UNPKG

api-console-assets

Version:

This repo only exists to publish api console components to npm

78 lines (72 loc) 2.24 kB
<!-- @license Copyright 2016 The Advanced REST client authors <arc@mulesoft.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../paper-styles/paper-styles.html"> <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="../paper-icon-button/paper-icon-button.html"> <link rel="import" href="../iron-collapse/iron-collapse.html"> <link rel="import" href="../arc-icons/arc-icons.html"> <!-- `http-source-message-view` displays the HTTP source message that has been sent to the remote mchine. --> <dom-module id="http-source-message-view"> <template> <style> :host { margin: 16px 16px 0 16px; overflow: auto; display: block; @apply(--http-source-message-view); } pre { word-break: break-all; @apply(--arc-font-code1); -webkit-user-select: text; cursor: text; @apply(--http-source-message); margin-bottom: 0; } h5 { margin: 0; display: inline-block; cursor: pointer; } </style> <h5 on-tap="toggle"> Source message <paper-icon-button icon="[[_computeIcon(opened)]]"></paper-icon-button> </h5> <iron-collapse id="collapse" opened="{{opened}}"> <pre>[[message]]</pre> </iron-collapse> </template> <script> Polymer({ is: 'http-source-message-view', properties: { // A HTTP message to display. message: String, // True if the message is visible. opened: Boolean }, toggle: function() { this.$.collapse.toggle(); }, _computeIcon: function(opened) { return opened ? 'arc:expand-less' : 'arc:expand-more'; } }); </script> </dom-module>