@hostlink/nuxt-light 1.3.0 → 1.3.1

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.3.0"
4
+ "version": "1.3.1"
5
5
  }
@@ -1,13 +1,13 @@
1
1
  <script setup>
2
2
  import { ref, computed, watch } from "vue";
3
+ import { useQuasar } from 'quasar';
3
4
  import { q, m } from '../';
4
5
  const emit = defineEmits(["selected"]);
5
6
  const data = await q("fsListFolders", { path: "/" }, ["name", "path"]);
6
7
  const folders = ref(data);
7
8
  const mode = ref("move");
8
9
  const folder = ref("/");
9
- const parent = ref(null);
10
- const selected = ref("/");
10
+ const parent = ref("/");
11
11
 
12
12
  const qua = useQuasar();
13
13
 
@@ -30,7 +30,7 @@ const title = computed(() => {
30
30
  const newFolder = ref(null);
31
31
 
32
32
  const onClickCreate = async () => {
33
- let f = selected.value + "/" + newFolder.value;
33
+ let f = folder.value + "/" + newFolder.value;
34
34
  await m("fsCreateFolder", { path: f });
35
35
 
36
36
  folder.value = f;
@@ -42,15 +42,15 @@ const menu = ref(null);
42
42
  const onClickMove = async () => {
43
43
  qua.dialog({
44
44
  title: "Move",
45
- message: "Are you sure you want to move?",
45
+ message: "Are you sure you want to move to \"" + folder.value + "\" ?",
46
46
  cancel: true,
47
47
  persistent: true,
48
48
  }).onOk(async () => {
49
49
 
50
50
 
51
51
  menu.value.hide();
52
- emit("selected", selected.value);
53
- selected.value = "/";
52
+ emit("selected", folder.value);
53
+ folder.value = "/";
54
54
  parent.value = null;
55
55
  folder.value = "/";
56
56
 
@@ -63,22 +63,22 @@ const onClickMove = async () => {
63
63
  <q-menu transition-show="jump-down" transition-hide="jump-up" ref="menu" @before-show="show">
64
64
  <q-card>
65
65
  <q-toolbar>
66
- <q-btn flat dense round @click="clickBack()" v-if="parent">
67
- <q-icon name="sym_o_arrow_back" />
68
- </q-btn>
69
- <q-toolbar-title>
70
- <template v-if="mode == 'create'">
71
- <q-input outlined dense v-model="newFolder">
72
- <template v-slot:append>
73
- <q-btn round dense flat icon="sym_o_add" @click="onClickCreate" />
74
- </template>
75
- </q-input>
76
- </template>
77
-
78
- <template v-else>
66
+ <template v-if="mode == 'create'">
67
+ <q-btn flat dense round @click="mode = 'move'" icon="sym_o_arrow_back" class="q-mr-sm">
68
+ <q-tooltip>Cancel</q-tooltip>
69
+ </q-btn>
70
+
71
+ </template>
72
+ <template v-else>
73
+ <q-btn flat dense round @click="clickBack()" v-if="folder !== '/'" icon="sym_o_arrow_back">
74
+ <q-tooltip>Back</q-tooltip>
75
+ </q-btn>
76
+ <q-toolbar-title>
79
77
  {{ title }}
80
- </template>
81
- </q-toolbar-title>
78
+ </q-toolbar-title>
79
+
80
+ </template>
81
+
82
82
  </q-toolbar>
83
83
 
84
84
  <template v-if="mode == 'empty folder'">
@@ -86,35 +86,39 @@ const onClickMove = async () => {
86
86
  </template>
87
87
 
88
88
  <template v-if="mode == 'create'">
89
- <q-card-section> Create folder at "{{ selected }}" </q-card-section>
89
+ <q-card-section>
90
+ <q-input outlined dense v-model="newFolder" :hint="`Create folder at ${folder}`" label="Foler name"
91
+ stack-label="">
92
+ <template v-slot:append v-if="newFolder">
93
+ <q-btn round dense flat icon="sym_o_add" @click="onClickCreate">
94
+ <q-tooltip>Create</q-tooltip>
95
+ </q-btn>
96
+ </template>
97
+ </q-input>
98
+ </q-card-section>
90
99
  </template>
91
100
 
92
101
  <template v-if="mode == 'move'">
93
102
  <q-list>
94
- <q-item v-for="(b, index) in folders" :key="index" clickable @click="selected = b.path"
95
- :active="selected === b.path">
96
- <q-item-section>
103
+ <q-item v-for="(b, index) in folders" :key="index" clickable @click="parent = folder; folder = b.path;">
104
+
105
+ <q-item-section avatar>
97
106
  <q-icon name="sym_o_folder"></q-icon>
98
107
  </q-item-section>
99
108
  <q-item-section>
100
109
  <q-item-label>{{ b.name }}</q-item-label>
101
110
  </q-item-section>
102
111
 
103
- <q-item-section side>
104
- <q-btn flat dense outlined @click="
105
- parent = folder;
106
- folder = b.path;
107
- ">
108
- <q-icon name="sym_o_navigate_next"></q-icon>
109
- </q-btn>
112
+ <q-item-section side avatar>
113
+ <q-icon name="sym_o_navigate_next"></q-icon>
110
114
  </q-item-section>
111
115
  </q-item>
112
116
  </q-list>
113
117
  </template>
114
118
 
115
119
  <q-card-actions>
116
- <q-btn flat dense @click="mode = 'create'" :disable="mode == 'create'">
117
- <q-icon name="sym_o_create_new_folder"></q-icon>
120
+ <q-btn flat dense @click="mode = 'create'" :disable="mode == 'create'" round icon="sym_o_create_new_folder">
121
+ <q-tooltip> Create new folder</q-tooltip>
118
122
  </q-btn>
119
123
  <q-space></q-space>
120
124
  <q-btn dense label="Move to here" color="primary" v-if="mode == 'empty folder'">
@@ -123,65 +127,4 @@ const onClickMove = async () => {
123
127
  </q-card-actions>
124
128
  </q-card>
125
129
  </q-menu>
126
- </template>
127
- <!--
128
- <script>
129
- import { listFolders, createFolder } from "./../lib/filemanager";
130
-
131
-
132
- export default {
133
- data() {
134
- return {
135
- selected: "/",
136
- folder: null,
137
- folders: [],
138
- parent: null,
139
- mode: "move",
140
- newFolder: null,
141
- };
142
- },
143
- watch: {
144
- async folder() {
145
- this.folders = await listFolders(this.folder);
146
-
147
- if (this.folders.length == 0) {
148
- this.mode = "empty folder";
149
- }
150
- },
151
- },
152
- computed: {
153
- title() {
154
- if (this.folder) {
155
- return this.folder.split("/").pop();
156
- }
157
- return "";
158
- },
159
- },
160
-
161
- methods: {
162
- show() {
163
- this.folder = "/";
164
- this.mode = "move";
165
- },
166
- async onClickCreate() {
167
- let folder = this.selected + "/" + this.newFolder;
168
- await createFolder(folder);
169
- this.folder = folder;
170
- },
171
- clickBack() {
172
- if (this.mode == "create") {
173
- this.mode = "move";
174
- return;
175
- }
176
-
177
- this.folder = this.parent;
178
-
179
-
180
- if (this.mode == "empty folder") {
181
- this.mode = "move";
182
- return;
183
- }
184
- },
185
- },
186
- };
187
- </script> -->
130
+ </template>
@@ -587,10 +587,21 @@ const isDark = computed(() => light.isDarkMode());
587
587
 
588
588
  <q-btn flat round icon="sym_o_drive_file_move" v-if="selected.length > 0">
589
589
  <l-file-manager-move @selected="moveToFolder($event)" />
590
+ <q-tooltip>
591
+ {{ $t('Move to') }}
592
+ </q-tooltip>
590
593
  </q-btn>
591
594
 
592
- <q-btn flat round icon="o_delete" @click="onDeleteSelected" v-if="selected.length > 0"></q-btn>
593
- <q-btn flat round :icon="grid ? 'list_view' : 'grid_view'" @click="grid = !grid"></q-btn>
595
+ <q-btn flat round icon="o_delete" @click="onDeleteSelected" v-if="selected.length > 0">
596
+ <q-tooltip>
597
+ {{ $t('Delete') }}
598
+ </q-tooltip>
599
+ </q-btn>
600
+ <q-btn flat round :icon="grid ? 'list_view' : 'grid_view'" @click="grid = !grid">
601
+ <q-tooltip>
602
+ {{ grid ? $t('List view') : $t('Grid view') }}
603
+ </q-tooltip>
604
+ </q-btn>
594
605
  </q-toolbar>
595
606
 
596
607
  <template v-if="grid">
@@ -138,12 +138,17 @@ const attrs = computed(() => {
138
138
 
139
139
  if (props.label) {
140
140
  a.label = i18n.t(props.label);
141
+
142
+ if (props.required) {
143
+ a.label = "* " + a.label;
144
+ }
145
+
141
146
  }
142
147
  return a;
143
148
  })
144
149
  </script>
145
150
  <template>
146
- <q-input v-bind="attrs" v-model="localValue" :rules="new_rules" :type="localType">
151
+ <q-input v-bind="attrs" v-model="localValue" :rules="new_rules" :type="localType">
147
152
  <template v-if="translate" #prepend>
148
153
  <q-btn icon="sym_o_translate" flat dense rounded>
149
154
  <q-menu dense>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",