Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010788
single-reference.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
999 B
Referenced Files
None
Subscribers
None
single-reference.ts
View Options
import
SealiousSingleReference
from
"sealious/@types/src/app/base-chips/field-types/single-reference.js"
;
import
{
CollectionField
}
from
"../fields/collection-field.js"
;
import
{
DropdownOptions
,
FreeformDropdown
}
from
"./dropdown.js"
;
import
{
Collection
,
CollectionItem
}
from
"sealious"
;
export
class
SingleReferenceDropdown
<
F
extends
SealiousSingleReference
,
Required
extends
boolean
>
extends
FreeformDropdown
{
constructor
(
public
field
:
CollectionField
<
F
,
Required
>
,
public
options
:
DropdownOptions
&
{
getLabel
?:
(
item
:
CollectionItem
<
Collection
>
)
=>
string
;
}
=
{
label
:
field
.
name
,
autosubmit
:
false
,
autocomplete
:
true
,
}
)
{
super
(
field
,
async
(
ctx
)
=>
{
const
{
items
}
=
await
ctx
.
$app
.
collections
[
field
.
sealiousField
.
target_collection
]
.
list
(
ctx
.
$context
)
.
fetch
();
return
items
.
map
((
item
)
=>
({
value
:
item
.
id
,
label
:
options
.
getLabel
?
options
.
getLabel
(
item
)
:
item
.
id
,
}));
},
options
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:47 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
661894
Default Alt Text
single-reference.ts (999 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment