@explorer-1/vue 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -51,9 +51,10 @@
51
51
  <script lang="ts">
52
52
  import type { PropType } from 'vue'
53
53
  import { defineComponent } from 'vue'
54
- import dayjs, { type Dayjs } from 'dayjs'
55
- import duration, { type Duration } from 'dayjs/plugin/duration'
56
- import minMax from 'dayjs/plugin/minMax'
54
+ import dayjs from './../../utils/dayjs'
55
+ import { type Dayjs } from 'dayjs'
56
+ import duration, { type Duration } from 'dayjs/plugin/duration.js'
57
+ import minMax from 'dayjs/plugin/minMax.js'
57
58
 
58
59
  dayjs.extend(duration)
59
60
  dayjs.extend(minMax)
@@ -1,3 +1,29 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import { useRouter } from 'vue-router'
4
+ import SearchInput from './../SearchInput/SearchInput.vue'
5
+ const router = useRouter()
6
+
7
+ interface NavSearchFormProps {
8
+ mobile?: boolean
9
+ }
10
+ const props = withDefaults(defineProps<NavSearchFormProps>(), {
11
+ mobile: false
12
+ })
13
+ const emit = defineEmits(['clearSearch', 'submitForm'])
14
+
15
+ const searchQuery = ref()
16
+
17
+ const clearSearch = () => {
18
+ searchQuery.value = undefined
19
+ emit('clearSearch')
20
+ }
21
+ const submitSearch = () => {
22
+ emit('submitForm')
23
+ console.log(searchQuery.value)
24
+ router.push({ path: '/search', query: searchQuery.value })
25
+ }
26
+ </script>
1
27
  <template>
2
28
  <form
3
29
  class="NavSearchForm"
@@ -6,11 +32,11 @@
6
32
  <SearchInput
7
33
  v-model="searchQuery"
8
34
  placeholder="Search JPL"
9
- :underlined-input="!mobile"
35
+ :underlined-input="!props.mobile"
10
36
  :underlined-input-value="searchQuery"
11
- :auto-focus="!mobile"
12
- :inline="!mobile"
13
- :default-colors="mobile"
37
+ :auto-focus="!props.mobile"
38
+ :inline="!props.mobile"
39
+ :default-colors="props.mobile"
14
40
  @esc="clearSearch()"
15
41
  />
16
42
  <button
@@ -22,43 +48,6 @@
22
48
  </button>
23
49
  </form>
24
50
  </template>
25
- <script lang="ts">
26
- import { defineComponent } from 'vue'
27
- import SearchInput from './../SearchInput/SearchInput.vue'
28
-
29
- export default defineComponent({
30
- name: 'NavSearchForm',
31
- components: {
32
- SearchInput
33
- },
34
- props: {
35
- mobile: {
36
- type: Boolean,
37
- default: false
38
- }
39
- },
40
- data() {
41
- return {
42
- searchQuery: undefined
43
- }
44
- },
45
- methods: {
46
- clearSearch() {
47
- this.searchQuery = undefined
48
- this.$emit('clearSearch')
49
- },
50
- submitSearch() {
51
- this.$emit('submitForm')
52
- if (this.$router) {
53
- this.$router.push({
54
- name: 'search',
55
- query: { query: this.searchQuery }
56
- })
57
- }
58
- }
59
- }
60
- })
61
- </script>
62
51
  <style lang="scss">
63
52
  .NavSearchForm {
64
53
  ::placeholder {
@@ -4,7 +4,7 @@
4
4
  heading="Past Events"
5
5
  variant="cards"
6
6
  :link="{
7
- path: '/events',
7
+ // path: 'events',
8
8
  query: {
9
9
  event_status: 'Past events',
10
10
  sortBy: 'eventStartDateLatest',
@@ -28,7 +28,7 @@
28
28
  </MixinCarousel>
29
29
  </template>
30
30
  <script lang="ts">
31
- // @ts-nocheck
31
+ // relative link to view past events assumes that this component will only be used on an events index page.
32
32
  import { defineComponent } from 'vue'
33
33
  import type { ElasticSearchPage } from '../../interfaces'
34
34
  import MixinCarousel from './../MixinCarousel/MixinCarousel.vue'