-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix canvas not init issue (#283) * Fix copy paste of widget value (#284) * Fix copy paste of widget value * Fix ui tests * Allow undefined group font size * Update test expectations [skip ci] * nit --------- Co-authored-by: github-actions <github-actions@github.com> * 1.2.9 (#285) * WIP * Add refresh button * Add context menu * nit * Add selection mode * Editable text * Fix relative path * implement node delete * Dynamic menu items * Fix refresh * Better dynamic handling of menu items * Disable rename / delete for root * Add workflow download * Auto select file name * Create workflow * Generate non-dup name * Fix folder name * Rename workflwoStore to userFileStore * load workflow when leaf node selected * Extract common report error logic * Basic workflows tab test * Auto expand * Add test on add/remove workflow --------- Co-authored-by: github-actions <github-actions@github.com>
- Loading branch information
Showing
10 changed files
with
579 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<template> | ||
<div class="editable-text"> | ||
<span v-if="!props.isEditing"> | ||
{{ modelValue }} | ||
</span> | ||
<InputText | ||
v-else | ||
type="text" | ||
size="small" | ||
fluid | ||
v-model:modelValue="inputValue" | ||
ref="inputRef" | ||
@keyup.enter="finishEditing" | ||
:pt="{ | ||
root: { | ||
onBlur: finishEditing | ||
} | ||
}" | ||
v-focus | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import InputText from 'primevue/inputtext' | ||
import { nextTick, ref, watch } from 'vue' | ||
const props = defineProps({ | ||
modelValue: { | ||
type: String, | ||
required: true | ||
}, | ||
isEditing: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}) | ||
const emit = defineEmits(['update:modelValue', 'edit']) | ||
const inputValue = ref<string>(props.modelValue) | ||
const isEditingFinished = ref<boolean>(false) | ||
const inputRef = ref(null) | ||
const finishEditing = () => { | ||
if (isEditingFinished.value) { | ||
return | ||
} | ||
isEditingFinished.value = true | ||
emit('edit', inputValue.value) | ||
} | ||
watch( | ||
() => props.isEditing, | ||
(newVal) => { | ||
if (newVal) { | ||
inputValue.value = props.modelValue | ||
isEditingFinished.value = false | ||
nextTick(() => { | ||
if (!inputRef.value) return | ||
const fileName = inputValue.value.split('.').slice(0, -1).join('.') | ||
const start = 0 | ||
const end = fileName.length | ||
const inputElement = inputRef.value.$el | ||
inputElement.setSelectionRange(start, end) | ||
}) | ||
} | ||
} | ||
) | ||
const vFocus = { | ||
mounted: (el: HTMLElement) => el.focus() | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.editable-text { | ||
display: inline-block; | ||
min-width: 50px; | ||
padding: 2px; | ||
cursor: pointer; | ||
} | ||
.editable-text input { | ||
width: 100%; | ||
box-sizing: border-box; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.