@hostlink/nuxt-light 1.6.5 → 1.6.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.6.5"
4
+ "version": "1.6.6"
5
5
  }
@@ -20,7 +20,7 @@ const to = props.to ?? relativePath + "/add";
20
20
 
21
21
  </script>
22
22
  <template>
23
- <l-btn color="primary" icon="sym_o_add" :to="to" :label="label">
23
+ <l-btn :color="$light.color" icon="sym_o_add" :to="to" :label="label">
24
24
  <q-tooltip>
25
25
  {{ $t(label) }}
26
26
  </q-tooltip>
@@ -158,7 +158,7 @@ const date_attrs = computed(() => {
158
158
  <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
159
159
  <q-date v-bind="date_attrs" v-model="dateValue" :color="$light.color">
160
160
  <div class="row items-center justify-end">
161
- <q-btn v-close-popup label="Close" color="primary" flat />
161
+ <q-btn v-close-popup label="Close" :color="$light.color" flat />
162
162
  </div>
163
163
  </q-date>
164
164
  </q-popup-proxy>
@@ -121,9 +121,9 @@ const onClickMove = async () => {
121
121
  <q-tooltip> Create new folder</q-tooltip>
122
122
  </q-btn>
123
123
  <q-space></q-space>
124
- <q-btn dense label="Move to here" color="primary" v-if="mode == 'empty folder'">
124
+ <q-btn dense label="Move to here" :color="$light.color" v-if="mode == 'empty folder'">
125
125
  </q-btn>
126
- <q-btn dense label="Move" outline color="primary" v-if="mode == 'move'" @click="onClickMove"></q-btn>
126
+ <q-btn dense label="Move" outline :color="$light.color" v-if="mode == 'move'" @click="onClickMove"></q-btn>
127
127
  </q-card-actions>
128
128
  </q-card>
129
129
  </q-menu>
@@ -1,5 +1,4 @@
1
1
  <script setup>
2
- import { VariableType } from "json-to-graphql-query";
3
2
  import { useI18n } from "vue-i18n";
4
3
  import { ref, watch, computed } from 'vue';
5
4
  import { useQuasar, format } from 'quasar';
@@ -354,15 +353,8 @@ const onUploadFiles = async () => {
354
353
 
355
354
  await m("fsUploadFile", {
356
355
  path: path.value,
357
- file: new VariableType("file")
358
- }, [{
359
- __variables: {
360
- file: {
361
- type: "Upload!",
362
- value: file
363
- }
364
- }
365
- }]);
356
+ file
357
+ });
366
358
  }
367
359
  } catch (e) {
368
360
  quasar.dialog({
@@ -1,5 +1,4 @@
1
1
  <script setup lang="ts">
2
- import { VariableType } from "json-to-graphql-query";
3
2
  import { ref, computed, useAttrs } from "vue";
4
3
  import { useLight, m, q } from '#imports';
5
4
  import { Loading, Dialog } from "quasar";
@@ -97,16 +96,9 @@ const onUploadFile = async () => {
97
96
  try {
98
97
  let v = await m("fsUploadFile", {
99
98
  path: props.path,
100
- file: new VariableType("file"),
99
+ file: uploadFile.value,
101
100
  rename: rename.value
102
- }, [{
103
- __variables: {
104
- file: {
105
- type: "Upload!",
106
- value: uploadFile.value
107
- }
108
- }
109
- }]);
101
+ });
110
102
 
111
103
  //remove first slash if exists
112
104
  if (v.startsWith("/")) v = v.substr(1);
@@ -142,8 +134,8 @@ const onUploadFile = async () => {
142
134
  </q-card-section>
143
135
 
144
136
  <q-card-actions align="right">
145
- <q-btn flat :label="$t('Cancel')" color="primary" @click="uploadFile = null" v-close-popup></q-btn>
146
- <q-btn flat :label="$t('Upload')" color="primary" @click="onUploadFile"></q-btn>
137
+ <q-btn flat :label="$t('Cancel')" :color="$light.color" @click="uploadFile = null" v-close-popup></q-btn>
138
+ <q-btn flat :label="$t('Upload')" :color="$light.color" @click="onUploadFile"></q-btn>
147
139
  </q-card-actions>
148
140
  </l-card>
149
141
  </q-dialog>
@@ -3317,7 +3317,7 @@ watch(search, (val) => {
3317
3317
  <template v-slot:loading>
3318
3318
  <div class="text-center q-my-md">
3319
3319
 
3320
- <q-spinner-dots color="primary" size="40px" />
3320
+ <q-spinner-dots :color="$light.color" size="40px" />
3321
3321
  </div>
3322
3322
  </template>
3323
3323
  </q-infinite-scroll>
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <l-btn color="primary" icon="sym_o_save" label="Save" />
2
+ <l-btn :color="$light.color" icon="sym_o_save" label="Save" />
3
3
  </template>
@@ -60,7 +60,7 @@ const attrs = {
60
60
  <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
61
61
  <q-time v-model="localValue" format24h>
62
62
  <div class="row items-center justify-end">
63
- <q-btn v-close-popup label="Close" color="primary" flat />
63
+ <q-btn v-close-popup label="Close" :color="$light.color" flat />
64
64
  </div>
65
65
  </q-time>
66
66
  </q-popup-proxy>
@@ -74,19 +74,19 @@ const isAllowMoveDown = (index) => {
74
74
  <div class="col-shrink">
75
75
  <div class="q-mb-sm">
76
76
  <!-- up -->
77
- <q-btn type="button" @click="onMoveUp(index)" icon="sym_o_arrow_upward" color="primary"
77
+ <q-btn type="button" @click="onMoveUp(index)" icon="sym_o_arrow_upward" :color="$light.color"
78
78
  dense unelevated :disable="!isAllowMoveUp(index)" />
79
79
  </div>
80
80
 
81
81
  <div class="q-mb-sm">
82
- <q-btn type="button" @click="onRemove" icon="sym_o_remove" color="primary" dense unelevated
82
+ <q-btn type="button" @click="onRemove" icon="sym_o_remove" :color="$light.color" dense unelevated
83
83
  :disable="!isAllowRemove" />
84
84
  </div>
85
85
 
86
86
 
87
87
  <div class="q-mb-sm">
88
88
  <!-- down -->
89
- <q-btn type="button" @click="onMoveDown(index)" icon="sym_o_arrow_downward" color="primary"
89
+ <q-btn type="button" @click="onMoveDown(index)" icon="sym_o_arrow_downward" :color="$light.color"
90
90
  dense unelevated :disable="!isAllowMoveDown(index)" />
91
91
  </div>
92
92
 
@@ -100,7 +100,7 @@ const isAllowMoveDown = (index) => {
100
100
  </q-card>
101
101
  </FormKit>
102
102
 
103
- <q-btn color="primary" @click="onAdd" icon="sym_o_add" label="Add" :disable="localValue.length >= max"
103
+ <q-btn :color="$light.color" @click="onAdd" icon="sym_o_add" :label="$t('Add')" :disable="localValue.length >= max"
104
104
  unelevated></q-btn>
105
105
  </FormKit>
106
106
  </template>
@@ -1,23 +1,22 @@
1
- import f from "./f";
2
- import getApiUrl from "./getApiUrl";
3
- import getCurrentUser from "./getCurrentUser";
4
- import getObject from "./getObject";
5
- import list from "./list";
6
- import m from "./m";
7
- import q from "./q";
8
- import t from "./t";
9
- import updateObject from "./updateObject";
10
- import listObject from "./listObject";
11
- import loadObject from "./loadObject";
12
- import isGranted from "./isGranted";
13
- import GQLFieldBuilder from "./GQLFieldBuilder";
14
- import getModelField from './getModelField';
15
- import getModelFields from './getModelFields';
16
- import getModelColumns from './getModelColumns';
17
- import sv from './sv';
18
- import model from './model';
19
- declare const notify: (message: string, color?: string) => void;
20
- import getID from "./getID";
21
- declare const getApiBase: () => {};
22
- import { getGQLFields } from '@hostlink/light';
23
- export { f, getApiUrl, getCurrentUser, getObject, list, m, q, t, updateObject, notify, getID, listObject, isGranted, getApiBase, loadObject, GQLFieldBuilder, getModelField, getModelFields, getModelColumns, getGQLFields, sv, model };
1
+ export { default as f } from "./f";
2
+ export { default as getApiUrl } from "./getApiUrl";
3
+ export { default as getCurrentUser } from "./getCurrentUser";
4
+ export { default as getObject } from "./getObject";
5
+ export { default as list } from "./list";
6
+ export { default as m } from "./m";
7
+ export { default as q } from "./q";
8
+ export { default as t } from "./t";
9
+ export { default as updateObject } from "./updateObject";
10
+ export { default as listObject } from "./listObject";
11
+ export { default as loadObject } from "./loadObject";
12
+ export { default as isGranted } from "./isGranted";
13
+ export { default as GQLFieldBuilder } from "./GQLFieldBuilder";
14
+ export { default as getModelField } from "./getModelField";
15
+ export { default as getModelFields } from "./getModelFields";
16
+ export { default as getModelColumns } from "./getModelColumns";
17
+ export { default as sv } from "./sv";
18
+ export { default as model } from "./model";
19
+ export declare const notify: (message: string, color?: string) => void;
20
+ export { default as getID } from "./getID";
21
+ export declare const getApiBase: () => {};
22
+ export { getGQLFields } from '@hostlink/light';
@@ -1,57 +1,33 @@
1
1
  import { useRuntimeConfig } from "nuxt/app";
2
2
  import { Notify } from "quasar";
3
- import f from "./f.mjs";
4
- import getApiUrl from "./getApiUrl.mjs";
5
- import getCurrentUser from "./getCurrentUser.mjs";
6
- import getObject from "./getObject.mjs";
7
- import list from "./list.mjs";
8
- import m from "./m.mjs";
9
- import q from "./q.mjs";
10
- import t from "./t.mjs";
11
- import updateObject from "./updateObject.mjs";
12
- import listObject from "./listObject.mjs";
13
- import loadObject from "./loadObject.mjs";
14
- import isGranted from "./isGranted.mjs";
15
- import GQLFieldBuilder from "./GQLFieldBuilder.mjs";
16
- import getModelField from "./getModelField.mjs";
17
- import getModelFields from "./getModelFields.mjs";
18
- import getModelColumns from "./getModelColumns.mjs";
19
- import sv from "./sv.mjs";
20
- import model from "./model.mjs";
21
- const notify = function(message, color = "positive") {
3
+ export { default as f } from "./f.mjs";
4
+ export { default as getApiUrl } from "./getApiUrl.mjs";
5
+ export { default as getCurrentUser } from "./getCurrentUser.mjs";
6
+ export { default as getObject } from "./getObject.mjs";
7
+ export { default as list } from "./list.mjs";
8
+ export { default as m } from "./m.mjs";
9
+ export { default as q } from "./q.mjs";
10
+ export { default as t } from "./t.mjs";
11
+ export { default as updateObject } from "./updateObject.mjs";
12
+ export { default as listObject } from "./listObject.mjs";
13
+ export { default as loadObject } from "./loadObject.mjs";
14
+ export { default as isGranted } from "./isGranted.mjs";
15
+ export { default as GQLFieldBuilder } from "./GQLFieldBuilder.mjs";
16
+ export { default as getModelField } from "./getModelField.mjs";
17
+ export { default as getModelFields } from "./getModelFields.mjs";
18
+ export { default as getModelColumns } from "./getModelColumns.mjs";
19
+ export { default as sv } from "./sv.mjs";
20
+ export { default as model } from "./model.mjs";
21
+ export const notify = function(message, color = "positive") {
22
22
  Notify.create({
23
23
  message,
24
24
  color,
25
25
  position: "top"
26
26
  });
27
27
  };
28
- import getID from "./getID.mjs";
29
- const getApiBase = () => {
28
+ export { default as getID } from "./getID.mjs";
29
+ export const getApiBase = () => {
30
30
  const config = useRuntimeConfig();
31
31
  return config?.public?.apiBase ?? "/api/";
32
32
  };
33
- import { getGQLFields } from "@hostlink/light";
34
- export {
35
- f,
36
- getApiUrl,
37
- getCurrentUser,
38
- getObject,
39
- list,
40
- m,
41
- q,
42
- t,
43
- updateObject,
44
- notify,
45
- getID,
46
- listObject,
47
- isGranted,
48
- getApiBase,
49
- loadObject,
50
- GQLFieldBuilder,
51
- getModelField,
52
- getModelFields,
53
- getModelColumns,
54
- getGQLFields,
55
- sv,
56
- model
57
- };
33
+ export { getGQLFields } from "@hostlink/light";
@@ -1 +1,3 @@
1
- export default function (operation: string, args: any, fields?: any): Promise<any>;
1
+ export default function (operation: string, args?: {
2
+ [key: string]: any;
3
+ }, fields?: any): Promise<any>;
@@ -1,56 +1,4 @@
1
- import axios from "axios";
2
- import { jsonToGraphQLQuery } from "json-to-graphql-query";
3
- import { getApiBase } from "./index.mjs";
4
- export default async function(operation, args, fields = []) {
5
- const mutation = {
6
- mutation: {}
7
- };
8
- if (arguments.length == 1) {
9
- mutation.mutation[operation] = true;
10
- } else {
11
- mutation.mutation[operation] = {};
12
- }
13
- if (args) {
14
- mutation.mutation[operation].__args = args;
15
- }
16
- let map = {};
17
- let map_values = [];
18
- fields.forEach((field) => {
19
- if (typeof field === "string") {
20
- mutation.mutation[operation][field] = true;
21
- } else {
22
- mutation.mutation.__variables = mutation.mutation.__variables || {};
23
- let i = 0;
24
- Object.entries(field.__variables).forEach(([key, value]) => {
25
- mutation.mutation.__variables[key] = value.type;
26
- map[i] = ["variables." + key];
27
- map_values.push(value.value);
28
- i++;
29
- });
30
- }
31
- });
32
- const graphql_query = jsonToGraphQLQuery(mutation);
33
- let service = axios.create({
34
- withCredentials: true
35
- });
36
- let data = null;
37
- if (map_values.length) {
38
- const fd = new FormData();
39
- fd.append("operations", JSON.stringify({
40
- query: graphql_query
41
- }));
42
- fd.append("map", JSON.stringify(map));
43
- for (let i = 0; i < map_values.length; i++) {
44
- fd.append(i.toString(), map_values[i]);
45
- }
46
- data = (await service.post(getApiBase(), fd)).data;
47
- } else {
48
- data = (await service.post(getApiBase(), {
49
- query: graphql_query
50
- })).data;
51
- }
52
- if (data.errors) {
53
- throw new Error(data.errors[0].message);
54
- }
55
- return data.data[operation];
1
+ import { mutation } from "@hostlink/light";
2
+ export default function(operation, args, fields = []) {
3
+ return mutation(operation, args, fields);
56
4
  }
@@ -1,19 +1,8 @@
1
- import { VariableType } from "json-to-graphql-query";
2
1
  import m from "./m.mjs";
3
2
  import { Dialog } from "quasar";
4
3
  export default async (name, id, data) => {
5
4
  try {
6
- const variables = {};
7
- Object.entries(data).forEach(([key, value]) => {
8
- if (value instanceof File) {
9
- variables[key] = {
10
- type: "Upload!",
11
- value
12
- };
13
- data[key] = new VariableType(key);
14
- }
15
- });
16
- return await m(`update${name}`, { id, data }, [{ __variables: variables }]);
5
+ return await m(`update${name}`, { id, data });
17
6
  } catch (e) {
18
7
  Dialog.create({
19
8
  title: "Error",
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
- import { getObject } from "../../../"
2
+ import { getObject } from "#imports"
3
3
  const obj = await getObject(["eventlog_id", "class", "id", "action", "created_time", "username", "source", "target"]);
4
+
5
+ const splitterModel = 50;
4
6
  </script>
5
7
  <template>
6
8
  <l-page>
@@ -13,27 +15,26 @@ const obj = await getObject(["eventlog_id", "class", "id", "action", "created_ti
13
15
  <l-item label="Created time">{{ obj.created_time }}</l-item>
14
16
  <l-item label="Username">{{ obj.username }}</l-item>
15
17
 
16
- <q-item>
17
- <q-item-section>
18
- <q-item-label>{{ $t('Source') }}</q-item-label>
19
- <q-item-label caption>
20
- <pre>{{ obj.source }}</pre>
21
- </q-item-label>
22
- </q-item-section>
23
- </q-item>
18
+ </l-list>
24
19
 
20
+ <q-splitter v-model="splitterModel" >
21
+ <template v-slot:before>
22
+ <div class="q-pa-md">
23
+ <div class="text-h6 q-mb-md">{{ $t('Source') }}</div>
24
+ <pre>{{ obj.source }}</pre>
25
+ </div>
26
+ </template>
25
27
 
26
- <q-item>
27
- <q-item-section>
28
- <q-item-label>{{ $t('Target') }}</q-item-label>
29
- <q-item-label caption style="white-space: pre-wrap;">
30
- {{ obj.target }}
31
- </q-item-label>
32
- </q-item-section>
33
- </q-item>
34
- </l-list>
35
- </l-card>
28
+ <template v-slot:after>
29
+ <div class="q-pa-md">
30
+ <div class="text-h6 q-mb-md">{{ $t('Target') }}</div>
31
+ <pre>{{ obj.target }}
32
+ </pre>
36
33
 
34
+ </div>
35
+ </template>
36
+ </q-splitter>
37
+ </l-card>
37
38
 
38
39
  </l-page>
39
40
  </template>
@@ -218,8 +218,8 @@ const menusOnly = computed(() => {
218
218
  </q-card-section>
219
219
 
220
220
  <q-card-actions align="right">
221
- <q-btn flat label="Cancel" color="primary" v-close-popup />
222
- <q-btn flat label="Move" color="primary" @click="onMoveConfirm" />
221
+ <q-btn flat label="Cancel" :color="$light.color" v-close-popup />
222
+ <q-btn flat label="Move" :color="$light.color" @click="onMoveConfirm" />
223
223
  <!-- q-btn flat label="Move to root" color="primary" @click="onMoveToRoot" /-->
224
224
  </q-card-actions>
225
225
  </l-card>
@@ -2,7 +2,6 @@
2
2
  import { ref } from 'vue'
3
3
  import { Notify } from 'quasar'
4
4
  import { reset } from "@formkit/core"
5
- import { useRouter } from 'vue-router'
6
5
  import { q, m } from '#imports'
7
6
 
8
7
  const { app } = await q({ app: { config: ["name", "value"] } })
@@ -69,7 +68,7 @@ const tab = ref('general')
69
68
  <template>
70
69
  <l-page>
71
70
 
72
- <q-card flat bordered>
71
+ <l-card>
73
72
  <q-splitter unit="px" :model-value="120">
74
73
  <template #before>
75
74
  <q-tabs v-model="tab" vertical :active-color="$light.color">
@@ -80,7 +79,7 @@ const tab = ref('general')
80
79
  </q-tabs>
81
80
  </template>
82
81
  <template #after>
83
- <FormKit type="l-form" :value="{
82
+ <FormKit type="l-form" :bordered="false" :value="{
84
83
  company: obj.company,
85
84
  company_logo: obj.company_logo,
86
85
  copyright_name: obj.copyright_name,
@@ -94,7 +93,7 @@ const tab = ref('general')
94
93
 
95
94
  </FormKit>
96
95
 
97
- <FormKit type="l-form" :value="{
96
+ <FormKit type="l-form" :bordered="false" :value="{
98
97
  password_contains_uppercase: obj.password_contains_uppercase,
99
98
  password_contains_lowercase: obj.password_contains_lowercase,
100
99
  password_contains_numeric: obj.password_contains_numeric,
@@ -139,7 +138,7 @@ const tab = ref('general')
139
138
  validation="required" />
140
139
  </FormKit>
141
140
 
142
- <FormKit type="l-form" :value="{
141
+ <FormKit type="l-form" :bordered="false" :value="{
143
142
  file_manager: obj.file_manager,
144
143
 
145
144
  }" v-if="tab == 'Modules'" @submit="onSubmit">
@@ -148,7 +147,7 @@ const tab = ref('general')
148
147
  </q-field>
149
148
  </FormKit>
150
149
 
151
- <FormKit type="l-form" :value="{
150
+ <FormKit type="l-form" :bordered="false" :value="{
152
151
  mode: obj.mode,
153
152
 
154
153
  }" v-if="tab == 'Developer'" @submit="onSubmit">
@@ -156,11 +155,11 @@ const tab = ref('general')
156
155
  { label: 'Production', value: 'prod' },
157
156
  { label: 'Development', value: 'dev' },
158
157
 
159
- ]" name="mode" validation="required">
158
+ ]" name="mode" validation="required" >
160
159
  </FormKit>
161
160
  </FormKit>
162
161
  </template>
163
162
  </q-splitter>
164
- </q-card>
163
+ </l-card>
165
164
  </l-page>
166
165
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
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
- "@hostlink/light": "^1.0.0",
37
+ "@hostlink/light": "^1.2.1",
38
38
  "@nuxt/kit": "^3.7.4",
39
39
  "@nuxt/module-builder": "^0.5.2",
40
40
  "@quasar/extras": "^1.16.6",