@hostlink/nuxt-light 0.0.3

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.
Files changed (111) hide show
  1. package/README.md +106 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.ts +7 -0
  4. package/dist/module.json +5 -0
  5. package/dist/module.mjs +51 -0
  6. package/dist/runtime/assets/element.css +15925 -0
  7. package/dist/runtime/assets/element.css.map +1 -0
  8. package/dist/runtime/assets/main.css +13 -0
  9. package/dist/runtime/components/l-add-btn.vue +22 -0
  10. package/dist/runtime/components/l-app-main.vue +214 -0
  11. package/dist/runtime/components/l-app.vue +17 -0
  12. package/dist/runtime/components/l-back-btn.vue +7 -0
  13. package/dist/runtime/components/l-btn.vue +19 -0
  14. package/dist/runtime/components/l-card.vue +19 -0
  15. package/dist/runtime/components/l-checkbox.vue +6 -0
  16. package/dist/runtime/components/l-col.vue +14 -0
  17. package/dist/runtime/components/l-customizer.vue +102 -0
  18. package/dist/runtime/components/l-date-picker.vue +78 -0
  19. package/dist/runtime/components/l-delete-btn.vue +23 -0
  20. package/dist/runtime/components/l-edit-btn.vue +3 -0
  21. package/dist/runtime/components/l-file-manager-labels.vue +55 -0
  22. package/dist/runtime/components/l-file-manager-move.vue +185 -0
  23. package/dist/runtime/components/l-file-manager-preview.vue +59 -0
  24. package/dist/runtime/components/l-file-manager.vue +618 -0
  25. package/dist/runtime/components/l-file.vue +33 -0
  26. package/dist/runtime/components/l-form.vue +73 -0
  27. package/dist/runtime/components/l-input.vue +48 -0
  28. package/dist/runtime/components/l-item.vue +14 -0
  29. package/dist/runtime/components/l-link.vue +24 -0
  30. package/dist/runtime/components/l-list.vue +5 -0
  31. package/dist/runtime/components/l-login.vue +128 -0
  32. package/dist/runtime/components/l-menu.vue +37 -0
  33. package/dist/runtime/components/l-page.vue +94 -0
  34. package/dist/runtime/components/l-row.vue +5 -0
  35. package/dist/runtime/components/l-save-btn.vue +3 -0
  36. package/dist/runtime/components/l-select.vue +77 -0
  37. package/dist/runtime/components/l-table.vue +333 -0
  38. package/dist/runtime/components/l-tabs.vue +5 -0
  39. package/dist/runtime/components/l-time-picker.vue +28 -0
  40. package/dist/runtime/components/l-view-btn.vue +3 -0
  41. package/dist/runtime/composables/addObject.d.ts +2 -0
  42. package/dist/runtime/composables/addObject.mjs +6 -0
  43. package/dist/runtime/composables/f.d.ts +1 -0
  44. package/dist/runtime/composables/f.mjs +27 -0
  45. package/dist/runtime/composables/getApiUrl.d.ts +1 -0
  46. package/dist/runtime/composables/getApiUrl.mjs +4 -0
  47. package/dist/runtime/composables/getCurrentUser.d.ts +2 -0
  48. package/dist/runtime/composables/getCurrentUser.mjs +8 -0
  49. package/dist/runtime/composables/getObject.d.ts +1 -0
  50. package/dist/runtime/composables/getObject.mjs +20 -0
  51. package/dist/runtime/composables/id.d.ts +2 -0
  52. package/dist/runtime/composables/id.mjs +12 -0
  53. package/dist/runtime/composables/list.d.ts +1 -0
  54. package/dist/runtime/composables/list.mjs +33 -0
  55. package/dist/runtime/composables/listData.d.ts +1 -0
  56. package/dist/runtime/composables/listData.mjs +30 -0
  57. package/dist/runtime/composables/login.d.ts +2 -0
  58. package/dist/runtime/composables/login.mjs +17 -0
  59. package/dist/runtime/composables/m.d.ts +1 -0
  60. package/dist/runtime/composables/m.mjs +73 -0
  61. package/dist/runtime/composables/mutation.d.ts +1 -0
  62. package/dist/runtime/composables/mutation.mjs +23 -0
  63. package/dist/runtime/composables/q.d.ts +1 -0
  64. package/dist/runtime/composables/q.mjs +18 -0
  65. package/dist/runtime/composables/removeObject.d.ts +1 -0
  66. package/dist/runtime/composables/removeObject.mjs +15 -0
  67. package/dist/runtime/composables/t.d.ts +1 -0
  68. package/dist/runtime/composables/t.mjs +8 -0
  69. package/dist/runtime/composables/updateObject.d.ts +2 -0
  70. package/dist/runtime/composables/updateObject.mjs +10 -0
  71. package/dist/runtime/composables/useLight.d.ts +7 -0
  72. package/dist/runtime/composables/useLight.mjs +17 -0
  73. package/dist/runtime/composables/viewAs.d.ts +1 -0
  74. package/dist/runtime/composables/viewAs.mjs +15 -0
  75. package/dist/runtime/locales/en.json +14 -0
  76. package/dist/runtime/locales/zh-hk.json +140 -0
  77. package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +21 -0
  78. package/dist/runtime/pages/EventLog/index.vue +56 -0
  79. package/dist/runtime/pages/FileManager/index.vue +5 -0
  80. package/dist/runtime/pages/MailLog/index.vue +48 -0
  81. package/dist/runtime/pages/Permission/add.vue +47 -0
  82. package/dist/runtime/pages/Permission/all.vue +85 -0
  83. package/dist/runtime/pages/Permission/index.vue +26 -0
  84. package/dist/runtime/pages/Role/add.vue +28 -0
  85. package/dist/runtime/pages/Role/index.vue +51 -0
  86. package/dist/runtime/pages/System/database/backup.vue +5 -0
  87. package/dist/runtime/pages/System/database/table.vue +19 -0
  88. package/dist/runtime/pages/System/index.vue +8 -0
  89. package/dist/runtime/pages/System/mailtest.vue +22 -0
  90. package/dist/runtime/pages/System/package.vue +8 -0
  91. package/dist/runtime/pages/System/phpinfo.vue +8 -0
  92. package/dist/runtime/pages/System/setting.vue +68 -0
  93. package/dist/runtime/pages/System/view_as.vue +56 -0
  94. package/dist/runtime/pages/User/_user_id/change-password.vue +49 -0
  95. package/dist/runtime/pages/User/_user_id/edit.vue +49 -0
  96. package/dist/runtime/pages/User/_user_id/view.vue +21 -0
  97. package/dist/runtime/pages/User/add.vue +64 -0
  98. package/dist/runtime/pages/User/index.vue +47 -0
  99. package/dist/runtime/pages/User/profile.vue +25 -0
  100. package/dist/runtime/pages/User/update-password.vue +45 -0
  101. package/dist/runtime/pages/UserLog/index.vue +53 -0
  102. package/dist/runtime/pages/index.vue +9 -0
  103. package/dist/runtime/pages/logout.vue +10 -0
  104. package/dist/runtime/plugin.d.ts +4 -0
  105. package/dist/runtime/plugin.mjs +58 -0
  106. package/dist/runtime/routes.d.ts +7 -0
  107. package/dist/runtime/routes.mjs +261 -0
  108. package/dist/runtime/system_menus.d.ts +10 -0
  109. package/dist/runtime/system_menus.mjs +37 -0
  110. package/dist/types.d.ts +15 -0
  111. package/package.json +57 -0
