1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
<!-- TODO(crbug.com/1201535): Move this component out of the os_languages_page
directory. -->
<style include="settings-shared shared-style">
[slot=body] {
display: flex;
flex-direction: column;
height: 350px;
overflow: auto;
}
iron-icon[icon='cr20:domain'] {
margin-inline-end: 10px;
}
cr-search-field {
margin-top: 20px;
}
cr-search-field::part(searchInput) {
font: var(--cros-body-2-font);
}
.managed-by-policy {
font: var(--cros-body-2-font);
padding-left: 0px;
}
.label {
padding-bottom: 4px;
padding-top: 8px;
}
.list-item {
color: var(--cros-text-color-primary);
min-height: 36px;
}
cr-checkbox::part(label-container) {
white-space: nowrap;
}
</style>
<cr-dialog id="dialog" close-text="$i18n{close}" show-on-attach>
<div slot="title">
<div id="heading">[[header]]</div>
<cr-search-field label="[[searchLabel]]" id="search"
clear-label="$i18n{clearSearch}" autofocus
on-search-changed="onSearchChanged_" on-keydown="onKeydown_">
</cr-search-field>
<template is="dom-if" if="[[showManagedByPolicy]]">
<div class="managed-by-policy cr-row continuation" id="managedByPolicy">
<iron-icon icon="cr20:domain"></iron-icon>
<div class="secondary">[[managedByPolicyLabel]]</div>
</div>
</template>
</div>
<div id="dialog-body" slot="body" scrollable>
<template is="dom-if" if="[[showSuggestedList_]]">
<div id="suggested-items-label" class="label">
[[suggestedItemsLabel]]
</div>
<iron-list id="suggested-items-list" items="[[suggestedItems_]]"
scroll-target="dialog-body">
<template>
<cr-checkbox class="list-item no-outline"
checked="[[willAdd_(item.id, itemIdsToAdd_.size)]]"
tab-index="[[tabIndex]]" on-change="onCheckboxChange_">
[[item.name]]
</cr-checkbox>
</template>
</iron-list>
</template>
<template is="dom-if" if="[[showFilteredList_]">
<div id="filtered-items-label" class="label"
hidden="[[!showSuggestedList_]]">
[[allItemsLabel]]
</div>
<iron-list id="filtered-items-list" items="[[filteredItems_]]"
scroll-target="dialog-body">
<template>
<cr-checkbox
class="list-item no-outline"
checked="[[willAdd_(item.id, itemIdsToAdd_.size)]]"
disabled="[[item.disabledByPolicy]]"
tab-index="[[tabIndex]]" on-change="onCheckboxChange_">
[[item.name]]
</cr-checkbox>
</template>
</iron-list>
</template>
<div id="no-search-results" class="centered-message"
hidden="[[showFilteredList_]]">
$i18n{noSearchResults}
</div>
</div>
<div slot="button-container">
<cr-button class="cancel-button" on-click="onCancelButtonClick_">
$i18n{cancel}
</cr-button>
<cr-button class="action-button" disabled="[[disableActionButton_]]"
on-click="onActionButtonClick_">
$i18n{add}
</cr-button>
</div>
</cr-dialog>
|