@simitgroup/simpleapp-generator 1.5.1-alpha → 1.6.1-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.
Files changed (147) hide show
  1. package/dist/buildinschemas/branch.d.ts.map +1 -1
  2. package/dist/buildinschemas/branch.js +10 -0
  3. package/dist/buildinschemas/branch.js.map +1 -1
  4. package/dist/buildinschemas/index.d.ts +2 -0
  5. package/dist/buildinschemas/index.d.ts.map +1 -1
  6. package/dist/buildinschemas/index.js +5 -1
  7. package/dist/buildinschemas/index.js.map +1 -1
  8. package/dist/buildinschemas/keyvaluepair.d.ts +3 -0
  9. package/dist/buildinschemas/keyvaluepair.d.ts.map +1 -0
  10. package/dist/buildinschemas/keyvaluepair.js +28 -0
  11. package/dist/buildinschemas/keyvaluepair.js.map +1 -0
  12. package/dist/buildinschemas/message.d.ts +3 -0
  13. package/dist/buildinschemas/message.d.ts.map +1 -0
  14. package/dist/buildinschemas/message.js +34 -0
  15. package/dist/buildinschemas/message.js.map +1 -0
  16. package/dist/buildinschemas/organization.d.ts.map +1 -1
  17. package/dist/buildinschemas/organization.js +18 -1
  18. package/dist/buildinschemas/organization.js.map +1 -1
  19. package/dist/buildinschemas/systemmessage.d.ts +3 -0
  20. package/dist/buildinschemas/systemmessage.d.ts.map +1 -0
  21. package/dist/buildinschemas/systemmessage.js +43 -0
  22. package/dist/buildinschemas/systemmessage.js.map +1 -0
  23. package/dist/framework.d.ts.map +1 -1
  24. package/dist/framework.js +4 -2
  25. package/dist/framework.js.map +1 -1
  26. package/dist/generate.d.ts.map +1 -1
  27. package/dist/generate.js +37 -9
  28. package/dist/generate.js.map +1 -1
  29. package/dist/processors/bpmnbuilder.d.ts.map +1 -1
  30. package/dist/processors/bpmnbuilder.js +23 -32
  31. package/dist/processors/bpmnbuilder.js.map +1 -1
  32. package/dist/processors/jrxmlbuilder.d.ts +3 -0
  33. package/dist/processors/jrxmlbuilder.d.ts.map +1 -0
  34. package/dist/processors/jrxmlbuilder.js +57 -0
  35. package/dist/processors/jrxmlbuilder.js.map +1 -0
  36. package/dist/type.d.ts +6 -0
  37. package/dist/type.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/buildinschemas/branch.ts +10 -0
  40. package/src/buildinschemas/index.ts +2 -0
  41. package/src/buildinschemas/keyvaluepair.ts +26 -0
  42. package/src/buildinschemas/organization.ts +18 -1
  43. package/src/buildinschemas/systemmessage.ts +42 -0
  44. package/src/framework.ts +4 -2
  45. package/src/generate.ts +41 -13
  46. package/src/processors/bpmnbuilder.ts +34 -38
  47. package/src/processors/jrxmlbuilder.ts +38 -0
  48. package/src/type.ts +7 -1
  49. package/templates/basic/nest/controller.ts.eta +34 -17
  50. package/templates/basic/nest/processor.ts.eta +2 -1
  51. package/templates/basic/nest/resolver.ts.eta +1 -1
  52. package/templates/basic/nest/service.ts.eta +22 -4
  53. package/templates/basic/nest/type.ts.eta +2 -2
  54. package/templates/basic/nuxt/component.select.vue.eta +5 -1
  55. package/templates/basic/nuxt/pages.form.vue.eta +1 -1
  56. package/templates/basic/nuxt/pages.mobile.landing.vue.eta +4 -61
  57. package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +11 -13
  58. package/templates/nest/src/app.module.ts.eta +12 -4
  59. package/templates/nest/src/cloudapi/cloudapi.module.ts._eta +1 -1
  60. package/templates/nest/src/printapi/api/.gitignore.eta +4 -0
  61. package/templates/nest/src/printapi/api/.npmignore.eta +1 -0
  62. package/templates/nest/src/printapi/api/.openapi-generator/FILES.eta +8 -0
  63. package/templates/nest/src/printapi/api/.openapi-generator/VERSION.eta +1 -0
  64. package/templates/nest/src/printapi/api/.openapi-generator-ignore.eta +23 -0
  65. package/templates/nest/src/printapi/api/api.ts.eta +223 -0
  66. package/templates/nest/src/printapi/api/base.ts.eta +86 -0
  67. package/templates/nest/src/printapi/api/common.ts.eta +150 -0
  68. package/templates/nest/src/printapi/api/configuration.ts.eta +110 -0
  69. package/templates/nest/src/printapi/api/git_push.sh.eta +57 -0
  70. package/templates/nest/src/printapi/api/index.ts.eta +18 -0
  71. package/templates/nest/src/printapi/api/openapitools.json.eta +7 -0
  72. package/templates/nest/src/printapi/printapi.module.ts.eta +15 -0
  73. package/templates/nest/src/printapi/printapi.service.ts.eta +42 -0
  74. package/templates/nest/src/simpleapp/apischemas/index.ts._eta +11 -0
  75. package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +5 -4
  76. package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +7 -0
  77. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +10 -9
  78. package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +73 -0
  79. package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +104 -0
  80. package/templates/nest/src/simpleapp/generate/processors/docno.processor.ts.eta +77 -0
  81. package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +115 -0
  82. package/templates/nest/src/simpleapp/generate/processors/perm.processor.ts.eta +71 -0
  83. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +77 -13
  84. package/templates/nest/src/simpleapp/generate/processors/sysmsg.processor.ts.eta +49 -0
  85. package/templates/nest/src/simpleapp/generate/processors/tenant.processor.ts.eta +52 -0
  86. package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +12 -5
  87. package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +2 -2
  88. package/templates/nest/src/simpleapp/generate/workflow/workflow.delegate.ts.eta +33 -28
  89. package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +95 -26
  90. package/templates/nest/src/simpleapp/generate/workflow/workflow.type.ts.eta +4 -4
  91. package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +15 -0
  92. package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +3 -1
  93. package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +20 -3
  94. package/templates/nest/src/simpleapp/services/sysmsg.service.ts._etaxxx +43 -0
  95. package/templates/nest/src/simpleapp/services/userresolver.service.ts._eta +70 -0
  96. package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +8 -4
  97. package/templates/nest/src/simpleapp/types/index.ts._eta +5 -0
  98. package/templates/nuxt/assets/css/listview.css._eta +2 -2
  99. package/templates/nuxt/components/button/ButtonAction.vue._eta +11 -5
  100. package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +11 -2
  101. package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +1 -1
  102. package/templates/nuxt/components/form/{FormBranch.vue.eta → FormBranch.vue._eta} +1 -1
  103. package/templates/nuxt/components/image/ImageAvatar.vue.eta.vue +38 -0
  104. package/templates/nuxt/components/image/ImageOrganization.vue.eta.vue +40 -0
  105. package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta.vue +147 -0
  106. package/templates/nuxt/components/list/ListItem.vue.eta +24 -0
  107. package/templates/nuxt/components/list/ListMessages.vue.eta +89 -0
  108. package/templates/nuxt/components/list/ListView.vue.eta +9 -12
  109. package/templates/nuxt/components/renderer/RendererMoney.vue.eta +11 -12
  110. package/templates/nuxt/components/select/SelectTemplate.vue.eta +49 -20
  111. package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +2 -2
  112. package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +16 -15
  113. package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +92 -8
  114. package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +29 -6
  115. package/templates/nuxt/components/text/TextBold.vue._eta +13 -0
  116. package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +18 -2
  117. package/templates/nuxt/composables/getUserStore.generate.ts.eta +12 -3
  118. package/templates/nuxt/composables/hotvalue.generate.ts.eta +30 -0
  119. package/templates/nuxt/composables/pusher.ts._eta +13 -0
  120. package/templates/nuxt/composables/stringHelper.generate.ts.eta +2 -3
  121. package/templates/nuxt/composables/sysmessage.generate.ts.eta +20 -0
  122. package/templates/nuxt/composables/workflow.generate.ts.eta +9 -4
  123. package/templates/nuxt/layouts/mobile.vue._eta +31 -42
  124. package/templates/nuxt/nuxt.config.ts._eta +2 -2
  125. package/templates/nuxt/othermodules.d.ts.eta +449 -0
  126. package/templates/nuxt/pages/[xorg]/mobile/organization/[id].vue._eta +40 -0
  127. package/templates/nuxt/pages/[xorg]/mobile/organization/{index.vue.eta → index.vue.aetaz} +16 -13
  128. package/templates/nuxt/pages/[xorg]/organization.vue.eta +21 -15
  129. package/templates/nuxt/plugins/40.pusher.ts.eta +18 -0
  130. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +10 -1
  131. package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +4 -1
  132. package/templates/nuxt/types/schema.ts.eta +8 -1
  133. package/templates/nuxt/types/simpleappinput.ts.eta +3 -5
  134. package/templates/printformats/template.jrxml._eta +27 -0
  135. package/templates/project/groups/admin.json.eta +6 -1
  136. package/templates/project/jsonschemas/branch.json._eta +113 -0
  137. package/templates/project/jsonschemas/invoice.json._eta +5 -1
  138. package/templates/project/jsonschemas/organization.json._eta +111 -0
  139. package/templates/project/lang/default._json +71 -150
  140. package/templates/workflow/next/listener.ts.eta +6 -3
  141. package/tsconfig.tsbuildinfo +1 -1
  142. /package/templates/nest/src/simpleapp/services/{autoinc.service.ts.eta → autoinc.service.ts.etaxx} +0 -0
  143. /package/templates/nest/src/simpleapp/services/{branch.service.ts.eta → branch.service.ts.etaxxx} +0 -0
  144. /package/templates/nest/src/simpleapp/services/{docno.service.ts.eta → docno.service.ts.etaxxx} +0 -0
  145. /package/templates/nest/src/simpleapp/services/{org.service.ts.eta → org.service.ts.etaxxx} +0 -0
  146. /package/templates/nest/src/simpleapp/services/{perm.service.ts.eta → perm.service.ts.etaxxx} +0 -0
  147. /package/templates/nest/src/simpleapp/services/{tenant.service.ts.eta → tenant.service.ts.etaxxx} +0 -0
