@hostlink/nuxt-light 1.8.4 → 1.8.6

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,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.8.4"
4
+ "version": "1.8.6"
5
5
  }
@@ -11,7 +11,8 @@ const props = defineProps({
11
11
 
12
12
 
13
13
  const usagePercent = computed(() => {
14
- return Math.round((props.storage.totalSpace - props.storage.freeSpace) / props.storage.totalSpace)
14
+ //return 0.0 to 1.0
15
+ return (props.storage.totalSpace - props.storage.freeSpace) / props.storage.totalSpace;
15
16
  })
16
17
 
17
18
  const progressColor = computed(() => {
@@ -5,6 +5,14 @@ const props = defineProps({
5
5
  type: [Number, String],
6
6
  default: 12
7
7
  },
8
+ sm: {
9
+ type: [Number, String],
10
+ default: 12
11
+ },
12
+ xs: {
13
+ type: [Number, String],
14
+ default: 12
15
+ },
8
16
  gutter: {
9
17
  type: String,
10
18
  default: "md"
@@ -13,13 +21,16 @@ const props = defineProps({
13
21
 
14
22
  const classes = computed(() => {
15
23
  return {
16
- [`col-md-${props.md}`]: true
24
+ "col-12": true, // default class "col-12
25
+ [`col-md-${props.md}`]: true,
26
+ [`col-sm-${props.sm}`]: true,
27
+ [`col-xs-${props.xs}`]: true
17
28
  }
18
29
  })
19
30
 
20
31
  </script>
21
32
  <template>
22
- <div class="col-12" :class="classes">
33
+ <div :class="classes">
23
34
  <div :class="`q-gutter-${props.gutter}`">
24
35
  <slot></slot>
25
36
  </div>
@@ -1,54 +1,44 @@
1
1
  <script setup lang="ts">
2
- import { useLight } from '#imports'
3
- import { useSlots, computed, ref } from 'vue';
2
+ import { useSlots } from 'vue';
4
3
  import type { QTabsProps } from 'quasar';
5
4
 
5
+ const model = defineModel<string | number | null | undefined>()
6
6
  interface LTabsProps extends QTabsProps {
7
7
 
8
8
  }
9
9
 
10
- const light = useLight();
11
- const props = defineProps<LTabsProps>()
12
- const emit = defineEmits(["update:modelValue"])
10
+ defineProps<LTabsProps>()
11
+
13
12
  const slots = useSlots();
14
- const defaultSlots = slots.default();
13
+ const defaultSlots = slots.default ? slots.default() : []
15
14
 
16
15
  //get the tabs from the default slot
17
16
  let name = 0;
18
17
  const tabContents = defaultSlots.map((slot) => {
19
- const n = slot.props.name || name++;
18
+ const n = slot.props?.name || name++;
20
19
  return {
21
- label: slot.props.label,
20
+ label: slot.props?.label,
22
21
  content: slot.children,
23
22
  name: n.toString()
24
23
  }
25
24
  })
26
25
 
27
- const v = ref(null)
28
-
29
- if (tabContents.length > 0) {
30
- v.value = tabContents[0].name
31
- }
32
- const localValue = computed({
33
- get: () => props.modelValue || v.value,
34
- set: (val) => {
35
- v.value = val
36
- emit("update:modelValue", val)
26
+ if (model.value === null || model.value === undefined) {
27
+ if (tabContents.length > 0) {
28
+ model.value = tabContents[0].name
37
29
  }
38
- })
39
-
40
-
30
+ }
41
31
 
42
32
  </script>
43
33
 
44
34
  <template>
45
35
  <l-card>
46
36
  <q-tabs class="text-grey" :active-color="$light.color" :indicator-color="$light.color" align="justify"
47
- v-model="localValue">
37
+ v-model="model">
48
38
  <q-tab v-for="tab in tabContents" :label="$t(tab.label)" :name="tab.name"></q-tab>
49
39
  </q-tabs>
50
- <q-tab-panels v-model="localValue">
51
- <slot></slot>
40
+ <q-tab-panels v-model="model">
41
+ <component v-for="tab in tabContents" :key="tab.name" :is="tab.content?.default" :name="tab.name" />
52
42
  </q-tab-panels>
53
43
  </l-card>
54
44
  </template>
@@ -62,8 +62,8 @@ eventLogCols.forEach(col => {
62
62
  </q-card-section>
63
63
 
64
64
  <q-card-section class="text-center text-center q-pt-none">
65
- <q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color" text-color="white"
66
- class="q-ma-xs" />
65
+ <q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color"
66
+ text-color="white" class="q-ma-xs" />
67
67
  </q-card-section>
68
68
 
69
69
 
@@ -85,11 +85,13 @@ eventLogCols.forEach(col => {
85
85
 
86
86
  <l-tabs>
87
87
  <l-tab label="User Log">
88
- <l-table :rows="my.userLog.data" :columns="userlogColumns" searchable :rows-per-page-options="[0]">
88
+ <l-table :rows="my.userLog.data" :columns="userlogColumns" searchable
89
+ :rows-per-page-options="[0]">
89
90
  </l-table>
90
91
  </l-tab>
91
92
  <l-tab label="Event Log">
92
- <l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable :rows-per-page-options="[0]">
93
+ <l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable
94
+ :rows-per-page-options="[0]">
93
95
  </l-table>
94
96
  </l-tab>
95
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",