@contember/create 2.1.0-alpha.30 → 2.1.0-alpha.35
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.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +4 -7
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +4 -7
- 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.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +4 -7
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +4 -7
- 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/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/package.json +12 -7
- package/resources/templates/default/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/admin/.env.production +6 -0
- 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/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 +14 -4
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +20 -8
- 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 +20 -14
- package/resources/templates/default/admin/lib/form/inputs.tsx +10 -6
- package/resources/templates/default/admin/lib/form/select.tsx +74 -42
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +56 -56
- package/resources/templates/default/admin/lib/form/upload.tsx +61 -65
- 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 +7 -5
- 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/dropdown.tsx +17 -14
- 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 +0 -1
- package/src/lib/TemplateInstaller.ts +3 -6
- package/src/run.ts +8 -7
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/resources/templates/default/admin/postcss.config.js +0 -5
|
@@ -49,18 +49,16 @@ export type DataGridEnumFilterProps =
|
|
|
49
49
|
* <DataGridEnumFilter field={'status'} />
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
|
-
export const DataGridEnumFilter = Component(({ options, label, ...props }: DataGridEnumFilterProps) =>
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
))
|
|
63
|
-
|
|
52
|
+
export const DataGridEnumFilter = Component(({ options, label, ...props }: DataGridEnumFilterProps) => (
|
|
53
|
+
<DataViewEnumFilter {...props}>
|
|
54
|
+
<DataGridFilterMobileHiding>
|
|
55
|
+
<DataGridSingleFilterUI>
|
|
56
|
+
<DataGridEnumFilterSelect options={options} label={label ?? <DataViewFieldLabel field={props.field} />} />
|
|
57
|
+
<DataGridEnumFilterList options={options} />
|
|
58
|
+
</DataGridSingleFilterUI>
|
|
59
|
+
</DataGridFilterMobileHiding>
|
|
60
|
+
</DataViewEnumFilter>
|
|
61
|
+
))
|
|
64
62
|
|
|
65
63
|
/**
|
|
66
64
|
* Props for {@link DataGridEnumListFilter}.
|
|
@@ -72,7 +70,6 @@ export type DataGridEnumListFilterProps =
|
|
|
72
70
|
label?: ReactNode
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
|
|
76
73
|
/**
|
|
77
74
|
* Enum list filter for DataGrid with default UI.
|
|
78
75
|
*
|
|
@@ -84,18 +81,16 @@ export type DataGridEnumListFilterProps =
|
|
|
84
81
|
* <DataGridEnumFilter field={'status'} />
|
|
85
82
|
* ```
|
|
86
83
|
*/
|
|
87
|
-
export const DataGridEnumListFilter = Component(({ options, label, ...props }: DataGridEnumListFilterProps) =>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
))
|
|
98
|
-
|
|
84
|
+
export const DataGridEnumListFilter = Component(({ options, label, ...props }: DataGridEnumListFilterProps) => (
|
|
85
|
+
<DataViewEnumListFilter {...props}>
|
|
86
|
+
<DataGridFilterMobileHiding>
|
|
87
|
+
<DataGridSingleFilterUI>
|
|
88
|
+
<DataGridEnumFilterSelect options={options} label={label ?? <DataViewFieldLabel field={props.field} />} />
|
|
89
|
+
<DataGridEnumFilterList options={options} />
|
|
90
|
+
</DataGridSingleFilterUI>
|
|
91
|
+
</DataGridFilterMobileHiding>
|
|
92
|
+
</DataViewEnumListFilter>
|
|
93
|
+
))
|
|
99
94
|
|
|
100
95
|
/**
|
|
101
96
|
* Props for {@link DataGridEnumFieldTooltip}.
|
|
@@ -108,7 +103,9 @@ export type DataGridEnumFieldTooltipProps = Omit<DataViewEnumFilterProps, 'child
|
|
|
108
103
|
* ## Props {@link DataGridEnumFieldTooltipProps}
|
|
109
104
|
* field, label, ?name, ?options
|
|
110
105
|
*/
|
|
111
|
-
export const DataGridEnumFieldTooltip = (
|
|
106
|
+
export const DataGridEnumFieldTooltip = (
|
|
107
|
+
{ children, actions, value, ...props }: DataGridEnumFieldTooltipProps & { children: ReactNode; value: string; actions?: ReactNode },
|
|
108
|
+
) => (
|
|
112
109
|
<DataViewEnumFilter {...props}>
|
|
113
110
|
<TooltipProvider>
|
|
114
111
|
<Tooltip>
|
|
@@ -131,7 +128,6 @@ export const DataGridEnumFieldTooltip = ({ children, actions, value, ...props }:
|
|
|
131
128
|
</DataViewEnumFilter>
|
|
132
129
|
)
|
|
133
130
|
|
|
134
|
-
|
|
135
131
|
const DataGridEnumFilterList = ({ options }: {
|
|
136
132
|
options?: Record<string, ReactNode>
|
|
137
133
|
}) => {
|
|
@@ -159,7 +155,6 @@ const DataGridEnumFilterSelectItem = ({ value, children, filterFactory }: {
|
|
|
159
155
|
children: ReactNode
|
|
160
156
|
filterFactory: (value: string) => UseDataViewEnumFilter
|
|
161
157
|
}) => {
|
|
162
|
-
|
|
163
158
|
const [current, setFilter] = filterFactory(value)
|
|
164
159
|
const include = useCallback(() => setFilter('toggleInclude'), [setFilter])
|
|
165
160
|
const exclude = useCallback(() => setFilter('toggleExclude'), [setFilter])
|
|
@@ -171,9 +166,8 @@ const DataGridEnumFilterSelectItem = ({ value, children, filterFactory }: {
|
|
|
171
166
|
{children}
|
|
172
167
|
</DataGridFilterSelectItemUI>
|
|
173
168
|
)
|
|
174
|
-
|
|
175
169
|
}
|
|
176
|
-
const DataGridEnumFilterSelect = ({
|
|
170
|
+
const DataGridEnumFilterSelect = ({ options, label }: {
|
|
177
171
|
options?: Record<string, ReactNode>
|
|
178
172
|
label?: ReactNode
|
|
179
173
|
}) => {
|
|
@@ -4,10 +4,9 @@ import { createContext, ReactNode, useContext } from 'react'
|
|
|
4
4
|
|
|
5
5
|
export const DataGridShowFiltersContext = createContext(true)
|
|
6
6
|
|
|
7
|
-
export const DataGridFilterMobileHiding = ({ name,
|
|
8
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
7
|
+
export const DataGridFilterMobileHiding = ({ name, children }: { name?: string; children: ReactNode }) => {
|
|
9
8
|
name ??= useDataViewFilterName()
|
|
10
|
-
const [
|
|
9
|
+
const [, , { isEmpty }] = useDataViewFilter(name)
|
|
11
10
|
const isActive = !isEmpty
|
|
12
11
|
const alwaysShow = useContext(DataGridShowFiltersContext)
|
|
13
12
|
return (
|
|
@@ -50,7 +50,6 @@ export const DataGridNumberFilter = Component(({ label, ...props }: DataGridNumb
|
|
|
50
50
|
</DataViewNumberFilter>
|
|
51
51
|
))
|
|
52
52
|
|
|
53
|
-
|
|
54
53
|
const DataGridNumberFilterRange = () => {
|
|
55
54
|
const [artifact] = useDataViewFilter<NumberRangeFilterArtifacts>(useDataViewFilterName())
|
|
56
55
|
if (!artifact) {
|
|
@@ -68,7 +67,6 @@ const DataGridNumberFilterRange = () => {
|
|
|
68
67
|
return null
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
|
|
72
70
|
const DataGridNumberFilterList = () => (
|
|
73
71
|
<>
|
|
74
72
|
<DataViewNumberFilterResetTrigger>
|
|
@@ -85,7 +83,6 @@ const DataGridNumberFilterList = () => (
|
|
|
85
83
|
</>
|
|
86
84
|
)
|
|
87
85
|
|
|
88
|
-
|
|
89
86
|
const DataGridNumberFilterSelect = ({ label }: {
|
|
90
87
|
label?: ReactNode
|
|
91
88
|
}) => (
|
|
@@ -87,7 +87,7 @@ export type DataGridHasManyFilterProps =
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
export const DataGridHasManyFilter = Component(({ label, children, ...props }: DataGridHasManyFilterProps) => (
|
|
90
|
-
<DataViewHasManyFilter {...props}
|
|
90
|
+
<DataViewHasManyFilter {...props}>
|
|
91
91
|
<DataGridFilterMobileHiding>
|
|
92
92
|
<DataGridRelationFilterInner label={label ?? <DataViewHasManyLabel field={props.field} />}>
|
|
93
93
|
{children}
|
|
@@ -144,16 +144,18 @@ export type DataGridHasOneTooltipProps =
|
|
|
144
144
|
* </HasOne>
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
export const DataGridHasOneTooltip = Component<DataGridHasOneTooltipProps>(({ children, actions, ...props }) => (
|
|
148
|
-
|
|
149
|
-
<
|
|
147
|
+
export const DataGridHasOneTooltip = Component<DataGridHasOneTooltipProps>(({ children, actions, ...props }) => (
|
|
148
|
+
<>
|
|
149
|
+
<DataViewHasOneFilter {...props as DataViewHasOneFilterProps}>
|
|
150
|
+
<DataGridRelationFieldTooltipInner actions={actions}>
|
|
151
|
+
{children}
|
|
152
|
+
</DataGridRelationFieldTooltipInner>
|
|
153
|
+
</DataViewHasOneFilter>
|
|
154
|
+
<StaticRender>
|
|
150
155
|
{children}
|
|
151
|
-
</
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
{children}
|
|
155
|
-
</StaticRender>
|
|
156
|
-
</>))
|
|
156
|
+
</StaticRender>
|
|
157
|
+
</>
|
|
158
|
+
))
|
|
157
159
|
|
|
158
160
|
/**
|
|
159
161
|
* Props for {@link DataGridHasManyTooltip}.
|
|
@@ -187,16 +189,18 @@ export type DataGridHasManyTooltipProps =
|
|
|
187
189
|
* ```
|
|
188
190
|
*/
|
|
189
191
|
export const DataGridHasManyTooltip = Component<DataGridHasManyTooltipProps>(({ children, actions, ...props }) => {
|
|
190
|
-
return (
|
|
191
|
-
|
|
192
|
-
<
|
|
192
|
+
return (
|
|
193
|
+
<>
|
|
194
|
+
<DataViewHasManyFilter {...props as DataViewHasManyFilterProps}>
|
|
195
|
+
<DataGridRelationFieldTooltipInner actions={actions}>
|
|
196
|
+
{children}
|
|
197
|
+
</DataGridRelationFieldTooltipInner>
|
|
198
|
+
</DataViewHasManyFilter>
|
|
199
|
+
<StaticRender>
|
|
193
200
|
{children}
|
|
194
|
-
</
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{children}
|
|
198
|
-
</StaticRender>
|
|
199
|
-
</>)
|
|
201
|
+
</StaticRender>
|
|
202
|
+
</>
|
|
203
|
+
)
|
|
200
204
|
})
|
|
201
205
|
|
|
202
206
|
const DataGridRelationFieldTooltipInner = Component(({ children, actions }: { children: ReactNode; actions?: ReactNode }) => (
|
|
@@ -242,7 +246,9 @@ export const DataGridRelationFilteredItemsList = ({ children }: {
|
|
|
242
246
|
</>
|
|
243
247
|
)
|
|
244
248
|
|
|
245
|
-
const [, useFilterFactory, FilterFactoryContextProvider] = createRequiredContext<(value: EntityId) => UseDataViewRelationFilterResult>(
|
|
249
|
+
const [, useFilterFactory, FilterFactoryContextProvider] = createRequiredContext<(value: EntityId) => UseDataViewRelationFilterResult>(
|
|
250
|
+
'FilterFactoryContext',
|
|
251
|
+
)
|
|
246
252
|
|
|
247
253
|
type DataGridRelationFilterSelectItemProps = {
|
|
248
254
|
children: ReactNode
|
|
@@ -268,7 +274,6 @@ const DataGridRelationFilterSelectItem = forwardRef<HTMLButtonElement, DataGridR
|
|
|
268
274
|
)
|
|
269
275
|
})
|
|
270
276
|
|
|
271
|
-
|
|
272
277
|
const DataGridRelationFilterSelect = ({ children, queryField, label }: {
|
|
273
278
|
queryField?: DataViewUnionFilterFields
|
|
274
279
|
children: ReactNode
|
|
@@ -315,12 +320,13 @@ type DataGridRelationFilterControlsInnerProps = {
|
|
|
315
320
|
children: ReactNode
|
|
316
321
|
}
|
|
317
322
|
const DataGridRelationFilterControlsInner = Component<DataGridRelationFilterControlsInnerProps>(({ children }) => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
return (
|
|
324
|
+
<>
|
|
325
|
+
<SelectListInner filterToolbar={<SelectDefaultFilter />}>
|
|
326
|
+
<DataGridRelationFilterSelectItem>
|
|
327
|
+
{children}
|
|
328
|
+
</DataGridRelationFilterSelectItem>
|
|
329
|
+
</SelectListInner>
|
|
330
|
+
</>
|
|
331
|
+
)
|
|
326
332
|
})
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
2
|
+
createDataGridDateRange,
|
|
3
3
|
DataGridBooleanFilter,
|
|
4
|
-
type
|
|
4
|
+
type DataGridBooleanFilterProps,
|
|
5
5
|
DataGridDateFilter,
|
|
6
|
-
type
|
|
7
|
-
createDataGridDateRange,
|
|
8
|
-
type DataGridIsDefinedFilterProps,
|
|
9
|
-
DataGridIsDefinedFilter,
|
|
10
|
-
type DataGridEnumFilterProps,
|
|
11
|
-
DataGridEnumFilter,
|
|
12
|
-
type DataGridEnumFieldTooltipProps,
|
|
6
|
+
type DataGridDateFilterProps,
|
|
13
7
|
DataGridEnumFieldTooltip,
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
type
|
|
17
|
-
DataGridTextFilter,
|
|
18
|
-
type DataGridUnionTextFilterProps,
|
|
19
|
-
DataGridUnionTextFilter,
|
|
20
|
-
type DataGridQueryFilterProps,
|
|
21
|
-
DataGridQueryFilter,
|
|
22
|
-
type DataGridHasManyFilterProps,
|
|
8
|
+
type DataGridEnumFieldTooltipProps,
|
|
9
|
+
DataGridEnumFilter,
|
|
10
|
+
type DataGridEnumFilterProps,
|
|
23
11
|
DataGridHasManyFilter,
|
|
24
|
-
type
|
|
12
|
+
type DataGridHasManyFilterProps,
|
|
25
13
|
DataGridHasManyTooltip,
|
|
26
|
-
type
|
|
14
|
+
type DataGridHasManyTooltipProps,
|
|
27
15
|
DataGridHasOneFilter,
|
|
28
|
-
type
|
|
16
|
+
type DataGridHasOneFilterProps,
|
|
29
17
|
DataGridHasOneTooltip,
|
|
18
|
+
type DataGridHasOneTooltipProps,
|
|
19
|
+
DataGridIsDefinedFilter,
|
|
20
|
+
type DataGridIsDefinedFilterProps,
|
|
21
|
+
DataGridNumberFilter,
|
|
22
|
+
type DataGridNumberFilterProps,
|
|
23
|
+
type DataGridPredefinedDateRange,
|
|
24
|
+
DataGridQueryFilter,
|
|
25
|
+
type DataGridQueryFilterProps,
|
|
26
|
+
DataGridTextFilter,
|
|
27
|
+
type DataGridTextFilterProps,
|
|
28
|
+
DataGridUnionTextFilter,
|
|
29
|
+
type DataGridUnionTextFilterProps,
|
|
30
30
|
} from './filters'
|
|
31
31
|
|
|
32
32
|
export * from './cells'
|
|
@@ -42,11 +42,6 @@ export const DataGridLoader = ({ children }: { children: ReactNode }) => (
|
|
|
42
42
|
</>
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
+
const DataGridOverlayLoader = () => <Loader position={'absolute'} />
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
-
<Loader position={'absolute'} />
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const DataGridInitialLoader = () => (
|
|
51
|
-
<Loader position={'static'} />
|
|
52
|
-
)
|
|
47
|
+
const DataGridInitialLoader = () => <Loader position={'static'} />
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataViewChangePageTrigger,
|
|
3
|
-
DataViewPagingStateView,
|
|
4
|
-
DataViewSetItemsPerPageTrigger,
|
|
5
|
-
} from '@contember/react-dataview'
|
|
1
|
+
import { DataViewChangePageTrigger, DataViewPagingStateView, DataViewSetItemsPerPageTrigger } from '@contember/react-dataview'
|
|
6
2
|
import { DropdownMenu } from '@radix-ui/react-dropdown-menu'
|
|
7
|
-
import {
|
|
8
|
-
ChevronDownIcon,
|
|
9
|
-
ChevronLeftIcon,
|
|
10
|
-
ChevronRightIcon,
|
|
11
|
-
ChevronsLeftIcon,
|
|
12
|
-
ChevronsRightIcon,
|
|
13
|
-
Loader2Icon,
|
|
14
|
-
} from 'lucide-react'
|
|
3
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon, Loader2Icon } from 'lucide-react'
|
|
15
4
|
import { FC } from 'react'
|
|
16
5
|
import { dict, dictFormat } from '../dict'
|
|
17
6
|
import { Button } from '../ui/button'
|
|
@@ -42,29 +31,37 @@ interface DataGridPaginationProps {
|
|
|
42
31
|
export const DataGridPagination: FC<DataGridPaginationProps> = ({ sticky }) => (
|
|
43
32
|
<PaginationWrapper sticky={sticky}>
|
|
44
33
|
<div>
|
|
45
|
-
<DataViewPagingStateView
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
<DataViewPagingStateView
|
|
35
|
+
render={it => (
|
|
36
|
+
<>
|
|
37
|
+
<div className="flex gap-2 items-center">
|
|
38
|
+
<div className="font-normal text-sm text-gray-500">
|
|
39
|
+
{it.totalCount === undefined
|
|
40
|
+
? <Loader2Icon className="animate-spin h-3 w-3 inline-block" />
|
|
41
|
+
: dictFormat(dict.datagrid.pageRowsCount, {
|
|
42
|
+
totalCount: it.totalCount.toString(),
|
|
43
|
+
})}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
/>
|
|
56
49
|
</div>
|
|
57
50
|
<div className="flex items-center space-x-2">
|
|
58
|
-
<DataViewPagingStateView
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
<DataViewPagingStateView
|
|
52
|
+
render={it => (
|
|
53
|
+
<>
|
|
54
|
+
<div className="flex gap-2 items-center">
|
|
55
|
+
<div className="text-sm">
|
|
56
|
+
{dictFormat(it.pagesCount !== undefined ? dict.datagrid.pageInfo : dict.datagrid.pageInfoShort, {
|
|
57
|
+
page: (it.pageIndex + 1).toString(),
|
|
58
|
+
pagesCount: it.pagesCount?.toString() ?? '',
|
|
59
|
+
})}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
/>
|
|
68
65
|
<DataViewChangePageTrigger page="first">
|
|
69
66
|
<Button
|
|
70
67
|
variant="outline"
|
|
@@ -105,12 +102,10 @@ export const DataGridPagination: FC<DataGridPaginationProps> = ({ sticky }) => (
|
|
|
105
102
|
</PaginationWrapper>
|
|
106
103
|
)
|
|
107
104
|
|
|
108
|
-
|
|
109
105
|
export const DataGridPerPageSelector = () => (
|
|
110
106
|
<div>
|
|
111
107
|
<p className="text-gray-400 text-xs font-semibold mb-1">{dict.datagrid.paginationRowsPerPage}</p>
|
|
112
|
-
<DropdownMenu
|
|
113
|
-
>
|
|
108
|
+
<DropdownMenu>
|
|
114
109
|
<DropdownMenuTrigger asChild>
|
|
115
110
|
<Button
|
|
116
111
|
variant="outline"
|
|
@@ -30,10 +30,12 @@ export const DataGridTable = Component<DataViewTableProps>(({ children }) => {
|
|
|
30
30
|
return (
|
|
31
31
|
<DataViewLayout
|
|
32
32
|
name="table"
|
|
33
|
-
label={
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
label={
|
|
34
|
+
<>
|
|
35
|
+
<SheetIcon className="w-3 h-3" />
|
|
36
|
+
<span>{dict.datagrid.showTable}</span>
|
|
37
|
+
</>
|
|
38
|
+
}
|
|
37
39
|
>
|
|
38
40
|
<div className="relative rounded-md border border-gray-200 overflow-y-auto">
|
|
39
41
|
<DataGridTableRenderer>
|
|
@@ -81,7 +83,7 @@ const DataGridTableRenderer = Component<DataViewTableProps>(({ children }, env)
|
|
|
81
83
|
return <>{children}</>
|
|
82
84
|
})
|
|
83
85
|
|
|
84
|
-
const columnLeaf = new Leaf(node => node.props, DataGridColumnLeaf)
|
|
86
|
+
const columnLeaf = new Leaf(node => node.props as DataGridColumnLeafProps, DataGridColumnLeaf)
|
|
85
87
|
|
|
86
88
|
const datagridColumnsAnalyzer = new ChildrenAnalyzer<
|
|
87
89
|
DataGridColumnLeafProps,
|
|
@@ -23,12 +23,17 @@ export interface DataGridTilesProps {
|
|
|
23
23
|
* </DataGridTiles>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export const DataGridTiles = Component<
|
|
26
|
+
export const DataGridTiles = Component<DataGridTilesProps>(({ children, className }) => {
|
|
27
27
|
return (
|
|
28
|
-
<DataViewLayout
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
<DataViewLayout
|
|
29
|
+
name={'grid'}
|
|
30
|
+
label={
|
|
31
|
+
<>
|
|
32
|
+
<LayoutGridIcon className={'w-3 h-3'} />
|
|
33
|
+
<span>{dict.datagrid.showGrid}</span>
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
>
|
|
32
37
|
<div className={cn('grid grid-cols-2 md:grid-cols-4 gap-4', className)}>
|
|
33
38
|
<DataViewEachRow>
|
|
34
39
|
{children}
|
|
@@ -70,7 +70,6 @@ export const DataGridToolbar = Component<DataGridToolbarProps>(({ children, stic
|
|
|
70
70
|
<DataGridToolbarVisibleElements />
|
|
71
71
|
<DataGridPerPageSelector />
|
|
72
72
|
</div>
|
|
73
|
-
|
|
74
73
|
</PopoverContent>
|
|
75
74
|
</Popover>
|
|
76
75
|
|
|
@@ -83,13 +82,17 @@ export const DataGridToolbar = Component<DataGridToolbarProps>(({ children, stic
|
|
|
83
82
|
</div>
|
|
84
83
|
|
|
85
84
|
<div className="flex flex-1 flex-wrap gap-2">
|
|
86
|
-
{children ??
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
{children ?? (
|
|
86
|
+
<>
|
|
87
|
+
<DataGridQueryFilter />
|
|
88
|
+
</>
|
|
89
|
+
)}
|
|
89
90
|
</div>
|
|
90
91
|
</DataGridToolbarUI>
|
|
91
92
|
</DataGridShowFiltersContext.Provider>
|
|
92
93
|
)
|
|
93
|
-
}, ({ children }) =>
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
}, ({ children }) => (
|
|
95
|
+
<>
|
|
96
|
+
{children}
|
|
97
|
+
</>
|
|
98
|
+
))
|
|
@@ -67,11 +67,8 @@ export const DataGridActiveFilterUI = forwardRef<HTMLButtonElement, {
|
|
|
67
67
|
)
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
|
|
71
70
|
export const DataGridSingleFilterUI = forwardRef<HTMLDivElement, { children: ReactNode }>((props, ref) => {
|
|
72
|
-
return
|
|
73
|
-
<div className="flex flex-wrap gap-2 rounded-sm bg-gray-50 items-center text-sm px-2 py-1.5 border border-gray-200" ref={ref} {...props} />
|
|
74
|
-
)
|
|
71
|
+
return <div className="flex flex-wrap gap-2 rounded-sm bg-gray-50 items-center text-sm px-2 py-1.5 border border-gray-200" ref={ref} {...props} />
|
|
75
72
|
})
|
|
76
73
|
|
|
77
74
|
export const DataGridFilterSelectTriggerUI = forwardRef<HTMLButtonElement, { children: ReactNode }>(({
|
|
@@ -80,12 +77,12 @@ export const DataGridFilterSelectTriggerUI = forwardRef<HTMLButtonElement, { chi
|
|
|
80
77
|
}, ref) => {
|
|
81
78
|
return (
|
|
82
79
|
<button className="hover:underline inline-flex items-center gap-2 group px-1" ref={ref} {...props}>
|
|
83
|
-
{children &&
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
>
|
|
80
|
+
{children && (
|
|
81
|
+
<span className="text-xs font-medium">
|
|
82
|
+
{children}
|
|
83
|
+
</span>
|
|
84
|
+
)}
|
|
85
|
+
<span className="bg-gray-100 rounded-full border border-gray-200 group-data-[state=open]:bg-background group-data-[state=open]:shadow-inner h-5 w-5 inline-flex items-center justify-center">
|
|
89
86
|
<PlusIcon className="w-3 h-3" />
|
|
90
87
|
</span>
|
|
91
88
|
</button>
|
|
@@ -125,7 +122,9 @@ export const DataGridFilterSelectItemUI = forwardRef<HTMLButtonElement, DataGrid
|
|
|
125
122
|
onClick={include}
|
|
126
123
|
size="sm"
|
|
127
124
|
className="pl-1 w-full text-left justify-start gap-1 data-[highlighted]:bg-gray-200"
|
|
128
|
-
variant="ghost"
|
|
125
|
+
variant="ghost"
|
|
126
|
+
{...props}
|
|
127
|
+
>
|
|
129
128
|
{isIncluded ? <CheckSquareIcon className="w-3 h-3" /> : <SquareIcon className="w-3 h-3" />}
|
|
130
129
|
<span className={cn('font-normal', isIncluded && 'text-blue-700')}>
|
|
131
130
|
{children}
|
|
@@ -141,11 +140,9 @@ export const DataGridFilterSelectItemUI = forwardRef<HTMLButtonElement, DataGrid
|
|
|
141
140
|
<FilterXIcon className="h-3 w-3" />
|
|
142
141
|
</button>
|
|
143
142
|
</div>
|
|
144
|
-
|
|
145
143
|
)
|
|
146
144
|
})
|
|
147
145
|
|
|
148
|
-
|
|
149
146
|
export const DataGridToolbarUI = uic('div', {
|
|
150
147
|
baseClass: 'flex flex-col md:flex-row gap-2 md:items-end mb-4 items-stretch',
|
|
151
148
|
variants: {
|
|
@@ -8,21 +8,23 @@ export const LoginWithEmail = () => {
|
|
|
8
8
|
const sessionToken = useSessionTokenWithMeta()
|
|
9
9
|
const setSessionToken = useSetSessionToken()
|
|
10
10
|
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<CreateSessionTokenForm
|
|
14
|
+
expiration={3600 * 24 * 7}
|
|
15
|
+
apiToken={sessionToken.propsToken}
|
|
16
|
+
onSuccess={it => {
|
|
17
|
+
setSessionToken(it.result.token)
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<form>
|
|
21
|
+
<CreateSessionTokenFormFields />
|
|
22
|
+
</form>
|
|
23
|
+
</CreateSessionTokenForm>
|
|
24
|
+
</>
|
|
25
|
+
)
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
|
|
26
28
|
const CreateSessionTokenFormFields = () => {
|
|
27
29
|
const form = useCreateSessionTokenForm()
|
|
28
30
|
|
|
@@ -38,12 +40,17 @@ const CreateSessionTokenFormFields = () => {
|
|
|
38
40
|
{form.state === 'submitting' ? <Loader position="absolute" /> : null}
|
|
39
41
|
|
|
40
42
|
<TenantFormError
|
|
41
|
-
form={form}
|
|
43
|
+
form={form}
|
|
44
|
+
messages={messages}
|
|
42
45
|
/>
|
|
43
46
|
|
|
44
47
|
<TenantFormField
|
|
45
|
-
form={form}
|
|
46
|
-
|
|
48
|
+
form={form}
|
|
49
|
+
messages={messages}
|
|
50
|
+
field="email"
|
|
51
|
+
type="text"
|
|
52
|
+
required
|
|
53
|
+
autoFocus
|
|
47
54
|
>
|
|
48
55
|
E-mail
|
|
49
56
|
</TenantFormField>
|
|
@@ -2,7 +2,17 @@ import { TextFilterArtifactsMatchMode } from '@contember/react-dataview'
|
|
|
2
2
|
import { InviteErrorCodes } from './tenant/hooks/useInvite'
|
|
3
3
|
import { UploaderErrorType } from '@contember/react-uploader'
|
|
4
4
|
import { ChangeMyPasswordFormErrorCode, CreateApiKeyFormErrorCode } from '@contember/interface'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
InviteFormErrorCode,
|
|
7
|
+
LoginFormErrorCode,
|
|
8
|
+
OtpConfirmFormErrorCode,
|
|
9
|
+
OtpPrepareFormErrorCode,
|
|
10
|
+
PasswordlessSignInFormErrorCode,
|
|
11
|
+
PasswordlessSignInInitFormErrorCode,
|
|
12
|
+
PasswordResetFormErrorCode,
|
|
13
|
+
PasswordResetRequestFormErrorCode,
|
|
14
|
+
UpdateProjectMemberFormErrorCode,
|
|
15
|
+
} from '@contember/react-identity'
|
|
6
16
|
import { ActivatePasswordlessOtpErrorCode, WeakPasswordReason } from '@contember/graphql-client-tenant'
|
|
7
17
|
|
|
8
18
|
export const dict = {
|
|
@@ -67,7 +77,6 @@ export const dict = {
|
|
|
67
77
|
filters: 'Filters',
|
|
68
78
|
exclude: 'Exclude',
|
|
69
79
|
export: 'Export',
|
|
70
|
-
|
|
71
80
|
},
|
|
72
81
|
select: {
|
|
73
82
|
confirmNew: 'Confirm',
|
|
@@ -99,7 +108,7 @@ export const dict = {
|
|
|
99
108
|
VARIABLE_EMPTY: 'Variable is empty',
|
|
100
109
|
VARIABLE_NOT_FOUND: 'Variable not found',
|
|
101
110
|
fallback: 'Failed to invite user',
|
|
102
|
-
} satisfies Record<InviteErrorCodes | 'fallback',
|
|
111
|
+
} satisfies Record<InviteErrorCodes | 'fallback', string>,
|
|
103
112
|
uploader: {
|
|
104
113
|
uploadErrors: {
|
|
105
114
|
httpError: 'HTTP error',
|
|
@@ -258,7 +267,8 @@ export const dict = {
|
|
|
258
267
|
disable: 'Disable',
|
|
259
268
|
disabledSuccess: 'Two-factor authentication was disabled.',
|
|
260
269
|
setupAgain: 'Setup again',
|
|
261
|
-
description:
|
|
270
|
+
description:
|
|
271
|
+
'2-Step Verification provides stronger security for your account by requiring a second step of verification when you sign in. In addition to your password, you’ll also need a code generated by an application on your phone.',
|
|
262
272
|
setupTwoFactor: 'Setup two-factor authentication',
|
|
263
273
|
enabledSuccess: 'Two-factor authentication was enabled.',
|
|
264
274
|
otpToken: 'OTP token',
|