@niyamulahsan/create-deskapp 1.2.5 → 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 +1 -1
- 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 +2 -0
- 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
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<!-- ./src/ui/src/components/InputGroup.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div :class="topclass">
|
|
5
|
+
<div class="position-relative">
|
|
6
|
+
<label :for="inputId" class="text-capitalize d-flex align-items-center mb-1" :class="{ 'd-none': !inputLabel }">
|
|
7
|
+
<div class="position-relative">
|
|
8
|
+
<span class="text-capitalize" v-html="inputLabel"></span>
|
|
9
|
+
<span class="position-absolute text-danger rounded-circle bg-danger must" :class="{ 'd-none': !props.must }"></span>
|
|
10
|
+
</div>
|
|
11
|
+
<div :class="hoodClass" style="font-size: 12px; margin-top: 0.15rem" v-html="hoodHtml"></div>
|
|
12
|
+
</label>
|
|
13
|
+
<div class="input-group">
|
|
14
|
+
<div class="position-relative" :style="props.half ? 'width: 50%;' : 'width: 35%;'">
|
|
15
|
+
<input
|
|
16
|
+
ref="inputRef"
|
|
17
|
+
:id="inputId"
|
|
18
|
+
type="text"
|
|
19
|
+
class="form-control flex-grow-0 px-1 text-center rounded-0 rounded-start"
|
|
20
|
+
:maxlength="maxLengthAttr"
|
|
21
|
+
:value="props.modelValue"
|
|
22
|
+
v-bind="$attrs"
|
|
23
|
+
@input="updateModel"
|
|
24
|
+
>
|
|
25
|
+
<div class="position-absolute bottom-0 end-0 pe-1 text-secondary max" :class="{ 'd-none': !max }">
|
|
26
|
+
{{ maxCounter }}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<input
|
|
30
|
+
type="text"
|
|
31
|
+
class="form-control text-center border-start second-input"
|
|
32
|
+
:style="props.half ? 'width: 50%;' : 'width: 62%;'"
|
|
33
|
+
:placeholder="placeholder1"
|
|
34
|
+
:value="props.calcdata"
|
|
35
|
+
readonly
|
|
36
|
+
>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div :id="`${inputId}Help`" class="form-text text-danger" :class="{ 'd-none': !props.err }">
|
|
40
|
+
{{ props.err }}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { computed, nextTick, onMounted, ref, useAttrs } from "vue";
|
|
47
|
+
|
|
48
|
+
defineOptions({ name: "InputGroup", inheritAttrs: false });
|
|
49
|
+
|
|
50
|
+
type InputGroupCategory = "number" | "decimal" | "mobile" | string;
|
|
51
|
+
|
|
52
|
+
interface InputGroupProps {
|
|
53
|
+
focus?: boolean;
|
|
54
|
+
must?: boolean;
|
|
55
|
+
half?: boolean;
|
|
56
|
+
err?: string | boolean;
|
|
57
|
+
modelValue?: string | number;
|
|
58
|
+
category?: InputGroupCategory;
|
|
59
|
+
calcdata?: string | number;
|
|
60
|
+
hood?: string | number | boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const $attrs = useAttrs();
|
|
64
|
+
const inputRef = ref<HTMLInputElement | null>(null);
|
|
65
|
+
const props = withDefaults(defineProps<InputGroupProps>(), {
|
|
66
|
+
err: false,
|
|
67
|
+
modelValue: "",
|
|
68
|
+
calcdata: ""
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "mb-3");
|
|
72
|
+
const inputId = computed(() => ($attrs.id as string | undefined) || "");
|
|
73
|
+
const inputLabel = computed(() => ($attrs.label as string | undefined) || "");
|
|
74
|
+
const placeholder1 = computed(() => ($attrs.placeholder1 as string | undefined) || "");
|
|
75
|
+
|
|
76
|
+
const max = computed<number | null>(() => {
|
|
77
|
+
const raw = $attrs.maxlength as string | number | undefined;
|
|
78
|
+
return raw != null ? Number(raw) : null;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const maxLengthAttr = computed<number | undefined>(() => max.value ?? undefined);
|
|
82
|
+
const maxCounter = computed(() => (max.value == null ? "" : max.value - String(props.modelValue).length));
|
|
83
|
+
|
|
84
|
+
const hoodHtml = computed(() => (props.hood === false || props.hood == null ? "" : String(props.hood)));
|
|
85
|
+
const hoodClass = computed(() => [
|
|
86
|
+
"text-uppercase w-50 text-end text-primary fw-semibold",
|
|
87
|
+
props.half ? "w-50" : "w-100",
|
|
88
|
+
!props.hood && "d-none"
|
|
89
|
+
]);
|
|
90
|
+
|
|
91
|
+
const emit = defineEmits<(event: "update:modelValue", value: string | number) => void>();
|
|
92
|
+
|
|
93
|
+
const updateModel = (e: Event) => {
|
|
94
|
+
const target = e.target as HTMLInputElement;
|
|
95
|
+
|
|
96
|
+
if (props.category === "number") {
|
|
97
|
+
emit("update:modelValue", (target.value = target.value.replace(/[^\d]/gi, "")));
|
|
98
|
+
} else if (props.category === "decimal") {
|
|
99
|
+
let val = target.value;
|
|
100
|
+
val = val.replace(/[^0-9.]/g, "");
|
|
101
|
+
|
|
102
|
+
const parts = val.split(".");
|
|
103
|
+
if (parts.length > 2) {
|
|
104
|
+
val = `${parts[0]}.${parts.slice(1).join("")}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
emit("update:modelValue", (target.value = val));
|
|
108
|
+
} else if (props.category === "mobile") {
|
|
109
|
+
const digits = target.value.replace(/[^\d]/g, "");
|
|
110
|
+
let val = digits;
|
|
111
|
+
if (target.value.includes("+")) {
|
|
112
|
+
val = `+${digits}`;
|
|
113
|
+
}
|
|
114
|
+
emit("update:modelValue", (target.value = val));
|
|
115
|
+
} else {
|
|
116
|
+
emit("update:modelValue", target.value);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
onMounted(async () => {
|
|
121
|
+
const shouldFocus = props.focus !== false && props.focus !== undefined;
|
|
122
|
+
if (!shouldFocus) return;
|
|
123
|
+
|
|
124
|
+
await nextTick();
|
|
125
|
+
// preventScroll: focusing inside a modal must not scroll the modal/page
|
|
126
|
+
inputRef.value?.focus({ preventScroll: true });
|
|
127
|
+
});
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style lang="scss" scoped>
|
|
131
|
+
.must {
|
|
132
|
+
width: 4px;
|
|
133
|
+
height: 4px;
|
|
134
|
+
margin-left: 2px;
|
|
135
|
+
margin-top: 5px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.max {
|
|
139
|
+
font-size: 0.6rem;
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<!-- ./src/ui/src/components/InputPasswordToggle.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div :class="topclass">
|
|
5
|
+
<div class="position-relative">
|
|
6
|
+
<label :for="inputId" class="d-flex align-items-center" :class="{ 'd-none': !inputLabel }">
|
|
7
|
+
<div class="position-relative">
|
|
8
|
+
<span class="text-capitalize mb-1" v-html="inputLabel"></span>
|
|
9
|
+
<span class="position-absolute text-danger rounded-circle bg-danger must" :class="{ 'd-none': !props.must }"></span>
|
|
10
|
+
</div>
|
|
11
|
+
<div
|
|
12
|
+
class="text-end ms-auto text-primary align-self-center"
|
|
13
|
+
:class="{ 'd-none': !props.hood }"
|
|
14
|
+
style="font-size: 12px; margin-top: 0.15rem"
|
|
15
|
+
v-html="hoodHtml"
|
|
16
|
+
></div>
|
|
17
|
+
</label>
|
|
18
|
+
|
|
19
|
+
<div class="input-group border-0 mb-3">
|
|
20
|
+
<input
|
|
21
|
+
ref="inputRef"
|
|
22
|
+
class="form-control shadow-none"
|
|
23
|
+
:type="showPassword ? 'text' : 'password'"
|
|
24
|
+
:value="props.modelValue"
|
|
25
|
+
:maxlength="maxLengthAttr"
|
|
26
|
+
:readonly="props.readonly"
|
|
27
|
+
v-bind="$attrs"
|
|
28
|
+
@input="updateModel"
|
|
29
|
+
>
|
|
30
|
+
<button class="input-group-text p-0 position-relative z-1" type="button" @click="togglePassword">
|
|
31
|
+
<i class="py-2 px-3" :class="showPassword ? 'bi bi-eye' : 'bi bi-eye-slash'" style="font-size: 15px"></i>
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
<!-- <input class="form-control" v-model="model" :maxlength="max" v-bind="$attrs"> vue3.3 (2nd way)/3.4 -->
|
|
35
|
+
<div class="position-absolute bottom-0 end-0 pe-1 text-secondary max" :class="{ 'd-none': !max }">
|
|
36
|
+
{{ maxCounter }}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div :id="`${inputId}Help`" class="form-text mt-1 text-danger" :class="{ 'd-none': !props.err }">
|
|
40
|
+
{{ props.err }}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { computed, nextTick, onMounted, ref, useAttrs } from "vue";
|
|
47
|
+
import { browserDetect } from "@/ui/plugins/browserDetect";
|
|
48
|
+
|
|
49
|
+
defineOptions({ name: "InputPasswordToggle", inheritAttrs: false });
|
|
50
|
+
const { isFirefox } = browserDetect;
|
|
51
|
+
|
|
52
|
+
const $attrs = useAttrs();
|
|
53
|
+
const inputRef = ref<HTMLInputElement | null>(null);
|
|
54
|
+
type InputPasswordCategory = "number" | "decimal" | "mobile" | "tax-period" | "bin" | "challan-number" | string;
|
|
55
|
+
|
|
56
|
+
interface InputPasswordProps {
|
|
57
|
+
focus?: boolean;
|
|
58
|
+
must?: boolean;
|
|
59
|
+
err?: string | boolean;
|
|
60
|
+
modelValue?: string | number;
|
|
61
|
+
category?: InputPasswordCategory;
|
|
62
|
+
hood?: string | boolean | number;
|
|
63
|
+
readonly?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const props = withDefaults(defineProps<InputPasswordProps>(), {
|
|
67
|
+
err: false,
|
|
68
|
+
modelValue: ""
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "mb-3");
|
|
72
|
+
const inputId = computed(() => ($attrs.id as string | undefined) || "");
|
|
73
|
+
const inputLabel = computed(() => ($attrs.label as string | undefined) || "");
|
|
74
|
+
const inputType = computed(() => ($attrs.type as string | undefined) || "text");
|
|
75
|
+
|
|
76
|
+
const max = computed<number | null>(() => {
|
|
77
|
+
const raw = $attrs.maxlength as string | number | undefined;
|
|
78
|
+
return raw != null ? Number(raw) : null;
|
|
79
|
+
});
|
|
80
|
+
const maxLengthAttr = computed<number | undefined>(() => max.value ?? undefined);
|
|
81
|
+
|
|
82
|
+
const hoodHtml = computed(() => (props.hood === false || props.hood == null ? "" : String(props.hood)));
|
|
83
|
+
|
|
84
|
+
const maxCounter = computed(() => {
|
|
85
|
+
if (max.value == null) {
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!isFirefox && inputType.value === "month") {
|
|
90
|
+
return "";
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return max.value - String(props.modelValue).length;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const emit = defineEmits<(event: "update:modelValue", value: string | number) => void>();
|
|
97
|
+
const updateModel = (e: Event) => {
|
|
98
|
+
const target = e.target as HTMLInputElement;
|
|
99
|
+
|
|
100
|
+
if (props.category === "number") {
|
|
101
|
+
emit("update:modelValue", (target.value = target.value.replace(/[^\d]/gi, "")));
|
|
102
|
+
} else if (props.category === "decimal") {
|
|
103
|
+
let val = target.value.replace(/[^\d.]/g, "");
|
|
104
|
+
const parts = val.split(".");
|
|
105
|
+
val = parts[0];
|
|
106
|
+
if (parts.length > 1) {
|
|
107
|
+
val += `.${parts.slice(1).join("")}`;
|
|
108
|
+
}
|
|
109
|
+
emit("update:modelValue", (target.value = val));
|
|
110
|
+
} else if (props.category === "mobile") {
|
|
111
|
+
let digits = target.value.replace(/[^\d]/g, ""); // only digits
|
|
112
|
+
let val = digits;
|
|
113
|
+
if (target.value.includes("+")) {
|
|
114
|
+
val = `+${digits}`;
|
|
115
|
+
}
|
|
116
|
+
emit("update:modelValue", (target.value = val));
|
|
117
|
+
} else if (props.category === "tax-period") {
|
|
118
|
+
let val = target.value.replace(/[^\d-]/g, ""); // Only numbers and hyphen
|
|
119
|
+
val = val.replace(/-/g, ""); // Remove all hyphens
|
|
120
|
+
val = val.slice(0, 6); // Only 6 digits (YYYYMM)
|
|
121
|
+
|
|
122
|
+
if (val.length > 4) {
|
|
123
|
+
let year = val.slice(0, 4);
|
|
124
|
+
let month = val.slice(4, 6);
|
|
125
|
+
|
|
126
|
+
// Only correct if both month digits entered
|
|
127
|
+
if (month.length === 2) {
|
|
128
|
+
let m = parseInt(month, 10);
|
|
129
|
+
// Clamp month between 1 and 12
|
|
130
|
+
if (m < 1) m = 1;
|
|
131
|
+
if (m > 12) m = 12;
|
|
132
|
+
// Always pad to 2 digits
|
|
133
|
+
month = m.toString().padStart(2, "0");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
val = `${year}-${month}`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
emit("update:modelValue", (target.value = val));
|
|
140
|
+
} else if (props.category === "bin") {
|
|
141
|
+
let digits = target.value.replace(/[^\d]/g, "");
|
|
142
|
+
digits = digits.slice(0, 14);
|
|
143
|
+
let formatted = digits;
|
|
144
|
+
if (digits.length > 9) {
|
|
145
|
+
formatted = `${digits.slice(0, 9)}-${digits.slice(9, 14)}`;
|
|
146
|
+
}
|
|
147
|
+
emit("update:modelValue", (target.value = formatted));
|
|
148
|
+
} else if (props.category === "challan-number") {
|
|
149
|
+
let digits = target.value.replace(/[^\d]/g, "");
|
|
150
|
+
digits = digits.slice(0, 16);
|
|
151
|
+
let formatted = digits;
|
|
152
|
+
if (digits.length > 4) {
|
|
153
|
+
formatted = `${digits.slice(0, 4)}-${digits.slice(4, 16)}`;
|
|
154
|
+
}
|
|
155
|
+
emit("update:modelValue", (target.value = formatted));
|
|
156
|
+
} else {
|
|
157
|
+
emit("update:modelValue", target.value);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const showPassword = ref(false);
|
|
162
|
+
const togglePassword = () => (showPassword.value = !showPassword.value);
|
|
163
|
+
|
|
164
|
+
onMounted(async () => {
|
|
165
|
+
const shouldFocus = props.focus !== false && props.focus !== undefined;
|
|
166
|
+
if (!shouldFocus) return;
|
|
167
|
+
|
|
168
|
+
await nextTick();
|
|
169
|
+
// preventScroll: focusing inside a modal must not scroll the modal/page
|
|
170
|
+
inputRef.value?.focus({ preventScroll: true });
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
<style lang="scss" scoped>
|
|
175
|
+
input {
|
|
176
|
+
&:read-only {
|
|
177
|
+
background-color: #f8f8f8;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&::placeholder {
|
|
181
|
+
color: #bfbfbf;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
button:focus-visible {
|
|
186
|
+
border: none;
|
|
187
|
+
box-shadow: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.form-text {
|
|
191
|
+
font-size: 0.75rem;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.must {
|
|
195
|
+
width: 4px;
|
|
196
|
+
height: 4px;
|
|
197
|
+
margin-left: 2px;
|
|
198
|
+
margin-top: 5px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.max {
|
|
202
|
+
font-size: 0.6rem;
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -1,55 +1,65 @@
|
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
title
|
|
42
|
-
size
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
<!-- ./src/ui/src/components/Modal.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<Teleport to="#modal-show">
|
|
5
|
+
<div
|
|
6
|
+
:id="props.id"
|
|
7
|
+
ref="modal"
|
|
8
|
+
class="modal fade"
|
|
9
|
+
data-bs-backdrop="static"
|
|
10
|
+
data-bs-keyboard="false"
|
|
11
|
+
tabindex="-1"
|
|
12
|
+
:aria-labelledby="`${props.id}Label`"
|
|
13
|
+
>
|
|
14
|
+
<div :class="`modal-dialog modal-dialog-centered modal-dialog-scrollable modal-${props.size}`">
|
|
15
|
+
<div class="modal-content border">
|
|
16
|
+
<div class="modal-header">
|
|
17
|
+
<div class="d-flex w-100 justify-content-between align-items-center">
|
|
18
|
+
<h5 id="modalScrollableTitle" class="modal-title me-3">{{ props.title }}</h5>
|
|
19
|
+
<button ref="closeButton" type="button" class="btn-close shadow-none" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
20
|
+
<slot name="modal-header-extra"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="modal-body">
|
|
24
|
+
<slot name="modalbody"></slot>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="modal-footer py-2">
|
|
27
|
+
<slot name="modalfooter"></slot>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</Teleport>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { Modal } from "bootstrap";
|
|
37
|
+
import { onMounted, ref } from "vue";
|
|
38
|
+
|
|
39
|
+
interface ModalProps {
|
|
40
|
+
id: string;
|
|
41
|
+
title?: string;
|
|
42
|
+
size?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const props = withDefaults(defineProps<ModalProps>(), {
|
|
46
|
+
title: "",
|
|
47
|
+
size: "md"
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const modal = ref<HTMLElement | null>(null);
|
|
51
|
+
let bsModal: Modal | null = null;
|
|
52
|
+
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
if (modal.value) {
|
|
55
|
+
bsModal = new Modal(modal.value);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const open = () => bsModal?.show();
|
|
60
|
+
const close = () => bsModal?.hide();
|
|
61
|
+
|
|
62
|
+
defineExpose({ open, close });
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style lang="scss" scoped></style>
|
|
@@ -1,42 +1,44 @@
|
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
<!-- ./src/ui/src/components/Spinner.vue -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div class="h-100" v-bind="$attrs">
|
|
5
|
+
<div class="h-100 d-flex align-items-center justify-content-center">
|
|
6
|
+
<div class="spinner-grow" :style="spinnerStyle" role="status">
|
|
7
|
+
<span class="visually-hidden">Loading...</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="fw-bold ms-2">
|
|
10
|
+
<span v-if="props.text" :class="props.textsize" :style="textStyle">
|
|
11
|
+
{{ props.text }}
|
|
12
|
+
</span>
|
|
13
|
+
<span v-else>Loading...</span>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { computed } from "vue";
|
|
21
|
+
|
|
22
|
+
defineOptions({ name: "Spinner", inheritAttrs: false });
|
|
23
|
+
|
|
24
|
+
interface SpinnerProps {
|
|
25
|
+
size?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
textsize?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const props = withDefaults(defineProps<SpinnerProps>(), {
|
|
31
|
+
size: "3rem",
|
|
32
|
+
text: "",
|
|
33
|
+
textsize: ""
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const spinnerStyle = computed(() => ({
|
|
37
|
+
width: props.size,
|
|
38
|
+
height: props.size
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
const textStyle = computed(() => ({
|
|
42
|
+
fontSize: props.textsize || undefined
|
|
43
|
+
}));
|
|
44
|
+
</script>
|