@edvisor/product-language 0.10.2 → 0.10.4
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/index.d.ts +2 -0
- package/index.js +11339 -0
- package/lib/components/alert-banner/alert-banner.d.ts +15 -0
- package/lib/components/alert-banner/alert-level-flags.d.ts +18 -0
- package/lib/components/alert-banner/index.d.ts +1 -0
- package/lib/components/badge/badge-type-flags.d.ts +18 -0
- package/lib/components/badge/badge.d.ts +5 -0
- package/lib/components/badge/index.d.ts +1 -0
- package/{src/lib/components/card/atoms/card-frame.tsx → lib/components/card/atoms/card-frame.d.ts} +7 -16
- package/lib/components/card/atoms/index.d.ts +1 -0
- package/lib/components/card/card.d.ts +14 -0
- package/lib/components/card/components/card-alert-banner-slot.d.ts +6 -0
- package/lib/components/card/components/card-controls-slot.d.ts +5 -0
- package/lib/components/card/components/card-section-slot.d.ts +11 -0
- package/lib/components/card/components/index.d.ts +3 -0
- package/lib/components/card/index.d.ts +3 -0
- package/lib/components/card/molecules/index.d.ts +1 -0
- package/lib/components/card/molecules/left-right-card.d.ts +16 -0
- package/lib/components/checkbox/checkbox.d.ts +11 -0
- package/lib/components/checkbox/helpers.d.ts +12 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/date-picker/components/custom-calendar.d.ts +6 -0
- package/lib/components/date-picker/components/index.d.ts +1 -0
- package/lib/components/date-picker/date-picker.d.ts +4 -0
- package/lib/components/date-picker/helpers/date-picker-factory.d.ts +34 -0
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/divider/divider-type-flags.d.ts +9 -0
- package/lib/components/divider/divider.d.ts +7 -0
- package/lib/components/divider/index.d.ts +1 -0
- package/lib/components/flag/flag-size-flags.d.ts +12 -0
- package/lib/components/flag/flag.d.ts +9 -0
- package/lib/components/flag/flag.list.d.ts +782 -0
- package/lib/components/flag/index.d.ts +1 -0
- package/lib/components/icon/icon-list.d.ts +132 -0
- package/lib/components/icon/icon.d.ts +131 -0
- package/lib/components/icon/index.d.ts +1 -0
- package/lib/components/index.d.ts +25 -0
- package/lib/components/input-field/components/index.d.ts +2 -0
- package/lib/components/input-field/components/labeled-input.d.ts +10 -0
- package/lib/components/input-field/components/stepper.d.ts +7 -0
- package/lib/components/input-field/index.d.ts +3 -0
- package/lib/components/input-field/input-field.d.ts +26 -0
- package/lib/components/input-field/input-number.d.ts +18 -0
- package/lib/components/input-field/input-text.d.ts +14 -0
- package/lib/components/layout/flex.d.ts +16 -0
- package/lib/components/layout/grid-layout.d.ts +11 -0
- package/lib/components/layout/index.d.ts +3 -0
- package/lib/components/layout/left-right-layout.d.ts +34 -0
- package/lib/components/link/index.d.ts +1 -0
- package/lib/components/link/link.d.ts +14 -0
- package/lib/components/modal/index.d.ts +3 -0
- package/lib/components/modal/modal-base.d.ts +28 -0
- package/lib/components/modal/modal-destructive.d.ts +11 -0
- package/lib/components/modal/modal.d.ts +13 -0
- package/lib/components/molecules/avatar/avatar-size-flags.d.ts +12 -0
- package/lib/components/molecules/avatar/avatar.d.ts +12 -0
- package/lib/components/molecules/avatar/index.d.ts +1 -0
- package/lib/components/molecules/button/button-flags.d.ts +44 -0
- package/lib/components/molecules/button/button.d.ts +12 -0
- package/lib/components/molecules/button/index.d.ts +1 -0
- package/lib/components/molecules/index.d.ts +3 -0
- package/lib/components/molecules/input-checkbox/index.d.ts +1 -0
- package/lib/components/molecules/input-checkbox/input-checkbox.d.ts +8 -0
- package/lib/components/organisms/choice-list/choice-list.d.ts +9 -0
- package/lib/components/organisms/choice-list/index.d.ts +1 -0
- package/lib/components/organisms/index.d.ts +2 -0
- package/lib/components/organisms/multi-choice-list/index.d.ts +1 -0
- package/lib/components/organisms/multi-choice-list/multi-choice-list.d.ts +11 -0
- package/lib/components/progress-bar/index.d.ts +1 -0
- package/lib/components/progress-bar/progress-bar-size-flags.d.ts +10 -0
- package/lib/components/progress-bar/progress-bar.d.ts +8 -0
- package/lib/components/radio-button/index.d.ts +1 -0
- package/lib/components/radio-button/radio-button.d.ts +10 -0
- package/lib/components/range-slider/components/bar-chart.d.ts +8 -0
- package/lib/components/range-slider/components/handle.d.ts +12 -0
- package/lib/components/range-slider/components/rail.d.ts +9 -0
- package/lib/components/range-slider/components/slider-component.d.ts +12 -0
- package/lib/components/range-slider/components/slider-inputs.d.ts +14 -0
- package/lib/components/range-slider/components/tick.d.ts +10 -0
- package/lib/components/range-slider/components/track.d.ts +11 -0
- package/lib/components/range-slider/index.d.ts +2 -0
- package/lib/components/range-slider/range-slider.d.ts +15 -0
- package/lib/components/range-slider/slider.d.ts +11 -0
- package/lib/components/range-slider/types.d.ts +11 -0
- package/lib/components/select/components/helpers.d.ts +17 -0
- package/lib/components/select/components/menu-container.d.ts +3 -0
- package/lib/components/select/components/menu-list.d.ts +3 -0
- package/lib/components/select/components/menu-row.d.ts +9 -0
- package/lib/components/select/components/menu.d.ts +3 -0
- package/lib/components/select/components/option.d.ts +3 -0
- package/lib/components/select/components/select-label.d.ts +1 -0
- package/lib/components/select/components/value-component-multi.d.ts +4 -0
- package/lib/components/select/components/value-component-single.d.ts +4 -0
- package/lib/components/select/components/value.d.ts +4 -0
- package/lib/components/select/index.d.ts +3 -0
- package/lib/components/select/select.d.ts +10 -0
- package/lib/components/select/types.d.ts +133 -0
- package/lib/components/select/utils.d.ts +15 -0
- package/{src/lib/components/radio-button/index.tsx → lib/components/spinner/index.d.ts} +1 -1
- package/lib/components/spinner/spinner-size-flags.d.ts +10 -0
- package/lib/components/spinner/spinner.d.ts +9 -0
- package/lib/components/tabs/components/index.d.ts +1 -0
- package/lib/components/tabs/components/tab.d.ts +8 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/tabs.d.ts +16 -0
- package/lib/components/tag/components/close-button.d.ts +8 -0
- package/lib/components/tag/components/index.d.ts +2 -0
- package/lib/components/tag/components/tag-label.d.ts +8 -0
- package/lib/components/tag/index.d.ts +1 -0
- package/lib/components/tag/tag.d.ts +10 -0
- package/lib/components/thumbnail/index.d.ts +1 -0
- package/lib/components/thumbnail/thumbnail-size-flags.d.ts +10 -0
- package/lib/components/thumbnail/thumbnail.d.ts +10 -0
- package/lib/components/tooltip/index.d.ts +1 -0
- package/lib/components/tooltip/tooltip.d.ts +26 -0
- package/lib/components/tree-view/components/tree-node.d.ts +3 -0
- package/lib/components/tree-view/helper.d.ts +12 -0
- package/lib/components/tree-view/index.d.ts +2 -0
- package/lib/components/tree-view/tree-view.d.ts +3 -0
- package/lib/components/tree-view/types.d.ts +63 -0
- package/lib/components/typography/index.d.ts +1 -0
- package/lib/components/typography/typography.d.ts +24 -0
- package/lib/foundations/color-system/base-palette/base-palette.d.ts +76 -0
- package/lib/foundations/color-system/base-palette/index.d.ts +1 -0
- package/lib/foundations/color-system/color-guidelines/color-guidelines.d.ts +133 -0
- package/lib/foundations/color-system/color-guidelines/index.d.ts +1 -0
- package/lib/foundations/color-system/components/color-sample.d.ts +17 -0
- package/lib/foundations/color-system/components/index.d.ts +1 -0
- package/lib/foundations/color-system/index.d.ts +1 -0
- package/lib/foundations/index.d.ts +4 -0
- package/lib/foundations/shadows/components.d.ts +8 -0
- package/lib/foundations/shadows/index.d.ts +1 -0
- package/lib/foundations/shadows/shadows.d.ts +8 -0
- package/lib/foundations/spacing/index.d.ts +1 -0
- package/lib/foundations/spacing/spacing-guidelines.d.ts +33 -0
- package/lib/foundations/spacing/spacing.d.ts +18 -0
- package/lib/foundations/typography/constants.d.ts +22 -0
- package/lib/foundations/typography/fonts.d.ts +1 -0
- package/lib/foundations/typography/index.d.ts +1 -0
- package/lib/foundations/typography/text-aspect-flags.d.ts +19 -0
- package/lib/foundations/typography/typography.d.ts +24 -0
- package/lib/helpers/generic-types.d.ts +21 -0
- package/lib/helpers/index.d.ts +8 -0
- package/lib/helpers/isReactElementOfType.d.ts +8 -0
- package/lib/helpers/nothing.d.ts +10 -0
- package/{src/lib/helpers/numbers.ts → lib/helpers/numbers.d.ts} +50 -67
- package/lib/helpers/safe-navigation.d.ts +17 -0
- package/lib/helpers/slots.d.ts +17 -0
- package/lib/helpers/strings.d.ts +1 -0
- package/lib/helpers/useInputElementState.d.ts +30 -0
- package/lib/helpers/useKeyDown.d.ts +1 -0
- package/package.json +27 -2
- package/.babelrc +0 -12
- package/.eslintrc.json +0 -147
- package/.release-it.json +0 -17
- package/.storybook/main.js +0 -57
- package/.storybook/manager.js +0 -7
- package/.storybook/preview.js +0 -15
- package/.storybook/tsconfig.json +0 -30
- package/jest.config.ts +0 -15
- package/jest.setup.ts +0 -2
- package/project.json +0 -98
- package/src/README.md +0 -61
- package/src/assets/svg/example_icon.svg +0 -3
- package/src/assets/svg/example_icon_white.svg +0 -3
- package/src/assets/svg/spinner.svg +0 -3
- package/src/assets/svg/spinner_white.svg +0 -3
- package/src/helpers/index.ts +0 -4
- package/src/helpers/playground.ts +0 -26
- package/src/helpers/talesOf.tsx +0 -42
- package/src/index.ts +0 -2
- package/src/lib/components/README.md +0 -49
- package/src/lib/components/alert-banner/alert-banner.test.tsx +0 -93
- package/src/lib/components/alert-banner/alert-banner.tsx +0 -117
- package/src/lib/components/alert-banner/alert-level-flags.ts +0 -101
- package/src/lib/components/alert-banner/index.ts +0 -1
- package/src/lib/components/alert-banner/storybook/alert-banner.stories.mdx +0 -67
- package/src/lib/components/alert-banner/storybook/components.tsx +0 -124
- package/src/lib/components/badge/badge-type-flags.ts +0 -72
- package/src/lib/components/badge/badge.test.tsx +0 -29
- package/src/lib/components/badge/badge.tsx +0 -22
- package/src/lib/components/badge/index.ts +0 -1
- package/src/lib/components/badge/stories/badge.stories.mdx +0 -44
- package/src/lib/components/badge/stories/components.tsx +0 -49
- package/src/lib/components/card/atoms/index.ts +0 -1
- package/src/lib/components/card/card.test.tsx +0 -162
- package/src/lib/components/card/card.tsx +0 -78
- package/src/lib/components/card/components/card-alert-banner-slot.tsx +0 -16
- package/src/lib/components/card/components/card-controls-slot.tsx +0 -19
- package/src/lib/components/card/components/card-section-slot.tsx +0 -51
- package/src/lib/components/card/components/index.ts +0 -3
- package/src/lib/components/card/index.ts +0 -3
- package/src/lib/components/card/molecules/index.ts +0 -1
- package/src/lib/components/card/molecules/left-right-card.test.tsx +0 -89
- package/src/lib/components/card/molecules/left-right-card.tsx +0 -63
- package/src/lib/components/card/storybook/card.stories.mdx +0 -100
- package/src/lib/components/card/storybook/components.tsx +0 -227
- package/src/lib/components/checkbox/checkbox.test.tsx +0 -39
- package/src/lib/components/checkbox/checkbox.tsx +0 -70
- package/src/lib/components/checkbox/helpers.tsx +0 -98
- package/src/lib/components/checkbox/index.tsx +0 -1
- package/src/lib/components/checkbox/stories/checkbox.stories.mdx +0 -57
- package/src/lib/components/checkbox/stories/components.tsx +0 -84
- package/src/lib/components/date-picker/components/custom-calendar.tsx +0 -193
- package/src/lib/components/date-picker/components/index.ts +0 -1
- package/src/lib/components/date-picker/data-picker.test.tsx +0 -220
- package/src/lib/components/date-picker/date-picker.tsx +0 -10
- package/src/lib/components/date-picker/helpers/date-picker-factory.tsx +0 -210
- package/src/lib/components/date-picker/index.ts +0 -1
- package/src/lib/components/date-picker/storybook/components.tsx +0 -259
- package/src/lib/components/date-picker/storybook/date-picker.stories.mdx +0 -133
- package/src/lib/components/divider/divider-type-flags.tsx +0 -37
- package/src/lib/components/divider/divider.test.tsx +0 -34
- package/src/lib/components/divider/divider.tsx +0 -37
- package/src/lib/components/divider/index.tsx +0 -1
- package/src/lib/components/divider/stories/components.tsx +0 -13
- package/src/lib/components/divider/stories/divider.stories.mdx +0 -44
- package/src/lib/components/flag/flag-size-flags.tsx +0 -55
- package/src/lib/components/flag/flag.list.tsx +0 -788
- package/src/lib/components/flag/flag.test.tsx +0 -65
- package/src/lib/components/flag/flag.tsx +0 -97
- package/src/lib/components/flag/index.tsx +0 -1
- package/src/lib/components/flag/stories/components.tsx +0 -403
- package/src/lib/components/flag/stories/flag.stories.mdx +0 -48
- package/src/lib/components/flag/stories/playGround-select.tsx +0 -145
- package/src/lib/components/icon/icon-list.tsx +0 -135
- package/src/lib/components/icon/icon.test.tsx +0 -47
- package/src/lib/components/icon/icon.tsx +0 -181
- package/src/lib/components/icon/index.tsx +0 -1
- package/src/lib/components/icon/stories/components.tsx +0 -282
- package/src/lib/components/icon/stories/icon.stories.mdx +0 -65
- package/src/lib/components/index.ts +0 -26
- package/src/lib/components/input-field/components/index.ts +0 -2
- package/src/lib/components/input-field/components/labeled-input.tsx +0 -57
- package/src/lib/components/input-field/components/stepper.tsx +0 -64
- package/src/lib/components/input-field/index.ts +0 -6
- package/src/lib/components/input-field/input-field.test.tsx +0 -107
- package/src/lib/components/input-field/input-field.tsx +0 -154
- package/src/lib/components/input-field/input-number.tsx +0 -41
- package/src/lib/components/input-field/input-text.tsx +0 -30
- package/src/lib/components/input-field/storybook/components.tsx +0 -367
- package/src/lib/components/input-field/storybook/input-field.stories.mdx +0 -120
- package/src/lib/components/layout/flex.tsx +0 -22
- package/src/lib/components/layout/grid-layout.tsx +0 -40
- package/src/lib/components/layout/index.ts +0 -3
- package/src/lib/components/layout/left-right-layout.tsx +0 -67
- package/src/lib/components/link/index.ts +0 -1
- package/src/lib/components/link/link.test.tsx +0 -29
- package/src/lib/components/link/link.tsx +0 -56
- package/src/lib/components/link/storybook/link.stories.mdx +0 -52
- package/src/lib/components/modal/index.ts +0 -3
- package/src/lib/components/modal/modal-base.tsx +0 -129
- package/src/lib/components/modal/modal-destructive.tsx +0 -70
- package/src/lib/components/modal/modal.test.tsx +0 -138
- package/src/lib/components/modal/modal.tsx +0 -114
- package/src/lib/components/modal/storybook/components.tsx +0 -105
- package/src/lib/components/modal/storybook/modal-destructive.stories.mdx +0 -31
- package/src/lib/components/modal/storybook/modal.stories.mdx +0 -50
- package/src/lib/components/molecules/avatar/avatar-size-flags.tsx +0 -55
- package/src/lib/components/molecules/avatar/avatar.test.tsx +0 -114
- package/src/lib/components/molecules/avatar/avatar.tsx +0 -80
- package/src/lib/components/molecules/avatar/index.tsx +0 -1
- package/src/lib/components/molecules/avatar/stories/avatar.stories.mdx +0 -52
- package/src/lib/components/molecules/avatar/stories/components.tsx +0 -36
- package/src/lib/components/molecules/button/button-flags.tsx +0 -340
- package/src/lib/components/molecules/button/button.test.tsx +0 -77
- package/src/lib/components/molecules/button/button.tsx +0 -212
- package/src/lib/components/molecules/button/index.tsx +0 -1
- package/src/lib/components/molecules/button/stories/button.stories.mdx +0 -105
- package/src/lib/components/molecules/button/stories/components.tsx +0 -90
- package/src/lib/components/molecules/index.ts +0 -3
- package/src/lib/components/molecules/input-checkbox/index.tsx +0 -1
- package/src/lib/components/molecules/input-checkbox/input-checkbox.test.tsx +0 -34
- package/src/lib/components/molecules/input-checkbox/input-checkbox.tsx +0 -50
- package/src/lib/components/molecules/input-checkbox/stories/components.tsx +0 -53
- package/src/lib/components/molecules/input-checkbox/stories/input-checkbox.stories.mdx +0 -49
- package/src/lib/components/organisms/choice-list/choice-list.test.tsx +0 -36
- package/src/lib/components/organisms/choice-list/choice-list.tsx +0 -72
- package/src/lib/components/organisms/choice-list/index.tsx +0 -1
- package/src/lib/components/organisms/choice-list/stories/choice-list.stories.mdx +0 -57
- package/src/lib/components/organisms/choice-list/stories/components.tsx +0 -45
- package/src/lib/components/organisms/index.ts +0 -2
- package/src/lib/components/organisms/multi-choice-list/index.tsx +0 -1
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.test.tsx +0 -33
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.tsx +0 -53
- package/src/lib/components/organisms/multi-choice-list/stories/components.tsx +0 -124
- package/src/lib/components/organisms/multi-choice-list/stories/multi-choice-list.stories.mdx +0 -99
- package/src/lib/components/progress-bar/index.ts +0 -1
- package/src/lib/components/progress-bar/progress-bar-size-flags.tsx +0 -37
- package/src/lib/components/progress-bar/progress-bar.test.tsx +0 -66
- package/src/lib/components/progress-bar/progress-bar.tsx +0 -42
- package/src/lib/components/progress-bar/storybook/components.tsx +0 -62
- package/src/lib/components/progress-bar/storybook/progress-bar.stories.mdx +0 -43
- package/src/lib/components/radio-button/radio-button.tsx +0 -135
- package/src/lib/components/radio-button/radio.test.tsx +0 -59
- package/src/lib/components/radio-button/stories/components.tsx +0 -36
- package/src/lib/components/radio-button/stories/radio-button.stories.mdx +0 -44
- package/src/lib/components/range-slider/components/bar-chart.tsx +0 -50
- package/src/lib/components/range-slider/components/handle.tsx +0 -58
- package/src/lib/components/range-slider/components/rail.tsx +0 -44
- package/src/lib/components/range-slider/components/slider-component.tsx +0 -98
- package/src/lib/components/range-slider/components/slider-inputs.tsx +0 -150
- package/src/lib/components/range-slider/components/tick.tsx +0 -51
- package/src/lib/components/range-slider/components/track.tsx +0 -67
- package/src/lib/components/range-slider/index.tsx +0 -2
- package/src/lib/components/range-slider/range-slider.test.tsx +0 -185
- package/src/lib/components/range-slider/range-slider.tsx +0 -132
- package/src/lib/components/range-slider/slider.test.tsx +0 -89
- package/src/lib/components/range-slider/slider.tsx +0 -80
- package/src/lib/components/range-slider/stories/components.tsx +0 -179
- package/src/lib/components/range-slider/stories/range-slider.stories.mdx +0 -84
- package/src/lib/components/range-slider/types.ts +0 -18
- package/src/lib/components/select/components/menu-container.tsx +0 -69
- package/src/lib/components/select/components/menu-list.tsx +0 -195
- package/src/lib/components/select/components/menu-row.tsx +0 -43
- package/src/lib/components/select/components/menu.tsx +0 -151
- package/src/lib/components/select/components/option.tsx +0 -91
- package/src/lib/components/select/components/select-label.tsx +0 -10
- package/src/lib/components/select/components/value-component-multi.tsx +0 -40
- package/src/lib/components/select/components/value-component-single.tsx +0 -27
- package/src/lib/components/select/components/value.tsx +0 -370
- package/src/lib/components/select/index.tsx +0 -3
- package/src/lib/components/select/select.test.tsx +0 -148
- package/src/lib/components/select/select.tsx +0 -337
- package/src/lib/components/select/storybook/components.tsx +0 -999
- package/src/lib/components/select/storybook/radio-group.tsx +0 -157
- package/src/lib/components/select/storybook/select.stories.mdx +0 -172
- package/src/lib/components/select/types.ts +0 -149
- package/src/lib/components/select/utils.ts +0 -101
- package/src/lib/components/spinner/index.tsx +0 -1
- package/src/lib/components/spinner/spinner-size-flags.tsx +0 -39
- package/src/lib/components/spinner/spinner.test.tsx +0 -31
- package/src/lib/components/spinner/spinner.tsx +0 -54
- package/src/lib/components/spinner/stories/components.tsx +0 -39
- package/src/lib/components/spinner/stories/spinner.stories.mdx +0 -35
- package/src/lib/components/tabs/components/index.ts +0 -1
- package/src/lib/components/tabs/components/tab.tsx +0 -85
- package/src/lib/components/tabs/index.tsx +0 -1
- package/src/lib/components/tabs/storybook/components.tsx +0 -317
- package/src/lib/components/tabs/storybook/tabs.stories.mdx +0 -105
- package/src/lib/components/tabs/tabs.test.tsx +0 -86
- package/src/lib/components/tabs/tabs.tsx +0 -115
- package/src/lib/components/tag/components/close-button.tsx +0 -85
- package/src/lib/components/tag/components/index.ts +0 -2
- package/src/lib/components/tag/components/tag-label.tsx +0 -45
- package/src/lib/components/tag/index.tsx +0 -1
- package/src/lib/components/tag/stories/components.tsx +0 -86
- package/src/lib/components/tag/stories/tag.stories.mdx +0 -42
- package/src/lib/components/tag/tag.test.tsx +0 -36
- package/src/lib/components/tag/tag.tsx +0 -33
- package/src/lib/components/thumbnail/index.tsx +0 -1
- package/src/lib/components/thumbnail/stories/thumbnail.stories.mdx +0 -44
- package/src/lib/components/thumbnail/thumbnail-size-flags.tsx +0 -41
- package/src/lib/components/thumbnail/thumbnail.test.tsx +0 -51
- package/src/lib/components/thumbnail/thumbnail.tsx +0 -44
- package/src/lib/components/tooltip/index.tsx +0 -1
- package/src/lib/components/tooltip/stories/components.tsx +0 -224
- package/src/lib/components/tooltip/stories/tooltip.stories.mdx +0 -63
- package/src/lib/components/tooltip/tooltip.test.tsx +0 -22
- package/src/lib/components/tooltip/tooltip.tsx +0 -179
- package/src/lib/components/tree-view/components/tree-node.tsx +0 -203
- package/src/lib/components/tree-view/helper.tsx +0 -171
- package/src/lib/components/tree-view/index.ts +0 -2
- package/src/lib/components/tree-view/stories/components.tsx +0 -640
- package/src/lib/components/tree-view/stories/tree-view.stories.mdx +0 -127
- package/src/lib/components/tree-view/tree-view.test.tsx +0 -146
- package/src/lib/components/tree-view/tree-view.tsx +0 -168
- package/src/lib/components/tree-view/types.tsx +0 -70
- package/src/lib/components/typography/index.ts +0 -1
- package/src/lib/components/typography/storybook/components.tsx +0 -288
- package/src/lib/components/typography/storybook/typography.stories.mdx +0 -90
- package/src/lib/components/typography/typography.test.tsx +0 -97
- package/src/lib/components/typography/typography.tsx +0 -99
- package/src/lib/foundations/color-system/base-palette/base-palette.stories.tsx +0 -123
- package/src/lib/foundations/color-system/base-palette/base-palette.ts +0 -93
- package/src/lib/foundations/color-system/base-palette/index.ts +0 -1
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.mdx +0 -85
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.tsx +0 -231
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.ts +0 -160
- package/src/lib/foundations/color-system/color-guidelines/index.ts +0 -1
- package/src/lib/foundations/color-system/components/color-sample.tsx +0 -99
- package/src/lib/foundations/color-system/components/index.ts +0 -1
- package/src/lib/foundations/color-system/index.ts +0 -1
- package/src/lib/foundations/index.ts +0 -4
- package/src/lib/foundations/shadows/components.tsx +0 -59
- package/src/lib/foundations/shadows/index.ts +0 -1
- package/src/lib/foundations/shadows/shadows.stories.mdx +0 -71
- package/src/lib/foundations/shadows/shadows.tsx +0 -47
- package/src/lib/foundations/spacing/index.ts +0 -1
- package/src/lib/foundations/spacing/spacing-guidelines.ts +0 -37
- package/src/lib/foundations/spacing/spacing.stories.mdx +0 -51
- package/src/lib/foundations/spacing/spacing.ts +0 -18
- package/src/lib/foundations/typography/constants.ts +0 -25
- package/src/lib/foundations/typography/fonts.ts +0 -205
- package/src/lib/foundations/typography/index.tsx +0 -1
- package/src/lib/foundations/typography/text-aspect-flags.ts +0 -61
- package/src/lib/foundations/typography/typography.tsx +0 -102
- package/src/lib/helpers/generic-types.ts +0 -44
- package/src/lib/helpers/index.ts +0 -8
- package/src/lib/helpers/isReactElementOfType.test.tsx +0 -108
- package/src/lib/helpers/isReactElementOfType.ts +0 -42
- package/src/lib/helpers/nothing.tsx +0 -22
- package/src/lib/helpers/safe-navigation.ts +0 -57
- package/src/lib/helpers/slots.tsx +0 -126
- package/src/lib/helpers/strings.test.ts +0 -47
- package/src/lib/helpers/strings.ts +0 -16
- package/src/lib/helpers/useInputElementState.ts +0 -56
- package/src/lib/helpers/useKeyDown.ts +0 -17
- package/tsconfig.json +0 -35
- package/tsconfig.lib.json +0 -28
- package/tsconfig.spec.json +0 -21
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { TreeView } from '../index'
|
|
3
|
-
import {
|
|
4
|
-
BasicTree,
|
|
5
|
-
TreeEvents,
|
|
6
|
-
PlayGroundTree,
|
|
7
|
-
TreeOpenCheckedNodes,
|
|
8
|
-
NodesWithMessage,
|
|
9
|
-
MultilevelTree
|
|
10
|
-
} from './components'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<Meta title="Components/TreeView" component={TreeView}/>
|
|
14
|
-
|
|
15
|
-
# Tree View System
|
|
16
|
-
|
|
17
|
-
For more details, check out the guidelines on [Figma](https://www.figma.com/file/ue1CurHfZ426o2T2l8Dk64/Edvisor-Product-Language?node-id=729%3A7354&t=3Z4YOaL6SG9Km6ih-0)
|
|
18
|
-
|
|
19
|
-
### Table of Contents
|
|
20
|
-
1. [How to use](#how-to-use)
|
|
21
|
-
2. [Playground](#playground)
|
|
22
|
-
3. [Default Opened and checked nodes](#default-opened-checked)
|
|
23
|
-
4. [With Help Message](#help-message)
|
|
24
|
-
5. [Multi level Tree](#multilevel-tree)
|
|
25
|
-
6. [Events](#events)
|
|
26
|
-
7. [Api](#api)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<div id="how-to-use"/>
|
|
30
|
-
|
|
31
|
-
## How to Use
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
import { TreeView } from '@edvisor/product-language'
|
|
35
|
-
|
|
36
|
-
<TreeView
|
|
37
|
-
nodes={nodes}
|
|
38
|
-
checkedList={checked}
|
|
39
|
-
onCheck={onCheck}
|
|
40
|
-
/>
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<div id="playground"></div>
|
|
46
|
-
|
|
47
|
-
### Playground
|
|
48
|
-
|
|
49
|
-
<PlayGroundTree/>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<div id="default-opened-checked"></div>
|
|
53
|
-
|
|
54
|
-
### Default Opened and checked nodes
|
|
55
|
-
|
|
56
|
-
<TreeOpenCheckedNodes/>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<div id="help-message"></div>
|
|
60
|
-
|
|
61
|
-
### With Help Message
|
|
62
|
-
|
|
63
|
-
<NodesWithMessage/>
|
|
64
|
-
|
|
65
|
-
### Multi level Tree
|
|
66
|
-
|
|
67
|
-
<div id="#multilevel-tree"></div>
|
|
68
|
-
|
|
69
|
-
<MultilevelTree/>
|
|
70
|
-
|
|
71
|
-
<div id="events"></div>
|
|
72
|
-
|
|
73
|
-
### Events
|
|
74
|
-
<TreeEvents/>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<div id="api"></div>
|
|
78
|
-
|
|
79
|
-
## API
|
|
80
|
-
|
|
81
|
-
### `Tree`
|
|
82
|
-
|
|
83
|
-
| Prop | Type | Description |
|
|
84
|
-
| ------------------- | --------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
85
|
-
| `checkedList` | `string[]` | `List of checked items` |
|
|
86
|
-
| `expanded?` | `string[]` | `List of parent nodes to be open as default` |
|
|
87
|
-
| [`nodes`](#inode) | `INode[]` | `List of nodes to construct the tree` |
|
|
88
|
-
| `className?` | `string` | `Class to be attached to the Container` |
|
|
89
|
-
| `title?` | `string` | `Title if the Tree` |
|
|
90
|
-
| `showChildCount?` | `boolean` | `Show child count by on parent nodes (default false)` |
|
|
91
|
-
| `expandDisabled?` | `boolean` | `Disable node expand (default false)` |
|
|
92
|
-
| `useCardContainer?` | `boolean` | `Use a Card as Container (required to use title)` |
|
|
93
|
-
| `onCheck` | `(checked: string[], node?:`[`ICheckNode`](#checkNode)) => `void` | `Fires when a node check status change` |
|
|
94
|
-
| `onClick?` | `(node?:` [`ICheckNode`](#checkNode)) => `void` | `Fires when the label is clicked` |
|
|
95
|
-
| `onExpand?` | `(expanded: string[], node?:` [`IExpandNode`](#expandNode)) => `void` | `Fires when a parent node is opend or closed` |
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<div id="inode"></div>
|
|
99
|
-
|
|
100
|
-
### `INode`
|
|
101
|
-
|
|
102
|
-
| Prop | Type | Description |
|
|
103
|
-
| ----------------------- | ------------ | --------------------------------------------- |
|
|
104
|
-
| `label` | `string` | `Node Name` |
|
|
105
|
-
| `value` | `string` | `Node value (must be unique)` |
|
|
106
|
-
| `helpfulMessage?` | `string` | `Message to be displaied under the node name` |
|
|
107
|
-
| `disabled?` | `boolean` | `disable the current node` |
|
|
108
|
-
| `invalid?` | `boolean` | `set the node check box as invalid` |
|
|
109
|
-
| [`children?`](#inode) | `INode[]` | `Array of child nodes` |
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<div id="checkNode"></div>
|
|
113
|
-
|
|
114
|
-
### `ICheckNode` extends `INode`
|
|
115
|
-
|
|
116
|
-
| Prop | Type | Description |
|
|
117
|
-
| ----------------- | ------------ | -------------------- |
|
|
118
|
-
| `checked` | `boolean` | `Node check state` |
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<div id="expandNode"></div>
|
|
122
|
-
|
|
123
|
-
### `IExpandNode` extends `INode`
|
|
124
|
-
|
|
125
|
-
| Prop | Type | Description |
|
|
126
|
-
| ----------------- | ------------ | -------------------- |
|
|
127
|
-
| `expanded` | `boolean` | `Node expand state` |
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/react'
|
|
3
|
-
import { TreeView } from './index'
|
|
4
|
-
import { INode } from './types'
|
|
5
|
-
|
|
6
|
-
describe('TreeView Tests', () => {
|
|
7
|
-
|
|
8
|
-
const countryNodes: INode[] = [
|
|
9
|
-
{
|
|
10
|
-
value: 'south_america',
|
|
11
|
-
label: 'South America',
|
|
12
|
-
children: [
|
|
13
|
-
{
|
|
14
|
-
value: 'brasil',
|
|
15
|
-
label: 'Brasil'
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: 'argentina',
|
|
19
|
-
label: 'Argentina'
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
value: 'uruguay',
|
|
23
|
-
label: 'Uruguay'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
value: 'peru',
|
|
27
|
-
label: 'Peru'
|
|
28
|
-
},
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: 'north_america',
|
|
33
|
-
label: 'North America',
|
|
34
|
-
children: [
|
|
35
|
-
{
|
|
36
|
-
value: 'canada',
|
|
37
|
-
label: 'Canada'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
value: 'usa',
|
|
41
|
-
label: 'USA'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
value: 'mexico',
|
|
45
|
-
label: 'Mexico'
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
it('should render the Tree', async () => {
|
|
52
|
-
const { container } = render(
|
|
53
|
-
<TreeView
|
|
54
|
-
checkedList={[]}
|
|
55
|
-
onCheck={() => void(0)}
|
|
56
|
-
nodes={countryNodes}
|
|
57
|
-
/>
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
const treeView = screen.getByRole('tree')
|
|
61
|
-
|
|
62
|
-
expect(treeView).toBeInTheDocument()
|
|
63
|
-
expect(container.getElementsByTagName('li').length).toBe(2)
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('Should expand the nodes on click', async () => {
|
|
68
|
-
const { container } = render(
|
|
69
|
-
<TreeView
|
|
70
|
-
checkedList={[]}
|
|
71
|
-
onCheck={() => void(0)}
|
|
72
|
-
nodes={countryNodes}
|
|
73
|
-
/>
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
const southAmericaNode = screen.getByText('South America')
|
|
77
|
-
expect(screen.queryByText('Brasil')).not.toBeInTheDocument()
|
|
78
|
-
|
|
79
|
-
fireEvent(southAmericaNode, new MouseEvent('click', {
|
|
80
|
-
bubbles: true,
|
|
81
|
-
cancelable: true,
|
|
82
|
-
}),)
|
|
83
|
-
|
|
84
|
-
expect(screen.queryByText('Brasil')).toBeInTheDocument()
|
|
85
|
-
expect(container.getElementsByTagName('li').length).toBe(6)
|
|
86
|
-
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
it('Should check by default', async () => {
|
|
90
|
-
|
|
91
|
-
const checked = ['south_america']
|
|
92
|
-
render(
|
|
93
|
-
<TreeView
|
|
94
|
-
checkedList={checked}
|
|
95
|
-
onCheck={() => void(0)}
|
|
96
|
-
nodes={countryNodes}
|
|
97
|
-
/>
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
const nodes = screen.getAllByRole('treeitem')
|
|
101
|
-
const checkBox = nodes[0].getElementsByTagName('input')[0]
|
|
102
|
-
|
|
103
|
-
expect(checkBox).toBeChecked()
|
|
104
|
-
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('Should Rende the Tree with a Title', async () => {
|
|
108
|
-
render(
|
|
109
|
-
<TreeView
|
|
110
|
-
nodes={countryNodes}
|
|
111
|
-
checkedList={[]}
|
|
112
|
-
onCheck={() => void(0)}
|
|
113
|
-
title="Tree Node Selection"
|
|
114
|
-
/>
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const tree = screen.getByText('Tree Node Selection')
|
|
119
|
-
expect(tree).toBeInTheDocument()
|
|
120
|
-
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
it('Should Return Checked values on Check', async () => {
|
|
124
|
-
const handleCheck = jest.fn()
|
|
125
|
-
|
|
126
|
-
const { container } = render(
|
|
127
|
-
<TreeView
|
|
128
|
-
nodes={countryNodes}
|
|
129
|
-
onCheck={handleCheck}
|
|
130
|
-
checkedList={[]}
|
|
131
|
-
title="Tree Node Selection"
|
|
132
|
-
/>
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
const checkBox = container.getElementsByTagName('input')[1]
|
|
136
|
-
|
|
137
|
-
fireEvent(checkBox, new MouseEvent('click', {
|
|
138
|
-
bubbles: true,
|
|
139
|
-
cancelable: true,
|
|
140
|
-
}),)
|
|
141
|
-
|
|
142
|
-
expect(handleCheck).toBeCalled()
|
|
143
|
-
expect(handleCheck).toBeCalledWith(['canada', 'usa', 'mexico'], {'checked': true, 'label': 'North America', 'value': 'north_america'})
|
|
144
|
-
|
|
145
|
-
})
|
|
146
|
-
})
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { defaultTo, FC, is, isDefined, isEmpty, maybeRender, Nothing, PropsWithChildren } from '@helpers'
|
|
2
|
-
import { TreeNode } from './components/tree-node'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
|
-
import { Margin, Padding } from '@foundations'
|
|
5
|
-
import { ICheckNode, IExpandNode, INode, IFlattenNode, ITreeViewProps } from './types'
|
|
6
|
-
import { useMemo, useState } from 'react'
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
flattenNodes,
|
|
10
|
-
deserializeList,
|
|
11
|
-
getNode,
|
|
12
|
-
toggleChecked,
|
|
13
|
-
serializeList,
|
|
14
|
-
toggleNode,
|
|
15
|
-
getNodeCheckState
|
|
16
|
-
} from './helper'
|
|
17
|
-
|
|
18
|
-
import { Card } from 'components/card'
|
|
19
|
-
|
|
20
|
-
const ParentNode = styled.ol`
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
gap: 8px;
|
|
24
|
-
margin: ${Margin.none};
|
|
25
|
-
padding-left: ${Padding.none};
|
|
26
|
-
list-style-type: none;
|
|
27
|
-
& ol {
|
|
28
|
-
padding-left: ${Padding.l};
|
|
29
|
-
}
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
const Container = styled.div<{useCardContainer: boolean}>`
|
|
33
|
-
display: block;
|
|
34
|
-
margin: ${Margin.none};
|
|
35
|
-
padding: ${({ useCardContainer }) => useCardContainer
|
|
36
|
-
? Padding.none
|
|
37
|
-
: Padding.xs
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
`
|
|
41
|
-
|
|
42
|
-
export const TreeView: FC<PropsWithChildren<ITreeViewProps>> = (props) => {
|
|
43
|
-
|
|
44
|
-
const {
|
|
45
|
-
checkedList = [],
|
|
46
|
-
expanded = [],
|
|
47
|
-
title,
|
|
48
|
-
nodes,
|
|
49
|
-
className,
|
|
50
|
-
showChildCount = false,
|
|
51
|
-
useCardContainer = true,
|
|
52
|
-
} = props
|
|
53
|
-
|
|
54
|
-
const [expandedList, setExpandedList] = useState<string[]>(expanded)
|
|
55
|
-
const treeId = new Date().getTime().toString()
|
|
56
|
-
|
|
57
|
-
const flattenNodeList: IFlattenNode[] = useMemo(() => {
|
|
58
|
-
const _nodeList:IFlattenNode[] = []
|
|
59
|
-
flattenNodes(_nodeList, nodes)
|
|
60
|
-
|
|
61
|
-
deserializeList(_nodeList, {
|
|
62
|
-
checked: checkedList,
|
|
63
|
-
expanded: expandedList,
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
return _nodeList
|
|
67
|
-
}, [nodes])
|
|
68
|
-
|
|
69
|
-
const handleOnCheck = (nodeInfo: ICheckNode): void => {
|
|
70
|
-
const { onCheck } = props
|
|
71
|
-
|
|
72
|
-
toggleChecked(flattenNodeList, nodeInfo, nodeInfo.checked)
|
|
73
|
-
if (isDefined(onCheck)) {
|
|
74
|
-
onCheck(serializeList(flattenNodeList, 'checked'), { ...nodeInfo })
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const handleOnExpand = (nodeInfo: IExpandNode): void => {
|
|
79
|
-
const { onExpand } = props
|
|
80
|
-
|
|
81
|
-
toggleNode(flattenNodeList, nodeInfo.value, 'expanded', nodeInfo.expanded)
|
|
82
|
-
if (isDefined(onExpand)) {
|
|
83
|
-
onExpand(serializeList(flattenNodeList, 'expanded'), {...nodeInfo })
|
|
84
|
-
}
|
|
85
|
-
setExpandedList(serializeList(flattenNodeList, 'expanded'))
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const onNodeClick = (nodeInfo: ICheckNode): void => {
|
|
89
|
-
const { onClick } = props
|
|
90
|
-
const node = getNode(flattenNodeList, nodeInfo.value)
|
|
91
|
-
if (isDefined(onClick)) {
|
|
92
|
-
onClick({ ...node, ...nodeInfo })
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const renderTreeNodes = (nodeList: INode[], parent?: INode): JSX.Element => {
|
|
97
|
-
const {
|
|
98
|
-
expandDisabled = false,
|
|
99
|
-
} = props
|
|
100
|
-
|
|
101
|
-
const treeNodes = nodeList.map((node: INode) => {
|
|
102
|
-
const flatNode = getNode(flattenNodeList, node.value)
|
|
103
|
-
|
|
104
|
-
const children = is(flatNode?.isParent)
|
|
105
|
-
? renderTreeNodes(defaultTo(node.children, []), node)
|
|
106
|
-
: <Nothing key={node.value}/>
|
|
107
|
-
|
|
108
|
-
if (isDefined(flatNode)) {
|
|
109
|
-
flatNode.checkState = getNodeCheckState(flattenNodeList, node)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const parentExpanded = isDefined(parent) && isDefined(parent.value)
|
|
113
|
-
? getNode(flattenNodeList, parent.value)?.expanded
|
|
114
|
-
: true
|
|
115
|
-
|
|
116
|
-
if (!is(parentExpanded)) {
|
|
117
|
-
return <Nothing key={node.value}/>
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<TreeNode
|
|
122
|
-
key={node.value}
|
|
123
|
-
checkState={defaultTo(flatNode?.checkState, 0)}
|
|
124
|
-
disabled={is(flatNode?.disabled)}
|
|
125
|
-
expandDisabled={expandDisabled}
|
|
126
|
-
expanded={is(flatNode?.expanded)}
|
|
127
|
-
label={node.label}
|
|
128
|
-
isLeaf={is(flatNode?.isLeaf)}
|
|
129
|
-
isParent={is(flatNode?.isParent)}
|
|
130
|
-
treeId={treeId}
|
|
131
|
-
invalid={defaultTo(node.invalid, false)}
|
|
132
|
-
value={node.value}
|
|
133
|
-
showChildCount={showChildCount}
|
|
134
|
-
childCount={defaultTo(flatNode?.children?.length, 0)}
|
|
135
|
-
helpfulMessage={node.helpfulMessage}
|
|
136
|
-
onClick={onNodeClick}
|
|
137
|
-
onCheck={handleOnCheck}
|
|
138
|
-
onExpand={handleOnExpand}
|
|
139
|
-
>
|
|
140
|
-
{ children }
|
|
141
|
-
</TreeNode>
|
|
142
|
-
)
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<ParentNode role="tree" className='tree-view'>
|
|
147
|
-
{ treeNodes }
|
|
148
|
-
</ParentNode>
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const renderTree = (): JSX.Element => {
|
|
153
|
-
return useCardContainer ?
|
|
154
|
-
<Card heading={title}>
|
|
155
|
-
<Card.Section>
|
|
156
|
-
<Container className={className} id={treeId} useCardContainer>
|
|
157
|
-
{ renderTreeNodes(nodes) }
|
|
158
|
-
</Container>
|
|
159
|
-
</Card.Section>
|
|
160
|
-
</Card>
|
|
161
|
-
:
|
|
162
|
-
<Container className={className} id={treeId} useCardContainer={false}>
|
|
163
|
-
{ renderTreeNodes(nodes) }
|
|
164
|
-
</Container>
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return maybeRender(!isEmpty(nodes), renderTree())
|
|
168
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react'
|
|
2
|
-
|
|
3
|
-
export interface INode {
|
|
4
|
-
label: string
|
|
5
|
-
value: string
|
|
6
|
-
helpfulMessage?: string
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
invalid?: boolean
|
|
9
|
-
children?: INode[]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IFlattenNode extends INode {
|
|
13
|
-
parent?: INode
|
|
14
|
-
isChild: boolean
|
|
15
|
-
isParent: boolean
|
|
16
|
-
isLeaf: boolean
|
|
17
|
-
treeDepth: number
|
|
18
|
-
index: number
|
|
19
|
-
checked: boolean
|
|
20
|
-
checkState: number
|
|
21
|
-
expanded: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ITreeViewProps {
|
|
25
|
-
checkedList: string[]
|
|
26
|
-
nodes: INode[]
|
|
27
|
-
expanded?: string[]
|
|
28
|
-
className?: string
|
|
29
|
-
title?: string
|
|
30
|
-
useCardContainer?: boolean
|
|
31
|
-
showChildCount?: boolean
|
|
32
|
-
expandDisabled?: boolean
|
|
33
|
-
onCheck: (checked: string[], node?: ICheckNode) => void;
|
|
34
|
-
onClick?: (node: ICheckNode) => void;
|
|
35
|
-
onExpand?: (expanded: string[], node?: IExpandNode) => void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ITreeNode {
|
|
39
|
-
checkState: number
|
|
40
|
-
disabled: boolean
|
|
41
|
-
expanded: boolean
|
|
42
|
-
isParent: boolean
|
|
43
|
-
isLeaf: boolean
|
|
44
|
-
expandDisabled: boolean
|
|
45
|
-
label: string
|
|
46
|
-
value: string
|
|
47
|
-
children: ReactNode
|
|
48
|
-
treeId: string
|
|
49
|
-
invalid: boolean
|
|
50
|
-
childCount: number
|
|
51
|
-
showChildCount: boolean
|
|
52
|
-
helpfulMessage?: string
|
|
53
|
-
onCheck: (node: ICheckNode) => void;
|
|
54
|
-
onClick: (node: ICheckNode) => void;
|
|
55
|
-
onExpand: (node: IExpandNode) => void;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ICheckNode extends INode {
|
|
59
|
-
checked: boolean
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface IExpandNode extends INode {
|
|
63
|
-
expanded: boolean
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export enum CheckboxState {
|
|
67
|
-
UNCHECKED,
|
|
68
|
-
CHECKED,
|
|
69
|
-
INDETERMINATE,
|
|
70
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './typography'
|