From bf46469a460d5cef474e358a29b52a1942b41df3 Mon Sep 17 00:00:00 2001 From: Cristine Guadelupe Date: Thu, 11 Apr 2024 17:39:21 +0800 Subject: [PATCH] Makes MultiSelect draggable --- lib/assets/data_transform_cell/main.css | 8 +++++ lib/assets/data_transform_cell/main.js | 38 ++++++++++++++++-------- lib/kino_explorer/data_transform_cell.ex | 18 +++++++++++ 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/lib/assets/data_transform_cell/main.css b/lib/assets/data_transform_cell/main.css index daa03e7..b84399c 100644 --- a/lib/assets/data_transform_cell/main.css +++ b/lib/assets/data_transform_cell/main.css @@ -991,3 +991,11 @@ select option { select.input.tag-input:disabled { display: none; } + +.dndrop-container.horizontal > .dndrop-draggable-wrapper { + height: auto; +} + +.dndrop-container.horizontal { + display: flex; +} diff --git a/lib/assets/data_transform_cell/main.js b/lib/assets/data_transform_cell/main.js index f4576f8..bb84f12 100644 --- a/lib/assets/data_transform_cell/main.js +++ b/lib/assets/data_transform_cell/main.js @@ -222,6 +222,11 @@ export async function init(ctx, payload) { const BaseMultiTagSelect = { name: "BaseMultiTagSelect", + components: { + Container: VueDndrop.Container, + Draggable: VueDndrop.Draggable, + }, + props: { label: { type: String, @@ -261,6 +266,7 @@ export async function init(ctx, payload) { availableOptions(tags, options) { return options.filter((option) => !tags.includes(option)); }, + onDrop(event) {this.$emit('handleInnerValueDrop', event)} }, template: `
@@ -268,19 +274,19 @@ export async function init(ctx, payload) { {{ label }}
-
+ {{ message }} - - {{ tag }} - - -
+ + {{ tag }} + + +