@altinn/altinn-components 0.28.0 → 0.28.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/{Checkmark-RgzvRNxP.js → Checkmark-D17Nyv_u.js} +1 -1
- package/dist/{ChevronRight-DUaHaWi-.js → ChevronRight-BbelnTke.js} +1 -1
- package/dist/{ChevronUp-C09jxB5F.js → ChevronUp-DR4Lz2Jb.js} +1 -1
- package/dist/{CircleFill-IZdiBc_K.js → CircleFill-BkDF4Wm0.js} +1 -1
- package/dist/{DialogActivityLog-wsSwha93.js → DialogActivityLog-BoPREh7Y.js} +1 -1
- package/dist/{Eye-CMPIjkcy.js → Eye-BuhFHkaK.js} +1 -1
- package/dist/{FieldsetLegend-Dwb3U0vQ.js → FieldsetLegend-CiZWWPgY.js} +1 -1
- package/dist/{Label-DjSEhgyW.js → Label-9elsbqMH.js} +1 -1
- package/dist/{MagnifyingGlass-DWIcpwS4.js → MagnifyingGlass-3Ln1MufI.js} +1 -1
- package/dist/{Paragraph-CFjOkbXa.js → Paragraph-Bm-eoPYv.js} +1 -1
- package/dist/{XMark-Bv1I87Ev.js → XMark-DIqxCTTQ.js} +1 -1
- package/dist/components/AccessAreaList/AccessAreaListItem.js +13 -13
- package/dist/components/AccessPackageList/AccessPackageListItem.js +1 -1
- package/dist/components/Attachment/AttachmentLink.js +1 -1
- package/dist/components/Avatar/AvatarGroup.js +8 -8
- package/dist/components/Bookmarks/EditableBookmark.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.js +15 -16
- package/dist/components/Dashboard/DashboardCard.js +2 -2
- package/dist/components/Dashboard/DashboardIcon.js +1 -1
- package/dist/components/Datepicker/DatepickerHeader.js +2 -2
- package/dist/components/Dialog/DialogActions.js +1 -1
- package/dist/components/Dialog/DialogActivity.js +1 -1
- package/dist/components/Dialog/DialogActivityLog.js +1 -1
- package/dist/components/Dialog/DialogBody.js +2 -2
- package/dist/components/Dialog/DialogByline.js +2 -2
- package/dist/components/Dialog/DialogHistoryItem.js +1 -1
- package/dist/components/Dialog/DialogHistorySegment.js +1 -1
- package/dist/components/Dialog/DialogListGroup.js +1 -1
- package/dist/components/Dialog/DialogListItem.js +54 -56
- package/dist/components/Dialog/DialogMetadata.js +2 -2
- package/dist/components/Dialog/DialogSeenBy.js +2 -2
- package/dist/components/Dialog/SeenByLog.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerHeader.js +1 -1
- package/dist/components/DsComponents/index.js +4 -4
- package/dist/components/Forms/Field.js +1 -1
- package/dist/components/Forms/Fieldset.js +2 -2
- package/dist/components/Forms/Label.js +1 -1
- package/dist/components/Forms/Legend.js +1 -1
- package/dist/components/Forms/Select.js +1 -1
- package/dist/components/GlobalMenu/AccountButton.js +15 -17
- package/dist/components/GlobalMenu/BackButton.js +1 -1
- package/dist/components/GlobalMenu/EndUserLabel.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +14 -14
- package/dist/components/GlobalMenu/GlobalMenuBase.js +7 -9
- package/dist/components/Header/HeaderButton.js +2 -2
- package/dist/components/Header/HeaderLogo.js +10 -11
- package/dist/components/Header/LocaleButton.js +15 -16
- package/dist/components/Icon/IconOrAvatar.js +17 -17
- package/dist/components/LayoutAction/ActionHeader.js +1 -1
- package/dist/components/List/ListItemControls.js +6 -8
- package/dist/components/List/ListItemHeader.js +13 -13
- package/dist/components/List/ListItemIcon.js +1 -1
- package/dist/components/Menu/MenuInputField.js +23 -26
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuItemIcon.js +1 -1
- package/dist/components/Menu/MenuItemsVirtual.js +7 -7
- package/dist/components/Menu/MenuSearch.js +2 -2
- package/dist/components/Page/Breadcrumbs.js +1 -1
- package/dist/components/Page/PageDetails.js +1 -1
- package/dist/components/Page/PageNav.js +15 -16
- package/dist/components/Profile/AccountListItem.js +1 -1
- package/dist/components/Searchbar/SearchField.js +2 -2
- package/dist/components/Skeleton/Skeleton.js +12 -13
- package/dist/components/Snackbar/SnackbarItem.js +4 -4
- package/dist/components/Timeline/TimelineActivity.js +1 -1
- package/dist/components/Timeline/TimelineFooter.js +1 -1
- package/dist/components/Timeline/TimelineIcon.js +1 -1
- package/dist/components/Timeline/TimelineSegment.js +1 -1
- package/dist/components/Toolbar/Toolbar.js +25 -25
- package/dist/components/Toolbar/ToolbarButton.js +2 -2
- package/dist/components/Toolbar/ToolbarSearch.js +2 -2
- package/dist/components/index.js +5 -5
- package/dist/{index-Bq6w9CqA.js → index-CnWc2FNH.js} +6 -6
- package/dist/{index-DyDqjche.js → index-D-VWMqlv.js} +129 -123
- package/dist/{index-B7UjMwQm.js → index-D3Rt9ate.js} +17 -17
- package/dist/index-D8Pn8SCu.js +78 -0
- package/dist/index.js +5 -5
- package/dist/useId-BVFxCjkq.js +16 -0
- package/dist/useMergeRefs-DOnoWyUH.js +29 -0
- package/dist/usePagination-D247OF6_.js +3838 -0
- package/package.json +33 -33
- package/dist/floating-ui.react-DpzNAs2N.js +0 -2835
- package/dist/index-C8BS_2GY.js +0 -64
- package/dist/useId-CsCRkvK3.js +0 -16
- package/dist/usePagination-Cpl0NjJN.js +0 -1025
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import * as x from "react";
|
|
2
|
-
import { flushSync as
|
|
3
|
-
function p(
|
|
2
|
+
import { flushSync as C } from "react-dom";
|
|
3
|
+
function p(r, l, e) {
|
|
4
4
|
let s = e.initialDeps ?? [], t;
|
|
5
5
|
function n() {
|
|
6
|
-
var i, o,
|
|
7
|
-
let
|
|
8
|
-
e.key && ((i = e.debug) != null && i.call(e)) && (
|
|
9
|
-
const u =
|
|
6
|
+
var i, o, a, c;
|
|
7
|
+
let h;
|
|
8
|
+
e.key && ((i = e.debug) != null && i.call(e)) && (h = Date.now());
|
|
9
|
+
const u = r();
|
|
10
10
|
if (!(u.length !== s.length || u.some((m, f) => s[f] !== m)))
|
|
11
11
|
return t;
|
|
12
12
|
s = u;
|
|
13
|
-
let
|
|
14
|
-
if (e.key && ((o = e.debug) != null && o.call(e)) && (
|
|
15
|
-
const m = Math.round((Date.now() -
|
|
16
|
-
for (g = String(g); g.length <
|
|
13
|
+
let v;
|
|
14
|
+
if (e.key && ((o = e.debug) != null && o.call(e)) && (v = Date.now()), t = l(...u), e.key && ((a = e.debug) != null && a.call(e))) {
|
|
15
|
+
const m = Math.round((Date.now() - h) * 100) / 100, f = Math.round((Date.now() - v) * 100) / 100, E = f / 16, b = (g, z) => {
|
|
16
|
+
for (g = String(g); g.length < z; )
|
|
17
17
|
g = " " + g;
|
|
18
18
|
return g;
|
|
19
19
|
};
|
|
20
20
|
console.info(
|
|
21
|
-
`%c⏱ ${
|
|
21
|
+
`%c⏱ ${b(f, 5)} /${b(m, 5)} ms`,
|
|
22
22
|
`
|
|
23
23
|
font-size: .6rem;
|
|
24
24
|
font-weight: bold;
|
|
25
25
|
color: hsl(${Math.max(
|
|
26
26
|
0,
|
|
27
|
-
Math.min(120 - 120 *
|
|
27
|
+
Math.min(120 - 120 * E, 120)
|
|
28
28
|
)}deg 100% 31%);`,
|
|
29
29
|
e == null ? void 0 : e.key
|
|
30
30
|
);
|
|
@@ -35,102 +35,103 @@ function p(l, r, e) {
|
|
|
35
35
|
s = i;
|
|
36
36
|
}, n;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
if (
|
|
38
|
+
function S(r, l) {
|
|
39
|
+
if (r === void 0)
|
|
40
40
|
throw new Error("Unexpected undefined");
|
|
41
|
-
return
|
|
41
|
+
return r;
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const T = (r, l) => Math.abs(r - l) <= 1, _ = (r, l, e) => {
|
|
44
44
|
let s;
|
|
45
45
|
return function(...t) {
|
|
46
|
-
|
|
46
|
+
r.clearTimeout(s), s = r.setTimeout(() => l.apply(this, t), e);
|
|
47
47
|
};
|
|
48
|
-
},
|
|
49
|
-
const
|
|
50
|
-
|
|
48
|
+
}, y = (r) => {
|
|
49
|
+
const { offsetWidth: l, offsetHeight: e } = r;
|
|
50
|
+
return { width: l, height: e };
|
|
51
|
+
}, R = (r) => r, D = (r) => {
|
|
52
|
+
const l = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
53
|
+
for (let t = l; t <= e; t++)
|
|
51
54
|
s.push(t);
|
|
52
55
|
return s;
|
|
53
|
-
},
|
|
54
|
-
const e =
|
|
56
|
+
}, A = (r, l) => {
|
|
57
|
+
const e = r.scrollElement;
|
|
55
58
|
if (!e)
|
|
56
59
|
return;
|
|
57
|
-
const s =
|
|
60
|
+
const s = r.targetWindow;
|
|
58
61
|
if (!s)
|
|
59
62
|
return;
|
|
60
63
|
const t = (i) => {
|
|
61
|
-
const { width: o, height:
|
|
62
|
-
|
|
64
|
+
const { width: o, height: a } = i;
|
|
65
|
+
l({ width: Math.round(o), height: Math.round(a) });
|
|
63
66
|
};
|
|
64
|
-
if (t(e
|
|
67
|
+
if (t(y(e)), !s.ResizeObserver)
|
|
65
68
|
return () => {
|
|
66
69
|
};
|
|
67
70
|
const n = new s.ResizeObserver((i) => {
|
|
68
71
|
const o = () => {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
const c =
|
|
72
|
+
const a = i[0];
|
|
73
|
+
if (a != null && a.borderBoxSize) {
|
|
74
|
+
const c = a.borderBoxSize[0];
|
|
72
75
|
if (c) {
|
|
73
76
|
t({ width: c.inlineSize, height: c.blockSize });
|
|
74
77
|
return;
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
t(e
|
|
80
|
+
t(y(e));
|
|
78
81
|
};
|
|
79
|
-
|
|
82
|
+
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
80
83
|
});
|
|
81
84
|
return n.observe(e, { box: "border-box" }), () => {
|
|
82
85
|
n.unobserve(e);
|
|
83
86
|
};
|
|
84
|
-
},
|
|
87
|
+
}, M = {
|
|
85
88
|
passive: !0
|
|
86
|
-
}, O = typeof window > "u" ? !0 : "onscrollend" in window,
|
|
87
|
-
const e =
|
|
89
|
+
}, O = typeof window > "u" ? !0 : "onscrollend" in window, k = (r, l) => {
|
|
90
|
+
const e = r.scrollElement;
|
|
88
91
|
if (!e)
|
|
89
92
|
return;
|
|
90
|
-
const s =
|
|
93
|
+
const s = r.targetWindow;
|
|
91
94
|
if (!s)
|
|
92
95
|
return;
|
|
93
96
|
let t = 0;
|
|
94
|
-
const n =
|
|
95
|
-
} :
|
|
97
|
+
const n = r.options.useScrollendEvent && O ? () => {
|
|
98
|
+
} : _(
|
|
96
99
|
s,
|
|
97
100
|
() => {
|
|
98
|
-
|
|
101
|
+
l(t, !1);
|
|
99
102
|
},
|
|
100
|
-
|
|
101
|
-
), i = (
|
|
102
|
-
const { horizontal: u, isRtl: d } =
|
|
103
|
-
t = u ? e.scrollLeft * (d && -1 || 1) : e.scrollTop, n(),
|
|
104
|
-
}, o = i(!0),
|
|
105
|
-
|
|
106
|
-
const c =
|
|
107
|
-
return c && e.addEventListener("scrollend",
|
|
108
|
-
e.removeEventListener("scroll", o), c && e.removeEventListener("scrollend",
|
|
103
|
+
r.options.isScrollingResetDelay
|
|
104
|
+
), i = (h) => () => {
|
|
105
|
+
const { horizontal: u, isRtl: d } = r.options;
|
|
106
|
+
t = u ? e.scrollLeft * (d && -1 || 1) : e.scrollTop, n(), l(t, h);
|
|
107
|
+
}, o = i(!0), a = i(!1);
|
|
108
|
+
a(), e.addEventListener("scroll", o, M);
|
|
109
|
+
const c = r.options.useScrollendEvent && O;
|
|
110
|
+
return c && e.addEventListener("scrollend", a, M), () => {
|
|
111
|
+
e.removeEventListener("scroll", o), c && e.removeEventListener("scrollend", a);
|
|
109
112
|
};
|
|
110
|
-
},
|
|
111
|
-
if (
|
|
112
|
-
const s =
|
|
113
|
+
}, F = (r, l, e) => {
|
|
114
|
+
if (l != null && l.borderBoxSize) {
|
|
115
|
+
const s = l.borderBoxSize[0];
|
|
113
116
|
if (s)
|
|
114
117
|
return Math.round(
|
|
115
118
|
s[e.options.horizontal ? "inlineSize" : "blockSize"]
|
|
116
119
|
);
|
|
117
120
|
}
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}, F = (l, {
|
|
122
|
-
adjustments: r = 0,
|
|
121
|
+
return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
122
|
+
}, N = (r, {
|
|
123
|
+
adjustments: l = 0,
|
|
123
124
|
behavior: e
|
|
124
125
|
}, s) => {
|
|
125
126
|
var t, n;
|
|
126
|
-
const i =
|
|
127
|
+
const i = r + l;
|
|
127
128
|
(n = (t = s.scrollElement) == null ? void 0 : t.scrollTo) == null || n.call(t, {
|
|
128
129
|
[s.options.horizontal ? "left" : "top"]: i,
|
|
129
130
|
behavior: e
|
|
130
131
|
});
|
|
131
132
|
};
|
|
132
|
-
class
|
|
133
|
-
constructor(
|
|
133
|
+
class W {
|
|
134
|
+
constructor(l) {
|
|
134
135
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
135
136
|
let e = null;
|
|
136
137
|
const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
|
|
@@ -167,11 +168,11 @@ class N {
|
|
|
167
168
|
scrollPaddingStart: 0,
|
|
168
169
|
scrollPaddingEnd: 0,
|
|
169
170
|
horizontal: !1,
|
|
170
|
-
getItemKey:
|
|
171
|
-
rangeExtractor:
|
|
171
|
+
getItemKey: R,
|
|
172
|
+
rangeExtractor: D,
|
|
172
173
|
onChange: () => {
|
|
173
174
|
},
|
|
174
|
-
measureElement:
|
|
175
|
+
measureElement: F,
|
|
175
176
|
initialRect: { width: 0, height: 0 },
|
|
176
177
|
scrollMargin: 0,
|
|
177
178
|
gap: 0,
|
|
@@ -239,10 +240,10 @@ class N {
|
|
|
239
240
|
const o = e[i];
|
|
240
241
|
if (t.has(o.lane))
|
|
241
242
|
continue;
|
|
242
|
-
const
|
|
243
|
+
const a = n.get(
|
|
243
244
|
o.lane
|
|
244
245
|
);
|
|
245
|
-
if (
|
|
246
|
+
if (a == null || o.end > a.end ? n.set(o.lane, o) : o.end < a.end && t.set(o.lane, !0), t.size === this.options.lanes)
|
|
246
247
|
break;
|
|
247
248
|
}
|
|
248
249
|
return n.size === this.options.lanes ? Array.from(n.values()).sort((i, o) => i.end === o.end ? i.index - o.index : i.end - o.end)[0] : void 0;
|
|
@@ -269,21 +270,21 @@ class N {
|
|
|
269
270
|
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: n, enabled: i }, o) => {
|
|
270
271
|
if (!i)
|
|
271
272
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
272
|
-
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
273
|
-
this.itemSizeCache.set(
|
|
273
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
|
|
274
|
+
this.itemSizeCache.set(h.key, h.size);
|
|
274
275
|
}));
|
|
275
|
-
const
|
|
276
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
276
277
|
this.pendingMeasuredCacheIndexes = [];
|
|
277
|
-
const c = this.measurementsCache.slice(0,
|
|
278
|
-
for (let
|
|
279
|
-
const u = n(
|
|
280
|
-
c[
|
|
281
|
-
index:
|
|
282
|
-
start:
|
|
278
|
+
const c = this.measurementsCache.slice(0, a);
|
|
279
|
+
for (let h = a; h < e; h++) {
|
|
280
|
+
const u = n(h), d = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h), v = d ? d.end + this.options.gap : s + t, m = o.get(u), f = typeof m == "number" ? m : this.options.estimateSize(h), E = v + f, b = d ? d.lane : h % this.options.lanes;
|
|
281
|
+
c[h] = {
|
|
282
|
+
index: h,
|
|
283
|
+
start: v,
|
|
283
284
|
size: f,
|
|
284
|
-
end:
|
|
285
|
+
end: E,
|
|
285
286
|
key: u,
|
|
286
|
-
lane:
|
|
287
|
+
lane: b
|
|
287
288
|
};
|
|
288
289
|
}
|
|
289
290
|
return this.measurementsCache = c, c;
|
|
@@ -299,7 +300,7 @@ class N {
|
|
|
299
300
|
this.getScrollOffset(),
|
|
300
301
|
this.options.lanes
|
|
301
302
|
],
|
|
302
|
-
(e, s, t, n) => this.range = e.length > 0 && s > 0 ?
|
|
303
|
+
(e, s, t, n) => this.range = e.length > 0 && s > 0 ? V({
|
|
303
304
|
measurements: e,
|
|
304
305
|
outerSize: s,
|
|
305
306
|
scrollOffset: t,
|
|
@@ -364,8 +365,8 @@ class N {
|
|
|
364
365
|
(e, s) => {
|
|
365
366
|
const t = [];
|
|
366
367
|
for (let n = 0, i = e.length; n < i; n++) {
|
|
367
|
-
const o = e[n],
|
|
368
|
-
t.push(
|
|
368
|
+
const o = e[n], a = s[o];
|
|
369
|
+
t.push(a);
|
|
369
370
|
}
|
|
370
371
|
return t;
|
|
371
372
|
},
|
|
@@ -376,19 +377,19 @@ class N {
|
|
|
376
377
|
), this.getVirtualItemForOffset = (e) => {
|
|
377
378
|
const s = this.getMeasurements();
|
|
378
379
|
if (s.length !== 0)
|
|
379
|
-
return
|
|
380
|
-
s[
|
|
380
|
+
return S(
|
|
381
|
+
s[w(
|
|
381
382
|
0,
|
|
382
383
|
s.length - 1,
|
|
383
|
-
(t) =>
|
|
384
|
+
(t) => S(s[t]).start,
|
|
384
385
|
e
|
|
385
386
|
)]
|
|
386
387
|
);
|
|
387
388
|
}, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
388
389
|
const n = this.getSize(), i = this.getScrollOffset();
|
|
389
390
|
s === "auto" && (s = e >= i + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
|
|
390
|
-
const o = this.
|
|
391
|
-
return Math.max(Math.min(
|
|
391
|
+
const o = this.getTotalSize() - n;
|
|
392
|
+
return Math.max(Math.min(o, e), 0);
|
|
392
393
|
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
393
394
|
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
394
395
|
const t = this.measurementsCache[e];
|
|
@@ -427,10 +428,10 @@ class N {
|
|
|
427
428
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
428
429
|
this.options.getItemKey(e)
|
|
429
430
|
)) {
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
);
|
|
433
|
-
|
|
431
|
+
const c = this.getOffsetForIndex(e, o);
|
|
432
|
+
if (!c) return;
|
|
433
|
+
const [h] = c, u = this.getScrollOffset();
|
|
434
|
+
T(h, u) || this.scrollToIndex(e, { align: o, behavior: t });
|
|
434
435
|
} else
|
|
435
436
|
this.scrollToIndex(e, { align: o, behavior: t });
|
|
436
437
|
}));
|
|
@@ -452,7 +453,7 @@ class N {
|
|
|
452
453
|
else {
|
|
453
454
|
const n = Array(this.options.lanes).fill(null);
|
|
454
455
|
let i = s.length - 1;
|
|
455
|
-
for (; i
|
|
456
|
+
for (; i >= 0 && n.some((o) => o === null); ) {
|
|
456
457
|
const o = s[i];
|
|
457
458
|
n[o.lane] === null && (n[o.lane] = o.end), i--;
|
|
458
459
|
}
|
|
@@ -469,73 +470,78 @@ class N {
|
|
|
469
470
|
this.options.scrollToFn(e, { behavior: t, adjustments: s }, this);
|
|
470
471
|
}, this.measure = () => {
|
|
471
472
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
472
|
-
}, this.setOptions(
|
|
473
|
+
}, this.setOptions(l);
|
|
473
474
|
}
|
|
474
475
|
}
|
|
475
|
-
const
|
|
476
|
-
for (;
|
|
477
|
-
const t = (
|
|
476
|
+
const w = (r, l, e, s) => {
|
|
477
|
+
for (; r <= l; ) {
|
|
478
|
+
const t = (r + l) / 2 | 0, n = e(t);
|
|
478
479
|
if (n < s)
|
|
479
|
-
|
|
480
|
+
r = t + 1;
|
|
480
481
|
else if (n > s)
|
|
481
|
-
|
|
482
|
+
l = t - 1;
|
|
482
483
|
else
|
|
483
484
|
return t;
|
|
484
485
|
}
|
|
485
|
-
return
|
|
486
|
+
return r > 0 ? r - 1 : 0;
|
|
486
487
|
};
|
|
487
|
-
function
|
|
488
|
-
measurements:
|
|
489
|
-
outerSize:
|
|
488
|
+
function V({
|
|
489
|
+
measurements: r,
|
|
490
|
+
outerSize: l,
|
|
490
491
|
scrollOffset: e,
|
|
491
492
|
lanes: s
|
|
492
493
|
}) {
|
|
493
|
-
const t =
|
|
494
|
-
|
|
494
|
+
const t = r.length - 1, n = (a) => r[a].start;
|
|
495
|
+
if (r.length <= s)
|
|
496
|
+
return {
|
|
497
|
+
startIndex: 0,
|
|
498
|
+
endIndex: t
|
|
499
|
+
};
|
|
500
|
+
let i = w(
|
|
495
501
|
0,
|
|
496
502
|
t,
|
|
497
|
-
|
|
503
|
+
n,
|
|
498
504
|
e
|
|
499
505
|
), o = i;
|
|
500
506
|
if (s === 1)
|
|
501
|
-
for (; o < t &&
|
|
507
|
+
for (; o < t && r[o].end < e + l; )
|
|
502
508
|
o++;
|
|
503
509
|
else if (s > 1) {
|
|
504
|
-
const
|
|
505
|
-
for (; o < t &&
|
|
506
|
-
const
|
|
507
|
-
h
|
|
510
|
+
const a = Array(s).fill(0);
|
|
511
|
+
for (; o < t && a.some((h) => h < e + l); ) {
|
|
512
|
+
const h = r[o];
|
|
513
|
+
a[h.lane] = h.end, o++;
|
|
508
514
|
}
|
|
509
|
-
const c = Array(s).fill(e +
|
|
510
|
-
for (; i
|
|
511
|
-
const
|
|
512
|
-
c[
|
|
515
|
+
const c = Array(s).fill(e + l);
|
|
516
|
+
for (; i >= 0 && c.some((h) => h >= e); ) {
|
|
517
|
+
const h = r[i];
|
|
518
|
+
c[h.lane] = h.start, i--;
|
|
513
519
|
}
|
|
514
520
|
i = Math.max(0, i - i % s), o = Math.min(t, o + (s - 1 - o % s));
|
|
515
521
|
}
|
|
516
522
|
return { startIndex: i, endIndex: o };
|
|
517
523
|
}
|
|
518
|
-
const
|
|
519
|
-
function
|
|
520
|
-
const
|
|
521
|
-
...
|
|
524
|
+
const I = typeof document < "u" ? x.useLayoutEffect : x.useEffect;
|
|
525
|
+
function j(r) {
|
|
526
|
+
const l = x.useReducer(() => ({}), {})[1], e = {
|
|
527
|
+
...r,
|
|
522
528
|
onChange: (t, n) => {
|
|
523
529
|
var i;
|
|
524
|
-
n ?
|
|
530
|
+
n ? C(l) : l(), (i = r.onChange) == null || i.call(r, t, n);
|
|
525
531
|
}
|
|
526
532
|
}, [s] = x.useState(
|
|
527
|
-
() => new
|
|
533
|
+
() => new W(e)
|
|
528
534
|
);
|
|
529
|
-
return s.setOptions(e),
|
|
535
|
+
return s.setOptions(e), I(() => s._didMount(), []), I(() => s._willUpdate()), s;
|
|
530
536
|
}
|
|
531
|
-
function
|
|
532
|
-
return
|
|
533
|
-
observeElementRect:
|
|
534
|
-
observeElementOffset:
|
|
535
|
-
scrollToFn:
|
|
536
|
-
...
|
|
537
|
+
function P(r) {
|
|
538
|
+
return j({
|
|
539
|
+
observeElementRect: A,
|
|
540
|
+
observeElementOffset: k,
|
|
541
|
+
scrollToFn: N,
|
|
542
|
+
...r
|
|
537
543
|
});
|
|
538
544
|
}
|
|
539
545
|
export {
|
|
540
|
-
|
|
546
|
+
P as u
|
|
541
547
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var E = typeof window < "u" && typeof window.document < "u" && typeof window.navigator < "u",
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { c as M } from "./lite-1fxw3LjI.js";
|
|
4
|
+
import { forwardRef as h, useRef as d, useEffect as x } from "react";
|
|
5
|
+
import { u as $ } from "./useMergeRefs-DOnoWyUH.js";
|
|
6
|
+
var E = typeof window < "u" && typeof window.document < "u" && typeof window.navigator < "u", v;
|
|
7
7
|
E && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474
|
|
8
|
-
/^Mac/i.test(((
|
|
8
|
+
/^Mac/i.test(((v = navigator.userAgentData) == null ? void 0 : v.platform) || navigator.platform);
|
|
9
9
|
var H = ":host(:not([hidden])) { display: block }", w = typeof HTMLElement > "u" ? class {
|
|
10
10
|
} : HTMLElement;
|
|
11
11
|
function a(t, e, n) {
|
|
@@ -15,14 +15,14 @@ function a(t, e, n) {
|
|
|
15
15
|
var D = (t, e, n) => {
|
|
16
16
|
for (const o of n[0].split(","))
|
|
17
17
|
n[0] = o, Element.prototype[`${t}EventListener`].apply(e, n);
|
|
18
|
-
},
|
|
18
|
+
}, g = (t, ...e) => D("add", t, e), k = (t, ...e) => D("remove", t, e), N = (t) => {
|
|
19
19
|
const e = "key" in t && (t.key === " " || t.key === "Enter");
|
|
20
20
|
return e && t.preventDefault(), e && t.target instanceof HTMLElement && t.target.click(), e;
|
|
21
21
|
}, O = (t) => {
|
|
22
22
|
var e;
|
|
23
23
|
const n = ((e = t.getRootNode) == null ? void 0 : e.call(t)) || t.ownerDocument;
|
|
24
24
|
return n instanceof Document || n instanceof ShadowRoot ? n : document;
|
|
25
|
-
},
|
|
25
|
+
}, m = (t, e, n) => {
|
|
26
26
|
const o = document.createElement(t);
|
|
27
27
|
if (e && (o.textContent = e), n) for (const [s, r] of Object.entries(n)) a(o, s, r);
|
|
28
28
|
return o;
|
|
@@ -31,9 +31,9 @@ var D = (t, e, n) => {
|
|
|
31
31
|
}, T = class extends w {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(), this._content = null, this.attachShadow({ mode: "open" }).append(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
m("slot", null, { name: "summary" }),
|
|
35
|
+
m("slot", null, { part: "details-content" }),
|
|
36
|
+
m(
|
|
37
37
|
"style",
|
|
38
38
|
`${H}
|
|
39
39
|
::slotted(u-summary) { cursor: pointer; display: block }
|
|
@@ -49,7 +49,7 @@ var D = (t, e, n) => {
|
|
|
49
49
|
}
|
|
50
50
|
connectedCallback() {
|
|
51
51
|
var t;
|
|
52
|
-
this._content = (t = this.shadowRoot) == null ? void 0 : t.children[1],
|
|
52
|
+
this._content = (t = this.shadowRoot) == null ? void 0 : t.children[1], g(this._content, "beforematch", this), g(this, "click,keydown", this), this.attributeChangedCallback();
|
|
53
53
|
}
|
|
54
54
|
disconnectedCallback() {
|
|
55
55
|
this._content && k(this._content, "beforematch", this), k(this, "click,keydown", this), this._content = null;
|
|
@@ -91,18 +91,18 @@ var D = (t, e, n) => {
|
|
|
91
91
|
C.define("u-details", T);
|
|
92
92
|
C.define("u-summary", U);
|
|
93
93
|
const j = h(function({ className: e, open: n, defaultOpen: o = !1, variant: s = "default", onToggle: r, ...l }, _) {
|
|
94
|
-
const p = d(null), L = d(o), R =
|
|
95
|
-
return c.current = r, u.current = n,
|
|
94
|
+
const p = d(null), L = d(o), R = $([p, _]), c = d(r), u = d(n);
|
|
95
|
+
return c.current = r, u.current = n, x(() => {
|
|
96
96
|
const i = p.current, y = (A) => {
|
|
97
97
|
var b;
|
|
98
98
|
!i || (i == null ? void 0 : i.open) === u.current || ((b = c.current) == null || b.call(c, A), u.current !== void 0 && (i.open = u.current));
|
|
99
99
|
};
|
|
100
100
|
return i == null || i.addEventListener("toggle", y, !0), () => i == null ? void 0 : i.removeEventListener("toggle", y, !0);
|
|
101
|
-
}, []),
|
|
101
|
+
}, []), f("u-details", { class: M("ds-details", e), open: (n ?? L.current) || void 0, "data-variant": s, ref: R, ...l });
|
|
102
102
|
}), B = h(function(e, n) {
|
|
103
|
-
return
|
|
103
|
+
return f("div", { ref: n, ...e });
|
|
104
104
|
}), I = h(function({ className: e, ...n }, o) {
|
|
105
|
-
return
|
|
105
|
+
return f("u-summary", { ref: o, class: e, ...n });
|
|
106
106
|
}), S = Object.assign(j, {
|
|
107
107
|
Summary: I,
|
|
108
108
|
Content: B
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as f, Fragment as S } from "react/jsx-runtime";
|
|
3
|
+
function d(t, e) {
|
|
4
|
+
if (typeof t == "function")
|
|
5
|
+
return t(e);
|
|
6
|
+
t != null && (t.current = e);
|
|
7
|
+
}
|
|
8
|
+
function g(...t) {
|
|
9
|
+
return (e) => {
|
|
10
|
+
let r = !1;
|
|
11
|
+
const o = t.map((n) => {
|
|
12
|
+
const l = d(n, e);
|
|
13
|
+
return !r && typeof l == "function" && (r = !0), l;
|
|
14
|
+
});
|
|
15
|
+
if (r)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let n = 0; n < o.length; n++) {
|
|
18
|
+
const l = o[n];
|
|
19
|
+
typeof l == "function" ? l() : d(t[n], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// @__NO_SIDE_EFFECTS__
|
|
25
|
+
function b(t) {
|
|
26
|
+
const e = /* @__PURE__ */ C(t), r = i.forwardRef((o, n) => {
|
|
27
|
+
const { children: l, ...a } = o, s = i.Children.toArray(l), c = s.find(h);
|
|
28
|
+
if (c) {
|
|
29
|
+
const u = c.props.children, m = s.map((p) => p === c ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : p);
|
|
30
|
+
return /* @__PURE__ */ f(e, { ...a, ref: n, children: i.isValidElement(u) ? i.cloneElement(u, void 0, m) : null });
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ f(e, { ...a, ref: n, children: l });
|
|
33
|
+
});
|
|
34
|
+
return r.displayName = `${t}.Slot`, r;
|
|
35
|
+
}
|
|
36
|
+
var I = /* @__PURE__ */ b("Slot");
|
|
37
|
+
// @__NO_SIDE_EFFECTS__
|
|
38
|
+
function C(t) {
|
|
39
|
+
const e = i.forwardRef((r, o) => {
|
|
40
|
+
const { children: n, ...l } = r;
|
|
41
|
+
if (i.isValidElement(n)) {
|
|
42
|
+
const a = _(n), s = R(l, n.props);
|
|
43
|
+
return n.type !== i.Fragment && (s.ref = o ? g(o, a) : a), i.cloneElement(n, s);
|
|
44
|
+
}
|
|
45
|
+
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
46
|
+
});
|
|
47
|
+
return e.displayName = `${t}.SlotClone`, e;
|
|
48
|
+
}
|
|
49
|
+
var y = Symbol("radix.slottable");
|
|
50
|
+
// @__NO_SIDE_EFFECTS__
|
|
51
|
+
function E(t) {
|
|
52
|
+
const e = ({ children: r }) => /* @__PURE__ */ f(S, { children: r });
|
|
53
|
+
return e.displayName = `${t}.Slottable`, e.__radixId = y, e;
|
|
54
|
+
}
|
|
55
|
+
var V = /* @__PURE__ */ E("Slottable");
|
|
56
|
+
function h(t) {
|
|
57
|
+
return i.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === y;
|
|
58
|
+
}
|
|
59
|
+
function R(t, e) {
|
|
60
|
+
const r = { ...e };
|
|
61
|
+
for (const o in e) {
|
|
62
|
+
const n = t[o], l = e[o];
|
|
63
|
+
/^on[A-Z]/.test(o) ? n && l ? r[o] = (...s) => {
|
|
64
|
+
const c = l(...s);
|
|
65
|
+
return n(...s), c;
|
|
66
|
+
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...l } : o === "className" && (r[o] = [n, l].filter(Boolean).join(" "));
|
|
67
|
+
}
|
|
68
|
+
return { ...t, ...r };
|
|
69
|
+
}
|
|
70
|
+
function _(t) {
|
|
71
|
+
var o, n;
|
|
72
|
+
let e = (o = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : o.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
|
73
|
+
return r ? t.ref : (e = (n = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : n.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? t.props.ref : t.props.ref || t.ref);
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
I as S,
|
|
77
|
+
V as a
|
|
78
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import { DialogListItem as fo } from "./components/Dialog/DialogListItem.js";
|
|
|
31
31
|
import { DialogMetadata as io } from "./components/Dialog/DialogMetadata.js";
|
|
32
32
|
import { DialogByline as co } from "./components/Dialog/DialogByline.js";
|
|
33
33
|
import { DialogActions as uo } from "./components/Dialog/DialogActions.js";
|
|
34
|
-
import { D as go } from "./DialogActivityLog-
|
|
34
|
+
import { D as go } from "./DialogActivityLog-BoPREh7Y.js";
|
|
35
35
|
import { DialogSeenBy as Bo } from "./components/Dialog/DialogSeenBy.js";
|
|
36
36
|
import { DialogSelect as So } from "./components/Dialog/DialogSelect.js";
|
|
37
37
|
import { DialogStatus as Ao, DialogStatusEnum as Mo } from "./components/Dialog/DialogStatus.js";
|
|
@@ -191,10 +191,10 @@ import { Article as Dp } from "./components/Article/Article.js";
|
|
|
191
191
|
import { useClickOutside as gp } from "./hooks/useClickOutside.js";
|
|
192
192
|
import { useEscapeKey as Bp } from "./hooks/useEscapeKey.js";
|
|
193
193
|
import { useMenu as Sp } from "./hooks/useMenu.js";
|
|
194
|
-
import { A as Ap, B as Mp, a as kp, C as Tp, b as yp, c as hp, D as Pp, H as Hp, L as Cp, d as Fp, e as vp, P as wp, f as Op, g as Rp, h as Ep, i as Gp, S as Qp, j as Up, T as Vp, u as jp } from "./usePagination-
|
|
195
|
-
import { D as Kp } from "./index-
|
|
196
|
-
import { P as qp } from "./Paragraph-
|
|
197
|
-
import { V as Wp } from "./index-
|
|
194
|
+
import { A as Ap, B as Mp, a as kp, C as Tp, b as yp, c as hp, D as Pp, H as Hp, L as Cp, d as Fp, e as vp, P as wp, f as Op, g as Rp, h as Ep, i as Gp, S as Qp, j as Up, T as Vp, u as jp } from "./usePagination-D247OF6_.js";
|
|
195
|
+
import { D as Kp } from "./index-D3Rt9ate.js";
|
|
196
|
+
import { P as qp } from "./Paragraph-Bm-eoPYv.js";
|
|
197
|
+
import { V as Wp } from "./index-CnWc2FNH.js";
|
|
198
198
|
export {
|
|
199
199
|
xa as AccessAreaList,
|
|
200
200
|
aa as AccessAreaListItem,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import c, { useState as d, useEffect as o } from "react";
|
|
2
|
+
let a = 0;
|
|
3
|
+
function s(t) {
|
|
4
|
+
const [e, u] = d(t), l = t || e;
|
|
5
|
+
return o(() => {
|
|
6
|
+
e == null && (a += 1, u(`aksel-icon-${a}`));
|
|
7
|
+
}, [e]), l;
|
|
8
|
+
}
|
|
9
|
+
const n = c.useId;
|
|
10
|
+
function r(t) {
|
|
11
|
+
var e;
|
|
12
|
+
return n !== void 0 ? n().replace(/(:)/g, "") : (e = s(t)) !== null && e !== void 0 ? e : "";
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
r as u
|
|
16
|
+
};
|