@altinn/altinn-components 0.13.0 → 0.13.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.
|
@@ -1,75 +1,81 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "../Autocomplete/AutocompleteBase.js";
|
|
6
|
-
import { QueryLabel as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { IconButton as
|
|
6
|
+
import { QueryLabel as I } from "./QueryLabel.js";
|
|
7
|
+
import { Button as L } from "../Button/Button.js";
|
|
8
|
+
import { IconButton as b } from "../Button/IconButton.js";
|
|
9
9
|
import "../RootProvider/RootProvider.js";
|
|
10
|
-
import { ListItemBase as
|
|
11
|
-
import { ListItemHeader as
|
|
10
|
+
import { ListItemBase as v } from "../List/ListItemBase.js";
|
|
11
|
+
import { ListItemHeader as y } from "../List/ListItemHeader.js";
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import { Section as
|
|
14
|
-
import { Flex as
|
|
15
|
-
import { TextField as
|
|
16
|
-
const
|
|
17
|
-
size:
|
|
18
|
-
icon:
|
|
13
|
+
import { Section as z } from "../Page/Section.js";
|
|
14
|
+
import { Flex as F } from "../Page/Flex.js";
|
|
15
|
+
import { TextField as H } from "../TextField/TextField.js";
|
|
16
|
+
const R = ({
|
|
17
|
+
size: p = "sm",
|
|
18
|
+
icon: f = "bookmark",
|
|
19
19
|
expanded: t,
|
|
20
20
|
loading: o,
|
|
21
21
|
title: i,
|
|
22
|
-
titleField:
|
|
23
|
-
untitled:
|
|
24
|
-
params:
|
|
25
|
-
onToggle:
|
|
26
|
-
saveButton:
|
|
22
|
+
titleField: l,
|
|
23
|
+
untitled: C = "Untitled bookmark",
|
|
24
|
+
params: a,
|
|
25
|
+
onToggle: m,
|
|
26
|
+
saveButton: n,
|
|
27
27
|
removeButton: e,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
inputValue: k,
|
|
29
|
+
onChange: u,
|
|
30
|
+
as: j,
|
|
31
|
+
...c
|
|
30
32
|
}) => {
|
|
31
|
-
const [
|
|
32
|
-
|
|
33
|
-
j((y) => ({
|
|
34
|
-
...y,
|
|
35
|
-
[F]: S
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
return t && !o ? /* @__PURE__ */ f(I, { loading: o, expanded: t, children: [
|
|
33
|
+
const [w, x] = S("");
|
|
34
|
+
return t && !o ? /* @__PURE__ */ s(v, { loading: o, expanded: t, children: [
|
|
39
35
|
/* @__PURE__ */ r(
|
|
40
|
-
|
|
36
|
+
y,
|
|
41
37
|
{
|
|
42
|
-
size:
|
|
43
|
-
title: i ||
|
|
38
|
+
size: p,
|
|
39
|
+
title: i || C,
|
|
44
40
|
loading: o,
|
|
45
|
-
icon:
|
|
46
|
-
onClick:
|
|
47
|
-
controls: /* @__PURE__ */ r(
|
|
48
|
-
...
|
|
41
|
+
icon: f,
|
|
42
|
+
onClick: m,
|
|
43
|
+
controls: /* @__PURE__ */ r(b, { variant: "outline", size: "sm", icon: "chevron-up", onClick: m }),
|
|
44
|
+
...c
|
|
49
45
|
}
|
|
50
46
|
),
|
|
51
|
-
t && /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */ r(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
t && /* @__PURE__ */ s(z, { padding: "lg", spacing: "lg", children: [
|
|
48
|
+
/* @__PURE__ */ r(I, { params: a }),
|
|
49
|
+
l && /* @__PURE__ */ r(
|
|
50
|
+
H,
|
|
51
|
+
{
|
|
52
|
+
...l,
|
|
53
|
+
name: "title",
|
|
54
|
+
value: typeof k == "string" ? k : w,
|
|
55
|
+
onChange: (h) => {
|
|
56
|
+
typeof u == "function" ? u(h) : x(h.target.value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
(n || e) && /* @__PURE__ */ s(F, { as: "footer", direction: "row", spacing: "sm", children: [
|
|
61
|
+
n && /* @__PURE__ */ r(L, { ...n }),
|
|
62
|
+
e && /* @__PURE__ */ r(L, { ...e, variant: "outline" })
|
|
57
63
|
] })
|
|
58
64
|
] })
|
|
59
|
-
] }) : /* @__PURE__ */ r(
|
|
60
|
-
|
|
65
|
+
] }) : /* @__PURE__ */ r(v, { ...c, loading: o, expanded: t, children: /* @__PURE__ */ r(
|
|
66
|
+
y,
|
|
61
67
|
{
|
|
62
|
-
as:
|
|
63
|
-
size:
|
|
68
|
+
as: j,
|
|
69
|
+
size: p,
|
|
64
70
|
title: i,
|
|
65
71
|
loading: o,
|
|
66
|
-
icon:
|
|
67
|
-
controls: !o && /* @__PURE__ */ r(
|
|
68
|
-
...
|
|
69
|
-
children: !i && !o && /* @__PURE__ */ r(
|
|
72
|
+
icon: f,
|
|
73
|
+
controls: !o && /* @__PURE__ */ r(b, { variant: "outline", size: "sm", icon: "chevron-down", onClick: m }),
|
|
74
|
+
...c,
|
|
75
|
+
children: !i && !o && /* @__PURE__ */ r(I, { params: a })
|
|
70
76
|
}
|
|
71
77
|
) });
|
|
72
78
|
};
|
|
73
79
|
export {
|
|
74
|
-
|
|
80
|
+
R as BookmarksListItem
|
|
75
81
|
};
|
|
@@ -2,6 +2,10 @@ import { ButtonProps, ListItemInputProps, TextFieldProps } from '..';
|
|
|
2
2
|
import { QueryItemProps } from './QueryLabel';
|
|
3
3
|
export interface BookmarksListItemProps extends ListItemInputProps {
|
|
4
4
|
id: string;
|
|
5
|
+
/** Input value */
|
|
6
|
+
inputValue?: string;
|
|
7
|
+
/** On change */
|
|
8
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
9
|
/** Loading */
|
|
6
10
|
loading?: boolean;
|
|
7
11
|
/** Expanded */
|
|
@@ -23,4 +27,4 @@ export interface BookmarksListItemProps extends ListItemInputProps {
|
|
|
23
27
|
/** Render as **/
|
|
24
28
|
as?: React.ElementType;
|
|
25
29
|
}
|
|
26
|
-
export declare const BookmarksListItem: ({ size, icon, expanded, loading, title, titleField, untitled, params, onToggle, saveButton, removeButton, as, ...rest }: BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const BookmarksListItem: ({ size, icon, expanded, loading, title, titleField, untitled, params, onToggle, saveButton, removeButton, inputValue, onChange, as, ...rest }: BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ size, icon, expanded, loading, title, titleField, untitled, params, onToggle, saveButton, removeButton, as, ...rest }: import('./BookmarksListItem').BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ size, icon, expanded, loading, title, titleField, untitled, params, onToggle, saveButton, removeButton, inputValue, onChange, as, ...rest }: import('./BookmarksListItem').BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|