mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 05:53:09 +03:00
add $move descriptor
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
4f4d2f8e48
commit
fe2d8176f1
@ -85,6 +85,14 @@ export interface Position<X extends PropertyType> {
|
||||
$position: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface MoveDescriptor<X extends PropertyType> {
|
||||
$value: X
|
||||
$position: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@ -92,6 +100,13 @@ export type ArrayAsElementPosition<T extends Doc> = {
|
||||
[P in keyof T]: T[P] extends Arr<infer X> ? X | Position<X> : never
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type ArrayMoveDescriptor<T extends Doc> = {
|
||||
[P in keyof T]: T[P] extends Arr<infer X> ? MoveDescriptor<X> : never
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@ -110,6 +125,7 @@ export type OmitNever<T extends object> = Omit<T, KeysByType<T, never>>
|
||||
export interface PushOptions<T extends Doc> {
|
||||
$push?: Partial<OmitNever<ArrayAsElementPosition<T>>>
|
||||
$pull?: Partial<OmitNever<ArrayAsElement<T>>>
|
||||
$move?: Partial<OmitNever<ArrayMoveDescriptor<T>>>
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,6 @@
|
||||
<KanbanCardEmpty label={'Create new application'} />
|
||||
{#each objects as object, j}
|
||||
{#if object.state === state._id}
|
||||
{j}
|
||||
<div
|
||||
on:dragover|preventDefault={(ev) => {
|
||||
dragover(ev, object)
|
||||
|
Loading…
Reference in New Issue
Block a user