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

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <Dialog header="Define searcher"
  3. :visible.sync="showDialog"
  4. :maximizable="true"
  5. :modal="true"
  6. :block-scroll="false"
  7. :style="{'position': 'absolute'}"
  8. :contentStyle="{height: '100%'}"
  9. :baseZIndex="2014"
  10. id="define-searcher"
  11. ref="define-searcher">
  12. <div v-if=" ! text" class="p-d-flex p-flex-row">
  13. <div class="p-field-radiobutton p-mr-4">
  14. <RadioButton name="searcher-type"
  15. id="searcher-type-regex"
  16. value="regex"
  17. v-model="type">
  18. </RadioButton>
  19. <label for="searcher-type-regex">Regex</label>
  20. </div>
  21. <div class="p-field-radiobutton">
  22. <RadioButton name="searcher-type"
  23. id="searcher-type-compound"
  24. value="compound"
  25. v-model="type">
  26. </RadioButton>
  27. <label for="searcher-type-compound">Searcher</label>
  28. </div>
  29. </div>
  30. <regex-create v-if="type === 'regex'"
  31. :standalone="true"
  32. @searcher="onDefined">
  33. </regex-create>
  34. <searcher-create v-if="type === 'compound'"
  35. :is-defining="true"
  36. :defined-searcher="text"
  37. @defined="onDefined">
  38. </searcher-create>
  39. </Dialog>
  40. </template>
  41. <script lang="ts">
  42. import RadioButton from "primevue/radiobutton";
  43. import {Component, Prop, Vue, Watch} from "vue-property-decorator";
  44. import SearcherCreate from './Create';
  45. import RegexCreate from '../Regex/Create';
  46. @Component({
  47. components: {
  48. RadioButton,
  49. SearcherCreate,
  50. RegexCreate,
  51. },
  52. })
  53. export default class DefineSearcher extends Vue {
  54. private showDialog: boolean = false;
  55. private type: String = '';
  56. @Prop({default: ''})
  57. public readonly text!: string;
  58. private onDefined(searcher: Object) {
  59. this.$emit('done', searcher);
  60. }
  61. @Watch('showDialog')
  62. showDialogChanged() {
  63. if ( ! this.showDialog) {
  64. this.$emit('close');
  65. }
  66. }
  67. created() {
  68. this.type = this.text ? 'compound' : 'regex';
  69. }
  70. mounted() {
  71. this.showDialog = true;
  72. }
  73. };
  74. </script>
  75. <style lang="sass">
  76. #define-searcher
  77. .p-dialog-content
  78. min-height: 90%
  79. </style>