blob: 09f4abf9a6ba8e46bf1fdf6985e762f60d28db7a [file] [log] [blame]
Dave Borowitz8cdc76b2018-03-26 10:04:27 -04001/**
2 * @license
3 * Copyright (C) 2017 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010017import '../../../scripts/bundled-polymer.js';
Kasper Nilsson88191142017-12-19 14:54:15 -080018
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010019import '../../../styles/shared-styles.js';
20import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
21import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin.js';
22import {PolymerElement} from '@polymer/polymer/polymer-element.js';
23import {htmlTemplate} from './gr-default-editor_html.js';
Kasper Nilsson88191142017-12-19 14:54:15 -080024
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010025/** @extends Polymer.Element */
26class GrDefaultEditor extends GestureEventListeners(
27 LegacyElementMixin(
28 PolymerElement)) {
29 static get template() { return htmlTemplate; }
Kasper Nilsson88191142017-12-19 14:54:15 -080030
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010031 static get is() { return 'gr-default-editor'; }
32 /**
33 * Fired when the content of the editor changes.
34 *
35 * @event content-change
36 */
37
38 static get properties() {
39 return {
40 fileContent: String,
41 };
Dmitrii Filippov3fd2b102019-11-15 16:16:46 +010042 }
43
Dmitrii Filippovdaf0ec92020-03-17 11:27:28 +010044 _handleTextareaInput(e) {
45 this.dispatchEvent(new CustomEvent(
46 'content-change',
47 {detail: {value: e.target.value}, bubbles: true, composed: true}));
48 }
49}
50
51customElements.define(GrDefaultEditor.is, GrDefaultEditor);