@salesforce/design-system-react 0.10.35 → 0.10.39
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/assets/styles/table.css +70 -0
- package/components/builder-header/utilities.d.ts +20 -0
- package/components/card/__docs__/__snapshots__/storybook-stories.storyshot +20 -5
- package/components/combobox/__docs__/__snapshots__/storybook-stories.storyshot +178 -169
- package/components/combobox/__tests__/combobox.browser-test.jsx +4 -5
- package/components/combobox/combobox.jsx +20 -18
- package/components/component-docs.json +160 -0
- package/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot +17997 -11862
- package/components/data-table/__docs__/storybook-stories.jsx +5 -1
- package/components/data-table/__examples__/advanced-single-select-fixed-header.jsx +1 -0
- package/components/data-table/__examples__/basic-fluid-headless.jsx +105 -0
- package/components/data-table/__examples__/interactive-elements.jsx +14 -0
- package/components/data-table/__examples__/joined-with-page-header.jsx +11 -18
- package/components/data-table/__examples__/resizable-columns.jsx +237 -0
- package/components/data-table/__tests__/data-table.browser-test.jsx +133 -0
- package/components/data-table/column.resizer.d.ts +1 -0
- package/components/data-table/component.json +11 -7
- package/components/data-table/index.jsx +431 -80
- package/components/data-table/private/head.jsx +8 -3
- package/components/data-table/private/header-cell.jsx +9 -1
- package/components/data-table.d.ts +8 -0
- package/components/date-picker/__tests__/__snapshots__/datepicker.dom-snapshot-test.jsx.snap +17 -17
- package/components/expression/__docs__/__snapshots__/storybook-stories.storyshot +90 -90
- package/components/global-header/__docs__/__snapshots__/storybook-stories.storyshot +9 -9
- package/components/index.d.ts +2 -0
- package/components/menu-dropdown/__docs__/__snapshots__/storybook-stories.storyshot +552 -26
- package/components/menu-dropdown/__docs__/storybook-stories.jsx +4 -16
- package/components/menu-dropdown/__examples__/checkmark.jsx +48 -31
- package/components/menu-dropdown/__tests__/dropdown.browser-test.jsx +12 -7
- package/components/modal/__tests__/modal.browser-test.jsx +4 -10
- package/components/portal-settings/__docs__/__snapshots__/storybook-stories.storyshot +6 -6
- package/components/progress-indicator/__docs__/__snapshots__/storybook-stories.storyshot +161 -14
- package/components/progress-indicator/private/step-vertical.jsx +28 -2
- package/components/setup-assistant/__docs__/__snapshots__/storybook-stories.storyshot +180 -13
- package/components/site-stories.js +16 -4
- package/components/utilities/menu-list/index.jsx +3 -0
- package/components/utilities/menu-list/item.jsx +5 -2
- package/components/vertical-navigation/__docs__/__snapshots__/storybook-stories.storyshot +326 -0
- package/components/vertical-navigation/__docs__/storybook-stories.jsx +4 -0
- package/components/vertical-navigation/__examples__/icons.jsx +70 -0
- package/components/vertical-navigation/__examples__/notifications.jsx +66 -0
- package/components/vertical-navigation/component.json +8 -0
- package/components/vertical-navigation/private/item.d.ts +2 -0
- package/components/vertical-navigation/private/item.jsx +23 -1
- package/docs/PULL_REQUEST_TEMPLATE.md +1 -1
- package/lib/assets/styles/table.css +70 -0
- package/lib/components/builder-header/utilities.d.ts +20 -0
- package/lib/components/card/__docs__/__snapshots__/storybook-stories.storyshot +20 -5
- package/lib/components/combobox/__docs__/__snapshots__/storybook-stories.storyshot +178 -169
- package/lib/components/combobox/__tests__/combobox.browser-test.jsx +4 -5
- package/lib/components/combobox/combobox.js +27 -23
- package/lib/components/component-docs.json +160 -0
- package/lib/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot +17997 -11862
- package/lib/components/data-table/__docs__/storybook-stories.jsx +5 -1
- package/lib/components/data-table/__examples__/advanced-single-select-fixed-header.jsx +1 -0
- package/lib/components/data-table/__examples__/basic-fluid-headless.jsx +105 -0
- package/lib/components/data-table/__examples__/interactive-elements.jsx +14 -0
- package/lib/components/data-table/__examples__/joined-with-page-header.jsx +11 -18
- package/lib/components/data-table/__examples__/resizable-columns.jsx +237 -0
- package/lib/components/data-table/__tests__/data-table.browser-test.jsx +133 -0
- package/lib/components/data-table/column.resizer.d.ts +1 -0
- package/lib/components/data-table/component.json +11 -7
- package/lib/components/data-table/index.js +444 -107
- package/lib/components/data-table/private/head.js +8 -3
- package/lib/components/data-table/private/header-cell.js +3 -1
- package/lib/components/data-table.d.ts +8 -0
- package/lib/components/date-picker/__tests__/__snapshots__/datepicker.dom-snapshot-test.jsx.snap +17 -17
- package/lib/components/expression/__docs__/__snapshots__/storybook-stories.storyshot +90 -90
- package/lib/components/global-header/__docs__/__snapshots__/storybook-stories.storyshot +9 -9
- package/lib/components/index.d.ts +2 -0
- package/lib/components/menu-dropdown/__docs__/__snapshots__/storybook-stories.storyshot +552 -26
- package/lib/components/menu-dropdown/__docs__/storybook-stories.jsx +4 -16
- package/lib/components/menu-dropdown/__examples__/checkmark.jsx +48 -31
- package/lib/components/menu-dropdown/__tests__/dropdown.browser-test.jsx +12 -7
- package/lib/components/modal/__tests__/modal.browser-test.jsx +4 -10
- package/lib/components/portal-settings/__docs__/__snapshots__/storybook-stories.storyshot +6 -6
- package/lib/components/progress-indicator/__docs__/__snapshots__/storybook-stories.storyshot +161 -14
- package/lib/components/progress-indicator/private/step-vertical.js +18 -4
- package/lib/components/setup-assistant/__docs__/__snapshots__/storybook-stories.storyshot +180 -13
- package/lib/components/site-stories.js +12 -3
- package/lib/components/utilities/menu-list/index.js +5 -2
- package/lib/components/utilities/menu-list/item.js +3 -2
- package/lib/components/vertical-navigation/__docs__/__snapshots__/storybook-stories.storyshot +326 -0
- package/lib/components/vertical-navigation/__docs__/storybook-stories.jsx +4 -0
- package/lib/components/vertical-navigation/__examples__/icons.jsx +70 -0
- package/lib/components/vertical-navigation/__examples__/notifications.jsx +66 -0
- package/lib/components/vertical-navigation/component.json +8 -0
- package/lib/components/vertical-navigation/private/item.d.ts +2 -0
- package/lib/components/vertical-navigation/private/item.js +5 -1
- package/lib/docs/PULL_REQUEST_TEMPLATE.md +1 -1
- package/lib/package.json +19 -6
- package/module/assets/styles/table.css +70 -0
- package/module/components/builder-header/utilities.d.ts +20 -0
- package/module/components/card/__docs__/__snapshots__/storybook-stories.storyshot +20 -5
- package/module/components/combobox/__docs__/__snapshots__/storybook-stories.storyshot +178 -169
- package/module/components/combobox/__tests__/combobox.browser-test.js +5 -6
- package/module/components/combobox/__tests__/combobox.browser-test.js.map +1 -1
- package/module/components/combobox/combobox.js +27 -23
- package/module/components/combobox/combobox.js.map +1 -1
- package/module/components/component-docs.json +160 -0
- package/module/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot +17997 -11862
- package/module/components/data-table/__docs__/storybook-stories.js +6 -0
- package/module/components/data-table/__docs__/storybook-stories.js.map +1 -1
- package/module/components/data-table/__examples__/advanced-single-select-fixed-header.js +1 -0
- package/module/components/data-table/__examples__/advanced-single-select-fixed-header.js.map +1 -1
- package/module/components/data-table/__examples__/basic-fluid-headless.js +152 -0
- package/module/components/data-table/__examples__/basic-fluid-headless.js.map +1 -0
- package/module/components/data-table/__examples__/interactive-elements.js +9 -0
- package/module/components/data-table/__examples__/interactive-elements.js.map +1 -1
- package/module/components/data-table/__examples__/joined-with-page-header.js +9 -20
- package/module/components/data-table/__examples__/joined-with-page-header.js.map +1 -1
- package/module/components/data-table/__examples__/resizable-columns.js +266 -0
- package/module/components/data-table/__examples__/resizable-columns.js.map +1 -0
- package/module/components/data-table/__tests__/data-table.browser-test.js +99 -0
- package/module/components/data-table/__tests__/data-table.browser-test.js.map +1 -1
- package/module/components/data-table/column.resizer.d.ts +1 -0
- package/module/components/data-table/component.json +11 -7
- package/module/components/data-table/index.js +443 -107
- package/module/components/data-table/index.js.map +1 -1
- package/module/components/data-table/private/head.js +8 -3
- package/module/components/data-table/private/head.js.map +1 -1
- package/module/components/data-table/private/header-cell.js +3 -1
- package/module/components/data-table/private/header-cell.js.map +1 -1
- package/module/components/data-table.d.ts +8 -0
- package/module/components/date-picker/__tests__/__snapshots__/datepicker.dom-snapshot-test.jsx.snap +17 -17
- package/module/components/expression/__docs__/__snapshots__/storybook-stories.storyshot +90 -90
- package/module/components/global-header/__docs__/__snapshots__/storybook-stories.storyshot +9 -9
- package/module/components/index.d.ts +2 -0
- package/module/components/menu-dropdown/__docs__/__snapshots__/storybook-stories.storyshot +552 -26
- package/module/components/menu-dropdown/__docs__/storybook-stories.js +9 -15
- package/module/components/menu-dropdown/__docs__/storybook-stories.js.map +1 -1
- package/module/components/menu-dropdown/__examples__/checkmark.js +53 -33
- package/module/components/menu-dropdown/__examples__/checkmark.js.map +1 -1
- package/module/components/menu-dropdown/__tests__/dropdown.browser-test.js +7 -4
- package/module/components/menu-dropdown/__tests__/dropdown.browser-test.js.map +1 -1
- package/module/components/modal/__tests__/modal.browser-test.js +4 -10
- package/module/components/modal/__tests__/modal.browser-test.js.map +1 -1
- package/module/components/portal-settings/__docs__/__snapshots__/storybook-stories.storyshot +6 -6
- package/module/components/progress-indicator/__docs__/__snapshots__/storybook-stories.storyshot +161 -14
- package/module/components/progress-indicator/private/step-vertical.js +18 -4
- package/module/components/progress-indicator/private/step-vertical.js.map +1 -1
- package/module/components/setup-assistant/__docs__/__snapshots__/storybook-stories.storyshot +180 -13
- package/module/components/site-stories.js +12 -3
- package/module/components/site-stories.js.map +1 -1
- package/module/components/utilities/menu-list/index.js +5 -2
- package/module/components/utilities/menu-list/index.js.map +1 -1
- package/module/components/utilities/menu-list/item.js +3 -2
- package/module/components/utilities/menu-list/item.js.map +1 -1
- package/module/components/vertical-navigation/__docs__/__snapshots__/storybook-stories.storyshot +326 -0
- package/module/components/vertical-navigation/__docs__/storybook-stories.js +10 -0
- package/module/components/vertical-navigation/__docs__/storybook-stories.js.map +1 -1
- package/module/components/vertical-navigation/__examples__/icons.js +149 -0
- package/module/components/vertical-navigation/__examples__/icons.js.map +1 -0
- package/module/components/vertical-navigation/__examples__/notifications.js +143 -0
- package/module/components/vertical-navigation/__examples__/notifications.js.map +1 -0
- package/module/components/vertical-navigation/component.json +8 -0
- package/module/components/vertical-navigation/private/item.d.ts +2 -0
- package/module/components/vertical-navigation/private/item.js +5 -1
- package/module/components/vertical-navigation/private/item.js.map +1 -1
- package/package.json +19 -6
- package/design-system-react-components.js +0 -62702
- package/design-system-react-components.js.map +0 -1
- package/design-system-react-components.min.js +0 -3
- package/design-system-react-components.min.js.LICENSE.txt +0 -83
- package/design-system-react-components.min.js.map +0 -1
- package/design-system-react.js +0 -73487
- package/design-system-react.js.map +0 -1
- package/design-system-react.min.js +0 -3
- package/design-system-react.min.js.LICENSE.txt +0 -83
- package/design-system-react.min.js.map +0 -1
- package/lib/design-system-react-components.min.js.LICENSE.txt +0 -83
- package/lib/design-system-react.min.js.LICENSE.txt +0 -83
|
@@ -22,16 +22,10 @@ describe('SLDSModal: ', function () {
|
|
|
22
22
|
document.body.removeChild(appNode);
|
|
23
23
|
appNode = null;
|
|
24
24
|
});
|
|
25
|
-
afterEach(function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setTimeout(function () {
|
|
30
|
-
ReactDOM.unmountComponentAtNode(container);
|
|
31
|
-
document.body.removeChild(container);
|
|
32
|
-
container = null;
|
|
33
|
-
done();
|
|
34
|
-
}, 100);
|
|
25
|
+
afterEach(function () {
|
|
26
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
27
|
+
document.body.removeChild(container);
|
|
28
|
+
container = null;
|
|
35
29
|
});
|
|
36
30
|
var defaultProps = {
|
|
37
31
|
align: 'top',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../.tmp-es/components/modal/__tests__/modal.browser-test.jsx"],"names":["React","ReactDOM","assign","TestUtils","expect","SLDSModal","IconSettings","Settings","Simulate","describe","container","renderedNode","appNode","document","createElement","id","body","appendChild","setAppElement","after","removeChild","afterEach","done","setTimeout","unmountComponentAtNode","defaultProps","align","children","renderModal","modalInstance","opener","render","createModal","props","getModal","getModalContainerNode","dom","querySelector","getModalNode","beforeEach","containerClassName","contentClassName","contentStyle","height","isOpen","portalClassName","it","modalContainer","to","exist","modalContent","style","equal","modalPortal","cmp","size","modal","className","include","overflow","be","null","closed","assistiveText","closeButton","onRequestClose","firstChild","closeBtn","title","false","click","true","role","getAttribute","disableClose","header","headerClassName","customHeader","not","feet","prompt","heading","footer","inn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ent":["/* eslint-disable no-unused-vars */\n/* eslint-disable react/no-find-dom-node */\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport assign from 'lodash.assign';\nimport TestUtils from 'react-dom/test-utils';\nimport { expect } from 'chai';\n\nimport SLDSModal from '../../modal';\nimport IconSettings from '../../icon-settings';\nimport Settings from '../../settings';\n\nconst { Simulate } = TestUtils;\n\ndescribe('SLDSModal: ', function () {\n\tlet container;\n\tlet renderedNode;\n\n\t// set \"app node\" fixture, so no warnings are triggered.\n\tlet appNode = document.createElement('span');\n\tappNode.id = 'app';\n\tdocument.body.appendChild(appNode);\n\tSettings.setAppElement('#app');\n\n\tafter(() => {\n\t\tdocument.body.removeChild(appNode);\n\t\tappNode = null;\n\t});\n\n\tafterEach((done) => {\n\t\t// We run into a race condition if we do not have this wait\n\t\t// with the changes to react-modal, we end up trying to set state\n\t\t// on an unmounted component\n\t\tsetTimeout(() => {\n\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\tdocument.body.removeChild(container);\n\t\t\tcontainer = null;\n\t\t\tdone();\n\t\t}, 100);\n\t});\n\n\tconst defaultProps = {\n\t\talign: 'top',\n\t\tchildren: <div key>hello</div>,\n\t};\n\n\tconst renderModal = (modalInstance) => {\n\t\tcontainer = document.createElement('div');\n\n\t\tconst opener = (\n\t\t\t<button type=\"button\">\n\t\t\t\t<IconSettings iconPath=\"/assets/icons\">{modalInstance}</IconSettings>\n\t\t\t</button>\n\t\t);\n\t\tdocument.body.appendChild(container);\n\t\t// eslint-disable-next-line react/no-render-return-value\n\t\trenderedNode = ReactDOM.render(opener, container); // deepscan-disable-line REACT_ASYNC_RENDER_RETURN_VALUE\n\t\treturn renderedNode;\n\t};\n\n\tconst createModal = (props) =>\n\t\tReact.createElement(SLDSModal, assign({}, defaultProps, props));\n\n\tconst getModal = (props) => renderModal(createModal(props));\n\n\tconst getModalContainerNode = (dom) =>\n\t\tdom.querySelector('[role=\"dialog\"]') ||\n\t\tdom.querySelector('[role=\"alertdialog\"]');\n\tconst getModalNode = (dom) => dom.querySelector('.slds-modal');\n\n\tdescribe('Styling', () => {\n\t\tbeforeEach(() => {\n\t\t\tgetModal({\n\t\t\t\tcontainerClassName: 'container-class-name-test',\n\t\t\t\tcontentClassName: 'content-class-name-test',\n\t\t\t\tcontentStyle: { height: '500px' },\n\t\t\t\tisOpen: true,\n\t\t\t\tportalClassName: 'portal-class-name-test',\n\t\t\t});\n\t\t});\n\t\tit('has correct containerClassName, contentClassName, contentStyle, and portalClassName', () => {\n\t\t\tconst modalContainer = getModalNode(document.body).querySelector(\n\t\t\t\t'.slds-modal__container.container-class-name-test'\n\t\t\t);\n\t\t\texpect(modalContainer).to.exist;\n\t\t\tconst modalContent = getModalNode(document.body).querySelector(\n\t\t\t\t'.slds-modal__content.content-class-name-test'\n\t\t\t);\n\t\t\texpect(modalContent).to.exist;\n\t\t\texpect(modalContent.style.height).to.equal('500px');\n\t\t\tconst modalPortal = document.querySelector(\n\t\t\t\t'body > .portal-class-name-test'\n\t\t\t);\n\t\t\texpect(modalPortal).to.exist;\n\t\t});\n\t});\n\n\tdescribe('Sizing', () => {\n\t\tit('size is set to small', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'small',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_small');\n\t\t});\n\t\tit('size is set to medium', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'medium',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_medium');\n\t\t});\n\t\tit('size is set to large', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'large',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_large');\n\t\t});\n\t});\n\n\tdescribe('Closed modal', () => {\n\t\tbeforeEach(() => {\n\t\t\tgetModal({ isOpen: false });\n\t\t});\n\n\t\tit('updates the overflow', () => {\n\t\t\texpect(document.body.style.overflow).to.equal('inherit');\n\t\t});\n\n\t\tit('does not render to the body', () => {\n\t\t\texpect(getModalNode(document.body)).to.be.null;\n\t\t});\n\t});\n\n\tdescribe('Open modal', () => {\n\t\tlet cmp;\n\t\tlet closed;\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tclosed = false;\n\t\t\tcmp = getModal({\n\t\t\t\tassistiveText: {\n\t\t\t\t\tcloseButton: 'Exit',\n\t\t\t\t},\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'large',\n\t\t\t\tcontainerClassName: 'my-custom-class',\n\t\t\t\tonRequestClose: () => {\n\t\t\t\t\tclosed = true;\n\t\t\t\t},\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('size is set to large', () => {\n\t\t\texpect(modal.className).to.include('slds-modal_large');\n\t\t});\n\n\t\tit('adds custom classname from modal container prop', () => {\n\t\t\texpect(modal.firstChild.className).to.include('my-custom-class');\n\t\t});\n\n\t\tit('renders correct assistive text/title for close button', () => {\n\t\t\tconst closeBtn = modal.querySelector('.slds-modal__close');\n\t\t\texpect(closeBtn.title).to.equal('Exit');\n\t\t});\n\n\t\tit('calls onRequestClose', () => {\n\t\t\tconst closeBtn = modal.querySelector('.slds-modal__close');\n\t\t\texpect(closed).to.be.false;\n\t\t\tSimulate.click(closeBtn, {});\n\t\t\texpect(closed).to.be.true;\n\t\t});\n\t});\n\n\tdescribe('Proper HTML markup', () => {\n\t\tit('dismissible modal has role=dialog', () => {\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'medium',\n\t\t\t});\n\t\t\tconst modal = getModalContainerNode(document.body);\n\t\t\tconst role = modal.getAttribute('role');\n\t\t\texpect(role).to.equal('dialog');\n\t\t});\n\n\t\tit('non-dismissible modal has role=alertdialog', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdisableClose: true,\n\t\t\t});\n\t\t\tconst modal = getModalContainerNode(document.body);\n\t\t\tconst role = modal.getAttribute('role');\n\t\t\texpect(role).to.equal('alertdialog');\n\t\t});\n\t});\n\n\tdescribe('Open with custom header and header className', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tgetModal({\n\t\t\t\theader: <div id=\"art-vandelay\">Art vandelay</div>,\n\t\t\t\theaderClassName: 'art-vandelay',\n\t\t\t\tisOpen: true,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the header', () => {\n\t\t\tconst customHeader = modal.querySelector('#art-vandelay');\n\t\t\texpect(customHeader).to.not.be.null;\n\t\t});\n\n\t\tit('adds the custom header class', () => {\n\t\t\texpect(modal.querySelector('.slds-modal__header').className).to.include(\n\t\t\t\t'art-vandelay'\n\t\t\t);\n\t\t});\n\t});\n\n\tdescribe('Open with Prompt and Footer', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = <div className=\"toes\">Toes</div>;\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tprompt: 'warning',\n\t\t\t\theading: 'are you sure?',\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the footer', () => {\n\t\t\tconst footer = modal.querySelector('.slds-modal__footer');\n\t\t\texpect(footer.className).to.include('slds-theme_default');\n\t\t});\n\n\t\tit('adds the prompt class', () => {\n\t\t\texpect(modal.className).to.include('slds-modal_prompt');\n\t\t});\n\n\t\tit('adds the prompt theme class', () => {\n\t\t\texpect(modal.querySelector('.slds-modal__header').className).to.include(\n\t\t\t\t'slds-theme_warning'\n\t\t\t);\n\t\t});\n\n\t\tit('adds the footer html content', () => {\n\t\t\texpect(modal.querySelector('.toes').innerHTML).to.equal('Toes');\n\t\t});\n\t});\n\n\tdescribe('Open Directional', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = [\n\t\t\t\t<div key=\"test-content1\" className=\"toes\">\n\t\t\t\t\tToe 1\n\t\t\t\t</div>,\n\t\t\t\t<div key=\"test-content2\" className=\"toes\">\n\t\t\t\t\tToe 2\n\t\t\t\t</div>,\n\t\t\t];\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdirectional: true,\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the footer', () => {\n\t\t\tconst footer = modal.querySelector('.slds-modal__footer_directional');\n\t\t\texpect(footer.className).to.include('slds-modal__footer');\n\t\t});\n\t});\n\n\tdescribe('Keyboard behavior', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = [\n\t\t\t\t<button type=\"button\" key=\"test-content1\" className=\"cancel\">\n\t\t\t\t\tCancel\n\t\t\t\t</button>,\n\t\t\t\t<button type=\"button\" key=\"test-content2\" className=\"save\">\n\t\t\t\t\tSave\n\t\t\t\t</button>,\n\t\t\t];\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdirectional: true,\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('first tab focuses close button', () => {\n\t\t\t// There an issue with this test, functionality works fine.\n\t\t\t// setTimeout(() => {\n\t\t\t// \tSimulate.keyDown(modal, {\n\t\t\t// \t\tkey: 'Tab',\n\t\t\t// \t\tkeyCode: 9,\n\t\t\t// \t\twhich: 9,\n\t\t\t// \t});\n\t\t\t// \tsetTimeout(() => {\n\t\t\t// \t\texpect(document.activeElement.className).to.include(\n\t\t\t// \t\t\t'slds-modal__close'\n\t\t\t// \t\t);\n\t\t\t// \t\tdone();\n\t\t\t// \t}, 200);\n\t\t\t// }, 200);\n\t\t});\n\n\t\tit('enter on close button works', () => {\n\t\t\t// TODO: simulate enter on close button and modal is undefined\n\t\t});\n\n\t\tit('traps focus inside Modal', () => {\n\t\t\t// TODO: simulate tabbing around inside of Modal\n\t\t});\n\t});\n});\n"],"file":"modal.browser-test.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../.tmp-es/components/modal/__tests__/modal.browser-test.jsx"],"names":["React","ReactDOM","assign","TestUtils","expect","SLDSModal","IconSettings","Settings","Simulate","describe","container","renderedNode","appNode","document","createElement","id","body","appendChild","setAppElement","after","removeChild","afterEach","unmountComponentAtNode","defaultProps","align","children","renderModal","modalInstance","opener","render","createModal","props","getModal","getModalContainerNode","dom","querySelector","getModalNode","beforeEach","containerClassName","contentClassName","contentStyle","height","isOpen","portalClassName","it","modalContainer","to","exist","modalContent","style","equal","modalPortal","cmp","size","modal","className","include","overflow","be","null","closed","assistiveText","closeButton","onRequestClose","firstChild","closeBtn","title","false","click","true","role","getAttribute","disableClose","header","headerClassName","customHeader","not","feet","prompt","heading","footer","innerHTML","directional"],"mappings":"AAAA;;AACA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,QAAP,MAAqB,WAArB;AACA,OAAOC,MAAP,MAAmB,eAAnB;AACA,OAAOC,SAAP,MAAsB,sBAAtB;AACA,SAASC,MAAT,QAAuB,MAAvB;AAEA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,YAAP,MAAyB,qBAAzB;AACA,OAAOC,QAAP,MAAqB,gBAArB;AAEA,IAAQC,QAAR,GAAqBL,SAArB,CAAQK,QAAR;AAEAC,QAAQ,CAAC,aAAD,EAAgB,YAAY;AACnC,MAAIC,SAAJ;AACA,MAAIC,YAAJ,CAFmC,CAInC;;AACA,MAAIC,OAAO,GAAGC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAAd;AACAF,EAAAA,OAAO,CAACG,EAAR,GAAa,KAAb;AACAF,EAAAA,QAAQ,CAACG,IAAT,CAAcC,WAAd,CAA0BL,OAA1B;AACAL,EAA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QAAAA,MAAM,EAAE,IADA;AAERwC,QAAAA,WAAW,EAAE,IAFL;AAGRF,QAAAA,MAAM,EAAEH;AAHA,OAAD,CAAR;AAKAvB,MAAAA,KAAK,GAAGlB,YAAY,CAACvB,QAAQ,CAACG,IAAV,CAApB;AACA,KAfS,CAAV;AAiBA4B,IAAAA,EAAE,CAAC,gCAAD,EAAmC,YAAM,CAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAfC,CAAF;AAiBAA,IAAAA,EAAE,CAAC,6BAAD,EAAgC,YAAM,CACvC;AACA,KAFC,CAAF;AAIAA,IAAAA,EAAE,CAAC,0BAAD,EAA6B,YAAM,CACpC;AACA,KAFC,CAAF;AAGA,GA5CO,CAAR;AA6CA,CAxTO,CAAR","sourcesContent":["/* eslint-disable no-unused-vars */\n/* eslint-disable react/no-find-dom-node */\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport assign from 'lodash.assign';\nimport TestUtils from 'react-dom/test-utils';\nimport { expect } from 'chai';\n\nimport SLDSModal from '../../modal';\nimport IconSettings from '../../icon-settings';\nimport Settings from '../../settings';\n\nconst { Simulate } = TestUtils;\n\ndescribe('SLDSModal: ', function () {\n\tlet container;\n\tlet renderedNode;\n\n\t// set \"app node\" fixture, so no warnings are triggered.\n\tlet appNode = document.createElement('span');\n\tappNode.id = 'app';\n\tdocument.body.appendChild(appNode);\n\tSettings.setAppElement('#app');\n\n\tafter(() => {\n\t\tdocument.body.removeChild(appNode);\n\t\tappNode = null;\n\t});\n\n\tafterEach(() => {\n\t\tReactDOM.unmountComponentAtNode(container);\n\t\tdocument.body.removeChild(container);\n\t\tcontainer = null;\n\t});\n\n\tconst defaultProps = {\n\t\talign: 'top',\n\t\tchildren: <div key>hello</div>,\n\t};\n\n\tconst renderModal = (modalInstance) => {\n\t\tcontainer = document.createElement('div');\n\n\t\tconst opener = (\n\t\t\t<button type=\"button\">\n\t\t\t\t<IconSettings iconPath=\"/assets/icons\">{modalInstance}</IconSettings>\n\t\t\t</button>\n\t\t);\n\t\tdocument.body.appendChild(container);\n\t\t// eslint-disable-next-line react/no-render-return-value\n\t\trenderedNode = ReactDOM.render(opener, container); // deepscan-disable-line REACT_ASYNC_RENDER_RETURN_VALUE\n\t\treturn renderedNode;\n\t};\n\n\tconst createModal = (props) =>\n\t\tReact.createElement(SLDSModal, assign({}, defaultProps, props));\n\n\tconst getModal = (props) => renderModal(createModal(props));\n\n\tconst getModalContainerNode = (dom) =>\n\t\tdom.querySelector('[role=\"dialog\"]') ||\n\t\tdom.querySelector('[role=\"alertdialog\"]');\n\tconst getModalNode = (dom) => dom.querySelector('.slds-modal');\n\n\tdescribe('Styling', () => {\n\t\tbeforeEach(() => {\n\t\t\tgetModal({\n\t\t\t\tcontainerClassName: 'container-class-name-test',\n\t\t\t\tcontentClassName: 'content-class-name-test',\n\t\t\t\tcontentStyle: { height: '500px' },\n\t\t\t\tisOpen: true,\n\t\t\t\tportalClassName: 'portal-class-name-test',\n\t\t\t});\n\t\t});\n\t\tit('has correct containerClassName, contentClassName, contentStyle, and portalClassName', () => {\n\t\t\tconst modalContainer = getModalNode(document.body).querySelector(\n\t\t\t\t'.slds-modal__container.container-class-name-test'\n\t\t\t);\n\t\t\texpect(modalContainer).to.exist;\n\t\t\tconst modalContent = getModalNode(document.body).querySelector(\n\t\t\t\t'.slds-modal__content.content-class-name-test'\n\t\t\t);\n\t\t\texpect(modalContent).to.exist;\n\t\t\texpect(modalContent.style.height).to.equal('500px');\n\t\t\tconst modalPortal = document.querySelector(\n\t\t\t\t'body > .portal-class-name-test'\n\t\t\t);\n\t\t\texpect(modalPortal).to.exist;\n\t\t});\n\t});\n\n\tdescribe('Sizing', () => {\n\t\tit('size is set to small', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'small',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_small');\n\t\t});\n\t\tit('size is set to medium', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'medium',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_medium');\n\t\t});\n\t\tit('size is set to large', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'large',\n\t\t\t});\n\t\t\tconst modal = getModalNode(document.body);\n\t\t\texpect(modal.className).to.include('slds-modal_large');\n\t\t});\n\t});\n\n\tdescribe('Closed modal', () => {\n\t\tbeforeEach(() => {\n\t\t\tgetModal({ isOpen: false });\n\t\t});\n\n\t\tit('updates the overflow', () => {\n\t\t\texpect(document.body.style.overflow).to.equal('inherit');\n\t\t});\n\n\t\tit('does not render to the body', () => {\n\t\t\texpect(getModalNode(document.body)).to.be.null;\n\t\t});\n\t});\n\n\tdescribe('Open modal', () => {\n\t\tlet cmp;\n\t\tlet closed;\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tclosed = false;\n\t\t\tcmp = getModal({\n\t\t\t\tassistiveText: {\n\t\t\t\t\tcloseButton: 'Exit',\n\t\t\t\t},\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'large',\n\t\t\t\tcontainerClassName: 'my-custom-class',\n\t\t\t\tonRequestClose: () => {\n\t\t\t\t\tclosed = true;\n\t\t\t\t},\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('size is set to large', () => {\n\t\t\texpect(modal.className).to.include('slds-modal_large');\n\t\t});\n\n\t\tit('adds custom classname from modal container prop', () => {\n\t\t\texpect(modal.firstChild.className).to.include('my-custom-class');\n\t\t});\n\n\t\tit('renders correct assistive text/title for close button', () => {\n\t\t\tconst closeBtn = modal.querySelector('.slds-modal__close');\n\t\t\texpect(closeBtn.title).to.equal('Exit');\n\t\t});\n\n\t\tit('calls onRequestClose', () => {\n\t\t\tconst closeBtn = modal.querySelector('.slds-modal__close');\n\t\t\texpect(closed).to.be.false;\n\t\t\tSimulate.click(closeBtn, {});\n\t\t\texpect(closed).to.be.true;\n\t\t});\n\t});\n\n\tdescribe('Proper HTML markup', () => {\n\t\tit('dismissible modal has role=dialog', () => {\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tsize: 'medium',\n\t\t\t});\n\t\t\tconst modal = getModalContainerNode(document.body);\n\t\t\tconst role = modal.getAttribute('role');\n\t\t\texpect(role).to.equal('dialog');\n\t\t});\n\n\t\tit('non-dismissible modal has role=alertdialog', () => {\n\t\t\tconst cmp = getModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdisableClose: true,\n\t\t\t});\n\t\t\tconst modal = getModalContainerNode(document.body);\n\t\t\tconst role = modal.getAttribute('role');\n\t\t\texpect(role).to.equal('alertdialog');\n\t\t});\n\t});\n\n\tdescribe('Open with custom header and header className', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tgetModal({\n\t\t\t\theader: <div id=\"art-vandelay\">Art vandelay</div>,\n\t\t\t\theaderClassName: 'art-vandelay',\n\t\t\t\tisOpen: true,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the header', () => {\n\t\t\tconst customHeader = modal.querySelector('#art-vandelay');\n\t\t\texpect(customHeader).to.not.be.null;\n\t\t});\n\n\t\tit('adds the custom header class', () => {\n\t\t\texpect(modal.querySelector('.slds-modal__header').className).to.include(\n\t\t\t\t'art-vandelay'\n\t\t\t);\n\t\t});\n\t});\n\n\tdescribe('Open with Prompt and Footer', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = <div className=\"toes\">Toes</div>;\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tprompt: 'warning',\n\t\t\t\theading: 'are you sure?',\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the footer', () => {\n\t\t\tconst footer = modal.querySelector('.slds-modal__footer');\n\t\t\texpect(footer.className).to.include('slds-theme_default');\n\t\t});\n\n\t\tit('adds the prompt class', () => {\n\t\t\texpect(modal.className).to.include('slds-modal_prompt');\n\t\t});\n\n\t\tit('adds the prompt theme class', () => {\n\t\t\texpect(modal.querySelector('.slds-modal__header').className).to.include(\n\t\t\t\t'slds-theme_warning'\n\t\t\t);\n\t\t});\n\n\t\tit('adds the footer html content', () => {\n\t\t\texpect(modal.querySelector('.toes').innerHTML).to.equal('Toes');\n\t\t});\n\t});\n\n\tdescribe('Open Directional', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = [\n\t\t\t\t<div key=\"test-content1\" className=\"toes\">\n\t\t\t\t\tToe 1\n\t\t\t\t</div>,\n\t\t\t\t<div key=\"test-content2\" className=\"toes\">\n\t\t\t\t\tToe 2\n\t\t\t\t</div>,\n\t\t\t];\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdirectional: true,\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('adds the footer', () => {\n\t\t\tconst footer = modal.querySelector('.slds-modal__footer_directional');\n\t\t\texpect(footer.className).to.include('slds-modal__footer');\n\t\t});\n\t});\n\n\tdescribe('Keyboard behavior', () => {\n\t\tlet modal;\n\n\t\tbeforeEach(() => {\n\t\t\tconst feet = [\n\t\t\t\t<button type=\"button\" key=\"test-content1\" className=\"cancel\">\n\t\t\t\t\tCancel\n\t\t\t\t</button>,\n\t\t\t\t<button type=\"button\" key=\"test-content2\" className=\"save\">\n\t\t\t\t\tSave\n\t\t\t\t</button>,\n\t\t\t];\n\t\t\tgetModal({\n\t\t\t\tisOpen: true,\n\t\t\t\tdirectional: true,\n\t\t\t\tfooter: feet,\n\t\t\t});\n\t\t\tmodal = getModalNode(document.body);\n\t\t});\n\n\t\tit('first tab focuses close button', () => {\n\t\t\t// There an issue with this test, functionality works fine.\n\t\t\t// setTimeout(() => {\n\t\t\t// \tSimulate.keyDown(modal, {\n\t\t\t// \t\tkey: 'Tab',\n\t\t\t// \t\tkeyCode: 9,\n\t\t\t// \t\twhich: 9,\n\t\t\t// \t});\n\t\t\t// \tsetTimeout(() => {\n\t\t\t// \t\texpect(document.activeElement.className).to.include(\n\t\t\t// \t\t\t'slds-modal__close'\n\t\t\t// \t\t);\n\t\t\t// \t\tdone();\n\t\t\t// \t}, 200);\n\t\t\t// }, 200);\n\t\t});\n\n\t\tit('enter on close button works', () => {\n\t\t\t// TODO: simulate enter on close button and modal is undefined\n\t\t});\n\n\t\tit('traps focus inside Modal', () => {\n\t\t\t// TODO: simulate tabbing around inside of Modal\n\t\t});\n\t});\n});\n"],"file":"modal.browser-test.js"}
|
package/module/components/portal-settings/__docs__/__snapshots__/storybook-stories.storyshot
CHANGED
|
@@ -20,6 +20,8 @@ exports[`DOM snapshots SLDSPortalSettings Default, not used 1`] = `
|
|
|
20
20
|
className="slds-combobox_container"
|
|
21
21
|
>
|
|
22
22
|
<div
|
|
23
|
+
aria-expanded={false}
|
|
24
|
+
aria-haspopup="listbox"
|
|
23
25
|
className="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ignore-react-onclickoutside"
|
|
24
26
|
role="combobox"
|
|
25
27
|
>
|
|
@@ -30,8 +32,6 @@ exports[`DOM snapshots SLDSPortalSettings Default, not used 1`] = `
|
|
|
30
32
|
<input
|
|
31
33
|
aria-activedescendant={null}
|
|
32
34
|
aria-autocomplete="list"
|
|
33
|
-
aria-expanded={false}
|
|
34
|
-
aria-haspopup="listbox"
|
|
35
35
|
autoComplete="off"
|
|
36
36
|
className="slds-input slds-combobox__input"
|
|
37
37
|
id="combobox-base"
|
|
@@ -43,7 +43,7 @@ exports[`DOM snapshots SLDSPortalSettings Default, not used 1`] = `
|
|
|
43
43
|
placeholder="Search Salesforce"
|
|
44
44
|
readOnly={false}
|
|
45
45
|
required={false}
|
|
46
|
-
role="
|
|
46
|
+
role="textbox"
|
|
47
47
|
type="text"
|
|
48
48
|
value=""
|
|
49
49
|
/>
|
|
@@ -234,6 +234,8 @@ exports[`DOM snapshots SLDSPortalSettings Override 1`] = `
|
|
|
234
234
|
className="slds-combobox_container"
|
|
235
235
|
>
|
|
236
236
|
<div
|
|
237
|
+
aria-expanded={false}
|
|
238
|
+
aria-haspopup="listbox"
|
|
237
239
|
className="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ignore-react-onclickoutside"
|
|
238
240
|
role="combobox"
|
|
239
241
|
>
|
|
@@ -244,8 +246,6 @@ exports[`DOM snapshots SLDSPortalSettings Override 1`] = `
|
|
|
244
246
|
<input
|
|
245
247
|
aria-activedescendant={null}
|
|
246
248
|
aria-autocomplete="list"
|
|
247
|
-
aria-expanded={false}
|
|
248
|
-
aria-haspopup="listbox"
|
|
249
249
|
autoComplete="off"
|
|
250
250
|
className="slds-input slds-combobox__input"
|
|
251
251
|
id="combobox-base"
|
|
@@ -257,7 +257,7 @@ exports[`DOM snapshots SLDSPortalSettings Override 1`] = `
|
|
|
257
257
|
placeholder="Search Salesforce"
|
|
258
258
|
readOnly={false}
|
|
259
259
|
required={false}
|
|
260
|
-
role="
|
|
260
|
+
role="textbox"
|
|
261
261
|
type="text"
|
|
262
262
|
value=""
|
|
263
263
|
/>
|
package/module/components/progress-indicator/__docs__/__snapshots__/storybook-stories.storyshot
CHANGED
|
@@ -1106,7 +1106,15 @@ exports[`DOM snapshots SLDSProgressIndicator SetupAssistant 1`] = `
|
|
|
1106
1106
|
className="slds-button slds-progress__marker"
|
|
1107
1107
|
onClick={[Function]}
|
|
1108
1108
|
type="button"
|
|
1109
|
-
|
|
1109
|
+
>
|
|
1110
|
+
<span
|
|
1111
|
+
className="slds-assistive-text"
|
|
1112
|
+
>
|
|
1113
|
+
Step 1:
|
|
1114
|
+
label #1
|
|
1115
|
+
|
|
1116
|
+
</span>
|
|
1117
|
+
</button>
|
|
1110
1118
|
<div
|
|
1111
1119
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1112
1120
|
id="progress-indicator-vertical-label-0"
|
|
@@ -1146,7 +1154,15 @@ exports[`DOM snapshots SLDSProgressIndicator SetupAssistant 1`] = `
|
|
|
1146
1154
|
className="slds-button slds-progress__marker"
|
|
1147
1155
|
onClick={[Function]}
|
|
1148
1156
|
type="button"
|
|
1149
|
-
|
|
1157
|
+
>
|
|
1158
|
+
<span
|
|
1159
|
+
className="slds-assistive-text"
|
|
1160
|
+
>
|
|
1161
|
+
Step 2:
|
|
1162
|
+
label #2
|
|
1163
|
+
|
|
1164
|
+
</span>
|
|
1165
|
+
</button>
|
|
1150
1166
|
<div
|
|
1151
1167
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1152
1168
|
id="progress-indicator-vertical-label-1"
|
|
@@ -1186,7 +1202,15 @@ exports[`DOM snapshots SLDSProgressIndicator SetupAssistant 1`] = `
|
|
|
1186
1202
|
className="slds-button slds-progress__marker"
|
|
1187
1203
|
onClick={[Function]}
|
|
1188
1204
|
type="button"
|
|
1189
|
-
|
|
1205
|
+
>
|
|
1206
|
+
<span
|
|
1207
|
+
className="slds-assistive-text"
|
|
1208
|
+
>
|
|
1209
|
+
Step 3:
|
|
1210
|
+
label #3
|
|
1211
|
+
- Disabled
|
|
1212
|
+
</span>
|
|
1213
|
+
</button>
|
|
1190
1214
|
<div
|
|
1191
1215
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1192
1216
|
id="progress-indicator-vertical-label-2"
|
|
@@ -1229,7 +1253,15 @@ exports[`DOM snapshots SLDSProgressIndicator SetupAssistant 1`] = `
|
|
|
1229
1253
|
className="slds-button slds-progress__marker"
|
|
1230
1254
|
onClick={[Function]}
|
|
1231
1255
|
type="button"
|
|
1232
|
-
|
|
1256
|
+
>
|
|
1257
|
+
<span
|
|
1258
|
+
className="slds-assistive-text"
|
|
1259
|
+
>
|
|
1260
|
+
Step 4:
|
|
1261
|
+
label #4
|
|
1262
|
+
- Disabled
|
|
1263
|
+
</span>
|
|
1264
|
+
</button>
|
|
1233
1265
|
<div
|
|
1234
1266
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1235
1267
|
id="progress-indicator-vertical-label-3"
|
|
@@ -1290,7 +1322,15 @@ exports[`DOM snapshots SLDSProgressIndicator SetupAssistant 1`] = `
|
|
|
1290
1322
|
className="slds-button slds-progress__marker"
|
|
1291
1323
|
onClick={[Function]}
|
|
1292
1324
|
type="button"
|
|
1293
|
-
|
|
1325
|
+
>
|
|
1326
|
+
<span
|
|
1327
|
+
className="slds-assistive-text"
|
|
1328
|
+
>
|
|
1329
|
+
Step 5:
|
|
1330
|
+
label #5
|
|
1331
|
+
- Disabled
|
|
1332
|
+
</span>
|
|
1333
|
+
</button>
|
|
1294
1334
|
<div
|
|
1295
1335
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1296
1336
|
id="progress-indicator-vertical-label-4"
|
|
@@ -1597,7 +1637,15 @@ exports[`DOM snapshots SLDSProgressIndicator Vertical 1`] = `
|
|
|
1597
1637
|
className="slds-button slds-progress__marker"
|
|
1598
1638
|
onClick={[Function]}
|
|
1599
1639
|
type="button"
|
|
1600
|
-
|
|
1640
|
+
>
|
|
1641
|
+
<span
|
|
1642
|
+
className="slds-assistive-text"
|
|
1643
|
+
>
|
|
1644
|
+
Step 1:
|
|
1645
|
+
label #1
|
|
1646
|
+
|
|
1647
|
+
</span>
|
|
1648
|
+
</button>
|
|
1601
1649
|
<div
|
|
1602
1650
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1603
1651
|
id="progress-indicator-vertical-label-0"
|
|
@@ -1612,7 +1660,15 @@ exports[`DOM snapshots SLDSProgressIndicator Vertical 1`] = `
|
|
|
1612
1660
|
className="slds-button slds-progress__marker"
|
|
1613
1661
|
onClick={[Function]}
|
|
1614
1662
|
type="button"
|
|
1615
|
-
|
|
1663
|
+
>
|
|
1664
|
+
<span
|
|
1665
|
+
className="slds-assistive-text"
|
|
1666
|
+
>
|
|
1667
|
+
Step 2:
|
|
1668
|
+
label #2
|
|
1669
|
+
|
|
1670
|
+
</span>
|
|
1671
|
+
</button>
|
|
1616
1672
|
<div
|
|
1617
1673
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1618
1674
|
id="progress-indicator-vertical-label-1"
|
|
@@ -1627,7 +1683,15 @@ exports[`DOM snapshots SLDSProgressIndicator Vertical 1`] = `
|
|
|
1627
1683
|
className="slds-button slds-progress__marker"
|
|
1628
1684
|
onClick={[Function]}
|
|
1629
1685
|
type="button"
|
|
1630
|
-
|
|
1686
|
+
>
|
|
1687
|
+
<span
|
|
1688
|
+
className="slds-assistive-text"
|
|
1689
|
+
>
|
|
1690
|
+
Step 3:
|
|
1691
|
+
label #3
|
|
1692
|
+
- Disabled
|
|
1693
|
+
</span>
|
|
1694
|
+
</button>
|
|
1631
1695
|
<div
|
|
1632
1696
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1633
1697
|
id="progress-indicator-vertical-label-2"
|
|
@@ -1642,7 +1706,15 @@ exports[`DOM snapshots SLDSProgressIndicator Vertical 1`] = `
|
|
|
1642
1706
|
className="slds-button slds-progress__marker"
|
|
1643
1707
|
onClick={[Function]}
|
|
1644
1708
|
type="button"
|
|
1645
|
-
|
|
1709
|
+
>
|
|
1710
|
+
<span
|
|
1711
|
+
className="slds-assistive-text"
|
|
1712
|
+
>
|
|
1713
|
+
Step 4:
|
|
1714
|
+
label #4
|
|
1715
|
+
- Disabled
|
|
1716
|
+
</span>
|
|
1717
|
+
</button>
|
|
1646
1718
|
<div
|
|
1647
1719
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1648
1720
|
id="progress-indicator-vertical-label-3"
|
|
@@ -1657,7 +1729,15 @@ exports[`DOM snapshots SLDSProgressIndicator Vertical 1`] = `
|
|
|
1657
1729
|
className="slds-button slds-progress__marker"
|
|
1658
1730
|
onClick={[Function]}
|
|
1659
1731
|
type="button"
|
|
1660
|
-
|
|
1732
|
+
>
|
|
1733
|
+
<span
|
|
1734
|
+
className="slds-assistive-text"
|
|
1735
|
+
>
|
|
1736
|
+
Step 5:
|
|
1737
|
+
label #5
|
|
1738
|
+
- Disabled
|
|
1739
|
+
</span>
|
|
1740
|
+
</button>
|
|
1661
1741
|
<div
|
|
1662
1742
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1663
1743
|
id="progress-indicator-vertical-label-4"
|
|
@@ -1708,6 +1788,13 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1708
1788
|
</svg>
|
|
1709
1789
|
|
|
1710
1790
|
</span>
|
|
1791
|
+
<span
|
|
1792
|
+
className="slds-assistive-text"
|
|
1793
|
+
>
|
|
1794
|
+
Step 1:
|
|
1795
|
+
label #1
|
|
1796
|
+
- Completed
|
|
1797
|
+
</span>
|
|
1711
1798
|
</button>
|
|
1712
1799
|
<div
|
|
1713
1800
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
@@ -1735,6 +1822,13 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1735
1822
|
</svg>
|
|
1736
1823
|
|
|
1737
1824
|
</span>
|
|
1825
|
+
<span
|
|
1826
|
+
className="slds-assistive-text"
|
|
1827
|
+
>
|
|
1828
|
+
Step 2:
|
|
1829
|
+
label #2
|
|
1830
|
+
- Completed
|
|
1831
|
+
</span>
|
|
1738
1832
|
</button>
|
|
1739
1833
|
<div
|
|
1740
1834
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
@@ -1762,6 +1856,13 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1762
1856
|
</svg>
|
|
1763
1857
|
|
|
1764
1858
|
</span>
|
|
1859
|
+
<span
|
|
1860
|
+
className="slds-assistive-text"
|
|
1861
|
+
>
|
|
1862
|
+
Step 3:
|
|
1863
|
+
label #3
|
|
1864
|
+
- Completed
|
|
1865
|
+
</span>
|
|
1765
1866
|
</button>
|
|
1766
1867
|
<div
|
|
1767
1868
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
@@ -1789,6 +1890,13 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1789
1890
|
</svg>
|
|
1790
1891
|
|
|
1791
1892
|
</span>
|
|
1893
|
+
<span
|
|
1894
|
+
className="slds-assistive-text"
|
|
1895
|
+
>
|
|
1896
|
+
Step 4:
|
|
1897
|
+
label #4
|
|
1898
|
+
- Completed
|
|
1899
|
+
</span>
|
|
1792
1900
|
</button>
|
|
1793
1901
|
<div
|
|
1794
1902
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
@@ -1816,6 +1924,13 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1816
1924
|
</svg>
|
|
1817
1925
|
|
|
1818
1926
|
</span>
|
|
1927
|
+
<span
|
|
1928
|
+
className="slds-assistive-text"
|
|
1929
|
+
>
|
|
1930
|
+
Step 5:
|
|
1931
|
+
label #5
|
|
1932
|
+
- Error
|
|
1933
|
+
</span>
|
|
1819
1934
|
</button>
|
|
1820
1935
|
<div
|
|
1821
1936
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
@@ -1831,7 +1946,15 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1831
1946
|
className="slds-button slds-progress__marker"
|
|
1832
1947
|
onClick={[Function]}
|
|
1833
1948
|
type="button"
|
|
1834
|
-
|
|
1949
|
+
>
|
|
1950
|
+
<span
|
|
1951
|
+
className="slds-assistive-text"
|
|
1952
|
+
>
|
|
1953
|
+
Step 6:
|
|
1954
|
+
label #6
|
|
1955
|
+
|
|
1956
|
+
</span>
|
|
1957
|
+
</button>
|
|
1835
1958
|
<div
|
|
1836
1959
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1837
1960
|
id="progress-indicator-vertical-label-5"
|
|
@@ -1846,7 +1969,15 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1846
1969
|
className="slds-button slds-progress__marker"
|
|
1847
1970
|
onClick={[Function]}
|
|
1848
1971
|
type="button"
|
|
1849
|
-
|
|
1972
|
+
>
|
|
1973
|
+
<span
|
|
1974
|
+
className="slds-assistive-text"
|
|
1975
|
+
>
|
|
1976
|
+
Step 7:
|
|
1977
|
+
label #7
|
|
1978
|
+
|
|
1979
|
+
</span>
|
|
1980
|
+
</button>
|
|
1850
1981
|
<div
|
|
1851
1982
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1852
1983
|
id="progress-indicator-vertical-label-6"
|
|
@@ -1861,7 +1992,15 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1861
1992
|
className="slds-button slds-progress__marker"
|
|
1862
1993
|
onClick={[Function]}
|
|
1863
1994
|
type="button"
|
|
1864
|
-
|
|
1995
|
+
>
|
|
1996
|
+
<span
|
|
1997
|
+
className="slds-assistive-text"
|
|
1998
|
+
>
|
|
1999
|
+
Step 8:
|
|
2000
|
+
label #8
|
|
2001
|
+
|
|
2002
|
+
</span>
|
|
2003
|
+
</button>
|
|
1865
2004
|
<div
|
|
1866
2005
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1867
2006
|
id="progress-indicator-vertical-label-7"
|
|
@@ -1876,7 +2015,15 @@ exports[`DOM snapshots SLDSProgressIndicator VerticalStepError 1`] = `
|
|
|
1876
2015
|
className="slds-button slds-progress__marker"
|
|
1877
2016
|
onClick={[Function]}
|
|
1878
2017
|
type="button"
|
|
1879
|
-
|
|
2018
|
+
>
|
|
2019
|
+
<span
|
|
2020
|
+
className="slds-assistive-text"
|
|
2021
|
+
>
|
|
2022
|
+
Step 9:
|
|
2023
|
+
label #9
|
|
2024
|
+
|
|
2025
|
+
</span>
|
|
2026
|
+
</button>
|
|
1880
2027
|
<div
|
|
1881
2028
|
className="slds-progress__item_content slds-grid slds-grid_align-spread"
|
|
1882
2029
|
id="progress-indicator-vertical-label-8"
|
|
@@ -95,7 +95,7 @@ var StepVertical = /*#__PURE__*/function (_React$Component) {
|
|
|
95
95
|
|
|
96
96
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
97
97
|
|
|
98
|
-
_defineProperty(_assertThisInitialized(_this), "stepIcon", function (renderIcon) {
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this), "stepIcon", function (renderIcon, status, props) {
|
|
99
99
|
var data = {
|
|
100
100
|
isSelected: _this.props.isSelected,
|
|
101
101
|
isError: _this.props.isError,
|
|
@@ -119,12 +119,16 @@ var StepVertical = /*#__PURE__*/function (_React$Component) {
|
|
|
119
119
|
}),
|
|
120
120
|
type: "button",
|
|
121
121
|
onClick: handleClick
|
|
122
|
-
}, icon
|
|
122
|
+
}, icon, /*#__PURE__*/React.createElement("span", {
|
|
123
|
+
className: "slds-assistive-text"
|
|
124
|
+
}, _this.props.step.assistiveText || /*#__PURE__*/React.createElement(React.Fragment, null, "".concat(_this.props.assistiveText.step, " ").concat(_this.props.index + 1, ": "), _this.props.step.label, status ? " - ".concat(status) : ''))) : /*#__PURE__*/React.createElement("span", {
|
|
123
125
|
className: classNames('slds-progress__marker', {
|
|
124
126
|
'slds-progress__marker_icon': renderIcon,
|
|
125
127
|
'slds-progress__marker_icon-success': _this.props.variant === 'setup-assistant' && renderIcon && !_this.props.isError
|
|
126
128
|
})
|
|
127
|
-
}, icon
|
|
129
|
+
}, icon, /*#__PURE__*/React.createElement("span", {
|
|
130
|
+
className: "slds-assistive-text"
|
|
131
|
+
}, _this.props.step.assistiveText || /*#__PURE__*/React.createElement(React.Fragment, null, "".concat(props.assistiveText.step, " ").concat(props.index + 1, ": "), props.step.label, status ? " - ".concat(status) : '')));
|
|
128
132
|
});
|
|
129
133
|
|
|
130
134
|
_defineProperty(_assertThisInitialized(_this), "renderStepContent", function () {
|
|
@@ -156,13 +160,23 @@ var StepVertical = /*#__PURE__*/function (_React$Component) {
|
|
|
156
160
|
key: "render",
|
|
157
161
|
value: function render() {
|
|
158
162
|
var renderIcon = this.props.isCompleted || this.props.isError;
|
|
163
|
+
var status = '';
|
|
164
|
+
|
|
165
|
+
if (this.props.isError) {
|
|
166
|
+
status = this.props.assistiveText.errorStep;
|
|
167
|
+
} else if (this.props.isCompleted) {
|
|
168
|
+
status = this.props.assistiveText.completedStep;
|
|
169
|
+
} else if (this.props.isDisabled) {
|
|
170
|
+
status = this.props.assistiveText.disabledStep;
|
|
171
|
+
}
|
|
172
|
+
|
|
159
173
|
return /*#__PURE__*/React.createElement("li", {
|
|
160
174
|
className: classNames('slds-progress__item', {
|
|
161
175
|
'slds-is-completed': this.props.isCompleted,
|
|
162
176
|
'slds-is-active': this.props.isSelected && !this.props.isError,
|
|
163
177
|
'slds-has-error': this.props.isError
|
|
164
178
|
})
|
|
165
|
-
}, this.stepIcon(renderIcon), this.renderStepContent());
|
|
179
|
+
}, this.stepIcon(renderIcon, status, this.props), this.renderStepContent());
|
|
166
180
|
}
|
|
167
181
|
}]);
|
|
168
182
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../.tmp-es/components/progress-indicator/private/step-vertical.jsx"],"names":["React","PropTypes","classNames","PROGRESS_INDICATOR_STEP_VERTICAL","Icon","displayName","propTypes","index","number","isCompleted","bool","isError","isSelected","onClick","func","step","object","variant","string","StepVertical","renderIcon","data","props","icon","handleClick","event","onRenderSetupAssistantAction","setupAssistantEstimatedTime","id","label","stepIcon","renderStepContent","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB,C,CAEA;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;;AACA,SAASC,gCAAT,QAAiD,8BAAjD;AACA,OAAOC,IAAP,M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AAhB,IAAsB,MAAKN,KAAL,CAAWf,KADhC,CADH;AAIC,QAAA,SAAS,EAAC;AAJX,SAME,MAAKe,KAAL,CAAWP,IAAX,CAAgBc,KANlB,CADD;AAUA,K;;;;;;;WAED,kBAAS;AACR,UAAMT,UAAU,GAAG,KAAKE,KAAL,CAAWb,WAAX,IAA0B,KAAKa,KAAL,CAAWX,OAAxD;AAEA,0BACC;AACC,QAAA,SAAS,EAAET,UAAU,CAAC,qBAAD,EAAwB;AAC5C,+BAAqB,KAAKoB,KAAL,CAAWb,WADY;AAE5C,4BAAkB,KAAKa,KAAL,CAAWV,UAAX,IAAyB,CAAC,KAAKU,KAAL,CAAWX,OAFX;AAG5C,4BAAkB,KAAKW,KAAL,CAAWX;AAHe,SAAxB;AADtB,SAOE,KAAKmB,QAAL,CAAcV,UAAd,CAPF,EAQE,KAAKW,iBAAL,EARF,CADD;AAYA;;;;EAxGyB/B,KAAK,CAACgC,S;;AA2GjCb,YAAY,CAACb,SAAb,GAAyBA,SAAzB;AACAa,YAAY,CAACd,WAAb,GAA2BA,WAA3B;AAEA,eAAec,YAAf,C,CAA6B","sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// Child component\nimport { PROGRESS_INDICATOR_STEP_VERTICAL } from '../../../utilities/constants';\nimport Icon from '../../icon';\n\n// ### Display Name\nconst displayName = PROGRESS_INDICATOR_STEP_VERTICAL;\n\n// ### Prop Types\nconst propTypes = {\n\t/**\n\t * Index of step. Used for id's if no step ID exists\n\t */\n\tindex: PropTypes.number,\n\t/**\n\t * Determines if the step has been completed\n\t */\n\tisCompleted: PropTypes.bool,\n\t/**\n\t * Determines if the step contains an error\n\t */\n\tisError: PropTypes.bool,\n\t/**\n\t * Determines if the step is currently selected (active)\n\t */\n\tisSelected: PropTypes.bool,\n\t/**\n\t * Triggered when click on individual steps. By default, it receives an event and returns all info passed to that step.\n\t * users are able to re-define it by passing a function as a prop\n\t */\n\tonClick: PropTypes.func,\n\t/**\n\t * Step object. This is passed into event callbacks.\n\t */\n\tstep: PropTypes.object,\n\t/**\n\t * The variant of the parent progress indicator\n\t */\n\tvariant: PropTypes.string,\n};\n\n/**\n * StepVertical renders a step icon and its step label if applied\n */\nclass StepVertical extends React.Component {\n\t/**\n\t * stepIcon represents the icon used for each step.\n\t */\n\tstepIcon = (renderIcon) => {\n\t\tconst data = {\n\t\t\tisSelected: this.props.isSelected,\n\t\t\tisError: this.props.isError,\n\t\t\tisCompleted: this.props.isCompleted,\n\t\t\tstep: this.props.step,\n\t\t};\n\n\t\tconst icon = renderIcon ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tsize=\"x-small\"\n\t\t\t\tname={this.props.isError ? 'error' : 'success'}\n\t\t\t/>\n\t\t) : null;\n\n\t\tconst handleClick = (event) => this.props.onClick(event, data);\n\n\t\treturn this.props.onClick ? (\n\t\t\t<button\n\t\t\t\tclassName={classNames('slds-button slds-progress__marker', {\n\t\t\t\t\t'slds-progress__marker_icon': renderIcon,\n\t\t\t\t\t'slds-progress__marker_icon-success':\n\t\t\t\t\t\tthis.props.variant === 'setup-assistant' &&\n\t\t\t\t\t\trenderIcon &&\n\t\t\t\t\t\t!this.props.isError,\n\t\t\t\t})}\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t</button>\n\t\t) : (\n\t\t\t<span\n\t\t\t\tclassName={classNames('slds-progress__marker', {\n\t\t\t\t\t'slds-progress__marker_icon': renderIcon,\n\t\t\t\t\t'slds-progress__marker_icon-success':\n\t\t\t\t\t\tthis.props.variant === 'setup-assistant' &&\n\t\t\t\t\t\trenderIcon &&\n\t\t\t\t\t\t!this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t</span>\n\t\t);\n\t};\n\n\trenderStepContent = () => {\n\t\tif (\n\t\t\tthis.props.step.onRenderSetupAssistantAction ||\n\t\t\tthis.props.step.setupAssistantEstimatedTime\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`progress-indicator-vertical-label-${\n\t\t\t\t\t\tthis.props.step.id || this.props.index\n\t\t\t\t\t}`}\n\t\t\t\t\tclassName=\"slds-progress__item_content slds-grid slds-grid_align-spread\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-size_3-of-4\">{this.props.step.label}</div>\n\t\t\t\t\t<div className=\"slds-grid slds-grid_align-end slds-size_1-of-4\">\n\t\t\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t\t\t{this.props.step.onRenderSetupAssistantAction}\n\t\t\t\t\t\t\t{this.props.step.setupAssistantEstimatedTime && (\n\t\t\t\t\t\t\t\t<p className=\"slds-text-align_right slds-text-color_weak slds-p-top_medium\">\n\t\t\t\t\t\t\t\t\t{this.props.step.setupAssistantEstimatedTime}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`progress-indicator-vertical-label-${\n\t\t\t\t\tthis.props.step.id || this.props.index\n\t\t\t\t}`}\n\t\t\t\tclassName=\"slds-progress__item_content slds-grid slds-grid_align-spread\"\n\t\t\t>\n\t\t\t\t{this.props.step.label}\n\t\t\t</div>\n\t\t);\n\t};\n\n\trender() {\n\t\tconst renderIcon = this.props.isCompleted || this.props.isError;\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames('slds-progress__item', {\n\t\t\t\t\t'slds-is-completed': this.props.isCompleted,\n\t\t\t\t\t'slds-is-active': this.props.isSelected && !this.props.isError,\n\t\t\t\t\t'slds-has-error': this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.stepIcon(renderIcon)}\n\t\t\t\t{this.renderStepContent()}\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nStepVertical.propTypes = propTypes;\nStepVertical.displayName = displayName;\n\nexport default StepVertical; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime\n"],"file":"step-vertical.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../.tmp-es/components/progress-indicator/private/step-vertical.jsx"],"names":["React","PropTypes","classNames","PROGRESS_INDICATOR_STEP_VERTICAL","Icon","displayName","propTypes","index","number","isCompleted","bool","isError","isSelected","onClick","func","step","object","variant","string","StepVertical","renderIcon","status","props","data","icon","handleClick","event","assistiveText","label","onRenderSetupAssistantAction","setupAssistantEstimatedTime","id","errorStep","completedStep","isDisabled","disabledStep","stepIcon","renderStepContent","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB,C,CAEA;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;;AACA,SAASC,gCAAT,QAAiD,8BAAjD;AACA,OAAOC,IAAP,MAAiB,YAAjB,C,CAEA;;AACA,IAAMC,WAAW,GAAGF,gCAApB,C,CAEA;;AACA,IAAMG,SAAS,GAAG;AACjB;AACD;AACA;AACCC,EAAAA,KAAK,EAAEN,SAAS,CAACO,MAJA;;AAKjB;AACD;AACA;AACCC,EAAAA,WAAW,EAAER,SAAS,CAACS,IARN;;AASjB;AACD;AACA;AACCC,EAAAA,OAAO,EAAEV,SAAS,CAACS,IAZF;;AAajB;AACD;AACA;AACCE,EAAAA,UAAU,EAAEX,SAAS,CAACS,IAhBL;;AAiBjB;AACD;AACA;AACA;AACCG,EAAAA,OAAO,EAAEZ,SAAS,C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;;EAlIyBrC,KAAK,CAACsC,S;;AAqIjCnB,YAAY,CAACb,SAAb,GAAyBA,SAAzB;AACAa,YAAY,CAACd,WAAb,GAA2BA,WAA3B;AAEA,eAAec,YAAf,C,CAA6B","sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\n// Child component\nimport { PROGRESS_INDICATOR_STEP_VERTICAL } from '../../../utilities/constants';\nimport Icon from '../../icon';\n\n// ### Display Name\nconst displayName = PROGRESS_INDICATOR_STEP_VERTICAL;\n\n// ### Prop Types\nconst propTypes = {\n\t/**\n\t * Index of step. Used for id's if no step ID exists\n\t */\n\tindex: PropTypes.number,\n\t/**\n\t * Determines if the step has been completed\n\t */\n\tisCompleted: PropTypes.bool,\n\t/**\n\t * Determines if the step contains an error\n\t */\n\tisError: PropTypes.bool,\n\t/**\n\t * Determines if the step is currently selected (active)\n\t */\n\tisSelected: PropTypes.bool,\n\t/**\n\t * Triggered when click on individual steps. By default, it receives an event and returns all info passed to that step.\n\t * users are able to re-define it by passing a function as a prop\n\t */\n\tonClick: PropTypes.func,\n\t/**\n\t * Step object. This is passed into event callbacks.\n\t */\n\tstep: PropTypes.object,\n\t/**\n\t * The variant of the parent progress indicator\n\t */\n\tvariant: PropTypes.string,\n};\n\n/**\n * StepVertical renders a step icon and its step label if applied\n */\nclass StepVertical extends React.Component {\n\t/**\n\t * stepIcon represents the icon used for each step.\n\t */\n\tstepIcon = (renderIcon, status, props) => {\n\t\tconst data = {\n\t\t\tisSelected: this.props.isSelected,\n\t\t\tisError: this.props.isError,\n\t\t\tisCompleted: this.props.isCompleted,\n\t\t\tstep: this.props.step,\n\t\t};\n\n\t\tconst icon = renderIcon ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tsize=\"x-small\"\n\t\t\t\tname={this.props.isError ? 'error' : 'success'}\n\t\t\t/>\n\t\t) : null;\n\n\t\tconst handleClick = (event) => this.props.onClick(event, data);\n\n\t\treturn this.props.onClick ? (\n\t\t\t<button\n\t\t\t\tclassName={classNames('slds-button slds-progress__marker', {\n\t\t\t\t\t'slds-progress__marker_icon': renderIcon,\n\t\t\t\t\t'slds-progress__marker_icon-success':\n\t\t\t\t\t\tthis.props.variant === 'setup-assistant' &&\n\t\t\t\t\t\trenderIcon &&\n\t\t\t\t\t\t!this.props.isError,\n\t\t\t\t})}\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleClick}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${this.props.assistiveText.step} ${this.props.index + 1}: `}\n\t\t\t\t\t\t\t{this.props.step.label}\n\t\t\t\t\t\t\t{status ? ` - ${status}` : ''}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t) : (\n\t\t\t<span\n\t\t\t\tclassName={classNames('slds-progress__marker', {\n\t\t\t\t\t'slds-progress__marker_icon': renderIcon,\n\t\t\t\t\t'slds-progress__marker_icon-success':\n\t\t\t\t\t\tthis.props.variant === 'setup-assistant' &&\n\t\t\t\t\t\trenderIcon &&\n\t\t\t\t\t\t!this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t{this.props.step.assistiveText || (\n\t\t\t\t\t\t<React.Fragment>\n\t\t\t\t\t\t\t{`${props.assistiveText.step} ${props.index + 1}: `}\n\t\t\t\t\t\t\t{props.step.label}\n\t\t\t\t\t\t\t{status ? ` - ${status}` : ''}\n\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t);\n\t};\n\n\trenderStepContent = () => {\n\t\tif (\n\t\t\tthis.props.step.onRenderSetupAssistantAction ||\n\t\t\tthis.props.step.setupAssistantEstimatedTime\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`progress-indicator-vertical-label-${\n\t\t\t\t\t\tthis.props.step.id || this.props.index\n\t\t\t\t\t}`}\n\t\t\t\t\tclassName=\"slds-progress__item_content slds-grid slds-grid_align-spread\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-size_3-of-4\">{this.props.step.label}</div>\n\t\t\t\t\t<div className=\"slds-grid slds-grid_align-end slds-size_1-of-4\">\n\t\t\t\t\t\t<div className=\"slds-media__figure slds-media__figure_reverse\">\n\t\t\t\t\t\t\t{this.props.step.onRenderSetupAssistantAction}\n\t\t\t\t\t\t\t{this.props.step.setupAssistantEstimatedTime && (\n\t\t\t\t\t\t\t\t<p className=\"slds-text-align_right slds-text-color_weak slds-p-top_medium\">\n\t\t\t\t\t\t\t\t\t{this.props.step.setupAssistantEstimatedTime}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`progress-indicator-vertical-label-${\n\t\t\t\t\tthis.props.step.id || this.props.index\n\t\t\t\t}`}\n\t\t\t\tclassName=\"slds-progress__item_content slds-grid slds-grid_align-spread\"\n\t\t\t>\n\t\t\t\t{this.props.step.label}\n\t\t\t</div>\n\t\t);\n\t};\n\n\trender() {\n\t\tconst renderIcon = this.props.isCompleted || this.props.isError;\n\t\tlet status = '';\n\t\tif (this.props.isError) {\n\t\t\tstatus = this.props.assistiveText.errorStep;\n\t\t} else if (this.props.isCompleted) {\n\t\t\tstatus = this.props.assistiveText.completedStep;\n\t\t} else if (this.props.isDisabled) {\n\t\t\tstatus = this.props.assistiveText.disabledStep;\n\t\t}\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\tclassName={classNames('slds-progress__item', {\n\t\t\t\t\t'slds-is-completed': this.props.isCompleted,\n\t\t\t\t\t'slds-is-active': this.props.isSelected && !this.props.isError,\n\t\t\t\t\t'slds-has-error': this.props.isError,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.stepIcon(renderIcon, status, this.props)}\n\t\t\t\t{this.renderStepContent()}\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nStepVertical.propTypes = propTypes;\nStepVertical.displayName = displayName;\n\nexport default StepVertical; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime\n"],"file":"step-vertical.js"}
|