@ramathibodi/nuxt-commons 0.1.1 → 0.1.3

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/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.1"
7
+ "version": "0.1.3"
8
8
  }
@@ -1,47 +1,59 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue';
3
- import { VCard } from 'vuetify/components/VCard'
4
- const isResizing = ref(false);
5
- const pane1Width = ref('50%');
2
+ import { ref } from 'vue'
3
+ import { VCard } from 'vuetify/components/VCard'
4
+
5
+ const isResizing = ref(false)
6
+ const pane1Width = ref('50%')
6
7
  const containerRef = ref<HTMLElement>()
7
- interface Props extends /* @vue-ignore */ InstanceType<typeof VCard['$props']>{
8
- height? : number | string
8
+ interface Props extends /* @vue-ignore */ InstanceType<typeof VCard['$props']> {
9
+ height?: number | string
9
10
  }
10
11
  const props = defineProps<Props>()
11
12
 
12
13
  const startResize = () => {
13
- isResizing.value = true;
14
- };
14
+ isResizing.value = true
15
+ }
15
16
 
16
17
  const stopResize = () => {
17
- isResizing.value = false;
18
- };
18
+ isResizing.value = false
19
+ }
19
20
 
20
21
  const resize = (event: MouseEvent) => {
21
22
  if (isResizing.value && containerRef.value) {
22
- const containerRect = containerRef.value.getBoundingClientRect();
23
- const newWidth = event.clientX - containerRect.left;
24
- pane1Width.value = `${(newWidth / containerRect.width) * 100}%`;
23
+ const containerRect = containerRef.value.getBoundingClientRect()
24
+ const newWidth = event.clientX - containerRect.left
25
+ pane1Width.value = `${(newWidth / containerRect.width) * 100}%`
25
26
  }
26
- };
27
+ }
27
28
  </script>
28
29
 
29
30
  <template>
30
31
  <v-card :="$attrs">
31
- <v-sheet border :height="height">
32
- <div class="d-flex" ref="containerRef" @mouseup="stopResize" @mousemove="resize" >
33
- <v-sheet :width = "pane1Width">
34
- <slot name="left"></slot>
32
+ <v-sheet
33
+ border
34
+ :height="height"
35
+ >
36
+ <div
37
+ ref="containerRef"
38
+ class="d-flex"
39
+ @mouseup="stopResize"
40
+ @mousemove="resize"
41
+ >
42
+ <v-sheet :width="pane1Width">
43
+ <slot name="left" />
35
44
  </v-sheet>
36
- <v-divider :thickness="3" vertical class="cursor-move" @mousedown="startResize" ></v-divider>
37
- <v-sheet :width = "`calc(100% - ${pane1Width})`" >
38
- <slot name="right"></slot>
45
+ <v-divider
46
+ :thickness="3"
47
+ vertical
48
+ class="cursor-move"
49
+ @mousedown="startResize"
50
+ />
51
+ <v-sheet :width="`calc(100% - ${pane1Width})`">
52
+ <slot name="right" />
39
53
  </v-sheet>
40
54
  </div>
41
- </v-sheet>
42
-
43
- </v-card>
44
-
55
+ </v-sheet>
56
+ </v-card>
45
57
  </template>
46
58
 
47
59
  <style scoped>
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
- import {computed, ref, watch} from 'vue'
2
+ import { computed, ref, watch } from 'vue'
3
3
  import * as prettier from 'prettier'
4
4
  import prettierPluginHtml from 'prettier/plugins/html'
5
- import {useDocumentTemplate, validationRulesRegex} from '../../composables/document/template'
5
+ import { useDocumentTemplate, validationRulesRegex } from '../../composables/document/template'
6
6
 
7
7
  interface Props {
8
8
  modelValue?: string
@@ -82,8 +82,8 @@ async function convertToAdvanceMode() {
82
82
  }
83
83
  }
84
84
 
85
- const inputTypeChoice = ref(['VTextField', 'VTextarea', 'VSelect','VAutocomplete','FormDate','FormTime','FormDateTime','VCombobox', 'VRadio', 'VRadioInline', 'VCheckbox','VSwitch', 'MasterAutocomplete', 'Header', 'Separator', 'CustomCode'])
86
- const requireOption = ref(['VSelect','VAutocomplete','VCombobox', 'VRadio', 'VRadioInline', 'MasterAutocomplete'])
85
+ const inputTypeChoice = ref(['VTextField', 'VTextarea', 'VSelect', 'VAutocomplete', 'FormDate', 'FormTime', 'FormDateTime', 'VCombobox', 'VRadio', 'VRadioInline', 'VCheckbox', 'VSwitch', 'MasterAutocomplete', 'Header', 'Separator', 'CustomCode'])
86
+ const requireOption = ref(['VSelect', 'VAutocomplete', 'VCombobox', 'VRadio', 'VRadioInline', 'MasterAutocomplete'])
87
87
  const notRequireVariable = ref(['Header', 'Separator', 'CustomCode'])