@@ -0,0 +1,449 @@
1
+ /**
2
+ * This file was automatically generated by simpleapp generator.
3
+ * MODIFICATION OVERRIDE BY GENERATEOR
4
+ * last change 2023-10-28
5
+ * Author: Ks Tan
6
+ */
7
+ declare module 'vue-pdf-embed';
8
+
9
+ declare module 'vue-cal' {
10
+ import Vue from 'vue';
11
+
12
+ // const VueCal = Vue.extend<VueCalProps>(Vue);
13
+
14
+ export type FormattedDate = string // eg (e.g. 2020-09-18)
15
+ export type View = 'years' | 'year' | 'month' | 'week' | 'day';
16
+ export type WeekDays = 1 | 2 | 3 | 4 | 5 | 6 | 7
17
+
18
+ export interface SplitDaysAttributes {
19
+ id: string | number
20
+ class: string
21
+ label: string
22
+ hide?: boolean
23
+ }
24
+
25
+ export interface EditableEvents {
26
+ title: boolean
27
+ drag: boolean
28
+ resize: boolean
29
+ delete: boolean
30
+ create: boolean
31
+ }
32
+
33
+ /**
34
+ * If no title is provided, no title will be displayed.
35
+ * content accepts free HTML, for instance: '<i class="v-icon material-icons">local_hospital</i>'.
36
+ * If no content is provided, no content will be displayed.
37
+ * You may need an event CSS class to handle different event types for instance. With different classes you can apply different styles to the events.
38
+ * E.g. backgrounds, images, borders, etc.
39
+ * The background attribute sets an event as a background event, which allows overlapping and disable the ability to drag & resize.
40
+ * When using splitDays, the split attribute accepts a number, starting from 1, corresponding to the split you want the event to appear in.
41
+ * Optionally, if you have set the id property in splitDays, you have to use the same id here (Integer or String).
42
+ * When the showAllDayEvents and time options are set to true, all the events with an attribute allDay set to true will show up in a fixed bar (week & day views).
43
+ */
44
+ export interface Event {
45
+ _eid?: string
46
+ start: string | Date // '2018-11-19 12:00', // Required.
47
+ end: string | Date // '2018-11-19 14:00', // Required.
48
+ // Instead of formatted dates, you can also provide Javascript Date objects:
49
+ // start: new Date(2018, 11 - 1, 19, 12, 0),
50
+ // end: new Date(2018, 11 - 1, 19, 14, 0),
51
+ title?: string // Optional.
52
+ content?: string // Optional.
53
+ contentFull?: string // opens in a d ialog
54
+ class?: string // Optional - space-separated css classes.
55
+ background?: boolean // Optional. (Event type not CSS property)
56
+ split?: number | string // Optional.
57
+ allDay?: boolean // Optional.
58
+ deletable?: boolean // optional - force undeletable when events are editable.
59
+ resizable?: boolean // optional - force unresizable when events are editable.
60
+ startTimeMinutes?: number
61
+ endTimeMinutes?: number
62
+
63
+ }
64
+
65
+ // export interface Event {
66
+ // created_at?: string | Date
67
+ // updated_at?: string | Date
68
+ // created_by_id?: number
69
+ // id?: number
70
+ // }
71
+
72
+ export type OnEventClick = (event: Event, e: MouseEvent) => void
73
+
74
+ export interface EventReadyChanged {
75
+ view: string
76
+ startDate: Date // View start - JS native Date object.
77
+ endDate: Date, // View end - JS native Date object.
78
+ firstCellDate: Date // Month view only, in case cell is out of current month - JS native Date object.
79
+ lastCellDate: Date // Month view only, in case cell is out of current month - JS native Date object.
80
+ outOfScopeEvents: Array<Event> // Month view only, all the events that are out of the current month.
81
+ events: Array<Event> // All the events in the current view.
82
+ week: number // Week number. Only returned if view is 'week'.
83
+ }
84
+
85
+ export interface EventChange {
86
+ event: Event
87
+ originalEvent: Event
88
+ }
89
+
90
+ export interface EventTitleChange {
91
+ event: Event
92
+ oldTitle: string
93
+ }
94
+
95
+ export interface EventDurationChange extends EventChange {
96
+ oldDate: Date
97
+ }
98
+
99
+
100
+ export interface Events {
101
+ ready: EventReadyChanged
102
+ 'view-change': EventReadyChanged
103
+ 'cell-click': Date
104
+ 'cell-dblclick': Date
105
+ 'cell-contextmenu': Date & { x: number, y: number }
106
+ 'cell-keypress-enter': Date
107
+ 'cell-focus': Date
108
+ 'event-focus': Event
109
+ 'event-mouse-enter': Event
110
+ 'event-mouse-leave': Event
111
+ 'event-create': Event
112
+ 'event-drag-create': Event
113
+ 'event-delete': Event
114
+ 'event-title-change': Event
115
+ 'event-duration-change': EventDurationChange
116
+ 'event-resizing': any
117
+ 'event-drop': any
118
+ 'event-change': EventChange
119
+ }
120
+
121
+ export type EventListeners = {
122
+ [A in keyof Events]: (value: Events[A]) => void
123
+ }
124
+
125
+
126
+ export interface VueCalEvent extends Event {
127
+ daysCount: number
128
+ deleting: boolean
129
+ draggable: boolean
130
+ dragging: boolean
131
+ draggingStatic: boolean
132
+ endTimeMinutes: number
133
+ focused: boolean
134
+ repeat: boolean
135
+ resizing: boolean
136
+ segments: any
137
+ titleEditable: boolean
138
+ }
139
+
140
+ export interface VueCalView {
141
+ id: string
142
+ title: string
143
+ startDate: any
144
+ endDate: any
145
+ firstCellDate: any
146
+ lastCellDate: any
147
+ selectedDate: any
148
+ events: VueCalEvent[]
149
+ }
150
+
151
+ export interface Props {
152
+ activeView?: View //default?: 'week'
153
+ /** When the all day bar is visible and Vue Cal is also scrollable horizontally (due to minCellWidth or day splits with minSplitWidth), the all-day bar must have a fixed height for this particular layout.
154
+ * Only if these conditions are fulfilled, the height provided through this option will be used. If none is provided the default height will be used.
155
+ * The height can be any valid CSS height (as a string) or an integer for an amount of pixels. */
156
+ allDayBarHeight?: string | number //default?: '25px'
157
+ cellClickHold?: boolean //default?: true
158
+ /** When set to true, a right click on a cell will emit the cell-contextmenu event, providing an object containing?: the date and time at cursor, the x and y position of cursor, and the full original DOM event. */
159
+ cellContextmenu?: boolean //default?: false
160
+ clickToNavigate?: boolean //default?: false
161
+ dblclickToNavigate?: boolean //default?: true
162
+ disableDatePrototypes?: boolean //default?: false
163
+ /** Allows you to provide an array of formatted dates (e.g. 2020-09-18) to disable. */
164
+ disableDays?: Array<FormattedDate> //default?: []
165
+ disableViews?: Array<View> //default?: []
166
+ dragToCreateEvent?: boolean //default?: true
167
+ dragToCreateThreshold?: number //default?: 15
168
+ /** When editableEvents is set to true, it allows?:
169
+ Dragging and dropping events
170
+ Resizing events by dragging the handle showing at the bottom of each event if time is set to true,
171
+ Deleting events by click and hold an event.
172
+ Editing events title */
173
+ editableEvents?: boolean | EditableEvents //default?: false
174
+ events?: Array<Event> //default?: [
175
+ eventsCountOnYearView?: boolean //default?: false
176
+ eventsOnMonthView?: boolean | string //default?: false
177
+ hideBody?: boolean //default?: false
178
+ /** When set to true, the title bar with navigating arrows will disappear. You can still navigate from a view to another with the view selector and clicking a cell (narrower view).*/
179
+ hideTitleBar?: boolean //default?: false
180
+ /** When set to true, the top view selector will disappear. You can still navigate from a view to another by clicking a cell (narrower view) or the view title (broader view). */
181
+ hideViewSelector?: boolean //default?: false
182
+ /** Hide particular days of the week. This option accepts an array of days (day numbers) to hide, starting at 1 for Monday, to 7 for Sunday. */
183
+ hideWeekdays?: Array<WeekDays> //default?: []
184
+ hideWeekends?: boolean //default?: false
185
+ locale?: string //default?: 'en'
186
+ maxDate?: string | Date //efault?: ''
187
+ /** When a number is set, in pixels, each cell of the week view (only) will have this minimum width. If it does not fit in the calendar body, the overflow will be scrollable. If minSplitWidth is also set, it will override minCellWidth.*/
188
+ minCellWidth?: number //default?: 0 // In pixels.
189
+ minDate?: string | Date //efault?: ''
190
+ minEventWidth?: number //default?: 0 // In percent.
191
+ /** This is for day splits only, and it applies to the week and day views (only).
192
+ When a number is set, in pixels, each split of each cell will have this minimum width.
193
+ If it does not fit in the calendar body, the overflow will be scrollable.
194
+ If minCellWidth is also set, minSplitWidth will override it on week view. */
195
+ minSplitWidth?: number //default?: 0 // In pixels.
196
+ onEventClick?: Function //default?: null
197
+ onEventCreate?: Function //default?: null
198
+ onEventDblclick?: Function //default?: null
199
+ overlapsPerTimeStep?: boolean //default?: false
200
+ resizeX?: boolean //default?: false
201
+ selectedDate?: string | Date //default?: ''
202
+ /**
203
+ * When the showAllDayEvents is set to true the events with an allDay attribute set to true will be displayed in a fixed top bar on the week & day views.
204
+ The all day events bar will only show up if the options showAllDayEvents & time are set to true.
205
+ time is important since without time information every event is an all-day event there is no point in separating them then.
206
+ * When showAllDayEvents is set to false, all the all day events (allDay attribute set to true), will show up as a normal background event.
207
+ * On month view, switching showAllDayEvents on and off will not have any impact since both should display the all day events.
208
+ * showAllDayEvents accepts a Boolean or the string 'short', to display only the event title. */
209
+ showAllDayEvents?: boolean | 'short' //default?: false
210
+ /** When set to true, the weeks numbers will show in the first column on the month view (only). You can also provide a custom renderer to the weeks numbers cells through the week-number-cell slot.*/
211
+ showWeekNumbers?: boolean | string //default?: false
212
+ /** When set to true, the days of the week headings will be truncated to 3 letters. Does not apply to the title of the day view. 2 media queries are truncating the days of the week bellow 450px,*/
213
+ small?: boolean //default?: false
214
+ /** With the snapToTime option, you can make sure the event starts and end at specific intervals of minutes.
215
+ E.g. ?:snap-to-time="15" will snap the event to the closest ?:00, ?:15, ?:30, ?:45 while dragging.
216
+ This option also applies on event resizing after the drag-creation. */
217
+ snapToTime?: number //default?: null
218
+ specialHours?: object //default?: {}
219
+ /** Split each day into multiple vertical splits.
220
+ Accepts an array of split objects with attributes.
221
+ Each split object can have these attributes, they are all optional?: */
222
+ splitDays?: Array<any> //default?: [
223
+ startWeekOnSunday?: boolean //default?: false
224
+ stickySplitLabels?: boolean //default?: false
225
+ time?: boolean //default?: true
226
+ timeCellHeight?: number //default?: 40 // In pixels.
227
+ /**
228
+ * When defined, overrides the default time format in time cells and events.
229
+ * Formatted time can contain any character but the following characters will be replaced?:
230
+ *
231
+ * H?: Hours no leading zero, 24-hour format
232
+ * HH?: Hours with leading zero, 24-hour format
233
+ * h?: Hours no leading zero, 12-hour format
234
+ * hh?: Hours with leading zero, 12-hour format
235
+ * m?: Minutes no leading zero
236
+ * mm?: Minutes with leading zero
237
+ * {am}?: am or pm
238
+ * The characters `{` and `}` are removed and used only to delimit keywords when there is no space.
239
+ * E.g. "h?:mm{am}".
240
+ */
241
+ timeFormat?: string //default?: ''
242
+ /** If time is enabled, set the start of the timeline in minutes. By default it starts at midnight. */
243
+ timeFrom?: number //default?: 0 // In minutes.
244
+ /** If time is enabled, set the time increment in minutes. */
245
+ timeStep?: number //default?: 30 // In minutes.
246
+ /** If time is enabled, set the end of the timeline in minutes. By default it ends at 24?:00. */
247
+ timeTo?: number //default?: 24 * 60 // In minutes.
248
+ /** Adds a Today button in the title bar to quickly go to Today's date. */
249
+ todayButton?: boolean //default?: false
250
+ transitions?: boolean //default?: true
251
+ twelveHour?: boolean //default?: false
252
+ /**
253
+ * When set to true, the days of the week headings will be truncated to 1 letter. Does not apply to the title of the day view.
254
+ * In Addition, the whole calendar gets applied a smaller font size of 0.9em, and the current view title is also reduced.
255
+ * 2 media queries are truncating the days of the week bellow 450px,
256
+ */
257
+ xsmall?: boolean //default?: false
258
+ watchRealTime?: boolean //default: false
259
+ }
260
+
261
+ export namespace slots {
262
+ export namespace event {
263
+ export interface Props {
264
+ view: View
265
+ event: VueCalEvent
266
+ }
267
+ }
268
+ }
269
+
270
+
271
+ export interface VueCal extends Props {}
272
+
273
+ export class VueCal extends Vue {
274
+ $on<T extends keyof Events>(event: T, callback: EventListeners[T]) {
275
+ return super.$on(event, callback);
276
+ }
277
+
278
+ //region: Data
279
+ ready: boolean; // Is vue-cal ready.
280
+ // Make texts reactive before a locale is loaded.
281
+ texts: any;
282
+ utils: {
283
+ // Remove prototypes ASAP if the user wants so.
284
+ date: any
285
+ cell: any
286
+ // Note: Destructuring class method loses the `this` context and Vue Cal becomes inaccessible
287
+ // from the event utils function. Don't do:
288
+ // const { eventInRange, createEventSegments } = this.utils.event
289
+ event: any
290
+ };
291
+ modules: { dnd: null };
292
+
293
+ minutesAtCursor(e: MouseEvent)
294
+
295
+ // At any time this object will be filled with current view, visible events and selected date.
296
+ view: VueCalView;
297
+ eventIdIncrement: number; // Internal unique id.
298
+ // or updated at least on each cells rerender, in order to keep Today's date accurate.
299
+ now: Date;
300
+
301
+ //endregion
302
+ // Useful when watchRealTime = true, 2 timeouts: 1 to snap to round minutes, then 1 every minute.
303
+ timeTickerIds: [ any, any ];
304
+ // An array of mutable events updated each time given external events array changes.
305
+ mutableEvents: any;
306
+ // Transition when switching view. left when going toward the past, right when going toward future.
307
+ transitionDirection: string;
308
+
309
+ //region: Methods
310
+ /**
311
+ * Shorthand function for external call (via $refs).
312
+ */
313
+ previous()
314
+
315
+ /**
316
+ * Shorthand function for external call (via $refs).
317
+ */
318
+ next()
319
+
320
+ /**
321
+ * On click on previous or next arrow, update the calendar visible date range.
322
+ *
323
+ * @param {Boolean} next
324
+ */
325
+ previousNext(next = true)
326
+
327
+ // Preset at now date on load, but updated every minute if watchRealTime,
328
+
329
+ /**
330
+ * On click/dblclick of a cell go to a narrower view if available.
331
+ * E.g. Click on month cell takes you to week view if not hidden, otherwise on day view if not hidden.
332
+ *
333
+ * @param {String | Date} date A starting date for the view, if none, fallbacks to the selected date,
334
+ * If also empty fallbacks to the current view start date.
335
+ */
336
+ switchToNarrowerView(date = null)
337
+
338
+ /**
339
+ * Switches to the specified view on view selector click, or programmatically form external call (via $refs).
340
+ * If a date is given, it will be selected and if the view does not contain it, it will go to that date.
341
+ *
342
+ * @param {String} view the view to go to. Among `years`, `year`, `month`, `week`, `day`.
343
+ * @param {String | Date} date A starting date for the view, if none, fallbacks to the selected date,
344
+ * If also empty fallbacks to the current view start date.
345
+ * @param {Boolean} fromViewSelector to know if the caller is the built-in view selector.
346
+ */
347
+ switchView(view: ViewEvents, date: Date = null, fromViewSelector: boolean = false)
348
+
349
+ // The events source of truth.
350
+
351
+ /**
352
+ * Creates a new event in vue-cal memory (in the mutableEvents array) starting at the given date & time.
353
+ * Proxy method to allow call from cell click & hold or external call (via $refs).
354
+ * Notes: Event duration is by default 2 hours. You can override the event end through eventOptions.
355
+ *
356
+ * @param {String | Date} dateTime date & time at which the event will start.
357
+ * @param {Number} duration the event duration in minutes.
358
+ * @param {Object} eventOptions an object of options to override the event creation defaults.
359
+ * (can be any key allowed in an event object)
360
+ * @return {Object} the created event.
361
+ */
362
+ createEvent(dateTime: string | Date, duration: number, eventOptions: Events = {})
363
+
364
+ /**
365
+ * Only import locale on demand to keep a small library weight.
366
+ *
367
+ * @param {String|Object} locale the language user whishes to have on vue-cal.
368
+ */
369
+ loadLocale(locale)
370
+
371
+ //endregion
372
+ }
373
+
374
+ export default VueCal;
375
+
376
+ global {
377
+ type VueCalDateTimeFormat = VueCalTimeFormat &
378
+ string
379
+ | 'YYYY' // full year. E.g. `2019`
380
+ | 'YY' //2 last digits of the year. E.g. `19`
381
+ | 'MMMM' //month in full. E.g. `January`
382
+ | 'MMM' // 3 first letters of the month. E.g. `Jan`
383
+ | 'MM' // month number with leading zero. (01-12) E.g. `01`
384
+ | 'M' // month number without leading zero. (1-12) E.g. `1`
385
+ | 'DD' // date of the month with leading zero. (01-31) E.g. `01`
386
+ | 'D' // date of the month without leading zero. (1-31) E.g. `1`
387
+ | 'S' // (usually with surrounding `{ }`) only in English, will output `st`, `nd`, `rd` or `th`.
388
+ | 'dddd' // day of the week in full. E.g. `Monday`
389
+ | 'ddd' // 3 first letters of the day of the week. E.g. `Mon`
390
+ | 'dd' // first letter of the day of the week. E.g. `M`
391
+ | 'd' // number of the day of the week. (1-7) E.g. `1` for Monday
392
+
393
+ type VueCalTimeFormat =
394
+ | string
395
+ | 'HH' // Hours with leading zero, 24-hour format. (00-24)E.g. `20`
396
+ | 'H' // Hours without leading zero, 24-hour format. (0-24)E.g. `20`
397
+ | 'hh' // Hours with leading zero, 12-hour format. E.g. `08`
398
+ | 'h' // Hours without leading zero, 12-hour format. E.g. `8`
399
+ | 'mm' // Minutes with leading zero. E.g. `08`
400
+ | 'm' // Minutes without leading zero. E.g. `8`
401
+ | 'am' // (usually with surrounding `{ }`) am or pm (also localized if any)
402
+
403
+ interface Date {
404
+ addDays(days: number): this // adds days to a Date object and returns it. The original Date stays untouched as a copy is made.
405
+ subtractDays(days: number): this // Subtracts days to a Date object and returns it. The original Date stays untouched as a copy is made.
406
+ addHours(hours: number): this //Adds hours to a Date object and returns it. The original Date stays untouched as a copy is made. `hours` is an integer.
407
+ subtractHours(hours: number): this // Subtracts hours to a Date object and returns it. The original Date stays untouched as a copy is made. `hours` is an integer.
408
+ addMinutes(minutes: number): this // Adds minutes to a Date object and returns it. The original Date stays untouched as a copy is made. `minutes` is an integer.
409
+ subtractMinutes(minutes: number): this //Subtracts minutes to a Date object and returns it. The original Date stays untouched as a copy is made. `minutes` is an integer.
410
+ getWeek(): number // Returns the week number (1 to 53) of a date.
411
+ isToday(): boolean // Returns true if the date is Today.
412
+ isLeapYear(): boolean //Returns true if the date is in a leap year.
413
+ /**
414
+ Returns a formatted date string. Default format is 'YYYY-MM-DD', but you can use any formatting keyword from this list, and add any character not present in this mapping:
415
+ * YYYY: full year. E.g. `2019`
416
+ * YY: 2 last digits of the year. E.g. `19`
417
+ * MMMM: month in full. E.g. `January`
418
+ * MMM: 3 first letters of the month. E.g. `Jan`
419
+ * MM: month number with leading zero. (01-12) E.g. `01`
420
+ * M: month number without leading zero. (1-12) E.g. `1`
421
+ * DD: date of the month with leading zero. (01-31) E.g. `01`
422
+ * D: date of the month without leading zero. (1-31) E.g. `1`
423
+ * S: (usually with surrounding `{ }`) only in English, will output `st`, `nd`, `rd` or `th`.
424
+ * dddd: day of the week in full. E.g. `Monday`
425
+ * ddd: 3 first letters of the day of the week. E.g. `Mon`
426
+ * dd: first letter of the day of the week. E.g. `M`
427
+ * d: number of the day of the week. (1-7) E.g. `1` for Monday
428
+ * And also all the keywords from the following formatTime() function.
429
+ */
430
+ format(format: VueCalDateTimeFormat): string
431
+
432
+ /**
433
+ Returns a formatted time string.
434
+ The format() function can also do this, but this might be a shortcut if you just want the default time formatting.
435
+ E.g. `formatTime()`).
436
+ This function will also be slightly faster than format() as lighter in functionality.
437
+ Default format is 'HH:mm', but you can use any formatting keyword from this list, and add any character not present in this mapping:
438
+ * HH: Hours with leading zero, 24-hour format. (00-24)E.g. `20`
439
+ * H: Hours without leading zero, 24-hour format. (0-24)E.g. `20`
440
+ * hh: Hours with leading zero, 12-hour format. E.g. `08`
441
+ * h: Hours without leading zero, 12-hour format. E.g. `8`
442
+ * mm: Minutes with leading zero. E.g. `08`
443
+ * m: Minutes without leading zero. E.g. `8`
444
+ * am: (usually with surrounding `{ }`) am or pm (also localized if any)
445
+ */
446
+ formatTime(format: VueCalTimeFormat): string
447
+ }
448
+ }
449
+ }
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <LazyFormBranch :_id="_id" class="w-full" @after="after" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ /**
7
+ * This file was automatically generated by simpleapp generator.
8
+ * --remove-this-line-to-prevent-override--
9
+ * last change 2023-09-09
10
+ * author: Ks Tan
11
+ */
12
+
13
+ import { Branch } from "~/simpleapp/generate/types";
14
+ const doc = useNuxtApp().$BranchDoc();
15
+ const _id = getPathPara("id", "");
16
+
17
+ const after = (actionName: string, data: Branch) => {
18
+ console.log("Branch capture after emits ", actionName);
19
+ switch (actionName) {
20
+ case "exit":
21
+ goTo('organization');
22
+ break;
23
+ case "create":
24
+ goTo(doc.getDocName(), data._id);
25
+ refreshDocumentList('branch');
26
+ goTo('organization');
27
+ break;
28
+ case "update":
29
+ refreshDocumentList('branch');
30
+ goTo('organization');
31
+ break;
32
+ case "delete":
33
+ goTo(doc.getDocName(), "new");
34
+ refreshDocumentList('branch');
35
+ goTo('organization');
36
+ break;
37
+ }
38
+ };
39
+ </script>
40
+
@@ -1,44 +1,47 @@
1
1
  <template>
