@olenbetong/appframe-ds 1.0.3 → 1.1.0
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 +6 -0
- package/package.json +3 -3
- package/src/AfLookup/Lookup.tsx +1 -1
- package/src/AfLookup/LookupCombobox.tsx +1 -1
- package/src/AfLookup/LookupEdit.tsx +1 -1
- package/src/AfLookup/LookupGrid.tsx +1 -1
- package/src/autocomplete/Autocomplete.tsx +1 -1
- package/src/autocomplete/AutocompleteFrame.tsx +1 -1
- package/src/autocomplete/Combobox.tsx +1 -1
- package/src/binding/BoundNumericTextField.tsx +1 -1
- package/src/binding/CancelButton.tsx +1 -1
- package/src/binding/CancelIconButton.tsx +1 -1
- package/src/binding/DataEditToolbar.tsx +1 -1
- package/src/binding/DeleteButton.tsx +1 -1
- package/src/binding/DeleteIconButton.tsx +1 -1
- package/src/binding/RefreshButton.tsx +1 -1
- package/src/binding/RefreshIconButton.tsx +1 -1
- package/src/binding/RefreshRowIconButton.tsx +1 -1
- package/src/binding/SaveButton.tsx +1 -1
- package/src/binding/SaveIconButton.tsx +1 -1
- package/src/filter/ChipListInput.tsx +1 -1
- package/src/filter/FieldFilterPanel.tsx +1 -1
- package/src/filter/FilterBuilder.tsx +1 -1
- package/src/filter/FilterEditor.tsx +2 -1
- package/src/filter/FilterGroupEditor.tsx +1 -1
- package/src/filter/FilterNameDialog.tsx +1 -1
- package/src/filter/FilterRow.tsx +1 -1
- package/src/filter/FilterShareDialog.tsx +1 -1
- package/src/filter/FilterStringField.tsx +2 -1
- package/src/filter/FilterValueEditor.tsx +1 -1
- package/src/filter/SavedFilterTree.tsx +2 -6
- package/src/filter/fieldFilter.ts +1 -1
- package/src/grid/AfGridColumnsPanel.tsx +1 -1
- package/src/grid/AfGridError.tsx +1 -1
- package/src/grid/AfHeaderFilterCell.tsx +2 -6
- package/src/grid/AfHeaderFilterPanel.tsx +1 -1
- package/src/grid/Toolbar.tsx +1 -1
- package/src/grid/editing.ts +1 -1
- package/src/grid/filter.ts +1 -1
- package/src/grid/index.tsx +1 -1
- package/src/grid/localization.ts +1 -1
- package/src/grid/useAfColumns.tsx +1 -1
- package/src/grid/useAfNewItemRow.ts +1 -1
- package/src/i18n.ts +13 -0
- package/src/layout/AppMenu.tsx +1 -2
- package/src/layout/ErrorBoundary.tsx +1 -1
- package/src/mdi/Mdi.test.tsx +4 -0
- package/src/mdi/MdiConfirmCloseDialog.tsx +1 -1
- package/src/mdi/MdiPanel.tsx +1 -1
- package/src/mdi/MdiRestore.test.tsx +4 -0
- package/src/page/PageHeader.tsx +1 -2
- package/src/report-downloader/components/StatusItem.tsx +2 -1
- package/src/sortable/SortableItemList.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @olenbetong/appframe-ds
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7a3a3fc: The package's strings (grid, filter builder, bindings, lookups, MDI) are looked up in their own globalization project, `appframe-ds`, through `createLocalizer` from appframe-core 2.14, so one translation covers every app instead of one per article. On a page whose template renders `af.i18n["appframe-ds"]` the strings are harvested under that project; on any other page the lookup falls back to the article's strings as before.
|
|
8
|
+
|
|
3
9
|
## 1.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olenbetong/appframe-ds",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Components that bind Designsystemet components to Appframe data objects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./es/index.d.ts",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"react-dom": "19.3.0",
|
|
72
72
|
"react-window": "2.3.1",
|
|
73
73
|
"@olenbetong/appframe-core": "2.14.0",
|
|
74
|
-
"@olenbetong/appframe-
|
|
75
|
-
"@olenbetong/appframe-
|
|
74
|
+
"@olenbetong/appframe-data": "1.7.2",
|
|
75
|
+
"@olenbetong/appframe-react": "2.2.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@digdir/designsystemet-react": "1.21.1",
|
package/src/AfLookup/Lookup.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import "./Lookup.css";
|
|
|
2
2
|
|
|
3
3
|
import { Button, Textfield, type TextfieldProps } from "@digdir/designsystemet-react";
|
|
4
4
|
import { MagnifyingGlassIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
5
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
6
5
|
import { type DistributiveOmit, useLookupState } from "@olenbetong/appframe-react";
|
|
7
6
|
|
|
8
7
|
import clsx from "clsx";
|
|
@@ -10,6 +9,7 @@ import { useRef } from "react";
|
|
|
10
9
|
import { createPortal } from "react-dom";
|
|
11
10
|
|
|
12
11
|
import { LookupCombobox, type LookupComboboxProps } from "./LookupCombobox.js";
|
|
12
|
+
import { getLocalizedString } from "../i18n.js";
|
|
13
13
|
|
|
14
14
|
export type AfLookupProps<T extends Record<string, unknown>> = DistributiveOmit<LookupComboboxProps<T>, "value"> & {
|
|
15
15
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "./LookupCombobox.css";
|
|
2
2
|
|
|
3
3
|
import { Button, Textfield } from "@digdir/designsystemet-react";
|
|
4
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
5
4
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
6
5
|
import { type LookupColumn, useComboboxData } from "@olenbetong/appframe-react";
|
|
7
6
|
|
|
@@ -10,6 +9,7 @@ import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
|
10
9
|
import { List, type RowComponentProps, useDynamicRowHeight, useListRef } from "react-window";
|
|
11
10
|
|
|
12
11
|
import { LookupGrid } from "./LookupGrid.js";
|
|
12
|
+
import { getLocalizedString } from "../i18n.js";
|
|
13
13
|
|
|
14
14
|
export interface LookupComboboxBaseProps<T extends Record<string, unknown>> {
|
|
15
15
|
nullable?: boolean;
|
|
@@ -2,7 +2,6 @@ import "./Lookup.css";
|
|
|
2
2
|
|
|
3
3
|
import { Button, Textfield, type TextfieldProps } from "@digdir/designsystemet-react";
|
|
4
4
|
import { MagnifyingGlassIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
5
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
6
5
|
import type { DistributiveOmit } from "@olenbetong/appframe-react";
|
|
7
6
|
|
|
8
7
|
import clsx from "clsx";
|
|
@@ -10,6 +9,7 @@ import type React from "react";
|
|
|
10
9
|
|
|
11
10
|
import type { LookupComboboxProps } from "./LookupCombobox.js";
|
|
12
11
|
import { useLookup } from "./Lookup.js";
|
|
12
|
+
import { getLocalizedString } from "../i18n.js";
|
|
13
13
|
|
|
14
14
|
export type AfLookupEditProps<T extends Record<string, unknown>> = DistributiveOmit<
|
|
15
15
|
LookupComboboxProps<T>,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./LookupGrid.css";
|
|
2
2
|
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import type { LookupColumn } from "@olenbetong/appframe-react";
|
|
5
4
|
|
|
6
5
|
import clsx from "clsx";
|
|
7
6
|
import { useEffect, useMemo } from "react";
|
|
8
7
|
import { List, type RowComponentProps, useListRef } from "react-window";
|
|
8
|
+
import { getLocalizedString } from "../i18n.js";
|
|
9
9
|
|
|
10
10
|
const ROW_HEIGHT = 40;
|
|
11
11
|
const HEADER_HEIGHT = 40;
|
|
@@ -3,7 +3,6 @@ import "./Autocomplete.css";
|
|
|
3
3
|
import { Autocomplete as BaseAutocomplete } from "@base-ui/react/autocomplete";
|
|
4
4
|
import { ChipRemovable } from "@digdir/designsystemet-react";
|
|
5
5
|
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
6
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
7
6
|
import { useId, useMemo, useRef } from "react";
|
|
8
7
|
|
|
9
8
|
import { AutocompleteFrame } from "./AutocompleteFrame.js";
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
16
15
|
handleInputValueChange,
|
|
17
16
|
useControlled,
|
|
18
17
|
} from "./utils.js";
|
|
18
|
+
import { getLocalizedString } from "../i18n.js";
|
|
19
19
|
|
|
20
20
|
export interface AutocompleteProps<
|
|
21
21
|
Option,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
|
|
2
2
|
import { FieldDescription, Label, Spinner, ValidationMessage } from "@digdir/designsystemet-react";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { XMarkIcon } from "@navikt/aksel-icons";
|
|
5
4
|
import clsx from "clsx";
|
|
6
5
|
import { type ReactNode, type Ref, useEffect, useRef, useState } from "react";
|
|
7
6
|
|
|
8
7
|
import type { AutocompleteSize } from "./types.js";
|
|
8
|
+
import { getLocalizedString } from "../i18n.js";
|
|
9
9
|
|
|
10
10
|
export interface AutocompleteFrameProps {
|
|
11
11
|
id?: string;
|
|
@@ -3,7 +3,6 @@ import "./Autocomplete.css";
|
|
|
3
3
|
import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
|
|
4
4
|
import { ChipRemovable } from "@digdir/designsystemet-react";
|
|
5
5
|
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
6
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
7
6
|
import { useEffect, useId, useMemo, useRef } from "react";
|
|
8
7
|
|
|
9
8
|
import { AutocompleteFrame } from "./AutocompleteFrame.js";
|
|
@@ -17,6 +16,7 @@ import {
|
|
|
17
16
|
mapChangeReason,
|
|
18
17
|
useControlled,
|
|
19
18
|
} from "./utils.js";
|
|
19
|
+
import { getLocalizedString } from "../i18n.js";
|
|
20
20
|
|
|
21
21
|
export interface ComboboxProps<Option, Multiple extends boolean | undefined = false> extends AutocompleteBaseProps<
|
|
22
22
|
Option,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Textfield, type TextfieldProps } from "@digdir/designsystemet-react";
|
|
2
|
-
import { getLocalizedString, localize } from "@olenbetong/appframe-core";
|
|
3
2
|
import { useField } from "@olenbetong/appframe-react";
|
|
4
3
|
import { useEffect, useState } from "react";
|
|
4
|
+
import { getLocalizedString, localize } from "../i18n.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A Designsystemet `Textfield` bound to an Appframe data source field via `useField`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ArrowUndoIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useCancelButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { type ForwardRefExoticComponent, forwardRef, type RefAttributes } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const CancelButton: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<
|
|
8
8
|
HTMLButtonElement,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ArrowUndoIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useCancelButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const CancelIconButton = forwardRef<HTMLButtonElement, Omit<ButtonProps, "icon">>(function CancelIconButton(
|
|
8
8
|
{ onClick, children, ...props },
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Button, Tooltip } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ChevronLeftIcon, ChevronRightIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
5
4
|
import { useCurrentIndex, useDataLength, useDataObject } from "@olenbetong/appframe-react";
|
|
6
5
|
import { CancelIconButton } from "./CancelIconButton.js";
|
|
7
6
|
import { RefreshRowIconButton } from "./RefreshRowIconButton.js";
|
|
8
7
|
import { SaveIconButton } from "./SaveIconButton.js";
|
|
8
|
+
import { getLocalizedString } from "../i18n.js";
|
|
9
9
|
|
|
10
10
|
function IndexNavigator({ dataObject }: { dataObject: DataObject<any> }) {
|
|
11
11
|
let count = useDataLength(dataObject);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { TrashIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { type DeletePrompt, useDeleteButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { type ForwardRefExoticComponent, forwardRef, type RefAttributes } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export type DeleteButtonProps = ButtonProps & { index?: number; prompt?: DeletePrompt };
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { TrashIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { type DeletePrompt, useDeleteButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export type DeleteIconButtonProps = Omit<ButtonProps, "icon"> & { index?: number; prompt?: DeletePrompt };
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ArrowsCirclepathIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useRefreshButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { type ForwardRefExoticComponent, forwardRef, type RefAttributes } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const RefreshButton: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<
|
|
8
8
|
HTMLButtonElement,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ArrowsCirclepathIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useDataObject, useLoading } from "@olenbetong/appframe-react";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const RefreshIconButton = forwardRef<HTMLButtonElement, Omit<ButtonProps, "icon">>(function RefreshIconButton(
|
|
8
8
|
{ onClick, children, loading, ...props },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { ArrowsCirclepathIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useRefreshRowButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export type RefreshRowIconButtonProps = Omit<ButtonProps, "icon"> & { index?: number };
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Badge, BadgePosition, Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { FloppydiskIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useSaveButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { type ForwardRefExoticComponent, forwardRef, type RefAttributes } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const SaveButton: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<
|
|
8
8
|
HTMLButtonElement,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Badge, BadgePosition, Button, type ButtonProps } from "@digdir/designsystemet-react";
|
|
2
2
|
import { FloppydiskIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import { useSaveButton } from "@olenbetong/appframe-react";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export const SaveIconButton = forwardRef<HTMLButtonElement, Omit<ButtonProps, "icon">>(function SaveIconButton(
|
|
8
8
|
{ onClick, children, loading, ...props },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChipRemovable, Textfield } from "@digdir/designsystemet-react";
|
|
2
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
3
2
|
import { useState } from "react";
|
|
3
|
+
import { getLocalizedString } from "../i18n.js";
|
|
4
4
|
|
|
5
5
|
export type ChipListInputProps = {
|
|
6
6
|
value: string[];
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
type FilterExpression,
|
|
10
10
|
type FilterOperator,
|
|
11
11
|
type FilterTree,
|
|
12
|
-
getLocalizedString,
|
|
13
12
|
getOperatorLabel,
|
|
14
13
|
getOperatorsForField,
|
|
15
14
|
normalizeOperator,
|
|
@@ -21,6 +20,7 @@ import { type ReactNode, useMemo, useState } from "react";
|
|
|
21
20
|
import { getInListValues, setInListValues } from "./fieldFilter.js";
|
|
22
21
|
import { FilterValueEditor } from "./FilterValueEditor.js";
|
|
23
22
|
import { supportsDistinctValues, useDistinctValues } from "./useDistinctValues.js";
|
|
23
|
+
import { getLocalizedString } from "../i18n.js";
|
|
24
24
|
|
|
25
25
|
export type FieldFilterPanelProps = {
|
|
26
26
|
/** The field being filtered. Decides the operators and the value editor. */
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
createEmptyFilter,
|
|
10
10
|
findSavedFilter,
|
|
11
11
|
type FilterTree,
|
|
12
|
-
getLocalizedString,
|
|
13
12
|
isEmptyFilter,
|
|
14
13
|
pruneFilter,
|
|
15
14
|
type SavedFilter,
|
|
@@ -26,6 +25,7 @@ import { FilterShareDialog } from "./FilterShareDialog.js";
|
|
|
26
25
|
import { SavedFilterTree } from "./SavedFilterTree.js";
|
|
27
26
|
import type { FilterEditorSize, GetFieldOptions } from "./types.js";
|
|
28
27
|
import type { FieldMetadata } from "@olenbetong/appframe-core";
|
|
28
|
+
import { getLocalizedString } from "../i18n.js";
|
|
29
29
|
|
|
30
30
|
export type FilterBuilderProps = {
|
|
31
31
|
/** The fields the user can filter on. Fields with `excludeFromFilter` are hidden. */
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import "./FilterEditor.css";
|
|
2
2
|
|
|
3
|
-
import { type FilterTree,
|
|
3
|
+
import { type FilterTree, toFilterTree } from "@olenbetong/appframe-core";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
6
|
|
|
7
7
|
import { FilterGroupEditor } from "./FilterGroupEditor.js";
|
|
8
8
|
import { FilterStringField } from "./FilterStringField.js";
|
|
9
9
|
import type { FilterEditorProps } from "./types.js";
|
|
10
|
+
import { getLocalizedString } from "../i18n.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* The criteria tree of the filter builder. Groups can be nested and each group
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
type FilterNode,
|
|
10
10
|
type FilterPath,
|
|
11
11
|
type FilterTree,
|
|
12
|
-
getLocalizedString,
|
|
13
12
|
getNodeAtPath,
|
|
14
13
|
insertNodeAtPath,
|
|
15
14
|
isExpression,
|
|
@@ -22,6 +21,7 @@ import { Combobox } from "../autocomplete/index.js";
|
|
|
22
21
|
|
|
23
22
|
import { FilterRow, getFieldLabel } from "./FilterRow.js";
|
|
24
23
|
import type { FilterEditorSize, GetFieldOptions } from "./types.js";
|
|
24
|
+
import { getLocalizedString } from "../i18n.js";
|
|
25
25
|
|
|
26
26
|
export type FilterGroupEditorProps = {
|
|
27
27
|
/** The whole tree. Groups edit it through their own `path`. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./FilterNameDialog.css";
|
|
2
2
|
|
|
3
3
|
import { Button, Dialog, Heading, Textfield } from "@digdir/designsystemet-react";
|
|
4
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
5
4
|
import { useEffect, useState } from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
6
6
|
|
|
7
7
|
export type FilterNameDialogProps = {
|
|
8
8
|
open: boolean;
|
package/src/filter/FilterRow.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type FieldMetadata,
|
|
7
7
|
type FilterExpression,
|
|
8
8
|
type FilterOperator,
|
|
9
|
-
getLocalizedString,
|
|
10
9
|
getOperatorLabel,
|
|
11
10
|
getOperatorsForField,
|
|
12
11
|
normalizeOperator,
|
|
@@ -15,6 +14,7 @@ import { Combobox } from "../autocomplete/index.js";
|
|
|
15
14
|
|
|
16
15
|
import { FilterValueEditor } from "./FilterValueEditor.js";
|
|
17
16
|
import type { FilterEditorSize, GetFieldOptions } from "./types.js";
|
|
17
|
+
import { getLocalizedString } from "../i18n.js";
|
|
18
18
|
|
|
19
19
|
export function getFieldLabel(field: FieldMetadata) {
|
|
20
20
|
return field.caption || field.name;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Button, Dialog, Heading, Select, Table } from "@digdir/designsystemet-react";
|
|
2
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
3
2
|
import { type FilterPermission, useDebounce, useFilterPermissions } from "@olenbetong/appframe-react";
|
|
4
3
|
import { Combobox } from "../autocomplete/index.js";
|
|
5
4
|
import { PersonGroupIcon, PersonIcon, TrashIcon } from "@navikt/aksel-icons";
|
|
6
5
|
import { useEffect, useState } from "react";
|
|
7
6
|
|
|
8
7
|
import "./FilterShareDialog.css";
|
|
8
|
+
import { getLocalizedString } from "../i18n.js";
|
|
9
9
|
|
|
10
10
|
type PermissionCandidate = {
|
|
11
11
|
primKey: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Textfield, ValidationMessage } from "@digdir/designsystemet-react";
|
|
2
|
-
import { type FilterTree,
|
|
2
|
+
import { type FilterTree, toFilterTree } from "@olenbetong/appframe-core";
|
|
3
3
|
import { useFilterConversion } from "@olenbetong/appframe-react";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
|
|
6
6
|
import type { FilterEditorSize } from "./types.js";
|
|
7
|
+
import { getLocalizedString } from "../i18n.js";
|
|
7
8
|
|
|
8
9
|
export type FilterStringFieldProps = {
|
|
9
10
|
filter: FilterTree;
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
type FilterOperator,
|
|
8
8
|
getDynamicValueLabel,
|
|
9
9
|
getDynamicValuesForField,
|
|
10
|
-
getLocalizedString,
|
|
11
10
|
getOperatorArity,
|
|
12
11
|
getValueType,
|
|
13
12
|
normalizeOperator,
|
|
@@ -16,6 +15,7 @@ import { Combobox } from "../autocomplete/index.js";
|
|
|
16
15
|
|
|
17
16
|
import { ChipListInput } from "./ChipListInput.js";
|
|
18
17
|
import type { FilterEditorSize, FilterValueOption } from "./types.js";
|
|
18
|
+
import { getLocalizedString } from "../i18n.js";
|
|
19
19
|
|
|
20
20
|
export type FilterValueEditorProps = {
|
|
21
21
|
expression: FilterExpression;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Dropdown } from "@digdir/designsystemet-react";
|
|
2
|
-
import {
|
|
3
|
-
canDeleteSavedFilter,
|
|
4
|
-
canRenameSavedFilter,
|
|
5
|
-
getLocalizedString,
|
|
6
|
-
type SavedFilter,
|
|
7
|
-
} from "@olenbetong/appframe-core";
|
|
2
|
+
import { canDeleteSavedFilter, canRenameSavedFilter, type SavedFilter } from "@olenbetong/appframe-core";
|
|
8
3
|
import {
|
|
9
4
|
ChevronDownIcon,
|
|
10
5
|
ChevronRightIcon,
|
|
@@ -20,6 +15,7 @@ import clsx from "clsx";
|
|
|
20
15
|
import { useState } from "react";
|
|
21
16
|
|
|
22
17
|
import "./SavedFilterTree.css";
|
|
18
|
+
import { getLocalizedString } from "../i18n.js";
|
|
23
19
|
|
|
24
20
|
/** `null` is the "new filter" node, i.e. no saved filter selected. */
|
|
25
21
|
export type SavedFilterSelection = number | null;
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
type FilterExpression,
|
|
4
4
|
type FilterOperator,
|
|
5
5
|
type FilterTree,
|
|
6
|
-
getLocalizedString,
|
|
7
6
|
getOperatorArity,
|
|
8
7
|
getOperatorLabel,
|
|
9
8
|
getValueType,
|
|
10
9
|
isExpression,
|
|
11
10
|
normalizeOperator,
|
|
12
11
|
} from "@olenbetong/appframe-core";
|
|
12
|
+
import { getLocalizedString } from "../i18n.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The criteria a header filter owns for a field: the expressions directly in
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
gridColumnVisibilityModelSelector,
|
|
6
6
|
useGridSelector,
|
|
7
7
|
} from "@mui/x-data-grid-premium";
|
|
8
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
9
8
|
|
|
10
9
|
import { useState } from "react";
|
|
11
10
|
import { useAfGridContext } from "./AfGridContext.js";
|
|
11
|
+
import { getLocalizedString } from "../i18n.js";
|
|
12
12
|
|
|
13
13
|
export type AfGridColumnsPanelProps = {
|
|
14
14
|
open: boolean;
|
package/src/grid/AfGridError.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Alert, Button } from "@digdir/designsystemet-react";
|
|
2
2
|
import type { GridApi } from "@mui/x-data-grid-premium";
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
5
4
|
import { useError } from "@olenbetong/appframe-react";
|
|
6
5
|
import { useEffect, useRef, useState } from "react";
|
|
7
6
|
import { createPortal } from "react-dom";
|
|
7
|
+
import { getLocalizedString } from "../i18n.js";
|
|
8
8
|
|
|
9
9
|
type AfGridErrorProps = {
|
|
10
10
|
apiRef: React.RefObject<GridApi | null>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { Button, Popover } from "@digdir/designsystemet-react";
|
|
2
2
|
import type { GridRenderHeaderFilterProps } from "@mui/x-data-grid-premium";
|
|
3
3
|
import { FunnelFillIcon, FunnelIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
4
|
-
import {
|
|
5
|
-
createExpression,
|
|
6
|
-
type FieldMetadata,
|
|
7
|
-
type FilterExpression,
|
|
8
|
-
getLocalizedString,
|
|
9
|
-
} from "@olenbetong/appframe-core";
|
|
4
|
+
import { createExpression, type FieldMetadata, type FilterExpression } from "@olenbetong/appframe-core";
|
|
10
5
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
11
6
|
import { useState } from "react";
|
|
12
7
|
|
|
@@ -16,6 +11,7 @@ import { AfHeaderFilterPanel } from "./AfHeaderFilterPanel.js";
|
|
|
16
11
|
import { getSimpleValue, isSimpleFieldFilter, summarizeFieldFilter } from "../filter/fieldFilter.js";
|
|
17
12
|
import { findFilterField } from "./useAfFilter.js";
|
|
18
13
|
import type { AfGridColDef } from "./useAfColumns.js";
|
|
14
|
+
import { getLocalizedString } from "../i18n.js";
|
|
19
15
|
|
|
20
16
|
export type AfHeaderFilterCellProps = GridRenderHeaderFilterProps & {
|
|
21
17
|
dataObject: DataObject<any>;
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
type FieldMetadata,
|
|
5
5
|
type FilterExpression,
|
|
6
6
|
type FilterTree,
|
|
7
|
-
getLocalizedString,
|
|
8
7
|
isCompleteExpression,
|
|
9
8
|
} from "@olenbetong/appframe-core";
|
|
10
9
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
11
10
|
import { useEffect, useState } from "react";
|
|
12
11
|
|
|
13
12
|
import { FieldFilterPanel } from "../filter/FieldFilterPanel.js";
|
|
13
|
+
import { getLocalizedString } from "../i18n.js";
|
|
14
14
|
|
|
15
15
|
export type AfHeaderFilterPanelProps = {
|
|
16
16
|
open: boolean;
|
package/src/grid/Toolbar.tsx
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
PlusIcon,
|
|
18
18
|
TableIcon,
|
|
19
19
|
} from "@navikt/aksel-icons";
|
|
20
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
21
20
|
import { type DataObject, exportOptionsFromDataObject } from "@olenbetong/appframe-data";
|
|
22
21
|
import { useDataObject, useLoading, usePermissions } from "@olenbetong/appframe-react";
|
|
23
22
|
|
|
@@ -25,6 +24,7 @@ import { openDataObjectReportWithProgress } from "../report-downloader/index.js"
|
|
|
25
24
|
import { useAfGridContext } from "./AfGridContext.js";
|
|
26
25
|
import { addRow } from "./editing.js";
|
|
27
26
|
import type { AfGridApi } from "./useAfGridApi.js";
|
|
27
|
+
import { getLocalizedString } from "../i18n.js";
|
|
28
28
|
|
|
29
29
|
export function GridToolbarAddButton({ onClick }: { onClick: () => void }) {
|
|
30
30
|
return (
|
package/src/grid/editing.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type GridApi, gridFocusCellSelector, gridVisibleColumnDefinitionsSelector } from "@mui/x-data-grid-premium";
|
|
2
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
3
2
|
import { type DataObject, uid } from "@olenbetong/appframe-data";
|
|
4
3
|
|
|
5
4
|
import type React from "react";
|
|
6
5
|
|
|
7
6
|
import type { AfGridApi } from "./useAfGridApi.js";
|
|
7
|
+
import { getLocalizedString } from "../i18n.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Starts a new row. With a new item row on the grid that row is focused and put
|
package/src/grid/filter.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getGridSingleSelectOperators,
|
|
12
12
|
getGridStringOperators,
|
|
13
13
|
} from "@mui/x-data-grid-premium";
|
|
14
|
-
import { getLocalizedString } from "
|
|
14
|
+
import { getLocalizedString } from "../i18n.js";
|
|
15
15
|
|
|
16
16
|
const stringOperators = getGridStringOperators();
|
|
17
17
|
const numericOperators = getGridNumericOperators();
|
package/src/grid/index.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
type GridFilterModel,
|
|
12
12
|
useGridApiRef,
|
|
13
13
|
} from "@mui/x-data-grid-premium";
|
|
14
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
15
14
|
import { type DataObject, uid } from "@olenbetong/appframe-data";
|
|
16
15
|
import { DataObjectProvider, useLoading } from "@olenbetong/appframe-react";
|
|
17
16
|
|
|
@@ -60,6 +59,7 @@ import { useAfRowEditModel } from "./useAfRowEditModel.js";
|
|
|
60
59
|
import { useAfRowGrouping } from "./useAfRowGrouping.js";
|
|
61
60
|
import { useAfServerAggregation } from "./useAfServerAggregation.js";
|
|
62
61
|
import { useAfSortModel } from "./useAfSortModel.js";
|
|
62
|
+
import { getLocalizedString } from "../i18n.js";
|
|
63
63
|
|
|
64
64
|
export * from "./formatters.js";
|
|
65
65
|
export * as MuiDataGrid from "@mui/x-data-grid-premium";
|
package/src/grid/localization.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GridLocaleText } from "@mui/x-data-grid-premium";
|
|
2
|
-
import { getLocalizedString, localize } from "
|
|
2
|
+
import { getLocalizedString, localize } from "../i18n.js";
|
|
3
3
|
|
|
4
4
|
export type AfGridLocaleTextExt = GridLocaleText & {
|
|
5
5
|
filterOperatorNotContains: string;
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
useGridSelector,
|
|
20
20
|
} from "@mui/x-data-grid-premium";
|
|
21
21
|
import { FloppydiskIcon, PencilIcon, TrashIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
22
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
23
22
|
import { type DataObject, uid } from "@olenbetong/appframe-data";
|
|
24
23
|
import { usePermissions } from "@olenbetong/appframe-react";
|
|
25
24
|
|
|
@@ -30,6 +29,7 @@ import { deleteRow } from "./editing.js";
|
|
|
30
29
|
import { operators } from "./filter.js";
|
|
31
30
|
import { dateTimeValueFormatter, dateValueFormatter } from "./formatters.js";
|
|
32
31
|
import { isNewItemRow } from "./useAfNewItemRow.js";
|
|
32
|
+
import { getLocalizedString } from "../i18n.js";
|
|
33
33
|
|
|
34
34
|
/** `auto-generated-group-footer-`, without spelling it out: every group's total row shares it. */
|
|
35
35
|
const AGGREGATION_FOOTER_ID_PREFIX = String(getAggregationFooterRowIdFromGroupId(""));
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
gridFocusCellSelector,
|
|
9
9
|
gridVisibleColumnDefinitionsSelector,
|
|
10
10
|
} from "@mui/x-data-grid-premium";
|
|
11
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
12
11
|
import { type DataObject, uid } from "@olenbetong/appframe-data";
|
|
13
12
|
import { setDataObjectField, usePermissions } from "@olenbetong/appframe-react";
|
|
14
13
|
|
|
@@ -16,6 +15,7 @@ import type React from "react";
|
|
|
16
15
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
17
16
|
|
|
18
17
|
import type { AfGridApi } from "./useAfGridApi.js";
|
|
18
|
+
import { getLocalizedString } from "../i18n.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Row id of the new item row. It never collides with a data row, whose id is
|
package/src/i18n.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The package's strings live in their own globalization project, `appframe-ds`, so one
|
|
3
|
+
* translation covers every app and the package can word a term its own way. The templates
|
|
4
|
+
* render the dictionary as af.i18n["appframe-ds"]; on a page that does not (a legacy
|
|
5
|
+
* template) the localizer falls back to the article's strings, exactly as before. See
|
|
6
|
+
* `createLocalizer` in @olenbetong/appframe-core.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createLocalizer } from "@olenbetong/appframe-core";
|
|
10
|
+
|
|
11
|
+
export const PROJECT = "appframe-ds";
|
|
12
|
+
|
|
13
|
+
export const { getLocalizedString, localize } = createLocalizer(PROJECT);
|
package/src/layout/AppMenu.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "./AppMenu.css";
|
|
2
2
|
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
|
-
|
|
5
3
|
import clsx from "clsx";
|
|
6
4
|
import type React from "react";
|
|
5
|
+
import { getLocalizedString } from "../i18n.js";
|
|
7
6
|
|
|
8
7
|
type MenuHeaderProps = {
|
|
9
8
|
children?: React.ReactNode[] | React.ReactNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "./ErrorBoundary.css";
|
|
2
2
|
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
3
|
import type { DataObject } from "@olenbetong/appframe-data";
|
|
5
4
|
import { useError } from "@olenbetong/appframe-react";
|
|
6
5
|
|
|
@@ -8,6 +7,7 @@ import { Component, useEffect } from "react";
|
|
|
8
7
|
import { useAsyncError, useRouteError } from "react-router";
|
|
9
8
|
|
|
10
9
|
import { PageContainer } from "./PageContainer.js";
|
|
10
|
+
import { getLocalizedString } from "../i18n.js";
|
|
11
11
|
|
|
12
12
|
function parseError(error: unknown) {
|
|
13
13
|
let message = "Unspecified error";
|
package/src/mdi/Mdi.test.tsx
CHANGED
|
@@ -9,6 +9,10 @@ import type { MdiApi, MdiDocumentProps, MdiDocumentTypes, MdiLayoutSpec } from "
|
|
|
9
9
|
|
|
10
10
|
vi.mock("@olenbetong/appframe-core", () => ({
|
|
11
11
|
getLocalizedString: (value: string) => value,
|
|
12
|
+
createLocalizer: () => ({
|
|
13
|
+
getLocalizedString: (value: string) => value,
|
|
14
|
+
localize: (parts: TemplateStringsArray) => parts.join(""),
|
|
15
|
+
}),
|
|
12
16
|
}));
|
|
13
17
|
|
|
14
18
|
function Note({ params }: MdiDocumentProps<{ label: string }>) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, Dialog, Heading, Paragraph } from "@digdir/designsystemet-react";
|
|
2
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
3
2
|
|
|
4
3
|
import type { MdiConfirmCloseResult, MdiDocumentInfo } from "./types.js";
|
|
4
|
+
import { getLocalizedString } from "../i18n.js";
|
|
5
5
|
|
|
6
6
|
export type MdiConfirmCloseDialogProps = {
|
|
7
7
|
/** The document being closed, or `null` when the dialog is closed */
|
package/src/mdi/MdiPanel.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Button } from "@digdir/designsystemet-react";
|
|
2
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
3
2
|
import type { IDockviewPanelProps } from "dockview-react";
|
|
4
3
|
import { useSyncExternalStore } from "react";
|
|
5
4
|
import { ErrorBoundary, type FallbackProps } from "react-error-boundary";
|
|
6
5
|
|
|
7
6
|
import { useMdiController } from "./MdiContext.js";
|
|
8
7
|
import { MdiDocumentIdContext } from "./MdiDocumentContext.js";
|
|
8
|
+
import { getLocalizedString } from "../i18n.js";
|
|
9
9
|
|
|
10
10
|
function MdiErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
|
11
11
|
let message = error instanceof Error ? error.message : String(error);
|
|
@@ -9,6 +9,10 @@ import type { MdiDocumentProps, MdiDocumentTypes, MdiLayout, MdiLayoutSpec } fro
|
|
|
9
9
|
|
|
10
10
|
vi.mock("@olenbetong/appframe-core", () => ({
|
|
11
11
|
getLocalizedString: (value: string) => value,
|
|
12
|
+
createLocalizer: () => ({
|
|
13
|
+
getLocalizedString: (value: string) => value,
|
|
14
|
+
localize: (parts: TemplateStringsArray) => parts.join(""),
|
|
15
|
+
}),
|
|
12
16
|
}));
|
|
13
17
|
|
|
14
18
|
function Doc({ id }: MdiDocumentProps) {
|
package/src/page/PageHeader.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import "./PageHeader.css";
|
|
2
2
|
|
|
3
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
|
-
|
|
5
3
|
import clsx from "clsx";
|
|
6
4
|
import type React from "react";
|
|
7
5
|
|
|
8
6
|
import { type AppMenuProps } from "../layout/AppMenu.js";
|
|
9
7
|
import { AppMenuDrawer, useAppMenuDrawer } from "../layout/AppMenuDrawer.js";
|
|
10
8
|
import { PageBlock, type PageBlockWidth } from "./PageBlock.js";
|
|
9
|
+
import { getLocalizedString } from "../i18n.js";
|
|
11
10
|
|
|
12
11
|
export type PageHeaderVariant = "appbar" | "plain";
|
|
13
12
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Button, Paragraph, Spinner } from "@digdir/designsystemet-react";
|
|
2
2
|
import { CheckmarkCircleFillIcon, ExclamationmarkTriangleFillIcon, XMarkOctagonFillIcon } from "@navikt/aksel-icons";
|
|
3
|
-
import { type DownloadItem
|
|
3
|
+
import { type DownloadItem } from "@olenbetong/appframe-core";
|
|
4
4
|
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
+
import { getLocalizedString } from "../../i18n.js";
|
|
6
7
|
|
|
7
8
|
const statuses: Record<string, { icon: React.ReactNode; text: string }> = {
|
|
8
9
|
cancelled: {
|
|
@@ -2,7 +2,6 @@ import "./SortableItemList.css";
|
|
|
2
2
|
|
|
3
3
|
import { Button, Dropdown } from "@digdir/designsystemet-react";
|
|
4
4
|
import { DragVerticalIcon } from "@navikt/aksel-icons";
|
|
5
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
6
5
|
import clsx from "clsx";
|
|
7
6
|
import type React from "react";
|
|
8
7
|
import { createContext, useContext, useId, useRef } from "react";
|
|
@@ -13,6 +12,7 @@ import { DropIndicator } from "./DropIndicator.js";
|
|
|
13
12
|
import type { SortableRecord } from "./types.js";
|
|
14
13
|
import { type SortableItemState, useSortableItem } from "./useSortableItem.js";
|
|
15
14
|
import { type SortableList, type SortableListOptions, useSortableList } from "./useSortableList.js";
|
|
15
|
+
import { getLocalizedString } from "../i18n.js";
|
|
16
16
|
|
|
17
17
|
export interface SortableItemContextValue<T extends SortableRecord = SortableRecord> {
|
|
18
18
|
record: T;
|