2023-03-14 13:18:55 +00:00
|
|
|
{{!
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 13:18:55 +00:00
|
|
|
}}
|
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
<div
|
2020-12-09 19:12:17 +00:00
|
|
|
class="child-selector {{type}}-child-selector"
|
2020-11-09 09:25:35 +00:00
|
|
|
...attributes
|
|
|
|
>
|
2019-05-01 18:09:29 +00:00
|
|
|
{{yield}}
|
2021-03-11 09:29:11 +00:00
|
|
|
{{#if (not disabled)}}
|
2020-02-19 19:26:38 +00:00
|
|
|
<YieldSlot @name="create">{{yield}}</YieldSlot>
|
2019-05-01 18:09:29 +00:00
|
|
|
<label class="type-text">
|
2020-02-19 19:26:38 +00:00
|
|
|
<span><YieldSlot @name="label">{{yield}}</YieldSlot></span>
|
2020-04-22 16:30:26 +00:00
|
|
|
{{#if isOpen}}
|
|
|
|
<DataSource
|
2021-09-15 18:50:11 +00:00
|
|
|
@src={{uri '/${partition}/${nspace}/${dc}/${type}'
|
|
|
|
(hash
|
|
|
|
partition=partition
|
|
|
|
nspace=nspace
|
|
|
|
dc=dc
|
|
|
|
type=(pluralize type)
|
|
|
|
)
|
|
|
|
}}
|
2020-04-22 16:30:26 +00:00
|
|
|
@onchange={{action (mut allOptions) value="data"}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
2020-12-09 19:12:17 +00:00
|
|
|
<DataCollection
|
|
|
|
@type={{type}}
|
|
|
|
@sort='Name:asc'
|
|
|
|
@filters={{hash
|
|
|
|
searchproperties=(array 'Name')
|
|
|
|
}}
|
|
|
|
@items={{options}}
|
|
|
|
as |collection|>
|
2020-02-21 16:48:54 +00:00
|
|
|
<PowerSelect
|
2020-12-09 19:12:17 +00:00
|
|
|
@searchEnabled={{true}}
|
|
|
|
@search={{action collection.search}}
|
2021-01-04 18:28:35 +00:00
|
|
|
@options={{sort-by 'Name:asc' options}}
|
2020-12-09 19:12:17 +00:00
|
|
|
@loadingMessage="Loading..."
|
|
|
|
@searchMessage="No possible options"
|
|
|
|
@searchPlaceholder={{placeholder}}
|
|
|
|
@onOpen={{action (mut isOpen) true}}
|
|
|
|
@onClose={{action (mut isOpen) false}}
|
|
|
|
@onChange={{action "change" "items[]" items}}
|
|
|
|
as |item|>
|
2020-02-19 19:26:38 +00:00
|
|
|
<YieldSlot @name="option" @params={{block-params item}}>{{yield}}</YieldSlot>
|
|
|
|
</PowerSelect>
|
2020-12-09 19:12:17 +00:00
|
|
|
</DataCollection>
|
2019-05-01 18:09:29 +00:00
|
|
|
</label>
|
2021-03-11 09:29:11 +00:00
|
|
|
{{/if}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{#if (gt items.length 0)}}
|
2020-02-19 19:26:38 +00:00
|
|
|
<YieldSlot @name="set">{{yield}}</YieldSlot>
|
2019-05-01 18:09:29 +00:00
|
|
|
{{else}}
|
|
|
|
|
2020-05-11 15:37:11 +00:00
|
|
|
{{/if}}
|
|
|
|
</div>
|