2
-
3
2
  <div class="w-full flex-col flex">
4
3
  <title>{{ t("organization") }}</title>
5
4
  <MobileToolbar class="bg-gray-600">
6
- <template #center><TextTitle class="text-white">{{ t("organization") }}</TextTitle></template>
5
+ <template #center
6
+ ><TextTitle class="text-white">{{
7
+ t("organization")
8
+ }}</TextTitle></template
9
+ >
7
10
  <template #end>
8
11
  <ButtonText @click="showEditOrg = true" class="text-white"
9
12
  ><i class="pi pi-pencil"></i
10
13
  ></ButtonText>
11
14
  </template>
12
15
  </MobileToolbar>
13
-
14
- <div class="w-full flex flex-row p-2 border-b border-gray-300 ">
16
+
17
+ <div class="w-full flex flex-row p-2 border-b border-gray-300">
15
18
  <div class="p-4">
16
19
  <div class="border w-12 h-12 md:w-24 md:h24"></div>
17
20
  </div>
18
- <div class="flex flex-col flex-1 ">
21
+ <div class="flex flex-col flex-1">
19
22
  <TextTitle>{{ data.orgName }} / {{ data.orgCode }}</TextTitle>
20
23
  <TextSubtitle>
21
24
  {{ data.description }}
22
- </TextSubtitle>
25
+ </TextSubtitle>
23
26
  </div>
