@mittwald/flow-react-components 1.4.0-next.1 → 1.4.0-next.11
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/MIGRATION.md +2 -1
- package/README.md +4 -0
- package/USAGE.md +29 -3
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_13.locale.mjs +5 -505
- package/dist/js/_virtual/_14.locale.mjs +505 -5
- package/dist/js/_virtual/_15.locale.mjs +9 -3
- package/dist/js/_virtual/_16.locale.mjs +3 -59
- package/dist/js/_virtual/_17.locale.mjs +63 -3
- package/dist/js/_virtual/_18.locale.mjs +3 -9
- package/dist/js/_virtual/_19.locale.mjs +5 -5
- package/dist/js/_virtual/_20.locale.mjs +5 -11
- package/dist/js/_virtual/_21.locale.mjs +15 -3
- package/dist/js/_virtual/_22.locale.mjs +3 -15
- package/dist/js/_virtual/_23.locale.mjs +15 -3
- package/dist/js/_virtual/_24.locale.mjs +3 -33
- package/dist/js/_virtual/_25.locale.mjs +29 -5
- package/dist/js/_virtual/_26.locale.mjs +9 -3
- package/dist/js/_virtual/_27.locale.mjs +3 -3
- package/dist/js/_virtual/_28.locale.mjs +3 -93
- package/dist/js/_virtual/_29.locale.mjs +93 -3
- package/dist/js/_virtual/_30.locale.mjs +3 -9
- package/dist/js/_virtual/_31.locale.mjs +5 -5
- package/dist/js/_virtual/_32.locale.mjs +5 -7
- package/dist/js/_virtual/_33.locale.mjs +7 -13
- package/dist/js/_virtual/_34.locale.mjs +23 -0
- package/dist/js/packages/components/src/components/Calendar/Calendar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs +1 -0
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.module.mjs +4 -2
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs +7 -3
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/lib/getColumns.mjs +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/lib/getColumns.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +9 -6
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.module.mjs +4 -2
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSelectAll/ContextMenuSelectAll.mjs +86 -0
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSelectAll/ContextMenuSelectAll.mjs.map +1 -0
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +1 -1
- package/dist/js/packages/components/src/components/FileCard/components/DeleteButton/DeleteButton.mjs +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +12 -3
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs +5 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ImageCropper/ImageCropper.mjs +1 -1
- package/dist/js/packages/components/src/components/Kbd/Kbd.mjs +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +33 -25
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.module.mjs +4 -2
- package/dist/js/packages/components/src/components/Label/Label.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/LightBoxGallery.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs +1 -1
- package/dist/js/packages/components/src/components/Link/components/LinkIcon/LinkIcon.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/EmptySearchResultView/EmptySearchResultView.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/EmptyView/EmptyView.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/Footer.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/components/PaginationInfos/PaginationInfos.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +3 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs +15 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.module.mjs +9 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +3 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +3 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.mjs +3 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterMenuItem.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterMenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/Filter.mjs +21 -0
- package/dist/js/packages/components/src/components/List/model/filter/Filter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/views/EmptyView/EmptyView.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ModeButton.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/useFileUpload.mjs +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +2 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +3 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs +4 -3
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Message/Message.mjs +1 -1
- package/dist/js/packages/components/src/components/MessageThread/components/MessageSeparator/MessageSeparator.mjs +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs +1 -1
- package/dist/js/packages/components/src/components/Notification/Notification.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/FallbackTab/FallbackTab.mjs +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +4 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +4 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +5 -0
- package/dist/types/components/ContextMenu/components/ContextMenuSelectAll/ContextMenuSelectAll.d.ts +7 -0
- package/dist/types/components/List/model/filter/Filter.d.ts +6 -0
- package/dist/types/components/List/typedList.d.ts +3 -3
- package/dist/types/components/MenuItem/MenuItem.d.ts +5 -0
- package/dist/types/components/MenuItem/components/MenuItemContent/MenuItemContent.d.ts +1 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +4 -0
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { IconContextMenu } from "../../../../../../../Icon/components/icons/IconContextMenu.mjs";
|
|
4
4
|
import { useLocalizedStringFormatter } from "../../../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
5
5
|
import ButtonView from "../../../../../../../../views/ButtonView.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../../../../../../_virtual/_17.locale.mjs";
|
|
7
7
|
import ContextMenuTriggerView from "../../../../../../../../views/ContextMenuTriggerView.mjs";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemView.module.mjs","names":[],"sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.module.scss"],"sourcesContent":[".view {\n display: flex;\n flex-direction: column;\n\n .checkboxContainer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n\n &:empty {\n display: none;\n }\n }\n\n .content {\n min-width: 0;\n display: flex;\n gap: var(--list-item--spacing);\n flex-grow: 1;\n flex-wrap: wrap;\n }\n\n .topContent {\n overflow-wrap: anywhere;\n display: flex;\n }\n\n .bottomContent {\n width: 100%;\n overflow-wrap: anywhere;\n display: flex;\n flex-direction: column;\n }\n\n .heading {\n color: var(--text--color--default);\n overflow-wrap: anywhere;\n }\n\n .header {\n overflow-wrap: anywhere;\n display: flex;\n gap: var(--list-item--avatar-to-title-spacing);\n max-width: 100%;\n }\n\n .subTitle {\n font-size: var(--list-item--subtitle-font-size);\n\n .text:not(:last-child)::after {\n content: \"–\";\n display: inline-block;\n margin: 0 var(--size-rem--s);\n }\n }\n\n .badge {\n max-width: 100%;\n }\n\n &.listView {\n padding: var(--list-item--padding);\n gap: var(--list-item--spacing);\n\n .columnLayout {\n flex-grow: 1;\n\n > :global(.flow--column-layout) {\n flex-grow: 1;\n align-items: center;\n }\n }\n\n .contentWrapper {\n display: flex;\n gap: var(--list-item--spacing);\n justify-content: space-between;\n flex-grow: 1;\n align-items: flex-start;\n }\n\n .content {\n align-items: center;\n align-self: center;\n max-width: 100%;\n }\n\n .title {\n max-width: 100%;\n min-width: 0;\n }\n\n .action {\n margin-inline-start: auto;\n\n :global(.flow--button) {\n margin-inline-end: 0;\n }\n }\n\n .header {\n order: 0;\n flex-grow: 1;\n align-items: center;\n\n &:empty,\n .subTitle:empty {\n display: none;\n }\n\n .avatar,\n .checkboxContainer {\n align-self: start;\n }\n\n .checkboxContainer {\n height: var(--avatar--size--m);\n }\n }\n\n &:has(.subTitle:not(:empty)) {\n .action,\n .avatar,\n .checkboxContainer {\n margin-top: var(--size-px--xxs);\n }\n }\n\n .topContent {\n order: 1;\n }\n\n :global(.flow--heading--heading-content) {\n max-width: 100%;\n }\n }\n\n &.tileView {\n gap: var(--list-item--padding);\n border-color: var(--list-item--border-color);\n border-width: var(--list-item--border-width);\n border-style: var(--list-item--border-style);\n border-radius: var(--list-item--corner-radius);\n align-content: flex-start;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n .content {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n padding-inline: var(--list-item--padding);\n padding-bottom: var(--list-item--padding);\n width: 100%;\n }\n\n .avatarContainer {\n width: 100%;\n border-bottom: var(--list-item--border-width)\n var(--list-item--border-style) var(--list-item--border-color);\n aspect-ratio: 16 / 9;\n\n // A consumer child inside `Avatar` — Flow `Image` or a bare `<img>`.\n // stylelint-disable-next-line selector-max-type -- bare `<img>` has no class\n img {\n overflow-clip-margin: unset;\n aspect-ratio: 16 / 9;\n }\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n border-radius: 0;\n\n :global(.flow--avatar--icon) {\n width: var(--size-px--xxl);\n height: var(--size-px--xxl);\n }\n\n :global(.flow--avatar--initials) {\n font-size: var(--size-px--xxl);\n }\n }\n\n .checkboxContainer {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline-start: var(--list-item--padding);\n background-color: var(--list-item--checkbox-background-color);\n border-radius: var(--list-item--checkbox-corner-radius);\n\n :global(.flow--checkbox .flow--checkbox--icon) {\n color: var(--list-item--checkbox-color);\n padding: var(--size-px--xxxs);\n }\n }\n\n .title {\n width: 100%;\n min-width: 0;\n\n :global(.flow--heading--heading-content) {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline: var(--list-item--padding);\n justify-content: end;\n }\n }\n\n &:has(.checkboxContainer:not(:empty)) {\n :global(.flow--heading--heading-content) {\n inset-inline-start: calc(var(--list-item--padding) * 2 + var(--icon--size--m));\n }\n }\n\n .topContent,\n .header {\n width: 100%;\n }\n\n .action {\n align-self: start;\n }\n\n .bottomContent {\n margin-top: auto;\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ListItemView.module.mjs","names":[],"sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.module.scss"],"sourcesContent":[".view {\n display: flex;\n flex-direction: column;\n\n .checkboxContainer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n\n &:empty {\n display: none;\n }\n }\n\n .content {\n min-width: 0;\n display: flex;\n gap: var(--list-item--spacing);\n flex-grow: 1;\n flex-wrap: wrap;\n }\n\n .topContent {\n overflow-wrap: anywhere;\n display: flex;\n }\n\n .bottomContent {\n width: 100%;\n overflow-wrap: anywhere;\n display: flex;\n flex-direction: column;\n }\n\n .heading {\n color: var(--text--color--default);\n overflow-wrap: anywhere;\n }\n\n .header {\n overflow-wrap: anywhere;\n display: flex;\n gap: var(--list-item--avatar-to-title-spacing);\n max-width: 100%;\n }\n\n .subTitle {\n font-size: var(--list-item--subtitle-font-size);\n\n .text:not(:last-child)::after {\n content: \"–\";\n display: inline-block;\n margin: 0 var(--size-rem--s);\n }\n }\n\n .badge {\n max-width: 100%;\n }\n\n &.listView {\n padding: var(--list-item--padding);\n gap: var(--list-item--spacing);\n\n .columnLayout {\n flex-grow: 1;\n\n > :global(.flow--column-layout) {\n flex-grow: 1;\n align-items: center;\n }\n }\n\n .contentWrapper {\n display: flex;\n gap: var(--list-item--spacing);\n justify-content: space-between;\n flex-grow: 1;\n align-items: flex-start;\n }\n\n .content {\n align-items: center;\n align-self: center;\n max-width: 100%;\n }\n\n .title {\n max-width: 100%;\n min-width: 0;\n }\n\n .action {\n margin-inline-start: auto;\n\n :global(.flow--button) {\n margin-inline-end: 0;\n }\n }\n\n .header {\n order: 0;\n flex-grow: 1;\n align-items: center;\n\n &:empty,\n .subTitle:empty {\n display: none;\n }\n\n .avatar,\n .checkboxContainer {\n align-self: start;\n }\n\n .checkboxContainer {\n height: var(--avatar--size--m);\n }\n }\n\n &:has(.subTitle:not(:empty)) {\n .action,\n .avatar,\n .checkboxContainer {\n margin-top: var(--size-px--xxs);\n }\n }\n\n .topContent {\n order: 1;\n }\n\n :global(.flow--heading--heading-content) {\n max-width: 100%;\n }\n }\n\n &.tileView {\n gap: var(--list-item--padding);\n border-color: var(--list-item--border-color);\n border-width: var(--list-item--border-width);\n border-style: var(--list-item--border-style);\n border-radius: var(--list-item--corner-radius);\n align-content: flex-start;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n .content {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n padding-inline: var(--list-item--padding);\n padding-bottom: var(--list-item--padding);\n width: 100%;\n }\n\n .avatarContainer {\n width: 100%;\n border-bottom: var(--list-item--border-width)\n var(--list-item--border-style) var(--list-item--border-color);\n aspect-ratio: 16 / 9;\n\n // A consumer child inside `Avatar` — Flow `Image` or a bare `<img>`.\n // stylelint-disable-next-line selector-max-type -- bare `<img>` has no class\n img {\n overflow-clip-margin: unset;\n aspect-ratio: 16 / 9;\n }\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n border-radius: 0;\n\n :global(.flow--avatar--icon) {\n width: var(--size-px--xxl);\n height: var(--size-px--xxl);\n }\n\n :global(.flow--avatar--initials) {\n font-size: var(--size-px--xxl);\n }\n }\n\n .checkboxContainer {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline-start: var(--list-item--padding);\n background-color: var(--list-item--checkbox-background-color);\n border-radius: var(--list-item--checkbox-corner-radius);\n\n :global(.flow--checkbox .flow--checkbox--icon) {\n color: var(--list-item--checkbox-color);\n padding: var(--size-px--xxxs);\n }\n }\n\n .title {\n width: 100%;\n min-width: 0;\n\n :global(.flow--heading--heading-text-spacer) {\n display: none;\n }\n\n :global(.flow--heading--heading-content) {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline: var(--list-item--padding);\n display: flex;\n flex-wrap: wrap;\n gap: var(--heading--icon-to-text-spacing);\n justify-content: end;\n }\n\n :global(.flow--heading--heading-content-item):not(:last-child) {\n margin-inline-end: 0;\n }\n }\n\n &:has(.checkboxContainer:not(:empty)) {\n :global(.flow--heading--heading-content) {\n inset-inline-start: calc(var(--list-item--padding) * 2 + var(--icon--size--m));\n }\n }\n\n .topContent,\n .header {\n width: 100%;\n }\n\n .action {\n align-self: start;\n }\n\n .bottomContent {\n margin-top: auto;\n }\n }\n}\n"],"mappings":""}
|
package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
|
-
import __locale_default from "../../../../../../_virtual/
|
|
4
|
+
import __locale_default from "../../../../../../_virtual/_17.locale.mjs";
|
|
5
5
|
import { useList } from "./useList.mjs";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
7
|
import { announce } from "@react-aria/live-announcer";
|
|
@@ -6,6 +6,7 @@ import { difference, unique } from "remeda";
|
|
|
6
6
|
import { getProperty } from "dot-prop";
|
|
7
7
|
//#region src/components/List/model/filter/Filter.ts
|
|
8
8
|
var equalsPropertyMatcher = (filterValue, propertyValue) => filterValue === propertyValue;
|
|
9
|
+
var selectAllMinValueCount = 6;
|
|
9
10
|
var stringCastRenderMethod = (value) => String(value);
|
|
10
11
|
var Filter = class {
|
|
11
12
|
_values;
|
|
@@ -162,6 +163,26 @@ var Filter = class {
|
|
|
162
163
|
this.list.reactTable.getTableColumn(this.property).setFilterValue(updatedValue);
|
|
163
164
|
this.callOnChangedHandlers(updatedValue);
|
|
164
165
|
}
|
|
166
|
+
get isSelectAllAvailable() {
|
|
167
|
+
return this.mode === "some" && this.values.length >= selectAllMinValueCount;
|
|
168
|
+
}
|
|
169
|
+
isEveryValueActive() {
|
|
170
|
+
return this.values.every((v) => v.isActive);
|
|
171
|
+
}
|
|
172
|
+
selectAll() {
|
|
173
|
+
this.setArrayValue(this.values);
|
|
174
|
+
}
|
|
175
|
+
setActiveValueIds(ids) {
|
|
176
|
+
const idSet = new Set(ids);
|
|
177
|
+
this.setArrayValue(this.values.filter((v) => idSet.has(v.id)));
|
|
178
|
+
}
|
|
179
|
+
deselectAll() {
|
|
180
|
+
this.setArrayValue([]);
|
|
181
|
+
}
|
|
182
|
+
setArrayValue(value) {
|
|
183
|
+
this.list.reactTable.getTableColumn(this.property).setFilterValue(value);
|
|
184
|
+
this.callOnChangedHandlers(value);
|
|
185
|
+
}
|
|
165
186
|
onFilterUpdated(cb) {
|
|
166
187
|
this.onFilterChangeCallbacks.add(cb);
|
|
167
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/Filter.ts"],"sourcesContent":["import type {\n Column,\n ColumnDef,\n ColumnFilter,\n InitialTableState,\n} from \"@tanstack/react-table\";\nimport type List from \"@/components/List/model/List\";\nimport { getProperty } from \"dot-prop\";\nimport type {\n FilterMatcher,\n FilterMode,\n FilterShape,\n FilterUpdatedCallback,\n} from \"@/components/List/model/filter/types\";\nimport type {\n PropertyName,\n PropertyValueRenderMethod,\n} from \"@/components/List/model/types\";\nimport { customPropertyPrefix } from \"@/components/List/model/types\";\nimport { difference, unique } from \"remeda\";\nimport { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport { toArray } from \"@/lib/array/toArray\";\nimport type { ListSettingsStoreOperationOptions } from \"../ListSettingsStore\";\n\nconst equalsPropertyMatcher: FilterMatcher<unknown, never, never> = (\n filterValue,\n propertyValue,\n) => filterValue === propertyValue;\n\nconst stringCastRenderMethod: PropertyValueRenderMethod<unknown> = (value) =>\n String(value);\n\nexport class Filter<\n T = never,\n TProp extends PropertyName<T> = never,\n TMatchValue = never,\n> {\n private _values?: FilterValue[] | undefined;\n private _valuesFromTableState?: FilterValue[];\n public readonly list: List<T>;\n public readonly property: TProp;\n public readonly mode: FilterMode;\n public readonly matcher: FilterMatcher<T, never, never>;\n public readonly renderItem: PropertyValueRenderMethod<TMatchValue>;\n public readonly name?: string;\n public readonly autosave: boolean;\n public readonly manualSave: boolean;\n private onFilterChangeCallbacks = new Set<FilterUpdatedCallback>();\n private readonly defaultSelectedValues?: FilterValue[];\n public readonly priority: \"primary\" | \"secondary\";\n public readonly storageKey: string;\n\n public constructor(list: List<T>, shape: FilterShape<T, TProp, TMatchValue>) {\n const {\n autosave = list.settingsStorageDefaults?.filters?.autosave ?? false,\n manualSave = list.settingsStorageDefaults?.filters?.manualSave ?? true,\n property,\n mode = \"some\",\n values,\n matcher = equalsPropertyMatcher,\n renderItem = stringCastRenderMethod,\n priority = \"primary\",\n name,\n defaultSelected,\n onChange,\n } = shape;\n\n this.list = list;\n this.autosave = autosave;\n this.manualSave = manualSave;\n this.property = property;\n this.storageKey = String(property);\n this.mode = mode;\n this._values = values?.map((v) => FilterValue.create(this, v));\n this.matcher = matcher;\n this.renderItem = renderItem;\n this.name = name;\n this.priority = priority;\n this.defaultSelectedValues = defaultSelected?.map((v) =>\n FilterValue.create(this, v),\n );\n if (onChange) {\n this.onFilterChangeCallbacks.add(onChange);\n }\n }\n\n public updateInitialState(initialState: InitialTableState) {\n const initialIds = this.getInitialSelectedIds();\n\n if (initialIds?.length) {\n initialState.columnFilters = [\n ...(initialState.columnFilters ?? []),\n {\n id: this.property as string,\n value: initialIds,\n },\n ];\n }\n }\n\n private getInitialSelectedIds() {\n return (\n this.getStoredSelectedIds({\n autosave: this.autosave,\n manualSave: this.manualSave,\n }) ?? this.defaultSelectedValues?.map((v) => v.id)\n );\n }\n\n private getStoredSelectedIds(options: ListSettingsStoreOperationOptions) {\n return this.list.settingsStorage?.get(\"activeFilters\", options)?.[\n this.storageKey\n ];\n }\n\n private getStoredSelectedValues(options: ListSettingsStoreOperationOptions) {\n return this.getStoredSelectedIds(options)\n ?.map((id) => this.values.find((v) => v.id === id))\n .filter((v): v is FilterValue => v !== undefined);\n }\n\n public static storeFilters<T>(\n list: List<T>,\n options: ListSettingsStoreOperationOptions,\n ) {\n const data = Object.fromEntries(\n list.filters.map((filter) => [\n filter.storageKey,\n filter.getArrayValue().map((v) => v.id),\n ]),\n );\n\n list.settingsStorage?.store(\"activeFilters\", data, options);\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableColumnFilter = true;\n def.filterFn = this.getReactTableFilterFn();\n }\n\n private getReactTableFilterFn(): ColumnDef<T>[\"filterFn\"] {\n return (row, _, filterValue) => {\n const propertyAsString = this.property as string;\n\n const filterBy = propertyAsString.startsWith(customPropertyPrefix)\n ? row.original\n : getProperty(row.original, propertyAsString);\n\n return this.checkFilterMatches(filterBy, filterValue);\n };\n }\n\n private checkFilterMatches(\n property: unknown,\n filterValueInput: unknown,\n ): boolean {\n if (filterValueInput === null) {\n return true;\n }\n\n const predicate = (filterValue: FilterValue) =>\n this.matcher(filterValue.value as never, property as never);\n\n const toFilterValue = (something: unknown) =>\n FilterValue.create(this, something);\n\n if (this.mode === \"all\") {\n return toArray(filterValueInput).map(toFilterValue).every(predicate);\n } else if (this.mode === \"some\") {\n const filterArr = toArray(filterValueInput);\n return (\n filterArr.length === 0 || filterArr.map(toFilterValue).some(predicate)\n );\n } else if (this.mode === \"one\") {\n const oneValue = Array.isArray(filterValueInput)\n ? filterValueInput[0]\n : filterValueInput;\n return predicate(toFilterValue(oneValue));\n }\n\n throw new Error(`Unknown filter mode '${this.mode}'`);\n }\n\n protected getTableColumnFilter(): ColumnFilter | undefined {\n return this.list.reactTable.table\n .getState()\n .columnFilters.find((f) => f.id === this.property);\n }\n\n private getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public getValue(): unknown {\n return this.getTableColumnFilter()?.value ?? null;\n }\n\n private getValuesFromTableState() {\n return unique(\n Array.from(this.getTableColumn().getFacetedUniqueValues().keys())\n .flatMap((v) => v)\n .filter((v) => v !== undefined && v !== null),\n ).map((v) => FilterValue.create(this, v));\n }\n\n private checkIfValueIsUnknown(value: FilterValue) {\n const isKnown = this.values.some((v) => v.id === value.id);\n return !isKnown;\n }\n\n public deleteUnknownFilterValues() {\n if (this.values === this.valuesFromTableState) {\n return;\n }\n\n for (const currentValues of this.getArrayValue()) {\n if (this.checkIfValueIsUnknown(currentValues)) {\n this.deactivateValue(currentValues);\n }\n }\n }\n\n public get values(): FilterValue[] {\n return this._values ?? this.valuesFromTableState;\n }\n\n private get valuesFromTableState(): FilterValue[] {\n if (!this._valuesFromTableState) {\n this._valuesFromTableState = this.getValuesFromTableState();\n }\n return this._valuesFromTableState;\n }\n\n public getArrayValue(): FilterValue[] {\n const value = this.getValue();\n return value === null\n ? []\n : toArray(value).map((v) => FilterValue.create(this, v));\n }\n\n public isValueActive(value: FilterValue): boolean {\n return this.getArrayValue().some((v) => v.equals(value));\n }\n\n public isActive(): boolean {\n return this.getArrayValue().length > 0;\n }\n\n public deactivateValue(value: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: FilterValue[] | FilterValue | null;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(value));\n } else {\n updatedValue = null;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n\n this.callOnChangedHandlers(updatedValue);\n }\n\n private callOnChangedHandlers(\n newValue: FilterValue[] | FilterValue | null,\n ): void {\n const values = toArray(newValue).map((v) => v?.value);\n this.onFilterChangeCallbacks.forEach((cb) => cb(values));\n }\n\n public hasChanges(): boolean {\n const currentIds = this.getArrayValue().map((v) => v.id);\n\n const defaultIds =\n this.getStoredSelectedIds({ autosave: false }) ??\n this.defaultSelectedValues?.map((v) => v.id) ??\n [];\n\n return (\n currentIds.length !== defaultIds.length ||\n difference(currentIds, defaultIds).length > 0\n );\n }\n\n public isStoringAvailable(): boolean {\n return !!this.list.settingsStorage && this.manualSave;\n }\n\n public resetValues(): void {\n let resetTo: FilterValue[] | FilterValue | null;\n\n const storedValues =\n this.getStoredSelectedValues({ autosave: false }) ??\n this.defaultSelectedValues;\n\n if (storedValues) {\n resetTo = storedValues;\n } else {\n if (this.mode === \"all\" || this.mode === \"some\") {\n resetTo = [];\n } else {\n resetTo = null;\n }\n }\n\n this.list.reactTable.getTableColumn(this.property).setFilterValue(resetTo);\n this.callOnChangedHandlers(resetTo);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).setFilterValue(null);\n this.callOnChangedHandlers(null);\n }\n\n public toggleValue(newValue: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: FilterValue[] | FilterValue | null;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n if (newValue.isActive) {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(newValue));\n } else {\n updatedValue = [...currentValueAsArray, newValue];\n }\n } else {\n updatedValue = newValue.isActive ? null : newValue;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.callOnChangedHandlers(updatedValue);\n }\n\n public onFilterUpdated(cb: () => unknown): void {\n this.onFilterChangeCallbacks.add(cb);\n }\n}\n"],"mappings":";;;;;;;AAwBA,IAAM,yBACJ,aACA,kBACG,gBAAgB;AAErB,IAAM,0BAA8D,UAClE,OAAO,KAAK;AAEd,IAAa,SAAb,MAIE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,0CAAkC,IAAI,IAA2B;CACjE;CACA;CACA;CAEA,YAAmB,MAAe,OAA2C;EAC3E,MAAM,EACJ,WAAW,KAAK,yBAAyB,SAAS,YAAY,OAC9D,aAAa,KAAK,yBAAyB,SAAS,cAAc,MAClE,UACA,OAAO,QACP,QACA,UAAU,uBACV,aAAa,wBACb,WAAW,WACX,MACA,iBACA,aACE;EAEJ,KAAK,OAAO;EACZ,KAAK,WAAW;EAChB,KAAK,aAAa;EAClB,KAAK,WAAW;EAChB,KAAK,aAAa,OAAO,QAAQ;EACjC,KAAK,OAAO;EACZ,KAAK,UAAU,QAAQ,KAAK,MAAM,YAAY,OAAO,MAAM,CAAC,CAAC;EAC7D,KAAK,UAAU;EACf,KAAK,aAAa;EAClB,KAAK,OAAO;EACZ,KAAK,WAAW;EAChB,KAAK,wBAAwB,iBAAiB,KAAK,MACjD,YAAY,OAAO,MA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,qBAAqC;EACnC,OAAO,CAAC,CAAC,KAAK,KAAK,mBAAmB,KAAK;CAC7C;CAEA,cAA2B;EACzB,IAAI;EAEJ,MAAM,eACJ,KAAK,wBAAwB,EAAE,UAAU,MAAM,CAAC,KAChD,KAAK;EAEP,IAAI,cACF,UAAU;OAEV,IAAI,KAAK,SAAS,SAAS,KAAK,SAAS,QACvC,UAAU,CAAC;OAEX,UAAU;EAId,KAAK,KAAK,WAAW,eAAe,KAAK,QAAQ,CAAC,CAAC,eAAe,OAAO;EACzE,KAAK,sBAAsB,OAAO;CACpC;CAEA,QAAqB;EACnB,KAAK,KAAK,WAAW,eAAe,KAAK,QAAQ,CAAC,CAAC,eAAe,IAAI;EACtE,KAAK,sBAAsB,IAAI;CACjC;CAEA,YAAmB,UAA6B;EAC9C,MAAM,sBAAsB,KAAK,cAAc;EAE/C,IAAI;EAEJ,IAAI,KAAK,SAAS,SAAS,KAAK,SAAS,QAAQ;GAC/C,IAAI,SAAS,UACX,eAAe,oBAAoB,QAAQ,MAAM,CAAC,EAAE,OAAO,QAAQ,CAAC;QAEpE,eAAe,CAAC,GAAG,qBAAqB,QAAQ;EAEpD,OACE,eAAe,SAAS,WAAW,OAAO;EAG5C,KAAK,KAAK,WACP,eAAe,KAAK,QAAQ,CAAC,CAC7B,eAAe,YAAY;EAC9B,KAAK,sBAAsB,YAAY;CACzC;CAEA,gBAAuB,IAAyB;EAC9C,KAAK,wBAAwB,IAAI,EAAE;CACrC;AACF"}
|
|
1
|
+
{"version":3,"file":"Filter.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/filter/Filter.ts"],"sourcesContent":["import type {\n Column,\n ColumnDef,\n ColumnFilter,\n InitialTableState,\n} from \"@tanstack/react-table\";\nimport type List from \"@/components/List/model/List\";\nimport { getProperty } from \"dot-prop\";\nimport type {\n FilterMatcher,\n FilterMode,\n FilterShape,\n FilterUpdatedCallback,\n} from \"@/components/List/model/filter/types\";\nimport type {\n PropertyName,\n PropertyValueRenderMethod,\n} from \"@/components/List/model/types\";\nimport { customPropertyPrefix } from \"@/components/List/model/types\";\nimport { difference, unique } from \"remeda\";\nimport { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport { toArray } from \"@/lib/array/toArray\";\nimport type { ListSettingsStoreOperationOptions } from \"../ListSettingsStore\";\n\nconst equalsPropertyMatcher: FilterMatcher<unknown, never, never> = (\n filterValue,\n propertyValue,\n) => filterValue === propertyValue;\n\nconst selectAllMinValueCount = 6;\n\nconst stringCastRenderMethod: PropertyValueRenderMethod<unknown> = (value) =>\n String(value);\n\nexport class Filter<\n T = never,\n TProp extends PropertyName<T> = never,\n TMatchValue = never,\n> {\n private _values?: FilterValue[] | undefined;\n private _valuesFromTableState?: FilterValue[];\n public readonly list: List<T>;\n public readonly property: TProp;\n public readonly mode: FilterMode;\n public readonly matcher: FilterMatcher<T, never, never>;\n public readonly renderItem: PropertyValueRenderMethod<TMatchValue>;\n public readonly name?: string;\n public readonly autosave: boolean;\n public readonly manualSave: boolean;\n private onFilterChangeCallbacks = new Set<FilterUpdatedCallback>();\n private readonly defaultSelectedValues?: FilterValue[];\n public readonly priority: \"primary\" | \"secondary\";\n public readonly storageKey: string;\n\n public constructor(list: List<T>, shape: FilterShape<T, TProp, TMatchValue>) {\n const {\n autosave = list.settingsStorageDefaults?.filters?.autosave ?? false,\n manualSave = list.settingsStorageDefaults?.filters?.manualSave ?? true,\n property,\n mode = \"some\",\n values,\n matcher = equalsPropertyMatcher,\n renderItem = stringCastRenderMethod,\n priority = \"primary\",\n name,\n defaultSelected,\n onChange,\n } = shape;\n\n this.list = list;\n this.autosave = autosave;\n this.manualSave = manualSave;\n this.property = property;\n this.storageKey = String(property);\n this.mode = mode;\n this._values = values?.map((v) => FilterValue.create(this, v));\n this.matcher = matcher;\n this.renderItem = renderItem;\n this.name = name;\n this.priority = priority;\n this.defaultSelectedValues = defaultSelected?.map((v) =>\n FilterValue.create(this, v),\n );\n if (onChange) {\n this.onFilterChangeCallbacks.add(onChange);\n }\n }\n\n public updateInitialState(initialState: InitialTableState) {\n const initialIds = this.getInitialSelectedIds();\n\n if (initialIds?.length) {\n initialState.columnFilters = [\n ...(initialState.columnFilters ?? []),\n {\n id: this.property as string,\n value: initialIds,\n },\n ];\n }\n }\n\n private getInitialSelectedIds() {\n return (\n this.getStoredSelectedIds({\n autosave: this.autosave,\n manualSave: this.manualSave,\n }) ?? this.defaultSelectedValues?.map((v) => v.id)\n );\n }\n\n private getStoredSelectedIds(options: ListSettingsStoreOperationOptions) {\n return this.list.settingsStorage?.get(\"activeFilters\", options)?.[\n this.storageKey\n ];\n }\n\n private getStoredSelectedValues(options: ListSettingsStoreOperationOptions) {\n return this.getStoredSelectedIds(options)\n ?.map((id) => this.values.find((v) => v.id === id))\n .filter((v): v is FilterValue => v !== undefined);\n }\n\n public static storeFilters<T>(\n list: List<T>,\n options: ListSettingsStoreOperationOptions,\n ) {\n const data = Object.fromEntries(\n list.filters.map((filter) => [\n filter.storageKey,\n filter.getArrayValue().map((v) => v.id),\n ]),\n );\n\n list.settingsStorage?.store(\"activeFilters\", data, options);\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableColumnFilter = true;\n def.filterFn = this.getReactTableFilterFn();\n }\n\n private getReactTableFilterFn(): ColumnDef<T>[\"filterFn\"] {\n return (row, _, filterValue) => {\n const propertyAsString = this.property as string;\n\n const filterBy = propertyAsString.startsWith(customPropertyPrefix)\n ? row.original\n : getProperty(row.original, propertyAsString);\n\n return this.checkFilterMatches(filterBy, filterValue);\n };\n }\n\n private checkFilterMatches(\n property: unknown,\n filterValueInput: unknown,\n ): boolean {\n if (filterValueInput === null) {\n return true;\n }\n\n const predicate = (filterValue: FilterValue) =>\n this.matcher(filterValue.value as never, property as never);\n\n const toFilterValue = (something: unknown) =>\n FilterValue.create(this, something);\n\n if (this.mode === \"all\") {\n return toArray(filterValueInput).map(toFilterValue).every(predicate);\n } else if (this.mode === \"some\") {\n const filterArr = toArray(filterValueInput);\n return (\n filterArr.length === 0 || filterArr.map(toFilterValue).some(predicate)\n );\n } else if (this.mode === \"one\") {\n const oneValue = Array.isArray(filterValueInput)\n ? filterValueInput[0]\n : filterValueInput;\n return predicate(toFilterValue(oneValue));\n }\n\n throw new Error(`Unknown filter mode '${this.mode}'`);\n }\n\n protected getTableColumnFilter(): ColumnFilter | undefined {\n return this.list.reactTable.table\n .getState()\n .columnFilters.find((f) => f.id === this.property);\n }\n\n private getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public getValue(): unknown {\n return this.getTableColumnFilter()?.value ?? null;\n }\n\n private getValuesFromTableState() {\n return unique(\n Array.from(this.getTableColumn().getFacetedUniqueValues().keys())\n .flatMap((v) => v)\n .filter((v) => v !== undefined && v !== null),\n ).map((v) => FilterValue.create(this, v));\n }\n\n private checkIfValueIsUnknown(value: FilterValue) {\n const isKnown = this.values.some((v) => v.id === value.id);\n return !isKnown;\n }\n\n public deleteUnknownFilterValues() {\n if (this.values === this.valuesFromTableState) {\n return;\n }\n\n for (const currentValues of this.getArrayValue()) {\n if (this.checkIfValueIsUnknown(currentValues)) {\n this.deactivateValue(currentValues);\n }\n }\n }\n\n public get values(): FilterValue[] {\n return this._values ?? this.valuesFromTableState;\n }\n\n private get valuesFromTableState(): FilterValue[] {\n if (!this._valuesFromTableState) {\n this._valuesFromTableState = this.getValuesFromTableState();\n }\n return this._valuesFromTableState;\n }\n\n public getArrayValue(): FilterValue[] {\n const value = this.getValue();\n return value === null\n ? []\n : toArray(value).map((v) => FilterValue.create(this, v));\n }\n\n public isValueActive(value: FilterValue): boolean {\n return this.getArrayValue().some((v) => v.equals(value));\n }\n\n public isActive(): boolean {\n return this.getArrayValue().length > 0;\n }\n\n public deactivateValue(value: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: FilterValue[] | FilterValue | null;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(value));\n } else {\n updatedValue = null;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n\n this.callOnChangedHandlers(updatedValue);\n }\n\n private callOnChangedHandlers(\n newValue: FilterValue[] | FilterValue | null,\n ): void {\n const values = toArray(newValue).map((v) => v?.value);\n this.onFilterChangeCallbacks.forEach((cb) => cb(values));\n }\n\n public hasChanges(): boolean {\n const currentIds = this.getArrayValue().map((v) => v.id);\n\n const defaultIds =\n this.getStoredSelectedIds({ autosave: false }) ??\n this.defaultSelectedValues?.map((v) => v.id) ??\n [];\n\n return (\n currentIds.length !== defaultIds.length ||\n difference(currentIds, defaultIds).length > 0\n );\n }\n\n public isStoringAvailable(): boolean {\n return !!this.list.settingsStorage && this.manualSave;\n }\n\n public resetValues(): void {\n let resetTo: FilterValue[] | FilterValue | null;\n\n const storedValues =\n this.getStoredSelectedValues({ autosave: false }) ??\n this.defaultSelectedValues;\n\n if (storedValues) {\n resetTo = storedValues;\n } else {\n if (this.mode === \"all\" || this.mode === \"some\") {\n resetTo = [];\n } else {\n resetTo = null;\n }\n }\n\n this.list.reactTable.getTableColumn(this.property).setFilterValue(resetTo);\n this.callOnChangedHandlers(resetTo);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).setFilterValue(null);\n this.callOnChangedHandlers(null);\n }\n\n public toggleValue(newValue: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: FilterValue[] | FilterValue | null;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n if (newValue.isActive) {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(newValue));\n } else {\n updatedValue = [...currentValueAsArray, newValue];\n }\n } else {\n updatedValue = newValue.isActive ? null : newValue;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.callOnChangedHandlers(updatedValue);\n }\n\n public get isSelectAllAvailable(): boolean {\n return this.mode === \"some\" && this.values.length >= selectAllMinValueCount;\n }\n\n public isEveryValueActive(): boolean {\n return this.values.every((v) => v.isActive);\n }\n\n public selectAll(): void {\n this.setArrayValue(this.values);\n }\n\n public setActiveValueIds(ids: Iterable<unknown>): void {\n const idSet = new Set(ids);\n this.setArrayValue(this.values.filter((v) => idSet.has(v.id)));\n }\n\n public deselectAll(): void {\n this.setArrayValue([]);\n }\n\n private setArrayValue(value: FilterValue[]): void {\n this.list.reactTable.getTableColumn(this.property).setFilterValue(value);\n this.callOnChangedHandlers(value);\n }\n\n public onFilterUpdated(cb: () => unknown): void {\n this.onFilterChangeCallbacks.add(cb);\n }\n}\n"],"mappings":";;;;;;;AAwBA,IAAM,yBACJ,aACA,kBACG,gBAAgB;AAErB,IAAM,yBAAyB;AAE/B,IAAM,0BAA8D,UAClE,OAAO,KAAK;AAEd,IAAa,SAAb,MAIE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,0CAAkC,IAAI,IAA2B;CACjE;CACA;CACA;CAEA,YAAmB,MAAe,OAA2C;EAC3E,MAAM,EACJ,WAAW,KAAK,yBAAyB,SAAS,YAAY,OAC9D,aAAa,KAAK,yBAAyB,SAAS,cAAc,MAClE,UACA,OAAO,QACP,QACA,UAAU,uBACV,aAAa,wBACb,WAAW,WACX,MACA,iBACA,aACE;EAEJ,KAAK,OAAO;EACZ,KAAK,WAAW;EAChB,KAAK,aAAa;EAClB,KAAK,WAAW;EAChB,KAAK,aAAa,OAAO,QAAQ;EACjC,KAAK,OAAO;EACZ,KAAK,UAAU,QAAQ,KAAK,MAAM,YAAY,OAAO,MAAM,CAAC,CAAC;EAC7D,KAAK,UAAU;EACf,KAAK,aAAa;EAClB,KAAK,OAAO;EACZ,KAAK,WAAW;EAChB,KAAK,wBAAwB,iBAAiB,KAAK,MACjD,YAAY,OAAO,MAAM,CAAC,CAC5B;EACA,IAAI,UACF,KAAK,wBAAwB,IAAI,QAAQ;CAE7C;CAEA,mBAA0B,cAAiC;EACzD,MAAM,aAAa,KAAK,sBAAsB;EAE9C,IAAI,YAAY,QACd,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yB;EAC9C,KAAK,wBAAwB,IAAI,EAAE;CACrC;AACF"}
|
|
@@ -4,7 +4,7 @@ import { IconSearch } from "../../../Icon/components/icons/IconSearch.mjs";
|
|
|
4
4
|
import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
5
5
|
import { Text } from "../../../Text/Text.mjs";
|
|
6
6
|
import { Heading } from "../../../Heading/Heading.mjs";
|
|
7
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
7
|
+
import __locale_default from "../../../../../../../_virtual/_17.locale.mjs";
|
|
8
8
|
import { IllustratedMessage } from "../../../IllustratedMessage/IllustratedMessage.mjs";
|
|
9
9
|
import Items_module_default from "../../components/Items/Items.module.mjs";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import { Button } from "../../Button/Button.mjs";
|
|
5
5
|
import MarkdownEditor_module_default from "../MarkdownEditor.module.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../_virtual/_25.locale.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/MarkdownEditor/components/ModeButton.tsx
|
package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import { Button } from "../../Button/Button.mjs";
|
|
5
|
-
import __locale_default from "../../../../../../_virtual/
|
|
5
|
+
import __locale_default from "../../../../../../_virtual/_25.locale.mjs";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/MarkdownEditor/components/ToolbarButton.tsx
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import { matchesAccept } from "../../../lib/files/acceptedFiles.mjs";
|
|
5
|
-
import __locale_default from "../../../../../../_virtual/
|
|
5
|
+
import __locale_default from "../../../../../../_virtual/_25.locale.mjs";
|
|
6
6
|
import { insertAtCaret, removePlaceholder, replacePlaceholder, uploadPlaceholder, uploadedFileMarkdown } from "./fileUpload.mjs";
|
|
7
7
|
import { useEffect, useRef, useState } from "react";
|
|
8
8
|
import { announce } from "@react-aria/live-announcer";
|
|
@@ -26,7 +26,7 @@ var disablePendingProps = (props) => {
|
|
|
26
26
|
/** @flr-generate all */
|
|
27
27
|
var MenuItem = flowComponent("MenuItem", (props) => {
|
|
28
28
|
props = disablePendingProps(props);
|
|
29
|
-
const { children, className, selectionVariant, id, ref, "aria-disabled": ariaDisabled, "aria-current": ariaCurrent, isPending, isSucceeded, isFailed, ...rest } = props;
|
|
29
|
+
const { children, className, selectionVariant, isIndeterminate, id, ref, "aria-disabled": ariaDisabled, "aria-current": ariaCurrent, isPending, isSucceeded, isFailed, ...rest } = props;
|
|
30
30
|
/**
|
|
31
31
|
* React Aria drops `aria-current` from the props it forwards to the DOM, so
|
|
32
32
|
* the current state is exposed as a data attribute (`data-*` passes the
|
|
@@ -52,6 +52,7 @@ var MenuItem = flowComponent("MenuItem", (props) => {
|
|
|
52
52
|
}, (props) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuItemContent, {
|
|
53
53
|
...props,
|
|
54
54
|
selectionVariant,
|
|
55
|
+
isIndeterminate,
|
|
55
56
|
children
|
|
56
57
|
}), stateIcon] }));
|
|
57
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.mjs","names":[],"sources":["../../../../../../../src/components/MenuItem/MenuItem.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./MenuItem.module.scss\";\nimport clsx from \"clsx\";\nimport { MenuItemContent } from \"@/components/MenuItem/components/MenuItemContent/MenuItemContent\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useAriaAnnounceActionState } from \"@/components/Action/lib/ariaLive\";\nimport { IconFailed, IconSucceeded } from \"@/components/Icon/components/icons\";\nimport LoadingSpinner from \"@/components/LoadingSpinner\";\n\nexport interface MenuItemProps\n extends\n Omit<Aria.MenuItemProps, \"children\">,\n PropsWithChildren,\n FlowComponentProps {\n selectionVariant?: \"control\" | \"navigation\" | \"switch\";\n /** Whether the button is in a pending state. */\n isPending?: boolean;\n /** Whether the button is in a succeeded state. */\n isSucceeded?: boolean;\n /** Whether the button is in a failed state. */\n isFailed?: boolean;\n /** Disables button but keeps it focusable. */\n \"aria-disabled\"?: boolean;\n /** Marks the menu item as referring to the currently active page. */\n \"aria-current\"?: string;\n}\n\nconst disablePendingProps = (props: MenuItemProps) => {\n if (\n props.isPending ||\n props.isSucceeded ||\n props.isFailed ||\n props[\"aria-disabled\"]\n ) {\n props = { ...props };\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n }\n\n return props;\n};\n\n/** @flr-generate all */\nexport const MenuItem = flowComponent(\"MenuItem\", (props) => {\n props = disablePendingProps(props);\n\n const {\n children,\n className,\n selectionVariant,\n id,\n ref,\n \"aria-disabled\": ariaDisabled,\n \"aria-current\": ariaCurrent,\n isPending,\n isSucceeded,\n isFailed,\n ...rest\n } = props;\n\n /**\n * React Aria drops `aria-current` from the props it forwards to the DOM, so\n * the current state is exposed as a data attribute (`data-*` passes the\n * filter) — that is what the `menuItem` styling matches on. Every\n * `aria-current` value marks the item as current, except an explicit\n * \"false\".\n */\n const currentProps =\n ariaCurrent && ariaCurrent !== \"false\" ? { \"data-current\": true } : {};\n\n const rootClassName = clsx(\n styles.menuItem /**\n * Workaround warning: The Aria.MenuItem does not support \"aria-disabled\" by\n * now, so this MenuItem will be visually disabled via CSS.\n */,\n (ariaDisabled || isFailed || isSucceeded || isPending) &&\n styles.ariaDisabled,\n className,\n );\n\n useAriaAnnounceActionState(\n isPending\n ? \"isPending\"\n : isSucceeded\n ? \"isSucceeded\"\n : isFailed\n ? \"isFailed\"\n : \"isIdle\",\n );\n\n const stateIconElement = isSucceeded ? (\n <IconSucceeded color=\"success\" />\n ) : isFailed ? (\n <IconFailed color=\"danger\" />\n ) : isPending ? (\n <LoadingSpinner />\n ) : undefined;\n\n const stateIcon = stateIconElement && (\n <div className={styles.stateIcon}>{stateIconElement}</div>\n );\n\n return (\n <Aria.MenuItem\n {...rest}\n {...currentProps}\n key={id}\n id={id}\n className={rootClassName}\n ref={ref}\n >\n {(props) => (\n <>\n <MenuItemContent
|
|
1
|
+
{"version":3,"file":"MenuItem.mjs","names":[],"sources":["../../../../../../../src/components/MenuItem/MenuItem.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./MenuItem.module.scss\";\nimport clsx from \"clsx\";\nimport { MenuItemContent } from \"@/components/MenuItem/components/MenuItemContent/MenuItemContent\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useAriaAnnounceActionState } from \"@/components/Action/lib/ariaLive\";\nimport { IconFailed, IconSucceeded } from \"@/components/Icon/components/icons\";\nimport LoadingSpinner from \"@/components/LoadingSpinner\";\n\nexport interface MenuItemProps\n extends\n Omit<Aria.MenuItemProps, \"children\">,\n PropsWithChildren,\n FlowComponentProps {\n selectionVariant?: \"control\" | \"navigation\" | \"switch\";\n /**\n * Shows the checkbox of a multiple-selection item as partially checked,\n * unless the item is selected.\n */\n isIndeterminate?: boolean;\n /** Whether the button is in a pending state. */\n isPending?: boolean;\n /** Whether the button is in a succeeded state. */\n isSucceeded?: boolean;\n /** Whether the button is in a failed state. */\n isFailed?: boolean;\n /** Disables button but keeps it focusable. */\n \"aria-disabled\"?: boolean;\n /** Marks the menu item as referring to the currently active page. */\n \"aria-current\"?: string;\n}\n\nconst disablePendingProps = (props: MenuItemProps) => {\n if (\n props.isPending ||\n props.isSucceeded ||\n props.isFailed ||\n props[\"aria-disabled\"]\n ) {\n props = { ...props };\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n }\n\n return props;\n};\n\n/** @flr-generate all */\nexport const MenuItem = flowComponent(\"MenuItem\", (props) => {\n props = disablePendingProps(props);\n\n const {\n children,\n className,\n selectionVariant,\n isIndeterminate,\n id,\n ref,\n \"aria-disabled\": ariaDisabled,\n \"aria-current\": ariaCurrent,\n isPending,\n isSucceeded,\n isFailed,\n ...rest\n } = props;\n\n /**\n * React Aria drops `aria-current` from the props it forwards to the DOM, so\n * the current state is exposed as a data attribute (`data-*` passes the\n * filter) — that is what the `menuItem` styling matches on. Every\n * `aria-current` value marks the item as current, except an explicit\n * \"false\".\n */\n const currentProps =\n ariaCurrent && ariaCurrent !== \"false\" ? { \"data-current\": true } : {};\n\n const rootClassName = clsx(\n styles.menuItem /**\n * Workaround warning: The Aria.MenuItem does not support \"aria-disabled\" by\n * now, so this MenuItem will be visually disabled via CSS.\n */,\n (ariaDisabled || isFailed || isSucceeded || isPending) &&\n styles.ariaDisabled,\n className,\n );\n\n useAriaAnnounceActionState(\n isPending\n ? \"isPending\"\n : isSucceeded\n ? \"isSucceeded\"\n : isFailed\n ? \"isFailed\"\n : \"isIdle\",\n );\n\n const stateIconElement = isSucceeded ? (\n <IconSucceeded color=\"success\" />\n ) : isFailed ? (\n <IconFailed color=\"danger\" />\n ) : isPending ? (\n <LoadingSpinner />\n ) : undefined;\n\n const stateIcon = stateIconElement && (\n <div className={styles.stateIcon}>{stateIconElement}</div>\n );\n\n return (\n <Aria.MenuItem\n {...rest}\n {...currentProps}\n key={id}\n id={id}\n className={rootClassName}\n ref={ref}\n >\n {(props) => (\n <>\n <MenuItemContent\n {...props}\n selectionVariant={selectionVariant}\n isIndeterminate={isIndeterminate}\n >\n {children}\n </MenuItemContent>\n {stateIcon}\n </>\n )}\n </Aria.MenuItem>\n );\n});\n\nexport default MenuItem;\n"],"mappings":";;;;;;;;;;;;;;AAkCA,IAAM,uBAAuB,UAAyB;CACpD,IACE,MAAM,aACN,MAAM,eACN,MAAM,YACN,MAAM,kBACN;EACA,QAAQ,EAAE,GAAG,MAAM;EACnB,MAAM,UAAU,KAAA;EAChB,MAAM,eAAe,KAAA;EACrB,MAAM,aAAa,KAAA;EACnB,MAAM,gBAAgB,KAAA;EACtB,MAAM,YAAY,KAAA;CACpB;CAEA,OAAO;AACT;;AAGA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,QAAQ,oBAAoB,KAAK;CAEjC,MAAM,EACJ,UACA,WACA,kBACA,iBACA,IACA,KACA,iBAAiB,cACjB,gBAAgB,aAChB,WACA,aACA,UACA,GAAG,SACD;;;;;;;;CASJ,MAAM,eACJ,eAAe,gBAAgB,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAEvE,MAAM,gBAAgB,KACpB,wBAAO,WAIN,gBAAgB,YAAY,eAAe,cAC1C,wBAAO,cACT,SACF;CAEA,2BACE,YACI,cACA,cACE,gBACA,WACE,aACA,QACV;CAEA,MAAM,mBAAmB,cACvB,oBAAC,eAAD,EAAe,OAAM,UAAW,CAAA,IAC9B,WACF,oBAAC,YAAD,EAAY,OAAM,SAAU,CAAA,IAC1B,YACF,oBAAC,gBAAD,CAAiB,CAAA,IACf,KAAA;CAEJ,MAAM,YAAY,oBAChB,oBAAC,OAAD;EAAK,WAAW,wBAAO;EAAY,UAAA;CAAsB,CAAA;CAG3D,OACE,8BAAC,KAAK,UAAN;EACE,GAAI;EACJ,GAAI;EACJ,KAAK;EACD;EACJ,WAAW;EACN;CAcQ,IAZX,UACA,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,iBAAD;EACE,GAAI;EACc;EACD;EAEhB;CACc,CAAA,GAChB,SACD,EAAA,CAAA,CAES;AAEnB,CAAC"}
|
|
@@ -8,6 +8,7 @@ var controlIcon = "flow--menu-item--control-icon";
|
|
|
8
8
|
var ariaDisabled = "flow--menu-item--aria-disabled";
|
|
9
9
|
var avatar = "flow--menu-item--avatar";
|
|
10
10
|
var stateIcon = "flow--menu-item--state-icon";
|
|
11
|
+
var controlIconActive = "flow--menu-item--control-icon-active";
|
|
11
12
|
var kbd = "flow--menu-item--kbd";
|
|
12
13
|
var badge = "flow--menu-item--badge";
|
|
13
14
|
var MenuItem_module_default = {
|
|
@@ -19,10 +20,11 @@ var MenuItem_module_default = {
|
|
|
19
20
|
ariaDisabled,
|
|
20
21
|
avatar,
|
|
21
22
|
stateIcon,
|
|
23
|
+
controlIconActive,
|
|
22
24
|
kbd,
|
|
23
25
|
badge
|
|
24
26
|
};
|
|
25
27
|
//#endregion
|
|
26
|
-
export { ariaDisabled, avatar, badge, checkMark, controlIcon, MenuItem_module_default as default, icon, kbd, menuItem, stateIcon };
|
|
28
|
+
export { ariaDisabled, avatar, badge, checkMark, controlIcon, controlIconActive, MenuItem_module_default as default, icon, kbd, menuItem, stateIcon };
|
|
27
29
|
|
|
28
30
|
//# sourceMappingURL=MenuItem.module.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.module.mjs","names":[],"sources":["../../../../../../../src/components/MenuItem/MenuItem.module.scss"],"sourcesContent":["@use \"@/styles/mixins/menuItem\";\n\n.menuItem {\n position: relative;\n\n @include menuItem.menuItem();\n\n .stateIcon {\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .kbd,\n .badge {\n margin-inline-start: auto;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MenuItem.module.mjs","names":[],"sources":["../../../../../../../src/components/MenuItem/MenuItem.module.scss"],"sourcesContent":["@use \"@/styles/mixins/menuItem\";\n\n.menuItem {\n position: relative;\n\n @include menuItem.menuItem();\n\n .stateIcon {\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .controlIconActive {\n color: var(--choice--icon-color--selected);\n }\n\n .kbd,\n .badge {\n margin-inline-start: auto;\n }\n}\n"],"mappings":""}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { PropsContextProvider } from "../../../../lib/propsContext/components/PropsContextProvider.mjs";
|
|
4
4
|
import { IconCheckboxChecked } from "../../../Icon/components/icons/IconCheckboxChecked.mjs";
|
|
5
5
|
import { IconCheckboxEmpty } from "../../../Icon/components/icons/IconCheckboxEmpty.mjs";
|
|
6
|
+
import { IconCheckboxIndeterminate } from "../../../Icon/components/icons/IconCheckboxIndeterminate.mjs";
|
|
6
7
|
import { IconRadioOff } from "../../../Icon/components/icons/IconRadioOff.mjs";
|
|
7
8
|
import { IconRadioOn } from "../../../Icon/components/icons/IconRadioOn.mjs";
|
|
8
9
|
import MenuItem_module_default from "../../MenuItem.module.mjs";
|
|
@@ -11,7 +12,7 @@ import clsx from "clsx";
|
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/MenuItem/components/MenuItemContent/MenuItemContent.tsx
|
|
13
14
|
var MenuItemContent = (props) => {
|
|
14
|
-
const { selectionMode, isSelected, selectionVariant = "control", children } = props;
|
|
15
|
+
const { selectionMode, isSelected, selectionVariant = "control", isIndeterminate, children } = props;
|
|
15
16
|
const propsContext = {
|
|
16
17
|
Icon: { className: MenuItem_module_default.icon },
|
|
17
18
|
Avatar: { className: MenuItem_module_default.avatar },
|
|
@@ -19,7 +20,7 @@ var MenuItemContent = (props) => {
|
|
|
19
20
|
Badge: { className: MenuItem_module_default.badge }
|
|
20
21
|
};
|
|
21
22
|
const controlIconPropsContext = {
|
|
22
|
-
Icon: { className: clsx(MenuItem_module_default.controlIcon, MenuItem_module_default.icon) },
|
|
23
|
+
Icon: { className: clsx(MenuItem_module_default.controlIcon, MenuItem_module_default.icon, (isSelected || isIndeterminate) && MenuItem_module_default.controlIconActive) },
|
|
23
24
|
Switch: {
|
|
24
25
|
className: clsx(MenuItem_module_default.controlIcon, MenuItem_module_default.switch),
|
|
25
26
|
labelPosition: "leading"
|
|
@@ -30,7 +31,7 @@ var MenuItemContent = (props) => {
|
|
|
30
31
|
children: selectionMode === "none" || selectionVariant === "navigation" ? null : selectionVariant === "switch" ? /* @__PURE__ */ jsx(Switch, {
|
|
31
32
|
isReadOnly: true,
|
|
32
33
|
isSelected
|
|
33
|
-
}) : selectionMode === "single" && isSelected ? /* @__PURE__ */ jsx(IconRadioOn, {}) : selectionMode === "single" && !isSelected ? /* @__PURE__ */ jsx(IconRadioOff, {}) : selectionMode === "multiple" && isSelected ? /* @__PURE__ */ jsx(IconCheckboxChecked, {}) : /* @__PURE__ */ jsx(IconCheckboxEmpty, {})
|
|
34
|
+
}) : selectionMode === "single" && isSelected ? /* @__PURE__ */ jsx(IconRadioOn, {}) : selectionMode === "single" && !isSelected ? /* @__PURE__ */ jsx(IconRadioOff, {}) : selectionMode === "multiple" && isSelected ? /* @__PURE__ */ jsx(IconCheckboxChecked, {}) : selectionMode === "multiple" && isIndeterminate ? /* @__PURE__ */ jsx(IconCheckboxIndeterminate, {}) : /* @__PURE__ */ jsx(IconCheckboxEmpty, {})
|
|
34
35
|
}), /* @__PURE__ */ jsx(PropsContextProvider, {
|
|
35
36
|
props: propsContext,
|
|
36
37
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemContent.mjs","names":[],"sources":["../../../../../../../../../src/components/MenuItem/components/MenuItemContent/MenuItemContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"../../MenuItem.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconRadioOff,\n IconRadioOn,\n} from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { Switch } from \"@/components/Switch\";\n\ninterface Props extends Aria.MenuItemRenderProps, PropsWithChildren {\n selectionVariant?: \"control\" | \"navigation\" | \"switch\";\n}\n\nexport const MenuItemContent: FC<Props> = (props) => {\n const {\n selectionMode,\n isSelected,\n selectionVariant = \"control\",\n children,\n } = props;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n },\n Avatar: {\n className: styles.avatar,\n },\n Kbd: {\n className: styles.kbd,\n },\n Badge: {\n className: styles.badge,\n },\n };\n\n const controlIconPropsContext: PropsContext = {\n Icon: {\n className: clsx(styles.controlIcon
|
|
1
|
+
{"version":3,"file":"MenuItemContent.mjs","names":[],"sources":["../../../../../../../../../src/components/MenuItem/components/MenuItemContent/MenuItemContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"../../MenuItem.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n IconRadioOff,\n IconRadioOn,\n} from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { Switch } from \"@/components/Switch\";\n\ninterface Props extends Aria.MenuItemRenderProps, PropsWithChildren {\n selectionVariant?: \"control\" | \"navigation\" | \"switch\";\n isIndeterminate?: boolean;\n}\n\nexport const MenuItemContent: FC<Props> = (props) => {\n const {\n selectionMode,\n isSelected,\n selectionVariant = \"control\",\n isIndeterminate,\n children,\n } = props;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n },\n Avatar: {\n className: styles.avatar,\n },\n Kbd: {\n className: styles.kbd,\n },\n Badge: {\n className: styles.badge,\n },\n };\n\n const controlIconPropsContext: PropsContext = {\n Icon: {\n className: clsx(\n styles.controlIcon,\n styles.icon,\n (isSelected || isIndeterminate) && styles.controlIconActive,\n ),\n },\n Switch: {\n className: clsx(styles.controlIcon, styles.switch),\n labelPosition: \"leading\",\n },\n };\n\n const selectionIcon =\n selectionMode === \"none\" ||\n selectionVariant === \"navigation\" ? null : selectionVariant === \"switch\" ? (\n <Switch isReadOnly isSelected={isSelected} />\n ) : selectionMode === \"single\" && isSelected ? (\n <IconRadioOn />\n ) : selectionMode === \"single\" && !isSelected ? (\n <IconRadioOff />\n ) : selectionMode === \"multiple\" && isSelected ? (\n <IconCheckboxChecked />\n ) : selectionMode === \"multiple\" && isIndeterminate ? (\n <IconCheckboxIndeterminate />\n ) : (\n <IconCheckboxEmpty />\n );\n\n return (\n <>\n <PropsContextProvider props={controlIconPropsContext}>\n {selectionIcon}\n </PropsContextProvider>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAa,mBAA8B,UAAU;CACnD,MAAM,EACJ,eACA,YACA,mBAAmB,WACnB,iBACA,aACE;CAEJ,MAAM,eAA6B;EACjC,MAAM,EACJ,WAAW,wBAAO,KACpB;EACA,QAAQ,EACN,WAAW,wBAAO,OACpB;EACA,KAAK,EACH,WAAW,wBAAO,IACpB;EACA,OAAO,EACL,WAAW,wBAAO,MACpB;CACF;CAEA,MAAM,0BAAwC;EAC5C,MAAM,EACJ,WAAW,KACT,wBAAO,aACP,wBAAO,OACN,cAAc,oBAAoB,wBAAO,iBAC5C,EACF;EACA,QAAQ;GACN,WAAW,KAAK,wBAAO,aAAa,wBAAO,MAAM;GACjD,eAAe;EACjB;CACF;CAkBA,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,sBAAD;EAAsB,OAAO;EAC1B,UAlBL,kBAAkB,UAClB,qBAAqB,eAAe,OAAO,qBAAqB,WAC9D,oBAAC,QAAD;GAAQ,YAAA;GAAuB;EAAa,CAAA,IAC1C,kBAAkB,YAAY,aAChC,oBAAC,aAAD,CAAc,CAAA,IACZ,kBAAkB,YAAY,CAAC,aACjC,oBAAC,cAAD,CAAe,CAAA,IACb,kBAAkB,cAAc,aAClC,oBAAC,qBAAD,CAAsB,CAAA,IACpB,kBAAkB,cAAc,kBAClC,oBAAC,2BAAD,CAA4B,CAAA,IAE5B,oBAAC,mBAAD,CAAoB,CAAA;CAOE,CAAA,GACtB,oBAAC,sBAAD;EAAsB,OAAO;EAC1B;CACmB,CAAA,CACtB,EAAA,CAAA;AAEN"}
|
|
@@ -7,7 +7,7 @@ import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
|
|
|
7
7
|
import { IconContextMenu } from "../Icon/components/icons/IconContextMenu.mjs";
|
|
8
8
|
import { useLocalizedStringFormatter } from "../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
9
9
|
import Message_module_default from "./Message.module.mjs";
|
|
10
|
-
import __locale_default from "../../../../../_virtual/
|
|
10
|
+
import __locale_default from "../../../../../_virtual/_26.locale.mjs";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -4,7 +4,7 @@ import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLoc
|
|
|
4
4
|
import { Separator } from "../../../Separator/Separator.mjs";
|
|
5
5
|
import { Content } from "../../../Content/Content.mjs";
|
|
6
6
|
import MessageSeparator_module_default from "./MessageSeparator.module.mjs";
|
|
7
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
7
|
+
import __locale_default from "../../../../../../../_virtual/_27.locale.mjs";
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import * as Aria from "react-aria-components";
|
|
@@ -15,7 +15,7 @@ import DivView from "../../views/DivView.mjs";
|
|
|
15
15
|
import { Overlay } from "../Overlay/Overlay.mjs";
|
|
16
16
|
import Modal_module_default from "./Modal.module.mjs";
|
|
17
17
|
import { OffCanvasSuspenseFallback } from "./components/OffCanvasSuspenseFallback/OffCanvasSuspenseFallback.mjs";
|
|
18
|
-
import __locale_default from "../../../../../_virtual/
|
|
18
|
+
import __locale_default from "../../../../../_virtual/_23.locale.mjs";
|
|
19
19
|
import { ConfirmUnsavedChangesModal } from "./components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs";
|
|
20
20
|
import { useVirtualKeyboardVisible } from "../../lib/hooks/dom/useVirtualKeyboardVisible.mjs";
|
|
21
21
|
import clsx from "clsx";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.module.mjs","names":[],"sources":["../../../../../../../src/components/Modal/Modal.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n/* Caps the dialog width per size token (`size-s` / `size-m` / `size-l`). */\n@mixin size($size) {\n &.size-#{$size} {\n [role=\"dialog\"] {\n width: inherit;\n max-width: var(--modal--size--#{$size});\n }\n }\n}\n\n/* ===========================================================================\n Base — shared by Modal (centered / bottom sheet) and OffCanvas (side panel).\n =========================================================================== */\n.modal,\n.offCanvas {\n /* Overlay.module.scss lays the viewport out; the dialog inside it is the only\n pointer target. */\n > :global(.flow--overlay--viewport) {\n pointer-events: none;\n\n /* react-aria's own modal wrapper — it gets no className from Flow, so\n its default `react-aria-Modal` class is the handle. */\n > :global(.react-aria-Modal) {\n display: flex;\n justify-content: center;\n width: inherit;\n max-height: var(--visual-viewport-height);\n padding: var(--size-px--xl);\n }\n }\n\n /* Close button: hidden when an action group is present, unless forced. */\n &:has(.actionGroup) {\n .closeButton:not(.alwaysVisible) {\n display: none;\n }\n }\n\n .closeButton.alwaysHidden {\n display: none;\n }\n\n /* The dialog card itself — a flex column. It is also the scroll container on\n mobile, and the sticky header/footer stack against its content only. */\n [role=\"dialog\"] {\n display: flex;\n flex-direction: column;\n isolation: isolate;\n max-height: 100%;\n overflow: hidden;\n outline: none;\n pointer-events: all;\n background-color: var(--modal--background-color);\n border: var(--modal--border-width) var(--modal--border-style)\n var(--modal--border-color);\n\n // A consumer `Form` (or raw `<form>`) wrapping the modal content. `Form`\n // is a plain FC, so the props context cannot give it a class.\n // stylelint-disable-next-line selector-max-type -- consumer form, no class\n > form {\n display: contents;\n }\n }\n\n /* Header */\n // A `Header`/`SectionHeader` — or a raw `<header>` — the consumer places in\n // the modal; both must match.\n // stylelint-disable-next-line selector-max-type -- consumer-placed header\n header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: var(--heading--icon-to-text-spacing);\n padding-top: var(--modal--header-padding-top);\n padding-inline: var(--modal--padding);\n\n /* Flatten the heading's text and content spans into the header row, so\n badges stay behind the title instead of wrapping onto their own line.\n Heading's spans do carry classes, but `.flow--heading--heading-content`\n already sets `display: none` on `:empty` at the same specificity a class\n selector here would reach — source order would then decide. */\n // stylelint-disable-next-line selector-max-type -- see above\n > span {\n display: contents;\n }\n\n .headerTitle {\n min-width: 0;\n }\n\n .closeButton {\n order: 1;\n margin-inline-start: auto;\n }\n }\n\n /* Content — the scrollable body */\n .content,\n .columnLayout {\n @include scrollbar.scrollbar;\n\n flex-grow: 1;\n min-height: var(--modal--content-min-height);\n padding: var(--modal--padding);\n overflow: hidden auto;\n background-color: var(--modal--background-color);\n }\n\n .columnLayout .accentBox {\n position: sticky;\n top: 0;\n height: fit-content;\n }\n\n /* Action group — the footer */\n .actionGroup {\n padding: var(--modal--padding);\n background-color: var(--modal--footer-background-color);\n }\n\n /* ActionGroup's \"sorted\" layout sets flex-grow:1 on itself; the modal footer\n must keep its natural height (otherwise it fills the full-height off-canvas\n panel). Scope via the dialog so flex-grow:0 wins the equal-specificity /\n source-order battle — without raising the specificity of the padding above,\n which the mobile rules override. */\n [role=\"dialog\"] .actionGroup {\n flex-grow: 0;\n }\n}\n\n/* ===========================================================================\n Modal — desktop (centered dialog, zoom in/out).\n =========================================================================== */\n@media (width > 768px) {\n .modal {\n @include size(s);\n @include size(m);\n @include size(l);\n\n [role=\"dialog\"] {\n border-radius: var(--modal--corner-radius);\n }\n\n > :global(.flow--overlay--viewport) > :global(.react-aria-Modal) {\n &[data-entering] {\n animation: modal-zoom var(--transition--duration--slow)\n cubic-bezier(0.1, 0.8, 0.3, 1.2);\n }\n\n &[data-exiting] {\n animation: modal-zoom var(--transition--duration--default)\n cubic-bezier(0.1, 0.8, 0.3, 1.2) reverse;\n }\n }\n }\n}\n\n/* ===========================================================================\n OffCanvas — side panel (all widths), full height, slides in from the side.\n =========================================================================== */\n.offCanvas {\n @include size(s);\n @include size(m);\n @include size(l);\n\n [role=\"dialog\"] {\n height: 100%;\n border-radius: 0;\n }\n\n > :global(.flow--overlay--viewport) {\n padding-inline-start: var(--size-px--m);\n\n > :global(.react-aria-Modal) {\n justify-content: flex-end;\n width: inherit;\n height: inherit;\n padding: unset;\n\n &[data-entering] {\n animation: modal-slide-in-from-right var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-in-from-right\n var(--transition--duration--default) reverse;\n }\n }\n }\n\n &.left {\n > :global(.flow--overlay--viewport) {\n padding-inline: 0 var(--size-px--m);\n\n > :global(.react-aria-Modal) {\n justify-content: flex-start;\n padding: unset;\n\n &[data-entering] {\n animation: modal-slide-in-from-left var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-in-from-left\n var(--transition--duration--default) reverse;\n }\n }\n }\n }\n}\n\n/* ===========================================================================\n Modal — mobile (bottom sheet), issue #2423.\n\n One scroll container: the dialog scrolls while the header sticks to the top\n and the footer to the bottom. While the virtual keyboard is open\n (.keyboardVisible) both un-stick so header + content + footer flow normally\n and the content gets the full available space.\n =========================================================================== */\n@media (max-width: 768px) {\n .modal {\n /* Bottom-anchored sheet: rounded top corners + slide-up animation. */\n > :global(.flow--overlay--viewport) > :global(.react-aria-Modal) {\n margin-top: auto;\n width: 100%;\n padding: unset;\n overflow: hidden;\n border-start-start-radius: var(--modal--corner-radius);\n border-start-end-radius: var(--modal--corner-radius);\n pointer-events: all;\n\n &[data-entering] {\n animation: modal-slide-up var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-up var(--transition--duration--default) reverse;\n }\n }\n\n /* The dialog is the single scroll container. Capped just below the visual\n viewport so a full-height sheet keeps a small gap from the top edge. */\n [role=\"dialog\"] {\n @include scrollbar.scrollbar;\n\n width: inherit;\n max-height: calc(\n var(--visual-viewport-height) - var(--modal--tray-top-spacing)\n );\n overflow: hidden auto;\n }\n\n // stylelint-disable-next-line selector-max-type -- consumer form, see above\n [role=\"dialog\"] > form {\n width: inherit;\n }\n\n /* flex: 0 0 auto keeps natural heights; without flex-shrink:0 the flex\n column compresses the content box and the (overflow:visible) fields\n spill over the footer. */\n .header,\n .content,\n .columnLayout,\n .actionGroup {\n flex: 0 0 auto;\n }\n\n .content,\n .columnLayout {\n min-height: 0;\n overflow: visible;\n }\n\n /* Docked header + footer (sticky within the single scroll container). */\n .header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--modal--background-color);\n }\n\n .actionGroup {\n position: sticky;\n bottom: 0;\n z-index: 1;\n }\n }\n\n /* Keyboard open: un-stick both so everything flows for maximum typing space.\n The dialog fills the available height and the footer uses margin-top:auto,\n so with SHORT content the footer still sits at the bottom (not mid-air) and\n with tall content it scrolls away with everything else. Never hidden. */\n .modal.keyboardVisible {\n [role=\"dialog\"] {\n min-height: calc(\n var(--visual-viewport-height) - var(--modal--tray-top-spacing)\n );\n }\n\n .header,\n .actionGroup {\n position: static;\n }\n\n .actionGroup {\n margin-top: auto;\n }\n }\n\n /* Shared mobile spacing + full-width stacked actions (Modal + OffCanvas). */\n .modal,\n .offCanvas {\n .header {\n padding-inline: var(--modal--padding-mobile);\n }\n\n .content,\n .columnLayout,\n .actionGroup {\n padding: var(--modal--padding-mobile);\n }\n\n .actionGroup {\n flex-direction: column;\n\n // The footer's buttons are consumer `Button`/`Action` children; a raw\n // `<button>` matches today too.\n // stylelint-disable-next-line selector-max-type -- consumer children\n button {\n width: 100%;\n }\n }\n }\n}\n\n/* ===========================================================================\n Animations\n =========================================================================== */\n@keyframes modal-zoom {\n /* Start with scale(1) to let ResizeObservers take the correct width on mount. */\n 0% {\n opacity: 0;\n transform: scale(1);\n }\n\n 0.1% {\n opacity: 1;\n transform: scale(0.8);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes modal-slide-up {\n from {\n translate: 0 30%;\n }\n\n to {\n translate: 0 0;\n }\n}\n\n@keyframes modal-slide-in-from-right {\n from {\n translate: 30% 0;\n }\n\n to {\n translate: 0 0;\n }\n}\n\n@keyframes modal-slide-in-from-left {\n from {\n translate: -30% 0;\n }\n\n to {\n translate: 0 0;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Modal.module.mjs","names":[],"sources":["../../../../../../../src/components/Modal/Modal.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n/* Caps the dialog width per size token (`size-s` / `size-m` / `size-l`). */\n@mixin size($size) {\n &.size-#{$size} {\n [role=\"dialog\"] {\n width: inherit;\n max-width: var(--modal--size--#{$size});\n }\n }\n}\n\n/* ===========================================================================\n Base — shared by Modal (centered / bottom sheet) and OffCanvas (side panel).\n =========================================================================== */\n.modal,\n.offCanvas {\n /* Overlay.module.scss lays the viewport out; the dialog inside it is the only\n pointer target. */\n > :global(.flow--overlay--viewport) {\n pointer-events: none;\n\n /* react-aria's own modal wrapper — it gets no className from Flow, so\n its default `react-aria-Modal` class is the handle. */\n > :global(.react-aria-Modal) {\n display: flex;\n justify-content: center;\n width: inherit;\n max-height: var(--visual-viewport-height);\n padding: var(--size-px--xl);\n }\n }\n\n /* Close button: hidden when an action group is present, unless forced. */\n &:has(.actionGroup) {\n .closeButton:not(.alwaysVisible) {\n display: none;\n }\n }\n\n .closeButton.alwaysHidden {\n display: none;\n }\n\n /* The dialog card itself — a flex column. It is also the scroll container on\n mobile, and the sticky header/footer stack against its content only. */\n [role=\"dialog\"] {\n display: flex;\n flex-direction: column;\n isolation: isolate;\n max-height: 100%;\n overflow: hidden;\n outline: none;\n pointer-events: all;\n background-color: var(--modal--background-color);\n border: var(--modal--border-width) var(--modal--border-style)\n var(--modal--border-color);\n\n // A consumer `Form` (or raw `<form>`) wrapping the modal content. `Form`\n // is a plain FC, so the props context cannot give it a class.\n // stylelint-disable-next-line selector-max-type -- consumer form, no class\n > form {\n display: contents;\n }\n }\n\n /* Header */\n // A `Header`/`SectionHeader` — or a raw `<header>` — the consumer places in\n // the modal; both must match.\n // stylelint-disable-next-line selector-max-type -- consumer-placed header\n header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: var(--heading--icon-to-text-spacing);\n padding-top: var(--modal--header-padding-top);\n padding-inline: var(--modal--padding);\n\n /* Flatten the heading's text and content spans into the header row, so\n badges stay behind the title instead of wrapping onto their own line.\n Heading's spans do carry classes, but `.flow--heading--heading-content`\n already sets `display: none` on `:empty` at the same specificity a class\n selector here would reach — source order would then decide. */\n // stylelint-disable-next-line selector-max-type -- see above\n > span {\n display: contents;\n }\n\n :global(.flow--heading--heading-text-spacer) {\n display: none;\n }\n\n :global(.flow--heading--heading-content)\n :global(.flow--heading--heading-content-item):not(:last-child) {\n margin-inline-end: 0;\n }\n\n .headerTitle {\n min-width: 0;\n }\n\n .closeButton {\n order: 1;\n margin-inline-start: auto;\n }\n }\n\n /* Content — the scrollable body */\n .content,\n .columnLayout {\n @include scrollbar.scrollbar;\n\n flex-grow: 1;\n min-height: var(--modal--content-min-height);\n padding: var(--modal--padding);\n overflow: hidden auto;\n background-color: var(--modal--background-color);\n }\n\n .columnLayout .accentBox {\n position: sticky;\n top: 0;\n height: fit-content;\n }\n\n /* Action group — the footer */\n .actionGroup {\n padding: var(--modal--padding);\n background-color: var(--modal--footer-background-color);\n }\n\n /* ActionGroup's \"sorted\" layout sets flex-grow:1 on itself; the modal footer\n must keep its natural height (otherwise it fills the full-height off-canvas\n panel). Scope via the dialog so flex-grow:0 wins the equal-specificity /\n source-order battle — without raising the specificity of the padding above,\n which the mobile rules override. */\n [role=\"dialog\"] .actionGroup {\n flex-grow: 0;\n }\n}\n\n/* ===========================================================================\n Modal — desktop (centered dialog, zoom in/out).\n =========================================================================== */\n@media (width > 768px) {\n .modal {\n @include size(s);\n @include size(m);\n @include size(l);\n\n [role=\"dialog\"] {\n border-radius: var(--modal--corner-radius);\n }\n\n > :global(.flow--overlay--viewport) > :global(.react-aria-Modal) {\n &[data-entering] {\n animation: modal-zoom var(--transition--duration--slow)\n cubic-bezier(0.1, 0.8, 0.3, 1.2);\n }\n\n &[data-exiting] {\n animation: modal-zoom var(--transition--duration--default)\n cubic-bezier(0.1, 0.8, 0.3, 1.2) reverse;\n }\n }\n }\n}\n\n/* ===========================================================================\n OffCanvas — side panel (all widths), full height, slides in from the side.\n =========================================================================== */\n.offCanvas {\n @include size(s);\n @include size(m);\n @include size(l);\n\n [role=\"dialog\"] {\n height: 100%;\n border-radius: 0;\n }\n\n > :global(.flow--overlay--viewport) {\n padding-inline-start: var(--size-px--m);\n\n > :global(.react-aria-Modal) {\n justify-content: flex-end;\n width: inherit;\n height: inherit;\n padding: unset;\n\n &[data-entering] {\n animation: modal-slide-in-from-right var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-in-from-right\n var(--transition--duration--default) reverse;\n }\n }\n }\n\n &.left {\n > :global(.flow--overlay--viewport) {\n padding-inline: 0 var(--size-px--m);\n\n > :global(.react-aria-Modal) {\n justify-content: flex-start;\n padding: unset;\n\n &[data-entering] {\n animation: modal-slide-in-from-left var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-in-from-left\n var(--transition--duration--default) reverse;\n }\n }\n }\n }\n}\n\n/* ===========================================================================\n Modal — mobile (bottom sheet), issue #2423.\n\n One scroll container: the dialog scrolls while the header sticks to the top\n and the footer to the bottom. While the virtual keyboard is open\n (.keyboardVisible) both un-stick so header + content + footer flow normally\n and the content gets the full available space.\n =========================================================================== */\n@media (max-width: 768px) {\n .modal {\n /* Bottom-anchored sheet: rounded top corners + slide-up animation. */\n > :global(.flow--overlay--viewport) > :global(.react-aria-Modal) {\n margin-top: auto;\n width: 100%;\n padding: unset;\n overflow: hidden;\n border-start-start-radius: var(--modal--corner-radius);\n border-start-end-radius: var(--modal--corner-radius);\n pointer-events: all;\n\n &[data-entering] {\n animation: modal-slide-up var(--transition--duration--slow);\n }\n\n &[data-exiting] {\n animation: modal-slide-up var(--transition--duration--default) reverse;\n }\n }\n\n /* The dialog is the single scroll container. Capped just below the visual\n viewport so a full-height sheet keeps a small gap from the top edge. */\n [role=\"dialog\"] {\n @include scrollbar.scrollbar;\n\n width: inherit;\n max-height: calc(\n var(--visual-viewport-height) - var(--modal--tray-top-spacing)\n );\n overflow: hidden auto;\n }\n\n // stylelint-disable-next-line selector-max-type -- consumer form, see above\n [role=\"dialog\"] > form {\n width: inherit;\n }\n\n /* flex: 0 0 auto keeps natural heights; without flex-shrink:0 the flex\n column compresses the content box and the (overflow:visible) fields\n spill over the footer. */\n .header,\n .content,\n .columnLayout,\n .actionGroup {\n flex: 0 0 auto;\n }\n\n .content,\n .columnLayout {\n min-height: 0;\n overflow: visible;\n }\n\n /* Docked header + footer (sticky within the single scroll container). */\n .header {\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: var(--modal--background-color);\n }\n\n .actionGroup {\n position: sticky;\n bottom: 0;\n z-index: 1;\n }\n }\n\n /* Keyboard open: un-stick both so everything flows for maximum typing space.\n The dialog fills the available height and the footer uses margin-top:auto,\n so with SHORT content the footer still sits at the bottom (not mid-air) and\n with tall content it scrolls away with everything else. Never hidden. */\n .modal.keyboardVisible {\n [role=\"dialog\"] {\n min-height: calc(\n var(--visual-viewport-height) - var(--modal--tray-top-spacing)\n );\n }\n\n .header,\n .actionGroup {\n position: static;\n }\n\n .actionGroup {\n margin-top: auto;\n }\n }\n\n /* Shared mobile spacing + full-width stacked actions (Modal + OffCanvas). */\n .modal,\n .offCanvas {\n .header {\n padding-inline: var(--modal--padding-mobile);\n }\n\n .content,\n .columnLayout,\n .actionGroup {\n padding: var(--modal--padding-mobile);\n }\n\n .actionGroup {\n flex-direction: column;\n\n // The footer's buttons are consumer `Button`/`Action` children; a raw\n // `<button>` matches today too.\n // stylelint-disable-next-line selector-max-type -- consumer children\n button {\n width: 100%;\n }\n }\n }\n}\n\n/* ===========================================================================\n Animations\n =========================================================================== */\n@keyframes modal-zoom {\n /* Start with scale(1) to let ResizeObservers take the correct width on mount. */\n 0% {\n opacity: 0;\n transform: scale(1);\n }\n\n 0.1% {\n opacity: 1;\n transform: scale(0.8);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes modal-slide-up {\n from {\n translate: 0 30%;\n }\n\n to {\n translate: 0 0;\n }\n}\n\n@keyframes modal-slide-in-from-right {\n from {\n translate: 30% 0;\n }\n\n to {\n translate: 0 0;\n }\n}\n\n@keyframes modal-slide-in-from-left {\n from {\n translate: -30% 0;\n }\n\n to {\n translate: 0 0;\n }\n}\n"],"mappings":""}
|
|
@@ -8,7 +8,7 @@ import HeadingView from "../../../../views/HeadingView.mjs";
|
|
|
8
8
|
import TextView from "../../../../views/TextView.mjs";
|
|
9
9
|
import ContentView from "../../../../views/ContentView.mjs";
|
|
10
10
|
import ActionGroupView from "../../../../views/ActionGroupView.mjs";
|
|
11
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
11
|
+
import __locale_default from "../../../../../../../_virtual/_23.locale.mjs";
|
|
12
12
|
import { Modal } from "../../Modal.mjs";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.tsx
|
|
@@ -7,7 +7,7 @@ import { Button } from "../Button/Button.mjs";
|
|
|
7
7
|
import { AlertIcon } from "../AlertIcon/AlertIcon.mjs";
|
|
8
8
|
import { Link } from "../Link/Link.mjs";
|
|
9
9
|
import Notification_module_default from "./Notification.module.mjs";
|
|
10
|
-
import __locale_default from "../../../../../_virtual/
|
|
10
|
+
import __locale_default from "../../../../../_virtual/_28.locale.mjs";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useLocalizedStringFormatter } from "react-aria";
|
package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import PasswordCreationField_module_default from "./PasswordCreationField.module
|
|
|
13
13
|
import { defaultPasswordCreationPolicy } from "../../integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs";
|
|
14
14
|
import { Policy } from "../../../../../@mittwald/password-tools-js.mjs";
|
|
15
15
|
import getStateFromLatestPolicyValidationResult from "./lib/getStateFromLatestPolicyValidationResult.mjs";
|
|
16
|
-
import __locale_default from "../../../../../_virtual/
|
|
16
|
+
import __locale_default from "../../../../../_virtual/_29.locale.mjs";
|
|
17
17
|
import generateValidationTranslation from "./lib/generateValidationTranslation.mjs";
|
|
18
18
|
import { ComplexityIndicator } from "./components/ComplexityIndicator/ComplexityIndicator.mjs";
|
|
19
19
|
import { generatePassword } from "./worker/generatePassword.mjs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import { Button } from "../../../Button/Button.mjs";
|
|
5
5
|
import { Action } from "../../../Action/Action.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../../_virtual/_29.locale.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.tsx
|
|
@@ -7,7 +7,7 @@ import { Button } from "../../../Button/Button.mjs";
|
|
|
7
7
|
import { Action } from "../../../Action/Action.mjs";
|
|
8
8
|
import { TooltipTrigger } from "../../../Tooltip/components/TooltipTrigger/TooltipTrigger.mjs";
|
|
9
9
|
import { Tooltip } from "../../../Tooltip/Tooltip.mjs";
|
|
10
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
10
|
+
import __locale_default from "../../../../../../../_virtual/_29.locale.mjs";
|
|
11
11
|
import "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.tsx
|
|
@@ -5,7 +5,7 @@ import { Button } from "../../../Button/Button.mjs";
|
|
|
5
5
|
import { ContextualHelpTrigger } from "../../../ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs";
|
|
6
6
|
import { Heading } from "../../../Heading/Heading.mjs";
|
|
7
7
|
import { ContextualHelp } from "../../../ContextualHelp/ContextualHelp.mjs";
|
|
8
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
8
|
+
import __locale_default from "../../../../../../../_virtual/_29.locale.mjs";
|
|
9
9
|
import { ValidationResultEntry } from "../ValidationResultEntry/ValidationResultEntry.mjs";
|
|
10
10
|
import ValidationResultButton_module_default from "./ValidationResultButton.module.mjs";
|
|
11
11
|
import { useId } from "react";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
4
|
import { AlertIcon } from "../../../AlertIcon/AlertIcon.mjs";
|
|
5
5
|
import { Text } from "../../../Text/Text.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../../_virtual/_29.locale.mjs";
|
|
7
7
|
import generateValidationTranslation from "../../lib/generateValidationTranslation.mjs";
|
|
8
8
|
import ValidationResultEntry_module_default from "./ValidationResultEntry.module.mjs";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
|
-
import __locale_default from "../../../../../../_virtual/
|
|
4
|
+
import __locale_default from "../../../../../../_virtual/_29.locale.mjs";
|
|
5
5
|
import { useEffect, useRef } from "react";
|
|
6
6
|
import { announce } from "@react-aria/live-announcer";
|
|
7
7
|
//#region src/components/PasswordCreationField/lib/ariaAnnounce.ts
|
package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { flowComponent } from "../../../../lib/componentFactory/flowComponent.mjs";
|
|
4
4
|
import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
5
5
|
import Rating_module_default from "../../Rating.module.mjs";
|
|
6
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
6
|
+
import __locale_default from "../../../../../../../_virtual/_30.locale.mjs";
|
|
7
7
|
import { useRatingSegmentContext } from "../../context.mjs";
|
|
8
8
|
import { FilledSegment } from "./FilledSegment.mjs";
|
|
9
9
|
import { EmptySegment } from "./EmptySegment.mjs";
|
|
@@ -11,7 +11,7 @@ import FormField_module_default from "../FormField/FormField.module.mjs";
|
|
|
11
11
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
12
12
|
import { useControlledHostValueProps } from "../../lib/remote/useControlledHostValueProps.mjs";
|
|
13
13
|
import SearchField_module_default from "./SearchField.module.mjs";
|
|
14
|
-
import __locale_default from "../../../../../_virtual/
|
|
14
|
+
import __locale_default from "../../../../../_virtual/_22.locale.mjs";
|
|
15
15
|
import clsx from "clsx";
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import * as Aria from "react-aria-components";
|
|
@@ -9,7 +9,7 @@ import { Button } from "../Button/Button.mjs";
|
|
|
9
9
|
import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
|
|
10
10
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
11
11
|
import Slider_module_default from "./Slider.module.mjs";
|
|
12
|
-
import __locale_default from "../../../../../_virtual/
|
|
12
|
+
import __locale_default from "../../../../../_virtual/_19.locale.mjs";
|
|
13
13
|
import clsx from "clsx";
|
|
14
14
|
import "react";
|
|
15
15
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -12,7 +12,7 @@ import ContextMenuTriggerView from "../../views/ContextMenuTriggerView.mjs";
|
|
|
12
12
|
import ContextMenuView from "../../views/ContextMenuView.mjs";
|
|
13
13
|
import TabNavigation_module_default from "./TabNavigation.module.mjs";
|
|
14
14
|
import { LinkContent } from "./components/LinkContent/LinkContent.mjs";
|
|
15
|
-
import __locale_default from "../../../../../_virtual/
|
|
15
|
+
import __locale_default from "../../../../../_virtual/_18.locale.mjs";
|
|
16
16
|
import useCollapsingItems from "./lib/useCollapsingItems.mjs";
|
|
17
17
|
import clsx from "clsx";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/js/packages/components/src/components/Tabs/components/FallbackTab/FallbackTab.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { Text } from "../../../Text/Text.mjs";
|
|
|
6
6
|
import { Heading } from "../../../Heading/Heading.mjs";
|
|
7
7
|
import { IllustratedMessage } from "../../../IllustratedMessage/IllustratedMessage.mjs";
|
|
8
8
|
import Tabs_module_default from "../../Tabs.module.mjs";
|
|
9
|
-
import __locale_default from "../../../../../../../_virtual/
|
|
9
|
+
import __locale_default from "../../../../../../../_virtual/_32.locale.mjs";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/Tabs/components/FallbackTab/FallbackTab.tsx
|
|
12
12
|
var FallbackTab = (props) => {
|
|
@@ -8,7 +8,7 @@ import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
|
8
8
|
import { useControlledHostValueProps } from "../../lib/remote/useControlledHostValueProps.mjs";
|
|
9
9
|
import { FieldDescription } from "../FieldDescription/FieldDescription.mjs";
|
|
10
10
|
import TextArea_module_default from "./TextArea.module.mjs";
|
|
11
|
-
import __locale_default from "../../../../../_virtual/
|
|
11
|
+
import __locale_default from "../../../../../_virtual/_24.locale.mjs";
|
|
12
12
|
import clsx from "clsx";
|
|
13
13
|
import { useEffect, useLayoutEffect, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +11,7 @@ import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
|
11
11
|
import { useControlledHostValueProps } from "../../lib/remote/useControlledHostValueProps.mjs";
|
|
12
12
|
import { FieldDescription } from "../FieldDescription/FieldDescription.mjs";
|
|
13
13
|
import TextField_module_default from "./TextField.module.mjs";
|
|
14
|
-
import __locale_default from "../../../../../_virtual/
|
|
14
|
+
import __locale_default from "../../../../../_virtual/_33.locale.mjs";
|
|
15
15
|
import clsx from "clsx";
|
|
16
16
|
import { useState } from "react";
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|