mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 07:10:02 +00: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
|
$position: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export interface MoveDescriptor<X extends PropertyType> {
|
||||||
|
$value: X
|
||||||
|
$position: number
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @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
|
[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
|
* @public
|
||||||
*/
|
*/
|
||||||
@ -110,6 +125,7 @@ export type OmitNever<T extends object> = Omit<T, KeysByType<T, never>>
|
|||||||
export interface PushOptions<T extends Doc> {
|
export interface PushOptions<T extends Doc> {
|
||||||
$push?: Partial<OmitNever<ArrayAsElementPosition<T>>>
|
$push?: Partial<OmitNever<ArrayAsElementPosition<T>>>
|
||||||
$pull?: Partial<OmitNever<ArrayAsElement<T>>>
|
$pull?: Partial<OmitNever<ArrayAsElement<T>>>
|
||||||
|
$move?: Partial<OmitNever<ArrayMoveDescriptor<T>>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,7 +181,6 @@
|
|||||||
<KanbanCardEmpty label={'Create new application'} />
|
<KanbanCardEmpty label={'Create new application'} />
|
||||||
{#each objects as object, j}
|
{#each objects as object, j}
|
||||||
{#if object.state === state._id}
|
{#if object.state === state._id}
|
||||||
{j}
|
|
||||||
<div
|
<div
|
||||||
on:dragover|preventDefault={(ev) => {
|
on:dragover|preventDefault={(ev) => {
|
||||||
dragover(ev, object)
|
dragover(ev, object)
|
||||||
|
Loading…
Reference in New Issue
Block a user