@coorpacademy/components 11.16.5-alpha.2 → 11.17.0

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.
Files changed (122) hide show
  1. package/es/atom/image-upload/style.css +2 -0
  2. package/es/atom/radio-with-title/index.d.ts +13 -13
  3. package/es/atom/radio-with-title/index.d.ts.map +1 -1
  4. package/es/atom/radio-with-title/index.js +10 -12
  5. package/es/atom/radio-with-title/index.js.map +1 -1
  6. package/es/atom/radio-with-title/types.d.ts +25 -5
  7. package/es/atom/radio-with-title/types.d.ts.map +1 -1
  8. package/es/atom/radio-with-title/types.js +10 -1
  9. package/es/atom/radio-with-title/types.js.map +1 -1
  10. package/es/atom/title/index.d.ts +1 -0
  11. package/es/atom/title/index.d.ts.map +1 -1
  12. package/es/atom/title/index.js +24 -6
  13. package/es/atom/title/index.js.map +1 -1
  14. package/es/atom/title/style.css +31 -4
  15. package/es/molecule/brand-form-group/index.d.ts +110 -0
  16. package/es/molecule/brand-form-group/index.d.ts.map +1 -1
  17. package/es/molecule/brand-form-group/index.js +10 -3
  18. package/es/molecule/brand-form-group/index.js.map +1 -1
  19. package/es/molecule/brand-form-group/style.css +4 -0
  20. package/es/molecule/external-content-viewer/index.d.ts.map +1 -1
  21. package/es/molecule/external-content-viewer/index.js +19 -35
  22. package/es/molecule/external-content-viewer/index.js.map +1 -1
  23. package/es/molecule/select-multiple/index.js +1 -1
  24. package/es/molecule/select-multiple/index.js.map +1 -1
  25. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
  26. package/es/molecule/title-radio-wrapper/index.d.ts +68 -0
  27. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -0
  28. package/es/molecule/title-radio-wrapper/index.js +27 -0
  29. package/es/molecule/title-radio-wrapper/index.js.map +1 -0
  30. package/es/molecule/title-radio-wrapper/style.css +10 -0
  31. package/es/molecule/title-radio-wrapper/types.d.ts +72 -0
  32. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -0
  33. package/es/molecule/title-radio-wrapper/types.js +11 -0
  34. package/es/molecule/title-radio-wrapper/types.js.map +1 -0
  35. package/es/organism/brand-form/index.d.ts +110 -0
  36. package/es/organism/brand-form/index.d.ts.map +1 -1
  37. package/es/organism/brand-form/index.js +4 -3
  38. package/es/organism/brand-form/index.js.map +1 -1
  39. package/es/organism/brand-form/style.css +5 -0
  40. package/es/organism/rewards-form/index.d.ts +1 -0
  41. package/es/organism/select-opponents/index.d.ts +70 -0
  42. package/es/organism/select-opponents/index.d.ts.map +1 -0
  43. package/es/organism/select-opponents/index.js +27 -0
  44. package/es/organism/select-opponents/index.js.map +1 -0
  45. package/es/organism/select-opponents/style.css +11 -0
  46. package/es/organism/select-opponents/types.d.ts +70 -0
  47. package/es/organism/select-opponents/types.d.ts.map +1 -0
  48. package/es/organism/select-opponents/types.js +7 -0
  49. package/es/organism/select-opponents/types.js.map +1 -0
  50. package/es/organism/title-and-input/index.d.ts +117 -0
  51. package/es/organism/title-and-input/index.d.ts.map +1 -0
  52. package/es/organism/title-and-input/index.js +43 -0
  53. package/es/organism/title-and-input/index.js.map +1 -0
  54. package/es/organism/title-and-input/style.css +9 -0
  55. package/es/organism/title-and-input/types.d.ts +127 -0
  56. package/es/organism/title-and-input/types.d.ts.map +1 -0
  57. package/es/organism/title-and-input/types.js +12 -0
  58. package/es/organism/title-and-input/types.js.map +1 -0
  59. package/es/organism/wizard-contents/index.d.ts +111 -0
  60. package/es/template/back-office/brand-update/index.d.ts +110 -0
  61. package/lib/atom/image-upload/style.css +2 -0
  62. package/lib/atom/radio-with-title/index.d.ts +13 -13
  63. package/lib/atom/radio-with-title/index.d.ts.map +1 -1
  64. package/lib/atom/radio-with-title/index.js +10 -14
  65. package/lib/atom/radio-with-title/index.js.map +1 -1
  66. package/lib/atom/radio-with-title/types.d.ts +25 -5
  67. package/lib/atom/radio-with-title/types.d.ts.map +1 -1
  68. package/lib/atom/radio-with-title/types.js +19 -0
  69. package/lib/atom/radio-with-title/types.js.map +1 -1
  70. package/lib/atom/title/index.d.ts +1 -0
  71. package/lib/atom/title/index.d.ts.map +1 -1
  72. package/lib/atom/title/index.js +24 -6
  73. package/lib/atom/title/index.js.map +1 -1
  74. package/lib/atom/title/style.css +31 -4
  75. package/lib/molecule/brand-form-group/index.d.ts +110 -0
  76. package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
  77. package/lib/molecule/brand-form-group/index.js +11 -3
  78. package/lib/molecule/brand-form-group/index.js.map +1 -1
  79. package/lib/molecule/brand-form-group/style.css +4 -0
  80. package/lib/molecule/external-content-viewer/index.d.ts.map +1 -1
  81. package/lib/molecule/external-content-viewer/index.js +19 -35
  82. package/lib/molecule/external-content-viewer/index.js.map +1 -1
  83. package/lib/molecule/select-multiple/index.js +1 -1
  84. package/lib/molecule/select-multiple/index.js.map +1 -1
  85. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
  86. package/lib/molecule/title-radio-wrapper/index.d.ts +68 -0
  87. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -0
  88. package/lib/molecule/title-radio-wrapper/index.js +40 -0
  89. package/lib/molecule/title-radio-wrapper/index.js.map +1 -0
  90. package/lib/molecule/title-radio-wrapper/style.css +10 -0
  91. package/lib/molecule/title-radio-wrapper/types.d.ts +72 -0
  92. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -0
  93. package/lib/molecule/title-radio-wrapper/types.js +23 -0
  94. package/lib/molecule/title-radio-wrapper/types.js.map +1 -0
  95. package/lib/organism/brand-form/index.d.ts +110 -0
  96. package/lib/organism/brand-form/index.d.ts.map +1 -1
  97. package/lib/organism/brand-form/index.js +4 -3
  98. package/lib/organism/brand-form/index.js.map +1 -1
  99. package/lib/organism/brand-form/style.css +5 -0
  100. package/lib/organism/rewards-form/index.d.ts +1 -0
  101. package/lib/organism/select-opponents/index.d.ts +70 -0
  102. package/lib/organism/select-opponents/index.d.ts.map +1 -0
  103. package/lib/organism/select-opponents/index.js +40 -0
  104. package/lib/organism/select-opponents/index.js.map +1 -0
  105. package/lib/organism/select-opponents/style.css +11 -0
  106. package/lib/organism/select-opponents/types.d.ts +70 -0
  107. package/lib/organism/select-opponents/types.d.ts.map +1 -0
  108. package/lib/organism/select-opponents/types.js +18 -0
  109. package/lib/organism/select-opponents/types.js.map +1 -0
  110. package/lib/organism/title-and-input/index.d.ts +117 -0
  111. package/lib/organism/title-and-input/index.d.ts.map +1 -0
  112. package/lib/organism/title-and-input/index.js +57 -0
  113. package/lib/organism/title-and-input/index.js.map +1 -0
  114. package/lib/organism/title-and-input/style.css +9 -0
  115. package/lib/organism/title-and-input/types.d.ts +127 -0
  116. package/lib/organism/title-and-input/types.d.ts.map +1 -0
  117. package/lib/organism/title-and-input/types.js +25 -0
  118. package/lib/organism/title-and-input/types.js.map +1 -0
  119. package/lib/organism/wizard-contents/index.d.ts +111 -0
  120. package/lib/template/back-office/brand-update/index.d.ts +110 -0
  121. package/locales/.mtslconfig.json +1 -0
  122. package/package.json +2 -2
