@hostlink/nuxt-light 1.27.8 → 1.28.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.
Files changed (276) hide show
  1. package/dist/module.d.mts +2 -1
  2. package/dist/module.json +3 -3
  3. package/dist/module.mjs +40 -42
  4. package/dist/runtime/components/L/CustomField/Add.vue +41 -52
  5. package/dist/runtime/components/L/CustomField/Add.vue.d.ts +2 -0
  6. package/dist/runtime/components/L/CustomField/List.vue +26 -30
  7. package/dist/runtime/components/L/CustomField/List.vue.d.ts +2 -0
  8. package/dist/runtime/components/L/Database/create-table-dialog.vue +22 -38
  9. package/dist/runtime/components/L/Database/create-table-dialog.vue.d.ts +2 -0
  10. package/dist/runtime/components/L/Fieldset.vue +19 -23
  11. package/dist/runtime/components/L/Fieldset.vue.d.ts +2 -0
  12. package/dist/runtime/components/L/ForgetPasswordDialog.vue +39 -41
  13. package/dist/runtime/components/L/ForgetPasswordDialog.vue.d.ts +2 -0
  14. package/dist/runtime/components/L/Revision.vue +101 -137
  15. package/dist/runtime/components/L/Revision.vue.d.ts +2 -0
  16. package/dist/runtime/components/L/Storage.vue +26 -30
  17. package/dist/runtime/components/L/Storage.vue.d.ts +2 -0
  18. package/dist/runtime/components/L/System/Setting/authentication.vue +22 -44
  19. package/dist/runtime/components/L/System/Setting/authentication.vue.d.ts +2 -0
  20. package/dist/runtime/components/L/System/Setting/developer.vue +43 -59
  21. package/dist/runtime/components/L/System/Setting/developer.vue.d.ts +2 -0
  22. package/dist/runtime/components/L/System/Setting/forget-password.vue +42 -58
  23. package/dist/runtime/components/L/System/Setting/forget-password.vue.d.ts +2 -0
  24. package/dist/runtime/components/L/System/Setting/general.vue +29 -41
  25. package/dist/runtime/components/L/System/Setting/general.vue.d.ts +2 -0
  26. package/dist/runtime/components/L/System/Setting/mail.vue +39 -42
  27. package/dist/runtime/components/L/System/Setting/mail.vue.d.ts +2 -0
  28. package/dist/runtime/components/L/System/Setting/modules.vue +9 -9
  29. package/dist/runtime/components/L/System/Setting/modules.vue.d.ts +2 -0
  30. package/dist/runtime/components/L/System/Setting/security.vue +20 -39
  31. package/dist/runtime/components/L/System/Setting/security.vue.d.ts +2 -0
  32. package/dist/runtime/components/L/User/eventlog.vue +26 -26
  33. package/dist/runtime/components/L/User/eventlog.vue.d.ts +2 -0
  34. package/dist/runtime/components/L/User/overview.vue +25 -27
  35. package/dist/runtime/components/L/User/overview.vue.d.ts +2 -0
  36. package/dist/runtime/components/L/User/userlog.vue +22 -28
  37. package/dist/runtime/components/L/User/userlog.vue.d.ts +2 -0
  38. package/dist/runtime/components/L/ValidationInput.vue +68 -91
  39. package/dist/runtime/components/L/ValidationInput.vue.d.ts +2 -0
  40. package/dist/runtime/components/MyTest.vue +8 -7
  41. package/dist/runtime/components/MyTest.vue.d.ts +2 -0
  42. package/dist/runtime/components/l-add-btn.vue +13 -12
  43. package/dist/runtime/components/l-add-btn.vue.d.ts +2 -0
  44. package/dist/runtime/components/l-alert.vue +25 -29
  45. package/dist/runtime/components/l-alert.vue.d.ts +2 -0
  46. package/dist/runtime/components/l-app-main.vue +226 -294
  47. package/dist/runtime/components/l-app-main.vue.d.ts +2 -0
  48. package/dist/runtime/components/l-app.vue +76 -89
  49. package/dist/runtime/components/l-app.vue.d.ts +2 -0
  50. package/dist/runtime/components/l-audit-card.vue +8 -14
  51. package/dist/runtime/components/l-audit-card.vue.d.ts +2 -0
  52. package/dist/runtime/components/l-back-btn.vue.d.ts +2 -0
  53. package/dist/runtime/components/l-banner.vue +28 -34
  54. package/dist/runtime/components/l-banner.vue.d.ts +2 -0
  55. package/dist/runtime/components/l-bar.vue +21 -25
  56. package/dist/runtime/components/l-bar.vue.d.ts +2 -0
  57. package/dist/runtime/components/l-btn.vue +62 -37
  58. package/dist/runtime/components/l-btn.vue.d.ts +2 -0
  59. package/dist/runtime/components/l-card.vue +90 -141
  60. package/dist/runtime/components/l-card.vue.d.ts +2 -0
  61. package/dist/runtime/components/l-checkbox.vue +30 -7
  62. package/dist/runtime/components/l-checkbox.vue.d.ts +2 -0
  63. package/dist/runtime/components/l-col.vue +21 -29
  64. package/dist/runtime/components/l-col.vue.d.ts +2 -0
  65. package/dist/runtime/components/l-customizer.vue +84 -100
  66. package/dist/runtime/components/l-customizer.vue.d.ts +2 -0
  67. package/dist/runtime/components/l-date-picker.vue +101 -147
  68. package/dist/runtime/components/l-date-picker.vue.d.ts +2 -0
  69. package/dist/runtime/components/l-delete-btn.vue +22 -27
  70. package/dist/runtime/components/l-delete-btn.vue.d.ts +2 -0
  71. package/dist/runtime/components/l-dialog-database-field-add.vue +19 -36
  72. package/dist/runtime/components/l-dialog-database-field-add.vue.d.ts +2 -0
  73. package/dist/runtime/components/l-drag-drop-container.vue +44 -62
  74. package/dist/runtime/components/l-drag-drop-container.vue.d.ts +2 -0
  75. package/dist/runtime/components/l-drag-drop-group.vue +49 -70
  76. package/dist/runtime/components/l-drag-drop-group.vue.d.ts +2 -0
  77. package/dist/runtime/components/l-drag-drop.vue +33 -44
  78. package/dist/runtime/components/l-drag-drop.vue.d.ts +2 -0
  79. package/dist/runtime/components/l-edit-btn.vue.d.ts +2 -0
  80. package/dist/runtime/components/l-editor.vue +185 -172
  81. package/dist/runtime/components/l-editor.vue.d.ts +2 -0
  82. package/dist/runtime/components/l-facebook-button.vue +18 -26
  83. package/dist/runtime/components/l-facebook-button.vue.d.ts +2 -0
  84. package/dist/runtime/components/l-fav-menu.vue +19 -24
  85. package/dist/runtime/components/l-fav-menu.vue.d.ts +2 -0
  86. package/dist/runtime/components/l-field.vue +49 -18
  87. package/dist/runtime/components/l-field.vue.d.ts +2 -0
  88. package/dist/runtime/components/l-file-manager-labels.vue +46 -48
  89. package/dist/runtime/components/l-file-manager-labels.vue.d.ts +2 -0
  90. package/dist/runtime/components/l-file-manager-move.vue +53 -68
  91. package/dist/runtime/components/l-file-manager-move.vue.d.ts +2 -0
  92. package/dist/runtime/components/l-file-manager-preview.vue +46 -81
  93. package/dist/runtime/components/l-file-manager-preview.vue.d.ts +2 -0
  94. package/dist/runtime/components/l-file-manager.vue +498 -640
  95. package/dist/runtime/components/l-file-manager.vue.d.ts +2 -0
  96. package/dist/runtime/components/l-file-upload.vue +80 -109
  97. package/dist/runtime/components/l-file-upload.vue.d.ts +2 -0
  98. package/dist/runtime/components/l-file.vue +37 -61
  99. package/dist/runtime/components/l-file.vue.d.ts +2 -0
  100. package/dist/runtime/components/l-form-dialog.vue +71 -83
  101. package/dist/runtime/components/l-form-dialog.vue.d.ts +2 -0
  102. package/dist/runtime/components/l-form.vue +82 -96
  103. package/dist/runtime/components/l-form.vue.d.ts +2 -0
  104. package/dist/runtime/components/l-group-select.vue +59 -94
  105. package/dist/runtime/components/l-group-select.vue.d.ts +2 -0
  106. package/dist/runtime/components/l-icon-picker.vue +3265 -3274
  107. package/dist/runtime/components/l-icon-picker.vue.d.ts +2 -0
  108. package/dist/runtime/components/l-input-xlsx.vue +30 -38
  109. package/dist/runtime/components/l-input-xlsx.vue.d.ts +2 -0
  110. package/dist/runtime/components/l-input.vue +141 -127
  111. package/dist/runtime/components/l-input.vue.d.ts +2 -0
  112. package/dist/runtime/components/l-item.vue +30 -21
  113. package/dist/runtime/components/l-item.vue.d.ts +2 -0
  114. package/dist/runtime/components/l-link.vue +16 -15
  115. package/dist/runtime/components/l-link.vue.d.ts +2 -0
  116. package/dist/runtime/components/l-list.vue +27 -35
  117. package/dist/runtime/components/l-list.vue.d.ts +2 -0
  118. package/dist/runtime/components/l-login.vue +246 -287
  119. package/dist/runtime/components/l-login.vue.d.ts +2 -0
  120. package/dist/runtime/components/l-menu.vue +45 -54
  121. package/dist/runtime/components/l-menu.vue.d.ts +2 -0
  122. package/dist/runtime/components/l-microsoft-button.vue +42 -52
  123. package/dist/runtime/components/l-microsoft-button.vue.d.ts +2 -0
  124. package/dist/runtime/components/l-page.vue +48 -67
  125. package/dist/runtime/components/l-page.vue.d.ts +2 -0
  126. package/dist/runtime/components/l-row.vue +8 -13
  127. package/dist/runtime/components/l-row.vue.d.ts +2 -0
  128. package/dist/runtime/components/l-save-btn.vue.d.ts +2 -0
  129. package/dist/runtime/components/l-select.vue +150 -76
  130. package/dist/runtime/components/l-select.vue.d.ts +2 -0
  131. package/dist/runtime/components/l-small-box.vue +18 -31
  132. package/dist/runtime/components/l-small-box.vue.d.ts +2 -0
  133. package/dist/runtime/components/l-statistic.vue +17 -23
  134. package/dist/runtime/components/l-statistic.vue.d.ts +2 -0
  135. package/dist/runtime/components/l-tab.vue +20 -15
  136. package/dist/runtime/components/l-tab.vue.d.ts +2 -0
  137. package/dist/runtime/components/l-table.vue +444 -560
  138. package/dist/runtime/components/l-table.vue.d.ts +2 -0
  139. package/dist/runtime/components/l-tabs.vue +34 -16
  140. package/dist/runtime/components/l-tabs.vue.d.ts +2 -0
  141. package/dist/runtime/components/l-test2.vue +10 -9
  142. package/dist/runtime/components/l-test2.vue.d.ts +2 -0
  143. package/dist/runtime/components/l-time-picker.vue +53 -68
  144. package/dist/runtime/components/l-time-picker.vue.d.ts +2 -0
  145. package/dist/runtime/components/l-view-btn.vue.d.ts +2 -0
  146. package/dist/runtime/composables/mytest.d.ts +2 -0
  147. package/dist/runtime/composables/mytest.js +3 -0
  148. package/dist/runtime/formkit/Checkbox.vue +15 -18
  149. package/dist/runtime/formkit/Checkbox.vue.d.ts +2 -0
  150. package/dist/runtime/formkit/DatePicker.vue +15 -18
  151. package/dist/runtime/formkit/DatePicker.vue.d.ts +2 -0
  152. package/dist/runtime/formkit/Editor.vue +15 -18
  153. package/dist/runtime/formkit/Editor.vue.d.ts +2 -0
  154. package/dist/runtime/formkit/File.vue +30 -37
  155. package/dist/runtime/formkit/File.vue.d.ts +2 -0
  156. package/dist/runtime/formkit/FilePicker.vue +22 -25
  157. package/dist/runtime/formkit/FilePicker.vue.d.ts +2 -0
  158. package/dist/runtime/formkit/FileUpload.vue +22 -25
  159. package/dist/runtime/formkit/FileUpload.vue.d.ts +2 -0
  160. package/dist/runtime/formkit/Form.vue +79 -100
  161. package/dist/runtime/formkit/Form.vue.d.ts +2 -0
  162. package/dist/runtime/formkit/GroupSelect.vue +21 -27
  163. package/dist/runtime/formkit/GroupSelect.vue.d.ts +2 -0
  164. package/dist/runtime/formkit/Input.vue +53 -61
  165. package/dist/runtime/formkit/Input.vue.d.ts +2 -0
  166. package/dist/runtime/formkit/InputXlsx.vue +15 -18
  167. package/dist/runtime/formkit/InputXlsx.vue.d.ts +2 -0
  168. package/dist/runtime/formkit/OptionGroup.vue +20 -26
  169. package/dist/runtime/formkit/OptionGroup.vue.d.ts +2 -0
  170. package/dist/runtime/formkit/Radio.vue +15 -18
  171. package/dist/runtime/formkit/Radio.vue.d.ts +2 -0
  172. package/dist/runtime/formkit/Repeater.vue +62 -76
  173. package/dist/runtime/formkit/Repeater.vue.d.ts +2 -0
  174. package/dist/runtime/formkit/Select.vue +21 -29
  175. package/dist/runtime/formkit/Select.vue.d.ts +2 -0
  176. package/dist/runtime/formkit/TimePicker.vue +15 -19
  177. package/dist/runtime/formkit/TimePicker.vue.d.ts +2 -0
  178. package/dist/runtime/formkit/Toggle.vue +13 -16
  179. package/dist/runtime/formkit/Toggle.vue.d.ts +2 -0
  180. package/dist/runtime/light.d.ts +1129 -6
  181. package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue +24 -26
  182. package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue.d.ts +2 -0
  183. package/dist/runtime/pages/CustomField/index.vue +22 -29
  184. package/dist/runtime/pages/CustomField/index.vue.d.ts +2 -0
  185. package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +8 -8
  186. package/dist/runtime/pages/EventLog/_eventlog_id/view.vue.d.ts +2 -0
  187. package/dist/runtime/pages/EventLog/index.vue +7 -6
  188. package/dist/runtime/pages/EventLog/index.vue.d.ts +2 -0
  189. package/dist/runtime/pages/FileManager/index.vue.d.ts +2 -0
  190. package/dist/runtime/pages/MailLog/index.vue +7 -6
  191. package/dist/runtime/pages/MailLog/index.vue.d.ts +2 -0
  192. package/dist/runtime/pages/Permission/add.vue +26 -29
  193. package/dist/runtime/pages/Permission/add.vue.d.ts +2 -0
  194. package/dist/runtime/pages/Permission/all.vue +57 -73
  195. package/dist/runtime/pages/Permission/all.vue.d.ts +2 -0
  196. package/dist/runtime/pages/Permission/export.vue +49 -62
  197. package/dist/runtime/pages/Permission/export.vue.d.ts +2 -0
  198. package/dist/runtime/pages/Permission/index.vue +19 -20
  199. package/dist/runtime/pages/Permission/index.vue.d.ts +2 -0
  200. package/dist/runtime/pages/Role/_name/update-child.vue +12 -14
  201. package/dist/runtime/pages/Role/_name/update-child.vue.d.ts +2 -0
  202. package/dist/runtime/pages/Role/add.vue +13 -15
  203. package/dist/runtime/pages/Role/add.vue.d.ts +2 -0
  204. package/dist/runtime/pages/Role/add2.vue +27 -38
  205. package/dist/runtime/pages/Role/add2.vue.d.ts +2 -0
  206. package/dist/runtime/pages/Role/index.vue +100 -127
  207. package/dist/runtime/pages/Role/index.vue.d.ts +2 -0
  208. package/dist/runtime/pages/System/database/backup.vue +28 -36
  209. package/dist/runtime/pages/System/database/backup.vue.d.ts +2 -0
  210. package/dist/runtime/pages/System/database/process.vue +33 -43
  211. package/dist/runtime/pages/System/database/process.vue.d.ts +2 -0
  212. package/dist/runtime/pages/System/database/table.vue +168 -205
  213. package/dist/runtime/pages/System/database/table.vue.d.ts +2 -0
  214. package/dist/runtime/pages/System/fs.vue +95 -107
  215. package/dist/runtime/pages/System/fs.vue.d.ts +2 -0
  216. package/dist/runtime/pages/System/index.vue +30 -31
  217. package/dist/runtime/pages/System/index.vue.d.ts +2 -0
  218. package/dist/runtime/pages/System/mailtest.vue +29 -35
  219. package/dist/runtime/pages/System/mailtest.vue.d.ts +2 -0
  220. package/dist/runtime/pages/System/menu/index.vue +175 -223
  221. package/dist/runtime/pages/System/menu/index.vue.d.ts +2 -0
  222. package/dist/runtime/pages/System/package.vue +21 -21
  223. package/dist/runtime/pages/System/package.vue.d.ts +2 -0
  224. package/dist/runtime/pages/System/phpinfo.vue +11 -10
  225. package/dist/runtime/pages/System/phpinfo.vue.d.ts +2 -0
  226. package/dist/runtime/pages/System/setting.vue +42 -59
  227. package/dist/runtime/pages/System/setting.vue.d.ts +2 -0
  228. package/dist/runtime/pages/System/test.vue.d.ts +2 -0
  229. package/dist/runtime/pages/System/view_as.vue +65 -68
  230. package/dist/runtime/pages/System/view_as.vue.d.ts +2 -0
  231. package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue +7 -7
  232. package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue.d.ts +2 -0
  233. package/dist/runtime/pages/SystemValue/add.vue.d.ts +2 -0
  234. package/dist/runtime/pages/SystemValue/index.vue +7 -6
  235. package/dist/runtime/pages/SystemValue/index.vue.d.ts +2 -0
  236. package/dist/runtime/pages/Translate/index.vue +81 -100
  237. package/dist/runtime/pages/Translate/index.vue.d.ts +2 -0
  238. package/dist/runtime/pages/User/_user_id/change-password.vue +38 -45
  239. package/dist/runtime/pages/User/_user_id/change-password.vue.d.ts +2 -0
  240. package/dist/runtime/pages/User/_user_id/edit.vue +35 -26
  241. package/dist/runtime/pages/User/_user_id/edit.vue.d.ts +2 -0
  242. package/dist/runtime/pages/User/_user_id/update-role.vue +33 -43
  243. package/dist/runtime/pages/User/_user_id/update-role.vue.d.ts +2 -0
  244. package/dist/runtime/pages/User/_user_id/view.vue +35 -37
  245. package/dist/runtime/pages/User/_user_id/view.vue.d.ts +2 -0
  246. package/dist/runtime/pages/User/add.vue +52 -60
  247. package/dist/runtime/pages/User/add.vue.d.ts +2 -0
  248. package/dist/runtime/pages/User/index.vue +23 -32
  249. package/dist/runtime/pages/User/index.vue.d.ts +2 -0
  250. package/dist/runtime/pages/User/profile.vue +52 -58
  251. package/dist/runtime/pages/User/profile.vue.d.ts +2 -0
  252. package/dist/runtime/pages/User/setting/bio-auth.vue +85 -95
  253. package/dist/runtime/pages/User/setting/bio-auth.vue.d.ts +2 -0
  254. package/dist/runtime/pages/User/setting/index.vue +27 -28
  255. package/dist/runtime/pages/User/setting/index.vue.d.ts +2 -0
  256. package/dist/runtime/pages/User/setting/information.vue +28 -27
  257. package/dist/runtime/pages/User/setting/information.vue.d.ts +2 -0
  258. package/dist/runtime/pages/User/setting/my_favorite.vue +29 -35
  259. package/dist/runtime/pages/User/setting/my_favorite.vue.d.ts +2 -0
  260. package/dist/runtime/pages/User/setting/open_id.vue +140 -165
  261. package/dist/runtime/pages/User/setting/open_id.vue.d.ts +2 -0
  262. package/dist/runtime/pages/User/setting/password.vue +37 -44
  263. package/dist/runtime/pages/User/setting/password.vue.d.ts +2 -0
  264. package/dist/runtime/pages/User/setting/style.vue +84 -102
  265. package/dist/runtime/pages/User/setting/style.vue.d.ts +2 -0
  266. package/dist/runtime/pages/User/setting/two-factor-auth.vue +51 -61
  267. package/dist/runtime/pages/User/setting/two-factor-auth.vue.d.ts +2 -0
  268. package/dist/runtime/pages/User/setting.vue +9 -9
  269. package/dist/runtime/pages/User/setting.vue.d.ts +2 -0
  270. package/dist/runtime/pages/UserLog/index.vue +7 -6
  271. package/dist/runtime/pages/UserLog/index.vue.d.ts +2 -0
  272. package/dist/types.d.mts +3 -1
  273. package/package.json +9 -11
  274. package/dist/module.cjs +0 -5
  275. package/dist/module.d.ts +0 -7
  276. package/dist/types.d.ts +0 -1
