@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
@@ -463,6 +463,116 @@ declare namespace BrandFormGroup {
463
463
  theme: PropTypes.Requireable<string>;
464
464
  titleStyle: PropTypes.Requireable<string>;
465
465
  }> | null | undefined)[]>;
466
+ }> | PropTypes.InferProps<{
467
+ type: PropTypes.Requireable<string>;
468
+ title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
469
+ title: PropTypes.Requireable<string>;
470
+ subtitle: PropTypes.Requireable<string>;
471
+ type: PropTypes.Requireable<string>;
472
+ 'data-name': PropTypes.Requireable<string>;
473
+ titleSize: PropTypes.Requireable<string>;
474
+ subtitleSize: PropTypes.Requireable<string>;
475
+ }>>>;
476
+ field: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
477
+ title: PropTypes.Requireable<string>;
478
+ placeholder: PropTypes.Requireable<string>;
479
+ description: PropTypes.Requireable<string>;
480
+ hint: PropTypes.Requireable<string>;
481
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
482
+ selected: PropTypes.Validator<boolean>;
483
+ name: PropTypes.Validator<string>;
484
+ value: PropTypes.Requireable<string>;
485
+ }>>[]>;
486
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
487
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
488
+ multiple: PropTypes.Requireable<boolean>;
489
+ modified: PropTypes.Requireable<boolean>;
490
+ disabled: PropTypes.Requireable<boolean>;
491
+ error: PropTypes.Requireable<string>;
492
+ theme: PropTypes.Requireable<string>;
493
+ }> | PropTypes.InferProps<{
494
+ title: PropTypes.Requireable<string>;
495
+ placeholder: PropTypes.Requireable<string>;
496
+ value: PropTypes.Requireable<string>;
497
+ description: PropTypes.Requireable<string>;
498
+ required: PropTypes.Requireable<boolean>;
499
+ modified: PropTypes.Requireable<boolean>;
500
+ error: PropTypes.Requireable<boolean>;
501
+ errorMessage: PropTypes.Requireable<string>;
502
+ suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
503
+ name: PropTypes.Requireable<string>;
504
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
505
+ }> | null | undefined)[]>;
506
+ theme: PropTypes.Requireable<string>;
507
+ onInput: PropTypes.Requireable<(...args: any[]) => any>;
508
+ onFetch: PropTypes.Requireable<(...args: any[]) => any>;
509
+ onClear: PropTypes.Requireable<(...args: any[]) => any>;
510
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
511
+ onSuggestionSelected: PropTypes.Requireable<(...args: any[]) => any>;
512
+ }> | PropTypes.InferProps<{
513
+ items: PropTypes.Requireable<(PropTypes.InferProps<{
514
+ radioWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
515
+ title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
516
+ title: PropTypes.Requireable<string>;
517
+ subtitle: PropTypes.Requireable<string>;
518
+ type: PropTypes.Requireable<string>;
519
+ 'data-name': PropTypes.Requireable<string>;
520
+ titleSize: PropTypes.Requireable<string>;
521
+ subtitleSize: PropTypes.Requireable<string>;
522
+ }>>>;
523
+ name: PropTypes.Requireable<string>;
524
+ checked: PropTypes.Requireable<boolean>;
525
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
526
+ 'aria-label': PropTypes.Requireable<string>;
527
+ 'data-name': PropTypes.Requireable<string>;
528
+ }>>;
529
+ field: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
530
+ name: PropTypes.Requireable<string>;
531
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
532
+ onReset: PropTypes.Requireable<(...args: any[]) => any>;
533
+ imageTypes: PropTypes.Requireable<any[]>;
534
+ error: PropTypes.Requireable<string>;
535
+ buttonAriaLabel: PropTypes.Requireable<string>;
536
+ errorButtonLabel: PropTypes.Requireable<string>;
537
+ labelLink: PropTypes.Requireable<string>;
538
+ hrefLink: PropTypes.Requireable<string>;
539
+ title: PropTypes.Requireable<string>;
540
+ description: PropTypes.Requireable<string>;
541
+ uploadLabel: PropTypes.Requireable<string>;
542
+ previewLabel: PropTypes.Requireable<string>;
543
+ previewContent: PropTypes.Requireable<PropTypes.InferProps<{
544
+ type: PropTypes.Requireable<string>;
545
+ src: PropTypes.Requireable<string>;
546
+ label: PropTypes.Requireable<string>;
547
+ }>>;
548
+ loading: PropTypes.Requireable<boolean>;
549
+ modified: PropTypes.Requireable<boolean>;
550
+ disabled: PropTypes.Requireable<boolean>;
551
+ children: PropTypes.Requireable<(...args: any[]) => any>;
552
+ pdfButtonLabel: PropTypes.Requireable<string>;
553
+ pdfButtonAriaLabel: PropTypes.Requireable<string>;
554
+ }> | PropTypes.InferProps<{
555
+ title: PropTypes.Requireable<string>;
556
+ placeholder: PropTypes.Requireable<string>;
557
+ description: PropTypes.Requireable<string>;
558
+ hint: PropTypes.Requireable<string>;
559
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
560
+ selected: PropTypes.Validator<boolean>;
561
+ name: PropTypes.Validator<string>;
562
+ value: PropTypes.Requireable<string>;
563
+ }>>[]>;
564
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
565
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
566
+ multiple: PropTypes.Requireable<boolean>;
567
+ modified: PropTypes.Requireable<boolean>;
568
+ disabled: PropTypes.Requireable<boolean>;
569
+ error: PropTypes.Requireable<string>;
570
+ theme: PropTypes.Requireable<string>;
571
+ }> | null | undefined>>;
572
+ childType: PropTypes.Requireable<string>;
573
+ }> | null | undefined)[]>;
574
+ }> | null | undefined>>;
575
+ childType: PropTypes.Validator<string>;
466
576
  }> | null | undefined> | null | undefined)[]>;
