@mittwald/flow-react-components 1.4.0-next.6 → 1.4.0-next.8
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/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/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/ImageCropper/ImageCropper.mjs +1 -1
- package/dist/js/packages/components/src/components/Kbd/Kbd.mjs +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 +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 +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +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/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/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
|
@@ -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 HeadingView from "../../../../../../views/HeadingView.mjs";
|
|
6
6
|
import { useList } from "../../../../hooks/useList.mjs";
|
|
7
7
|
import { useAvailableViewModes } from "../../lib.mjs";
|
|
@@ -6,7 +6,7 @@ import { useOverlayController } from "../../../../../../lib/controller/overlay/u
|
|
|
6
6
|
import { Popover } from "../../../../../Popover/Popover.mjs";
|
|
7
7
|
import ButtonView from "../../../../../../views/ButtonView.mjs";
|
|
8
8
|
import { PopoverTrigger } from "../../../../../Popover/components/PopoverTrigger/PopoverTrigger.mjs";
|
|
9
|
-
import __locale_default from "../../../../../../../../../_virtual/
|
|
9
|
+
import __locale_default from "../../../../../../../../../_virtual/_17.locale.mjs";
|
|
10
10
|
import TextView from "../../../../../../views/TextView.mjs";
|
|
11
11
|
import Header_module_default from "../../Header.module.mjs";
|
|
12
12
|
import FilterContextMenus_module_default from "./FilterContextMenus.module.mjs";
|
|
@@ -18,6 +18,7 @@ var FilterContextMenu = (props) => {
|
|
|
18
18
|
selectionMode
|
|
19
19
|
}, v.id));
|
|
20
20
|
const activeFilterKeys = values.filter((v) => v.isActive).map((v) => v.id);
|
|
21
|
+
const onSelectionChange = selectionMode === "multiple" ? (keys) => keys === "all" ? filter.selectAll() : filter.setActiveValueIds(keys) : void 0;
|
|
21
22
|
return /* @__PURE__ */ jsxs(ContextMenuTriggerView, { children: [/* @__PURE__ */ jsxs(ButtonView, {
|
|
22
23
|
className: Header_module_default.hideOnMobile,
|
|
23
24
|
variant: "outline",
|
|
@@ -27,6 +28,8 @@ var FilterContextMenu = (props) => {
|
|
|
27
28
|
}), /* @__PURE__ */ jsx(ContextMenuView, {
|
|
28
29
|
selectionMode,
|
|
29
30
|
selectedKeys: activeFilterKeys,
|
|
31
|
+
onSelectionChange,
|
|
32
|
+
showSelectAll: filter.isSelectAllAvailable,
|
|
30
33
|
children: filterItems
|
|
31
34
|
})] });
|
|
32
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterContextMenu.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport type { Filter } from \"@/components/List/model/filter/Filter\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport TextView from \"@/views/TextView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { FilterMenuItem } from \"@/components/List/components/Header/components/FilterContextMenu/FilterMenuItem\";\nimport styles from \"@/components/List/components/Header/Header.module.scss\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\ninterface Props {\n filter: Filter;\n isDisabled?: boolean;\n}\n\nexport const FilterContextMenu: FC<Props> = (props) => {\n const { filter, isDisabled } = props;\n\n const { values, mode, name, property } = filter;\n\n const selectionMode = mode === \"one\" ? \"single\" : \"multiple\";\n\n const filterItems = values.map((v) => (\n <FilterMenuItem filterValue={v} key={v.id} selectionMode={selectionMode} />\n ));\n\n const activeFilterKeys = values.filter((v) => v.isActive).map((v) => v.id);\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n className={styles.hideOnMobile}\n variant=\"outline\"\n color=\"secondary\"\n isDisabled={isDisabled}\n >\n <TextView>{name ?? property}</TextView>\n <IconFilter />\n </ButtonView>\n <ContextMenuView\n selectionMode={selectionMode}\n selectedKeys={activeFilterKeys}\n >\n {filterItems}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FilterContextMenu.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport type { Selection } from \"react-aria-components\";\nimport type { Filter } from \"@/components/List/model/filter/Filter\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport TextView from \"@/views/TextView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { FilterMenuItem } from \"@/components/List/components/Header/components/FilterContextMenu/FilterMenuItem\";\nimport styles from \"@/components/List/components/Header/Header.module.scss\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\ninterface Props {\n filter: Filter;\n isDisabled?: boolean;\n}\n\nexport const FilterContextMenu: FC<Props> = (props) => {\n const { filter, isDisabled } = props;\n\n const { values, mode, name, property } = filter;\n\n const selectionMode = mode === \"one\" ? \"single\" : \"multiple\";\n\n const filterItems = values.map((v) => (\n <FilterMenuItem filterValue={v} key={v.id} selectionMode={selectionMode} />\n ));\n\n const activeFilterKeys = values.filter((v) => v.isActive).map((v) => v.id);\n\n const onSelectionChange =\n selectionMode === \"multiple\"\n ? (keys: Selection) =>\n keys === \"all\" ? filter.selectAll() : filter.setActiveValueIds(keys)\n : undefined;\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n className={styles.hideOnMobile}\n variant=\"outline\"\n color=\"secondary\"\n isDisabled={isDisabled}\n >\n <TextView>{name ?? property}</TextView>\n <IconFilter />\n </ButtonView>\n <ContextMenuView\n selectionMode={selectionMode}\n selectedKeys={activeFilterKeys}\n onSelectionChange={onSelectionChange}\n showSelectAll={filter.isSelectAllAvailable}\n >\n {filterItems}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"mappings":";;;;;;;;;;;AAgBA,IAAa,qBAAgC,UAAU;CACrD,MAAM,EAAE,QAAQ,eAAe;CAE/B,MAAM,EAAE,QAAQ,MAAM,MAAM,aAAa;CAEzC,MAAM,gBAAgB,SAAS,QAAQ,WAAW;CAElD,MAAM,cAAc,OAAO,KAAK,MAC9B,oBAAC,gBAAD;EAAgB,aAAa;EAA6B;CAAgB,GAArC,EAAE,EAAmC,CAC3E;CAED,MAAM,mBAAmB,OAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,MAAM,EAAE,EAAE;CAEzE,MAAM,oBACJ,kBAAkB,cACb,SACC,SAAS,QAAQ,OAAO,UAAU,IAAI,OAAO,kBAAkB,IAAI,IACrE,KAAA;CAEN,OACE,qBAAC,wBAAD,EAAA,UAAA,CACE,qBAAC,YAAD;EACE,WAAW,sBAAO;EAClB,SAAQ;EACR,OAAM;EACM;EAJd,UAAA,CAME,oBAAC,UAAD,EAAA,UAAW,QAAQ,SAAmB,CAAA,GACtC,oBAAC,YAAD,CAAa,CAAA,CACH;CACZ,CAAA,GAAA,oBAAC,iBAAD;EACiB;EACf,cAAc;EACK;EACnB,eAAe,OAAO;EAErB,UAAA;CACc,CAAA,CACK,EAAA,CAAA;AAE5B"}
|
|
@@ -9,7 +9,7 @@ var FilterMenuItem = (props) => {
|
|
|
9
9
|
return /* @__PURE__ */ jsx(MenuItemView, {
|
|
10
10
|
id: filterValue.id,
|
|
11
11
|
onAction: () => {
|
|
12
|
-
if (selectionMode === "
|
|
12
|
+
if (selectionMode === "single" && !filterValue.isActive) filterValue.toggle();
|
|
13
13
|
},
|
|
14
14
|
children: filterValue.render()
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterMenuItem.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterMenuItem.tsx"],"sourcesContent":["import MenuItemView from \"@/views/MenuItemView\";\nimport { type FC } from \"react\";\nimport type { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\n\ninterface Props {\n filterValue: FilterValue;\n selectionMode?: ContextMenuSelectionMode;\n}\n\nexport const FilterMenuItem: FC<Props> = (props) => {\n const { filterValue, selectionMode } = props;\n\n return (\n <MenuItemView\n id={filterValue.id}\n onAction={() => {\n if (selectionMode === \"
|
|
1
|
+
{"version":3,"file":"FilterMenuItem.mjs","names":[],"sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterMenuItem.tsx"],"sourcesContent":["import MenuItemView from \"@/views/MenuItemView\";\nimport { type FC } from \"react\";\nimport type { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\n\ninterface Props {\n filterValue: FilterValue;\n selectionMode?: ContextMenuSelectionMode;\n}\n\nexport const FilterMenuItem: FC<Props> = (props) => {\n const { filterValue, selectionMode } = props;\n\n return (\n <MenuItemView\n id={filterValue.id}\n onAction={() => {\n if (selectionMode === \"single\" && !filterValue.isActive) {\n filterValue.toggle();\n }\n }}\n >\n {filterValue.render()}\n </MenuItemView>\n );\n};\n"],"mappings":";;;;;;AAUA,IAAa,kBAA6B,UAAU;CAClD,MAAM,EAAE,aAAa,kBAAkB;CAEvC,OACE,oBAAC,cAAD;EACE,IAAI,YAAY;EAChB,gBAAgB;GACd,IAAI,kBAAkB,YAAY,CAAC,YAAY,UAC7C,YAAY,OAAO;EAEvB;EAEC,UAAA,YAAY,OAAO;CACR,CAAA;AAElB"}
|
|
@@ -5,7 +5,7 @@ import { IconDescending } from "../../../../../Icon/components/icons/IconDescend
|
|
|
5
5
|
import { IconSorting } from "../../../../../Icon/components/icons/IconSorting.mjs";
|
|
6
6
|
import { useLocalizedStringFormatter } from "../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
7
7
|
import ButtonView from "../../../../../../views/ButtonView.mjs";
|
|
8
|
-
import __locale_default from "../../../../../../../../../_virtual/
|
|
8
|
+
import __locale_default from "../../../../../../../../../_virtual/_17.locale.mjs";
|
|
9
9
|
import ContextMenuTriggerView from "../../../../../../views/ContextMenuTriggerView.mjs";
|
|
10
10
|
import ContextMenuView from "../../../../../../views/ContextMenuView.mjs";
|
|
11
11
|
import TextView from "../../../../../../views/TextView.mjs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { IconView } from "../../../../../Icon/components/icons/IconView.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 ContextMenuView from "../../../../../../views/ContextMenuView.mjs";
|
|
9
9
|
import TextView from "../../../../../../views/TextView.mjs";
|
|
@@ -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 "../../../../hooks/useList.mjs";
|
|
6
6
|
import MenuItemView from "../../../../../../views/MenuItemView.mjs";
|
|
7
7
|
import "react";
|
|
@@ -4,7 +4,7 @@ import { IconChevronDown } from "../../../../../../Icon/components/icons/IconChe
|
|
|
4
4
|
import { IconChevronUp } from "../../../../../../Icon/components/icons/IconChevronUp.mjs";
|
|
5
5
|
import { useLocalizedStringFormatter } from "../../../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
6
6
|
import ButtonView from "../../../../../../../views/ButtonView.mjs";
|
|
7
|
-
import __locale_default from "../../../../../../../../../../_virtual/
|
|
7
|
+
import __locale_default from "../../../../../../../../../../_virtual/_17.locale.mjs";
|
|
8
8
|
import ListItemView_module_default from "../../../../ListItemView/ListItemView.module.mjs";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/List/components/Items/components/Item/components/AccordionButton.tsx
|
|
@@ -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
|
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;EAC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uB,KAAK,MAAM,EAAE,EAAE,KAC3C,CAAC;EAEH,OACE,WAAW,WAAW,WAAW,UACjC,WAAW,YAAY,UAAU,CAAC,CAAC,SAAS;CAEhD;CAEA,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,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AA4B;EAChD,KAAK,KAAK,WAAW,eAAe,KAAK,QAAQ,CAAC,CAAC,eAAe,KAAK;EACvE,KAAK,sBAAsB,KAAK;CAClC;CAEA,gBAAuB,IAAyB;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";
|
|
@@ -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";
|