@@ -1,143 +1,92 @@
1
- <script setup lang="ts">
2
- import { useLight, q, m } from '#imports'
3
- import { ref, computed, useSlots, onMounted } from 'vue'
4
- import type { QCardProps } from 'quasar';
5
-
6
- const emit = defineEmits(["close"]);
7
-
8
- const minimized = defineModel<boolean>("minimized", { default: false })
9
- const maximized = defineModel<boolean>("maximized", { default: false })
10
-
11
- export interface LCardProps extends QCardProps {
12
- loading?: boolean;
13
- title?: string;
14
- /**
15
- * Permission to access this card, if not granted, the card will not be shown, if the user is admin, a lock icon will be shown to allow the user to grant the permission
16
- */
17
- permission?: string
18
- closeable?: boolean
19
- minimizable?: boolean,
20
- maximizable?: boolean
21
- }
22
-
23
- const light = useLight();
24
- const props = withDefaults(defineProps<LCardProps>(), {
25
- flat: undefined,
26
- bordered: undefined,
27
- square: undefined,
28
- });
29
-
30
-
31
-
32
- const attrs = computed(() => {
33
- return { ...light.styles.card, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== undefined)) };
34
-
35
- });
36
-
37
- const barClass = computed(() => {
38
- const c = ["text-white"];
39
- const color = light.color;
40
- c.push(`bg-${color}`);
41
- return c;
42
- });
43
-
44
- const showBar = computed(() => {
45
- if (props.closeable) return true;
46
- if (props.maximizable) return true;
47
- if (props.minimizable) return true;
48
- if (props.title !== undefined) return true;
49
- if (showSecurity.value) return true;
50
- return false;
51
- });
52
-
53
-
54
- const showSecurity = computed(() => {
55
- if (props.permission === undefined) return false;
56
- if (!light.isAdmin) return false;
57
- return true;
58
- });
59
-
60
-
61
- const roles = ref<{
62
- name: string;
63
- granted: boolean;
64
- }[]>([]);
65
-
66
- if (props.permission && light.isAdmin) {
67
- /* //get role
68
- const data = await q({
69
- listRole: {
70
- name: true
71
- },
72
- listPermission: {
73
- __args: {
74
- filters: {
75
- value: props.permission
76
- }
77
- }, data: {
78
- role: true
79
- }
80
-
81
- }
82
- });
83
-
84
- roles.value = (data.listRole.map((r: any) => {
85
- return {
86
- name: r.name,
87
- granted: data.listPermission.data.find((p: any) => p.role == r.name) != undefined
88
- }
89
- })); */
90
- }
91
-
92
- const onUpdatePermission = async (role: any) => {
93
- if (role.granted) {
94
- await m("addPermission", {
95
- role: role.name,
96
- value: props.permission,
97
- });
98
- } else {
99
- //remove permission
100
- await m("removePermission", {
101
- role: role.name,
102
- value: props.permission,
103
- })
104
- }
105
- }
106
-
107
- onMounted(async () => {
108
- if (props.permission && light.isAdmin) {
109
- //get role
110
- const data = await q({
111
- listRole: {
112
- name: true
113
- },
114
- listPermission: {
115
- __args: {
116
- filters: {
117
- value: props.permission
118
- }
119
- }, data: {
120
- role: true
121
- }
122
-
123
- }
124
- });
125
-
126
- roles.value = (data.listRole.map((r: any) => {
127
- return {
128
- name: r.name,
129
- granted: data.listPermission.data.find((p: any) => p.role == r.name) != undefined
130
- }
131
- }));
132
- }
133
- })
134
-
135
- const onClose = () => {
136
- emit("close");
137
- }
138
-
139
- </script>
140
- <template>
1
+ <script setup>
2
+ import { useLight, q, m } from "#imports";
3
+ import { ref, computed, useSlots, onMounted } from "vue";
4
+ const emit = defineEmits(["close"]);
5
+ const minimized = defineModel("minimized", { type: Boolean, ...{ default: false } });
6
+ const maximized = defineModel("maximized", { type: Boolean, ...{ default: false } });
7
+ const light = useLight();
8
+ const props = defineProps({
9
+ loading: { type: Boolean, required: false },
10
+ title: { type: String, required: false },
11
+ permission: { type: String, required: false },
12
+ closeable: { type: Boolean, required: false },
13
+ minimizable: { type: Boolean, required: false },
14
+ maximizable: { type: Boolean, required: false },
15
+ dark: { type: [Boolean, null], required: false, skipCheck: true },
16
+ square: { type: Boolean, required: false, skipCheck: true, default: void 0 },
17
+ flat: { type: Boolean, required: false, skipCheck: true, default: void 0 },
18
+ bordered: { type: Boolean, required: false, skipCheck: true, default: void 0 },
19
+ tag: { type: null, required: false }
20
+ });
21
+ const attrs = computed(() => {
22
+ return { ...light.styles.card, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== void 0)) };
23
+ });
24
+ const barClass = computed(() => {
25
+ const c = ["text-white"];
26
+ const color = light.color;
27
+ c.push(`bg-${color}`);
28
+ return c;
29
+ });
30
+ const showBar = computed(() => {
31
+ if (props.closeable) return true;
32
+ if (props.maximizable) return true;
33
+ if (props.minimizable) return true;
34
+ if (props.title !== void 0) return true;
35
+ if (showSecurity.value) return true;
36
+ return false;
37
+ });
38
+ const showSecurity = computed(() => {
39
+ if (props.permission === void 0) return false;
40
+ if (!light.isAdmin) return false;
41
+ return true;
42
+ });
43
+ const roles = ref([]);
44
+ if (props.permission && light.isAdmin) {
45
+ }
46
+ const onUpdatePermission = async (role) => {
47
+ if (role.granted) {
48
+ await m("addPermission", {
49
+ role: role.name,
50
+ value: props.permission
51
+ });
52
+ } else {
53
+ await m("removePermission", {
54
+ role: role.name,
55
+ value: props.permission
56
+ });
57
+ }
58
+ };
59
+ onMounted(async () => {
60
+ if (props.permission && light.isAdmin) {
61
+ const data = await q({
62
+ listRole: {
63
+ name: true
64
+ },
65
+ listPermission: {
66
+ __args: {
67
+ filters: {
68
+ value: props.permission
69
+ }
70
+ },
71
+ data: {
72
+ role: true
73
+ }
74
+ }
75
+ });
76
+ roles.value = data.listRole.map((r) => {
77
+ return {
78
+ name: r.name,
79
+ granted: data.listPermission.data.find((p) => p.role == r.name) != void 0
80
+ };
81
+ });
82
+ }
83
+ });
84
+ const onClose = () => {
85
+ emit("close");
86
+ };
87
+ </script>
88
+
89
+ <template>
141
90
  <q-card v-bind="attrs" :class="{ 'fullscreen': maximized, 'no-margin': maximized }"
