Convert gr-confirm-cherrypick-conflict-dialog to typescript

Change-Id: Ia8869076771c0c6447ceee2af587b2bd142f13ae
This commit is contained in:
Dhruv Srivastava
2020-08-25 13:09:21 +02:00
parent 5c8ba85d29
commit af7dff9348

View File

@@ -14,21 +14,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../../styles/shared-styles.js';
import '../../shared/gr-dialog/gr-dialog.js';
import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin.js';
import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {htmlTemplate} from './gr-confirm-cherrypick-conflict-dialog_html.js';
import '../../../styles/shared-styles';
import '../../shared/gr-dialog/gr-dialog';
import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners';
import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin';
import {PolymerElement} from '@polymer/polymer/polymer-element';
import {htmlTemplate} from './gr-confirm-cherrypick-conflict-dialog_html';
import {customElement} from '@polymer/decorators';
/**
* @extends PolymerElement
*/
class GrConfirmCherrypickConflictDialog extends GestureEventListeners(
LegacyElementMixin(PolymerElement)) {
static get template() { return htmlTemplate; }
declare global {
interface HTMLElementTagNameMap {
'gr-confirm-cherrypick-conflict-dialog': GrConfirmCherrypickConflictDialog;
}
}
static get is() { return 'gr-confirm-cherrypick-conflict-dialog'; }
@customElement('gr-confirm-cherrypick-conflict-dialog')
export class GrConfirmCherrypickConflictDialog extends GestureEventListeners(
LegacyElementMixin(PolymerElement)
) {
static get template() {
return htmlTemplate;
}
/**
* Fired when the confirm button is pressed.
@@ -42,22 +48,25 @@ class GrConfirmCherrypickConflictDialog extends GestureEventListeners(
* @event cancel
*/
_handleConfirmTap(e) {
_handleConfirmTap(e: Event) {
e.preventDefault();
e.stopPropagation();
this.dispatchEvent(new CustomEvent('confirm', {
composed: true, bubbles: false,
}));
this.dispatchEvent(
new CustomEvent('confirm', {
composed: true,
bubbles: false,
})
);
}
_handleCancelTap(e) {
_handleCancelTap(e: Event) {
e.preventDefault();
e.stopPropagation();
this.dispatchEvent(new CustomEvent('cancel', {
composed: true, bubbles: false,
}));
this.dispatchEvent(
new CustomEvent('cancel', {
composed: true,
bubbles: false,
})
);
}
}
customElements.define(GrConfirmCherrypickConflictDialog.is,
GrConfirmCherrypickConflictDialog);