@simitgroup/simpleapp-generator 1.1.25 → 1.1.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -56,3 +56,7 @@ input {
56
56
  .btn-warn {
57
57
  @apply btn bg-warning-600 hover:bg-warning-400
58
58
  }
59
+
60
+ .simpleapp-input-label{
61
+ @apply text-left
62
+ }
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div v-if="schema" class="flex flex-col">
3
3
  <div v-if="hidelabel"></div>
4
- <label v-else-if="error" class="text-danger-600 overflow-hidden" :for="uuid">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label>
5
- <label v-else :for="uuid" class="whitespace-nowrap text-gray-500 truncate">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label>
4
+ <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>
5
+ <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>
6
6
 
7
7
  <!-- <div :uuid="uuid" >{{ modelValue }}</div> -->
8
8
  <!-- <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> -->
@@ -1,28 +1,32 @@
1
1
  <template>
2
2
  <SimpleAppFieldContainer :hidelabel="hidelabel" v-model="modelValue"
3
- :label="label" :description="description"
3
+ :label="label" :description="description" :pt="pt"
4
4
  :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
5
5
  <!-- binary input -->
6
6
  <component :is="inputComponent" :readonly="isReadonly" :pt="pt"
7
7
  v-if="[SimpleAppInputType.checkbox,SimpleAppInputType.switch ].includes(inputType)"
8
8
  :inputId="slotprops.uuid" :path="setting.instancepath"
9
- v-model="modelValue" :binary="true"/>
9
+ v-model="modelValue" :binary="true"
10
+ v-bind="componentProps"/>
10
11
 
11
12
  <!-- date component -->
12
13
  <component :is="inputComponent" type="date" :pt="pt"
13
14
  v-else-if="inputType == SimpleAppInputType.date"
14
15
  :inputId="slotprops.uuid" :path="setting.instancepath"
15
- v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"/>
16
+ v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"
17
+ v-bind="componentProps"/>
16
18
  <!-- calendar component -->
17
- <component :is="inputComponent" type="date" :pt="pt" class="flex flex-col"
19
+ <component :is="inputComponent" type="date" :pt="pt" :class="'flex flex-col yyy-'+modelValue+ ' xxx-'+datevalue"
18
20
  v-else-if="SimpleAppInputType.calendar==inputType"
19
21
  :inputId="slotprops.uuid" :path="setting.instancepath"
20
- v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"/>
22
+ v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"
23
+ v-bind="componentProps"/>
21
24
  <!-- time component -->
22
25
  <component :is="inputComponent" :pt="pt"
23
26
  v-else-if="inputType == SimpleAppInputType.time"
24
27
  :inputId="slotprops.uuid" :path="setting.instancepath"
25
- v-model="modelValue" :readonly="isReadonly"/>
28
+ v-model="modelValue" :readonly="isReadonly"
29
+ v-bind="componentProps"/>
26
30
  <!-- select/list component -->
27
31
  <component :is="inputComponent" v-model="modelValue" :pt="pt"
28
32
  v-else-if="[SimpleAppInputType.select,SimpleAppInputType.list].includes(inputType)"
@@ -30,7 +34,8 @@
30
34
  :readonly="isReadonly"
31
35
  class="w w-full lg:w-full"
32
36
  :disabled="isReadonly"
33
- :options="getListOptions()" optionLabel="label" optionValue="value"/>
37
+ :options="getListOptions()" optionLabel="label" optionValue="value"
38
+ v-bind="componentProps"/>
34
39
 
35
40
  <!-- radio component -->
36
41
  <div v-else-if="inputType == SimpleAppInputType.radio" >
@@ -51,15 +56,16 @@
51
56
  :disabled="isReadonly"
52
57
  :inputId="slotprops.uuid"
53
58
  :path="setting.instancepath"
54
- :readonly="isReadonly"
59
+ :readonly="isReadonly"
55
60
  />
56
-
61
+ <!-- v-bind:attributes="componentProps" -->
57
62
  <!-- document no input-->
58
63
  <SimpleAppDocumentNo v-else-if="inputType == SimpleAppInputType.documentno"
59
64
  :setting="setting" v-model="modelValue" :inputId="slotprops.uuid"
60
65
  :readonly="isReadonly" @update:docNoFormat="triggerDocNoFormatChange"
61
66
  :pt="pt"
62
- :path="setting.instancepath"/>
67
+ :path="setting.instancepath"
68
+ v-bind:attributes="componentProps"/>
63
69
 
64
70
 
65
71
  <!-- password -->
@@ -67,27 +73,33 @@
67
73
  v-else-if="inputType == SimpleAppInputType.password"
68
74
  :type="type" v-model="modelValue" :pt="pt"
69
75
  :readonly="isReadonly" class="flex flex-col"
70
- :inputId="slotprops.uuid" :path="setting.instancepath"/>
76
+ :inputId="slotprops.uuid" :path="setting.instancepath"
77
+ v-bind="componentProps"/>
71
78
 
72
79
  <!-- rating -->
73
- <Rating v-else-if="inputType == SimpleAppInputType.rating"
74
- :is="inputComponent" :type="type" v-model="modelValue" :pt="pt"
80
+ <component v-else-if="inputType == SimpleAppInputType.rating"
81
+ :type="type" v-model="modelValue" :pt="pt"
75
82
  :readonly="isReadonly"
76
- :inputId="slotprops.uuid" :path="setting.instancepath"/>
83
+ :inputId="slotprops.uuid" :path="setting.instancepath"
84
+ v-bind="componentProps"/>
77
85
 
78
86
  <!-- chip -->
79
87
  <component v-else-if="inputType == SimpleAppInputType.chip"
80
88
  :is="inputComponent" :type="type" v-model="modelValue"
81
89
  :pt="pt"
82
90
  :disabled="isReadonly"
83
- :inputId="slotprops.uuid" :path="setting.instancepath"/>
91
+ :inputId="slotprops.uuid" :path="setting.instancepath"
92
+ v-bind="componentProps"
93
+ />
84
94
  <!-- simple component -->
85
95
  <InputNumber v-else-if="inputType == SimpleAppInputType.number"
86
96
  :type="type" v-model="modelValue"
87
97
  :readonly="isReadonly"
88
98
  :pt="pt"
89
99
  :class="!pt ? 'w-full flex flex-col' :''"
90
- :inputId="slotprops.uuid" :path="setting.instancepath"/>
100
+ :inputId="slotprops.uuid" :path="setting.instancepath"
101
+ v-bind="componentProps"
102
+ />
91
103
 
92
104
  <component v-else
93
105
  v-model="modelValue"
@@ -96,7 +108,9 @@
96
108
  :pt="pt"
97
109
  :type="type"
98
110
  class="w-full flex flex-col"
99
- :inputId="slotprops.uuid" :path="setting.instancepath"/>
111
+ :inputId="slotprops.uuid" :path="setting.instancepath"
112
+ v-bind="componentProps"
113
+ />
100
114
 
101
115
 
102
116
  <!-- component require special treatment -->
@@ -106,23 +120,23 @@
106
120
 
107
121
  <script lang="ts" setup>
108
122
  import moment from 'moment'
109
- import AutoComplete from 'primevue/autocomplete';
110
- import Calendar from 'primevue/calendar';
111
- import Checkbox from 'primevue/checkbox';
112
- import Chips from 'primevue/chips';
123
+ import AutoComplete,{ AutoCompleteProps } from 'primevue/autocomplete';
124
+ import Calendar,{ CalendarProps } from 'primevue/calendar';
125
+ import Checkbox,{ CheckboxProps } from 'primevue/checkbox';
126
+ import Chips,{ ChipsProps } from 'primevue/chips';
113
127
  import SimpleAppDocumentNo from './SimpleAppDocumentNo.vue';
114
128
  import SimpleAppAutocomplete from './SimpleAppAutocomplete.vue'
115
- import Dropdown from 'primevue/dropdown';
116
- import InputNumber from 'primevue/inputnumber';
117
- import InputSwitch from 'primevue/inputswitch';
118
- import InputText from 'primevue/inputtext';
119
- import Listbox from 'primevue/listbox';
120
- import MultiSelect from 'primevue/multiselect';
121
- import Password from 'primevue/password';
122
- import RadioButton from 'primevue/radiobutton';
123
- import Rating from 'primevue/rating';
124
- import Slider from 'primevue/slider';
125
- import Textarea from 'primevue/textarea';
129
+ import Dropdown,{ DropdownProps } from 'primevue/dropdown';
130
+ import InputNumber, { InputNumberProps } from 'primevue/inputnumber';
131
+ import InputSwitch, { InputSwitchProps } from 'primevue/inputswitch';
132
+ import InputText, { InputTextProps } from 'primevue/inputtext';
133
+ import Listbox,{ ListboxProps } from 'primevue/listbox';
134
+ import MultiSelect,{ MultiSelectProps } from 'primevue/multiselect';
135
+ import Password,{ PasswordProps } from 'primevue/password';
136
+ import RadioButton,{ RadioButtonProps } from 'primevue/radiobutton';
137
+ import Rating,{ RatingProps } from 'primevue/rating';
138
+ import Slider,{ SliderProps } from 'primevue/slider';
139
+ import Textarea, { TextareaProps } from 'primevue/textarea';
126
140
  import {SimpleAppInputType} from '~/types'
127
141
 
128
142
 
@@ -131,6 +145,12 @@ let inputComponent :Component
131
145
 
132
146
  const datevalue = ref('')
133
147
  const modelValue = defineModel()
148
+
149
+ if(modelValue.value){
150
+ datevalue.value = moment(modelValue.value as string ).format('YYYY-MM-DD')
151
+ }else{
152
+ datevalue.value = ''
153
+ }
134
154
  const props = withDefaults( defineProps<{
135
155
  inputType:SimpleAppInputType,
136
156
  label?:string,
@@ -141,7 +161,9 @@ const props = withDefaults( defineProps<{
141
161
  instancepath?:string,
142
162
  hidelabel?: boolean
143
163
  readonly?: boolean
144
- pt?:any
164
+ pt?:any,
165
+ componentProps?: InputNumberProps | InputSwitchProps | InputTextProps | TextareaProps | DropdownProps | CalendarProps | RatingProps
166
+
145
167
  }>(),{type:'text'})
146
168
 
147
169