142
91
  v-if="$light.isGranted(permission)" :dark="$q.dark.isActive">
143
92
  <q-bar :class="barClass" v-if="showBar">
@@ -167,4 +116,4 @@ const onClose = () => {
167
116
 
168
117
  <q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
169
118
  </q-card>
170
- </template>
119
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,9 +1,32 @@
1
- <script setup lang="ts">
2
- import { type QCheckboxProps } from "quasar"
3
- defineProps<QCheckboxProps>()
4
- </script>
5
- <template>
6
- <q-checkbox v-bind="$props" :color="color || $light.color" :label="label ? $t(label) : undefined">
1
+ <script setup>
2
+ import {} from "quasar";
3
+ defineProps({
4
+ name: { type: null, required: false },
5
+ size: { type: null, required: false },
6
+ modelValue: { type: null, required: true },
7
+ val: { type: null, required: false },
8
+ trueValue: { type: null, required: false },
9
+ falseValue: { type: null, required: false },
10
+ indeterminateValue: { type: null, required: false },
11
+ toggleOrder: { type: null, required: false },
12
+ toggleIndeterminate: { type: Boolean, required: false, skipCheck: true },
13
+ label: { type: null, required: false },
14
+ leftLabel: { type: Boolean, required: false, skipCheck: true },
15
+ checkedIcon: { type: null, required: false },
16
+ uncheckedIcon: { type: null, required: false },
17
+ indeterminateIcon: { type: null, required: false },
18
+ color: { type: null, required: false },
19
+ keepColor: { type: Boolean, required: false, skipCheck: true },
20
+ dark: { type: [Boolean, null], required: false, skipCheck: true },
21
+ dense: { type: Boolean, required: false, skipCheck: true },
22
+ disable: { type: Boolean, required: false, skipCheck: true },
23
+ tabindex: { type: null, required: false },
24
+ "onUpdate:modelValue": { type: Function, required: false }
25
+ });
26
+ </script>
27
+
28
+ <template>
29
+ <q-checkbox v-bind="$props" :color="color || $light.color" :label="label ? $t(label) : void 0">
7
30
  <slot></slot>
8
31
  </q-checkbox>
9
- </template>
32
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,34 +1,26 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- export interface LColProps {
5
- md?: number | string;
6
- sm?: number | string;
7
- xs?: number | string;
8
- gutter?: "xs" | "sm" | "md" | "lg" | "xl" | "none";
9
- }
10
-
11
- const props = withDefaults(defineProps<LColProps>(), {
12
- md: 12,
13
- sm: 12,
14
- xs: 12,
15
- gutter: "md"
16
- })
17
-
18
- const classes = computed(() => {
19
- return {
20
- "col-12": true, // default class "col-12
21
- [`col-md-${props.md}`]: true,
22
- [`col-sm-${props.sm}`]: true,
23
- [`col-xs-${props.xs}`]: true,
24
- }
25
- })
26
-
27
- </script>
28
- <template>
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ const props = defineProps({
4
+ md: { type: [Number, String], required: false, default: 12 },
5
+ sm: { type: [Number, String], required: false, default: 12 },
6
+ xs: { type: [Number, String], required: false, default: 12 },
7
+ gutter: { type: String, required: false, default: "md" }
8
+ });
9
+ const classes = computed(() => {
10
+ return {
11
+ "col-12": true,
12
+ // default class "col-12
13
+ [`col-md-${props.md}`]: true,
14
+ [`col-sm-${props.sm}`]: true,
15
+ [`col-xs-${props.xs}`]: true
16
+ };
17
+ });
18
+ </script>
19
+
20
+ <template>
29
21
  <div :class="classes">
30
22
  <div :class="`q-gutter-${props.gutter}`">
31
23
  <slot></slot>
32
24
  </div>
33
25
  </div>
34
- </template>
26
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,102 +1,86 @@
1
- <script setup>
2
- import { ref } from 'vue'
3
- const menuWidth = defineModel('menuWidth', {
4
- type: Number,
5
- default: 280
6
- });
7
-
8
- const COLORS = [
9
- 'primary',
10
- 'secondary',
11
- 'positive',
12
- 'negative',
13
- 'info',
14
- 'warning',
15
- 'dark',
16
- 'red',
17
- 'pink',
18
- 'purple',
19
- 'deep-purple',
20
- 'indigo',
21
- 'blue',
22
- 'light-blue',
23
- 'cyan',
24
- 'teal',
25
- 'green',
26
- 'light-green',
27
- 'lime',
28
- 'yellow',
29
- 'amber',
30
- 'orange',
31
- 'deep-orange',
32
- 'brown',
33
- 'grey',
34
- 'blue-grey'
35
- ]
36
-
37
-
38
- defineEmits(['update:theme', 'update:menuOverlayHeader', 'update:dense', 'update:color', 'update:miniState', 'update:footer'])
39
-
40
- const props = defineProps({
41
- time: {
42
- type: String,
43
- default: ''
44
- },
45
- color: {
46
- type: String,
47
- default: 'primary'
48
- },
49
- menuOverlayHeader: {
50
- type: Boolean,
51
- default: false
52
- },
53
- theme: {
54
- type: String,
55
- default: 'semi-dark'
56
- },
57
- miniState: {
58
- type: Boolean,
59
- default: false
60
- },
61
- dense: {
62
- type: Boolean,
63
- default: false
64
- },
65
- footer: {
66
- type: Boolean,
67
- default: false
68
- },
69
-
70
- })
71
-
72
-
73
- //find the difference between the current time and the server time
74
-
75
- const time_diff = ref(new Date().getTime() - new Date(props.time).getTime());
76
- const server_time = ref(new Date(props.time).toLocaleTimeString());
77
- const server_date = ref(new Date(props.time).toLocaleDateString());
78
- let start;
79
-
80
- const refreshServerTime = (timestamp) => {
81
- if (!start) start = timestamp;
82
- let elapsed = timestamp - start;
83
-
84
-
85
- if (elapsed > 1000) {
86
- server_time.value = new Date(new Date().getTime() - time_diff.value).toLocaleTimeString();
87
- server_date.value = new Date(new Date().getTime() - time_diff.value).toLocaleDateString();
88
- start = timestamp;
89
- }
90
-
91
- //refresh every second
92
- requestAnimationFrame(refreshServerTime);
93
- }
94
-
95
- requestAnimationFrame(refreshServerTime);
96
-
97
-
98
- </script>
99
- <template>
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ const menuWidth = defineModel("menuWidth", {
4
+ type: Number,
5
+ default: 280
6
+ });
7
+ const COLORS = [
8
+ "primary",
9
+ "secondary",
10
+ "positive",
11
+ "negative",
12
+ "info",
13
+ "warning",
14
+ "dark",
15
+ "red",
16
+ "pink",
17
+ "purple",
18
+ "deep-purple",
19
+ "indigo",
20
+ "blue",
21
+ "light-blue",
22
+ "cyan",
23
+ "teal",
24
+ "green",
25
+ "light-green",
26
+ "lime",
27
+ "yellow",
28
+ "amber",
29
+ "orange",
30
+ "deep-orange",
31
+ "brown",
32
+ "grey",
33
+ "blue-grey"
34
+ ];
35
+ defineEmits(["update:theme", "update:menuOverlayHeader", "update:dense", "update:color", "update:miniState", "update:footer"]);
36
+ const props = defineProps({
37
+ time: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ color: {
42
+ type: String,
43
+ default: "primary"
44
+ },
45
+ menuOverlayHeader: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ theme: {
50
+ type: String,
51
+ default: "semi-dark"
52
+ },
53
+ miniState: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ dense: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ footer: {
62
+ type: Boolean,
63
+ default: false
64
+ }
65
+ });
66
+ const time_diff = ref((/* @__PURE__ */ new Date()).getTime() - new Date(props.time).getTime());
67
+ const server_time = ref(new Date(props.time).toLocaleTimeString());
68
+ const server_date = ref(new Date(props.time).toLocaleDateString());
69
+ let start;
70
+ const refreshServerTime = (timestamp) => {
71
+ if (!start) start = timestamp;
72
+ let elapsed = timestamp - start;
73
+ if (elapsed > 1e3) {
74
+ server_time.value = new Date((/* @__PURE__ */ new Date()).getTime() - time_diff.value).toLocaleTimeString();
75
+ server_date.value = new Date((/* @__PURE__ */ new Date()).getTime() - time_diff.value).toLocaleDateString();
76
+ start = timestamp;
77
+ }
78
+ requestAnimationFrame(refreshServerTime);
79
+ };
80
+ requestAnimationFrame(refreshServerTime);
81
+ </script>
82
+
83
+ <template>
100
84
  <q-list>
101
85
  <q-item-label header>
102
86
  <q-item-label>{{ $t('Theme Customizer') }}</q-item-label>
@@ -193,4 +177,4 @@ requestAnimationFrame(refreshServerTime);
193
177
  </q-item>
194
178
 
195
179
  </q-list>
196
- </template>
180
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;