@simitgroup/simpleapp-generator 1.6.6-i-alpha → 1.6.6-k-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/ReleaseNote.md +7 -0
- package/dist/buildinschemas/docnoformat.js +6 -6
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/documentevent.js +1 -1
- package/dist/buildinschemas/documentevent.js.map +1 -1
- package/dist/buildinschemas/organization.js +1 -1
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/tenant.js +1 -1
- package/dist/buildinschemas/tenant.js.map +1 -1
- package/dist/buildinschemas/user.js +2 -2
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/buildinschemas/webhook.d.ts.map +1 -1
- package/dist/buildinschemas/webhook.js +1 -0
- package/dist/buildinschemas/webhook.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +30 -3
- package/dist/framework.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +21 -20
- package/dist/generate.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/processors/jrxmlbuilder.js +3 -3
- package/dist/processors/jrxmlbuilder.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +17 -10
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +1 -1
- package/dist/type.d.ts.map +1 -1
- package/package.json +2 -3
- package/reset-install.sh +3 -0
- package/src/buildinschemas/docnoformat.ts +6 -6
- package/src/buildinschemas/documentevent.ts +1 -1
- package/src/buildinschemas/organization.ts +1 -1
- package/src/buildinschemas/tenant.ts +1 -1
- package/src/buildinschemas/user.ts +2 -2
- package/src/buildinschemas/webhook.ts +1 -0
- package/src/framework.ts +33 -5
- package/src/generate.ts +22 -20
- package/src/processors/jrxmlbuilder.ts +3 -3
- package/src/processors/jsonschemabuilder.ts +27 -14
- package/src/type.ts +1 -1
- package/templates/basic/nest/controller.ts.eta +6 -5
- package/templates/basic/nest/resolver.ts.eta +4 -2
- package/templates/basic/nest/service.ts.eta +5 -2
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +3 -3
- package/templates/nest/.gitignore.eta +4 -5
- package/templates/nest/src/{app.module.ts.eta → app.module.ts._eta} +2 -2
- package/templates/nest/src/{main.ts.eta → main.ts._eta} +2 -2
- package/templates/nest/src/printapi/printapi.service.ts.eta +7 -8
- package/templates/nest/src/simpleapp/.gitignore.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +2 -2
- package/templates/nest/src/simpleapp/generate/commons/customkeycloa.guard.ts.eta +14 -12
- package/templates/nest/src/simpleapp/generate/commons/customkeycloak.guard.ts.eta +36 -42
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +6 -3
- package/templates/nest/src/simpleapp/generate/commons/encryption.static.ts.eta +56 -61
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +65 -88
- package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +10 -9
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +10 -3
- package/templates/nest/src/simpleapp/generate/commons/runwebhook.service.ts.eta +71 -77
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +439 -293
- package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +20 -5
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +423 -38
- package/templates/nest/src/simpleapp/profile/{profile.controller.ts.eta → profile.controller.ts._eta} +2 -2
- package/templates/nest/src/simpleapp/profile/{profile.service.ts.eta → profile.service.ts._eta} +2 -2
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +15 -4
- package/templates/nuxt/assets/css/style.css._eta +74 -28
- package/templates/nuxt/components/button/ButtonMultiple.vue._eta +1 -1
- package/templates/nuxt/components/calendar/{CalendarByResource.vue.eta → CalendarByResource.vue._eta} +2 -2
- package/templates/nuxt/components/calendar/{CalendarInput.vue.eta → CalendarInput.vue._eta} +3 -3
- package/templates/nuxt/components/calendar/{CalendarSmall.vue.eta → CalendarSmall.vue._eta} +13 -7
- package/templates/nuxt/components/debug/{DebugDocumentData.vue.eta → DebugDocumentData.vue._eta} +4 -5
- package/templates/nuxt/components/form/{FormDocnoformat.vue.eta → FormDocnoformat.vue._eta} +2 -1
- package/templates/nuxt/components/form/user/{FormUserPermission.vue.eta → FormUserPermission.vue._eta} +6 -0
- package/templates/nuxt/components/header/{HeaderBreadcrumb.vue.eta → HeaderBreadcrumb.vue._eta} +5 -5
- package/templates/nuxt/components/header/button/{HeaderButtonProfile.vue.eta → HeaderButtonProfile.vue._eta} +2 -2
- package/templates/nuxt/components/header/button/task/{HeaderButtonTaskList.vue.eta → HeaderButtonTaskList.vue._eta} +4 -4
- package/templates/nuxt/components/image/ImageAvatar.vue.eta +56 -0
- package/templates/nuxt/components/image/{ImageOrganization.vue.eta.vue → ImageOrganization.vue.eta} +15 -9
- package/templates/nuxt/components/image/{ImageToBase64Uploader.vue.eta.vue → ImageToBase64Uploader.vue.eta} +28 -18
- package/templates/nuxt/components/list/{ListDocumentTable.vue.eta → ListDocumentTable.vue._eta} +3 -3
- package/templates/nuxt/components/list/{ListItem.vue.eta → ListItem.vue._eta} +2 -2
- package/templates/nuxt/components/list/{ListMessages.vue.eta → ListMessages.vue._eta} +8 -2
- package/templates/nuxt/components/list/{ListView.vue.eta → ListView.vue._eta} +2 -2
- package/templates/nuxt/components/overlay/{OverlayPanelWithToolBar.vue.eta → OverlayPanelWithToolBar.vue._eta} +5 -5
- package/templates/nuxt/components/overlay/{OverlaySideBarCrud.vue.eta → OverlaySideBarCrud.vue._eta} +4 -4
- package/templates/nuxt/components/overlay/{OverlayViewer.vue.eta → OverlayViewer.vue._eta} +2 -2
- package/templates/nuxt/components/page/{PageDocList.vue.eta → PageDocList.vue._eta} +5 -5
- package/templates/nuxt/components/renderer/RendererDateAge.vue.eta +19 -0
- package/templates/nuxt/components/renderer/{RendererDateTime.vue.eta → RendererDateTime.vue._eta} +2 -2
- package/templates/nuxt/components/renderer/{RendererDocHistories.vue.eta → RendererDocHistories.vue._eta} +6 -0
- package/templates/nuxt/components/renderer/{RendererForeignKey.vue.eta → RendererForeignKey.vue._eta} +2 -2
- package/templates/nuxt/components/renderer/{RendererLink.vue.eta → RendererLink.vue._eta} +2 -2
- package/templates/nuxt/components/renderer/{RendererTime.vue.eta → RendererTime.vue._eta} +2 -2
- package/templates/nuxt/components/renderer/{RendererViewer.vue.eta → RendererViewer.vue._eta} +2 -2
- package/templates/nuxt/components/select/{SelectTemplate.vue.eta → SelectTemplate.vue._eta} +2 -2
- package/templates/nuxt/components/session/{SessionBlock.vue.eta → SessionBlock.vue._eta} +2 -2
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +55 -55
- package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +13 -11
- package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +6 -3
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +33 -28
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +19 -28
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +113 -105
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +3 -3
- package/templates/nuxt/components/simpleApp/SimpleAppJsonSchemaForm.vue.eta +3 -16
- package/templates/nuxt/components/simpleApp/SimpleAppUserPicker.vue.eta +10 -12
- package/templates/nuxt/components/table/{TableDocuments.vue.eta → TableDocuments.vue._eta} +2 -2
- package/templates/nuxt/components/user/{UserButtonPermissionInfo.vue.eta → UserButtonPermissionInfo.vue._eta} +4 -4
- package/templates/nuxt/components/user/{UserInvitation.vue.eta → UserInvitation.vue._eta} +2 -2
- package/templates/nuxt/components/user/{UserProfileListItem.vue.eta → UserProfileListItem.vue._eta} +2 -2
- package/templates/nuxt/components/user/{UserTenantPicker.vue.eta → UserTenantPicker.vue._eta} +2 -2
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +11 -3
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +1 -1
- package/templates/nuxt/composables/graphquery.generate.ts.eta +1 -1
- package/templates/nuxt/composables/recently.generate.ts.eta +0 -1
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +5 -2
- package/templates/nuxt/nuxt.config.ts._eta +6 -5
- package/templates/nuxt/pages/[xorg]/docnoformat/[id].vue.eta +0 -1
- package/templates/nuxt/pages/[xorg]/{docnoformat.vue.eta → docnoformat.vue._eta} +1 -0
- package/templates/nuxt/pages/[xorg]/organization/[id].vue.eta +13 -9
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +10 -12
- package/templates/nuxt/pages/[xorg]/{user.vue.eta → user.vue._eta} +2 -2
- package/templates/nuxt/pages/index.vue._eta +1 -1
- package/templates/nuxt/pages/{profile.vue.eta → profile.vue._eta} +2 -2
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +6 -0
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +89 -12
- package/templates/nuxt/plugins/40.pusher.ts.eta +8 -5
- package/templates/nuxt/presets/lara/accordion/index.js +79 -0
- package/templates/nuxt/presets/lara/accordioncontent/index.js +3 -0
- package/templates/nuxt/presets/lara/accordionheader/index.js +11 -0
- package/templates/nuxt/presets/lara/accordionpanel/index.js +18 -0
- package/templates/nuxt/presets/lara/autocomplete/index.js +208 -0
- package/templates/nuxt/presets/lara/avatar/index.js +43 -0
- package/templates/nuxt/presets/lara/avatargroup/index.js +5 -0
- package/templates/nuxt/presets/lara/badge/index.js +47 -0
- package/templates/nuxt/presets/lara/badgedirective/index.js +43 -0
- package/templates/nuxt/presets/lara/blockui/index.js +4 -0
- package/templates/nuxt/presets/lara/breadcrumb/index.js +64 -0
- package/templates/nuxt/presets/lara/button/index.js +238 -0
- package/templates/nuxt/presets/lara/buttongroup/index.js +12 -0
- package/templates/nuxt/presets/lara/card/index.js +37 -0
- package/templates/nuxt/presets/lara/carousel/index.js +103 -0
- package/templates/nuxt/presets/lara/cascadeselect/index.js +199 -0
- package/templates/nuxt/presets/lara/checkbox/index.js +104 -0
- package/templates/nuxt/presets/lara/chip/index.js +42 -0
- package/templates/nuxt/presets/lara/colorpicker/index.js +123 -0
- package/templates/nuxt/presets/lara/confirmdialog/index.js +3 -0
- package/templates/nuxt/presets/lara/confirmpopup/index.js +56 -0
- package/templates/nuxt/presets/lara/contextmenu/index.js +126 -0
- package/templates/nuxt/presets/lara/datatable/index.js +403 -0
- package/templates/nuxt/presets/lara/dataview/index.js +28 -0
- package/templates/nuxt/presets/lara/datepicker/index.js +435 -0
- package/templates/nuxt/presets/lara/deferred/index.js +3 -0
- package/templates/nuxt/presets/lara/dialog/index.js +148 -0
- package/templates/nuxt/presets/lara/divider/index.js +67 -0
- package/templates/nuxt/presets/lara/dock/index.js +86 -0
- package/templates/nuxt/presets/lara/drawer/index.js +149 -0
- package/templates/nuxt/presets/lara/fieldset/index.js +84 -0
- package/templates/nuxt/presets/lara/fileupload/index.js +95 -0
- package/templates/nuxt/presets/lara/floatlabel/index.js +26 -0
- package/templates/nuxt/presets/lara/galleria/index.js +308 -0
- package/templates/nuxt/presets/lara/global.js +90 -0
- package/templates/nuxt/presets/lara/iconfield/index.js +27 -0
- package/templates/nuxt/presets/lara/image/index.js +206 -0
- package/templates/nuxt/presets/lara/index.js +234 -0
- package/templates/nuxt/presets/lara/inplace/index.js +27 -0
- package/templates/nuxt/presets/lara/inputgroup/index.js +5 -0
- package/templates/nuxt/presets/lara/inputgroupaddon/index.js +28 -0
- package/templates/nuxt/presets/lara/inputmask/index.js +39 -0
- package/templates/nuxt/presets/lara/inputnumber/index.js +167 -0
- package/templates/nuxt/presets/lara/inputotp/index.js +10 -0
- package/templates/nuxt/presets/lara/inputswitch/index.js +80 -0
- package/templates/nuxt/presets/lara/inputtext/index.js +54 -0
- package/templates/nuxt/presets/lara/knob/index.js +44 -0
- package/templates/nuxt/presets/lara/listbox/index.js +117 -0
- package/templates/nuxt/presets/lara/megamenu/index.js +198 -0
- package/templates/nuxt/presets/lara/menu/index.js +96 -0
- package/templates/nuxt/presets/lara/menubar/index.js +176 -0
- package/templates/nuxt/presets/lara/message/index.js +92 -0
- package/templates/nuxt/presets/lara/metergroup/index.js +96 -0
- package/templates/nuxt/presets/lara/multiselect/index.js +201 -0
- package/templates/nuxt/presets/lara/orderlist/index.js +13 -0
- package/templates/nuxt/presets/lara/organizationchart/index.js +137 -0
- package/templates/nuxt/presets/lara/overlaybadge/index.js +18 -0
- package/templates/nuxt/presets/lara/paginator/index.js +178 -0
- package/templates/nuxt/presets/lara/panel/index.js +91 -0
- package/templates/nuxt/presets/lara/panelmenu/index.js +127 -0
- package/templates/nuxt/presets/lara/password/index.js +72 -0
- package/templates/nuxt/presets/lara/picklist/index.js +52 -0
- package/templates/nuxt/presets/lara/popover/index.js +31 -0
- package/templates/nuxt/presets/lara/progressbar/index.js +55 -0
- package/templates/nuxt/presets/lara/progressspinner/index.js +51 -0
- package/templates/nuxt/presets/lara/radiobutton/index.js +104 -0
- package/templates/nuxt/presets/lara/rating/index.js +63 -0
- package/templates/nuxt/presets/lara/ripple/index.js +6 -0
- package/templates/nuxt/presets/lara/scrollpanel/index.js +77 -0
- package/templates/nuxt/presets/lara/scrolltop/index.js +26 -0
- package/templates/nuxt/presets/lara/select/index.js +240 -0
- package/templates/nuxt/presets/lara/selectbutton/index.js +16 -0
- package/templates/nuxt/presets/lara/skeleton/index.js +16 -0
- package/templates/nuxt/presets/lara/slider/index.js +137 -0
- package/templates/nuxt/presets/lara/speeddial/index.js +57 -0
- package/templates/nuxt/presets/lara/splitbutton/index.js +19 -0
- package/templates/nuxt/presets/lara/splitter/index.js +61 -0
- package/templates/nuxt/presets/lara/splitterpanel/index.js +5 -0
- package/templates/nuxt/presets/lara/step/index.js +62 -0
- package/templates/nuxt/presets/lara/stepitem/index.js +11 -0
- package/templates/nuxt/presets/lara/steplist/index.js +3 -0
- package/templates/nuxt/presets/lara/steppanels/index.js +3 -0
- package/templates/nuxt/presets/lara/stepper/index.js +13 -0
- package/templates/nuxt/presets/lara/steps/index.js +111 -0
- package/templates/nuxt/presets/lara/tab/index.js +42 -0
- package/templates/nuxt/presets/lara/tablist/index.js +8 -0
- package/templates/nuxt/presets/lara/tabmenu/index.js +73 -0
- package/templates/nuxt/presets/lara/tabpanel/index.js +3 -0
- package/templates/nuxt/presets/lara/tabpanels/index.js +3 -0
- package/templates/nuxt/presets/lara/tabs/index.js +5 -0
- package/templates/nuxt/presets/lara/tabview/index.js +156 -0
- package/templates/nuxt/presets/lara/tag/index.js +38 -0
- package/templates/nuxt/presets/lara/terminal/index.js +60 -0
- package/templates/nuxt/presets/lara/textarea/index.js +39 -0
- package/templates/nuxt/presets/lara/tieredmenu/index.js +121 -0
- package/templates/nuxt/presets/lara/timeline/index.js +81 -0
- package/templates/nuxt/presets/lara/toast/index.js +102 -0
- package/templates/nuxt/presets/lara/togglebutton/index.js +45 -0
- package/templates/nuxt/presets/lara/toggleswitch/index.js +80 -0
- package/templates/nuxt/presets/lara/toolbar/index.js +28 -0
- package/templates/nuxt/presets/lara/tooltip/index.js +46 -0
- package/templates/nuxt/presets/lara/tree/index.js +101 -0
- package/templates/nuxt/presets/lara/treeselect/index.js +102 -0
- package/templates/nuxt/presets/lara/treetable/index.js +305 -0
- package/templates/nuxt/providers/my-provider.ts.eta +1 -1
- package/templates/nuxt/server/api/profile/[...].ts.eta +4 -3
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +10 -20
- package/templates/nuxt/tailwind.config.ts._eta +4 -15
- package/templates/nuxt/types/schema.ts.eta +1 -1
- package/templates/nuxt/types/user.ts.eta +6 -1
- package/templates/project/jsonschemas/appintegration.json_eta +227 -0
- package/templates/project/sharelibs/validate.ts.eta +23 -0
- package/templates/nuxt/components/image/ImageAvatar.vue.eta._vue +0 -57
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="schema" :class="getLayoutClass()">
|
|
3
|
-
<label v-if="hidelabel"
|
|
4
|
-
|
|
5
|
-
>{{ fieldlabel }}
|
|
3
|
+
<label v-if="!hidelabel" :for="uuid" :class="getLabelClass()">
|
|
4
|
+
{{ fieldlabel }}
|
|
6
5
|
<span
|
|
7
6
|
v-if="props.setting.isrequired && fieldlabel"
|
|
8
7
|
class="text-danger-600 dark:text-danger-400"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<!-- <label v-else-if="error" class="simpleapp-input-label text-danger-600 overflow-hidden" :for="uuid">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label>
|
|
13
|
-
<label v-else :for="uuid" class="simpleapp-input-label whitespace-nowrap text-gray-500 truncate">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label> -->
|
|
14
|
-
|
|
15
|
-
<!-- <div :uuid="uuid" >{{ modelValue }}</div> -->
|
|
16
|
-
<!-- <div v-if="typeof modelValue =='object' && typeof modelValue['_id']!='undefined' && typeof modelValue['label']!='undefined' && readonly ==true " :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue['label'] }}</div> -->
|
|
17
|
-
<!-- <div v-else-if="readonly==true" :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue }}</div> -->
|
|
18
|
-
<!-- <slot v-else name="default" :uuid="uuid" :error="error"></slot> -->
|
|
19
|
-
<slot name="default" :uuid="uuid" :error="error"></slot>
|
|
8
|
+
>*</span>
|
|
9
|
+
</label>
|
|
10
|
+
<slot name="default" :uuid="uuid" :error="error"/>
|
|
20
11
|
|
|
21
12
|
<small v-if="error" class="text-danger-600 dark:text-danger-400">{{
|
|
22
13
|
error
|
|
@@ -24,7 +15,7 @@
|
|
|
24
15
|
<small v-else class="input-desc">{{ fielddesc }}</small>
|
|
25
16
|
</div>
|
|
26
17
|
<div v-else :class="defaultcssclass">
|
|
27
|
-
<label class="
|
|
18
|
+
<label class="text-danger-600 dark:text-danger-400"
|
|
28
19
|
>wrong path in getField()</label
|
|
29
20
|
>
|
|
30
21
|
<div class="text-danger-600 dark:text-danger-400">
|
|
@@ -33,7 +24,7 @@
|
|
|
33
24
|
</div>
|
|
34
25
|
</template>
|
|
35
26
|
<script setup lang="ts">
|
|
36
|
-
import SimpleAppValue from "./SimpleAppValue.vue";
|
|
27
|
+
// import SimpleAppValue from "./SimpleAppValue.vue";
|
|
37
28
|
/**
|
|
38
29
|
* This file was automatically generated by simpleapp generator. Every
|
|
39
30
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
@@ -73,25 +64,24 @@ const readonlyclass = "simpleapp-value-readonly";
|
|
|
73
64
|
let schema: any;
|
|
74
65
|
|
|
75
66
|
const getLayoutClass = () =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}`;
|
|
67
|
+
"simpleapp-input-container flex flex-col";
|
|
68
|
+
// `simpleapp-input-container flex ${
|
|
69
|
+
// props.inputType == "checkbox" ? " flex flex-col " : "flex flex-col "
|
|
70
|
+
// }`;
|
|
81
71
|
|
|
82
72
|
const getLabelClass = () => {
|
|
83
73
|
let class1 =
|
|
84
|
-
"simpleapp-input-label text-left text-gray-500
|
|
74
|
+
"simpleapp-input-label text-left text-gray-500 ";
|
|
85
75
|
|
|
86
76
|
if (!isMobile()) class1 += "whitespace-nowrap truncate";
|
|
87
|
-
else if (props.inputType == "checkbox") class1 += " ml-1
|
|
77
|
+
else if (props.inputType == "checkbox") class1 += " ml-1";
|
|
88
78
|
else if (props.inputType != "autocomplete" && modelValue.value)
|
|
89
|
-
class1 += "-mb-4 ml-1 z-10 text-xs
|
|
79
|
+
class1 += "-mb-4 ml-1 z-10 text-xs";
|
|
90
80
|
else if (props.inputType == "autocomplete" && modelValue.value?.label)
|
|
91
|
-
class1 += "-mb-4 ml-1 z-10 text-xs
|
|
81
|
+
class1 += "-mb-4 ml-1 z-10 text-xs";
|
|
92
82
|
else if (modelValue.value !== undefined)
|
|
93
|
-
class1 += "-mb-4 ml-1 z-10 text-xs
|
|
94
|
-
else class1 += "-mb-4 ml-1 z-10 text-xs
|
|
83
|
+
class1 += "-mb-4 ml-1 z-10 text-xs";
|
|
84
|
+
else class1 += "-mb-4 ml-1 z-10 text-xs ";
|
|
95
85
|
return class1;
|
|
96
86
|
};
|
|
97
87
|
|
|
@@ -133,8 +123,9 @@ watch(props.setting.errors, (newvalue, oldvalue) => {
|
|
|
133
123
|
if (newvalue[instancepath.value]) {
|
|
134
124
|
const errlist: any[] = newvalue[instancepath.value];
|
|
135
125
|
for (let i = 0; i < errlist.length; i++) {
|
|
136
|
-
error.value += errlist[i].message + ",";
|
|
126
|
+
error.value += errlist[i].message + ", ";
|
|
137
127
|
}
|
|
128
|
+
error.value = error.value.slice(0, -2);
|
|
138
129
|
fieldcontainerclass.value = defaultcssclass + " input-error";
|
|
139
130
|
} else {
|
|
140
131
|
error.value = "";
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<SimpleAppFieldContainer
|
|
3
|
-
|
|
3
|
+
v-slot="slotprops"
|
|
4
4
|
v-model="modelValue"
|
|
5
|
+
:hidelabel="hidelabel"
|
|
5
6
|
:label="label"
|
|
6
7
|
:description="description"
|
|
7
8
|
:pt="pt"
|
|
8
|
-
:
|
|
9
|
+
:input-type="inputType"
|
|
9
10
|
:setting="setting"
|
|
10
11
|
:instancepath="instancepath"
|
|
11
12
|
:error="error"
|
|
12
|
-
#default="slotprops"
|
|
13
13
|
:resetcount="resetcount"
|
|
14
14
|
>
|
|
15
15
|
<Checkbox
|
|
16
16
|
v-if="inputType == SimpleAppInputType.checkbox"
|
|
17
|
+
v-model="modelValue"
|
|
17
18
|
:readonly="isReadonly"
|
|
18
19
|
:pt="pt"
|
|
19
|
-
:
|
|
20
|
+
:input-id="slotprops.uuid"
|
|
20
21
|
:path="setting.instancepath"
|
|
21
|
-
v-model="modelValue"
|
|
22
22
|
:binary="true"
|
|
23
|
-
v-bind="componentProps
|
|
23
|
+
v-bind="componentProps"
|
|
24
24
|
@change="onChange"
|
|
25
25
|
/>
|
|
26
26
|
<InputSwitch
|
|
27
27
|
v-else-if="inputType == SimpleAppInputType.switch"
|
|
28
|
+
v-model="modelValue"
|
|
28
29
|
:readonly="isReadonly"
|
|
29
30
|
:pt="pt"
|
|
30
|
-
:
|
|
31
|
+
:input-id="slotprops.uuid"
|
|
31
32
|
:path="setting.instancepath"
|
|
32
|
-
v-model="modelValue as boolean"
|
|
33
33
|
:binary="true"
|
|
34
|
-
v-bind="componentProps
|
|
34
|
+
v-bind="componentProps"
|
|
35
35
|
@change="onChange"
|
|
36
36
|
/>
|
|
37
37
|
|
|
@@ -41,102 +41,102 @@
|
|
|
41
41
|
SimpleAppInputType.calendar == inputType ||
|
|
42
42
|
inputType == SimpleAppInputType.date
|
|
43
43
|
"
|
|
44
|
+
v-model="modelValue"
|
|
44
45
|
:pt="pt"
|
|
45
46
|
type="date"
|
|
46
|
-
v-model="modelValue"
|
|
47
47
|
:uuid="slotprops.uuid"
|
|
48
48
|
:placeholder="placeholder"
|
|
49
49
|
:setting="setting"
|
|
50
50
|
:readonly="isReadonly"
|
|
51
|
-
:
|
|
51
|
+
:component-props="componentProps"
|
|
52
52
|
@change="onChange"
|
|
53
53
|
/>
|
|
54
54
|
|
|
55
55
|
<!-- time component -->
|
|
56
|
-
<
|
|
56
|
+
<SimpleAppCalendarTime
|
|
57
57
|
v-else-if="inputType == SimpleAppInputType.time"
|
|
58
|
+
v-model="modelValue"
|
|
58
59
|
:pt="pt"
|
|
59
60
|
type="time"
|
|
60
|
-
v-model="modelValue"
|
|
61
61
|
:uuid="slotprops.uuid"
|
|
62
62
|
:placeholder="placeholder"
|
|
63
63
|
:setting="setting"
|
|
64
64
|
:readonly="isReadonly"
|
|
65
|
-
:
|
|
65
|
+
:component-props="componentProps"
|
|
66
66
|
@change="onChange"
|
|
67
67
|
/>
|
|
68
68
|
|
|
69
69
|
<SimpleAppCalendarInput
|
|
70
70
|
v-else-if="inputType == SimpleAppInputType.datetime"
|
|
71
|
+
v-model="modelValue"
|
|
71
72
|
:pt="pt"
|
|
72
73
|
type="datetime"
|
|
73
|
-
v-model="modelValue"
|
|
74
74
|
:uuid="slotprops.uuid"
|
|
75
75
|
:placeholder="placeholder"
|
|
76
76
|
:setting="setting"
|
|
77
77
|
:readonly="isReadonly"
|
|
78
|
-
:
|
|
78
|
+
:component-props="componentProps"
|
|
79
79
|
@change="onChange"
|
|
80
80
|
/>
|
|
81
81
|
|
|
82
82
|
<!-- select/list component -->
|
|
83
83
|
<Listbox
|
|
84
|
+
v-else-if="SimpleAppInputType.list == inputType"
|
|
84
85
|
v-model="modelValue"
|
|
85
86
|
:pt="pt"
|
|
86
|
-
|
|
87
|
-
:inputId="slotprops.uuid"
|
|
87
|
+
:input-id="slotprops.uuid"
|
|
88
88
|
:path="setting.instancepath"
|
|
89
89
|
:readonly="isReadonly"
|
|
90
90
|
class="w w-full lg:w-full"
|
|
91
91
|
:disabled="isReadonly"
|
|
92
92
|
:options="getListOptions()"
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
option-label="label"
|
|
94
|
+
option-value="value"
|
|
95
95
|
:placeholder="placeholder"
|
|
96
|
-
v-bind="componentProps
|
|
96
|
+
v-bind="componentProps"
|
|
97
97
|
@change="onChange"
|
|
98
98
|
/>
|
|
99
99
|
|
|
100
|
-
<
|
|
100
|
+
<Select
|
|
101
|
+
v-else-if="SimpleAppInputType.select == inputType"
|
|
101
102
|
v-model="modelValue"
|
|
102
103
|
:pt="pt"
|
|
103
|
-
|
|
104
|
-
:inputId="slotprops.uuid"
|
|
104
|
+
:input-id="slotprops.uuid"
|
|
105
105
|
:path="setting.instancepath"
|
|
106
106
|
:readonly="isReadonly"
|
|
107
107
|
class="w w-full lg:w-full"
|
|
108
108
|
:disabled="isReadonly"
|
|
109
109
|
:options="getListOptions()"
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
option-label="label"
|
|
111
|
+
option-value="value"
|
|
112
112
|
:placeholder="placeholder"
|
|
113
113
|
v-bind="componentProps"
|
|
114
114
|
@change="onChange"
|
|
115
115
|
/>
|
|
116
116
|
|
|
117
117
|
<MultiSelect
|
|
118
|
+
v-else-if="SimpleAppInputType.selectmultiple == inputType"
|
|
118
119
|
v-model="modelValue"
|
|
119
120
|
:pt="pt"
|
|
120
|
-
|
|
121
|
-
:inputId="slotprops.uuid"
|
|
121
|
+
:input-id="slotprops.uuid"
|
|
122
122
|
:path="setting.instancepath"
|
|
123
123
|
:readonly="isReadonly"
|
|
124
124
|
class="w w-full lg:w-full"
|
|
125
125
|
:disabled="isReadonly"
|
|
126
126
|
:options="getListOptions()"
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
option-label="label"
|
|
128
|
+
option-value="value"
|
|
129
129
|
:placeholder="placeholder"
|
|
130
130
|
v-bind="componentProps"
|
|
131
131
|
@change="onChange"
|
|
132
132
|
/>
|
|
133
133
|
<!-- radio component -->
|
|
134
134
|
<div v-else-if="inputType == SimpleAppInputType.radio">
|
|
135
|
-
<div v-for="(item, index) in getListOptions()">
|
|
135
|
+
<div v-for="(item, index) in getListOptions()" :key="index">
|
|
136
136
|
<RadioButton
|
|
137
|
-
:pt="pt"
|
|
138
137
|
v-model="modelValue"
|
|
139
|
-
:
|
|
138
|
+
:pt="pt"
|
|
139
|
+
:input-id="setting.key + '-' + index"
|
|
140
140
|
name="smaple"
|
|
141
141
|
:value="item.value"
|
|
142
142
|
:readonly="isReadonly"
|
|
@@ -149,66 +149,66 @@
|
|
|
149
149
|
|
|
150
150
|
<SimpleAppUserPicker
|
|
151
151
|
v-else-if="inputType == SimpleAppInputType.user"
|
|
152
|
-
v-model="modelValue
|
|
152
|
+
v-model="modelValue"
|
|
153
153
|
:hidelabel="hidelabel"
|
|
154
154
|
:pt="pt"
|
|
155
155
|
:setting="setting"
|
|
156
156
|
:disabled="isReadonly"
|
|
157
|
-
:
|
|
157
|
+
:input-id="slotprops.uuid"
|
|
158
158
|
:path="setting.instancepath"
|
|
159
159
|
:readonly="isReadonly"
|
|
160
160
|
:placeholder="placeholder"
|
|
161
|
-
:
|
|
161
|
+
:autocomplete-filter="autocompleteFilter"
|
|
162
162
|
@change="onChange"
|
|
163
163
|
>
|
|
164
164
|
<template #header>
|
|
165
|
-
<slot name="header"
|
|
165
|
+
<slot name="header"/>
|
|
166
166
|
</template>
|
|
167
167
|
<template #content>
|
|
168
|
-
<slot name="content"
|
|
168
|
+
<slot name="content"/>
|
|
169
169
|
</template>
|
|
170
170
|
<template #option="{ index, option }">
|
|
171
|
-
<slot name="option" :index="index" :option="option"
|
|
171
|
+
<slot name="option" :index="index" :option="option"/>
|
|
172
172
|
</template>
|
|
173
173
|
</SimpleAppUserPicker>
|
|
174
174
|
|
|
175
175
|
<!-- autocomplete, need do more enterprise grade component-->
|
|
176
176
|
<SimpleAppAutocomplete
|
|
177
177
|
v-else-if="inputType == SimpleAppInputType.autocomplete"
|
|
178
|
-
v-model="modelValue
|
|
178
|
+
v-model="modelValue"
|
|
179
179
|
:hidelabel="hidelabel"
|
|
180
180
|
:pt="pt"
|
|
181
181
|
:setting="setting"
|
|
182
182
|
:disabled="isReadonly"
|
|
183
|
-
:
|
|
183
|
+
:input-id="slotprops.uuid"
|
|
184
184
|
:path="setting.instancepath"
|
|
185
185
|
:readonly="isReadonly"
|
|
186
186
|
:placeholder="placeholder"
|
|
187
|
-
:
|
|
187
|
+
:autocomplete-filter="autocompleteFilter"
|
|
188
188
|
@change="onChange"
|
|
189
189
|
>
|
|
190
190
|
<template #header>
|
|
191
|
-
<slot name="header"
|
|
191
|
+
<slot name="header"/>
|
|
192
192
|
</template>
|
|
193
193
|
<template #content>
|
|
194
|
-
<slot name="content"
|
|
194
|
+
<slot name="content"/>
|
|
195
195
|
</template>
|
|
196
196
|
<template #option="{ index, option }">
|
|
197
|
-
<slot name="option" :index="index" :option="option"
|
|
197
|
+
<slot name="option" :index="index" :option="option"/>
|
|
198
198
|
</template>
|
|
199
199
|
</SimpleAppAutocomplete>
|
|
200
200
|
<!-- v-bind:attributes="componentProps" -->
|
|
201
201
|
<!-- document no input-->
|
|
202
202
|
<SimpleAppDocumentNo
|
|
203
203
|
v-else-if="inputType == SimpleAppInputType.documentno"
|
|
204
|
+
v-model="modelValue"
|
|
204
205
|
:setting="setting"
|
|
205
|
-
|
|
206
|
-
:inputId="slotprops.uuid"
|
|
206
|
+
:input-id="slotprops.uuid"
|
|
207
207
|
:readonly="isReadonly"
|
|
208
|
-
@update:docNoFormat="triggerDocNoFormatChange"
|
|
209
208
|
:pt="pt"
|
|
210
209
|
:path="setting.instancepath"
|
|
211
210
|
v-bind="componentProps as any"
|
|
211
|
+
@update:doc-no-format="triggerDocNoFormatChange"
|
|
212
212
|
@change="onChange"
|
|
213
213
|
/>
|
|
214
214
|
<!-- use componentProps as any at the moment, no ideal yet, and for compatibility -->
|
|
@@ -216,67 +216,68 @@
|
|
|
216
216
|
<!-- password -->
|
|
217
217
|
<Password
|
|
218
218
|
v-else-if="inputType == SimpleAppInputType.password"
|
|
219
|
+
v-model="modelValue"
|
|
219
220
|
:type="type"
|
|
220
|
-
v-model="modelValue as string"
|
|
221
221
|
:pt="pt"
|
|
222
|
-
@focus="setFocus"
|
|
223
222
|
:readonly="isReadonly"
|
|
224
223
|
class="flex flex-col"
|
|
225
|
-
:
|
|
224
|
+
:input-id="slotprops.uuid"
|
|
226
225
|
:path="setting.instancepath"
|
|
227
|
-
@change="onChange"
|
|
228
226
|
:placeholder="placeholder"
|
|
229
|
-
v-bind="componentProps
|
|
227
|
+
v-bind="componentProps"
|
|
228
|
+
:toggleMask="true"
|
|
229
|
+
:feedback="false"
|
|
230
|
+
@focus="setFocus"
|
|
231
|
+
@change="onChange"
|
|
230
232
|
/>
|
|
231
233
|
|
|
232
234
|
<!-- rating -->
|
|
233
235
|
<Rating
|
|
234
236
|
v-else-if="inputType == SimpleAppInputType.rating"
|
|
237
|
+
v-model="modelValue"
|
|
235
238
|
:type="type"
|
|
236
|
-
v-model="modelValue as number"
|
|
237
239
|
:pt="pt"
|
|
238
240
|
:readonly="isReadonly"
|
|
239
|
-
:
|
|
241
|
+
:input-id="slotprops.uuid"
|
|
240
242
|
:path="setting.instancepath"
|
|
243
|
+
v-bind="componentProps"
|
|
241
244
|
@change="onChange"
|
|
242
|
-
v-bind="componentProps as RatingProps"
|
|
243
245
|
/>
|
|
244
246
|
|
|
245
247
|
<!-- chip -->
|
|
246
248
|
<Chips
|
|
247
249
|
v-else-if="inputType == SimpleAppInputType.chip"
|
|
250
|
+
v-model="modelValue"
|
|
248
251
|
:type="type"
|
|
249
|
-
v-model="modelValue as string[]"
|
|
250
252
|
:pt="pt"
|
|
251
253
|
:disabled="isReadonly"
|
|
252
|
-
:
|
|
254
|
+
:input-id="slotprops.uuid"
|
|
253
255
|
:path="setting.instancepath"
|
|
254
256
|
:placeholder="placeholder"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
v-bind="componentProps"
|
|
258
|
+
@update:model-value="onChange"
|
|
257
259
|
/>
|
|
258
260
|
<!-- simple component -->
|
|
259
261
|
|
|
260
262
|
<InputNumber
|
|
261
263
|
v-else-if="inputType == SimpleAppInputType.number"
|
|
262
|
-
:type="type"
|
|
263
264
|
v-model="modelValue"
|
|
264
|
-
|
|
265
|
+
:type="type"
|
|
265
266
|
:readonly="isReadonly"
|
|
266
267
|
:pt="pt"
|
|
267
268
|
:class="!pt ? 'w-full flex flex-col' : ''"
|
|
268
|
-
:
|
|
269
|
-
@update:modelValue="onChange"
|
|
269
|
+
:input-id="slotprops.uuid"
|
|
270
270
|
:path="setting.instancepath"
|
|
271
|
-
v-bind="componentProps
|
|
271
|
+
v-bind="componentProps"
|
|
272
272
|
:placeholder="placeholder"
|
|
273
|
+
@focus="setFocus"
|
|
274
|
+
@update:model-value="onChange"
|
|
273
275
|
/>
|
|
274
276
|
<!-- // // -->
|
|
275
277
|
<InputNumber
|
|
276
278
|
v-else-if="inputType == SimpleAppInputType.money"
|
|
279
|
+
v-model="modelValue"
|
|
277
280
|
:type="type"
|
|
278
|
-
v-model="modelValue as number"
|
|
279
|
-
@focus="setFocus"
|
|
280
281
|
:max-fraction-digits="2"
|
|
281
282
|
:min-fraction-digits="2"
|
|
282
283
|
mode="currency"
|
|
@@ -284,54 +285,55 @@
|
|
|
284
285
|
:readonly="isReadonly"
|
|
285
286
|
:pt="pt"
|
|
286
287
|
:class="!pt ? 'w-full flex flex-col' : ''"
|
|
287
|
-
:
|
|
288
|
+
:input-id="slotprops.uuid"
|
|
288
289
|
:path="setting.instancepath"
|
|
289
|
-
|
|
290
|
-
v-bind="componentProps as InputNumber"
|
|
290
|
+
v-bind="componentProps"
|
|
291
291
|
:placeholder="placeholder"
|
|
292
|
+
@focus="setFocus"
|
|
293
|
+
@update:model-value="onChange"
|
|
292
294
|
/>
|
|
293
295
|
<Textarea
|
|
294
296
|
v-else-if="inputType == SimpleAppInputType.textarea"
|
|
295
|
-
v-model="modelValue
|
|
297
|
+
v-model="modelValue"
|
|
296
298
|
:autofocus="autofocus"
|
|
297
299
|
:readonly="isReadonly"
|
|
298
300
|
:pt="pt"
|
|
299
301
|
:type="type"
|
|
300
302
|
class="w-full flex flex-col"
|
|
301
|
-
:
|
|
303
|
+
:input-id="slotprops.uuid"
|
|
302
304
|
:path="setting.instancepath"
|
|
303
|
-
@change="onChange"
|
|
304
305
|
:placeholder="placeholder"
|
|
305
|
-
v-bind="componentProps
|
|
306
|
+
v-bind="componentProps"
|
|
307
|
+
@change="onChange"
|
|
306
308
|
/>
|
|
307
|
-
<Editor
|
|
309
|
+
<Editor
|
|
308
310
|
v-else-if="inputType == SimpleAppInputType.html"
|
|
309
|
-
|
|
310
|
-
:
|
|
311
|
+
v-model="modelValue"
|
|
312
|
+
:input-id="slotprops.uuid"
|
|
311
313
|
:path="setting.instancepath"
|
|
312
314
|
:placeholder="placeholder"
|
|
313
315
|
:readonly="isReadonly"
|
|
314
|
-
v-
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
v-bind="componentProps"
|
|
317
|
+
@update:model-value="onChange"
|
|
318
|
+
/>
|
|
317
319
|
<InputText
|
|
318
320
|
v-else
|
|
319
|
-
v-model="modelValue
|
|
320
|
-
@focus="setFocus"
|
|
321
|
+
v-model="modelValue"
|
|
321
322
|
:autofocus="autofocus"
|
|
322
323
|
:readonly="isReadonly"
|
|
323
324
|
:pt="pt"
|
|
324
325
|
:type="type"
|
|
325
326
|
class="w-full flex flex-col"
|
|
326
|
-
:
|
|
327
|
-
@change="onChange"
|
|
327
|
+
:input-id="slotprops.uuid"
|
|
328
328
|
:path="setting.instancepath"
|
|
329
329
|
:placeholder="placeholder"
|
|
330
|
-
v-bind="componentProps
|
|
330
|
+
v-bind="componentProps"
|
|
331
|
+
@focus="setFocus"
|
|
332
|
+
@change="onChange"
|
|
331
333
|
/>
|
|
332
334
|
<!-- component require special treatment -->
|
|
333
335
|
|
|
334
|
-
<slot name="footer"
|
|
336
|
+
<slot name="footer"/>
|
|
335
337
|
</SimpleAppFieldContainer>
|
|
336
338
|
</template>
|
|
337
339
|
|
|
@@ -342,30 +344,36 @@
|
|
|
342
344
|
* last change 2023-10-28
|
|
343
345
|
* Author: Ks Tan
|
|
344
346
|
*/
|
|
345
|
-
import { autocompletetype } from "~/types";
|
|
346
|
-
import moment from "moment";
|
|
347
|
-
import AutoComplete, { AutoCompleteProps } from "primevue/autocomplete";
|
|
348
|
-
import
|
|
349
|
-
import Checkbox
|
|
350
|
-
import Chips
|
|
347
|
+
// import { autocompletetype } from "~/types";
|
|
348
|
+
// import moment from "moment";
|
|
349
|
+
// import AutoComplete, { AutoCompleteProps } from "primevue/autocomplete";
|
|
350
|
+
import type { CalendarProps } from "primevue/calendar";
|
|
351
|
+
import Checkbox from "primevue/checkbox";
|
|
352
|
+
import Chips from "primevue/chips";
|
|
351
353
|
import SimpleAppDocumentNo from "./SimpleAppDocumentNo.vue";
|
|
352
354
|
import SimpleAppAutocomplete from "./SimpleAppAutocomplete.vue";
|
|
353
|
-
import
|
|
354
|
-
import
|
|
355
|
-
import
|
|
356
|
-
import
|
|
357
|
-
import
|
|
358
|
-
import
|
|
359
|
-
import
|
|
360
|
-
import
|
|
361
|
-
import
|
|
362
|
-
import
|
|
363
|
-
import
|
|
364
|
-
import
|
|
355
|
+
import type { DropdownProps } from "primevue/dropdown";
|
|
356
|
+
// import Dropdown from "primevue/dropdown";
|
|
357
|
+
import type { InputNumberProps } from "primevue/inputnumber";
|
|
358
|
+
import InputNumber from "primevue/inputnumber";
|
|
359
|
+
import type { InputSwitchProps } from "primevue/inputswitch";
|
|
360
|
+
import InputSwitch from "primevue/inputswitch";
|
|
361
|
+
import type { InputTextProps } from "primevue/inputtext";
|
|
362
|
+
import InputText from "primevue/inputtext";
|
|
363
|
+
import Listbox from "primevue/listbox";
|
|
364
|
+
import MultiSelect from "primevue/multiselect";
|
|
365
|
+
import Password from "primevue/password";
|
|
366
|
+
import RadioButton from "primevue/radiobutton";
|
|
367
|
+
import type { RatingProps } from "primevue/rating";
|
|
368
|
+
import Rating from "primevue/rating";
|
|
369
|
+
// import Slider, { SliderProps } from "primevue/slider";
|
|
370
|
+
import type { TextareaProps } from "primevue/textarea";
|
|
371
|
+
import Textarea from "primevue/textarea";
|
|
372
|
+
import Editor from "primevue/editor";
|
|
365
373
|
import { SimpleAppInputType } from "~/types";
|
|
366
374
|
const resetcount = ref(0);
|
|
367
375
|
const instancepath = ref("");
|
|
368
|
-
const modelValue = defineModel({ required: true });
|
|
376
|
+
const modelValue = defineModel<any>({ required: true });
|
|
369
377
|
|
|
370
378
|
const watchOnChange = ref(false);
|
|
371
379
|
const props = withDefaults(
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
v-bind="$attrs"
|
|
4
4
|
stripedRows
|
|
5
5
|
resizableColumns
|
|
6
|
-
:rowClass="()=>'align-top'"
|
|
6
|
+
:rowClass="() => 'align-top'"
|
|
7
7
|
class="simpleapp-datatable p-datatable-sm"
|
|
8
8
|
:value="modelValue"
|
|
9
9
|
>
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
<Button
|
|
17
17
|
icon="pi pi-plus"
|
|
18
18
|
@click="addNew()"
|
|
19
|
-
class="simpleapp-datatable-add btn-primary"
|
|
19
|
+
class="simpleapp-datatable-add btn-primary pl-10 pr-10"
|
|
20
20
|
type="button"
|
|
21
|
-
>{{ t("add") }}</Button
|
|
21
|
+
><i class="pi pi-plus"> </i>{{ t("add") }}</Button
|
|
22
22
|
>
|
|
23
23
|
</slot>
|
|
24
24
|
</div>
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
* Author: Ks Tan
|
|
13
13
|
*/
|
|
14
14
|
import type { JSONSchema7,JSONSchema7Definition } from 'json-schema';
|
|
15
|
-
import
|
|
16
|
-
import addFormats from 'ajv-formats';
|
|
17
|
-
import addErrors from 'ajv-errors';
|
|
15
|
+
import { getValidateService } from "~/simpleapp/generate/sharelibs/validate";
|
|
18
16
|
import _ from 'lodash'
|
|
19
17
|
|
|
20
18
|
const props = defineProps<{
|
|
@@ -130,23 +128,12 @@ import _ from 'lodash'
|
|
|
130
128
|
|
|
131
129
|
|
|
132
130
|
const validate=(callback:Function) => {
|
|
133
|
-
const ajv =
|
|
134
|
-
addFormats(ajv);
|
|
135
|
-
addErrors(ajv)
|
|
136
|
-
|
|
137
|
-
ajv.addFormat('tel',/^$|^\d{7,15}$/gm)
|
|
138
|
-
ajv.addFormat('text',/.*$/)
|
|
139
|
-
ajv.addFormat('html',/.*$/)
|
|
140
|
-
ajv.addFormat('documentno',/.*$/)
|
|
141
|
-
|
|
142
|
-
ajv.addKeyword({ keyword: 'x-foreignkey', schemaType: 'string' });
|
|
143
|
-
ajv.addKeyword({ keyword: 'x-simpleapp-config', schemaType: 'object' });
|
|
144
|
-
|
|
131
|
+
const ajv = getValidateService();
|
|
145
132
|
|
|
146
133
|
// this.errorlist.value = {};
|
|
147
134
|
// this.hook('pre-validation', this.data.value);
|
|
148
135
|
const validate = ajv.compile(props.schema);
|
|
149
|
-
console.log("validate data",props.data)
|
|
136
|
+
// console.log("validate data",props.data)
|
|
150
137
|
const valid = validate(props.data);
|
|
151
138
|
if (!valid) {
|
|
152
139
|
const errors = validate.errors;
|