467
577
  }
468
578
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-form-group/index.js"],"names":[],"mappings":";AA+GA,yDAuBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-form-group/index.js"],"names":[],"mappings":";AAmHA,yDAuBC"}
@@ -57,6 +57,8 @@ var _titleAndCheckboxWrapper = _interopRequireDefault(require("../title-and-chec
57
57
 
58
58
  var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
59
59
 
60
+ var _titleAndInput = _interopRequireDefault(require("../../organism/title-and-input"));
61
+
60
62
  var _style = _interopRequireDefault(require("./style.css"));
61
63
 
62
64
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -151,6 +153,9 @@ const buildInput = field => {
151
153
  case 'titleAndCheckBoxWrapper':
152
154
  return /*#__PURE__*/_react.default.createElement(_titleAndCheckboxWrapper.default, field);
153
155
 
156
+ case 'titleAndInput':
157
+ return /*#__PURE__*/_react.default.createElement(_titleAndInput.default, field);
158
+
154
159
  default:
155
160
  return /*#__PURE__*/_react.default.createElement(_inputText.default, field);
156
161
  }
@@ -161,10 +166,11 @@ const buildField = (field, index) => {
161
166
  const {
162
167
  theme,
163
168
  size = 'default'
164
- } = field;
169
+ } = field.type === 'titleAndInput' ? field.field : field;
165
170
  const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : _style.default.field;
171
+ const styleField = field.type === 'titleAndInput' ? _style.default.fieldMassiveBattle : styleInput;
166
172
  return /*#__PURE__*/_react.default.createElement("div", {
167
- className: styleInput,
173
+ className: styleField,
168
174
  key: index
169
175
  }, input);
170
176
  };
@@ -254,7 +260,9 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
254
260
  type: _propTypes.default.oneOf(['selectMultiple'])
255
261
  })), _propTypes.default.shape(_extends({}, _coorpManagerRoles.default.propTypes, {
256
262
  type: _propTypes.default.oneOf(['roles'])
257
- })), _propTypes.default.shape(_inputText.default.propTypes)]))
263
+ })), _propTypes.default.shape(_inputText.default.propTypes), _propTypes.default.shape(_extends({}, _titleAndInput.default.propTypes, {
264
+ type: _propTypes.default.oneOf(['titleAndInput'])
265
+ }))]))
258
266
  } : {};