@@ -0,0 +1,78 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ modelValue: {
4
+ type: [String, Object],
5
+ required: false,
6
+ default: null
7
+ },
8
+ range: {
9
+ type: Boolean,
10
+ default: false
11
+ },
12
+ label: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ });
17
+
18
+ const emit = defineEmits(["update:modelValue"]);
19
+ const popup = ref(null);
20
+ const localValue = computed({
21
+ get: () => {
22
+ if (props.range) {
23
+ if (props.modelValue) {
24
+ return props.modelValue.from + " - " + props.modelValue.to
25
+ }
26
+ }
27
+ return props.modelValue
28
+ },
29
+ set: (value) => {
30
+ console.log(value);
31
+ popup.value.hide();
32
+ emit('update:modelValue', value)
33
+ }
34
+
35
+ });
36
+
37
+ const rules = [];
38
+
39
+
40
+
41
+ rules.push((val) => {
42
+
43
+ if (props.range) {
44
+ return;
45
+ }
46
+
47
+ if (props.required) {
48
+ //check val is YYYY-MM-DD
49
+ if (!val.match(/^\d{4}-\d{2}-\d{2}$/)) {
50
+ return "Invalid date format";
51
+ }
52
+
53
+ }
54
+ return;
55
+ });
56
+
57
+ const localLabel = computed(() => {
58
+
59
+ return t(props.label);
60
+
61
+ });
62
+
63
+ </script>
64
+ <template>
65
+ <q-input v-model="localValue" :rules="rules" :label="localLabel" hide-bottom-space>
66
+ <template v-slot:prepend>
67
+ <q-btn icon="sym_o_event" round dense flat>
68
+ <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
69
+ <q-date v-model="localValue" mask="YYYY-MM-DD" :range="range">
70
+ <div class="row items-center justify-end">
71
+ <q-btn v-close-popup label="Close" color="primary" flat />
72
+ </div>
73
+ </q-date>
74
+ </q-popup-proxy>
75
+ </q-btn>
76
+ </template>
77
+ </q-input>
78
+ </template>
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+
3
+ import { useQuasar } from 'quasar';
4
+
5
+ const props = defineProps(["to"]);
6
+
7
+ const emit = defineEmits(["submit"]);
8
+
9
+ const qua = useQuasar();
10
+ const onDelete = () => {
11
+ qua.dialog({
12
+ title: "Delete",
13
+ message: "Are you sure you want to delete this record?",
14
+ cancel: true,
15
+ persistent: true
16
+ }).onOk(async () => {
17
+ emit("submit");
18
+ })
19
+ }
20
+ </script>
21
+ <template>
22
+ <q-btn flat round dense icon="sym_o_delete" @click="onDelete" />
23
+ </template>
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <q-btn flat round dense icon="sym_o_edit" to="edit" />
3
+ </template>
@@ -0,0 +1,55 @@
1
+ <script setup>
2
+
3
+ const props = defineProps({
4
+ modelValue: {
5
+ type: String,
6
+ default: ""
7
+ }
8
+ })
9
+
10
+ const emit = defineEmits(['update:modelValue'])
11
+ const toggleLabel = (type) => {
12
+
13
+ if (props.modelValue == type) {
14
+ emit('update:modelValue', null)
15
+ } else {
16
+ emit('update:modelValue', type)
17
+ }
18
+ }
19
+
20
+ </script>
21
+ <template>
22
+ <q-item-label header>
23
+ {{ $t('Labels') }}
24
+ </q-item-label>
25
+ <q-item clickable :active="modelValue == 'document'" @click="toggleLabel('document')">
26
+ <q-item-section avatar>
27
+ <q-icon name="sym_o_article" />
28
+ </q-item-section>
29
+ <q-item-section> {{ $t('Documents') }} </q-item-section>
30
+ </q-item>
31
+ <q-item clickable :active="modelValue == 'image'" @click="toggleLabel('image')">
32
+ <q-item-section avatar>
33
+ <q-icon name="sym_o_insert_photo" />
34
+ </q-item-section>
35
+ <q-item-section> {{ $t('Images') }} </q-item-section>
36
+ </q-item>
37
+ <q-item clickable :active="modelValue == 'video'" @click="toggleLabel('video')">
38
+ <q-item-section avatar>
39
+ <q-icon name="sym_o_videocam" />
40
+ </q-item-section>
41
+ <q-item-section> {{ $t('Videos') }} </q-item-section>
42
+ </q-item>
43
+ <q-item clickable :active="modelValue == 'audio'" @click="toggleLabel('audio')">
44
+ <q-item-section avatar>
45
+ <q-icon name="sym_o_audiotrack" />
46
+ </q-item-section>
47
+ <q-item-section> {{ $t('Audio') }} </q-item-section>
48
+ </q-item>
49
+ <q-item clickable :active="modelValue == 'other'" @click="toggleLabel('other')">
50
+ <q-item-section avatar>
51
+ <q-icon name="sym_o_text_snippet" />
52
+ </q-item-section>
53
+ <q-item-section> {{ $t('Archives') }} </q-item-section>
54
+ </q-item>
55
+ </template>
@@ -0,0 +1,185 @@
1
+ <script setup>
2
+ const emit = defineEmits(["selected"]);
3
+ const data = await q("fsListFolders", { path: "/" }, ["name", "path"]);
4
+ const folders = ref(data);
5
+ const mode = ref("move");
6
+ const folder = ref("/");
7
+ const parent = ref(null);
8
+ const selected = ref("/");
9
+
10
+ const qua = useQuasar();
11
+
12
+ watch(folder, async () => {
13
+ folders.value = await q("fsListFolders", { path: folder.value }, ["name", "path"]);
14
+ });
15
+
16
+ const clickBack = () => {
17
+ folder.value = parent.value;
18
+
19
+ }
20
+
21
+ const title = computed(() => {
22
+ if (folder.value) {
23
+ return folder.value.split("/").pop();
24
+ }
25
+ return "";
26
+ });
27
+
28
+ const newFolder = ref(null);
29
+
30
+ const onClickCreate = async () => {
31
+ let f = selected.value + "/" + newFolder.value;
32
+ await m("fsCreateFolder", { path: f });
33
+
34
+ folder.value = f;
35
+
36
+ mode.value = "move";
37
+ }
38
+
39
+ const menu = ref(null);
40
+ const onClickMove = async () => {
41
+ qua.dialog({
42
+ title: "Move",
43
+ message: "Are you sure you want to move?",
44
+ cancel: true,
45
+ persistent: true,
46
+ }).onOk(async () => {
47
+
48
+
49
+ menu.value.hide();
50
+ emit("selected", selected.value);
51
+ selected.value = "/";
52
+ parent.value = null;
53
+ folder.value = "/";
54
+
55
+
56
+ })
57
+ }
58
+
59
+ </script >
60
+ <template>
61
+ <q-menu transition-show="jump-down" transition-hide="jump-up" ref="menu" @before-show="show">
62
+ <q-card>
63
+ <q-toolbar>
64
+ <q-btn flat dense round @click="clickBack()" v-if="parent">
65
+ <q-icon name="sym_o_arrow_back" />
66
+ </q-btn>
67
+ <q-toolbar-title>
68
+ <template v-if="mode == 'create'">
69
+ <q-input outlined dense v-model="newFolder">
70
+ <template v-slot:append>
71
+ <q-btn round dense flat icon="sym_o_add" @click="onClickCreate" />
72
+ </template>
73
+ </q-input>
74
+ </template>
75
+
76
+ <template v-else>
77
+ {{ title }}
78
+ </template>
79
+ </q-toolbar-title>
80
+ </q-toolbar>
81
+
82
+ <template v-if="mode == 'empty folder'">
83
+ <q-card-section> Empty folder</q-card-section>
84
+ </template>
85
+
86
+ <template v-if="mode == 'create'">
87
+ <q-card-section> Create folder at "{{ selected }}" </q-card-section>
88
+ </template>
89
+
90
+ <template v-if="mode == 'move'">
91
+ <q-list>
92
+ <q-item v-for="(b, index) in folders" :key="index" clickable @click="selected = b.path"
93
+ :active="selected === b.path">
94
+ <q-item-section>
95
+ <q-icon name="sym_o_folder"></q-icon>
96
+ </q-item-section>
97
+ <q-item-section>
98
+ <q-item-label>{{ b.name }}</q-item-label>
99
+ </q-item-section>
100
+
101
+ <q-item-section side>
102
+ <q-btn flat dense outlined @click="
103
+ parent = folder;
104
+ folder = b.path;
105
+ ">
106
+ <q-icon name="sym_o_navigate_next"></q-icon>
107
+ </q-btn>
108
+ </q-item-section>
109
+ </q-item>
110
+ </q-list>
111
+ </template>
112
+
113
+ <q-card-actions>
114
+ <q-btn flat dense @click="mode = 'create'" :disable="mode == 'create'">
115
+ <q-icon name="sym_o_create_new_folder"></q-icon>
116
+ </q-btn>
117
+ <q-space></q-space>
118
+ <q-btn dense label="Move to here" color="primary" v-if="mode == 'empty folder'">
119
+ </q-btn>
120
+ <q-btn dense label="Move" outline color="primary" v-if="mode == 'move'" @click="onClickMove"></q-btn>
121
+ </q-card-actions>
122
+ </q-card>
123
+ </q-menu>
124
+ </template>
125
+ <!--
126
+ <script>
127
+ import { listFolders, createFolder } from "./../lib/filemanager";
128
+
129
+
130
+ export default {
131
+ data() {
132
+ return {
133
+ selected: "/",
134
+ folder: null,
135
+ folders: [],
136
+ parent: null,
137
+ mode: "move",
138
+ newFolder: null,
139
+ };
140
+ },
141
+ watch: {
142
+ async folder() {
143
+ this.folders = await listFolders(this.folder);
144
+
145
+ if (this.folders.length == 0) {
146
+ this.mode = "empty folder";
147
+ }
148
+ },
149
+ },
150
+ computed: {
151
+ title() {
152
+ if (this.folder) {
153
+ return this.folder.split("/").pop();
154
+ }
155
+ return "";
156
+ },
157
+ },
158
+
159
+ methods: {
160
+ show() {
161
+ this.folder = "/";
162
+ this.mode = "move";
163
+ },
164
+ async onClickCreate() {
165
+ let folder = this.selected + "/" + this.newFolder;
166
+ await createFolder(folder);
167
+ this.folder = folder;
168
+ },
169
+ clickBack() {
170
+ if (this.mode == "create") {
171
+ this.mode = "move";
172
+ return;
173
+ }
174
+
175
+ this.folder = this.parent;
176
+
177
+
178
+ if (this.mode == "empty folder") {
179
+ this.mode = "move";
180
+ return;
181
+ }
182
+ },
183
+ },
184
+ };
185
+ </script> -->
@@ -0,0 +1,59 @@
1
+ <script setup>
2
+ const props = defineProps(["modelValue"]);
3
+
4
+ const file = await q("fsFile", {
5
+ path: props.modelValue.path
6
+ }, ["canPreview"])
7
+
8
+ </script >
9
+ <template>
10
+ <template v-if="canPreviewImage">
11
+ <q-img :src="imagePath"></q-img>
12
+ </template>
13
+
14
+ {{ file }}
15
+ <q-list dense>
16
+ <q-item>
17
+ <q-item-section>
18
+ <q-item-label>Name</q-item-label>
19
+ </q-item-section>
20
+ <q-item-section side>{{ modelValue.name }} </q-item-section>
21
+ </q-item>
22
+ <q-item>
23
+ <q-item-section>
24
+ <q-item-label>Size</q-item-label>
25
+ </q-item-section>
26
+ <q-item-section side>{{ modelValue.size }} </q-item-section>
27
+ </q-item>
28
+ <q-item>
29
+ <q-item-section>
30
+ <q-item-label>Location</q-item-label>
31
+ </q-item-section>
32
+ <q-item-section side>{{ modelValue.path }} </q-item-section>
33
+ </q-item>
34
+ </q-list>
35
+ </template>
36
+
37
+ <!-- <script >
38
+ import { getEndpoint } from "../lib";
39
+ export default {
40
+ props: {
41
+ value: Object,
42
+ },
43
+
44
+ computed: {
45
+ imagePath() {
46
+ return getEndpoint() + `photo/0${this.value.path}?w=200`;
47
+ },
48
+ canPreviewImage() {
49
+ if (this.value.type == "folder") return false;
50
+
51
+ if (this.value.mime_type == "image/jpeg") return true;
52
+ if (this.value.mime_type == "image/png") return true;
53
+ if (this.value.mime_type == "image/gif") return true;
54
+
55
+ return false;
56
+ },
57
+ },
58
+ };
59
+ </script> -->