Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Added Selectable and Selection Titles
Browse files Browse the repository at this point in the history
  • Loading branch information
AssafDamari committed Aug 7, 2017
1 parent 1e94634 commit f93ba64
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sample/src/welcome.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<section class="au-animate">
<br><br>
<multiple-select items.bind="items">
<multiple-select items.bind="items" selectable-title="Available options" selection-title="Selection options">
<template replace-part="item-template-selectable">
test
</template>
Expand Down
3 changes: 3 additions & 0 deletions src/elements/multiple-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
color: #aaa;
cursor: text;
}
.ms-container .ms-selectable-filter{
margin-bottom: 5px;
}
/*
.multiple-select {
right: auto !important;
Expand Down
16 changes: 10 additions & 6 deletions src/elements/multiple-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@

<div class="ms-container">
<div class="ms-selectable">
<div class="ms-selectable-title">${selectableTitle}</div>
<div class="ms-selectable-filter" if.bind="isSearchFilterEnabled">
<input type="text" class="form-control" placeholder="Filter..." value.bind="filterOfSelectableItems & debounce">
</div><br>
<ul class="ms-list">
</div>
<ul class="ms-list">
<li class="ms-elem-selectable" repeat.for="item of itemsToSelect" click.delegate="selectItem(item, true)">
<template part="item-template-selectable" replaceable> <!-- enables user to replace item template -->
<template part="item-template-selectable" replaceable>
<!-- enables user to replace item template -->
<span>${getItemDisplay(item.item)}</span>
</template>
</li>
</ul>
</div>
<div class="ms-selection">
<div class="ms-selectable-title">${selectionTitle}</div>
<div class="ms-selectable-filter" if.bind="isSearchFilterEnabled">
<input type="text" class="form-control" placeholder="Filter..." value.bind="filterOfSelectedItems & debounce">
</div><br>
<ul class="ms-list">
</div>
<ul class="ms-list">
<li class="ms-elem-selection" repeat.for="item of itemsAlreadySelected" click.delegate="selectItem(item, false)">
<template part="item-template-selection" replaceable> <!-- enables user to replace item template -->
<template part="item-template-selection" replaceable>
<!-- enables user to replace item template -->
<span>${getItemDisplay(item.item)}</span>
</template>
</li>
Expand Down
16 changes: 16 additions & 0 deletions src/elements/multiple-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ export class MultipleSelect {
@bindable
displayFieldName: string = "name";

/**
* The title of the selectable left
* @type {string}
* @memberof MultipleSelect
*/
@bindable
selectableTitle: string = "";

/**
* The title of the selection left
* @type {string}
* @memberof MultipleSelect
*/
@bindable
selectionTitle: string = "";

private _itemsInternal: SelectableItem[] = [];
private _isAttached: boolean = false;
private _ignoreInternalSelectedItemsChanged: boolean = false;
Expand Down

0 comments on commit f93ba64

Please sign in to comment.