@simplysm/angular 14.0.27 → 14.0.28

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.
@@ -2,14 +2,13 @@ import type { Signal } from "@angular/core";
2
2
  import type { AppStructureItem, SdFlatMenu } from "./sd-app-structure.types";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare function injectPermsSignal<K extends string>(viewCodes: string[], keys: K[]): Signal<K[]>;
5
- export declare abstract class SdAppStructureProvider<TModule = unknown> {
5
+ export declare class SdAppStructureProvider<TModule = unknown> {
6
6
  private readonly _clientFactory;
7
7
  private readonly _config;
8
- abstract serviceKey: string;
9
- abstract usableModules: Signal<TModule[] | undefined>;
10
- abstract permRecord: Signal<Record<string, boolean> | undefined>;
8
+ readonly usableModules: import("@angular/core").WritableSignal<TModule[] | undefined>;
9
+ readonly permRecord: import("@angular/core").WritableSignal<Record<string, boolean> | undefined>;
11
10
  readonly items: import("@angular/core").WritableSignal<AppStructureItem<TModule>[]>;
12
- fetchItems(): Promise<void>;
11
+ initialize(serviceKey: string): Promise<void>;
13
12
  usableMenus: Signal<import("./sd-app-structure.types").SdMenu[]>;
14
13
  usableFlatMenus: Signal<SdFlatMenu<TModule>[]>;
15
14
  getPermissionsByStructure(items: AppStructureItem<TModule>[], codeChain?: string[]): import("./sd-app-structure.types").SdPermission<TModule>[];
@@ -1 +1 @@
1
- {"version":3,"file":"sd-app-structure.provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/sd-app-structure.provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;;AAK7E,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAG/F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O;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0C;IACzE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAE3D,QAAQ,CAAC,aAAa,gEAA4C;IAClE,QAAQ,CAAC,UAAU,8EAA0D;IAC7E,QAAQ,CAAC,KAAK,sEAA2C;IAEnD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD,WAAW,sDAET;IACF,eAAe,gCAEb;IAEF,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,GAAE,MAAM,EAAO;IAItF,kBAAkB,CAAC,QAAQ,EAAE,MAAM;IAInC,sBAAsB,CAAC,QAAQ,EAAE,MAAM;IAIvC,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;yCApClE,sBAAsB;6CAAtB,sBAAsB;CA4ClC"}
@@ -12,9 +12,11 @@ export function injectPermsSignal(viewCodes, keys) {
12
12
  export class SdAppStructureProvider {
13
13
  _clientFactory = inject(SdServiceClientFactoryProvider);
14
14
  _config = inject(SdAngularConfigProvider);
15
+ usableModules = signal(undefined, ...(ngDevMode ? [{ debugName: "usableModules" }] : /* istanbul ignore next */ []));
16
+ permRecord = signal(undefined, ...(ngDevMode ? [{ debugName: "permRecord" }] : /* istanbul ignore next */ []));
15
17
  items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
16
- async fetchItems() {
17
- const client = this._clientFactory.get(this.serviceKey);
18
+ async initialize(serviceKey) {
19
+ const client = this._clientFactory.get(serviceKey);
18
20
  const svc = client.getService("AppStructure");
19
21
  const itemsMap = await svc.getItems();
20
22
  this.items.set((itemsMap[this._config.clientName] ?? []));
@@ -59,7 +59,8 @@ export class SdSharedDataProvider {
59
59
  throw new Error(`등록되지 않은 공유 데이터: ${name}`);
60
60
  }
61
61
  const client = this._clientFactory.get(entry.info.serviceKey);
62
- await client.emitEvent(SdSharedDataChangeEvent, (item) => item.name === name && obj.equal(item.filter, entry.info.filter), changeKeys);
62
+ const event = client.getEvent("SdSharedDataChange");
63
+ await event.emit((item) => item.name === name && obj.equal(item.filter, entry.info.filter), changeKeys);
63
64
  }
64
65
  async wait() {
65
66
  await waitUtil.until(() => this.loadingCount() <= 0);
@@ -75,7 +76,8 @@ export class SdSharedDataProvider {
75
76
  // 이벤트 리스너 등록
76
77
  if (entry.listenerKey == null) {
77
78
  const client = this._clientFactory.get(entry.info.serviceKey);
78
- entry.listenerKey = await client.addListener(SdSharedDataChangeEvent, { name, filter: entry.info.filter }, async (changeKeys) => {
79
+ const event = client.getEvent("SdSharedDataChange");
80
+ entry.listenerKey = await event.addListener({ name, filter: entry.info.filter }, async (changeKeys) => {
79
81
  await this._onEvent(name, entry, changeKeys);
80
82
  });
81
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/angular",
3
- "version": "14.0.27",
3
+ "version": "14.0.28",
4
4
  "description": "심플리즘 패키지 - Angular",
5
5
  "author": "심플리즘",
6
6
  "license": "Apache-2.0",
@@ -49,10 +49,10 @@
49
49
  "jspdf": "^4.2.1",
50
50
  "rxjs": "^7.8.2",
51
51
  "tabbable": "^6.4.0",
52
- "@simplysm/core-common": "14.0.27",
53
- "@simplysm/core-browser": "14.0.27",
54
- "@simplysm/service-client": "14.0.27",
55
- "@simplysm/service-common": "14.0.27"
52
+ "@simplysm/core-browser": "14.0.28",
53
+ "@simplysm/core-common": "14.0.28",
54
+ "@simplysm/service-client": "14.0.28",
55
+ "@simplysm/service-common": "14.0.28"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@angular/compiler": "^21.2.7",
@@ -14,18 +14,16 @@ export function injectPermsSignal<K extends string>(viewCodes: string[], keys: K
14
14
  // 권한은 모듈만 체크하고
15
15
  // 메뉴는 모듈/권한 모두 체크함
16
16
  @Injectable({ providedIn: "root" })
17
- export abstract class SdAppStructureProvider<TModule = unknown> {
17
+ export class SdAppStructureProvider<TModule = unknown> {
18
18
  private readonly _clientFactory = inject(SdServiceClientFactoryProvider);
19
19
  private readonly _config = inject(SdAngularConfigProvider);
20
20
 
21
- abstract serviceKey: string;
22
- abstract usableModules: Signal<TModule[] | undefined>;
23
- abstract permRecord: Signal<Record<string, boolean> | undefined>;
24
-
21
+ readonly usableModules = signal<TModule[] | undefined>(undefined);
22
+ readonly permRecord = signal<Record<string, boolean> | undefined>(undefined);
25
23
  readonly items = signal<AppStructureItem<TModule>[]>([]);
26
24
 
27
- async fetchItems(): Promise<void> {
28
- const client = this._clientFactory.get(this.serviceKey);
25
+ async initialize(serviceKey: string): Promise<void> {
26
+ const client = this._clientFactory.get(serviceKey);
29
27
  const svc = client.getService<AppStructureService>("AppStructure");
30
28
  const itemsMap = await svc.getItems();
31
29
  this.items.set(
@@ -107,8 +107,8 @@ export abstract class SdSharedDataProvider<T extends Record<string, SharedDataBa
107
107
  }
108
108
 
109
109
  const client = this._clientFactory.get(entry.info.serviceKey);
110
- await client.emitEvent(
111
- SdSharedDataChangeEvent,
110
+ const event = client.getEvent<typeof SdSharedDataChangeEvent>("SdSharedDataChange");
111
+ await event.emit(
112
112
  (item) => item.name === (name as string) && obj.equal(item.filter, entry.info.filter),
113
113
  changeKeys,
114
114
  );
@@ -131,8 +131,8 @@ export abstract class SdSharedDataProvider<T extends Record<string, SharedDataBa
131
131
  // 이벤트 리스너 등록
132
132
  if (entry.listenerKey == null) {
133
133
  const client = this._clientFactory.get(entry.info.serviceKey);
134
- entry.listenerKey = await client.addListener(
135
- SdSharedDataChangeEvent,
134
+ const event = client.getEvent<typeof SdSharedDataChangeEvent>("SdSharedDataChange");
135
+ entry.listenerKey = await event.addListener(
136
136
  { name, filter: entry.info.filter },
137
137
  async (changeKeys) => {
138
138
  await this._onEvent(name, entry, changeKeys);