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.

68 lines
1.8 KiB

  1. <template>
  2. <div>
  3. <div @click="adding = true"
  4. class="box"
  5. style="font-size: 6rem; max-width: 100px;">
  6. +
  7. </div>
  8. <Dialog header="Select searcher"
  9. position="right"
  10. :visible="adding"
  11. :closable="false"
  12. :style="{width: '50vw'}"
  13. :modal="true">
  14. <searchers @selected="onSearcherSelected"
  15. :ignore-searcher-ids="ignoreSearcherIds"
  16. :allow-select="true">
  17. </searchers>
  18. <template #footer>
  19. <Button label="Close"
  20. icon="pi pi-times"
  21. @click="adding = false"
  22. class="p-button-text"/>
  23. <Button label="Confirm"
  24. icon="pi pi-check"
  25. @click="onConfirm"
  26. :disabled="Object.keys(selectedSearcher).length === 0"
  27. autofocus />
  28. </template>
  29. </Dialog>
  30. </div>
  31. </template>
  32. <script lang="ts">
  33. import {Component, Prop, Vue} from "vue-property-decorator";
  34. import Dialog from 'primevue/dialog';
  35. import Searchers from './Index.vue';
  36. @Component({
  37. name: 'AddBox',
  38. components: {
  39. Dialog,
  40. Searchers,
  41. },
  42. })
  43. export default class Create extends Vue {
  44. private adding: boolean = false;
  45. private selectedSearcher: Object = {};
  46. @Prop({default: () => {return[];}})
  47. public readonly ignoreSearcherIds!: Array<string>;
  48. onSearcherSelected(searcher: Object) {
  49. this.selectedSearcher = searcher;
  50. }
  51. onConfirm() {
  52. this.$emit('added', this.selectedSearcher);
  53. this.selectedSearcher = {};
  54. this.adding = false;
  55. }
  56. };
  57. </script>