@alphakits/ui 2.3.0 → 2.4.0
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/__internal/utils/index.d.ts +1 -1
- package/dist/__internal/utils/index.js +4 -4
- package/dist/amount-input/component.js +41 -41
- package/dist/avatar/component.js +2 -18
- package/dist/badge/component.d.ts +1 -1
- package/dist/base-card/component.js +1 -7
- package/dist/bottom-sheet/component.d.ts +1 -1
- package/dist/bottom-sheet/component.js +9 -13
- package/dist/box/component.d.ts +2 -2
- package/dist/box/component.js +4 -4
- package/dist/button/component.js +9 -9
- package/dist/button-arrow/component.js +6 -1
- package/dist/calendar/component.d.ts +1 -2
- package/dist/calendar/component.js +77 -74
- package/dist/calendar/components/days-table/component.js +46 -43
- package/dist/calendar/components/header/{/321/201omponent.js → component.js} +3 -12
- package/dist/calendar/components/header/index.d.ts +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/months-table/{/321/201omponent.js → component.js} +7 -7
- package/dist/calendar/components/months-table/index.d.ts +1 -1
- package/dist/calendar/components/months-table/index.js +1 -1
- package/dist/calendar/components/select-button/{/321/201omponent.d.ts → component.d.ts} +3 -3
- package/dist/calendar/components/select-button/{/321/201omponent.js → component.js} +5 -11
- package/dist/calendar/components/select-button/index.d.ts +1 -1
- package/dist/calendar/components/select-button/index.js +1 -1
- package/dist/calendar/components/years-table/{/321/201omponent.js → component.js} +14 -14
- package/dist/calendar/components/years-table/index.d.ts +1 -1
- package/dist/calendar/components/years-table/index.js +1 -1
- package/dist/calendar/index.d.ts +2 -2
- package/dist/calendar/index.js +4 -4
- package/dist/calendar/use-calendar.js +51 -47
- package/dist/calendar/utils.js +7 -9
- package/dist/calendar-input/component.js +22 -22
- package/dist/card/component.js +2 -18
- package/dist/cell/base/component.js +31 -31
- package/dist/cell/pure/component.js +2 -2
- package/dist/checkbox/component.js +11 -11
- package/dist/checkbox-group/component.js +23 -24
- package/dist/checkbox-lists/component.d.ts +1 -2
- package/dist/checkbox-lists/component.js +59 -61
- package/dist/collapsable-row/addons.d.ts +3 -4
- package/dist/collapsable-row/addons.js +6 -9
- package/dist/collapsable-row/component.d.ts +1 -1
- package/dist/collapsable-row/component.js +7 -7
- package/dist/collapse/component.js +45 -54
- package/dist/copy-button/component.d.ts +1 -2
- package/dist/copy-button/component.js +1 -5
- package/dist/date/component.js +1 -1
- package/dist/date-switcher/component.d.ts +1 -2
- package/dist/date-switcher/component.js +8 -8
- package/dist/decorated-item/component.js +10 -20
- package/dist/dot/component.js +1 -4
- package/dist/empty-page/component.js +1 -9
- package/dist/filter-tag/component.d.ts +1 -1
- package/dist/flex/component.d.ts +2 -2
- package/dist/footer/component.js +57 -53
- package/dist/form/component.d.ts +1 -2
- package/dist/form/component.js +2 -12
- package/dist/form/templates/base-form/index.d.ts +3 -3
- package/dist/form/templates/base-form/index.js +26 -26
- package/dist/form/templates/filters-form/index.d.ts +1 -1
- package/dist/form/templates/filters-form/index.js +20 -23
- package/dist/form/templates/rest-form/form.d.ts +1 -2
- package/dist/form/templates/rest-form/form.js +51 -56
- package/dist/form/templates/rest-form/index.d.ts +3 -3
- package/dist/form/templates/rest-form/index.js +16 -27
- package/dist/form/utils/get-default-values.js +3 -6
- package/dist/form/utils/remove-undefined-from-object.js +1 -3
- package/dist/form-control/component.js +1 -1
- package/dist/formik/index.d.ts +2 -2
- package/dist/header-search/component.js +1 -6
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +10 -10
- package/dist/hooks/use-get-one/index.js +16 -16
- package/dist/icon-button/component.d.ts +3 -3
- package/dist/icon-button/component.js +2 -8
- package/dist/image/component.js +52 -30
- package/dist/image/image-base.js +1 -7
- package/dist/image/use-image-render-component.d.ts +1 -1
- package/dist/image/use-image-render-component.js +11 -14
- package/dist/image-gallery/component.js +40 -45
- package/dist/image-uploader/component.js +56 -53
- package/dist/index.js +41 -41
- package/dist/info-block-wrapper/component.d.ts +1 -1
- package/dist/input/component.js +1 -1
- package/dist/input-autocomplete/autocomplete-field/index.d.ts +1 -2
- package/dist/input-autocomplete/autocomplete-field/index.js +6 -6
- package/dist/input-autocomplete/component.d.ts +26 -26
- package/dist/input-ghost/component.d.ts +1 -1
- package/dist/link/component.d.ts +2 -2
- package/dist/link/component.js +1 -1
- package/dist/loader/component.js +6 -5
- package/dist/masked-input/component.js +7 -16
- package/dist/menu/component.js +12 -17
- package/dist/menu/components/content-header/index.js +1 -9
- package/dist/menu/components/menu-avatar/index.js +1 -6
- package/dist/menu/components/menu-button/index.js +1 -10
- package/dist/menu/components/menu-buttons-list/index.d.ts +1 -1
- package/dist/menu/components/menu-buttons-list/index.js +1 -7
- package/dist/menu/hooks/use-menu.js +12 -12
- package/dist/message/component.js +33 -14
- package/dist/modal/components/modals/modal.d.ts +1 -2
- package/dist/modal/components/modals/modal.js +30 -33
- package/dist/modal/context.js +12 -9
- package/dist/modal/hooks/use-modal.d.ts +1 -1
- package/dist/mq/component.js +1 -6
- package/dist/notification/component.js +14 -12
- package/dist/page-container/component.js +1 -6
- package/dist/page-loading/component.d.ts +1 -2
- package/dist/page-with-controls/component.js +4 -7
- package/dist/picker-button/common/labeled-button/index.js +18 -12
- package/dist/picker-button/component.js +5 -5
- package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
- package/dist/picker-button/field/index.d.ts +1 -1
- package/dist/picker-button/field/index.js +1 -1
- package/dist/picker-button/index.d.ts +1 -1
- package/dist/picker-button/index.js +4 -4
- package/dist/popover/component.d.ts +2 -2
- package/dist/popover/component.js +69 -63
- package/dist/radio/component.js +7 -7
- package/dist/radio-groups/component.d.ts +1 -2
- package/dist/radio-groups/component.js +9 -7
- package/dist/select/component.d.ts +8 -9
- package/dist/select/component.js +1 -9
- package/dist/select/components/arrow/component.d.ts +1 -2
- package/dist/select/components/base-select/component.js +97 -90
- package/dist/select/components/checkmark/component.d.ts +1 -2
- package/dist/select/components/field/component.d.ts +1 -2
- package/dist/select/components/field/component.js +8 -5
- package/dist/select/components/native-select/component.js +4 -11
- package/dist/select/components/optgroup/component.d.ts +1 -2
- package/dist/select/components/optgroup/component.js +4 -4
- package/dist/select/components/option/component.js +1 -1
- package/dist/select/components/options-list/component.d.ts +1 -2
- package/dist/select/components/options-list/component.js +25 -23
- package/dist/select/components/select-search/index.d.ts +1 -1
- package/dist/select/components/select-search/index.js +28 -26
- package/dist/select/components/virtual-options-list/component.d.ts +1 -2
- package/dist/select/components/virtual-options-list/component.js +52 -45
- package/dist/select/index.js +4 -4
- package/dist/select/presets/index.d.ts +1 -1
- package/dist/select/presets/index.js +4 -4
- package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
- package/dist/select/presets/use-lazy-loading/index.js +45 -43
- package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
- package/dist/select/presets/use-select-with-loading/hook.js +8 -1
- package/dist/select/utils.js +32 -32
- package/dist/sidepanel/component.js +21 -15
- package/dist/sidepanel-header/component.js +17 -16
- package/dist/skeleton/component.js +4 -4
- package/dist/space/component.d.ts +2 -2
- package/dist/space/component.js +42 -45
- package/dist/space/{Item.d.ts → item.d.ts} +2 -2
- package/dist/spinner/component.js +6 -5
- package/dist/stack/index.d.ts +1 -1
- package/dist/stack/index.js +5 -5
- package/dist/stepped-progress-bar/components/step-bar.js +3 -3
- package/dist/stepped-progress-bar/index.d.ts +2 -2
- package/dist/stepped-progress-bar/index.js +37 -22
- package/dist/sticker/component.js +1 -17
- package/dist/suffix-input/component.js +13 -13
- package/dist/switch/component.js +7 -7
- package/dist/table/components/cells/index.d.ts +1 -2
- package/dist/table/components/empty-list/index.d.ts +1 -2
- package/dist/table/components/error/index.d.ts +2 -3
- package/dist/table/components/error/index.js +1 -1
- package/dist/table/components/loading/index.d.ts +1 -1
- package/dist/table/components/loading/index.js +18 -12
- package/dist/table/components/pagination/index.js +56 -53
- package/dist/table/components/table-header/index.js +59 -56
- package/dist/table/hooks/use-table-data.js +63 -60
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +73 -73
- package/dist/table/types.d.ts +3 -3
- package/dist/table/utils/get-query-from-url.js +1 -8
- package/dist/table/utils/get-tags.d.ts +1 -1
- package/dist/table/utils/get-tags.js +9 -12
- package/dist/table/utils/index.d.ts +1 -1
- package/dist/table/utils/index.js +4 -4
- package/dist/table/utils/parse-query-params.js +5 -1
- package/dist/table/utils/prepare-rows.d.ts +1 -2
- package/dist/table/utils/prepare-rows.js +4 -3
- package/dist/table/utils/query-adapter.d.ts +1 -1
- package/dist/table/utils/query-adapter.js +5 -5
- package/dist/table/utils/remove-query-param.js +3 -1
- package/dist/table/utils/reset-query-param.js +16 -9
- package/dist/table-status/component.js +5 -1
- package/dist/textarea/component.js +36 -28
- package/dist/theme-provider/component.js +33 -29
- package/dist/toast/component.d.ts +7 -8
- package/dist/toast/component.js +65 -63
- package/dist/toast-notifier/component.js +13 -13
- package/dist/toast-notifier/use-timer.d.ts +1 -1
- package/dist/toast-notifier/use-timer.js +5 -5
- package/dist/toast-plate/component.d.ts +3 -3
- package/dist/toast-plate/component.js +7 -7
- package/dist/tooltip/component.js +35 -35
- package/dist/tooltip/node-resolver.js +7 -7
- package/dist/typings/api.d.ts +3 -5
- package/dist/typography/colors.d.ts +1 -1
- package/dist/typography/title/component.d.ts +3 -3
- package/dist/typography/title/index.d.ts +1 -1
- package/dist/typography/title/index.js +3 -3
- package/dist/utils/date/index.js +12 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +14 -14
- package/dist/utils/split-amount/util.js +4 -4
- package/dist/with-suffix/component.d.ts +13 -13
- package/dist/with-suffix/component.js +8 -8
- package/package.json +9 -34
- /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
- /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
- /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/picker-button/field/{Component.js → component.js} +0 -0
- /package/dist/space/{Item.js → item.js} +0 -0
package/dist/table/table.js
CHANGED
|
@@ -1,133 +1,133 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import X, { useMemo as E, useCallback as Y } from "react";
|
|
3
2
|
import P from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { prepareRows as sa } from "./utils/prepare-rows.js";
|
|
3
|
+
import { useMemo as j, useCallback as U } from "react";
|
|
4
|
+
import { Cells as W } from "./components/cells/index.js";
|
|
5
|
+
import { EmptyList as X } from "./components/empty-list/index.js";
|
|
6
|
+
import { TableError as Y } from "./components/error/index.js";
|
|
7
|
+
import { Loading as Z } from "./components/loading/index.js";
|
|
8
|
+
import { Pagination as $ } from "./components/pagination/index.js";
|
|
9
|
+
import { TableHeader as A } from "./components/table-header/index.js";
|
|
10
|
+
import { useTableData as aa } from "./hooks/use-table-data.js";
|
|
13
11
|
import o from "./index.module.css.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
import { getTags as ta } from "./utils/get-tags.js";
|
|
13
|
+
import { prepareRows as ra } from "./utils/prepare-rows.js";
|
|
14
|
+
function ha({
|
|
15
|
+
columns: l,
|
|
16
|
+
searchPlaceholder: E = "Поиск по таблице",
|
|
17
|
+
records: H,
|
|
18
|
+
hideSearch: b,
|
|
19
|
+
rightHeaderAddons: h,
|
|
20
20
|
leftHeaderAddons: g,
|
|
21
|
-
filtersButtonLabel:
|
|
22
|
-
createButtonLabel:
|
|
23
|
-
loading:
|
|
24
|
-
height:
|
|
21
|
+
filtersButtonLabel: S,
|
|
22
|
+
createButtonLabel: _,
|
|
23
|
+
loading: w,
|
|
24
|
+
height: B = "fill",
|
|
25
25
|
view: e = "default",
|
|
26
|
-
tagsBuilder:
|
|
26
|
+
tagsBuilder: F,
|
|
27
27
|
promise: u,
|
|
28
|
-
onRowClick:
|
|
29
|
-
onCreateClick:
|
|
30
|
-
onFiltersClick:
|
|
31
|
-
refetch:
|
|
28
|
+
onRowClick: T,
|
|
29
|
+
onCreateClick: n,
|
|
30
|
+
onFiltersClick: m,
|
|
31
|
+
refetch: C,
|
|
32
32
|
language: i,
|
|
33
|
-
fromPath:
|
|
33
|
+
fromPath: M = !0
|
|
34
34
|
}) {
|
|
35
35
|
const {
|
|
36
|
-
loading:
|
|
37
|
-
error:
|
|
38
|
-
data:
|
|
36
|
+
loading: R,
|
|
37
|
+
error: x,
|
|
38
|
+
data: y,
|
|
39
39
|
total: V,
|
|
40
40
|
params: t,
|
|
41
41
|
pagesCount: q,
|
|
42
|
-
updateData:
|
|
42
|
+
updateData: c,
|
|
43
43
|
addParam: z,
|
|
44
44
|
removeParam: G,
|
|
45
|
-
resetParams:
|
|
46
|
-
} =
|
|
45
|
+
resetParams: L
|
|
46
|
+
} = aa({
|
|
47
47
|
promise: u,
|
|
48
|
-
records:
|
|
49
|
-
fromPath:
|
|
50
|
-
}),
|
|
51
|
-
() => [...
|
|
48
|
+
records: H,
|
|
49
|
+
fromPath: M
|
|
50
|
+
}), k = j(
|
|
51
|
+
() => [...y || []].sort(
|
|
52
52
|
(a, s) => (a.sortPosition || 0) - (s.sortPosition || 0)
|
|
53
53
|
),
|
|
54
|
-
[
|
|
55
|
-
), I = (a) =>
|
|
54
|
+
[y]
|
|
55
|
+
), I = (a) => T?.(a, c), J = n ? () => n(c) : void 0, K = U(
|
|
56
56
|
(a) => {
|
|
57
|
-
|
|
57
|
+
L(a);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
59
|
+
[L]
|
|
60
|
+
), v = () => m ? m({
|
|
61
61
|
submitCallback: (a) => K(a),
|
|
62
62
|
initialValues: t
|
|
63
63
|
}) : null, d = (a) => {
|
|
64
64
|
z(a);
|
|
65
65
|
}, O = (a, s) => {
|
|
66
66
|
G(a, s);
|
|
67
|
-
}, Q =
|
|
67
|
+
}, Q = ta({
|
|
68
68
|
params: t?.where || {},
|
|
69
69
|
onDelete: O,
|
|
70
|
-
tagsBuilder:
|
|
71
|
-
onClick:
|
|
72
|
-
}),
|
|
73
|
-
() =>
|
|
74
|
-
columns:
|
|
70
|
+
tagsBuilder: F,
|
|
71
|
+
onClick: v
|
|
72
|
+
}), D = j(
|
|
73
|
+
() => ra({
|
|
74
|
+
columns: l,
|
|
75
75
|
view: e,
|
|
76
|
-
data:
|
|
77
|
-
refetch:
|
|
76
|
+
data: k,
|
|
77
|
+
refetch: C || c
|
|
78
78
|
}),
|
|
79
79
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
80
|
-
[
|
|
81
|
-
), p =
|
|
82
|
-
return /* @__PURE__ */ f("div", { className: P(o.table_wrapper, o[
|
|
83
|
-
(!
|
|
84
|
-
|
|
80
|
+
[k, l, e, c, C]
|
|
81
|
+
), p = R || w, N = !!u;
|
|
82
|
+
return /* @__PURE__ */ f("div", { className: P(o.table_wrapper, o[B], o[e]), children: [
|
|
83
|
+
(!b || h || g || n || m) && /* @__PURE__ */ r(
|
|
84
|
+
A,
|
|
85
85
|
{
|
|
86
86
|
language: i,
|
|
87
|
-
hideSearch:
|
|
88
|
-
rightHeaderAddons:
|
|
87
|
+
hideSearch: b,
|
|
88
|
+
rightHeaderAddons: h,
|
|
89
89
|
leftHeaderAddons: g,
|
|
90
90
|
searchText: t?.searchText || "",
|
|
91
91
|
addParam: d,
|
|
92
|
-
searchPlaceholder:
|
|
93
|
-
filtersButtonLabel:
|
|
92
|
+
searchPlaceholder: E,
|
|
93
|
+
filtersButtonLabel: S,
|
|
94
94
|
tags: Q,
|
|
95
95
|
onCreateClick: J,
|
|
96
|
-
createButtonLabel:
|
|
97
|
-
onFiltersClick:
|
|
98
|
-
showFiltersButton: !!
|
|
96
|
+
createButtonLabel: _,
|
|
97
|
+
onFiltersClick: v,
|
|
98
|
+
showFiltersButton: !!m,
|
|
99
99
|
compact: e === "compact"
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
|
-
/* @__PURE__ */ r("div", { className: P(o.table, { [o.no_footer]: !
|
|
102
|
+
/* @__PURE__ */ r("div", { className: P(o.table, { [o.no_footer]: !N }), children: /* @__PURE__ */ f("table", { cellSpacing: "0", cellPadding: "0", children: [
|
|
103
103
|
/* @__PURE__ */ r(
|
|
104
|
-
|
|
104
|
+
W,
|
|
105
105
|
{
|
|
106
106
|
sort: t?.sort,
|
|
107
107
|
order: t?.order,
|
|
108
108
|
addParam: d,
|
|
109
|
-
columns:
|
|
109
|
+
columns: l,
|
|
110
110
|
compact: e === "compact"
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
113
|
/* @__PURE__ */ f("tbody", { children: [
|
|
114
|
-
|
|
115
|
-
!
|
|
116
|
-
p && /* @__PURE__ */ r(
|
|
117
|
-
|
|
114
|
+
x && /* @__PURE__ */ r(Y, { language: i }),
|
|
115
|
+
!D.length && !p && !x && /* @__PURE__ */ r(X, { language: i }),
|
|
116
|
+
p && /* @__PURE__ */ r(Z, { columnsLength: l.length }),
|
|
117
|
+
D.map(({ row: a, cells: s }) => /* @__PURE__ */ r(
|
|
118
118
|
"tr",
|
|
119
119
|
{
|
|
120
120
|
onClick: () => I(a),
|
|
121
|
-
className: P({ [o.clickable]: !!
|
|
121
|
+
className: P({ [o.clickable]: !!T }),
|
|
122
122
|
style: { visibility: p ? "collapse" : "visible" },
|
|
123
|
-
children: s
|
|
123
|
+
children: s
|
|
124
124
|
},
|
|
125
125
|
String(a.id)
|
|
126
126
|
))
|
|
127
127
|
] })
|
|
128
128
|
] }) }),
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
N && /* @__PURE__ */ r(
|
|
130
|
+
$,
|
|
131
131
|
{
|
|
132
132
|
language: i,
|
|
133
133
|
currentPage: t ? +t.page : 1,
|
|
@@ -140,5 +140,5 @@ function ya({
|
|
|
140
140
|
] });
|
|
141
141
|
}
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
ha as Table
|
|
144
144
|
};
|
package/dist/table/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type TableComponentValue<T, D> = (
|
|
2
|
+
export type TableComponentValue<T, D> = (data: {
|
|
3
3
|
row: T;
|
|
4
4
|
refetch: () => void;
|
|
5
|
-
}) => D
|
|
6
|
-
export type TableValue<T, D> =
|
|
5
|
+
}) => D;
|
|
6
|
+
export type TableValue<T, D> = keyof T | TableComponentValue<T, D>;
|
|
7
7
|
type Accessor<T> = {
|
|
8
8
|
accessor?: never;
|
|
9
9
|
sort?: never;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { parseQueryParams as a } from "./parse-query-params.js";
|
|
2
2
|
function n() {
|
|
3
|
-
const {
|
|
4
|
-
limit: i,
|
|
5
|
-
page: s,
|
|
6
|
-
searchText: t,
|
|
7
|
-
sort: o,
|
|
8
|
-
order: e,
|
|
9
|
-
...m
|
|
10
|
-
} = a(), r = {
|
|
3
|
+
const { limit: i, page: s, searchText: t, sort: o, order: e, ...m } = a(), r = {
|
|
11
4
|
where: m,
|
|
12
5
|
limit: Number(i) || 10,
|
|
13
6
|
page: Number(s) || 1
|
|
@@ -6,5 +6,5 @@ type Props = {
|
|
|
6
6
|
tagsBuilder?: (props: FiltersMapper) => ReactElement | null;
|
|
7
7
|
onClick: () => void;
|
|
8
8
|
};
|
|
9
|
-
export declare function getTags({ params, onClick, onDelete, tagsBuilder
|
|
9
|
+
export declare function getTags({ params, onClick, onDelete, tagsBuilder }: Props): ReactElement<unknown, string | import('react').JSXElementConstructor<any>>[];
|
|
10
10
|
export {};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
function i({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onDelete: c,
|
|
11
|
-
onClick: r
|
|
12
|
-
})) : []).filter((t) => t !== null) : [];
|
|
1
|
+
function i({ params: e, onClick: r, onDelete: c, tagsBuilder: n }) {
|
|
2
|
+
return n ? (e ? Object.entries(e).map(
|
|
3
|
+
([t, f]) => n({
|
|
4
|
+
paramName: t,
|
|
5
|
+
paramValue: f,
|
|
6
|
+
onDelete: c,
|
|
7
|
+
onClick: r
|
|
8
|
+
})
|
|
9
|
+
) : []).filter((t) => t !== null) : [];
|
|
13
10
|
}
|
|
14
11
|
export {
|
|
15
12
|
i as getTags
|
|
@@ -4,8 +4,8 @@ import { getTags as p } from "./get-tags.js";
|
|
|
4
4
|
import { parseQueryParams as x } from "./parse-query-params.js";
|
|
5
5
|
import { removeQueryParam as u } from "./remove-query-param.js";
|
|
6
6
|
import { resetQueryParam as Q } from "./reset-query-param.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { serializeData as g } from "./serialize-data.js";
|
|
8
|
+
import { setQueryToUrl as d } from "./set-query-to-url.js";
|
|
9
9
|
export {
|
|
10
10
|
o as addQueryParam,
|
|
11
11
|
m as getQueryFromUrl,
|
|
@@ -13,6 +13,6 @@ export {
|
|
|
13
13
|
x as parseQueryParams,
|
|
14
14
|
u as removeQueryParam,
|
|
15
15
|
Q as resetQueryParam,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
g as serializeData,
|
|
17
|
+
d as setQueryToUrl
|
|
18
18
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { parse as r } from "query-string";
|
|
2
2
|
function e() {
|
|
3
|
-
return r(window.location.search, {
|
|
3
|
+
return r(window.location.search, {
|
|
4
|
+
arrayFormat: "comma",
|
|
5
|
+
parseBooleans: !0,
|
|
6
|
+
parseNumbers: !0
|
|
7
|
+
});
|
|
4
8
|
}
|
|
5
9
|
export {
|
|
6
10
|
e as parseQueryParams
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { TableProps } from '../table';
|
|
3
2
|
type Props<T extends object> = {
|
|
4
3
|
columns: TableProps<T>['columns'];
|
|
@@ -8,6 +7,6 @@ type Props<T extends object> = {
|
|
|
8
7
|
};
|
|
9
8
|
export declare function prepareRows<T extends object>({ columns, view, data, refetch, }: Props<T>): {
|
|
10
9
|
row: T;
|
|
11
|
-
cells:
|
|
10
|
+
cells: import("react/jsx-runtime").JSX.Element[];
|
|
12
11
|
}[];
|
|
13
12
|
export {};
|
|
@@ -8,7 +8,7 @@ function p(t, i, r) {
|
|
|
8
8
|
function c(t, i, r) {
|
|
9
9
|
return t ? typeof t == "string" ? i[t] : typeof t == "function" ? t({ row: i, refetch: r }) : null : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function v({
|
|
12
12
|
columns: t,
|
|
13
13
|
view: i = "default",
|
|
14
14
|
data: r,
|
|
@@ -61,11 +61,12 @@ function w({
|
|
|
61
61
|
compact: l,
|
|
62
62
|
subtitle: l ? void 0 : e.row?.subtitle && c(e.row?.subtitle, n, s),
|
|
63
63
|
addon: m
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
|
+
String(e.accessor)
|
|
65
66
|
);
|
|
66
67
|
})
|
|
67
68
|
}));
|
|
68
69
|
}
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
v as prepareRows
|
|
71
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function queryAdapter(params: any, adapter: 'dev' | 'prod'):
|
|
1
|
+
export declare function queryAdapter(params: any, adapter: 'dev' | 'prod'): Record<string, unknown>;
|
|
@@ -14,11 +14,11 @@ const p = {
|
|
|
14
14
|
searchText: "searchText"
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
function s(
|
|
18
|
-
return Object.entries(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
function s(t, o) {
|
|
18
|
+
return Object.entries(t).reduce((e, [r, a]) => {
|
|
19
|
+
const i = p[o][r] || r;
|
|
20
|
+
return e[i] = a, e;
|
|
21
|
+
}, {});
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
24
|
s as queryAdapter
|
|
@@ -3,7 +3,9 @@ import { parseQueryParams as i } from "./parse-query-params.js";
|
|
|
3
3
|
import { setQueryToUrl as f } from "./set-query-to-url.js";
|
|
4
4
|
function c(o, e) {
|
|
5
5
|
const r = i();
|
|
6
|
-
Array.isArray(r[o]) && e ? r[o] = r[o].filter(
|
|
6
|
+
Array.isArray(r[o]) && e ? r[o] = r[o].filter(
|
|
7
|
+
(t) => t !== e
|
|
8
|
+
) : delete r[o], f(s(r, { arrayFormat: "comma" }));
|
|
7
9
|
}
|
|
8
10
|
export {
|
|
9
11
|
c as removeQueryParam
|
|
@@ -2,15 +2,22 @@ import { stringify as s } from "query-string";
|
|
|
2
2
|
import { parseQueryParams as i } from "./parse-query-params.js";
|
|
3
3
|
import { setQueryToUrl as c } from "./set-query-to-url.js";
|
|
4
4
|
function y(r) {
|
|
5
|
-
const e = Object.fromEntries(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const e = Object.fromEntries(
|
|
6
|
+
Object.entries(r).filter((a) => a[1] !== "")
|
|
7
|
+
), { searchText: t, order: o, sort: m } = i();
|
|
8
|
+
c(
|
|
9
|
+
s(
|
|
10
|
+
{
|
|
11
|
+
limit: 10,
|
|
12
|
+
page: 1,
|
|
13
|
+
searchText: t,
|
|
14
|
+
order: o,
|
|
15
|
+
sort: m,
|
|
16
|
+
...e
|
|
17
|
+
},
|
|
18
|
+
{ arrayFormat: "comma" }
|
|
19
|
+
)
|
|
20
|
+
);
|
|
14
21
|
}
|
|
15
22
|
export {
|
|
16
23
|
y as resetQueryParam
|
|
@@ -6,7 +6,11 @@ import p from "@alphakits/icons/dist/ClockCircleM";
|
|
|
6
6
|
import l from "classnames";
|
|
7
7
|
import { Typography as f } from "../typography/component.js";
|
|
8
8
|
import e from "./index.module.css.js";
|
|
9
|
-
const u = ({
|
|
9
|
+
const u = ({
|
|
10
|
+
text: i,
|
|
11
|
+
view: o = "secondary",
|
|
12
|
+
className: c
|
|
13
|
+
}) => {
|
|
10
14
|
const m = {
|
|
11
15
|
negative: /* @__PURE__ */ r(t, {}),
|
|
12
16
|
positive: /* @__PURE__ */ r(n, {}),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as z, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import d from "classnames";
|
|
3
|
+
import H, { useRef as ee, useState as C, useEffect as te, useCallback as p } from "react";
|
|
3
4
|
import re from "react-merge-refs";
|
|
4
5
|
import se from "react-textarea-autosize";
|
|
5
|
-
import p from "classnames";
|
|
6
6
|
import { FormControl as ae } from "../form-control/component.js";
|
|
7
7
|
import { useFocus as oe } from "../hooks/useFocus/index.js";
|
|
8
8
|
import t from "./index.module.css.js";
|
|
9
9
|
const pe = H.forwardRef(
|
|
10
10
|
({
|
|
11
11
|
autoComplete: F = "on",
|
|
12
|
-
autosize:
|
|
12
|
+
autosize: s = !0,
|
|
13
13
|
size: x = "s",
|
|
14
14
|
block: S = !1,
|
|
15
15
|
bottomAddons: $,
|
|
@@ -22,45 +22,45 @@ const pe = H.forwardRef(
|
|
|
22
22
|
textareaClassName: w,
|
|
23
23
|
label: R,
|
|
24
24
|
leftAddons: B,
|
|
25
|
-
onFocus:
|
|
25
|
+
onFocus: f,
|
|
26
26
|
required: E,
|
|
27
|
-
onBlur:
|
|
27
|
+
onBlur: c,
|
|
28
28
|
onChange: n,
|
|
29
29
|
onHeightChange: M,
|
|
30
30
|
rightAddons: P,
|
|
31
31
|
maxRows: q,
|
|
32
32
|
minRows: D,
|
|
33
|
-
maxHeight:
|
|
33
|
+
maxHeight: a,
|
|
34
34
|
resize: G = "none",
|
|
35
|
-
value:
|
|
35
|
+
value: o,
|
|
36
36
|
defaultValue: I,
|
|
37
37
|
maxLength: i = 500,
|
|
38
38
|
counter: J,
|
|
39
|
-
rows: K =
|
|
39
|
+
rows: K = s ? 1 : 3,
|
|
40
40
|
...O
|
|
41
41
|
}, Q) => {
|
|
42
|
-
const
|
|
42
|
+
const r = o === void 0, l = ee(null), [T, V] = C(!1), [u, U] = C(I || ""), [W] = oe(l, "keyboard"), b = !!(r ? u : o);
|
|
43
43
|
te(() => {
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
const X =
|
|
44
|
+
s && a && l.current?.style && (l.current.style.maxHeight = `${a}px`);
|
|
45
|
+
}, [s, a]);
|
|
46
|
+
const X = p(
|
|
47
47
|
(e) => {
|
|
48
|
-
V(!0),
|
|
48
|
+
V(!0), f && f(e);
|
|
49
49
|
},
|
|
50
|
-
[
|
|
51
|
-
), Y =
|
|
50
|
+
[f]
|
|
51
|
+
), Y = p(
|
|
52
52
|
(e) => {
|
|
53
|
-
V(!1),
|
|
53
|
+
V(!1), c && c(e);
|
|
54
54
|
},
|
|
55
|
-
[
|
|
56
|
-
), Z =
|
|
55
|
+
[c]
|
|
56
|
+
), Z = p(
|
|
57
57
|
(e) => {
|
|
58
|
-
n && n(e, { value: e.target.value }),
|
|
58
|
+
n && n(e, { value: e.target.value }), r && U(e.target.value);
|
|
59
59
|
},
|
|
60
|
-
[n,
|
|
60
|
+
[n, r]
|
|
61
61
|
), _ = {
|
|
62
62
|
...O,
|
|
63
|
-
className:
|
|
63
|
+
className: d(
|
|
64
64
|
t.textarea,
|
|
65
65
|
t[x],
|
|
66
66
|
{
|
|
@@ -75,16 +75,16 @@ const pe = H.forwardRef(
|
|
|
75
75
|
onBlur: Y,
|
|
76
76
|
onFocus: X,
|
|
77
77
|
onChange: Z,
|
|
78
|
-
value:
|
|
78
|
+
value: r ? u : o,
|
|
79
79
|
rows: K,
|
|
80
|
-
ref: re([Q,
|
|
80
|
+
ref: re([Q, l]),
|
|
81
81
|
"data-test-id": k
|
|
82
|
-
}, L = () => `${
|
|
82
|
+
}, L = () => `${r ? u.length : o?.length} / ${i || "-"}`, { ref: h, ...N } = _;
|
|
83
83
|
return /* @__PURE__ */ z(
|
|
84
84
|
ae,
|
|
85
85
|
{
|
|
86
|
-
className:
|
|
87
|
-
fieldClassName:
|
|
86
|
+
className: d(j),
|
|
87
|
+
fieldClassName: d(g, {
|
|
88
88
|
[t.focusVisible]: W
|
|
89
89
|
}),
|
|
90
90
|
size: x,
|
|
@@ -100,7 +100,7 @@ const pe = H.forwardRef(
|
|
|
100
100
|
rightAddons: P,
|
|
101
101
|
bottomAddons: $,
|
|
102
102
|
children: [
|
|
103
|
-
|
|
103
|
+
s ? /* @__PURE__ */ m(
|
|
104
104
|
se,
|
|
105
105
|
{
|
|
106
106
|
...N,
|
|
@@ -110,7 +110,15 @@ const pe = H.forwardRef(
|
|
|
110
110
|
onHeightChange: M,
|
|
111
111
|
ref: h
|
|
112
112
|
}
|
|
113
|
-
) : /* @__PURE__ */ m(
|
|
113
|
+
) : /* @__PURE__ */ m(
|
|
114
|
+
"textarea",
|
|
115
|
+
{
|
|
116
|
+
maxLength: i,
|
|
117
|
+
...N,
|
|
118
|
+
ref: h,
|
|
119
|
+
style: { maxHeight: a }
|
|
120
|
+
}
|
|
121
|
+
),
|
|
114
122
|
J && /* @__PURE__ */ m("span", { className: t.counter, children: L() })
|
|
115
123
|
]
|
|
116
124
|
}
|
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
2
|
+
import { createContext as k, useState as x, useCallback as u, useEffect as y, useContext as _ } from "react";
|
|
3
|
+
var b = /* @__PURE__ */ ((t) => (t.DARK = "dark", t.LIGHT = "light", t))(b || {});
|
|
4
|
+
const f = k({
|
|
5
5
|
setTheme: () => {
|
|
6
6
|
},
|
|
7
7
|
currentTheme: void 0
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
}), i = "theme", E = "theme-styles", v = "data-theme", S = ({
|
|
9
|
+
children: t,
|
|
10
|
+
themes: c,
|
|
11
|
+
selectedTheme: r
|
|
12
|
+
}) => {
|
|
13
|
+
const [A, C] = x(), n = u((e) => {
|
|
14
|
+
document?.documentElement.setAttribute(v, e), localStorage.setItem(i, e), C(e);
|
|
15
|
+
}, []), m = u((e) => {
|
|
16
|
+
let o = document.getElementById(E), s = "";
|
|
17
|
+
o || (o = document.createElement("style"), o.id = E, document.head.appendChild(o)), Object.keys(e).forEach((a) => {
|
|
18
|
+
s += `html[data-theme='${a}'] {`;
|
|
19
|
+
const h = e[a];
|
|
20
|
+
Object.keys(h).forEach((T) => {
|
|
21
|
+
const l = h[T];
|
|
22
|
+
Object.keys(l).forEach((d) => {
|
|
23
|
+
s += `--color-${T}-${d}: ${l[d]};
|
|
20
24
|
`;
|
|
21
25
|
});
|
|
22
|
-
}),
|
|
23
|
-
`, o.textContent =
|
|
26
|
+
}), s += `}
|
|
27
|
+
`, o.textContent = s;
|
|
24
28
|
});
|
|
25
|
-
};
|
|
26
|
-
return
|
|
27
|
-
const e = localStorage?.getItem(
|
|
28
|
-
|
|
29
|
-
}, [c, r]), /* @__PURE__ */ g(
|
|
30
|
-
},
|
|
31
|
-
const { setTheme: t, currentTheme: c } = _(
|
|
29
|
+
}, []);
|
|
30
|
+
return y(() => {
|
|
31
|
+
const e = localStorage?.getItem(i), o = window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
32
|
+
n(r || e || o), m(c);
|
|
33
|
+
}, [c, r, n, m]), /* @__PURE__ */ g(f.Provider, { value: { setTheme: n, currentTheme: A }, children: t });
|
|
34
|
+
}, j = () => {
|
|
35
|
+
const { setTheme: t, currentTheme: c } = _(f);
|
|
32
36
|
return { setTheme: t, currentTheme: c };
|
|
33
37
|
};
|
|
34
38
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
i as LOACAL_STORAGE_THEME_KEY,
|
|
40
|
+
E as STYLE_TAG_ID,
|
|
41
|
+
b as THEME,
|
|
38
42
|
v as THEME_DATA_ATTR,
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
S as ThemeProvider,
|
|
44
|
+
j as useTheme
|
|
41
45
|
};
|