@hostlink/nuxt-light 1.27.7 → 1.28.0
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.d.mts +2 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +40 -42
- package/dist/runtime/components/L/CustomField/Add.vue +41 -52
- package/dist/runtime/components/L/CustomField/Add.vue.d.ts +2 -0
- package/dist/runtime/components/L/CustomField/List.vue +26 -30
- package/dist/runtime/components/L/CustomField/List.vue.d.ts +2 -0
- package/dist/runtime/components/L/Database/create-table-dialog.vue +22 -38
- package/dist/runtime/components/L/Database/create-table-dialog.vue.d.ts +2 -0
- package/dist/runtime/components/L/Fieldset.vue +19 -23
- package/dist/runtime/components/L/Fieldset.vue.d.ts +2 -0
- package/dist/runtime/components/L/ForgetPasswordDialog.vue +39 -41
- package/dist/runtime/components/L/ForgetPasswordDialog.vue.d.ts +2 -0
- package/dist/runtime/components/L/Revision.vue +101 -137
- package/dist/runtime/components/L/Revision.vue.d.ts +2 -0
- package/dist/runtime/components/L/Storage.vue +26 -30
- package/dist/runtime/components/L/Storage.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/authentication.vue +22 -44
- package/dist/runtime/components/L/System/Setting/authentication.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/developer.vue +43 -59
- package/dist/runtime/components/L/System/Setting/developer.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/forget-password.vue +42 -58
- package/dist/runtime/components/L/System/Setting/forget-password.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/general.vue +29 -41
- package/dist/runtime/components/L/System/Setting/general.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/mail.vue +39 -42
- package/dist/runtime/components/L/System/Setting/mail.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/modules.vue +9 -9
- package/dist/runtime/components/L/System/Setting/modules.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/security.vue +20 -39
- package/dist/runtime/components/L/System/Setting/security.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/eventlog.vue +26 -26
- package/dist/runtime/components/L/User/eventlog.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/overview.vue +25 -27
- package/dist/runtime/components/L/User/overview.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/userlog.vue +22 -28
- package/dist/runtime/components/L/User/userlog.vue.d.ts +2 -0
- package/dist/runtime/components/L/ValidationInput.vue +68 -91
- package/dist/runtime/components/L/ValidationInput.vue.d.ts +2 -0
- package/dist/runtime/components/MyTest.vue +8 -7
- package/dist/runtime/components/MyTest.vue.d.ts +2 -0
- package/dist/runtime/components/l-add-btn.vue +13 -12
- package/dist/runtime/components/l-add-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-alert.vue +25 -29
- package/dist/runtime/components/l-alert.vue.d.ts +2 -0
- package/dist/runtime/components/l-app-main.vue +226 -294
- package/dist/runtime/components/l-app-main.vue.d.ts +2 -0
- package/dist/runtime/components/l-app.vue +76 -89
- package/dist/runtime/components/l-app.vue.d.ts +2 -0
- package/dist/runtime/components/l-audit-card.vue +8 -14
- package/dist/runtime/components/l-audit-card.vue.d.ts +2 -0
- package/dist/runtime/components/l-back-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-banner.vue +28 -34
- package/dist/runtime/components/l-banner.vue.d.ts +2 -0
- package/dist/runtime/components/l-bar.vue +21 -25
- package/dist/runtime/components/l-bar.vue.d.ts +2 -0
- package/dist/runtime/components/l-btn.vue +62 -39
- package/dist/runtime/components/l-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-card.vue +90 -141
- package/dist/runtime/components/l-card.vue.d.ts +2 -0
- package/dist/runtime/components/l-checkbox.vue +30 -7
- package/dist/runtime/components/l-checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/l-col.vue +21 -29
- package/dist/runtime/components/l-col.vue.d.ts +2 -0
- package/dist/runtime/components/l-customizer.vue +84 -100
- package/dist/runtime/components/l-customizer.vue.d.ts +2 -0
- package/dist/runtime/components/l-date-picker.vue +101 -147
- package/dist/runtime/components/l-date-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-delete-btn.vue +22 -27
- package/dist/runtime/components/l-delete-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-dialog-database-field-add.vue +19 -36
- package/dist/runtime/components/l-dialog-database-field-add.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop-container.vue +44 -62
- package/dist/runtime/components/l-drag-drop-container.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop-group.vue +49 -70
- package/dist/runtime/components/l-drag-drop-group.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop.vue +33 -44
- package/dist/runtime/components/l-drag-drop.vue.d.ts +2 -0
- package/dist/runtime/components/l-edit-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-editor.vue +185 -172
- package/dist/runtime/components/l-editor.vue.d.ts +2 -0
- package/dist/runtime/components/l-facebook-button.vue +18 -26
- package/dist/runtime/components/l-facebook-button.vue.d.ts +2 -0
- package/dist/runtime/components/l-fav-menu.vue +19 -24
- package/dist/runtime/components/l-fav-menu.vue.d.ts +2 -0
- package/dist/runtime/components/l-field.vue +49 -18
- package/dist/runtime/components/l-field.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-labels.vue +46 -48
- package/dist/runtime/components/l-file-manager-labels.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-move.vue +53 -68
- package/dist/runtime/components/l-file-manager-move.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-preview.vue +46 -81
- package/dist/runtime/components/l-file-manager-preview.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager.vue +498 -640
- package/dist/runtime/components/l-file-manager.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-upload.vue +80 -109
- package/dist/runtime/components/l-file-upload.vue.d.ts +2 -0
- package/dist/runtime/components/l-file.vue +37 -61
- package/dist/runtime/components/l-file.vue.d.ts +2 -0
- package/dist/runtime/components/l-form-dialog.vue +71 -83
- package/dist/runtime/components/l-form-dialog.vue.d.ts +2 -0
- package/dist/runtime/components/l-form.vue +82 -96
- package/dist/runtime/components/l-form.vue.d.ts +2 -0
- package/dist/runtime/components/l-group-select.vue +59 -94
- package/dist/runtime/components/l-group-select.vue.d.ts +2 -0
- package/dist/runtime/components/l-icon-picker.vue +3265 -3274
- package/dist/runtime/components/l-icon-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-input-xlsx.vue +30 -38
- package/dist/runtime/components/l-input-xlsx.vue.d.ts +2 -0
- package/dist/runtime/components/l-input.vue +142 -126
- package/dist/runtime/components/l-input.vue.d.ts +2 -0
- package/dist/runtime/components/l-item.vue +30 -21
- package/dist/runtime/components/l-item.vue.d.ts +2 -0
- package/dist/runtime/components/l-link.vue +16 -15
- package/dist/runtime/components/l-link.vue.d.ts +2 -0
- package/dist/runtime/components/l-list.vue +27 -35
- package/dist/runtime/components/l-list.vue.d.ts +2 -0
- package/dist/runtime/components/l-login.vue +246 -287
- package/dist/runtime/components/l-login.vue.d.ts +2 -0
- package/dist/runtime/components/l-menu.vue +45 -54
- package/dist/runtime/components/l-menu.vue.d.ts +2 -0
- package/dist/runtime/components/l-microsoft-button.vue +42 -52
- package/dist/runtime/components/l-microsoft-button.vue.d.ts +2 -0
- package/dist/runtime/components/l-page.vue +48 -67
- package/dist/runtime/components/l-page.vue.d.ts +2 -0
- package/dist/runtime/components/l-row.vue +8 -13
- package/dist/runtime/components/l-row.vue.d.ts +2 -0
- package/dist/runtime/components/l-save-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-select.vue +150 -76
- package/dist/runtime/components/l-select.vue.d.ts +2 -0
- package/dist/runtime/components/l-small-box.vue +18 -31
- package/dist/runtime/components/l-small-box.vue.d.ts +2 -0
- package/dist/runtime/components/l-statistic.vue +17 -23
- package/dist/runtime/components/l-statistic.vue.d.ts +2 -0
- package/dist/runtime/components/l-tab.vue +20 -15
- package/dist/runtime/components/l-tab.vue.d.ts +2 -0
- package/dist/runtime/components/l-table.vue +444 -560
- package/dist/runtime/components/l-table.vue.d.ts +2 -0
- package/dist/runtime/components/l-tabs.vue +34 -16
- package/dist/runtime/components/l-tabs.vue.d.ts +2 -0
- package/dist/runtime/components/l-test2.vue +10 -9
- package/dist/runtime/components/l-test2.vue.d.ts +2 -0
- package/dist/runtime/components/l-time-picker.vue +53 -68
- package/dist/runtime/components/l-time-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-view-btn.vue.d.ts +2 -0
- package/dist/runtime/composables/mytest.d.ts +2 -0
- package/dist/runtime/composables/mytest.js +3 -0
- package/dist/runtime/formkit/Checkbox.vue +15 -18
- package/dist/runtime/formkit/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/formkit/DatePicker.vue +15 -18
- package/dist/runtime/formkit/DatePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/Editor.vue +15 -18
- package/dist/runtime/formkit/Editor.vue.d.ts +2 -0
- package/dist/runtime/formkit/File.vue +30 -37
- package/dist/runtime/formkit/File.vue.d.ts +2 -0
- package/dist/runtime/formkit/FilePicker.vue +22 -25
- package/dist/runtime/formkit/FilePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/FileUpload.vue +22 -25
- package/dist/runtime/formkit/FileUpload.vue.d.ts +2 -0
- package/dist/runtime/formkit/Form.vue +79 -100
- package/dist/runtime/formkit/Form.vue.d.ts +2 -0
- package/dist/runtime/formkit/GroupSelect.vue +21 -27
- package/dist/runtime/formkit/GroupSelect.vue.d.ts +2 -0
- package/dist/runtime/formkit/Input.vue +53 -61
- package/dist/runtime/formkit/Input.vue.d.ts +2 -0
- package/dist/runtime/formkit/InputXlsx.vue +15 -18
- package/dist/runtime/formkit/InputXlsx.vue.d.ts +2 -0
- package/dist/runtime/formkit/OptionGroup.vue +20 -26
- package/dist/runtime/formkit/OptionGroup.vue.d.ts +2 -0
- package/dist/runtime/formkit/Radio.vue +15 -18
- package/dist/runtime/formkit/Radio.vue.d.ts +2 -0
- package/dist/runtime/formkit/Repeater.vue +62 -76
- package/dist/runtime/formkit/Repeater.vue.d.ts +2 -0
- package/dist/runtime/formkit/Select.vue +21 -29
- package/dist/runtime/formkit/Select.vue.d.ts +2 -0
- package/dist/runtime/formkit/TimePicker.vue +15 -19
- package/dist/runtime/formkit/TimePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/Toggle.vue +13 -16
- package/dist/runtime/formkit/Toggle.vue.d.ts +2 -0
- package/dist/runtime/light.d.ts +1129 -6
- package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue +24 -26
- package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/CustomField/index.vue +22 -29
- package/dist/runtime/pages/CustomField/index.vue.d.ts +2 -0
- package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +8 -8
- package/dist/runtime/pages/EventLog/_eventlog_id/view.vue.d.ts +2 -0
- package/dist/runtime/pages/EventLog/index.vue +7 -6
- package/dist/runtime/pages/EventLog/index.vue.d.ts +2 -0
- package/dist/runtime/pages/FileManager/index.vue.d.ts +2 -0
- package/dist/runtime/pages/MailLog/index.vue +7 -6
- package/dist/runtime/pages/MailLog/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/add.vue +26 -29
- package/dist/runtime/pages/Permission/add.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/all.vue +57 -73
- package/dist/runtime/pages/Permission/all.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/export.vue +49 -62
- package/dist/runtime/pages/Permission/export.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/index.vue +19 -20
- package/dist/runtime/pages/Permission/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/_name/update-child.vue +12 -14
- package/dist/runtime/pages/Role/_name/update-child.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/add.vue +13 -15
- package/dist/runtime/pages/Role/add.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/add2.vue +27 -38
- package/dist/runtime/pages/Role/add2.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/index.vue +100 -127
- package/dist/runtime/pages/Role/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/backup.vue +28 -36
- package/dist/runtime/pages/System/database/backup.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/process.vue +33 -43
- package/dist/runtime/pages/System/database/process.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/table.vue +168 -205
- package/dist/runtime/pages/System/database/table.vue.d.ts +2 -0
- package/dist/runtime/pages/System/fs.vue +95 -107
- package/dist/runtime/pages/System/fs.vue.d.ts +2 -0
- package/dist/runtime/pages/System/index.vue +30 -31
- package/dist/runtime/pages/System/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/mailtest.vue +29 -35
- package/dist/runtime/pages/System/mailtest.vue.d.ts +2 -0
- package/dist/runtime/pages/System/menu/index.vue +175 -223
- package/dist/runtime/pages/System/menu/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/package.vue +21 -21
- package/dist/runtime/pages/System/package.vue.d.ts +2 -0
- package/dist/runtime/pages/System/phpinfo.vue +11 -10
- package/dist/runtime/pages/System/phpinfo.vue.d.ts +2 -0
- package/dist/runtime/pages/System/setting.vue +42 -59
- package/dist/runtime/pages/System/setting.vue.d.ts +2 -0
- package/dist/runtime/pages/System/test.vue.d.ts +2 -0
- package/dist/runtime/pages/System/view_as.vue +65 -68
- package/dist/runtime/pages/System/view_as.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue +7 -7
- package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/add.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/index.vue +7 -6
- package/dist/runtime/pages/SystemValue/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Translate/index.vue +81 -100
- package/dist/runtime/pages/Translate/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/change-password.vue +38 -45
- package/dist/runtime/pages/User/_user_id/change-password.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/edit.vue +35 -26
- package/dist/runtime/pages/User/_user_id/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/update-role.vue +33 -43
- package/dist/runtime/pages/User/_user_id/update-role.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/view.vue +35 -37
- package/dist/runtime/pages/User/_user_id/view.vue.d.ts +2 -0
- package/dist/runtime/pages/User/add.vue +52 -60
- package/dist/runtime/pages/User/add.vue.d.ts +2 -0
- package/dist/runtime/pages/User/index.vue +23 -32
- package/dist/runtime/pages/User/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/profile.vue +52 -58
- package/dist/runtime/pages/User/profile.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/bio-auth.vue +85 -95
- package/dist/runtime/pages/User/setting/bio-auth.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/index.vue +27 -28
- package/dist/runtime/pages/User/setting/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/information.vue +28 -27
- package/dist/runtime/pages/User/setting/information.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/my_favorite.vue +29 -35
- package/dist/runtime/pages/User/setting/my_favorite.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/open_id.vue +140 -165
- package/dist/runtime/pages/User/setting/open_id.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/password.vue +37 -44
- package/dist/runtime/pages/User/setting/password.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/style.vue +84 -102
- package/dist/runtime/pages/User/setting/style.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/two-factor-auth.vue +51 -61
- package/dist/runtime/pages/User/setting/two-factor-auth.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting.vue +9 -9
- package/dist/runtime/pages/User/setting.vue.d.ts +2 -0
- package/dist/runtime/pages/UserLog/index.vue +7 -6
- package/dist/runtime/pages/UserLog/index.vue.d.ts +2 -0
- package/dist/types.d.mts +3 -1
- package/package.json +9 -11
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -7
- package/dist/types.d.ts +0 -1
|
@@ -1,149 +1,103 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { ref, computed } from "vue";
|
|
3
|
-
import { useLight } from
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (popup.value) {
|
|
102
|
-
popup.value.hide();
|
|
103
|
-
}
|
|
104
|
-
localValue.value = value;
|
|
105
|
-
modelValue.value = value;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const rules: any = [];
|
|
110
|
-
|
|
111
|
-
if (props.required) {
|
|
112
|
-
rules.push((val: any) => {
|
|
113
|
-
if (!val) {
|
|
114
|
-
return "Required";
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (!props.range) {
|
|
120
|
-
rules.push((val: any) => {
|
|
121
|
-
//check val is YYYY-MM-DD
|
|
122
|
-
if (val) {
|
|
123
|
-
if (!val.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
124
|
-
return "Invalid date format";
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const input_attrs = computed(() => {
|
|
131
|
-
|
|
132
|
-
const a = light.getInputProps(props);
|
|
133
|
-
a.rules = rules;
|
|
134
|
-
a.mask = props.range ? "####-##-## - ####-##-##" : "####-##-##"
|
|
135
|
-
|
|
136
|
-
return a;
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
const date_attrs = computed(() => {
|
|
140
|
-
const { label, rules, hideBottomSpace, filled, outlined, standout, rounded, dense, square, stackLabel, ...rest } = props;
|
|
141
|
-
return rest;
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</script>
|
|
146
|
-
<template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useLight } from "#imports";
|
|
4
|
+
import { date } from "quasar";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
const modelValue = defineModel({ type: [String, Object, null, Unknown] });
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
label: { type: String, required: false },
|
|
10
|
+
required: { type: Boolean, required: false },
|
|
11
|
+
hideBottomSpace: { type: Boolean, required: false, default: true },
|
|
12
|
+
filled: { type: Boolean, required: false, default: void 0 },
|
|
13
|
+
outlined: { type: Boolean, required: false, default: void 0 },
|
|
14
|
+
standout: { type: Boolean, required: false, default: void 0 },
|
|
15
|
+
rounded: { type: Boolean, required: false, default: void 0 },
|
|
16
|
+
dense: { type: Boolean, required: false, default: void 0 },
|
|
17
|
+
square: { type: Boolean, required: false, default: void 0 },
|
|
18
|
+
stackLabel: { type: Boolean, required: false, default: void 0 },
|
|
19
|
+
rules: { type: Array, required: false },
|
|
20
|
+
range: { type: Boolean, required: false, default: false },
|
|
21
|
+
mask: { type: String, required: false, default: "YYYY-MM-DD" },
|
|
22
|
+
disable: { type: Boolean, required: false, default: false },
|
|
23
|
+
color: { type: String, required: false }
|
|
24
|
+
});
|
|
25
|
+
const light = useLight();
|
|
26
|
+
const popup = ref(null);
|
|
27
|
+
const localValue = computed({
|
|
28
|
+
get: () => {
|
|
29
|
+
if (modelValue.value) {
|
|
30
|
+
if (typeof modelValue.value == "object") {
|
|
31
|
+
return modelValue.value.from + " - " + modelValue.value.to;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return modelValue.value;
|
|
35
|
+
},
|
|
36
|
+
set: (value) => {
|
|
37
|
+
if (props.range) {
|
|
38
|
+
if (typeof value == "object") {
|
|
39
|
+
modelValue.value = value;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const parts = value.split(" - ");
|
|
43
|
+
if (parts.length == 2) {
|
|
44
|
+
const from = parts[0];
|
|
45
|
+
const to = parts[1];
|
|
46
|
+
if (from.match(/^\d{4}-\d{2}-\d{2}$/) && to.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
47
|
+
modelValue.value = { from, to };
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (value.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
53
|
+
modelValue.value = value;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
modelValue.value = null;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const dateValue = computed({
|
|
60
|
+
get: () => {
|
|
61
|
+
return modelValue;
|
|
62
|
+
},
|
|
63
|
+
set: (value) => {
|
|
64
|
+
if (popup.value) {
|
|
65
|
+
popup.value.hide();
|
|
66
|
+
}
|
|
67
|
+
localValue.value = value;
|
|
68
|
+
modelValue.value = value;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const rules = [];
|
|
72
|
+
if (props.required) {
|
|
73
|
+
rules.push((val) => {
|
|
74
|
+
if (!val) {
|
|
75
|
+
return "Required";
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!props.range) {
|
|
80
|
+
rules.push((val) => {
|
|
81
|
+
if (val) {
|
|
82
|
+
if (!val.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
83
|
+
return "Invalid date format";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const input_attrs = computed(() => {
|
|
89
|
+
const a = light.getInputProps(props);
|
|
90
|
+
a.rules = rules;
|
|
91
|
+
a.mask = props.range ? "####-##-## - ####-##-##" : "####-##-##";
|
|
92
|
+
return a;
|
|
93
|
+
});
|
|
94
|
+
const date_attrs = computed(() => {
|
|
95
|
+
const { label, rules: rules2, hideBottomSpace, filled, outlined, standout, rounded, dense, square, stackLabel, ...rest } = props;
|
|
96
|
+
return rest;
|
|
97
|
+
});
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
147
101
|
<q-input v-bind="input_attrs" v-model="localValue">
|
|
148
102
|
<template v-slot:prepend>
|
|
149
103
|
<q-btn icon="sym_o_event" round dense flat>
|
|
@@ -161,4 +115,4 @@ const date_attrs = computed(() => {
|
|
|
161
115
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
162
116
|
</template>
|
|
163
117
|
</q-input>
|
|
164
|
-
</template>
|
|
118
|
+
</template>
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
emit("submit");
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
26
|
-
<template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useQuasar } from "quasar";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
const { t } = useI18n();
|
|
5
|
+
const props = defineProps(["to"]);
|
|
6
|
+
const emit = defineEmits(["submit"]);
|
|
7
|
+
const qua = useQuasar();
|
|
8
|
+
const onDelete = () => {
|
|
9
|
+
qua.dialog({
|
|
10
|
+
title: t("Delete"),
|
|
11
|
+
message: t("Are you sure you want to delete this record?"),
|
|
12
|
+
cancel: true,
|
|
13
|
+
persistent: true,
|
|
14
|
+
color: "negative"
|
|
15
|
+
}).onOk(async () => {
|
|
16
|
+
emit("submit");
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
27
22
|
<q-btn flat round icon="sym_o_delete" @click="onDelete" />
|
|
28
|
-
</template>
|
|
23
|
+
</template>
|
|
@@ -1,38 +1,21 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useDialogPluginComponent } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// example: onDialogOK({ /*...*/ }) - with payload
|
|
20
|
-
// onDialogCancel - Function to call to settle dialog with "cancel" outcome
|
|
21
|
-
|
|
22
|
-
// this is part of our example (so not required)
|
|
23
|
-
function onOKClick(value) {
|
|
24
|
-
// on OK, it is REQUIRED to
|
|
25
|
-
// call onDialogOK (with optional payload)
|
|
26
|
-
onDialogOK(value)
|
|
27
|
-
// or with payload: onDialogOK({ ... })
|
|
28
|
-
// ...and it will also hide the dialog automatically
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const types = ["varchar", "int", "date", "time", "datetime", "timestamp", "text", "blob", "json", "jsonb", "uuid", "boolean", "decimal", "float", "double", "real", "numeric", "smallint", "bigint", "tinyint", "mediumint", "char", "binary", "varbinary", "enum"]
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useDialogPluginComponent } from "quasar";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
// ...your custom props
|
|
5
|
+
});
|
|
6
|
+
defineEmits([
|
|
7
|
+
// REQUIRED; need to specify some events that your
|
|
8
|
+
// component will emit through useDialogPluginComponent()
|
|
9
|
+
...useDialogPluginComponent.emits
|
|
10
|
+
]);
|
|
11
|
+
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent();
|
|
12
|
+
function onOKClick(value) {
|
|
13
|
+
onDialogOK(value);
|
|
14
|
+
}
|
|
15
|
+
const types = ["varchar", "int", "date", "time", "datetime", "timestamp", "text", "blob", "json", "jsonb", "uuid", "boolean", "decimal", "float", "double", "real", "numeric", "smallint", "bigint", "tinyint", "mediumint", "char", "binary", "varbinary", "enum"];
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
36
19
|
<q-dialog ref="dialogRef">
|
|
37
20
|
<q-card class="q-dialog-plugin">
|
|
38
21
|
<q-toolbar>
|
|
@@ -59,4 +42,4 @@ const types = ["varchar", "int", "date", "time", "datetime", "timestamp", "text"
|
|
|
59
42
|
|
|
60
43
|
</q-card>
|
|
61
44
|
</q-dialog>
|
|
62
|
-
</template>
|
|
45
|
+
</template>
|
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { animations } from "@formkit/drag-and-drop";
|
|
3
|
-
import { getCurrentInstance, watch } from
|
|
4
|
-
import { useDragAndDrop } from
|
|
5
|
-
const model = defineModel();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const [parent, items] = useDragAndDrop(filteredItem, {
|
|
45
|
-
plugins: [animations()],
|
|
46
|
-
group: group_name,
|
|
47
|
-
dragHandle: group.props.dragHandle
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
watch(items, () => {
|
|
51
|
-
model.value = items.value.map((item) => {
|
|
52
|
-
return item.props.name ?? Symbol();
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
group.exposed.updateModel(props.name, model.value);
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</script>
|
|
61
|
-
<template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { animations } from "@formkit/drag-and-drop";
|
|
3
|
+
import { getCurrentInstance, watch } from "vue";
|
|
4
|
+
import { useDragAndDrop } from "@formkit/drag-and-drop/vue";
|
|
5
|
+
const model = defineModel();
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
name: String
|
|
8
|
+
});
|
|
9
|
+
const doFind = (instance) => {
|
|
10
|
+
if (instance.type.__name === "l-drag-drop-group") {
|
|
11
|
+
return instance;
|
|
12
|
+
}
|
|
13
|
+
if (instance.parent) {
|
|
14
|
+
return doFind(instance.parent);
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
const group = doFind(getCurrentInstance());
|
|
19
|
+
const allItems = group.exposed.findAllItems();
|
|
20
|
+
const group_name = group.exposed.getGroupName();
|
|
21
|
+
const group_model = group.exposed.getModelByName(props.name);
|
|
22
|
+
console.log(props.name);
|
|
23
|
+
if (model.value == void 0) {
|
|
24
|
+
model.value = group_model;
|
|
25
|
+
console.log(model.value);
|
|
26
|
+
}
|
|
27
|
+
const filteredItem = allItems.filter((item) => {
|
|
28
|
+
return model.value.includes(item.props.name);
|
|
29
|
+
});
|
|
30
|
+
const [parent, items] = useDragAndDrop(filteredItem, {
|
|
31
|
+
plugins: [animations()],
|
|
32
|
+
group: group_name,
|
|
33
|
+
dragHandle: group.props.dragHandle
|
|
34
|
+
});
|
|
35
|
+
watch(items, () => {
|
|
36
|
+
model.value = items.value.map((item) => {
|
|
37
|
+
return item.props.name ?? Symbol();
|
|
38
|
+
});
|
|
39
|
+
group.exposed.updateModel(props.name, model.value);
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
62
44
|
<div ref="parent" style="min-height: 150px;">
|
|
63
45
|
<template v-for="item in items" :key="item">
|
|
64
46
|
<component :is="item" />
|
|
65
47
|
</template>
|
|
66
48
|
</div>
|
|
67
|
-
</template>
|
|
49
|
+
</template>
|
|
@@ -1,71 +1,50 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useSlots } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return containers;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//get all containers children and join them
|
|
58
|
-
function getItems(containers) {
|
|
59
|
-
const items = [];
|
|
60
|
-
for (const container of containers) {
|
|
61
|
-
items.push(...container.children.default());
|
|
62
|
-
}
|
|
63
|
-
return items;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</script>
|
|
69
|
-
<template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useSlots } from "vue";
|
|
3
|
+
const model = defineModel();
|
|
4
|
+
console.log(model);
|
|
5
|
+
const slots = useSlots().default();
|
|
6
|
+
const DragDropContainer = resolveComponent("l-drag-drop-container");
|
|
7
|
+
const group_name = Symbol();
|
|
8
|
+
defineExpose({
|
|
9
|
+
updateModel: (name, value) => {
|
|
10
|
+
model.value[name] = value;
|
|
11
|
+
},
|
|
12
|
+
getModelByName: (name) => {
|
|
13
|
+
return model.value[name];
|
|
14
|
+
},
|
|
15
|
+
getGroupName: () => {
|
|
16
|
+
return group_name;
|
|
17
|
+
},
|
|
18
|
+
findAllItems: () => {
|
|
19
|
+
const containers = getContainers(slots);
|
|
20
|
+
const items = getItems(containers);
|
|
21
|
+
return items;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
function getContainers(nodes) {
|
|
25
|
+
const containers = [];
|
|
26
|
+
for (const node of nodes) {
|
|
27
|
+
if (node.type === DragDropContainer) {
|
|
28
|
+
containers.push(node);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (node.children) {
|
|
32
|
+
if (node.children.default) {
|
|
33
|
+
containers.push(...getContainers(node.children.default()));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return containers;
|
|
38
|
+
}
|
|
39
|
+
function getItems(containers) {
|
|
40
|
+
const items = [];
|
|
41
|
+
for (const container of containers) {
|
|
42
|
+
items.push(...container.children.default());
|
|
43
|
+
}
|
|
44
|
+
return items;
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
70
49
|
<slot></slot>
|
|
71
|
-
</template>
|
|
50
|
+
</template>
|