@hostlink/nuxt-light 1.3.1 → 1.4.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.1"
4
+ "version": "1.4.1"
5
5
  }
@@ -3,7 +3,7 @@ import { useRoute } from 'vue-router';
3
3
  import { useLight, q, m } from "#imports";
4
4
  import { useQuasar, Loading, Dialog } from 'quasar';
5
5
  import { useI18n } from 'vue-i18n';
6
- import { ref, computed, reactive, provide, watch, toRaw } from 'vue';
6
+ import { ref, computed, reactive, provide, watch, toRaw, inject } from 'vue';
7
7
  import { useRuntimeConfig } from 'nuxt/app';
8
8
 
9
9
  Loading.show()
@@ -17,7 +17,7 @@ const appVersion = config.public.appVersion ?? '0.0.1';
17
17
 
18
18
  const quasar = useQuasar();
19
19
  const tt = await q({
20
- system: ["devMode"],
20
+ system: ["devMode", "time"],
21
21
  app: ["menus", "viewAsMode", "languages",
22
22
  "copyrightYear",
23
23
  "copyrightName",
@@ -29,8 +29,11 @@ const tt = await q({
29
29
  let app = tt.app
30
30
  let my = reactive(tt.my)
31
31
 
32
- const light = useLight();
32
+ const light = useLight({
33
+ color: my.styles?.color || 'primary'
34
+ });
33
35
  light.init(my.styles);
36
+
34
37
  //set permission
35
38
  light.setPermissions(my.permissions);
36
39
 
@@ -49,10 +52,13 @@ quasar.dark.set(light.isDarkMode());
49
52
  const i18n = useI18n();
50
53
  i18n.locale = my.language || 'en';
51
54
 
52
- let system = null
55
+ let system = tt.system;
53
56
 
54
57
  if (light.isGranted("system.storage")) {
55
- system = await q("system", ["diskFreeSpace", "diskUsageSpace", "diskTotalSpace", "diskFreeSpacePercent"]);
58
+ let s = await q("system", ["diskFreeSpace", "diskUsageSpace", "diskTotalSpace", "diskFreeSpacePercent"]);
59
+ //merge system value
60
+ system = { ...system, ...s };
61
+
56
62
  }
57
63
 
58
64
  // message
@@ -258,8 +264,16 @@ watch(menuWidth, () => {
258
264
  light.setStyle("menuWidth", menuWidth.value)
259
265
  })
260
266
 
267
+ const c1 = computed(() => {
268
+ return light.getColorValue(light.color)
269
+ })
270
+
261
271
  </script>
262
272
 
273
+ <style scoped>
274
+ .q-layout__section--marginal{background-color:v-bind(c1)}
275
+ </style>
276
+
263
277
  <template>
264
278
  <q-layout :view="layoutView">
265
279
  <q-header bordered class="text-white" :class="`bg-${light.color}`">
@@ -394,7 +408,7 @@ watch(menuWidth, () => {
394
408
  <q-scroll-area class="fit">
395
409
  <l-customizer v-model:color="light.color" v-model:theme="light.theme" v-model:miniState="style.miniState"
396
410
  v-model:dense="style.dense" v-model:menuOverlayHeader="style.menuOverlayHeader"
397
- v-model:footer="style.footer" v-model:menuWidth="menuWidth" />
411
+ v-model:footer="style.footer" v-model:menuWidth="menuWidth" :time="system.time" />
398
412
  </q-scroll-area>
399
413
  </q-drawer>
400
414
 
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { provide, ref } from 'vue'
2
3
  import { useLight, watch } from "#imports";
3
4
  import { useRuntimeConfig } from 'nuxt/app'
4
5
  import { setApiUrl } from '@hostlink/light'
@@ -32,6 +33,9 @@ try {
32
33
  }
33
34
 
34
35
 
36
+ const color = ref(light.color);
37
+ provide('color', color)
38
+
35
39
  </script>
36
40
  <template>
37
41
  <q-layout v-if="!app.logged">
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { type QBtnProps } from "quasar";
3
- import { computed } from "vue";
3
+ import { computed, inject, unref, toRaw } from "vue";
4
4
  import { useLight } from '#imports';
5
5
  import { useI18n } from "vue-i18n";
6
6
 
@@ -28,14 +28,12 @@ const attrs = computed(() => {
28
28
  a.label = t(a.label)
29
29
  }
30
30
 
31
+ a.color = (props.color != undefined) ? props.color : light.color
31
32
  return a;
32
-
33
33
  });
34
-
35
-
36
34
  </script>
37
35
  <template>
38
- <q-btn v-bind="attrs" color="primary" v-if="$light.isGranted(permission)">
36
+ <q-btn v-bind="attrs" v-if="$light.isGranted(permission)">
39
37
  <slot></slot>
40
38
  </q-btn>
41
39
  </template>
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { computed, ref } from 'vue'
2
3
  const menuWidth = defineModel('menuWidth', {
3
4
  type: Number,
4
5
  default: 280
@@ -38,6 +39,10 @@ const COLORS = [
38
39
  defineEmits(['update:theme', 'update:menuOverlayHeader', 'update:dense', 'update:color', 'update:miniState', 'update:footer'])
39
40
 
40
41
  const props = defineProps({
42
+ time: {
43
+ type: String,
44
+ default: ''
45
+ },
41
46
  color: {
42
47
  type: String,
43
48
  default: 'primary'
@@ -65,6 +70,19 @@ const props = defineProps({
65
70
 
66
71
  })
67
72
 
73
+
74
+ //find the difference between the current time and the server time
75
+
76
+ const time_diff = ref(new Date().getTime() - new Date(props.time).getTime());
77
+ const server_time = ref(new Date(props.time).toLocaleTimeString());
78
+ const server_date = ref(new Date(props.time).toLocaleDateString());
79
+
80
+ setInterval(() => {
81
+ server_time.value = new Date(new Date().getTime() - time_diff.value).toLocaleTimeString();
82
+ server_date.value = new Date(new Date().getTime() - time_diff.value).toLocaleDateString();
83
+ }, 500);
84
+
85
+
68
86
  </script>
69
87
  <template>
70
88
  <q-list>
@@ -80,11 +98,11 @@ const props = defineProps({
80
98
  <q-item-label>Skin</q-item-label>
81
99
  <div class="q-gutter-sm">
82
100
  <q-radio :model-value="theme" val="light" label="Light"
83
- @update:model-value="$emit('update:theme', $event)" />
101
+ @update:model-value="$emit('update:theme', $event)" :color="$light.color" />
84
102
  <q-radio :model-value="theme" val="dark" label="Dark"
85
- @update:model-value="$emit('update:theme', $event)" />
103
+ @update:model-value="$emit('update:theme', $event)" :color="$light.color" />
86
104
  <q-radio :model-value="theme" val="semi-dark" label="Semi dark"
87
- @update:model-value="$emit('update:theme', $event)" />
105
+ @update:model-value="$emit('update:theme', $event)" :color="$light.color" />
88
106
  </div>
89
107
  </q-item-section>
90
108
  </q-item>
@@ -104,7 +122,8 @@ const props = defineProps({
104
122
  <q-item-label>{{ $t('Mini mode') }}</q-item-label>
105
123
  </q-item-section>
106
124
  <q-item-section side>
107
- <q-toggle :model-value="miniState" @update:model-value="$emit('update:miniState', $event)" />
125
+ <q-toggle :model-value="miniState" @update:model-value="$emit('update:miniState', $event)"
126
+ :color="$light.color" />
108
127
  </q-item-section>
109
128
  </q-item>
110
129
  <q-separator />
@@ -114,7 +133,7 @@ const props = defineProps({
114
133
  <q-item-label>Menu dense mode</q-item-label>
115
134
  </q-item-section>
116
135
  <q-item-section side>
117
- <q-toggle :model-value="dense" @update:model-value="$emit('update:dense', $event)" />
136
+ <q-toggle :model-value="dense" @update:model-value="$emit('update:dense', $event)" :color="$light.color" />
118
137
  </q-item-section>
119
138
  </q-item>
120
139
 
@@ -125,8 +144,8 @@ const props = defineProps({
125
144
  <q-item-label>Menu overlay header</q-item-label>
126
145
  </q-item-section>
127
146
  <q-item-section side>
128
- <q-toggle :model-value="menuOverlayHeader"
129
- @update:model-value="$emit('update:menuOverlayHeader', $event)" />
147
+ <q-toggle :model-value="menuOverlayHeader" @update:model-value="$emit('update:menuOverlayHeader', $event)"
148
+ :color="$light.color" />
130
149
  </q-item-section>
131
150
  </q-item>
132
151
 
@@ -137,7 +156,8 @@ const props = defineProps({
137
156
  <q-item-label>{{ $t('Show footer') }}</q-item-label>
138
157
  </q-item-section>
139
158
  <q-item-section side>
140
- <q-toggle :model-value="footer" @update:model-value="$emit('update:footer', $event)" />
159
+ <q-toggle :model-value="footer" @update:model-value="$emit('update:footer', $event)"
160
+ :color="$light.color" />
141
161
  </q-item-section>
142
162
  </q-item>
143
163
  <q-separator />
@@ -150,5 +170,14 @@ const props = defineProps({
150
170
  </q-item>
151
171
  <q-separator />
152
172
 
173
+ <q-item>
174
+ <q-item-section>
175
+ <q-item-label>{{ $t('Server time') }}</q-item-label>
176
+ </q-item-section>
177
+ <q-item-section side>
178
+ <q-item-label>{{ server_date }} {{ server_time }} </q-item-label>
179
+ </q-item-section>
180
+ </q-item>
181
+
153
182
  </q-list>
154
183
  </template>
@@ -152,11 +152,11 @@ const date_attrs = computed(() => {
152
152
 
153
153
  </script>
154
154
  <template>
155
- <q-input v-bind="input_attrs" v-model="localValue" :rules="rules">
155
+ <q-input v-bind="input_attrs" v-model="localValue" :rules="rules" :color="$light.color">
156
156
  <template v-slot:prepend>
157
157
  <q-btn icon="sym_o_event" round dense flat>
158
158
  <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
159
- <q-date v-bind="date_attrs" v-model="dateValue">
159
+ <q-date v-bind="date_attrs" v-model="dateValue" :color="$light.color">
160
160
  <div class="row items-center justify-end">
161
161
  <q-btn v-close-popup label="Close" color="primary" flat />
162
162
  </div>
@@ -1,9 +1,25 @@
1
1
  <script setup>
2
+ import { computed } from 'vue'
3
+ import { useLight } from '#imports'
4
+ const light = useLight()
2
5
  const props = defineProps(["value", "dense"])
6
+
7
+
8
+ const color1 = computed(() => {
9
+ return light.getColorValue()
10
+ });
11
+
12
+ const color2 = computed(() => {
13
+ let c = light.getColorValue()
14
+ // 0.7 alpha
15
+ c = c + "b3";
16
+ return c;
17
+ });
18
+
3
19
  </script>
4
20
 
5
21
  <style scoped>
6
- .menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,var(--q-primary),rgba(115,103,240,.7));color:#fff}
22
+ .menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,v-bind(color1),v-bind(color2));color:#fff}
7
23
  </style>
8
24
  <template>
9
25
  <q-expansion-item :label="$t('My favorite')" :dense="dense" ref="expansion" icon="sym_o_favorite">
@@ -4,9 +4,9 @@ import { computed } from 'vue';
4
4
  import { useI18n } from 'vue-i18n';
5
5
 
6
6
  import type { QFieldProps } from 'quasar';
7
-
8
7
  const props = defineProps<QFieldProps>()
9
8
  const light = useLight();
9
+
10
10
  const { t } = useI18n();
11
11
 
12
12
  const attrs = computed(() => {
@@ -20,6 +20,9 @@ const attrs = computed(() => {
20
20
  a.label = t(props.label);
21
21
  }
22
22
 
23
+ if (props.color === undefined) {
24
+ a.color = light.color
25
+ }
23
26
 
24
27
  return a;
25
28
  });
@@ -3,7 +3,7 @@ import { VariableType } from "json-to-graphql-query";
3
3
  import { useI18n } from "vue-i18n";
4
4
  import { ref, watch, computed } from 'vue';
5
5
  import { useQuasar } from 'quasar';
6
- import { q, m, useLight } from '../';
6
+ import { q, m, useLight } from '#imports';
7
7
  import {
8
8
  fsListFolders, fsCreateFolder, fsDeleteFolder, fsDeleteFile, fsRenameFile, fsRenameFolder, fsReadFile,
9
9
  granted
@@ -501,7 +501,7 @@ const isDark = computed(() => light.isDarkMode());
501
501
  <q-list padding class="text-grey-8">
502
502
  <q-item>
503
503
  <q-item-section>
504
- <q-btn icon="add" outline rounded color="primary" :label="$t('New')">
504
+ <q-btn icon="add" outline rounded :color="light.color" :label="$t('New')">
505
505
  <q-menu>
506
506
  <q-list>
507
507
  <q-item clickable v-close-popup @click="onNewFolder" v-if="permission.includes('fs.folder.create')">
@@ -571,8 +571,8 @@ const isDark = computed(() => light.isDarkMode());
571
571
  </q-card-section>
572
572
 
573
573
  <q-card-actions align="right">
574
- <q-btn flat label="Cancel" color="primary" v-close-popup></q-btn>
575
- <q-btn flat label="Upload" color="primary" @click="onUploadFiles"></q-btn>
574
+ <q-btn flat label="Cancel" :color="light.color" v-close-popup></q-btn>
575
+ <q-btn flat label="Upload" :color="light.color" @click="onUploadFiles"></q-btn>
576
576
  </q-card-actions>
577
577
  </l-card>
578
578
  </q-dialog>
@@ -86,7 +86,7 @@ const onSubmit = (e) => {
86
86
  </q-card-section>
87
87
 
88
88
  <q-card-actions align="right">
89
- <l-btn color="primary" :icon="submitIcon" :label="submitLabel" @click="save" :loading="loading" />
89
+ <l-btn :icon="submitIcon" :label="submitLabel" @click="save" :loading="loading" />
90
90
  </q-card-actions>
91
91
  </l-card>
92
92
  </q-form>
@@ -142,8 +142,9 @@ const attrs = computed(() => {
142
142
  if (props.required) {
143
143
  a.label = "* " + a.label;
144
144
  }
145
-
146
145
  }
146
+
147
+ if (props.color === undefined) a.color = light.color
147
148
  return a;
148
149
  })
149
150
  </script>
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useLight } from "#imports";
3
- import { ref, reactive, onMounted } from 'vue'
3
+ import { ref, reactive, onMounted, inject } from 'vue'
4
4
  import { useQuasar, Notify, Dialog } from 'quasar';
5
5
  import { useI18n } from 'vue-i18n';
6
6
  import { m, notify } from '#imports';
@@ -196,14 +196,15 @@ onMounted(() => {
196
196
  <l-input v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
197
197
  clearable :outlined="false" stackLabel autocomplete="username" />
198
198
  <l-input v-model="data.password" label="Password" type="password" clearable show-password stackLabel
199
- :rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false" autocomplete="current-password" />
199
+ :rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false"
200
+ autocomplete="current-password" />
200
201
  <l-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code" required type="text" clearable>
201
202
  </l-input>
202
203
  </div>
203
204
  </q-form>
204
205
  </q-card-section>
205
206
  <q-card-actions>
206
- <l-btn label="Login" outline rounded color="primary" icon="sym_o_login" @click="submit"/>
207
+ <l-btn label="Login" outline rounded color="primary" icon="sym_o_login" @click="submit" />
207
208
  <l-btn v-if="hasBioLogin" outline rounded color="primary" icon="sym_o_fingerprint" @click="bioLogin" />
208
209
  <l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword" />
209
210
  </q-card-actions>
@@ -1,7 +1,9 @@
1
1
  <script setup>
2
- import { ref } from 'vue'
2
+ import { ref, computed } from 'vue'
3
+ import { useLight } from '#imports'
3
4
  const props = defineProps(["value", "dense"])
4
5
  const menus = ref(null);
6
+ const light = useLight();
5
7
 
6
8
  const expansion = ref(null);
7
9
 
@@ -24,14 +26,35 @@ defineExpose({
24
26
  }
25
27
  })
26
28
 
29
+ const isShowExpansionItem = computed(() => {
30
+ if (props.value.children) {
31
+ if (props.value.children.length > 0) {
32
+ return true;
33
+
34
+ }
35
+ }
36
+ return false;
37
+
38
+ });
39
+
40
+ const color1 = computed(() => {
41
+ return light.getColorValue()
42
+ });
43
+
44
+ const color2 = computed(() => {
45
+ let c = light.getColorValue()
46
+ // 0.7 alpha
47
+ c = c + "b3";
48
+ return c;
49
+ });
50
+
27
51
  </script>
28
52
 
29
53
  <style scoped>
30
- .menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,var(--q-primary),rgba(115,103,240,.7));color:#fff}
54
+ .menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,v-bind(color1),v-bind(color2));color:#fff}
31
55
  </style>
32
56
  <template>
33
- <q-expansion-item v-if="value.children?.length > 0" :label="$t(value.label)" :icon="value.icon" :dense="dense"
34
- ref="expansion">
57
+ <q-expansion-item v-if="isShowExpansionItem" :label="$t(value.label)" :icon="value.icon" :dense="dense" ref="expansion">
35
58
  <q-list class="q-pl-md">
36
59
  <l-menu :value="menu" v-for="menu in value.children" :dense="dense" @show="onShowChild(menu)"
37
60
  ref="menus"></l-menu>
@@ -39,8 +62,8 @@ defineExpose({
39
62
  </q-expansion-item>
40
63
  <q-list v-else class="menu-list" :dense="dense">
41
64
  <q-separator v-if="value.type == 'separator'" :spaced="value.spaced" />
42
- <q-item-label header v-if="value.type=='header'">{{ value.label }}</q-item-label>
43
- <q-item v-ripple :to="value.to" v-if="!value.type" >
65
+ <q-item-label header v-if="value.type == 'header'">{{ value.label }}</q-item-label>
66
+ <q-item v-ripple :to="value.to" v-if="!value.type">
44
67
  <q-item-section avatar>
45
68
  <q-icon :name="value.icon" />
46
69
  </q-item-section>
@@ -49,7 +49,7 @@ const obj = await model('User').get({ user_id: props.id }, ["user_id", "username
49
49
  </q-item-section>
50
50
  <q-item-section>
51
51
  <div class="q-gutter-xs float-left">
52
- <q-badge v-for="role in obj.roles" :key="role">{{ role }}</q-badge>
52
+ <q-badge v-for="role in obj.roles" :key="role" :color="$light.color">{{ role }}</q-badge>
53
53
  </div>
54
54
  </q-item-section>
55
55
  </q-item>
@@ -16,7 +16,7 @@ const value = computed({
16
16
  </script>
17
17
  <template>
18
18
  <l-field label="Roles" stack-label :label="context.label" :error="error" :error-message="errorMessage">
19
- <q-option-group type="checkbox" :options="context.options" v-model="value" inline v-bind="context.attrs">
19
+ <q-option-group type="checkbox" :options="context.options" v-model="value" inline v-bind="context.attrs" :color="$light.color">
20
20
  </q-option-group>
21
21
  </l-field>
22
22
  </template>
@@ -6,6 +6,7 @@ declare const app: {
6
6
  isAdmin: boolean;
7
7
  permissions: string[];
8
8
  myFavorites: any[];
9
+ getColorValue: () => any;
9
10
  setMyFavorites: (favorites: any[]) => void;
10
11
  reloadMyFavorites: () => Promise<void>;
11
12
  getMyFavorites: () => any[];
@@ -35,7 +36,9 @@ declare module 'vue' {
35
36
  $light: typeof app;
36
37
  }
37
38
  }
38
- export declare const useLight: () => {
39
+ export declare const useLight: (options?: {
40
+ color?: string;
41
+ }) => {
39
42
  company: string;
40
43
  companyLogo: string;
41
44
  color: string;
@@ -43,6 +46,7 @@ export declare const useLight: () => {
43
46
  isAdmin: boolean;
44
47
  permissions: string[];
45
48
  myFavorites: any[];
49
+ getColorValue: () => any;
46
50
  setMyFavorites: (favorites: Array<any>) => void;
47
51
  reloadMyFavorites: () => Promise<void>;
48
52
  getMyFavorites: () => any[];
@@ -1,8 +1,37 @@
1
1
  import packageJson from "../../package.json";
2
- import { watch, reactive } from "vue";
2
+ import { watch, reactive, toRaw } from "vue";
3
3
  import { m, q } from "./lib/index.mjs";
4
4
  const errors = [];
5
5
  let styles = {};
6
+ const COLOR_CODE = {
7
+ red: "#f44336",
8
+ pink: "#e91e63",
9
+ purple: "#9c27b0",
10
+ "deep-purple": "#673ab7",
11
+ indigo: "#3f51b5",
12
+ blue: "#2196f3",
13
+ "light-blue": "#03a9f4",
14
+ cyan: "#00bcd4",
15
+ teal: "#009688",
16
+ green: "#4caf50",
17
+ "light-green": "#8bc34a",
18
+ lime: "#cddc39",
19
+ yellow: "#ffeb3b",
20
+ amber: "#ffc107",
21
+ orange: "#ff9800",
22
+ "deep-orange": "#ff5722",
23
+ brown: "#795548",
24
+ grey: "#9e9e9e",
25
+ "blue-grey": "#607d8b",
26
+ primary: "#7367f0",
27
+ secondary: "#82868b",
28
+ accent: "#9C27B0",
29
+ positive: "#28c76f",
30
+ negative: "#ea5455",
31
+ info: "#00cfe8",
32
+ warning: "#ff9f43",
33
+ dark: "#4b4b4b"
34
+ };
6
35
  let defaultStyle = {
7
36
  inputOutlined: true,
8
37
  inputStackLabel: true,
@@ -13,11 +42,14 @@ let defaultStyle = {
13
42
  const app = reactive({
14
43
  company: "",
15
44
  companyLogo: "",
16
- color: "primary",
45
+ color: "",
17
46
  theme: "light",
18
47
  isAdmin: false,
19
48
  permissions: Array(),
20
49
  myFavorites: Array(),
50
+ getColorValue: () => {
51
+ return COLOR_CODE[app.color];
52
+ },
21
53
  setMyFavorites: (favorites) => {
22
54
  app.myFavorites = favorites;
23
55
  },
@@ -106,9 +138,6 @@ const app = reactive({
106
138
  app.color = styles2.color || "primary";
107
139
  app.theme = styles2.theme || "semi-dark";
108
140
  app.setStyles(styles2);
109
- watch(() => app.color, async () => {
110
- await app.setStyle("color", app.color);
111
- });
112
141
  watch(() => app.theme, async () => {
113
142
  await app.setStyle("theme", app.theme);
114
143
  });
@@ -127,7 +156,16 @@ const app = reactive({
127
156
  }
128
157
  });
129
158
  let currentRoute = null;
130
- export const useLight = () => {
159
+ watch(() => app.color, async () => {
160
+ await m("updateMyStyle", {
161
+ name: "color",
162
+ value: app.color
163
+ });
164
+ });
165
+ export const useLight = (options = {}) => {
166
+ if (options.color !== void 0) {
167
+ toRaw(app).color = options.color;
168
+ }
131
169
  return app;
132
170
  };
133
171
  export * from "./lib/index.mjs";
@@ -1,4 +1,5 @@
1
1
  {
2
+ "Server time": "伺服器時間",
2
3
  "Developer": "開發者",
3
4
  "Modules": "模組",
4
5
  "Security": "安全",
@@ -32,7 +32,7 @@ const onSave = async () => {
32
32
  <l-input label="Permission name" v-model="obj.value" required></l-input>
33
33
 
34
34
  <l-field label="Roles" stack-label>
35
- <q-option-group type="checkbox" :options="roles" v-model="obj.roles" inline>
35
+ <q-option-group type="checkbox" :options="roles" v-model="obj.roles" inline :color="$light.color">
36
36
  </q-option-group>
37
37
  </l-field>
38
38
 
@@ -77,7 +77,10 @@ const onUpdate = (value, role, permission) => {
77
77
  </q-td>
78
78
  <q-td v-for="role in roles">
79
79
  <q-checkbox v-model="props.row[role.name]"
80
- @update:model-value="onUpdate($event, role.name, props.row.permission)" />
80
+ @update:model-value="onUpdate($event, role.name, props.row.permission)"
81
+
82
+ :color="$light.color"
83
+ />
81
84
  </q-td>
82
85
  </q-tr>
83
86
 
@@ -63,7 +63,7 @@ const submit = () => {
63
63
  <l-page>
64
64
  <l-form submit-label="Export" submit-icon="sym_o_download" @submit="submit">
65
65
  <l-field label="Roles" stack-label>
66
- <q-option-group type="checkbox" :options="roles" v-model="obj.roles" inline>
66
+ <q-option-group type="checkbox" :options="roles" v-model="obj.roles" inline :color="$light.color">
67
67
  </q-option-group>
68
68
  </l-field>
69
69
  </l-form>
@@ -124,8 +124,8 @@ const onRemoveUser = async (value, user) => {
124
124
 
125
125
  <template #body-cell-children="props">
126
126
  <q-td>
127
- <q-select :options="role_options" v-model="props.row.children" multiple use-chips dense
128
- @remove="onRemoveChild(props.row.name, $event)" @add="onAddChild(props.row.name, $event)">
127
+ <q-select :options="role_options" v-model="props.row.children" multiple use-chips
128
+ dense @remove="onRemoveChild(props.row.name, $event)" @add="onAddChild(props.row.name, $event)">
129
129
 
130
130
  </q-select>
131
131
  </q-td>
@@ -211,7 +211,7 @@ const menusOnly = computed(() => {
211
211
  <q-dialog v-model="showMove">
212
212
  <l-card>
213
213
  <q-card-section>
214
- <q-tree :nodes="menus" selected-color="primary" default-expand-all v-model:selected="moveTarget"
214
+ <q-tree :nodes="menus" :selected-color="$light.color" default-expand-all v-model:selected="moveTarget"
215
215
  node-key="uuid" ref="tree2" />
216
216
  </q-card-section>
217
217
 
@@ -224,17 +224,17 @@ const menusOnly = computed(() => {
224
224
  </q-dialog>
225
225
 
226
226
  <l-card>
227
- <q-card-actions v-if="selectedNode">
227
+ <q-card-actions v-if="selectedNode">
228
228
  <l-btn @click="onSave" label="Save" icon="sym_o_save" />
229
229
  <l-btn @click="onReload" label="Reload" icon="sym_o_refresh" />
230
230
  <template v-if="selectedNode.type == 'root'">
231
- <l-btn color="primary" @click="onAddChild(selectedNode)" label="Add" icon="sym_o_add" />
232
- <l-btn color="primary" @click="onAddHeader(selectedNode)" label="Add Header" icon="sym_o_add" />
233
- <l-btn color="primary" @click="onAddSeparator(selectedNode)" label="Add Separator" icon="sym_o_add" />
231
+ <l-btn @click="onAddChild(selectedNode)" label="Add" icon="sym_o_add" />
232
+ <l-btn @click="onAddHeader(selectedNode)" label="Add Header" icon="sym_o_add" />
233
+ <l-btn @click="onAddSeparator(selectedNode)" label="Add Separator" icon="sym_o_add" />
234
234
  </template>
235
235
 
236
236
  <template v-else>
237
- <q-btn-dropdown color="primary" label="Add" icon="sym_o_add">
237
+ <q-btn-dropdown :color="$light.color" label="Add" icon="sym_o_add">
238
238
  <q-list>
239
239
  <q-item clickable v-close-popup @click="onAddChild(selectedNode)">
240
240
  <q-item-section>
@@ -255,17 +255,17 @@ const menusOnly = computed(() => {
255
255
  </q-list>
256
256
  </q-btn-dropdown>
257
257
 
258
- <l-btn color="primary" @click="onRemove(selectedNode)" label="Remove" icon="sym_o_remove" />
258
+ <l-btn @click="onRemove(selectedNode)" label="Remove" icon="sym_o_remove" />
259
259
 
260
260
 
261
- <l-btn color="primary" @click="onMove(selectedNode)" label="Move" icon="sym_o_move" />
261
+ <l-btn @click="onMove(selectedNode)" label="Move" icon="sym_o_move" />
262
262
 
263
- <l-btn color="primary" @click="onMoveUp(selectedNode)" label="Up" icon="sym_o_arrow_upward" />
263
+ <l-btn @click="onMoveUp(selectedNode)" label="Up" icon="sym_o_arrow_upward" />
264
264
 
265
- <l-btn color="primary" @click="onMoveDown(selectedNode)" label="Down" icon="sym_o_arrow_downward" />
265
+ <l-btn @click="onMoveDown(selectedNode)" label="Down" icon="sym_o_arrow_downward" />
266
266
 
267
267
 
268
- <q-btn-dropdown color="primary" label="Add menus" icon="sym_o_add">
268
+ <q-btn-dropdown :color="$light.color" label="Add menus" icon="sym_o_add">
269
269
  <q-list>
270
270
  <q-item clickable v-close-popup @click="onAddChildMenu(selectedNode, 'list')">
271
271
  <q-item-section>
@@ -286,7 +286,7 @@ const menusOnly = computed(() => {
286
286
  <q-splitter v-model="splitterModel" style="height:680px">
287
287
  <template #before>
288
288
 
289
- <q-tree :nodes="menus" selected-color="primary" default-expand-all v-model:selected="selected"
289
+ <q-tree :nodes="menus" :selected-color="$light.color" default-expand-all v-model:selected="selected"
290
290
  node-key="uuid" ref="tree1" />
291
291
  </template>
292
292
 
@@ -20,7 +20,7 @@ const id = route.params.user_id;
20
20
 
21
21
 
22
22
  <q-card flat bordered>
23
- <q-tabs v-model="tab" :class="`text-${light.color}`" inline-label align="justify">
23
+ <q-tabs v-model="tab" :active-color="$light.color" inline-label align="justify">
24
24
  <q-tab name="overview" icon="sym_o_person" label="Overview" />
25
25
  <q-tab name="userlog" icon="sym_o_description" label="User log" />
26
26
  <q-tab name="eventlog" icon="sym_o_description" label="Event log" />
@@ -67,42 +67,42 @@ const setDefault = async () => {
67
67
  <template>
68
68
  <l-form @save="onSave" :bordered="false">
69
69
  <div>
70
- <q-checkbox v-model="styles.tableDense" label="Table dense" />
71
- <q-checkbox v-model="styles.tableFlat" label="Table flat" />
72
- <q-checkbox v-model="styles.tableBorder" label="Table bordered" />
70
+ <q-checkbox v-model="styles.tableDense" label="Table dense" :color="$light.color" />
71
+ <q-checkbox v-model="styles.tableFlat" label="Table flat" :color="$light.color" />
72
+ <q-checkbox v-model="styles.tableBorder" label="Table bordered" :color="$light.color" />
73
73
 
74
74
  <q-option-group v-model="styles.tableSeparator" inline class="q-mb-md" :options="[
75
75
  { label: 'Horizontal', value: 'horizontal' },
76
76
  { label: 'Vertical', value: 'vertical' },
77
77
  { label: 'Cell', value: 'cell' },
78
78
  { label: 'None', value: 'none' },
79
- ]" />
79
+ ]" :color="$light.color" />
80
80
 
81
81
  </div>
82
82
 
83
83
  <div>
84
- <q-checkbox v-model="styles.cardFlat" label="Card flat" />
85
- <q-checkbox v-model="styles.cardBordered" label="Card bordered" />
86
- <q-checkbox v-model="styles.cardSquare" label="Card square" />
84
+ <q-checkbox v-model="styles.cardFlat" label="Card flat" :color="$light.color"/>
85
+ <q-checkbox v-model="styles.cardBordered" label="Card bordered" :color="$light.color"/>
86
+ <q-checkbox v-model="styles.cardSquare" label="Card square" :color="$light.color"/>
87
87
 
88
88
  </div>
89
89
 
90
90
  <div>
91
- <q-checkbox v-model="styles.buttonOutline" label="Button outline" />
92
- <q-checkbox v-model="styles.buttonRounded" label="Button rounded" />
93
- <q-checkbox v-model="styles.buttonUnelevated" label="Button unelevated" />
94
- <q-checkbox v-model="styles.buttonDense" label="Button dense" />
91
+ <q-checkbox v-model="styles.buttonOutline" label="Button outline" :color="$light.color"/>
92
+ <q-checkbox v-model="styles.buttonRounded" label="Button rounded" :color="$light.color"/>
93
+ <q-checkbox v-model="styles.buttonUnelevated" label="Button unelevated" :color="$light.color"/>
94
+ <q-checkbox v-model="styles.buttonDense" label="Button dense" :color="$light.color"/>
95
95
 
96
96
  </div>
97
97
 
98
98
  <div>
99
- <q-checkbox v-model="styles.inputFilled" label="Input filled" />
100
- <q-checkbox v-model="styles.inputOutlined" label="Input outlined" />
101
- <q-checkbox v-model="styles.inputStandout" label="Input standout" />
102
- <q-checkbox v-model="styles.inputRounded" label="Input rounded" />
103
- <q-checkbox v-model="styles.inputDense" label="Input dense" />
104
- <q-checkbox v-model="styles.inputSquare" label="Input square" />
105
- <q-checkbox v-model="styles.inputStackLabel" label="Input stack label" />
99
+ <q-checkbox v-model="styles.inputFilled" label="Input filled" :color="$light.color"/>
100
+ <q-checkbox v-model="styles.inputOutlined" label="Input outlined" :color="$light.color"/>
101
+ <q-checkbox v-model="styles.inputStandout" label="Input standout" :color="$light.color"/>
102
+ <q-checkbox v-model="styles.inputRounded" label="Input rounded" :color="$light.color"/>
103
+ <q-checkbox v-model="styles.inputDense" label="Input dense" :color="$light.color"/>
104
+ <q-checkbox v-model="styles.inputSquare" label="Input square" :color="$light.color"/>
105
+ <q-checkbox v-model="styles.inputStackLabel" label="Input stack label" :color="$light.color"/>
106
106
 
107
107
 
108
108
  </div>
@@ -116,7 +116,7 @@ const setDefault = async () => {
116
116
  UI preview
117
117
  <div class="q-gutter-md q-mt-md">
118
118
 
119
- <q-btn color="primary" icon="sym_o_person" label="Button" :outline="styles.buttonOutline"
119
+ <q-btn :color="$light.color" icon="sym_o_person" label="Button" :outline="styles.buttonOutline"
120
120
  :rounded="styles.buttonRounded" :unelevated="styles.buttonUnelevated"
121
121
  :dense="styles.buttonDense"></q-btn>
122
122
 
@@ -10,7 +10,7 @@ const route = useRoute()
10
10
  <l-card>
11
11
  <q-splitter unit="px" :model-value="120">
12
12
  <template #before>
13
- <q-tabs v-model="tab" vertical>
13
+ <q-tabs v-model="tab" vertical :active-color="$light.color">
14
14
  <q-route-tab name="general" icon="sym_o_info" :label="$t('General')" to="/User/setting" exact
15
15
  replace />
16
16
  <q-route-tab name="information" icon="sym_o_info" :label="$t('Information')"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",