diff --git a/src/webcomponents/commons/modal/modal-utils.js b/src/webcomponents/commons/modal/modal-utils.js index 191d5c43e..f9d0a1b77 100644 --- a/src/webcomponents/commons/modal/modal-utils.js +++ b/src/webcomponents/commons/modal/modal-utils.js @@ -17,15 +17,17 @@ export default class ModalUtils { static create(self, id, config) { // Parse modal parameters, all of them must start with prefix 'modal' - const modalWidth = config.display?.modalWidth || "768px"; - const modalSize = config.display?.modalSize || ""; - const modalTitle = config.display?.modalTitle || ""; - const modalTitleHeader = config.display?.modalTitleHeader || "h4"; - const modalTitleClassName = config.display?.modalTitleClassName || ""; - const modalTitleStyle = config.display?.modalTitleStyle || ""; - const btnsVisible = config.display?.modalbtnsVisible; - const modalDraggable = config.display?.modalDraggable || false; - const modalCyDataName = config.display?.modalCyDataName || ""; + const modalWidth = config.display?.modalWidth ?? "768px"; + const modalSize = config.display?.modalSize ?? ""; + const modalTitle = config.display?.modalTitle ?? ""; + const modalTitleHeader = config.display?.modalTitleHeader ?? "h4"; + const modalTitleClassName = config.display?.modalTitleClassName ?? ""; + const modalTitleStyle = config.display?.modalTitleStyle ?? ""; + const btnsVisible = config.display?.modalbtnsVisible ?? false; + const btnCancelVisible = config.display?.btnCancelVisible ?? true; + const btnSaveVisible = config.display?.btnSaveVisible ?? true; + const modalDraggable = config.display?.modalDraggable ?? false; + const modalCyDataName = config.display?.modalCyDataName ?? ""; return html` + `} + `; break; case "MAP_DOUBLE": case "MAP_INTEGER": content = html` - ${variable?.allowedKeys?.length ? html`
+ .config="${{multiple: true, liveSearch: false}}" + @filterChange="${e => this.changeMap(e, variableSet.id, variable.id, e.detail.value)}">
- ${this.variableMap?.[variableSet.id]?.[variable.id]?.map(key => { - return html` -
- -
-
- -
-
- + ${ + this.variableMap?.[variableSet.id]?.[variable.id]?.map(key => { + const operator = this.selectedVariables?.[variableSet.id]?.[variable.id + "." + key]?.operator || ">"; + const value = this.selectedVariables?.[variableSet.id]?.[variable.id + "." + key]?.value || ""; + return html` +
+ +
+
+ +
+
+ +
-
`; }) } @@ -360,17 +390,23 @@ export default class OpencgaAnnotationFilterModal extends LitElement {
- -
`} - + - `; +
+ `} + `; break; case "TEXT": case "STRING": @@ -378,14 +414,22 @@ export default class OpencgaAnnotationFilterModal extends LitElement {
- -
`; + +
+ `; break; case "NUMERIC": case "INTEGER": @@ -394,32 +438,56 @@ export default class OpencgaAnnotationFilterModal extends LitElement {
- + + + + +
- +
-
`; +
+ `; break; case "CATEGORICAL": content = html` - `; +
+ + + +
+ `; break; case "BOOLEAN": content = html` @@ -427,20 +495,35 @@ export default class OpencgaAnnotationFilterModal extends LitElement {
- + True - + False
-
`; +
+ `; break; default: throw new Error("Type not recognized " + variable.type + "(" + variable.id + ")"); @@ -448,68 +531,63 @@ export default class OpencgaAnnotationFilterModal extends LitElement { return html`${content}`; } - filterChange() { - - } - showModal() { - const annotationModal = new bootstrap.Modal(`#${this._prefix}annotation-modal`); + const annotationModal = new bootstrap.Modal(`#${this._prefix}AnnotationFilterModal`); annotationModal.show(); UtilsNew.initTooltip(this); } - getDefaultConfig() { - return { - - }; - } - - render() { + renderBody() { return html` - ${this.variableSets?.length ? html` - - -