@hostlink/nuxt-light 1.6.7 → 1.6.8

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.6.7"
4
+ "version": "1.6.8"
5
5
  }
@@ -295,12 +295,15 @@ if (route.fullPath == "/" && my.default_page) {
295
295
 
296
296
  <q-space />
297
297
 
298
- <q-btn :icon="isFav ? 'favorite' : 'sym_o_favorite'" round flat dense class="q-mr-xs" @click="onToggleFav"
299
- v-if="app.hasFavorite">
298
+ <q-btn :icon="isFav ? 'favorite' : 'sym_o_favorite'" round flat dense class="q-mr-xs"
299
+ @click="onToggleFav" v-if="app.hasFavorite">
300
300
  </q-btn>
301
301
 
302
- <q-btn :icon="$q.fullscreen.isActive ? 'fullscreen_exit' : 'fullscreen'" round flat dense class="q-mr-xs"
303
- @click="$q.fullscreen.toggle()">
302
+ <q-btn :icon="$q.fullscreen.isActive ? 'fullscreen_exit' : 'fullscreen'" round flat dense
303
+ class="q-mr-xs" @click="$q.fullscreen.toggle()">
304
+ <q-tooltip>
305
+ {{ $q.fullscreen.isActive ? $t('Exit Fullscreen') : $t('Fullscreen') }}
306
+ </q-tooltip>
304
307
  </q-btn>
305
308
 
306
309
  <q-btn v-if="languages.length > 1" round flat icon="language" class="q-mr-xs">
@@ -412,23 +415,24 @@ if (route.fullPath == "/" && my.default_page) {
412
415
  <q-drawer overlay v-model="rightDrawerOpen" side="right" bordered>
413
416
  <!-- drawer content -->
414
417
  <q-scroll-area class="fit">
415
- <l-customizer v-model:color="light.color" v-model:theme="light.theme" v-model:miniState="style.miniState"
416
- v-model:dense="style.dense" v-model:menuOverlayHeader="style.menuOverlayHeader"
417
- v-model:footer="style.footer" v-model:menuWidth="menuWidth" :time="system.time" />
418
+ <l-customizer v-model:color="light.color" v-model:theme="light.theme"
419
+ v-model:miniState="style.miniState" v-model:dense="style.dense"
420
+ v-model:menuOverlayHeader="style.menuOverlayHeader" v-model:footer="style.footer"
421
+ v-model:menuWidth="menuWidth" :time="system.time" />
418
422
  </q-scroll-area>
419
423
  </q-drawer>
420
424
 
421
- <q-page-container :class="containerClass" :style="containerStyle">
422
-
423
- <!-- Error message -->
425
+ <q-page-container :class="containerClass" :style="containerStyle"> <!-- Error message -->
424
426
  <q-banner dense inline-actions class="bg-grey-4 q-ma-md" v-for=" error in errors " rounded>
425
427
  {{ error }}
428
+
426
429
  <template v-slot:action>
427
430
  <q-btn flat icon="sym_o_close" round dense @click="light.removeError(error)" />
428
431
  </template>
429
432
  </q-banner>
430
433
 
431
434
  <router-view v-slot="{ Component }">
435
+
432
436
  <template v-if="Component">
433
437
  <suspense>
434
438
  <component :is="Component" :reloadMenu="reloadMenu"></component>
@@ -443,12 +447,12 @@ if (route.fullPath == "/" && my.default_page) {
443
447
  <q-footer bordered v-if="style.footer">
444
448
  <q-item>
445
449
  <q-item-section>
446
- {{ light.getCompany() }} {{ appVersion }} - Copyright {{ app.copyrightYear }} {{ app.copyrightName }}.
450
+ {{ light.getCompany() }} {{ appVersion }} - Copyright {{ app.copyrightYear }} {{ app.copyrightName
451
+ }}.
447
452
  Build {{
448
- light.getVersion() }}
453
+ light.getVersion() }}
449
454
  </q-item-section>
450
455
  </q-item>
451
456
  </q-footer>
452
457
  </q-layout>
453
458
  </template>
454
-
@@ -1,15 +1,25 @@
1
1
  <script setup>
2
2
  import { ref, computed } from 'vue'
3
+ import { useDragAndDrop } from "@formkit/drag-and-drop/vue";
4
+ import { animations } from "@formkit/drag-and-drop";
3
5
 
4
6
  const props = defineProps({
5
7
  context: Object
8
+
6
9
  });
7
10
 
8
11
  const node = props.context.node;
12
+ console.log(node);
9
13
  const min = props.context.node.props.min ?? 1;
10
14
  const max = props.context.node.props.max ?? Infinity;
15
+ const sortable = (props.context.node.props.sortable !== undefined) ? props.context.node.props.sortable : true;
16
+
17
+ console.log(sortable);
18
+ const [parent, localValue] = useDragAndDrop(props.context.value, {
19
+ dragHandle: ".l-repeater-handle",
20
+ plugins: [animations()]
21
+ })
11
22
 
12
- const localValue = ref(props.context.value)
13
23
 
14
24
  if (localValue.value.length < min) {
15
25
  for (let i = localValue.value.length; i < min; i++) {
@@ -63,44 +73,47 @@ const isAllowMoveDown = (index) => {
63
73
 
64
74
  <template>
65
75
  <FormKit type="list" v-model="localValue" dynamic #default="{ items, node, value }" :name="node.name">
66
-
67
-
68
- <FormKit type="group" v-for="(item, index) in items " :index="index" :key="item">
69
-
70
- <q-card class="q-mb-sm" flat>
71
- <q-card-section>
72
- <div class="row q-col-gutter-md">
73
-
74
- <div class="col-shrink">
75
- <div class="q-mb-sm">
76
- <!-- up -->
77
- <q-btn type="button" @click="onMoveUp(index)" icon="sym_o_arrow_upward" :color="$light.color"
78
- dense unelevated :disable="!isAllowMoveUp(index)" />
79
- </div>
80
76
 
81
- <div class="q-mb-sm">
82
- <q-btn type="button" @click="onRemove" icon="sym_o_remove" :color="$light.color" dense unelevated
83
- :disable="!isAllowRemove" />
77
+ <div ref="parent">
78
+ <FormKit type="group" v-for="(item, index) in items" :index="index" :key="item">
79
+ <q-card class="q-mb-sm" flat>
80
+ <q-card-section>
81
+ <div class="row q-col-gutter-md">
82
+ <div class="col-shrink">
83
+ <div class="q-mb-sm" v-if="sortable">
84
+ <q-btn icon="sym_o_drag_handle" dense unelevated :color="$light.color"
85
+ style="cursor: grab;" class="l-repeater-handle">
86
+ </q-btn>
87
+ </div>
88
+ <div class="q-mb-sm" v-if="sortable">
89
+ <!-- up -->
90
+ <q-btn type="button" @click="onMoveUp(index)" icon="sym_o_arrow_upward"
91
+ :color="$light.color" dense unelevated :disable="!isAllowMoveUp(index)" />
92
+ </div>
93
+
94
+ <div class="q-mb-sm">
95
+ <q-btn type="button" @click="onRemove" icon="sym_o_remove" :color="$light.color"
96
+ dense unelevated :disable="!isAllowRemove" />
97
+ </div>
98
+ <div class="q-mb-sm" v-if="sortable">
99
+ <!-- down -->
100
+ <q-btn type="button" @click="onMoveDown(index)" icon="sym_o_arrow_downward"
101
+ :color="$light.color" dense unelevated :disable="!isAllowMoveDown(index)" />
102
+ </div>
84
103
  </div>
85
104
 
86
-
87
- <div class="q-mb-sm">
88
- <!-- down -->
89
- <q-btn type="button" @click="onMoveDown(index)" icon="sym_o_arrow_downward" :color="$light.color"
90
- dense unelevated :disable="!isAllowMoveDown(index)" />
105
+ <div class="col">
106
+ <slot v-bind="{ value: localValue[index] }"></slot>
91
107
  </div>
92
-
93
108
  </div>
94
-
95
- <div class="col">
96
- <slot v-bind="{ value: localValue[index] }"></slot>
97
- </div>
98
- </div>
99
- </q-card-section>
100
- </q-card>
101
- </FormKit>
102
-
103
- <q-btn :color="$light.color" @click="onAdd" icon="sym_o_add" :label="$t('Add')" :disable="localValue.length >= max"
104
- unelevated></q-btn>
109
+ </q-card-section>
110
+ </q-card>
111
+ </FormKit>
112
+ </div>
113
+
114
+ <q-toolbar>
115
+ <q-btn :color="$light.color" @click="onAdd" icon="sym_o_add" :label="$t('Add')"
116
+ :disable="localValue.length >= max" unelevated></q-btn>
117
+ </q-toolbar>
105
118
  </FormKit>
106
119
  </template>
@@ -81,7 +81,7 @@ export const createLightPlugin = () => {
81
81
  case "l-repeater":
82
82
  return node.define({
83
83
  type: "input",
84
- props: ["min", "max"],
84
+ props: ["min", "max", "sortable"],
85
85
  component: RepeaterVue
86
86
  });
87
87
  case "l-form":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -34,6 +34,7 @@
34
34
  "route-gen": "node route-generate.mjs"
35
35
  },
36
36
  "dependencies": {
37
+ "@formkit/drag-and-drop": "^0.0.24",
37
38
  "@hostlink/light": "^1.2.1",
38
39
  "@nuxt/kit": "^3.7.4",
39
40
  "@nuxt/module-builder": "^0.5.2",