@nucleus-suite-pe/core 0.6.1 → 0.7.0

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": "@nucleus-suite-pe/core",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Capa compartida de la suite Nucleus: sesión única, permisos, tema y marco de aplicación para Angular.",
5
5
  "keywords": [
6
6
  "angular",
package/styles/tokens.css CHANGED
@@ -122,3 +122,113 @@ input {
122
122
  .ns-crumbs .p-breadcrumb-separator {
123
123
  color: color-mix(in srgb, var(--ac-text-muted) 60%, transparent);
124
124
  }
125
+
126
+ .ns-form-grid {
127
+ display: grid;
128
+ grid-template-columns: 1fr;
129
+ gap: 18px 20px;
130
+ }
131
+
132
+ .ns-form-grid .ns-field {
133
+ display: flex;
134
+ min-width: 0;
135
+ flex-direction: column;
136
+ gap: 6px;
137
+ }
138
+
139
+ .ns-form-grid .ns-field > label {
140
+ color: var(--ac-text-muted);
141
+ font-size: 12px;
142
+ letter-spacing: 0.04em;
143
+ text-transform: uppercase;
144
+ }
145
+
146
+ .ns-form-grid .ns-hint {
147
+ margin: 0;
148
+ max-width: 52ch;
149
+ color: var(--ac-text-muted);
150
+ font-size: 12px;
151
+ line-height: 1.45;
152
+ }
153
+
154
+ .ns-form-grid .ns-inline {
155
+ display: flex;
156
+ min-height: 38px;
157
+ align-items: center;
158
+ gap: 10px;
159
+ }
160
+
161
+ .ns-form-grid .ns-inline-label {
162
+ color: var(--ac-text);
163
+ font-size: 13px;
164
+ letter-spacing: normal;
165
+ text-transform: none;
166
+ }
167
+
168
+ .ns-form-grid .is-size-xs :is(input, textarea, .p-select, .p-inputtext) {
169
+ max-width: 6rem;
170
+ }
171
+
172
+ .ns-form-grid .is-size-sm :is(input, textarea, .p-select, .p-inputtext) {
173
+ max-width: 11rem;
174
+ }
175
+
176
+ .ns-form-grid .is-size-md :is(input, textarea, .p-select, .p-inputtext) {
177
+ max-width: 17rem;
178
+ }
179
+
180
+ .ns-form-grid .is-size-lg :is(input, textarea, .p-select, .p-inputtext) {
181
+ max-width: 26rem;
182
+ }
183
+
184
+ .ns-form-grid .is-span-full {
185
+ grid-column: 1 / -1;
186
+ }
187
+
188
+ @media (min-width: 640px) {
189
+ .ns-form-grid {
190
+ grid-template-columns: repeat(2, minmax(0, 1fr));
191
+ }
192
+
193
+ .ns-form-grid .is-span-2,
194
+ .ns-form-grid .is-span-3,
195
+ .ns-form-grid .is-span-4 {
196
+ grid-column: span 2;
197
+ }
198
+ }
199
+
200
+ @media (min-width: 1080px) {
201
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2) {
202
+ grid-template-columns: repeat(3, minmax(0, 1fr));
203
+ }
204
+
205
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2) .is-span-2 {
206
+ grid-column: span 2;
207
+ }
208
+
209
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2) :is(.is-span-3, .is-span-4) {
210
+ grid-column: span 3;
211
+ }
212
+ }
213
+
214
+ @media (min-width: 1500px) {
215
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2):not(.is-cap-3) {
216
+ grid-template-columns: repeat(4, minmax(0, 1fr));
217
+ }
218
+
219
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2):not(.is-cap-3) .is-span-3 {
220
+ grid-column: span 3;
221
+ }
222
+
223
+ .ns-form-grid:not(.is-cap-1):not(.is-cap-2):not(.is-cap-3) .is-span-4 {
224
+ grid-column: span 4;
225
+ }
226
+ }
227
+
228
+ .ns-form-grid.is-cap-1 {
229
+ grid-template-columns: 1fr;
230
+ }
231
+
232
+ .ns-form-grid.is-cap-1 .ns-field {
233
+ grid-column: 1 / -1;
234
+ }
@@ -1,9 +1,9 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, EnvironmentProviders, Signal, TemplateRef } from '@angular/core';
3
3
  import { HttpContextToken, HttpInterceptorFn } from '@angular/common/http';
4
+ import * as _nucleus_suite_pe_core from '@nucleus-suite-pe/core';
4
5
  import * as _primeuix_themes from '@primeuix/themes';
5
6
  import * as _primeuix_themes_types_base from '@primeuix/themes/types/base';
6
- import * as _nucleus_suite_pe_core from '@nucleus-suite-pe/core';
7
7
  import { MenuItem } from 'primeng/api';
8
8
 
