@dxc-technology/halstack-react 0.0.0-f4bae62 → 0.0.0-f53e801
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +47 -0
- package/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +226 -0
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +169 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +43 -153
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +61 -0
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -0
- package/bleed/Bleed.stories.tsx +341 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +116 -0
- package/box/Box.stories.tsx +132 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +156 -0
- package/button/Button.stories.tsx +283 -0
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +53 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +161 -0
- package/card/Card.stories.tsx +201 -0
- package/card/Card.test.js +50 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +55 -98
- package/checkbox/Checkbox.stories.tsx +188 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +64 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +161 -0
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +370 -435
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +83 -111
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +107 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +162 -0
- package/dialog/Dialog.stories.tsx +211 -0
- package/dialog/Dialog.test.js +70 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +387 -0
- package/dropdown/Dropdown.stories.tsx +312 -0
- package/dropdown/Dropdown.test.js +591 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +100 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +593 -0
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +186 -0
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +57 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +21 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +185 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/{dist/footer → footer}/Icons.js +16 -16
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +305 -0
- package/header/Header.stories.tsx +172 -0
- package/header/Header.test.js +79 -0
- package/header/Icons.d.ts +2 -0
- package/{dist/header → header}/Icons.js +9 -34
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +31 -90
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +51 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +20 -0
- package/layout/ApplicationLayout.js +171 -0
- package/layout/ApplicationLayout.stories.tsx +161 -0
- package/layout/Icons.d.ts +5 -0
- package/{dist/layout → layout}/Icons.js +19 -8
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +42 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +136 -0
- package/link/Link.stories.tsx +193 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +111 -109
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +76 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +506 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +124 -0
- package/number-input/types.js +5 -0
- package/package.json +40 -29
- package/{dist/paginator → paginator}/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +171 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +308 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password-input → password-input}/PasswordInput.js +45 -77
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +180 -0
- package/password-input/types.d.ts +110 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +176 -0
- package/progress-bar/ProgressBar.stories.jsx +60 -0
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +36 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +118 -0
- package/quick-nav/QuickNav.stories.tsx +264 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +281 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +348 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +199 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +643 -0
- package/select/Select.stories.tsx +627 -0
- package/select/Select.test.js +2175 -0
- package/select/types.d.ts +210 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +268 -0
- package/sidenav/Sidenav.stories.tsx +180 -0
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +73 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +77 -163
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +187 -0
- package/slider/types.d.ts +82 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +251 -0
- package/switch/Switch.stories.tsx +138 -0
- package/switch/Switch.test.js +212 -0
- package/switch/types.d.ts +61 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +12 -26
- package/table/Table.stories.jsx +277 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +211 -0
- package/tabs/Tabs.stories.tsx +112 -0
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +82 -0
- package/tabs/types.js +5 -0
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +130 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +183 -0
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.d.ts +4 -0
- package/{dist/text-input → text-input}/TextInput.js +294 -504
- package/text-input/TextInput.stories.tsx +473 -0
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +178 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/{dist/textarea → textarea}/Textarea.js +50 -142
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +36 -148
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +105 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +285 -0
- package/wizard/Wizard.stories.tsx +233 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +65 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -248
- package/dist/V3Textarea/V3Textarea.js +0 -264
- package/dist/accordion/Accordion.js +0 -353
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/box/Box.js +0 -156
- package/dist/button/Button.js +0 -238
- package/dist/card/Card.js +0 -254
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -265
- package/dist/date/Date.js +0 -379
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/date-input/index.d.ts +0 -95
- package/dist/dialog/Dialog.js +0 -218
- package/dist/dropdown/Dropdown.js +0 -544
- package/dist/file-input/FileInput.js +0 -644
- package/dist/file-input/FileItem.js +0 -280
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -421
- package/dist/header/Header.js +0 -434
- package/dist/input-text/Icons.js +0 -22
- package/dist/input-text/InputText.js +0 -705
- package/dist/layout/ApplicationLayout.js +0 -327
- package/dist/link/Link.js +0 -237
- package/dist/link/readme.md +0 -51
- package/dist/main.d.ts +0 -8
- package/dist/new-select/NewSelect.js +0 -836
- package/dist/new-select/index.d.ts +0 -53
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -283
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/ProgressBar.js +0 -242
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.js +0 -209
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/select/Select.js +0 -549
- package/dist/sidenav/Sidenav.js +0 -179
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.js +0 -222
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/tag/Tag.js +0 -282
- package/dist/text-input/index.d.ts +0 -135
- package/dist/textarea/index.d.ts +0 -117
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -184
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -175
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Icons.js +0 -65
- package/dist/wizard/Wizard.js +0 -405
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -397
- package/test/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -248
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -177
- package/test/PasswordInput.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -329
- package/test/Select.test.js +0 -212
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -732
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3TextArea.test.js +0 -51
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
9
|
+
var _Sidenav = _interopRequireDefault(require("./Sidenav.tsx"));
|
|
10
|
+
|
|
11
|
+
describe("Sidenav component tests", function () {
|
|
12
|
+
test("Sidenav renders anchors and Section correctly", function () {
|
|
13
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement("p", null, "nav-content-test"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
14
|
+
href: "#"
|
|
15
|
+
}, "Link")))),
|
|
16
|
+
getByText = _render.getByText;
|
|
17
|
+
|
|
18
|
+
expect(getByText("nav-content-test")).toBeTruthy();
|
|
19
|
+
var link = getByText("Link");
|
|
20
|
+
expect(link.closest("a").getAttribute("href")).toBe("#");
|
|
21
|
+
});
|
|
22
|
+
test("Sidenav renders groups correctly", function () {
|
|
23
|
+
var sidenav = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Group, {
|
|
24
|
+
title: "Collapsable",
|
|
25
|
+
collapsable: true
|
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
27
|
+
href: "#"
|
|
28
|
+
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
29
|
+
href: "#"
|
|
30
|
+
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
31
|
+
href: "#"
|
|
32
|
+
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
33
|
+
href: "#"
|
|
34
|
+
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
35
|
+
href: "#"
|
|
36
|
+
}, "Lorem ipsum")))));
|
|
37
|
+
expect(sidenav.getByText("Collapsable")).toBeTruthy();
|
|
38
|
+
expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("true");
|
|
39
|
+
|
|
40
|
+
_react2.fireEvent.click(sidenav.getByText("Collapsable"));
|
|
41
|
+
|
|
42
|
+
expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("false");
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
3
|
+
declare type SidenavPropsType = {
|
|
4
|
+
/**
|
|
5
|
+
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
10
|
+
*/
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare type SidenavTitlePropsType = {
|
|
14
|
+
/**
|
|
15
|
+
* The area inside the sidenav title. This area can be used to render custom content.
|
|
16
|
+
*/
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export declare type SidenavSectionPropsType = {
|
|
20
|
+
/**
|
|
21
|
+
* The area inside the sidenav section. This area can be used to render sidenav groups, links and custom content.
|
|
22
|
+
*/
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare type SidenavGroupPropsType = {
|
|
26
|
+
/**
|
|
27
|
+
* The area inside the sidenav group. This area can be used to render sidenav links.
|
|
28
|
+
*/
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The title of the sidenav group.
|
|
32
|
+
*/
|
|
33
|
+
title?: string;
|
|
34
|
+
/**
|
|
35
|
+
* If true the sidenav group title will be considered a button and the group will be collapsable.
|
|
36
|
+
*/
|
|
37
|
+
collapsable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The icon to be displayed next to the title of the group.
|
|
40
|
+
*/
|
|
41
|
+
icon?: string | SVG;
|
|
42
|
+
};
|
|
43
|
+
export declare type SidenavLinkPropsType = {
|
|
44
|
+
/**
|
|
45
|
+
* Value of the tabindex.
|
|
46
|
+
*/
|
|
47
|
+
tabIndex?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Page to be opened when the user clicks on the link.
|
|
50
|
+
*/
|
|
51
|
+
href?: string;
|
|
52
|
+
/**
|
|
53
|
+
* If true, the page is opened in a new browser tab.
|
|
54
|
+
*/
|
|
55
|
+
newWindow?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Element or path used as the icon that will be placed to the left of the link text.
|
|
58
|
+
*/
|
|
59
|
+
icon?: string | SVG;
|
|
60
|
+
/**
|
|
61
|
+
* If true, the link will be marked as selected. This can also affect the group if it is closed to indicate that one of its links is selected.
|
|
62
|
+
*/
|
|
63
|
+
selected?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The area inside the sidenav link.
|
|
66
|
+
*/
|
|
67
|
+
children: string;
|
|
68
|
+
/**
|
|
69
|
+
* This function will be called when the user clicks the link.
|
|
70
|
+
*/
|
|
71
|
+
onClick?: ($event: any) => void;
|
|
72
|
+
};
|
|
73
|
+
export default SidenavPropsType;
|
package/sidenav/types.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import SliderPropsType from "./types";
|
|
3
|
+
declare const DxcSlider: ({ label, name, defaultValue, value, helperText, minValue, maxValue, step, showLimitsValues, showInput, disabled, marks, onChange, onDragEnd, labelFormatCallback, margin, size, }: SliderPropsType) => JSX.Element;
|
|
4
|
+
export default DxcSlider;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
13
|
|
|
16
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
@@ -23,121 +21,66 @@ var _Slider = _interopRequireDefault(require("@material-ui/lab/Slider"));
|
|
|
23
21
|
|
|
24
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
23
|
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
24
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
29
25
|
|
|
30
26
|
var _variables = require("../common/variables.js");
|
|
31
27
|
|
|
32
28
|
var _utils = require("../common/utils.js");
|
|
33
29
|
|
|
34
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
35
|
-
|
|
36
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
|
-
|
|
38
|
-
function _templateObject7() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n max-width: 70px;\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject7 = function _templateObject7() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject6() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-left: ", ";\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject6 = function _templateObject6() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject5() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-right: ", ";\n"]);
|
|
30
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
60
31
|
|
|
61
|
-
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject4() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n\n .MultiSlider-root {\n display: flex;\n align-items: center;\n }\n .MuiSlider-container {\n padding: 30px 24px;\n }\n .MuiSlider-root.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n .Mui-disabled {\n & .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n }\n & .MuiSlider-track {\n background-color: ", ";\n }\n & .MuiSlider-rail {\n background-color: ", ";\n }\n & > .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", " !important;\n }\n & > .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n }\n .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n border-radius: 9999px;\n\n :hover,\n &.Mui-focusVisible {\n box-shadow: none;\n }\n &.MuiSlider-active {\n box-shadow: none;\n }\n :focus {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n height: ", ";\n width: ", ";\n top: ", ";\n }\n :active {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n }\n .MuiSlider-track {\n background-color: ", ";\n height: ", ";\n top: ", ";\n border-radius: 9999px;\n }\n .MuiSlider-track.MuiSlider-trackAfter {\n background-color: ", ";\n }\n .MuiSlider-rail {\n background-color: ", ";\n height: ", ";\n top: ", ";\n }\n .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", ";\n }\n .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject4 = function _templateObject4() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject3() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject3 = function _templateObject3() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject2() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject2 = function _templateObject2() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
32
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
94
33
|
|
|
95
|
-
|
|
96
|
-
}
|
|
34
|
+
var _uuid = require("uuid");
|
|
97
35
|
|
|
98
|
-
|
|
99
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"]);
|
|
36
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
100
37
|
|
|
101
|
-
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
38
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
104
39
|
|
|
105
|
-
|
|
106
|
-
}
|
|
40
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
107
41
|
|
|
108
42
|
var DxcSlider = function DxcSlider(_ref) {
|
|
109
|
-
var label = _ref.label,
|
|
110
|
-
|
|
43
|
+
var _ref$label = _ref.label,
|
|
44
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
45
|
+
_ref$name = _ref.name,
|
|
46
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
47
|
+
defaultValue = _ref.defaultValue,
|
|
48
|
+
value = _ref.value,
|
|
49
|
+
_ref$helperText = _ref.helperText,
|
|
50
|
+
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
111
51
|
_ref$minValue = _ref.minValue,
|
|
112
52
|
minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
|
|
113
53
|
_ref$maxValue = _ref.maxValue,
|
|
114
54
|
maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
|
|
115
55
|
_ref$step = _ref.step,
|
|
116
56
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
117
|
-
value = _ref.value,
|
|
118
57
|
_ref$showLimitsValues = _ref.showLimitsValues,
|
|
119
58
|
showLimitsValues = _ref$showLimitsValues === void 0 ? false : _ref$showLimitsValues,
|
|
120
59
|
_ref$showInput = _ref.showInput,
|
|
121
60
|
showInput = _ref$showInput === void 0 ? false : _ref$showInput,
|
|
122
|
-
name = _ref.name,
|
|
123
|
-
onChange = _ref.onChange,
|
|
124
|
-
onDragEnd = _ref.onDragEnd,
|
|
125
61
|
_ref$disabled = _ref.disabled,
|
|
126
62
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
127
63
|
_ref$marks = _ref.marks,
|
|
128
64
|
marks = _ref$marks === void 0 ? false : _ref$marks,
|
|
65
|
+
onChange = _ref.onChange,
|
|
66
|
+
onDragEnd = _ref.onDragEnd,
|
|
129
67
|
labelFormatCallback = _ref.labelFormatCallback,
|
|
130
68
|
margin = _ref.margin,
|
|
131
69
|
_ref$size = _ref.size,
|
|
132
70
|
size = _ref$size === void 0 ? "fillParent" : _ref$size;
|
|
133
71
|
|
|
134
|
-
var _useState = (0, _react.useState)(0),
|
|
72
|
+
var _useState = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0),
|
|
135
73
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
136
74
|
innerValue = _useState2[0],
|
|
137
75
|
setInnerValue = _useState2[1];
|
|
138
76
|
|
|
139
77
|
var colorsTheme = (0, _useTheme["default"])();
|
|
140
78
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
79
|
+
|
|
80
|
+
var _useState3 = (0, _react.useState)("label-".concat((0, _uuid.v4)())),
|
|
81
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
82
|
+
labelId = _useState4[0];
|
|
83
|
+
|
|
141
84
|
var minLabel = (0, _react.useMemo)(function () {
|
|
142
85
|
return labelFormatCallback ? labelFormatCallback(minValue) : minValue;
|
|
143
86
|
}, [labelFormatCallback, minValue]);
|
|
@@ -146,67 +89,61 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
146
89
|
}, [labelFormatCallback, maxValue]);
|
|
147
90
|
|
|
148
91
|
var handlerSliderChange = function handlerSliderChange(event, newValue) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
setInnerValue(newValue);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
92
|
+
var valueToCheck = value != null && value >= 0 ? value : innerValue;
|
|
93
|
+
valueToCheck !== newValue && setInnerValue(newValue);
|
|
94
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
95
|
+
};
|
|
156
96
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
97
|
+
var handleSliderOnChangeCommited = function handleSliderOnChangeCommited(event, selectedValue) {
|
|
98
|
+
onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(selectedValue);
|
|
160
99
|
};
|
|
161
100
|
|
|
162
101
|
var handlerInputChange = function handlerInputChange(event) {
|
|
163
102
|
var intValue = parseInt(event.value, 10);
|
|
164
103
|
|
|
165
104
|
if (value == null) {
|
|
166
|
-
if (!Number.isNaN(intValue))
|
|
167
|
-
setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
168
|
-
} else {
|
|
169
|
-
setInnerValue("");
|
|
170
|
-
}
|
|
105
|
+
if (!Number.isNaN(intValue)) setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
171
106
|
}
|
|
172
107
|
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
onChange(intValue > maxValue ? maxValue : intValue);
|
|
176
|
-
} else {
|
|
177
|
-
onChange("");
|
|
178
|
-
}
|
|
108
|
+
if (!Number.isNaN(intValue)) {
|
|
109
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(intValue > maxValue ? maxValue : intValue);
|
|
179
110
|
}
|
|
180
111
|
};
|
|
181
112
|
|
|
182
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
113
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
183
114
|
theme: colorsTheme.slider
|
|
184
|
-
}, _react["default"].createElement(Container, {
|
|
115
|
+
}, /*#__PURE__*/_react["default"].createElement(Container, {
|
|
185
116
|
margin: margin,
|
|
186
117
|
size: size
|
|
187
|
-
}, _react["default"].createElement(Label,
|
|
118
|
+
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
119
|
+
id: labelId,
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
backgroundType: backgroundType
|
|
122
|
+
}, label), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
123
|
+
disabled: disabled,
|
|
124
|
+
backgroundType: backgroundType
|
|
125
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(SliderContainer, {
|
|
188
126
|
backgroundType: backgroundType
|
|
189
|
-
}, showLimitsValues && _react["default"].createElement(MinLabelContainer, {
|
|
127
|
+
}, showLimitsValues && /*#__PURE__*/_react["default"].createElement(MinLabelContainer, {
|
|
190
128
|
backgroundType: backgroundType,
|
|
191
129
|
disabled: disabled
|
|
192
|
-
}, minLabel), _react["default"].createElement(_Slider["default"], {
|
|
193
|
-
value: value != null && value >= 0
|
|
130
|
+
}, minLabel), /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
131
|
+
value: value != null && value >= 0 ? value : innerValue,
|
|
194
132
|
min: minValue,
|
|
195
133
|
max: maxValue,
|
|
196
134
|
onChange: handlerSliderChange,
|
|
197
|
-
onChangeCommitted:
|
|
198
|
-
return onDragEnd(selectedValue);
|
|
199
|
-
},
|
|
135
|
+
onChangeCommitted: handleSliderOnChangeCommited,
|
|
200
136
|
step: step,
|
|
201
137
|
marks: marks || [],
|
|
202
|
-
disabled: disabled
|
|
203
|
-
|
|
138
|
+
disabled: disabled,
|
|
139
|
+
"aria-labelledby": labelId
|
|
140
|
+
}), showLimitsValues && /*#__PURE__*/_react["default"].createElement(MaxLabelContainer, {
|
|
204
141
|
backgroundType: backgroundType,
|
|
205
142
|
disabled: disabled,
|
|
206
143
|
step: step
|
|
207
|
-
}, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_TextInput["default"], {
|
|
144
|
+
}, maxLabel), showInput && /*#__PURE__*/_react["default"].createElement(StyledTextInput, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
208
145
|
name: name,
|
|
209
|
-
value: value != null && value >= 0
|
|
146
|
+
value: value != null && value >= 0 ? value.toString() : innerValue.toString(),
|
|
210
147
|
disabled: disabled,
|
|
211
148
|
onChange: handlerInputChange,
|
|
212
149
|
size: "fillParent"
|
|
@@ -214,7 +151,7 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
214
151
|
};
|
|
215
152
|
|
|
216
153
|
var sizes = {
|
|
217
|
-
medium: "
|
|
154
|
+
medium: "360px",
|
|
218
155
|
large: "480px",
|
|
219
156
|
fillParent: "100%"
|
|
220
157
|
};
|
|
@@ -223,7 +160,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
223
160
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
224
161
|
};
|
|
225
162
|
|
|
226
|
-
var Container = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
163
|
+
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"])), function (props) {
|
|
227
164
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
228
165
|
}, function (props) {
|
|
229
166
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -237,10 +174,10 @@ var Container = _styledComponents["default"].div(_templateObject(), function (pr
|
|
|
237
174
|
return calculateWidth(props.margin, props.size);
|
|
238
175
|
});
|
|
239
176
|
|
|
240
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
241
|
-
return props.theme.labelFontColor;
|
|
177
|
+
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
178
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
242
179
|
}, function (props) {
|
|
243
|
-
return props.theme.
|
|
180
|
+
return props.theme.fontFamily;
|
|
244
181
|
}, function (props) {
|
|
245
182
|
return props.theme.labelFontSize;
|
|
246
183
|
}, function (props) {
|
|
@@ -251,21 +188,21 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
251
188
|
return props.theme.labelLineHeight;
|
|
252
189
|
});
|
|
253
190
|
|
|
254
|
-
var HelperText = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
255
|
-
return props.theme.helperTextFontColor;
|
|
191
|
+
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
192
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
256
193
|
}, function (props) {
|
|
257
|
-
return props.theme.
|
|
194
|
+
return props.theme.fontFamily;
|
|
258
195
|
}, function (props) {
|
|
259
196
|
return props.theme.helperTextFontSize;
|
|
260
197
|
}, function (props) {
|
|
261
|
-
return props.theme.
|
|
198
|
+
return props.theme.helperTextFontStyle;
|
|
262
199
|
}, function (props) {
|
|
263
200
|
return props.theme.helperTextFontWeight;
|
|
264
201
|
}, function (props) {
|
|
265
202
|
return props.theme.helperTextLineHeight;
|
|
266
203
|
});
|
|
267
204
|
|
|
268
|
-
var SliderContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
205
|
+
var SliderContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n\n .MuiSlider-root {\n min-width: 15rem;\n }\n .MuiSlider-container {\n padding: 30px 24px;\n }\n .MuiSlider-root.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n .Mui-disabled {\n & .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n }\n & .MuiSlider-track {\n background-color: ", ";\n }\n & .MuiSlider-rail {\n background-color: ", ";\n }\n & > .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", " !important;\n }\n & > .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n }\n .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n border-radius: 9999px;\n\n :hover,\n &.Mui-focusVisible {\n box-shadow: none;\n }\n &.MuiSlider-active {\n box-shadow: none;\n }\n :focus {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n height: ", ";\n width: ", ";\n top: ", ";\n }\n :active {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n }\n .MuiSlider-track {\n background-color: ", ";\n height: ", ";\n top: ", ";\n border-radius: 9999px;\n }\n .MuiSlider-track.MuiSlider-trackAfter {\n background-color: ", ";\n }\n .MuiSlider-rail {\n background-color: ", ";\n height: ", ";\n top: ", ";\n }\n .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", ";\n }\n .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n"])), function (props) {
|
|
269
206
|
return props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor;
|
|
270
207
|
}, function (props) {
|
|
271
208
|
return props.theme.thumbHeight;
|
|
@@ -341,64 +278,41 @@ var SliderContainer = _styledComponents["default"].div(_templateObject4(), funct
|
|
|
341
278
|
return props.theme.tickVerticalPosition;
|
|
342
279
|
});
|
|
343
280
|
|
|
344
|
-
var MinLabelContainer = _styledComponents["default"].span(_templateObject5(), function (props) {
|
|
345
|
-
return props.theme.
|
|
281
|
+
var MinLabelContainer = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n white-space: nowrap;\n margin-right: ", ";\n"])), function (props) {
|
|
282
|
+
return props.disabled ? props.theme.disabledLimitValuesFontColor : props.backgroundType === "dark" ? props.theme.limitValuesFontColorOnDark : props.theme.limitValuesFontColor;
|
|
346
283
|
}, function (props) {
|
|
347
|
-
return props.theme.
|
|
284
|
+
return props.theme.fontFamily;
|
|
348
285
|
}, function (props) {
|
|
349
|
-
return props.theme.
|
|
286
|
+
return props.theme.limitValuesFontSize;
|
|
350
287
|
}, function (props) {
|
|
351
|
-
return props.theme.
|
|
288
|
+
return props.theme.limitValuesFontStyle;
|
|
352
289
|
}, function (props) {
|
|
353
|
-
return props.
|
|
290
|
+
return props.theme.limitValuesFontWeight;
|
|
354
291
|
}, function (props) {
|
|
355
|
-
return props.theme.
|
|
292
|
+
return props.theme.limitValuesFontLetterSpacing;
|
|
356
293
|
}, function (props) {
|
|
357
294
|
return props.theme.floorLabelMarginRight;
|
|
358
295
|
});
|
|
359
296
|
|
|
360
|
-
var MaxLabelContainer = _styledComponents["default"].span(_templateObject6(), function (props) {
|
|
361
|
-
return props.theme.
|
|
297
|
+
var MaxLabelContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n white-space: nowrap;\n margin-left: ", ";\n"])), function (props) {
|
|
298
|
+
return props.disabled ? props.theme.disabledLimitValuesFontColor : props.backgroundType === "dark" ? props.theme.limitValuesFontColorOnDark : props.theme.limitValuesFontColor;
|
|
362
299
|
}, function (props) {
|
|
363
|
-
return props.theme.
|
|
300
|
+
return props.theme.fontFamily;
|
|
364
301
|
}, function (props) {
|
|
365
|
-
return props.theme.
|
|
302
|
+
return props.theme.limitValuesFontSize;
|
|
366
303
|
}, function (props) {
|
|
367
|
-
return props.theme.
|
|
304
|
+
return props.theme.limitValuesFontStyle;
|
|
368
305
|
}, function (props) {
|
|
369
|
-
return props.
|
|
306
|
+
return props.theme.limitValuesFontWeight;
|
|
370
307
|
}, function (props) {
|
|
371
|
-
return props.theme.
|
|
308
|
+
return props.theme.limitValuesFontLetterSpacing;
|
|
372
309
|
}, function (props) {
|
|
373
310
|
return props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem";
|
|
374
311
|
});
|
|
375
312
|
|
|
376
|
-
var StyledTextInput = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
313
|
+
var StyledTextInput = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n max-width: 70px;\n"])), function (props) {
|
|
377
314
|
return props.theme.inputMarginLeft;
|
|
378
315
|
});
|
|
379
316
|
|
|
380
|
-
DxcSlider.propTypes = {
|
|
381
|
-
label: _propTypes["default"].string,
|
|
382
|
-
helperText: _propTypes["default"].string,
|
|
383
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
384
|
-
minValue: _propTypes["default"].number,
|
|
385
|
-
maxValue: _propTypes["default"].number,
|
|
386
|
-
step: _propTypes["default"].number,
|
|
387
|
-
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
388
|
-
showLimitsValues: _propTypes["default"].bool,
|
|
389
|
-
showInput: _propTypes["default"].bool,
|
|
390
|
-
name: _propTypes["default"].string,
|
|
391
|
-
onChange: _propTypes["default"].func,
|
|
392
|
-
onDragEnd: _propTypes["default"].func,
|
|
393
|
-
disabled: _propTypes["default"].bool,
|
|
394
|
-
marks: _propTypes["default"].bool,
|
|
395
|
-
labelFormatCallback: _propTypes["default"].func,
|
|
396
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
397
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
398
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
399
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
400
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
401
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
402
|
-
};
|
|
403
317
|
var _default = DxcSlider;
|
|
404
318
|
exports["default"] = _default;
|