@@ -23,41 +23,25 @@ function ExternalContentViewer(props) {
23
23
  } = props;
24
24
  const isPdf = includes('.pdf', url);
25
25
  const googleViewer = `https://docs.google.com/viewerng/viewer?embedded=true&url=${url}`;
26
-
27
- if (startsWith('audio', contentType)) {
28
- return /*#__PURE__*/React.createElement("div", {
29
- className: podcastWrapperStyle[mode]
30
- }, /*#__PURE__*/React.createElement("div", {
31
- className: style.bgPodcast,
32
- style: {
33
- backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`
34
- }
35
- }), /*#__PURE__*/React.createElement("audio", {
36
- className: style.podcast,
37
- controls: true,
38
- controlsList: "nodownload",
39
- autoPlay: "",
40
- name: "media",
41
- "data-name": "external-content-podcast",
42
- preload: "auto"
43
- }, /*#__PURE__*/React.createElement("source", {
44
- src: url,
45
- type: contentType
46
- })));
47
- }
48
-
49
- if (startsWith('video', contentType) && mode === 'cockpit') {
50
- return /*#__PURE__*/React.createElement("video", {
51
- src: isPdf && mode === 'mobile' ? googleViewer : url,
52
- frameBorder: 0,
53
- className: iframeStyle[mode],
54
- allowFullScreen: true,
55
- "data-name": "external-content-iframe",
56
- autoPlay: false
57
- });
58
- }
59
-
60
- return /*#__PURE__*/React.createElement("iframe", {
26
+ return startsWith('audio', contentType) ? /*#__PURE__*/React.createElement("div", {
27
+ className: podcastWrapperStyle[mode]
28
+ }, /*#__PURE__*/React.createElement("div", {
29
+ className: style.bgPodcast,
30
+ style: {
31
+ backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`
32
+ }
33
+ }), /*#__PURE__*/React.createElement("audio", {
34
+ className: style.podcast,
35
+ controls: true,
36
+ controlsList: "nodownload",
37
+ autoPlay: "",
38
+ name: "media",
39
+ "data-name": "external-content-podcast",
40
+ preload: "auto"
41
+ }, /*#__PURE__*/React.createElement("source", {
42
+ src: url,
43
+ type: contentType
44
+ }))) : /*#__PURE__*/React.createElement("iframe", {
61
45
  src: isPdf && mode === 'mobile' ? googleViewer : url,
62
46
  frameBorder: 0,
63
47
  className: iframeStyle[mode],
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","startsWith","includes","PropTypes","style","podcastWrapperStyle","default","podcastWrapper","cockpit","podcastWrapperCockpit","mobile","iframeStyle","iframe","iframeCockpit","ExternalContentViewer","props","url","backgroundImageUrl","contentType","mode","isPdf","googleViewer","bgPodcast","backgroundImage","podcast","propTypes","string","isRequired"],"sources":["../../../src/molecule/external-content-viewer/index.js"],"sourcesContent":["import React from 'react';\nimport startsWith from 'lodash/fp/startsWith';\nimport includes from 'lodash/fp/includes';\nimport PropTypes from 'prop-types';\nimport style from './style.css';\n\nconst podcastWrapperStyle = {\n default: style.podcastWrapper,\n cockpit: style.podcastWrapperCockpit,\n mobile: style.podcastWrapper\n};\n\nconst iframeStyle = {\n default: style.iframe,\n cockpit: style.iframeCockpit,\n mobile: style.iframe\n};\n\nfunction ExternalContentViewer(props) {\n const {url, backgroundImageUrl, contentType, mode = 'default'} = props;\n const isPdf = includes('.pdf', url);\n const googleViewer = `https://docs.google.com/viewerng/viewer?embedded=true&url=${url}`;\n\n if (startsWith('audio', contentType)) {\n return (\n <div className={podcastWrapperStyle[mode]}>\n <div\n className={style.bgPodcast}\n style={{backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`}}\n />\n <audio\n className={style.podcast}\n controls\n controlsList=\"nodownload\"\n autoPlay=\"\"\n name=\"media\"\n data-name=\"external-content-podcast\"\n preload=\"auto\"\n >\n <source src={url} type={contentType} />\n </audio>\n </div>\n );\n }\n if (startsWith('video', contentType) && mode === 'cockpit') {\n return (\n <video\n src={isPdf && mode === 'mobile' ? googleViewer : url}\n frameBorder={0}\n className={iframeStyle[mode]}\n allowFullScreen\n data-name=\"external-content-iframe\"\n autoPlay={false}\n />\n );\n }\n\n return (\n <iframe\n src={isPdf && mode === 'mobile' ? googleViewer : url}\n frameBorder={0}\n className={iframeStyle[mode]}\n allowFullScreen\n data-name=\"external-content-iframe\"\n />\n );\n}\n\nExternalContentViewer.propTypes = {\n url: PropTypes.string.isRequired,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n};\n\nexport default ExternalContentViewer;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,sBAAvB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACG,cADW;EAE1BC,OAAO,EAAEJ,KAAK,CAACK,qBAFW;EAG1BC,MAAM,EAAEN,KAAK,CAACG;AAHY,CAA5B;AAMA,MAAMI,WAAW,GAAG;EAClBL,OAAO,EAAEF,KAAK,CAACQ,MADG;EAElBJ,OAAO,EAAEJ,KAAK,CAACS,aAFG;EAGlBH,MAAM,EAAEN,KAAK,CAACQ;AAHI,CAApB;;AAMA,SAASE,qBAAT,CAA+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AJjB;IAKE,aAAU;EALZ,EADF;AASD;;AAEDL,qBAAqB,CAACW,SAAtB,2CAAkC;EAChCT,GAAG,EAAEb,SAAS,CAACuB,MAAV,CAAiBC,UADU;EAEhCV,kBAAkB,EAAEd,SAAS,CAACuB,MAFE;EAGhCR,WAAW,EAAEf,SAAS,CAACuB,MAHS;EAIhCP,IAAI,EAAEhB,SAAS,CAACuB;AAJgB,CAAlC;AAOA,eAAeZ,qBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","startsWith","includes","PropTypes","style","podcastWrapperStyle","default","podcastWrapper","cockpit","podcastWrapperCockpit","mobile","iframeStyle","iframe","iframeCockpit","ExternalContentViewer","props","url","backgroundImageUrl","contentType","mode","isPdf","googleViewer","bgPodcast","backgroundImage","podcast","propTypes","string","isRequired"],"sources":["../../../src/molecule/external-content-viewer/index.js"],"sourcesContent":["import React from 'react';\nimport startsWith from 'lodash/fp/startsWith';\nimport includes from 'lodash/fp/includes';\nimport PropTypes from 'prop-types';\nimport style from './style.css';\n\nconst podcastWrapperStyle = {\n default: style.podcastWrapper,\n cockpit: style.podcastWrapperCockpit,\n mobile: style.podcastWrapper\n};\n\nconst iframeStyle = {\n default: style.iframe,\n cockpit: style.iframeCockpit,\n mobile: style.iframe\n};\n\nfunction ExternalContentViewer(props) {\n const {url, backgroundImageUrl, contentType, mode = 'default'} = props;\n const isPdf = includes('.pdf', url);\n const googleViewer = `https://docs.google.com/viewerng/viewer?embedded=true&url=${url}`;\n\n return startsWith('audio', contentType) ? (\n <div className={podcastWrapperStyle[mode]}>\n <div\n className={style.bgPodcast}\n style={{backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`}}\n />\n <audio\n className={style.podcast}\n controls\n controlsList=\"nodownload\"\n autoPlay=\"\"\n name=\"media\"\n data-name=\"external-content-podcast\"\n preload=\"auto\"\n >\n <source src={url} type={contentType} />\n </audio>\n </div>\n ) : (\n <iframe\n src={isPdf && mode === 'mobile' ? googleViewer : url}\n frameBorder={0}\n className={iframeStyle[mode]}\n allowFullScreen\n data-name=\"external-content-iframe\"\n />\n );\n}\n\nExternalContentViewer.propTypes = {\n url: PropTypes.string.isRequired,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n};\n\nexport default ExternalContentViewer;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,sBAAvB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACG,cADW;EAE1BC,OAAO,EAAEJ,KAAK,CAACK,qBAFW;EAG1BC,MAAM,EAAEN,KAAK,CAACG;AAHY,CAA5B;AAMA,MAAMI,WAAW,GAAG;EAClBL,OAAO,EAAEF,KAAK,CAACQ,MADG;EAElBJ,OAAO,EAAEJ,KAAK,CAACS,aAFG;EAGlBH,MAAM,EAAEN,KAAK,CAACQ;AAHI,CAApB;;AAMA,SAASE,qBAAT,CAA+BC,KAA/B,EAAsC;EACpC,MAAM;IAACC,GAAD;IAAMC,kBAAN;IAA0BC,WAA1B;IAAuCC,IAAI,GAAG;EAA9C,IAA2DJ,KAAjE;EACA,MAAMK,KAAK,GAAGlB,QAAQ,CAAC,MAAD,EAASc,GAAT,CAAtB;EACA,MAAMK,YAAY,GAAI,6DAA4DL,GAAI,EAAtF;EAEA,OAAOf,UAAU,CAAC,OAAD,EAAUiB,WAAV,CAAV,gBACL;IAAK,SAAS,EAAEb,mBAAmB,CAACc,IAAD;EAAnC,gBACE;IACE,SAAS,EAAEf,KAAK,CAACkB,SADnB;IAEE,KAAK,EAAE;MAACC,eAAe,EAAEN,kBAAkB,IAAK,OAAMA,kBAAmB;IAAlE;EAFT,EADF,eAKE;IACE,SAAS,EAAEb,KAAK,CAACoB,OADnB;IAEE,QAAQ,MAFV;IAGE,YAAY,EAAC,YAHf;IAIE,QAAQ,EAAC,EAJX;IAKE,IAAI,EAAC,OALP;IAME,aAAU,0BANZ;IAOE,OAAO,EAAC;EAPV,gBASE;IAAQ,GAAG,EAAER,GAAb;IAAkB,IAAI,EAAEE;EAAxB,EATF,CALF,CADK,gBAmBL;IACE,GAAG,EAAEE,KAAK,IAAID,IAAI,KAAK,QAAlB,GAA6BE,YAA7B,GAA4CL,GADnD;IAEE,WAAW,EAAE,CAFf;IAGE,SAAS,EAAEL,WAAW,CAACQ,IAAD,CAHxB;IAIE,eAAe,MAJjB;IAKE,aAAU;EALZ,EAnBF;AA2BD;;AAEDL,qBAAqB,CAACW,SAAtB,2CAAkC;EAChCT,GAAG,EAAEb,SAAS,CAACuB,MAAV,CAAiBC,UADU;EAEhCV,kBAAkB,EAAEd,SAAS,CAACuB,MAFE;EAGhCR,WAAW,EAAEf,SAAS,CAACuB,MAHS;EAIhCP,IAAI,EAAEhB,SAAS,CAACuB;AAJgB,CAAlC;AAOA,eAAeZ,qBAAf"}
@@ -154,7 +154,7 @@ const SelectMultiple = ({
154
154
  const isActive = isOpened === true;
155
155
  const titleView = title ? /*#__PURE__*/React.createElement("span", {
156
156
  className: classnames(style.title, isCMTheme && selection && style.titleWithSelection, isCMTheme && _isEmpty(selection) && style.noValue, isActive && style.active)
157
- }, title, isCMTheme ? /*#__PURE__*/React.createElement("div", {
157
+ }, title, description && isCMTheme ? /*#__PURE__*/React.createElement("div", {
158
158
  className: style.infoIconWrapper
159
159
  }, /*#__PURE__*/React.createElement(InfoIcon, {
160
160
  className: style.infoIcon
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useState","useEffect","useRef","useCallback","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","TitledCheckbox","Provider","Checkbox","getClassState","style","themeStyle","setup","cockpit","sidebar","coorpmanager","useChoices","options","choicesRef","current","getChoices","setChoices","choice","choices","i","selected","filter","c","CMMultipleView","multiple","onChange","handleChange","item","name","SelectMultiple","title","theme","placeholder","description","hint","onError","modified","error","disabled","skin","isOpened","updateIsOpened","nodeRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","document","addEventListener","removeEventListener","isCMTheme","handleOnClickOnListElement","lines","convert","cap","selection","isActive","titleView","titleWithSelection","noValue","active","infoIconWrapper","infoIcon","descriptionLabel","hintView","hideHint","__html","mainClass","default","showPlaceholder","behaviourClassName","errorIconView","errorIcon","select","noselection","iconsWrapper","flex","clicked","color","arrow","down","activeChoices","list","contextTypes","childContextTypes","propTypes","bool","func","string","arrayOf","oneOf"],"sources":["../../../src/molecule/select-multiple/index.js"],"sourcesContent":["import React, {useState, useEffect, useRef, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {map, pipe, join, filter, get, set, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport TitledCheckbox from '../titled-checkbox';\nimport Provider from '../../atom/provider';\nimport Checkbox from '../../atom/input-checkbox';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n cockpit: style.cockpit,\n sidebar: style.sidebar,\n coorpmanager: style.coorpmanager\n};\n\nexport const useChoices = options => {\n const choicesRef = {current: options};\n\n const getChoices = () => {\n return choicesRef.current;\n };\n\n const setChoices = choice => {\n const choices = set(`[${choice.i}].selected`, !choice.selected, getChoices());\n\n choicesRef.current = choices.filter(c => c.selected);\n };\n\n return [getChoices, setChoices];\n};\n\nconst CMMultipleView = ({multiple, choice, onChange}) => {\n const handleChange = useCallback(() => {\n return onChange(choice);\n }, [onChange, choice]);\n\n return multiple ? (\n <div className={style.item}>\n <Checkbox\n titleStyle=\"inherit\"\n checked={choice.selected}\n onChange={handleChange}\n noLabelMargins\n title={choice.name}\n />\n </div>\n ) : (\n <span className={style.item} title={choice.name} data-name={`${choice.name}-language`}>\n {choice.name}\n </span>\n );\n};\n\nconst SelectMultiple = (\n {\n title,\n options,\n theme,\n placeholder,\n description,\n hint,\n multiple,\n onChange,\n onError,\n modified = false,\n error = '',\n disabled = false\n },\n {skin}\n) => {\n const [isOpened, updateIsOpened] = useState(false);\n const [getChoices, setChoices] = useChoices(options);\n const nodeRef = useRef(null);\n\n const defaultColor = get('common.primary', skin);\n const black = get('common.black', skin);\n\n const handleOnClick = useCallback(\n e => {\n if (disabled) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n updateIsOpened(prev => !prev);\n },\n [disabled]\n );\n\n const closeHandle = useCallback(e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n updateIsOpened(false);\n }\n }, []);\n\n const handleChange = useCallback(\n choice => {\n // if multiple prop is turned on\n // we return all selected choices\n if (multiple) {\n setChoices(choice);\n return onChange(getChoices());\n }\n updateIsOpened(false);\n return onChange(choice);\n },\n [multiple, onChange, setChoices, getChoices]\n );\n\n useEffect(() => {\n document.addEventListener('click', closeHandle);\n document.addEventListener('touchstart', closeHandle);\n\n return () => {\n document.removeEventListener('click', closeHandle);\n document.removeEventListener('touchstart', closeHandle);\n };\n }, [closeHandle]);\n\n const isCMTheme = theme === 'coorpmanager';\n\n const handleOnClickOnListElement = choice => () => handleChange(choice);\n\n const lines = map.convert({cap: false})((choice, i) => {\n return (\n <li\n key={i}\n className={style.choice}\n onClick={isCMTheme && !multiple ? handleOnClickOnListElement({...choice, i}) : null}\n >\n {isCMTheme ? (\n <CMMultipleView multiple={multiple} choice={{...choice, i}} onChange={handleChange} />\n ) : (\n <TitledCheckbox\n onToggle={handleChange}\n choice={{...choice, i}}\n background={defaultColor}\n />\n )}\n </li>\n );\n }, options);\n\n const selection = pipe(filter({selected: true}), map('name'), join(', '))(options);\n\n const isActive = isOpened === true;\n\n const titleView = title ? (\n <span\n className={classnames(\n style.title,\n isCMTheme && selection && style.titleWithSelection,\n isCMTheme && isEmpty(selection) && style.noValue,\n isActive && style.active\n )}\n >\n {title}\n {isCMTheme ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null}\n </span>\n ) : null;\n\n const hintView = isCMTheme ? (\n <div\n className={classnames(style.hint, isActive && style.hideHint)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n\n const mainClass = theme ? themeStyle[theme] : style.default;\n const showPlaceholder = isCMTheme && isActive;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n\n const errorIconView = error ? <ErrorIcon onClick={onError} className={style.errorIcon} /> : null;\n\n return (\n <div\n className={classnames(mainClass, behaviourClassName, disabled && style.disabled)}\n ref={nodeRef}\n >\n <label>\n {!isCMTheme && titleView}\n <div\n className={style.select}\n title={selection || placeholder}\n data-name={`select-languages`}\n onClick={handleOnClick}\n >\n {isCMTheme && titleView}\n <span\n className={classnames(\n style.selection,\n isCMTheme && isEmpty(selection) && style.noselection\n )}\n >\n {selection || !isCMTheme || (showPlaceholder && placeholder) || null}\n </span>\n {isCMTheme ? (\n <div className={style.iconsWrapper}>\n <div className={style.flex}>{errorIconView}</div>\n <div className={classnames(style.flex, isActive && style.clicked)}>\n <ArrowDown\n style={{color: black}}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n </div>\n </div>\n ) : (\n <ArrowDown\n style={{color: black}}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n )}\n </div>\n <div className={classnames(style.choices, isActive && style.activeChoices)}>\n <ul className={style.list}>{lines}</ul>\n </div>\n </label>\n {!isCMTheme ? <div className={style.description}>{description}</div> : null}\n {hintView}\n </div>\n );\n};\n\nSelectMultiple.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCMMultipleView.propTypes = {\n multiple: PropTypes.bool,\n choice: TitledCheckbox.propTypes.choice,\n onChange: PropTypes.func\n};\n\nSelectMultiple.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n description: PropTypes.string,\n hint: PropTypes.string,\n options: PropTypes.arrayOf(TitledCheckbox.propTypes.choice),\n onChange: PropTypes.func,\n onError: PropTypes.func,\n multiple: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle))\n};\n\nexport default SelectMultiple;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,MAApC,EAA4CC,WAA5C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,QAAP,MAAqB,2BAArB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEF,KAAK,CAACE,KADI;EAEjBC,OAAO,EAAEH,KAAK,CAACG,OAFE;EAGjBC,OAAO,EAAEJ,KAAK,CAACI,OAHE;EAIjBC,YAAY,EAAEL,KAAK,CAACK;AAJH,CAAnB;AAOA,OAAO,MAAMC,UAAU,GAAGC,OAAO,IAAI;EACnC,MAAMC,UAAU,GAAG;IAACC,OAAO,EAAEF;EAAV,CAAnB;;EAEA,MAAMG,UAAU,GAAG,MAAM;IACvB,OAAOF,UAAU,CAACC,OAAlB;EACD,CAFD;;EAIA,MAAME,UAAU,GAAGC,MAAM,IAAI;IAC3B,MAAMC,OAAO,GAAG,KAAK,IAAGD,MA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KAA5B,CADF,CAlCF,CAJF,EA0CG,CAACF,SAAD,gBAAa;IAAK,SAAS,EAAEnD,KAAK,CAAC4B;EAAtB,GAAoCA,WAApC,CAAb,GAAsE,IA1CzE,EA2CGqC,QA3CH,CADF;AA+CD,CApLD;;AAsLAzC,cAAc,CAAC4D,YAAf,GAA8B;EAC5BlD,IAAI,EAAErC,QAAQ,CAACwF,iBAAT,CAA2BnD;AADL,CAA9B;AAIAhB,cAAc,CAACoE,SAAf,2CAA2B;EACzBnE,QAAQ,EAAE/B,SAAS,CAACmG,IADK;EAEzB3E,MAAM,EAAEhB,cAAc,CAAC0F,SAAf,CAAyB1E,MAFR;EAGzBQ,QAAQ,EAAEhC,SAAS,CAACoG;AAHK,CAA3B;AAMAhE,cAAc,CAAC8D,SAAf,2CAA2B;EACzB7D,KAAK,EAAErC,SAAS,CAACqG,MADQ;EAEzB9D,WAAW,EAAEvC,SAAS,CAACqG,MAFE;EAGzB7D,WAAW,EAAExC,SAAS,CAACqG,MAHE;EAIzB5D,IAAI,EAAEzC,SAAS,CAACqG,MAJS;EAKzBlF,OAAO,EAAEnB,SAAS,CAACsG,OAAV,CAAkB9F,cAAc,CAAC0F,SAAf,CAAyB1E,MAA3C,CALgB;EAMzBQ,QAAQ,EAAEhC,SAAS,CAACoG,IANK;EAOzB1D,OAAO,EAAE1C,SAAS,CAACoG,IAPM;EAQzBrE,QAAQ,EAAE/B,SAAS,CAACmG,IARK;EASzBxD,QAAQ,EAAE3C,SAAS,CAACmG,IATK;EAUzBtD,QAAQ,EAAE7C,SAAS,CAACmG,IAVK;EAWzBvD,KAAK,EAAE5C,SAAS,CAACqG,MAXQ;EAYzB/D,KAAK,EAAEtC,SAAS,CAACuG,KAAV,CAAgB,MAAK1F,UAAL,CAAhB;AAZkB,CAA3B;AAeA,eAAeuB,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useState","useEffect","useRef","useCallback","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","TitledCheckbox","Provider","Checkbox","getClassState","style","themeStyle","setup","cockpit","sidebar","coorpmanager","useChoices","options","choicesRef","current","getChoices","setChoices","choice","choices","i","selected","filter","c","CMMultipleView","multiple","onChange","handleChange","item","name","SelectMultiple","title","theme","placeholder","description","hint","onError","modified","error","disabled","skin","isOpened","updateIsOpened","nodeRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","document","addEventListener","removeEventListener","isCMTheme","handleOnClickOnListElement","lines","convert","cap","selection","isActive","titleView","titleWithSelection","noValue","active","infoIconWrapper","infoIcon","descriptionLabel","hintView","hideHint","__html","mainClass","default","showPlaceholder","behaviourClassName","errorIconView","errorIcon","select","noselection","iconsWrapper","flex","clicked","color","arrow","down","activeChoices","list","contextTypes","childContextTypes","propTypes","bool","func","string","arrayOf","oneOf"],"sources":["../../../src/molecule/select-multiple/index.js"],"sourcesContent":["import React, {useState, useEffect, useRef, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {map, pipe, join, filter, get, set, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport TitledCheckbox from '../titled-checkbox';\nimport Provider from '../../atom/provider';\nimport Checkbox from '../../atom/input-checkbox';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n cockpit: style.cockpit,\n sidebar: style.sidebar,\n coorpmanager: style.coorpmanager\n};\n\nexport const useChoices = options => {\n const choicesRef = {current: options};\n\n const getChoices = () => {\n return choicesRef.current;\n };\n\n const setChoices = choice => {\n const choices = set(`[${choice.i}].selected`, !choice.selected, getChoices());\n\n choicesRef.current = choices.filter(c => c.selected);\n };\n\n return [getChoices, setChoices];\n};\n\nconst CMMultipleView = ({multiple, choice, onChange}) => {\n const handleChange = useCallback(() => {\n return onChange(choice);\n }, [onChange, choice]);\n\n return multiple ? (\n <div className={style.item}>\n <Checkbox\n titleStyle=\"inherit\"\n checked={choice.selected}\n onChange={handleChange}\n noLabelMargins\n title={choice.name}\n />\n </div>\n ) : (\n <span className={style.item} title={choice.name} data-name={`${choice.name}-language`}>\n {choice.name}\n </span>\n );\n};\n\nconst SelectMultiple = (\n {\n title,\n options,\n theme,\n placeholder,\n description,\n hint,\n multiple,\n onChange,\n onError,\n modified = false,\n error = '',\n disabled = false\n },\n {skin}\n) => {\n const [isOpened, updateIsOpened] = useState(false);\n const [getChoices, setChoices] = useChoices(options);\n const nodeRef = useRef(null);\n\n const defaultColor = get('common.primary', skin);\n const black = get('common.black', skin);\n\n const handleOnClick = useCallback(\n e => {\n if (disabled) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n updateIsOpened(prev => !prev);\n },\n [disabled]\n );\n\n const closeHandle = useCallback(e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n updateIsOpened(false);\n }\n }, []);\n\n const handleChange = useCallback(\n choice => {\n // if multiple prop is turned on\n // we return all selected choices\n if (multiple) {\n setChoices(choice);\n return onChange(getChoices());\n }\n updateIsOpened(false);\n return onChange(choice);\n },\n [multiple, onChange, setChoices, getChoices]\n );\n\n useEffect(() => {\n document.addEventListener('click', closeHandle);\n document.addEventListener('touchstart', closeHandle);\n\n return () => {\n document.removeEventListener('click', closeHandle);\n document.removeEventListener('touchstart', closeHandle);\n };\n }, [closeHandle]);\n\n const isCMTheme = theme === 'coorpmanager';\n\n const handleOnClickOnListElement = choice => () => handleChange(choice);\n\n const lines = map.convert({cap: false})((choice, i) => {\n return (\n <li\n key={i}\n className={style.choice}\n onClick={isCMTheme && !multiple ? handleOnClickOnListElement({...choice, i}) : null}\n >\n {isCMTheme ? (\n <CMMultipleView multiple={multiple} choice={{...choice, i}} onChange={handleChange} />\n ) : (\n <TitledCheckbox\n onToggle={handleChange}\n choice={{...choice, i}}\n background={defaultColor}\n />\n )}\n </li>\n );\n }, options);\n\n const selection = pipe(filter({selected: true}), map('name'), join(', '))(options);\n\n const isActive = isOpened === true;\n\n const titleView = title ? (\n <span\n className={classnames(\n style.title,\n isCMTheme && selection && style.titleWithSelection,\n isCMTheme && isEmpty(selection) && style.noValue,\n isActive && style.active\n )}\n >\n {title}\n {description && isCMTheme ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null}\n </span>\n ) : null;\n\n const hintView = isCMTheme ? (\n <div\n className={classnames(style.hint, isActive && style.hideHint)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n\n const mainClass = theme ? themeStyle[theme] : style.default;\n const showPlaceholder = isCMTheme && isActive;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n\n const errorIconView = error ? <ErrorIcon onClick={onError} className={style.errorIcon} /> : null;\n\n return (\n <div\n className={classnames(mainClass, behaviourClassName, disabled && style.disabled)}\n ref={nodeRef}\n >\n <label>\n {!isCMTheme && titleView}\n <div\n className={style.select}\n title={selection || placeholder}\n data-name={`select-languages`}\n onClick={handleOnClick}\n >\n {isCMTheme && titleView}\n <span\n className={classnames(\n style.selection,\n isCMTheme && isEmpty(selection) && style.noselection\n )}\n >\n {selection || !isCMTheme || (showPlaceholder && placeholder) || null}\n </span>\n {isCMTheme ? (\n <div className={style.iconsWrapper}>\n <div className={style.flex}>{errorIconView}</div>\n <div className={classnames(style.flex, isActive && style.clicked)}>\n <ArrowDown\n style={{color: black}}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n </div>\n </div>\n ) : (\n <ArrowDown\n style={{color: black}}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n )}\n </div>\n <div className={classnames(style.choices, isActive && style.activeChoices)}>\n <ul className={style.list}>{lines}</ul>\n </div>\n </label>\n {!isCMTheme ? <div className={style.description}>{description}</div> : null}\n {hintView}\n </div>\n );\n};\n\nSelectMultiple.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCMMultipleView.propTypes = {\n multiple: PropTypes.bool,\n choice: TitledCheckbox.propTypes.choice,\n onChange: PropTypes.func\n};\n\nSelectMultiple.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n description: PropTypes.string,\n hint: PropTypes.string,\n options: PropTypes.arrayOf(TitledCheckbox.propTypes.choice),\n onChange: PropTypes.func,\n onError: PropTypes.func,\n multiple: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle))\n};\n\nexport default SelectMultiple;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,MAApC,EAA4CC,WAA5C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,QAAP,MAAqB,2BAArB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEF,KAAK,CAACE,KADI;EAEjBC,OAAO,EAAEH,KAAK,CAACG,OAFE;EAGjBC,OAAO,EAAEJ,KAAK,CAACI,OAHE;EAIjBC,YAAY,EAAEL,KAAK,CAACK;AAJH,CAAnB;AAOA,OAAO,MAAMC,UAAU,GAAGC,OAAO,IAAI;EACnC,MAAMC,UAAU,GAAG;IAACC,OAAO,EAAEF;EAAV,CAAnB;;EAE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AAgB,MAAK1F,UAAL,CAAhB;AAZkB,CAA3B;AAeA,eAAeuB,cAAf"}
@@ -15,6 +15,7 @@ declare namespace TitleAndCheckBoxWrapper {
15
15
  subtitle: PropTypes.Requireable<string>;
16
16
  type: PropTypes.Requireable<string>;
17
17
  'data-name': PropTypes.Requireable<string>;
18
+ titleSize: PropTypes.Requireable<string>;
18
19
  subtitleSize: PropTypes.Requireable<string>;
19
20
  }>>;
20
21
  const child: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
@@ -0,0 +1,68 @@
1
+ /// <reference types="react" />
2
+ import { TitleRadioWrapperProps } from './types';
3
+ declare const TitleRadioWrapper: {
4
+ (props: TitleRadioWrapperProps): JSX.Element;
5
+ propTypes: {
6
+ radioWithTitle: import("prop-types").Requireable<import("prop-types").InferProps<{
7
+ title: import("prop-types").Validator<NonNullable<import("prop-types").InferProps<{
8
+ title: import("prop-types").Requireable<string>;
9
+ subtitle: import("prop-types").Requireable<string>;
10
+ type: import("prop-types").Requireable<string>;
11
+ 'data-name': import("prop-types").Requireable<string>;
12
+ titleSize: import("prop-types").Requireable<string>;
13
+ subtitleSize: import("prop-types").Requireable<string>;
14
+ }>>>;
15
+ name: import("prop-types").Requireable<string>;
16
+ checked: import("prop-types").Requireable<boolean>;
17
+ onChange: import("prop-types").Validator<(...args: any[]) => any>;
18
+ 'aria-label': import("prop-types").Requireable<string>;
19
+ 'data-name': import("prop-types").Requireable<string>;
20
+ }>>;
21
+ field: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
22
+ name: import("prop-types").Requireable<string>;
23
+ onChange: import("prop-types").Requireable<(...args: any[]) => any>;
24
+ onReset: import("prop-types").Requireable<(...args: any[]) => any>;
25
+ imageTypes: import("prop-types").Requireable<any[]>;
26
+ error: import("prop-types").Requireable<string>;
27
+ buttonAriaLabel: import("prop-types").Requireable<string>;
28
+ errorButtonLabel: import("prop-types").Requireable<string>;
29
+ labelLink: import("prop-types").Requireable<string>;
30
+ hrefLink: import("prop-types").Requireable<string>;
31
+ title: import("prop-types").Requireable<string>;
32
+ description: import("prop-types").Requireable<string>;
33
+ uploadLabel: import("prop-types").Requireable<string>;
34
+ previewLabel: import("prop-types").Requireable<string>;
35
+ previewContent: import("prop-types").Requireable<import("prop-types").InferProps<{
36
+ type: import("prop-types").Requireable<string>;
37
+ src: import("prop-types").Requireable<string>;
38
+ label: import("prop-types").Requireable<string>;
39
+ }>>;
40
+ loading: import("prop-types").Requireable<boolean>;
41
+ modified: import("prop-types").Requireable<boolean>;
42
+ disabled: import("prop-types").Requireable<boolean>;
43
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
44
+ pdfButtonLabel: import("prop-types").Requireable<string>;
45
+ pdfButtonAriaLabel: import("prop-types").Requireable<string>;
46
+ }> | import("prop-types").InferProps<{
47
+ title: import("prop-types").Requireable<string>;
48
+ placeholder: import("prop-types").Requireable<string>;
49
+ description: import("prop-types").Requireable<string>;
50
+ hint: import("prop-types").Requireable<string>;
51
+ options: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
52
+ selected: import("prop-types").Validator<boolean>;
53
+ name: import("prop-types").Validator<string>;
54
+ value: import("prop-types").Requireable<string>;
55
+ }>>[]>;
56
+ onChange: import("prop-types").Requireable<(...args: any[]) => any>;
57
+ onError: import("prop-types").Requireable<(...args: any[]) => any>;
58
+ multiple: import("prop-types").Requireable<boolean>;
59
+ modified: import("prop-types").Requireable<boolean>;
60
+ disabled: import("prop-types").Requireable<boolean>;
61
+ error: import("prop-types").Requireable<string>;
62
+ theme: import("prop-types").Requireable<string>;
63
+ }> | null | undefined>>;
64
+ childType: import("prop-types").Requireable<string>;
65
+ };
66
+ };
67
+ export default TitleRadioWrapper;
68
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/title-radio-wrapper/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAW1D,QAAA,MAAM,iBAAiB;YAAW,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvD,CAAC;AAIF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import RadioWithTitle from '../../atom/radio-with-title';
3
+ import SelectMultiple from '../select-multiple';
4
+ import ImageUpload from '../../atom/image-upload';
5
+ import propTypes from './types';
6
+ import style from './style.css';
7
+
8
+ const buildInput = (childType, field) => {
9
+ return childType === 'select-multiple' ? /*#__PURE__*/React.createElement(SelectMultiple, field) : /*#__PURE__*/React.createElement(ImageUpload, field);
10
+ };
11
+
12
+ const TitleRadioWrapper = props => {
13
+ const {
14
+ radioWithTitle,
15
+ field,
16
+ childType
17
+ } = props;
18
+ return /*#__PURE__*/React.createElement("div", {
19
+ className: style.container
20
+ }, radioWithTitle ? /*#__PURE__*/React.createElement(RadioWithTitle, radioWithTitle) : null, /*#__PURE__*/React.createElement("div", {
21
+ className: style.field
22
+ }, buildInput(childType, field)));
23
+ };
24
+
25
+ TitleRadioWrapper.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
26
+ export default TitleRadioWrapper;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","RadioWithTitle","SelectMultiple","ImageUpload","propTypes","style","buildInput","childType","field","TitleRadioWrapper","props","radioWithTitle","container"],"sources":["../../../src/molecule/title-radio-wrapper/index.tsx"],"sourcesContent":["import React from 'react';\nimport RadioWithTitle from '../../atom/radio-with-title';\nimport SelectMultiple from '../select-multiple';\nimport ImageUpload from '../../atom/image-upload';\nimport propTypes, {TitleRadioWrapperProps} from './types';\nimport style from './style.css';\n\nconst buildInput = (childType: string, field: any) => {\n return childType === 'select-multiple' ? (\n <SelectMultiple {...field} />\n ) : (\n <ImageUpload {...field} />\n );\n};\n\nconst TitleRadioWrapper = (props: TitleRadioWrapperProps) => {\n const {radioWithTitle, field, childType} = props;\n return (\n <div className={style.container}>\n {radioWithTitle ? <RadioWithTitle {...radioWithTitle} /> : null}\n <div className={style.field}>{buildInput(childType, field)}</div>\n </div>\n );\n};\n\nTitleRadioWrapper.propTypes = propTypes;\n\nexport default TitleRadioWrapper;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,SAAP,MAAgD,SAAhD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,UAAU,GAAG,CAACC,SAAD,EAAoBC,KAApB,KAAmC;EACpD,OAAOD,SAAS,KAAK,iBAAd,gBACL,oBAAC,cAAD,EAAoBC,KAApB,CADK,gBAGL,oBAAC,WAAD,EAAiBA,KAAjB,CAHF;AAKD,CAND;;AAQA,MAAMC,iBAAiB,GAAIC,KAAD,IAAmC;EAC3D,MAAM;IAACC,cAAD;IAAiBH,KAAjB;IAAwBD;EAAxB,IAAqCG,KAA3C;EACA,oBACE;IAAK,SAAS,EAAEL,KAAK,CAACO;EAAtB,GACGD,cAAc,gBAAG,oBAAC,cAAD,EAAoBA,cAApB,CAAH,GAA4C,IAD7D,eAEE;IAAK,SAAS,EAAEN,KAAK,CAACG;EAAtB,GAA8BF,UAAU,CAACC,SAAD,EAAYC,KAAZ,CAAxC,CAFF,CADF;AAMD,CARD;;AAUAC,iBAAiB,CAACL,SAAlB,2CAA8BA,SAA9B;AAEA,eAAeK,iBAAf"}
@@ -0,0 +1,10 @@
1
+ .container {
2
+ display: flex;
3
+ gap: 16px;
4
+ flex-direction: column;
5
+ }
6
+
7
+ .field {
8
+ margin-left: 40px;
9
+ max-width: 300px;
10
+ }
@@ -0,0 +1,72 @@
1
+ import PropTypes from 'prop-types';
2
+ import ImageUpload from '../../atom/image-upload';
3
+ import { RadioWithTitleProps } from '../../atom/radio-with-title/types';
4
+ import SelectMultiple from '../select-multiple';
5
+ declare const propTypes: {
6
+ radioWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
7
+ title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
8
+ title: PropTypes.Requireable<string>;
9
+ subtitle: PropTypes.Requireable<string>;
10
+ type: PropTypes.Requireable<string>;
11
+ 'data-name': PropTypes.Requireable<string>;
12
+ titleSize: PropTypes.Requireable<string>;
13
+ subtitleSize: PropTypes.Requireable<string>;
14
+ }>>>;
15
+ name: PropTypes.Requireable<string>;
16
+ checked: PropTypes.Requireable<boolean>;
17
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
18
+ 'aria-label': PropTypes.Requireable<string>;
19
+ 'data-name': PropTypes.Requireable<string>;
20
+ }>>;
21
+ field: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
22
+ name: PropTypes.Requireable<string>;
23
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
24
+ onReset: PropTypes.Requireable<(...args: any[]) => any>;
25
+ imageTypes: PropTypes.Requireable<any[]>;
26
+ error: PropTypes.Requireable<string>;
27
+ buttonAriaLabel: PropTypes.Requireable<string>;
28
+ errorButtonLabel: PropTypes.Requireable<string>;
29
+ labelLink: PropTypes.Requireable<string>;
30
+ hrefLink: PropTypes.Requireable<string>;
31
+ title: PropTypes.Requireable<string>;
32
+ description: PropTypes.Requireable<string>;
33
+ uploadLabel: PropTypes.Requireable<string>;
34
+ previewLabel: PropTypes.Requireable<string>;
35
+ previewContent: PropTypes.Requireable<PropTypes.InferProps<{
36
+ type: PropTypes.Requireable<string>;
37
+ src: PropTypes.Requireable<string>;
38
+ label: PropTypes.Requireable<string>;
39
+ }>>;
40
+ loading: PropTypes.Requireable<boolean>;
41
+ modified: PropTypes.Requireable<boolean>;
42
+ disabled: PropTypes.Requireable<boolean>;
43
+ children: PropTypes.Requireable<(...args: any[]) => any>;
44
+ pdfButtonLabel: PropTypes.Requireable<string>;
45
+ pdfButtonAriaLabel: PropTypes.Requireable<string>;
46
+ }> | PropTypes.InferProps<{
47
+ title: PropTypes.Requireable<string>;
48
+ placeholder: PropTypes.Requireable<string>;
49
+ description: PropTypes.Requireable<string>;
50
+ hint: PropTypes.Requireable<string>;
51
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
52
+ selected: PropTypes.Validator<boolean>;
53
+ name: PropTypes.Validator<string>;
54
+ value: PropTypes.Requireable<string>;
55
+ }>>[]>;
56
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
57
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
58
+ multiple: PropTypes.Requireable<boolean>;
59
+ modified: PropTypes.Requireable<boolean>;
60
+ disabled: PropTypes.Requireable<boolean>;
61
+ error: PropTypes.Requireable<string>;
62
+ theme: PropTypes.Requireable<string>;
63
+ }> | null | undefined>>;
64
+ childType: PropTypes.Requireable<string>;
65
+ };
66
+ export declare type TitleRadioWrapperProps = {
67
+ radioWithTitle: RadioWithTitleProps;
68
+ field: typeof SelectMultiple.propTypes | typeof ImageUpload.propTypes;
69
+ childType: 'select-multiple' | 'massive-upload';
70
+ };
71
+ export default propTypes;
72
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/title-radio-wrapper/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAC,mBAAmB,EAAC,MAAM,mCAAmC,CAAC;AACtE,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAEhD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOd,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,cAAc,EAAE,mBAAmB,CAAC;IACpC,KAAK,EAAE,OAAO,cAAc,CAAC,SAAS,GAAG,OAAO,WAAW,CAAC,SAAS,CAAC;IACtE,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;CACjD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import PropTypes from 'prop-types';
2
+ import ImageUpload from '../../atom/image-upload';
3
+ import RadioWithTitle from '../../atom/radio-with-title';
4
+ import SelectMultiple from '../select-multiple';
5
+ const propTypes = {
6
+ radioWithTitle: PropTypes.shape(RadioWithTitle.propTypes),
7
+ field: PropTypes.oneOfType([PropTypes.shape(SelectMultiple.propTypes), PropTypes.shape(ImageUpload.propTypes)]),
8
+ childType: PropTypes.oneOf(['select-multiple', 'massive-upload'])
9
+ };
10
+ export default propTypes;
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":["PropTypes","ImageUpload","RadioWithTitle","SelectMultiple","propTypes","radioWithTitle","shape","field","oneOfType","childType","oneOf"],"sources":["../../../src/molecule/title-radio-wrapper/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ImageUpload from '../../atom/image-upload';\nimport RadioWithTitle from '../../atom/radio-with-title';\nimport {RadioWithTitleProps} from '../../atom/radio-with-title/types';\nimport SelectMultiple from '../select-multiple';\n\nconst propTypes = {\n radioWithTitle: PropTypes.shape(RadioWithTitle.propTypes),\n field: PropTypes.oneOfType([\n PropTypes.shape(SelectMultiple.propTypes),\n PropTypes.shape(ImageUpload.propTypes)\n ]),\n childType: PropTypes.oneOf(['select-multiple', 'massive-upload'])\n};\n\nexport type TitleRadioWrapperProps = {\n radioWithTitle: RadioWithTitleProps;\n field: typeof SelectMultiple.propTypes | typeof ImageUpload.propTypes;\n childType: 'select-multiple' | 'massive-upload';\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AAEA,OAAOC,cAAP,MAA2B,oBAA3B;AAEA,MAAMC,SAAS,GAAG;EAChBC,cAAc,EAAEL,SAAS,CAACM,KAAV,CAAgBJ,cAAc,CAACE,SAA/B,CADA;EAEhBG,KAAK,EAAEP,SAAS,CAACQ,SAAV,CAAoB,CACzBR,SAAS,CAACM,KAAV,CAAgBH,cAAc,CAACC,SAA/B,CADyB,EAEzBJ,SAAS,CAACM,KAAV,CAAgBL,WAAW,CAACG,SAA5B,CAFyB,CAApB,CAFS;EAMhBK,SAAS,EAAET,SAAS,CAACU,KAAV,CAAgB,CAAC,iBAAD,EAAoB,gBAApB,CAAhB;AANK,CAAlB;AAeA,eAAeN,SAAf"}
@@ -493,6 +493,116 @@ declare namespace BrandForm {
493
493
  theme: PropTypes.Requireable<string>;
494
494
  titleStyle: PropTypes.Requireable<string>;
495
495
  }> | null | undefined)[]>;
496
+ }> | PropTypes.InferProps<{
497
+ type: PropTypes.Requireable<string>;
498
+ title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
499
+ title: PropTypes.Requireable<string>;
500
+ subtitle: PropTypes.Requireable<string>;
501
+ type: PropTypes.Requireable<string>;
502
+ 'data-name': PropTypes.Requireable<string>;
503
+ titleSize: PropTypes.Requireable<string>;
504
+ subtitleSize: PropTypes.Requireable<string>;
505
+ }>>>;
506
+ field: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
507
+ title: PropTypes.Requireable<string>;
508
+ placeholder: PropTypes.Requireable<string>;
509
+ description: PropTypes.Requireable<string>;
510
+ hint: PropTypes.Requireable<string>;
511
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
512
+ selected: PropTypes.Validator<boolean>;
513
+ name: PropTypes.Validator<string>;
514
+ value: PropTypes.Requireable<string>;
515
+ }>>[]>;
516
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
517
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
518
+ multiple: PropTypes.Requireable<boolean>;
519
+ modified: PropTypes.Requireable<boolean>;
520
+ disabled: PropTypes.Requireable<boolean>;
521
+ error: PropTypes.Requireable<string>;
522
+ theme: PropTypes.Requireable<string>;
523
+ }> | PropTypes.InferProps<{
524
+ title: PropTypes.Requireable<string>;
525
+ placeholder: PropTypes.Requireable<string>;
526
+ value: PropTypes.Requireable<string>;
527
+ description: PropTypes.Requireable<string>;
528
+ required: PropTypes.Requireable<boolean>;
529
+ modified: PropTypes.Requireable<boolean>;
530
+ error: PropTypes.Requireable<boolean>;
531
+ errorMessage: PropTypes.Requireable<string>;
532
+ suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
533
+ name: PropTypes.Requireable<string>;
534
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
535
+ }> | null | undefined)[]>;
536
+ theme: PropTypes.Requireable<string>;
537
+ onInput: PropTypes.Requireable<(...args: any[]) => any>;
538
+ onFetch: PropTypes.Requireable<(...args: any[]) => any>;
539
+ onClear: PropTypes.Requireable<(...args: any[]) => any>;
540
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
541
+ onSuggestionSelected: PropTypes.Requireable<(...args: any[]) => any>;
542
+ }> | PropTypes.InferProps<{
543
+ items: PropTypes.Requireable<(PropTypes.InferProps<{
544
+ radioWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
545
+ title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
546
+ title: PropTypes.Requireable<string>;
547
+ subtitle: PropTypes.Requireable<string>;
548
+ type: PropTypes.Requireable<string>;
549
+ 'data-name': PropTypes.Requireable<string>;
550
+ titleSize: PropTypes.Requireable<string>;
551
+ subtitleSize: PropTypes.Requireable<string>;
552
+ }>>>;
553
+ name: PropTypes.Requireable<string>;
554
+ checked: PropTypes.Requireable<boolean>;
555
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
556
+ 'aria-label': PropTypes.Requireable<string>;
557
+ 'data-name': PropTypes.Requireable<string>;
558
+ }>>;
559
+ field: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
560
+ name: PropTypes.Requireable<string>;
561
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
562
+ onReset: PropTypes.Requireable<(...args: any[]) => any>;
563
+ imageTypes: PropTypes.Requireable<any[]>;
564
+ error: PropTypes.Requireable<string>;
565
+ buttonAriaLabel: PropTypes.Requireable<string>;
566
+ errorButtonLabel: PropTypes.Requireable<string>;
567
+ labelLink: PropTypes.Requireable<string>;
568
+ hrefLink: PropTypes.Requireable<string>;
569
+ title: PropTypes.Requireable<string>;
570
+ description: PropTypes.Requireable<string>;
571
+ uploadLabel: PropTypes.Requireable<string>;
572
+ previewLabel: PropTypes.Requireable<string>;
573
+ previewContent: PropTypes.Requireable<PropTypes.InferProps<{
574
+ type: PropTypes.Requireable<string>;
575
+ src: PropTypes.Requireable<string>;
576
+ label: PropTypes.Requireable<string>;
577
+ }>>;
578
+ loading: PropTypes.Requireable<boolean>;
579
+ modified: PropTypes.Requireable<boolean>;
580
+ disabled: PropTypes.Requireable<boolean>;
581
+ children: PropTypes.Requireable<(...args: any[]) => any>;
582
+ pdfButtonLabel: PropTypes.Requireable<string>;
583
+ pdfButtonAriaLabel: PropTypes.Requireable<string>;
584
+ }> | PropTypes.InferProps<{
585
+ title: PropTypes.Requireable<string>;
586
+ placeholder: PropTypes.Requireable<string>;
587
+ description: PropTypes.Requireable<string>;
588
+ hint: PropTypes.Requireable<string>;
589
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
590
+ selected: PropTypes.Validator<boolean>;
591
+ name: PropTypes.Validator<string>;
592
+ value: PropTypes.Requireable<string>;
593
+ }>>[]>;
594
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
595
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
596
+ multiple: PropTypes.Requireable<boolean>;
597
+ modified: PropTypes.Requireable<boolean>;
598
+ disabled: PropTypes.Requireable<boolean>;
599
+ error: PropTypes.Requireable<string>;
600
+ theme: PropTypes.Requireable<string>;
601
+ }> | null | undefined>>;
602
+ childType: PropTypes.Requireable<string>;
603
+ }> | null | undefined)[]>;
604
+ }> | null | undefined>>;
605
+ childType: PropTypes.Validator<string>;
496
606
  }> | null | undefined> | null | undefined)[]>;
