Skip to content

Commit

Permalink
Adding dialog to Multi Expression Editor (#4602)
Browse files Browse the repository at this point in the history
* Adding dialog to Multi Expression Editor

* Adding Max width as a property for the Dialog, defaults to old value in css
  • Loading branch information
Dioltas95 authored Nov 15, 2023
1 parent 3e16e6a commit f015e85
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/designer/elsa-workflows-studio/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export namespace Components {
"propertyModel": ActivityDefinitionProperty;
}
interface ElsaModalDialog {
"dialogWidth": string;
"hide": (animate?: boolean) => Promise<void>;
"show": (animate?: boolean) => Promise<void>;
}
Expand Down Expand Up @@ -1065,6 +1066,7 @@ declare namespace LocalJSX {
"propertyModel"?: ActivityDefinitionProperty;
}
interface ElsaModalDialog {
"dialogWidth"?: string;
"onHidden"?: (event: CustomEvent<any>) => void;
"onShown"?: (event: CustomEvent<any>) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export class ElsaMultiExpressionEditor {
language={monacoLanguage}
editorHeight={this.editorHeight}
singleLineMode={this.singleLineMode}
context={this.context}/>
context={this.context}
opensModal/>
</div>
<div class={defaultEditorClass}>
<slot/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,12 @@ export class ElsaWorkflowDefinitionEditorScreen {
return (
<elsa-modal-dialog ref={el => {
monacoEditorDialogService.monacoEditorDialog = el;
}}>
}} dialogWidth='80vw'>
<div slot="content" class="elsa-py-8 elsa-px-4">
<elsa-monaco
value=""
language="javascript"
editor-height="400px"
editor-height="80vh"
single-line={false}
onValueChanged={e => {
monacoEditorDialogService.currentValue = e.detail.value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, Host, h, State, Listen, Method, Event, EventEmitter} from '@stencil/core';
import {Component, Host, h, State, Listen, Method, Event, EventEmitter, Prop} from '@stencil/core';
import {enter, leave} from 'el-transition'
import {eventBus} from "../../../services";
import {EventTypes} from "../../../models";
Expand All @@ -13,6 +13,7 @@ export class ElsaModalDialog {
@State() isVisible: boolean;
overlay: HTMLElement
modal: HTMLElement
@Prop({attribute : 'dialog-width', reflect: true}) dialogWidth: string = '56em'

render() {
return this.renderModal();
Expand Down Expand Up @@ -87,8 +88,8 @@ export class ElsaModalDialog {
data-transition-leave="elsa-ease-in elsa-duration-200"
data-transition-leave-start="elsa-opacity-0 elsa-translate-y-0 sm:elsa-scale-100"
data-transition-leave-end="elsa-opacity-0 elsa-translate-y-4 sm:elsa-translate-y-0 sm:elsa-scale-95"
class="hidden elsa-inline-block sm:elsa-align-top elsa-bg-white elsa-rounded-lg elsa-text-left elsa-overflow-visible elsa-shadow-xl elsa-transform elsa-transition-all sm:elsa-my-8 sm:elsa-align-top sm:elsa-max-w-4xl sm:elsa-w-full"
role="dialog" aria-modal="true" aria-labelledby="modal-headline">
class="hidden elsa-inline-block sm:elsa-align-top elsa-bg-white elsa-rounded-lg elsa-text-left elsa-overflow-visible elsa-shadow-xl elsa-transform elsa-transition-all sm:elsa-my-8 sm:elsa-align-top sm:elsa-w-full"
role="dialog" aria-modal="true" aria-labelledby="modal-headline" style={{'max-width' : this.dialogWidth}}>
<div class="modal-content">
<slot name="content"/>
</div>
Expand Down

0 comments on commit f015e85

Please sign in to comment.