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