497
607
  }> | null | undefined)[]>;
498
608
  export const disabled: PropTypes.Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AA6DA,kEA+EC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AAkEA,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, darkColor, theme) => {
13
+ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor, theme, massiveBattleForm) => {
14
14
  if (!onSubmit && !onReset) {
15
15
  return null;
16
16
  }
@@ -19,7 +19,7 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
19
19
  const submitButton = onSubmit ? /*#__PURE__*/React.createElement("div", {
20
20
  "data-tip": tooltip.title,
21
21
  "data-for": "submitButton",
22
- className: style.saveButton
22
+ className: massiveBattleForm ? style.massiveBattleButton : style.saveButton
23
23
  }, theme === 'coorpmanager' ? /*#__PURE__*/React.createElement(ButtonLink, {
24
24
  type: "primary",
25
25
  label: submitValue,
@@ -68,6 +68,7 @@ const BrandForm = (props, context) => {
68
68
 
69
69
  const darkColor = _get('common.dark', skin);
70
70
 
71
+ const massiveBattleForm = groups[0]?.fields[0]?.type === 'titleAndInput';
71
72
  const backView = back ? /*#__PURE__*/React.createElement("p", {
72
73
  className: style.back
73
74
  }, /*#__PURE__*/React.createElement(ArrowLeft, {
@@ -85,7 +86,7 @@ const BrandForm = (props, context) => {
85
86
  key: index
86
87
  }, /*#__PURE__*/React.createElement(BrandFormGroup, group));
87
88
  });
88
- const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor, theme);
89
+ const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor, theme, massiveBattleForm);
89
90
  const handleSubmit = useMemo(() => e => {
90
91
  e.preventDefault();
91
92
  return onSubmit(e);