blob: d35415d4f8c1df5a883d6b4fd42c3a1ac84f668d (
plain)
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
|
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="shortcut_util.html">
<dom-module id="extensions-shortcut-input">
<template>
<style include="cr-icons cr-hidden-style">
#main {
position: relative;
width: 200px;
}
#clear {
--cr-icon-button-size: 28px;
position: absolute;
right: 2px;
}
:host-context([dir='rtl']) #clear {
left: -2px;
right: inherit;
}
</style>
<div id="main">
<cr-input id="input" placeholder="$i18n{shortcutTypeAShortcut}"
error-message="[[getErrorString_(error_,
'$i18nPolymer{shortcutIncludeStartModifier}',
'$i18nPolymer{shortcutTooManyModifiers}',
'$i18nPolymer{shortcutNeedCharacter}')]]"
value="[[computeText_(capturing_, shortcut, pendingShortcut_)]]">
<cr-icon-button id="clear" aria-label="$i18nPolymer{clear}"
slot="suffix" class="icon-cancel no-overlap"
hidden$="[[computeClearHidden_(capturing_, shortcut)]]"
on-click="onClearTap_"></cr-icon-button>
</cr-input>
</div>
</template>
<script src="shortcut_input.js"></script>
</dom-module>
|