24
27
  </div>
25
28
 
26
- <div class="w-full p-2 flex flex-col ">
27
-
29
+ <div class="w-full p-2 flex flex-col">
28
30
  <div class="flex flex-row justify-end">
29
- <TextTitle class="flex-1 p-2">{{ t('branches') }}</TextTitle>
31
+ <TextTitle class="flex-1 p-2">{{ t("branches") }}</TextTitle>
30
32
  <div>
31
33
  <ButtonPrimary @click="goBranch('new')">
32
34
  <i class="pi pi-plus"></i> <span>{{ t("addBranches") }}</span>
33
35
  </ButtonPrimary>
34
36
  </div>
35
37
  </div>
36
- <ListView class="border rounded-lg border-gray-400 dark:border-gray-600"
38
+ <ListView
39
+ class="border rounded-lg border-gray-400 dark:border-gray-600"
37
40
  :list="branchlist"
38
41
  title-field="branchName"
39
42
  sub-title-field="branchCode"
40
43
  :url="getDocumentUrl('organization', id)"
41
- #default="{item}"
44
+ #default="{ item }"
42
45
  >
43
46
  <div class="flex flex-row">
44
47
  <div class="flex-col flex flex-1">
@@ -50,7 +53,6 @@
50
53
  <renderer-boolean v-model="item.active"></renderer-boolean>
