Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
2.5 KiB

<template>
<Dialog header="Define searcher"
:visible.sync="showDialog"
:maximizable="true"
:modal="true"
:block-scroll="false"
:style="{'position': 'absolute'}"
:contentStyle="{height: '100%'}"
:baseZIndex="2014"
id="define-searcher"
ref="define-searcher">
<div v-if=" ! text" class="p-d-flex p-flex-row">
<div class="p-field-radiobutton p-mr-4">
<RadioButton name="searcher-type"
id="searcher-type-regex"
value="regex"
v-model="type">
</RadioButton>
<label for="searcher-type-regex">Regex</label>
</div>
<div class="p-field-radiobutton">
<RadioButton name="searcher-type"
id="searcher-type-compound"
value="compound"
v-model="type">
</RadioButton>
<label for="searcher-type-compound">Searcher</label>
</div>
</div>
<regex-create v-if="type === 'regex'"
:standalone="true"
@searcher="onDefined">
</regex-create>
<searcher-create v-if="type === 'compound'"
:is-defining="true"
:defined-searcher="text"
@defined="onDefined">
</searcher-create>
</Dialog>
</template>
<script lang="ts">
import RadioButton from "primevue/radiobutton";
import {Component, Prop, Vue, Watch} from "vue-property-decorator";
import SearcherCreate from './Create';
import RegexCreate from '../Regex/Create';
@Component({
components: {
RadioButton,
SearcherCreate,
RegexCreate,
},
})
export default class DefineSearcher extends Vue {
private showDialog: boolean = false;
private type: String = '';
@Prop({default: ''})
public readonly text!: string;
private onDefined(searcher: Object) {
this.$emit('done', searcher);
}
@Watch('showDialog')
showDialogChanged() {
if ( ! this.showDialog) {
this.$emit('close');
}
}
created() {
this.type = this.text ? 'compound' : 'regex';
}
mounted() {
this.showDialog = true;
}
};
</script>
<style lang="sass">
#define-searcher
.p-dialog-content
min-height: 90%
</style>