259
267
  var _default = BrandFormGroup;
260
268
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","bulkUploadContainer","buttonType","buildField","index","input","theme","size","styleInput","defineLayoutClass","layout","classNames","grid","layoutBulk","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","subtitleSize","fieldsList","convert","cap","useMemo","wrapper","groupGrid","titleWrapper","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","ButtonLink","SelectMultiple","Roles"],"sources":["../../../src/molecule/brand-form-group/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'bulkUpload':\n return (\n <div className={style.bulkUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'buttonLink':\n return <ButtonLink {...field} type={field.buttonType} />;\n case 'roles':\n return <Roles {...field} />;\n case 'titleAndCheckBoxWrapper':\n return <TitleAndCheckBoxWrapper {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst defineLayoutClass = layout => {\n if (layout === 'grid') return classNames(style.grid);\n else if (layout === 'bulkLayout') return classNames(style.layoutBulk);\n else return classNames(null);\n};\n\nconst BrandFormGroup = props => {\n const {\n title,\n subtitle = '',\n fieldsLayout = '',\n groupLayout = '',\n fields = [],\n subtitleSize = 'standard'\n } = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n const layout = useMemo(() => defineLayoutClass(fieldsLayout), [fieldsLayout]);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} subtitleSize={subtitleSize} type={'form-group'} />\n </div>\n <div className={layout}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n subtitleSize: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['bulkImage'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...ButtonLink.propTypes,\n buttonType: ButtonLink.propTypes.type,\n type: PropTypes.oneOf(['buttonLink'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;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AgB,oBAAK/C,mBAAL,CAAhB;EAHR,GAxDkB,EA6DlByC,kBAAA,CAAUI,KAAV,cACKe,yBAAA,CAAiBpB,SADtB;IAEE9B,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,aAAD,CAAhB;EAFR,GA7DkB,EAiElBN,kBAAA,CAAUI,KAAV,cACKgB,uBAAA,CAAerB,SADpB;IAEE9B,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,WAAD,CAAhB;EAFR,GAjEkB,EAqElBN,kBAAA,CAAUI,KAAV,cACKiB,eAAA,CAAOtB,SADZ;IAEE9B,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,QAAD,CAAhB;EAFR,GArEkB,EAyElBN,kBAAA,CAAUI,KAAV,cACKkB,mBAAA,CAAWvB,SADhB;IAEE3B,UAAU,EAAEkD,mBAAA,CAAWvB,SAAX,CAAqB9B,IAFnC;IAGEA,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,YAAD,CAAhB;EAHR,GAzEkB,EA8ElBN,kBAAA,CAAUI,KAAV,cACKmB,uBAAA,CAAexB,SADpB;IAEE9B,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;EAFR,GA9EkB,EAkFlBN,kBAAA,CAAUI,KAAV,cACKoB,0BAAA,CAAMzB,SADX;IAEE9B,IAAI,EAAE+B,kBAAA,CAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;EAFR,GAlFkB,EAsFlBN,kBAAA,CAAUI,KAAV,CAAgBc,kBAAA,CAAUnB,SAA1B,CAtFkB,CAApB,CADM;AANiB,CAA3B;eAiGef,c"}
1
+ {"version":3,"file":"index.js","names":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","bulkUploadContainer","buttonType","buildField","index","input","theme","size","styleInput","styleField","fieldMassiveBattle","defineLayoutClass","layout","classNames","grid","layoutBulk","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","subtitleSize","fieldsList","convert","cap","useMemo","wrapper","groupGrid","titleWrapper","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","ButtonLink","SelectMultiple","Roles","TitleAndInput"],"sources":["../../../src/molecule/brand-form-group/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport TitleAndInput from '../../organism/title-and-input';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'bulkUpload':\n return (\n <div className={style.bulkUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'buttonLink':\n return <ButtonLink {...field} type={field.buttonType} />;\n case 'roles':\n return <Roles {...field} />;\n case 'titleAndCheckBoxWrapper':\n return <TitleAndCheckBoxWrapper {...field} />;\n case 'titleAndInput':\n return <TitleAndInput {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field.type === 'titleAndInput' ? field.field : field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n const styleField = field.type === 'titleAndInput' ? style.fieldMassiveBattle : styleInput;\n\n return (\n <div className={styleField} key={index}>\n {input}\n </div>\n );\n};\n\nconst defineLayoutClass = layout => {\n if (layout === 'grid') return classNames(style.grid);\n else if (layout === 'bulkLayout') return classNames(style.layoutBulk);\n else return classNames(null);\n};\n\nconst BrandFormGroup = props => {\n const {\n title,\n subtitle = '',\n fieldsLayout = '',\n groupLayout = '',\n fields = [],\n subtitleSize = 'standard'\n } = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n const layout = useMemo(() => defineLayoutClass(fieldsLayout), [fieldsLayout]);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} subtitleSize={subtitleSize} type={'form-group'} />\n </div>\n <div className={layout}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n subtitleSize: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['bulkImage'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...ButtonLink.propTypes,\n buttonType: ButtonLink.propTypes.type,\n type: PropTypes.oneOf(['buttonLink'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes),\n PropTypes.shape({\n ...TitleAndInput.propTypes,\n type: PropTypes.oneOf(['titleAndInput'])\n })\n ])\n )\n};\nexport default BrandFormGroup;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMC,YADW;EAE1BC,MAAM,EAAEF,cAAA,CAAMG,WAFY;EAG1BC,KAAK,EAAEJ,cAAA,CAAMK;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC;EAAD,IAASD,KAAf;;EAEA,QAAQC,IAAR;IACE,KAAK,cAAL;MACE,oBAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;IACF,KAAK,OAAL;MACE,oBAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,6BAAC,sBAAD,EAAmBA,KAA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AV,cACKiB,eAAA,CAAOtB,SADZ;IAEEhC,IAAI,EAAEiC,kBAAA,CAAUM,KAAV,CAAgB,CAAC,QAAD,CAAhB;EAFR,GArEkB,EAyElBN,kBAAA,CAAUI,KAAV,cACKkB,mBAAA,CAAWvB,SADhB;IAEE7B,UAAU,EAAEoD,mBAAA,CAAWvB,SAAX,CAAqBhC,IAFnC;IAGEA,IAAI,EAAEiC,kBAAA,CAAUM,KAAV,CAAgB,CAAC,YAAD,CAAhB;EAHR,GAzEkB,EA8ElBN,kBAAA,CAAUI,KAAV,cACKmB,uBAAA,CAAexB,SADpB;IAEEhC,IAAI,EAAEiC,kBAAA,CAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;EAFR,GA9EkB,EAkFlBN,kBAAA,CAAUI,KAAV,cACKoB,0BAAA,CAAMzB,SADX;IAEEhC,IAAI,EAAEiC,kBAAA,CAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;EAFR,GAlFkB,EAsFlBN,kBAAA,CAAUI,KAAV,CAAgBc,kBAAA,CAAUnB,SAA1B,CAtFkB,EAuFlBC,kBAAA,CAAUI,KAAV,cACKqB,sBAAA,CAAc1B,SADnB;IAEEhC,IAAI,EAAEiC,kBAAA,CAAUM,KAAV,CAAgB,CAAC,eAAD,CAAhB;EAFR,GAvFkB,CAApB,CADM;AANiB,CAA3B;eAqGetB,c"}
@@ -73,6 +73,10 @@
73
73
  width: 100%;
74
74
  }
75
75
 
76
+ .fieldMassiveBattle {
77
+ margin: 0 0 48px 0;
78
+ }
79
+
76
80
  .imageUploadContainer {
77
81
  display: flex;
78
82
  flex-direction: column;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/external-content-viewer/index.js"],"names":[],"mappings":";AAkBA,gEAgDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/external-content-viewer/index.js"],"names":[],"mappings":";AAkBA,gEAgCC"}
@@ -35,41 +35,25 @@ function ExternalContentViewer(props) {
35
35
  } = props;
36
36
  const isPdf = (0, _includes.default)('.pdf', url);
37
37
  const googleViewer = `https://docs.google.com/viewerng/viewer?embedded=true&url=${url}`;
38
-
39
- if ((0, _startsWith.default)('audio', contentType)) {
40
- return /*#__PURE__*/_react.default.createElement("div", {
41
- className: podcastWrapperStyle[mode]
42
- }, /*#__PURE__*/_react.default.createElement("div", {
43
- className: _style.default.bgPodcast,
44
- style: {
45
- backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`
46
- }
47
- }), /*#__PURE__*/_react.default.createElement("audio", {
48
- className: _style.default.podcast,
49
- controls: true,
50
- controlsList: "nodownload",
51
- autoPlay: "",
52
- name: "media",
53
- "data-name": "external-content-podcast",
54
- preload: "auto"
55
- }, /*#__PURE__*/_react.default.createElement("source", {
56
- src: url,
57
- type: contentType
58
- })));
59
- }
60
-
61
- if ((0, _startsWith.default)('video', contentType) && mode === 'cockpit') {
62
- return /*#__PURE__*/_react.default.createElement("video", {
63
- src: isPdf && mode === 'mobile' ? googleViewer : url,
64
- frameBorder: 0,
65
- className: iframeStyle[mode],
66
- allowFullScreen: true,
67
- "data-name": "external-content-iframe",
68
- autoPlay: false
69
- });
70
- }
71
-
72
- return /*#__PURE__*/_react.default.createElement("iframe", {
38
+ return (0, _startsWith.default)('audio', contentType) ? /*#__PURE__*/_react.default.createElement("div", {
39
+ className: podcastWrapperStyle[mode]
40
+ }, /*#__PURE__*/_react.default.createElement("div", {
41
+ className: _style.default.bgPodcast,
42
+ style: {
43
+ backgroundImage: backgroundImageUrl && `url(${backgroundImageUrl})`
44
+ }
45
+ }), /*#__PURE__*/_react.default.createElement("audio", {
46
+ className: _style.default.podcast,
47
+ controls: true,
48
+ controlsList: "nodownload",
49
+ autoPlay: "",
50
+ name: "media",
51
+ "data-name": "external-content-podcast",
52
+ preload: "auto"
53
+ }, /*#__PURE__*/_react.default.createElement("source", {
54
+ src: url,
55
+ type: contentType
56
+ }))) : /*#__PURE__*/_react.default.createElement("iframe", {
73
57
  src: isPdf && mode === 'mobile' ? googleViewer : url,
74
58
  frameBorder: 0,
75
59
  className: iframeStyle[mode],
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["podcastWrapperStyle","default","style","podcastWrapper","cockpit","podcastWrapperCockpit","mobile","iframeStyle","iframe","iframeCockpit","ExternalContentViewer","props","url","backgroundImageUrl","contentType","mode","isPdf","includes","googleViewer","startsWith","bgPodcast","backgroundImage","podcast","propTypes","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;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMC,cADW;EAE1BC,OAAO,EAAEF,cAAA,CAAMG,qBAFW;EAG1BC,MAAM,EAAEJ,cAAA,CAAMC;AAHY,CAA5B;AAMA,MAAMI,WAAW,GAAG;EAClBN,OAAO,EAAEC,cAAA,CAAMM,MADG;EAElBJ,OAAO,EAAEF,cAAA,CAAMO,aAFG;EAGlBH,MAAM,EAAEJ,cAAA,CAAMM;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,GAAG,IAAAC,iBAAA,EAAS,MAAT,EAAiBL,GAAjB,CAAd;EACA,MAAMM,YAAY,GAAI,6DAA4DN,GAAI,EAAtF;;EAEA,IAAI,IAAAO,mBAAA,EAAW,OAAX,EAAoBL,WAApB,CAAJ,EAAsC;IACpC,oBACE;MAAK,SAAS,EAAEd,mBAAmB,CAACe,IAAD;IAAnC,gBACE;MACE,SAAS,EAAEb,cAAA,CAAMkB,SADnB;MAEE,KAAK,EAAE;QAACC,eAAe,EAAER,kBAAkB,IAAK,OAAMA,kBAAmB;MAAlE;IAFT,EADF,eAKE;MACE,SAAS,EAAEX,cAAA,CAAMoB,OADnB;MAEE,QAAQ,MAFV;MAGE,YAAY,EAAC,YAHf;MAIE,QAAQ,EAAC,EAJX;MAKE,IAAI,EAAC,OALP;MAME,aAAU,0BANZ;MAOE,OAAO,EAAC;IAPV,gBASE;MAAQ,GAAG,EAAEV,GAAb;MAAkB,IAAI,EAAEE;IAAxB,EATF,CALF,CADF;EAmBD;;EACD,IAAI,IAAAK,mBAAA,EAAW,OAAX,EAAoBL,WAApB,KAAoCC,IAAI,KAAK,SAAjD,EAA4D;IAC1D,oBACE;MACE,GAAG,EAAEC,KAAK,IAAID,IAAI,KAAK,QAAlB,GAA6BG,YAA7B,GAA4CN,GADnD;MAEE,WAAW,EAAE,CAFf;MAGE,SAAS,EAAEL,WAAW,CAACQ,IAAD,CAHxB;MAIE,eAAe,MAJjB;MAKE,aAAU,yBALZ;MAME,QAAQ,EAAE;IANZ,EADF;EAUD;;EAED,oBACE;IACE,GAAG,EAAEC,KAAK,IAAID,IAAI,KAAK,QAAlB,GAA6BG,YAA7B,GAA4CN,GADnD;IAEE,WAAW,EAAE,CAFf;IAGE,SAAS,EAAEL,WAAW,CAACQ,IAAD,CAHxB;IAIE,eAAe,MAJjB;IAKE,aAAU;EALZ,EADF;AASD;;AAEDL,qBAAqB,CAACa,SAAtB,2CAAkC;EAChCX,GAAG,EAAEY,kBAAA,CAAUC,MAAV,CAAiBC,UADU;EAEhCb,kBAAkB,EAAEW,kBAAA,CAAUC,MAFE;EAGhCX,WAAW,EAAEU,kBAAA,CAAUC,MAHS;EAIhCV,IAAI,EAAES,kBAAA,CAAUC;AAJgB,CAAlC;eAOef,qB"}
1
+ {"version":3,"file":"index.js","names":["podcastWrapperStyle","default","style","podcastWrapper","cockpit","podcastWrapperCockpit","mobile","iframeStyle","iframe","iframeCockpit","ExternalContentViewer","props","url","backgroundImageUrl","contentType","mode","isPdf","includes","googleViewer","startsWith","bgPodcast","backgroundImage","podcast","propTypes","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;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMC,cADW;EAE1BC,OAAO,EAAEF,cAAA,CAAMG,qBAFW;EAG1BC,MAAM,EAAEJ,cAAA,CAAMC;AAHY,CAA5B;AAMA,MAAMI,WAAW,GAAG;EAClBN,OAAO,EAAEC,cAAA,CAAMM,MADG;EAElBJ,OAAO,EAAEF,cAAA,CAAMO,aAFG;EAGlBH,MAAM,EAAEJ,cAAA,CAAMM;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,GAAG,IAAAC,iBAAA,EAAS,MAAT,EAAiBL,GAAjB,CAAd;EACA,MAAMM,YAAY,GAAI,6DAA4DN,GAAI,EAAtF;EAEA,OAAO,IAAAO,mBAAA,EAAW,OAAX,EAAoBL,WAApB,iBACL;IAAK,SAAS,EAAEd,mBAAmB,CAACe,IAAD;EAAnC,gBACE;IACE,SAAS,EAAEb,cAAA,CAAMkB,SADnB;IAEE,KAAK,EAAE;MAACC,eAAe,EAAER,kBAAkB,IAAK,OAAMA,kBAAmB;IAAlE;EAFT,EADF,eAKE;IACE,SAAS,EAAEX,cAAA,CAAMoB,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,EAAEV,GAAb;IAAkB,IAAI,EAAEE;EAAxB,EATF,CALF,CADK,gBAmBL;IACE,GAAG,EAAEE,KAAK,IAAID,IAAI,KAAK,QAAlB,GAA6BG,YAA7B,GAA4CN,GADnD;IAEE,WAAW,EAAE,CAFf;IAGE,SAAS,EAAEL,WAAW,CAACQ,IAAD,CAHxB;IAIE,eAAe,MAJjB;IAKE,aAAU;EALZ,EAnBF;AA2BD;;AAEDL,qBAAqB,CAACa,SAAtB,2CAAkC;EAChCX,GAAG,EAAEY,kBAAA,CAAUC,MAAV,CAAiBC,UADU;EAEhCb,kBAAkB,EAAEW,kBAAA,CAAUC,MAFE;EAGhCX,WAAW,EAAEU,kBAAA,CAAUC,MAHS;EAIhCV,IAAI,EAAES,kBAAA,CAAUC;AAJgB,CAAlC;eAOef,qB"}
@@ -179,7 +179,7 @@ const SelectMultiple = ({
179
179
  const isActive = isOpened === true;
180
180
  const titleView = title ? /*#__PURE__*/_react.default.createElement("span", {
181
181
  className: (0, _classnames.default)(_style.default.title, isCMTheme && selection && _style.default.titleWithSelection, isCMTheme && (0, _isEmpty2.default)(selection) && _style.default.noValue, isActive && _style.default.active)
182
- }, title, isCMTheme ? /*#__PURE__*/_react.default.createElement("div", {
182
+ }, title, description && isCMTheme ? /*#__PURE__*/_react.default.createElement("div", {
183
183
  className: _style.default.infoIconWrapper
184
184
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
185
185
  className: _style.default.infoIcon
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeStyle","setup","style","cockpit","sidebar","coorpmanager","useChoices","options","choicesRef","current","getChoices","setChoices","choice","choices","i","selected","filter","c","CMMultipleView","multiple","onChange","handleChange","useCallback","item","name","SelectMultiple","title","theme","placeholder","description","hint","onError","modified","error","disabled","skin","isOpened","updateIsOpened","useState","nodeRef","useRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","useEffect","document","addEventListener","removeEventListener","isCMTheme","handleOnClickOnListElement","lines","convert","cap","selection","isActive","titleView","classnames","titleWithSelection","noValue","active","infoIconWrapper","infoIcon","descriptionLabel","hintView","hideHint","__html","mainClass","default","showPlaceholder","behaviourClassName","getClassState","errorIconView","errorIcon","select","noselection","iconsWrapper","flex","clicked","color","arrow","down","activeChoices","list","contextTypes","Provider","childContextTypes","propTypes","PropTypes","bool","TitledCheckbox","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;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,KAAK,EAAEC,cAAA,CAAMD,KADI;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,OAAO,EAAEF,cAAA,CAAME,OAHE;EAIjBC,YAAY,EAAEH,cAAA,CAAMG;AAJH,CAAnB;;AAOO,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,MAA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,CAAUI,MAXQ;EAYzBvE,KAAK,EAAEmE,kBAAA,CAAUM,KAAV,CAAgB,oBAAKpG,UAAL,CAAhB;AAZkB,CAA3B;eAeeyB,c"}
1
+ {"version":3,"file":"index.js","names":["themeStyle","setup","style","cockpit","sidebar","coorpmanager","useChoices","options","choicesRef","current","getChoices","setChoices","choice","choices","i","selected","filter","c","CMMultipleView","multiple","onChange","handleChange","useCallback","item","name","SelectMultiple","title","theme","placeholder","description","hint","onError","modified","error","disabled","skin","isOpened","updateIsOpened","useState","nodeRef","useRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","useEffect","document","addEventListener","removeEventListener","isCMTheme","handleOnClickOnListElement","lines","convert","cap","selection","isActive","titleView","classnames","titleWithSelection","noValue","active","infoIconWrapper","infoIcon","descriptionLabel","hintView","hideHint","__html","mainClass","default","showPlaceholder","behaviourClassName","getClassState","errorIconView","errorIcon","select","noselection","iconsWrapper","flex","clicked","color","arrow","down","activeChoices","list","contextTypes","Provider","childContextTypes","propTypes","PropTypes","bool","TitledCheckbox","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;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,KAAK,EAAEC,cAAA,CAAMD,KADI;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,OAAO,EAAEF,cAAA,CAAME,OAHE;EAIjBC,YAAY,EAAEH,cAAA,CAAMG;AAJH,CAAnB;;AAOO,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,mBAAK,IAAGD,MAAM,CAACE,CAAE,YAAjB,EAA8B,CAACF,MAAM,CAACG,QAAtC,EAAgDL,UAAU,EAA1D,CAAh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espace 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,40 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _radioWithTitle = _interopRequireDefault(require("../../atom/radio-with-title"));
9
+
10
+ var _selectMultiple = _interopRequireDefault(require("../select-multiple"));
11
+
12
+ var _imageUpload = _interopRequireDefault(require("../../atom/image-upload"));
13
+
14
+ var _types = _interopRequireDefault(require("./types"));
15
+
16
+ var _style = _interopRequireDefault(require("./style.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const buildInput = (childType, field) => {
21
+ return childType === 'select-multiple' ? /*#__PURE__*/_react.default.createElement(_selectMultiple.default, field) : /*#__PURE__*/_react.default.createElement(_imageUpload.default, field);
22
+ };
23
+
24
+ const TitleRadioWrapper = props => {
25
+ const {
26
+ radioWithTitle,
27
+ field,
28
+ childType
29
+ } = props;
30
+ return /*#__PURE__*/_react.default.createElement("div", {
31
+ className: _style.default.container
32
+ }, radioWithTitle ? /*#__PURE__*/_react.default.createElement(_radioWithTitle.default, radioWithTitle) : null, /*#__PURE__*/_react.default.createElement("div", {
33
+ className: _style.default.field
34
+ }, buildInput(childType, field)));
35
+ };
36
+
37
+ TitleRadioWrapper.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
38
+ var _default = TitleRadioWrapper;
39
+ exports.default = _default;
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["buildInput","childType","field","TitleRadioWrapper","props","radioWithTitle","style","container","propTypes"],"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;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,SAAD,EAAoBC,KAApB,KAAmC;EACpD,OAAOD,SAAS,KAAK,iBAAd,gBACL,6BAAC,uBAAD,EAAoBC,KAApB,CADK,gBAGL,6BAAC,oBAAD,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,EAAEE,cAAA,CAAMC;EAAtB,GACGF,cAAc,gBAAG,6BAAC,uBAAD,EAAoBA,cAApB,CAAH,GAA4C,IAD7D,eAEE;IAAK,SAAS,EAAEC,cAAA,CAAMJ;EAAtB,GAA8BF,UAAU,CAACC,SAAD,EAAYC,KAAZ,CAAxC,CAFF,CADF;AAMD,CARD;;AAUAC,iBAAiB,CAACK,SAAlB,2CAA8BA,cAA9B;eAEeL,iB"}
@@ -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
+ }