@shlinkio/shlink-frontend-kit 0.9.8 → 0.9.10
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.ts +43 -4
- package/dist/index.js +167 -188
- package/dist/ordering-VI1mTe3x.js +102 -0
- package/dist/tailwind.d.ts +88 -0
- package/dist/tailwind.js +794 -553
- package/dist/tailwind.preset.css +7 -3
- package/package.json +7 -7
- package/dist/use-toggle-C1uZwbSD.js +0 -32
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,17 @@ import { ReactNode } from 'react';
|
|
|
9
9
|
import { RefObject } from 'react';
|
|
10
10
|
import { SetStateAction } from 'react';
|
|
11
11
|
|
|
12
|
+
export declare type ArrowKeyNavigationOptions = {
|
|
13
|
+
/** Query selector for focusable elements that need to be included in the loop */
|
|
14
|
+
elementsSelector: string;
|
|
15
|
+
/** Whether first focusable item should be focused or not. Defaults to false */
|
|
16
|
+
focusFirstItem?: boolean;
|
|
17
|
+
/** Enables up and down arrows navigation. Defaults to true */
|
|
18
|
+
vertical?: boolean;
|
|
19
|
+
/** Enables left and right arrows navigation. Defaults to true */
|
|
20
|
+
horizontal?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
12
23
|
declare type BooleanControlProps = PropsWithChildren<{
|
|
13
24
|
checked?: boolean;
|
|
14
25
|
onChange?: (checked: boolean, e: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -20,16 +31,20 @@ export declare type Callback = () => unknown;
|
|
|
20
31
|
|
|
21
32
|
export declare const changeThemeInMarkup: (theme: Theme) => void | undefined;
|
|
22
33
|
|
|
34
|
+
/** @deprecated */
|
|
23
35
|
export declare const Checkbox: FC<BooleanControlProps>;
|
|
24
36
|
|
|
25
37
|
export declare function determineOrder<Fields extends string = string>(orderDirChange: OrderDirChange<Fields>): Order<Fields>;
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
/** @deprecated */
|
|
40
|
+
export declare function determineOrder<Fields extends string = string>(currentField?: Fields, newField?: Fields, currentOrderDir?: OrderDir): Order<Fields>;
|
|
28
41
|
|
|
29
42
|
export declare function determineOrderDir<Fields extends string = string>(orderDirChange: OrderDirChange<Fields>): OrderDir;
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
/** @deprecated */
|
|
45
|
+
export declare function determineOrderDir<Fields extends string = string>(currentField?: Fields, newField?: Fields, currentOrderDir?: OrderDir): OrderDir;
|
|
32
46
|
|
|
47
|
+
/** @deprecated */
|
|
33
48
|
export declare const DropdownBtn: FC<DropdownBtnProps>;
|
|
34
49
|
|
|
35
50
|
export declare type DropdownBtnMenuProps = PropsWithChildren<{
|
|
@@ -54,6 +69,7 @@ export declare const HIGHLIGHTED_COLOR = "#f77f28";
|
|
|
54
69
|
|
|
55
70
|
export declare const HIGHLIGHTED_COLOR_ALPHA = "rgba(247, 127, 40, 0.4)";
|
|
56
71
|
|
|
72
|
+
/** @deprecated */
|
|
57
73
|
export declare const InputFormGroup: FC<InputFormGroupProps>;
|
|
58
74
|
|
|
59
75
|
export declare type InputFormGroupProps = PropsWithChildren<{
|
|
@@ -83,6 +99,7 @@ export declare const MAIN_COLOR = "#4696e5";
|
|
|
83
99
|
|
|
84
100
|
export declare const MAIN_COLOR_ALPHA = "rgba(70, 150, 229, 0.4)";
|
|
85
101
|
|
|
102
|
+
/** @deprecated */
|
|
86
103
|
export declare const Message: FC<MessageProps>;
|
|
87
104
|
|
|
88
105
|
export declare type MessageProps = PropsWithChildren<{
|
|
@@ -94,6 +111,7 @@ export declare type MessageProps = PropsWithChildren<{
|
|
|
94
111
|
|
|
95
112
|
declare type MessageType = 'default' | 'error';
|
|
96
113
|
|
|
114
|
+
/** @deprecated */
|
|
97
115
|
export declare const NavPillItem: FC<NavPillItemProps>;
|
|
98
116
|
|
|
99
117
|
declare type NavPillItemProps = PropsWithChildren<{
|
|
@@ -101,6 +119,7 @@ declare type NavPillItemProps = PropsWithChildren<{
|
|
|
101
119
|
replace?: boolean;
|
|
102
120
|
}>;
|
|
103
121
|
|
|
122
|
+
/** @deprecated */
|
|
104
123
|
export declare const NavPills: FC<NavPillsProps>;
|
|
105
124
|
|
|
106
125
|
declare type NavPillsProps = PropsWithChildren<{
|
|
@@ -116,11 +135,12 @@ export declare type Order<Fields> = {
|
|
|
116
135
|
export declare type OrderDir = 'ASC' | 'DESC' | undefined;
|
|
117
136
|
|
|
118
137
|
export declare type OrderDirChange<Fields extends string = string> = {
|
|
119
|
-
currentField
|
|
138
|
+
currentField?: Fields;
|
|
120
139
|
newField?: Fields;
|
|
121
140
|
currentOrderDir?: OrderDir;
|
|
122
141
|
};
|
|
123
142
|
|
|
143
|
+
/** @deprecated */
|
|
124
144
|
export declare function OrderingDropdown<T extends string = string>({ items, order, onChange, isButton, right, prefixed }: OrderingDropdownProps<T>): JSX.Element;
|
|
125
145
|
|
|
126
146
|
export declare type OrderingDropdownProps<T extends string = string> = {
|
|
@@ -132,6 +152,12 @@ export declare type OrderingDropdownProps<T extends string = string> = {
|
|
|
132
152
|
prefixed?: boolean;
|
|
133
153
|
};
|
|
134
154
|
|
|
155
|
+
export declare type OrderSetter<T> = {
|
|
156
|
+
(order: Order<T>): void;
|
|
157
|
+
/** @deprecated Pass the order object as the only argument */
|
|
158
|
+
(orderField?: T, orderDir?: OrderDir): void;
|
|
159
|
+
};
|
|
160
|
+
|
|
135
161
|
/**
|
|
136
162
|
* Convert provided order object to string, with the pattern `${order.field}-${order.di}`.
|
|
137
163
|
* @return - A `string` if the `dir` prop is set, `undefined` otherwise.
|
|
@@ -148,6 +174,7 @@ export declare const PRIMARY_DARK_COLOR = "#161b22";
|
|
|
148
174
|
|
|
149
175
|
export declare const PRIMARY_LIGHT_COLOR = "white";
|
|
150
176
|
|
|
177
|
+
/** @deprecated */
|
|
151
178
|
export declare const Result: FC<ResultProps>;
|
|
152
179
|
|
|
153
180
|
export declare type ResultProps = PropsWithChildren<{
|
|
@@ -158,8 +185,10 @@ export declare type ResultProps = PropsWithChildren<{
|
|
|
158
185
|
|
|
159
186
|
export declare type ResultType = 'success' | 'error' | 'warning';
|
|
160
187
|
|
|
188
|
+
/** @deprecated */
|
|
161
189
|
export declare const RowDropdownBtn: FC<DropdownBtnMenuProps>;
|
|
162
190
|
|
|
191
|
+
/** @deprecated */
|
|
163
192
|
export declare const SearchField: ({ onChange, className, large, noBorder, initialValue, setTimeout_ }: SearchFieldProps) => JSX.Element;
|
|
164
193
|
|
|
165
194
|
declare type SearchFieldProps = {
|
|
@@ -171,6 +200,7 @@ declare type SearchFieldProps = {
|
|
|
171
200
|
setTimeout_?: typeof setTimeout;
|
|
172
201
|
};
|
|
173
202
|
|
|
203
|
+
/** @deprecated */
|
|
174
204
|
export declare const SimpleCard: ({ title, children, bodyClassName, ...rest }: SimpleCardProps) => JSX.Element;
|
|
175
205
|
|
|
176
206
|
export declare type SimpleCardProps = Omit<CardProps, 'title'> & {
|
|
@@ -219,14 +249,23 @@ export declare type ToggleResultObject = {
|
|
|
219
249
|
/** @deprecated */
|
|
220
250
|
export declare type ToggleResultTuple = [boolean, () => void, () => void, () => void];
|
|
221
251
|
|
|
252
|
+
/** @deprecated */
|
|
222
253
|
export declare const ToggleSwitch: FC<BooleanControlProps>;
|
|
223
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Allows focus navigation via arrow keys on the elements of a container.
|
|
257
|
+
*
|
|
258
|
+
* Initially, the first element with [data-selected=true] or the first globally, matching `elementsSelector`, will be
|
|
259
|
+
* focusable via Tab, then arrow keys need to be used to move through the sequence.
|
|
260
|
+
*/
|
|
261
|
+
export declare function useArrowKeyNavigation(containerRef: RefObject<HTMLElement | null>, { elementsSelector, focusFirstItem, vertical, horizontal }: ArrowKeyNavigationOptions): void;
|
|
262
|
+
|
|
224
263
|
/** @deprecated Use `useRef<T>(null) instead */
|
|
225
264
|
export declare const useElementRef: <T extends HTMLElement>() => RefObject<T | null>;
|
|
226
265
|
|
|
227
266
|
export declare const useGoBack: () => () => void | Promise<void>;
|
|
228
267
|
|
|
229
|
-
export declare const useOrder: <T>(initialOrder: Order<T>) => [Order<T>,
|
|
268
|
+
export declare const useOrder: <T>(initialOrder: Order<T>) => [Order<T>, OrderSetter<T>];
|
|
230
269
|
|
|
231
270
|
export declare const useParsedQuery: <T>() => T;
|
|
232
271
|
|
package/dist/index.js
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { faCircleNotch as
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { faCircleNotch as S, faSearch as R, faEllipsisV as D, faSortAmountUp as P, faSortAmountDown as E } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { Card as w, CardHeader as
|
|
6
|
-
import { useId as
|
|
4
|
+
import { clsx as u } from "clsx";
|
|
5
|
+
import { Card as w, CardHeader as H, CardBody as M, Dropdown as v, DropdownToggle as k, DropdownMenu as C, NavItem as $, NavLink as F, Nav as G, DropdownItem as g } from "reactstrap";
|
|
6
|
+
import { useId as O, useState as x, useRef as j, useCallback as U, useMemo as q, Children as Q, isValidElement as V, useEffect as Y } from "react";
|
|
7
|
+
import { u as T, d as W } from "./ordering-VI1mTe3x.js";
|
|
8
|
+
import { e as He, o as Me, s as $e, f as Fe, a as Ge, g as je, b as Ue, c as qe } from "./ordering-VI1mTe3x.js";
|
|
7
9
|
import { useNavigate as z, useLocation as J, NavLink as X } from "react-router";
|
|
8
|
-
|
|
9
|
-
import { a as je, b as Ue } from "./use-toggle-C1uZwbSD.js";
|
|
10
|
-
const fe = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: o = !1 }) => /* @__PURE__ */ s(
|
|
10
|
+
const ue = ({ className: r, children: e, loading: s = !1, type: t = "default", fullWidth: a = !1 }) => /* @__PURE__ */ n(
|
|
11
11
|
w,
|
|
12
12
|
{
|
|
13
13
|
body: !0,
|
|
14
|
-
className:
|
|
15
|
-
"w-100":
|
|
16
|
-
"w-75 mx-auto": !
|
|
17
|
-
"border-danger":
|
|
14
|
+
className: u(r, {
|
|
15
|
+
"w-100": a,
|
|
16
|
+
"w-75 mx-auto": !a,
|
|
17
|
+
"border-danger": t === "error"
|
|
18
18
|
}),
|
|
19
19
|
children: /* @__PURE__ */ i(
|
|
20
20
|
"h3",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
23
|
-
"text-muted":
|
|
24
|
-
"text-danger":
|
|
22
|
+
className: u("text-center mb-0", {
|
|
23
|
+
"text-muted": t === "default",
|
|
24
|
+
"text-danger": t === "error"
|
|
25
25
|
}),
|
|
26
26
|
children: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
!
|
|
27
|
+
s && /* @__PURE__ */ n(b, { icon: S, spin: !0 }),
|
|
28
|
+
s && /* @__PURE__ */ n("span", { className: "ms-2", children: e ?? "Loading..." }),
|
|
29
|
+
!s && e
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
|
-
), Z = ({ title:
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
] }),
|
|
34
|
+
), Z = ({ title: r, children: e, bodyClassName: s, ...t }) => /* @__PURE__ */ i(w, { ...t, children: [
|
|
35
|
+
r && /* @__PURE__ */ n(H, { role: "heading", "aria-level": 4, children: r }),
|
|
36
|
+
/* @__PURE__ */ n(M, { className: s, children: e })
|
|
37
|
+
] }), fe = ({ children: r, type: e, className: s, small: t = !1 }) => /* @__PURE__ */ n(
|
|
38
38
|
Z,
|
|
39
39
|
{
|
|
40
40
|
role: "document",
|
|
41
|
-
className:
|
|
42
|
-
"w-75 mx-auto": !
|
|
43
|
-
"w-100":
|
|
44
|
-
"bg-main":
|
|
45
|
-
"bg-danger":
|
|
46
|
-
"bg-warning":
|
|
47
|
-
"text-white":
|
|
48
|
-
},
|
|
49
|
-
bodyClassName:
|
|
50
|
-
children:
|
|
41
|
+
className: u("text-center", {
|
|
42
|
+
"w-75 mx-auto": !t,
|
|
43
|
+
"w-100": t,
|
|
44
|
+
"bg-main": e === "success",
|
|
45
|
+
"bg-danger": e === "error",
|
|
46
|
+
"bg-warning": e === "warning",
|
|
47
|
+
"text-white": e !== "warning"
|
|
48
|
+
}, s),
|
|
49
|
+
bodyClassName: u({ "p-2": t }),
|
|
50
|
+
children: r
|
|
51
51
|
}
|
|
52
|
-
),
|
|
53
|
-
const l =
|
|
54
|
-
"form-switch":
|
|
55
|
-
"form-checkbox":
|
|
56
|
-
},
|
|
57
|
-
return /* @__PURE__ */ i("span", { className:
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
52
|
+
), y = ({ checked: r = !1, onChange: e, className: s, children: t, type: a, inline: c = !1 }) => {
|
|
53
|
+
const l = O(), h = (m) => e == null ? void 0 : e(m.target.checked, m), d = {
|
|
54
|
+
"form-switch": a === "switch",
|
|
55
|
+
"form-checkbox": a === "checkbox"
|
|
56
|
+
}, o = c ? { display: "inline-block" } : {};
|
|
57
|
+
return /* @__PURE__ */ i("span", { className: u("form-check", d, s), style: o, children: [
|
|
58
|
+
/* @__PURE__ */ n("input", { type: "checkbox", className: "form-check-input", id: l, checked: r, onChange: h }),
|
|
59
|
+
/* @__PURE__ */ n("label", { className: "form-check-label", htmlFor: l, children: t })
|
|
60
60
|
] });
|
|
61
|
-
},
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
] }),
|
|
65
|
-
const d =
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
|
|
61
|
+
}, pe = (r) => /* @__PURE__ */ n(y, { type: "checkbox", ...r }), be = (r) => /* @__PURE__ */ n(y, { type: "switch", ...r }), B = ({ children: r, label: e, className: s = "", labelClassName: t = "", noMargin: a = !1, id: c }) => /* @__PURE__ */ i("div", { className: `${s} ${a ? "" : "mb-3"}`, children: [
|
|
62
|
+
/* @__PURE__ */ n("label", { className: `form-label ${t}`, htmlFor: c, children: e }),
|
|
63
|
+
r
|
|
64
|
+
] }), ge = ({ children: r, value: e, onChange: s, type: t, required: a, placeholder: c, className: l, labelClassName: h }) => {
|
|
65
|
+
const d = O();
|
|
66
|
+
return /* @__PURE__ */ n(B, { label: /* @__PURE__ */ i(f, { children: [
|
|
67
|
+
r,
|
|
68
68
|
":"
|
|
69
|
-
] }), className: l, labelClassName:
|
|
69
|
+
] }), className: l, labelClassName: h, id: d, children: /* @__PURE__ */ n(
|
|
70
70
|
"input",
|
|
71
71
|
{
|
|
72
72
|
id: d,
|
|
73
73
|
className: "form-control",
|
|
74
|
-
type:
|
|
75
|
-
value:
|
|
76
|
-
required:
|
|
74
|
+
type: t ?? "text",
|
|
75
|
+
value: e,
|
|
76
|
+
required: a ?? !0,
|
|
77
77
|
placeholder: c,
|
|
78
|
-
onChange: (
|
|
78
|
+
onChange: (o) => s(o.target.value)
|
|
79
79
|
}
|
|
80
80
|
) });
|
|
81
81
|
}, K = 500;
|
|
82
82
|
let p;
|
|
83
|
-
const
|
|
83
|
+
const _ = () => {
|
|
84
84
|
p !== null && clearTimeout(p), p = null;
|
|
85
|
-
},
|
|
86
|
-
const [l,
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
}, we = ({ onChange: r, className: e, large: s = !0, noBorder: t = !1, initialValue: a = "", setTimeout_: c = setTimeout }) => {
|
|
86
|
+
const [l, h] = x(a), d = (o, m = K) => {
|
|
87
|
+
h(o), _(), p = c(() => {
|
|
88
|
+
r(o), _();
|
|
89
89
|
}, m);
|
|
90
90
|
};
|
|
91
|
-
return /* @__PURE__ */ i("div", { className:
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ i("div", { className: u("search-field", e), children: [
|
|
92
|
+
/* @__PURE__ */ n(
|
|
93
93
|
"input",
|
|
94
94
|
{
|
|
95
95
|
type: "text",
|
|
96
|
-
className:
|
|
97
|
-
"form-control-lg":
|
|
98
|
-
"search-field__input--no-border":
|
|
96
|
+
className: u("form-control search-field__input", {
|
|
97
|
+
"form-control-lg": s,
|
|
98
|
+
"search-field__input--no-border": t
|
|
99
99
|
}),
|
|
100
100
|
placeholder: "Search...",
|
|
101
101
|
value: l,
|
|
102
|
-
onChange: (
|
|
102
|
+
onChange: (o) => d(o.target.value)
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ n(b, { icon: R, className: "search-field__icon" }),
|
|
106
|
+
/* @__PURE__ */ n(
|
|
107
107
|
"button",
|
|
108
108
|
{
|
|
109
109
|
"aria-label": "Clear search",
|
|
@@ -115,181 +115,160 @@ const O = () => {
|
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
] });
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
}, ee = (
|
|
122
|
-
const
|
|
123
|
-
return
|
|
124
|
-
if (
|
|
125
|
-
const c =
|
|
126
|
-
|
|
118
|
+
}, Ne = () => j(null), _e = () => {
|
|
119
|
+
const r = z();
|
|
120
|
+
return U(() => r(-1), [r]);
|
|
121
|
+
}, ee = (r) => {
|
|
122
|
+
const e = new URLSearchParams(r), s = {};
|
|
123
|
+
return e.forEach((t, a) => {
|
|
124
|
+
if (a.endsWith("[]")) {
|
|
125
|
+
const c = a.slice(0, -2);
|
|
126
|
+
s[c] ?? (s[c] = []), s[c].push(t);
|
|
127
127
|
} else
|
|
128
|
-
|
|
129
|
-
}),
|
|
130
|
-
},
|
|
131
|
-
const
|
|
132
|
-
for (const [
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
const { search:
|
|
137
|
-
return
|
|
128
|
+
s[a] = t;
|
|
129
|
+
}), s;
|
|
130
|
+
}, ve = (r) => {
|
|
131
|
+
const e = new URLSearchParams();
|
|
132
|
+
for (const [s, t] of Object.entries(r))
|
|
133
|
+
t !== void 0 && (Array.isArray(t) ? t.forEach((a) => e.append(`${s}[]`, `${a}`)) : e.append(s, `${t}`));
|
|
134
|
+
return e.toString();
|
|
135
|
+
}, ke = () => {
|
|
136
|
+
const { search: r } = J();
|
|
137
|
+
return q(() => ee(r), [r]);
|
|
138
138
|
}, re = ({
|
|
139
|
-
text:
|
|
140
|
-
disabled:
|
|
141
|
-
className:
|
|
142
|
-
children:
|
|
143
|
-
dropdownClassName:
|
|
139
|
+
text: r,
|
|
140
|
+
disabled: e = !1,
|
|
141
|
+
className: s,
|
|
142
|
+
children: t,
|
|
143
|
+
dropdownClassName: a,
|
|
144
144
|
noCaret: c,
|
|
145
145
|
end: l = !1,
|
|
146
|
-
minWidth:
|
|
146
|
+
minWidth: h,
|
|
147
147
|
inline: d,
|
|
148
|
-
size:
|
|
148
|
+
size: o,
|
|
149
149
|
...m
|
|
150
150
|
}) => {
|
|
151
|
-
const [
|
|
151
|
+
const [N, L] = T(), A = u("dropdown-btn__toggle", s, {
|
|
152
152
|
"btn-block": !d,
|
|
153
153
|
"dropdown-btn__toggle--with-caret": !c
|
|
154
|
-
}),
|
|
155
|
-
return /* @__PURE__ */ i(v, { isOpen:
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */
|
|
154
|
+
}), I = { minWidth: h && `${h}px` };
|
|
155
|
+
return /* @__PURE__ */ i(v, { isOpen: N, toggle: L, disabled: e, className: a, children: [
|
|
156
|
+
/* @__PURE__ */ n(k, { size: o, caret: !c, className: A, color: "primary", ...m, children: r }),
|
|
157
|
+
/* @__PURE__ */ n(C, { className: "w-100", end: l, style: I, children: N && t })
|
|
158
158
|
] });
|
|
159
|
-
},
|
|
159
|
+
}, Ce = ({ children: r, minWidth: e, label: s = "Options" }) => /* @__PURE__ */ n(
|
|
160
160
|
re,
|
|
161
161
|
{
|
|
162
|
-
text: /* @__PURE__ */
|
|
163
|
-
"aria-label":
|
|
162
|
+
text: /* @__PURE__ */ n(b, { className: "px-1", icon: D }),
|
|
163
|
+
"aria-label": s,
|
|
164
164
|
size: "sm",
|
|
165
|
-
minWidth:
|
|
165
|
+
minWidth: e,
|
|
166
166
|
end: !0,
|
|
167
167
|
noCaret: !0,
|
|
168
168
|
inline: !0,
|
|
169
|
-
children:
|
|
169
|
+
children: r
|
|
170
170
|
}
|
|
171
|
-
), te = ({ children:
|
|
172
|
-
if (!
|
|
171
|
+
), te = ({ children: r, ...e }) => /* @__PURE__ */ n($, { children: /* @__PURE__ */ n(F, { className: "nav-pills__nav-link", tag: X, ...e, children: r }) }), Oe = ({ children: r, fill: e = !1, className: s = "" }) => /* @__PURE__ */ n(w, { className: `nav-pills__nav p-0 overflow-hidden ${s}`, body: !0, children: /* @__PURE__ */ n(G, { pills: !0, fill: e, children: Q.map(r, (t) => {
|
|
172
|
+
if (!V(t) || t.type !== te)
|
|
173
173
|
throw new Error("Only NavPillItem children are allowed inside NavPills.");
|
|
174
|
-
return
|
|
174
|
+
return t;
|
|
175
175
|
}) }) });
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}[t] : "ASC";
|
|
181
|
-
}
|
|
182
|
-
function ne(e, r, t) {
|
|
183
|
-
return typeof e == "object" ? ne(e.currentField, e.newField, e.currentOrderDir) : {
|
|
184
|
-
field: r,
|
|
185
|
-
dir: C(e, r, t)
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
const xe = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
|
|
189
|
-
const c = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
|
|
190
|
-
return n[r] > o[r] ? c : l;
|
|
191
|
-
}), Te = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, ye = (e) => {
|
|
192
|
-
const [r, t] = e.split("-");
|
|
193
|
-
return { field: r, dir: t };
|
|
194
|
-
}, Le = (e) => {
|
|
195
|
-
const [r, t] = N(e), n = T((o, c) => t({ field: o, dir: c }), []);
|
|
196
|
-
return [r, n];
|
|
197
|
-
};
|
|
198
|
-
function Ie({ items: e, order: r, onChange: t, isButton: n = !0, right: o = !1, prefixed: c = !0 }) {
|
|
199
|
-
const [l, u] = y(), d = (a) => () => {
|
|
200
|
-
const m = C(a, r.field, r.dir);
|
|
201
|
-
t(m ? a : void 0, m);
|
|
176
|
+
function xe({ items: r, order: e, onChange: s, isButton: t = !0, right: a = !1, prefixed: c = !0 }) {
|
|
177
|
+
const [l, h] = T(), d = (o) => () => {
|
|
178
|
+
const m = W(o, e.field, e.dir);
|
|
179
|
+
s(m ? o : void 0, m);
|
|
202
180
|
};
|
|
203
|
-
return /* @__PURE__ */ i(v, { isOpen: l, toggle:
|
|
181
|
+
return /* @__PURE__ */ i(v, { isOpen: l, toggle: h, children: [
|
|
204
182
|
/* @__PURE__ */ i(
|
|
205
183
|
k,
|
|
206
184
|
{
|
|
207
185
|
caret: !0,
|
|
208
|
-
color:
|
|
209
|
-
className:
|
|
210
|
-
"dropdown-btn__toggle btn-block pe-4 overflow-hidden":
|
|
211
|
-
"btn-sm p-0": !
|
|
186
|
+
color: t ? "primary" : "link",
|
|
187
|
+
className: u({
|
|
188
|
+
"dropdown-btn__toggle btn-block pe-4 overflow-hidden": t,
|
|
189
|
+
"btn-sm p-0": !t
|
|
212
190
|
}),
|
|
213
191
|
children: [
|
|
214
|
-
!
|
|
215
|
-
|
|
216
|
-
|
|
192
|
+
!t && /* @__PURE__ */ n(f, { children: "Order by" }),
|
|
193
|
+
t && !e.field && /* @__PURE__ */ n("i", { children: "Order by..." }),
|
|
194
|
+
t && e.field && /* @__PURE__ */ i(f, { children: [
|
|
217
195
|
c && "Order by: ",
|
|
218
|
-
e
|
|
196
|
+
r[e.field],
|
|
219
197
|
" - ",
|
|
220
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ n("small", { children: e.dir ?? "DESC" })
|
|
221
199
|
] })
|
|
222
200
|
]
|
|
223
201
|
}
|
|
224
202
|
),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
Object.entries(
|
|
203
|
+
/* @__PURE__ */ n(C, { end: a, className: "w-100", style: t ? void 0 : { minWidth: "11rem" }, children: l && /* @__PURE__ */ i(f, { children: [
|
|
204
|
+
Object.entries(r).map(([o, m]) => /* @__PURE__ */ i(
|
|
227
205
|
g,
|
|
228
206
|
{
|
|
229
|
-
active:
|
|
230
|
-
onClick: d(
|
|
207
|
+
active: e.field === o,
|
|
208
|
+
onClick: d(o),
|
|
231
209
|
className: "d-flex justify-content-between align-items-center",
|
|
232
210
|
tabIndex: -1,
|
|
233
211
|
children: [
|
|
234
212
|
m,
|
|
235
|
-
|
|
213
|
+
e.field === o && /* @__PURE__ */ n(b, { icon: e.dir === "ASC" ? P : E })
|
|
236
214
|
]
|
|
237
215
|
},
|
|
238
|
-
|
|
216
|
+
o
|
|
239
217
|
)),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ n(g, { divider: !0, tag: "hr" }),
|
|
219
|
+
/* @__PURE__ */ n(g, { disabled: !e.field, onClick: () => s(), tabIndex: -1, children: /* @__PURE__ */ n("i", { children: "Clear selection" }) })
|
|
242
220
|
] }) })
|
|
243
221
|
] });
|
|
244
222
|
}
|
|
245
|
-
const
|
|
246
|
-
var r;
|
|
247
|
-
return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
|
|
248
|
-
}, He = () => {
|
|
223
|
+
const Te = "#4696e5", ye = "rgba(70, 150, 229, 0.4)", Le = "#f77f28", Ae = "rgba(247, 127, 40, 0.4)", Ie = "white", Se = "#161b22", se = (r) => {
|
|
249
224
|
var e;
|
|
250
|
-
return (
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
|
|
225
|
+
return (e = document.querySelector("html")) == null ? void 0 : e.setAttribute("data-theme", r);
|
|
226
|
+
}, Re = () => {
|
|
227
|
+
var r;
|
|
228
|
+
return ((r = document.querySelector("html")) == null ? void 0 : r.getAttribute("data-theme")) === "dark";
|
|
229
|
+
}, ne = (r = window.matchMedia.bind(window)) => r("(prefers-color-scheme: dark)").matches ? "dark" : "light", De = (r) => {
|
|
230
|
+
const [e, s] = x(() => r ?? ne());
|
|
231
|
+
return Y(() => {
|
|
232
|
+
se(e);
|
|
233
|
+
}, [e]), [e, s];
|
|
256
234
|
};
|
|
257
235
|
export {
|
|
258
|
-
|
|
236
|
+
pe as Checkbox,
|
|
259
237
|
re as DropdownBtn,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
238
|
+
Le as HIGHLIGHTED_COLOR,
|
|
239
|
+
Ae as HIGHLIGHTED_COLOR_ALPHA,
|
|
240
|
+
ge as InputFormGroup,
|
|
263
241
|
B as LabeledFormGroup,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
242
|
+
Te as MAIN_COLOR,
|
|
243
|
+
ye as MAIN_COLOR_ALPHA,
|
|
244
|
+
ue as Message,
|
|
267
245
|
te as NavPillItem,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
246
|
+
Oe as NavPills,
|
|
247
|
+
xe as OrderingDropdown,
|
|
248
|
+
Se as PRIMARY_DARK_COLOR,
|
|
249
|
+
Ie as PRIMARY_LIGHT_COLOR,
|
|
250
|
+
fe as Result,
|
|
251
|
+
Ce as RowDropdownBtn,
|
|
252
|
+
we as SearchField,
|
|
275
253
|
Z as SimpleCard,
|
|
276
|
-
|
|
254
|
+
be as ToggleSwitch,
|
|
277
255
|
se as changeThemeInMarkup,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
256
|
+
He as determineOrder,
|
|
257
|
+
W as determineOrderDir,
|
|
258
|
+
ne as getSystemPreferredTheme,
|
|
259
|
+
Re as isDarkThemeEnabled,
|
|
260
|
+
Me as orderToString,
|
|
283
261
|
ee as parseQueryString,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
262
|
+
$e as sortList,
|
|
263
|
+
Fe as stringToOrder,
|
|
264
|
+
ve as stringifyQueryParams,
|
|
265
|
+
Ge as useArrowKeyNavigation,
|
|
266
|
+
Ne as useElementRef,
|
|
288
267
|
_e as useGoBack,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
268
|
+
je as useOrder,
|
|
269
|
+
ke as useParsedQuery,
|
|
270
|
+
De as useTheme,
|
|
271
|
+
Ue as useTimeout,
|
|
272
|
+
qe as useTimeoutToggle,
|
|
273
|
+
T as useToggle
|
|
295
274
|
};
|