@hostlink/nuxt-light 1.8.5 → 1.8.7

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.5"
4
+ "version": "1.8.7"
5
5
  }
@@ -135,7 +135,6 @@ const getDiffHtml = (diffs) => {
135
135
  <template>
136
136
  <div>
137
137
 
138
- <div v-html="html"></div>
139
138
  <q-dialog v-model="showDialog" full-height full-width>
140
139
  <q-card>
141
140
  <q-toolbar>
@@ -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>
@@ -0,0 +1,7 @@
1
+ <script setup>
2
+ </script>
3
+ <template>
4
+ <div>
5
+ <slot></slot>
6
+ </div>
7
+ </template>
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ import { useSlots } from 'vue'
3
+ const slots = useSlots().default();
4
+
5
+ //fine component by name
6
+
7
+ const DragDropContainer = resolveComponent("l-drag-drop-container")
8
+
9
+
10
+ //find all l-drag-drop-container (include children)
11
+ function getContainers(nodes) {
12
+ const containers = [];
13
+ for (const node of nodes) {
14
+ console.log(node)
15
+
16
+ //check node is l-drag-drop-container
17
+
18
+ if (node.type === DragDropContainer) {
19
+ containers.push(node);
20
+ continue;
21
+ }
22
+
23
+
24
+ if (node.children) {
25
+ if (node.children.default) {
26
+ containers.push(...getContainers(node.children.default()));
27
+ }
28
+
29
+ }
30
+ }
31
+
32
+ return containers;
33
+ }
34
+
35
+ const containers = getContainers(slots);
36
+
37
+
38
+ //get all containers children and join them
39
+ function getItems(containers) {
40
+ const items = [];
41
+ for (const container of containers) {
42
+ items.push(...container.children.default());
43
+ }
44
+ return items;
45
+ }
46
+
47
+ const items = getItems(containers);
48
+
49
+
50
+
51
+ </script>
52
+ <template>
53
+ <div>
54
+ <slot></slot>
55
+ </div>
56
+ </template>
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ import { animations } from "@formkit/drag-and-drop";
3
+ import { useSlots, watch } from 'vue'
4
+ import { useDragAndDrop } from '@formkit/drag-and-drop/vue'
5
+ const slots = useSlots();
6
+
7
+ const model = defineModel()
8
+
9
+ const props = defineProps<{
10
+ group?: string
11
+ dragHandle?: string
12
+ }>()
13
+
14
+ const [parent, items] = useDragAndDrop(slots.default(), {
15
+ plugins: [animations()],
16
+ group: props.group,
17
+ dragHandle: props.dragHandle
18
+ });
19
+
20
+ if (model.value === null) { //default
21
+ model.value = items.value.map((item) => {
22
+ return item.props.name;
23
+ })
24
+ } else {
25
+ items.value = model.value.map((name) => {
26
+ return items.value.find((item) => item.props.name === name);
27
+ })
28
+
29
+ }
30
+
31
+ watch(items, () => {
32
+ model.value = items.value.map((item) => {
33
+ return item.props.name ?? Symbol();
34
+ })
35
+
36
+ })
37
+
38
+ </script>
39
+ <template>
40
+
41
+
42
+
43
+ <div ref="parent">
44
+ <template v-for="item in items" :key="item">
45
+ <component :is="item" />
46
+ </template>
47
+
48
+ </div>
49
+
50
+ </template>
@@ -12,9 +12,13 @@ defineProps<LTabsProps>()
12
12
  const slots = useSlots();
13
13
  const defaultSlots = slots.default ? slots.default() : []
14
14
 
15
+
16
+ const LTab = resolveComponent("l-tab")
15
17
  //get the tabs from the default slot
16
18
  let name = 0;
17
- const tabContents = defaultSlots.map((slot) => {
19
+ const tabContents = defaultSlots.filter((slot) => {
20
+ return slot.type === LTab
21
+ }).map((slot) => {
18
22
  const n = slot.props?.name || name++;
19
23
  return {
20
24
  label: slot.props?.label,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "route-gen": "node route-generate.mjs"
35
35
  },
36
36
  "dependencies": {
37
- "@formkit/drag-and-drop": "^0.0.24",
37
+ "@formkit/drag-and-drop": "^0.0.36",
38
38
  "@hostlink/light": "^1.2.1",
39
39
  "@nuxt/kit": "^3.7.4",
40
40
  "@nuxt/module-builder": "^0.5.2",