@helpwave/hightide 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import react__default, { HTMLAttributes, SVGProps, ReactNode, PropsWithChildren, RefObject, CSSProperties, Dispatch, SetStateAction, ButtonHTMLAttributes, InputHTMLAttributes, ComponentPropsWithoutRef, ComponentProps, JSX, TableHTMLAttributes, TextareaHTMLAttributes, LabelHTMLAttributes, ElementType } from 'react';
|
|
4
4
|
import { Translation, TranslationEntries, PartialTranslationExtension } from '@helpwave/internationalization';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
-
import { TableFeature, ColumnDef, Table as Table$1, InitialTableState, Row, TableState, TableOptions, RowData, FilterFn, RowSelectionState, RowModel, Header, SortDirection, ColumnSizingState } from '@tanstack/react-table';
|
|
6
|
+
import { TableFeature, ColumnDef, Table as Table$1, InitialTableState, Row, TableState, TableOptions, RowData, FilterFn, RowSelectionState, RowModel, Header, SortDirection, ColumnSizingState, ColumnFilter } from '@tanstack/react-table';
|
|
7
7
|
import { SlotProps } from '@radix-ui/react-slot';
|
|
8
8
|
|
|
9
9
|
type Size = 'sm' | 'md' | 'lg';
|
|
@@ -2348,8 +2348,8 @@ type FilterValueTranslationOptions = {
|
|
|
2348
2348
|
};
|
|
2349
2349
|
declare function useFilterValueTranslation(): (value: FilterValue, options?: FilterValueTranslationOptions) => string;
|
|
2350
2350
|
|
|
2351
|
-
interface IdentifierFilterValue extends
|
|
2352
|
-
|
|
2351
|
+
interface IdentifierFilterValue extends ColumnFilter {
|
|
2352
|
+
value: FilterValue;
|
|
2353
2353
|
}
|
|
2354
2354
|
interface FilterListPopUpBuilderProps {
|
|
2355
2355
|
value: FilterValue;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import react__default, { HTMLAttributes, SVGProps, ReactNode, PropsWithChildren, RefObject, CSSProperties, Dispatch, SetStateAction, ButtonHTMLAttributes, InputHTMLAttributes, ComponentPropsWithoutRef, ComponentProps, JSX, TableHTMLAttributes, TextareaHTMLAttributes, LabelHTMLAttributes, ElementType } from 'react';
|
|
4
4
|
import { Translation, TranslationEntries, PartialTranslationExtension } from '@helpwave/internationalization';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
-
import { TableFeature, ColumnDef, Table as Table$1, InitialTableState, Row, TableState, TableOptions, RowData, FilterFn, RowSelectionState, RowModel, Header, SortDirection, ColumnSizingState } from '@tanstack/react-table';
|
|
6
|
+
import { TableFeature, ColumnDef, Table as Table$1, InitialTableState, Row, TableState, TableOptions, RowData, FilterFn, RowSelectionState, RowModel, Header, SortDirection, ColumnSizingState, ColumnFilter } from '@tanstack/react-table';
|
|
7
7
|
import { SlotProps } from '@radix-ui/react-slot';
|
|
8
8
|
|
|
9
9
|
type Size = 'sm' | 'md' | 'lg';
|
|
@@ -2348,8 +2348,8 @@ type FilterValueTranslationOptions = {
|
|
|
2348
2348
|
};
|
|
2349
2349
|
declare function useFilterValueTranslation(): (value: FilterValue, options?: FilterValueTranslationOptions) => string;
|
|
2350
2350
|
|
|
2351
|
-
interface IdentifierFilterValue extends
|
|
2352
|
-
|
|
2351
|
+
interface IdentifierFilterValue extends ColumnFilter {
|
|
2352
|
+
value: FilterValue;
|
|
2353
2353
|
}
|
|
2354
2354
|
interface FilterListPopUpBuilderProps {
|
|
2355
2355
|
value: FilterValue;
|
package/dist/index.js
CHANGED
|
@@ -19924,9 +19924,11 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
19924
19924
|
if (!item) return;
|
|
19925
19925
|
const newValue = {
|
|
19926
19926
|
id: item.id,
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
19927
|
+
value: {
|
|
19928
|
+
dataType: item.dataType,
|
|
19929
|
+
operator: FilterOperatorUtils.getDefaultOperator(item.dataType),
|
|
19930
|
+
parameter: {}
|
|
19931
|
+
}
|
|
19930
19932
|
};
|
|
19931
19933
|
setEditState(newValue);
|
|
19932
19934
|
setIsOpen(false);
|
|
@@ -19938,36 +19940,36 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
19938
19940
|
}
|
|
19939
19941
|
) }) })
|
|
19940
19942
|
] }),
|
|
19941
|
-
valueWithEditState.map((
|
|
19942
|
-
const item = itemRecord[
|
|
19943
|
+
valueWithEditState.map((columnFilter) => {
|
|
19944
|
+
const item = itemRecord[columnFilter.id];
|
|
19943
19945
|
if (!item) return null;
|
|
19944
19946
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
19945
19947
|
PopUpRoot,
|
|
19946
19948
|
{
|
|
19947
|
-
isOpen: editState?.id ===
|
|
19949
|
+
isOpen: editState?.id === columnFilter.id,
|
|
19948
19950
|
onIsOpenChange: (isOpen) => {
|
|
19949
19951
|
if (!isOpen) {
|
|
19950
|
-
const isEditStateValid = editState ? FilterValueUtils.isValid(editState) : false;
|
|
19952
|
+
const isEditStateValid = editState ? FilterValueUtils.isValid(editState.value) : false;
|
|
19951
19953
|
if (isEditStateValid) {
|
|
19952
|
-
onValueChange(valueWithEditState.map((prevItem) => prevItem.id ===
|
|
19954
|
+
onValueChange(valueWithEditState.map((prevItem) => prevItem.id === columnFilter.id ? { ...prevItem, ...editState } : prevItem));
|
|
19953
19955
|
}
|
|
19954
19956
|
setEditState(void 0);
|
|
19955
19957
|
} else {
|
|
19956
|
-
const valueItem = value.find((prevItem) => prevItem.id ===
|
|
19958
|
+
const valueItem = value.find((prevItem) => prevItem.id === columnFilter.id);
|
|
19957
19959
|
if (!valueItem) return;
|
|
19958
19960
|
setEditState({ ...valueItem });
|
|
19959
19961
|
}
|
|
19960
19962
|
},
|
|
19961
19963
|
children: [
|
|
19962
19964
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PopUpOpener, { children: ({ toggleOpen, props, isOpen }) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Button, { ...props, onClick: toggleOpen, color: "primary", coloringStyle: "tonal", size: "sm", children: [
|
|
19963
|
-
item.label + ": " + filterValueToLabel(
|
|
19965
|
+
item.label + ": " + filterValueToLabel(columnFilter.value, { tags: item.tags }),
|
|
19964
19966
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
19965
19967
|
] }) }),
|
|
19966
19968
|
item.popUpBuilder ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PopUpContext.Consumer, { children: ({ isOpen, setIsOpen }) => item.popUpBuilder({
|
|
19967
|
-
value: editState?.id ===
|
|
19968
|
-
onValueChange: (value2) => setEditState({ ...
|
|
19969
|
+
value: editState?.id === columnFilter.id ? editState.value : columnFilter.value,
|
|
19970
|
+
onValueChange: (value2) => setEditState({ ...columnFilter, value: value2 }),
|
|
19969
19971
|
onRemove: () => {
|
|
19970
|
-
onValueChange(value.filter((prevItem) => prevItem.id !==
|
|
19972
|
+
onValueChange(value.filter((prevItem) => prevItem.id !== columnFilter.id));
|
|
19971
19973
|
setEditState(void 0);
|
|
19972
19974
|
},
|
|
19973
19975
|
dataType: item.dataType,
|
|
@@ -19979,21 +19981,21 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
19979
19981
|
FilterPopUp,
|
|
19980
19982
|
{
|
|
19981
19983
|
name: item.label,
|
|
19982
|
-
value: editState?.id ===
|
|
19984
|
+
value: editState?.id === columnFilter.id ? editState.value : columnFilter.value,
|
|
19983
19985
|
dataType: item.dataType,
|
|
19984
19986
|
tags: item.tags,
|
|
19985
19987
|
onValueChange: (value2) => {
|
|
19986
|
-
setEditState({ ...
|
|
19988
|
+
setEditState({ ...columnFilter, value: value2 });
|
|
19987
19989
|
},
|
|
19988
19990
|
onRemove: () => {
|
|
19989
|
-
onValueChange(value.filter((prevItem) => prevItem.id !==
|
|
19991
|
+
onValueChange(value.filter((prevItem) => prevItem.id !== columnFilter.id));
|
|
19990
19992
|
setEditState(void 0);
|
|
19991
19993
|
}
|
|
19992
19994
|
}
|
|
19993
19995
|
)
|
|
19994
19996
|
]
|
|
19995
19997
|
},
|
|
19996
|
-
|
|
19998
|
+
columnFilter.id
|
|
19997
19999
|
);
|
|
19998
20000
|
})
|
|
19999
20001
|
] });
|