@coorpacademy/components 11.32.33 → 11.32.35-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/input-text/index.d.ts +1 -0
- package/es/atom/input-text/index.d.ts.map +1 -1
- package/es/atom/input-text/index.js +3 -1
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text-with-title/index.d.ts +1 -0
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +13 -3
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/course-sections/index.d.ts +1 -0
- package/es/molecule/progress-wrapper/index.d.ts +4 -5
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/es/molecule/progress-wrapper/index.js +14 -28
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/progress-wrapper/style.css +3 -25
- package/es/molecule/setup-slider/index.d.ts.map +1 -1
- package/es/molecule/setup-slider/index.js +14 -2
- package/es/molecule/setup-slider/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/organism/content-translation/index.d.ts +1 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +3 -0
- package/es/template/certification-detail/index.d.ts +6 -46
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +22 -40
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certification-detail/style.css +1 -12
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js +2 -2
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/lib/atom/input-text/index.d.ts +1 -0
- package/lib/atom/input-text/index.d.ts.map +1 -1
- package/lib/atom/input-text/index.js +3 -1
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text-with-title/index.d.ts +1 -0
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +14 -3
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/course-sections/index.d.ts +1 -0
- package/lib/molecule/progress-wrapper/index.d.ts +4 -5
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/progress-wrapper/index.js +14 -29
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/style.css +3 -25
- package/lib/molecule/setup-slider/index.d.ts.map +1 -1
- package/lib/molecule/setup-slider/index.js +15 -2
- package/lib/molecule/setup-slider/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/organism/content-translation/index.d.ts +1 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +3 -0
- package/lib/template/certification-detail/index.d.ts +6 -46
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +22 -41
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certification-detail/style.css +1 -12
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js +2 -2
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/locales/en/global.json +1 -0
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ declare namespace InputText {
|
|
|
14
14
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
15
|
description: PropTypes.Requireable<string>;
|
|
16
16
|
modified: PropTypes.Requireable<boolean>;
|
|
17
|
+
type: PropTypes.Requireable<string>;
|
|
17
18
|
valid: PropTypes.Requireable<boolean>;
|
|
18
19
|
'aria-label': PropTypes.Requireable<string>;
|
|
19
20
|
'data-name': PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-text/index.js"],"names":[],"mappings":";AAkBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-text/index.js"],"names":[],"mappings":";AAkBA,oDAmFC"}
|
|
@@ -20,6 +20,7 @@ const InputText = props => {
|
|
|
20
20
|
autoFocus = false,
|
|
21
21
|
placeholder = '',
|
|
22
22
|
value,
|
|
23
|
+
type = 'text',
|
|
23
24
|
hint,
|
|
24
25
|
defaultValue,
|
|
25
26
|
onChange = _noop,
|
|
@@ -66,7 +67,7 @@ const InputText = props => {
|
|
|
66
67
|
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
67
68
|
}, propsTitle, toolTipView), /*#__PURE__*/React.createElement("input", {
|
|
68
69
|
autoFocus: autoFocus,
|
|
69
|
-
type:
|
|
70
|
+
type: type,
|
|
70
71
|
name: propsTitle,
|
|
71
72
|
className: style.input,
|
|
72
73
|
placeholder: placeholder,
|
|
@@ -94,6 +95,7 @@ InputText.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
94
95
|
onChange: PropTypes.func,
|
|
95
96
|
description: PropTypes.string,
|
|
96
97
|
modified: PropTypes.bool,
|
|
98
|
+
type: PropTypes.string,
|
|
97
99
|
valid: PropTypes.bool,
|
|
98
100
|
'aria-label': PropTypes.string,
|
|
99
101
|
'data-name': PropTypes.string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","hint","defaultValue","onChange","error","valid","theme","description","disabled","modified","title","propsTitle","dataName","ariaLabel","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"sources":["../../../src/atom/input-text/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n modified = false,\n title: propsTitle,\n 'data-name': dataName = 'input-text',\n 'aria-label': ariaLabel = 'Input Text'\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","type","hint","defaultValue","onChange","error","valid","theme","description","disabled","modified","title","propsTitle","dataName","ariaLabel","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"sources":["../../../src/atom/input-text/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n type = 'text',\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n modified = false,\n title: propsTitle,\n 'data-name': dataName = 'input-text',\n 'aria-label': ariaLabel = 'Input Text'\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type={type}\n name={propsTitle}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n onChange={noop}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n type: PropTypes.string,\n valid: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputText;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEF,KAAK,CAACE,KADI;EAEjBC,YAAY,EAAEH,KAAK,CAACG,YAFH;EAGjBC,OAAO,EAAEJ,KAAK,CAACI,OAHE;EAIjBC,OAAO,EAAEL,KAAK,CAACK;AAJE,CAAnB;;AAMA,MAAMC,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IACJC,SAAS,GAAG,KADR;IAEJC,WAAW,GAAG,EAFV;IAGJC,KAHI;IAIJC,IAAI,GAAG,MAJH;IAKJC,IALI;IAMJC,YANI;IAOJC,QAAQ,QAPJ;IAQJC,KARI;IASJC,KATI;IAUJC,KAAK,GAAG,SAVJ;IAWJC,WAXI;IAYJC,QAZI;IAaJC,QAAQ,GAAG,KAbP;IAcJC,KAAK,EAAEC,UAdH;IAeJ,aAAaC,QAAQ,GAAG,YAfpB;IAgBJ,cAAcC,SAAS,GAAG;EAhBtB,IAiBFjB,KAjBJ;EAmBA,MAAMkB,SAAS,GAAGR,KAAK,KAAK,cAA5B;EACA,MAAMS,YAAY,GAAGpC,OAAO,CAAC,MAAMqC,CAAC,IAAIb,QAAQ,CAACa,CAAC,CAAC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cpB9B,KAAK,EAAEzB,SAAS,CAACsD,IAdG;EAepB,cAActD,SAAS,CAACuD,MAfJ;EAgBpB,aAAavD,SAAS,CAACuD;AAhBH,CAAtB;AAkBA,eAAexC,SAAf"}
|
|
@@ -16,6 +16,7 @@ declare namespace InputTextWithTitle {
|
|
|
16
16
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
17
|
description: PropTypes.Requireable<string>;
|
|
18
18
|
modified: PropTypes.Requireable<boolean>;
|
|
19
|
+
type: PropTypes.Requireable<string>;
|
|
19
20
|
valid: PropTypes.Requireable<boolean>;
|
|
20
21
|
'aria-label': PropTypes.Requireable<string>;
|
|
21
22
|
'data-name': PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-form-group/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-form-group/index.js"],"names":[],"mappings":";AA8HA,yDAuBC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _snakeCase from "lodash/fp/snakeCase";
|
|
2
2
|
import _map from "lodash/fp/map";
|
|
3
3
|
import _keys from "lodash/fp/keys";
|
|
4
|
+
const _excluded = ["type"];
|
|
4
5
|
|
|
5
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
7
|
|
|
8
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
+
|
|
7
10
|
import React, { useMemo } from 'react';
|
|
8
11
|
import PropTypes from 'prop-types';
|
|
9
12
|
import classNames from 'classnames';
|
|
@@ -39,7 +42,8 @@ const inputContainerStyle = {
|
|
|
39
42
|
const buildInput = field => {
|
|
40
43
|
const {
|
|
41
44
|
type
|
|
42
|
-
} = field
|
|
45
|
+
} = field,
|
|
46
|
+
rest = _objectWithoutPropertiesLoose(field, _excluded);
|
|
43
47
|
|
|
44
48
|
switch (type) {
|
|
45
49
|
case 'autoComplete':
|
|
@@ -91,6 +95,7 @@ const buildInput = field => {
|
|
|
91
95
|
return /*#__PURE__*/React.createElement(SetupSections, field);
|
|
92
96
|
|
|
93
97
|
case 'text':
|
|
98
|
+
case 'password':
|
|
94
99
|
return /*#__PURE__*/React.createElement(InputText, field);
|
|
95
100
|
|
|
96
101
|
case 'downloadbox':
|
|
@@ -129,7 +134,9 @@ const buildInput = field => {
|
|
|
129
134
|
return /*#__PURE__*/React.createElement(TitleAndInput, field);
|
|
130
135
|
|
|
131
136
|
default:
|
|
132
|
-
return /*#__PURE__*/React.createElement(InputText,
|
|
137
|
+
return /*#__PURE__*/React.createElement(InputText, _extends({}, rest, {
|
|
138
|
+
type: 'text'
|
|
139
|
+
}));
|
|
133
140
|
}
|
|
134
141
|
};
|
|
135
142
|
|
|
@@ -194,6 +201,9 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
194
201
|
type: PropTypes.oneOf(['color'])
|
|
195
202
|
})), PropTypes.shape(_extends({}, InputReadonly.propTypes, {
|
|
196
203
|
type: PropTypes.oneOf(['readonly'])
|
|
204
|
+
})), PropTypes.shape(_extends({}, InputText.propTypes, {
|
|
205
|
+
type: PropTypes.oneOf(['password']),
|
|
206
|
+
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
197
207
|
})), PropTypes.shape(_extends({}, InputSwitch.propTypes, {
|
|
198
208
|
type: PropTypes.oneOf(['switch'])
|
|
199
209
|
})), PropTypes.shape(_extends({}, InputTextarea.propTypes, {
|
|
@@ -217,7 +227,7 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
217
227
|
})), PropTypes.shape(_extends({}, SetupSections.propTypes, {
|
|
218
228
|
type: PropTypes.oneOf(['sections'])
|
|
219
229
|
})), PropTypes.shape(_extends({}, InputText.propTypes, {
|
|
220
|
-
type: PropTypes.oneOf(['text']),
|
|
230
|
+
type: PropTypes.oneOf(['text', 'password']),
|
|
221
231
|
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
222
232
|
})), PropTypes.shape(_extends({}, BrandDownloadBox.propTypes, {
|
|
223
233
|
type: PropTypes.oneOf(['downloadbox'])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","InputFileDraggable","SetupSlider","SetupSections","Title","Roles","TitleAndCheckBoxWrapper","ButtonLink","TitleAndInput","style","inputContainerStyle","default","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","bulkUploadContainer","submitValue","href","target","download","width","buttonType","buildField","index","input","theme","size","styleInput","styleField","fieldMassiveBattle","defineLayoutClass","layout","grid","layoutBulk","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","subtitleSize","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"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 InputFileDraggable from '../../atom/input-file-draggable';\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 <InputFileDraggable {...field} />\n </div>\n );\n case 'bulkUpload':\n return (\n <div className={style.bulkUploadContainer}>\n <InputFileDraggable {...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 (\n <ButtonLink\n {...field}\n type=\"primary\"\n label={field.submitValue}\n link={\n field.href ? {href: field.href, target: field.target, download: field.download} : null\n }\n customStyle={{width: 'fit-content'}}\n />\n );\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 ...InputFileDraggable.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...InputFileDraggable.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,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,eAAP,MAA4B,6BAA5B;AACA,OAAOC,kBAAP,MAA+B,iCAA/B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,aAAP,MAA0B,gCAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACG,YADW;EAE1BC,MAAM,EAAEJ,KAAK,CAACK,WAFY;EAG1BC,KAAK,EAAEN,KAAK,CAACO;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC;EAAD,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;AANiB,CAA3B;AAqGA,eAAenB,cAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","InputFileDraggable","SetupSlider","SetupSections","Title","Roles","TitleAndCheckBoxWrapper","ButtonLink","TitleAndInput","style","inputContainerStyle","default","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","rest","imageUploadContainer","bulkUploadContainer","submitValue","href","target","download","width","buttonType","buildField","index","input","theme","size","styleInput","styleField","fieldMassiveBattle","defineLayoutClass","layout","grid","layoutBulk","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","subtitleSize","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"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 InputFileDraggable from '../../atom/input-file-draggable';\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, ...rest} = 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 <InputFileDraggable {...field} />\n </div>\n );\n case 'bulkUpload':\n return (\n <div className={style.bulkUploadContainer}>\n <InputFileDraggable {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n case 'password':\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 (\n <ButtonLink\n {...field}\n type=\"primary\"\n label={field.submitValue}\n link={\n field.href ? {href: field.href, target: field.target, download: field.download} : null\n }\n customStyle={{width: 'fit-content'}}\n />\n );\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 {...rest} type={'text'} />;\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 ...InputText.propTypes,\n type: PropTypes.oneOf(['password']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\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 ...InputFileDraggable.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...InputFileDraggable.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', 'password']),\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,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB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CAAC+C,SADnB;IAEEpC,IAAI,EAAElC,SAAS,CAAC2E,KAAV,CAAgB,CAAC,eAAD,CAAhB;EAFR,GA5FkB,CAApB,CADM;AANiB,CAA3B;AA0GA,eAAenB,cAAf"}
|
|
@@ -47,6 +47,7 @@ declare namespace CourseSections {
|
|
|
47
47
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
description: PropTypes.Requireable<string>;
|
|
49
49
|
modified: PropTypes.Requireable<boolean>;
|
|
50
|
+
type: PropTypes.Requireable<string>;
|
|
50
51
|
valid: PropTypes.Requireable<boolean>;
|
|
51
52
|
'aria-label': PropTypes.Requireable<string>;
|
|
52
53
|
'data-name': PropTypes.Requireable<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default ProgressWrapper;
|
|
2
|
-
declare function ProgressWrapper({
|
|
3
|
-
completedCourses: any;
|
|
2
|
+
declare function ProgressWrapper({ completedModules, mandatoryModules, title, subtitle, progression, sections }: {
|
|
4
3
|
completedModules: any;
|
|
4
|
+
mandatoryModules: any;
|
|
5
5
|
title: any;
|
|
6
6
|
subtitle: any;
|
|
7
7
|
progression: any;
|
|
@@ -14,13 +14,12 @@ declare namespace ProgressWrapper {
|
|
|
14
14
|
namespace propTypes {
|
|
15
15
|
const title: PropTypes.Requireable<string>;
|
|
16
16
|
const subtitle: PropTypes.Requireable<string>;
|
|
17
|
-
const completedCourses: PropTypes.Requireable<number>;
|
|
18
17
|
const completedModules: PropTypes.Requireable<number>;
|
|
18
|
+
const mandatoryModules: PropTypes.Requireable<number>;
|
|
19
19
|
const progression: PropTypes.Requireable<number>;
|
|
20
20
|
const sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
21
21
|
type: PropTypes.Requireable<string>;
|
|
22
|
-
|
|
23
|
-
onDownload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
downloadUrl: PropTypes.Requireable<string>;
|
|
24
23
|
stars: PropTypes.Requireable<number>;
|
|
25
24
|
}> | null | undefined)[]>;
|
|
26
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AA6FA;;;;;;;8BAuDC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _map from "lodash/fp/map";
|
|
2
|
-
import _lowerCase from "lodash/fp/lowerCase";
|
|
3
2
|
import _isEmpty from "lodash/fp/isEmpty";
|
|
4
3
|
|
|
5
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -24,8 +23,7 @@ const DetailSection = ({
|
|
|
24
23
|
index,
|
|
25
24
|
type,
|
|
26
25
|
isLocked,
|
|
27
|
-
|
|
28
|
-
onDownload,
|
|
26
|
+
downloadUrl,
|
|
29
27
|
stars
|
|
30
28
|
}, context) => {
|
|
31
29
|
const {
|
|
@@ -34,7 +32,10 @@ const DetailSection = ({
|
|
|
34
32
|
const isTypeStars = type === 'stars';
|
|
35
33
|
const DownloadButton = /*#__PURE__*/React.createElement(ButtonLink, {
|
|
36
34
|
label: translate('download'),
|
|
37
|
-
|
|
35
|
+
link: {
|
|
36
|
+
target: '_blank',
|
|
37
|
+
href: downloadUrl
|
|
38
|
+
},
|
|
38
39
|
"data-name": "download-button",
|
|
39
40
|
"aria-label": "download button",
|
|
40
41
|
customStyle: {
|
|
@@ -86,7 +87,7 @@ const DetailSection = ({
|
|
|
86
87
|
className: style[`detailsSection${index}`]
|
|
87
88
|
}, /*#__PURE__*/React.createElement("img", {
|
|
88
89
|
className: style.img,
|
|
89
|
-
src:
|
|
90
|
+
src: type === 'badge' ? downloadUrl : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
|
|
90
91
|
}), /*#__PURE__*/React.createElement("div", {
|
|
91
92
|
className: style.detailsInfo
|
|
92
93
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -99,8 +100,8 @@ const DetailSection = ({
|
|
|
99
100
|
};
|
|
100
101
|
|
|
101
102
|
const ProgressWrapper = ({
|
|
102
|
-
completedCourses,
|
|
103
103
|
completedModules,
|
|
104
|
+
mandatoryModules,
|
|
104
105
|
title,
|
|
105
106
|
subtitle,
|
|
106
107
|
progression,
|
|
@@ -109,7 +110,7 @@ const ProgressWrapper = ({
|
|
|
109
110
|
const {
|
|
110
111
|
translate
|
|
111
112
|
} = context;
|
|
112
|
-
const
|
|
113
|
+
const mandatoryCompletedModulesLocal = translate('modules_completed_mandatory');
|
|
113
114
|
const isLocked = progression !== 100;
|
|
114
115
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
116
|
className: style.container
|
|
@@ -126,13 +127,7 @@ const ProgressWrapper = ({
|
|
|
126
127
|
className: style.stats
|
|
127
128
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
128
129
|
className: style.statsNumber
|
|
129
|
-
},
|
|
130
|
-
className: style.divider
|
|
131
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
132
|
-
className: style.statsModule
|
|
133
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
134
|
-
className: style.statsNumber
|
|
135
|
-
}, completedModules), modulesCompletedLocal)), /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
}, `${completedModules > mandatoryModules ? mandatoryModules : completedModules} / ${mandatoryModules}`), mandatoryCompletedModulesLocal)), /*#__PURE__*/React.createElement("div", {
|
|
136
131
|
className: style.progression
|
|
137
132
|
}, /*#__PURE__*/React.createElement("span", {
|
|
138
133
|
className: style.statsNumber
|
|
@@ -145,27 +140,19 @@ const ProgressWrapper = ({
|
|
|
145
140
|
value: progression,
|
|
146
141
|
max: 100
|
|
147
142
|
}), /*#__PURE__*/React.createElement("div", {
|
|
148
|
-
className: style.statsMobile
|
|
149
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
150
|
-
className: style.statsModuleMobile
|
|
151
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
152
|
-
className: style.statsNumber
|
|
153
|
-
}, completedModules), modulesCompletedLocal), /*#__PURE__*/React.createElement("div", {
|
|
154
143
|
className: style.statsProgressionMobile
|
|
155
144
|
}, /*#__PURE__*/React.createElement("span", {
|
|
156
145
|
className: style.statsNumber
|
|
157
|
-
}, progression, "%"))
|
|
146
|
+
}, progression, "%")), _isEmpty(sections) ? null : /*#__PURE__*/React.createElement("div", {
|
|
158
147
|
className: style.details
|
|
159
148
|
}, uncappedMap(({
|
|
160
149
|
type,
|
|
161
150
|
stars,
|
|
162
|
-
|
|
163
|
-
onDownload
|
|
151
|
+
downloadUrl
|
|
164
152
|
}, index) => /*#__PURE__*/React.createElement(DetailSection, {
|
|
165
153
|
type,
|
|
166
154
|
isLocked,
|
|
167
|
-
|
|
168
|
-
onDownload,
|
|
155
|
+
downloadUrl,
|
|
169
156
|
stars,
|
|
170
157
|
key: `${type}-${index}`,
|
|
171
158
|
index: index
|
|
@@ -174,8 +161,7 @@ const ProgressWrapper = ({
|
|
|
174
161
|
|
|
175
162
|
const commonDetailSectionPropTypes = process.env.NODE_ENV !== "production" ? {
|
|
176
163
|
type: PropTypes.oneOf(['diploma', 'badge', 'stars']),
|
|
177
|
-
|
|
178
|
-
onDownload: PropTypes.func,
|
|
164
|
+
downloadUrl: PropTypes.string,
|
|
179
165
|
stars: PropTypes.number
|
|
180
166
|
} : {};
|
|
181
167
|
DetailSection.contextTypes = {
|
|
@@ -191,8 +177,8 @@ ProgressWrapper.contextTypes = {
|
|
|
191
177
|
ProgressWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
192
178
|
title: PropTypes.string,
|
|
193
179
|
subtitle: PropTypes.string,
|
|
194
|
-
completedCourses: PropTypes.number,
|
|
195
180
|
completedModules: PropTypes.number,
|
|
181
|
+
mandatoryModules: PropTypes.number,
|
|
196
182
|
progression: PropTypes.number,
|
|
197
183
|
sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))
|
|
198
184
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","style","uncappedMap","convert","cap","DetailSection","index","type","isLocked","badgeUrl","onDownload","stars","context","translate","isTypeStars","DownloadButton","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedCourses","completedModules","title","subtitle","progression","sections","modulesCompletedLocal","container","titleContainer","statscontainer","stats","statsNumber","divider","statsModule","customProgressBar","positive","statsMobile","statsModuleMobile","statsProgressionMobile","details","commonDetailSectionPropTypes","oneOf","string","func","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, lowerCase, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, badgeUrl, onDownload, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n onClick={onDownload}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n badgeUrl ||\n 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedCourses, completedModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const modulesCompletedLocal = translate('modules_completed');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber}>{completedCourses}</span>\n {lowerCase(translate('courses_completed'))}\n </div>\n <div className={style.divider} />\n <div className={style.statsModule}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsMobile}>\n <div className={style.statsModuleMobile}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, badgeUrl, onDownload}, index) => (\n <DetailSection\n {...{type, isLocked, badgeUrl, onDownload, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n badgeUrl: PropTypes.string,\n onDownload: PropTypes.func,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,QAAP,MAAqB,qBAArB,C,CACA;;AACA,OAAOC,K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SAAS,CAACiE,MALG;EAM1BnB,QAAQ,EAAE9C,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACuE,KAAV,CAAgBV,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAerB,eAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","style","uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocal","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","positive","statsProgressionMobile","details","commonDetailSectionPropTypes","oneOf","string","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocal = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber}>\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, downloadUrl}, index) => (\n <DetailSection\n {...{type, isLocked, downloadUrl, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,QAAP,MAAqB,qBAArB,C,CACA;;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,KAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,WAAxB;EAAqCC;AAArC,CAAD,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AAhB,CAD6B;EAEnC3C,WAAW,EAAEhB,SAAS,CAAC4D,MAFY;EAGnC3C,KAAK,EAAEjB,SAAS,CAAC6D;AAHkB,CAArC;AAMAjD,aAAa,CAACkD,YAAd,GAA6B;EAC3B3C,SAAS,EAAEZ,QAAQ,CAACwD,iBAAT,CAA2B5C;AADX,CAA7B;AAIAP,aAAa,CAACoD,SAAd;EACEnD,KAAK,EAAEb,SAAS,CAAC6D,MADnB;EAEE9C,QAAQ,EAAEf,SAAS,CAACiE;AAFtB,GAGKP,4BAHL;AAMAjB,eAAe,CAACqB,YAAhB,GAA+B;EAC7B3C,SAAS,EAAEZ,QAAQ,CAACwD,iBAAT,CAA2B5C;AADT,CAA/B;AAIAsB,eAAe,CAACuB,SAAhB,2CAA4B;EAC1BpB,KAAK,EAAE5C,SAAS,CAAC4D,MADS;EAE1Bf,QAAQ,EAAE7C,SAAS,CAAC4D,MAFM;EAG1BlB,gBAAgB,EAAE1C,SAAS,CAAC6D,MAHF;EAI1BlB,gBAAgB,EAAE3C,SAAS,CAAC6D,MAJF;EAK1Bf,WAAW,EAAE9C,SAAS,CAAC6D,MALG;EAM1Bd,QAAQ,EAAE/C,SAAS,CAACkE,OAAV,CAAkBlE,SAAS,CAACmE,KAAV,CAAgBT,4BAAhB,CAAlB;AANgB,CAA5B;AASA,eAAejB,eAAf"}
|
|
@@ -41,14 +41,6 @@
|
|
|
41
41
|
gap: 16px;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.divider {
|
|
45
|
-
width: 4px;
|
|
46
|
-
height: 4px;
|
|
47
|
-
background-color: #d7d7da;
|
|
48
|
-
border: solid #d7d7da 1px;
|
|
49
|
-
border-radius: 4px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
44
|
.progression {
|
|
53
45
|
display: flex;
|
|
54
46
|
justify-content: end;
|
|
@@ -129,10 +121,6 @@
|
|
|
129
121
|
font-weight: 700;
|
|
130
122
|
}
|
|
131
123
|
|
|
132
|
-
.statsMobile {
|
|
133
|
-
display: none;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
124
|
.statsModuleMobile {
|
|
137
125
|
display: none;
|
|
138
126
|
}
|
|
@@ -140,6 +128,9 @@
|
|
|
140
128
|
.statsProgressionMobile {
|
|
141
129
|
composes: progression;
|
|
142
130
|
display: none;
|
|
131
|
+
color: cm_grey_400;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
padding-top: 16px;
|
|
143
134
|
}
|
|
144
135
|
|
|
145
136
|
@media mobile, tablet {
|
|
@@ -160,12 +151,6 @@
|
|
|
160
151
|
justify-content: space-around;
|
|
161
152
|
gap: 0;
|
|
162
153
|
}
|
|
163
|
-
.divider {
|
|
164
|
-
display: none;
|
|
165
|
-
}
|
|
166
|
-
.statsModule {
|
|
167
|
-
display: none;
|
|
168
|
-
}
|
|
169
154
|
.progression {
|
|
170
155
|
display: none;
|
|
171
156
|
}
|
|
@@ -175,11 +160,4 @@
|
|
|
175
160
|
.statsModuleMobile {
|
|
176
161
|
display: block;
|
|
177
162
|
}
|
|
178
|
-
.statsMobile {
|
|
179
|
-
display: flex;
|
|
180
|
-
justify-content: space-between;
|
|
181
|
-
padding-top: 16px;
|
|
182
|
-
color: cm_grey_400;
|
|
183
|
-
font-weight: 600;
|
|
184
|
-
}
|
|
185
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-slider/index.js"],"names":[],"mappings":";AAiBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-slider/index.js"],"names":[],"mappings":";AAiBA,sDAyEC;;;;AAsDD,wCAGE"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _map from "lodash/fp/map";
|
|
2
|
+
const _excluded = ["type"];
|
|
2
3
|
|
|
3
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
5
|
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
+
|
|
5
8
|
import React from 'react';
|
|
6
9
|
import PropTypes from 'prop-types';
|
|
7
10
|
import Accordion from '../../organism/accordion/toggler';
|
|
@@ -31,7 +34,8 @@ const SetupSlider = props => {
|
|
|
31
34
|
const buildInput = field => {
|
|
32
35
|
const {
|
|
33
36
|
type
|
|
34
|
-
} = field
|
|
37
|
+
} = field,
|
|
38
|
+
rest = _objectWithoutPropertiesLoose(field, _excluded);
|
|
35
39
|
|
|
36
40
|
switch (type) {
|
|
37
41
|
case 'switch':
|
|
@@ -80,8 +84,14 @@ const SetupSlider = props => {
|
|
|
80
84
|
theme: 'setup'
|
|
81
85
|
}, buildSlides(field.slides));
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
case 'text':
|
|
88
|
+
case 'password':
|
|
84
89
|
return /*#__PURE__*/React.createElement(InputText, field);
|
|
90
|
+
|
|
91
|
+
default:
|
|
92
|
+
return /*#__PURE__*/React.createElement(InputText, _extends({}, rest, {
|
|
93
|
+
type: 'text'
|
|
94
|
+
}));
|
|
85
95
|
}
|
|
86
96
|
};
|
|
87
97
|
|
|
@@ -127,6 +137,8 @@ const SlidePropTypes = process.env.NODE_ENV !== "production" ? PropTypes.shape({
|
|
|
127
137
|
type: PropTypes.oneOf(['image'])
|
|
128
138
|
})), PropTypes.shape(_extends({}, InputReadonly.propTypes, {
|
|
129
139
|
type: PropTypes.oneOf(['readonly'])
|
|
140
|
+
})), PropTypes.shape(_extends({}, InputText.propTypes, {
|
|
141
|
+
type: PropTypes.oneOf(['text', 'password'])
|
|
130
142
|
})), PropTypes.shape(_extends({}, InputDoublestep.propTypes, {
|
|
131
143
|
type: PropTypes.oneOf(['doublestep'])
|
|
132
144
|
})), PropTypes.shape(_extends({}, SetupCohortItem.propTypes, {
|