@mittwald/flow-react-components 0.2.0-alpha.60 → 0.2.0-alpha.62
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/CHANGELOG.md +10 -0
- package/dist/assets/doc-properties.json +7534 -7534
- package/dist/js/components/List/components/Header/components/ViewModeMenu/ViewModeMenu.mjs +2 -1
- package/dist/js/components/List/components/Header/components/ViewModeMenu/ViewModeMenu.mjs.map +1 -1
- package/dist/js/components/List/components/Items/Items.mjs +2 -1
- package/dist/js/components/List/components/Items/Items.mjs.map +1 -1
- package/dist/js/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +2 -1
- package/dist/js/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
- package/dist/js/components/List/components/ListItemView/ListItemView.mjs +2 -1
- package/dist/js/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
- package/dist/js/components/List/components/Table/Table.mjs +2 -1
- package/dist/js/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/components/List/model/sorting/Sorting.mjs +5 -0
- package/dist/js/components/List/model/sorting/Sorting.mjs.map +1 -1
- package/dist/js/components/List/model/sorting/SortingFunctions.mjs +54 -0
- package/dist/js/components/List/model/sorting/SortingFunctions.mjs.map +1 -0
- package/dist/js/components/List/model/types.mjs.map +1 -1
- package/dist/js/components/List/typedList.mjs +2 -1
- package/dist/js/components/List/typedList.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +1 -1
- package/dist/js/index.mjs +1 -0
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/views/ItemsGridListItemView.mjs +2 -1
- package/dist/js/views/ItemsGridListItemView.mjs.map +1 -1
- package/dist/js/views/ItemsGridListView.mjs +2 -1
- package/dist/js/views/ItemsGridListView.mjs.map +1 -1
- package/dist/js/views/ListEmptyViewView.mjs +2 -1
- package/dist/js/views/ListEmptyViewView.mjs.map +1 -1
- package/dist/js/views/ListItemViewContentView.mjs +2 -1
- package/dist/js/views/ListItemViewContentView.mjs.map +1 -1
- package/dist/types/components/List/index.d.ts +2 -1
- package/dist/types/components/List/index.d.ts.map +1 -1
- package/dist/types/components/List/model/sorting/Sorting.d.ts +2 -1
- package/dist/types/components/List/model/sorting/Sorting.d.ts.map +1 -1
- package/dist/types/components/List/model/sorting/SortingFunctions.d.ts +7 -0
- package/dist/types/components/List/model/sorting/SortingFunctions.d.ts.map +1 -0
- package/dist/types/components/List/model/sorting/types.d.ts +3 -1
- package/dist/types/components/List/model/sorting/types.d.ts.map +1 -1
- package/dist/types/components/List/model/types.d.ts +7 -7
- package/dist/types/components/List/model/types.d.ts.map +1 -1
- package/dist/types/components/List/stories/EdgeCases.stories.d.ts +1 -0
- package/dist/types/components/List/stories/EdgeCases.stories.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -4,6 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import locales from '../../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
6
6
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
7
|
+
import 'invariant';
|
|
8
|
+
import 'luxon';
|
|
7
9
|
import 'react-aria-components';
|
|
8
10
|
import 'clsx';
|
|
9
11
|
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
@@ -15,7 +17,6 @@ import '@mittwald/react-tunnel';
|
|
|
15
17
|
import '../../../../../../lib/slotContext/slotContext.mjs';
|
|
16
18
|
import '../../../../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
17
19
|
import { IconView } from '../../../../../Icon/components/icons/IconView.mjs';
|
|
18
|
-
import 'invariant';
|
|
19
20
|
import ButtonView from '../../../../../../views/ButtonView.mjs';
|
|
20
21
|
import { ContextMenu } from '../../../../../ContextMenu/ContextMenu.mjs';
|
|
21
22
|
import { ContextMenuTrigger } from '../../../../../ContextMenu/components/ContextMenuTrigger/ContextMenuTrigger.mjs';
|
package/dist/js/components/List/components/Header/components/ViewModeMenu/ViewModeMenu.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewModeMenu.mjs","sources":["../../../../../../../../src/components/List/components/Header/components/ViewModeMenu/ViewModeMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { useList } from \"@/components/List\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport SectionView from \"@/views/SectionView\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContextMenu, { ContextMenuTrigger } from \"@/components/ContextMenu\";\n\nexport const ViewModeMenu: FC = () => {\n const stringFormatter = useLocalizedStringFormatter(locales);\n const list = useList();\n const selectedViewMode = list.viewMode;\n\n const availableViewModes: ListViewMode[] = [];\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 if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTrigger>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.settings\")}\n >\n <TextView>\n {stringFormatter.format(`list.settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenu selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n <SectionView>\n <HeadingView>\n {stringFormatter.format(\"list.settings.viewMode\")}\n </HeadingView>\n {availableViewModes.map((viewMode) => (\n <MenuItemView\n id={viewMode}\n key={viewMode}\n onAction={() => {\n list.setViewMode(viewMode);\n }}\n >\n {stringFormatter.format(`list.settings.viewMode.${viewMode}`)}\n </MenuItemView>\n ))}\n </SectionView>\n </ContextMenu>\n </ContextMenuTrigger>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewModeMenu.mjs","sources":["../../../../../../../../src/components/List/components/Header/components/ViewModeMenu/ViewModeMenu.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { useList } from \"@/components/List\";\nimport type { ListViewMode } from \"@/components/List/model/types\";\nimport { IconView } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport TextView from \"@/views/TextView\";\nimport SectionView from \"@/views/SectionView\";\nimport MenuItemView from \"@/views/MenuItemView\";\nimport HeadingView from \"@/views/HeadingView\";\nimport ContextMenu, { ContextMenuTrigger } from \"@/components/ContextMenu\";\n\nexport const ViewModeMenu: FC = () => {\n const stringFormatter = useLocalizedStringFormatter(locales);\n const list = useList();\n const selectedViewMode = list.viewMode;\n\n const availableViewModes: ListViewMode[] = [];\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 if (availableViewModes.length <= 1) {\n return null;\n }\n\n return (\n <ContextMenuTrigger>\n <ButtonView\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.settings\")}\n >\n <TextView>\n {stringFormatter.format(`list.settings.viewMode.${selectedViewMode}`)}\n </TextView>\n <IconView />\n </ButtonView>\n <ContextMenu selectionMode=\"single\" selectedKeys={[selectedViewMode]}>\n <SectionView>\n <HeadingView>\n {stringFormatter.format(\"list.settings.viewMode\")}\n </HeadingView>\n {availableViewModes.map((viewMode) => (\n <MenuItemView\n id={viewMode}\n key={viewMode}\n onAction={() => {\n list.setViewMode(viewMode);\n }}\n >\n {stringFormatter.format(`list.settings.viewMode.${viewMode}`)}\n </MenuItemView>\n ))}\n </SectionView>\n </ContextMenu>\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,EAAA,EAAA,QAAA,EAAA,eAAA,CAAgB,MAAO,CAAA,wBAAwB,CAClD,EAAA,CAAA;AAAA,MACC,kBAAA,CAAmB,GAAI,CAAA,CAAC,QACvB,qBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA,QAAA;AAAA,UAEJ,UAAU,MAAM;AACd,YAAA,IAAA,CAAK,YAAY,QAAQ,CAAA;AAAA,WAC3B;AAAA,UAEC,QAAgB,EAAA,eAAA,CAAA,MAAA,CAAO,CAA0B,uBAAA,EAAA,QAAQ,CAAE,CAAA;AAAA,SAAA;AAAA,QALvD;AAAA,OAOR;AAAA,KAAA,EACH,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'invariant';
|
|
5
|
+
import 'luxon';
|
|
4
6
|
import 'react-aria-components';
|
|
5
7
|
import { EmptyView } from '../../views/EmptyView/EmptyView.mjs';
|
|
6
8
|
import clsx from 'clsx';
|
|
@@ -14,7 +16,6 @@ import 'dot-prop';
|
|
|
14
16
|
import 'react-aria';
|
|
15
17
|
import '@tabler/icons-react';
|
|
16
18
|
import '../../../../lib/slotContext/slotContext.mjs';
|
|
17
|
-
import 'invariant';
|
|
18
19
|
import '@chakra-ui/live-region';
|
|
19
20
|
import 'mobx';
|
|
20
21
|
import '../../../../lib/controller/overlay/context.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items.mjs","sources":["../../../../../../src/components/List/components/Items/Items.tsx"],"sourcesContent":["import { EmptyView } from \"@/components/List\";\nimport Item from \"@/components/List/components/Items/components/Item/Item\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport DivView from \"@/views/DivView\";\nimport ItemsGridListView from \"@/views/ItemsGridListView\";\nimport clsx from \"clsx\";\nimport type { FC } from \"react\";\nimport styles from \"./Items.module.scss\";\nimport { FallbackItems } from \"./components/FallbackItems\";\n\nexport const Items: FC = () => {\n const list = useList();\n const tiles = list.viewMode === \"tiles\";\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!list.itemView) {\n return null;\n }\n\n const items = list.items.entries.map((item) => (\n <Item key={item.id} data={item.data} id={item.id} />\n ));\n\n const rootClassName = clsx(\n styles.items,\n isLoading && styles.isLoading,\n tiles && styles.tiles,\n );\n\n return (\n <DivView aria-hidden={isInitiallyLoading} aria-busy={isLoading}>\n <ItemsGridListView\n className={rootClassName}\n {...list.componentProps}\n renderEmptyState={() => <EmptyView />}\n style={{\n gridTemplateColumns: `repeat(auto-fill, minmax(${list.itemView.tileMaxWidth}px, 1fr))`,\n }}\n >\n {isInitiallyLoading ? <FallbackItems /> : items}\n </ItemsGridListView>\n </DivView>\n );\n};\n\nexport default Items;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Items.mjs","sources":["../../../../../../src/components/List/components/Items/Items.tsx"],"sourcesContent":["import { EmptyView } from \"@/components/List\";\nimport Item from \"@/components/List/components/Items/components/Item/Item\";\nimport { useList } from \"@/components/List/hooks/useList\";\nimport DivView from \"@/views/DivView\";\nimport ItemsGridListView from \"@/views/ItemsGridListView\";\nimport clsx from \"clsx\";\nimport type { FC } from \"react\";\nimport styles from \"./Items.module.scss\";\nimport { FallbackItems } from \"./components/FallbackItems\";\n\nexport const Items: FC = () => {\n const list = useList();\n const tiles = list.viewMode === \"tiles\";\n const isLoading = list.loader.useIsLoading();\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n\n if (!list.itemView) {\n return null;\n }\n\n const items = list.items.entries.map((item) => (\n <Item key={item.id} data={item.data} id={item.id} />\n ));\n\n const rootClassName = clsx(\n styles.items,\n isLoading && styles.isLoading,\n tiles && styles.tiles,\n );\n\n return (\n <DivView aria-hidden={isInitiallyLoading} aria-busy={isLoading}>\n <ItemsGridListView\n className={rootClassName}\n {...list.componentProps}\n renderEmptyState={() => <EmptyView />}\n style={{\n gridTemplateColumns: `repeat(auto-fill, minmax(${list.itemView.tileMaxWidth}px, 1fr))`,\n }}\n >\n {isInitiallyLoading ? <FallbackItems /> : items}\n </ItemsGridListView>\n </DivView>\n );\n};\n\nexport default Items;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,QAAY,MAAM;AAC7B,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAM,MAAA,KAAA,GAAQ,KAAK,QAAa,KAAA,OAAA;AAChC,EAAM,MAAA,SAAA,GAAY,IAAK,CAAA,MAAA,CAAO,YAAa,EAAA;AAC3C,EAAM,MAAA,kBAAA,GAAqB,IAAK,CAAA,MAAA,CAAO,qBAAsB,EAAA;AAE7D,EAAI,IAAA,CAAC,KAAK,QAAU,EAAA;AAClB,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,QAAQ,IAAK,CAAA,KAAA,CAAM,OAAQ,CAAA,GAAA,CAAI,CAAC,IACpC,qBAAA,GAAA,CAAC,IAAmB,EAAA,EAAA,IAAA,EAAM,KAAK,IAAM,EAAA,EAAA,EAAI,KAAK,EAAnC,EAAA,EAAA,IAAA,CAAK,EAAkC,CACnD,CAAA;AAED,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,KAAA;AAAA,IACP,aAAa,MAAO,CAAA,SAAA;AAAA,IACpB,SAAS,MAAO,CAAA;AAAA,GAClB;AAEA,EAAA,uBACG,GAAA,CAAA,OAAA,EAAA,EAAQ,aAAa,EAAA,kBAAA,EAAoB,aAAW,SACnD,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,aAAA;AAAA,MACV,GAAG,IAAK,CAAA,cAAA;AAAA,MACT,gBAAA,EAAkB,sBAAM,GAAA,CAAC,SAAU,EAAA,EAAA,CAAA;AAAA,MACnC,KAAO,EAAA;AAAA,QACL,mBAAqB,EAAA,CAAA,yBAAA,EAA4B,IAAK,CAAA,QAAA,CAAS,YAAY,CAAA,SAAA;AAAA,OAC7E;AAAA,MAEC,QAAA,EAAA,kBAAA,mBAAsB,GAAA,CAAA,aAAA,EAAA,EAAc,CAAK,GAAA;AAAA;AAAA,GAE9C,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useId, useRef, useEffect } from 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import 'react-aria-components';
|
|
6
8
|
import 'clsx';
|
|
7
9
|
import '../../../../../../../lib/propsContext/propsContext.mjs';
|
|
@@ -13,7 +15,6 @@ import '../../../../../../../lib/slotContext/slotContext.mjs';
|
|
|
13
15
|
import '@react-aria/utils';
|
|
14
16
|
import 'remeda';
|
|
15
17
|
import '../../../../../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
16
|
-
import 'invariant';
|
|
17
18
|
import 'react-aria';
|
|
18
19
|
import '@chakra-ui/live-region';
|
|
19
20
|
import 'mobx';
|
package/dist/js/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridItemProps.mjs","sources":["../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React, { useEffect, useId, useRef, useState } from \"react\";\nimport { useList } from \"@/components/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n}\n\nexport const useGridItemProps = (props: P) => {\n const { data, children: childrenFromProps } = props;\n const list = useList();\n const itemView = list.itemView;\n const onAction = list.onAction;\n\n const [isExpanded, setIsExpanded] = useState(\n itemView?.defaultExpanded?.(data) ?? false,\n );\n const contentElementId = useId();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const accordion = list.accordion;\n const children = childrenFromProps ?? itemView?.render(data);\n\n useEffect(() => {\n if (accordion) {\n itemRef.current?.setAttribute(\"aria-expanded\", String(isExpanded));\n itemRef.current?.setAttribute(\"aria-controls\", contentElementId);\n }\n }, [isExpanded, contentElementId, itemRef.current, accordion]);\n\n if (!accordion) {\n return {\n gridItemProps: {\n onAction: onAction\n ? () => {\n onAction?.(data);\n }\n : undefined,\n },\n children,\n };\n }\n\n const toggleAccordion = () => {\n setIsExpanded((current) => !current);\n onAction?.(data);\n };\n\n const propsContext: PropsContext = {\n Content: {\n id: dynamic((p) => (p.slot === \"bottom\" ? contentElementId : undefined)),\n wrapWith: dynamic((p) =>\n p.slot === \"bottom\" ? (\n <AccordionButton\n contentElementId={contentElementId}\n toggle={toggleAccordion}\n isExpanded={isExpanded}\n />\n ) : undefined,\n ),\n },\n };\n\n return {\n gridItemProps: {\n ref: itemRef,\n onAction: toggleAccordion,\n },\n children: (\n <PropsContextProvider\n props={propsContext}\n dependencies={[contentElementId, isExpanded]}\n >\n {children}\n </PropsContextProvider>\n ),\n };\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGridItemProps.mjs","sources":["../../../../../../../../../src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React, { useEffect, useId, useRef, useState } from \"react\";\nimport { useList } from \"@/components/List\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { AccordionButton } from \"@/components/List/components/Items/components/Item/components/AccordionButton\";\n\ninterface P extends PropsWithChildren {\n data: never;\n}\n\nexport const useGridItemProps = (props: P) => {\n const { data, children: childrenFromProps } = props;\n const list = useList();\n const itemView = list.itemView;\n const onAction = list.onAction;\n\n const [isExpanded, setIsExpanded] = useState(\n itemView?.defaultExpanded?.(data) ?? false,\n );\n const contentElementId = useId();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const accordion = list.accordion;\n const children = childrenFromProps ?? itemView?.render(data);\n\n useEffect(() => {\n if (accordion) {\n itemRef.current?.setAttribute(\"aria-expanded\", String(isExpanded));\n itemRef.current?.setAttribute(\"aria-controls\", contentElementId);\n }\n }, [isExpanded, contentElementId, itemRef.current, accordion]);\n\n if (!accordion) {\n return {\n gridItemProps: {\n onAction: onAction\n ? () => {\n onAction?.(data);\n }\n : undefined,\n },\n children,\n };\n }\n\n const toggleAccordion = () => {\n setIsExpanded((current) => !current);\n onAction?.(data);\n };\n\n const propsContext: PropsContext = {\n Content: {\n id: dynamic((p) => (p.slot === \"bottom\" ? contentElementId : undefined)),\n wrapWith: dynamic((p) =>\n p.slot === \"bottom\" ? (\n <AccordionButton\n contentElementId={contentElementId}\n toggle={toggleAccordion}\n isExpanded={isExpanded}\n />\n ) : undefined,\n ),\n },\n };\n\n return {\n gridItemProps: {\n ref: itemRef,\n onAction: toggleAccordion,\n },\n children: (\n <PropsContextProvider\n props={propsContext}\n dependencies={[contentElementId, isExpanded]}\n >\n {children}\n </PropsContextProvider>\n ),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWa,MAAA,gBAAA,GAAmB,CAAC,KAAa,KAAA;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAM,QAAU,EAAA,iBAAA,EAAsB,GAAA,KAAA;AAC9C,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAA,MAAM,WAAW,IAAK,CAAA,QAAA;AACtB,EAAA,MAAM,WAAW,IAAK,CAAA,QAAA;AAEtB,EAAM,MAAA,CAAC,UAAY,EAAA,aAAa,CAAI,GAAA,QAAA;AAAA,IAClC,QAAA,EAAU,eAAkB,GAAA,IAAI,CAAK,IAAA;AAAA,G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AAA,SAEA,GAAA;AAAA;AACN;AACF,GACF;AAEA,EAAO,OAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,GAAK,EAAA,OAAA;AAAA,MACL,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,QACE,kBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,YAAA;AAAA,QACP,YAAA,EAAc,CAAC,gBAAA,EAAkB,UAAU,CAAA;AAAA,QAE1C;AAAA;AAAA;AACH,GAEJ;AACF;;;;"}
|
|
@@ -10,6 +10,8 @@ import '../../../../lib/propsContext/propsContext.mjs';
|
|
|
10
10
|
import { PropsContextProvider } from '../../../../lib/propsContext/PropsContextProvider.mjs';
|
|
11
11
|
import { dynamic } from '../../../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
12
12
|
import { OptionsButton } from '../Items/components/Item/components/OptionsButton/OptionsButton.mjs';
|
|
13
|
+
import 'invariant';
|
|
14
|
+
import 'luxon';
|
|
13
15
|
import 'react-aria-components';
|
|
14
16
|
import 'clsx';
|
|
15
17
|
import '@tabler/icons-react';
|
|
@@ -17,7 +19,6 @@ import '../../../../lib/slotContext/slotContext.mjs';
|
|
|
17
19
|
import '@react-aria/utils';
|
|
18
20
|
import 'remeda';
|
|
19
21
|
import '../../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
20
|
-
import 'invariant';
|
|
21
22
|
import 'react-aria';
|
|
22
23
|
import { useList } from '../../hooks/useList.mjs';
|
|
23
24
|
import '../../listContext.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemView.mjs","sources":["../../../../../../src/components/List/components/ListItemView/ListItemView.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport FragmentView from \"@/views/FragmentView\";\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\";\n\nexport type ListItemViewProps = PropsWithChildren;\n\nexport const ListItemView = (props: ListItemViewProps) => {\n const { children } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnelId: \"button\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnelId: \"button\",\n },\n ActionGroup: {\n tunnelId: \"button\",\n Button: {\n tunnelId: null,\n },\n },\n Avatar: {\n tunnelId: \"avatar\",\n },\n Heading: {\n tunnelId: \"title\",\n },\n Text: {\n tunnelId: \"text\",\n },\n Content: {\n tunnelId: dynamic((p) => (p.slot === \"bottom\" ? \"bottom\" : undefined)),\n },\n };\n\n return (\n <PropsContextProvider props={propsContext} mergeInParentContext>\n <TunnelProvider>\n <ListItemViewContentView\n viewMode={list.viewMode}\n title={\n <FragmentView>\n <TunnelExit id=\"title\" />\n </FragmentView>\n }\n avatar={\n <FragmentView>\n <TunnelExit id=\"avatar\" />\n </FragmentView>\n }\n button={\n <FragmentView>\n <TunnelExit id=\"button\" />\n </FragmentView>\n }\n subTitle={\n <FragmentView>\n <TunnelExit id=\"text\" />\n </FragmentView>\n }\n bottom={\n <FragmentView>\n <TunnelExit id=\"bottom\" />\n </FragmentView>\n }\n >\n {children}\n </ListItemViewContentView>\n </TunnelProvider>\n </PropsContextProvider>\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 React from \"react\";\nimport styles from \"./ListItemView.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport ListItemViewContentView from \"@/views/ListItemViewContentView\";\nimport FragmentView from \"@/views/FragmentView\";\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\";\n\nexport type ListItemViewProps = PropsWithChildren;\n\nexport const ListItemView = (props: ListItemViewProps) => {\n const { children } = props;\n const list = useList();\n\n const propsContext: PropsContext = {\n ContextMenu: {\n tunnelId: \"button\",\n wrapWith: <OptionsButton className={styles.action} />,\n },\n Button: {\n tunnelId: \"button\",\n },\n ActionGroup: {\n tunnelId: \"button\",\n Button: {\n tunnelId: null,\n },\n },\n Avatar: {\n tunnelId: \"avatar\",\n },\n Heading: {\n tunnelId: \"title\",\n },\n Text: {\n tunnelId: \"text\",\n },\n Content: {\n tunnelId: dynamic((p) => (p.slot === \"bottom\" ? \"bottom\" : undefined)),\n },\n };\n\n return (\n <PropsContextProvider props={propsContext} mergeInParentContext>\n <TunnelProvider>\n <ListItemViewContentView\n viewMode={list.viewMode}\n title={\n <FragmentView>\n <TunnelExit id=\"title\" />\n </FragmentView>\n }\n avatar={\n <FragmentView>\n <TunnelExit id=\"avatar\" />\n </FragmentView>\n }\n button={\n <FragmentView>\n <TunnelExit id=\"button\" />\n </FragmentView>\n }\n subTitle={\n <FragmentView>\n <TunnelExit id=\"text\" />\n </FragmentView>\n }\n bottom={\n <FragmentView>\n <TunnelExit id=\"bottom\" />\n </FragmentView>\n }\n >\n {children}\n </ListItemViewContentView>\n </TunnelProvider>\n </PropsContextProvider>\n );\n};\n\nexport default ListItemView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBa,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA,EAAE,UAAa,GAAA,KAAA;AACrB,EAAA,MAAM,OAAO,OAAQ,EAAA;AAErB,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,QAAA;AAAA,MACV,QAAU,k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ACC,8BAAC,UAAW,EAAA,EAAA,EAAA,EAAG,UAAS,CAC1B,EAAA,CAAA;AAAA,MAGD;AAAA;AAAA,KAEL,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import 'react-aria-components';
|
|
6
8
|
import clsx from 'clsx';
|
|
7
9
|
import '../../../../lib/propsContext/propsContext.mjs';
|
|
@@ -12,7 +14,6 @@ import '@tabler/icons-react';
|
|
|
12
14
|
import '@mittwald/react-tunnel';
|
|
13
15
|
import '../../../../lib/slotContext/slotContext.mjs';
|
|
14
16
|
import '../../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
15
|
-
import 'invariant';
|
|
16
17
|
import 'react-aria';
|
|
17
18
|
import '@chakra-ui/live-region';
|
|
18
19
|
import 'mobx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","sources":["../../../../../../src/components/List/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { useList } from \"@/components/List\";\nimport { TableLoadingView } from \"@/components/List/components/Table/components/TableLoadingView\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport ListEmptyViewView from \"@/views/ListEmptyViewView\";\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\";\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) {\n return null;\n }\n\n if (isInitiallyLoading) {\n return <TableLoadingView {...table.componentProps} />;\n }\n\n if (listIsEmpty) {\n return <ListEmptyViewView />;\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 return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\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 {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 </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 React from \"react\";\nimport { useList } from \"@/components/List\";\nimport { TableLoadingView } from \"@/components/List/components/Table/components/TableLoadingView\";\nimport styles from \"./Table.module.css\";\nimport clsx from \"clsx\";\nimport ListEmptyViewView from \"@/views/ListEmptyViewView\";\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\";\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) {\n return null;\n }\n\n if (isInitiallyLoading) {\n return <TableLoadingView {...table.componentProps} />;\n }\n\n if (listIsEmpty) {\n return <ListEmptyViewView />;\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 return (\n <TableView\n {...list.componentProps}\n {...table.componentProps}\n className={tableClassName}\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 {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 </TableBodyView>\n </TableView>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,QAAY,MAAM;AAC7B,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAA,MAAM,QAAQ,IAAK,CAAA,KAAA;AACnB,EAAM,MAAA,WAAA,GAAc,KAAK,UAAW,EAAA;AAEpC,EAAM,MAAA,SAAA,GAAY,IAAK,CAAA,MAAA,CAAO,YAAa,EAAA;AAC3C,EAAM,MAAA,kBAAA,GAAqB,IAAK,CAAA,MAAA,CAAO,qBAAsB,EAAA;AAE7D,EAAA,IAAI,CAAC,KAAO,EAAA;AACV,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,IAAI,kBAAoB,EAAA;AACtB,IAAA,uBAAQ,GAAA,CAAA,gBAAA,EA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T,UAAU,SAAY,GAAA,MAAM,SAAU,CAAA,IAAA,CAAK,IAAI,CAAI,GAAA,MAAA;AAAA,YAClD,GAAG,KAAM,CAAA,IAAA,CAAK,GAAI,CAAA,cAAA;AAAA,YAElB,QAAA,EAAA,KAAA,CAAM,KAAK,GAAK,EAAA,KAAA,CAAM,IAAI,CAAC,IAAA,EAAM,CAChC,qBAAA,GAAA,CAAC,aAAuB,EAAA,EAAA,GAAG,KAAK,cAC7B,EAAA,QAAA,EAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAK,QAAS,CAAA,IAAA,CAAK,MAAM,IAAI,CAAA,GAAI,MADhC,EAAA,EAAA,CAEpB,CACD;AAAA,WAAA;AAAA,UATI,IAAK,CAAA;AAAA,SAWb,CACH,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -6,15 +6,20 @@ class Sorting {
|
|
|
6
6
|
name;
|
|
7
7
|
direction;
|
|
8
8
|
defaultEnabled;
|
|
9
|
+
customSortingFn;
|
|
9
10
|
constructor(list, shape) {
|
|
10
11
|
this.list = list;
|
|
11
12
|
this.property = shape.property;
|
|
12
13
|
this.name = shape.name;
|
|
13
14
|
this.direction = shape.direction ?? "asc";
|
|
14
15
|
this.defaultEnabled = shape.defaultEnabled ?? false;
|
|
16
|
+
this.customSortingFn = shape.customSortingFn;
|
|
15
17
|
}
|
|
16
18
|
updateTableColumnDef(def) {
|
|
17
19
|
def.enableSorting = true;
|
|
20
|
+
if (this.customSortingFn) {
|
|
21
|
+
def.sortingFn = this.customSortingFn;
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
getReactTableColumnSort() {
|
|
20
25
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sorting.mjs","sources":["../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"Sorting.mjs","sources":["../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type List from \"@/components/List/model/List\";\nimport type {\n SortingDefaultMode,\n SortingShape,\n} from \"@/components/List/model/sorting/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type {\n Column,\n ColumnDef,\n ColumnSort,\n SortDirection,\n SortingFn,\n} from \"@tanstack/react-table\";\n\nexport class Sorting<T> {\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly name?: string;\n public readonly direction: SortDirection;\n public readonly defaultEnabled: SortingDefaultMode;\n public readonly customSortingFn?: SortingFn<T>;\n\n public constructor(list: List<T>, shape: SortingShape<T>) {\n this.list = list;\n this.property = shape.property;\n this.name = shape.name;\n this.direction = shape.direction ?? \"asc\";\n this.defaultEnabled = shape.defaultEnabled ?? false;\n this.customSortingFn = shape.customSortingFn;\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableSorting = true;\n if (this.customSortingFn) {\n def.sortingFn = this.customSortingFn;\n }\n }\n\n public getReactTableColumnSort(): ColumnSort {\n return {\n id: this.property as string,\n desc: this.direction === \"desc\",\n };\n }\n\n public isSorted(): boolean {\n const col = this.getTableColumn();\n return col.getIsSorted() == this.direction;\n }\n\n public getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public enable(): void {\n this.list.reactTable\n .getTableColumn(this.property)\n .toggleSorting(this.direction === \"desc\", false);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).clearSorting();\n }\n\n public get id(): string {\n return `${this.getTableColumn().id}:${this.direction}`;\n }\n}\n"],"names":[],"mappings":"AAcO,MAAM,OAAW,CAAA;AAAA,EACN,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EAET,WAAA,CAAY,MAAe,KAAwB,EAAA;AACxD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAM,CAAA,QAAA;AACtB,IAAA,IAAA,CA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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import invariant from 'invariant';
|
|
4
|
+
import { DateTime } from 'luxon';
|
|
5
|
+
|
|
6
|
+
const SortingFunctions = {
|
|
7
|
+
bigInt: (rowA, rowB, columnId) => {
|
|
8
|
+
const valueA = rowA.getValue(columnId);
|
|
9
|
+
const valueB = rowB.getValue(columnId);
|
|
10
|
+
if (valueA == null) return valueB == null ? 0 : -1;
|
|
11
|
+
if (valueB == null) return 1;
|
|
12
|
+
try {
|
|
13
|
+
invariant(
|
|
14
|
+
typeof valueA === "bigint" && typeof valueB === "bigint",
|
|
15
|
+
`Expected BigInt values, got ${typeof valueA} and ${typeof valueB}`
|
|
16
|
+
);
|
|
17
|
+
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error(`Error in BigInt comparison: ${error}`);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
alphanumeric: "alphanumeric",
|
|
23
|
+
dateTime: (rowA, rowB, columnId) => {
|
|
24
|
+
const valueA = rowA.getValue(columnId);
|
|
25
|
+
const valueB = rowB.getValue(columnId);
|
|
26
|
+
if (valueA == null) return valueB == null ? 0 : -1;
|
|
27
|
+
if (valueB == null) return 1;
|
|
28
|
+
let dtA = null;
|
|
29
|
+
let dtB = null;
|
|
30
|
+
if (valueA instanceof DateTime) {
|
|
31
|
+
dtA = valueA;
|
|
32
|
+
} else if (typeof valueA === "string") {
|
|
33
|
+
dtA = DateTime.fromISO(valueA);
|
|
34
|
+
}
|
|
35
|
+
if (valueB instanceof DateTime) {
|
|
36
|
+
dtB = valueB;
|
|
37
|
+
} else if (typeof valueB === "string") {
|
|
38
|
+
dtB = DateTime.fromISO(valueB);
|
|
39
|
+
}
|
|
40
|
+
if (dtA?.isValid && dtB?.isValid) {
|
|
41
|
+
return dtA.toMillis() - dtB.toMillis();
|
|
42
|
+
} else if (dtA?.isValid) {
|
|
43
|
+
return -1;
|
|
44
|
+
} else if (dtB?.isValid) {
|
|
45
|
+
return 1;
|
|
46
|
+
} else {
|
|
47
|
+
console.warn("Invalid DateTime values for sorting.");
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { SortingFunctions };
|
|
54
|
+
//# sourceMappingURL=SortingFunctions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortingFunctions.mjs","sources":["../../../../../../src/components/List/model/sorting/SortingFunctions.ts"],"sourcesContent":["import type { Row, SortingFn } from \"@tanstack/react-table\";\nimport invariant from \"invariant\";\nimport { DateTime } from \"luxon\";\n\nexport const SortingFunctions = {\n bigInt: ((rowA: Row<bigint>, rowB: Row<bigint>, columnId) => {\n const valueA = rowA.getValue(columnId);\n const valueB = rowB.getValue(columnId);\n\n if (valueA == null) return valueB == null ? 0 : -1;\n if (valueB == null) return 1;\n\n try {\n invariant(\n typeof valueA === \"bigint\" && typeof valueB === \"bigint\",\n `Expected BigInt values, got ${typeof valueA} and ${typeof valueB}`,\n );\n\n return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;\n } catch (error) {\n console.error(`Error in BigInt comparison: ${error}`);\n }\n }) as SortingFn<unknown>,\n\n alphanumeric: \"alphanumeric\" as const,\n\n dateTime: ((rowA: Row<unknown>, rowB: Row<unknown>, columnId) => {\n const valueA = rowA.getValue(columnId);\n const valueB = rowB.getValue(columnId);\n\n if (valueA == null) return valueB == null ? 0 : -1;\n if (valueB == null) return 1;\n\n let dtA: DateTime | null = null;\n let dtB: DateTime | null = null;\n\n if (valueA instanceof DateTime) {\n dtA = valueA;\n } else if (typeof valueA === \"string\") {\n dtA = DateTime.fromISO(valueA);\n }\n\n if (valueB instanceof DateTime) {\n dtB = valueB;\n } else if (typeof valueB === \"string\") {\n dtB = DateTime.fromISO(valueB);\n }\n\n if (dtA?.isValid && dtB?.isValid) {\n return dtA.toMillis() - dtB.toMillis();\n } else if (dtA?.isValid) {\n return -1;\n } else if (dtB?.isValid) {\n return 1;\n } else {\n console.warn(\"Invalid DateTime values for sorting.\");\n return 0;\n }\n }) as SortingFn<unknown>,\n};\n"],"names":[],"mappings":";;;AAIO,MAAM,gBAAmB,GAAA;AAAA,EAC9B,MAAS,EAAA,CAAC,IAAmB,EAAA,IAAA,EAAmB,QAAa,KAAA;AAC3D,IAAM,MAAA,MAAA,GAAS,IAAK,CAAA,QAAA,CAAS,QAAQ,CAAA;AACrC,IAAM,MAAA,MAAA,GAAS,IAAK,CAAA,QAAA,CAAS,QAAQ,CAAA;AAErC,IAAA,IAAI,MAAU,IAAA,IAAA,EAAa,OAAA,MAAA,IAAU,OAAO,CAAI,GAAA,EAAA;AAChD,IAAI,IAAA,MAAA,IAAU,MAAa,OAAA,CAAA;AAE3B,IAAI,IAAA;AACF,MAAA,SAAA;AAAA,QACE,OAAO,MAAA,KAAW,QAAY,IAAA,OAAO,MAAW,KAAA,QAAA;AAAA,QAChD,CAA+B,4BAAA,EAAA,OAAO,MAAM,CAAA,KAAA,EAAQ,OAAO,MAAM,CAAA;AAAA,OACnE;AAEA,MAAA,OAAO,MAAS,GAAA,MAAA,GAAS,CAAK,CAAA,GAAA,MAAA,GAAS,SAAS,CAAI,GAAA,CAAA;AAAA,aAC7C,KAAO,EAAA;AACd,MAAQ,OAAA,CAAA,KAAA,CAAM,CAA+B,4BAAA,EAAA,KAAK,CAAE,CAAA,CAAA;AAAA;AACtD,GACF;AAAA,EAEA,YAAc,EAAA,cAAA;AAAA,EAEd,QAAW,EAAA,CAAC,IAAoB,EAAA,IAAA,EAAoB,QAAa,KAAA;AAC/D,IAAM,MAAA,MAAA,GAAS,IAAK,CAAA,QAAA,CAAS,QAAQ,CAAA;AACrC,IAAM,MAAA,MAAA,GAAS,IAAK,CAAA,QAAA,CAAS,QAAQ,CAAA;AAErC,IAAA,IAAI,MAAU,IAAA,IAAA,EAAa,OAAA,MAAA,IAAU,OAAO,CAAI,GAAA,EAAA;AAChD,IAAI,IAAA,MAAA,IAAU,MAAa,OAAA,CAAA;AAE3B,IAAA,IAAI,GAAuB,GAAA,IAAA;AAC3B,IAAA,IAAI,GAAuB,GAAA,IAAA;AAE3B,IAAA,IAAI,kBAAkB,QAAU,EAAA;AAC9B,MAAM,GAAA,GAAA,MAAA;AAAA,KACR,MAAA,IAAW,OAAO,MAAA,KAAW,QAAU,EAAA;AACrC,MAAM,GAAA,GAAA,QAAA,CAAS,QAAQ,MAAM,CAAA;AAAA;AAG/B,IAAA,IAAI,kBAAkB,QAAU,EAAA;AAC9B,MAAM,GAAA,GAAA,MAAA;AAAA,KACR,MAAA,IAAW,OAAO,MAAA,KAAW,QAAU,EAAA;AACrC,MAAM,GAAA,GAAA,QAAA,CAAS,QAAQ,MAAM,CAAA;AAAA;AAG/B,IAAI,IAAA,GAAA,EAAK,OAAW,IAAA,GAAA,EAAK,OAAS,EAAA;AAChC,MAAA,OAAO,GAAI,CAAA,QAAA,EAAa,GAAA,GAAA,CAAI,QAAS,EAAA;AAAA,KACvC,MAAA,IAAW,KAAK,OAAS,EAAA;AACvB,MAAO,OAAA,EAAA;AAAA,KACT,MAAA,IAAW,KAAK,OAAS,EAAA;AACvB,MAAO,OAAA,CAAA;AAAA,KACF,MAAA;AACL,MAAA,OAAA,CAAQ,KAAK,sCAAsC,CAAA;AACnD,MAAO,OAAA,CAAA;AAAA;AACT;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../../src/components/List/model/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../../src/components/List/model/types.ts"],"sourcesContent":["import type { FilterShape } from \"@/components/List/model/filter/types\";\nimport type { ItemViewShape } from \"@/components/List/model/item/ItemView\";\nimport type List from \"@/components/List/model/List\";\nimport type { IncrementalLoaderShape } from \"@/components/List/model/loading/types\";\nimport type { BatchesControllerShape } from \"@/components/List/model/pagination/types\";\nimport type { SearchShape } from \"@/components/List/model/search/types\";\nimport type { SortingShape } from \"@/components/List/model/sorting/types\";\nimport type { TableShape } from \"@/components/List/model/table/types\";\nimport type { ItemType } from \"@/lib/types/array\";\nimport type { MultipleSelection, SelectionBehavior } from \"@react-types/shared\";\nimport type { DeepKeys, DeepValue } from \"@tanstack/react-table\";\nimport type { ReactNode } from \"react\";\n\nexport const customPropertyPrefix = \"$\" as const;\nexport type CustomPropertyName = `${typeof customPropertyPrefix}${string}`;\n\nexport type PropertyName<T> = DeepKeys<T> | CustomPropertyName;\nexport type PropertyValue<T, TProp> = TProp extends CustomPropertyName\n ? T\n : DeepValue<T, TProp>;\nexport type PropertyValueRenderMethod<TMatcherValue> = (\n prop: NonNullable<ItemType<TMatcherValue>>,\n) => ReactNode;\n\nexport type OnListChanged<T> = (list: List<T>) => void;\n\nexport interface ListSupportedComponentProps extends MultipleSelection {\n \"aria-labelledby\"?: string;\n \"aria-label\"?: string;\n selectionBehavior?: SelectionBehavior;\n}\n\nexport interface ListShape<T> extends ListSupportedComponentProps {\n settingStorageKey?: string;\n\n loader?: IncrementalLoaderShape<T>;\n filters?: FilterShape<T, never, never>[];\n itemView?: ItemViewShape<T>;\n search?: SearchShape<T>;\n sorting?: SortingShape<T>[];\n batchesController?: BatchesControllerShape;\n table?: TableShape<T>;\n\n onAction?: ItemActionFn<T>;\n accordion?: boolean;\n getItemId?: GetItemId<T>;\n onChange?: OnListChanged<T>;\n defaultViewMode?: ListViewMode;\n}\n\nexport type PropertyRecord<T, TValue> = Partial<\n Record<PropertyName<T>, TValue>\n>;\n\nexport type ListViewMode = \"table\" | \"list\" | \"tiles\";\nexport type ItemActionFn<T> = (data: T) => void;\nexport type GetItemId<T> = (data: T) => string;\n"],"names":[],"mappings":"AAaO,MAAM,oBAAuB,GAAA;;;;"}
|
|
@@ -8,6 +8,8 @@ import { TypedListLoaderAsync } from './setupComponents/ListLoaderAsync.mjs';
|
|
|
8
8
|
import { TypedListLoaderAsyncResource } from './setupComponents/ListLoaderAsyncResource.mjs';
|
|
9
9
|
import { TypedListStaticData } from './setupComponents/ListStaticData.mjs';
|
|
10
10
|
import { TypedListSearch } from './setupComponents/ListSearch.mjs';
|
|
11
|
+
import 'invariant';
|
|
12
|
+
import 'luxon';
|
|
11
13
|
import 'react/jsx-runtime';
|
|
12
14
|
import 'react-aria-components';
|
|
13
15
|
import 'react';
|
|
@@ -20,7 +22,6 @@ import '@tabler/icons-react';
|
|
|
20
22
|
import '@mittwald/react-tunnel';
|
|
21
23
|
import '../../lib/slotContext/slotContext.mjs';
|
|
22
24
|
import '../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
23
|
-
import 'invariant';
|
|
24
25
|
import 'react-aria';
|
|
25
26
|
import { ListItemView } from './components/ListItemView/ListItemView.mjs';
|
|
26
27
|
import './listContext.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedList.mjs","sources":["../../../../src/components/List/typedList.ts"],"sourcesContent":["import type { ListProps } from \"@/components/List/List\";\nimport List from \"@/components/List/List\";\nimport { TypedListFilter } from \"@/components/List/setupComponents/ListFilter\";\nimport { TypedListSorting } from \"@/components/List/setupComponents/ListSorting\";\nimport { TypedListItem } from \"@/components/List/setupComponents/ListItem\";\nimport { TypedListLoaderAsync } from \"@/components/List/setupComponents/ListLoaderAsync\";\nimport { TypedListLoaderAsyncResource } from \"@/components/List/setupComponents/ListLoaderAsyncResource\";\nimport { TypedListStaticData } from \"@/components/List/setupComponents/ListStaticData\";\nimport { TypedListSearch } from \"@/components/List/setupComponents/ListSearch\";\nimport { ListItemView } from \"@/components/List\";\nimport type { ComponentType } from \"react\";\nimport { TableColumn } from \"@/components/List/setupComponents/TableColumn\";\nimport { TableCell } from \"@/components/List/setupComponents/TableCell\";\nimport { TableHeader } from \"@/components/List/setupComponents/TableHeader\";\nimport { TableRow } from \"@/components/List/setupComponents/TableRow\";\nimport { TableBody } from \"@/components/List/setupComponents/TableBody\";\nimport { Table } from \"@/components/List/setupComponents/Table\";\n\nexport const TypedList = <T>() =>\n List as unknown as ComponentType<ListProps<T>>;\n\nexport const typedList = <T>() => ({\n List: TypedList<T>(),\n Filter: TypedListFilter<T>(),\n Search: TypedListSearch<T>(),\n Sorting: TypedListSorting<T>(),\n Item: TypedListItem<T>(),\n ItemView: ListItemView,\n TableHeader: TableHeader<T>,\n TableColumn: TableColumn<T>,\n TableBody: TableBody<T>,\n TableRow: TableRow<T>,\n TableCell: TableCell<T>,\n Table: Table<T>,\n StaticData: TypedListStaticData<T>(),\n LoaderAsync: TypedListLoaderAsync<T>(),\n LoaderAsyncResource: TypedListLoaderAsyncResource<T>(),\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typedList.mjs","sources":["../../../../src/components/List/typedList.ts"],"sourcesContent":["import type { ListProps } from \"@/components/List/List\";\nimport List from \"@/components/List/List\";\nimport { TypedListFilter } from \"@/components/List/setupComponents/ListFilter\";\nimport { TypedListSorting } from \"@/components/List/setupComponents/ListSorting\";\nimport { TypedListItem } from \"@/components/List/setupComponents/ListItem\";\nimport { TypedListLoaderAsync } from \"@/components/List/setupComponents/ListLoaderAsync\";\nimport { TypedListLoaderAsyncResource } from \"@/components/List/setupComponents/ListLoaderAsyncResource\";\nimport { TypedListStaticData } from \"@/components/List/setupComponents/ListStaticData\";\nimport { TypedListSearch } from \"@/components/List/setupComponents/ListSearch\";\nimport { ListItemView } from \"@/components/List\";\nimport type { ComponentType } from \"react\";\nimport { TableColumn } from \"@/components/List/setupComponents/TableColumn\";\nimport { TableCell } from \"@/components/List/setupComponents/TableCell\";\nimport { TableHeader } from \"@/components/List/setupComponents/TableHeader\";\nimport { TableRow } from \"@/components/List/setupComponents/TableRow\";\nimport { TableBody } from \"@/components/List/setupComponents/TableBody\";\nimport { Table } from \"@/components/List/setupComponents/Table\";\n\nexport const TypedList = <T>() =>\n List as unknown as ComponentType<ListProps<T>>;\n\nexport const typedList = <T>() => ({\n List: TypedList<T>(),\n Filter: TypedListFilter<T>(),\n Search: TypedListSearch<T>(),\n Sorting: TypedListSorting<T>(),\n Item: TypedListItem<T>(),\n ItemView: ListItemView,\n TableHeader: TableHeader<T>,\n TableColumn: TableColumn<T>,\n TableBody: TableBody<T>,\n TableRow: TableRow<T>,\n TableCell: TableCell<T>,\n Table: Table<T>,\n StaticData: TypedListStaticData<T>(),\n LoaderAsync: TypedListLoaderAsync<T>(),\n LoaderAsyncResource: TypedListLoaderAsyncResource<T>(),\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,YAAY,MACvB;AAEK,MAAM,YAAY,OAAU;AAAA,EACjC,MAAM,SAAa,EAAA;AAAA,EACnB,QAAQ,eAAmB,EAAA;AAAA,EAC3B,QAAQ,eAAmB,EAAA;AAAA,EAC3B,SAAS,gBAAoB,EAAA;AAAA,EAC7B,MAAM,aAAiB,EAAA;AAAA,EACvB,QAAU,EAAA,YAAA;AAAA,EACV,WAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAY,mBAAuB,EAAA;AAAA,EACnC,aAAa,oBAAwB,EAAA;AAAA,EACrC,qBAAqB,4BAAgC;AACvD,CAAA;;;;"}
|
|
@@ -139,6 +139,7 @@ import './components/Link/context.mjs';
|
|
|
139
139
|
import '@react-aria/form';
|
|
140
140
|
import '@react-stately/form';
|
|
141
141
|
import './lib/viewComponentContext/viewComponentContext.mjs';
|
|
142
|
+
import 'luxon';
|
|
142
143
|
export { ListItemView } from './components/List/components/ListItemView/ListItemView.mjs';
|
|
143
144
|
import './components/List/listContext.mjs';
|
|
144
145
|
export { List } from './components/List/List.mjs';
|
|
@@ -148,7 +149,6 @@ export { Modal } from './components/Modal/Modal.mjs';
|
|
|
148
149
|
export { ModalTrigger } from './components/Modal/components/ModalTrigger/ModalTrigger.mjs';
|
|
149
150
|
import './components/NotificationProvider/NotificationProvider.mjs';
|
|
150
151
|
import 'mobx';
|
|
151
|
-
import 'luxon';
|
|
152
152
|
import './components/Select/components/CountryOptions/CountryOptions.mjs';
|
|
153
153
|
export { SettingsProvider } from './components/SettingsProvider/SettingsProvider.mjs';
|
|
154
154
|
import 'use-callback-ref';
|
package/dist/js/index.mjs
CHANGED
|
@@ -156,6 +156,7 @@ export { LayoutCard } from './components/LayoutCard/LayoutCard.mjs';
|
|
|
156
156
|
export { LightBox } from './components/LightBox/LightBox.mjs';
|
|
157
157
|
export { LightBoxTrigger } from './components/LightBox/components/LightBoxTrigger/LightBoxTrigger.mjs';
|
|
158
158
|
export { Link } from './components/Link/Link.mjs';
|
|
159
|
+
export { SortingFunctions } from './components/List/model/sorting/SortingFunctions.mjs';
|
|
159
160
|
export { GridList } from './components/List/components/Items/views/GridList/GridList.mjs';
|
|
160
161
|
export { GridListItem } from './components/List/components/Items/views/GridListItem/GridListItem.mjs';
|
|
161
162
|
export { ListItemView } from './components/List/components/ListItemView/ListItemView.mjs';
|
package/dist/js/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useContext } from 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import 'react-aria-components';
|
|
6
8
|
import 'clsx';
|
|
7
9
|
import '../lib/propsContext/propsContext.mjs';
|
|
@@ -12,7 +14,6 @@ import '@tabler/icons-react';
|
|
|
12
14
|
import '@mittwald/react-tunnel';
|
|
13
15
|
import '../lib/slotContext/slotContext.mjs';
|
|
14
16
|
import { viewComponentContext } from '../lib/viewComponentContext/viewComponentContext.mjs';
|
|
15
|
-
import 'invariant';
|
|
16
17
|
import 'react-aria';
|
|
17
18
|
import { GridListItem } from '../components/List/components/Items/views/GridListItem/GridListItem.mjs';
|
|
18
19
|
import '@chakra-ui/live-region';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemsGridListItemView.mjs","sources":["../../../src/views/ItemsGridListItemView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { GridListItem, type GridListItemProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ItemsGridListItemView: FC<GridListItemProps> = (props) => {\n const View =\n useContext(viewComponentContext)[\"ItemsGridListItem\"] ?? GridListItem;\n return <View {...props} />;\n};\n\nexport default ItemsGridListItemView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ItemsGridListItemView.mjs","sources":["../../../src/views/ItemsGridListItemView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { GridListItem, type GridListItemProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ItemsGridListItemView: FC<GridListItemProps> = (props) => {\n const View =\n useContext(viewComponentContext)[\"ItemsGridListItem\"] ?? GridListItem;\n return <View {...props} />;\n};\n\nexport default ItemsGridListItemView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMM,MAAA,qBAAA,GAA+C,CAAC,KAAU,KAAA;AAC9D,EAAA,MAAM,IACJ,GAAA,UAAA,CAAW,oBAAoB,CAAA,CAAE,mBAAmB,CAAK,IAAA,YAAA;AAC3D,EAAO,uBAAA,GAAA,CAAC,IAAM,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAC1B;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useContext } from 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import { GridList } from '../components/List/components/Items/views/GridList/GridList.mjs';
|
|
6
8
|
import 'react-aria-components';
|
|
7
9
|
import 'clsx';
|
|
@@ -14,7 +16,6 @@ import 'dot-prop';
|
|
|
14
16
|
import 'react-aria';
|
|
15
17
|
import '@tabler/icons-react';
|
|
16
18
|
import '../lib/slotContext/slotContext.mjs';
|
|
17
|
-
import 'invariant';
|
|
18
19
|
import '@chakra-ui/live-region';
|
|
19
20
|
import 'mobx';
|
|
20
21
|
import '../lib/controller/overlay/context.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemsGridListView.mjs","sources":["../../../src/views/ItemsGridListView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { GridList, type GridListProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ItemsGridListView: FC<GridListProps> = (props) => {\n const View = useContext(viewComponentContext)[\"ItemsGridList\"] ?? GridList;\n return <View {...props} />;\n};\n\nexport default ItemsGridListView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ItemsGridListView.mjs","sources":["../../../src/views/ItemsGridListView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { GridList, type GridListProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ItemsGridListView: FC<GridListProps> = (props) => {\n const View = useContext(viewComponentContext)[\"ItemsGridList\"] ?? GridList;\n return <View {...props} />;\n};\n\nexport default ItemsGridListView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMM,MAAA,iBAAA,GAAuC,CAAC,KAAU,KAAA;AACtD,EAAA,MAAM,IAAO,GAAA,UAAA,CAAW,oBAAoB,CAAA,CAAE,eAAe,CAAK,IAAA,QAAA;AAClE,EAAO,uBAAA,GAAA,CAAC,IAAM,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAC1B;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useContext } from 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import 'react-aria-components';
|
|
6
8
|
import { EmptyView } from '../components/List/views/EmptyView/EmptyView.mjs';
|
|
7
9
|
import 'clsx';
|
|
@@ -14,7 +16,6 @@ import 'dot-prop';
|
|
|
14
16
|
import 'react-aria';
|
|
15
17
|
import '@tabler/icons-react';
|
|
16
18
|
import '../lib/slotContext/slotContext.mjs';
|
|
17
|
-
import 'invariant';
|
|
18
19
|
import '@chakra-ui/live-region';
|
|
19
20
|
import 'mobx';
|
|
20
21
|
import '../lib/controller/overlay/context.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListEmptyViewView.mjs","sources":["../../../src/views/ListEmptyViewView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { EmptyView, type EmptyViewProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ListEmptyViewView: FC<EmptyViewProps> = (props) => {\n const View = useContext(viewComponentContext)[\"ListEmptyView\"] ?? EmptyView;\n return <View {...props} />;\n};\n\nexport default ListEmptyViewView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListEmptyViewView.mjs","sources":["../../../src/views/ListEmptyViewView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport { EmptyView, type EmptyViewProps } from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ListEmptyViewView: FC<EmptyViewProps> = (props) => {\n const View = useContext(viewComponentContext)[\"ListEmptyView\"] ?? EmptyView;\n return <View {...props} />;\n};\n\nexport default ListEmptyViewView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMM,MAAA,iBAAA,GAAwC,CAAC,KAAU,KAAA;AACvD,EAAA,MAAM,IAAO,GAAA,UAAA,CAAW,oBAAoB,CAAA,CAAE,eAAe,CAAK,IAAA,SAAA;AAClE,EAAO,uBAAA,GAAA,CAAC,IAAM,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAC1B;;;;"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useContext } from 'react';
|
|
5
|
+
import 'invariant';
|
|
6
|
+
import 'luxon';
|
|
5
7
|
import 'react-aria-components';
|
|
6
8
|
import 'clsx';
|
|
7
9
|
import '../lib/propsContext/propsContext.mjs';
|
|
@@ -12,7 +14,6 @@ import '@tabler/icons-react';
|
|
|
12
14
|
import '@mittwald/react-tunnel';
|
|
13
15
|
import '../lib/slotContext/slotContext.mjs';
|
|
14
16
|
import { viewComponentContext } from '../lib/viewComponentContext/viewComponentContext.mjs';
|
|
15
|
-
import 'invariant';
|
|
16
17
|
import 'react-aria';
|
|
17
18
|
import '@chakra-ui/live-region';
|
|
18
19
|
import 'mobx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemViewContentView.mjs","sources":["../../../src/views/ListItemViewContentView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport {\n ListItemViewContent,\n type ListItemViewContentProps,\n} from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ListItemViewContentView: FC<ListItemViewContentProps> = (props) => {\n const View =\n useContext(viewComponentContext)[\"ListItemViewContent\"] ??\n ListItemViewContent;\n return <View {...props} />;\n};\n\nexport default ListItemViewContentView;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemViewContentView.mjs","sources":["../../../src/views/ListItemViewContentView.tsx"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport React, { type FC, useContext } from \"react\";\nimport {\n ListItemViewContent,\n type ListItemViewContentProps,\n} from \"@/components/List\";\nimport { viewComponentContext } from \"@/lib/viewComponentContext/viewComponentContext\";\n\nconst ListItemViewContentView: FC<ListItemViewContentProps> = (props) => {\n const View =\n useContext(viewComponentContext)[\"ListItemViewContent\"] ??\n ListItemViewContent;\n return <View {...props} />;\n};\n\nexport default ListItemViewContentView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASM,MAAA,uBAAA,GAAwD,CAAC,KAAU,KAAA;AACvE,EAAA,MAAM,IACJ,GAAA,UAAA,CAAW,oBAAoB,CAAA,CAAE,qBAAqB,CACtD,IAAA,mBAAA;AACF,EAAO,uBAAA,GAAA,CAAC,IAAM,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAC1B;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { RenderItemFn } from './model/item/types';
|
|
2
2
|
export type { AsyncDataLoader, AsyncResourceFactory, DataLoaderOptions, DataLoaderResult, } from './model/loading/types';
|
|
3
|
+
export type { SortingFn } from './model/sorting/types';
|
|
4
|
+
export { SortingFunctions } from './model/sorting/SortingFunctions';
|
|
3
5
|
export * from './components/Items/views/GridList';
|
|
4
6
|
export * from './components/Items/views/GridListItem';
|
|
5
7
|
export * from './components/ListItemView';
|
|
@@ -13,5 +15,4 @@ export * from './setupComponents/ListItem';
|
|
|
13
15
|
export * from './setupComponents/ListLoaderAsync';
|
|
14
16
|
export * from './setupComponents/ListSorting';
|
|
15
17
|
export * from './setupComponents/ListStaticData';
|
|
16
|
-
export * from './setupComponents/ListStaticData';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/List/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAE5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/List/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,YAAY,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAE5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Column, ColumnDef, ColumnSort, SortDirection } from '@tanstack/react-table';
|
|
2
1
|
import { default as List } from '../List';
|
|
3
2
|
import { SortingDefaultMode, SortingShape } from './types';
|
|
4
3
|
import { PropertyName } from '../types';
|
|
4
|
+
import { Column, ColumnDef, ColumnSort, SortDirection, SortingFn } from '@tanstack/react-table';
|
|
5
5
|
export declare class Sorting<T> {
|
|
6
6
|
readonly list: List<T>;
|
|
7
7
|
readonly property: PropertyName<T>;
|
|
8
8
|
readonly name?: string;
|
|
9
9
|
readonly direction: SortDirection;
|
|
10
10
|
readonly defaultEnabled: SortingDefaultMode;
|
|
11
|
+
readonly customSortingFn?: SortingFn<T>;
|
|
11
12
|
constructor(list: List<T>, shape: SortingShape<T>);
|
|
12
13
|
updateTableColumnDef(def: ColumnDef<T>): void;
|
|
13
14
|
getReactTableColumnSort(): ColumnSort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sorting.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/Sorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Sorting.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/Sorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACb,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACV,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,OAAO,CAAC,CAAC;IACpB,SAAgB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,SAAgB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,SAAS,EAAE,aAAa,CAAC;IACzC,SAAgB,cAAc,EAAE,kBAAkB,CAAC;IACnD,SAAgB,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;gBAE5B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IASjD,oBAAoB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;IAO7C,uBAAuB,IAAI,UAAU;IAOrC,QAAQ,IAAI,OAAO;IAKnB,cAAc,IAAI,MAAM,CAAC,CAAC,CAAC;IAI3B,MAAM,IAAI,IAAI;IAMd,KAAK,IAAI,IAAI;IAIpB,IAAW,EAAE,IAAI,MAAM,CAEtB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortingFunctions.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/SortingFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,gBAAgB;YAkBrB,SAAS,CAAC,OAAO,CAAC;;cAoClB,SAAS,CAAC,OAAO,CAAC;CACzB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { SortDirection } from '@tanstack/react-table';
|
|
2
1
|
import { PropertyName } from '../types';
|
|
2
|
+
import { SortDirection, SortingFn as SortingFunction } from '@tanstack/react-table';
|
|
3
3
|
export type SortingDefaultMode = boolean | "hidden";
|
|
4
|
+
export type SortingFn<T> = SortingFunction<T>;
|
|
4
5
|
export interface SortingShape<T> {
|
|
5
6
|
property: PropertyName<T>;
|
|
6
7
|
name?: string;
|
|
7
8
|
direction?: SortDirection;
|
|
8
9
|
defaultEnabled?: SortingDefaultMode;
|
|
10
|
+
customSortingFn?: SortingFn<T>;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EACV,aAAa,EACb,SAAS,IAAI,eAAe,EAC7B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAE9C,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CAChC"}
|