@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
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,111 +1,82 @@
1
- <script setup lang="ts">
2
- import { ref, computed } from "vue";
3
- import { useLight, m, q } from '#imports';
4
- import { useQuasar } from "quasar";
5
- import { useI18n } from "vue-i18n";
6
- import { format } from 'quasar'
7
- const { humanStorageSize } = format
8
- const light = useLight();
9
- const i18n = useI18n();
10
- const $q = useQuasar();
11
- const modelValue = defineModel()
12
-
13
- const { system } = await q({
14
- system: {
15
- maxUploadSize: true
16
- }
17
- })
18
-
19
- export interface LFileProps {
20
- label?: string;
21
- filled?: boolean;
22
- outlined?: boolean;
23
- standout?: boolean;
24
- rounded?: boolean;
25
- dense?: boolean;
26
- square?: boolean;
27
- stackLabel?: boolean;
28
- path?: string;
29
- accept?: string;
30
- driveIndex?: number;
31
- color?: string;
32
- }
33
-
34
- const props = withDefaults(defineProps<LFileProps>(), {
35
- filled: undefined,
36
- outlined: undefined,
37
- standout: undefined,
38
- rounded: undefined,
39
- dense: undefined,
40
- square: undefined,
41
- stackLabel: undefined,
42
- path: "",
43
- accept: "*",
44
- driveIndex: 0
45
- });
46
-
47
- const show = ref(false);
48
-
49
- const attrs = computed(() => {
50
- return { ...light.styles.input, ...JSON.parse(JSON.stringify(props)) };
51
- });
52
-
53
- const uploadFile = ref<File | null>(null);
54
- const rename = ref(true);
55
-
56
- const onUploadFile = async () => {
57
-
58
- if (!uploadFile.value) {
59
- $q.dialog({
60
- title: "Error",
61
- message: i18n.t("Please select a file"),
62
- color: "negative"
63
- });
64
- return;
65
- }
66
-
67
- //check file size
68
- if (uploadFile.value.size > system.maxUploadSize) {
69
- $q.dialog({
70
- title: "Error",
71
- message: "File size is too big. Max size is " + humanStorageSize(system.maxUploadSize),
72
- color: "negative"
73
- });
74
- return;
75
- }
76
-
77
- $q.loading.show({
78
- message: i18n.t("Uploading file..."),
79
- });
80
-
81
- try {
82
- let v = await m("lightDriveUploadFile", {
83
- index: props.driveIndex,
84
- path: props.path,
85
- file: uploadFile.value,
86
- rename: rename.value
87
- });
88
-
89
- //remove first slash if exists
90
- if (v.startsWith("/")) v = v.substr(1);
91
-
92
- modelValue.value = v;
93
- show.value = false;
94
- uploadFile.value = null;
95
- } catch (e: any) {
96
- $q.loading.hide();
97
-
98
- $q.dialog({
99
- title: i18n.t("Error"),
100
- message: e.message,
101
- });
102
- }
103
- $q.loading.hide();
104
-
105
- }
106
-
107
- </script>
108
- <template>
1
+ <script setup>
2
+ import { ref, computed } from "vue";
3
+ import { useLight, m, q } from "#imports";
4
+ import { useQuasar } from "quasar";
5
+ import { useI18n } from "vue-i18n";
6
+ import { format } from "quasar";
7
+ const { humanStorageSize } = format;
8
+ const light = useLight();
9
+ const i18n = useI18n();
10
+ const $q = useQuasar();
11
+ const modelValue = defineModel();
12
+ const { system } = await q({
13
+ system: {
14
+ maxUploadSize: true
15
+ }
16
+ });
17
+ const props = defineProps({
18
+ label: { type: String, required: false },
19
+ filled: { type: Boolean, required: false, default: void 0 },
20
+ outlined: { type: Boolean, required: false, default: void 0 },
21
+ standout: { type: Boolean, required: false, default: void 0 },
22
+ rounded: { type: Boolean, required: false, default: void 0 },
23
+ dense: { type: Boolean, required: false, default: void 0 },
24
+ square: { type: Boolean, required: false, default: void 0 },
25
+ stackLabel: { type: Boolean, required: false, default: void 0 },
26
+ path: { type: String, required: false, default: "" },
27
+ accept: { type: String, required: false, default: "*" },
28
+ driveIndex: { type: Number, required: false, default: 0 },
29
+ color: { type: String, required: false }
30
+ });
31
+ const show = ref(false);
32
+ const attrs = computed(() => {
33
+ return { ...light.styles.input, ...JSON.parse(JSON.stringify(props)) };
34
+ });
35
+ const uploadFile = ref(null);
36
+ const rename = ref(true);
37
+ const onUploadFile = async () => {
38
+ if (!uploadFile.value) {
39
+ $q.dialog({
40
+ title: "Error",
41
+ message: i18n.t("Please select a file"),
42
+ color: "negative"
43
+ });
44
+ return;
45
+ }
46
+ if (uploadFile.value.size > system.maxUploadSize) {
47
+ $q.dialog({
48
+ title: "Error",
49
+ message: "File size is too big. Max size is " + humanStorageSize(system.maxUploadSize),
50
+ color: "negative"
51
+ });
52
+ return;
53
+ }
54
+ $q.loading.show({
55
+ message: i18n.t("Uploading file...")
56
+ });
57
+ try {
58
+ let v = await m("lightDriveUploadFile", {
59
+ index: props.driveIndex,
60
+ path: props.path,
61
+ file: uploadFile.value,
62
+ rename: rename.value
63
+ });
64
+ if (v.startsWith("/")) v = v.substr(1);
65
+ modelValue.value = v;
66
+ show.value = false;
67
+ uploadFile.value = null;
68
+ } catch (e) {
69
+ $q.loading.hide();
70
+ $q.dialog({
71
+ title: i18n.t("Error"),
72
+ message: e.message
73
+ });
74
+ }
75
+ $q.loading.hide();
76
+ };
77
+ </script>
78
+
79
+ <template>
109
80
  <q-input v-bind="attrs" v-model="modelValue" hide-bottom-space>
110
81
  <q-dialog v-model="show" persistent transition-show="scale" transition-hide="scale">
111
82
  <l-card style="width:300px">
@@ -131,4 +102,4 @@ const onUploadFile = async () => {
131
102
  <slot :name="name" v-bind="props ?? {}"></slot>
132
103
  </template>
133
104
  </q-input>
134
- </template>
105
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,63 +1,39 @@
1
- <script setup lang="ts">
2
- import { ref, computed, useAttrs } from "vue";
3
- import { useLight } from '#imports';
4
-
5
- const light = useLight();
6
-
7
- export interface LFileProps {
8
- modelValue?: string;
9
- label?: string;
10
- filled?: boolean;
11
- outlined?: boolean;
12
- standout?: boolean;
13
- rounded?: boolean;
14
- dense?: boolean;
15
- square?: boolean;
16
- stackLabel?: boolean;
17
-
18
- }
19
-
20
- const props = withDefaults(defineProps<LFileProps>(), {
21
- filled: undefined,
22
- outlined: undefined,
23
- standout: undefined,
24
- rounded: undefined,
25
- dense: undefined,
26
- square: undefined,
27
- stackLabel: undefined,
28
- });
29
-
30
- const emit = defineEmits(["update:modelValue"]);
31
-
32
- const show = ref(false);
33
-
34
- const onInput = (value: string) => {
35
- localValue.value = value;
36
- show.value = false;
37
-
38
- };
39
-
40
- const localValue = computed({
41
- get: () => props.modelValue,
42
- set: (value) => emit("update:modelValue", value),
43
- })
44
-
45
-
46
-
47
- const attrs = computed(() => {
48
- const a = {
49
- ...light.styles.input,
50
- ...useAttrs,
51
- ...JSON.parse(JSON.stringify(props))
52
- };
53
-
54
- return a;
55
- });
56
-
57
-
58
-
59
- </script>
60
- <template>
1
+ <script setup>
2
+ import { ref, computed, useAttrs } from "vue";
3
+ import { useLight } from "#imports";
4
+ const light = useLight();
5
+ const props = defineProps({
6
+ modelValue: { type: String, required: false },
7
+ label: { type: String, required: false },
8
+ filled: { type: Boolean, required: false, default: void 0 },
9
+ outlined: { type: Boolean, required: false, default: void 0 },
10
+ standout: { type: Boolean, required: false, default: void 0 },
11
+ rounded: { type: Boolean, required: false, default: void 0 },
12
+ dense: { type: Boolean, required: false, default: void 0 },
13
+ square: { type: Boolean, required: false, default: void 0 },
14
+ stackLabel: { type: Boolean, required: false, default: void 0 }
15
+ });
16
+ const emit = defineEmits(["update:modelValue"]);
17
+ const show = ref(false);
18
+ const onInput = (value) => {
19
+ localValue.value = value;
20
+ show.value = false;
21
+ };
22
+ const localValue = computed({
23
+ get: () => props.modelValue,
24
+ set: (value) => emit("update:modelValue", value)
25
+ });
26
+ const attrs = computed(() => {
27
+ const a = {
28
+ ...light.styles.input,
29
+ ...useAttrs,
30
+ ...JSON.parse(JSON.stringify(props))
31
+ };
32
+ return a;
33
+ });
34
+ </script>
35
+
36
+ <template>
61
37
  <l-input v-bind="attrs" v-model="localValue" hide-bottom-space>
62
38
  <q-dialog v-model="show" full-height full-width>
63
39
  <l-file-manager closable @close="show = false" @input="onInput"></l-file-manager>
@@ -66,4 +42,4 @@ const attrs = computed(() => {
66
42
  <q-btn dense flat round icon="sym_o_folder" @click="show = true"></q-btn>
67
43
  </template>
68
44
  </l-input>
69
- </template>
45
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,85 +1,73 @@
1
- <script setup>
2
- import { useDialogPluginComponent } from 'quasar'
3
- import { ref } from 'vue'
4
-
5
- const props = defineProps({
6
- title: {
7
- type: String,
8
- default: null
9
- },
10
- width: {
11
- type: String,
12
- default: '500px'
13
- },
14
- save: {
15
- type: Function,
16
- default: null
17
- },
18
- cancel: {
19
- type: Function,
20
- default: null
21
- },
22
- value: {
23
- type: Object,
24
- default: () => {
25
- return {}
26
- }
27
- },
28
- showNotification: {
29
- type: Boolean,
30
- default: true
31
- }
32
-
33
- })
34
-
35
- const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
36
- import { useQuasar } from 'quasar'
37
- const $q = useQuasar()
38
-
39
- const loading = ref(false)
40
-
41
-
42
- const emits = defineEmits(['submit'])
43
-
44
- const onSubmit = async (data, node) => {
45
- emits('submit', data)
46
-
47
- if (props.save) {
48
- loading.value = true
49
- try {
50
- await props.save(data)
51
- if (props.showNotification) {
52
- $q.notify({
53
- type: 'positive',
54
- message: 'Data saved successfully'
55
- })
56
- }
57
- onDialogOK(data)
58
- } catch (error) {
59
-
60
- $q.dialog({
61
- title: 'Error',
62
- message: error.message
63
- })
64
-
65
- } finally {
66
- loading.value = false
67
- }
68
- } else {
69
- onDialogOK(data)
70
- }
71
- }
72
-
73
- const onCancel = async () => {
74
-
75
- if (props.cancel) {
76
- await props.cancel()
77
- }
78
- onDialogCancel()
79
- }
80
-
81
- </script>
82
- <template>
1
+ <script setup>
2
+ import { useDialogPluginComponent } from "quasar";
3
+ import { ref } from "vue";
4
+ const props = defineProps({
5
+ title: {
6
+ type: String,
7
+ default: null
8
+ },
9
+ width: {
10
+ type: String,
11
+ default: "500px"
12
+ },
13
+ save: {
14
+ type: Function,
15
+ default: null
16
+ },
17
+ cancel: {
18
+ type: Function,
19
+ default: null
20
+ },
21
+ value: {
22
+ type: Object,
23
+ default: () => {
24
+ return {};
25
+ }
26
+ },
27
+ showNotification: {
28
+ type: Boolean,
29
+ default: true
30
+ }
31
+ });
32
+ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent();
33
+ import { useQuasar } from "quasar";
34
+ const $q = useQuasar();
35
+ const loading = ref(false);
36
+ const emits = defineEmits(["submit"]);
37
+ const onSubmit = async (data, node) => {
38
+ emits("submit", data);
39
+ if (props.save) {
40
+ loading.value = true;
41
+ try {
42
+ await props.save(data);
43
+ if (props.showNotification) {
44
+ $q.notify({
45
+ type: "positive",
46
+ message: "Data saved successfully"
47
+ });
48
+ }
49
+ onDialogOK(data);
50
+ } catch (error) {
51
+ $q.dialog({
52
+ title: "Error",
53
+ message: error.message
54
+ });
55
+ } finally {
56
+ loading.value = false;
57
+ }
58
+ } else {
59
+ onDialogOK(data);
60
+ }
61
+ };
62
+ const onCancel = async () => {
63
+ if (props.cancel) {
64
+ await props.cancel();
65
+ }
66
+ onDialogCancel();
67
+ };
68
+ </script>
69
+
70
+ <template>
83
71
  <q-dialog ref="dialogRef">
84
72
 
85
73
  <q-card :style="{ width }" :loading="loading" class="q-dialog-plugin">
@@ -107,4 +95,4 @@ const onCancel = async () => {
107
95
  <q-inner-loading :showing="loading"></q-inner-loading>
108
96
  </q-card>
109
97
  </q-dialog>
110
- </template>
98
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -1,98 +1,84 @@
1
- <script setup lang="ts">
2
- import { ref } from "vue";
3
- import { useRouter, useRoute } from "vue-router";
4
- import { useQuasar } from "quasar";
5
- import { model } from "#imports";
6
-
7
- const route = useRoute();
8
- const router = useRouter();
9
- const quasar = useQuasar();
10
-
11
- const form = ref(null);
12
- const props = defineProps({
13
- modelValue: {
14
- type: Object
15
- },
16
- bordered: {
17
- type: Boolean,
18
- default: true
19
- },
20
- gutter: {
21
- type: String,
22
- default: "md"
23
- },
24
- submitLabel: {
25
- type: String,
26
- default: "Save"
27
- },
28
- submitIcon: {
29
- type: String,
30
- default: "sym_o_save"
31
- },
32
- noRedirect: {
33
- type: Boolean,
34
- default: false
35
- }
36
-
37
- });
38
-
39
- const loading = ref(false)
40
-
41
- const emit = defineEmits(["save", "submit", "submitted"]);
42
- const save = async () => {
43
-
44
- let valid = await form.value.validate();
45
- if (!valid) return;
46
- if (valid) {
47
- loading.value = true;
48
- emit("save");
49
- emit('submit');
50
- }
51
-
52
- if (props.modelValue) {
53
- const [module, id_name] = route.name.split("-");
54
-
55
- try {
56
- if (route.params[id_name]) {//edit
57
- if (await model(module).update(parseInt(route.params[id_name]), props.modelValue)) {
58
-
59
- if (!props.noRedirect) {
60
- router.push(`/${module}`);
61
- }
62
-
63
- emit('submitted');
64
-
65
- return;
66
- }
67
- } else {
68
- if (await model(module).add(props.modelValue)) {
69
-
70
- if (!props.noRedirect) {
71
- router.push(`/${module}`);
72
- }
73
-
74
- emit('submitted');
75
- return;
76
- }
77
- }
78
- } catch (e) {
79
- quasar.dialog({
80
- title: "Error",
81
- message: e.message,
82
- ok: "OK"
83
- });
84
- }
85
- }
86
-
87
- loading.value = false
88
- }
89
- const onSubmit = (e) => {
90
- e.preventDefault();
91
- save();
92
- }
93
-
94
- </script>
95
- <template>
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ import { useRouter, useRoute } from "vue-router";
4
+ import { useQuasar } from "quasar";
5
+ import { model } from "#imports";
6
+ const route = useRoute();
7
+ const router = useRouter();
8
+ const quasar = useQuasar();
9
+ const form = ref(null);
10
+ const props = defineProps({
11
+ modelValue: {
12
+ type: Object
13
+ },
14
+ bordered: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ gutter: {
19
+ type: String,
20
+ default: "md"
21
+ },
22
+ submitLabel: {
23
+ type: String,
24
+ default: "Save"
25
+ },
26
+ submitIcon: {
27
+ type: String,
28
+ default: "sym_o_save"
29
+ },
30
+ noRedirect: {
31
+ type: Boolean,
32
+ default: false
33
+ }
34
+ });
35
+ const loading = ref(false);
36
+ const emit = defineEmits(["save", "submit", "submitted"]);
37
+ const save = async () => {
38
+ let valid = await form.value.validate();
39
+ if (!valid) return;
40
+ if (valid) {
41
+ loading.value = true;
42
+ emit("save");
43
+ emit("submit");
44
+ }
45
+ if (props.modelValue) {
46
+ const [module, id_name] = route.name.split("-");
47
+ try {
48
+ if (route.params[id_name]) {
49
+ if (await model(module).update(parseInt(route.params[id_name]), props.modelValue)) {
50
+ if (!props.noRedirect) {
51
+ router.push(`/${module}`);
52
+ }
53
+ emit("submitted");
54
+ return;
55
+ }
56
+ } else {
57
+ if (await model(module).add(props.modelValue)) {
58
+ if (!props.noRedirect) {
59
+ router.push(`/${module}`);
60
+ }
61
+ emit("submitted");
62
+ return;
63
+ }
64
+ }
65
+ } catch (e) {
66
+ quasar.dialog({
67
+ title: "Error",
68
+ message: e.message,
69
+ ok: "OK"
70
+ });
71
+ }
72
+ }
73
+ loading.value = false;
74
+ };
75
+ const onSubmit = (e) => {
76
+ e.preventDefault();
77
+ save();
78
+ };
79
+ </script>
80
+
81
+ <template>
96
82
  <q-form ref="form" @submit="onSubmit">
97
83
  <l-card :bordered="bordered">
98
84
  <q-card-section>
@@ -107,4 +93,4 @@ const onSubmit = (e) => {
107
93
  </q-card-actions>
108
94
  </l-card>
109
95
  </q-form>
110
- </template>
96
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;