@hostlink/nuxt-light 1.33.6 → 1.34.0

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.33.6",
4
+ "version": "1.34.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
@@ -7,9 +7,9 @@ declare const _default: import("vue").DefineComponent<LEditorProps, {}, {}, {},
7
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
8
8
  }>, {
9
9
  dense: boolean;
10
+ placeholder: string;
10
11
  modelValue: string;
11
12
  fonts: any | undefined;
12
13
  toolbar: readonly any[];
13
- placeholder: string;
14
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  export default _default;
@@ -1,11 +1,13 @@
1
1
  <script setup>
2
- import { useSlots } from "#imports";
3
- defineProps({
2
+ import { useSlots, useRouter, useRoute, watch, onMounted } from "#imports";
3
+ const props = defineProps({
4
+ name: { type: String, required: false, default: "tab" },
5
+ route: { type: Boolean, required: false },
4
6
  modelValue: { type: null, required: false },
5
7
  vertical: { type: Boolean, required: false, skipCheck: true },
6
8
  outsideArrows: { type: Boolean, required: false, skipCheck: true },
7
9
  mobileArrows: { type: Boolean, required: false, skipCheck: true },
8
- align: { type: null, required: false },
10
+ align: { type: null, required: false, default: "justify" },
9
11
  breakpoint: { type: null, required: false },
10
12
  activeColor: { type: null, required: false },
11
13
  activeBgColor: { type: null, required: false },
@@ -24,15 +26,36 @@ defineProps({
24
26
  "onUpdate:modelValue": { type: Function, required: false }
25
27
  });
26
28
  const slots = useSlots();
29
+ const router = useRouter();
30
+ const route = useRoute();
27
31
  const modelValue = defineModel({ type: null });
28
32
  if (modelValue.value === void 0) {
29
- modelValue.value = slots.default?.()[0]?.props?.name;
33
+ if (props.route && props.name && route.query[props.name]) {
34
+ modelValue.value = route.query[props.name];
35
+ } else {
36
+ modelValue.value = slots.default?.()[0]?.props?.name;
37
+ }
30
38
  }
39
+ watch(modelValue, (newValue) => {
40
+ if (props.route && props.name && newValue) {
41
+ router.push({
42
+ query: {
43
+ ...route.query,
44
+ [props.name]: newValue
45
+ }
46
+ });
47
+ }
48
+ }, { immediate: false });
49
+ watch(() => props.name ? route.query[props.name] : null, (newTab) => {
50
+ if (props.route && props.name && newTab && newTab !== modelValue.value) {
51
+ modelValue.value = newTab;
52
+ }
53
+ });
31
54
  </script>
32
55
 
33
56
  <template>
34
57
  <l-card>
35
- <q-tabs class="text-grey" :active-color="$light.color" :indicator-color="$light.color" align="justify"
58
+ <q-tabs v-bind="$props" class="text-grey" :active-color="$light.color" :indicator-color="$light.color"
36
59
  v-model="modelValue">
37
60
  <slot></slot>
38
61
  </q-tabs>
@@ -1,5 +1,7 @@
1
1
  import type { QTabsProps } from 'quasar';
2
2
  export interface LTabsProps extends QTabsProps {
3
+ name?: string;
4
+ route?: boolean;
3
5
  }
4
6
  type __VLS_Props = LTabsProps;
5
7
  type __VLS_PublicProps = __VLS_Props & {
@@ -15,7 +17,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
15
17
  "update:modelValue": (value: any) => any;
16
18
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
19
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ }>, {
21
+ name: string;
22
+ align: "left" | "right" | "center" | "justify";
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
24
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
20
25
  export default _default;
21
26
  type __VLS_WithSlots<T, S> = T & {
@@ -1 +1 @@
1
- export default function (fields: Object): import("#app").AsyncData<any, import("#app").NuxtError<unknown> | null> | undefined;
1
+ export default function (fields: Object): import("#app").AsyncData<any, import("#app").NuxtError<unknown> | undefined> | undefined;
@@ -15,17 +15,16 @@ const columns = model("User").columns({
15
15
  has2FA: true
16
16
  //_test: true,
17
17
  });
18
- const status = ref("0");
19
18
  </script>
20
19
 
21
20
  <template>
22
21
  <l-page>
23
- <l-tabs v-model="status">
24
- <l-tab label="Active" name="0">
22
+ <l-tabs route>
23
+ <l-tab label="Active" name="active">
25
24
  <l-table ref="table" row-key="user_id" @request-data="onRequest" :columns="columns"
26
25
  :actions="['view', 'edit', 'delete']"></l-table>
27
26
  </l-tab>
28
- <l-tab label="Inactive" name="1">
27
+ <l-tab label="Inactive" name="inactive">
29
28
  <l-table row-key="user_id" @request-data="onRequest" :columns="columns"
30
29
  :actions="['view', 'edit', 'delete']">
31
30
  </l-table>
@@ -0,0 +1 @@
1
+ export {};
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.33.6",
3
+ "version": "1.34.0",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,13 +49,13 @@
49
49
  "devDependencies": {
50
50
  "@nuxt/devtools": "latest",
51
51
  "@nuxt/eslint-config": "^0.2.0",
52
- "@nuxt/kit": "^3.16.2",
53
- "@nuxt/schema": "^3.16.2",
52
+ "@nuxt/kit": "^4.0.3",
53
+ "@nuxt/schema": "^4.0.3",
54
54
  "@nuxt/test-utils": "^3.17.2",
55
55
  "@types/node": "^22.5.0",
56
56
  "changelogen": "^0.5.4",
57
57
  "eslint": "^8.46.0",
58
- "nuxt": "^3.16.2",
58
+ "nuxt": "^4.0.3",
59
59
  "typescript": "^5.8.3",
60
60
  "vue-tsc": "^2.2.8"
61
61
  }