@coorpacademy/components 11.32.24-alpha.0 → 11.32.24
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/button-link/index.d.ts +1 -0
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +4 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +2 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +1 -0
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/circular-progress-bar/index.d.ts.map +1 -1
- package/es/atom/circular-progress-bar/index.js +2 -9
- package/es/atom/circular-progress-bar/index.js.map +1 -1
- package/es/atom/input-doublestep/index.d.ts +1 -0
- package/es/atom/input-doublestep/index.d.ts.map +1 -1
- package/es/atom/input-doublestep/index.js +38 -13
- package/es/atom/input-doublestep/index.js.map +1 -1
- package/es/atom/input-doublestep/style.css +7 -67
- package/es/atom/select/index.js +1 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +1 -0
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +8 -6
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/brand-create-form/index.d.ts.map +1 -1
- package/es/molecule/brand-create-form/index.js +9 -4
- package/es/molecule/brand-create-form/index.js.map +1 -1
- package/es/molecule/brand-download-box/index.d.ts.map +1 -1
- package/es/molecule/brand-download-box/index.js +11 -6
- package/es/molecule/brand-download-box/index.js.map +1 -1
- package/es/molecule/brand-download-box/style.css +6 -5
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +12 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +1 -1
- package/es/molecule/cm-popin/types.d.ts +3 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/discipline-associated-skills/index.js +1 -1
- package/es/molecule/discipline-associated-skills/index.js.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/learning-priority-modal/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-modal/index.js +8 -15
- package/es/molecule/learning-priority-modal/index.js.map +1 -1
- package/es/molecule/learning-priority-modal/style.css +0 -1
- package/es/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-setup-item/index.js +1 -1
- package/es/molecule/learning-priority-setup-item/index.js.map +1 -1
- package/es/molecule/setup-section/index.d.ts.map +1 -1
- package/es/molecule/setup-section/index.js +3 -1
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +2 -2
- package/es/molecule/skill-picker-modal/index.js +1 -1
- package/es/molecule/skill-picker-modal/index.js.map +1 -1
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +24 -15
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +1 -21
- package/es/organism/brand-learning-priorities/index.d.ts.map +1 -1
- package/es/organism/brand-learning-priorities/index.js +1 -14
- package/es/organism/brand-learning-priorities/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/style.css +2 -0
- package/es/organism/list-item/index.d.ts +3 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +7 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-items/index.d.ts +3 -0
- package/es/organism/setup-header/index.d.ts +4 -0
- package/es/organism/wizard-contents/index.d.ts +3 -0
- package/es/template/app-player/loading/index.d.ts +3 -0
- package/es/template/app-player/player/index.d.ts +6 -0
- package/es/template/app-player/player/slides/index.d.ts +3 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +3 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +3 -0
- package/es/template/app-review/index.d.ts +3 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +3 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +4 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +4 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +14 -0
- package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +6 -0
- package/es/template/common/search-page/index.d.ts +3 -0
- package/es/template/external-course/index.d.ts +3 -0
- package/lib/atom/button-link/index.d.ts +1 -0
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +4 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +2 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +1 -0
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/circular-progress-bar/index.d.ts.map +1 -1
- package/lib/atom/circular-progress-bar/index.js +1 -8
- package/lib/atom/circular-progress-bar/index.js.map +1 -1
- package/lib/atom/input-doublestep/index.d.ts +1 -0
- package/lib/atom/input-doublestep/index.d.ts.map +1 -1
- package/lib/atom/input-doublestep/index.js +39 -13
- package/lib/atom/input-doublestep/index.js.map +1 -1
- package/lib/atom/input-doublestep/style.css +7 -67
- package/lib/atom/select/index.js +1 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +1 -0
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +8 -6
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/brand-create-form/index.d.ts.map +1 -1
- package/lib/molecule/brand-create-form/index.js +9 -4
- package/lib/molecule/brand-create-form/index.js.map +1 -1
- package/lib/molecule/brand-download-box/index.d.ts.map +1 -1
- package/lib/molecule/brand-download-box/index.js +11 -6
- package/lib/molecule/brand-download-box/index.js.map +1 -1
- package/lib/molecule/brand-download-box/style.css +6 -5
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +12 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +1 -1
- package/lib/molecule/cm-popin/types.d.ts +3 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.js +1 -1
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/learning-priority-modal/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-modal/index.js +9 -14
- package/lib/molecule/learning-priority-modal/index.js.map +1 -1
- package/lib/molecule/learning-priority-modal/style.css +0 -1
- package/lib/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-setup-item/index.js +1 -1
- package/lib/molecule/learning-priority-setup-item/index.js.map +1 -1
- package/lib/molecule/setup-section/index.d.ts.map +1 -1
- package/lib/molecule/setup-section/index.js +4 -1
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +2 -2
- package/lib/molecule/skill-picker-modal/index.js +1 -1
- package/lib/molecule/skill-picker-modal/index.js.map +1 -1
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +24 -15
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +1 -21
- package/lib/organism/brand-learning-priorities/index.d.ts.map +1 -1
- package/lib/organism/brand-learning-priorities/index.js +3 -15
- package/lib/organism/brand-learning-priorities/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/style.css +2 -0
- package/lib/organism/list-item/index.d.ts +3 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +7 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-items/index.d.ts +3 -0
- package/lib/organism/setup-header/index.d.ts +4 -0
- package/lib/organism/wizard-contents/index.d.ts +3 -0
- package/lib/template/app-player/loading/index.d.ts +3 -0
- package/lib/template/app-player/player/index.d.ts +6 -0
- package/lib/template/app-player/player/slides/index.d.ts +3 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +3 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +3 -0
- package/lib/template/app-review/index.d.ts +3 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +3 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +4 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +4 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +14 -0
- package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +6 -0
- package/lib/template/common/search-page/index.d.ts +3 -0
- package/lib/template/external-course/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ConfirmationInput","onChange","placeholder","handleOnChange","useMemo","e","target","value","style","input","propTypes","PropTypes","func","string","ConfirmationForm","props","confirmValue","confirmDisabled","onConfirm","cancelValue","onHandleClose","textValidation","isPending","form","confirmForm","confirmEmptySpace","
|
|
1
|
+
{"version":3,"file":"index.js","names":["ConfirmationInput","onChange","placeholder","handleOnChange","useMemo","e","target","value","style","input","propTypes","PropTypes","func","string","ConfirmationForm","props","confirmValue","confirmDisabled","onConfirm","cancelValue","onHandleClose","textValidation","isPending","form","confirmForm","confirmEmptySpace","confirmationCTAWrapper","backgroundColor","color","isRequired","bool","Confirmation","description","sectionConfirm","inputDoubleProps","InputDoublestep","React","Component","constructor","context","state","open","handleToggle","bind","handleOnClick","setState","onCloseConfirmation","onOpenConfirmation","preventDefault","onClick","render","toggleValue","disabled","icon","formView","position","faIcon","name","size","wrapper"],"sources":["../../../src/atom/input-doublestep/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {snakeCase, omit, noop} from 'lodash/fp';\nimport Loader from '../loader';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\n\nconst ConfirmationInput = ({onChange, placeholder = ''}) => {\n const handleOnChange = useMemo(\n () => e => {\n return onChange(e.target.value);\n },\n [onChange]\n );\n\n return (\n <div>\n <input\n data-testid=\"input\"\n onInput={handleOnChange}\n placeholder={placeholder}\n className={style.input}\n onChange={noop}\n />\n </div>\n );\n};\n\nConfirmationInput.propTypes = {\n onChange: PropTypes.func,\n placeholder: PropTypes.string\n};\n\nconst ConfirmationForm = props => {\n const {\n confirmValue,\n confirmDisabled = false,\n onConfirm,\n cancelValue,\n onHandleClose,\n onChange,\n textValidation,\n placeholder,\n isPending = false\n } = props;\n\n const form = (\n <div className={style.confirmForm}>\n {textValidation ? (\n <ConfirmationInput onChange={onChange} placeholder={placeholder} />\n ) : (\n <div className={style.confirmEmptySpace} />\n )}\n <div className={style.confirmationCTAWrapper}>\n <ButtonLink\n label={cancelValue}\n data-testid=\"cancel-confirmation-button\"\n onClick={onHandleClose}\n />\n <ButtonLink\n label={confirmValue}\n disabled={confirmDisabled}\n data-testid=\"confirm-delete-button\"\n onClick={onConfirm}\n customStyle={{backgroundColor: 'orange', color: 'white'}}\n />\n </div>\n </div>\n );\n\n return isPending ? (\n <div className={style.confirmForm}>\n <Loader />\n </div>\n ) : (\n form\n );\n};\nConfirmationForm.propTypes = {\n confirmValue: PropTypes.string.isRequired,\n confirmDisabled: PropTypes.bool,\n onConfirm: PropTypes.func.isRequired,\n cancelValue: PropTypes.string.isRequired,\n onHandleClose: PropTypes.func.isRequired,\n textValidation: PropTypes.bool,\n isPending: PropTypes.bool,\n ...ConfirmationInput.propTypes\n};\n\nconst Confirmation = props => {\n const {description} = props;\n\n return (\n <div className={style.sectionConfirm}>\n <div className={style.description}>{description}</div>\n <ConfirmationForm {...props} />\n </div>\n );\n};\nConfirmation.propTypes = {\n description: PropTypes.string\n};\n\nconst inputDoubleProps = omit(['onConfirm', 'onHandleClose'], {...Confirmation.propTypes});\nclass InputDoublestep extends React.Component {\n static propTypes = {\n toggleValue: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n onOpenConfirmation: PropTypes.func,\n onCloseConfirmation: PropTypes.func,\n icon: PropTypes.string,\n ...inputDoubleProps\n };\n\n constructor(props, context) {\n super(props);\n this.state = {\n open: false\n };\n this.handleToggle = this.handleToggle.bind(this);\n this.handleOnClick = this.handleOnClick.bind(this);\n }\n\n handleToggle() {\n this.setState(state => ({\n open: !state.open\n }));\n\n const {open} = this.state;\n const {onCloseConfirmation = noop, onOpenConfirmation = noop} = this.props;\n open ? onCloseConfirmation() : onOpenConfirmation();\n }\n\n handleOnClick(e) {\n e.preventDefault();\n this.setState({open: false});\n const {onClick = noop} = this.props;\n return onClick(e);\n }\n\n render() {\n const {toggleValue, disabled, icon} = this.props;\n const {open} = this.state;\n\n const formView = !open ? (\n <ButtonLink\n {...(icon\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: icon,\n color: '#ffffff',\n size: 16\n }\n }\n }\n : {})}\n type=\"dangerous\"\n label={toggleValue}\n disabled={disabled}\n data-testid=\"input-toggle-button\"\n onClick={this.handleToggle}\n />\n ) : (\n <Confirmation\n {...this.props}\n onHandleClose={this.handleToggle}\n onConfirm={this.handleOnClick}\n />\n );\n\n return (\n <div className={style.wrapper}>\n <div data-name={`input_doublestep_${snakeCase(toggleValue)}`} className={style.value}>\n {formView}\n </div>\n </div>\n );\n }\n}\n\nexport default InputDoublestep;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,iBAAiB,GAAG,CAAC;EAACC,QAAD;EAAWC,WAAW,GAAG;AAAzB,CAAD,KAAkC;EAC1D,MAAMC,cAAc,GAAG,IAAAC,cAAA,EACrB,MAAMC,CAAC,IAAI;IACT,OAAOJ,QAAQ,CAACI,CAAC,CAACC,MAAF,CAASC,KAAV,CAAf;EACD,CAHoB,EAIrB,CAACN,QAAD,CAJqB,CAAvB;EAOA,oBACE,uDACE;IACE,eAAY,OADd;IAEE,OAAO,EAAEE,cAFX;IAGE,WAAW,EAAED,WAHf;IAIE,SAAS,EAAEM,cAAA,CAAMC,KAJnB;IAKE,QAAQ;EALV,EADF,CADF;AAWD,CAnBD;;AAqBAT,iBAAiB,CAACU,SAAlB,2CAA8B;EAC5BT,QAAQ,EAAEU,kBAAA,CAAUC,IADQ;EAE5BV,WAAW,EAAES,kBAAA,CAAUE;AAFK,CAA9B;;AAKA,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;EAChC,MAAM;IACJC,YADI;IAEJC,eAAe,GAAG,KAFd;I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|
38
|
-
.toggle {
|
|
39
|
-
height: 52px;
|
|
40
|
-
padding: 0 40px;
|
|
41
|
-
line-height: 52px;
|
|
42
|
-
border-radius: 2px;
|
|
43
|
-
font-family: 'Gilroy';
|
|
44
|
-
font-size: 15px;
|
|
45
|
-
color: white;
|
|
46
|
-
font-weight: 700px;
|
|
47
|
-
display: block;
|
|
48
|
-
background-color: negative;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
text-align: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.toggleDisabled {
|
|
54
|
-
composes: toggle;
|
|
55
|
-
cursor: default;
|
|
56
|
-
background-color: light;
|
|
57
|
-
border: 1px solid light;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.button {
|
|
61
|
-
height: 32px;
|
|
62
|
-
padding: 0 15px;
|
|
63
|
-
text-transform: uppercase;
|
|
64
|
-
border-radius: 2px;
|
|
65
|
-
font-family: 'Gilroy';
|
|
66
|
-
font-size: 15px;
|
|
67
|
-
font-weight: 700;
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
line-height: 30px;
|
|
70
|
-
text-align: center;
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.cancel {
|
|
75
|
-
composes: button;
|
|
76
|
-
border: 1px solid dark;
|
|
77
|
-
color: white;
|
|
78
|
-
background-color: dark;
|
|
79
|
-
margin-right: 10px;
|
|
80
|
-
margin-bottom: 10px;
|
|
81
|
-
font-weight: 600;
|
|
82
|
-
display: inline-block;
|
|
83
|
-
min-width: 120px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.delete {
|
|
87
|
-
composes: button;
|
|
88
|
-
border: 1px solid orange;
|
|
89
|
-
color: white;
|
|
90
|
-
background-color: orange;
|
|
91
|
-
margin-right: 5px;
|
|
92
|
-
margin-bottom: 10px;
|
|
93
|
-
font-weight: 600;
|
|
94
|
-
display: inline-block;
|
|
95
|
-
min-width: 120px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.disabled {
|
|
99
|
-
composes: delete;
|
|
100
|
-
cursor: default;
|
|
101
|
-
background-color: light;
|
|
102
|
-
border: 1px solid light;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
38
|
.description {
|
|
106
39
|
font-family: 'Gilroy';
|
|
107
40
|
font-weight: 500;
|
|
@@ -123,3 +56,10 @@
|
|
|
123
56
|
width: 230px;
|
|
124
57
|
appearance: none;
|
|
125
58
|
}
|
|
59
|
+
|
|
60
|
+
.confirmationCTAWrapper {
|
|
61
|
+
display: flex;
|
|
62
|
+
margin: auto;
|
|
63
|
+
width: 50%;
|
|
64
|
+
gap: 16px;
|
|
65
|
+
}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -72,7 +72,7 @@ const ArrowView = ({
|
|
|
72
72
|
color: arrowColor
|
|
73
73
|
}, {
|
|
74
74
|
className: arrowClass
|
|
75
|
-
}), [
|
|
75
|
+
}), [arrowClass, arrowColor]);
|
|
76
76
|
|
|
77
77
|
if (shouldRender) {
|
|
78
78
|
return isArrowUp ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowTop, _extends({}, props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,E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CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,WAAW,EAAET,cAAA,CAAMS,WAVF;EAWjBC,YAAY,EAAE;AAXG,CAAnB;;AAcA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,UAArC;EAAiDC;AAAjD,CAAD,KAAkE;EAClF,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,mBACMF,UAAU,GACZ;IACEG,KAAK,EAAEH;EADT,CAFJ;IAKEI,SAAS,EAAEL;EALb,E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AI,EAAE+D,iBAAA,CAASC,iBAAT,CAA2BhE;AADb,CAAtB;AAIAjB,MAAM,CAACkF,SAAP,2CAAmB;EACjBpE,KAAK,EAAEwD,kBAAA,CAAUC,MADA;EAEjBrE,IAAI,EAAEoE,kBAAA,CAAUC,MAFC;EAGjBxE,SAAS,EAAEuE,kBAAA,CAAUC,MAHJ;EAIjBlE,eAAe,EAAEiE,kBAAA,CAAUC,MAJV;EAKjB/D,QAAQ,EAAE8D,kBAAA,CAAUK,IALH;EAMjBpE,QAAQ,EAAE+D,kBAAA,CAAUK,IANH;EAOjBjE,WAAW,EAAE4D,kBAAA,CAAUC,MAPN;EAQjB9D,QAAQ,EAAE6D,kBAAA,CAAUK,IARH;EASjBrE,QAAQ,EAAEgE,kBAAA,CAAUa,IATH;EAUjBxE,KAAK,EAAE2D,kBAAA,CAAUc,KAAV,CAAgB,IAAAC,aAAA,EAAK5G,UAAL,CAAhB,CAVU;EAWjB0B,OAAO,EAAEmE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBjE,SAAS,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
|
|
@@ -47,6 +47,7 @@ declare namespace BaseModal {
|
|
|
47
47
|
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
iconName: PropTypes.Requireable<string>;
|
|
49
49
|
disabled: PropTypes.Requireable<boolean>;
|
|
50
|
+
color: PropTypes.Requireable<string>;
|
|
50
51
|
}>>;
|
|
51
52
|
}> | null | undefined>>;
|
|
52
53
|
const onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AASA,yEA6GC"}
|
|
@@ -60,9 +60,10 @@ const BaseModal = (props, context) => {
|
|
|
60
60
|
label: confirmLabel,
|
|
61
61
|
onConfirm,
|
|
62
62
|
disabled: confirmDisabled,
|
|
63
|
-
iconName
|
|
63
|
+
iconName,
|
|
64
|
+
color
|
|
64
65
|
} = confirmButton || {};
|
|
65
|
-
const
|
|
66
|
+
const buttonConfirmColor = color || (0, _get2.default)('common.primary', skin);
|
|
66
67
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
68
|
className: _style.default.footer
|
|
68
69
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -75,9 +76,9 @@ const BaseModal = (props, context) => {
|
|
|
75
76
|
disabled: cancelDisabled
|
|
76
77
|
}) : null, onConfirm && confirmLabel ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({
|
|
77
78
|
customStyle: {
|
|
78
|
-
backgroundColor:
|
|
79
|
+
backgroundColor: buttonConfirmColor
|
|
79
80
|
},
|
|
80
|
-
hoverBackgroundColor: (0, _cssColorFunction.convert)(`hsl(from ${
|
|
81
|
+
hoverBackgroundColor: (0, _cssColorFunction.convert)(`hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`),
|
|
81
82
|
hoverColor: '#FFFFFF',
|
|
82
83
|
className: _style.default.footerConfirmButton,
|
|
83
84
|
type: 'primary',
|
|
@@ -96,7 +97,7 @@ const BaseModal = (props, context) => {
|
|
|
96
97
|
} : {}))) : null), text ? /*#__PURE__*/_react.default.createElement("div", {
|
|
97
98
|
className: `${_style.default.footerDescription} ${isError ? _style.default.footerDescriptionError : ''}`
|
|
98
99
|
}, text) : null);
|
|
99
|
-
}, [footer, skin
|
|
100
|
+
}, [footer, skin]);
|
|
100
101
|
if (!isOpen || !title || !children) return null;
|
|
101
102
|
|
|
102
103
|
function handleOnClose(e) {
|
|
@@ -166,7 +167,8 @@ BaseModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
166
167
|
label: _propTypes.default.string,
|
|
167
168
|
onConfirm: _propTypes.default.func,
|
|
168
169
|
iconName: _propTypes.default.string,
|
|
169
|
-
disabled: _propTypes.default.bool
|
|
170
|
+
disabled: _propTypes.default.bool,
|
|
171
|
+
color: _propTypes.default.string
|
|
170
172
|
})
|
|
171
173
|
})]),
|
|
172
174
|
onClose: _propTypes.default.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","skin","Footer","useCallback","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","
|
|
1
|
+
{"version":3,"file":"index.js","names":["BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","skin","Footer","useCallback","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","color","buttonConfirmColor","style","footerCTAWrapper","className","footerCancelButton","type","onClick","customStyle","backgroundColor","hoverBackgroundColor","convert","hoverColor","footerConfirmButton","icon","position","faIcon","name","size","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","body","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","node","bool","oneOfType","func","boolean"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {title, description, headerIcon, children, isOpen, footer, onClose} = props;\n const {skin} = context;\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName,\n color\n } = confirmButton || {};\n const buttonConfirmColor = color || get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.footerCancelButton,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: buttonConfirmColor},\n hoverBackgroundColor: convert(\n `hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: '#FFFFFF',\n className: style.footerConfirmButton,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: '#FFFFFF',\n size: 16\n }\n }\n }\n : {})\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper}>\n <div className={style.modal}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose}>\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div className={style.body}>{children}</div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool,\n color: PropTypes.string\n })\n })\n ]),\n onClose: PropTypes.func\n};\n\nexport default BaseModal;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC,UAArB;IAAiCC,QAAjC;IAA2CC,MAA3C;IAAmDC,MAAnD;IAA2DC;EAA3D,IAAsER,KAA5E;EACA,MAAM;IAACS;EAAD,IAASR,OAAf;EAEA,MAAMS,MAAM,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAC/B,IAAI,uBAAQJ,MAAR,CAAJ,EAAqB,OAAO,IAAP;IACrB,IAAI,OAAO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kD,kBAAA,CAAUE,KAAV,CAAgB;MAC7BjD,KAAK,EAAE+C,kBAAA,CAAUC,MADY;MAE7B1C,SAAS,EAAEyC,kBAAA,CAAUM,IAFQ;MAG7B7C,QAAQ,EAAEuC,kBAAA,CAAUC,MAHS;MAI7B7C,QAAQ,EAAE4C,kBAAA,CAAUI,IAJS;MAK7B1C,KAAK,EAAEsC,kBAAA,CAAUC;IALY,CAAhB;EARD,CAAhB,CAF0B,CAApB,CAVY;EA6BpBxD,OAAO,EAAEuD,kBAAA,CAAUM;AA7BC,CAAtB;eAgCetE,S"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-create-form/index.js"],"names":[],"mappings":";AAOA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-create-form/index.js"],"names":[],"mappings":";AAOA,wEA4DC"}
|
|
@@ -7,7 +7,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
11
11
|
|
|
12
12
|
var _loader = _interopRequireDefault(require("../../atom/loader"));
|
|
13
13
|
|
|
@@ -47,11 +47,16 @@ const BrandCreateForm = (props, context) => {
|
|
|
47
47
|
className: _style.default.wait
|
|
48
48
|
}, waitMessage), /*#__PURE__*/_react.default.createElement("div", {
|
|
49
49
|
className: _style.default.loading
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(_loader.default, null))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_loader.default, null))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
51
|
+
type: "primary",
|
|
51
52
|
"data-name": "brand_create_submit_button",
|
|
52
|
-
|
|
53
|
+
usage: "submit",
|
|
54
|
+
customStyle: {
|
|
55
|
+
display: 'inline-block',
|
|
56
|
+
width: 'fit-content'
|
|
57
|
+
},
|
|
53
58
|
disabled: disabled,
|
|
54
|
-
|
|
59
|
+
label: submitValue
|
|
55
60
|
}));
|
|
56
61
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
62
|
className: wrapperClass
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","style","modifiedWrapper","wrapper","fieldClass","default","disabled","onChange","handleChange","useMemo","e","target","value","actionView","wait","loading","header","content","placeholder","label","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","func","bool"],"sources":["../../../src/molecule/brand-create-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","style","modifiedWrapper","wrapper","fieldClass","default","disabled","onChange","handleChange","useMemo","e","target","value","actionView","wait","loading","display","width","header","content","placeholder","label","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","func","bool"],"sources":["../../../src/molecule/brand-create-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst BrandCreateForm = (props, context) => {\n const {title, subtitle, description, field, onSubmit, submitValue, isPending, isModified} = props;\n const {translate} = context;\n const waitMessage = translate('Wait_creation');\n\n const wrapperClass =\n isModified || isPending || field.error ? style.modifiedWrapper : style.wrapper;\n const fieldClass = field.error ? style.error : style.default;\n const disabled = isPending || !isModified;\n const {onChange} = field;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const actionView = isPending ? (\n <div>\n <div className={style.wait}>{waitMessage}</div>\n <div className={style.loading}>\n <Loader />\n </div>\n </div>\n ) : (\n <div>\n <ButtonLink\n type=\"primary\"\n data-name=\"brand_create_submit_button\"\n usage=\"submit\"\n customStyle={{\n display: 'inline-block',\n width: 'fit-content'\n }}\n disabled={disabled}\n label={submitValue}\n />\n </div>\n );\n\n return (\n <div className={wrapperClass}>\n <div className={style.header}>\n <h1>{title}</h1>\n </div>\n <form className={style.content} onSubmit={onSubmit}>\n <h2>{subtitle}</h2>\n <div className={style.description}>{description}</div>\n <div className={fieldClass}>\n <label>\n <input\n type=\"text\"\n maxLength=\"40\"\n data-name=\"brand_create_text_input\"\n placeholder={field.placeholder}\n defaultValue={field.value}\n onInput={handleChange}\n />\n {field.label}\n </label>\n </div>\n {actionView}\n </form>\n </div>\n );\n};\n\nBrandCreateForm.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nBrandCreateForm.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n field: PropTypes.shape({\n placeholder: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n error: PropTypes.string,\n value: PropTypes.string\n }).isRequired,\n onSubmit: PropTypes.func.isRequired,\n submitValue: PropTypes.string.isRequired,\n isPending: PropTypes.bool,\n isModified: PropTypes.bool\n};\n\nexport default BrandCreateForm;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC1C,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,WAAlB;IAA+BC,KAA/B;IAAsCC,QAAtC;IAAgDC,WAAhD;IAA6DC,SAA7D;IAAwEC;EAAxE,IAAsFT,KAA5F;EACA,MAAM;IAACU;EAAD,I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ts","sourceRoot":"","sources":["../../../src/molecule/brand-download-box/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-download-box/index.js"],"names":[],"mappings":";AAQA,yEA8BC"}
|
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
15
15
|
|
|
16
16
|
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
17
17
|
|
|
@@ -52,13 +52,18 @@ const BrandDownloadBox = (props, context) => {
|
|
|
52
52
|
}, description));
|
|
53
53
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
className: _style.default.wrapper
|
|
55
|
-
}, type, /*#__PURE__*/_react.default.createElement(
|
|
55
|
+
}, type, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
56
56
|
className: _style.default.button,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
link: {
|
|
58
|
+
href,
|
|
59
|
+
download: true
|
|
60
|
+
},
|
|
60
61
|
onClick: onClick,
|
|
61
|
-
|
|
62
|
+
label: submitValue,
|
|
63
|
+
customStyle: {
|
|
64
|
+
backgroundColor: '#FFA000',
|
|
65
|
+
color: 'white'
|
|
66
|
+
}
|
|
62
67
|
}));
|
|
63
68
|
};
|
|
64
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BrandDownloadBox","props","context","title","warning","description","href","onClick","submitValue","skin","negativeColor","type","style","texts","icon","color","titleTexts","wrapper","button","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","func"],"sources":["../../../src/molecule/brand-download-box/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {NovaSolidInterfaceFeedbackInterfaceAlertCircle as AlertIcon} from '@coorpacademy/nova-icons';\nimport {get} from 'lodash/fp';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["BrandDownloadBox","props","context","title","warning","description","href","onClick","submitValue","skin","negativeColor","type","style","texts","icon","color","titleTexts","wrapper","button","download","backgroundColor","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","func"],"sources":["../../../src/molecule/brand-download-box/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {NovaSolidInterfaceFeedbackInterfaceAlertCircle as AlertIcon} from '@coorpacademy/nova-icons';\nimport {get} from 'lodash/fp';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst BrandDownloadBox = (props, context) => {\n const {title = '', warning = '', description = '', href = '', onClick, submitValue = ''} = props;\n const {skin} = context;\n const negativeColor = get('common.negative', skin);\n\n const type = warning ? (\n <div className={style.texts}>\n <AlertIcon className={style.icon} style={{color: negativeColor}} />\n <span className={style.warning}>{warning}</span>\n <p className={style.description}>{description}</p>\n </div>\n ) : (\n <div className={style.titleTexts}>\n <span className={style.title}>{title}</span>\n <p className={style.description}>{description}</p>\n </div>\n );\n\n return (\n <div className={style.wrapper}>\n {type}\n <ButtonLink\n className={style.button}\n link={{href, download: true}}\n onClick={onClick}\n label={submitValue}\n customStyle={{backgroundColor: '#FFA000', color: 'white'}}\n />\n </div>\n );\n};\n\nBrandDownloadBox.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandDownloadBox.propTypes = {\n title: PropTypes.string,\n warning: PropTypes.string,\n description: PropTypes.string,\n href: PropTypes.string,\n onClick: PropTypes.func,\n submitValue: PropTypes.string\n};\n\nexport default BrandDownloadBox;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IAACC,KAAK,GAAG,EAAT;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CAA6B;EAC3BrB,KAAK,EAAEsB,kBAAA,CAAUC,MADU;EAE3BtB,OAAO,EAAEqB,kBAAA,CAAUC,MAFQ;EAG3BrB,WAAW,EAAEoB,kBAAA,CAAUC,MAHI;EAI3BpB,IAAI,EAAEmB,kBAAA,CAAUC,MAJW;EAK3BnB,OAAO,EAAEkB,kBAAA,CAAUE,IALQ;EAM3BnB,WAAW,EAAEiB,kBAAA,CAAUC;AANI,CAA7B;eASe1B,gB"}
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
width: 80%;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.wrapper > .button {
|
|
23
|
-
background-color: dark;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
22
|
.icon {
|
|
27
23
|
width: 32px;
|
|
28
24
|
height: 32px;
|
|
@@ -47,13 +43,18 @@
|
|
|
47
43
|
font-size: 13px;
|
|
48
44
|
}
|
|
49
45
|
|
|
46
|
+
.button {
|
|
47
|
+
width: 200px;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
@media mobile {
|
|
51
53
|
.wrapper {
|
|
52
54
|
display: block;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
.button {
|
|
56
|
-
display: block;
|
|
57
58
|
width: 100%;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -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":";AA6HA,yDAuBC"}
|
|
@@ -140,7 +140,18 @@ const buildInput = field => {
|
|
|
140
140
|
|
|
141
141
|
case 'button':
|
|
142
142
|
case 'link':
|
|
143
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, field, {
|
|
144
|
+
type: "primary",
|
|
145
|
+
label: field.submitValue,
|
|
146
|
+
link: field.href ? {
|
|
147
|
+
href: field.href,
|
|
148
|
+
target: field.target,
|
|
149
|
+
download: field.download
|
|
150
|
+
} : null,
|
|
151
|
+
customStyle: {
|
|
152
|
+
width: 'fit-content'
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
144
155
|
|
|
145
156
|
case 'buttonLink':
|
|
146
157
|
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, field, {
|