Skip to content

Commit

Permalink
Fixes #1431 - Rename and remove properties from clay-multiselect
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Lancha committed Jan 10, 2019
1 parent 4e9d312 commit b8c48aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 42 deletions.
25 changes: 3 additions & 22 deletions packages/clay-multi-select/src/ClayMultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class ClayMultiSelect extends ClayComponent {
*/
_handleDropdownItemClick(event) {
this.filteredItems = [];
this.inputValue = '';
this.refs.autocomplete.refs.input.focus();

const value = this._performCall(this.valueLocator, event.data);
Expand Down Expand Up @@ -428,22 +427,13 @@ ClayMultiSelect.STATE = {
initialData: Config.oneOfType([Config.object(), Config.array()]),

/**
* Name of the input.
* @default undefind
* @instance
* @memberof ClayMultiSelect
* @type {?(string|undefined)}
*/
inputName: Config.string(),

/**
* Value of the input.
* @default undefined
* Name for each selected item input hidden.
* @default selectedItems
* @instance
* @memberof ClayMultiSelect
* @type {?(string|undefined)}
*/
inputValue: Config.string(),
inputName: Config.string().value('selectedItems'),

/**
* Set ups the request options
Expand Down Expand Up @@ -519,15 +509,6 @@ ClayMultiSelect.STATE = {
*/
selectedItems: Config.array(Config.object()).value([]),

/**
* Name of the selected items input.
* @default selectedItems
* @instance
* @memberof ClayMultiSelect
* @type {?(string|undefined)}
*/
selectedItemsInputName: Config.string().value('selectedItems'),

/**
* The path to the SVG spritemap file containing the icons.
* @default undefined
Expand Down
26 changes: 6 additions & 20 deletions packages/clay-multi-select/src/ClayMultiSelect.soy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
{@param? id: string}
{@param? initialData: []|list<?>}
{@param? inputName: string}
{@param? inputValue: string}
{@param? label: string}
{@param? labelLocator: any}
{@param? requestOptions: [
Expand All @@ -39,7 +38,6 @@
{@param? requestRetries: number}
{@param? requestTimeout: number}
{@param? selectedItems: list<?>}
{@param? selectedItemsInputName: string}

{let $attributes kind="attributes"}
class="from-group
Expand All @@ -55,13 +53,7 @@

<div {$attributes}>
{if $label}
{let $labelAttributes kind="attributes"}
{if $inputName}
for="{$inputName}"
{/if}
{/let}

<label {$labelAttributes}>{$label}</label>
<label>{$label}</label>
{/if}

{call .content}
Expand All @@ -80,14 +72,12 @@
{param helpText: $helpText /}
{param initialData: $initialData /}
{param inputName: $inputName /}
{param inputValue: $inputValue /}
{param labelLocator: $labelLocator /}
{param requestOptions: $requestOptions /}
{param requestPolling: $requestPolling /}
{param requestRetries: $requestRetries /}
{param requestTimeout: $requestTimeout /}
{param selectedItems: $selectedItems /}
{param selectedItemsInputName: $selectedItemsInputName /}
{param spritemap: $spritemap /}
{/call}
</div>
Expand All @@ -113,7 +103,6 @@
{@param? filteredItems: list<?>}
{@param? initialData: []|list<?>}
{@param? inputName: string}
{@param? inputValue: string}
{@param? labelLocator: any}
{@param? requestOptions: [
method: string,
Expand All @@ -129,7 +118,6 @@
{@param? requestRetries: number}
{@param? requestTimeout: number}
{@param? selectedItems: list<?>}
{@param? selectedItemsInputName: string}

<div class="input-group input-group-stacked-sm-down">
<div class="input-group-item">
Expand All @@ -151,8 +139,6 @@
{param filteredItems: $filteredItems /}
{param initialData: $initialData /}
{param inputElementClasses: 'form-control-inset' /}
{param inputName: $inputName /}
{param inputValue: $inputValue /}
{param ref: 'autocomplete' /}
{param requestOptions: $requestOptions /}
{param requestPolling: $requestPolling /}
Expand All @@ -163,8 +149,8 @@
{call .items}
{param _handleCloseButtonClick: $_handleCloseButtonClick /}
{param contentRenderer: $contentRenderer /}
{param inputName: $inputName /}
{param selectedItems: $selectedItems /}
{param selectedItemsInputName: $selectedItemsInputName /}
{param spritemap: $spritemap /}
{/call}
{/if}
Expand Down Expand Up @@ -205,13 +191,13 @@
{@param spritemap: string}
{@param? _handleCloseButtonClick: any}
{@param? contentRenderer: string}
{@param? selectedItemsInputName: string}
{@param? inputName: string}

{foreach $item in $selectedItems}
{if $selectedItemsInputName}
{if $inputName}
{let $inputAttributes kind="attributes"}
{if $selectedItemsInputName}
name="{$selectedItemsInputName}"
{if $inputName}
name="{$inputName}"
{/if}

type="hidden"
Expand Down

0 comments on commit b8c48aa

Please sign in to comment.