@niyamulahsan/create-deskapp 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -16
- package/template/.env.example +20 -13
- package/template/AGENTS.md +699 -0
- package/template/package.json +3 -0
- package/template/src/config/app.ts +26 -24
- package/template/src/config/winsetup.ts +93 -91
- package/template/src/core/api/binding-error.ts +57 -0
- package/template/src/core/api/bindings.generated.ts +2 -0
- package/template/src/core/api/generate.manifest.ts +84 -80
- package/template/src/core/api/registry.ts +58 -48
- package/template/src/core/config.ts +101 -99
- package/template/src/core/database/aggregate.ts +89 -85
- package/template/src/core/database/config.ts +50 -48
- package/template/src/core/database/connection.ts +116 -114
- package/template/src/core/database/migrate-hooks.ts +86 -84
- package/template/src/core/database/paginate.ts +226 -224
- package/template/src/core/database/reset.ts +21 -19
- package/template/src/core/database/seed.ts +169 -167
- package/template/src/core/database/status.ts +37 -35
- package/template/src/core/env.ts +108 -106
- package/template/src/core/facade.ts +63 -61
- package/template/src/core/maker/db/fresh.ts +10 -8
- package/template/src/core/maker/db/generate.ts +13 -11
- package/template/src/core/maker/db/helpers.ts +92 -96
- package/template/src/core/maker/db/migrate.ts +37 -35
- package/template/src/core/maker/db/mod.ts +93 -91
- package/template/src/core/maker/db/module-migrate.ts +56 -54
- package/template/src/core/maker/db/push.ts +23 -21
- package/template/src/core/maker/db/reset.ts +8 -6
- package/template/src/core/maker/db/seed.ts +9 -7
- package/template/src/core/maker/db/status.ts +8 -6
- package/template/src/core/maker/help.ts +59 -57
- package/template/src/core/maker/make/controller.ts +25 -22
- package/template/src/core/maker/make/helpers.ts +97 -91
- package/template/src/core/maker/make/mod.ts +69 -67
- package/template/src/core/maker/make/model.ts +16 -14
- package/template/src/core/maker/make/module.ts +53 -39
- package/template/src/core/maker/make/seeder.ts +23 -21
- package/template/src/core/maker/make/test.ts +33 -30
- package/template/src/core/maker/mod.ts +85 -83
- package/template/src/core/maker/run/mod.ts +134 -132
- package/template/src/core/maker/stub.ts +26 -24
- package/template/src/core/maker/stubs/controller/controller.controller.stub +57 -55
- package/template/src/core/maker/stubs/controller/controller.schema.stub +18 -13
- package/template/src/core/maker/stubs/facade/facade.stub +21 -0
- package/template/src/core/maker/stubs/model/model.stub +10 -8
- package/template/src/core/maker/stubs/seeder/seeder.stub +18 -16
- package/template/src/core/maker/stubs/test/test.stub +9 -7
- package/template/src/core/maker/sync-config.ts +93 -94
- package/template/src/core/utils/password.ts +29 -27
- package/template/src/core/utils/playwright.ts +123 -121
- package/template/src/core/utils/queue.ts +68 -66
- package/template/src/core/utils/scheduler.ts +62 -60
- package/template/src/core/utils/storage.ts +3 -1
- package/template/src/core/utils/validation.ts +37 -35
- package/template/src/database/schema.ts +2 -0
- package/template/src/main.ts +120 -118
- package/template/src/modules/app/__tests__/demo.controller.test.ts +75 -0
- package/template/src/modules/app/__tests__/net.controller.test.ts +65 -0
- package/template/src/modules/app/__tests__/playwright.controller.test.ts +50 -0
- package/template/src/modules/app/__tests__/storage.controller.test.ts +114 -0
- package/template/src/modules/app/__tests__/window.controller.test.ts +98 -0
- package/template/src/modules/app/controllers/demo.controller.ts +120 -118
- package/template/src/modules/app/controllers/net.controller.ts +50 -48
- package/template/src/modules/app/controllers/playwright.controller.ts +142 -140
- package/template/src/modules/app/controllers/storage.controller.ts +231 -229
- package/template/src/modules/app/controllers/window.controller.ts +2 -0
- package/template/src/modules/app/facade.ts +21 -0
- package/template/src/preload.ts +25 -2
- package/template/src/ui/src/App.vue +4 -2
- package/template/src/ui/src/app.ts +38 -23
- package/template/src/ui/src/bindings.d.ts +18 -16
- package/template/src/ui/src/components/Button.vue +34 -32
- package/template/src/ui/src/components/Checkbox.vue +26 -29
- package/template/src/ui/src/components/Input.vue +221 -227
- package/template/src/ui/src/components/InputGroup.vue +141 -0
- package/template/src/ui/src/components/InputPasswordToggle.vue +204 -0
- package/template/src/ui/src/components/Modal.vue +65 -55
- package/template/src/ui/src/components/Spinner.vue +44 -42
- package/template/src/ui/src/components/Switch.vue +62 -65
- package/template/src/ui/src/components/TextArea.vue +108 -121
- package/template/src/ui/src/components/Toast.vue +55 -56
- package/template/src/ui/src/components/datatable/DataTableSkeleton.vue +100 -98
- package/template/src/ui/src/components/datatable/Pagination.vue +153 -125
- package/template/src/ui/src/components/datatable/SelectOpption.vue +36 -35
- package/template/src/ui/src/components/datatable/index.vue +336 -258
- package/template/src/ui/src/env.d.ts +16 -13
- package/template/src/ui/src/global.d.ts +21 -2
- package/template/src/ui/src/helpers/nformatter.ts +12 -10
- package/template/src/ui/src/pages/dashboard/index.vue +690 -687
- package/template/src/ui/src/plugins/browserDetect.ts +57 -0
- package/template/src/ui/src/plugins/gum.ts +576 -549
- package/template/src/ui/src/plugins/pulse.ts +181 -147
- package/template/src/ui/src/plugins/routeProgress.ts +89 -0
- package/template/src/ui/src/router/index.ts +44 -25
- package/template/src/ui/src/stores/example.ts +2 -0
- package/template/src/ui/vite.config.ts +40 -38
- package/template/src/window/app-menu.ts +89 -87
- package/template/src/window/config.ts +14 -12
- package/template/src/window/context-menu.ts +23 -21
- package/template/src/window/dialogs.ts +92 -90
- package/template/src/window/manager.ts +2 -0
- package/template/src/window/native.ts +47 -45
- package/template/src/window/tray.ts +132 -130
|
@@ -1,65 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
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
|
-
cursor: pointer;
|
|
64
|
-
}
|
|
65
|
-
</style>
|
|
1
|
+
<!-- ./src/ui/src/components/Switch.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div :class="wrapperClass">
|
|
5
|
+
<label :class="props.vertical ? 'form-check-label d-block' : 'd-none'">
|
|
6
|
+
<span v-html="statusHtml"></span>
|
|
7
|
+
</label>
|
|
8
|
+
<div class="form-check form-switch d-inline-block">
|
|
9
|
+
<input class="form-check-input shadow-none border-primary" type="checkbox" :checked="isChecked" v-bind="$attrs">
|
|
10
|
+
<label :class="props.vertical ? 'd-none' : 'form-check-label'">
|
|
11
|
+
<span v-html="statusHtml"></span>
|
|
12
|
+
</label>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed, useAttrs } from "vue";
|
|
19
|
+
|
|
20
|
+
defineOptions({ name: "Switch", inheritAttrs: false });
|
|
21
|
+
|
|
22
|
+
interface SwitchProps {
|
|
23
|
+
modelValue?: string | number | boolean;
|
|
24
|
+
value?: unknown[] | Record<string, unknown> | string | number | boolean;
|
|
25
|
+
vertical?: boolean;
|
|
26
|
+
checked?: boolean | number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const $attrs = useAttrs();
|
|
30
|
+
const props = defineProps<SwitchProps>();
|
|
31
|
+
|
|
32
|
+
const textLabel = computed(() => ($attrs.text as string | undefined) || "");
|
|
33
|
+
const blankLabel = computed(() => ($attrs.blank as string | undefined) || "");
|
|
34
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "");
|
|
35
|
+
|
|
36
|
+
const isChecked = computed(() => Boolean(props.checked));
|
|
37
|
+
|
|
38
|
+
const wrapperClass = computed(() => (props.vertical ? `text-center ${topclass.value}`.trim() : ""));
|
|
39
|
+
|
|
40
|
+
const statusHtml = computed(() => {
|
|
41
|
+
if (isChecked.value) {
|
|
42
|
+
return `<div class='d-flex justify-content-center'><span>${textLabel.value}</span><div class='rounded-circle bg-success indicator'></div></div>`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return `<div class='d-flex justify-content-center'><span>${blankLabel.value}</span><div class='rounded-circle bg-danger indicator'></div></div>`;
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style lang="scss" scoped>
|
|
50
|
+
.indicator {
|
|
51
|
+
width: 4px;
|
|
52
|
+
height: 4px;
|
|
53
|
+
margin-left: 2px;
|
|
54
|
+
margin-top: 5px;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
<style lang="scss" scoped>
|
|
58
|
+
label,
|
|
59
|
+
input {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -1,121 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
<div class="form-floating h-100">
|
|
11
|
-
<textarea
|
|
12
|
-
:value="props.modelValue"
|
|
13
|
-
class="form-control mb-0 h-100"
|
|
14
|
-
:maxlength="maxLengthAttr"
|
|
15
|
-
:aria-describedby="`${inputId}Help`"
|
|
16
|
-
v-bind="$attrs"
|
|
17
|
-
rows="3"
|
|
18
|
-
@input="updateModel"
|
|
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
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
const
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.must {
|
|
112
|
-
width: 4px;
|
|
113
|
-
height: 4px;
|
|
114
|
-
margin-left: 2px;
|
|
115
|
-
margin-top: 5px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.max {
|
|
119
|
-
font-size: 0.6rem;
|
|
120
|
-
}
|
|
121
|
-
</style>
|
|
1
|
+
<!-- ./src/ui/src/components/TextArea.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div :class="wrapperClass">
|
|
5
|
+
<div class="position-relative">
|
|
6
|
+
<div class="position-relative mb-1">
|
|
7
|
+
<span class="text-capitalize" v-html="inputLabel"></span>
|
|
8
|
+
<span class="position-absolute text-danger rounded-circle bg-danger must" :class="{ 'd-none': !props.must }"></span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="form-floating h-100">
|
|
11
|
+
<textarea
|
|
12
|
+
:value="props.modelValue"
|
|
13
|
+
class="form-control mb-0 h-100"
|
|
14
|
+
:maxlength="maxLengthAttr"
|
|
15
|
+
:aria-describedby="`${inputId}Help`"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
rows="3"
|
|
18
|
+
@input="updateModel"
|
|
19
|
+
>
|
|
20
|
+
</textarea>
|
|
21
|
+
<label :for="inputId" class="d-block placeholder-label border-0" :class="{ 'd-none': !placeholderText }">
|
|
22
|
+
{{ placeholderText }}
|
|
23
|
+
</label>
|
|
24
|
+
</div>
|
|
25
|
+
<label class="position-absolute end-0 pe-1 text-secondary max" :class="{ 'd-none': !max }" style="top: 28px">
|
|
26
|
+
{{ maxCounter }}
|
|
27
|
+
</label>
|
|
28
|
+
</div>
|
|
29
|
+
<div :id="`${inputId}Help`" class="form-text text-danger" :class="{ 'd-none': !props.err }">
|
|
30
|
+
{{ props.err }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { computed, nextTick, onMounted, useAttrs } from "vue";
|
|
37
|
+
|
|
38
|
+
defineOptions({ name: "TextArea", inheritAttrs: false });
|
|
39
|
+
|
|
40
|
+
const $attrs = useAttrs();
|
|
41
|
+
interface TextAreaProps {
|
|
42
|
+
focus?: boolean;
|
|
43
|
+
must?: boolean;
|
|
44
|
+
err?: string | boolean;
|
|
45
|
+
modelValue?: string | number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const props = withDefaults(defineProps<TextAreaProps>(), {
|
|
49
|
+
modelValue: ""
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const inputId = computed(() => ($attrs.id as string | undefined) || "");
|
|
53
|
+
const inputLabel = computed(() => ($attrs.label as string | undefined) || "");
|
|
54
|
+
const placeholderText = computed(() => ($attrs.placeholder as string | undefined) || "");
|
|
55
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "");
|
|
56
|
+
|
|
57
|
+
const wrapperClass = computed(() => (topclass.value ? `${topclass.value} position-relative` : "mb-2"));
|
|
58
|
+
|
|
59
|
+
const max = computed<number | null>(() => {
|
|
60
|
+
const raw = $attrs.maxlength as string | number | undefined;
|
|
61
|
+
return raw != null ? Number(raw) : null;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const maxLengthAttr = computed<number | undefined>(() => max.value ?? undefined);
|
|
65
|
+
const maxCounter = computed(() => (max.value == null ? "" : max.value - String(props.modelValue).length));
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits<(event: "update:modelValue", value: string) => void>();
|
|
68
|
+
const updateModel = (e: Event) => {
|
|
69
|
+
const target = e.target as HTMLTextAreaElement;
|
|
70
|
+
emit("update:modelValue", target.value);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
onMounted(async () => {
|
|
74
|
+
if (!props.focus || !inputId.value) return;
|
|
75
|
+
await nextTick();
|
|
76
|
+
const textarea = document.querySelector(`#${inputId.value}`) as HTMLTextAreaElement | null;
|
|
77
|
+
textarea?.focus();
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.form-floating {
|
|
83
|
+
label {
|
|
84
|
+
top: -1px;
|
|
85
|
+
left: 1px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
textarea:focus+label,
|
|
89
|
+
textarea:not(:placeholder-shown)+label {
|
|
90
|
+
top: -6px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.placeholder-label {
|
|
95
|
+
color: #cccccc !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.must {
|
|
99
|
+
width: 4px;
|
|
100
|
+
height: 4px;
|
|
101
|
+
margin-left: 2px;
|
|
102
|
+
margin-top: 5px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.max {
|
|
106
|
+
font-size: 0.6rem;
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<style lang="scss" scoped></style>
|
|
1
|
+
<!-- ./src/ui/src/components/Toast.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<Teleport to="#toast-show">
|
|
5
|
+
<div
|
|
6
|
+
ref="notify"
|
|
7
|
+
class="toast position-fixed"
|
|
8
|
+
role="alert"
|
|
9
|
+
aria-live="assertive"
|
|
10
|
+
aria-atomic="true"
|
|
11
|
+
style="z-index: 1000000; top: 10px; right: 23px"
|
|
12
|
+
data-bs-delay="2000"
|
|
13
|
+
>
|
|
14
|
+
<div :class="`text-bg-${bgcolor} align-items-center rounded-1 shadow-sm`">
|
|
15
|
+
<div class="d-flex">
|
|
16
|
+
<div class="toast-body">
|
|
17
|
+
{{ message }}
|
|
18
|
+
</div>
|
|
19
|
+
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</Teleport>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import Toast from "bootstrap/js/dist/toast.js";
|
|
28
|
+
import { ref } from "vue";
|
|
29
|
+
|
|
30
|
+
defineOptions({ name: "Toast", inheritAttrs: false });
|
|
31
|
+
|
|
32
|
+
interface ToastProps {
|
|
33
|
+
icon?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
defineProps<ToastProps>();
|
|
37
|
+
|
|
38
|
+
const notify = ref<HTMLElement | null>(null);
|
|
39
|
+
const message = ref("");
|
|
40
|
+
const bgcolor = ref("primary");
|
|
41
|
+
|
|
42
|
+
const toastme = (msg: string, bg: string) => {
|
|
43
|
+
message.value = msg;
|
|
44
|
+
bgcolor.value = bg;
|
|
45
|
+
if (!notify.value) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const toast = Toast.getOrCreateInstance(notify.value);
|
|
49
|
+
toast.show();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
defineExpose({ toastme });
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style lang="scss" scoped></style>
|