2019-10-17 18:23:53 +03:00
|
|
|
<!--
|
|
|
|
|
|
2024-01-09 10:46:16 +02:00
|
|
|
Copyright © 2016-2024 The Thingsboard Authors
|
2019-10-17 18:23:53 +03:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
-->
|
2024-10-09 19:36:42 +03:00
|
|
|
<div class="tb-js-func flex flex-col" style="background: #fff;" [class]="{'tb-disabled': disabled, 'fill-height': fillHeight, 'tb-hide-brackets': hideBrackets}"
|
2019-10-17 18:23:53 +03:00
|
|
|
tb-fullscreen
|
2024-10-09 19:36:42 +03:00
|
|
|
[fullscreen]="fullscreen">
|
|
|
|
|
<div style="min-height: 40px;" class="tb-js-func-toolbar flex flex-row justify-start items-center">
|
2024-01-26 17:54:24 +02:00
|
|
|
<label class="tb-title no-padding"
|
2024-10-09 19:36:42 +03:00
|
|
|
[class]="{'tb-error': !disabled && (hasErrors || !functionValid || required && !modelValue), 'tb-required': !disabled && required}">
|
2024-01-26 17:54:24 +02:00
|
|
|
{{ functionLabel }}
|
|
|
|
|
</label>
|
2024-10-09 19:36:42 +03:00
|
|
|
<span class="flex-1"></span>
|
2024-07-19 17:20:58 +03:00
|
|
|
<ng-content select="[toolbarPrefixButton]"></ng-content>
|
2019-10-17 18:23:53 +03:00
|
|
|
<button type='button' *ngIf="!disabled" mat-button class="tidy" (click)="beautifyJs()">
|
|
|
|
|
{{'js-func.tidy' | translate }}
|
|
|
|
|
</button>
|
2023-07-20 10:08:43 +03:00
|
|
|
<ng-content select="[toolbarSuffixButton]"></ng-content>
|
2021-10-06 21:03:29 +03:00
|
|
|
<div *ngIf="helpId" [tb-help-popup]="helpId"></div>
|
2021-02-17 17:21:50 +02:00
|
|
|
<fieldset style="width: initial">
|
|
|
|
|
<div matTooltip="{{(fullscreen ? 'fullscreen.exit' : 'fullscreen.expand') | translate}}"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
style="border-radius: 50%"
|
|
|
|
|
(click)="fullscreen = !fullscreen">
|
2023-02-17 19:24:01 +02:00
|
|
|
<button type='button' mat-icon-button class="tb-mat-32">
|
2021-02-17 17:21:50 +02:00
|
|
|
<mat-icon class="material-icons">{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
2019-10-17 18:23:53 +03:00
|
|
|
</div>
|
2024-10-09 19:36:42 +03:00
|
|
|
<div id="tb-javascript-panel" class="tb-js-func-panel flex flex-col" tb-toast toastTarget="{{toastTargetId}}">
|
|
|
|
|
<div #javascriptEditor id="tb-javascript-input" [style]="fillHeight ? {} : {minHeight: minHeight}" [class.fill-height]="fillHeight"></div>
|
2019-10-17 18:23:53 +03:00
|
|
|
</div>
|
2024-10-09 19:36:42 +03:00
|
|
|
<div *ngIf="!hideBrackets" class="flex flex-row justify-start items-center" style="height: 40px;">
|
|
|
|
|
<label class="tb-title no-padding" [class]="{'tb-error': hasErrors || !functionValid || required && !modelValue}">}</label>
|
2019-10-17 18:23:53 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|