@nauticana/sail 0.9.5 → 0.9.6

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": "@nauticana/sail",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Metadata-driven Angular component library for CRUD admin frontends backed by the keel Go backend. Tables, forms, navigation, OTP/2FA/social auth, billing, payout onboarding.",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -16,6 +16,10 @@ import { CanActivateFn, Router, Routes } from '@angular/router';
16
16
  import { SAIL_GUI_CONFIG, SailGuiConfig, DEFAULT_CONFIG } from '../config';
17
17
  import { BaseRestService } from './base_rest.service';
18
18
 
19
+ /** Sort dropdown options by their visible label so long lookup lists are scannable. */
20
+ const byCaption = (a: ConstantValue, b: ConstantValue) =>
21
+ (a.Caption ?? '').localeCompare(b.Caption ?? '', undefined, { numeric: true, sensitivity: 'base' });
22
+
19
23
  @Injectable()
20
24
  export abstract class BaseAuthService extends BaseRestService {
21
25
  protected readonly router = inject(Router);
@@ -416,7 +420,7 @@ export abstract class BaseAuthService extends BaseRestService {
416
420
  Value: key,
417
421
  Caption: domainMap[key],
418
422
  [opField]: 'S',
419
- } as unknown as ConstantValue));
423
+ } as unknown as ConstantValue)).sort(byCaption);
420
424
  }
421
425
 
422
426
  getTableValues(tableName: string): ConstantValue[] | undefined {
@@ -430,7 +434,7 @@ export abstract class BaseAuthService extends BaseRestService {
430
434
  Value: key,
431
435
  Caption: tableMap[key],
432
436
  [opField]: 'S',
433
- } as unknown as ConstantValue));
437
+ } as unknown as ConstantValue)).sort(byCaption);
434
438
  }
435
439
 
436
440
  getMenus(): Observable<ApplicationMenu[]> {