@coorpacademy/components 11.9.1 → 11.9.2-alpha.12
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/drag-and-drop/style.css +14 -9
- package/es/atom/image-upload/index.d.ts +6 -1
- package/es/atom/image-upload/index.d.ts.map +1 -1
- package/es/atom/image-upload/index.js +24 -4
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/image-upload/style.css +7 -0
- package/es/atom/title/index.d.ts +1 -0
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +14 -5
- package/es/atom/title/index.js.map +1 -1
- package/es/atom/title/style.css +6 -0
- package/es/molecule/brand-form-group/index.d.ts +5 -0
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +4 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +9 -10
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/es/molecule/setup-slide/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts +2 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +3 -0
- package/es/organism/brand-form/index.d.ts +5 -0
- package/es/organism/rewards-form/index.d.ts +3 -0
- package/es/organism/wizard-contents/index.d.ts +10 -2
- package/es/organism/wizard-contents/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.js +9 -4
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/style.css +36 -4
- package/es/template/back-office/brand-update/index.d.ts +15 -2
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +14 -9
- package/lib/atom/image-upload/index.d.ts +6 -1
- package/lib/atom/image-upload/index.d.ts.map +1 -1
- package/lib/atom/image-upload/index.js +25 -4
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/image-upload/style.css +7 -0
- package/lib/atom/title/index.d.ts +1 -0
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +14 -5
- package/lib/atom/title/index.js.map +1 -1
- package/lib/atom/title/style.css +6 -0
- package/lib/molecule/brand-form-group/index.d.ts +5 -0
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +4 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +9 -10
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/lib/molecule/setup-slide/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts +2 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +3 -0
- package/lib/organism/brand-form/index.d.ts +5 -0
- package/lib/organism/rewards-form/index.d.ts +3 -0
- package/lib/organism/wizard-contents/index.d.ts +10 -2
- package/lib/organism/wizard-contents/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.js +9 -4
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +36 -4
- package/lib/template/back-office/brand-update/index.d.ts +15 -2
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -126,10 +126,10 @@ const WizardContents = props => {
|
|
|
126
126
|
className: style.container,
|
|
127
127
|
"data-name": "content-summary"
|
|
128
128
|
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: style.leftSection
|
|
129
|
+
className: summary ? style.leftSection : style.leftSectionWithoutSummary
|
|
130
130
|
}, headerView, /*#__PURE__*/React.createElement("div", {
|
|
131
131
|
className: style.form
|
|
132
|
-
}, formView)), /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
}, formView)), summary ? /*#__PURE__*/React.createElement("div", {
|
|
133
133
|
className: style.rightSection,
|
|
134
134
|
"data-name": "summary-right-section"
|
|
135
135
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -139,7 +139,7 @@ const WizardContents = props => {
|
|
|
139
139
|
"data-name": "summary-zone"
|
|
140
140
|
}, /*#__PURE__*/React.createElement(WizardSummary, _extends({}, summary, {
|
|
141
141
|
side: 'right'
|
|
142
|
-
}))), rightActionView)), /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
}))), rightActionView)) : null, summary ? /*#__PURE__*/React.createElement("div", {
|
|
143
143
|
className: style.footer,
|
|
144
144
|
"data-name": "summary-footer-section"
|
|
145
145
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -148,6 +148,11 @@ const WizardContents = props => {
|
|
|
148
148
|
side: 'footer'
|
|
149
149
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
150
150
|
className: style.actionFooter
|
|
151
|
+
}, footerActionView)) : /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: style.footerWithoutSummary,
|
|
153
|
+
"data-name": "footer-section"
|
|
154
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
className: style.actionFooterWithoutSummary
|
|
151
156
|
}, footerActionView)));
|
|
152
157
|
};
|
|
153
158
|
|
|
@@ -158,7 +163,7 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
158
163
|
onClick: PropTypes.func
|
|
159
164
|
}).isRequired,
|
|
160
165
|
steps: WizardSteps.propTypes.steps,
|
|
161
|
-
summary: PropTypes.shape(_extends({}, WizardSummary.propTypes))
|
|
166
|
+
summary: PropTypes.shape(_extends({}, WizardSummary.propTypes)),
|
|
162
167
|
content: PropTypes.oneOfType([PropTypes.shape(_extends({}, BrandForm.propTypes, {
|
|
163
168
|
type: PropTypes.oneOf(['form'])
|
|
164
169
|
})), PropTypes.shape(_extends({}, ContentTranslate.propTypes, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","bool","shape","string","func","isRequired","oneOfType","oneOf"],"sources":["../../../src/organism/wizard-contents/index.js"],"sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport RewardsForm from '../rewards-form';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'content-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n case 'rewards':\n return <RewardsForm {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"content-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n }),\n PropTypes.shape({\n ...RewardsForm.propTypes,\n type: PropTypes.oneOf(['rewards'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,gBAAP,MAA6B,wBAA7B;AACA,OAAOC,6BAAP,MAA0C,6BAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;EAC3C,MAAM;IAACC,KAAD;IAAQC;EAAR,IAAmBH,YAAzB;EAEA,MAAMI,eAAe,GAAG;IACtBC,IAAI,EAAE,OADgB;IAEtB,aAAa,cAFS;IAGtB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MAFO;IAGxB/C,OAAO,EAAEhB,SAAS,CAACgE;EAHK,CAAhB;AAxCe,CAA3B;AA+CA,eAAerB,cAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","leftSectionWithoutSummary","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","footerWithoutSummary","actionFooterWithoutSummary","propTypes","bool","shape","string","func","isRequired","oneOfType","oneOf"],"sources":["../../../src/organism/wizard-contents/index.js"],"sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport RewardsForm from '../rewards-form';\nimport style from './style.css';\nimport isEmpty from 'lodash/fp/isEmpty';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'content-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n case 'rewards':\n return <RewardsForm {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n\n return (\n <div className={style.container} data-name=\"content-summary\">\n <div className={summary ? style.leftSection: style.leftSectionWithoutSummary}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n {summary ? (\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n ) : null}\n {summary ? ( <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n ) : ( <div className={style.footerWithoutSummary} data-name=\"footer-section\">\n <div className={style.actionFooterWithoutSummary}>{footerActionView}</div>\n </div>)}\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n }),\n PropTypes.shape({\n ...RewardsForm.propTypes,\n type: PropTypes.oneOf(['rewards'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,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3BtE,SAAS,CAACiE,KAAV,cACKxD,cAAc,CAACsD,SADpB;IAEEvC,IAAI,EAAExB,SAAS,CAACsE,KAAV,CAAgB,CAAC,kBAAD,CAAhB;EAFR,GAjB2B,EAqB3BtE,SAAS,CAACiE,KAAV,cACKvD,WAAW,CAACqD,SADjB;IAEEvC,IAAI,EAAExB,SAAS,CAACsE,KAAV,CAAgB,CAAC,SAAD,CAAhB;EAFR,GArB2B,CAApB,CAVgB;EAoCzBlC,YAAY,EAAEpC,SAAS,CAACiE,KAAV,CAAgB;IAC5BhC,KAAK,EAAEjC,SAAS,CAACkE,MADW;IAE5BlD,OAAO,EAAEhB,SAAS,CAACmE;EAFS,CAAhB,CApCW;EAwCzB9B,QAAQ,EAAErC,SAAS,CAACiE,KAAV,CAAgB;IACxBzC,IAAI,EAAExB,SAAS,CAACsE,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;IAExBrC,KAAK,EAAEjC,SAAS,CAACkE,MAFO;IAGxBlD,OAAO,EAAEhB,SAAS,CAACmE;EAHK,CAAhB;AAxCe,CAA3B;AA+CA,eAAexB,cAAf"}
|
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
position: relative;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
.leftSectionWithoutSummary {
|
|
26
|
+
display: block;
|
|
27
|
+
overflow: auto;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
.rightSection {
|
|
26
35
|
height: 100%;
|
|
27
36
|
padding-bottom: 58px;
|
|
@@ -69,12 +78,22 @@
|
|
|
69
78
|
.actionZone {
|
|
70
79
|
width: 100%;
|
|
71
80
|
display: flex;
|
|
72
|
-
justify-content:
|
|
81
|
+
justify-content: center;
|
|
73
82
|
margin: 16px 0;
|
|
83
|
+
flex-wrap: wrap;
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
.button {
|
|
77
|
-
width:
|
|
87
|
+
width: 100%;
|
|
88
|
+
max-width: 184px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.footerWithoutSummary {
|
|
92
|
+
width: 100%;
|
|
93
|
+
bottom: 0px;
|
|
94
|
+
position: inherit;
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: flex-end;
|
|
78
97
|
}
|
|
79
98
|
|
|
80
99
|
.footer {
|
|
@@ -84,6 +103,16 @@
|
|
|
84
103
|
position: inherit;
|
|
85
104
|
}
|
|
86
105
|
|
|
106
|
+
.actionFooterWithoutSummary {
|
|
107
|
+
width: 100%;
|
|
108
|
+
display: flex;
|
|
109
|
+
right: 0;
|
|
110
|
+
max-width: 184px;
|
|
111
|
+
bottom: -10px;
|
|
112
|
+
position: sticky;
|
|
113
|
+
position: absolute;
|
|
114
|
+
}
|
|
115
|
+
|
|
87
116
|
@media desktop, tablet {
|
|
88
117
|
.leftSection {
|
|
89
118
|
width: 100%;
|
|
@@ -94,13 +123,14 @@
|
|
|
94
123
|
display: none;
|
|
95
124
|
}
|
|
96
125
|
|
|
97
|
-
.footer
|
|
126
|
+
.footer {
|
|
98
127
|
display: flex;
|
|
99
128
|
align-items: flex-end;
|
|
100
129
|
bottom: 10px;
|
|
101
130
|
position: sticky;
|
|
102
131
|
z-index: 1;
|
|
103
132
|
}
|
|
133
|
+
|
|
104
134
|
.footer::before {
|
|
105
135
|
content: '';
|
|
106
136
|
background: linear-gradient(to top,white 64px, #ffffff00 );
|
|
@@ -118,8 +148,10 @@
|
|
|
118
148
|
}
|
|
119
149
|
|
|
120
150
|
.actionFooter {
|
|
121
|
-
width:
|
|
151
|
+
max-width: 184px;
|
|
152
|
+
width: 100%;
|
|
122
153
|
}
|
|
154
|
+
|
|
123
155
|
.actionZone {
|
|
124
156
|
margin: 0;
|
|
125
157
|
}
|
|
@@ -136,6 +136,7 @@ declare namespace BrandUpdate {
|
|
|
136
136
|
groups: PropTypes.Validator<(PropTypes.InferProps<{
|
|
137
137
|
title: PropTypes.Requireable<string>;
|
|
138
138
|
subtitle: PropTypes.Requireable<string>;
|
|
139
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
139
140
|
fieldsLayout: PropTypes.Requireable<string>;
|
|
140
141
|
groupLayout: PropTypes.Requireable<string>;
|
|
141
142
|
fields: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
@@ -261,6 +262,8 @@ declare namespace BrandUpdate {
|
|
|
261
262
|
error: PropTypes.Requireable<string>;
|
|
262
263
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
263
264
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
265
|
+
labelLink: PropTypes.Requireable<string>;
|
|
266
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
264
267
|
title: PropTypes.Requireable<string>;
|
|
265
268
|
description: PropTypes.Requireable<string>;
|
|
266
269
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -374,6 +377,8 @@ declare namespace BrandUpdate {
|
|
|
374
377
|
error: PropTypes.Requireable<string>;
|
|
375
378
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
376
379
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
380
|
+
labelLink: PropTypes.Requireable<string>;
|
|
381
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
377
382
|
title: PropTypes.Requireable<string>;
|
|
378
383
|
description: PropTypes.Requireable<string>;
|
|
379
384
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -738,7 +743,7 @@ declare namespace BrandUpdate {
|
|
|
738
743
|
done: PropTypes.Requireable<boolean>;
|
|
739
744
|
current: PropTypes.Requireable<boolean>;
|
|
740
745
|
}> | null | undefined)[]>;
|
|
741
|
-
summary: PropTypes.
|
|
746
|
+
summary: PropTypes.Requireable<PropTypes.InferProps<{
|
|
742
747
|
title: PropTypes.Requireable<string>;
|
|
743
748
|
side: PropTypes.Requireable<string>;
|
|
744
749
|
sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -771,12 +776,13 @@ declare namespace BrandUpdate {
|
|
|
771
776
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
772
777
|
'aria-label': PropTypes.Requireable<string>;
|
|
773
778
|
}>>;
|
|
774
|
-
}
|
|
779
|
+
}>>;
|
|
775
780
|
content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
776
781
|
type: PropTypes.Requireable<string>;
|
|
777
782
|
groups: PropTypes.Validator<(PropTypes.InferProps<{
|
|
778
783
|
title: PropTypes.Requireable<string>;
|
|
779
784
|
subtitle: PropTypes.Requireable<string>;
|
|
785
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
780
786
|
fieldsLayout: PropTypes.Requireable<string>;
|
|
781
787
|
groupLayout: PropTypes.Requireable<string>;
|
|
782
788
|
fields: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
@@ -902,6 +908,8 @@ declare namespace BrandUpdate {
|
|
|
902
908
|
error: PropTypes.Requireable<string>;
|
|
903
909
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
904
910
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
911
|
+
labelLink: PropTypes.Requireable<string>;
|
|
912
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
905
913
|
title: PropTypes.Requireable<string>;
|
|
906
914
|
description: PropTypes.Requireable<string>;
|
|
907
915
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -1015,6 +1023,8 @@ declare namespace BrandUpdate {
|
|
|
1015
1023
|
error: PropTypes.Requireable<string>;
|
|
1016
1024
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
1017
1025
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
1026
|
+
labelLink: PropTypes.Requireable<string>;
|
|
1027
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
1018
1028
|
title: PropTypes.Requireable<string>;
|
|
1019
1029
|
description: PropTypes.Requireable<string>;
|
|
1020
1030
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -1366,6 +1376,7 @@ declare namespace BrandUpdate {
|
|
|
1366
1376
|
subtitle: PropTypes.Requireable<string>;
|
|
1367
1377
|
type: PropTypes.Requireable<string>;
|
|
1368
1378
|
'data-name': PropTypes.Requireable<string>;
|
|
1379
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
1369
1380
|
}>>;
|
|
1370
1381
|
child: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
1371
1382
|
childType: PropTypes.Requireable<string>;
|
|
@@ -1400,6 +1411,8 @@ declare namespace BrandUpdate {
|
|
|
1400
1411
|
error: PropTypes.Requireable<string>;
|
|
1401
1412
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
1402
1413
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
1414
|
+
labelLink: PropTypes.Requireable<string>;
|
|
1415
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
1403
1416
|
title: PropTypes.Requireable<string>;
|
|
1404
1417
|
description: PropTypes.Requireable<string>;
|
|
1405
1418
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/back-office/brand-update/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/back-office/brand-update/index.js"],"names":[],"mappings":";AAwLA,sDA6CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","map","pipe","get","isEmpty","find","classNames","BrandTabs","IconLinkItem","LinkItem","BrandForm","BrandTable","BrandUpload","BrandAnalytics","BrandDashboard","WizardContents","ListItems","Banner","Header","Loader","Accordion","CmPopin","ButtonLinkIconOnly","EmptyStateDashboard","style","getStyle","isSelected","selectedElement","unselectedElement","subTabsView","_subTabs","convert","cap","subTab","_index","title","type","selected","buildLeftNavigation","logo","items","onItemClick","formattedTabs","key","href","index","children","iconType","formattedTabsViews","tab","tabs","navigation","buildNotifications","notifications","notificationsList","notification","buildHeader","header","buildPopin","popin","buildDocumentation","documentation","show","onClose","content","open","documentationContent","__html","closeButton","buildTabs","selectedTab","e","showTabs","subTabs","undefined","buildContentView","loaderContainer","loader","buildDetailsView","details","BrandUpdate","props","contentFixHeight","leftNavigation","notificationsView","documentationView","headerView","tabsView","contentView","detailsView","popinView","contentStyle","contentWithNotifications","container","left","contentWrapper","headerSticky","defaultProps","propTypes","arrayOf","shape","string","isRequired","bool","oneOfType","oneOf","func"],"sources":["../../../../src/template/back-office/brand-update/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport map from 'lodash/fp/map';\nimport pipe from 'lodash/fp/pipe';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport find from 'lodash/fp/find';\nimport classNames from 'classnames';\nimport BrandTabs from '../../../molecule/brand-tabs';\nimport {IconLinkItem, LinkItem} from '../../../organism/sidebar';\nimport BrandForm from '../../../organism/brand-form';\nimport BrandTable from '../../../organism/brand-table';\nimport BrandUpload from '../../../organism/brand-upload';\nimport BrandAnalytics from '../../../organism/brand-analytics';\nimport BrandDashboard from '../../../organism/brand-dashboard';\nimport WizardContents from '../../../organism/wizard-contents';\nimport ListItems from '../../../organism/list-items';\nimport Banner from '../../../molecule/banner';\nimport Header from '../../../organism/setup-header';\nimport Loader from '../../../atom/loader';\nimport Accordion from '../../../organism/accordion/coorp-manager';\nimport CmPopin from '../../../molecule/cm-popin';\nimport ButtonLinkIconOnly from '../../../atom/button-link-icon-only';\nimport EmptyStateDashboard from '../../../molecule/empty-state-dashboard';\nimport style from './style.css';\n\nconst getStyle = isSelected => (isSelected ? style.selectedElement : style.unselectedElement);\n\nconst subTabsView = (_subTabs = []) =>\n map.convert({cap: false})((subTab, _index) => (\n <div key={subTab.title}>\n {subTab.type === 'iconLink' ? (\n <IconLinkItem\n {...subTab}\n styles={getStyle(subTab.selected)}\n uppercase={false}\n target={'_blank'}\n />\n ) : (\n <LinkItem {...subTab} styles={getStyle(subTab.selected)} uppercase={false} />\n )}\n </div>\n ))(_subTabs);\n\n// TODO: this fonction should be replaced by a molecule to avoid this file to be unreadable\nconst buildLeftNavigation = (logo, items, onItemClick) => {\n const formattedTabs = items.map(({key, title, href, selected, type = 'simpleTab'}, index) => ({\n title,\n selected,\n type,\n href,\n index,\n children: [],\n iconType: key || 'arrow'\n }));\n\n const formattedTabsViews = map(tab => (\n <div key={tab.title} className={style.subTabsView}>\n {subTabsView(tab.tabs)}\n </div>\n ))(items);\n\n return (\n <div className={style.navigation}>\n <div className={style.logo}>\n <a href=\"/\">\n <img src={logo} />\n </a>\n </div>\n <Accordion tabProps={formattedTabs} theme={'setup'} onClick={onItemClick}>\n {formattedTabsViews}\n </Accordion>\n </div>\n );\n};\n\nconst buildNotifications = notifications => {\n if (isEmpty(notifications)) {\n return null;\n }\n\n const notificationsList = notifications.map((notification, index) => {\n return (\n <div className={style.notification} key={index}>\n <Banner {...notification} />\n </div>\n );\n });\n return <div className={style.notifications}>{notificationsList}</div>;\n};\n\nconst buildHeader = header => {\n return (\n <div className={style.header}>\n <Header {...header} />\n </div>\n );\n};\n\nconst buildPopin = popin => {\n return popin ? (\n <div className={style.popin}>\n <CmPopin {...popin} />\n </div>\n ) : null;\n};\n\nconst buildDocumentation = documentation => {\n if (!documentation) return null;\n const {show = false, onClose, content = ''} = documentation;\n return (\n <div className={classNames(style.documentation, show && style.open)}>\n <div\n className={style.documentationContent}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n {onClose ? (\n <ButtonLinkIconOnly\n className={style.closeButton}\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </div>\n );\n};\n\nconst buildTabs = items => {\n const selectedTab = pipe(\n find(e => e.selected),\n get('tabs'),\n find(e => e.selected)\n )(items);\n\n const showTabs = selectedTab ? find(e => e.selected, selectedTab.subTabs) : undefined;\n if (!showTabs) return null;\n return (\n <div className={style.tabs}>\n <BrandTabs type=\"light\" tabs={selectedTab.subTabs} />\n </div>\n );\n};\n\nconst buildContentView = content => {\n if (!content) {\n return (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n );\n }\n\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'list':\n return <BrandTable {...content} />;\n case 'upload':\n return <BrandUpload {...content} />;\n case 'analytics-dashboards':\n return <BrandAnalytics {...content} />;\n case 'list-content':\n return <ListItems {...content} />;\n case 'home':\n return <BrandDashboard {...content} />;\n case 'wizard':\n return <WizardContents {...content} />;\n case 'empty-state-dashboard':\n return <EmptyStateDashboard {...content} />;\n }\n};\n\nconst buildDetailsView = details => {\n if (!details) return;\n return <BrandTable {...details} />;\n};\n\nconst BrandUpdate = props => {\n const {\n notifications,\n header,\n items,\n content,\n details,\n popin,\n onItemClick,\n documentation,\n contentFixHeight\n } = props;\n const logo = 'https://static.coorpacademy.com/logo/coorp-manager.svg';\n\n const leftNavigation = buildLeftNavigation(logo, items, onItemClick);\n const notificationsView = buildNotifications(notifications);\n const documentationView = buildDocumentation(documentation);\n const headerView = buildHeader(header, notifications);\n const tabsView = buildTabs(items);\n const contentView = buildContentView(content);\n const detailsView = buildDetailsView(details);\n const popinView = buildPopin(popin);\n\n const contentStyle = classNames([\n style.content,\n !isEmpty(notifications) && style.contentWithNotifications,\n contentFixHeight && style.contentFixHeight\n ]);\n\n return (\n <div className={style.container}>\n <div className={style.left}>{leftNavigation}</div>\n <div className={style.contentWrapper}>\n <div className={style.headerSticky}>{headerView}</div>\n <div className={contentStyle}>\n {notificationsView}\n {tabsView}\n {contentView}\n {detailsView}\n {documentationView}\n </div>\n </div>\n {popinView}\n </div>\n );\n};\n\nBrandUpdate.defaultProps = {\n notifications: []\n};\n\nBrandUpdate.propTypes = {\n notifications: PropTypes.arrayOf(\n PropTypes.shape({\n ...Banner.propTypes\n })\n ),\n header: PropTypes.shape({...Header.propTypes}),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n subTabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string\n })\n )\n })\n )\n })\n ).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n PropTypes.shape({\n ...BrandUpload.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['upload'])\n }),\n PropTypes.shape({\n ...BrandAnalytics.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['analytics-dashboards'])\n }),\n PropTypes.shape({\n ...BrandDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['home'])\n }),\n PropTypes.shape({\n ...WizardContents.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['wizard'])\n }),\n PropTypes.shape({\n ...ListItems.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list-content'])\n }),\n PropTypes.shape({\n ...EmptyStateDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['empty-state-dashboard'])\n })\n ]),\n documentation: PropTypes.shape({\n content: PropTypes.string,\n show: PropTypes.bool,\n onClose: PropTypes.func\n }),\n popin: PropTypes.shape({...CmPopin.propTypes}),\n details: PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.o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AG,EAAE3C,SAAS,CAACqG,MAFR;IAGPjE,IAAI,EAAEpC,SAAS,CAACyG,KAAV,CAAgB,CAAC,MAAD,CAAhB;EAHC,GAhFa;EAqFtBhE,WAAW,EAAEzC,SAAS,CAAC0G,IArFD;EAsFtBxB,gBAAgB,EAAElF,SAAS,CAACuG;AAtFN,CAAxB;AAyFA,eAAevB,WAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","map","pipe","get","isEmpty","find","classNames","BrandTabs","IconLinkItem","LinkItem","BrandForm","BrandTable","BrandUpload","BrandAnalytics","BrandDashboard","WizardContents","ListItems","Banner","Header","Loader","Accordion","CmPopin","ButtonLinkIconOnly","EmptyStateDashboard","style","getStyle","isSelected","selectedElement","unselectedElement","subTabsView","_subTabs","convert","cap","subTab","_index","title","type","selected","buildLeftNavigation","logo","items","onItemClick","formattedTabs","key","href","index","children","iconType","formattedTabsViews","tab","tabs","navigation","buildNotifications","notifications","notificationsList","notification","buildHeader","header","buildPopin","popin","buildDocumentation","documentation","show","onClose","content","open","documentationContent","__html","closeButton","buildTabs","selectedTab","e","showTabs","subTabs","undefined","buildContentView","loaderContainer","loader","buildDetailsView","details","BrandUpdate","props","contentFixHeight","leftNavigation","notificationsView","documentationView","headerView","tabsView","contentView","detailsView","popinView","contentStyle","contentWithNotifications","container","left","contentWrapper","headerSticky","defaultProps","propTypes","arrayOf","shape","string","isRequired","bool","oneOfType","oneOf","func"],"sources":["../../../../src/template/back-office/brand-update/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport map from 'lodash/fp/map';\nimport pipe from 'lodash/fp/pipe';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport find from 'lodash/fp/find';\nimport classNames from 'classnames';\nimport BrandTabs from '../../../molecule/brand-tabs';\nimport {IconLinkItem, LinkItem} from '../../../organism/sidebar';\nimport BrandForm from '../../../organism/brand-form';\nimport BrandTable from '../../../organism/brand-table';\nimport BrandUpload from '../../../organism/brand-upload';\nimport BrandAnalytics from '../../../organism/brand-analytics';\nimport BrandDashboard from '../../../organism/brand-dashboard';\nimport WizardContents from '../../../organism/wizard-contents';\nimport ListItems from '../../../organism/list-items';\nimport Banner from '../../../molecule/banner';\nimport Header from '../../../organism/setup-header';\nimport Loader from '../../../atom/loader';\nimport Accordion from '../../../organism/accordion/coorp-manager';\nimport CmPopin from '../../../molecule/cm-popin';\nimport ButtonLinkIconOnly from '../../../atom/button-link-icon-only';\nimport EmptyStateDashboard from '../../../molecule/empty-state-dashboard';\nimport style from './style.css';\nimport ImageUpload from '../../../atom/image-upload';\n\nconst getStyle = isSelected => (isSelected ? style.selectedElement : style.unselectedElement);\n\nconst subTabsView = (_subTabs = []) =>\n map.convert({cap: false})((subTab, _index) => (\n <div key={subTab.title}>\n {subTab.type === 'iconLink' ? (\n <IconLinkItem\n {...subTab}\n styles={getStyle(subTab.selected)}\n uppercase={false}\n target={'_blank'}\n />\n ) : (\n <LinkItem {...subTab} styles={getStyle(subTab.selected)} uppercase={false} />\n )}\n </div>\n ))(_subTabs);\n\n// TODO: this fonction should be replaced by a molecule to avoid this file to be unreadable\nconst buildLeftNavigation = (logo, items, onItemClick) => {\n const formattedTabs = items.map(({key, title, href, selected, type = 'simpleTab'}, index) => ({\n title,\n selected,\n type,\n href,\n index,\n children: [],\n iconType: key || 'arrow'\n }));\n\n const formattedTabsViews = map(tab => (\n <div key={tab.title} className={style.subTabsView}>\n {subTabsView(tab.tabs)}\n </div>\n ))(items);\n\n return (\n <div className={style.navigation}>\n <div className={style.logo}>\n <a href=\"/\">\n <img src={logo} />\n </a>\n </div>\n <Accordion tabProps={formattedTabs} theme={'setup'} onClick={onItemClick}>\n {formattedTabsViews}\n </Accordion>\n </div>\n );\n};\n\nconst buildNotifications = notifications => {\n if (isEmpty(notifications)) {\n return null;\n }\n\n const notificationsList = notifications.map((notification, index) => {\n return (\n <div className={style.notification} key={index}>\n <Banner {...notification} />\n </div>\n );\n });\n return <div className={style.notifications}>{notificationsList}</div>;\n};\n\nconst buildHeader = header => {\n return (\n <div className={style.header}>\n <Header {...header} />\n </div>\n );\n};\n\nconst buildPopin = popin => {\n return popin ? (\n <div className={style.popin}>\n <CmPopin {...popin} />\n </div>\n ) : null;\n};\n\nconst buildDocumentation = documentation => {\n if (!documentation) return null;\n const {show = false, onClose, content = ''} = documentation;\n return (\n <div className={classNames(style.documentation, show && style.open)}>\n <div\n className={style.documentationContent}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n {onClose ? (\n <ButtonLinkIconOnly\n className={style.closeButton}\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </div>\n );\n};\n\nconst buildTabs = items => {\n const selectedTab = pipe(\n find(e => e.selected),\n get('tabs'),\n find(e => e.selected)\n )(items);\n\n const showTabs = selectedTab ? find(e => e.selected, selectedTab.subTabs) : undefined;\n if (!showTabs) return null;\n return (\n <div className={style.tabs}>\n <BrandTabs type=\"light\" tabs={selectedTab.subTabs} />\n </div>\n );\n};\n\nconst buildContentView = content => {\n if (!content) {\n return (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n );\n }\n\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'list':\n return <BrandTable {...content} />;\n case 'upload':\n return <BrandUpload {...content} />;\n case 'analytics-dashboards':\n return <BrandAnalytics {...content} />;\n case 'list-content':\n return <ListItems {...content} />;\n case 'home':\n return <BrandDashboard {...content} />;\n case 'wizard':\n return <WizardContents {...content} />;\n case 'empty-state-dashboard':\n return <EmptyStateDashboard {...content} />;\n \n }\n};\n\nconst buildDetailsView = details => {\n if (!details) return;\n return <BrandTable {...details} />;\n};\n\nconst BrandUpdate = props => {\n const {\n notifications,\n header,\n items,\n content,\n details,\n popin,\n onItemClick,\n documentation,\n contentFixHeight\n } = props;\n const logo = 'https://static.coorpacademy.com/logo/coorp-manager.svg';\n\n const leftNavigation = buildLeftNavigation(logo, items, onItemClick);\n const notificationsView = buildNotifications(notifications);\n const documentationView = buildDocumentation(documentation);\n const headerView = buildHeader(header, notifications);\n const tabsView = buildTabs(items);\n const contentView = buildContentView(content);\n const detailsView = buildDetailsView(details);\n const popinView = buildPopin(popin);\n\n const contentStyle = classNames([\n style.content,\n !isEmpty(notifications) && style.contentWithNotifications,\n contentFixHeight && style.contentFixHeight\n ]);\n\n return (\n <div className={style.container}>\n <div className={style.left}>{leftNavigation}</div>\n <div className={style.contentWrapper}>\n <div className={style.headerSticky}>{headerView}</div>\n <div className={contentStyle}>\n {notificationsView}\n {tabsView}\n {contentView}\n {detailsView}\n {documentationView}\n </div>\n </div>\n {popinView}\n </div>\n );\n};\n\nBrandUpdate.defaultProps = {\n notifications: []\n};\n\nBrandUpdate.propTypes = {\n notifications: PropTypes.arrayOf(\n PropTypes.shape({\n ...Banner.propTypes\n })\n ),\n header: PropTypes.shape({...Header.propTypes}),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n subTabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string\n })\n )\n })\n )\n })\n ).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n PropTypes.shape({\n ...BrandUpload.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['upload'])\n }),\n PropTypes.shape({\n ...BrandAnalytics.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['analytics-dashboards'])\n }),\n PropTypes.shape({\n ...BrandDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['home'])\n }),\n PropTypes.shape({\n ...WizardContents.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['wizard'])\n }),\n PropTypes.shape({\n ...ListItems.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list-content'])\n }),\n PropTypes.shape({\n ...EmptyStateDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['empty-state-dashboard'])\n })\n ]),\n documentation: PropTypes.shape({\n content: PropTypes.string,\n show: PropTypes.bool,\n onClose: PropTypes.func\n }),\n popin: PropTypes.shape({...CmPopin.propTypes}),\n details: PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n onItemClick: PropTypes.func,\n contentFixHeight: PropTypes.bool\n};\n\nexport default BrandUpdate;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,SAAQC,YAAR,EAAsBC,QAAtB,QAAqC,2BAArC;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,OAAOC,UAAP,MAAuB,+BAAvB;AACA,OAAOC,WAAP,MAAwB,gCAAxB;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AACA,OA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AAD,CAAhB;EAHR,GA/B2B,EAoC3BzG,SAAS,CAACoG,KAAV,cACK7E,mBAAmB,CAAC2E,SADzB;IAEEvD,GAAG,EAAE3C,SAAS,CAACqG,MAFjB;IAGEjE,IAAI,EAAEpC,SAAS,CAACyG,KAAV,CAAgB,CAAC,uBAAD,CAAhB;EAHR,GApC2B,CAApB,CAhCa;EA0EtB5C,aAAa,EAAE7D,SAAS,CAACoG,KAAV,CAAgB;IAC7BpC,OAAO,EAAEhE,SAAS,CAACqG,MADU;IAE7BvC,IAAI,EAAE9D,SAAS,CAACuG,IAFa;IAG7BxC,OAAO,EAAE/D,SAAS,CAAC0G;EAHU,CAAhB,CA1EO;EA+EtB/C,KAAK,EAAE3D,SAAS,CAACoG,KAAV,cAAoB/E,OAAO,CAAC6E,SAA5B,EA/Ee;EAgFtBnB,OAAO,EAAE/E,SAAS,CAACoG,KAAV,cACJzF,UAAU,CAACuF,SADP;IAEPvD,GAAG,EAAE3C,SAAS,CAACqG,MAFR;IAGPjE,IAAI,EAAEpC,SAAS,CAACyG,KAAV,CAAgB,CAAC,MAAD,CAAhB;EAHC,GAhFa;EAqFtBhE,WAAW,EAAEzC,SAAS,CAAC0G,IArFD;EAsFtBxB,gBAAgB,EAAElF,SAAS,CAACuG;AAtFN,CAAxB;AAyFA,eAAevB,WAAf"}
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
.wrapper {
|
|
20
20
|
font-family: "Gilroy";
|
|
21
|
-
max-height: 350px;
|
|
22
|
-
max-width: 460px;
|
|
23
21
|
height: 100%;
|
|
24
22
|
width: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.disabled {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
width: 100%;
|
|
56
56
|
height: 80%;
|
|
57
57
|
border: none;
|
|
58
|
+
display: flex;
|
|
58
59
|
border-radius: 7px;
|
|
59
60
|
background: cm_grey_50;
|
|
60
61
|
}
|
|
@@ -96,7 +97,6 @@
|
|
|
96
97
|
.inputWrapper {
|
|
97
98
|
background: cm_grey_50;
|
|
98
99
|
width: 100%;
|
|
99
|
-
height: 80%;
|
|
100
100
|
box-sizing: border-box;
|
|
101
101
|
border-radius: 7px;
|
|
102
102
|
position: relative;
|
|
@@ -147,23 +147,26 @@
|
|
|
147
147
|
background-color: cm_grey_50;
|
|
148
148
|
border-radius: 3px;
|
|
149
149
|
display: flex;
|
|
150
|
+
flex-wrap: nowrap;
|
|
151
|
+
min-width: 0;
|
|
150
152
|
align-items: center;
|
|
151
153
|
justify-content: space-between;
|
|
152
154
|
margin-top: 16px;
|
|
153
155
|
padding: 4px 8px;
|
|
154
156
|
font-size: 12px;
|
|
155
157
|
font-weight: 400;
|
|
158
|
+
position: relative;
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
.resetSrcLabel {
|
|
159
162
|
color: cm_grey_700;
|
|
160
|
-
display: inline-block;
|
|
161
|
-
white-space: nowrap;
|
|
162
163
|
overflow: hidden;
|
|
163
164
|
text-overflow: ellipsis;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
white-space: nowrap;
|
|
166
|
+
flex-wrap: nowrap;
|
|
167
|
+
position: absolute;
|
|
168
|
+
left: 0;
|
|
169
|
+
right: 15px;
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
.closeIcon {
|
|
@@ -172,6 +175,8 @@
|
|
|
172
175
|
margin-left: 6px;
|
|
173
176
|
height: 15px;
|
|
174
177
|
width: 15px;
|
|
178
|
+
position: absolute;
|
|
179
|
+
right: 0;
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
.dragging {
|
|
@@ -244,7 +249,7 @@
|
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
.loaderWrapper:hover .loadingCancel {
|
|
247
|
-
display:
|
|
252
|
+
display: flex;
|
|
248
253
|
}
|
|
249
254
|
|
|
250
255
|
.loaderWrapper:hover {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ImageUpload;
|
|
2
|
-
declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, imageTypes, error, buttonAriaLabel, errorButtonLabel }: {
|
|
2
|
+
declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, imageTypes, error, buttonAriaLabel, errorButtonLabel }: {
|
|
3
3
|
title: any;
|
|
4
4
|
description: any;
|
|
5
5
|
previewLabel: any;
|
|
@@ -11,6 +11,9 @@ declare function ImageUpload({ title, description, previewLabel, previewContent,
|
|
|
11
11
|
onChange: any;
|
|
12
12
|
onReset?: null | undefined;
|
|
13
13
|
name: any;
|
|
14
|
+
labelLink: any;
|
|
15
|
+
labelButtonLink: any;
|
|
16
|
+
hrefLink: any;
|
|
14
17
|
imageTypes?: string[] | undefined;
|
|
15
18
|
error?: string | undefined;
|
|
16
19
|
buttonAriaLabel: any;
|
|
@@ -25,6 +28,8 @@ declare namespace ImageUpload {
|
|
|
25
28
|
error: PropTypes.Requireable<string>;
|
|
26
29
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
27
30
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
31
|
+
labelLink: PropTypes.Requireable<string>;
|
|
32
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
28
33
|
title: PropTypes.Requireable<string>;
|
|
29
34
|
description: PropTypes.Requireable<string>;
|
|
30
35
|
uploadLabel: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;gBAmFC"}
|
|
@@ -19,6 +19,8 @@ var _dragAndDrop = _interopRequireDefault(require("../drag-and-drop"));
|
|
|
19
19
|
|
|
20
20
|
var _proptypes = require("../../util/proptypes");
|
|
21
21
|
|
|
22
|
+
var _buttonLink = _interopRequireDefault(require("../button-link"));
|
|
23
|
+
|
|
22
24
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
23
25
|
|
|
24
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -42,6 +44,9 @@ const ImageUpload = ({
|
|
|
42
44
|
onReset = null,
|
|
43
45
|
name,
|
|
44
46
|
// See ImagePropType for accepted values
|
|
47
|
+
labelLink,
|
|
48
|
+
labelButtonLink,
|
|
49
|
+
hrefLink,
|
|
45
50
|
imageTypes = ['*'],
|
|
46
51
|
error = '',
|
|
47
52
|
buttonAriaLabel,
|
|
@@ -53,7 +58,11 @@ const ImageUpload = ({
|
|
|
53
58
|
return onReset(e);
|
|
54
59
|
}, [onReset]);
|
|
55
60
|
const acceptedImages = (0, _pipe2.default)((0, _map2.default)(t => `image/${t}`), (0, _join2.default)(','))(imageTypes);
|
|
56
|
-
|
|
61
|
+
const linkCustomStyle = {
|
|
62
|
+
width: '40px',
|
|
63
|
+
color: 'red'
|
|
64
|
+
};
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_dragAndDrop.default, {
|
|
57
66
|
title: title,
|
|
58
67
|
description: description,
|
|
59
68
|
previewLabel: previewLabel,
|
|
@@ -66,7 +75,7 @@ const ImageUpload = ({
|
|
|
66
75
|
disabled: disabled,
|
|
67
76
|
buttonAriaLabel: buttonAriaLabel,
|
|
68
77
|
errorButtonLabel: errorButtonLabel
|
|
69
|
-
}, (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("
|
|
78
|
+
}, (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("input", {
|
|
70
79
|
type: "file",
|
|
71
80
|
name: name,
|
|
72
81
|
accept: acceptedImages,
|
|
@@ -76,7 +85,17 @@ const ImageUpload = ({
|
|
|
76
85
|
onDragEnter: onDragStart,
|
|
77
86
|
onDrop: onDragStop,
|
|
78
87
|
onDragLeave: onDragStop
|
|
79
|
-
}))
|
|
88
|
+
})), labelLink && hrefLink ? /*#__PURE__*/_react.default.createElement("div", {
|
|
89
|
+
className: _style.default.templateLink
|
|
90
|
+
}, labelLink, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
91
|
+
type: "text",
|
|
92
|
+
customStyle: linkCustomStyle,
|
|
93
|
+
link: {
|
|
94
|
+
href: hrefLink,
|
|
95
|
+
download: true
|
|
96
|
+
},
|
|
97
|
+
label: labelButtonLink
|
|
98
|
+
})) : null);
|
|
80
99
|
};
|
|
81
100
|
|
|
82
101
|
ImageUpload.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _dragAndDrop.default.propTypes, {
|
|
@@ -86,7 +105,9 @@ ImageUpload.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _dr
|
|
|
86
105
|
imageTypes: _propTypes.default.arrayOf(_proptypes.ImagePropType),
|
|
87
106
|
error: _propTypes.default.string,
|
|
88
107
|
buttonAriaLabel: _propTypes.default.string,
|
|
89
|
-
errorButtonLabel: _propTypes.default.string
|
|
108
|
+
errorButtonLabel: _propTypes.default.string,
|
|
109
|
+
labelLink: _propTypes.default.string,
|
|
110
|
+
hrefLink: _propTypes.default.string
|
|
90
111
|
}) : {};
|
|
91
112
|
var _default = ImageUpload;
|
|
92
113
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","imageTypes","error","buttonAriaLabel","errorButtonLabel","handleReset","useCallback","e","preventDefault","acceptedImages","t","onDragStart","onDragStop","style","input","propTypes","DragAndDrop","PropTypes","string","func","arrayOf","ImagePropType"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {join, map, pipe, isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n // See ImagePropType for accepted values\n imageTypes = ['*'],\n error = '',\n buttonAriaLabel,\n errorButtonLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const acceptedImages = pipe(\n map(t => `image/${t}`),\n join(',')\n )(imageTypes);\n\n return (\n <DragAndDrop\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","handleReset","useCallback","e","preventDefault","acceptedImages","t","linkCustomStyle","width","color","onDragStart","onDragStop","style","input","templateLink","href","download","propTypes","DragAndDrop","PropTypes","string","func","arrayOf","ImagePropType"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {join, map, pipe, isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport Link from '../button-link';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n // See ImagePropType for accepted values\n labelLink,\n labelButtonLink,\n hrefLink,\n imageTypes = ['*'],\n error = '',\n buttonAriaLabel,\n errorButtonLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const acceptedImages = pipe(\n map(t => `image/${t}`),\n join(',')\n )(imageTypes);\n\n const linkCustomStyle = {\n width: '40px',\n color: 'red'\n };\n\n return (\n <div>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={acceptedImages}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: PropTypes.arrayOf(ImagePropType),\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,WAAW,GAAG,CAAC;EACnBC,KADmB;EAEnBC,WAFmB;EAGnBC,YAHmB;EAInBC,cAJmB;EAKnBC,WALmB;EAMnBC,OANmB;EAOnBC,QAPmB;EAQnBC,QAAQ,GAAG,KARQ;EASnBC,QATmB;EAUnBC,OAAO,GAAG,IAVS;EAWnBC,IAXmB;EAYnB;EACAC,SAbmB;EAc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;IAAK,SAAS,EAAEgB,cAAA,CAAME;EAAtB,GACGpB,SADH,eAEE,6BAAC,mBAAD;IACE,IAAI,EAAC,MADP;IAEE,WAAW,EAAEa,eAFf;IAGE,IAAI,EAAE;MAACQ,IAAI,EAAEnB,QAAP;MAAiBoB,QAAQ,EAAE;IAA3B,CAHR;IAIE,KAAK,EAAErB;EAJT,EAFF,CADD,GAUG,IAvCN,CADF;AA2CD,CAnFD;;AAqFAb,WAAW,CAACmC,SAAZ,wDACKC,oBAAA,CAAYD,SADjB;EAEExB,IAAI,EAAE0B,kBAAA,CAAUC,MAFlB;EAGE7B,QAAQ,EAAE4B,kBAAA,CAAUE,IAHtB;EAIE7B,OAAO,EAAE2B,kBAAA,CAAUE,IAJrB;EAKExB,UAAU,EAAEsB,kBAAA,CAAUG,OAAV,CAAkBC,wBAAlB,CALd;EAMEzB,KAAK,EAAEqB,kBAAA,CAAUC,MANnB;EAOErB,eAAe,EAAEoB,kBAAA,CAAUC,MAP7B;EAQEpB,gBAAgB,EAAEmB,kBAAA,CAAUC,MAR9B;EASE1B,SAAS,EAAEyB,kBAAA,CAAUC,MATvB;EAUExB,QAAQ,EAAEuB,kBAAA,CAAUC;AAVtB;eAaetC,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AA2BA,gDAeC"}
|