@contember/create 2.1.0-alpha.9 → 2.1.0-beta.2
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/development/run.cjs +6 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +6 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +3 -2
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +3 -2
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +26 -8
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +26 -8
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -1
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/run.cjs +6 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +6 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +3 -2
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +3 -2
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +26 -8
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +26 -8
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -1
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +1 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -5
- package/resources/templates/default/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/admin/app/pages/tenant.tsx +2 -2
- package/resources/templates/default/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/default/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +31 -30
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/binding/persist.tsx +7 -5
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +10 -12
- package/resources/templates/default/admin/lib/board/board.tsx +59 -45
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +8 -4
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +34 -20
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +35 -29
- package/resources/templates/default/admin/lib/datagrid/index.ts +21 -21
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +32 -37
- package/resources/templates/default/admin/lib/datagrid/table.tsx +7 -5
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +10 -13
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/default/admin/lib/dict.ts +17 -5
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +84 -60
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +155 -33
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/default/admin/lib/editor/common/editor-canvas.tsx +5 -3
- package/resources/templates/default/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/default/admin/lib/editor/common/editor-inline-toolbar.tsx +4 -1
- package/resources/templates/default/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +46 -34
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/default/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +16 -9
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +31 -25
- package/resources/templates/default/admin/lib/form/container.tsx +51 -38
- package/resources/templates/default/admin/lib/form/inputs.tsx +14 -12
- package/resources/templates/default/admin/lib/form/select.tsx +93 -51
- package/resources/templates/default/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +105 -72
- package/resources/templates/default/admin/lib/form/upload.tsx +61 -62
- package/resources/templates/default/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/default/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +36 -26
- package/resources/templates/default/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +21 -12
- package/resources/templates/default/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/default/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +66 -70
- package/resources/templates/default/admin/lib/select/select.tsx +77 -72
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +84 -82
- package/resources/templates/default/admin/lib/select/ui.tsx +8 -6
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +31 -19
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +24 -22
- package/resources/templates/default/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +2 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +17 -14
- package/resources/templates/default/admin/lib/ui/input.tsx +18 -19
- package/resources/templates/default/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/default/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/default/admin/lib/ui/popover.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/default/admin/lib/ui/select.tsx +1 -2
- package/resources/templates/default/admin/lib/ui/sheet.tsx +6 -5
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +41 -30
- package/resources/templates/default/admin/lib/ui/switch.tsx +5 -3
- package/resources/templates/default/admin/lib/ui/textarea.tsx +7 -4
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/default/admin/lib/ui/toggle.tsx +3 -4
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -1
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/default/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +0 -4
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +27 -11
- package/resources/templates/default/admin/lib/upload/view.tsx +129 -67
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/default/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/default/admin/package.json +2 -3
- package/resources/templates/default/admin/vite.config.ts +1 -1
- package/src/commands/WorkspaceCreateCommand.ts +3 -3
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +26 -8
- package/src/run.ts +8 -7
- package/resources/templates/default/admin/postcss.config.js +0 -5
- /package/resources/templates/default/admin/entrypoint/pages/{magicLintSent.tsx → magicLinkSent.tsx} +0 -0
|
@@ -3,5 +3,7 @@ import { ReactNode } from 'react'
|
|
|
3
3
|
|
|
4
4
|
export type FieldLabelFormatter = (entityName: string, fieldName: string) => ReactNode | null
|
|
5
5
|
|
|
6
|
-
export const [, useFieldLabelFormatter, FieldLabelFormatterProvider] = createContext<FieldLabelFormatter>(
|
|
7
|
-
|
|
6
|
+
export const [, useFieldLabelFormatter, FieldLabelFormatterProvider] = createContext<FieldLabelFormatter>(
|
|
7
|
+
'FieldLabelContext',
|
|
8
|
+
(entityName, fieldName) => null,
|
|
9
|
+
)
|
|
@@ -32,7 +32,9 @@ const LayoutMaxWidthUI = uic('div', {
|
|
|
32
32
|
layout: 'default',
|
|
33
33
|
},
|
|
34
34
|
})
|
|
35
|
-
const LayoutBoxUI = uic('div', {
|
|
35
|
+
const LayoutBoxUI = uic('div', {
|
|
36
|
+
baseClass: 'rounded-xl shadow-lg border border-gray-200 bg-background gap-1 flex flex-col lg:flex-row mt-4 relative min-h-[calc(100vh-10rem)]',
|
|
37
|
+
})
|
|
36
38
|
|
|
37
39
|
const LayoutCenterPanelUI = uic('div', { baseClass: 'flex flex-col flex-2 p-4 gap-2 w-full flex-auto overflow-hidden' })
|
|
38
40
|
const LayoutCenterTopUI = uic('div', { baseClass: 'flex justify-between pb-4 mb-4 border-b border-gray-200' })
|
|
@@ -67,11 +69,17 @@ const LayoutTitleUI = uic('h1', { baseClass: 'text-2xl font-bold' })
|
|
|
67
69
|
|
|
68
70
|
const LayoutFooterUI = uic('div', { baseClass: 'flex justify-end mt-2 mx-4' })
|
|
69
71
|
|
|
70
|
-
const LayoutLeftPanelCloserUI = uic('a', {
|
|
72
|
+
const LayoutLeftPanelCloserUI = uic('a', {
|
|
73
|
+
baseClass: 'hidden lg:flex self-end absolute top-1 right-1 opacity-0 text-gray-400 hover:opacity-100 transition-opacity cursor-pointer',
|
|
74
|
+
})
|
|
71
75
|
const LayoutLeftPanelOpenerUI = uic('a', { baseClass: 'hidden lg:block absolute top-1 left-1' })
|
|
72
|
-
const LayoutRightPanelCloserUI = uic('a', {
|
|
76
|
+
const LayoutRightPanelCloserUI = uic('a', {
|
|
77
|
+
baseClass: 'hidden lg:flex self-end absolute top-1 right-1 opacity-0 text-gray-400 hover:opacity-100 transition-opacity cursor-pointer',
|
|
78
|
+
})
|
|
73
79
|
const LayoutRightPanelOpenerUI = uic('a', { baseClass: 'absolute top-1 right-1' })
|
|
74
|
-
const LayoutSwitcherUI = uic('a', {
|
|
80
|
+
const LayoutSwitcherUI = uic('a', {
|
|
81
|
+
baseClass: 'hidden lg:flex self-end absolute top-1 right-1 opacity-20 text-gray-400 hover:opacity-100 transition-opacity cursor-pointer',
|
|
82
|
+
})
|
|
75
83
|
const LayoutContentWrapperUI = uic('div', { baseClass: 'flex flex-col gap-12' })
|
|
76
84
|
|
|
77
85
|
export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}>) => {
|
|
@@ -81,10 +89,12 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
81
89
|
const [layout, setLayout] = useStoredState<'default' | 'stretch'>('local', ['', 'layout'], it => it ?? 'default')
|
|
82
90
|
|
|
83
91
|
const request = useCurrentRequest()
|
|
92
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: intentional
|
|
84
93
|
useEffect(() => {
|
|
85
94
|
setLeftSidebarVisibility(it => it === 'show' ? 'auto' : it)
|
|
86
95
|
}, [request])
|
|
87
96
|
|
|
97
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: intentional
|
|
88
98
|
useEffect(() => {
|
|
89
99
|
window.scrollTo({ top: 0 })
|
|
90
100
|
}, [request?.pageName])
|
|
@@ -99,7 +109,6 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
99
109
|
{layout === 'default' ? <Maximize2Icon /> : <Minimize2Icon />}
|
|
100
110
|
</LayoutSwitcherUI>
|
|
101
111
|
|
|
102
|
-
|
|
103
112
|
<LayoutMaxWidthUI layout={layout}>
|
|
104
113
|
<LayoutBoxUI>
|
|
105
114
|
{leftSidebarVisibility === 'hidden' && (
|
|
@@ -107,14 +116,15 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
107
116
|
<PanelLeftOpenIcon className="w-4 h-4" />
|
|
108
117
|
</LayoutLeftPanelOpenerUI>
|
|
109
118
|
)}
|
|
110
|
-
{hasRightSidebar && rightSidebarVisibility === 'hidden'
|
|
111
|
-
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
{hasRightSidebar && rightSidebarVisibility === 'hidden'
|
|
120
|
+
? (
|
|
121
|
+
<LayoutRightPanelOpenerUI onClick={() => setRightSidebarVisibility('show')}>
|
|
122
|
+
<PanelRightOpenIcon className="w-4 h-4" />
|
|
123
|
+
</LayoutRightPanelOpenerUI>
|
|
124
|
+
)
|
|
125
|
+
: null}
|
|
115
126
|
|
|
116
127
|
<LayoutLeftSidebarUI visibility={leftSidebarVisibility}>
|
|
117
|
-
|
|
118
128
|
<LayoutLeftPanelCloserUI onClick={() => setLeftSidebarVisibility('hidden')}>
|
|
119
129
|
<PanelLeftCloseIcon className="w-4 h-4" />
|
|
120
130
|
</LayoutLeftPanelCloserUI>
|
|
@@ -134,10 +144,8 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
134
144
|
</Button>
|
|
135
145
|
</LogoutTrigger>
|
|
136
146
|
</div>
|
|
137
|
-
|
|
138
147
|
</LayoutLeftSidebarUI>
|
|
139
148
|
|
|
140
|
-
|
|
141
149
|
<LayoutCenterPanelUI>
|
|
142
150
|
<LayoutCenterTopUI>
|
|
143
151
|
<div className={'flex gap-2'}>
|
|
@@ -148,7 +156,9 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
148
156
|
<div className={'flex gap-2'}>
|
|
149
157
|
<SlotTargets.Actions />
|
|
150
158
|
<div className={'flex flex-col lg:hidden p-4 gap-2 w-full flex-auto'}>
|
|
151
|
-
<a onClick={() => setLeftSidebarVisibility(it => it !== 'show' ? 'show' : 'auto')}
|
|
159
|
+
<a onClick={() => setLeftSidebarVisibility(it => it !== 'show' ? 'show' : 'auto')}>
|
|
160
|
+
<MenuIcon />
|
|
161
|
+
</a>
|
|
152
162
|
</div>
|
|
153
163
|
</div>
|
|
154
164
|
</LayoutCenterTopUI>
|
|
@@ -157,18 +167,18 @@ export const LayoutBoxedComponent = ({ children, ...rest }: PropsWithChildren<{}
|
|
|
157
167
|
{children}
|
|
158
168
|
</LayoutContentWrapperUI>
|
|
159
169
|
</LayoutCenterPanelUI>
|
|
160
|
-
{hasRightSidebar
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
{hasRightSidebar
|
|
171
|
+
? (
|
|
172
|
+
<LayoutRightSidebarUI visibility={rightSidebarVisibility ? 'show' : 'hidden'}>
|
|
173
|
+
<LayoutRightPanelCloserUI onClick={() => setRightSidebarVisibility('hidden')}>
|
|
174
|
+
<PanelRightCloseIcon />
|
|
175
|
+
</LayoutRightPanelCloserUI>
|
|
176
|
+
<div>
|
|
177
|
+
<SlotTargets.Sidebar />
|
|
178
|
+
</div>
|
|
179
|
+
</LayoutRightSidebarUI>
|
|
180
|
+
)
|
|
181
|
+
: null}
|
|
172
182
|
</LayoutBoxUI>
|
|
173
183
|
|
|
174
184
|
<LayoutFooterUI>
|
|
@@ -18,8 +18,5 @@ export const Title = memo<{ children: ReactNode }>(({ children }) => {
|
|
|
18
18
|
const titleText = useChildrenAsLabel(children)
|
|
19
19
|
useDocumentTitle(titleText)
|
|
20
20
|
|
|
21
|
-
return
|
|
22
|
-
<Slots.Title>{children}</Slots.Title>
|
|
23
|
-
)
|
|
21
|
+
return <Slots.Title>{children}</Slots.Title>
|
|
24
22
|
})
|
|
25
|
-
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ComponentType, useCallback, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogAction,
|
|
5
|
+
AlertDialogCancel,
|
|
6
|
+
AlertDialogContent,
|
|
7
|
+
AlertDialogDescription,
|
|
8
|
+
AlertDialogFooter,
|
|
9
|
+
AlertDialogHeader,
|
|
10
|
+
} from '../ui/alert-dialog'
|
|
3
11
|
import { useIsApplicationOutdated } from '@contember/interface'
|
|
4
12
|
import { ClockIcon, RefreshCwIcon } from 'lucide-react'
|
|
5
13
|
import { dict } from '../dict'
|
|
@@ -25,7 +33,7 @@ export const OutdatedApplicationDialog: ComponentType = () => {
|
|
|
25
33
|
<div className="text-sm text-destructive">{dict.outdatedApplication.warning}</div>
|
|
26
34
|
<AlertDialogFooter>
|
|
27
35
|
<AlertDialogCancel onClick={postpone} className="gap-1">
|
|
28
|
-
<ClockIcon className="w-3 h-4"/>
|
|
36
|
+
<ClockIcon className="w-3 h-4" />
|
|
29
37
|
{dict.outdatedApplication.snooze}
|
|
30
38
|
</AlertDialogCancel>
|
|
31
39
|
<AlertDialogAction onClick={() => window.location.reload()} className="gap-1">
|
|
@@ -37,5 +45,3 @@ export const OutdatedApplicationDialog: ComponentType = () => {
|
|
|
37
45
|
</AlertDialog>
|
|
38
46
|
)
|
|
39
47
|
}
|
|
40
|
-
|
|
41
|
-
|
|
@@ -33,7 +33,8 @@ const RepeaterDragOverlayUI = uic('div', {
|
|
|
33
33
|
baseClass: 'rounded-sm border border-gray-300 p-4 relative bg-gray-100/60 backdrop-blur-xs',
|
|
34
34
|
})
|
|
35
35
|
const RepeaterHandleUI = uic('button', {
|
|
36
|
-
baseClass:
|
|
36
|
+
baseClass:
|
|
37
|
+
'absolute top-1/2 -left-7 h-6 w-6 flex justify-end align-center opacity-10 group-hover/repeater-item:opacity-30 hover:!opacity-100 transition-opacity -translate-y-1/2',
|
|
37
38
|
beforeChildren: <GripVerticalIcon size={16} />,
|
|
38
39
|
})
|
|
39
40
|
const RepeaterEmptyUI = uic('div', {
|
|
@@ -52,10 +53,12 @@ export const RepeaterAddItemButton = ({ children, index }: { children?: React.Re
|
|
|
52
53
|
<RepeaterAddItemTrigger index={index}>
|
|
53
54
|
<div>
|
|
54
55
|
<Button variant={'link'} size={'sm'} className={'gap-1 px-0'}>
|
|
55
|
-
{children ||
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
{children || (
|
|
57
|
+
<>
|
|
58
|
+
<PlusCircleIcon size={16} />
|
|
59
|
+
<span>{dict.repeater.addItem}</span>
|
|
60
|
+
</>
|
|
61
|
+
)}
|
|
59
62
|
</Button>
|
|
60
63
|
</div>
|
|
61
64
|
</RepeaterAddItemTrigger>
|
|
@@ -67,9 +70,11 @@ export const RepeaterAddItemButton = ({ children, index }: { children?: React.Re
|
|
|
67
70
|
export const RepeaterRemoveItemButton = ({ children }: { children?: React.ReactNode }) => (
|
|
68
71
|
<RepeaterRemoveItemTrigger>
|
|
69
72
|
<Button variant={'link'} size={'sm'} className={'gap-1 px-0 group/button'}>
|
|
70
|
-
{children ||
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
{children || (
|
|
74
|
+
<>
|
|
75
|
+
<Trash2Icon className={'group-hover/button:text-red-600'} size={16} />
|
|
76
|
+
</>
|
|
77
|
+
)}
|
|
73
78
|
</Button>
|
|
74
79
|
</RepeaterRemoveItemTrigger>
|
|
75
80
|
)
|
|
@@ -124,10 +129,12 @@ const DefaultRepeaterInner = Component<DefaultRepeaterProps>(({ title, children,
|
|
|
124
129
|
|
|
125
130
|
if (!isSortable) {
|
|
126
131
|
return (
|
|
127
|
-
<Repeater {...props}>
|
|
132
|
+
<Repeater {...props as RepeaterProps}>
|
|
128
133
|
<RepeaterWrapperUI>
|
|
129
134
|
{title && <h3 className={'font-medium'}>{title}</h3>}
|
|
130
|
-
{(addButtonPosition === 'before' || addButtonPosition === 'around') &&
|
|
135
|
+
{(addButtonPosition === 'before' || addButtonPosition === 'around') && (
|
|
136
|
+
<RepeaterAddItemButton index="first">{addButtonLabel}</RepeaterAddItemButton>
|
|
137
|
+
)}
|
|
131
138
|
<RepeaterEmpty>
|
|
132
139
|
<RepeaterEmptyUI>
|
|
133
140
|
{dict.repeater.empty}
|
|
@@ -144,10 +151,12 @@ const DefaultRepeaterInner = Component<DefaultRepeaterProps>(({ title, children,
|
|
|
144
151
|
)
|
|
145
152
|
}
|
|
146
153
|
return (
|
|
147
|
-
<Repeater {...props}>
|
|
154
|
+
<Repeater {...props as RepeaterProps}>
|
|
148
155
|
<RepeaterWrapperUI>
|
|
149
156
|
{title && <h3 className={'font-medium'}>{title}</h3>}
|
|
150
|
-
{(addButtonPosition === 'before' || addButtonPosition === 'around') &&
|
|
157
|
+
{(addButtonPosition === 'before' || addButtonPosition === 'around') && (
|
|
158
|
+
<RepeaterAddItemButton index="first">{addButtonLabel}</RepeaterAddItemButton>
|
|
159
|
+
)}
|
|
151
160
|
<RepeaterSortable>
|
|
152
161
|
<RepeaterEmpty>
|
|
153
162
|
<RepeaterEmptyUI>
|
|
@@ -5,7 +5,6 @@ import { SelectItemTrigger, SelectNewItem } from '@contember/react-select'
|
|
|
5
5
|
import { dict } from '../dict'
|
|
6
6
|
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogTrigger } from '../ui/dialog'
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
export const CreateEntityDialog = ({ trigger, children }: { trigger: ReactElement; children: ReactNode }) => {
|
|
10
9
|
return (
|
|
11
10
|
<Dialog>
|
|
@@ -25,10 +24,8 @@ export const CreateEntityDialog = ({ trigger, children }: { trigger: ReactElemen
|
|
|
25
24
|
</SelectItemTrigger>
|
|
26
25
|
</DialogClose>
|
|
27
26
|
</DialogFooter>
|
|
28
|
-
|
|
29
27
|
</SelectNewItem>
|
|
30
28
|
</DialogContent>
|
|
31
29
|
</Dialog>
|
|
32
30
|
)
|
|
33
31
|
}
|
|
34
|
-
|
|
@@ -4,7 +4,6 @@ import { DataViewHasFilterType, DataViewQueryFilterName, DataViewTextFilterInput
|
|
|
4
4
|
import { dict } from '../dict'
|
|
5
5
|
import { memo } from 'react'
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export const SelectDefaultFilter = memo(() => (
|
|
9
8
|
<DataViewHasFilterType name={DataViewQueryFilterName}>
|
|
10
9
|
<DataViewTextFilterInput name={DataViewQueryFilterName}>
|
|
@@ -27,33 +27,36 @@ export interface DefaultSelectDataViewProps {
|
|
|
27
27
|
children: ReactNode
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export const DefaultSelectDataView = Component<
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
export const DefaultSelectDataView = Component<DefaultSelectDataViewProps>(({ children, initialSorting, queryField }) => {
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<SelectDataView initialSorting={initialSorting} queryField={queryField}>
|
|
34
|
+
<DefaultSelectDataViewRenderer>
|
|
35
|
+
{children}
|
|
36
|
+
</DefaultSelectDataViewRenderer>
|
|
37
|
+
</SelectDataView>
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
38
40
|
})
|
|
39
41
|
|
|
40
|
-
const DefaultSelectDataViewRenderer = Component<{children: ReactNode}>(({ children }) =>
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const DefaultSelectDataViewRenderer = Component<{ children: ReactNode }>(({ children }) => (
|
|
43
|
+
<>
|
|
44
|
+
<SelectListInner filterToolbar={<SelectDefaultFilter />}>
|
|
45
|
+
<SelectOption>
|
|
46
|
+
<SelectItemTrigger>
|
|
47
|
+
<SelectListItemUI>
|
|
48
|
+
{children}
|
|
49
|
+
</SelectListItemUI>
|
|
50
|
+
</SelectItemTrigger>
|
|
51
|
+
</SelectOption>
|
|
52
|
+
</SelectListInner>
|
|
53
|
+
</>
|
|
54
|
+
))
|
|
51
55
|
|
|
52
|
-
export type SelectListProps =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
56
|
+
export type SelectListProps = {
|
|
57
|
+
children: ReactNode
|
|
58
|
+
filterToolbar?: ReactNode
|
|
59
|
+
}
|
|
57
60
|
|
|
58
61
|
export const SelectListInner = Component(({ children, filterToolbar }: SelectListProps) => {
|
|
59
62
|
return (
|
|
@@ -94,8 +97,10 @@ export const SelectListInner = Component(({ children, filterToolbar }: SelectLis
|
|
|
94
97
|
</DataViewInfiniteLoadProvider>
|
|
95
98
|
)
|
|
96
99
|
}, ({ children, filterToolbar }) => {
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
{filterToolbar}
|
|
103
|
+
{children}
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
101
106
|
})
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
RecursionTerminatorPortal,
|
|
4
|
-
SugaredQualifiedEntityList,
|
|
5
|
-
SugaredRelativeEntityList,
|
|
6
|
-
} from '@contember/interface'
|
|
1
|
+
import { Component, RecursionTerminatorPortal, SugaredQualifiedEntityList, SugaredRelativeEntityList } from '@contember/interface'
|
|
7
2
|
import { DataViewSortingDirections, DataViewUnionFilterFields } from '@contember/react-dataview'
|
|
8
3
|
import { useFormFieldId } from '@contember/react-form'
|
|
9
4
|
import { MultiSelect, SelectEachValue, SelectItemTrigger, SelectPlaceholder } from '@contember/react-select'
|
|
@@ -26,71 +21,72 @@ import {
|
|
|
26
21
|
SelectPopoverContent,
|
|
27
22
|
} from './ui'
|
|
28
23
|
|
|
29
|
-
export type MultiSelectInputProps =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const MultiSelectInput = Component<MultiSelectInputProps>(({ field, queryField, options, children, placeholder, createNewForm, initialSorting }) => {
|
|
41
|
-
const id = useFormFieldId()
|
|
24
|
+
export type MultiSelectInputProps = {
|
|
25
|
+
field: SugaredRelativeEntityList['field']
|
|
26
|
+
options?: SugaredQualifiedEntityList['entities']
|
|
27
|
+
children: ReactNode
|
|
28
|
+
placeholder?: ReactNode
|
|
29
|
+
createNewForm?: ReactNode
|
|
30
|
+
queryField?: DataViewUnionFilterFields
|
|
31
|
+
initialSorting?: DataViewSortingDirections
|
|
32
|
+
}
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<Popover>
|
|
47
|
-
<SelectInputWrapperUI>
|
|
48
|
-
<PopoverTrigger asChild>
|
|
49
|
-
<SelectInputUI id={id ? `${id}-input` : undefined}>
|
|
50
|
-
<SelectPlaceholder>
|
|
51
|
-
{placeholder ?? <SelectDefaultPlaceholderUI />}
|
|
52
|
-
</SelectPlaceholder>
|
|
34
|
+
export const MultiSelectInput = Component<MultiSelectInputProps>(
|
|
35
|
+
({ field, queryField, options, children, placeholder, createNewForm, initialSorting }) => {
|
|
36
|
+
const id = useFormFieldId()
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</SelectEachValue>
|
|
65
|
-
</MultiSelectItemWrapperUI>
|
|
38
|
+
return (
|
|
39
|
+
<MultiSelect field={field} options={options}>
|
|
40
|
+
<div className="flex gap-1 items-center">
|
|
41
|
+
<Popover>
|
|
42
|
+
<SelectInputWrapperUI>
|
|
43
|
+
<PopoverTrigger asChild>
|
|
44
|
+
<SelectInputUI id={id ? `${id}-input` : undefined}>
|
|
45
|
+
<SelectPlaceholder>
|
|
46
|
+
{placeholder ?? <SelectDefaultPlaceholderUI />}
|
|
47
|
+
</SelectPlaceholder>
|
|
66
48
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
<MultiSelectItemWrapperUI>
|
|
50
|
+
<SelectEachValue>
|
|
51
|
+
<MultiSelectItemUI>
|
|
52
|
+
<MultiSelectItemContentUI>
|
|
53
|
+
{children}
|
|
54
|
+
</MultiSelectItemContentUI>
|
|
55
|
+
<SelectItemTrigger>
|
|
56
|
+
<MultiSelectItemRemoveButtonUI onClick={e => e.stopPropagation()} />
|
|
57
|
+
</SelectItemTrigger>
|
|
58
|
+
</MultiSelectItemUI>
|
|
59
|
+
</SelectEachValue>
|
|
60
|
+
</MultiSelectItemWrapperUI>
|
|
72
61
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
62
|
+
<SelectInputActionsUI>
|
|
63
|
+
<ChevronDownIcon className="w-4 h-4" />
|
|
64
|
+
</SelectInputActionsUI>
|
|
65
|
+
</SelectInputUI>
|
|
66
|
+
</PopoverTrigger>
|
|
67
|
+
</SelectInputWrapperUI>
|
|
68
|
+
<SelectPopoverContent>
|
|
69
|
+
<DefaultSelectDataView initialSorting={initialSorting} queryField={queryField}>
|
|
70
|
+
{children}
|
|
71
|
+
</DefaultSelectDataView>
|
|
72
|
+
</SelectPopoverContent>
|
|
73
|
+
</Popover>
|
|
74
|
+
{createNewForm && (
|
|
75
|
+
<RecursionTerminatorPortal field={{ field, kind: 'hasMany' }}>
|
|
76
|
+
<CreateEntityDialog trigger={<SelectCreateNewTrigger />}>
|
|
77
|
+
{createNewForm}
|
|
78
|
+
</CreateEntityDialog>
|
|
79
|
+
</RecursionTerminatorPortal>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
</MultiSelect>
|
|
83
|
+
)
|
|
84
|
+
},
|
|
85
|
+
({ field, options, children }) => {
|
|
86
|
+
return (
|
|
87
|
+
<MultiSelect field={field} options={options}>
|
|
88
|
+
{children}
|
|
89
|
+
</MultiSelect>
|
|
90
|
+
)
|
|
91
|
+
},
|
|
92
|
+
)
|