@geexcode/geex-angular 0.0.16 → 0.0.18
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/dist/index.d.mts +2 -11
- package/dist/index.d.ts +2 -11
- package/dist/index.js +10 -4
- package/dist/index.mjs +10 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { WritableSignal, Injector, InjectionToken, Provider } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
1
|
+
import { WritableSignal, Signal, Injector, InjectionToken, Provider } from '@angular/core';
|
|
3
2
|
|
|
4
3
|
interface Tenant {
|
|
5
4
|
/** Unique identifier */
|
|
@@ -85,10 +84,6 @@ interface IdentityModule extends GeexModule {
|
|
|
85
84
|
orgs: WritableSignal<Org[]>;
|
|
86
85
|
/** Organizations owned by current user */
|
|
87
86
|
userOwnedOrgs: WritableSignal<Org[]>;
|
|
88
|
-
/**
|
|
89
|
-
* Initialize identity-related reactive state and listeners.
|
|
90
|
-
*/
|
|
91
|
-
init(): void;
|
|
92
87
|
}
|
|
93
88
|
interface MessagingModule extends GeexModule {
|
|
94
89
|
/**
|
|
@@ -98,16 +93,12 @@ interface MessagingModule extends GeexModule {
|
|
|
98
93
|
}
|
|
99
94
|
interface SettingsModule extends GeexModule {
|
|
100
95
|
settings: WritableSignal<SettingItem[]>;
|
|
101
|
-
/**
|
|
102
|
-
* Initialize application settings.
|
|
103
|
-
*/
|
|
104
|
-
init(): Promise<void>;
|
|
105
96
|
}
|
|
106
97
|
interface UiModule extends GeexModule {
|
|
107
98
|
/** Whether the app is currently in fullscreen mode */
|
|
108
99
|
fullScreen: WritableSignal<boolean>;
|
|
109
100
|
/** Responsive helper stream notifying if device is mobile-like */
|
|
110
|
-
isMobile
|
|
101
|
+
isMobile: Signal<boolean | undefined>;
|
|
111
102
|
/** Currently active routed component (framework dependent) */
|
|
112
103
|
activeRoutedComponent?: any;
|
|
113
104
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { WritableSignal, Injector, InjectionToken, Provider } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
1
|
+
import { WritableSignal, Signal, Injector, InjectionToken, Provider } from '@angular/core';
|
|
3
2
|
|
|
4
3
|
interface Tenant {
|
|
5
4
|
/** Unique identifier */
|
|
@@ -85,10 +84,6 @@ interface IdentityModule extends GeexModule {
|
|
|
85
84
|
orgs: WritableSignal<Org[]>;
|
|
86
85
|
/** Organizations owned by current user */
|
|
87
86
|
userOwnedOrgs: WritableSignal<Org[]>;
|
|
88
|
-
/**
|
|
89
|
-
* Initialize identity-related reactive state and listeners.
|
|
90
|
-
*/
|
|
91
|
-
init(): void;
|
|
92
87
|
}
|
|
93
88
|
interface MessagingModule extends GeexModule {
|
|
94
89
|
/**
|
|
@@ -98,16 +93,12 @@ interface MessagingModule extends GeexModule {
|
|
|
98
93
|
}
|
|
99
94
|
interface SettingsModule extends GeexModule {
|
|
100
95
|
settings: WritableSignal<SettingItem[]>;
|
|
101
|
-
/**
|
|
102
|
-
* Initialize application settings.
|
|
103
|
-
*/
|
|
104
|
-
init(): Promise<void>;
|
|
105
96
|
}
|
|
106
97
|
interface UiModule extends GeexModule {
|
|
107
98
|
/** Whether the app is currently in fullscreen mode */
|
|
108
99
|
fullScreen: WritableSignal<boolean>;
|
|
109
100
|
/** Responsive helper stream notifying if device is mobile-like */
|
|
110
|
-
isMobile
|
|
101
|
+
isMobile: Signal<boolean | undefined>;
|
|
111
102
|
/** Currently active routed component (framework dependent) */
|
|
112
103
|
activeRoutedComponent?: any;
|
|
113
104
|
}
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ var import_util = require("@delon/util");
|
|
|
59
59
|
var import_graphql_tag = __toESM(require("graphql-tag"));
|
|
60
60
|
var import_rxjs = require("rxjs");
|
|
61
61
|
var import_operators = require("rxjs/operators");
|
|
62
|
+
var import_rxjs_interop = require("@angular/core/rxjs-interop");
|
|
62
63
|
var LoginProviderEnum = {
|
|
63
64
|
Local: "Local"
|
|
64
65
|
};
|
|
@@ -97,7 +98,11 @@ function createTenantModule(injector) {
|
|
|
97
98
|
}
|
|
98
99
|
function createAuthModule(injector) {
|
|
99
100
|
const user = (0, import_core.signal)(null);
|
|
100
|
-
|
|
101
|
+
const module2 = {
|
|
102
|
+
init: async () => {
|
|
103
|
+
let userData = await module2.loadUserData();
|
|
104
|
+
user.set(userData ?? null);
|
|
105
|
+
},
|
|
101
106
|
user,
|
|
102
107
|
async loadUserData() {
|
|
103
108
|
const oAuthService = injector.get(import_angular_oauth2_oidc.OAuthService);
|
|
@@ -121,6 +126,7 @@ function createAuthModule(injector) {
|
|
|
121
126
|
return void 0;
|
|
122
127
|
}
|
|
123
128
|
};
|
|
129
|
+
return module2;
|
|
124
130
|
}
|
|
125
131
|
function createIdentityModule(injector) {
|
|
126
132
|
const orgsSignal = (0, import_core.signal)([]);
|
|
@@ -174,13 +180,13 @@ function createSettingsModule(injector) {
|
|
|
174
180
|
}
|
|
175
181
|
function createUiModule(injector) {
|
|
176
182
|
const fullScreenSignal = (0, import_core.signal)(false);
|
|
177
|
-
const isMobile
|
|
183
|
+
const isMobile = (0, import_rxjs_interop.toSignal)((0, import_rxjs.fromEvent)(window, "resize").pipe(
|
|
178
184
|
(0, import_operators.debounceTime)(200),
|
|
179
185
|
(0, import_operators.switchMap)(async () => window.innerHeight / window.innerWidth >= 1.5)
|
|
180
|
-
);
|
|
186
|
+
));
|
|
181
187
|
return {
|
|
182
188
|
fullScreen: fullScreenSignal,
|
|
183
|
-
isMobile
|
|
189
|
+
isMobile,
|
|
184
190
|
activeRoutedComponent: void 0
|
|
185
191
|
};
|
|
186
192
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { CookieService, deepCopy } from "@delon/util";
|
|
|
14
14
|
import gql from "graphql-tag";
|
|
15
15
|
import { firstValueFrom, map, fromEvent } from "rxjs";
|
|
16
16
|
import { debounceTime, switchMap } from "rxjs/operators";
|
|
17
|
+
import { toSignal } from "@angular/core/rxjs-interop";
|
|
17
18
|
var LoginProviderEnum = {
|
|
18
19
|
Local: "Local"
|
|
19
20
|
};
|
|
@@ -52,7 +53,11 @@ function createTenantModule(injector) {
|
|
|
52
53
|
}
|
|
53
54
|
function createAuthModule(injector) {
|
|
54
55
|
const user = signal(null);
|
|
55
|
-
|
|
56
|
+
const module = {
|
|
57
|
+
init: async () => {
|
|
58
|
+
let userData = await module.loadUserData();
|
|
59
|
+
user.set(userData ?? null);
|
|
60
|
+
},
|
|
56
61
|
user,
|
|
57
62
|
async loadUserData() {
|
|
58
63
|
const oAuthService = injector.get(OAuthService);
|
|
@@ -76,6 +81,7 @@ function createAuthModule(injector) {
|
|
|
76
81
|
return void 0;
|
|
77
82
|
}
|
|
78
83
|
};
|
|
84
|
+
return module;
|
|
79
85
|
}
|
|
80
86
|
function createIdentityModule(injector) {
|
|
81
87
|
const orgsSignal = signal([]);
|
|
@@ -129,13 +135,13 @@ function createSettingsModule(injector) {
|
|
|
129
135
|
}
|
|
130
136
|
function createUiModule(injector) {
|
|
131
137
|
const fullScreenSignal = signal(false);
|
|
132
|
-
const isMobile
|
|
138
|
+
const isMobile = toSignal(fromEvent(window, "resize").pipe(
|
|
133
139
|
debounceTime(200),
|
|
134
140
|
switchMap(async () => window.innerHeight / window.innerWidth >= 1.5)
|
|
135
|
-
);
|
|
141
|
+
));
|
|
136
142
|
return {
|
|
137
143
|
fullScreen: fullScreenSignal,
|
|
138
|
-
isMobile
|
|
144
|
+
isMobile,
|
|
139
145
|
activeRoutedComponent: void 0
|
|
140
146
|
};
|
|
141
147
|
}
|