@@ -138,6 +138,10 @@ export class MetadataPropertyType {
138
138
allowableMin ;
139
139
allowableMax ;
140
140
attributes ;
141
+ uploadTo ;
142
+ input ;
143
+ format ;
144
+ ref ;
141
145
constructor ( init ) { Object . assign ( this , init ) ; }
142
146
}
143
147
export class MetadataType {
@@ -148,6 +152,8 @@ export class MetadataType {
148
152
implements ;
149
153
displayType ;
150
154
description ;
155
+ notes ;
156
+ icon ;
151
157
isNested ;
152
158
isEnum ;
153
159
isEnumInt ;
@@ -164,6 +170,63 @@ export class MetadataType {
164
170
meta ;
165
171
constructor ( init ) { Object . assign ( this , init ) ; }
166
172
}
173
+ export class ImageInfo {
174
+ svg ;
175
+ uri ;
176
+ alt ;
177
+ cls ;
178
+ }
179
+ export class InputInfo {
180
+ id ;
181
+ name ;
182
+ type ;
183
+ value ;
184
+ placeholder ;
185
+ help ;
186
+ label ;
187
+ title ;
188
+ size ;
189
+ pattern ;
190
+ readOnly ;
191
+ required ;
192
+ disabled ;
193
+ autocomplete ;
194
+ autofocus ;
195
+ min ;
196
+ max ;
197
+ step ;
198
+ minLength ;
199
+ maxLength ;
200
+ accept ;
201
+ capture ;
202
+ multiple ;
203
+ allowableValues ;
204
+ allowableEntries ;
205
+ options ;
206
+ ignore ;
207
+ css ;
208
+ meta ;
209
+ }
210
+ export class FormatInfo {
211
+ method ;
212
+ options ;
213
+ locale ;
214
+ }
215
+ export class RefInfo {
216
+ model ;
217
+ selfId ;
218
+ refId ;
219
+ refLabel ;
220
+ }
221
+ export class KeyValuePair {
222
+ key ;
223
+ value ;
224
+ }
225
+ export class FieldCss {
226
+ field ;
227
+ input ;
228
+ label ;
229
+ }
167
230
export class NewInstanceResolver {
168
231
tryResolve ( ctor ) {
169
232
return new ctor ( ) ;
@@ -1198,7 +1261,7 @@ export function createErrorStatus(message, errorCode = 'Exception') {
1198
1261
export function createFieldError ( fieldName , message , errorCode = 'Exception' ) {
1199
1262
return new ResponseStatus ( { errors : [ new ResponseError ( { fieldName, errorCode, message } ) ] } ) ;
1200
1263
}
1201
- export function isFormData ( body ) { return typeof window != "undefined" && body instanceof FormData ; }
1264
+ export function isFormData ( body ) { return body instanceof FormData ; }
1202
1265
function createErrorResponse ( errorCode , message , type = null ) {
1203
1266
const error = apply ( new ErrorResponse ( ) , e => {
1204
1267
if ( type != null )
@@ -1219,9 +1282,34 @@ export function createError(errorCode, message, fieldName) {
1219
1282
} )
1220
1283
} ) ;
1221
1284
}
1222
- export function toCamelCase ( s ) { return ! s ? s : s . charAt ( 0 ) . toLowerCase ( ) + s . substring ( 1 ) ; }
1223
- export function toPascalCase ( s ) { return ! s ? s : s . charAt ( 0 ) . toUpperCase ( ) + s . substring ( 1 ) ; }
1224
- export function toKebabCase ( s ) { return ( s || '' ) . replace ( / ( [ a - z ] ) ( [ A - Z ] ) / g, '$1-$2' ) . toLowerCase ( ) ; }
1285
+ export function toPascalCase ( s ) {
1286
+ if ( ! s )
1287
+ return '' ;
1288
+ const isAllCaps = s . match ( / ^ [ A - Z 0 - 9 _ ] + $ / ) ;
1289
+ if ( isAllCaps ) {
1290
+ const words = s . split ( '_' ) ;
1291
+ return words . map ( x => x [ 0 ] . toUpperCase ( ) + x . substring ( 1 ) . toLowerCase ( ) ) . join ( '' ) ;
1292
+ }
1293
+ if ( s . includes ( '_' ) ) {
1294
+ return s . split ( '_' ) . filter ( x => x [ 0 ] ) . map ( x => x [ 0 ] . toUpperCase ( ) + x . substring ( 1 ) ) . join ( '' ) ;
1295
+ }
1296
+ return s . charAt ( 0 ) . toUpperCase ( ) + s . substring ( 1 ) ;
1297
+ }
1298
+ export function toCamelCase ( s ) {
1299
+ s = toPascalCase ( s ) ;
1300
+ if ( ! s )
1301
+ return '' ;
1302
+ return s . charAt ( 0 ) . toLowerCase ( ) + s . substring ( 1 ) ;
1303
+ }
1304
+ export function toKebabCase ( s ) {
1305
+ if ( ! s || s . length <= 1 )
1306
+ return s . toLowerCase ( ) ;
1307
+ return s
1308
+ . replace ( / ( [ A - Z 0 - 9 ] ) / g, '-$1' )
1309
+ . toLowerCase ( )
1310
+ . replace ( / ^ - / , '' )
1311
+ . replace ( / - + / g, '-' ) ;
1312
+ }
1225
1313
export function map ( o , f ) { return o == null ? null : f ( o ) ; }
1226
1314
export function camelCaseAny ( o ) {
1227
1315
if ( ! o || ! ( o instanceof Object ) || Array . isArray ( o ) )
@@ -1361,7 +1449,11 @@ export function splitTitleCase(s) {
1361
1449
to . push ( s . substring ( lastSplit , s . length ) ) ;
1362
1450
return to . filter ( x => ! ! x ) ;
1363
1451
}
1364
- export function humanify ( s ) { return ! s || s . indexOf ( ' ' ) >= 0 ? s : ucFirst ( splitTitleCase ( s ) . join ( ' ' ) ) ; }
1452
+ export function humanify ( s ) {
1453
+ return ! s || indexOfAny ( s , [ ' ' , ',' , '.' , ':' , '-' ] ) >= 0
1454
+ ? s
1455
+ : ucFirst ( splitTitleCase ( s ) . join ( ' ' ) ) ;
1456
+ }
1365
1457
export function queryString ( url ) {
1366
1458
if ( ! url || url . indexOf ( '?' ) === - 1 )
1367
1459
return { } ;
@@ -2247,30 +2339,34 @@ export function safeVarName(s) {
2247
2339
}
2248
2340
export function pick ( o , keys ) {
2249
2341
const to = { } ;
2250
- for ( const k in o ) {
2251
- if ( o . hasOwnProperty ( k ) && keys . indexOf ( k ) >= 0 ) {
2342
+ Object . keys ( o ) . forEach ( k => {
2343
+ if ( keys . indexOf ( k ) >= 0 ) {
2252
2344
to [ k ] = o [ k ] ;
2253
2345
}
2254
- }
2346
+ } ) ;
2255
2347
return to ;
2256
2348
}
2257
2349
export function omit ( o , keys ) {
2258
2350
const to = { } ;
2259
- for ( const k in o ) {
2260
- if ( o . hasOwnProperty ( k ) && keys . indexOf ( k ) < 0 ) {
2351
+ if ( ! o )
2352
+ return to ;
2353
+ Object . keys ( o ) . forEach ( k => {
2354
+ if ( keys . indexOf ( k ) < 0 ) {
2261
2355
to [ k ] = o [ k ] ;
2262
2356
}
2263
- }
2357
+ } ) ;
2264
2358
return to ;
2265
2359
}
2266
2360
export function omitEmpty ( o ) {
2267
2361
const to = { } ;
2268
- for ( const k in o ) {
2362
+ if ( ! o )
2363
+ return to ;
2364
+ Object . keys ( o ) . forEach ( k => {
2269
2365
const v = o [ k ] ;
2270
2366
if ( v != null && v !== '' ) {
2271
2367
to [ k ] = v ;
2272
2368
}
2273
- }
2369
+ } ) ;
2274
2370
return to ;
2275
2371
}
2276
2372
export function apply ( x , fn ) {
@@ -2835,9 +2931,10 @@ export class Inspect {
2835
2931
if ( ! inspectVarsPath || ! obj )
2836
2932
return ;
2837
2933
// resolve dynamic path to prevent ng webpack static analysis
2934
+ const I = ( s ) => import ( /* @vite -ignore */ s ) ;
2838
2935
const nodeModule = ( m ) => 'no' + 'de:' + `${ m } ` ;
2839
- await import ( nodeModule ( 'fs' ) ) . then ( async ( fs ) => {
2840
- await import ( nodeModule ( 'path' ) ) . then ( path => {
2936
+ await I ( nodeModule ( 'fs' ) ) . then ( async ( fs ) => {
2937
+ await I ( nodeModule ( 'path' ) ) . then ( path => {
2841
2938
let varsPath = inspectVarsPath . replace ( / \\ / g, '/' ) ;
2842
2939
if ( varsPath . indexOf ( '/' ) >= 0 ) {
2843
2940
let dir = path . dirname ( varsPath ) ;
0 commit comments