@digigov/ui 1.2.0-a7ffb5dc → 2.0.0-4be8f7cc
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/app/Footer/index.mdx +18 -5
- package/app/Header/index.mdx +7 -5
- package/app/Masthead/index.mdx +9 -4
- package/app/Modal/auto.d.ts +2 -2
- package/app/Modal/index.d.ts +2 -2
- package/app/Modal/index.js +1 -1
- package/app/Modal/index.mdx +11 -4
- package/app/NotFound/index.mdx +2 -0
- package/app/Panel/index.mdx +9 -4
- package/app/PhaseBannerHeader/index.mdx +4 -4
- package/app/QrCodeViewer/QRCode.stories.d.ts +1 -0
- package/app/QrCodeViewer/index.d.ts +1 -0
- package/app/QrCodeViewer/index.js +2 -1
- package/app/QrCodeViewer/index.mdx +4 -4
- package/app/Skeleton/Skeleton.stories/index.js +16 -0
- package/{utils/Kitchensink/AllComponents → app/Skeleton/Skeleton.stories}/package.json +1 -1
- package/app/Skeleton/Skeleton.stories.d.ts +17 -0
- package/app/Skeleton/__stories__/Button/index.js +9 -0
- package/{utils/Kitchensink/KitchensinkByLetter → app/Skeleton/__stories__/Button}/package.json +1 -1
- package/app/Skeleton/__stories__/Button.d.ts +3 -0
- package/app/Skeleton/__stories__/Circular/index.js +11 -0
- package/{utils/Kitchensink/KitchensinkComponent → app/Skeleton/__stories__/Circular}/package.json +1 -1
- package/app/Skeleton/__stories__/Circular.d.ts +3 -0
- package/app/Skeleton/__stories__/Default/index.js +7 -0
- package/app/Skeleton/__stories__/Default/package.json +6 -0
- package/app/Skeleton/__stories__/Default.d.ts +3 -0
- package/app/Skeleton/__stories__/NoAnimation/index.js +9 -0
- package/{utils/Kitchensink/KitchensinkByCategory → app/Skeleton/__stories__/NoAnimation}/package.json +1 -1
- package/app/Skeleton/__stories__/NoAnimation.d.ts +3 -0
- package/app/Skeleton/__stories__/Rectangular/index.js +10 -0
- package/app/Skeleton/__stories__/Rectangular/package.json +6 -0
- package/app/Skeleton/__stories__/Rectangular.d.ts +3 -0
- package/app/Skeleton/__stories__/SpecificWidthAndHeight/index.js +10 -0
- package/app/Skeleton/__stories__/SpecificWidthAndHeight/package.json +6 -0
- package/app/Skeleton/__stories__/SpecificWidthAndHeight.d.ts +3 -0
- package/app/Skeleton/__stories__/UnderTypography/index.js +10 -0
- package/{form/AutoComplete/__stories__/WithInLine → app/Skeleton/__stories__/UnderTypography}/package.json +1 -1
- package/app/Skeleton/__stories__/UnderTypography.d.ts +3 -0
- package/app/Skeleton/__stories__/WithChildren/index.js +8 -0
- package/app/Skeleton/__stories__/WithChildren/package.json +6 -0
- package/app/Skeleton/__stories__/WithChildren.d.ts +3 -0
- package/app/Skeleton/index.d.ts +3 -0
- package/app/Skeleton/index.js +3 -0
- package/{misc/KitchenSink → app/Skeleton}/package.json +1 -1
- package/app/ThemeOptions/index.d.ts +2 -2
- package/cjs/app/Footer/index.mdx +18 -5
- package/cjs/app/Header/index.mdx +7 -5
- package/cjs/app/Masthead/index.mdx +9 -4
- package/cjs/app/Modal/index.js +1 -1
- package/cjs/app/Modal/index.mdx +11 -4
- package/cjs/app/NotFound/index.mdx +2 -0
- package/cjs/app/Panel/index.mdx +9 -4
- package/cjs/app/PhaseBannerHeader/index.mdx +4 -4
- package/cjs/app/QrCodeViewer/index.js +3 -2
- package/cjs/app/QrCodeViewer/index.mdx +4 -4
- package/cjs/app/Skeleton/Skeleton.stories/index.js +111 -0
- package/cjs/app/Skeleton/__stories__/Button/index.js +16 -0
- package/cjs/app/Skeleton/__stories__/Circular/index.js +18 -0
- package/cjs/app/Skeleton/__stories__/Default/index.js +14 -0
- package/cjs/app/Skeleton/__stories__/NoAnimation/index.js +16 -0
- package/cjs/app/Skeleton/__stories__/Rectangular/index.js +17 -0
- package/cjs/app/Skeleton/__stories__/SpecificWidthAndHeight/index.js +17 -0
- package/cjs/app/Skeleton/__stories__/UnderTypography/index.js +17 -0
- package/cjs/app/Skeleton/__stories__/WithChildren/index.js +15 -0
- package/cjs/app/Skeleton/index.js +23 -0
- package/cjs/content/Accordion/__stories__/Auto/index.js +2 -3
- package/cjs/content/Accordion/hooks/index.js +0 -1
- package/cjs/content/Accordion/index.mdx +9 -5
- package/cjs/content/Blockquote/index.mdx +3 -5
- package/cjs/content/Card/index.mdx +3 -5
- package/cjs/content/Chip/index.mdx +4 -5
- package/cjs/content/Details/index.mdx +3 -5
- package/cjs/content/List/__stories__/Default/index.js +1 -2
- package/cjs/content/List/index.mdx +3 -5
- package/cjs/content/SafeHTML/index.js +5 -8
- package/cjs/content/StepNav/index.mdx +28 -5
- package/cjs/content/SummaryList/index.mdx +10 -5
- package/cjs/content/Table/index.js +2 -2
- package/cjs/content/Table/index.mdx +13 -14
- package/cjs/content/TaskList/index.mdx +9 -5
- package/cjs/content/Timeline/index.mdx +10 -5
- package/cjs/feedback/CopyToClipboard/index.mdx +3 -5
- package/cjs/feedback/ErrorSummary/index.mdx +3 -5
- package/cjs/feedback/NotificationBanner/index.mdx +14 -5
- package/cjs/feedback/PhaseBanner/index.mdx +8 -5
- package/cjs/feedback/WarningText/index.mdx +5 -5
- package/cjs/form/AutoComplete/AutoComplete.stories/index.js +44 -8
- package/cjs/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/cjs/form/AutoComplete/Status/index.js +12 -5
- package/cjs/form/AutoComplete/__stories__/Multiple/index.js +24 -0
- package/cjs/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +7 -6
- package/cjs/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +23 -0
- package/cjs/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +26 -0
- package/cjs/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
- package/cjs/form/AutoComplete/index.js +312 -202
- package/cjs/form/AutoComplete/index.mdx +13 -20
- package/cjs/form/AutoComplete/utils/index.js +2 -1
- package/cjs/form/Button/index.mdx +3 -5
- package/cjs/form/Checkbox/index.mdx +3 -5
- package/cjs/form/DateInputContainer/index.mdx +3 -5
- package/cjs/form/ErrorMessage/index.mdx +3 -5
- package/cjs/form/FileUpload/index.mdx +3 -5
- package/cjs/form/RadioContainer/index.mdx +2 -14
- package/cjs/form/SelectContainer/index.mdx +3 -1
- package/cjs/form/SingleCharacterInputs/index.mdx +3 -5
- package/cjs/form/TextArea/index.mdx +3 -5
- package/cjs/form/TextInput/TextInput.stories/index.js +12 -0
- package/cjs/form/TextInput/__stories__/DisabledInputWithValue/index.js +31 -0
- package/cjs/form/TextInput/index.mdx +3 -5
- package/cjs/govgr/Footer/index.mdx +1 -1
- package/cjs/i18n/locales/el/index.js +2 -2
- package/cjs/i18n/locales/en/index.js +2 -2
- package/cjs/layouts/Basic/Bottom/__stories__/Default/index.js +22 -0
- package/cjs/layouts/Basic/Bottom/index.mdx +9 -28
- package/cjs/layouts/Basic/Container/__stories__/Default/index.js +20 -0
- package/cjs/layouts/Basic/Container/index.mdx +23 -0
- package/cjs/layouts/Basic/Main/__stories__/Default/index.js +20 -0
- package/cjs/layouts/Basic/Main/index.mdx +10 -47
- package/cjs/layouts/Basic/Top/__stories__/Default/index.js +20 -0
- package/cjs/layouts/Basic/Top/index.mdx +10 -55
- package/cjs/layouts/Basic/index.mdx +27 -25
- package/cjs/layouts/Grid/index.mdx +39 -0
- package/cjs/lazy/index.js +152 -134
- package/cjs/navigation/BackLink/index.mdx +4 -5
- package/cjs/navigation/Breadcrumbs/index.mdx +6 -5
- package/cjs/navigation/Drawer/index.mdx +4 -10
- package/cjs/navigation/Dropdown/Dropdown.stories/index.js +12 -0
- package/cjs/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/cjs/navigation/Dropdown/__stories__/ScrollableContent/index.js +68 -0
- package/cjs/navigation/Dropdown/index.mdx +3 -5
- package/cjs/navigation/Link/index.mdx +5 -15
- package/cjs/navigation/NavList/__stories__/Default/index.js +14 -2
- package/cjs/navigation/NavList/__stories__/HorizontalWithDrawer/index.js +35 -2
- package/cjs/navigation/NavList/__stories__/HorizontalWithoutDrawer/index.js +35 -2
- package/cjs/navigation/NavList/__stories__/NavListWithoutNav/index.js +14 -2
- package/cjs/navigation/NavList/__stories__/UsingNavListAuto/index.js +37 -4
- package/cjs/navigation/NavList/__stories__/Vertical/index.js +14 -2
- package/cjs/navigation/NavList/__stories__/VerticalWithoutDrawer/index.js +35 -2
- package/cjs/navigation/NavList/index.mdx +23 -7
- package/cjs/navigation/Pagination/__stories__/PaginationWithSmallFont/index.js +2 -2
- package/cjs/navigation/Pagination/__stories__/WithResultsPerPage/index.js +2 -2
- package/cjs/navigation/Pagination/index.mdx +9 -5
- package/cjs/navigation/Tabs/index.mdx +9 -5
- package/cjs/registry/index.js +6 -12
- package/cjs/typography/Heading/index.mdx +3 -5
- package/cjs/typography/HeadingCaption/index.mdx +3 -5
- package/cjs/typography/Hint/index.mdx +3 -5
- package/cjs/typography/NormalText/index.mdx +3 -5
- package/cjs/typography/Paragraph/index.mdx +9 -30
- package/cjs/typography/Typography/index.js +23 -0
- package/cjs/typography/Typography/index.mdx +12 -0
- package/cjs/typography/index.js +11 -0
- package/cjs/utils/Base/index.mdx +13 -0
- package/cjs/utils/VisuallyHidden/index.mdx +10 -5
- package/content/Accordion/__stories__/Auto/index.js +2 -3
- package/content/Accordion/auto.d.ts +3 -3
- package/content/Accordion/hooks/index.js +0 -1
- package/content/Accordion/index.mdx +9 -5
- package/content/Blockquote/index.mdx +3 -5
- package/content/Card/index.mdx +3 -5
- package/content/Chip/index.mdx +4 -5
- package/content/Details/index.mdx +3 -5
- package/content/List/__stories__/Default/index.js +1 -2
- package/content/List/index.mdx +3 -5
- package/content/SafeHTML/index.d.ts +1 -1
- package/content/SafeHTML/index.js +5 -8
- package/content/StepNav/auto.d.ts +3 -3
- package/content/StepNav/index.mdx +28 -5
- package/content/SummaryList/index.mdx +10 -5
- package/content/Table/index.d.ts +1 -1
- package/content/Table/index.js +2 -2
- package/content/Table/index.mdx +13 -14
- package/content/TaskList/index.mdx +9 -5
- package/content/Timeline/index.mdx +10 -5
- package/feedback/CopyToClipboard/index.d.ts +1 -1
- package/feedback/CopyToClipboard/index.mdx +3 -5
- package/feedback/ErrorSummary/index.mdx +3 -5
- package/feedback/NotificationBanner/index.mdx +14 -5
- package/feedback/PhaseBanner/index.mdx +8 -5
- package/feedback/WarningText/index.mdx +5 -5
- package/form/AutoComplete/AutoComplete.stories/index.js +4 -1
- package/form/AutoComplete/AutoComplete.stories.d.ts +4 -1
- package/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/form/AutoComplete/Status/index.d.ts +4 -2
- package/form/AutoComplete/Status/index.js +11 -4
- package/form/AutoComplete/__stories__/Multiple/index.js +17 -0
- package/form/AutoComplete/__stories__/Multiple/package.json +6 -0
- package/form/AutoComplete/__stories__/Multiple.d.ts +3 -0
- package/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +6 -5
- package/form/AutoComplete/__stories__/MultipleShowingTwoSelected/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleShowingTwoSelected.d.ts +3 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +16 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues.d.ts +3 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +19 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength.d.ts +3 -0
- package/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
- package/form/AutoComplete/index.d.ts +12 -18
- package/form/AutoComplete/index.js +295 -197
- package/form/AutoComplete/index.mdx +13 -20
- package/form/AutoComplete/utils/index.js +2 -1
- package/form/AutoComplete/utils.d.ts +1 -0
- package/form/Button/index.mdx +3 -5
- package/form/Checkbox/index.mdx +3 -5
- package/form/DateInputContainer/index.mdx +3 -5
- package/form/ErrorMessage/index.mdx +3 -5
- package/form/FileUpload/index.mdx +3 -5
- package/form/RadioContainer/index.mdx +2 -14
- package/form/SelectContainer/index.mdx +3 -1
- package/form/SingleCharacterInputs/index.mdx +3 -5
- package/form/TextArea/index.mdx +3 -5
- package/form/TextInput/TextInput.stories/index.js +1 -0
- package/form/TextInput/TextInput.stories.d.ts +1 -0
- package/form/TextInput/__stories__/DisabledInputWithValue/index.js +25 -0
- package/form/TextInput/__stories__/DisabledInputWithValue/package.json +6 -0
- package/form/TextInput/__stories__/DisabledInputWithValue.d.ts +3 -0
- package/form/TextInput/index.mdx +3 -5
- package/govgr/Footer/index.mdx +1 -1
- package/i18n/locales/el/index.js +2 -2
- package/i18n/locales/en/index.js +2 -2
- package/index.js +1 -1
- package/layouts/Basic/Bottom/__stories__/Default/index.js +15 -0
- package/layouts/Basic/Bottom/__stories__/Default/package.json +6 -0
- package/layouts/Basic/Bottom/__stories__/Default.d.ts +3 -0
- package/layouts/Basic/Bottom/index.mdx +9 -28
- package/layouts/Basic/Container/__stories__/Default/index.js +13 -0
- package/layouts/Basic/Container/__stories__/Default/package.json +6 -0
- package/layouts/Basic/Container/__stories__/Default.d.ts +3 -0
- package/layouts/Basic/Container/index.mdx +23 -0
- package/layouts/Basic/Main/__stories__/Default/index.js +13 -0
- package/layouts/Basic/Main/__stories__/Default/package.json +6 -0
- package/layouts/Basic/Main/__stories__/Default.d.ts +3 -0
- package/layouts/Basic/Main/index.mdx +10 -47
- package/layouts/Basic/Top/__stories__/Default/index.js +13 -0
- package/layouts/Basic/Top/__stories__/Default/package.json +6 -0
- package/layouts/Basic/Top/__stories__/Default.d.ts +3 -0
- package/layouts/Basic/Top/index.mdx +10 -55
- package/layouts/Basic/index.mdx +27 -25
- package/layouts/Grid/index.mdx +39 -0
- package/lazy/index.js +120 -106
- package/lazy.d.ts +269 -267
- package/navigation/BackLink/index.mdx +4 -5
- package/navigation/Breadcrumbs/index.mdx +6 -5
- package/navigation/Drawer/auto.d.ts +3 -3
- package/navigation/Drawer/index.mdx +4 -10
- package/navigation/Dropdown/Dropdown.stories/index.js +1 -0
- package/navigation/Dropdown/Dropdown.stories.d.ts +1 -0
- package/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/navigation/Dropdown/__stories__/ScrollableContent/index.js +61 -0
- package/navigation/Dropdown/__stories__/ScrollableContent/package.json +6 -0
- package/navigation/Dropdown/__stories__/ScrollableContent.d.ts +3 -0
- package/navigation/Dropdown/index.d.ts +1 -1
- package/navigation/Dropdown/index.mdx +3 -5
- package/navigation/Link/index.mdx +5 -15
- package/navigation/NavList/__stories__/Default/index.js +13 -1
- package/navigation/NavList/__stories__/HorizontalWithDrawer/index.js +34 -1
- package/navigation/NavList/__stories__/HorizontalWithoutDrawer/index.js +34 -1
- package/navigation/NavList/__stories__/NavListWithoutNav/index.js +13 -1
- package/navigation/NavList/__stories__/UsingNavListAuto/index.js +35 -2
- package/navigation/NavList/__stories__/Vertical/index.js +13 -1
- package/navigation/NavList/__stories__/VerticalWithoutDrawer/index.js +34 -1
- package/navigation/NavList/index.mdx +23 -7
- package/navigation/NavList/types.d.ts +1 -2
- package/navigation/Pagination/__stories__/PaginationWithSmallFont/index.js +1 -1
- package/navigation/Pagination/__stories__/WithResultsPerPage/index.js +1 -1
- package/navigation/Pagination/auto.d.ts +4 -4
- package/navigation/Pagination/index.d.ts +2 -2
- package/navigation/Pagination/index.mdx +9 -5
- package/navigation/Tabs/auto.d.ts +2 -2
- package/navigation/Tabs/index.mdx +9 -5
- package/package.json +4 -6
- package/registry/index.js +6 -12
- package/registry.d.ts +4 -6
- package/src/app/Footer/index.mdx +18 -5
- package/src/app/Header/index.mdx +7 -5
- package/src/app/Masthead/index.mdx +9 -4
- package/src/app/Modal/index.mdx +11 -4
- package/src/app/Modal/index.tsx +1 -1
- package/src/app/NotFound/index.mdx +2 -0
- package/src/app/Panel/index.mdx +9 -4
- package/src/app/PhaseBannerHeader/index.mdx +4 -4
- package/src/app/QrCodeViewer/index.mdx +4 -4
- package/src/app/QrCodeViewer/index.tsx +2 -0
- package/src/app/Skeleton/Skeleton.stories.js +18 -0
- package/src/app/Skeleton/__stories__/Button.tsx +6 -0
- package/src/app/Skeleton/__stories__/Circular.tsx +8 -0
- package/src/app/Skeleton/__stories__/Default.tsx +6 -0
- package/src/app/Skeleton/__stories__/NoAnimation.tsx +6 -0
- package/src/app/Skeleton/__stories__/Rectangular.tsx +8 -0
- package/src/app/Skeleton/__stories__/SpecificWidthAndHeight.tsx +8 -0
- package/src/app/Skeleton/__stories__/UnderTypography.tsx +17 -0
- package/src/app/Skeleton/__stories__/WithChildren.tsx +11 -0
- package/src/app/Skeleton/index.tsx +4 -0
- package/src/app/ThemeOptions/index.tsx +1 -1
- package/src/content/Accordion/__stories__/Auto.tsx +2 -2
- package/src/content/Accordion/auto.tsx +1 -1
- package/src/content/Accordion/hooks.ts +0 -1
- package/src/content/Accordion/index.mdx +9 -5
- package/src/content/Blockquote/index.mdx +3 -5
- package/src/content/Card/index.mdx +3 -5
- package/src/content/Chip/index.mdx +4 -5
- package/src/content/Details/index.mdx +3 -5
- package/src/content/List/__stories__/Default.tsx +3 -4
- package/src/content/List/index.mdx +3 -5
- package/src/content/SafeHTML/index.tsx +3 -4
- package/src/content/StepNav/index.mdx +28 -5
- package/src/content/SummaryList/index.mdx +10 -5
- package/src/content/Table/index.mdx +13 -14
- package/src/content/Table/index.tsx +2 -2
- package/src/content/TaskList/index.mdx +9 -5
- package/src/content/Timeline/index.mdx +10 -5
- package/src/feedback/CopyToClipboard/index.mdx +3 -5
- package/src/feedback/ErrorSummary/index.mdx +3 -5
- package/src/feedback/NotificationBanner/index.mdx +14 -5
- package/src/feedback/PhaseBanner/index.mdx +8 -5
- package/src/feedback/WarningText/index.mdx +5 -5
- package/src/form/AutoComplete/AutoComplete.stories.js +4 -1
- package/src/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/src/form/AutoComplete/Status/index.tsx +10 -6
- package/src/form/AutoComplete/__stories__/Multiple.tsx +18 -0
- package/src/form/AutoComplete/__stories__/{WithInLine.tsx → MultipleShowingTwoSelected.tsx} +3 -8
- package/src/form/AutoComplete/__stories__/MultipleWithDefaultValues.tsx +16 -0
- package/src/form/AutoComplete/__stories__/MultipleWithMinLength.tsx +29 -0
- package/src/form/AutoComplete/__stories__/WithShowAllValues.tsx +0 -1
- package/src/form/AutoComplete/index.mdx +13 -20
- package/src/form/AutoComplete/index.tsx +351 -213
- package/src/form/AutoComplete/utils.ts +3 -2
- package/src/form/Button/index.mdx +3 -5
- package/src/form/Checkbox/index.mdx +3 -5
- package/src/form/DateInputContainer/index.mdx +3 -5
- package/src/form/ErrorMessage/index.mdx +3 -5
- package/src/form/FileUpload/index.mdx +3 -5
- package/src/form/RadioContainer/index.mdx +2 -14
- package/src/form/SelectContainer/index.mdx +3 -1
- package/src/form/SingleCharacterInputs/index.mdx +3 -5
- package/src/form/TextArea/index.mdx +3 -5
- package/src/form/TextInput/TextInput.stories.js +1 -0
- package/src/form/TextInput/__stories__/DisabledInputWithValue.tsx +27 -0
- package/src/form/TextInput/index.mdx +3 -5
- package/src/govgr/Footer/index.mdx +1 -1
- package/src/i18n/locales/el.ts +2 -2
- package/src/i18n/locales/en.ts +2 -2
- package/src/layouts/Basic/Bottom/__stories__/Default.tsx +35 -0
- package/src/layouts/Basic/Bottom/index.mdx +9 -28
- package/src/layouts/Basic/Container/__stories__/Default.tsx +30 -0
- package/src/layouts/Basic/Container/index.mdx +23 -0
- package/src/layouts/Basic/Main/__stories__/Default.tsx +30 -0
- package/src/layouts/Basic/Main/index.mdx +10 -47
- package/src/layouts/Basic/Top/__stories__/Default.tsx +28 -0
- package/src/layouts/Basic/Top/index.mdx +10 -55
- package/src/layouts/Basic/index.mdx +27 -25
- package/src/layouts/Grid/index.mdx +39 -0
- package/src/lazy.js +18 -16
- package/src/navigation/BackLink/index.mdx +4 -5
- package/src/navigation/Breadcrumbs/index.mdx +6 -5
- package/src/navigation/Drawer/index.mdx +4 -10
- package/src/navigation/Dropdown/Dropdown.stories.js +1 -0
- package/src/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/src/navigation/Dropdown/__stories__/ScrollableContent.tsx +82 -0
- package/src/navigation/Dropdown/index.mdx +3 -5
- package/src/navigation/Link/index.mdx +5 -15
- package/src/navigation/NavList/__stories__/Default.tsx +18 -1
- package/src/navigation/NavList/__stories__/HorizontalWithDrawer.tsx +37 -1
- package/src/navigation/NavList/__stories__/HorizontalWithoutDrawer.tsx +37 -1
- package/src/navigation/NavList/__stories__/NavListWithoutNav.tsx +18 -1
- package/src/navigation/NavList/__stories__/UsingNavListAuto.tsx +39 -2
- package/src/navigation/NavList/__stories__/Vertical.tsx +18 -1
- package/src/navigation/NavList/__stories__/VerticalWithoutDrawer.tsx +37 -1
- package/src/navigation/NavList/index.mdx +23 -7
- package/src/navigation/NavList/types.tsx +1 -2
- package/src/navigation/Pagination/__stories__/PaginationWithSmallFont.tsx +1 -1
- package/src/navigation/Pagination/__stories__/WithResultsPerPage.tsx +1 -1
- package/src/navigation/Pagination/index.mdx +9 -5
- package/src/navigation/Tabs/index.mdx +9 -5
- package/src/registry.js +6 -12
- package/src/typography/Heading/index.mdx +3 -5
- package/src/typography/HeadingCaption/index.mdx +3 -5
- package/src/typography/Hint/index.mdx +3 -5
- package/src/typography/NormalText/index.mdx +3 -5
- package/src/typography/Paragraph/index.mdx +9 -30
- package/src/typography/Typography/index.mdx +12 -0
- package/src/typography/Typography/index.tsx +4 -0
- package/src/typography/index.ts +1 -0
- package/src/utils/Base/index.mdx +13 -0
- package/src/utils/VisuallyHidden/index.mdx +10 -5
- package/typography/Heading/index.mdx +3 -5
- package/typography/HeadingCaption/index.mdx +3 -5
- package/typography/Hint/index.mdx +3 -5
- package/typography/NormalText/index.mdx +3 -5
- package/typography/Paragraph/index.mdx +9 -30
- package/typography/Typography/index.d.ts +3 -0
- package/typography/Typography/index.js +3 -0
- package/typography/Typography/index.mdx +12 -0
- package/typography/Typography/package.json +6 -0
- package/typography/index.d.ts +1 -0
- package/typography/index.js +2 -1
- package/utils/Base/index.mdx +13 -0
- package/utils/VisuallyHidden/index.mdx +10 -5
- package/cjs/content/List/List.stories.playwright.json +0 -27
- package/cjs/layouts/Basic/Masthead/index.mdx +0 -65
- package/cjs/misc/KitchenSink/index.js +0 -93
- package/cjs/utils/Kitchensink/AllComponents/index.js +0 -16
- package/cjs/utils/Kitchensink/KitchensinkByCategory/index.js +0 -39
- package/cjs/utils/Kitchensink/KitchensinkByLetter/index.js +0 -26
- package/cjs/utils/Kitchensink/KitchensinkComponent/index.js +0 -55
- package/cjs/utils/Kitchensink/KitchensinkDashboard/index.js +0 -47
- package/content/List/List.stories.playwright.json +0 -27
- package/form/AutoComplete/__stories__/WithInLine.d.ts +0 -3
- package/layouts/Basic/Masthead/index.mdx +0 -65
- package/misc/KitchenSink/index.d.ts +0 -8
- package/misc/KitchenSink/index.js +0 -8
- package/src/content/List/List.stories.playwright.json +0 -27
- package/src/layouts/Basic/Masthead/index.mdx +0 -65
- package/src/misc/KitchenSink/index.tsx +0 -8
- package/src/utils/Kitchensink/AllComponents.tsx +0 -6
- package/src/utils/Kitchensink/KitchensinkByCategory.tsx +0 -56
- package/src/utils/Kitchensink/KitchensinkByLetter.tsx +0 -35
- package/src/utils/Kitchensink/KitchensinkComponent.tsx +0 -70
- package/src/utils/Kitchensink/KitchensinkDashboard.tsx +0 -56
- package/utils/Kitchensink/AllComponents/index.js +0 -9
- package/utils/Kitchensink/AllComponents.d.ts +0 -2
- package/utils/Kitchensink/KitchensinkByCategory/index.js +0 -32
- package/utils/Kitchensink/KitchensinkByCategory.d.ts +0 -6
- package/utils/Kitchensink/KitchensinkByLetter/index.js +0 -19
- package/utils/Kitchensink/KitchensinkByLetter.d.ts +0 -6
- package/utils/Kitchensink/KitchensinkComponent/index.js +0 -45
- package/utils/Kitchensink/KitchensinkComponent.d.ts +0 -10
- package/utils/Kitchensink/KitchensinkDashboard/index.js +0 -40
- package/utils/Kitchensink/KitchensinkDashboard/package.json +0 -6
- package/utils/Kitchensink/KitchensinkDashboard.d.ts +0 -5
|
@@ -12,6 +12,12 @@ Object.defineProperty(exports, "AutoCompleteAssistiveHint", {
|
|
|
12
12
|
return _AutoCompleteAssistiveHint["default"];
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
Object.defineProperty(exports, "AutoCompleteContainer", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _AutoCompleteContainer["default"];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
15
21
|
Object.defineProperty(exports, "AutoCompleteInput", {
|
|
16
22
|
enumerable: true,
|
|
17
23
|
get: function get() {
|
|
@@ -24,22 +30,28 @@ Object.defineProperty(exports, "AutoCompleteInputTypeahead", {
|
|
|
24
30
|
return _AutoCompleteInputTypeahead["default"];
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
|
-
Object.defineProperty(exports, "
|
|
33
|
+
Object.defineProperty(exports, "AutoCompleteMultipleInput", {
|
|
28
34
|
enumerable: true,
|
|
29
35
|
get: function get() {
|
|
30
|
-
return
|
|
36
|
+
return _AutoCompleteMultipleInput["default"];
|
|
31
37
|
}
|
|
32
38
|
});
|
|
33
|
-
Object.defineProperty(exports, "
|
|
39
|
+
Object.defineProperty(exports, "AutoCompleteMultipleInputContainer", {
|
|
34
40
|
enumerable: true,
|
|
35
41
|
get: function get() {
|
|
36
|
-
return
|
|
42
|
+
return _AutoCompleteMultipleInputContainer["default"];
|
|
37
43
|
}
|
|
38
44
|
});
|
|
39
|
-
Object.defineProperty(exports, "
|
|
45
|
+
Object.defineProperty(exports, "AutoCompleteResultList", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function get() {
|
|
48
|
+
return _AutoCompleteResultList["default"];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "AutoCompleteResultListItem", {
|
|
40
52
|
enumerable: true,
|
|
41
53
|
get: function get() {
|
|
42
|
-
return
|
|
54
|
+
return _AutoCompleteResultListItem["default"];
|
|
43
55
|
}
|
|
44
56
|
});
|
|
45
57
|
exports["default"] = void 0;
|
|
@@ -56,14 +68,28 @@ var _AutoCompleteInput = _interopRequireDefault(require("@digigov/react-core/cjs
|
|
|
56
68
|
var _AutoCompleteInputTypeahead = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteInputTypeahead"));
|
|
57
69
|
var _AutoCompleteResultList = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteResultList"));
|
|
58
70
|
var _AutoCompleteResultListItem = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteResultListItem"));
|
|
59
|
-
var
|
|
71
|
+
var _AutoCompleteContainer = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteContainer"));
|
|
72
|
+
var _AutoCompleteMultipleInputContainer = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteMultipleInputContainer"));
|
|
73
|
+
var _AutoCompleteMultipleInput = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteMultipleInput"));
|
|
60
74
|
var _CaretIcon = require("@digigov/react-icons/cjs/CaretIcon");
|
|
61
75
|
var _Status = _interopRequireDefault(require("@digigov/ui/form/AutoComplete/Status"));
|
|
62
76
|
var _utils = require("@digigov/ui/form/AutoComplete/utils");
|
|
77
|
+
var _Checkbox = _interopRequireWildcard(require("../Checkbox"));
|
|
78
|
+
var _Chip = require("@digigov/ui/content/Chip");
|
|
79
|
+
var _Button = _interopRequireDefault(require("@digigov/ui/form/Button"));
|
|
80
|
+
var _NormalText = require("@digigov/ui/typography/NormalText");
|
|
63
81
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
64
82
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
65
83
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
66
84
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
85
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, {
|
|
86
|
+
direction: "down",
|
|
87
|
+
size: "md"
|
|
88
|
+
});
|
|
89
|
+
var _ref3 = /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, {
|
|
90
|
+
direction: "down",
|
|
91
|
+
size: "md"
|
|
92
|
+
});
|
|
67
93
|
var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
68
94
|
(0, _inherits2["default"])(AutoComplete, _Component);
|
|
69
95
|
function AutoComplete(props) {
|
|
@@ -72,32 +98,41 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
72
98
|
_this = _callSuper(this, AutoComplete, [props]);
|
|
73
99
|
_this.elementReferences = {};
|
|
74
100
|
_this.$pollInput = void 0;
|
|
75
|
-
|
|
101
|
+
var customState = {};
|
|
102
|
+
if (Array.isArray(props.defaultValue)) {
|
|
103
|
+
customState.selectedValues = props.defaultValue;
|
|
104
|
+
} else if (props.defaultValue) {
|
|
105
|
+
customState.selectedValues = [props.defaultValue];
|
|
106
|
+
}
|
|
107
|
+
_this.state = (0, _extends2["default"])({
|
|
76
108
|
focused: null,
|
|
77
109
|
hovered: null,
|
|
78
110
|
menuOpen: false,
|
|
79
|
-
options:
|
|
80
|
-
query: props.defaultValue,
|
|
111
|
+
options: [],
|
|
112
|
+
query: _this.props.multiple ? '' : props.defaultValue || '',
|
|
113
|
+
selectedValues: [],
|
|
81
114
|
validChoiceMade: false,
|
|
82
115
|
selected: null,
|
|
83
116
|
ariaHint: true
|
|
84
|
-
};
|
|
117
|
+
}, customState);
|
|
85
118
|
_this.handleComponentBlur = _this.handleComponentBlur.bind((0, _assertThisInitialized2["default"])(_this));
|
|
119
|
+
_this.handleAutoCompleteBlur = _this.handleAutoCompleteBlur.bind((0, _assertThisInitialized2["default"])(_this));
|
|
86
120
|
_this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2["default"])(_this));
|
|
87
121
|
_this.handleUpArrow = _this.handleUpArrow.bind((0, _assertThisInitialized2["default"])(_this));
|
|
88
122
|
_this.handleDownArrow = _this.handleDownArrow.bind((0, _assertThisInitialized2["default"])(_this));
|
|
89
123
|
_this.handleEnter = _this.handleEnter.bind((0, _assertThisInitialized2["default"])(_this));
|
|
90
124
|
_this.handlePrintableKey = _this.handlePrintableKey.bind((0, _assertThisInitialized2["default"])(_this));
|
|
91
125
|
_this.handleListMouseLeave = _this.handleListMouseLeave.bind((0, _assertThisInitialized2["default"])(_this));
|
|
92
|
-
|
|
93
|
-
|
|
126
|
+
if (_this.props.multiple) {
|
|
127
|
+
_this.handleOptionClick = _this.handleOptionClickMultiple.bind((0, _assertThisInitialized2["default"])(_this));
|
|
128
|
+
} else {
|
|
129
|
+
_this.handleOptionClick = _this.handleOptionClick.bind((0, _assertThisInitialized2["default"])(_this));
|
|
130
|
+
}
|
|
94
131
|
_this.handleOptionFocus = _this.handleOptionFocus.bind((0, _assertThisInitialized2["default"])(_this));
|
|
95
132
|
_this.handleOptionMouseDown = _this.handleOptionMouseDown.bind((0, _assertThisInitialized2["default"])(_this));
|
|
96
133
|
_this.handleOptionMouseEnter = _this.handleOptionMouseEnter.bind((0, _assertThisInitialized2["default"])(_this));
|
|
97
|
-
_this.handleInputBlur = _this.handleInputBlur.bind((0, _assertThisInitialized2["default"])(_this));
|
|
98
134
|
_this.handleInputChange = _this.handleInputChange.bind((0, _assertThisInitialized2["default"])(_this));
|
|
99
135
|
_this.handleInputFocus = _this.handleInputFocus.bind((0, _assertThisInitialized2["default"])(_this));
|
|
100
|
-
_this.pollInputElement = _this.pollInputElement.bind((0, _assertThisInitialized2["default"])(_this));
|
|
101
136
|
_this.getDirectInputChanges = _this.getDirectInputChanges.bind((0, _assertThisInitialized2["default"])(_this));
|
|
102
137
|
return _this;
|
|
103
138
|
}
|
|
@@ -112,32 +147,14 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
112
147
|
}, {
|
|
113
148
|
key: "componentDidMount",
|
|
114
149
|
value: function componentDidMount() {
|
|
115
|
-
this.pollInputElement();
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "componentWillUnmount",
|
|
119
|
-
value: function componentWillUnmount() {
|
|
120
|
-
clearTimeout(this.$pollInput);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Applications like Dragon NaturallySpeaking will modify the
|
|
124
|
-
// `input` field by directly changing its `.value`. These events
|
|
125
|
-
// don't trigger our JavaScript event listeners, so we need to poll
|
|
126
|
-
// to handle when and if they occur.
|
|
127
|
-
}, {
|
|
128
|
-
key: "pollInputElement",
|
|
129
|
-
value: function pollInputElement() {
|
|
130
|
-
var _this3 = this;
|
|
131
150
|
this.getDirectInputChanges();
|
|
132
|
-
this.$pollInput = setTimeout(function () {
|
|
133
|
-
_this3.pollInputElement();
|
|
134
|
-
}, 100);
|
|
135
151
|
}
|
|
136
152
|
}, {
|
|
137
153
|
key: "getDirectInputChanges",
|
|
138
154
|
value: function getDirectInputChanges() {
|
|
155
|
+
var _this$state$query;
|
|
139
156
|
var inputReference = this.elementReferences[-1];
|
|
140
|
-
var queryHasChanged = inputReference && inputReference.value !== this.state.query;
|
|
157
|
+
var queryHasChanged = inputReference && inputReference.value !== ((_this$state$query = this.state.query) !== null && _this$state$query !== void 0 ? _this$state$query : '');
|
|
141
158
|
if (queryHasChanged) {
|
|
142
159
|
this.handleInputChange({
|
|
143
160
|
target: {
|
|
@@ -183,7 +200,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
183
200
|
key: "templateSuggestion",
|
|
184
201
|
value: function templateSuggestion(value) {
|
|
185
202
|
var suggestionTemplate = this.props.templates && this.props.templates.suggestion;
|
|
186
|
-
return suggestionTemplate ? suggestionTemplate(value) : value;
|
|
203
|
+
return suggestionTemplate ? suggestionTemplate(value, this.state.query) : value;
|
|
187
204
|
}
|
|
188
205
|
}, {
|
|
189
206
|
key: "handleComponentBlur",
|
|
@@ -195,14 +212,14 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
195
212
|
var newQuery;
|
|
196
213
|
if (this.props.confirmOnBlur) {
|
|
197
214
|
var _this$props$onConfirm, _this$props;
|
|
198
|
-
newQuery = newState.query || query;
|
|
215
|
+
newQuery = (newState === null || newState === void 0 ? void 0 : newState.query) || query;
|
|
199
216
|
(_this$props$onConfirm = (_this$props = this.props).onConfirm) === null || _this$props$onConfirm === void 0 ? void 0 : _this$props$onConfirm.call(_this$props, options[selected]);
|
|
200
217
|
} else {
|
|
201
218
|
newQuery = query;
|
|
202
219
|
}
|
|
203
220
|
this.setState({
|
|
204
221
|
focused: null,
|
|
205
|
-
menuOpen: newState.menuOpen || false,
|
|
222
|
+
menuOpen: (newState === null || newState === void 0 ? void 0 : newState.menuOpen) || false,
|
|
206
223
|
query: newQuery,
|
|
207
224
|
selected: null,
|
|
208
225
|
validChoiceMade: this.isQueryAnOption(newQuery, options)
|
|
@@ -216,40 +233,33 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
216
233
|
});
|
|
217
234
|
}
|
|
218
235
|
}, {
|
|
219
|
-
key: "
|
|
220
|
-
value: function
|
|
236
|
+
key: "handleAutoCompleteBlur",
|
|
237
|
+
value: function handleAutoCompleteBlur(event, index) {
|
|
221
238
|
var _this$state2 = this.state,
|
|
222
239
|
focused = _this$state2.focused,
|
|
223
|
-
menuOpen = _this$state2.menuOpen,
|
|
224
240
|
options = _this$state2.options,
|
|
241
|
+
query = _this$state2.query,
|
|
225
242
|
selected = _this$state2.selected;
|
|
226
|
-
var focusingOutsideComponent =
|
|
243
|
+
var focusingOutsideComponent = false;
|
|
244
|
+
if (event.relatedTarget === null) {
|
|
245
|
+
focusingOutsideComponent = true;
|
|
246
|
+
} else {
|
|
247
|
+
// This affects if we have multiple autocompletes in same page and we click the first button-arrow and then another button-arrow
|
|
248
|
+
focusingOutsideComponent = this.elementReferences['button-arrow'] !== event.relatedTarget;
|
|
249
|
+
}
|
|
227
250
|
var focusingInput = event.relatedTarget === this.elementReferences[-1];
|
|
228
|
-
var
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
this.handleComponentBlur({
|
|
233
|
-
menuOpen: keepMenuOpen,
|
|
234
|
-
query: this.templateInputValue(options[selected])
|
|
235
|
-
});
|
|
251
|
+
var focusingButtonArrow = this.elementReferences['button-arrow'] === event.relatedTarget || false;
|
|
252
|
+
var focusingAnotherOption = focused !== null && focused !== -1;
|
|
253
|
+
if (index !== undefined) {
|
|
254
|
+
focusingAnotherOption = focused !== index && focused !== -1;
|
|
236
255
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
var _this$state3 = this.state,
|
|
242
|
-
focused = _this$state3.focused,
|
|
243
|
-
menuOpen = _this$state3.menuOpen,
|
|
244
|
-
options = _this$state3.options,
|
|
245
|
-
query = _this$state3.query,
|
|
246
|
-
selected = _this$state3.selected;
|
|
247
|
-
var focusingAnOption = focused !== -1;
|
|
248
|
-
if (!focusingAnOption) {
|
|
249
|
-
var keepMenuOpen = menuOpen && (0, _utils.isIosDevice)();
|
|
256
|
+
// Check if the user clicks outside and not either on option, either on input or on button arrow
|
|
257
|
+
var blurComponent = focusingOutsideComponent && !(focusingAnotherOption || focusingInput || focusingButtonArrow);
|
|
258
|
+
if (blurComponent) {
|
|
259
|
+
// In handleInputBlur:
|
|
250
260
|
var newQuery = (0, _utils.isIosDevice)() ? query : this.templateInputValue(options[selected]);
|
|
251
261
|
this.handleComponentBlur({
|
|
252
|
-
menuOpen:
|
|
262
|
+
menuOpen: false,
|
|
253
263
|
query: newQuery
|
|
254
264
|
});
|
|
255
265
|
}
|
|
@@ -257,37 +267,27 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
257
267
|
}, {
|
|
258
268
|
key: "handleInputChange",
|
|
259
269
|
value: function handleInputChange(event) {
|
|
260
|
-
var
|
|
270
|
+
var _this3 = this;
|
|
261
271
|
var _this$props2 = this.props,
|
|
262
|
-
minLength = _this$props2.minLength,
|
|
263
272
|
source = _this$props2.source,
|
|
264
|
-
|
|
273
|
+
minLength = _this$props2.minLength;
|
|
265
274
|
var autoselect = this.hasAutoselect();
|
|
266
275
|
var query = event.target.value;
|
|
267
276
|
var queryEmpty = query.length === 0;
|
|
268
|
-
var queryChanged = this.state.query.length !== query.length;
|
|
269
|
-
var queryLongEnough = query.length >= minLength;
|
|
270
277
|
this.setState({
|
|
271
278
|
query: query,
|
|
272
279
|
ariaHint: queryEmpty
|
|
273
280
|
});
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
validChoiceMade: false
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
} else if (queryEmpty || !queryLongEnough) {
|
|
286
|
-
this.setState({
|
|
287
|
-
menuOpen: false,
|
|
288
|
-
options: []
|
|
281
|
+
var minLengthQuery = minLength != undefined && minLength > query.length ? '' : query;
|
|
282
|
+
source(minLengthQuery, function (options) {
|
|
283
|
+
var optionsAvailable = options.length > 0;
|
|
284
|
+
_this3.setState({
|
|
285
|
+
menuOpen: optionsAvailable,
|
|
286
|
+
options: options,
|
|
287
|
+
selected: autoselect && optionsAvailable ? 0 : -1,
|
|
288
|
+
validChoiceMade: false
|
|
289
289
|
});
|
|
290
|
-
}
|
|
290
|
+
});
|
|
291
291
|
}
|
|
292
292
|
}, {
|
|
293
293
|
key: "handleInputClick",
|
|
@@ -297,10 +297,12 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
297
297
|
}, {
|
|
298
298
|
key: "handleInputFocus",
|
|
299
299
|
value: function handleInputFocus() {
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
var _this4 = this;
|
|
301
|
+
var source = this.props.source;
|
|
302
|
+
var _this$state3 = this.state,
|
|
303
|
+
query = _this$state3.query,
|
|
304
|
+
validChoiceMade = _this$state3.validChoiceMade,
|
|
305
|
+
options = _this$state3.options;
|
|
304
306
|
var minLength = this.props.minLength;
|
|
305
307
|
var shouldReopenMenu = !validChoiceMade && query.length >= minLength && options.length > 0;
|
|
306
308
|
if (shouldReopenMenu) {
|
|
@@ -313,8 +315,11 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
313
315
|
};
|
|
314
316
|
});
|
|
315
317
|
} else {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
source(query, function (options) {
|
|
319
|
+
_this4.setState({
|
|
320
|
+
focused: -1,
|
|
321
|
+
options: options
|
|
322
|
+
});
|
|
318
323
|
});
|
|
319
324
|
}
|
|
320
325
|
}
|
|
@@ -338,18 +343,43 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
338
343
|
});
|
|
339
344
|
}
|
|
340
345
|
}
|
|
346
|
+
}, {
|
|
347
|
+
key: "handleOptionClickMultiple",
|
|
348
|
+
value: function handleOptionClickMultiple(index) {
|
|
349
|
+
var _this$props$onConfirm2, _this$props3;
|
|
350
|
+
var selectedOption = this.state.options[index];
|
|
351
|
+
var selectedValues = this.state.selectedValues;
|
|
352
|
+
if (this.state.selectedValues.indexOf(selectedOption) === -1) {
|
|
353
|
+
selectedValues = selectedValues.concat([selectedOption]);
|
|
354
|
+
} else {
|
|
355
|
+
selectedValues.splice(this.state.selectedValues.indexOf(selectedOption), 1);
|
|
356
|
+
}
|
|
357
|
+
(_this$props$onConfirm2 = (_this$props3 = this.props).onConfirm) === null || _this$props$onConfirm2 === void 0 ? void 0 : _this$props$onConfirm2.call(_this$props3, selectedValues);
|
|
358
|
+
this.setState({
|
|
359
|
+
focused: index,
|
|
360
|
+
hovered: null,
|
|
361
|
+
menuOpen: true,
|
|
362
|
+
query: '',
|
|
363
|
+
selectedValues: selectedValues,
|
|
364
|
+
selected: index,
|
|
365
|
+
validChoiceMade: true
|
|
366
|
+
});
|
|
367
|
+
this.forceUpdate();
|
|
368
|
+
}
|
|
341
369
|
}, {
|
|
342
370
|
key: "handleOptionClick",
|
|
343
371
|
value: function handleOptionClick(index) {
|
|
344
|
-
var _this$props$
|
|
372
|
+
var _this$props$onConfirm3, _this$props4;
|
|
345
373
|
var selectedOption = this.state.options[index];
|
|
346
374
|
var newQuery = this.templateInputValue(selectedOption);
|
|
347
|
-
(_this$props$
|
|
375
|
+
(_this$props$onConfirm3 = (_this$props4 = this.props).onConfirm) === null || _this$props$onConfirm3 === void 0 ? void 0 : _this$props$onConfirm3.call(_this$props4, selectedOption);
|
|
376
|
+
var selectedValues = this.props.multiple ? this.state.selectedValues.concat(selectedOption) : [selectedOption];
|
|
348
377
|
this.setState({
|
|
349
378
|
focused: -1,
|
|
350
379
|
hovered: null,
|
|
351
380
|
menuOpen: false,
|
|
352
381
|
query: newQuery,
|
|
382
|
+
selectedValues: selectedValues,
|
|
353
383
|
selected: -1,
|
|
354
384
|
validChoiceMade: true
|
|
355
385
|
});
|
|
@@ -370,9 +400,9 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
370
400
|
key: "handleUpArrow",
|
|
371
401
|
value: function handleUpArrow(event) {
|
|
372
402
|
event.preventDefault();
|
|
373
|
-
var _this$
|
|
374
|
-
menuOpen = _this$
|
|
375
|
-
selected = _this$
|
|
403
|
+
var _this$state4 = this.state,
|
|
404
|
+
menuOpen = _this$state4.menuOpen,
|
|
405
|
+
selected = _this$state4.selected;
|
|
376
406
|
var isNotAtTop = selected !== -1;
|
|
377
407
|
var allowMoveUp = isNotAtTop && menuOpen;
|
|
378
408
|
if (allowMoveUp) {
|
|
@@ -385,7 +415,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
385
415
|
var _this5 = this;
|
|
386
416
|
event.preventDefault();
|
|
387
417
|
// if not open, open
|
|
388
|
-
if (this.
|
|
418
|
+
if (this.state.menuOpen === false) {
|
|
389
419
|
event.preventDefault();
|
|
390
420
|
this.props.source('', function (options) {
|
|
391
421
|
_this5.setState({
|
|
@@ -397,10 +427,10 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
397
427
|
});
|
|
398
428
|
});
|
|
399
429
|
} else if (this.state.menuOpen === true) {
|
|
400
|
-
var _this$
|
|
401
|
-
menuOpen = _this$
|
|
402
|
-
_options = _this$
|
|
403
|
-
selected = _this$
|
|
430
|
+
var _this$state5 = this.state,
|
|
431
|
+
menuOpen = _this$state5.menuOpen,
|
|
432
|
+
_options = _this$state5.options,
|
|
433
|
+
selected = _this$state5.selected;
|
|
404
434
|
var isNotAtBottom = selected !== _options.length - 1;
|
|
405
435
|
var allowMoveDown = isNotAtBottom && menuOpen;
|
|
406
436
|
if (allowMoveDown) {
|
|
@@ -413,7 +443,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
413
443
|
value: function handleSpace(event) {
|
|
414
444
|
var _this6 = this;
|
|
415
445
|
// if not open, open
|
|
416
|
-
if (this.
|
|
446
|
+
if (this.state.menuOpen === false && this.state.query === '') {
|
|
417
447
|
event.preventDefault();
|
|
418
448
|
this.props.source('', function (options) {
|
|
419
449
|
_this6.setState({
|
|
@@ -436,6 +466,12 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
436
466
|
var hasSelectedOption = this.state.selected >= 0;
|
|
437
467
|
if (hasSelectedOption) {
|
|
438
468
|
this.handleOptionClick(this.state.selected);
|
|
469
|
+
if (this.props.multiple) {
|
|
470
|
+
this.setState({
|
|
471
|
+
menuOpen: false,
|
|
472
|
+
focused: -1
|
|
473
|
+
});
|
|
474
|
+
}
|
|
439
475
|
}
|
|
440
476
|
}
|
|
441
477
|
}
|
|
@@ -472,6 +508,15 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
472
508
|
query: this.state.query
|
|
473
509
|
});
|
|
474
510
|
break;
|
|
511
|
+
case 'backspace':
|
|
512
|
+
if (this.props.multiple) {
|
|
513
|
+
if (this.state.query.length === 0) {
|
|
514
|
+
this.setState({
|
|
515
|
+
selectedValues: this.state.selectedValues.slice(0, -1)
|
|
516
|
+
});
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
475
520
|
default:
|
|
476
521
|
if ((0, _utils.isPrintableKeyCode)(event.keyCode)) {
|
|
477
522
|
this.handlePrintableKey(event);
|
|
@@ -482,40 +527,39 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
482
527
|
}, {
|
|
483
528
|
key: "render",
|
|
484
529
|
value: function render() {
|
|
485
|
-
var
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
minLength = _this$
|
|
491
|
-
name = _this$
|
|
492
|
-
placeholder = _this$
|
|
493
|
-
required = _this$
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
var _this$
|
|
503
|
-
focused = _this$
|
|
504
|
-
hovered = _this$
|
|
505
|
-
menuOpen = _this$
|
|
506
|
-
options = _this$
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
validChoiceMade = _this$state7.validChoiceMade;
|
|
530
|
+
var _this$state$query2,
|
|
531
|
+
_this7 = this;
|
|
532
|
+
var _this$props5 = this.props,
|
|
533
|
+
id = _this$props5.id,
|
|
534
|
+
width = _this$props5.width,
|
|
535
|
+
minLength = _this$props5.minLength,
|
|
536
|
+
name = _this$props5.name,
|
|
537
|
+
placeholder = _this$props5.placeholder,
|
|
538
|
+
required = _this$props5.required,
|
|
539
|
+
tNoResults = _this$props5.tNoResults,
|
|
540
|
+
tStatusQueryTooShort = _this$props5.tStatusQueryTooShort,
|
|
541
|
+
tStatusNoResults = _this$props5.tStatusNoResults,
|
|
542
|
+
tStatusSelectedOption = _this$props5.tStatusSelectedOption,
|
|
543
|
+
tStatusResults = _this$props5.tStatusResults,
|
|
544
|
+
tAssistiveHint = _this$props5.tAssistiveHint,
|
|
545
|
+
multiple = _this$props5.multiple,
|
|
546
|
+
source = _this$props5.source;
|
|
547
|
+
var _this$state6 = this.state,
|
|
548
|
+
focused = _this$state6.focused,
|
|
549
|
+
hovered = _this$state6.hovered,
|
|
550
|
+
menuOpen = _this$state6.menuOpen,
|
|
551
|
+
options = _this$state6.options,
|
|
552
|
+
selected = _this$state6.selected,
|
|
553
|
+
ariaHint = _this$state6.ariaHint,
|
|
554
|
+
validChoiceMade = _this$state6.validChoiceMade;
|
|
511
555
|
var autoselect = this.hasAutoselect();
|
|
556
|
+
var query = (_this$state$query2 = this.state.query) !== null && _this$state$query2 !== void 0 ? _this$state$query2 : '';
|
|
512
557
|
var inputFocused = focused === -1;
|
|
513
558
|
var noOptionsAvailable = options.length === 0;
|
|
514
559
|
var queryNotEmpty = query.length !== 0;
|
|
515
560
|
var queryLongEnough = query.length >= minLength;
|
|
516
|
-
var showNoOptionsFound =
|
|
561
|
+
var showNoOptionsFound = inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;
|
|
517
562
|
var componentIsFocused = focused !== null;
|
|
518
|
-
var dropdownArrowClassName = "ds-autocomplete__dropdown-arrow-down";
|
|
519
563
|
var optionFocused = focused !== -1 && focused !== null;
|
|
520
564
|
var menuIsVisible = menuOpen || showNoOptionsFound;
|
|
521
565
|
var selectedOptionText = this.templateInputValue(options[selected]);
|
|
@@ -525,7 +569,57 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
525
569
|
var ariaDescribedProp = ariaHint ? {
|
|
526
570
|
'aria-describedby': assistiveHintID
|
|
527
571
|
} : null;
|
|
528
|
-
|
|
572
|
+
var showAutoCompleteResultListItems = function showAutoCompleteResultListItems(options, multiple) {
|
|
573
|
+
{
|
|
574
|
+
return options.map(function (option, index) {
|
|
575
|
+
var showFocused = focused === -1 ? selected === index : focused === index;
|
|
576
|
+
var iosPosinsetHtml = (0, _utils.isIosDevice)() ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
577
|
+
id: "".concat(id, "__option-suffix--").concat(index),
|
|
578
|
+
style: {
|
|
579
|
+
border: '0',
|
|
580
|
+
clip: 'rect(0 0 0 0)',
|
|
581
|
+
height: '1px',
|
|
582
|
+
marginBottom: '-1px',
|
|
583
|
+
marginRight: '-1px',
|
|
584
|
+
overflow: 'hidden',
|
|
585
|
+
padding: '0',
|
|
586
|
+
position: 'absolute',
|
|
587
|
+
whiteSpace: 'nowrap',
|
|
588
|
+
width: '1px'
|
|
589
|
+
}
|
|
590
|
+
}, index + 1, " \u03B1\u03C0\u03CC ", options.length) : '';
|
|
591
|
+
return /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
|
|
592
|
+
isFocused: showFocused,
|
|
593
|
+
isHovered: hovered,
|
|
594
|
+
index: index,
|
|
595
|
+
"aria-selected": focused === index ? 'true' : 'false',
|
|
596
|
+
key: index,
|
|
597
|
+
onBlur: function onBlur(event) {
|
|
598
|
+
return _this7.handleAutoCompleteBlur(event, index);
|
|
599
|
+
},
|
|
600
|
+
onClick: function onClick() {
|
|
601
|
+
return _this7.handleOptionClick(index);
|
|
602
|
+
},
|
|
603
|
+
onMouseDown: _this7.handleOptionMouseDown,
|
|
604
|
+
onMouseEnter: function onMouseEnter() {
|
|
605
|
+
return _this7.handleOptionMouseEnter(index);
|
|
606
|
+
},
|
|
607
|
+
ref: function ref(optionEl) {
|
|
608
|
+
_this7.elementReferences[index] = optionEl;
|
|
609
|
+
},
|
|
610
|
+
role: "option",
|
|
611
|
+
tabIndex: -1,
|
|
612
|
+
"aria-posinset": index + 1,
|
|
613
|
+
"aria-setsize": options.length
|
|
614
|
+
}, multiple ? /*#__PURE__*/_react["default"].createElement(_Checkbox.CheckboxItem, {
|
|
615
|
+
value: option,
|
|
616
|
+
checked: _this7.state.selectedValues.includes(option),
|
|
617
|
+
onChange: function onChange() {}
|
|
618
|
+
}, _this7.templateSuggestion(option)) : _this7.templateSuggestion(option), iosPosinsetHtml);
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
return /*#__PURE__*/_react["default"].createElement(_AutoCompleteContainer["default"], {
|
|
529
623
|
onKeyDown: this.handleKeyDown,
|
|
530
624
|
width: width
|
|
531
625
|
}, /*#__PURE__*/_react["default"].createElement(_Status["default"], {
|
|
@@ -541,22 +635,41 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
541
635
|
tNoResults: tStatusNoResults,
|
|
542
636
|
tSelectedOption: tStatusSelectedOption,
|
|
543
637
|
tResults: tStatusResults
|
|
544
|
-
}), hintValue && /*#__PURE__*/_react["default"].createElement(_AutoCompleteInputTypeahead["default"], {
|
|
638
|
+
}), hintValue && (placeholder === '' || !placeholder) && /*#__PURE__*/_react["default"].createElement(_AutoCompleteInputTypeahead["default"], {
|
|
545
639
|
value: hintValue
|
|
546
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
640
|
+
}), multiple ? /*#__PURE__*/_react["default"].createElement(_AutoCompleteMultipleInputContainer["default"], {
|
|
641
|
+
isFocused: componentIsFocused,
|
|
642
|
+
numberOfSelected: this.props.numberOfSelected
|
|
643
|
+
}, /*#__PURE__*/_react["default"].createElement(_Chip.ChipContainer, null, this.state.selectedValues.map(function (value) {
|
|
644
|
+
return /*#__PURE__*/_react["default"].createElement(_Chip.Chip, {
|
|
645
|
+
key: value,
|
|
646
|
+
onDelete: function onDelete() {
|
|
647
|
+
_this7.setState({
|
|
648
|
+
selectedValues: _this7.state.selectedValues.filter(function (v) {
|
|
649
|
+
return v !== value;
|
|
650
|
+
})
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
}, value);
|
|
654
|
+
}), !componentIsFocused && typeof this.props.numberOfSelected === 'number' && this.state.selectedValues.length > this.props.numberOfSelected && /*#__PURE__*/_react["default"].createElement(_NormalText.NormalText, {
|
|
655
|
+
fontWeight: "bold",
|
|
656
|
+
margin: 0
|
|
657
|
+
}, "+", this.state.selectedValues.length - this.props.numberOfSelected)), /*#__PURE__*/_react["default"].createElement(_AutoCompleteMultipleInput["default"], (0, _extends2["default"])({
|
|
547
658
|
"aria-expanded": menuOpen ? 'true' : 'false',
|
|
548
659
|
"aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
|
|
549
660
|
"aria-owns": "".concat(id, "__listbox"),
|
|
550
661
|
"aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
|
|
551
662
|
}, ariaDescribedProp, {
|
|
552
|
-
autoComplete: "off"
|
|
553
|
-
isFocused
|
|
554
|
-
|
|
663
|
+
autoComplete: "off"
|
|
664
|
+
// isFocused={componentIsFocused}
|
|
665
|
+
,
|
|
555
666
|
id: id,
|
|
556
667
|
onClick: function onClick(event) {
|
|
557
668
|
return _this7.handleInputClick(event);
|
|
558
669
|
},
|
|
559
|
-
onBlur:
|
|
670
|
+
onBlur: function onBlur(event) {
|
|
671
|
+
return _this7.handleAutoCompleteBlur(event);
|
|
672
|
+
},
|
|
560
673
|
onChange: this.handleInputChange,
|
|
561
674
|
onFocus: this.handleInputFocus,
|
|
562
675
|
name: name,
|
|
@@ -567,80 +680,85 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
|
|
|
567
680
|
role: "combobox",
|
|
568
681
|
required: required,
|
|
569
682
|
value: query
|
|
570
|
-
})),
|
|
571
|
-
|
|
683
|
+
})), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
684
|
+
ref: function ref(buttonElement) {
|
|
685
|
+
_this7.elementReferences['button-arrow'] = buttonElement;
|
|
686
|
+
},
|
|
687
|
+
variant: "link",
|
|
572
688
|
onClick: function onClick() {
|
|
573
|
-
_this7.
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
689
|
+
if (!_this7.state.menuOpen) {
|
|
690
|
+
source(query, function (options) {
|
|
691
|
+
var optionsAvailable = options.length > 0;
|
|
692
|
+
_this7.setState({
|
|
693
|
+
menuOpen: optionsAvailable,
|
|
694
|
+
options: options,
|
|
695
|
+
selected: autoselect && optionsAvailable ? 0 : -1,
|
|
696
|
+
validChoiceMade: false
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
} else {
|
|
700
|
+
_this7.setState({
|
|
701
|
+
menuOpen: false,
|
|
702
|
+
focused: null
|
|
703
|
+
});
|
|
704
|
+
}
|
|
579
705
|
},
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
706
|
+
onBlur: function onBlur(event) {
|
|
707
|
+
return _this7.handleAutoCompleteBlur(event);
|
|
708
|
+
}
|
|
709
|
+
}, _ref2), /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultList["default"], {
|
|
583
710
|
isVisible: menuIsVisible,
|
|
584
711
|
onMouseLeave: function onMouseLeave() {
|
|
585
712
|
return _this7.handleListMouseLeave();
|
|
586
713
|
},
|
|
587
714
|
id: "".concat(id, "__listbox"),
|
|
588
715
|
role: "listbox"
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
},
|
|
625
|
-
role: "option",
|
|
626
|
-
tabIndex: -1,
|
|
627
|
-
"aria-posinset": index + 1,
|
|
628
|
-
"aria-setsize": options.length
|
|
629
|
-
}, _this7.templateSuggestion(option), " ", iosPosinsetHtml);
|
|
630
|
-
}), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
|
|
716
|
+
}, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], null, showAutoCompleteResultListItems(options, multiple)), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
|
|
717
|
+
empty: true
|
|
718
|
+
}, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/_react["default"].createElement(_AutoCompleteAssistiveHint["default"], {
|
|
719
|
+
id: assistiveHintID
|
|
720
|
+
}, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_AutoCompleteInput["default"], (0, _extends2["default"])({
|
|
721
|
+
"aria-expanded": menuOpen ? 'true' : 'false',
|
|
722
|
+
"aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
|
|
723
|
+
"aria-owns": "".concat(id, "__listbox"),
|
|
724
|
+
"aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
|
|
725
|
+
}, ariaDescribedProp, {
|
|
726
|
+
autoComplete: "off",
|
|
727
|
+
isFocused: componentIsFocused,
|
|
728
|
+
id: id,
|
|
729
|
+
onClick: function onClick(event) {
|
|
730
|
+
return _this7.handleInputClick(event);
|
|
731
|
+
},
|
|
732
|
+
onBlur: this.handleAutoCompleteBlur,
|
|
733
|
+
onChange: this.handleInputChange,
|
|
734
|
+
onFocus: this.handleInputFocus,
|
|
735
|
+
name: name,
|
|
736
|
+
placeholder: placeholder,
|
|
737
|
+
ref: function ref(inputElement) {
|
|
738
|
+
_this7.elementReferences[-1] = inputElement;
|
|
739
|
+
},
|
|
740
|
+
role: "combobox",
|
|
741
|
+
required: required,
|
|
742
|
+
value: query
|
|
743
|
+
})), _ref3, /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultList["default"], {
|
|
744
|
+
isVisible: menuIsVisible,
|
|
745
|
+
onMouseLeave: function onMouseLeave() {
|
|
746
|
+
return _this7.handleListMouseLeave();
|
|
747
|
+
},
|
|
748
|
+
id: "".concat(id, "__listbox"),
|
|
749
|
+
role: "listbox"
|
|
750
|
+
}, showAutoCompleteResultListItems(options, false), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
|
|
631
751
|
empty: true
|
|
632
752
|
}, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/_react["default"].createElement(_AutoCompleteAssistiveHint["default"], {
|
|
633
753
|
id: assistiveHintID
|
|
634
|
-
}, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint()));
|
|
754
|
+
}, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())));
|
|
635
755
|
}
|
|
636
756
|
}]);
|
|
637
757
|
return AutoComplete;
|
|
638
758
|
}(_react.Component);
|
|
639
759
|
AutoComplete.defaultProps = {
|
|
640
|
-
width: '
|
|
760
|
+
width: 'full',
|
|
641
761
|
autoselect: false,
|
|
642
|
-
defaultValue: '',
|
|
643
|
-
displayMenu: 'overlay',
|
|
644
762
|
minLength: 0,
|
|
645
763
|
name: 'ds-input-autocomplete',
|
|
646
764
|
placeholder: '',
|
|
@@ -648,19 +766,11 @@ AutoComplete.defaultProps = {
|
|
|
648
766
|
return;
|
|
649
767
|
},
|
|
650
768
|
confirmOnBlur: false,
|
|
651
|
-
showNoOptionsFound: true,
|
|
652
|
-
showAllValues: false,
|
|
653
769
|
required: false,
|
|
654
770
|
tNoResults: function tNoResults() {
|
|
655
771
|
return 'No results found';
|
|
656
772
|
},
|
|
657
773
|
tAssistiveHint: function tAssistiveHint() {
|
|
658
774
|
return 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.';
|
|
659
|
-
},
|
|
660
|
-
dropdownArrow: function dropdownArrow(props) {
|
|
661
|
-
return /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, (0, _extends2["default"])({
|
|
662
|
-
direction: "down",
|
|
663
|
-
size: "sm"
|
|
664
|
-
}, props));
|
|
665
775
|
}
|
|
666
776
|
};
|