88
88
  const notRequireLabel = ref(['Separator', 'CustomCode'])
89
89
 
@@ -176,8 +176,8 @@ const ruleOptions = (inputType: string) => (value: any) => {
176
176
  </v-col>
177
177
  <v-col v-if="data.inputType!='Separator'">
178
178
  <v-text-field
179
- v-model="data.columnAttributes"
180
- label="Column Attributes"
179
+ v-model="data.columnAttributes"
180
+ label="Column Attributes"
181
181
  />
182
182
  </v-col>
183
183
  <v-col
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" setup>
2
- import {VAutocomplete} from 'vuetify/components/VAutocomplete'
3
- import {concat, isEmpty} from 'lodash-es'
4
- import {computed, ref, watch} from 'vue'
5
- import {watchDebounced} from '@vueuse/core'
6
- import {useFuzzy} from '../../composables/utils/fuzzy'
7
- import {useGraphQl} from '../../composables/graphql'
2
+ import { VAutocomplete } from 'vuetify/components/VAutocomplete'
3
+ import { concat, isEmpty } from 'lodash-es'
4
+ import { computed, ref, watch } from 'vue'
5
+ import { watchDebounced } from '@vueuse/core'
6
+ import { useFuzzy } from '../../composables/utils/fuzzy'
7
+ import { useGraphQl } from '../../composables/graphql'
8
8
 
9
9
  interface Props extends /* @vue-ignore */ InstanceType<typeof VAutocomplete['$props']> {
10
10
  fuzzy?: boolean
@@ -0,0 +1,11 @@
1
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
+ import { type RouteRecordNormalized, type RouteRecordRaw } from 'vue-router';
3
+ import { type MenuItem } from '../types/menu';
4
+ export interface MenuProvide {
5
+ menuAll: Ref<MenuItem[]>;
6
+ menuByRoute: ComputedRef<MenuItem[]>;
7
+ }
8
+ export declare const MenuKey: InjectionKey<MenuProvide>;
9
+ export declare function routeToMenuItem(route: RouteRecordRaw | RouteRecordNormalized): MenuItem | undefined;
10
+ export declare function createMenu(): void;
11
+ export declare function useMenu(): MenuProvide | null;
@@ -1,6 +1,6 @@
1
1
  import { computed, inject, provide, ref } from "vue";
2
- import { useRoute, useRouter } from "vue-router";
3
2
  import { isUndefined } from "lodash-es";
3
+ import { useRoute, useRouter } from "#imports";
4
4
  export const MenuKey = Symbol.for("ramacare:menu");
5
5
  export function routeToMenuItem(route) {
6
6
  let menuItem = void 0;
@@ -1,2 +1,2 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
- export declare function useFuzzy(searchTerm: MaybeRefOrGetter<string>, items: MaybeRefOrGetter<any[]>, fieldName: MaybeRefOrGetter<string[]>, options?: MaybeRefOrGetter<Record<string, any>>): import("vue").ComputedRef<import("fuse.js").default.FuseResult<any>[]>;
2
+ export declare function useFuzzy(searchTerm: MaybeRefOrGetter<string>, items: MaybeRefOrGetter<any[]>, fieldName: MaybeRefOrGetter<string[]>, options?: MaybeRefOrGetter<Record<string, any>>): import("vue").ComputedRef<Fuse.FuseResult<DataItem>[]>;
@@ -22,4 +22,4 @@ declare global {
22
22
  }
23
23
  }
24
24
 
25
- export {}
25
+ export { MenuMeta, MenuItem }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramathibodi/nuxt-commons",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Ramathibodi Nuxt modules for common components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,7 +56,7 @@
56
56
  "@zxing/browser": "^0.1.4",
57
57
  "cropperjs": "^1.6.2",
58
58
  "currency.js": "^2.0.4",
59
- "fuse.js": "^6.6.2",
59
+ "fuse.js": "^7.0.0",
60
60
  "gql-query-builder": "^3.8.0",
61
61
  "lodash": "^4.17.21",
62
62
  "luxon": "^3.4.4",