asma-ui-core 3.98.0 → 3.98.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/asma-ui-core.css +1 -1
- package/dist/components/custom/widget/widget-title/StyledWidgetTitle.js +7 -7
- package/dist/components/custom/widget/widget-title/StyledWidgetTitle.module.js +1 -1
- package/dist/components/inputs/phone-field/StyledPhoneField.js +27 -26
- package/dist/src/components/custom/widget/widget-title/StyledWidgetTitle.d.ts +2 -1
- package/dist/table/components/table-footer/TablePagination.js +21 -19
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn as i } from "../../../../helpers/cn.js";
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
return /* @__PURE__ */
|
|
2
|
+
import l from "./StyledWidgetTitle.module.js";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
5
|
+
var c = r(function(e, t) {
|
|
6
|
+
return /* @__PURE__ */ d(e.component ?? "h2", {
|
|
7
7
|
ref: t,
|
|
8
|
-
className: i(
|
|
8
|
+
className: i(l["styled-widget-title"], e.className),
|
|
9
9
|
children: e.children
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
c as StyledWidgetTitle
|
|
14
14
|
};
|
|
@@ -3,66 +3,67 @@ import { StyledInputField as M } from "../input-field/StyledInputField.js";
|
|
|
3
3
|
import { StyledLink as V } from "../../navigation/link/StyledLink.js";
|
|
4
4
|
import { CountryCodeSelect as W } from "./CountryCodeSelect.js";
|
|
5
5
|
import { useId as z } from "react";
|
|
6
|
-
import { jsx as t, jsxs as
|
|
7
|
-
var E = (e) => e.replace(/\D/g, ""), U = ({ dataTest: e, label: l, countries: h, country: n, onCountryChange: x, value: s, onChange: f, onBlur:
|
|
8
|
-
const B = z(), a = j ?? `${B}-phone`,
|
|
9
|
-
return /* @__PURE__ */
|
|
6
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
var E = (e) => e.replace(/\D/g, ""), U = ({ dataTest: e, label: l, countries: h, country: n, onCountryChange: x, value: s, onChange: f, onBlur: v, error: y, helperText: N, reserveHelperText: b = !0, disabled: i, readOnly: g, readOnlyText: m, readOnlyHref: c, required: p, placeholder: $, formatNationalNumber: I, renderFlag: C, selectCountryLabel: S, searchPlaceholder: F, id: j, name: P, size: k = "medium", fieldClassName: u, helperTextClassName: w, className: A }) => {
|
|
8
|
+
const B = z(), a = j ?? `${B}-phone`, o = `${a}-label`, r = I?.(s, n) ?? s;
|
|
9
|
+
return /* @__PURE__ */ d("div", {
|
|
10
10
|
className: L("flex flex-col", A),
|
|
11
11
|
"data-testid": `${e}-root`,
|
|
12
|
-
children: [l != null && /* @__PURE__ */
|
|
13
|
-
id:
|
|
12
|
+
children: [l != null && /* @__PURE__ */ d("label", {
|
|
13
|
+
id: o,
|
|
14
14
|
htmlFor: a,
|
|
15
15
|
className: "pb-1 text-base font-semibold text-delta-800",
|
|
16
|
-
children: [l,
|
|
16
|
+
children: [l, p === !0 && /* @__PURE__ */ t("span", {
|
|
17
17
|
"aria-hidden": "true",
|
|
18
18
|
children: " *"
|
|
19
19
|
})]
|
|
20
|
-
}),
|
|
20
|
+
}), g === !0 ? /* @__PURE__ */ t("span", {
|
|
21
21
|
className: "py-2 text-base text-delta-800",
|
|
22
|
-
children:
|
|
22
|
+
children: c === void 0 ? /* @__PURE__ */ t("span", {
|
|
23
23
|
"data-testid": `${e}-readonly`,
|
|
24
|
-
children:
|
|
24
|
+
children: m ?? r
|
|
25
25
|
}) : /* @__PURE__ */ t(V, {
|
|
26
26
|
dataTest: `${e}-readonly`,
|
|
27
|
-
href:
|
|
27
|
+
href: c,
|
|
28
28
|
className: "-ml-1",
|
|
29
|
-
contentNode:
|
|
29
|
+
contentNode: m ?? r
|
|
30
30
|
})
|
|
31
|
-
}) : /* @__PURE__ */
|
|
31
|
+
}) : /* @__PURE__ */ d("div", {
|
|
32
32
|
className: "flex items-start gap-2.5",
|
|
33
33
|
children: [/* @__PURE__ */ t(W, {
|
|
34
34
|
dataTest: `${e}-country`,
|
|
35
35
|
countries: h,
|
|
36
36
|
value: n,
|
|
37
37
|
onChange: x,
|
|
38
|
-
disabled:
|
|
38
|
+
disabled: i,
|
|
39
39
|
selectCountryLabel: S,
|
|
40
40
|
searchPlaceholder: F,
|
|
41
41
|
renderFlag: C,
|
|
42
|
-
labelledBy: l == null ? void 0 :
|
|
43
|
-
className:
|
|
42
|
+
labelledBy: l == null ? void 0 : o,
|
|
43
|
+
className: u
|
|
44
44
|
}), /* @__PURE__ */ t(M, {
|
|
45
45
|
dataTest: `${e}-number`,
|
|
46
46
|
className: "max-w-[200px]",
|
|
47
47
|
id: a,
|
|
48
48
|
name: P,
|
|
49
|
-
value:
|
|
49
|
+
value: r,
|
|
50
50
|
onChange: (D) => f(E(D.target.value)),
|
|
51
|
-
onBlur:
|
|
52
|
-
placeholder:
|
|
53
|
-
error:
|
|
54
|
-
disabled:
|
|
55
|
-
required:
|
|
51
|
+
onBlur: v,
|
|
52
|
+
placeholder: $,
|
|
53
|
+
error: y,
|
|
54
|
+
disabled: i,
|
|
55
|
+
required: p,
|
|
56
56
|
fullWidth: !0,
|
|
57
|
-
helperText:
|
|
58
|
-
reserveHelperText:
|
|
57
|
+
helperText: N,
|
|
58
|
+
reserveHelperText: b,
|
|
59
59
|
size: k,
|
|
60
60
|
slotProps: {
|
|
61
61
|
htmlInput: {
|
|
62
62
|
inputMode: "tel",
|
|
63
|
-
autoComplete: "tel"
|
|
63
|
+
autoComplete: "tel",
|
|
64
|
+
"aria-labelledby": l == null ? void 0 : o
|
|
64
65
|
},
|
|
65
|
-
input: { className:
|
|
66
|
+
input: { className: u },
|
|
66
67
|
formHelperText: { className: w }
|
|
67
68
|
}
|
|
68
69
|
})]
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const StyledWidgetTitle: import('react').ForwardRefExoticComponent<{
|
|
6
6
|
className?: string;
|
|
7
|
+
component?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
7
8
|
} & {
|
|
8
9
|
children?: import('react').ReactNode | undefined;
|
|
9
|
-
} & import('react').RefAttributes<
|
|
10
|
+
} & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ChevronRightIcon as
|
|
1
|
+
import { ChevronRightIcon as $ } from "../../../components/icons/chevron-right-icon/ChevronRightIcon.js";
|
|
2
2
|
import { ChevronLeftIcon as O } from "../../../components/icons/chevron-left-icon/ChevronLeftIcon.js";
|
|
3
3
|
import { StyledPopover as k } from "../../../components/utils/popover/StyledPopover.js";
|
|
4
4
|
import { StyledMenuList as z } from "../../../components/navigation/menu/StyledMenuList.js";
|
|
5
5
|
import { StyledSelectItem as D } from "../../../components/inputs/select/StyledSelectItem.js";
|
|
6
|
-
import
|
|
7
|
-
import { StyledTooltip as
|
|
8
|
-
import { ChevronDownIcon as
|
|
9
|
-
import { useKeyboardSelectMenu as
|
|
6
|
+
import h from "../StyledTable.module.js";
|
|
7
|
+
import { StyledTooltip as m } from "../../shared-components/tooltip/index.js";
|
|
8
|
+
import { ChevronDownIcon as F } from "../../shared-components/ChevronDownIcon.js";
|
|
9
|
+
import { useKeyboardSelectMenu as L } from "../../hooks/useToggleMenuVisibility.hook.js";
|
|
10
10
|
import { StyledButton as u } from "../../shared-components/button/StyledButton.js";
|
|
11
|
-
import { useCallback as I, useId as
|
|
11
|
+
import { useCallback as I, useId as R, useMemo as S, useRef as K } from "react";
|
|
12
12
|
import { Fragment as M, jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
13
13
|
function U({ table: o, locale: y }) {
|
|
14
|
-
const v = K(null), r = y === "no", a =
|
|
14
|
+
const v = K(null), r = y === "no", a = R(), b = S(() => ({
|
|
15
15
|
anchorOrigin: {
|
|
16
16
|
vertical: -5,
|
|
17
17
|
horizontal: "center"
|
|
@@ -21,20 +21,20 @@ function U({ table: o, locale: y }) {
|
|
|
21
21
|
horizontal: "center"
|
|
22
22
|
}
|
|
23
23
|
}), []), l = I(() => {
|
|
24
|
-
const t =
|
|
24
|
+
const t = h["asma-ui-table-styled-table"], n = v.current?.closest(`.${t}`)?.querySelector(`.${h["table-scroll"]}, .${h["table-wrapper"]}`);
|
|
25
25
|
n && n.scrollTo({
|
|
26
26
|
top: 0,
|
|
27
27
|
behavior: "smooth"
|
|
28
28
|
});
|
|
29
29
|
}, []), s = o.getPageCount() || 1, i = o.getState().pagination.pageIndex + 1, c = S(() => Array.from({ length: s }, (t, n) => n + 1), [s]), P = I((t) => {
|
|
30
30
|
o.setPageIndex(t - 1), l();
|
|
31
|
-
}, [o, l]), { anchorEl: g, open: d, handleClose: x, handleOpen:
|
|
31
|
+
}, [o, l]), { anchorEl: g, open: d, handleClose: x, handleOpen: N, triggerRef: T, activeIndex: p, handleKeyDown: w } = L({
|
|
32
32
|
optionCount: c.length,
|
|
33
33
|
selectedIndex: i - 1,
|
|
34
34
|
onSelect: (t) => P(c[t])
|
|
35
35
|
});
|
|
36
36
|
return /* @__PURE__ */ f(M, { children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
37
|
+
/* @__PURE__ */ e(m, {
|
|
38
38
|
title: r ? "Nåværende side" : "Current Page",
|
|
39
39
|
children: /* @__PURE__ */ e("div", {
|
|
40
40
|
ref: v,
|
|
@@ -42,15 +42,15 @@ function U({ table: o, locale: y }) {
|
|
|
42
42
|
dataTest: "current-page-button",
|
|
43
43
|
variant: "outlined",
|
|
44
44
|
size: "large",
|
|
45
|
-
refLink:
|
|
46
|
-
onClick:
|
|
47
|
-
onKeyDown:
|
|
45
|
+
refLink: T,
|
|
46
|
+
onClick: N,
|
|
47
|
+
onKeyDown: w,
|
|
48
48
|
role: "combobox",
|
|
49
49
|
"aria-haspopup": "listbox",
|
|
50
50
|
"aria-controls": d ? a : void 0,
|
|
51
51
|
"aria-expanded": d,
|
|
52
|
-
"aria-activedescendant":
|
|
53
|
-
endIcon: /* @__PURE__ */ e(
|
|
52
|
+
"aria-activedescendant": p === null ? void 0 : `${a}-option-${p}`,
|
|
53
|
+
endIcon: /* @__PURE__ */ e(F, {
|
|
54
54
|
className: `${d ? "flip-180" : "rotate-0"} transition-transform duration-300`,
|
|
55
55
|
height: 24,
|
|
56
56
|
width: 24
|
|
@@ -87,7 +87,7 @@ function U({ table: o, locale: y }) {
|
|
|
87
87
|
role: "listbox",
|
|
88
88
|
children: c.map((t, n) => /* @__PURE__ */ e(D, {
|
|
89
89
|
id: `${a}-option-${n}`,
|
|
90
|
-
active: n ===
|
|
90
|
+
active: n === p,
|
|
91
91
|
onClick: (C) => {
|
|
92
92
|
C.stopPropagation(), C.preventDefault(), P(t), x();
|
|
93
93
|
},
|
|
@@ -103,7 +103,7 @@ function U({ table: o, locale: y }) {
|
|
|
103
103
|
}, t))
|
|
104
104
|
})
|
|
105
105
|
}),
|
|
106
|
-
/* @__PURE__ */ e(
|
|
106
|
+
/* @__PURE__ */ e(m, {
|
|
107
107
|
title: i === 1 ? "" : r ? "Forrige side" : "Previous Page",
|
|
108
108
|
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, {
|
|
109
109
|
dataTest: "prev-page-button",
|
|
@@ -113,13 +113,14 @@ function U({ table: o, locale: y }) {
|
|
|
113
113
|
},
|
|
114
114
|
size: "large",
|
|
115
115
|
disabled: !o.getCanPreviousPage(),
|
|
116
|
+
"aria-label": r ? "Forrige side" : "Previous page",
|
|
116
117
|
startIcon: /* @__PURE__ */ e(O, {
|
|
117
118
|
height: 24,
|
|
118
119
|
width: 24
|
|
119
120
|
})
|
|
120
121
|
}) })
|
|
121
122
|
}),
|
|
122
|
-
/* @__PURE__ */ e(
|
|
123
|
+
/* @__PURE__ */ e(m, {
|
|
123
124
|
title: i === s ? "" : r ? "Neste side" : "Next Page",
|
|
124
125
|
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, {
|
|
125
126
|
dataTest: "next-page-button",
|
|
@@ -129,7 +130,8 @@ function U({ table: o, locale: y }) {
|
|
|
129
130
|
},
|
|
130
131
|
size: "large",
|
|
131
132
|
disabled: !o.getCanNextPage(),
|
|
132
|
-
|
|
133
|
+
"aria-label": r ? "Neste side" : "Next page",
|
|
134
|
+
startIcon: /* @__PURE__ */ e($, {
|
|
133
135
|
height: 24,
|
|
134
136
|
width: 24
|
|
135
137
|
})
|