9
9
  interface NucleusConfig {
@@ -115,7 +115,8 @@ interface CompanySummary {
115
115
  readonly legalName: string;
116
116
  readonly tradeName: string | null;
117
117
  readonly taxId: string;
118
- readonly countryCode: string | null;
118
+ readonly countryId: string | null;
119
+ readonly countryName: string | null;
119
120
  readonly logoPath: string | null;
120
121
  readonly status: number;
121
122
  readonly isOwner: boolean;
@@ -139,7 +140,11 @@ interface Site {
139
140
  readonly companyId: string;
140
141
  readonly name: string;
141
142
  readonly address: string | null;
142
- readonly city: string | null;
143
+ readonly countryId: string | null;
144
+ readonly countryName: string | null;
145
+ readonly divisionId: string | null;
146
+ readonly divisionLabel: string | null;
147
+ readonly postalCode: string | null;
143
148
  readonly phone: string | null;
144
149
  readonly isMain: boolean;
145
150
  readonly isActive: boolean;
@@ -253,6 +258,93 @@ declare class NucleusLanguage {
253
258
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NucleusLanguage>;
254
259
  }
255
260
 
261
+ interface GeoCountry {
262
+ readonly id: string;
263
+ readonly code: string;
264
+ readonly phoneCode: string | null;
265
+ readonly name: string;
266
+ }
267
+ interface GeoDivision {
268
+ readonly id: string;
269
+ readonly countryId: string;
270
+ readonly parentId: string | null;
271
+ readonly level: number;
272
+ readonly code: string;
273
+ readonly name: string;
274
+ readonly kind: string | null;
275
+ }
276
+ interface GeoLevel {
277
+ readonly level: number;
278
+ readonly kind: string | null;
279
+ readonly items: readonly GeoDivision[];
280
+ }
281
+ interface GeoPlace {
282
+ readonly countryId: string;
283
+ readonly countryCode: string;
284
+ readonly countryName: string;
285
+ readonly trail: readonly GeoDivision[];
286
+ }
287
+ interface GeoValue {
288
+ readonly countryId: string | null;
289
+ readonly divisionId: string | null;
290
+ }
291
+ declare const EMPTY_GEO_VALUE: GeoValue;
292
+ declare function flagOf(code: string): string;
293
+
294
+ interface GeoCopy {
295
+ readonly country: string;
296
+ readonly choose: string;
297
+ readonly search: string;
298
+ readonly levels: readonly [string, string, string, string];
299
+ readonly kinds: Readonly<Record<string, string>>;
300
+ }
301
+ interface GeoCopySet {
302
+ readonly es: GeoCopy;
303
+ readonly en: GeoCopy;
304
+ }
305
+ declare const GEO_COPY: GeoCopySet;
306
+ declare function geoCopyOf(lang: string): GeoCopy;
307
+ declare function levelLabel(copy: GeoCopy, level: number, kind: string | null): string;
308
+
309
+ declare class NucleusGeo {
310
+ private readonly http;
311
+ private readonly config;
312
+ private readonly cache;
313
+ countries(language: string): Promise<readonly GeoCountry[]>;
314
+ divisions(countryId: string, parentId: string | null, language: string): Promise<GeoLevel>;
315
+ place(divisionId: string, language: string): Promise<GeoPlace>;
316
+ levelOf(countryId: string, parentId: string | null, language: string): Promise<GeoLevel>;
317
+ private once;
318
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusGeo, never>;
319
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<NucleusGeo>;
320
+ }
321
+
322
+ interface GeoStep {
323
+ readonly level: number;
324
+ readonly kind: string | null;
325
+ readonly items: GeoDivision[];
326
+ readonly selectedId: string | null;
327
+ }
328
+ declare class NucleusGeoSelect {
329
+ private readonly geo;
330
+ private readonly language;
331
+ readonly value: _angular_core.ModelSignal<GeoValue>;
332
+ readonly readonly: _angular_core.InputSignal<boolean>;
333
+ readonly columns: _angular_core.InputSignal<number | null>;
334
+ protected readonly countries: _angular_core.WritableSignal<GeoCountry[]>;
335
+ protected readonly steps: _angular_core.WritableSignal<GeoStep[]>;
336
+ protected readonly labels: _angular_core.Signal<_nucleus_suite_pe_core.GeoCopy>;
337
+ private syncedKey;
338
+ constructor();
339
+ protected gridClass(): string;
340
+ protected nameOf(step: GeoStep): string;
341
+ protected pickCountry(countryId: string | null): Promise<void>;
342
+ protected pick(index: number, divisionId: string | null): Promise<void>;
343
+ private sync;
344
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NucleusGeoSelect, never>;
345
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusGeoSelect, "nucleus-geo-select", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
346
+ }
347
+
256
348
  type ThemeId = 'nucleus' | 'light' | 'dark' | 'bubblegum' | 'cool-breeze' | 'cool-slate' | 'icy-mint' | 'juicy-plum' | 'mango-paradise' | 'moonlight-glow' | 'mystical-forest' | 'silky-pink' | 'spicy-red' | 'sunny-day';
257
349
  type ThemePreference = ThemeId | 'system';
258
350
  interface ThemeTokens {
@@ -643,5 +735,5 @@ declare class NucleusShell {
643
735
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NucleusShell, "nucleus-shell", never, { "brand": { "alias": "brand"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "lead": { "alias": "lead"; "required": false; "isSignal": true; }; "navItems": { "alias": "navItems"; "required": false; "isSignal": true; }; "activeNavId": { "alias": "activeNavId"; "required": false; "isSignal": true; }; "selectedMenuId": { "alias": "selectedMenuId"; "required": false; "isSignal": true; }; }, { "navSelect": "navSelect"; "menuSelect": "menuSelect"; }, never, ["[nucleusTop]", "*"], true, never>;
644
736
  }
645
737
 
646
- export { DEFAULT_THEME, NO_PERMISSIONS, NUCLEUS_CONFIG, NUCLEUS_DARK_SELECTOR, NUCLEUS_FORCE_BEARER, NUCLEUS_ICONS, NUCLEUS_LANGS, NUCLEUS_LOGOUT_PARAM, NUCLEUS_SKIP_AUTH, NucleusAuth, NucleusCard, NucleusCell, NucleusFeedback, NucleusForm, NucleusLanguage, NucleusList, NucleusLordicon, NucleusMark, NucleusPage, NucleusPreset, NucleusSessionAuth, NucleusShell, NucleusStarfield, NucleusTabs, SHELL_COPY, SessionService, THEMES, THEME_LABELS, ThemeService, UserSyncService, consumeNucleusLogout, findMenuByRoute, isNucleusConfigured, isThemePreference, loadLordicon, loadNucleusConfig, nucleusAuthInterceptor, nucleusLogoutUrl, ownsUrl, permissionsOf, provideNucleus, provideNucleusFeedback, provideNucleusTheme, resolveFieldSize, themeById };
647
- export type { AccessScope, AppSummary, AppUser, AuthSyncRequest, CardSize, CompanyOption, CompanyRelation, CompanySummary, ConfirmRequest, Crumb, FieldKind, FieldOption, FieldSize, FieldSpan, FormField, FormValue, LauncherApp, ListAction, ListActionEvent, ListAlign, ListColumn, ListColumnKind, ListTag, ListToggleEvent, MeResponse, MenuNode, MenuPermissions, NucleusConfig, NucleusIdentity, NucleusLang, SessionTicket, ShellCopy, ShellNavItem, Site, SiteAccess, Subscription, TabItem, Theme, ThemeId, ThemePreference, ThemeTokens, UserProfile };
738
+ export { DEFAULT_THEME, EMPTY_GEO_VALUE, GEO_COPY, NO_PERMISSIONS, NUCLEUS_CONFIG, NUCLEUS_DARK_SELECTOR, NUCLEUS_FORCE_BEARER, NUCLEUS_ICONS, NUCLEUS_LANGS, NUCLEUS_LOGOUT_PARAM, NUCLEUS_SKIP_AUTH, NucleusAuth, NucleusCard, NucleusCell, NucleusFeedback, NucleusForm, NucleusGeo, NucleusGeoSelect, NucleusLanguage, NucleusList, NucleusLordicon, NucleusMark, NucleusPage, NucleusPreset, NucleusSessionAuth, NucleusShell, NucleusStarfield, NucleusTabs, SHELL_COPY, SessionService, THEMES, THEME_LABELS, ThemeService, UserSyncService, consumeNucleusLogout, findMenuByRoute, flagOf, geoCopyOf, isNucleusConfigured, isThemePreference, levelLabel, loadLordicon, loadNucleusConfig, nucleusAuthInterceptor, nucleusLogoutUrl, ownsUrl, permissionsOf, provideNucleus, provideNucleusFeedback, provideNucleusTheme, resolveFieldSize, themeById };
739
+ export type { AccessScope, AppSummary, AppUser, AuthSyncRequest, CardSize, CompanyOption, CompanyRelation, CompanySummary, ConfirmRequest, Crumb, FieldKind, FieldOption, FieldSize, FieldSpan, FormField, FormValue, GeoCopy, GeoCopySet, GeoCountry, GeoDivision, GeoLevel, GeoPlace, GeoValue, LauncherApp, ListAction, ListActionEvent, ListAlign, ListColumn, ListColumnKind, ListTag, ListToggleEvent, MeResponse, MenuNode, MenuPermissions, NucleusConfig, NucleusIdentity, NucleusLang, SessionTicket, ShellCopy, ShellNavItem, Site, SiteAccess, Subscription, TabItem, Theme, ThemeId, ThemePreference, ThemeTokens, UserProfile };