51
54
  </div>
52
55
  </div>
53
-
54
56
  </ListView>
55
57
  </div>
56
58
 
@@ -75,6 +77,7 @@
75
77
  * Author: Ks Tan
76
78
  */
77
79
  import { FormCrudEvent, SimpleAppInputType } from "~/types";
80
+ import { Branch } from "~/simpleapp/generate/openapi";
78
81
  import ConfirmPopup from "primevue/confirmpopup";
79
82
  import { useConfirm } from "primevue/useconfirm";
80
83
  const confirm = useConfirm();
@@ -87,7 +90,7 @@ const orgId = computed(() => <string>getUserProfile()?.orgRecordId);
87
90
  const doc = $OrganizationDoc();
88
91
  const brancdoc = $BranchDoc();
89
92
  const data = doc.getReactiveData();
90
- const branchlist = ref([]);
93
+ const branchlist = ref<Branch[]>([]);
91
94
  const isReadOnly = ref(true);
92
95
  const getCurrentOrg = async () => {
93
96
  await doc.getById(orgId.value);
@@ -1,44 +1,50 @@
1
1
  <template>
2
-
3
2
  <div class="w-full flex-col flex">
4
3
  <title>{{ t("organization") }}</title>
5
4
  <MobileToolbar class="bg-gray-600">
6
- <template #center><TextTitle class="text-white">{{ t("organization") }}</TextTitle></template>
5
+ <template #center
6
+ ><TextTitle class="text-white">{{
7
+ t("organization")
8
+ }}</TextTitle></template
9
+ >
7
10
  <template #end>
8
11
  <ButtonText @click="showEditOrg = true" class="text-white"
9
12
  ><i class="pi pi-pencil"></i
10
13
  ></ButtonText>
11
14
  </template>
12
15
  </MobileToolbar>
13
-
14
- <div class="w-full flex flex-row p-2 border-b border-gray-300 ">
15
- <div class="p-4">
16
- <div class="border w-12 h-12 md:w-24 md:h24"></div>
16
+
17
+ <div class="w-full flex flex-row p-2 border-b border-gray-300">
18
+ <div class="">
19
+ <!-- -->
20
+ <!-- <div class="border w-12 h-12 md:w-24 md:h24"> -->
21
+ <ImageOrganization :changable="!doc.isReadOnly()"></ImageOrganization>
22
+ <!-- </div> -->
17
23
  </div>
18
- <div class="flex flex-col flex-1 ">
24
+ <div class="flex flex-col flex-1">
19
25
  <TextTitle>{{ data.orgName }} / {{ data.orgCode }}</TextTitle>
20
26
  <TextSubtitle>
21
27
  {{ data.description }}
22
- </TextSubtitle>
28
+ </TextSubtitle>
23
29
  </div>
24
30
  </div>
25
31
 
26
- <div class="w-full p-2 flex flex-col ">
27
-
32
+ <div class="w-full p-2 flex flex-col">
28
33
  <div class="flex flex-row justify-end">
29
- <TextTitle class="flex-1 p-2">{{ t('branches') }}</TextTitle>
34
+ <TextTitle class="flex-1 p-2">{{ t("branches") }}</TextTitle>
30
35
  <div>
31
36
  <ButtonPrimary @click="goBranch('new')">
32
37
  <i class="pi pi-plus"></i> <span>{{ t("addBranches") }}</span>
33
38
  </ButtonPrimary>
34
39
  </div>
35
40
  </div>
36
- <ListView class="border rounded-lg border-gray-400 dark:border-gray-600"
41
+ <ListView
42
+ class="border rounded-lg border-gray-400 dark:border-gray-600"
37
43
  :list="branchlist"
38
44
  title-field="branchName"
39
45
  sub-title-field="branchCode"
40
46
  :url="getDocumentUrl('organization', id)"
41
- #default="{item}"
47
+ #default="{ item }"
42
48
  >
43
49
  <div class="flex flex-row">
44
50
  <div class="flex-col flex flex-1">
@@ -50,7 +56,6 @@
50
56
  <renderer-boolean v-model="item.active"></renderer-boolean>
51
57
  </div>
52
58
  </div>
53
-
54
59
  </ListView>
55
60
  </div>
56
61
 
@@ -75,6 +80,7 @@
75
80
  * Author: Ks Tan
76
81
  */
77
82
  import { FormCrudEvent, SimpleAppInputType } from "~/types";
83
+ import { Branch } from "~/simpleapp/generate/openapi";
78
84
  import ConfirmPopup from "primevue/confirmpopup";
79
85
  import { useConfirm } from "primevue/useconfirm";
80
86
  const confirm = useConfirm();
@@ -87,7 +93,7 @@ const orgId = computed(() => <string>getUserProfile()?.orgRecordId);
87
93
  const doc = $OrganizationDoc();
88
94
  const brancdoc = $BranchDoc();
89
95
  const data = doc.getReactiveData();
90
- const branchlist = ref([]);
96
+ const branchlist = ref<Branch[]>([]);
91
97
  const isReadOnly = ref(true);
92
98
  const getCurrentOrg = async () => {
93
99
  await doc.getById(orgId.value);