@mittwald/flow-react-components 0.2.0-alpha.980 → 0.2.0-alpha.982
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/AGENTS.md +20 -1
- package/CHANGELOG.md +10 -0
- package/PATTERNS.md +6 -4
- package/dist/assets/doc-properties.json +1566 -1566
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +1 -0
- 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/SortingAccordion.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/lib.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/lib.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/List.mjs +7 -0
- package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/setupComponents/ListLoaderAsyncResource.mjs +9 -1
- package/dist/js/packages/components/src/components/List/setupComponents/ListLoaderAsyncResource.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/worker/generatePassword.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/worker/generatePassword.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +7 -0
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs +1 -0
- package/dist/js/packages/components/src/integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/@mittwald/password-tools-js/usePasswordCreationFieldValidation.mjs +8 -1
- package/dist/js/packages/components/src/integrations/@mittwald/password-tools-js/usePasswordCreationFieldValidation.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/nextjs/components/Link/Link.mjs +5 -0
- package/dist/js/packages/components/src/integrations/nextjs/components/Link/Link.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/nextjs/components/LinkProvider/LinkProvider.mjs +8 -1
- package/dist/js/packages/components/src/integrations/nextjs/components/LinkProvider/LinkProvider.mjs.map +1 -1
- package/dist/types/components/List/model/List.d.ts.map +1 -1
- package/dist/types/components/List/setupComponents/ListLoaderAsyncResource.d.ts.map +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts.map +1 -1
- package/dist/types/integrations/@mittwald/password-tools-js/usePasswordCreationFieldValidation.d.ts.map +1 -1
- package/dist/types/integrations/nextjs/components/Link/Link.d.ts.map +1 -1
- package/dist/types/integrations/nextjs/components/LinkProvider/LinkProvider.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -30,6 +30,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
30
30
|
import '../../../../listContext.mjs';
|
|
31
31
|
import 'mobx';
|
|
32
32
|
import '../../../../List.mjs';
|
|
33
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
33
34
|
import headerStyles from '../../Header.module.css.mjs';
|
|
34
35
|
import ContentView from '../../../../../../views/ContentView.mjs';
|
|
35
36
|
import SectionView from '../../../../../../views/SectionView.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllFiltersModal.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContentView from \"@/views/ContentView\";\nimport SectionView from \"@/views/SectionView\";\nimport { FilterAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordion\";\nimport { ViewModeAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion\";\nimport TextView from \"@/views/TextView\";\nimport { SortingAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/SortingAccordion\";\nimport ActionGroupView from \"@/views/ActionGroupView\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport HeadingView from \"@/views/HeadingView\";\nimport clsx from \"clsx\";\nimport Modal, { ModalTrigger } from \"@/components/Modal\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport { useAvailableViewModes } from \"../../lib\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const AllFiltersModal: FC<Props> = (props) => {\n const { isDisabled } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const totalItemCount =\n list.batches.getTotalItemsCount() ?? list.items.entries.length;\n\n const availableViewModes = useAvailableViewModes();\n\n const accordionCount =\n (availableViewModes.length > 1 ? 1 : 0) +\n (list.sorting.length > 0 ? 1 : 0) +\n list.filters.length;\n\n const expandAccordions = accordionCount <= 2;\n\n const filterAccordions = list.filters.map((f) => (\n <FilterAccordion\n filter={f}\n key={f.name}\n expandAccordions={expandAccordions}\n />\n ));\n\n const accordions = [\n availableViewModes.length > 1 && (\n <ViewModeAccordion key=\"viewMode\" expandAccordions={expandAccordions} />\n ),\n list.sorting.length > 0 && (\n <SortingAccordion key=\"sorting\" expandAccordions={expandAccordions} />\n ),\n ...filterAccordions,\n ].filter(Boolean);\n\n const hasSecondaryFilters = list.filters.some(\n (f) => f.priority === \"secondary\",\n );\n\n const controller = useOverlayController(\"Modal\", {\n reuseControllerFromContext: false,\n });\n\n if (accordions.length === 0) {\n return null;\n }\n\n return (\n <ModalTrigger controller={controller}>\n <ButtonView\n className={clsx(\n styles.hideOnMobile,\n hasSecondaryFilters ? undefined : styles.hideOnDesktop,\n )}\n variant=\"outline\"\n color=\"secondary\"\n isDisabled={isDisabled}\n >\n <TextView>{stringFormatter.format(\"filters.all\")}</TextView>\n <IconFilter />\n </ButtonView>\n\n <ButtonView\n className={styles.hideOnDesktop}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"filters.all\")}\n >\n <IconFilter />\n </ButtonView>\n\n <Modal offCanvas controller={controller}>\n <HeadingView>{stringFormatter.format(\"filters.all\")}</HeadingView>\n <ContentView>\n <SectionView>{...accordions}</SectionView>\n </ContentView>\n\n <ActionGroupView>\n <ButtonView onPress={() => controller.close()}>\n <TextView>\n {isInitiallyLoading ? (\n <SkeletonText width=\"16ch\" />\n ) : (\n stringFormatter.format(\"results.show\", {\n totalItemCount,\n })\n )}\n </TextView>\n </ButtonView>\n <ButtonView\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => {\n list.resetFilters();\n controller.close();\n }}\n >\n {stringFormatter.format(\"reset\")}\n </ButtonView>\n </ActionGroupView>\n </Modal>\n </ModalTrigger>\n );\n};\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AllFiltersModal.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContentView from \"@/views/ContentView\";\nimport SectionView from \"@/views/SectionView\";\nimport { FilterAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordion\";\nimport { ViewModeAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion\";\nimport TextView from \"@/views/TextView\";\nimport { SortingAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/SortingAccordion\";\nimport ActionGroupView from \"@/views/ActionGroupView\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport HeadingView from \"@/views/HeadingView\";\nimport clsx from \"clsx\";\nimport Modal, { ModalTrigger } from \"@/components/Modal\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport { useAvailableViewModes } from \"../../lib\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const AllFiltersModal: FC<Props> = (props) => {\n const { isDisabled } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const totalItemCount =\n list.batches.getTotalItemsCount() ?? list.items.entries.length;\n\n const availableViewModes = useAvailableViewModes();\n\n const accordionCount =\n (availableViewModes.length > 1 ? 1 : 0) +\n (list.sorting.length > 0 ? 1 : 0) +\n list.filters.length;\n\n const expandAccordions = accordionCount <= 2;\n\n const filterAccordions = list.filters.map((f) => (\n <FilterAccordion\n filter={f}\n key={f.name}\n expandAccordions={expandAccordions}\n />\n ));\n\n const accordions = [\n availableViewModes.length > 1 && (\n <ViewModeAccordion key=\"viewMode\" expandAccordions={expandAccordions} />\n ),\n list.sorting.length > 0 && (\n <SortingAccordion key=\"sorting\" expandAccordions={expandAccordions} />\n ),\n ...filterAccordions,\n ].filter(Boolean);\n\n const hasSecondaryFilters = list.filters.some(\n (f) => f.priority === \"secondary\",\n );\n\n const controller = useOverlayController(\"Modal\", {\n reuseControllerFromContext: false,\n });\n\n if (accordions.length === 0) {\n return null;\n }\n\n return (\n <ModalTrigger controller={controller}>\n <ButtonView\n className={clsx(\n styles.hideOnMobile,\n hasSecondaryFilters ? undefined : styles.hideOnDesktop,\n )}\n variant=\"outline\"\n color=\"secondary\"\n isDisabled={isDisabled}\n >\n <TextView>{stringFormatter.format(\"filters.all\")}</TextView>\n <IconFilter />\n </ButtonView>\n\n <ButtonView\n className={styles.hideOnDesktop}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"filters.all\")}\n >\n <IconFilter />\n </ButtonView>\n\n <Modal offCanvas controller={controller}>\n <HeadingView>{stringFormatter.format(\"filters.all\")}</HeadingView>\n <ContentView>\n <SectionView>{...accordions}</SectionView>\n </ContentView>\n\n <ActionGroupView>\n <ButtonView onPress={() => controller.close()}>\n <TextView>\n {isInitiallyLoading ? (\n <SkeletonText width=\"16ch\" />\n ) : (\n stringFormatter.format(\"results.show\", {\n totalItemCount,\n })\n )}\n </TextView>\n </ButtonView>\n <ButtonView\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => {\n list.resetFilters();\n controller.close();\n }}\n >\n {stringFormatter.format(\"reset\")}\n </ButtonView>\n </ActionGroupView>\n </Modal>\n </ModalTrigger>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,eAAA,GAA6B,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM,EAAE,YAAW,GAAI,KAAA;AACvB,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,MAAM,CAAA;AAEnE,EAAA,MAAM,kBAAA,GAAqB,IAAA,CAAK,MAAA,CAAO,qBAAA,EAAsB;AAC7D,EAAA,MAAM,iBACJ,IAAA,CAAK,OAAA,CAAQ,oBAAmB,IAAK,IAAA,CAAK,MAAM,OAAA,CAAQ,MAAA;AAE1D,EAAA,MAAM,qBAAqB,qBAAA,EAAsB;AAEjD,EAAA,MAAM,cAAA,GAAA,CACH,kBAAA,CAAmB,MAAA,GAAS,CAAA,GAAI,CAAA,GAAI,CAAA,KACpC,IAAA,CAAK,OAAA,CAAQ,MAAA,GAAS,CAAA,GAAI,CAAA,GAAI,CAAA,CAAA,GAC/B,KAAK,OAAA,CAAQ,MAAA;AAEf,EAAA,MAAM,mBAAmB,cAAA,IAAkB,CAAA;AAE3C,EAAA,M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B,OAAO,OAAO;AAAA;AAAA;AACjC,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -32,6 +32,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
32
32
|
import '../../../../listContext.mjs';
|
|
33
33
|
import 'mobx';
|
|
34
34
|
import '../../../../List.mjs';
|
|
35
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
35
36
|
|
|
36
37
|
const SortingAccordion = (props) => {
|
|
37
38
|
const { expandAccordions } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport ContentView from \"@/views/ContentView\";\nimport RadioGroupView from \"@/views/RadioGroupView\";\nimport RadioView from \"@/views/RadioView\";\nimport { useList } from \"@/components/List\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n expandAccordions: boolean;\n}\n\nexport const SortingAccordion: FC<Props> = (props) => {\n const { expandAccordions } = props;\n\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const sorting = list.visibleSorting;\n const activeSorting = sorting.find((s) => s.isSorted());\n\n if (sorting.length === 0) {\n return null;\n }\n\n return (\n <AccordionView defaultExpanded={expandAccordions}>\n <HeadingView>{stringFormatter.format(\"sorting\")}</HeadingView>\n <ContentView>\n <RadioGroupView value={activeSorting?.id} m={[1, 1]}>\n {sorting.map((s) => (\n <RadioView\n key={s.id}\n value={s.id}\n onPress={() => list.getSorting(s.id).enable()}\n >\n {`${s.name ?? s.property} ${s.directionName ?? \"\"}`.trim()}\n </RadioView>\n ))}\n </RadioGroupView>\n </ContentView>\n </AccordionView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortingAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport ContentView from \"@/views/ContentView\";\nimport RadioGroupView from \"@/views/RadioGroupView\";\nimport RadioView from \"@/views/RadioView\";\nimport { useList } from \"@/components/List\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n expandAccordions: boolean;\n}\n\nexport const SortingAccordion: FC<Props> = (props) => {\n const { expandAccordions } = props;\n\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const sorting = list.visibleSorting;\n const activeSorting = sorting.find((s) => s.isSorted());\n\n if (sorting.length === 0) {\n return null;\n }\n\n return (\n <AccordionView defaultExpanded={expandAccordions}>\n <HeadingView>{stringFormatter.format(\"sorting\")}</HeadingView>\n <ContentView>\n <RadioGroupView value={activeSorting?.id} m={[1, 1]}>\n {sorting.map((s) => (\n <RadioView\n key={s.id}\n value={s.id}\n onPress={() => list.getSorting(s.id).enable()}\n >\n {`${s.name ?? s.property} ${s.directionName ?? \"\"}`.trim()}\n </RadioView>\n ))}\n </RadioGroupView>\n </ContentView>\n </AccordionView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,gBAAA,GAA8B,CAAC,KAAA,KAAU;AACpD,EAAA,MAAM,EAAE,kBAAiB,GAAI,KAAA;AAE7B,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,MAAM,CAAA;AAEnE,EAAA,MAAM,UAAU,IAAA,CAAK,cAAA;AACrB,EAAA,MAAM,gBAAgB,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,UAAU,CAAA;AAEtD,EAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,IAAA,CAAC,aAAA,EAAA,EAAc,eAAA,EAAiB,gBAAA,EAC9B,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAa,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,SAAS,CAAA,EAAE,CAAA;AAAA,oBAChD,GAAA,CAAC,WAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAO,aAAA,EAAe,EAAA,EAAI,CAAA,EAAG,CAAC,GAAG,CAAC,CAAA,EAC/C,QAAA,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,qBACZ,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QAEC,OAAO,CAAA,CAAE,EAAA;AAAA,QACT,SAAS,MAAM,IAAA,CAAK,WAAW,CAAA,CAAE,EAAE,EAAE,MAAA,EAAO;AAAA,QAE3C,QAAA,EAAA,CAAA,EAAG,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,QAAQ,IAAI,CAAA,CAAE,aAAA,IAAiB,EAAE,CAAA,CAAA,CAAG,IAAA;AAAK,OAAA;AAAA,MAJpD,CAAA,CAAE;AAAA,KAMV,GACH,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -33,6 +33,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
33
33
|
import '../../../../listContext.mjs';
|
|
34
34
|
import 'mobx';
|
|
35
35
|
import '../../../../List.mjs';
|
|
36
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
36
37
|
|
|
37
38
|
const ViewModeAccordion = (props) => {
|
|
38
39
|
const { expandAccordions } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContentView from \"@/views/ContentView\";\nimport RadioGroupView from \"@/views/RadioGroupView\";\nimport RadioView from \"@/views/RadioView\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n expandAccordions: boolean;\n}\n\nexport const ViewModeAccordion: FC<Props> = (props) => {\n const { expandAccordions } = props;\n\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const availableViewModes = useAvailableViewModes();\n const selectedViewMode = list.viewMode.value;\n\n return (\n <AccordionView defaultExpanded={expandAccordions}>\n <HeadingView>{stringFormatter.format(\"settings.viewMode\")}</HeadingView>\n <ContentView>\n <RadioGroupView value={selectedViewMode} m={[1, 1]}>\n {availableViewModes.map((v) => (\n <RadioView key={v} value={v} onPress={() => list.viewMode.set(v)}>\n {stringFormatter.format(`settings.viewMode.${v}`)}\n </RadioView>\n ))}\n </RadioGroupView>\n </ContentView>\n </AccordionView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeAccordion.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport AccordionView from \"@/views/AccordionView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContentView from \"@/views/ContentView\";\nimport RadioGroupView from \"@/views/RadioGroupView\";\nimport RadioView from \"@/views/RadioView\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n expandAccordions: boolean;\n}\n\nexport const ViewModeAccordion: FC<Props> = (props) => {\n const { expandAccordions } = props;\n\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n const availableViewModes = useAvailableViewModes();\n const selectedViewMode = list.viewMode.value;\n\n return (\n <AccordionView defaultExpanded={expandAccordions}>\n <HeadingView>{stringFormatter.format(\"settings.viewMode\")}</HeadingView>\n <ContentView>\n <RadioGroupView value={selectedViewMode} m={[1, 1]}>\n {availableViewModes.map((v) => (\n <RadioView key={v} value={v} onPress={() => list.viewMode.set(v)}>\n {stringFormatter.format(`settings.viewMode.${v}`)}\n </RadioView>\n ))}\n </RadioGroupView>\n </ContentView>\n </AccordionView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,iBAAA,GAA+B,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM,EAAE,kBAAiB,GAAI,KAAA;AAE7B,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,MAAM,CAAA;AAEnE,EAAA,MAAM,qBAAqB,qBAAA,EAAsB;AACjD,EAAA,MAAM,gBAAA,GAAmB,KAAK,QAAA,CAAS,KAAA;AAEvC,EAAA,uBACE,IAAA,CAAC,aAAA,EAAA,EAAc,eAAA,EAAiB,gBAAA,EAC9B,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAa,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,mBAAmB,CAAA,EAAE,CAAA;AAAA,oBAC1D,GAAA,CAAC,WAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAO,gBAAA,EAAkB,CAAA,EAAG,CAAC,CAAA,EAAG,CAAC,CAAA,EAC9C,QAAA,EAAA,kBAAA,CAAmB,GAAA,CAAI,CAAC,sBACvB,GAAA,CAAC,SAAA,EAAA,EAAkB,KAAA,EAAO,CAAA,EAAG,SAAS,MAAM,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,CAAC,CAAA,EAC5D,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,kBAAA,EAAqB,CAAC,CAAA,CAAE,CAAA,EAAA,EADlC,CAEhB,CACD,GACH,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -30,6 +30,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
30
30
|
import '../../../../listContext.mjs';
|
|
31
31
|
import 'mobx';
|
|
32
32
|
import '../../../../List.mjs';
|
|
33
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
33
34
|
import { FilterContextMenu } from './FilterContextMenu.mjs';
|
|
34
35
|
import { DateRangeFilterPopover } from './DateRangeFilterPopover.mjs';
|
|
35
36
|
import { DateRangeFilter } from '../../../../model/filter/DateRangeFilter.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterContextMenus.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport { FilterContextMenu } from \"@/components/List/components/Header/components/FilterContextMenu/FilterContextMenu\";\nimport { DateRangeFilterPopover } from \"@/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const FilterContextMenus: FC<Props> = (props) => {\n const { isDisabled } = props;\n const list = useList();\n\n return list.filters\n .filter((f) => f.priority === \"primary\")\n .map((filter) =>\n filter instanceof DateRangeFilter ? (\n <DateRangeFilterPopover\n key={filter.property}\n filter={filter}\n isDisabled={isDisabled}\n />\n ) : (\n <FilterContextMenu\n key={filter.property}\n filter={filter}\n isDisabled={isDisabled}\n />\n ),\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterContextMenus.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport { FilterContextMenu } from \"@/components/List/components/Header/components/FilterContextMenu/FilterContextMenu\";\nimport { DateRangeFilterPopover } from \"@/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const FilterContextMenus: FC<Props> = (props) => {\n const { isDisabled } = props;\n const list = useList();\n\n return list.filters\n .filter((f) => f.priority === \"primary\")\n .map((filter) =>\n filter instanceof DateRangeFilter ? (\n <DateRangeFilterPopover\n key={filter.property}\n filter={filter}\n isDisabled={isDisabled}\n />\n ) : (\n <FilterContextMenu\n key={filter.property}\n filter={filter}\n isDisabled={isDisabled}\n />\n ),\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,kBAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,YAAW,GAAI,KAAA;AACvB,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,OAAO,IAAA,CAAK,QACT,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,SAAS,CAAA,CACtC,GAAA;AAAA,IAAI,CAAC,MAAA,KACJ,MAAA,YAAkB,eAAA,mBAChB,GAAA;AAAA,MAAC,sBAAA;AAAA,MAAA;AAAA,QAEC,MAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAFK,MAAA,CAAO;AAAA,KAGd,mBAEA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QAEC,MAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAFK,MAAA,CAAO;AAAA;AAGd,GAEJ;AACJ;;;;"}
|
|
@@ -31,6 +31,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
31
31
|
import '../../../../listContext.mjs';
|
|
32
32
|
import 'mobx';
|
|
33
33
|
import '../../../../List.mjs';
|
|
34
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
34
35
|
|
|
35
36
|
const SortingMenuItem = (props) => {
|
|
36
37
|
const { sorting } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport type { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport { useList } from \"@/components/List\";\n\ninterface Props {\n sorting: Sorting<never>;\n}\n\nexport const SortingMenuItem: FC<Props> = (props) => {\n const { sorting } = props;\n\n const list = useList();\n\n return (\n <MenuItemView\n id={sorting.id}\n onAction={() => {\n list.getSorting(sorting.id).enable();\n }}\n >\n {`${sorting.name ?? sorting.property} ${sorting.directionName ?? \"\"}`.trim()}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortingMenuItem.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport type { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport { useList } from \"@/components/List\";\n\ninterface Props {\n sorting: Sorting<never>;\n}\n\nexport const SortingMenuItem: FC<Props> = (props) => {\n const { sorting } = props;\n\n const list = useList();\n\n return (\n <MenuItemView\n id={sorting.id}\n onAction={() => {\n list.getSorting(sorting.id).enable();\n }}\n >\n {`${sorting.name ?? sorting.property} ${sorting.directionName ?? \"\"}`.trim()}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAM,eAAA,GAA6B,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM,EAAE,SAAQ,GAAI,KAAA;AAEpB,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,IAAI,OAAA,CAAQ,EAAA;AAAA,MACZ,UAAU,MAAM;AACd,QAAA,IAAA,CAAK,UAAA,CAAW,OAAA,CAAQ,EAAE,CAAA,CAAE,MAAA,EAAO;AAAA,MACrC,CAAA;AAAA,MAEC,QAAA,EAAA,CAAA,EAAG,OAAA,CAAQ,IAAA,IAAQ,OAAA,CAAQ,QAAQ,IAAI,OAAA,CAAQ,aAAA,IAAiB,EAAE,CAAA,CAAA,CAAG,IAAA;AAAK;AAAA,GAC7E;AAEJ;;;;"}
|
|
@@ -29,6 +29,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
29
29
|
import '../../../../listContext.mjs';
|
|
30
30
|
import 'mobx';
|
|
31
31
|
import '../../../../List.mjs';
|
|
32
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
32
33
|
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
33
34
|
import { ViewModeMenuItem } from './ViewModeMenuItem.mjs';
|
|
34
35
|
import { useAvailableViewModes } from '../../lib.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeContextMenu.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { useList } from \"@/components/List\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport { ViewModeMenuItem } from \"@/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const ViewModeContextMenu: FC<Props> = (props) => {\n const { isDisabled } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n const list = useList();\n const selectedViewMode = list.viewMode.value;\n\n const availableViewModes = useAvailableViewModes();\n\n if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"settings\")}\n className={styles.hideOnMobile}\n isDisabled={isDisabled}\n >\n <TextView>\n {stringFormatter.format(`settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenuView selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n {availableViewModes.map((viewMode) => (\n <ViewModeMenuItem viewMode={viewMode} key={viewMode} />\n ))}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeContextMenu.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { useList } from \"@/components/List\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport { ViewModeMenuItem } from \"@/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem\";\nimport { useAvailableViewModes } from \"@/components/List/components/Header/lib\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\n\ninterface Props {\n isDisabled?: boolean;\n}\n\nexport const ViewModeContextMenu: FC<Props> = (props) => {\n const { isDisabled } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n const list = useList();\n const selectedViewMode = list.viewMode.value;\n\n const availableViewModes = useAvailableViewModes();\n\n if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTriggerView>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"settings\")}\n className={styles.hideOnMobile}\n isDisabled={isDisabled}\n >\n <TextView>\n {stringFormatter.format(`settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenuView selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n {availableViewModes.map((viewMode) => (\n <ViewModeMenuItem viewMode={viewMode} key={viewMode} />\n ))}\n </ContextMenuView>\n </ContextMenuTriggerView>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,mBAAA,GAAiC,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM,EAAE,YAAW,GAAI,KAAA;AAEvB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,MAAM,CAAA;AACnE,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,gBAAA,GAAmB,KAAK,QAAA,CAAS,KAAA;AAEvC,EAAA,MAAM,qBAAqB,qBAAA,EAAsB;AAEjD,EAAA,IAAI,kBAAA,CAAmB,UAAU,CAAA,EAAG;AAClC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,4BACG,sBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,SAAA;AAAA,QACR,KAAA,EAAM,WAAA;AAAA,QACN,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,UAAU,CAAA;AAAA,QAC7C,WAAWA,YAAA,CAAO,YAAA;AAAA,QAClB,UAAA;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,YACE,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,kBAAA,EAAqB,gBAAgB,EAAE,CAAA,EACjE,CAAA;AAAA,8BACC,QAAA,EAAA,EAAS;AAAA;AAAA;AAAA,KACZ;AAAA,wBACC,eAAA,EAAA,EAAgB,aAAA,EAAc,QAAA,EAAS,YAAA,EAAc,CAAC,gBAAgB,CAAA,EACpE,QAAA,EAAA,kBAAA,CAAmB,GAAA,CAAI,CAAC,QAAA,qBACvB,GAAA,CAAC,oBAAiB,QAAA,EAAA,EAAyB,QAAU,CACtD,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -29,6 +29,7 @@ import { useList } from '../../../../hooks/useList.mjs';
|
|
|
29
29
|
import '../../../../listContext.mjs';
|
|
30
30
|
import 'mobx';
|
|
31
31
|
import '../../../../List.mjs';
|
|
32
|
+
import '../../../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
32
33
|
|
|
33
34
|
const ViewModeMenuItem = (props) => {
|
|
34
35
|
const { viewMode } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeMenuItem.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n viewMode: ListViewMode;\n}\n\nexport const ViewModeMenuItem: FC<Props> = (props) => {\n const { viewMode } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n return (\n <MenuItemView\n id={viewMode}\n onAction={() => {\n list.viewMode.set(viewMode);\n }}\n >\n {stringFormatter.format(`settings.viewMode.${viewMode}`)}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeMenuItem.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.tsx"],"sourcesContent":["import { type FC } from \"react\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../../../locales/*.locale.json\";\n\ninterface Props {\n viewMode: ListViewMode;\n}\n\nexport const ViewModeMenuItem: FC<Props> = (props) => {\n const { viewMode } = props;\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales, \"List\");\n\n return (\n <MenuItemView\n id={viewMode}\n onAction={() => {\n list.viewMode.set(viewMode);\n }}\n >\n {stringFormatter.format(`settings.viewMode.${viewMode}`)}\n </MenuItemView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,gBAAA,GAA8B,CAAC,KAAA,KAAU;AACpD,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,MAAM,CAAA;AAEnE,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAI,QAAA;AAAA,MACJ,UAAU,MAAM;AACd,QAAA,IAAA,CAAK,QAAA,CAAS,IAAI,QAAQ,CAAA;AAAA,MAC5B,CAAA;AAAA,MAEC,QAAA,EAAA,eAAA,CAAgB,MAAA,CAAO,CAAA,kBAAA,EAAqB,QAAQ,CAAA,CAAE;AAAA;AAAA,GACzD;AAEJ;;;;"}
|
|
@@ -30,6 +30,7 @@ import { useList } from '../../hooks/useList.mjs';
|
|
|
30
30
|
import '../../listContext.mjs';
|
|
31
31
|
import 'mobx';
|
|
32
32
|
import '../../List.mjs';
|
|
33
|
+
import '../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
33
34
|
|
|
34
35
|
const useAvailableViewModes = () => {
|
|
35
36
|
const list = useList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","sources":["../../../../../../../../../src/components/List/components/Header/lib.ts"],"sourcesContent":["import type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\n\nexport const useAvailableViewModes = () => {\n const list = useList();\n\n const availableViewModes: ListViewMode[] = [];\n\n if (list.itemView?.showList) {\n availableViewModes.push(\"list\");\n }\n if (list.table) {\n availableViewModes.push(\"table\");\n }\n if (list.itemView?.showTiles) {\n availableViewModes.push(\"tiles\");\n }\n\n return availableViewModes;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.mjs","sources":["../../../../../../../../../src/components/List/components/Header/lib.ts"],"sourcesContent":["import type { ListViewMode } from \"@/components/List/model/types\";\nimport { useList } from \"@/components/List\";\n\nexport const useAvailableViewModes = () => {\n const list = useList();\n\n const availableViewModes: ListViewMode[] = [];\n\n if (list.itemView?.showList) {\n availableViewModes.push(\"list\");\n }\n if (list.table) {\n availableViewModes.push(\"table\");\n }\n if (list.itemView?.showTiles) {\n availableViewModes.push(\"tiles\");\n }\n\n return availableViewModes;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,wBAAwB,MAAM;AACzC,EAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,EAAA,MAAM,qBAAqC,EAAC;AAE5C,EAAA,IAAI,IAAA,CAAK,UAAU,QAAA,EAAU;AAC3B,IAAA,kBAAA,CAAmB,KAAK,MAAM,CAAA;AAAA,EAChC;AACA,EAAA,IAAI,KAAK,KAAA,EAAO;AACd,IAAA,kBAAA,CAAmB,KAAK,OAAO,CAAA;AAAA,EACjC;AACA,EAAA,IAAI,IAAA,CAAK,UAAU,SAAA,EAAW;AAC5B,IAAA,kBAAA,CAAmB,KAAK,OAAO,CAAA;AAAA,EACjC;AAEA,EAAA,OAAO,kBAAA;AACT;;;;"}
|
package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs
CHANGED
|
@@ -33,6 +33,7 @@ import { useList } from '../../hooks/useList.mjs';
|
|
|
33
33
|
import '../../listContext.mjs';
|
|
34
34
|
import 'mobx';
|
|
35
35
|
import '../../List.mjs';
|
|
36
|
+
import '../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
36
37
|
import { flowComponent } from '../../../../lib/componentFactory/flowComponent.mjs';
|
|
37
38
|
import { UiComponentTunnelExit } from '../../../UiComponentTunnel/UiComponentTunnelExit.mjs';
|
|
38
39
|
|
package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemView.mjs","sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { useList } from \"@/components/List\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport type ListItemViewProps = PropsWithChildren &\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">;\n\nexport const ListItemView = flowComponent(\n \"ListItemView\",\n (props: ListItemViewProps) => {\n const { children, s, m, l } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n placement: \"bottom right\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n size: dynamic(() => (useList().viewMode.isTiles ? \"s\" : \"m\")),\n },\n ActionGroup: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n Button: {\n tunnel: null,\n },\n },\n Avatar: {\n tunnel: {\n id: \"avatar\",\n component: \"ListItemView\",\n },\n },\n Heading: {\n tunnel: {\n id: \"title\",\n component: \"ListItemView\",\n },\n },\n Text: {\n tunnel: {\n id: \"text\",\n component: \"ListItemView\",\n },\n },\n Content: {\n tunnel: dynamic((p) =>\n p.slot === \"bottom\"\n ? {\n id: \"bottom\",\n component: \"ListItemView\",\n }\n : undefined,\n ),\n },\n Checkbox: {\n tunnel: {\n id: \"checkbox\",\n component: \"ListItemView\",\n },\n },\n };\n\n return (\n <ListItemViewContentView\n viewMode={list.viewMode.value}\n title={<UiComponentTunnelExit id=\"title\" component=\"ListItemView\" />}\n avatar={<UiComponentTunnelExit id=\"avatar\" component=\"ListItemView\" />}\n button={<UiComponentTunnelExit id=\"button\" component=\"ListItemView\" />}\n subTitle={<UiComponentTunnelExit id=\"text\" component=\"ListItemView\" />}\n bottom={<UiComponentTunnelExit id=\"bottom\" component=\"ListItemView\" />}\n checkbox={\n <UiComponentTunnelExit id=\"checkbox\" component=\"ListItemView\" />\n }\n s={s}\n m={m}\n l={l}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ListItemViewContentView>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ListItemView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemView.mjs","sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { useList } from \"@/components/List\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport type ListItemViewProps = PropsWithChildren &\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">;\n\nexport const ListItemView = flowComponent(\n \"ListItemView\",\n (props: ListItemViewProps) => {\n const { children, s, m, l } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n placement: \"bottom right\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n size: dynamic(() => (useList().viewMode.isTiles ? \"s\" : \"m\")),\n },\n ActionGroup: {\n tunnel: {\n id: \"button\",\n component: \"ListItemView\",\n },\n Button: {\n tunnel: null,\n },\n },\n Avatar: {\n tunnel: {\n id: \"avatar\",\n component: \"ListItemView\",\n },\n },\n Heading: {\n tunnel: {\n id: \"title\",\n component: \"ListItemView\",\n },\n },\n Text: {\n tunnel: {\n id: \"text\",\n component: \"ListItemView\",\n },\n },\n Content: {\n tunnel: dynamic((p) =>\n p.slot === \"bottom\"\n ? {\n id: \"bottom\",\n component: \"ListItemView\",\n }\n : undefined,\n ),\n },\n Checkbox: {\n tunnel: {\n id: \"checkbox\",\n component: \"ListItemView\",\n },\n },\n };\n\n return (\n <ListItemViewContentView\n viewMode={list.viewMode.value}\n title={<UiComponentTunnelExit id=\"title\" component=\"ListItemView\" />}\n avatar={<UiComponentTunnelExit id=\"avatar\" component=\"ListItemView\" />}\n button={<UiComponentTunnelExit id=\"button\" component=\"ListItemView\" />}\n subTitle={<UiComponentTunnelExit id=\"text\" component=\"ListItemView\" />}\n bottom={<UiComponentTunnelExit id=\"bottom\" component=\"ListItemView\" />}\n checkbox={\n <UiComponentTunnelExit id=\"checkbox\" component=\"ListItemView\" />\n }\n s={s}\n m={m}\n l={l}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ListItemViewContentView>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ListItemView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,YAAA,GAAe,aAAA;AAAA,EAC1B,cAAA;AAAA,EACA,CAAC,KAAA,KAA6B;AAC5B,IAAA,MAAM,EAAE,QAAA,EAAU,CAAA,EAAG,CAAA,EAAG,GAAE,GAAI,KAAA;AAC9B,IAAA,MAAM,OAAO,OAAA,EAAQ;AAErB,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,WAAA,EAAa;AAAA,QACX,MAAA,EAAQ;AAAA,UACN,EAAA,EAAI,QAAA;AAAA,UACJ,SAAA,EAAW;AAAA,SACb;AAAA,QACA,SAAA,EAAW,cAAA;AAAA,QACX,QAAA,kBAAU,GAAA,CAAC,aAAA,EAAA,EAAc,SAAA,EAAW,OAAO,MAAA,EAAQ;AAAA,OACrD;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,MAAA,EAAQ;AAAA,UACN,EAAA,EAAI,QAAA;AAAA,UACJ,SAAA,EAAW;AAAA,SACb;AAAA,QACA,IAAA,EAAM,QAAQ,MAAO,OAAA,GAAU,QAAA,CAAS,OAAA,GAAU,MAAM,GAAI;AAAA,OAC9D;A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cAAA,EAAe,CAAA;AAAA,QACpE,0BAAU,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,MAAA,EAAO,WAAU,cAAA,EAAe,CAAA;AAAA,QACpE,wBAAQ,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,QAAA,EAAS,WAAU,cAAA,EAAe,CAAA;AAAA,QACpE,0BACE,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,UAAA,EAAW,WAAU,cAAA,EAAe,CAAA;AAAA,QAEhE,CAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -30,6 +30,7 @@ import { useList } from '../../hooks/useList.mjs';
|
|
|
30
30
|
import '../../listContext.mjs';
|
|
31
31
|
import 'mobx';
|
|
32
32
|
import '../../List.mjs';
|
|
33
|
+
import '../../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
33
34
|
import styles from './Table.module.css.mjs';
|
|
34
35
|
import TableView from '../../../../views/TableView.mjs';
|
|
35
36
|
import TableHeaderView from '../../../../views/TableHeaderView.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","sources":["../../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport TableRowView from \"@/views/TableRowView\";\nimport TableCellView from \"@/views/TableCellView\";\nimport TableColumnView from \"@/views/TableColumnView\";\nimport { TableBodyLoadingView } from \"@/components/List/components/Table/components/TableBodyLoadingView\";\n\nexport const Table: FC = () => {\n const list = useList();\n const table = list.table;\n const listIsEmpty = list.useIsEmpty();\n\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!table || listIsEmpty) {\n return null;\n }\n\n const rowAction = table.list.onAction;\n\n const tableClassName = clsx(\n styles.table,\n isLoading && styles.isLoading,\n table.componentProps.className,\n );\n\n const rows = list.items.entries.map((item) => (\n <TableRowView\n className={(props) =>\n clsx(\n styles.row,\n rowAction && styles.hasAction,\n table.body.row.componentProps.className,\n props.isSelected && styles.isSelected,\n )\n }\n key={item.id}\n id={item.id}\n onAction={rowAction ? () => rowAction(item.data) : undefined}\n {...table.body.row.componentProps}\n >\n {table.body.row?.cells.map((cell, i) => (\n <TableCellView key={i} {...cell.componentProps}>\n {cell.renderFn ? cell.renderFn(item.data, list) : undefined}\n </TableCellView>\n ))}\n </TableRowView>\n ));\n\n return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\n aria-hidden={isInitiallyLoading}\n aria-busy={isLoading}\n >\n <TableHeaderView {...table.header.componentProps}>\n {table.header.columns.map((col, i) => (\n <TableColumnView key={i} {...col.componentProps} />\n ))}\n </TableHeaderView>\n <TableBodyView {...table.body.componentProps}>\n {isInitiallyLoading ? <TableBodyLoadingView /> : rows}\n </TableBodyView>\n </TableView>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.mjs","sources":["../../../../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useList } from \"@/components/List\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport TableView from \"@/views/TableView\";\nimport TableHeaderView from \"@/views/TableHeaderView\";\nimport TableBodyView from \"@/views/TableBodyView\";\nimport TableRowView from \"@/views/TableRowView\";\nimport TableCellView from \"@/views/TableCellView\";\nimport TableColumnView from \"@/views/TableColumnView\";\nimport { TableBodyLoadingView } from \"@/components/List/components/Table/components/TableBodyLoadingView\";\n\nexport const Table: FC = () => {\n const list = useList();\n const table = list.table;\n const listIsEmpty = list.useIsEmpty();\n\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!table || listIsEmpty) {\n return null;\n }\n\n const rowAction = table.list.onAction;\n\n const tableClassName = clsx(\n styles.table,\n isLoading && styles.isLoading,\n table.componentProps.className,\n );\n\n const rows = list.items.entries.map((item) => (\n <TableRowView\n className={(props) =>\n clsx(\n styles.row,\n rowAction && styles.hasAction,\n table.body.row.componentProps.className,\n props.isSelected && styles.isSelected,\n )\n }\n key={item.id}\n id={item.id}\n onAction={rowAction ? () => rowAction(item.data) : undefined}\n {...table.body.row.componentProps}\n >\n {table.body.row?.cells.map((cell, i) => (\n <TableCellView key={i} {...cell.componentProps}>\n {cell.renderFn ? cell.renderFn(item.data, list) : undefined}\n </TableCellView>\n ))}\n </TableRowView>\n ));\n\n return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\n aria-hidden={isInitiallyLoading}\n aria-busy={isLoading}\n >\n <TableHeaderView {...table.header.componentProps}>\n {table.header.columns.map((col, i) => (\n <TableColumnView key={i} {...col.componentProps} />\n ))}\n </TableHeaderView>\n <TableBodyView {...table.body.componentProps}>\n {isInitiallyLoading ? <TableBodyLoadingView /> : rows}\n </TableBodyView>\n </TableView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,QAAY,MAAM;AAC7B,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,QAAQ,IAAA,CAAK,KAAA;AACnB,EAAA,MAAM,WAAA,GAAc,KAAK,UAAA,EAAW;AAEpC,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,MAAA,CAAO,YAAA,EAAa;AAC3C,EAAA,MAAM,kBAAA,GAAqB,IAAA,CAAK,MAAA,CAAO,qBAAA,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G,IAAA,CAAK,cAAA;AAAA,MACR,GAAG,KAAA,CAAM,cAAA;AAAA,MACV,SAAA,EAAW,cAAA;AAAA,MACX,aAAA,EAAa,kBAAA;AAAA,MACb,WAAA,EAAW,SAAA;AAAA,MAEX,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,mBAAiB,GAAG,KAAA,CAAM,OAAO,cAAA,EAC/B,QAAA,EAAA,KAAA,CAAM,OAAO,OAAA,CAAQ,GAAA,CAAI,CAAC,GAAA,EAAK,CAAA,yBAC7B,eAAA,EAAA,EAAyB,GAAG,IAAI,cAAA,EAAA,EAAX,CAA2B,CAClD,CAAA,EACH,CAAA;AAAA,wBACA,GAAA,CAAC,aAAA,EAAA,EAAe,GAAG,KAAA,CAAM,IAAA,CAAK,gBAC3B,QAAA,EAAA,kBAAA,mBAAqB,GAAA,CAAC,oBAAA,EAAA,EAAqB,CAAA,GAAK,IAAA,EACnD;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -15,6 +15,7 @@ import { ListSettingsStore } from './ListSettingsStore.mjs';
|
|
|
15
15
|
import { ListViewMode } from './ListViewMode.mjs';
|
|
16
16
|
import { useSettings } from '../../SettingsProvider/SettingsProvider.mjs';
|
|
17
17
|
import { DateRangeFilter } from './filter/DateRangeFilter.mjs';
|
|
18
|
+
import { useWarnDeprecation } from '../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
18
19
|
|
|
19
20
|
class List {
|
|
20
21
|
filters;
|
|
@@ -60,6 +61,12 @@ class List {
|
|
|
60
61
|
emptySearchResultView,
|
|
61
62
|
...componentProps
|
|
62
63
|
} = shape;
|
|
64
|
+
const warnDeprecation = useWarnDeprecation();
|
|
65
|
+
if (itemView?.fallback !== void 0) {
|
|
66
|
+
warnDeprecation(
|
|
67
|
+
"The 'fallback' prop is deprecated and will be removed in a future release. Use 'loadingView' instead."
|
|
68
|
+
);
|
|
69
|
+
}
|
|
63
70
|
this.settingsStorageDefaults = settingsStorageDefaults;
|
|
64
71
|
const generalSettingsStore = useSettings();
|
|
65
72
|
this.settingsStorage = settingStorageKey && generalSettingsStore ? new ListSettingsStore(this, generalSettingsStore, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.mjs","sources":["../../../../../../../../src/components/List/model/List.ts"],"sourcesContent":["import { ItemCollection } from \"@/components/List/model/item/ItemCollection\";\nimport { BatchesController } from \"@/components/List/model/pagination/BatchesController\";\nimport { Filter } from \"./filter/Filter\";\nimport { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport ReactTable from \"@/components/List/model/ReactTable\";\nimport type {\n EmptyViewType,\n GetItemId,\n ItemActionFn,\n ListSettingsStorageDefaults,\n ListShape,\n ListSupportedComponentProps,\n} from \"@/components/List/model/types\";\nimport { IncrementalLoader } from \"@/components/List/model/loading/IncrementalLoader\";\nimport invariant from \"invariant\";\nimport { Search } from \"@/components/List/model/search/Search\";\nimport { ItemView } from \"@/components/List/model/item/ItemView\";\nimport { Table } from \"@/components/List/model/table/Table\";\nimport { useEffect, type ReactNode } from \"react\";\nimport { ListSettingsStore } from \"./ListSettingsStore\";\nimport { ListViewMode } from \"./ListViewMode\";\nimport { useSettings } from \"@/components/SettingsProvider/SettingsProvider\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\n\nexport class List<T = unknown, TMeta = unknown> {\n public readonly filters: (\n | Filter<T, never, never>\n | DateRangeFilter<T, never>\n )[];\n public readonly itemView?: ItemView<T>;\n public readonly table?: Table<T>;\n public readonly search?: Search<T>;\n public readonly sorting: Sorting<T>[];\n public readonly items: ItemCollection<T>;\n public readonly reactTable: ReactTable<T>;\n public readonly batches: BatchesController<T>;\n public readonly loader: IncrementalLoader<T>;\n public readonly onAction?: ItemActionFn<T>;\n public readonly accordion: boolean;\n public readonly infiniteScroll: boolean;\n public readonly getItemId?: GetItemId<T>;\n public readonly componentProps: ListSupportedComponentProps;\n public metadata?: TMeta;\n public readonly settingsStorage?: ListSettingsStore<T>;\n public readonly loadingItemsCount;\n public readonly viewMode: ListViewMode<T>;\n public readonly emptyView?: ReactNode;\n public readonly emptySearchResultView?: ReactNode;\n public readonly settingsStorageDefaults?: ListSettingsStorageDefaults;\n\n public constructor(shape: ListShape<T, TMeta>) {\n const {\n settingStorageKey,\n itemView,\n table,\n filters = [],\n sorting = [],\n batchesController,\n onChange,\n loader,\n search,\n onAction,\n getItemId,\n defaultViewMode,\n accordion = false,\n infiniteScroll = false,\n loadingItemsCount = 5,\n settingsStorageDefaults,\n emptyView,\n emptySearchResultView,\n ...componentProps\n } = shape;\n\n this.settingsStorageDefaults = settingsStorageDefaults;\n const generalSettingsStore = useSettings();\n\n this.settingsStorage =\n settingStorageKey && generalSettingsStore\n ? new ListSettingsStore(this, generalSettingsStore, {\n storageKey: settingStorageKey,\n })\n : undefined;\n\n this.items = new ItemCollection(this);\n this.filters = filters.map((shape) =>\n shape.mode === \"dateRange\"\n ? new DateRangeFilter(this, shape)\n : new Filter(this, shape),\n );\n this.sorting = sorting.map((shape) => new Sorting<T>(this, shape));\n this.search = search ? new Search(this, search) : undefined;\n this.itemView = itemView ? new ItemView(this, itemView) : undefined;\n this.accordion = accordion;\n this.infiniteScroll = infiniteScroll;\n this.table = table ? new Table(this, table) : undefined;\n this.batches = new BatchesController(this, batchesController);\n this.componentProps = componentProps;\n this.loader = IncrementalLoader.useNew<T>(this, loader);\n this.onAction = onAction;\n this.getItemId = getItemId;\n this.loadingItemsCount = loadingItemsCount;\n this.reactTable = ReactTable.useNew(this, onChange, {\n manualFiltering: this.loader.manualFiltering,\n manualPagination: this.loader.manualPagination,\n manualSorting: this.loader.manualSorting,\n });\n this.viewMode = new ListViewMode(this, { defaultViewMode });\n this.emptyView = emptyView;\n this.emptySearchResultView = emptySearchResultView;\n\n useEffect(() => {\n this.filters.forEach((f) => f.deleteUnknownFilterValues());\n }, [this.filters]);\n }\n\n public getEmptyViewType(): EmptyViewType {\n return this.hasActiveFilters || this.search?.isSet ? \"search\" : \"list\";\n }\n\n public get hasActiveFilters(): boolean {\n return this.filters.some((f) => f.isActive());\n }\n\n public get visibleSorting() {\n return this.sorting.filter((s) => s.initialEnabled !== \"hidden\");\n }\n\n public static useNew<T, TMeta = unknown>(\n shape: ListShape<T, TMeta>,\n ): List<T, TMeta> {\n return new List<T, TMeta>(shape);\n }\n\n public getSorting(id: string): Sorting<T> {\n const sorting = this.sorting.find((s) => s.id === id);\n invariant(!!sorting, `Could not get Sorting (ID: ${id})`);\n return sorting;\n }\n\n public clearSorting(): void {\n return this.sorting.forEach((s) => s.clear());\n }\n\n public resetFilters(): void {\n return this.filters.forEach((f) => f.resetValues());\n }\n\n public clearFilters(): void {\n return this.filters.forEach((f) => f.clear());\n }\n\n public useIsEmpty(): boolean {\n return !this.loader.useIsLoading() && this.items.entries.length === 0;\n }\n}\n\nexport default List;\n"],"names":["shape"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.mjs","sources":["../../../../../../../../src/components/List/model/List.ts"],"sourcesContent":["import { ItemCollection } from \"@/components/List/model/item/ItemCollection\";\nimport { BatchesController } from \"@/components/List/model/pagination/BatchesController\";\nimport { Filter } from \"./filter/Filter\";\nimport { Sorting } from \"@/components/List/model/sorting/Sorting\";\nimport ReactTable from \"@/components/List/model/ReactTable\";\nimport type {\n EmptyViewType,\n GetItemId,\n ItemActionFn,\n ListSettingsStorageDefaults,\n ListShape,\n ListSupportedComponentProps,\n} from \"@/components/List/model/types\";\nimport { IncrementalLoader } from \"@/components/List/model/loading/IncrementalLoader\";\nimport invariant from \"invariant\";\nimport { Search } from \"@/components/List/model/search/Search\";\nimport { ItemView } from \"@/components/List/model/item/ItemView\";\nimport { Table } from \"@/components/List/model/table/Table\";\nimport { useEffect, type ReactNode } from \"react\";\nimport { ListSettingsStore } from \"./ListSettingsStore\";\nimport { ListViewMode } from \"./ListViewMode\";\nimport { useSettings } from \"@/components/SettingsProvider/SettingsProvider\";\nimport { DateRangeFilter } from \"@/components/List/model/filter/DateRangeFilter\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nexport class List<T = unknown, TMeta = unknown> {\n public readonly filters: (\n | Filter<T, never, never>\n | DateRangeFilter<T, never>\n )[];\n public readonly itemView?: ItemView<T>;\n public readonly table?: Table<T>;\n public readonly search?: Search<T>;\n public readonly sorting: Sorting<T>[];\n public readonly items: ItemCollection<T>;\n public readonly reactTable: ReactTable<T>;\n public readonly batches: BatchesController<T>;\n public readonly loader: IncrementalLoader<T>;\n public readonly onAction?: ItemActionFn<T>;\n public readonly accordion: boolean;\n public readonly infiniteScroll: boolean;\n public readonly getItemId?: GetItemId<T>;\n public readonly componentProps: ListSupportedComponentProps;\n public metadata?: TMeta;\n public readonly settingsStorage?: ListSettingsStore<T>;\n public readonly loadingItemsCount;\n public readonly viewMode: ListViewMode<T>;\n public readonly emptyView?: ReactNode;\n public readonly emptySearchResultView?: ReactNode;\n public readonly settingsStorageDefaults?: ListSettingsStorageDefaults;\n\n public constructor(shape: ListShape<T, TMeta>) {\n const {\n settingStorageKey,\n itemView,\n table,\n filters = [],\n sorting = [],\n batchesController,\n onChange,\n loader,\n search,\n onAction,\n getItemId,\n defaultViewMode,\n accordion = false,\n infiniteScroll = false,\n loadingItemsCount = 5,\n settingsStorageDefaults,\n emptyView,\n emptySearchResultView,\n ...componentProps\n } = shape;\n\n const warnDeprecation = useWarnDeprecation();\n if (itemView?.fallback !== undefined) {\n warnDeprecation(\n \"The 'fallback' prop is deprecated and will be removed in a future release. Use 'loadingView' instead.\",\n );\n }\n\n this.settingsStorageDefaults = settingsStorageDefaults;\n const generalSettingsStore = useSettings();\n\n this.settingsStorage =\n settingStorageKey && generalSettingsStore\n ? new ListSettingsStore(this, generalSettingsStore, {\n storageKey: settingStorageKey,\n })\n : undefined;\n\n this.items = new ItemCollection(this);\n this.filters = filters.map((shape) =>\n shape.mode === \"dateRange\"\n ? new DateRangeFilter(this, shape)\n : new Filter(this, shape),\n );\n this.sorting = sorting.map((shape) => new Sorting<T>(this, shape));\n this.search = search ? new Search(this, search) : undefined;\n this.itemView = itemView ? new ItemView(this, itemView) : undefined;\n this.accordion = accordion;\n this.infiniteScroll = infiniteScroll;\n this.table = table ? new Table(this, table) : undefined;\n this.batches = new BatchesController(this, batchesController);\n this.componentProps = componentProps;\n this.loader = IncrementalLoader.useNew<T>(this, loader);\n this.onAction = onAction;\n this.getItemId = getItemId;\n this.loadingItemsCount = loadingItemsCount;\n this.reactTable = ReactTable.useNew(this, onChange, {\n manualFiltering: this.loader.manualFiltering,\n manualPagination: this.loader.manualPagination,\n manualSorting: this.loader.manualSorting,\n });\n this.viewMode = new ListViewMode(this, { defaultViewMode });\n this.emptyView = emptyView;\n this.emptySearchResultView = emptySearchResultView;\n\n useEffect(() => {\n this.filters.forEach((f) => f.deleteUnknownFilterValues());\n }, [this.filters]);\n }\n\n public getEmptyViewType(): EmptyViewType {\n return this.hasActiveFilters || this.search?.isSet ? \"search\" : \"list\";\n }\n\n public get hasActiveFilters(): boolean {\n return this.filters.some((f) => f.isActive());\n }\n\n public get visibleSorting() {\n return this.sorting.filter((s) => s.initialEnabled !== \"hidden\");\n }\n\n public static useNew<T, TMeta = unknown>(\n shape: ListShape<T, TMeta>,\n ): List<T, TMeta> {\n return new List<T, TMeta>(shape);\n }\n\n public getSorting(id: string): Sorting<T> {\n const sorting = this.sorting.find((s) => s.id === id);\n invariant(!!sorting, `Could not get Sorting (ID: ${id})`);\n return sorting;\n }\n\n public clearSorting(): void {\n return this.sorting.forEach((s) => s.clear());\n }\n\n public resetFilters(): void {\n return this.filters.forEach((f) => f.resetValues());\n }\n\n public clearFilters(): void {\n return this.filters.forEach((f) => f.clear());\n }\n\n public useIsEmpty(): boolean {\n return !this.loader.useIsLoading() && this.items.entries.length === 0;\n }\n}\n\nexport default List;\n"],"names":["shape"],"mappings":";;;;;;;;;;;;;;;;;AAyBO,MAAM,IAAA,CAAmC;AAAA,EAC9B,OAAA;AAAA,EAIA,QAAA;AAAA,EACA,KAAA;AAAA,EAC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AAA,CAAQ,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,CAAA;AAAA,EAC9C;AAAA,EAEO,YAAA,GAAqB;AAC1B,IAAA,OAAO,KAAK,OAAA,CAAQ,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAAA,EACpD;AAAA,EAEO,YAAA,GAAqB;AAC1B,IAAA,OAAO,KAAK,OAAA,CAAQ,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,CAAA;AAAA,EAC9C;AAAA,EAEO,UAAA,GAAsB;AAC3B,IAAA,OAAO,CAAC,KAAK,MAAA,CAAO,YAAA,MAAkB,IAAA,CAAK,KAAA,CAAM,QAAQ,MAAA,KAAW,CAAA;AAAA,EACtE;AACF;;;;"}
|
package/dist/js/packages/components/src/components/List/setupComponents/ListLoaderAsyncResource.mjs
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
|
|
3
|
+
import { useWarnDeprecation } from '../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
4
|
+
|
|
5
|
+
const ListLoaderAsyncResource = (ignoredProps) => {
|
|
6
|
+
const warnDeprecation = useWarnDeprecation();
|
|
7
|
+
warnDeprecation(
|
|
8
|
+
"The 'ListLoaderAsyncResource' component is deprecated and will be removed in a future release. Use 'ListLoaderHooks' instead."
|
|
9
|
+
);
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
4
12
|
const TypedListLoaderAsyncResource = () => ListLoaderAsyncResource;
|
|
5
13
|
|
|
6
14
|
export { ListLoaderAsyncResource, TypedListLoaderAsyncResource };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListLoaderAsyncResource.mjs","sources":["../../../../../../../../src/components/List/setupComponents/ListLoaderAsyncResource.ts"],"sourcesContent":["import type { AsyncResourceFactoryDataLoaderShape } from \"@/components/List/model/loading/types\";\nimport type { ComponentType } from \"react\";\n\ntype Props<T> = Omit<\n AsyncResourceFactoryDataLoaderShape<T>,\n \"asyncResourceFactory\"\n> & {\n children: AsyncResourceFactoryDataLoaderShape<T>[\"asyncResourceFactory\"];\n};\n\n/** @deprecated Use ListLoaderHooks instead */\nexport const ListLoaderAsyncResource = <T>(ignoredProps: Props<T>) => null;\n\nexport const TypedListLoaderAsyncResource = <T>() =>\n ListLoaderAsyncResource as ComponentType<Props<T>>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListLoaderAsyncResource.mjs","sources":["../../../../../../../../src/components/List/setupComponents/ListLoaderAsyncResource.ts"],"sourcesContent":["import type { AsyncResourceFactoryDataLoaderShape } from \"@/components/List/model/loading/types\";\nimport type { ComponentType } from \"react\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\ntype Props<T> = Omit<\n AsyncResourceFactoryDataLoaderShape<T>,\n \"asyncResourceFactory\"\n> & {\n children: AsyncResourceFactoryDataLoaderShape<T>[\"asyncResourceFactory\"];\n};\n\n/** @deprecated Use ListLoaderHooks instead */\nexport const ListLoaderAsyncResource = <T>(ignoredProps: Props<T>) => {\n const warnDeprecation = useWarnDeprecation();\n warnDeprecation(\n \"The 'ListLoaderAsyncResource' component is deprecated and will be removed in a future release. Use 'ListLoaderHooks' instead.\",\n );\n\n return null;\n};\n\nexport const TypedListLoaderAsyncResource = <T>() =>\n ListLoaderAsyncResource as ComponentType<Props<T>>;\n"],"names":[],"mappings":";;AAYO,MAAM,uBAAA,GAA0B,CAAI,YAAA,KAA2B;AACpE,EAAA,MAAM,kBAAkB,kBAAA,EAAmB;AAC3C,EAAA,eAAA;AAAA,IACE;AAAA,GACF;AAEA,EAAA,OAAO,IAAA;AACT;AAEO,MAAM,+BAA+B,MAC1C;;;;"}
|
package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import { Policy } from '@mittwald/password-tools-js/policy';
|
|
|
25
25
|
import '@mittwald/password-tools-js/rules';
|
|
26
26
|
import '@mittwald/password-tools-js/generator';
|
|
27
27
|
import { defaultPasswordCreationPolicy } from '../../integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs';
|
|
28
|
+
import '../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
28
29
|
import { usePolicyValidationResult } from './lib/usePolicyValidationResult.mjs';
|
|
29
30
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
30
31
|
import { FieldError } from '../FieldError/FieldError.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordCreationField.mjs","sources":["../../../../../../../src/components/PasswordCreationField/PasswordCreationField.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n useState,\n type ClipboardEvent,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"./PasswordCreationField.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport { type ActionFn } from \"@/components/Action\";\nimport getStateFromLatestPolicyValidationResult from \"@/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult\";\nimport locales from \"./locales/*.locale.json\";\nimport generateValidationTranslation from \"@/components/PasswordCreationField/lib/generateValidationTranslation\";\nimport FieldDescription from \"@/components/FieldDescription\";\nimport ComplexityIndicator from \"@/components/PasswordCreationField/components/ComplexityIndicator/ComplexityIndicator\";\nimport { generatePassword } from \"@/components/PasswordCreationField/worker/generatePassword\";\nimport TogglePasswordVisibilityButton from \"@/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton\";\nimport { ValidationResultButton } from \"@/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton\";\nimport { PasswordGenerateButton } from \"@/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton\";\nimport type {\n PolicyValidationResult,\n PolicyGenericDeclaration,\n RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\nimport {\n defaultPasswordCreationPolicy,\n Policy,\n} from \"@/integrations/@mittwald/password-tools-js\";\nimport { usePolicyValidationResult } from \"@/components/PasswordCreationField/lib/usePolicyValidationResult\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { FieldError } from \"@/components/FieldError\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface PasswordCreationFieldProps\n extends\n PropsWithChildren<\n Omit<Aria.TextFieldProps, \"children\" | \"value\" | \"defaultValue\"> &\n Partial<Pick<Aria.FieldErrorRenderProps, \"validationErrors\">>\n >,\n FlowComponentProps<HTMLInputElement> {\n value?: string;\n onValidationResult?: (result: { password: string; isValid: boolean }) => void;\n defaultValue?: string;\n placeholder?: string;\n validationPolicy?: PolicyGenericDeclaration;\n}\n\nexport interface ResolvedPolicyValidationResult extends Omit<\n PolicyValidationResult,\n \"isValid\"\n> {\n isValid: boolean | \"indeterminate\";\n ruleResults: RuleValidationResult[];\n}\n\n/** @flr-generate all */\nexport const PasswordCreationField = flowComponent(\n \"PasswordCreationField\",\n (props) => {\n const {\n children,\n className,\n ref,\n isDisabled,\n onValidationResult,\n isInvalid: invalidFromProps,\n validationPolicy:\n validationPolicyFromProps = defaultPasswordCreationPolicy,\n isRequired,\n value,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"PasswordCreationField\");\n\n const translate = useLocalizedStringFormatter(\n locales,\n \"PasswordCreationField\",\n );\n\n const validationPolicy = useMemo(\n () => Policy.fromDeclaration(validationPolicyFromProps),\n [validationPolicyFromProps],\n );\n\n const [isPasswordRevealed, setIsPasswordRevealed] = useState(false);\n const initialPolicyValidationState: ResolvedPolicyValidationResult = {\n isValid: \"indeterminate\",\n complexity: {\n min: validationPolicy.minComplexity,\n actual: 4,\n warning: null,\n },\n ruleResults: [],\n };\n\n const [policyValidationResult, setPolicyValidationResult] = useState(\n initialPolicyValidationState,\n );\n\n const loadingRef = useRef<ReturnType<typeof setTimeout>>(null);\n usePolicyValidationResult(\n validationPolicy,\n value ?? \"\",\n () => {\n if (isEmptyValue) {\n return;\n }\n\n loadingRef.current = setTimeout(() => {\n setPolicyValidationResult((r) => ({\n ...r,\n isValid: \"indeterminate\",\n }));\n }, 150);\n },\n ({ password, isValid, results }) => {\n if (loadingRef.current) {\n clearTimeout(loadingRef.current);\n }\n\n if (isEmptyValue) {\n setPolicyValidationResult(() => ({\n ...results,\n isValid: true,\n }));\n return;\n }\n\n setPolicyValidationResult(() => results);\n onValidationResult?.({ password, isValid });\n },\n );\n\n const isEmptyValue = !value;\n const stateFromValidationResult = getStateFromLatestPolicyValidationResult(\n isEmptyValue,\n policyValidationResult,\n );\n let latestValidationErrorText = undefined;\n if (stateFromValidationResult) {\n const [translationKey, translationValues] = generateValidationTranslation(\n stateFromValidationResult,\n );\n latestValidationErrorText = translate.format(\n translationKey,\n translationValues,\n );\n }\n\n const isValidFromValidationResult =\n !isEmptyValue && stateFromValidationResult?.isValid;\n\n const isInvalidFromValidationResult =\n !isEmptyValue && stateFromValidationResult?.isValid === false;\n const isInvalid = invalidFromProps || isInvalidFromValidationResult;\n\n const setOptimisticPolicyValidationResult = (\n state: Partial<ResolvedPolicyValidationResult> = {},\n ) => {\n setPolicyValidationResult((currentState) => ({\n ...currentState,\n isValid: true,\n ...state,\n }));\n };\n\n const onPasswordGenerateHandler: ActionFn = async () => {\n const generatedPassword = await generatePassword(validationPolicy);\n setOptimisticPolicyValidationResult({\n ...initialPolicyValidationState,\n isValid: true,\n ruleResults: policyValidationResult.ruleResults.map((r) => ({\n ...r,\n isValid: true,\n })),\n });\n setIsPasswordRevealed(true);\n onChange(generatedPassword);\n };\n\n const onPasswordPasteHandler = (event: ClipboardEvent) => {\n const pastedValue = event.clipboardData?.getData(\"text\");\n if (typeof pastedValue === \"string\" && pastedValue !== value) {\n setOptimisticPolicyValidationResult({\n isValid: \"indeterminate\",\n });\n }\n };\n\n const togglePasswordVisibilityHandler = () => {\n setIsPasswordRevealed((old) => !old);\n };\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Button: {\n tunnel: {\n id: \"button\",\n component: \"PasswordCreationField\",\n },\n size: \"m\",\n variant: \"plain\",\n color: \"secondary\",\n isDisabled: isDisabled,\n className: styles.button,\n },\n CopyButton: {\n tunnel: {\n id: \"button\",\n component: \"PasswordCreationField\",\n },\n size: \"m\",\n variant: \"plain\",\n color: \"secondary\",\n isDisabled: isDisabled,\n className: styles.button,\n text: value,\n },\n Label: {\n ...fieldPropsContext.Label,\n children: dynamic((localProps) => {\n return (\n <>\n {localProps.children}\n <PasswordGenerateButton\n isDisabled={isDisabled}\n onGeneratePasswordAction={onPasswordGenerateHandler}\n />\n <ValidationResultButton\n isEmptyValue={isEmptyValue}\n isDisabled={isDisabled}\n policyValidationResult={policyValidationResult}\n />\n </>\n );\n }),\n },\n };\n\n return (\n <Aria.TextField\n {...rest}\n value={value}\n type={isPasswordRevealed ? \"text\" : \"password\"}\n onChange={onChange}\n onPaste={onPasswordPasteHandler}\n className={clsx(className, fieldProps.className)}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isRequired={isRequired}\n >\n <FieldErrorCaptureContext>\n {latestValidationErrorText && (\n <FieldError>{latestValidationErrorText}</FieldError>\n )}\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n isDisabled,\n isRequired,\n value,\n policyValidationResult,\n isEmptyValue,\n ]}\n >\n {children}\n <Aria.Group\n isDisabled={isDisabled}\n className={clsx(styles.inputGroup)}\n >\n <Aria.Input ref={ref} className={styles.input} />\n <Aria.Group className={styles.buttonContainer}>\n <TogglePasswordVisibilityButton\n className={styles.button}\n isVisible={isPasswordRevealed}\n isDisabled={isDisabled}\n onPress={togglePasswordVisibilityHandler}\n />\n <UiComponentTunnelExit\n id=\"button\"\n component=\"PasswordCreationField\"\n />\n </Aria.Group>\n <ComplexityIndicator\n key={value}\n isEmptyValue={isEmptyValue}\n isLoading={policyValidationResult.isValid === \"indeterminate\"}\n policyValidationResult={policyValidationResult}\n validationResultState={stateFromValidationResult}\n />\n </Aria.Group>\n {isValidFromValidationResult && (\n <FieldDescription>{latestValidationErrorText}</FieldDescription>\n )}\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.TextField>\n );\n },\n);\n\nexport default PasswordCreationField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEO,MAAM,qBAAA,GAAwB,aAAA;AAAA,EACnC,uBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,GAAA;AAAA,MACA,UAAA;AAAA,MACA,kBAAA;AAAA,MACA,SAAA,EAAW,gBAAA;AAAA,MACX,kBACE,yBAAA,GAA4B,6BAAA;AAAA,MAC9B,UAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,IAAA,MAAM;AAAA,MACJ,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,uBAAuB,CAAA;AAEpD,IAAA,MAAM,SAAA,GAAY,2BAAA;AAAA,MAChB,OAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,gBAAA,GAAmB,OAAA;AAAA,MACvB,MAAM,MAAA,CAAO,eAAA,CAAgB,yBAAyB,CAAA;AAAA,MACtD,CAAC,yBAAyB;AAAA,KAC5B;AAEA,I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AO,CAAA;AAAA,6CAC9C,IAAA,CAAK,KAAA,EAAL,EAAW,SAAA,EAAW,OAAO,eAAA,EAC5B,QAAA,EAAA;AAAA,0CAAA,GAAA;AAAA,4BAAC,8BAAA;AAAA,4BAAA;AAAA,8BACC,WAAW,MAAA,CAAO,MAAA;AAAA,8BAClB,SAAA,EAAW,kBAAA;AAAA,8BACX,UAAA;AAAA,8BACA,OAAA,EAAS;AAAA;AAAA,2BACX;AAAA,0CACA,GAAA;AAAA,4BAAC,qBAAA;AAAA,4BAAA;AAAA,8BACC,EAAA,EAAG,QAAA;AAAA,8BACH,SAAA,EAAU;AAAA;AAAA;AACZ,yBAAA,EACF,CAAA;AAAA,wCACA,GAAA;AAAA,0BAAC,mBAAA;AAAA,0BAAA;AAAA,4BAEC,YAAA;AAAA,4BACA,SAAA,EAAW,uBAAuB,OAAA,KAAY,eAAA;AAAA,4BAC9C,sBAAA;AAAA,4BACA,qBAAA,EAAuB;AAAA,2BAAA;AAAA,0BAJlB;AAAA;AAKP;AAAA;AAAA,mBACF;AAAA,kBACC,2BAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,yBAAA,EAA0B;AAAA;AAAA;AAAA;AAEjD,WAAA,EACF,CAAA;AAAA,8BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,KAClB;AAAA,EAEJ;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"PasswordCreationField.mjs","sources":["../../../../../../../src/components/PasswordCreationField/PasswordCreationField.tsx"],"sourcesContent":["import {\n type PropsWithChildren,\n useState,\n type ClipboardEvent,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"./PasswordCreationField.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport { type ActionFn } from \"@/components/Action\";\nimport getStateFromLatestPolicyValidationResult from \"@/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult\";\nimport locales from \"./locales/*.locale.json\";\nimport generateValidationTranslation from \"@/components/PasswordCreationField/lib/generateValidationTranslation\";\nimport FieldDescription from \"@/components/FieldDescription\";\nimport ComplexityIndicator from \"@/components/PasswordCreationField/components/ComplexityIndicator/ComplexityIndicator\";\nimport { generatePassword } from \"@/components/PasswordCreationField/worker/generatePassword\";\nimport TogglePasswordVisibilityButton from \"@/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton\";\nimport { ValidationResultButton } from \"@/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton\";\nimport { PasswordGenerateButton } from \"@/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton\";\nimport type {\n PolicyValidationResult,\n PolicyGenericDeclaration,\n RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\nimport {\n defaultPasswordCreationPolicy,\n Policy,\n} from \"@/integrations/@mittwald/password-tools-js\";\nimport { usePolicyValidationResult } from \"@/components/PasswordCreationField/lib/usePolicyValidationResult\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { FieldError } from \"@/components/FieldError\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface PasswordCreationFieldProps\n extends\n PropsWithChildren<\n Omit<Aria.TextFieldProps, \"children\" | \"value\" | \"defaultValue\"> &\n Partial<Pick<Aria.FieldErrorRenderProps, \"validationErrors\">>\n >,\n FlowComponentProps<HTMLInputElement> {\n value?: string;\n onValidationResult?: (result: { password: string; isValid: boolean }) => void;\n defaultValue?: string;\n placeholder?: string;\n validationPolicy?: PolicyGenericDeclaration;\n}\n\nexport interface ResolvedPolicyValidationResult extends Omit<\n PolicyValidationResult,\n \"isValid\"\n> {\n isValid: boolean | \"indeterminate\";\n ruleResults: RuleValidationResult[];\n}\n\n/** @flr-generate all */\nexport const PasswordCreationField = flowComponent(\n \"PasswordCreationField\",\n (props) => {\n const {\n children,\n className,\n ref,\n isDisabled,\n onValidationResult,\n isInvalid: invalidFromProps,\n validationPolicy:\n validationPolicyFromProps = defaultPasswordCreationPolicy,\n isRequired,\n value,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"PasswordCreationField\");\n\n const translate = useLocalizedStringFormatter(\n locales,\n \"PasswordCreationField\",\n );\n\n const validationPolicy = useMemo(\n () => Policy.fromDeclaration(validationPolicyFromProps),\n [validationPolicyFromProps],\n );\n\n const [isPasswordRevealed, setIsPasswordRevealed] = useState(false);\n const initialPolicyValidationState: ResolvedPolicyValidationResult = {\n isValid: \"indeterminate\",\n complexity: {\n min: validationPolicy.minComplexity,\n actual: 4,\n warning: null,\n },\n ruleResults: [],\n };\n\n const [policyValidationResult, setPolicyValidationResult] = useState(\n initialPolicyValidationState,\n );\n\n const loadingRef = useRef<ReturnType<typeof setTimeout>>(null);\n usePolicyValidationResult(\n validationPolicy,\n value ?? \"\",\n () => {\n if (isEmptyValue) {\n return;\n }\n\n loadingRef.current = setTimeout(() => {\n setPolicyValidationResult((r) => ({\n ...r,\n isValid: \"indeterminate\",\n }));\n }, 150);\n },\n ({ password, isValid, results }) => {\n if (loadingRef.current) {\n clearTimeout(loadingRef.current);\n }\n\n if (isEmptyValue) {\n setPolicyValidationResult(() => ({\n ...results,\n isValid: true,\n }));\n return;\n }\n\n setPolicyValidationResult(() => results);\n onValidationResult?.({ password, isValid });\n },\n );\n\n const isEmptyValue = !value;\n const stateFromValidationResult = getStateFromLatestPolicyValidationResult(\n isEmptyValue,\n policyValidationResult,\n );\n let latestValidationErrorText = undefined;\n if (stateFromValidationResult) {\n const [translationKey, translationValues] = generateValidationTranslation(\n stateFromValidationResult,\n );\n latestValidationErrorText = translate.format(\n translationKey,\n translationValues,\n );\n }\n\n const isValidFromValidationResult =\n !isEmptyValue && stateFromValidationResult?.isValid;\n\n const isInvalidFromValidationResult =\n !isEmptyValue && stateFromValidationResult?.isValid === false;\n const isInvalid = invalidFromProps || isInvalidFromValidationResult;\n\n const setOptimisticPolicyValidationResult = (\n state: Partial<ResolvedPolicyValidationResult> = {},\n ) => {\n setPolicyValidationResult((currentState) => ({\n ...currentState,\n isValid: true,\n ...state,\n }));\n };\n\n const onPasswordGenerateHandler: ActionFn = async () => {\n const generatedPassword = await generatePassword(validationPolicy);\n setOptimisticPolicyValidationResult({\n ...initialPolicyValidationState,\n isValid: true,\n ruleResults: policyValidationResult.ruleResults.map((r) => ({\n ...r,\n isValid: true,\n })),\n });\n setIsPasswordRevealed(true);\n onChange(generatedPassword);\n };\n\n const onPasswordPasteHandler = (event: ClipboardEvent) => {\n const pastedValue = event.clipboardData?.getData(\"text\");\n if (typeof pastedValue === \"string\" && pastedValue !== value) {\n setOptimisticPolicyValidationResult({\n isValid: \"indeterminate\",\n });\n }\n };\n\n const togglePasswordVisibilityHandler = () => {\n setIsPasswordRevealed((old) => !old);\n };\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Button: {\n tunnel: {\n id: \"button\",\n component: \"PasswordCreationField\",\n },\n size: \"m\",\n variant: \"plain\",\n color: \"secondary\",\n isDisabled: isDisabled,\n className: styles.button,\n },\n CopyButton: {\n tunnel: {\n id: \"button\",\n component: \"PasswordCreationField\",\n },\n size: \"m\",\n variant: \"plain\",\n color: \"secondary\",\n isDisabled: isDisabled,\n className: styles.button,\n text: value,\n },\n Label: {\n ...fieldPropsContext.Label,\n children: dynamic((localProps) => {\n return (\n <>\n {localProps.children}\n <PasswordGenerateButton\n isDisabled={isDisabled}\n onGeneratePasswordAction={onPasswordGenerateHandler}\n />\n <ValidationResultButton\n isEmptyValue={isEmptyValue}\n isDisabled={isDisabled}\n policyValidationResult={policyValidationResult}\n />\n </>\n );\n }),\n },\n };\n\n return (\n <Aria.TextField\n {...rest}\n value={value}\n type={isPasswordRevealed ? \"text\" : \"password\"}\n onChange={onChange}\n onPaste={onPasswordPasteHandler}\n className={clsx(className, fieldProps.className)}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isRequired={isRequired}\n >\n <FieldErrorCaptureContext>\n {latestValidationErrorText && (\n <FieldError>{latestValidationErrorText}</FieldError>\n )}\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n isDisabled,\n isRequired,\n value,\n policyValidationResult,\n isEmptyValue,\n ]}\n >\n {children}\n <Aria.Group\n isDisabled={isDisabled}\n className={clsx(styles.inputGroup)}\n >\n <Aria.Input ref={ref} className={styles.input} />\n <Aria.Group className={styles.buttonContainer}>\n <TogglePasswordVisibilityButton\n className={styles.button}\n isVisible={isPasswordRevealed}\n isDisabled={isDisabled}\n onPress={togglePasswordVisibilityHandler}\n />\n <UiComponentTunnelExit\n id=\"button\"\n component=\"PasswordCreationField\"\n />\n </Aria.Group>\n <ComplexityIndicator\n key={value}\n isEmptyValue={isEmptyValue}\n isLoading={policyValidationResult.isValid === \"indeterminate\"}\n policyValidationResult={policyValidationResult}\n validationResultState={stateFromValidationResult}\n />\n </Aria.Group>\n {isValidFromValidationResult && (\n <FieldDescription>{latestValidationErrorText}</FieldDescription>\n )}\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.TextField>\n );\n },\n);\n\nexport default PasswordCreationField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEO,MAAM,qBAAA,GAAwB,aAAA;AAAA,EACnC,uBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,GAAA;AAAA,MACA,UAAA;AAAA,MACA,kBAAA;AAAA,MACA,SAAA,EAAW,gBAAA;AAAA,M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AAAA;AAAA;AAAA;AAEjD,WAAA,EACF,CAAA;AAAA,8BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,KAClB;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -6,6 +6,7 @@ import '@mittwald/password-tools-js/generator';
|
|
|
6
6
|
import '../PasswordCreationField.mjs';
|
|
7
7
|
import '../../../integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs';
|
|
8
8
|
import 'react';
|
|
9
|
+
import '../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
9
10
|
|
|
10
11
|
const generateTranslationString = (rule, shortVersion = false) => {
|
|
11
12
|
if (rule.translationKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateValidationTranslation.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/lib/generateValidationTranslation.ts"],"sourcesContent":["import {\n RuleType,\n type RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nconst generateTranslationString = (\n rule: Partial<RuleValidationResult> & { translationKey?: string },\n shortVersion = false,\n): string => {\n if (rule.translationKey) {\n return `validation.${rule.translationKey}`;\n }\n const translateString = `validation.${rule.ruleType ?? \"general\"}`;\n let finalTranslationString: string;\n\n if (\n (\"min\" in rule && rule.min !== undefined) ||\n (\"max\" in rule && rule.max !== undefined)\n ) {\n const breakingBoundaryProperty = rule.failingBoundary\n ? rule.failingBoundary\n : rule.min\n ? \"min\"\n : \"max\";\n\n if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}.${breakingBoundaryProperty}`;\n } else {\n finalTranslationString = `${translateString}.${breakingBoundaryProperty}`;\n }\n } else if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}`;\n } else {\n finalTranslationString = translateString;\n }\n\n return shortVersion\n ? `${finalTranslationString}.short`\n : finalTranslationString;\n};\n\nexport const generateValidationTranslation = (\n r: Partial<RuleValidationResult>,\n shotVersion = false,\n): [string, Record<string, string | number | boolean> | undefined] => {\n const translationKey = generateTranslationString(r, shotVersion);\n\n if (r.ruleType === RuleType.char && r.chars) {\n return [\n translationKey,\n { ...r, chars: r.chars.map((c) => c.char).join(\"\") },\n ];\n }\n\n return [\n translationKey,\n r as unknown as Record<string, string | number | boolean> | undefined,\n ];\n};\n\nexport default generateValidationTranslation;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateValidationTranslation.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/lib/generateValidationTranslation.ts"],"sourcesContent":["import {\n RuleType,\n type RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nconst generateTranslationString = (\n rule: Partial<RuleValidationResult> & { translationKey?: string },\n shortVersion = false,\n): string => {\n if (rule.translationKey) {\n return `validation.${rule.translationKey}`;\n }\n const translateString = `validation.${rule.ruleType ?? \"general\"}`;\n let finalTranslationString: string;\n\n if (\n (\"min\" in rule && rule.min !== undefined) ||\n (\"max\" in rule && rule.max !== undefined)\n ) {\n const breakingBoundaryProperty = rule.failingBoundary\n ? rule.failingBoundary\n : rule.min\n ? \"min\"\n : \"max\";\n\n if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}.${breakingBoundaryProperty}`;\n } else {\n finalTranslationString = `${translateString}.${breakingBoundaryProperty}`;\n }\n } else if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}`;\n } else {\n finalTranslationString = translateString;\n }\n\n return shortVersion\n ? `${finalTranslationString}.short`\n : finalTranslationString;\n};\n\nexport const generateValidationTranslation = (\n r: Partial<RuleValidationResult>,\n shotVersion = false,\n): [string, Record<string, string | number | boolean> | undefined] => {\n const translationKey = generateTranslationString(r, shotVersion);\n\n if (r.ruleType === RuleType.char && r.chars) {\n return [\n translationKey,\n { ...r, chars: r.chars.map((c) => c.char).join(\"\") },\n ];\n }\n\n return [\n translationKey,\n r as unknown as Record<string, string | number | boolean> | undefined,\n ];\n};\n\nexport default generateValidationTranslation;\n"],"names":[],"mappings":";;;;;;;;AAKA,MAA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AAA,CAAE,QAAA,KAAa,QAAA,CAAS,IAAA,IAAQ,EAAE,KAAA,EAAO;AAC3C,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,EAAE,GAAG,CAAA,EAAG,KAAA,EAAO,EAAE,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,IAAI,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA;AAAE,KACrD;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,cAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -6,6 +6,7 @@ import '@mittwald/password-tools-js/generator';
|
|
|
6
6
|
import '../PasswordCreationField.mjs';
|
|
7
7
|
import '../../../integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs';
|
|
8
8
|
import 'react';
|
|
9
|
+
import '../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
9
10
|
|
|
10
11
|
const getStateFromLatestPolicyValidationResult = (isEmptyValue, result) => {
|
|
11
12
|
if (result.isValid === "indeterminate") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStateFromLatestPolicyValidationResult.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult.ts"],"sourcesContent":["import { type RuleValidationResult } from \"@/integrations/@mittwald/password-tools-js\";\nimport type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\n\nexport type StateFromLatestPolicyValidationResult =\n | undefined\n | Partial<RuleValidationResult>;\n\n/** @internal */\nexport const getStateFromLatestPolicyValidationResult = (\n isEmptyValue: boolean,\n result: ResolvedPolicyValidationResult,\n): StateFromLatestPolicyValidationResult => {\n if (result.isValid === \"indeterminate\") {\n return undefined;\n }\n\n if (result.ruleResults.length >= 1) {\n const failingRule = result.ruleResults.find((r) => !r.isValid);\n if (failingRule) {\n return failingRule;\n }\n }\n\n if (!isEmptyValue) {\n if (result.complexity.actual < result.complexity.min) {\n return {\n isValid: false,\n identifier: \"failingComplexity\",\n };\n }\n\n if (result.complexity.actual === result.complexity.min) {\n return {\n isValid: result.isValid,\n identifier: \"optimizeComplexity\",\n };\n }\n }\n\n return {\n isValid: true,\n identifier: \"securePassword\",\n };\n};\n\nexport default getStateFromLatestPolicyValidationResult;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStateFromLatestPolicyValidationResult.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/lib/getStateFromLatestPolicyValidationResult.ts"],"sourcesContent":["import { type RuleValidationResult } from \"@/integrations/@mittwald/password-tools-js\";\nimport type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\n\nexport type StateFromLatestPolicyValidationResult =\n | undefined\n | Partial<RuleValidationResult>;\n\n/** @internal */\nexport const getStateFromLatestPolicyValidationResult = (\n isEmptyValue: boolean,\n result: ResolvedPolicyValidationResult,\n): StateFromLatestPolicyValidationResult => {\n if (result.isValid === \"indeterminate\") {\n return undefined;\n }\n\n if (result.ruleResults.length >= 1) {\n const failingRule = result.ruleResults.find((r) => !r.isValid);\n if (failingRule) {\n return failingRule;\n }\n }\n\n if (!isEmptyValue) {\n if (result.complexity.actual < result.complexity.min) {\n return {\n isValid: false,\n identifier: \"failingComplexity\",\n };\n }\n\n if (result.complexity.actual === result.complexity.min) {\n return {\n isValid: result.isValid,\n identifier: \"optimizeComplexity\",\n };\n }\n }\n\n return {\n isValid: true,\n identifier: \"securePassword\",\n };\n};\n\nexport default getStateFromLatestPolicyValidationResult;\n"],"names":[],"mappings":";;;;;;;;AAQO,MAAM,wCAAA,GAA2C,CACtD,YAAA,EACA,MAAA,KAC0C;AAC1C,EAAA,IAAI,MAAA,CAAO,YAAY,eAAA,EAAiB;AACtC,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,IAAI,MAAA,CAAO,WAAA,CAAY,MAAA,IAAU,CAAA,EAAG;AAClC,IAAA,MAAM,WAAA,GAAc,OAAO,WAAA,CAAY,IAAA,CAAK,CAAC,CAAA,KAAM,CAAC,EAAE,OAAO,CAAA;AAC7D,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,OAAO,WAAA;AAAA,IACT;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,YAAA,EAAc;AACjB,IAAA,IAAI,MAAA,CAAO,UAAA,CAAW,MAAA,GAAS,MAAA,CAAO,WAAW,GAAA,EAAK;AACpD,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,KAAA;AAAA,QACT,UAAA,EAAY;AAAA,OACd;AAAA,IACF;AAEA,IAAA,IAAI,MAAA,CAAO,UAAA,CAAW,MAAA,KAAW,MAAA,CAAO,WAAW,GAAA,EAAK;AACtD,MAAA,OAAO;AAAA,QACL,SAAS,MAAA,CAAO,OAAA;AAAA,QAChB,UAAA,EAAY;AAAA,OACd;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,IAAA;AAAA,IACT,UAAA,EAAY;AAAA,GACd;AACF;;;;"}
|
package/dist/js/packages/components/src/components/PasswordCreationField/worker/generatePassword.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { Generator } from '@mittwald/password-tools-js/generator';
|
|
|
6
6
|
import '../PasswordCreationField.mjs';
|
|
7
7
|
import '../../../integrations/@mittwald/password-tools-js/defaultPasswordCreationPolicy.mjs';
|
|
8
8
|
import 'react';
|
|
9
|
+
import '../../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
9
10
|
|
|
10
11
|
const generatePassword = async (validationPolicy) => {
|
|
11
12
|
return new Generator(validationPolicy).generatePassword();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePassword.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/worker/generatePassword.ts"],"sourcesContent":["import {\n Generator,\n type Policy,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nexport const generatePassword = async (\n validationPolicy: Policy,\n): Promise<string> => {\n return new Generator(validationPolicy).generatePassword();\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generatePassword.mjs","sources":["../../../../../../../../src/components/PasswordCreationField/worker/generatePassword.ts"],"sourcesContent":["import {\n Generator,\n type Policy,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nexport const generatePassword = async (\n validationPolicy: Policy,\n): Promise<string> => {\n return new Generator(validationPolicy).generatePassword();\n};\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,gBAAA,GAAmB,OAC9B,gBAAA,KACoB;AACpB,EAAA,OAAO,IAAI,SAAA,CAAU,gBAAgB,CAAA,CAAE,gBAAA,EAAiB;AAC1D;;;;"}
|
|
@@ -22,6 +22,7 @@ import 'dot-prop';
|
|
|
22
22
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
23
23
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
24
24
|
import { UiComponentTunnelExit } from '../UiComponentTunnel/UiComponentTunnelExit.mjs';
|
|
25
|
+
import { useWarnDeprecation } from '../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
25
26
|
|
|
26
27
|
const Select = flowComponent("Select", (props) => {
|
|
27
28
|
const {
|
|
@@ -33,6 +34,12 @@ const Select = flowComponent("Select", (props) => {
|
|
|
33
34
|
ref,
|
|
34
35
|
...rest
|
|
35
36
|
} = props;
|
|
37
|
+
const warnDeprecation = useWarnDeprecation();
|
|
38
|
+
if (onSelectionChange !== void 0) {
|
|
39
|
+
warnDeprecation(
|
|
40
|
+
"The 'onSelectionChange' prop is deprecated and will be removed in a future release. Use 'onChange' instead."
|
|
41
|
+
);
|
|
42
|
+
}
|
|
36
43
|
const {
|
|
37
44
|
FieldErrorView,
|
|
38
45
|
fieldPropsContext,
|