mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
* Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License. Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUS-1.1 * Fix test that expected exact offset on hcl file --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Sarah Thompson <sthompson@hashicorp.com> Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
44 lines
1.9 KiB
JavaScript
44 lines
1.9 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@ember/component';
|
|
import layout from '../templates/components/select';
|
|
|
|
/**
|
|
* @module Select
|
|
* Select components are used to render a dropdown.
|
|
*
|
|
* @example
|
|
* ```js
|
|
* <Select @label='Date Range' @options={{[{ value: 'berry', label: 'Berry' }]}} @onChange={{onChange}}/>
|
|
* ```
|
|
*
|
|
* @param {string} [label=null] - The label for the select element.
|
|
* @param {Array} [options=null] - A list of items that the user will select from. This can be an array of strings or objects.
|
|
* @param {string} [selectedValue=null] - The currently selected item. Can also be used to set the default selected item. This should correspond to the `value` of one of the `<option>`s.
|
|
* @param {string} [name = null] - The name of the select, used for the test selector.
|
|
* @param {string} [valueAttribute = value]- When `options` is an array objects, the key to check for when assigning the option elements value.
|
|
* @param {string} [labelAttribute = label] - When `options` is an array objects, the key to check for when assigning the option elements' inner text.
|
|
* @param {boolean} [isInline = false] - Whether or not the select should be displayed as inline-block or block.
|
|
* @param {boolean} [isFullwidth = false] - Whether or not the select should take up the full width of the parent element.
|
|
* @param {boolean} [noDefault = false] - shows Select One with empty value as first option
|
|
* @param {Func} [onChange] - The action to take once the user has selected an item. This method will be passed the `value` of the select.
|
|
*/
|
|
|
|
export default Component.extend({
|
|
layout,
|
|
classNames: ['field'],
|
|
label: null,
|
|
selectedValue: null,
|
|
name: null,
|
|
options: null,
|
|
valueAttribute: 'value',
|
|
labelAttribute: 'label',
|
|
isInline: false,
|
|
isFullwidth: false,
|
|
noDefault: false,
|
|
onChange() {},
|
|
});
|