@ngx-smz/ui-kit 21.10.0-next.2 → 21.10.0-next.20

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,11 @@
1
1
  {
2
2
  "name": "@ngx-smz/ui-kit",
3
- "version": "21.10.0-next.2",
3
+ "version": "21.10.0-next.20",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/smarza/ng-smz.git",
7
+ "directory": "projects/ngx-smz-ui-kit"
8
+ },
4
9
  "peerDependencies": {
5
10
  "@angular/cdk": ">=21.0.0 <22.0.0",
6
11
  "@angular/common": ">=21.0.0 <22.0.0",
@@ -1,91 +1,91 @@
1
- const channel = (name) => `rgb(var(--smz-color-${name}) / <alpha-value>)`;
2
-
3
- const colorNames = [
4
- 'primary', 'primary-hover', 'primary-active', 'on-primary',
5
- 'danger', 'danger-hover', 'danger-active', 'on-danger',
6
- 'success', 'success-hover', 'success-active', 'on-success',
7
- 'warning', 'warning-hover', 'warning-active', 'on-warning',
8
- 'surface-0', 'surface-1', 'surface-2', 'surface-3',
9
- 'fg', 'fg-muted', 'fg-subtle',
10
- 'line', 'line-strong',
11
- 'focus',
12
- ];
13
-
14
- const colors = Object.fromEntries(colorNames.map((name) => [`ui-${name}`, channel(name)]));
15
-
16
- /**
17
- * Vocabulario herdado do `tailwindcss-primeui` (bg-primary, text-color, text-muted-color, bg-surface-100, border-surface,
18
- * rounded-border), mantido para os apps e layouts existentes. Mapeia para os mesmos tokens do tema; a escala `surface-N` e fixa.
19
- */
20
- const surfaceScale = {
21
- 0: '#ffffff', 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8',
22
- 500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', 950: '#020617',
23
- };
24
- const legacyColors = {
25
- primary: { DEFAULT: channel('primary'), contrast: channel('on-primary'), hover: channel('primary-hover'), active: channel('primary-active') },
26
- surface: { DEFAULT: channel('line'), ...surfaceScale },
27
- color: channel('fg'),
28
- 'muted-color': channel('fg-muted'),
29
- 'surface-border': channel('line'),
30
- };
31
-
32
- /**
33
- * Preset do @ngx-smz/ui-kit. Mapeia os tokens do tema (variaveis CSS --smz-*)
34
- * para utilitarios semanticos do Tailwind (bg-ui-primary, rounded-control, h-control...).
35
- * Cores levam o prefixo `ui-` (bg-ui-primary, text-ui-fg) para nao colidir com plugins ou temas do app
36
- * Os valores vivem no arquivo de tema (themes/*.css), nunca aqui.
37
- */
38
- module.exports = {
39
- // Classes de layout que @ngx-smz/core monta em runtime (row: N dos templates de formulario/dialog): o scanner do
40
- // Tailwind do app nao as ve nos templates, entao precisam estar na safelist.
41
- safelist: [
42
- { pattern: /^col-span-(1[0-2]|[1-9]|full)$/, variants: ['sm', 'md', 'lg', 'xl'] },
43
- { pattern: /^w-((1[01]|[1-9])\/12|full)$/, variants: ['sm', 'md', 'lg', 'xl'] },
44
- ],
45
- theme: {
46
- extend: {
47
- colors: { ...colors, ...legacyColors },
48
- fontFamily: {
49
- ui: 'var(--smz-font-sans)',
50
- 'ui-mono': 'var(--smz-font-mono)',
51
- },
52
- fontSize: {
53
- 'ui-xs': ['var(--smz-text-xs)', 'var(--smz-leading)'],
54
- 'ui-sm': ['var(--smz-text-sm)', 'var(--smz-leading)'],
55
- 'ui-md': ['var(--smz-text-md)', 'var(--smz-leading)'],
56
- 'ui-lg': ['var(--smz-text-lg)', 'var(--smz-leading)'],
57
- 'ui-xl': ['var(--smz-text-xl)', 'var(--smz-leading)'],
58
- },
59
- height: {
60
- 'control-sm': 'var(--smz-control-h-sm)',
61
- control: 'var(--smz-control-h)',
62
- 'control-lg': 'var(--smz-control-h-lg)',
63
- },
64
- minHeight: {
65
- 'control-sm': 'var(--smz-control-h-sm)',
66
- control: 'var(--smz-control-h)',
67
- 'control-lg': 'var(--smz-control-h-lg)',
68
- },
69
- padding: {
70
- 'control-x-sm': 'var(--smz-control-px-sm)',
71
- 'control-x': 'var(--smz-control-px)',
72
- 'control-x-lg': 'var(--smz-control-px-lg)',
73
- 'input-x-sm': 'var(--smz-input-px-sm)',
74
- 'input-x': 'var(--smz-input-px)',
75
- },
76
- borderRadius: {
77
- control: 'var(--smz-radius-control)',
78
- card: 'var(--smz-radius-card)',
79
- overlay: 'var(--smz-radius-overlay)',
80
- border: 'var(--smz-radius-control)',
81
- },
82
- boxShadow: {
83
- card: 'var(--smz-shadow-card)',
84
- overlay: 'var(--smz-shadow-overlay)',
85
- },
86
- transitionDuration: {
87
- ui: 'var(--smz-duration)',
88
- },
89
- },
90
- },
91
- };
1
+ const channel = (name) => `rgb(var(--smz-color-${name}) / <alpha-value>)`;
2
+
3
+ const colorNames = [
4
+ 'primary', 'primary-hover', 'primary-active', 'on-primary',
5
+ 'danger', 'danger-hover', 'danger-active', 'on-danger',
6
+ 'success', 'success-hover', 'success-active', 'on-success',
7
+ 'warning', 'warning-hover', 'warning-active', 'on-warning',
8
+ 'surface-0', 'surface-1', 'surface-2', 'surface-3',
9
+ 'fg', 'fg-muted', 'fg-subtle',
10
+ 'line', 'line-strong',
11
+ 'focus',
12
+ ];
13
+
14
+ const colors = Object.fromEntries(colorNames.map((name) => [`ui-${name}`, channel(name)]));
15
+
16
+ /**
17
+ * Vocabulario herdado do `tailwindcss-primeui` (bg-primary, text-color, text-muted-color, bg-surface-100, border-surface,
18
+ * rounded-border), mantido para os apps e layouts existentes. Mapeia para os mesmos tokens do tema; a escala `surface-N` e fixa.
19
+ */
20
+ const surfaceScale = {
21
+ 0: '#ffffff', 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8',
22
+ 500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', 950: '#020617',
23
+ };
24
+ const legacyColors = {
25
+ primary: { DEFAULT: channel('primary'), contrast: channel('on-primary'), hover: channel('primary-hover'), active: channel('primary-active') },
26
+ surface: { DEFAULT: channel('line'), ...surfaceScale },
27
+ color: channel('fg'),
28
+ 'muted-color': channel('fg-muted'),
29
+ 'surface-border': channel('line'),
30
+ };
31
+
32
+ /**
33
+ * Preset do @ngx-smz/ui-kit. Mapeia os tokens do tema (variaveis CSS --smz-*)
34
+ * para utilitarios semanticos do Tailwind (bg-ui-primary, rounded-control, h-control...).
35
+ * Cores levam o prefixo `ui-` (bg-ui-primary, text-ui-fg) para nao colidir com plugins ou temas do app
36
+ * Os valores vivem no arquivo de tema (themes/*.css), nunca aqui.
37
+ */
38
+ module.exports = {
39
+ // Classes de layout que @ngx-smz/core monta em runtime (row: N dos templates de formulario/dialog): o scanner do
40
+ // Tailwind do app nao as ve nos templates, entao precisam estar na safelist.
41
+ safelist: [
42
+ { pattern: /^col-span-(1[0-2]|[1-9]|full)$/, variants: ['sm', 'md', 'lg', 'xl'] },
43
+ { pattern: /^w-((1[01]|[1-9])\/12|full)$/, variants: ['sm', 'md', 'lg', 'xl'] },
44
+ ],
45
+ theme: {
46
+ extend: {
47
+ colors: { ...colors, ...legacyColors },
48
+ fontFamily: {
49
+ ui: 'var(--smz-font-sans)',
50
+ 'ui-mono': 'var(--smz-font-mono)',
51
+ },
52
+ fontSize: {
53
+ 'ui-xs': ['var(--smz-text-xs)', 'var(--smz-leading)'],
54
+ 'ui-sm': ['var(--smz-text-sm)', 'var(--smz-leading)'],
55
+ 'ui-md': ['var(--smz-text-md)', 'var(--smz-leading)'],
56
+ 'ui-lg': ['var(--smz-text-lg)', 'var(--smz-leading)'],
57
+ 'ui-xl': ['var(--smz-text-xl)', 'var(--smz-leading)'],
58
+ },
59
+ height: {
60
+ 'control-sm': 'var(--smz-control-h-sm)',
61
+ control: 'var(--smz-control-h)',
62
+ 'control-lg': 'var(--smz-control-h-lg)',
63
+ },
64
+ minHeight: {
65
+ 'control-sm': 'var(--smz-control-h-sm)',
66
+ control: 'var(--smz-control-h)',
67
+ 'control-lg': 'var(--smz-control-h-lg)',
68
+ },
69
+ padding: {
70
+ 'control-x-sm': 'var(--smz-control-px-sm)',
71
+ 'control-x': 'var(--smz-control-px)',
72
+ 'control-x-lg': 'var(--smz-control-px-lg)',
73
+ 'input-x-sm': 'var(--smz-input-px-sm)',
74
+ 'input-x': 'var(--smz-input-px)',
75
+ },
76
+ borderRadius: {
77
+ control: 'var(--smz-radius-control)',
78
+ card: 'var(--smz-radius-card)',
79
+ overlay: 'var(--smz-radius-overlay)',
80
+ border: 'var(--smz-radius-control)',
81
+ },
82
+ boxShadow: {
83
+ card: 'var(--smz-shadow-card)',
84
+ overlay: 'var(--smz-shadow-overlay)',
85
+ },
86
+ transitionDuration: {
87
+ ui: 'var(--smz-duration)',
88
+ },
89
+ },
90
+ },
91
+ };
@@ -699,7 +699,9 @@ declare class SmzDialogComponent implements OnDestroy {
699
699
  readonly hidden: _angular_core.OutputEmitterRef<void>;
700
700
  private readonly panel;
701
701
  private readonly templates;
702
+ /** `header`: acoes extras na barra padrao (titulo, maximizar e fechar permanecem). `headerFull`: substitui a barra inteira. */
702
703
  protected readonly headerTemplate: _angular_core.Signal<TemplateRef<unknown>>;
704
+ protected readonly headerFullTemplate: _angular_core.Signal<TemplateRef<unknown>>;
703
705
  protected readonly footerTemplate: _angular_core.Signal<TemplateRef<unknown>>;
704
706
  private readonly overlay;
705
707
  private readonly viewContainer;
@@ -1234,6 +1236,7 @@ declare class SmzListboxComponent extends SmzValueAccessor<any> {
1234
1236
  protected rowClass(option: any): string;
1235
1237
  protected onFilter(event: Event): void;
1236
1238
  protected onItemClick(option: any, event: Event): void;
1239
+ protected onItemEnter(option: any, event: Event): void;
1237
1240
  protected focusSibling(event: Event, step: 1 | -1): void;
1238
1241
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SmzListboxComponent, never>;
1239
1242
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SmzListboxComponent, "ui-listbox", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "checkbox": { "alias": "checkbox"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterMatchMode": { "alias": "filterMatchMode"; "required": false; "isSignal": true; }; "metaKeySelection": { "alias": "metaKeySelection"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "listStyle": { "alias": "listStyle"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, { "changed": "changed"; "clicked": "clicked"; }, ["templates"], never, true, never>;
@@ -2389,6 +2392,12 @@ declare class SmzTreeTableComponent {
2389
2392
  readonly rowsPerPageOptions: _angular_core.InputSignal<number[]>;
2390
2393
  readonly sortField: _angular_core.ModelSignal<string>;
2391
2394
  readonly sortOrder: _angular_core.ModelSignal<1 | -1>;
2395
+ /**
2396
+ * Clicar na linha de um no com filhos expande/recolhe (e emite `nodeExpand`/`nodeCollapse`). Cliques em controles
2397
+ * interativos da linha (button, a, input, select, textarea, `[role=button]`, `[role=checkbox]`, `[data-no-row-toggle]`)
2398
+ * nao alternam. Enter/Espaco na linha focada tambem alternam.
2399
+ */
2400
+ readonly expandOnRowClick: _angular_core.InputSignalWithTransform<boolean, unknown>;
2392
2401
  /** Destaca a linha sob o cursor (padrao: ligado). */
2393
2402
  readonly rowHover: _angular_core.InputSignalWithTransform<boolean, unknown>;
2394
2403
  readonly showCurrentPageReport: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -2447,13 +2456,17 @@ declare class SmzTreeTableComponent {
2447
2456
  private countNodes;
2448
2457
  private findParent;
2449
2458
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SmzTreeTableComponent, never>;
2450
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SmzTreeTableComponent, "ui-tree-table", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "propagateSelectionUp": { "alias": "propagateSelectionUp"; "required": false; "isSignal": true; }; "propagateSelectionDown": { "alias": "propagateSelectionDown"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "tableStyleClass": { "alias": "tableStyleClass"; "required": false; "isSignal": true; }; "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "showCurrentPageReport": { "alias": "showCurrentPageReport"; "required": false; "isSignal": true; }; "currentPageReportTemplate": { "alias": "currentPageReportTemplate"; "required": false; "isSignal": true; }; "globalFilterFields": { "alias": "globalFilterFields"; "required": false; "isSignal": true; }; "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "rows": "rowsChange"; "first": "firstChange"; "sortField": "sortFieldChange"; "sortOrder": "sortOrderChange"; "nodeSelect": "nodeSelect"; "nodeUnselect": "nodeUnselect"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "sorted": "sorted"; "page": "page"; }, ["templates"], never, true, never>;
2459
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SmzTreeTableComponent, "ui-tree-table", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "propagateSelectionUp": { "alias": "propagateSelectionUp"; "required": false; "isSignal": true; }; "propagateSelectionDown": { "alias": "propagateSelectionDown"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "tableStyleClass": { "alias": "tableStyleClass"; "required": false; "isSignal": true; }; "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; "expandOnRowClick": { "alias": "expandOnRowClick"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "showCurrentPageReport": { "alias": "showCurrentPageReport"; "required": false; "isSignal": true; }; "currentPageReportTemplate": { "alias": "currentPageReportTemplate"; "required": false; "isSignal": true; }; "globalFilterFields": { "alias": "globalFilterFields"; "required": false; "isSignal": true; }; "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "rows": "rowsChange"; "first": "firstChange"; "sortField": "sortFieldChange"; "sortOrder": "sortOrderChange"; "nodeSelect": "nodeSelect"; "nodeUnselect": "nodeUnselect"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "sorted": "sorted"; "page": "page"; }, ["templates"], never, true, never>;
2451
2460
  }
2452
2461
  /** Linha do corpo: `<tr [smzTtRow]="rowNode">`. Cuida de estilo, aria e selecao por clique. */
2453
2462
  declare class SmzTreeTableRowDirective {
2454
2463
  protected readonly table: SmzTreeTableComponent;
2455
2464
  readonly rowNode: _angular_core.InputSignal<SmzTreeTableRowNode<any>>;
2465
+ /** A linha alterna o no (expandOnRowClick ligado e o no tem filhos). */
2466
+ protected readonly togglesOnRow: _angular_core.Signal<boolean>;
2456
2467
  protected readonly classes: _angular_core.Signal<string>;
2468
+ protected onClick(event: Event): void;
2469
+ protected onKey(event: Event): void;
2457
2470
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SmzTreeTableRowDirective, never>;
2458
2471
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SmzTreeTableRowDirective, "tr[smzTtRow]", never, { "rowNode": { "alias": "smzTtRow"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
2459
2472
  }
@@ -2461,9 +2474,15 @@ declare class SmzTreeTableRowDirective {
2461
2474
  declare class SmzTreeTableTogglerComponent {
2462
2475
  protected readonly table: SmzTreeTableComponent;
2463
2476
  readonly rowNode: _angular_core.InputSignal<SmzTreeTableRowNode<any>>;
2477
+ /**
2478
+ * Tamanho do alvo clicavel: `sm` 24px (denso), `md` 32px (padrao, minimo recomendado) e `lg` 40px. A margem negativa mantem
2479
+ * o espaco ocupado na linha (24px): so a area de clique cresce, sem mudar a altura da linha nem o visual da seta.
2480
+ */
2481
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
2482
+ protected readonly sizeClass: _angular_core.Signal<string>;
2464
2483
  protected hasChildren(): boolean;
2465
2484
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SmzTreeTableTogglerComponent, never>;
2466
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SmzTreeTableTogglerComponent, "ui-tree-table-toggler", never, { "rowNode": { "alias": "rowNode"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
2485
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SmzTreeTableTogglerComponent, "ui-tree-table-toggler", never, { "rowNode": { "alias": "rowNode"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
2467
2486
  }
2468
2487
  /** Checkbox de selecao da linha (modo `checkbox`): `<ui-tree-table-checkbox [value]="rowNode" />`. */
2469
2488
  declare class SmzTreeTableCheckboxComponent {