@simitgroup/simpleapp-generator 1.6.3-alpha → 1.6.4-b-alpha
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/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +1 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/changehistories.d.ts +3 -0
- package/dist/buildinschemas/changehistories.d.ts.map +1 -0
- package/dist/buildinschemas/changehistories.js +36 -0
- package/dist/buildinschemas/changehistories.js.map +1 -0
- package/dist/buildinschemas/index.d.ts +1 -0
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +3 -1
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/organization.js +2 -2
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +5 -1
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/buildinschemas/webhook.d.ts +3 -0
- package/dist/buildinschemas/webhook.d.ts.map +1 -0
- package/dist/buildinschemas/webhook.js +33 -0
- package/dist/buildinschemas/webhook.js.map +1 -0
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +3 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +30 -11
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +10 -2
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/type.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/branch.ts +1 -0
- package/src/buildinschemas/changehistories.ts +33 -0
- package/src/buildinschemas/index.ts +2 -1
- package/src/buildinschemas/organization.ts +2 -2
- package/src/buildinschemas/user.ts +5 -1
- package/src/buildinschemas/webhook.ts +31 -0
- package/src/framework.ts +3 -2
- package/src/generate.ts +35 -15
- package/src/processors/jsonschemabuilder.ts +10 -2
- package/src/type.ts +2 -0
- package/templates/basic/nest/controller.ts.eta +24 -3
- package/templates/basic/nest/model.ts.eta +9 -1
- package/templates/basic/nest/resolver.ts.eta +2 -2
- package/templates/basic/nuxt/pages.[id].vue.eta +7 -7
- package/templates/basic/nuxt/pages.form.vue.eta +1 -4
- package/templates/basic/nuxt/pages.landing.vue.eta +1 -20
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +8 -1
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +2 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +9 -2
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +21 -8
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +5 -10
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +1 -0
- package/templates/nest/src/simpleapp/generate/commons/runwebhook.service.ts.eta +50 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +22 -8
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +9 -1
- package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +12 -6
- package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +7 -12
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +133 -28
- package/templates/nest/src/simpleapp/generate/types/schema.type.ts.eta +3 -1
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +1 -0
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +19 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +33 -8
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +15 -9
- package/templates/nuxt/assets/css/calendar.css._eta +3 -0
- package/templates/nuxt/assets/css/style.css._eta +1 -1
- package/templates/nuxt/assets/images/unknown.png.eta +0 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +6 -1
- package/templates/nuxt/components/button/ButtonAction.vue._eta +40 -39
- package/templates/nuxt/components/button/ButtonDanger.vue._eta +11 -3
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +11 -3
- package/templates/nuxt/components/button/ButtonPrimary.vue._eta +9 -3
- package/templates/nuxt/components/button/ButtonSecondary.vue._eta +33 -0
- package/templates/nuxt/components/button/ButtonText.vue._eta +9 -5
- package/templates/nuxt/components/button/ButtonWarning.vue._eta +11 -3
- package/templates/nuxt/components/calendar/CalendarInput.vue.eta +4 -3
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +76 -52
- package/templates/nuxt/components/chart/card.vue._eta +1 -1
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +36 -26
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +35 -13
- package/templates/nuxt/components/form/FormBranch.vue._eta +52 -5
- package/templates/nuxt/components/form/FormDocnoformat.vue.eta +14 -10
- package/templates/nuxt/components/form/FormUser.vue._eta +2 -4
- package/templates/nuxt/components/form/user/FormUserPermission.vue.eta +77 -59
- package/templates/nuxt/components/header/HeaderSelectBranch.vue.eta +42 -35
- package/templates/nuxt/components/image/ImageAvatar.vue.eta._vue +30 -0
- package/templates/nuxt/components/image/ImageOrganization.vue.eta.vue +34 -14
- package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta.vue +67 -50
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +20 -12
- package/templates/nuxt/components/list/ListView.vue.eta +64 -35
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +5 -4
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +8 -8
- package/templates/nuxt/components/page/PageDocList.vue.eta +36 -13
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +8 -2
- package/templates/nuxt/components/renderer/RendererDateTime.vue.eta +7 -1
- package/templates/nuxt/components/renderer/RendererDocHistories.vue.eta +56 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +14 -8
- package/templates/nuxt/components/renderer/RendererLink.vue.eta +7 -4
- package/templates/nuxt/components/renderer/RendererMoney.vue.eta +25 -17
- package/templates/nuxt/components/renderer/RendererTime.vue.eta +7 -1
- package/templates/nuxt/components/renderer/RendererViewer.vue.eta +19 -9
- package/templates/nuxt/components/select/SelectTemplate.vue.eta +53 -22
- package/templates/nuxt/components/session/SessionBlock.vue.eta +44 -46
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +25 -16
- package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +60 -0
- package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +16 -8
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +8 -8
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +114 -38
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +89 -168
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +44 -40
- package/templates/nuxt/components/simpleApp/SimpleAppUserPicker.vue.eta +387 -0
- package/templates/nuxt/components/text/TextDocStatus.vue._eta +22 -0
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +13 -15
- package/templates/nuxt/components/user/UserButtonPermissionInfo.vue.eta +138 -95
- package/templates/nuxt/components/user/UserInvitation.vue.eta +53 -45
- package/templates/nuxt/components/user/UserTenantPicker.vue.eta +32 -71
- package/templates/nuxt/composables/date.generate.ts.eta +105 -8
- package/templates/nuxt/composables/getDocument.generate.ts.eta +8 -6
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +58 -10
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +39 -6
- package/templates/nuxt/composables/goTo.generate.ts.eta +14 -1
- package/templates/nuxt/composables/graphquery.generate.ts.eta +20 -2
- package/templates/nuxt/composables/recently.generate.ts.eta +16 -0
- package/templates/nuxt/composables/roles.generate.ts.eta +9 -13
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +52 -0
- package/templates/nuxt/composables/sysmessage.generate.ts.eta +1 -1
- package/templates/nuxt/error.vue._eta +4 -2
- package/templates/nuxt/pages/[xorg]/{organization.vue.eta → organization.vue._eta} +38 -9
- package/templates/nuxt/pages/[xorg]/user.vue.eta +12 -9
- package/templates/nuxt/pages/login.vue._eta +4 -1
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +54 -26
- package/templates/nuxt/plugins/70.recently.ts.eta +55 -0
- package/templates/nuxt/providers/my-provider.ts.eta +22 -0
- package/templates/nuxt/server/api/[xorg]/{[...].ts.eta → [...].ts._eta} +47 -21
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +44 -3
- package/templates/nuxt/types/events.ts.eta +3 -2
- package/templates/nuxt/types/others.ts.eta +11 -1
- package/templates/nuxt/types/schema.ts.eta +3 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +1 -1
- package/templates/nuxt/types/user.ts.eta +8 -7
- package/templates/project/jsonschemas/branch.json._eta +1 -0
- package/templates/project/jsonschemas/invoice.json._eta +4 -3
- package/templates/project/jsonschemas/organization.json._eta +2 -2
- package/templates/project/lang/default._json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta.vue +0 -38
- /package/templates/nuxt/pages/[xorg]/mobile/docnoformat/{index.vue.eta → index.vue.etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/{index.vue._eta → index.vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/organization/{[id].vue._eta → [id].vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/{pickgroup.vue._eta → pickgroup.vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/user/{index.vue.eta → index.vue.etaxxx} +0 -0
|
@@ -10,7 +10,7 @@ import {DocNumberFormatGenerator} from './generate/commons/docnogenerator.servic
|
|
|
10
10
|
import { AuditTrail } from './generate/commons/audittrail.service';
|
|
11
11
|
import { CloudapiModule } from 'src/cloudapi/cloudapi.module';
|
|
12
12
|
import { PrintapiModule } from 'src/printapi/printapi.module';
|
|
13
|
-
|
|
13
|
+
import { RunWebhookService } from 'src/simpleapp/generate/commons/runwebhook.service'
|
|
14
14
|
import { UserResolverService } from './services/userresolver.service';
|
|
15
15
|
// auto import modules
|
|
16
16
|
<% for(let i=0;i<it.modules.length; i++){ %>
|
|
@@ -22,11 +22,11 @@ import { <%= obj.docname %>MongoSchema } from './generate/models/<%= obj.doctype
|
|
|
22
22
|
<%}%>
|
|
23
23
|
import { ProfileController } from './profile/profile.controller';
|
|
24
24
|
import { ProfileService } from './profile/profile.service';
|
|
25
|
-
import { WorkflowController } from './generate/workflow/workflow.controller';
|
|
26
|
-
import { WorkflowDelegate } from './generate/workflow/workflow.delegate';
|
|
27
|
-
import { WorkflowConfig } from './generate/workflow/workflow.config';
|
|
28
|
-
import { WorkflowService } from './generate/workflow/workflow.service';
|
|
29
|
-
import { WorkflowUserService } from './generate/workflow/workflow.userservice';
|
|
25
|
+
//import { WorkflowController } from './generate/workflow/workflow.controller';
|
|
26
|
+
//import { WorkflowDelegate } from './generate/workflow/workflow.delegate';
|
|
27
|
+
//import { WorkflowConfig } from './generate/workflow/workflow.config';
|
|
28
|
+
//import { WorkflowService } from './generate/workflow/workflow.service';
|
|
29
|
+
//import { WorkflowUserService } from './generate/workflow/workflow.userservice';
|
|
30
30
|
import { SimpleAppRobotUserService } from './generate/commons/robotuser.service';
|
|
31
31
|
<%for(let i=0; i<it.allbpmn.length;i++){%>
|
|
32
32
|
<%let bpmn = it.allbpmn[i]%>
|
|
@@ -50,13 +50,17 @@ import { <%=capitalizeFirstLetter(bpmn)%>ListenerService } from 'src/simpleapp/w
|
|
|
50
50
|
<%}%>
|
|
51
51
|
]),
|
|
52
52
|
],
|
|
53
|
-
controllers: [<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Controller,<%}%> ProfileController,
|
|
53
|
+
controllers: [<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Controller,<%}%> ProfileController,
|
|
54
|
+
//WorkflowController
|
|
55
|
+
],
|
|
54
56
|
providers: [
|
|
55
57
|
SimpleAppRobotUserService,
|
|
58
|
+
RunWebhookService,
|
|
56
59
|
AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %>
|
|
57
60
|
<%= it.modules[i].docname %>Service,
|
|
58
61
|
<%= it.modules[i].docname %>Resolver,
|
|
59
|
-
<%}%> ProfileService,
|
|
62
|
+
<%}%> ProfileService,
|
|
63
|
+
//WorkflowDelegate,WorkflowConfig,WorkflowService,WorkflowUserService,
|
|
60
64
|
<%for(let i=0; i<it.allbpmn.length;i++){%>
|
|
61
65
|
<%let bpmn = it.allbpmn[i]%>
|
|
62
66
|
<%=capitalizeFirstLetter(bpmn)%>ListenerService,
|
|
@@ -65,6 +69,8 @@ import { <%=capitalizeFirstLetter(bpmn)%>ListenerService } from 'src/simpleapp/w
|
|
|
65
69
|
exports:[SimpleAppRobotUserService,AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %>
|
|
66
70
|
<%= it.modules[i].docname %>Service,
|
|
67
71
|
<%= it.modules[i].docname %>Resolver,
|
|
68
|
-
<%}%> ProfileService,
|
|
72
|
+
<%}%> ProfileService,
|
|
73
|
+
//WorkflowDelegate,WorkflowConfig,WorkflowService,WorkflowUserService,
|
|
74
|
+
UserResolverService,]
|
|
69
75
|
})
|
|
70
76
|
export class GenerateModule {}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@apply bg-gray-100 dark:bg-slate-800 dark:text-gray-300
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
[disabled=true],input[disabled] ,input[readonly] ,textarea[readonly]{
|
|
12
|
+
[disabled=true],input[disabled] ,input[readonly] ,textarea[readonly], .p-dropdown[readonly]{
|
|
13
13
|
@apply bg-gray-300 dark:bg-gray-600
|
|
14
14
|
}
|
|
15
15
|
|
|
Binary file
|
|
@@ -24,7 +24,12 @@ const CustomTailwind = usePassThrough(
|
|
|
24
24
|
root:{class:'bg-white dark:bg-gray-800 shadow p-2 rounded-2xl'},
|
|
25
25
|
// title:{class:''},
|
|
26
26
|
// header:{class:''}
|
|
27
|
-
},
|
|
27
|
+
},
|
|
28
|
+
fieldset:{
|
|
29
|
+
root:{class:'border p-2 mt-1'},
|
|
30
|
+
legend:{class:''},
|
|
31
|
+
content:{class:'p-2'}
|
|
32
|
+
},
|
|
28
33
|
// tabview:{
|
|
29
34
|
// tabpanel:{
|
|
30
35
|
// headeraction:{class:'p-tabview-nav-link p-tabview-header-action items-center cursor-pointer flex overflow-hidden relative select-none text-decoration-none select-none border-b-2 p-5 font-bold rounded-t-md transition-shadow duration-200 m-0 transition-colors duration-200 bg-white border-blue-500 text-blue-500 dark:bg-gray-600 dark:border-blue-300 dark:text-blue-300'}
|
|
@@ -1,66 +1,67 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ButtonDefault v-if="!actionName" :animate="animate">
|
|
3
|
-
<i :class="getIcon()"/><slot></slot>def</ButtonDefault
|
|
3
|
+
<i :class="getIcon()" /><slot></slot>def</ButtonDefault
|
|
4
4
|
>
|
|
5
5
|
<ButtonPrimary
|
|
6
|
-
v-else-if="['create', 'update','confirm'].includes(actionName)"
|
|
6
|
+
v-else-if="['create', 'update', 'confirm'].includes(actionName)"
|
|
7
7
|
:animate="animate"
|
|
8
|
-
|
|
9
|
-
<i :class="getIcon()"/>
|
|
8
|
+
>
|
|
9
|
+
<i :class="getIcon()" />
|
|
10
10
|
<slot></slot
|
|
11
11
|
></ButtonPrimary>
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
<ButtonDanger
|
|
14
14
|
v-else-if="['delete', 'void'].includes(actionName)"
|
|
15
15
|
:animate="animate"
|
|
16
|
-
|
|
17
|
-
<i :class="getIcon()"/>
|
|
16
|
+
>
|
|
17
|
+
<i :class="getIcon()" />
|
|
18
18
|
<slot></slot>
|
|
19
19
|
</ButtonDanger>
|
|
20
20
|
<ButtonWarning v-else-if="['draft'].includes(actionName)" :animate="animate">
|
|
21
|
-
<i :class="getIcon()"/>
|
|
21
|
+
<i :class="getIcon()" />
|
|
22
22
|
<slot></slot>
|
|
23
|
-
</ButtonWarning>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
</ButtonWarning>
|
|
24
|
+
<ButtonSecondary v-else-if="actionName == 'print'">
|
|
25
|
+
<i :class="getIcon()" />
|
|
26
|
+
<slot></slot
|
|
27
|
+
></ButtonSecondary>
|
|
28
|
+
<ButtonDefault v-else :animate="animate">
|
|
29
|
+
<i :class="getIcon()" />
|
|
29
30
|
<slot></slot
|
|
30
31
|
></ButtonDefault>
|
|
31
32
|
</template>
|
|
32
33
|
<script setup lang="ts">
|
|
33
34
|
/**
|
|
34
35
|
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
36
|
+
* --remove-this-line-to-prevent-override--
|
|
35
37
|
* last change 2024-03-01
|
|
36
38
|
* author: Ks Tan
|
|
37
39
|
*/
|
|
38
40
|
|
|
39
41
|
const props = defineProps<{ actionName?: string; animate?: boolean }>();
|
|
40
|
-
const getIcon = ()=>{
|
|
41
|
-
let cssname=
|
|
42
|
-
switch(props.actionName){
|
|
43
|
-
case
|
|
44
|
-
case
|
|
45
|
-
cssname+=
|
|
46
|
-
|
|
47
|
-
case
|
|
48
|
-
cssname+=
|
|
49
|
-
|
|
50
|
-
case
|
|
51
|
-
cssname+=
|
|
52
|
-
|
|
53
|
-
case
|
|
54
|
-
cssname+=
|
|
55
|
-
|
|
56
|
-
case
|
|
57
|
-
cssname+=
|
|
58
|
-
|
|
59
|
-
case
|
|
60
|
-
cssname+=
|
|
61
|
-
|
|
42
|
+
const getIcon = () => {
|
|
43
|
+
let cssname = "mr-1 pi ";
|
|
44
|
+
switch (props.actionName) {
|
|
45
|
+
case "create":
|
|
46
|
+
case "update":
|
|
47
|
+
cssname += "pi-save";
|
|
48
|
+
break;
|
|
49
|
+
case "delete":
|
|
50
|
+
cssname += "pi-trash";
|
|
51
|
+
break;
|
|
52
|
+
case "print":
|
|
53
|
+
cssname += "pi-file-pdf";
|
|
54
|
+
break;
|
|
55
|
+
case "confirm":
|
|
56
|
+
cssname += "pi-check";
|
|
57
|
+
break;
|
|
58
|
+
case "void":
|
|
59
|
+
cssname += "pi-file-excel";
|
|
60
|
+
break;
|
|
61
|
+
case "draft":
|
|
62
|
+
cssname += "pi-file-edit";
|
|
63
|
+
break;
|
|
62
64
|
}
|
|
63
|
-
return cssname
|
|
64
|
-
}
|
|
65
|
-
|
|
65
|
+
return cssname;
|
|
66
|
+
};
|
|
66
67
|
</script>
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
|
-
|
|
4
|
+
severity="danger"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
5
8
|
@click="onActivate"
|
|
6
9
|
>
|
|
7
10
|
<slot></slot>
|
|
8
11
|
</Button>
|
|
9
|
-
<Button
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="danger"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
10
18
|
<slot></slot>
|
|
11
19
|
</Button>
|
|
12
20
|
</template>
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
* author: Ks Tan
|
|
19
27
|
*/
|
|
20
28
|
const emits = defineEmits(["click"]);
|
|
21
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
22
30
|
const onActivate = (e: Event) => {
|
|
23
31
|
emits("click", e);
|
|
24
32
|
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
|
-
|
|
4
|
+
severity="secondary"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
5
8
|
@click="onActivate"
|
|
6
9
|
>
|
|
7
10
|
<slot></slot>
|
|
8
11
|
</Button>
|
|
9
|
-
<Button
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="secondary"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
10
18
|
<slot></slot>
|
|
11
19
|
</Button>
|
|
12
20
|
</template>
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
* author: Ks Tan
|
|
19
27
|
*/
|
|
20
28
|
const emits = defineEmits(["click"]);
|
|
21
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
22
30
|
const onActivate = (e: Event) => {
|
|
23
31
|
emits("click", e);
|
|
24
32
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
|
-
:class="`w-full rounded-full text-center block dark:bg-primary-600 bg-primary-600 active:dark:bg-primary-400 text-white ${
|
|
4
|
+
:class="`w-full rounded-full text-center block dark:bg-primary-600 bg-primary-600 active:dark:bg-primary-400 text-white ${
|
|
5
|
+
animate ? 'animate-bounce' : ''
|
|
6
|
+
}`"
|
|
5
7
|
@click="onActivate"
|
|
6
8
|
>
|
|
7
9
|
<slot></slot>
|
|
8
10
|
</Button>
|
|
9
|
-
<Button
|
|
11
|
+
<Button
|
|
12
|
+
v-else
|
|
13
|
+
:class="`btn-primary ${animate ? 'animate-bounce' : ''}`"
|
|
14
|
+
@click="onActivate"
|
|
15
|
+
>
|
|
10
16
|
<slot></slot>
|
|
11
17
|
</Button>
|
|
12
18
|
</template>
|
|
@@ -18,7 +24,7 @@
|
|
|
18
24
|
* author: Ks Tan
|
|
19
25
|
*/
|
|
20
26
|
const emits = defineEmits(["click"]);
|
|
21
|
-
const props = defineProps<{animate?:boolean}>()
|
|
27
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
22
28
|
const onActivate = (e: Event) => {
|
|
23
29
|
emits("click", e);
|
|
24
30
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Button
|
|
3
|
+
v-if="isMobile()"
|
|
4
|
+
severity="info"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
8
|
+
@click="onActivate"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</Button>
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="info"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</Button>
|
|
20
|
+
</template>
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
/**
|
|
23
|
+
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
24
|
+
* --remove-this-line-to-prevent-override--
|
|
25
|
+
* last change 2024-02-22
|
|
26
|
+
* author: Ks Tan
|
|
27
|
+
*/
|
|
28
|
+
const emits = defineEmits(["click"]);
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
30
|
+
const onActivate = (e: Event) => {
|
|
31
|
+
emits("click", e);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
4
|
@click="onActivate"
|
|
5
|
-
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
5
|
+
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
6
8
|
>
|
|
7
9
|
<slot></slot>
|
|
8
10
|
</Button>
|
|
9
|
-
<
|
|
11
|
+
<div
|
|
10
12
|
v-else
|
|
11
13
|
@click="onActivate"
|
|
12
|
-
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
14
|
+
:class="`cursor-pointer p-3 border-none text-center dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
15
|
+
animate ? 'animate-bounce' : ''
|
|
16
|
+
}`"
|
|
13
17
|
>
|
|
14
18
|
<slot></slot>
|
|
15
|
-
</
|
|
19
|
+
</div>
|
|
16
20
|
</template>
|
|
17
21
|
<script setup lang="ts">
|
|
18
22
|
/**
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
* author: Ks Tan
|
|
23
27
|
*/
|
|
24
28
|
const emits = defineEmits(["click"]);
|
|
25
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
26
30
|
let stopawhile = false;
|
|
27
31
|
const onActivate = (e: Event) => {
|
|
28
32
|
emits("click", e);
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
|
-
|
|
4
|
+
severity="warning"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
5
8
|
@click="onActivate"
|
|
6
9
|
>
|
|
7
10
|
<slot></slot>
|
|
8
11
|
</Button>
|
|
9
|
-
<Button
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="warning"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
10
18
|
<slot></slot>
|
|
11
19
|
</Button>
|
|
12
20
|
</template>
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
* author: Ks Tan
|
|
19
27
|
*/
|
|
20
28
|
const emits = defineEmits(["click"]);
|
|
21
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
22
30
|
const onActivate = (e: Event) => {
|
|
23
31
|
emits("click", e);
|
|
24
32
|
};
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
class="w-full"
|
|
7
7
|
:inputid="inputid"
|
|
8
8
|
:date-format="getPrimevueCalendarDateFormat()"
|
|
9
|
-
@update:modelValue="emits('change',modelValue)"
|
|
10
|
-
|
|
9
|
+
@update:modelValue="emits('change', modelValue)"
|
|
10
|
+
showButtonBar
|
|
11
|
+
/>
|
|
11
12
|
</div>
|
|
12
13
|
</template>
|
|
13
14
|
<script setup lang="ts">
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
*/
|
|
20
21
|
const modelValue = defineModel<Date>({ required: true });
|
|
21
22
|
const inputid = randomUUID();
|
|
22
|
-
const emits = defineEmits([
|
|
23
|
+
const emits = defineEmits(["change"]);
|
|
23
24
|
const props = defineProps<{
|
|
24
25
|
label?: string;
|
|
25
26
|
}>();
|
|
@@ -1,50 +1,56 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<template #cell-content="{ cell, events }">
|
|
25
|
-
<div>
|
|
26
|
-
<div>
|
|
27
|
-
<s
|
|
28
|
-
v-if="dateExists(new Date(cell.formattedDate), alloffdays)"
|
|
29
|
-
v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
30
|
-
class="text text-red-400 font-bold"
|
|
31
|
-
>{{ cell.content }}</s
|
|
32
|
-
>
|
|
33
|
-
<span v-else>{{ cell.content }} </span>
|
|
34
|
-
</div>
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<VueCal
|
|
4
|
+
:id="id"
|
|
5
|
+
class="w-full"
|
|
6
|
+
hide-view-selector
|
|
7
|
+
click-to-navigate
|
|
8
|
+
:time="false"
|
|
9
|
+
today-button
|
|
10
|
+
active-view="month"
|
|
11
|
+
:disable-views="['week', 'day']"
|
|
12
|
+
:selected-date="selectedDate"
|
|
13
|
+
events-count-on-year-view
|
|
14
|
+
@view-change="viewChange"
|
|
15
|
+
:events="allevents"
|
|
16
|
+
@cell-focus="chooseDate"
|
|
17
|
+
xsmall
|
|
18
|
+
>
|
|
19
|
+
<template #today-button>
|
|
20
|
+
<!-- Using Vuetify (but we prefer Wave UI 🤘) -->
|
|
21
|
+
<div @click="chooseDate(new Date(), true)">{{ t("today") }}</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template #cell-content="{ cell, events }">
|
|
35
24
|
<div>
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
v-if="
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
<div>
|
|
26
|
+
<s
|
|
27
|
+
v-if="isHoliday(cell.formattedDate)"
|
|
28
|
+
v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
29
|
+
class="text text-red-400 dark:text-red-400 font-bold"
|
|
30
|
+
>{{ cell.content }}</s
|
|
31
|
+
>
|
|
32
|
+
<div v-else-if="isOffDay(cell)" class="text-gray-400">
|
|
33
|
+
<s v-tooltip="t('offDay')">{{ cell.content }}</s>
|
|
34
|
+
</div>
|
|
35
|
+
<span v-else>{{ cell.content }} </span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div>
|
|
39
|
+
<slot name="default" :cell="cell" :events="events">
|
|
40
|
+
<Badge
|
|
41
|
+
v-if="events.length > 0"
|
|
42
|
+
@contextmenu="
|
|
43
|
+
(mouseevent) => onRightClickDate(mouseevent, cell)
|
|
44
|
+
"
|
|
45
|
+
severity="info"
|
|
46
|
+
:value="events.length"
|
|
47
|
+
/>
|
|
48
|
+
</slot>
|
|
49
|
+
</div>
|
|
44
50
|
</div>
|
|
45
|
-
</
|
|
46
|
-
</
|
|
47
|
-
</
|
|
51
|
+
</template>
|
|
52
|
+
</VueCal>
|
|
53
|
+
</ClientOnly>
|
|
48
54
|
</template>
|
|
49
55
|
<script lang="ts" setup generic="T">
|
|
50
56
|
/**
|
|
@@ -66,24 +72,25 @@ const viewStatus = ref<CalViewChange>();
|
|
|
66
72
|
const props = defineProps<{
|
|
67
73
|
id: string;
|
|
68
74
|
items: CalEventType<T>[];
|
|
69
|
-
|
|
75
|
+
holidays: OffDay[];
|
|
70
76
|
}>();
|
|
71
|
-
const
|
|
72
|
-
const
|
|
77
|
+
const offdays = ref<string[]>([]);
|
|
78
|
+
const emits = defineEmits(["chooseDate", "rightClick","viewChange"]);
|
|
79
|
+
// const allholidays = computed(() => props.holidays.map((item) => item.date));
|
|
73
80
|
const selectedDate = defineModel<Date>({ required: true });
|
|
74
81
|
const getHolidayName = (date: Date) =>
|
|
75
|
-
props.
|
|
82
|
+
props.holidays.find((item) => item.date.getTime() == date.getTime())?.title;
|
|
76
83
|
const allevents = computed(() => {
|
|
77
84
|
const list = props.items.map((item) => {
|
|
78
85
|
if (item.start instanceof Date)
|
|
79
86
|
item.start = item.start.format("YYYY-MM-DD HH:mm");
|
|
80
|
-
else if (typeof item.start ==
|
|
81
|
-
item.start = item.start.substring(0,16).replace(
|
|
87
|
+
else if (typeof item.start == "string") {
|
|
88
|
+
item.start = item.start.substring(0, 16).replace("T", " ");
|
|
82
89
|
}
|
|
83
90
|
if (item.end instanceof Date)
|
|
84
91
|
item.end = item.end.format("YYYY-MM-DD HH:mm");
|
|
85
|
-
else if (typeof item.end ==
|
|
86
|
-
item.end = item.end.substring(0,16).replace(
|
|
92
|
+
else if (typeof item.end == "string") {
|
|
93
|
+
item.end = item.end.substring(0, 16).replace("T", " ");
|
|
87
94
|
}
|
|
88
95
|
return item;
|
|
89
96
|
});
|
|
@@ -91,8 +98,21 @@ const allevents = computed(() => {
|
|
|
91
98
|
});
|
|
92
99
|
const viewChange = (event: CalViewChange) => {
|
|
93
100
|
viewStatus.value = event;
|
|
101
|
+
emits('viewChange',event)
|
|
94
102
|
};
|
|
95
103
|
|
|
104
|
+
const isHoliday = (datestr: string) => {
|
|
105
|
+
return props.holidays.find(
|
|
106
|
+
(item) => item.date.format("YYYY-MM-DD") == datestr,
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
const isOffDay = (cell: any) => {
|
|
110
|
+
const dayname: string = new Date(cell.formattedDate)
|
|
111
|
+
.toLocaleString("en", { weekday: "short" })
|
|
112
|
+
.toLowerCase();
|
|
113
|
+
if (offdays.value.includes(dayname)) return true;
|
|
114
|
+
else return false;
|
|
115
|
+
};
|
|
96
116
|
const chooseDate = (date1: Date, force?: boolean) => {
|
|
97
117
|
if (force || !viewStatus.value || viewStatus.value.view == "month") {
|
|
98
118
|
selectedDate.value = date1;
|
|
@@ -102,4 +122,8 @@ const chooseDate = (date1: Date, force?: boolean) => {
|
|
|
102
122
|
const onRightClickDate = (e: MouseEvent, cell: CalRightClickEvent) => {
|
|
103
123
|
emits("rightClick", e, cell);
|
|
104
124
|
};
|
|
125
|
+
|
|
126
|
+
onMounted(() => {
|
|
127
|
+
offdays.value = getCurrentBranch()?.branch.offdays ?? [];
|
|
128
|
+
});
|
|
105
129
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template >
|
|
2
|
-
<div class="rounded-lg
|
|
2
|
+
<div class="rounded-lg p-2" @click="showCartDialog">
|
|
3
3
|
<div class="line-clamp-1 text-sm md:text-base">{{ title }}</div>
|
|
4
4
|
<div class="text text-2xl md:text-3xl text-right">
|
|
5
5
|
<slot name="default"></slot>
|