@yimingliao/cms 0.0.129 → 0.0.131
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/export/client/index.js +2 -1
- package/dist/export/server/index.js +0 -6
- package/dist/export/server/r2/index.js +0 -19
- package/dist/export/server/sftp/index.js +0 -18
- package/dist/src/client/infrastructure/contexts/admin.js +5 -4
- package/dist/src/client/infrastructure/contexts/theme.js +5 -5
- package/dist/src/client/infrastructure/toast/error-display.js +15 -3
- package/dist/src/client/interfaces/components/shadcn/avatar.js +5 -4
- package/dist/src/client/interfaces/components/shadcn/button.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/card.js +9 -8
- package/dist/src/client/interfaces/components/shadcn/collapsible.js +4 -3
- package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +36 -29
- package/dist/src/client/interfaces/components/shadcn/input-group.js +8 -7
- package/dist/src/client/interfaces/components/shadcn/input.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/label.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/pagination.js +21 -18
- package/dist/src/client/interfaces/components/shadcn/select.js +47 -40
- package/dist/src/client/interfaces/components/shadcn/separator.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/sheet.js +36 -27
- package/dist/src/client/interfaces/components/shadcn/sidebar.js +120 -105
- package/dist/src/client/interfaces/components/shadcn/skeleton.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/spinner.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/textarea.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/tooltip.js +13 -10
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +35 -23
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +20 -14
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +35 -26
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +10 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +21 -15
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +19 -14
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +34 -29
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +43 -37
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +24 -18
- package/dist/src/client/interfaces/components/ui/buttons/button.js +8 -4
- package/dist/src/client/interfaces/components/ui/buttons/return-button.js +5 -4
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +9 -6
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +14 -8
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +22 -17
- package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +80 -57
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +114 -91
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +4 -3
- package/dist/src/client/interfaces/components/ui/form/field-body.js +31 -28
- package/dist/src/client/interfaces/components/ui/form/field.js +12 -1
- package/dist/src/client/interfaces/components/ui/form/form.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/index-field.js +49 -42
- package/dist/src/client/interfaces/components/ui/form/slug-field.js +45 -38
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +63 -52
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +41 -38
- package/dist/src/client/interfaces/components/ui/inputs/input.js +20 -17
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/select.js +19 -13
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/content-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/layouts/layout-skeleton.js +20 -7
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +8 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +60 -34
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +39 -26
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +6 -2
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +22 -1
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +43 -27
- package/dist/src/client/interfaces/pages/auth/change-password.js +81 -70
- package/dist/src/client/interfaces/pages/auth/email-unverified.js +39 -21
- package/dist/src/client/interfaces/pages/auth/forgot-password.js +41 -26
- package/dist/src/client/interfaces/pages/auth/reset-password.js +60 -51
- package/dist/src/client/interfaces/pages/auth/sign-in.js +46 -37
- package/dist/src/client/interfaces/pages/auth/verify-email.js +2 -1
- package/dist/types/export/server/r2/index.d.ts +1 -1
- package/dist/types/export/server/r2/index.d.ts.map +1 -1
- package/dist/types/export/server/sftp/index.d.ts +1 -1
- package/dist/types/export/server/sftp/index.d.ts.map +1 -1
- package/dist/types/src/server/index.d.ts +1 -1
- package/dist/types/src/server/index.d.ts.map +1 -1
- package/dist/types/src/server/infrastructure/index.d.ts +1 -1
- package/dist/types/src/server/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/server/infrastructure/storage/index.d.ts +0 -2
- package/dist/types/src/server/infrastructure/storage/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import '@radix-ui/react-avatar';
|
|
3
4
|
import 'react';
|
|
4
5
|
import 'ua-parser-js';
|
|
@@ -53,32 +54,40 @@ function Pagination({
|
|
|
53
54
|
}
|
|
54
55
|
const isAtFirstPage = page === 1;
|
|
55
56
|
const isAtLastPage = page === totalPages;
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
isActive:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx(Pagination$1, { className: "flex-1", children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationPrevious, { disabled: isAtFirstPage, onClick: handlePrev }) }),
|
|
59
|
+
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
60
|
+
PaginationLink,
|
|
61
|
+
{
|
|
62
|
+
isActive: page === 1,
|
|
63
|
+
disabled: isAtFirstPage,
|
|
64
|
+
onClick: () => setPage(1),
|
|
65
|
+
children: "1"
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
startPage > 2 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }),
|
|
69
|
+
pages.map((p) => {
|
|
70
|
+
const isThisPage = page === p;
|
|
71
|
+
return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, { isActive: isThisPage, onClick: () => setPage(p), children: p }) }, p);
|
|
72
|
+
}),
|
|
73
|
+
endPage < totalPages - 1 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }),
|
|
74
|
+
totalPages > 1 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
75
|
+
PaginationLink,
|
|
76
|
+
{
|
|
77
|
+
isActive: page === totalPages,
|
|
78
|
+
disabled: isAtLastPage,
|
|
79
|
+
onClick: () => setPage(totalPages),
|
|
80
|
+
children: totalPages
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
84
|
+
PaginationNext,
|
|
85
|
+
{
|
|
86
|
+
disabled: isAtLastPage || totalPages <= 1,
|
|
87
|
+
onClick: handleNext
|
|
88
|
+
}
|
|
89
|
+
) })
|
|
90
|
+
] }) });
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
export { Pagination };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { createElement } from 'react';
|
|
2
3
|
import 'ua-parser-js';
|
|
3
4
|
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
@@ -11,7 +12,15 @@ function PageHeaderTitle({
|
|
|
11
12
|
leftChildren,
|
|
12
13
|
className
|
|
13
14
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", className), children: [
|
|
16
|
+
leftChildren,
|
|
17
|
+
icon && createElement(icon),
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-center w-fit gap-3 whitespace-nowrap", children: [
|
|
19
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: subtitle }),
|
|
20
|
+
/* @__PURE__ */ jsx("p", { className: "scroll-m-20 text-xl font-semibold tracking-tight", children: title })
|
|
21
|
+
] }),
|
|
22
|
+
children
|
|
23
|
+
] });
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
export { PageHeaderTitle };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import { Files } from 'lucide-react';
|
|
3
4
|
import 'react';
|
|
@@ -43,24 +44,29 @@ function PageHeader(props) {
|
|
|
43
44
|
const left = props.leftChildren ?? preset.left;
|
|
44
45
|
const resolvedTitleProps = { ...preset.titleProps, ...props.titleProps };
|
|
45
46
|
const right = props.rightChildren ?? preset.right;
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
className: cn(
|
|
50
|
-
"relative h-full px-6",
|
|
51
|
-
"flex items-center justify-between gap-3"
|
|
52
|
-
)
|
|
53
|
-
},
|
|
54
|
-
!isDefault && left && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3" }, left),
|
|
55
|
-
/* @__PURE__ */ React.createElement(
|
|
56
|
-
PageHeaderTitle,
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { style: { height: PAGE_HEADER_HEIGHT }, children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
"div",
|
|
57
50
|
{
|
|
58
|
-
className: cn(
|
|
59
|
-
|
|
51
|
+
className: cn(
|
|
52
|
+
"relative h-full px-6",
|
|
53
|
+
"flex items-center justify-between gap-3"
|
|
54
|
+
),
|
|
55
|
+
children: [
|
|
56
|
+
!isDefault && left && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: left }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
PageHeaderTitle,
|
|
59
|
+
{
|
|
60
|
+
className: cn(!isDefault && "absolute left-1/2 -translate-x-1/2"),
|
|
61
|
+
...resolvedTitleProps
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
right && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-3", children: right })
|
|
65
|
+
]
|
|
60
66
|
}
|
|
61
67
|
),
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
/* @__PURE__ */ jsx(Separator, {})
|
|
69
|
+
] });
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
export { PageHeader };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { FilePlus } from 'lucide-react';
|
|
2
3
|
import 'next/navigation';
|
|
3
4
|
import 'react';
|
|
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
20
21
|
function createBatchCreatePreset(ctx) {
|
|
21
22
|
const { props, t } = ctx;
|
|
22
23
|
return {
|
|
23
|
-
left: /* @__PURE__ */
|
|
24
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
|
|
24
25
|
titleProps: {
|
|
25
26
|
icon: FilePlus,
|
|
26
27
|
subtitle: t("ui.page-header.batch-create.subtitle.text")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { FilePen, CopyCheck, CopyX, FileX, FilePlus } from 'lucide-react';
|
|
2
3
|
import { Button } from '../../../buttons/button.js';
|
|
3
4
|
import { ReturnButton } from '../../../buttons/return-button.js';
|
|
@@ -5,29 +6,33 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
5
6
|
function createBatchPreset(ctx) {
|
|
6
7
|
const { props, t } = ctx;
|
|
7
8
|
return {
|
|
8
|
-
left: /* @__PURE__ */
|
|
9
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps, children: t("ui.button.exit-batch-mode.text") }) }),
|
|
9
10
|
titleProps: {
|
|
10
11
|
icon: FilePen,
|
|
11
12
|
subtitle: t("ui.page-header.batch.subtitle.text"),
|
|
12
|
-
children: /* @__PURE__ */
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
13
14
|
Button,
|
|
14
15
|
{
|
|
15
16
|
variant: "success",
|
|
16
17
|
href: props.batchCreateButtonHref,
|
|
17
|
-
icon: FilePlus
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
icon: FilePlus,
|
|
19
|
+
children: t("ui.button.batch-create.text")
|
|
20
|
+
}
|
|
20
21
|
)
|
|
21
22
|
},
|
|
22
|
-
right: /* @__PURE__ */
|
|
23
|
-
Button,
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
right: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn, children: /* @__PURE__ */ jsx(CopyCheck, {}) }),
|
|
25
|
+
/* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn, children: /* @__PURE__ */ jsx(CopyX, {}) }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Button,
|
|
28
|
+
{
|
|
29
|
+
...props.destroyButtonProps,
|
|
30
|
+
variant: "destructive",
|
|
31
|
+
icon: FileX,
|
|
32
|
+
children: t("ui.button.destroy.text")
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] })
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { FilePlus } from 'lucide-react';
|
|
2
3
|
import 'next/navigation';
|
|
3
4
|
import 'react';
|
|
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
20
21
|
function createCreatePreset(ctx) {
|
|
21
22
|
const { props, t } = ctx;
|
|
22
23
|
return {
|
|
23
|
-
left: /* @__PURE__ */
|
|
24
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
|
|
24
25
|
titleProps: {
|
|
25
26
|
icon: FilePlus,
|
|
26
27
|
subtitle: t("ui.page-header.create.subtitle.text")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { FilePen } from 'lucide-react';
|
|
2
3
|
import 'next/navigation';
|
|
3
4
|
import 'react';
|
|
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
20
21
|
function createEditPreset(ctx) {
|
|
21
22
|
const { props, t } = ctx;
|
|
22
23
|
return {
|
|
23
|
-
left: /* @__PURE__ */
|
|
24
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
|
|
24
25
|
titleProps: {
|
|
25
26
|
icon: FilePen,
|
|
26
27
|
subtitle: t("ui.page-header.edit.subtitle.text")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { Files, FileStack, FolderCog, FileSpreadsheet, FilePlus } from 'lucide-react';
|
|
2
3
|
import { Button } from '../../../buttons/button.js';
|
|
3
4
|
import { ReturnButton } from '../../../buttons/return-button.js';
|
|
@@ -5,38 +6,42 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
5
6
|
function createIndexPreset(ctx) {
|
|
6
7
|
const { props, t } = ctx;
|
|
7
8
|
return {
|
|
8
|
-
left: /* @__PURE__ */
|
|
9
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
|
|
9
10
|
titleProps: {
|
|
10
11
|
icon: Files,
|
|
11
|
-
children: /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
+
props.settingButtonProps && props.showTopicSettingButton && /* @__PURE__ */ jsx(
|
|
14
|
+
Button,
|
|
15
|
+
{
|
|
16
|
+
...props.settingButtonProps,
|
|
17
|
+
variant: "outline",
|
|
18
|
+
icon: FolderCog,
|
|
19
|
+
isDisabled: props.settingButtonProps.isDisabled ?? props.isDisabled,
|
|
20
|
+
children: `${t("ui.button.setting.text")} ${t("resources.topic.text")}`
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
props.createCategoryButtonProps && /* @__PURE__ */ jsx(
|
|
24
|
+
Button,
|
|
25
|
+
{
|
|
26
|
+
...props.createCategoryButtonProps,
|
|
27
|
+
variant: "success",
|
|
28
|
+
icon: FileSpreadsheet,
|
|
29
|
+
isDisabled: props.createCategoryButtonProps.isDisabled ?? props.isDisabled,
|
|
30
|
+
children: t("ui.button.create.text")
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
props.createButtonProps && /* @__PURE__ */ jsx(
|
|
34
|
+
Button,
|
|
35
|
+
{
|
|
36
|
+
variant: "success",
|
|
37
|
+
icon: FilePlus,
|
|
38
|
+
...props.createButtonProps,
|
|
39
|
+
children: t("ui.button.create.text")
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] })
|
|
38
43
|
},
|
|
39
|
-
right: props.batchButtonProps && /* @__PURE__ */
|
|
44
|
+
right: props.batchButtonProps && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps, children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: t("ui.button.batch.text") }) }) })
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { File, FileStack, FolderSearch, FilePen, FileX, Lock } from 'lucide-react';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'ua-parser-js';
|
|
@@ -9,46 +10,51 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
9
10
|
function createShowPreset(ctx) {
|
|
10
11
|
const { props, t } = ctx;
|
|
11
12
|
return {
|
|
12
|
-
left: /* @__PURE__ */
|
|
13
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
|
|
13
14
|
titleProps: {
|
|
14
15
|
icon: File,
|
|
15
|
-
children: !props.isNotFound && /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
children: !props.isNotFound && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
17
|
+
props.showButtonProps && /* @__PURE__ */ jsx(
|
|
18
|
+
Button,
|
|
19
|
+
{
|
|
20
|
+
...props.showButtonProps,
|
|
21
|
+
variant: "outline",
|
|
22
|
+
icon: FolderSearch,
|
|
23
|
+
isDisabled: props.showButtonProps.isDisabled || props.isDisabled,
|
|
24
|
+
children: `${t("ui.button.show.text")} ${t("resources.related.text")}`
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
props.editButtonProps && /* @__PURE__ */ jsx(
|
|
28
|
+
Button,
|
|
29
|
+
{
|
|
30
|
+
...props.editButtonProps,
|
|
31
|
+
variant: "warning",
|
|
32
|
+
icon: FilePen,
|
|
33
|
+
isDisabled: props.editButtonProps.isDisabled || props.isDisabled,
|
|
34
|
+
children: t("ui.button.edit.text")
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
props.destroyButtonProps && /* @__PURE__ */ jsx(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
...props.destroyButtonProps,
|
|
41
|
+
variant: "destructive",
|
|
42
|
+
icon: FileX,
|
|
43
|
+
isDisabled: props.destroyButtonProps.isDisabled || props.isDisabled,
|
|
44
|
+
children: t("ui.button.destroy.text")
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
Lock,
|
|
49
|
+
{
|
|
50
|
+
className: cn(
|
|
51
|
+
props.isLocked && !props.isDisabled ? "opacity-100" : "opacity-0"
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] })
|
|
50
56
|
},
|
|
51
|
-
right: props.batchButtonProps && /* @__PURE__ */
|
|
57
|
+
right: props.batchButtonProps && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps, children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: t("ui.button.batch.text") }) }) })
|
|
52
58
|
};
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { Trash2, CopyCheck, CopyX, FileSymlink, FileX } from 'lucide-react';
|
|
2
3
|
import { Button } from '../../../buttons/button.js';
|
|
3
4
|
import { ReturnButton } from '../../../buttons/return-button.js';
|
|
@@ -5,28 +6,33 @@ import { ReturnButton } from '../../../buttons/return-button.js';
|
|
|
5
6
|
function createTrashPreset(ctx) {
|
|
6
7
|
const { props, t } = ctx;
|
|
7
8
|
return {
|
|
8
|
-
left: /* @__PURE__ */
|
|
9
|
+
left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
|
|
9
10
|
titleProps: {
|
|
10
11
|
icon: Trash2,
|
|
11
12
|
title: t("main.trash.text")
|
|
12
13
|
},
|
|
13
|
-
right: /* @__PURE__ */
|
|
14
|
-
Button,
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
right: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn, children: /* @__PURE__ */ jsx(CopyCheck, {}) }),
|
|
16
|
+
/* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn, children: /* @__PURE__ */ jsx(CopyX, {}) }),
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
Button,
|
|
19
|
+
{
|
|
20
|
+
...props.restoreButtonProps,
|
|
21
|
+
variant: "success",
|
|
22
|
+
icon: FileSymlink,
|
|
23
|
+
children: t("ui.button.restore.text")
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Button,
|
|
28
|
+
{
|
|
29
|
+
...props.destroyButtonProps,
|
|
30
|
+
variant: "destructive",
|
|
31
|
+
icon: FileX,
|
|
32
|
+
children: t("ui.button.destroy.text")
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] })
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { useRouter } from 'next/navigation';
|
|
2
3
|
import { createElement } from 'react';
|
|
3
4
|
import '@radix-ui/react-avatar';
|
|
@@ -37,15 +38,18 @@ function Button({
|
|
|
37
38
|
router.push(href);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
41
42
|
Button$1,
|
|
42
43
|
{
|
|
43
44
|
type: props.type ?? "button",
|
|
44
45
|
disabled: isDisabled || isLoading,
|
|
45
46
|
onClick: props.onClick ?? handleClick,
|
|
46
|
-
...props
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
...props,
|
|
48
|
+
children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
icon && createElement(icon),
|
|
50
|
+
children
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
49
53
|
);
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import { Undo2 } from 'lucide-react';
|
|
3
4
|
import { useRouter } from 'next/navigation';
|
|
@@ -42,7 +43,7 @@ function ReturnButton({
|
|
|
42
43
|
}
|
|
43
44
|
router.back();
|
|
44
45
|
};
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
46
47
|
Button,
|
|
47
48
|
{
|
|
48
49
|
variant: "outline",
|
|
@@ -50,9 +51,9 @@ function ReturnButton({
|
|
|
50
51
|
icon: useIcon ? icon || Undo2 : void 0,
|
|
51
52
|
onClick: handelClick,
|
|
52
53
|
className,
|
|
53
|
-
...props
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
...props,
|
|
55
|
+
children: children ?? t("ui.button.return.text")
|
|
56
|
+
}
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { CirclePlus, CircleMinus } from 'lucide-react';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'ua-parser-js';
|
|
@@ -16,7 +17,7 @@ import '../../../shadcn/sidebar.js';
|
|
|
16
17
|
import '@radix-ui/react-tooltip';
|
|
17
18
|
|
|
18
19
|
function ExpandBar({ isExpand }) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
20
21
|
"div",
|
|
21
22
|
{
|
|
22
23
|
className: cn(
|
|
@@ -24,11 +25,13 @@ function ExpandBar({ isExpand }) {
|
|
|
24
25
|
"flex-center gap-1",
|
|
25
26
|
"opacity-50 group-hover:opacity-100",
|
|
26
27
|
"transition"
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-3 flex-1" }),
|
|
31
|
+
!isExpand ? /* @__PURE__ */ jsx(CirclePlus, { className: "text-base-content size-5 min-w-5" }) : /* @__PURE__ */ jsx(CircleMinus, { className: "text-base-content size-5 min-w-5" }),
|
|
32
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-3 flex-1" })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
32
35
|
);
|
|
33
36
|
}
|
|
34
37
|
|
package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useRef, useEffect } from 'react';
|
|
2
3
|
import 'ua-parser-js';
|
|
3
4
|
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
@@ -25,17 +26,22 @@ function ExpandableListContent({
|
|
|
25
26
|
}
|
|
26
27
|
el.style.maxHeight = isExpand ? `${height}px` : `${COLLAPSED_HEIGHT}px`;
|
|
27
28
|
}, [isExpand, isDisabled, items.length, children, onOverflowChange]);
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
29
30
|
"div",
|
|
30
31
|
{
|
|
31
32
|
ref: containerRef,
|
|
32
|
-
className: cn("overflow-hidden", "flex flex-wrap gap-1", "duration-150")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
className: cn("overflow-hidden", "flex flex-wrap gap-1", "duration-150"),
|
|
34
|
+
children: [
|
|
35
|
+
children,
|
|
36
|
+
items.map((eachItem, idx) => {
|
|
37
|
+
const matched = isUnique && eachItem === item;
|
|
38
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
39
|
+
/* @__PURE__ */ jsx("span", { className: cn(matched && "text-error"), children: eachItem }),
|
|
40
|
+
idx !== items.length - 1 && ","
|
|
41
|
+
] }, `${eachItem}-${idx}`);
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}
|
|
39
45
|
);
|
|
40
46
|
}
|
|
41
47
|
|