@shlinkio/shlink-frontend-kit 0.5.1 → 0.5.3
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.css +1 -1
- package/dist/index.d.ts +19 -4
- package/dist/index.js +136 -125
- package/dist/index.umd.cjs +1 -1
- package/package.json +25 -23
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@media (max-width: 991px){.responsive-table__header{display:none}}@media (max-width: 991px){.responsive-table.table>:not(:first-child){border:none}}@media (max-width: 991px){.responsive-table__row{display:block;border-bottom:1px solid var(--border-color);border-top:2px solid var(--border-color);position:relative}.responsive-table__row:not(:last-child){margin-bottom:10px}}.responsive-table__cell.responsive-table__cell{vertical-align:middle!important}@media (max-width: 991px){.responsive-table__cell.responsive-table__cell{display:block;width:100%;position:relative;padding:.5rem;font-size:.9rem}.responsive-table__cell.responsive-table__cell[data-th]:before{content:attr(data-th) ": ";font-weight:700}.responsive-table__cell.responsive-table__cell:last-child{position:absolute;top:3.5px;right:.5rem;width:auto;padding:0;border:none}}@media (max-width: 991px){.responsive-table__cell.responsive-table__cell .btn-sm{padding:.1rem .4rem;margin-top:.16rem}}html:not([data-theme=dark]){--color-scheme: initial;--primary-color: #ffffff;--primary-color-alfa: rgba(255, 255, 255, .5);--secondary-color: #f5f6fe;--text-color: #232323;--border-color: rgba(0, 0, 0, .125);--active-color: #eeeeee;--brand-color: #4696e5;--input-color: #ffffff;--input-disabled-color: #f5f6fe;--input-border-color: rgba(0, 0, 0, .19);--input-text-color: #495057;--table-border-color: #dee2e6;--table-highlight-color: rgba(0, 0, 0, .075);--btn-close-filter: initial}html[data-theme=dark]{--color-scheme: dark;--primary-color: #161b22;--primary-color-alfa: rgba(22, 27, 34, .8);--secondary-color: #0f131a;--text-color: rgb(201, 209, 217);--border-color: rgba(255, 255, 255, .15);--active-color: #0f131a;--brand-color: #0b2d4e;--input-color:
|
|
1
|
+
@media (max-width: 991px){.responsive-table__header{display:none}}@media (max-width: 991px){.responsive-table.table>:not(:first-child){border:none}}@media (max-width: 991px){.responsive-table__row{display:block;border-bottom:1px solid var(--border-color);border-top:2px solid var(--border-color);position:relative}.responsive-table__row:not(:last-child){margin-bottom:10px}}.responsive-table__cell.responsive-table__cell{vertical-align:middle!important}@media (max-width: 991px){.responsive-table__cell.responsive-table__cell{display:block;width:100%;position:relative;padding:.5rem;font-size:.9rem}.responsive-table__cell.responsive-table__cell[data-th]:before{content:attr(data-th) ": ";font-weight:700}.responsive-table__cell.responsive-table__cell:last-child{position:absolute;top:3.5px;right:.5rem;width:auto;padding:0;border:none}}@media (max-width: 991px){.responsive-table__cell.responsive-table__cell .btn-sm{padding:.1rem .4rem;margin-top:.16rem}}html:not([data-theme=dark]){--color-scheme: initial;--primary-color: #ffffff;--primary-color-alfa: rgba(255, 255, 255, .5);--secondary-color: #f5f6fe;--text-color: #232323;--border-color: rgba(0, 0, 0, .125);--active-color: #eeeeee;--brand-color: #4696e5;--input-color: #ffffff;--input-disabled-color: #f5f6fe;--input-border-color: rgba(0, 0, 0, .19);--input-text-color: #495057;--table-border-color: #dee2e6;--table-highlight-color: rgba(0, 0, 0, .075);--btn-close-filter: initial}html[data-theme=dark]{--color-scheme: dark;--primary-color: #161b22;--primary-color-alfa: rgba(22, 27, 34, .8);--secondary-color: #0f131a;--text-color: rgb(201, 209, 217);--border-color: rgba(255, 255, 255, .15);--active-color: #0f131a;--brand-color: #0b2d4e;--input-color: rgb(17.9928571429, 22.0821428571, 27.8071428571);--input-disabled-color: rgb(26.0071428571, 31.9178571429, 40.1928571429);--input-border-color: rgba(255, 255, 255, .15);--input-text-color: rgb(201, 209, 217);--table-border-color: #393d43;--table-highlight-color: rgba(255, 255, 255, .15);--btn-close-filter: invert(1)}:root{scroll-behavior:auto;color-scheme:var(--color-scheme)}html,body,#root{height:100%;background:var(--secondary-color);color:var(--text-color)}a,.btn-link{text-decoration:none}a:not(.nav-link):not(.navbar-brand):not(.page-link):not(.highlight-card):not(.btn):not(.dropdown-item):hover,.btn-link:hover{text-decoration:underline}.bg-main{background-color:#4696e5!important}.bg-warning{color:#232323}.card-body,.card-header,.list-group-item{background-color:transparent}.card-footer{background-color:var(--primary-color-alfa)}.card.card{box-shadow:0 .125rem .25rem #00000013;background-color:var(--primary-color);border-color:var(--border-color)}.list-group,.modal-content,.page-link,.page-item.disabled .page-link,.dropdown-menu{background-color:var(--primary-color)}.modal-header.modal-header,.modal-footer.modal-footer,.card-header.card-header,.card-footer.card-footer,.table.table thead th,.table.table th,.table.table td,.page-link.page-link,.page-link.page-link:hover,.page-item.page-item.disabled .page-link.page-link,.dropdown-divider.dropdown-divider,.dropdown-menu.dropdown-menu,.list-group-item.list-group-item,.modal-content.modal-content,hr{border-color:var(--border-color)}.table-bordered,.table-bordered thead th,.table-bordered thead td{border-color:var(--table-border-color)}.page-link:hover,.page-link:focus{background-color:var(--secondary-color)}.page-item.active .page-link{background-color:var(--brand-color);border-color:var(--brand-color)}.pagination .page-link{cursor:pointer}@media (min-width: 1200px){.container-xl{max-width:1320px}}@media (max-width: 767px){.container-xl{padding-right:0;padding-left:0}}.btn-block{display:block;width:100%}.btn-primary,.btn-primary:hover,.btn-primary:disabled,.btn-primary:active,.btn-primary:focus-visible,.btn-primary.active,.btn-outline-primary:hover,.btn-outline-primary:active.btn-outline-primary:active,.btn-outline-primary:focus-visible.btn-outline-primary:focus-visible,.btn-outline-primary.active.btn-outline-primary.active{color:#fff}.dropdown-item,.dropdown-item-text{color:var(--text-color)}.dropdown-item:not(:disabled){cursor:pointer}.dropdown-item:focus:not(:disabled),.dropdown-item:hover:not(:disabled),.dropdown-item.active:not(:disabled),.dropdown-item:active:not(:disabled){background-color:var(--active-color)!important;color:var(--text-color)!important}.dropdown-item--danger.dropdown-item--danger{color:#dc3545}.dropdown-item--danger.dropdown-item--danger:hover,.dropdown-item--danger.dropdown-item--danger:active,.dropdown-item--danger.dropdown-item--danger.active{color:#dc3545!important}.badge-main{color:#fff;background-color:var(--brand-color)}.close,.close:hover,.table,.table-hover>tbody>tr:hover>*,.table-hover>tbody>tr>*{color:var(--text-color)}.btn-close{filter:var(--btn-close-filter)}.table-hover tbody tr:hover{background-color:var(--secondary-color)}.form-control.form-control,.form-control.form-control:focus,.form-select.form-select,.form-select.form-select:focus{background-color:var(--primary-color);border-color:var(--input-border-color);color:var(--input-text-color)}.form-control.disabled,.form-control:disabled,.form-select.disabled,.form-select:disabled{background-color:var(--input-disabled-color);cursor:not-allowed}.card .form-control:not(:disabled),.card .form-control:not(:disabled):hover,.card .form-select:not(:disabled),.card .form-select:not(:disabled):hover,.modal .form-control:not(:disabled),.modal .form-control:not(:disabled):hover,.modal .form-select:not(:disabled),.modal .form-select:not(:disabled):hover{background-color:var(--input-color)}.card input[type=text]:not(:disabled),.dropdown input[type=text]:not(:disabled){background-color:var(--input-color)!important}.card input[type=date]:not(:disabled),.dropdown input[type=date]:not(:disabled){background-color:var(--input-color)!important}.card input[type=datetime-local]:not(:disabled),.dropdown input[type=datetime-local]:not(:disabled){background-color:var(--input-color)!important}.card input[type=password]:not(:disabled),.dropdown input[type=password]:not(:disabled){background-color:var(--input-color)!important}.card input[type=number]:not(:disabled),.dropdown input[type=number]:not(:disabled){background-color:var(--input-color)!important}.card input[type=email]:not(:disabled),.dropdown input[type=email]:not(:disabled){background-color:var(--input-color)!important}.card input[type=search]:not(:disabled),.dropdown input[type=search]:not(:disabled){background-color:var(--input-color)!important}.card input[type=url]:not(:disabled),.dropdown input[type=url]:not(:disabled){background-color:var(--input-color)!important}.input-group-text.input-group-text{border-color:var(--input-border-color)}.dropdown label{color:var(--text-color)!important}.table-active,.table-active>th,.table-active>td{background-color:var(--table-highlight-color)!important}@media (max-width: 767px){.navbar-brand{margin:0 auto!important}}.indivisible{white-space:nowrap}.pointer{cursor:pointer}.progress-bar{background-color:#4696e5}@media (max-width: 575px){.btn-xs-block{width:100%;display:block}}@media (max-width: 991px){.btn-md-block{width:100%;display:block}}@media (max-width: 767px){.btn-sm-block{width:100%;display:block}}.search-field{position:relative}.search-field:focus-within{z-index:1}.search-field__input.search-field__input{padding-left:40px;padding-right:40px}.search-field__input--no-border.search-field__input--no-border{border:none;border-radius:0}.search-field__icon{position:absolute;top:50%;transform:translateY(-50%);left:15px;color:#6c757d}.search-field__close{position:absolute;top:50%;transform:translateY(-50%);right:10px;cursor:pointer}.dropdown-btn__toggle.dropdown-btn__toggle{text-align:left}.dropdown-btn__toggle.dropdown-btn__toggle--with-caret{padding-right:1.75rem}.dropdown-btn__toggle.dropdown-btn__toggle,.dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled).active,.dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):active,.dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):focus,.dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):hover,.show>.dropdown-btn__toggle.dropdown-btn__toggle.dropdown-toggle{color:var(--input-text-color);background-color:var(--primary-color);border-color:var(--input-border-color)}.card .dropdown-btn__toggle.dropdown-btn__toggle,.card .dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled).active,.card .dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):active,.card .dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):focus,.card .dropdown-btn__toggle.dropdown-btn__toggle:not(:disabled):not(.disabled):hover,.show>.card .dropdown-btn__toggle.dropdown-btn__toggle.dropdown-toggle{background-color:var(--input-color)}.dropdown-btn__toggle.dropdown-btn__toggle.disabled,.dropdown-btn__toggle.dropdown-btn__toggle:disabled{background-color:var(--input-disabled-color)}.dropdown-btn__toggle.dropdown-btn__toggle:after{position:absolute;top:50%;transform:translateY(-50%);right:.75rem}.nav-pills__nav{position:sticky!important;top:55px;z-index:2}.nav-pills__nav-link.nav-pills__nav-link{border-radius:0!important;padding-bottom:calc(.5rem - 3px)!important;border-bottom:3px solid transparent!important;color:#5d6778;font-weight:700;cursor:pointer;text-decoration:none}@media (min-width: 576px) and (max-width: 991px){.nav-pills__nav-link.nav-pills__nav-link{font-size:89%}}.nav-pills__nav-link:hover{color:#4696e5!important}.nav-pills__nav-link.active{border-color:#4696e5!important;background-color:var(--primary-color)!important;color:#4696e5!important}.ordering-dropdown__menu--link.ordering-dropdown__menu--link{min-width:11rem}.ordering-dropdown__sort-icon{margin:3.5px 0 0;float:right}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { CardProps } from 'reactstrap';
|
|
4
2
|
import { ChangeEvent } from 'react';
|
|
5
3
|
import { DropdownToggleProps } from 'reactstrap/types/lib/DropdownToggle';
|
|
@@ -120,8 +118,15 @@ export declare type OrderingDropdownProps<T extends string = string> = {
|
|
|
120
118
|
|
|
121
119
|
export declare const orderToString: <T>(order: Order<T>) => string | undefined;
|
|
122
120
|
|
|
121
|
+
/** @deprecated Use parseQueryString instead */
|
|
123
122
|
export declare const parseQuery: <T>(search: string) => T;
|
|
124
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Parses provided query string into an object.
|
|
126
|
+
* Parameters ending with "[]" will be considered arrays and returned as a single prop with all values.
|
|
127
|
+
*/
|
|
128
|
+
export declare const parseQueryString: <T>(search: string) => T;
|
|
129
|
+
|
|
125
130
|
export declare const PRIMARY_DARK_COLOR = "#161b22";
|
|
126
131
|
|
|
127
132
|
export declare const PRIMARY_LIGHT_COLOR = "white";
|
|
@@ -158,7 +163,16 @@ export declare type SimpleCardProps = Omit<CardProps, 'title'> & {
|
|
|
158
163
|
|
|
159
164
|
export declare const sortList: <List>(list: List[], { field, dir }: Order<keyof List>) => List[];
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
/** @deprecated Use stringifyQueryParams instead */
|
|
167
|
+
export declare const stringifyQuery: (params: Record<string, unknown | unknown[] | undefined>) => string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Stringify an object of query parameters.
|
|
171
|
+
* Keys explicitly defined with undefined value will be skipped.
|
|
172
|
+
* Arrays will be appended multiple times with the "[]" suffix in the param name.
|
|
173
|
+
* All values are cast to string.
|
|
174
|
+
*/
|
|
175
|
+
export declare const stringifyQueryParams: (params: Record<string, unknown | unknown[] | undefined>) => string;
|
|
162
176
|
|
|
163
177
|
export declare const stringToOrder: <T>(order: string) => Order<T>;
|
|
164
178
|
|
|
@@ -170,6 +184,7 @@ declare type ToggleResult = [boolean, () => void, () => void, () => void];
|
|
|
170
184
|
|
|
171
185
|
export declare const ToggleSwitch: FC<BooleanControlProps>;
|
|
172
186
|
|
|
187
|
+
/** @deprecated Use standard useId() instead */
|
|
173
188
|
export declare const useDomId: () => string;
|
|
174
189
|
|
|
175
190
|
export declare const useElementRef: <T>() => MutableRefObject<T | null>;
|
|
@@ -178,7 +193,7 @@ export declare const useOrder: <T>(initialOrder: Order<T>) => [Order<T>, (orderF
|
|
|
178
193
|
|
|
179
194
|
export declare const useParsedQuery: <T>() => T;
|
|
180
195
|
|
|
181
|
-
export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number
|
|
196
|
+
export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof globalThis.setTimeout, clearTimeout?: ((id: number | undefined) => void) & typeof globalThis.clearTimeout) => [boolean, () => void];
|
|
182
197
|
|
|
183
198
|
export declare const useToggle: (initialValue?: boolean) => ToggleResult;
|
|
184
199
|
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { faCircleNotch as
|
|
3
|
-
import { FontAwesomeIcon as
|
|
1
|
+
import { jsx as s, jsxs as d, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { faCircleNotch as D, faSearch as E, faEllipsisV as P, faSortAmountUp as F, faSortAmountDown as H } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { clsx as m } from "clsx";
|
|
5
|
-
import { Row as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { useLocation as J, NavLink as
|
|
8
|
-
|
|
9
|
-
import y from "qs";
|
|
10
|
-
const W = (e) => ({
|
|
5
|
+
import { Row as T, Card as _, CardHeader as M, CardBody as $, Dropdown as G, DropdownToggle as O, DropdownMenu as S, NavItem as Q, NavLink as U, Nav as j, UncontrolledDropdown as q, DropdownItem as w } from "reactstrap";
|
|
6
|
+
import { useId as k, useState as b, useCallback as f, useRef as C, useMemo as V, Children as Y, isValidElement as z } from "react";
|
|
7
|
+
import { useLocation as J, NavLink as W } from "react-router-dom";
|
|
8
|
+
const X = (e) => ({
|
|
11
9
|
error: "border-danger",
|
|
12
10
|
default: ""
|
|
13
|
-
})[e],
|
|
11
|
+
})[e], Z = (e) => ({
|
|
14
12
|
error: "text-danger",
|
|
15
13
|
default: "text-muted"
|
|
16
|
-
})[e],
|
|
14
|
+
})[e], he = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: o = !1 }) => {
|
|
17
15
|
const c = m({
|
|
18
|
-
"col-md-12":
|
|
19
|
-
"col-md-10 offset-md-1": !
|
|
16
|
+
"col-md-12": o,
|
|
17
|
+
"col-md-10 offset-md-1": !o
|
|
20
18
|
});
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
t && /* @__PURE__ */
|
|
23
|
-
t && /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ s(T, { className: m("g-0", e), children: /* @__PURE__ */ s("div", { className: c, children: /* @__PURE__ */ s(_, { className: X(n), body: !0, children: /* @__PURE__ */ d("h3", { className: m("text-center mb-0", Z(n)), children: [
|
|
20
|
+
t && /* @__PURE__ */ s(g, { icon: D, spin: !0 }),
|
|
21
|
+
t && /* @__PURE__ */ s("span", { className: "ms-2", children: r ?? "Loading..." }),
|
|
24
22
|
!t && r
|
|
25
23
|
] }) }) }) });
|
|
26
|
-
},
|
|
27
|
-
e && /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
] }),
|
|
30
|
-
|
|
24
|
+
}, B = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ d(_, { ...n, children: [
|
|
25
|
+
e && /* @__PURE__ */ s(M, { role: "heading", "aria-level": 4, children: e }),
|
|
26
|
+
/* @__PURE__ */ s($, { className: t, children: r })
|
|
27
|
+
] }), fe = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ s(T, { className: t, children: /* @__PURE__ */ s("div", { className: m({ "col-md-10 offset-md-1": !n, "col-12": n }), children: /* @__PURE__ */ s(
|
|
28
|
+
B,
|
|
31
29
|
{
|
|
32
30
|
role: "document",
|
|
33
31
|
className: m("text-center", {
|
|
@@ -39,61 +37,47 @@ const W = (e) => ({
|
|
|
39
37
|
bodyClassName: m({ "p-2": n }),
|
|
40
38
|
children: e
|
|
41
39
|
}
|
|
42
|
-
) }) }),
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const [s, c] = w(e), l = g(e), a = g(), i = p(() => {
|
|
47
|
-
c(!l.current), a.current && n(a.current), a.current = t(() => c(l.current), r);
|
|
48
|
-
}, [n, r, t]);
|
|
49
|
-
return [s, i];
|
|
50
|
-
}, A = () => {
|
|
51
|
-
const { current: e } = g(`dom-${Z()}`);
|
|
52
|
-
return e;
|
|
53
|
-
}, Ce = () => g(null), _e = () => {
|
|
54
|
-
const { search: e } = J();
|
|
55
|
-
return V(() => ee(e), [e]);
|
|
56
|
-
}, S = ({ checked: e = !1, onChange: r, className: t, children: n, type: s, inline: c = !1 }) => {
|
|
57
|
-
const l = A(), a = (h) => r == null ? void 0 : r(h.target.checked, h), i = {
|
|
58
|
-
"form-switch": s === "switch",
|
|
59
|
-
"form-checkbox": s === "checkbox"
|
|
40
|
+
) }) }), A = ({ checked: e = !1, onChange: r, className: t, children: n, type: o, inline: c = !1 }) => {
|
|
41
|
+
const l = k(), a = (h) => r == null ? void 0 : r(h.target.checked, h), i = {
|
|
42
|
+
"form-switch": o === "switch",
|
|
43
|
+
"form-checkbox": o === "checkbox"
|
|
60
44
|
}, u = c ? { display: "inline-block" } : {};
|
|
61
45
|
return /* @__PURE__ */ d("span", { className: m("form-check", i, t), style: u, children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ s("input", { type: "checkbox", className: "form-check-input", id: l, checked: e, onChange: a }),
|
|
47
|
+
/* @__PURE__ */ s("label", { className: "form-check-label", htmlFor: l, children: n })
|
|
64
48
|
] });
|
|
65
|
-
},
|
|
66
|
-
/* @__PURE__ */
|
|
49
|
+
}, pe = (e) => /* @__PURE__ */ s(A, { type: "checkbox", ...e }), ge = (e) => /* @__PURE__ */ s(A, { type: "switch", ...e }), K = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: o = !1, id: c }) => /* @__PURE__ */ d("div", { className: `${t} ${o ? "" : "mb-3"}`, children: [
|
|
50
|
+
/* @__PURE__ */ s("label", { className: `form-label ${n}`, htmlFor: c, children: r }),
|
|
67
51
|
e
|
|
68
|
-
] }),
|
|
69
|
-
const i =
|
|
70
|
-
return /* @__PURE__ */
|
|
52
|
+
] }), be = ({ children: e, value: r, onChange: t, type: n, required: o, placeholder: c, className: l, labelClassName: a }) => {
|
|
53
|
+
const i = k();
|
|
54
|
+
return /* @__PURE__ */ s(K, { label: /* @__PURE__ */ d(N, { children: [
|
|
71
55
|
e,
|
|
72
56
|
":"
|
|
73
|
-
] }), className: l, labelClassName: a, id: i, children: /* @__PURE__ */
|
|
57
|
+
] }), className: l, labelClassName: a, id: i, children: /* @__PURE__ */ s(
|
|
74
58
|
"input",
|
|
75
59
|
{
|
|
76
60
|
id: i,
|
|
77
61
|
className: "form-control",
|
|
78
62
|
type: n ?? "text",
|
|
79
63
|
value: r,
|
|
80
|
-
required:
|
|
64
|
+
required: o ?? !0,
|
|
81
65
|
placeholder: c,
|
|
82
66
|
onChange: (u) => t(u.target.value)
|
|
83
67
|
}
|
|
84
68
|
) });
|
|
85
|
-
},
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
const [l, a] =
|
|
91
|
-
a(u),
|
|
92
|
-
e(u),
|
|
69
|
+
}, ee = 500;
|
|
70
|
+
let p;
|
|
71
|
+
const v = () => {
|
|
72
|
+
p !== null && clearTimeout(p), p = null;
|
|
73
|
+
}, we = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: o = "", setTimeout_: c = setTimeout }) => {
|
|
74
|
+
const [l, a] = b(o), i = (u, h = ee) => {
|
|
75
|
+
a(u), v(), p = c(() => {
|
|
76
|
+
e(u), v();
|
|
93
77
|
}, h);
|
|
94
78
|
};
|
|
95
79
|
return /* @__PURE__ */ d("div", { className: m("search-field", r), children: [
|
|
96
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ s(
|
|
97
81
|
"input",
|
|
98
82
|
{
|
|
99
83
|
type: "text",
|
|
@@ -106,8 +90,8 @@ const k = () => {
|
|
|
106
90
|
onChange: (u) => i(u.target.value)
|
|
107
91
|
}
|
|
108
92
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ s(g, { icon: E, className: "search-field__icon" }),
|
|
94
|
+
/* @__PURE__ */ s(
|
|
111
95
|
"button",
|
|
112
96
|
{
|
|
113
97
|
"aria-label": "Clear search",
|
|
@@ -119,12 +103,37 @@ const k = () => {
|
|
|
119
103
|
}
|
|
120
104
|
)
|
|
121
105
|
] });
|
|
122
|
-
},
|
|
106
|
+
}, y = (e) => {
|
|
107
|
+
const r = new URLSearchParams(e), t = {};
|
|
108
|
+
return r.forEach((n, o) => {
|
|
109
|
+
if (o.endsWith("[]")) {
|
|
110
|
+
const c = o.slice(0, -2);
|
|
111
|
+
t[c] ?? (t[c] = []), t[c].push(n);
|
|
112
|
+
} else
|
|
113
|
+
t[o] = n;
|
|
114
|
+
}), t;
|
|
115
|
+
}, re = (e) => {
|
|
116
|
+
const r = new URLSearchParams();
|
|
117
|
+
for (const [t, n] of Object.entries(e))
|
|
118
|
+
n !== void 0 && (Array.isArray(n) ? n.forEach((o) => r.append(`${t}[]`, `${o}`)) : r.append(t, `${n}`));
|
|
119
|
+
return r.toString();
|
|
120
|
+
}, Ne = y, Ce = re, te = (e = !1) => {
|
|
121
|
+
const [r, t] = b(e), n = f(() => t((l) => !l), []), o = f(() => t(!0), []), c = f(() => t(!1), []);
|
|
122
|
+
return [r, n, o, c];
|
|
123
|
+
}, _e = (e = !1, r = 2e3, t = window.setTimeout, n = window.clearTimeout) => {
|
|
124
|
+
const [o, c] = b(e), l = C(e), a = C(), i = f(() => {
|
|
125
|
+
c(!l.current), a.current && n(a.current), a.current = t(() => c(l.current), r);
|
|
126
|
+
}, [n, r, t]);
|
|
127
|
+
return [o, i];
|
|
128
|
+
}, ke = () => k(), ve = () => C(null), Te = () => {
|
|
129
|
+
const { search: e } = J();
|
|
130
|
+
return V(() => y(e), [e]);
|
|
131
|
+
}, ne = ({
|
|
123
132
|
text: e,
|
|
124
133
|
disabled: r = !1,
|
|
125
134
|
className: t,
|
|
126
135
|
children: n,
|
|
127
|
-
dropdownClassName:
|
|
136
|
+
dropdownClassName: o,
|
|
128
137
|
noCaret: c,
|
|
129
138
|
end: l = !1,
|
|
130
139
|
minWidth: a,
|
|
@@ -132,18 +141,18 @@ const k = () => {
|
|
|
132
141
|
size: u,
|
|
133
142
|
...h
|
|
134
143
|
}) => {
|
|
135
|
-
const [
|
|
144
|
+
const [L, R] = te(), x = m("dropdown-btn__toggle", t, {
|
|
136
145
|
"btn-block": !i,
|
|
137
146
|
"dropdown-btn__toggle--with-caret": !c
|
|
138
147
|
}), I = { minWidth: a && `${a}px` };
|
|
139
|
-
return /* @__PURE__ */ d(G, { isOpen:
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ d(G, { isOpen: L, toggle: R, disabled: r, className: o, children: [
|
|
149
|
+
/* @__PURE__ */ s(O, { size: u, caret: !c, className: x, color: "primary", ...h, children: e }),
|
|
150
|
+
/* @__PURE__ */ s(S, { className: "w-100", end: l, style: I, children: n })
|
|
142
151
|
] });
|
|
143
|
-
},
|
|
144
|
-
|
|
152
|
+
}, Oe = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ s(
|
|
153
|
+
ne,
|
|
145
154
|
{
|
|
146
|
-
text: /* @__PURE__ */
|
|
155
|
+
text: /* @__PURE__ */ s(g, { className: "px-1", icon: P }),
|
|
147
156
|
"aria-label": t,
|
|
148
157
|
size: "sm",
|
|
149
158
|
minWidth: r,
|
|
@@ -152,31 +161,31 @@ const k = () => {
|
|
|
152
161
|
inline: !0,
|
|
153
162
|
children: e
|
|
154
163
|
}
|
|
155
|
-
), se = ({ children: e, ...r }) => /* @__PURE__ */
|
|
164
|
+
), se = ({ children: e, ...r }) => /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(U, { className: "nav-pills__nav-link", tag: W, ...r, children: e }) }), Se = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ s(_, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ s(j, { pills: !0, fill: r, children: Y.map(e, (n) => {
|
|
156
165
|
if (!z(n) || n.type !== se)
|
|
157
166
|
throw new Error("Only NavPillItem children are allowed inside NavPills.");
|
|
158
167
|
return n;
|
|
159
|
-
}) }) }),
|
|
168
|
+
}) }) }), oe = (e, r, t) => e !== r ? "ASC" : t ? {
|
|
160
169
|
ASC: "DESC",
|
|
161
170
|
DESC: void 0
|
|
162
|
-
}[t] : "ASC",
|
|
171
|
+
}[t] : "ASC", Ae = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
|
|
163
172
|
const c = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
|
|
164
|
-
return n[r] >
|
|
165
|
-
}),
|
|
173
|
+
return n[r] > o[r] ? c : l;
|
|
174
|
+
}), ye = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Le = (e) => {
|
|
166
175
|
const [r, t] = e.split("-");
|
|
167
176
|
return { field: r, dir: t };
|
|
168
|
-
},
|
|
169
|
-
const [r, t] =
|
|
177
|
+
}, Re = (e) => {
|
|
178
|
+
const [r, t] = b(e), n = f((o, c) => t({ field: o, dir: c }), []);
|
|
170
179
|
return [r, n];
|
|
171
180
|
};
|
|
172
|
-
function
|
|
181
|
+
function xe({ items: e, order: r, onChange: t, isButton: n = !0, right: o = !1, prefixed: c = !0 }) {
|
|
173
182
|
const l = (a) => () => {
|
|
174
|
-
const i =
|
|
183
|
+
const i = oe(a, r.field, r.dir);
|
|
175
184
|
t(i ? a : void 0, i);
|
|
176
185
|
};
|
|
177
|
-
return /* @__PURE__ */ d(
|
|
186
|
+
return /* @__PURE__ */ d(q, { children: [
|
|
178
187
|
/* @__PURE__ */ d(
|
|
179
|
-
|
|
188
|
+
O,
|
|
180
189
|
{
|
|
181
190
|
caret: !0,
|
|
182
191
|
color: n ? "primary" : "link",
|
|
@@ -185,80 +194,82 @@ function Ie({ items: e, order: r, onChange: t, isButton: n = !0, right: s = !1,
|
|
|
185
194
|
"btn-sm p-0": !n
|
|
186
195
|
}),
|
|
187
196
|
children: [
|
|
188
|
-
!n && /* @__PURE__ */
|
|
189
|
-
n && !r.field && /* @__PURE__ */
|
|
190
|
-
n && r.field && /* @__PURE__ */ d(
|
|
197
|
+
!n && /* @__PURE__ */ s(N, { children: "Order by" }),
|
|
198
|
+
n && !r.field && /* @__PURE__ */ s("i", { children: "Order by..." }),
|
|
199
|
+
n && r.field && /* @__PURE__ */ d(N, { children: [
|
|
191
200
|
c && "Order by: ",
|
|
192
201
|
e[r.field],
|
|
193
202
|
" - ",
|
|
194
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ s("small", { children: r.dir ?? "DESC" })
|
|
195
204
|
] })
|
|
196
205
|
]
|
|
197
206
|
}
|
|
198
207
|
),
|
|
199
208
|
/* @__PURE__ */ d(
|
|
200
|
-
|
|
209
|
+
S,
|
|
201
210
|
{
|
|
202
|
-
end:
|
|
211
|
+
end: o,
|
|
203
212
|
className: m("w-100", { "ordering-dropdown__menu--link": !n }),
|
|
204
213
|
children: [
|
|
205
|
-
Object.entries(e).map(([a, i]) => /* @__PURE__ */ d(
|
|
214
|
+
Object.entries(e).map(([a, i]) => /* @__PURE__ */ d(w, { active: r.field === a, onClick: l(a), children: [
|
|
206
215
|
i,
|
|
207
|
-
r.field === a && /* @__PURE__ */
|
|
208
|
-
|
|
216
|
+
r.field === a && /* @__PURE__ */ s(
|
|
217
|
+
g,
|
|
209
218
|
{
|
|
210
|
-
icon: r.dir === "ASC" ?
|
|
219
|
+
icon: r.dir === "ASC" ? F : H,
|
|
211
220
|
className: "ordering-dropdown__sort-icon"
|
|
212
221
|
}
|
|
213
222
|
)
|
|
214
223
|
] }, a)),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ s(w, { divider: !0 }),
|
|
225
|
+
/* @__PURE__ */ s(w, { disabled: !r.field, onClick: () => t(), children: /* @__PURE__ */ s("i", { children: "Clear selection" }) })
|
|
217
226
|
]
|
|
218
227
|
}
|
|
219
228
|
)
|
|
220
229
|
] });
|
|
221
230
|
}
|
|
222
|
-
const
|
|
231
|
+
const Ie = "#4696e5", De = "rgba(70, 150, 229, 0.4)", Ee = "#f77f28", Pe = "rgba(247, 127, 40, 0.4)", Fe = "white", He = "#161b22", Me = (e) => {
|
|
223
232
|
var r;
|
|
224
233
|
return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
|
|
225
|
-
},
|
|
234
|
+
}, $e = () => {
|
|
226
235
|
var e;
|
|
227
236
|
return ((e = document.querySelector("html")) == null ? void 0 : e.getAttribute("data-theme")) === "dark";
|
|
228
|
-
},
|
|
237
|
+
}, Ge = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
229
238
|
export {
|
|
230
|
-
|
|
231
|
-
|
|
239
|
+
pe as Checkbox,
|
|
240
|
+
ne as DropdownBtn,
|
|
232
241
|
Ee as HIGHLIGHTED_COLOR,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
Pe as HIGHLIGHTED_COLOR_ALPHA,
|
|
243
|
+
be as InputFormGroup,
|
|
244
|
+
K as LabeledFormGroup,
|
|
245
|
+
Ie as MAIN_COLOR,
|
|
246
|
+
De as MAIN_COLOR_ALPHA,
|
|
247
|
+
he as Message,
|
|
239
248
|
se as NavPillItem,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
249
|
+
Se as NavPills,
|
|
250
|
+
xe as OrderingDropdown,
|
|
251
|
+
He as PRIMARY_DARK_COLOR,
|
|
252
|
+
Fe as PRIMARY_LIGHT_COLOR,
|
|
253
|
+
fe as Result,
|
|
254
|
+
Oe as RowDropdownBtn,
|
|
255
|
+
we as SearchField,
|
|
256
|
+
B as SimpleCard,
|
|
257
|
+
ge as ToggleSwitch,
|
|
258
|
+
Me as changeThemeInMarkup,
|
|
259
|
+
oe as determineOrderDir,
|
|
260
|
+
Ge as getSystemPreferredTheme,
|
|
261
|
+
$e as isDarkThemeEnabled,
|
|
262
|
+
ye as orderToString,
|
|
263
|
+
Ne as parseQuery,
|
|
264
|
+
y as parseQueryString,
|
|
265
|
+
Ae as sortList,
|
|
256
266
|
Le as stringToOrder,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
Ce as stringifyQuery,
|
|
268
|
+
re as stringifyQueryParams,
|
|
269
|
+
ke as useDomId,
|
|
270
|
+
ve as useElementRef,
|
|
271
|
+
Re as useOrder,
|
|
272
|
+
Te as useParsedQuery,
|
|
273
|
+
_e as useTimeoutToggle,
|
|
274
|
+
te as useToggle
|
|
264
275
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(o,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/react-fontawesome"),require("clsx"),require("reactstrap"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@fortawesome/free-solid-svg-icons","@fortawesome/react-fontawesome","clsx","reactstrap","react","react-router-dom"],s):(o=typeof globalThis<"u"?globalThis:o||self,s(o["shlink-frontend-kit"]={},o.jsxRuntime,o.freeSolidSvgIcons,o.reactFontawesome,o.clsx,o.reactstrap,o.react,o.reactRouterDom))})(this,function(o,s,w,b,f,d,i,T){"use strict";const S=e=>({error:"border-danger",default:""})[e],v=e=>({error:"text-danger",default:"text-muted"})[e],P=({className:e,children:r,loading:n=!1,type:c="default",fullWidth:l=!1})=>{const a=f.clsx({"col-md-12":l,"col-md-10 offset-md-1":!l});return s.jsx(d.Row,{className:f.clsx("g-0",e),children:s.jsx("div",{className:a,children:s.jsx(d.Card,{className:S(c),body:!0,children:s.jsxs("h3",{className:f.clsx("text-center mb-0",v(c)),children:[n&&s.jsx(b.FontAwesomeIcon,{icon:w.faCircleNotch,spin:!0}),n&&s.jsx("span",{className:"ms-2",children:r??"Loading..."}),!n&&r]})})})})},N=({title:e,children:r,bodyClassName:n,...c})=>s.jsxs(d.Card,{...c,children:[e&&s.jsx(d.CardHeader,{role:"heading","aria-level":4,children:e}),s.jsx(d.CardBody,{className:n,children:r})]}),E=({children:e,type:r,className:n,small:c=!1})=>s.jsx(d.Row,{className:n,children:s.jsx("div",{className:f.clsx({"col-md-10 offset-md-1":!c,"col-12":c}),children:s.jsx(N,{role:"document",className:f.clsx("text-center",{"bg-main":r==="success","bg-danger":r==="error","bg-warning":r==="warning","text-white":r!=="warning"}),bodyClassName:f.clsx({"p-2":c}),children:e})})}),O=({checked:e=!1,onChange:r,className:n,children:c,type:l,inline:a=!1})=>{const h=i.useId(),t=g=>r==null?void 0:r(g.target.checked,g),u={"form-switch":l==="switch","form-checkbox":l==="checkbox"},m=a?{display:"inline-block"}:{};return s.jsxs("span",{className:f.clsx("form-check",u,n),style:m,children:[s.jsx("input",{type:"checkbox",className:"form-check-input",id:h,checked:e,onChange:t}),s.jsx("label",{className:"form-check-label",htmlFor:h,children:c})]})},F=e=>s.jsx(O,{type:"checkbox",...e}),H=e=>s.jsx(O,{type:"switch",...e}),A=({children:e,label:r,className:n="",labelClassName:c="",noMargin:l=!1,id:a})=>s.jsxs("div",{className:`${n} ${l?"":"mb-3"}`,children:[s.jsx("label",{className:`form-label ${c}`,htmlFor:a,children:r}),e]}),M=({children:e,value:r,onChange:n,type:c,required:l,placeholder:a,className:h,labelClassName:t})=>{const u=i.useId();return s.jsx(A,{label:s.jsxs(s.Fragment,{children:[e,":"]}),className:h,labelClassName:t,id:u,children:s.jsx("input",{id:u,className:"form-control",type:c??"text",value:r,required:l??!0,placeholder:a,onChange:m=>n(m.target.value)})})};let C;const I=()=>{C!==null&&clearTimeout(C),C=null},G=({onChange:e,className:r,large:n=!0,noBorder:c=!1,initialValue:l="",setTimeout_:a=setTimeout})=>{const[h,t]=i.useState(l),u=(m,g=500)=>{t(m),I(),C=a(()=>{e(m),I()},g)};return s.jsxs("div",{className:f.clsx("search-field",r),children:[s.jsx("input",{type:"text",className:f.clsx("form-control search-field__input",{"form-control-lg":n,"search-field__input--no-border":c}),placeholder:"Search...",value:h,onChange:m=>u(m.target.value)}),s.jsx(b.FontAwesomeIcon,{icon:w.faSearch,className:"search-field__icon"}),s.jsx("button",{"aria-label":"Clear search",type:"button",className:"close search-field__close btn-close",hidden:h==="",id:"search-field__close",onClick:()=>u("",0)})]})},_=e=>{const r=new URLSearchParams(e),n={};return r.forEach((c,l)=>{if(l.endsWith("[]")){const a=l.slice(0,-2);n[a]??(n[a]=[]),n[a].push(c)}else n[l]=c}),n},k=e=>{const r=new URLSearchParams;for(const[n,c]of Object.entries(e))c!==void 0&&(Array.isArray(c)?c.forEach(l=>r.append(`${n}[]`,`${l}`)):r.append(n,`${c}`));return r.toString()},q=_,Q=k,p=(e=!1)=>{const[r,n]=i.useState(e),c=i.useCallback(()=>n(h=>!h),[]),l=i.useCallback(()=>n(!0),[]),a=i.useCallback(()=>n(!1),[]);return[r,c,l,a]},$=(e=!1,r=2e3,n=window.setTimeout,c=window.clearTimeout)=>{const[l,a]=i.useState(e),h=i.useRef(e),t=i.useRef(),u=i.useCallback(()=>{a(!h.current),t.current&&c(t.current),t.current=n(()=>a(h.current),r)},[c,r,n]);return[l,u]},U=()=>i.useId(),j=()=>i.useRef(null),V=()=>{const{search:e}=T.useLocation();return i.useMemo(()=>_(e),[e])},y=({text:e,disabled:r=!1,className:n,children:c,dropdownClassName:l,noCaret:a,end:h=!1,minWidth:t,inline:u,size:m,...g})=>{const[le,ae]=p(),te=f.clsx("dropdown-btn__toggle",n,{"btn-block":!u,"dropdown-btn__toggle--with-caret":!a}),de={minWidth:t&&`${t}px`};return s.jsxs(d.Dropdown,{isOpen:le,toggle:ae,disabled:r,className:l,children:[s.jsx(d.DropdownToggle,{size:m,caret:!a,className:te,color:"primary",...g,children:e}),s.jsx(d.DropdownMenu,{className:"w-100",end:h,style:de,children:c})]})},Y=({children:e,minWidth:r,label:n="Options"})=>s.jsx(y,{text:s.jsx(b.FontAwesomeIcon,{className:"px-1",icon:w.faEllipsisV}),"aria-label":n,size:"sm",minWidth:r,end:!0,noCaret:!0,inline:!0,children:e}),L=({children:e,...r})=>s.jsx(d.NavItem,{children:s.jsx(d.NavLink,{className:"nav-pills__nav-link",tag:T.NavLink,...r,children:e})}),z=({children:e,fill:r=!1,className:n=""})=>s.jsx(d.Card,{className:`nav-pills__nav p-0 overflow-hidden ${n}`,body:!0,children:s.jsx(d.Nav,{pills:!0,fill:r,children:i.Children.map(e,c=>{if(!i.isValidElement(c)||c.type!==L)throw new Error("Only NavPillItem children are allowed inside NavPills.");return c})})}),D=(e,r,n)=>e!==r?"ASC":n?{ASC:"DESC",DESC:void 0}[n]:"ASC",B=(e,{field:r,dir:n})=>!r||!n?e:e.sort((c,l)=>{const a=n==="ASC"?1:-1,h=n==="ASC"?-1:1;return c[r]>l[r]?a:h}),J=e=>e.dir?`${e.field}-${e.dir}`:void 0,W=e=>{const[r,n]=e.split("-");return{field:r,dir:n}},X=e=>{const[r,n]=i.useState(e),c=i.useCallback((l,a)=>n({field:l,dir:a}),[]);return[r,c]};function Z({items:e,order:r,onChange:n,isButton:c=!0,right:l=!1,prefixed:a=!0}){const h=t=>()=>{const u=D(t,r.field,r.dir);n(u?t:void 0,u)};return s.jsxs(d.UncontrolledDropdown,{children:[s.jsxs(d.DropdownToggle,{caret:!0,color:c?"primary":"link",className:f.clsx({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":c,"btn-sm p-0":!c}),children:[!c&&s.jsx(s.Fragment,{children:"Order by"}),c&&!r.field&&s.jsx("i",{children:"Order by..."}),c&&r.field&&s.jsxs(s.Fragment,{children:[a&&"Order by: ",e[r.field]," - ",s.jsx("small",{children:r.dir??"DESC"})]})]}),s.jsxs(d.DropdownMenu,{end:l,className:f.clsx("w-100",{"ordering-dropdown__menu--link":!c}),children:[Object.entries(e).map(([t,u])=>s.jsxs(d.DropdownItem,{active:r.field===t,onClick:h(t),children:[u,r.field===t&&s.jsx(b.FontAwesomeIcon,{icon:r.dir==="ASC"?w.faSortAmountUp:w.faSortAmountDown,className:"ordering-dropdown__sort-icon"})]},t)),s.jsx(d.DropdownItem,{divider:!0}),s.jsx(d.DropdownItem,{disabled:!r.field,onClick:()=>n(),children:s.jsx("i",{children:"Clear selection"})})]})]})}const K="#4696e5",R="rgba(70, 150, 229, 0.4)",x="#f77f28",ee="rgba(247, 127, 40, 0.4)",re="white",se="#161b22",ne=e=>{var r;return(r=document.querySelector("html"))==null?void 0:r.setAttribute("data-theme",e)},oe=()=>{var e;return((e=document.querySelector("html"))==null?void 0:e.getAttribute("data-theme"))==="dark"},ce=(e=window.matchMedia.bind(window))=>e("(prefers-color-scheme: dark)").matches?"dark":"light";o.Checkbox=F,o.DropdownBtn=y,o.HIGHLIGHTED_COLOR=x,o.HIGHLIGHTED_COLOR_ALPHA=ee,o.InputFormGroup=M,o.LabeledFormGroup=A,o.MAIN_COLOR=K,o.MAIN_COLOR_ALPHA=R,o.Message=P,o.NavPillItem=L,o.NavPills=z,o.OrderingDropdown=Z,o.PRIMARY_DARK_COLOR=se,o.PRIMARY_LIGHT_COLOR=re,o.Result=E,o.RowDropdownBtn=Y,o.SearchField=G,o.SimpleCard=N,o.ToggleSwitch=H,o.changeThemeInMarkup=ne,o.determineOrderDir=D,o.getSystemPreferredTheme=ce,o.isDarkThemeEnabled=oe,o.orderToString=J,o.parseQuery=q,o.parseQueryString=_,o.sortList=B,o.stringToOrder=W,o.stringifyQuery=Q,o.stringifyQueryParams=k,o.useDomId=U,o.useElementRef=j,o.useOrder=X,o.useParsedQuery=V,o.useTimeoutToggle=$,o.useToggle=p,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test:ci": "npm run test -- --coverage",
|
|
24
24
|
"lint": "npm run lint:css && npm run lint:js",
|
|
25
25
|
"lint:css": "stylelint src/*.scss src/**/*.scss dev/*.scss dev/**/*.scss",
|
|
26
|
-
"lint:js": "eslint
|
|
26
|
+
"lint:js": "eslint dev src test",
|
|
27
27
|
"lint:fix": "npm run lint:css:fix && npm run lint:js:fix",
|
|
28
28
|
"lint:css:fix": "npm run lint:css -- --fix",
|
|
29
29
|
"lint:js:fix": "npm run lint:js -- --fix",
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
"dev": "vite serve --host=0.0.0.0 --port 3001"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"clsx": "^2.1.
|
|
35
|
-
"qs": "^6.12.1",
|
|
36
|
-
"uuid": "^9.0.1"
|
|
34
|
+
"clsx": "^2.1.1"
|
|
37
35
|
},
|
|
38
36
|
"peerDependencies": {
|
|
39
37
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
@@ -45,32 +43,36 @@
|
|
|
45
43
|
"reactstrap": "^9.2.0"
|
|
46
44
|
},
|
|
47
45
|
"devDependencies": {
|
|
48
|
-
"@shlinkio/eslint-config-js-coding-standard": "~
|
|
46
|
+
"@shlinkio/eslint-config-js-coding-standard": "~3.1.0",
|
|
49
47
|
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
|
|
50
|
-
"@
|
|
51
|
-
"@testing-library/
|
|
48
|
+
"@stylistic/eslint-plugin": "^2.8.0",
|
|
49
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
50
|
+
"@testing-library/react": "^16.0.1",
|
|
52
51
|
"@testing-library/user-event": "^14.5.2",
|
|
53
52
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
54
|
-
"@types/qs": "^6.9.
|
|
55
|
-
"@types/react": "^18.
|
|
56
|
-
"@types/react-dom": "^18.
|
|
57
|
-
"@types/uuid": "^
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"@vitest/coverage-v8": "^1.5.0",
|
|
62
|
-
"axe-core": "^4.9.0",
|
|
53
|
+
"@types/qs": "^6.9.16",
|
|
54
|
+
"@types/react": "^18.3.10",
|
|
55
|
+
"@types/react-dom": "^18.3.0",
|
|
56
|
+
"@types/uuid": "^10.0.0",
|
|
57
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
58
|
+
"@vitest/coverage-v8": "^2.1.1",
|
|
59
|
+
"axe-core": "^4.10.0",
|
|
63
60
|
"bootstrap": "5.2.3",
|
|
64
61
|
"eslint": "^8.57.0",
|
|
62
|
+
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
63
|
+
"eslint-plugin-react": "^7.37.0",
|
|
64
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
65
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
65
66
|
"history": "^5.3.0",
|
|
66
|
-
"jsdom": "^
|
|
67
|
+
"jsdom": "^25.0.1",
|
|
67
68
|
"resize-observer-polyfill": "^1.5.1",
|
|
68
|
-
"sass": "^1.
|
|
69
|
+
"sass": "^1.79.4",
|
|
69
70
|
"stylelint": "^15.11.0",
|
|
70
|
-
"typescript": "^5.
|
|
71
|
-
"
|
|
72
|
-
"vite
|
|
73
|
-
"
|
|
71
|
+
"typescript": "^5.6.2",
|
|
72
|
+
"typescript-eslint": "^8.7.0",
|
|
73
|
+
"vite": "^5.4.8",
|
|
74
|
+
"vite-plugin-dts": "^4.2.2",
|
|
75
|
+
"vitest": "^2.0.2"
|
|
74
76
|
},
|
|
75
77
|
"browserslist": [
|
|
76
78
|
">0.2%",
|
|
@@ -78,5 +80,5 @@
|
|
|
78
80
|
"not ie <= 11",
|
|
79
81
|
"not op_mini all"
|
|
80
82
|
],
|
|
81
|
-
"version": "0.5.
|
|
83
|
+
"version": "0.5.3"
|
|
82
84
|
}
|