@innovaccer/design-system 2.6.0 → 2.7.0-0
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/.eslintrc.json +10 -9
- package/.github/workflows/chromatic.yml +5 -0
- package/.github/workflows/pull_request.yml +1 -1
- package/.storybook/main.js +4 -0
- package/.vscode/settings.json +11 -0
- package/CHANGELOG.md +36 -0
- package/CONTRIBUTING.md +7 -1
- package/core/accessibility/utils/useAccessibilityProps.ts +4 -2
- package/core/common.type.tsx +22 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +9 -9
- package/core/components/atoms/_chip/index.tsx +17 -3
- package/core/components/atoms/avatar/Avatar.tsx +4 -14
- package/core/components/atoms/avatar/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/avatar/__tests__/Avatar.test.tsx +14 -9
- package/core/components/atoms/avatarGroup/AvatarGroup.tsx +3 -5
- package/core/components/atoms/badge/Badge.tsx +2 -12
- package/core/components/atoms/badge/__tests__/Badge.test.tsx +22 -7
- package/core/components/atoms/badge/_stories_/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/badge/_stories_/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/button/Button.tsx +10 -7
- package/core/components/atoms/button/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +2 -2
- package/core/components/atoms/button/__tests__/Button.test.tsx +1 -1
- package/core/components/atoms/button/__tests__/__snapshots__/Button.test.tsx.snap +0 -137
- package/core/components/atoms/card/__stories__/empty.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/nested.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/scroll.story.tsx +1 -1
- package/core/components/atoms/checkbox/Checkbox.tsx +8 -9
- package/core/components/atoms/checkbox/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/chip/Chip.tsx +3 -2
- package/core/components/atoms/chip/__stories__/variants/Selection.story.tsx +17 -0
- package/core/components/atoms/chip/__stories__/variants/Type.story.tsx +2 -2
- package/core/components/atoms/chip/__tests__/Chip.test.tsx +7 -0
- package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +5 -5
- package/core/components/atoms/chipGroup/__tests__/chipGroup.test.tsx +2 -2
- package/core/components/atoms/chipGroup/_stories_/index.story.tsx +2 -2
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -17
- package/core/components/atoms/dropdown/DropdownButton.tsx +2 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +10 -5
- package/core/components/atoms/dropdown/Loading.tsx +1 -1
- package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.tsx +45 -0
- package/core/components/atoms/dropdown/__stories__/_common_/types.tsx +3 -0
- package/core/components/atoms/dropdown/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.tsx +1 -1
- package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +12 -1
- package/core/components/atoms/dropdown/__tests__/Loading.test.tsx +0 -1
- package/core/components/atoms/dropdown/option/index.tsx +1 -1
- package/core/components/atoms/heading/Heading.tsx +4 -4
- package/core/components/atoms/heading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/heading/__tests__/Heading.test.tsx +4 -3
- package/core/components/atoms/icon/Icon.tsx +3 -3
- package/core/components/atoms/input/Input.tsx +3 -3
- package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +62 -0
- package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +38 -0
- package/core/components/atoms/input/__stories__/variants/controlledInput.story.tsx +46 -0
- package/core/components/atoms/input/__stories__/variants/types/BasicInput.story.tsx +2 -2
- package/core/components/atoms/input/__stories__/variants/types/IconLeft.story.tsx +2 -10
- package/core/components/atoms/input/__stories__/variants/types/WithLabel.story.tsx +1 -9
- package/core/components/atoms/label/Label.tsx +1 -1
- package/core/components/atoms/legend/Legend.tsx +2 -2
- package/core/components/atoms/legend/__stories__/variants/labelAppearance.story.tsx +2 -2
- package/core/components/atoms/link/Link.tsx +4 -4
- package/core/components/atoms/message/Message.tsx +12 -12
- package/core/components/atoms/message/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/Appearance.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/AppearanceTitle.story.tsx +1 -1
- package/core/components/atoms/message/__tests__/Message.test.tsx +1 -6
- package/core/components/atoms/message/__tests__/__snapshots__/Message.test.tsx.snap +0 -45
- package/core/components/atoms/metaList/__tests__/MetaList.test.tsx +2 -2
- package/core/components/atoms/metricInput/MetricInput.tsx +5 -5
- package/core/components/atoms/multiSlider/SliderUtils.tsx +1 -4
- package/core/components/atoms/multiSlider/index.tsx +3 -4
- package/core/components/atoms/outsideClick/OutsideClick.tsx +1 -2
- package/core/components/atoms/paragraph/Paragraph.tsx +2 -2
- package/core/components/atoms/paragraph/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/paragraph/__tests__/Paragraph.test.tsx +2 -2
- package/core/components/atoms/pills/Pills.tsx +2 -12
- package/core/components/atoms/pills/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/pills/__stories__/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/pills/__tests__/Pills.test.tsx +3 -2
- package/core/components/atoms/placeholderImage/PlaceholderImage.tsx +2 -2
- package/core/components/atoms/placeholderImage/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/PlaceholderParagraph.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/popperWrapper/PopperWrapper.tsx +2 -6
- package/core/components/atoms/progressRing/ProgressRing.tsx +2 -2
- package/core/components/atoms/progressRing/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/radio/Radio.tsx +4 -5
- package/core/components/atoms/rangeSlider/RangeSlider.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/index.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/CustomLabels.story.tsx +1 -2
- package/core/components/atoms/spinner/Spinner.tsx +4 -4
- package/core/components/atoms/spinner/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/spinner/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/statusHint/StatusHint.tsx +2 -3
- package/core/components/atoms/statusHint/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/statusHint/__tests__/StatusHint.test.tsx +3 -2
- package/core/components/atoms/subheading/Subheading.tsx +2 -2
- package/core/components/atoms/subheading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/subheading/__tests__/Subheading.test.tsx +3 -2
- package/core/components/atoms/switchInput/Switch.tsx +7 -8
- package/core/components/atoms/text/Text.tsx +4 -4
- package/core/components/atoms/text/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/text/__tests__/Text.test.tsx +2 -3
- package/core/components/atoms/toast/ActionButton.tsx +2 -2
- package/core/components/atoms/toast/Toast.tsx +11 -6
- package/core/components/atoms/toast/__stories__/index.story.tsx +2 -6
- package/core/components/atoms/toast/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastMessage.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastWithAction.story.tsx +3 -2
- package/core/components/atoms/toast/__tests__/Toast.test.tsx +1 -1
- package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +0 -131
- package/core/components/css-utilities/Schema.tsx +1 -1
- package/core/components/css-utilities/Spacing/Schema.tsx +1 -1
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +2 -2
- package/core/components/molecules/dropzone/Dropzone.tsx +3 -3
- package/core/components/molecules/dropzone/DropzoneBase.tsx +22 -38
- package/core/components/molecules/dropzone/__stories__/index.story.tsx +151 -41
- package/core/components/molecules/dropzone/__tests__/Dropzone.test.tsx +2 -2
- package/core/components/molecules/dropzone/utils.tsx +6 -4
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +4 -4
- package/core/components/molecules/emptyState/EmptyState.tsx +4 -4
- package/core/components/molecules/emptyState/__stories__/pageNotLoadedWithSVG.story.tsx +26 -26
- package/core/components/molecules/fileList/FileListItem.tsx +1 -2
- package/core/components/molecules/fileUploader/FileUploaderItem.tsx +1 -2
- package/core/components/molecules/fileUploader/FileUploaderStatus.tsx +1 -1
- package/core/components/molecules/fileUploader/__stories__/_common_/types.tsx +3 -0
- package/core/components/molecules/fileUploader/__stories__/index.story.tsx +3 -222
- package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +5 -7
- package/core/components/molecules/inputMask/InputMask.tsx +212 -146
- package/core/components/molecules/inputMask/__stories__/index.story.tsx +24 -0
- package/core/components/molecules/modal/Modal.tsx +4 -6
- package/core/components/molecules/modal/__stories__/Confirmation.story.tsx +1 -1
- package/core/components/molecules/placeholder/Placeholder.tsx +2 -2
- package/core/components/molecules/popover/Popover.tsx +2 -9
- package/core/components/molecules/sidesheet/Sidesheet.tsx +5 -7
- package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.tsx +172 -0
- package/core/components/molecules/tooltip/Tooltip.tsx +4 -4
- package/core/components/organisms/calendar/__stories__/variants/firstDayOfWeek.story.tsx +2 -2
- package/core/components/organisms/calendar/utility.ts +3 -3
- package/core/components/organisms/choiceList/ChoiceList.tsx +11 -11
- package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
- package/core/components/organisms/datePicker/Trigger.tsx +1 -5
- package/core/components/organisms/dateRangePicker/DateRangePicker.tsx +9 -10
- package/core/components/organisms/dateRangePicker/SingleInputTrigger.tsx +0 -1
- package/core/components/organisms/dateRangePicker/Trigger.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__stories__/variants/monthsInView.story.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +16 -16
- package/core/components/organisms/grid/Cell.tsx +19 -19
- package/core/components/organisms/grid/Grid.tsx +3 -4
- package/core/components/organisms/grid/GridBody.tsx +0 -1
- package/core/components/organisms/grid/GridContext.ts +1 -1
- package/core/components/organisms/grid/__stories__/_common_/editableSchema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +1 -1
- package/core/components/organisms/grid/__stories__/_common_/loaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/schema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/simpleLoaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/statusSchema.ts +0 -2
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +2 -2
- package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +3 -2
- package/core/components/organisms/list/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/list/__stories__/index.story.tsx +0 -16
- package/core/components/organisms/table/Table.tsx +2 -2
- package/core/components/organisms/table/__stories__/CompressedTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/DataTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/PinnedColumn.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/ResourceTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/StandardTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TightStory.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/table/__stories__/variants/showHead.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/showMenu.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/size.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/type.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withCheckbox.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withPagination.story.tsx +2 -2
- package/core/components/organisms/timePicker/TimePicker.tsx +3 -7
- package/core/components/organisms/verticalNav/__stories__/schema.tsx +0 -2
- package/core/components/organisms/verticalNav/__tests__/VerticalNav.test.tsx +1 -2
- package/core/global.d.ts +9 -0
- package/core/index.tsx +1 -1
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +18 -5
- package/core/utils/docPage/generateImports.tsx +2 -3
- package/core/utils/docPage/index.tsx +30 -20
- package/core/utils/docPage/sandbox.tsx +14 -7
- package/core/utils/overlayHelper.ts +7 -3
- package/core/utils/testHelper.ts +1 -1
- package/core/utils/types.tsx +1 -1
- package/css/dist/index.css +48 -30
- package/css/dist/index.css.map +1 -1
- package/css/src/components/button.css +5 -5
- package/css/src/components/calendar.css +1 -1
- package/css/src/components/chip.css +6 -4
- package/css/src/components/fullscreenModal.css +4 -3
- package/css/src/components/message.css +0 -5
- package/css/src/components/switch.css +23 -2
- package/css/src/components/toast.css +0 -5
- package/css/src/variables/index.css +5 -2
- package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +4 -1
- package/dist/core/common.type.d.ts +12 -0
- package/dist/core/components/atoms/avatar/Avatar.d.ts +4 -4
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -3
- package/dist/core/components/atoms/badge/Badge.d.ts +2 -2
- package/dist/core/components/atoms/button/Button.d.ts +6 -6
- package/dist/core/components/atoms/checkbox/Checkbox.d.ts +3 -3
- package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +18 -17
- package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +4 -3
- package/dist/core/components/atoms/dropdown/option/index.d.ts +1 -1
- package/dist/core/components/atoms/heading/Heading.d.ts +4 -4
- package/dist/core/components/atoms/icon/Icon.d.ts +2 -2
- package/dist/core/components/atoms/input/Input.d.ts +3 -3
- package/dist/core/components/atoms/legend/Legend.d.ts +2 -2
- package/dist/core/components/atoms/link/Link.d.ts +4 -4
- package/dist/core/components/atoms/message/Message.d.ts +2 -2
- package/dist/core/components/atoms/metricInput/MetricInput.d.ts +3 -3
- package/dist/core/components/atoms/multiSlider/SliderUtils.d.ts +1 -1
- package/dist/core/components/atoms/multiSlider/index.d.ts +3 -3
- package/dist/core/components/atoms/paragraph/Paragraph.d.ts +2 -2
- package/dist/core/components/atoms/pills/Pills.d.ts +2 -2
- package/dist/core/components/atoms/placeholderImage/PlaceholderImage.d.ts +2 -2
- package/dist/core/components/atoms/placeholderParagraph/PlaceholderParagraph.d.ts +2 -2
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +1 -2
- package/dist/core/components/atoms/progressRing/ProgressRing.d.ts +2 -2
- package/dist/core/components/atoms/radio/Radio.d.ts +4 -4
- package/dist/core/components/atoms/rangeSlider/RangeSlider.d.ts +1 -1
- package/dist/core/components/atoms/spinner/Spinner.d.ts +4 -4
- package/dist/core/components/atoms/statusHint/StatusHint.d.ts +2 -2
- package/dist/core/components/atoms/subheading/Subheading.d.ts +2 -2
- package/dist/core/components/atoms/switchInput/Switch.d.ts +6 -6
- package/dist/core/components/atoms/text/Text.d.ts +4 -4
- package/dist/core/components/atoms/toast/ActionButton.d.ts +2 -2
- package/dist/core/components/atoms/toast/Toast.d.ts +2 -2
- package/dist/core/components/molecules/dropzone/Dropzone.d.ts +3 -3
- package/dist/core/components/molecules/dropzone/DropzoneBase.d.ts +1 -1
- package/dist/core/components/molecules/dropzone/utils.d.ts +5 -3
- package/dist/core/components/molecules/emptyState/EmptyState.d.ts +4 -4
- package/dist/core/components/molecules/fileList/FileListItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderStatus.d.ts +1 -1
- package/dist/core/components/molecules/fullscreenModal/FullscreenModal.d.ts +4 -7
- package/dist/core/components/molecules/inputMask/InputMask.d.ts +10 -2
- package/dist/core/components/molecules/modal/Modal.d.ts +3 -6
- package/dist/core/components/molecules/placeholder/Placeholder.d.ts +2 -2
- package/dist/core/components/molecules/popover/Popover.d.ts +0 -1
- package/dist/core/components/molecules/sidesheet/Sidesheet.d.ts +3 -6
- package/dist/core/components/molecules/tooltip/Tooltip.d.ts +3 -3
- package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +5 -6
- package/dist/core/components/organisms/dateRangePicker/DateRangePicker.d.ts +24 -0
- package/dist/core/components/organisms/grid/Cell.d.ts +1 -1
- package/dist/core/components/organisms/grid/Grid.d.ts +3 -3
- package/dist/core/components/organisms/grid/GridContext.d.ts +1 -1
- package/dist/core/components/organisms/inlineMessage/InlineMessage.d.ts +2 -2
- package/dist/core/components/organisms/table/Table.d.ts +2 -2
- package/dist/core/components/patterns/dateRangePicker/withCustomPopover.story.d.ts +5 -1
- package/dist/core/utils/docPage/generateImports.d.ts +1 -1
- package/dist/core/utils/overlayHelper.d.ts +1 -1
- package/dist/core/utils/types.d.ts +1 -1
- package/dist/index.esm.js +221 -245
- package/dist/index.js +225 -233
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/dts.config.js +11 -2
- package/package.json +20 -18
- package/tsconfig.json +3 -16
- package/tsconfig.type.json +2 -1
- package/types/index.d.ts +2217 -0
- package/types/{innovaccer-design-system/tsconfig.json → tsconfig.json} +1 -1
- package/types/{innovaccer-design-system/tslint.json → tslint.json} +0 -0
- package/types/types-tests.tsx +936 -0
- package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +0 -89
- package/core/components/atoms/message/__stories__/default.story.tsx +0 -16
- package/core/components/atoms/toast/__stories__/DefaultToast.story.tsx +0 -16
- package/core/components/molecules/dropzone/__stories__/variants/DropzoneWithFileList.story.tsx +0 -176
- package/core/components/molecules/fileUploader/__stories__/variants/FileUploaderList.story.tsx +0 -80
- package/types/innovaccer-design-system/index.d.ts +0 -39
- package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { boolean } from '@storybook/addon-knobs';
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
4
|
+
import { updateKnob } from '@/utils/storybookEventEmitter';
|
|
5
|
+
import { Text, Paragraph, Sidesheet, ModalDescription, Button, Badge, Heading, Divider } from '@/index';
|
|
6
|
+
|
|
7
|
+
export const customHeader = () => {
|
|
8
|
+
const open = boolean('open', true);
|
|
9
|
+
const seperator = boolean('seperator', false);
|
|
10
|
+
const stickFooter = boolean('stick bottom', false);
|
|
11
|
+
const backdropClose = boolean('backdropClose', false);
|
|
12
|
+
|
|
13
|
+
const onClose = () => {
|
|
14
|
+
updateKnob('open', false);
|
|
15
|
+
action('on close triggered')();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const options = {
|
|
19
|
+
onClose,
|
|
20
|
+
open,
|
|
21
|
+
seperator,
|
|
22
|
+
stickFooter,
|
|
23
|
+
backdropClose,
|
|
24
|
+
footer: (
|
|
25
|
+
<>
|
|
26
|
+
<Button appearance="primary" className="mr-4">
|
|
27
|
+
Primary
|
|
28
|
+
</Button>
|
|
29
|
+
<Button appearance="basic">Basic</Button>
|
|
30
|
+
</>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const modalDescriptionOptions = {
|
|
35
|
+
title: 'Description Title',
|
|
36
|
+
description: 'Adding a subheading clearly indicates the hierarchy of the information.',
|
|
37
|
+
removePadding: true,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const modalDescriptionOptionsWithoutTitle = {
|
|
41
|
+
description: 'Card Sections include supporting text like an article summary or a restaurant description.',
|
|
42
|
+
removePadding: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div>
|
|
47
|
+
<Paragraph>
|
|
48
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
|
49
|
+
magna aliqua.
|
|
50
|
+
<br />
|
|
51
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
52
|
+
<br />
|
|
53
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <br />
|
|
54
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
55
|
+
<br />
|
|
56
|
+
</Paragraph>
|
|
57
|
+
<Sidesheet
|
|
58
|
+
{...options}
|
|
59
|
+
dimension="regular"
|
|
60
|
+
header={
|
|
61
|
+
<div className="pl-7">
|
|
62
|
+
<Heading size="s">Untitled document</Heading>
|
|
63
|
+
<div className="d-flex">
|
|
64
|
+
<div className="mr-3">
|
|
65
|
+
<Badge appearance="primary">User Interface</Badge>
|
|
66
|
+
</div>
|
|
67
|
+
<div className="mr-3">
|
|
68
|
+
<Badge>Design</Badge>
|
|
69
|
+
</div>
|
|
70
|
+
<div className="mr-3">
|
|
71
|
+
<Badge>Development</Badge>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<Divider></Divider>
|
|
75
|
+
</div>
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
<Text>Modal Body</Text>
|
|
79
|
+
<ModalDescription {...modalDescriptionOptions} />
|
|
80
|
+
<ModalDescription {...modalDescriptionOptionsWithoutTitle} />
|
|
81
|
+
</Sidesheet>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const customCode = `() => {
|
|
87
|
+
const [open, setOpen] = React.useState(true);
|
|
88
|
+
|
|
89
|
+
const onClose = () => {
|
|
90
|
+
setOpen(!open);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const options = {
|
|
94
|
+
onClose,
|
|
95
|
+
open,
|
|
96
|
+
footer: (
|
|
97
|
+
<>
|
|
98
|
+
<Button appearance="primary" className="mr-4">
|
|
99
|
+
Primary
|
|
100
|
+
</Button>
|
|
101
|
+
<Button appearance="basic">Basic</Button>
|
|
102
|
+
</>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const modalDescriptionOptions = {
|
|
107
|
+
title: 'Description Title',
|
|
108
|
+
description: 'Adding a subheading clearly indicates the hierarchy of the information.',
|
|
109
|
+
removePadding: true,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const modalDescriptionOptionsWithoutTitle = {
|
|
113
|
+
description: 'Card Sections include supporting text like an article summary or a restaurant description.',
|
|
114
|
+
removePadding: true,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div>
|
|
119
|
+
<Paragraph>
|
|
120
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
|
121
|
+
magna aliqua. <br />
|
|
122
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.{' '}
|
|
123
|
+
<br />
|
|
124
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <br />
|
|
125
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{' '}
|
|
126
|
+
<br />
|
|
127
|
+
<Button appearance="primary" onClick={() => setOpen(true)}>
|
|
128
|
+
Open
|
|
129
|
+
</Button>
|
|
130
|
+
</Paragraph>
|
|
131
|
+
<Sidesheet
|
|
132
|
+
{...options}
|
|
133
|
+
dimension="regular"
|
|
134
|
+
header={
|
|
135
|
+
<div className="pl-7">
|
|
136
|
+
<Heading size="s">Untitled document</Heading>
|
|
137
|
+
<div className="d-flex">
|
|
138
|
+
<div className="mr-3">
|
|
139
|
+
<Badge appearance="primary">User Interface</Badge>
|
|
140
|
+
</div>
|
|
141
|
+
<div className="mr-3">
|
|
142
|
+
<Badge>Design</Badge>
|
|
143
|
+
</div>
|
|
144
|
+
<div className="mr-3">
|
|
145
|
+
<Badge>Development</Badge>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<Divider></Divider>
|
|
149
|
+
</div>
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
<Text>Modal Body</Text>
|
|
153
|
+
<ModalDescription {...modalDescriptionOptions} />
|
|
154
|
+
<ModalDescription {...modalDescriptionOptionsWithoutTitle} />
|
|
155
|
+
</Sidesheet>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}`;
|
|
159
|
+
|
|
160
|
+
export default {
|
|
161
|
+
title: 'Components/Sidesheet/Custom Header',
|
|
162
|
+
component: Sidesheet,
|
|
163
|
+
parameters: {
|
|
164
|
+
docs: {
|
|
165
|
+
docPage: {
|
|
166
|
+
customCode,
|
|
167
|
+
title: 'Modal',
|
|
168
|
+
noHtml: true,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
@@ -3,7 +3,7 @@ import { Popover, Text } from '@/index';
|
|
|
3
3
|
import { PopoverProps } from '@/index.type';
|
|
4
4
|
import { BaseProps, filterProps } from '@/utils/types';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const tooltipPropsList = [
|
|
7
7
|
'trigger',
|
|
8
8
|
'on',
|
|
9
9
|
'open',
|
|
@@ -15,8 +15,8 @@ const propsList = [
|
|
|
15
15
|
'hideOnReferenceEscape',
|
|
16
16
|
'closeOnScroll',
|
|
17
17
|
] as const;
|
|
18
|
-
type
|
|
19
|
-
export interface TooltipProps extends Omit<PopoverProps,
|
|
18
|
+
type TooltipPopperProps = typeof tooltipPropsList[number];
|
|
19
|
+
export interface TooltipProps extends Omit<PopoverProps, TooltipPopperProps>, BaseProps {
|
|
20
20
|
/**
|
|
21
21
|
* Text to be rendered in `Tooltip`
|
|
22
22
|
*/
|
|
@@ -49,7 +49,7 @@ export const Tooltip = (props: TooltipProps) => {
|
|
|
49
49
|
// ...Popover.defaultProps,
|
|
50
50
|
// hoverable: false
|
|
51
51
|
// }, propsList);
|
|
52
|
-
Tooltip.defaultProps = Object.assign({}, filterProps(Popover.defaultProps,
|
|
52
|
+
Tooltip.defaultProps = Object.assign({}, filterProps(Popover.defaultProps, tooltipPropsList), {
|
|
53
53
|
hoverable: false,
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -9,10 +9,10 @@ export const firstDayOfWeek = () => {
|
|
|
9
9
|
|
|
10
10
|
const style = {
|
|
11
11
|
flexWrap: 'wrap',
|
|
12
|
-
};
|
|
12
|
+
} as const;
|
|
13
|
+
// to freeze the object for typescript
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
|
-
// @ts-ignore
|
|
16
16
|
<div className="d-flex" style={style}>
|
|
17
17
|
{values.map((v, index) => (
|
|
18
18
|
<div className="mr-9 mt-5" key={index}>
|
|
@@ -151,9 +151,9 @@ export const translateToDate = (format: string, val: string, validators: Validat
|
|
|
151
151
|
if (isValid(validators, val, format)) {
|
|
152
152
|
const separator = format.includes('/') ? '/' : '-';
|
|
153
153
|
|
|
154
|
-
let year
|
|
155
|
-
month
|
|
156
|
-
date
|
|
154
|
+
let year = -1,
|
|
155
|
+
month = -1,
|
|
156
|
+
date = -1;
|
|
157
157
|
const v = val.split(separator);
|
|
158
158
|
format.split(separator).forEach((f, i) => {
|
|
159
159
|
switch (f) {
|
|
@@ -2,10 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { Checkbox, Radio, Label } from '@/index';
|
|
4
4
|
import { BaseProps } from '@/utils/types';
|
|
5
|
+
import { ChangeEvent } from '@/common.type';
|
|
5
6
|
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
|
|
7
|
+
export type ChoiceListAlignment = 'horizontal' | 'vertical';
|
|
8
|
+
export type ChoiceListSize = 'regular' | 'tiny';
|
|
9
9
|
type noop = (ev: ChangeEvent) => void;
|
|
10
10
|
|
|
11
11
|
export interface Choice {
|
|
@@ -43,12 +43,12 @@ export interface ChoiceListProps extends BaseProps {
|
|
|
43
43
|
* Alignment in which the coices will be rendered
|
|
44
44
|
* @default "vertical"
|
|
45
45
|
*/
|
|
46
|
-
alignment?:
|
|
46
|
+
alignment?: ChoiceListAlignment;
|
|
47
47
|
/**
|
|
48
48
|
* Size of the `ChoiceList`
|
|
49
49
|
* @default "regular"
|
|
50
50
|
*/
|
|
51
|
-
size?:
|
|
51
|
+
size?: ChoiceListSize;
|
|
52
52
|
/**
|
|
53
53
|
* renders `checkbox` if `true` and renders `radio` if `false` of the `ChoiceList`
|
|
54
54
|
* @default false
|
|
@@ -73,8 +73,8 @@ const renderCheckbox = (
|
|
|
73
73
|
list: Choice[],
|
|
74
74
|
handleOnChange: noop,
|
|
75
75
|
ChoiceListDisabled: boolean,
|
|
76
|
-
size:
|
|
77
|
-
alignment:
|
|
76
|
+
size: ChoiceListSize,
|
|
77
|
+
alignment: ChoiceListAlignment,
|
|
78
78
|
selected: string[]
|
|
79
79
|
) => {
|
|
80
80
|
return list.map((item: Choice, checkboxIndex: number) => {
|
|
@@ -100,8 +100,8 @@ const renderRadio = (
|
|
|
100
100
|
list: Choice[],
|
|
101
101
|
handleOnChange: noop,
|
|
102
102
|
ChoiceListDisabled: boolean,
|
|
103
|
-
size:
|
|
104
|
-
alignment:
|
|
103
|
+
size: ChoiceListSize,
|
|
104
|
+
alignment: ChoiceListAlignment,
|
|
105
105
|
selected: string[]
|
|
106
106
|
) => {
|
|
107
107
|
return list.map((item: Choice, radioIndex: number) => {
|
|
@@ -123,7 +123,7 @@ const renderRadio = (
|
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
const getCheckboxClassName = (alignment:
|
|
126
|
+
const getCheckboxClassName = (alignment: ChoiceListAlignment, index: number) => {
|
|
127
127
|
const ChoiceListCheckboxClass = classNames({
|
|
128
128
|
[`ChoiceList-checkbox--${alignment}`]: true,
|
|
129
129
|
['ml-0']: index === 0 && alignment === 'horizontal',
|
|
@@ -132,7 +132,7 @@ const getCheckboxClassName = (alignment: Alignment, index: number) => {
|
|
|
132
132
|
return ChoiceListCheckboxClass;
|
|
133
133
|
};
|
|
134
134
|
|
|
135
|
-
const getRadioClassName = (alignment:
|
|
135
|
+
const getRadioClassName = (alignment: ChoiceListAlignment, index: number) => {
|
|
136
136
|
const ChoiceListRadioClass = classNames({
|
|
137
137
|
[`ChoiceList-radio--${alignment}`]: true,
|
|
138
138
|
['ml-0']: index === 0 && alignment === 'horizontal',
|
|
@@ -198,7 +198,7 @@ export class DatePicker extends React.Component<DatePickerProps, DatePickerState
|
|
|
198
198
|
const { date } = this.state;
|
|
199
199
|
const { months } = config;
|
|
200
200
|
const todayDate = new Date(Date.now());
|
|
201
|
-
const todayMonthAndDate
|
|
201
|
+
const todayMonthAndDate = `${months[todayDate.getMonth()]} ${todayDate.getDate()}`;
|
|
202
202
|
const currDate = convertToDate(date, inputFormat, validators);
|
|
203
203
|
const dateDisabledBefore = convertToDate(disabledBefore, inputFormat, validators);
|
|
204
204
|
const dateDisabledAfter = convertToDate(disabledAfter, inputFormat, validators);
|
|
@@ -61,11 +61,7 @@ export const Trigger = (props: TriggerProps) => {
|
|
|
61
61
|
error={showError}
|
|
62
62
|
mask={mask}
|
|
63
63
|
value={
|
|
64
|
-
date
|
|
65
|
-
? translateToString(inputFormat, date)
|
|
66
|
-
: init // @ts-ignore
|
|
67
|
-
? InputMask.utils.getDefaultValue(mask, placeholderChar)
|
|
68
|
-
: ''
|
|
64
|
+
date ? translateToString(inputFormat, date) : init ? InputMask.utils.getDefaultValue(mask, placeholderChar) : ''
|
|
69
65
|
}
|
|
70
66
|
onChange={onChangeHandler}
|
|
71
67
|
onBlur={onBlurHandler}
|
|
@@ -119,6 +119,15 @@ export interface DateRangePickerState {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export class DateRangePicker extends React.Component<DateRangePickerProps, DateRangePickerState> {
|
|
122
|
+
static utils = {
|
|
123
|
+
getCurrentWeek,
|
|
124
|
+
getPreviousWeek,
|
|
125
|
+
getPreviousMonth,
|
|
126
|
+
getPrevious90Days,
|
|
127
|
+
getCustomDates,
|
|
128
|
+
getCurrentYear,
|
|
129
|
+
getCurrentMonth,
|
|
130
|
+
};
|
|
122
131
|
static defaultProps = {
|
|
123
132
|
...Calendar.defaultProps,
|
|
124
133
|
children: <></>,
|
|
@@ -431,15 +440,5 @@ export class DateRangePicker extends React.Component<DateRangePickerProps, DateR
|
|
|
431
440
|
return this.renderCalendar();
|
|
432
441
|
}
|
|
433
442
|
}
|
|
434
|
-
// @ts-ignore
|
|
435
|
-
DateRangePicker.utils = {
|
|
436
|
-
getCurrentWeek,
|
|
437
|
-
getPreviousWeek,
|
|
438
|
-
getPreviousMonth,
|
|
439
|
-
getPrevious90Days,
|
|
440
|
-
getCustomDates,
|
|
441
|
-
getCurrentYear,
|
|
442
|
-
getCurrentMonth,
|
|
443
|
-
};
|
|
444
443
|
|
|
445
444
|
export default DateRangePicker;
|
|
@@ -21,7 +21,6 @@ export const SingleInputTrigger = (props: TriggerProps) => {
|
|
|
21
21
|
const errorMessage = inputOptions.caption === undefined ? 'Invalid value' : inputOptions.caption;
|
|
22
22
|
const { label } = inputOptions;
|
|
23
23
|
const { placeholderChar = '_' } = inputOptions;
|
|
24
|
-
// @ts-ignore
|
|
25
24
|
const defaultValue = InputMask.utils.getDefaultValue(mask, placeholderChar).split(' - ');
|
|
26
25
|
const sValue = startValue || defaultValue[0];
|
|
27
26
|
const eValue = endValue || defaultValue[1];
|
|
@@ -130,7 +130,7 @@ export const Trigger = (props: TriggerProps) => {
|
|
|
130
130
|
value={
|
|
131
131
|
startDate
|
|
132
132
|
? translateToString(inputFormat, startDate)
|
|
133
|
-
: init
|
|
133
|
+
: init
|
|
134
134
|
? InputMask.utils.getDefaultValue(mask, startPlaceholderChar)
|
|
135
135
|
: ''
|
|
136
136
|
}
|
|
@@ -162,7 +162,7 @@ export const Trigger = (props: TriggerProps) => {
|
|
|
162
162
|
value={
|
|
163
163
|
endDate
|
|
164
164
|
? translateToString(inputFormat, endDate)
|
|
165
|
-
: init
|
|
165
|
+
: init
|
|
166
166
|
? InputMask.utils.getDefaultValue(mask, endPlaceholderChar)
|
|
167
167
|
: ''
|
|
168
168
|
}
|
package/core/components/organisms/dateRangePicker/__stories__/variants/monthsInView.story.tsx
CHANGED
|
@@ -6,10 +6,10 @@ import Card from '@/components/atoms/card';
|
|
|
6
6
|
export const monthsInView = () => {
|
|
7
7
|
const style = {
|
|
8
8
|
flexDirection: 'column',
|
|
9
|
-
};
|
|
9
|
+
} as const;
|
|
10
|
+
// to freeze the object for typescript
|
|
10
11
|
|
|
11
12
|
return (
|
|
12
|
-
// @ts-ignore
|
|
13
13
|
<div className="d-flex" style={style}>
|
|
14
14
|
{Array.from([1, 2, 3], (x) => (
|
|
15
15
|
<div className="mt-5" style={{ alignSelf: 'flex-start' }}>
|
|
@@ -38981,22 +38981,22 @@ exports[`DateRangePicker component
|
|
|
38981
38981
|
</span>
|
|
38982
38982
|
</div>
|
|
38983
38983
|
<div
|
|
38984
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--large
|
|
38984
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--large"
|
|
38985
38985
|
data-test="DesignSystem-Calendar--monthValue"
|
|
38986
38986
|
>
|
|
38987
38987
|
<span
|
|
38988
|
-
class="Text Text--
|
|
38988
|
+
class="Text Text--default Text--regular"
|
|
38989
38989
|
data-test="DesignSystem-Text"
|
|
38990
38990
|
>
|
|
38991
38991
|
Nov
|
|
38992
38992
|
</span>
|
|
38993
38993
|
</div>
|
|
38994
38994
|
<div
|
|
38995
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--large"
|
|
38995
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--large Calendar-value--currDateMonthYear"
|
|
38996
38996
|
data-test="DesignSystem-Calendar--monthValue"
|
|
38997
38997
|
>
|
|
38998
38998
|
<span
|
|
38999
|
-
class="Text Text--
|
|
38999
|
+
class="Text Text--link Text--regular"
|
|
39000
39000
|
data-test="DesignSystem-Text"
|
|
39001
39001
|
>
|
|
39002
39002
|
Dec
|
|
@@ -40540,22 +40540,22 @@ exports[`DateRangePicker component
|
|
|
40540
40540
|
</span>
|
|
40541
40541
|
</div>
|
|
40542
40542
|
<div
|
|
40543
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--small
|
|
40543
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--small"
|
|
40544
40544
|
data-test="DesignSystem-Calendar--monthValue"
|
|
40545
40545
|
>
|
|
40546
40546
|
<span
|
|
40547
|
-
class="Text Text--
|
|
40547
|
+
class="Text Text--default Text--small"
|
|
40548
40548
|
data-test="DesignSystem-Text"
|
|
40549
40549
|
>
|
|
40550
40550
|
Nov
|
|
40551
40551
|
</span>
|
|
40552
40552
|
</div>
|
|
40553
40553
|
<div
|
|
40554
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--small"
|
|
40554
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--small Calendar-value--currDateMonthYear"
|
|
40555
40555
|
data-test="DesignSystem-Calendar--monthValue"
|
|
40556
40556
|
>
|
|
40557
40557
|
<span
|
|
40558
|
-
class="Text Text--
|
|
40558
|
+
class="Text Text--link Text--small"
|
|
40559
40559
|
data-test="DesignSystem-Text"
|
|
40560
40560
|
>
|
|
40561
40561
|
Dec
|
|
@@ -42099,22 +42099,22 @@ exports[`DateRangePicker component
|
|
|
42099
42099
|
</span>
|
|
42100
42100
|
</div>
|
|
42101
42101
|
<div
|
|
42102
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--large
|
|
42102
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--large"
|
|
42103
42103
|
data-test="DesignSystem-Calendar--monthValue"
|
|
42104
42104
|
>
|
|
42105
42105
|
<span
|
|
42106
|
-
class="Text Text--
|
|
42106
|
+
class="Text Text--default Text--regular"
|
|
42107
42107
|
data-test="DesignSystem-Text"
|
|
42108
42108
|
>
|
|
42109
42109
|
Nov
|
|
42110
42110
|
</span>
|
|
42111
42111
|
</div>
|
|
42112
42112
|
<div
|
|
42113
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--large"
|
|
42113
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--large Calendar-value--currDateMonthYear"
|
|
42114
42114
|
data-test="DesignSystem-Calendar--monthValue"
|
|
42115
42115
|
>
|
|
42116
42116
|
<span
|
|
42117
|
-
class="Text Text--
|
|
42117
|
+
class="Text Text--link Text--regular"
|
|
42118
42118
|
data-test="DesignSystem-Text"
|
|
42119
42119
|
>
|
|
42120
42120
|
Dec
|
|
@@ -46679,22 +46679,22 @@ exports[`DateRangePicker component
|
|
|
46679
46679
|
</span>
|
|
46680
46680
|
</div>
|
|
46681
46681
|
<div
|
|
46682
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--small
|
|
46682
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--small"
|
|
46683
46683
|
data-test="DesignSystem-Calendar--monthValue"
|
|
46684
46684
|
>
|
|
46685
46685
|
<span
|
|
46686
|
-
class="Text Text--
|
|
46686
|
+
class="Text Text--default Text--small"
|
|
46687
46687
|
data-test="DesignSystem-Text"
|
|
46688
46688
|
>
|
|
46689
46689
|
Nov
|
|
46690
46690
|
</span>
|
|
46691
46691
|
</div>
|
|
46692
46692
|
<div
|
|
46693
|
-
class="Calendar-value Calendar-monthValue Calendar-monthValue--small"
|
|
46693
|
+
class="Calendar-value Calendar-monthValue Calendar-monthValue--small Calendar-value--currDateMonthYear"
|
|
46694
46694
|
data-test="DesignSystem-Calendar--monthValue"
|
|
46695
46695
|
>
|
|
46696
46696
|
<span
|
|
46697
|
-
class="Text Text--
|
|
46697
|
+
class="Text Text--link Text--small"
|
|
46698
46698
|
data-test="DesignSystem-Text"
|
|
46699
46699
|
>
|
|
46700
46700
|
Dec
|
|
@@ -28,10 +28,12 @@ type BodyCellProps = SharedCellProps & {
|
|
|
28
28
|
expandedState: [boolean, React.Dispatch<React.SetStateAction<boolean>>];
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export type CellProps =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export type CellProps = Partial<HeaderCellProps> &
|
|
32
|
+
Partial<BodyCellProps> &
|
|
33
|
+
SharedCellProps & {
|
|
34
|
+
isHead?: boolean;
|
|
35
|
+
firstCell: boolean;
|
|
36
|
+
};
|
|
35
37
|
|
|
36
38
|
const HeaderCell = (props: HeaderCellProps) => {
|
|
37
39
|
const context = React.useContext(GridContext);
|
|
@@ -265,24 +267,16 @@ export const Cell = (props: CellProps) => {
|
|
|
265
267
|
isHead,
|
|
266
268
|
firstCell,
|
|
267
269
|
schema,
|
|
268
|
-
// @ts-ignore
|
|
269
270
|
data,
|
|
270
|
-
// @ts-ignore
|
|
271
271
|
rowIndex,
|
|
272
272
|
colIndex,
|
|
273
|
-
// @ts-ignore
|
|
274
273
|
expandedState,
|
|
275
|
-
// @ts-ignore
|
|
276
274
|
onSelectAll,
|
|
277
|
-
// @ts-ignore
|
|
278
275
|
onMenuChange,
|
|
279
|
-
// @ts-ignore
|
|
280
276
|
onFilterChange,
|
|
281
|
-
// @ts-ignore
|
|
282
277
|
updateColumnSchema,
|
|
283
|
-
// @ts-ignore
|
|
284
278
|
reorderColumn,
|
|
285
|
-
} = props;
|
|
279
|
+
} = props as CellProps;
|
|
286
280
|
|
|
287
281
|
const { draggable, separator, nestedRows, ref, withCheckbox } = context;
|
|
288
282
|
|
|
@@ -323,7 +317,7 @@ export const Cell = (props: CellProps) => {
|
|
|
323
317
|
type: pinned || '',
|
|
324
318
|
};
|
|
325
319
|
|
|
326
|
-
if (from.type === to.type) reorderColumn(from.name, to.name);
|
|
320
|
+
if (from.type === to.type && reorderColumn) reorderColumn(from.name, to.name);
|
|
327
321
|
}
|
|
328
322
|
}}
|
|
329
323
|
style={{
|
|
@@ -337,13 +331,19 @@ export const Cell = (props: CellProps) => {
|
|
|
337
331
|
colIndex={colIndex}
|
|
338
332
|
schema={schema}
|
|
339
333
|
onSelectAll={onSelectAll}
|
|
340
|
-
onMenuChange={onMenuChange}
|
|
341
|
-
onFilterChange={onFilterChange}
|
|
342
|
-
updateColumnSchema={updateColumnSchema}
|
|
343
|
-
reorderColumn={reorderColumn}
|
|
334
|
+
onMenuChange={onMenuChange!}
|
|
335
|
+
onFilterChange={onFilterChange!}
|
|
336
|
+
updateColumnSchema={updateColumnSchema!}
|
|
337
|
+
reorderColumn={reorderColumn!}
|
|
344
338
|
/>
|
|
345
339
|
) : (
|
|
346
|
-
<BodyCell
|
|
340
|
+
<BodyCell
|
|
341
|
+
rowIndex={rowIndex!}
|
|
342
|
+
colIndex={colIndex}
|
|
343
|
+
data={data!}
|
|
344
|
+
schema={schema}
|
|
345
|
+
expandedState={expandedState!}
|
|
346
|
+
/>
|
|
347
347
|
)}
|
|
348
348
|
</div>
|
|
349
349
|
);
|
|
@@ -288,6 +288,9 @@ export interface GridState {
|
|
|
288
288
|
|
|
289
289
|
export class Grid extends React.Component<GridProps, GridState> {
|
|
290
290
|
static defaultProps: GridProps;
|
|
291
|
+
gridRef: GridRef = null;
|
|
292
|
+
isHeadSyncing = false;
|
|
293
|
+
isBodySyncing = false;
|
|
291
294
|
|
|
292
295
|
constructor(props: GridProps) {
|
|
293
296
|
super(props);
|
|
@@ -327,10 +330,6 @@ export class Grid extends React.Component<GridProps, GridState> {
|
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
332
|
|
|
330
|
-
gridRef: GridRef = null;
|
|
331
|
-
isHeadSyncing: boolean = false;
|
|
332
|
-
isBodySyncing: boolean = false;
|
|
333
|
-
|
|
334
333
|
addScrollListeners() {
|
|
335
334
|
const gridHeadEl = this.gridRef!.querySelector('.Grid-head');
|
|
336
335
|
const gridBodyEl = this.gridRef!.querySelector('.Grid-body');
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Schema } from '../../Grid';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import iconImg from './image.png';
|
|
5
3
|
import { GridCellProps } from '../../GridCell';
|
|
6
4
|
import { PlaceholderParagraph, EditableInput } from '@/index';
|
|
7
5
|
|
|
@@ -89,7 +87,7 @@ const schema: Schema = [
|
|
|
89
87
|
resizable: true,
|
|
90
88
|
align: 'center',
|
|
91
89
|
cellType: 'ICON',
|
|
92
|
-
translate: (
|
|
90
|
+
translate: () => ({
|
|
93
91
|
icon: 'events',
|
|
94
92
|
}),
|
|
95
93
|
// separator: true,
|
|
@@ -6,7 +6,7 @@ import { filterData, sortData } from '../../utility';
|
|
|
6
6
|
export const fetchData: fetchDataFunction = (options) => {
|
|
7
7
|
const { page, pageSize, sortingList, filterList, searchTerm } = options;
|
|
8
8
|
|
|
9
|
-
const onSearch = (d: RowData, searchTerm
|
|
9
|
+
const onSearch = (d: RowData, searchTerm = '') => {
|
|
10
10
|
return (
|
|
11
11
|
d.firstName.toLowerCase().match(searchTerm.toLowerCase()) ||
|
|
12
12
|
d.lastName.toLowerCase().match(searchTerm.toLowerCase())
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Schema } from '../../Grid';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import iconImg from './image.png';
|
|
5
3
|
import { Icon, GridCell } from '@/index';
|
|
6
4
|
|
|
7
5
|
const schema: Schema = [
|
|
@@ -88,7 +86,7 @@ const schema: Schema = [
|
|
|
88
86
|
resizable: true,
|
|
89
87
|
align: 'center',
|
|
90
88
|
cellType: 'ICON',
|
|
91
|
-
translate: (
|
|
89
|
+
translate: () => ({
|
|
92
90
|
icon: 'events',
|
|
93
91
|
}),
|
|
94
92
|
// separator: true,
|