@zambon-dev/ui 1.9.0 → 1.11.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.
@@ -49,6 +49,8 @@
49
49
  "Format-DateTime": "MM/dd/yyyy hh:mm a",
50
50
  "Format-Number": "1.0",
51
51
  "Grid-Columns": "Choose columns",
52
+ "Grid-Copied": "Copied {{ count }} rows",
53
+ "Grid-CopiedRow": "Copied 1 row",
52
54
  "Grid-Loading": "Loading...",
53
55
  "Grid-Message-Empty": "No records found.",
54
56
  "Grid-Message-Failed": "An error occurred while loading the records. Please try again later.",
@@ -49,6 +49,8 @@
49
49
  "Format-DateTime": "dd/MM/yyyy HH:mm",
50
50
  "Format-Number": "1.0",
51
51
  "Grid-Columns": "Colunas",
52
+ "Grid-Copied": "{{ count }} linhas copiadas",
53
+ "Grid-CopiedRow": "1 linha copiada",
52
54
  "Grid-Loading": "Carregando...",
53
55
  "Grid-Message-Empty": "Nenhum registro encontrado.",
54
56
  "Grid-Message-Failed": "Ocorreu um erro ao carregar os registros. Por favor, tente novamente mais tarde.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zambon-dev/ui",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "Angular 22 component library and application shell: form controls, a virtual-scroll data grid, modals, ribbon, sidebar, tabbed navigation, view base classes and authentication layouts, themed with Tailwind CSS 4 tokens.",
5
5
  "keywords": [
6
6
  "angular",
@@ -27,6 +27,15 @@
27
27
  "url": "https://github.com/RicardoZambon/ZLibraries/issues"
28
28
  },
29
29
  "homepage": "https://ricardozambon.github.io/ZLibraries/",
30
+ "schematics": "./schematics/collection.json",
31
+ "ng-add": {
32
+ "save": "dependencies"
33
+ },
34
+ "dependencies": {
35
+ "@angular-devkit/schematics": "^22.0.0",
36
+ "@schematics/angular": "^22.0.0",
37
+ "tslib": "^2.3.0"
38
+ },
30
39
  "peerDependencies": {
31
40
  "@angular/cdk": "^22.0.0",
32
41
  "@angular/common": "^22.0.0",
@@ -106,8 +115,5 @@
106
115
  "style": "styles/common.scss",
107
116
  "module": "fesm2022/zambon-dev-ui.mjs",
108
117
  "typings": "types/zambon-dev-ui.d.ts",
109
- "type": "module",
110
- "dependencies": {
111
- "tslib": "^2.3.0"
112
- }
118
+ "type": "module"
113
119
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Sets up @zambon-dev/ui in a standalone Angular application.",
6
+ "factory": "./ng-add/index#ngAdd",
7
+ "schema": "./ng-add/schema.json"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18N_ASSETS = exports.BUILD_DEPENDENCIES = void 0;
4
+ exports.ngAdd = ngAdd;
5
+ exports.withGlobalStyles = withGlobalStyles;
6
+ const schematics_1 = require("@angular-devkit/schematics");
7
+ const utility_1 = require("@schematics/angular/utility");
8
+ const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
9
+ const app_config_1 = require("@schematics/angular/utility/standalone/app_config");
10
+ const util_1 = require("@schematics/angular/utility/standalone/util");
11
+ const node_fs_1 = require("node:fs");
12
+ const node_path_1 = require("node:path");
13
+ const providers_1 = require("./providers");
14
+ /** Packages the styles need. They are not peer dependencies, so the consumer installs them. */
15
+ exports.BUILD_DEPENDENCIES = [
16
+ { name: 'tailwindcss', version: '^4.0.0', type: utility_1.DependencyType.Dev },
17
+ { name: '@tailwindcss/postcss', version: '^4.0.0', type: utility_1.DependencyType.Dev },
18
+ { name: '@tailwindcss/forms', version: '^0.5.9', type: utility_1.DependencyType.Dev },
19
+ { name: '@fortawesome/fontawesome-free', version: '^7.0.0', type: utility_1.DependencyType.Default },
20
+ ];
21
+ const FONT_AWESOME_CSS = '@fortawesome/fontawesome-free/css/all.css';
22
+ const THEME_CSS = '@zambon-dev/ui/styles/theme.css';
23
+ const COMMON_SCSS = '@zambon-dev/ui/styles/common.scss';
24
+ /** The same objects as `ZAMBON_FRAMEWORK_I18N_ASSET` and `ZAMBON_SHARED_I18N_ASSET`; a spec keeps them equal. */
25
+ exports.I18N_ASSETS = [
26
+ {
27
+ glob: '**/*.json',
28
+ input: 'node_modules/@zambon-dev/ui/i18n/framework',
29
+ output: 'assets/i18n/zambon-dev/framework',
30
+ },
31
+ { glob: '**/*.json', input: 'node_modules/@zambon-dev/ui/i18n/shared', output: 'assets/i18n/zambon-dev/shared' },
32
+ ];
33
+ const POSTCSS_PLUGIN = '@tailwindcss/postcss';
34
+ const POSTCSS_CONFIG_FILES = ['.postcssrc.json', 'postcss.config.json'];
35
+ /** Must match `THEME_STORAGE_KEY`, which `ThemeService` writes. */
36
+ const THEME_SCRIPT_MARKER = "localStorage.getItem('zambon-theme')";
37
+ const THEME_SCRIPT = ` <script>
38
+ (function () {
39
+ try {
40
+ var p = localStorage.getItem('zambon-theme') || 'light';
41
+ if (p === 'system') p = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
42
+ document.documentElement.dataset.theme = p;
43
+ } catch (e) {
44
+ document.documentElement.dataset.theme = 'light';
45
+ }
46
+ })();
47
+ </script>
48
+ `;
49
+ const DOCS_URL = 'https://ricardozambon.github.io/ZLibraries/guides/getting-started';
50
+ const NEXT_STEPS = `
51
+ @zambon-dev/ui is set up. Library components such as lib-button render now.
52
+
53
+ The full application shell (MainLayoutComponent and the sign-in screen) needs values only your
54
+ application knows, so add these to the application config yourself:
55
+ - APP_CONFIG with your API base URL
56
+ - JwtModule.forRoot(...) with your token getter and domains, and JwtInterceptor
57
+ - AuthInterceptor in HTTP_INTERCEPTORS
58
+ - { provide: AuthService, useExisting: AuthenticationService }
59
+ - { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
60
+ - { provide: SidebarService, useClass: <your SidebarService subclass> }
61
+ - routes for MainLayoutComponent and SharedAuthModule
62
+
63
+ To load your own translation files, add a resource such as
64
+ { prefix: '/assets/i18n/', suffix: '.json' } to appResources.
65
+
66
+ Full guide: ${DOCS_URL}
67
+ `;
68
+ function ngAdd(options) {
69
+ return async (tree, context) => {
70
+ const workspace = await (0, utility_1.readWorkspace)(tree);
71
+ const projectName = resolveProjectName(options.project, workspace.projects);
72
+ const project = workspace.projects.get(projectName);
73
+ if (!project || project.extensions['projectType'] !== 'application') {
74
+ throw new schematics_1.SchematicsException(`"${projectName}" is not an application in this workspace.`);
75
+ }
76
+ if (!project.targets.get('build')) {
77
+ throw new schematics_1.SchematicsException(`The project "${projectName}" has no build target.`);
78
+ }
79
+ const mainPath = await (0, util_1.getMainFilePath)(tree, projectName);
80
+ if (!(0, ng_ast_utils_1.isStandaloneApp)(tree, mainPath)) {
81
+ throw new schematics_1.SchematicsException(`ng add @zambon-dev/ui supports standalone applications only, and "${projectName}" bootstraps an NgModule ` +
82
+ `(${mainPath} calls bootstrapModule). Nothing was changed. ` +
83
+ `Follow the manual setup instead: ${DOCS_URL}`);
84
+ }
85
+ return (0, schematics_1.chain)([
86
+ addDependencies(),
87
+ updateBuildOptions(projectName, project),
88
+ addPostcssConfig(),
89
+ addThemeScript(project),
90
+ addProviders(projectName, mainPath, context),
91
+ (_, ctx) => ctx.logger.info(NEXT_STEPS),
92
+ ]);
93
+ };
94
+ }
95
+ function resolveProjectName(requested, projects) {
96
+ if (requested) {
97
+ return requested;
98
+ }
99
+ const applications = [...projects].filter(([, project]) => project.extensions['projectType'] === 'application');
100
+ if (applications.length === 1) {
101
+ return applications[0][0];
102
+ }
103
+ throw new schematics_1.SchematicsException('Name the application to set up with --project.');
104
+ }
105
+ function addDependencies() {
106
+ // The peer dependencies go into package.json too: the application config imports some of them,
107
+ // and a strict package manager would not let it import a package it does not declare.
108
+ const manifest = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '..', '..', 'package.json'), 'utf8'));
109
+ const peers = Object.entries(manifest.peerDependencies ?? {}).map(([name, version]) => ({
110
+ name,
111
+ version,
112
+ type: utility_1.DependencyType.Default,
113
+ }));
114
+ return (0, schematics_1.chain)([...peers, ...exports.BUILD_DEPENDENCIES].map((dependency) => (0, utility_1.addDependency)(dependency.name, dependency.version, {
115
+ type: dependency.type,
116
+ existing: utility_1.ExistingBehavior.Skip,
117
+ })));
118
+ }
119
+ function styleInput(entry) {
120
+ return typeof entry === 'string' ? entry : entry.input;
121
+ }
122
+ /** Adds the three global stylesheets in their required order, and skips any already loaded. */
123
+ function withGlobalStyles(existing, tree) {
124
+ const styles = [...existing];
125
+ const indexOf = (needle) => styles.findIndex((entry) => {
126
+ const input = styleInput(entry);
127
+ return input === needle || (tree.exists(input) && tree.readText(input).includes(needle));
128
+ });
129
+ if (indexOf(FONT_AWESOME_CSS) < 0) {
130
+ styles.unshift(FONT_AWESOME_CSS);
131
+ }
132
+ if (indexOf(THEME_CSS) < 0) {
133
+ styles.splice(indexOf(FONT_AWESOME_CSS) + 1, 0, THEME_CSS);
134
+ }
135
+ if (indexOf(COMMON_SCSS) < 0) {
136
+ styles.splice(indexOf(THEME_CSS) + 1, 0, COMMON_SCSS);
137
+ }
138
+ return styles;
139
+ }
140
+ function updateBuildOptions(projectName, project) {
141
+ return (tree) => {
142
+ const options = project.targets.get('build')?.options ?? {};
143
+ const styles = withGlobalStyles(options['styles'] ?? [], tree);
144
+ const assets = [...(options['assets'] ?? [])];
145
+ for (const asset of exports.I18N_ASSETS) {
146
+ const present = assets.some((entry) => (typeof entry === 'string' ? entry : entry.input) === asset.input);
147
+ if (!present) {
148
+ assets.push(asset);
149
+ }
150
+ }
151
+ return (0, utility_1.updateWorkspace)((workspace) => {
152
+ const build = workspace.projects.get(projectName)?.targets.get('build');
153
+ if (!build) {
154
+ return;
155
+ }
156
+ build.options ??= {};
157
+ build.options['styles'] = styles;
158
+ build.options['assets'] = assets;
159
+ });
160
+ };
161
+ }
162
+ function addPostcssConfig() {
163
+ return (tree, context) => {
164
+ const existing = POSTCSS_CONFIG_FILES.find((file) => tree.exists(file));
165
+ if (!existing) {
166
+ tree.create('.postcssrc.json', JSON.stringify({ plugins: { [POSTCSS_PLUGIN]: {} } }, null, 2) + '\n');
167
+ return;
168
+ }
169
+ let config;
170
+ try {
171
+ config = JSON.parse(tree.readText(existing));
172
+ }
173
+ catch {
174
+ context.logger.warn(`Could not read ${existing}. Add "${POSTCSS_PLUGIN}": {} to its plugins yourself.`);
175
+ return;
176
+ }
177
+ if (config.plugins?.[POSTCSS_PLUGIN]) {
178
+ return;
179
+ }
180
+ config.plugins = { ...config.plugins, [POSTCSS_PLUGIN]: {} };
181
+ tree.overwrite(existing, JSON.stringify(config, null, 2) + '\n');
182
+ };
183
+ }
184
+ function indexHtmlPath(project) {
185
+ const index = project.targets.get('build')?.options?.['index'];
186
+ if (typeof index === 'string') {
187
+ return index;
188
+ }
189
+ if (index?.input) {
190
+ return index.input;
191
+ }
192
+ return node_path_1.posix.join(project.sourceRoot ?? node_path_1.posix.join(project.root, 'src'), 'index.html');
193
+ }
194
+ /** Sets the theme before the first paint, so a user who chose dark never sees a flash of light. */
195
+ function addThemeScript(project) {
196
+ return (tree, context) => {
197
+ const path = indexHtmlPath(project);
198
+ if (!tree.exists(path)) {
199
+ context.logger.warn(`${path} not found. Add the dark-theme script yourself: ${DOCS_URL}`);
200
+ return;
201
+ }
202
+ const html = tree.readText(path);
203
+ if (html.includes(THEME_SCRIPT_MARKER)) {
204
+ return;
205
+ }
206
+ const headEnd = html.indexOf('</head>');
207
+ if (headEnd < 0) {
208
+ context.logger.warn(`${path} has no </head>. Add the dark-theme script yourself: ${DOCS_URL}`);
209
+ return;
210
+ }
211
+ // At the start of the </head> line, so the script is the last element in <head>.
212
+ const lineStart = html.lastIndexOf('\n', headEnd) + 1;
213
+ const atLineStart = html.slice(lineStart, headEnd).trim() === '';
214
+ const recorder = tree.beginUpdate(path);
215
+ recorder.insertLeft(atLineStart ? lineStart : headEnd, atLineStart ? THEME_SCRIPT : '\n' + THEME_SCRIPT);
216
+ tree.commitUpdate(recorder);
217
+ };
218
+ }
219
+ function addProviders(projectName, mainPath, context) {
220
+ return (tree) => {
221
+ const bootstrapCall = (0, util_1.findBootstrapApplicationCall)(tree, mainPath);
222
+ const configPath = (0, app_config_1.findAppConfig)(bootstrapCall, tree, mainPath)?.filePath ?? mainPath;
223
+ const source = tree.readText(configPath);
224
+ const rules = [];
225
+ for (const provider of providers_1.ROOT_PROVIDERS) {
226
+ if (provider.alreadyProvided.test(source)) {
227
+ context.logger.info(`Skipped ${provider.description}: already in ${configPath}.`);
228
+ const warning = provider.checkExisting?.(source);
229
+ if (warning) {
230
+ context.logger.warn(warning);
231
+ }
232
+ continue;
233
+ }
234
+ rules.push((0, utility_1.addRootProvider)(projectName, provider.code));
235
+ }
236
+ return (0, schematics_1.chain)(rules);
237
+ };
238
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ROOT_PROVIDERS = void 0;
4
+ /**
5
+ * Every root provider `ng add` adds, in order. This is the one list to change when the setup
6
+ * changes. Providers that need values only the application knows (the API URL, the JWT options,
7
+ * the sidebar service, the routes) are not here: `ng add` prints them as next steps instead.
8
+ */
9
+ exports.ROOT_PROVIDERS = [
10
+ {
11
+ description: 'HTTP client with class-based interceptors',
12
+ alreadyProvided: /\bprovideHttpClient\s*\(/,
13
+ code: ({ code, external }) => code `${external('provideHttpClient', '@angular/common/http')}(${external('withInterceptorsFromDi', '@angular/common/http')}())`,
14
+ checkExisting: (source) => /\bwithInterceptorsFromDi\s*\(/.test(source)
15
+ ? undefined
16
+ : 'provideHttpClient() is already in the application config without withInterceptorsFromDi(). ' +
17
+ 'Add it if you use AuthInterceptor: the package registers it as a class-based interceptor.',
18
+ },
19
+ {
20
+ description: 'translations for the framework and shared layers',
21
+ alreadyProvided: /\bprovideZambon(Shared|Framework)TranslateService\s*\(|\bprovideTranslateService\s*\(|\bTranslateModule\.forRoot\s*\(/,
22
+ code: ({ code, external }) => code `${external('provideZambonSharedTranslateService', '@zambon-dev/ui/shared')}({
23
+ defaultLanguage: 'en',
24
+ appResources: [...${external('ZAMBON_FRAMEWORK_I18N_RESOURCES', '@zambon-dev/ui/framework')}],
25
+ })`,
26
+ },
27
+ {
28
+ description: 'language selection at startup',
29
+ alreadyProvided: /\.addLangs\s*\(/,
30
+ code: ({ code, external }) => code `${external('provideAppInitializer', '@angular/core')}(() => {
31
+ const translate = ${external('inject', '@angular/core')}(${external('TranslateService', '@ngx-translate/core')});
32
+ translate.addLangs(['en', 'pt']);
33
+ translate.use(globalThis.localStorage?.getItem('language') ?? 'en');
34
+ })`,
35
+ },
36
+ {
37
+ description: 'grid messages as translation keys',
38
+ alreadyProvided: /\bGridConfigsProvider\b/,
39
+ code: ({ code, external }) => code `{ provide: ${external('GridConfigsProvider', '@zambon-dev/ui/library')}, useClass: ${external('FrameworkGridConfigsProvider', '@zambon-dev/ui/framework')} }`,
40
+ },
41
+ ];
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "ZambonDevUiNgAdd",
4
+ "title": "@zambon-dev/ui ng-add",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The application to set up. Defaults to the project in the current folder, or the only application in the workspace.",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ }
14
+ },
15
+ "required": []
16
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -253,6 +253,10 @@ export interface AngularAssetPattern {
253
253
  input: string;
254
254
  output: string;
255
255
  }
256
+ /** The row height, in pixels, that `GridConfigsProvider` gives every grid. */
257
+ export declare const DEFAULT_GRID_ROW_HEIGHT = 41.6;
258
+ /** The row height, in pixels, of a `compact` data grid whose `rowHeight` is the default. */
259
+ export declare const COMPACT_GRID_ROW_HEIGHT = 32;
256
260
  export type GridConfigs = {
257
261
  loadingDisplayText?: string;
258
262
  messageOnEmpty?: string;
@@ -262,7 +266,27 @@ export type GridConfigs = {
262
266
  rowHeight: number;
263
267
  rowsToDisplay: number;
264
268
  };
269
+ /** How tightly a data grid sets its rows. See `DataGridConfigs.density`. */
270
+ export type DataGridDensity = 'comfortable' | 'compact';
265
271
  export type DataGridConfigs = GridConfigs & {
272
+ /**
273
+ * How tightly the grid sets its rows. `compact` uses 32px rows and tighter cell padding, for
274
+ * dense screens. A `rowHeight` other than the default 41.6px still wins, in either density.
275
+ * Defaults to `comfortable`.
276
+ */
277
+ density?: DataGridDensity;
278
+ /**
279
+ * Keeps the first visible data column in place while the grid scrolls sideways. The selection
280
+ * column of a multi-select grid stays with it. Defaults to `false`.
281
+ */
282
+ pinFirstColumn?: boolean;
283
+ /**
284
+ * What screen readers hear after Ctrl+C or Cmd+C copies rows, as a translation key or plain text.
285
+ * `{{ count }}` is replaced by the number of rows copied. Defaults to `Copied {{ count }} rows`.
286
+ */
287
+ copiedText?: string;
288
+ /** The same text when exactly one row was copied. Defaults to `Copied 1 row`. */
289
+ copiedRowText?: string;
266
290
  /** Drops the grid's outline and rounded corner, for a grid that sits inside a card of its own. */
267
291
  hideBorders?: boolean;
268
292
  /**
@@ -1054,6 +1078,12 @@ export declare abstract class DataGridDataset extends GridDataset {
1054
1078
  get columnsSize(): string;
1055
1079
  /** The columns the grid shows: `columns` without the hidden ones. */
1056
1080
  get visibleColumns(): IGridColumn[];
1081
+ /**
1082
+ * The height in pixels the grid gives each row. A `compact` grid uses 32px while `rowHeight` is the
1083
+ * default 41.6px. Any other `rowHeight`, set on the dataset or by the configs provider, wins in
1084
+ * either density.
1085
+ */
1086
+ get effectiveRowHeight(): number;
1057
1087
  get hasSelectedRows(): boolean;
1058
1088
  constructor();
1059
1089
  clearSelection(): void;
@@ -1306,18 +1336,27 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
1306
1336
  protected readonly hasFailed: WritableSignal<boolean>;
1307
1337
  protected readonly headerRightMargin: WritableSignal<number>;
1308
1338
  protected readonly headerScrollLeft: WritableSignal<number>;
1339
+ /**
1340
+ * The height in pixels of the body's horizontal scrollbar while the columns are wider than the
1341
+ * grid, else 0. The body grows by it, so the scrollbar does not cover the last row.
1342
+ */
1343
+ protected readonly horizontalScrollbarHeight: WritableSignal<number>;
1344
+ /** How many rows the last copy put on the clipboard, while the status region announces it. */
1345
+ protected readonly copiedCount: WritableSignal<number | null>;
1309
1346
  protected readonly loading: WritableSignal<boolean>;
1310
1347
  /** Whether the column chooser popover is open. */
1311
1348
  protected readonly columnChooserOpen: WritableSignal<boolean>;
1312
1349
  protected readonly columnChooserId: string;
1313
1350
  protected readonly minColumnWidth: number;
1314
1351
  private bodyResized$;
1352
+ private copiedTimer?;
1315
1353
  /**
1316
1354
  * The key of a row the keyboard moved to that was not rendered yet. It gets the DOM focus after
1317
1355
  * the virtual scroll renders it; see focusPendingRow.
1318
1356
  */
1319
1357
  private pendingFocusKey;
1320
1358
  private bodyResizeObserver?;
1359
+ private contentResizeObserver?;
1321
1360
  private columnChooserRef?;
1322
1361
  private readonly document;
1323
1362
  private readonly injector;
@@ -1332,8 +1371,20 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
1332
1371
  private readonly localeService;
1333
1372
  private ngZone;
1334
1373
  private router;
1374
+ private readonly translateService;
1335
1375
  private selectionColRealSize?;
1336
1376
  protected get bodyMinHeight(): number;
1377
+ /** The height in pixels of each row: `rowHeight`, or 32px in a `compact` grid at the default. */
1378
+ protected get rowHeight(): number;
1379
+ /** Whether the first data column, and the selection column, stay in place sideways. */
1380
+ protected get pinFirstColumn(): boolean;
1381
+ /** The first column the header and the rows show, which `pinFirstColumn` pins. */
1382
+ protected get firstColumn(): IGridColumn | undefined;
1383
+ /**
1384
+ * Where the pinned data column sticks after a pinned selection column: the selection cell's full
1385
+ * width, its reach over the row's padding included. `null` until the selection cell is measured.
1386
+ */
1387
+ protected get pinOffset(): string | null;
1337
1388
  /**
1338
1389
  * The grid's `aria-rowcount`, header row included. The dataset's `totalRows` when the last load
1339
1390
  * returned one; the loaded rows once the last block is in; otherwise -1, which tells assistive
@@ -1419,6 +1470,12 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
1419
1470
  * itself counts, so a control inside a cell keeps its own keys. A disabled grid ignores them all.
1420
1471
  */
1421
1472
  protected onKeydown(event: KeyboardEvent): void;
1473
+ /**
1474
+ * Ctrl+C or Cmd+C on a focused row copies rows as tab-separated text, one line per row: the
1475
+ * selected rows of a multi-select grid that has a selection, else the focused row. Text the user
1476
+ * selected is left to the browser's own copy. Without the Clipboard API nothing happens.
1477
+ */
1478
+ protected onCopyKeydown(event: KeyboardEvent): void;
1422
1479
  /** The column chooser button: opens the chooser, or closes it when it is open. */
1423
1480
  protected onToggleColumnChooser(): void;
1424
1481
  /** A key inside the chooser. Escape closes it and gives the focus back to the button. */
@@ -1444,6 +1501,12 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
1444
1501
  * key, but returns plain text such as the library default untouched, placeholder and all.
1445
1502
  */
1446
1503
  protected fillCount(text: string): string;
1504
+ /** The number of rows the last copy took, in the application's language, for the status region. */
1505
+ protected get formattedCopiedCount(): string;
1506
+ /** Puts the copied rows' count into the status text, when it is plain text the pipe left alone. */
1507
+ protected fillCopiedCount(text: string): string;
1508
+ /** The translateX a pinned heading takes to stay in place while the header row moves sideways. */
1509
+ protected pinnedHeaderTransform(): string | null;
1447
1510
  /**
1448
1511
  * The width of a header cell, in pixels: the width of the column's cell measured in the first
1449
1512
  * row, or before that the width the user gave the column. `null` until either is known.
@@ -1463,6 +1526,25 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
1463
1526
  */
1464
1527
  protected fillColumn(text: string, columnName: string): string;
1465
1528
  protected isFirstVisibleRow(rowIndex: number): boolean;
1529
+ /**
1530
+ * Says through the status region how many rows were copied, for a while. The same text twice in
1531
+ * a row would not be announced again, so the region is emptied first and filled a moment later.
1532
+ */
1533
+ private announceCopied;
1534
+ /** The text a copy takes from a cell: what the cell shows, translated, on one line. */
1535
+ private cellText;
1536
+ /** Whether the document has a non-empty text selection, which the browser's own copy takes. */
1537
+ private hasTextSelection;
1538
+ /** Whether the key is Ctrl+C, or Cmd+C on a Mac. */
1539
+ private isCopyShortcut;
1540
+ /**
1541
+ * Measures the body's horizontal scrollbar: the viewport's height less its client height, while
1542
+ * its content is wider than it. Writes the signal only on a change. Skipped while detached; see
1543
+ * isBodyAttached.
1544
+ */
1545
+ private measureHorizontalScrollbar;
1546
+ /** The rows as tab-separated text, one line per row, of the visible columns but `actions` ones. */
1547
+ private rowsAsText;
1466
1548
  /**
1467
1549
  * Opens the column chooser in a CDK overlay under its button. The focus moves to its first
1468
1550
  * control and stays inside until Escape or a click outside closes it.
@@ -1583,11 +1665,20 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
1583
1665
  *
1584
1666
  * A click on the label around the selection checkbox is skipped: the browser forwards it to the
1585
1667
  * checkbox, and that second click reaches the row too. Handling both toggled the row twice.
1668
+ *
1669
+ * A click that ends with text selected inside the grid is skipped too: it was a drag to select
1670
+ * that text, so the user can copy it without selecting or focusing the row.
1586
1671
  */
1587
1672
  setFocus(event?: MouseEvent): void;
1673
+ /**
1674
+ * Keeps a double or triple click from selecting a word or the cell's text: the double click opens
1675
+ * the record, and a selection left behind would make its second click count as a text selection.
1676
+ * Dragging still selects text. A control in a cell keeps its own behaviour.
1677
+ */
1678
+ preventMultiClickSelection(event: MouseEvent): void;
1588
1679
  /**
1589
1680
  * Announces the row as activated through the dataset's `rowActivated`. Runs on a double click on
1590
- * the row; does nothing while disabled. The host is `select-none`, so no text gets selected.
1681
+ * the row; does nothing while disabled.
1591
1682
  */
1592
1683
  activate(): void;
1593
1684
  protected dataGridDataset: DataGridDataset;
@@ -1604,6 +1695,8 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
1604
1695
  private get isLaidOut();
1605
1696
  private get isRowDataSelected();
1606
1697
  protected get rowKey(): string;
1698
+ /** Whether the grid keeps its first data column, and its selection column, in place sideways. */
1699
+ protected get pinFirstColumn(): boolean;
1607
1700
  protected get selectRowText(): string;
1608
1701
  constructor();
1609
1702
  ngOnInit(): void;
@@ -1626,6 +1719,8 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
1626
1719
  protected visibleActions(column: IGridColumn): IGridRowAction[];
1627
1720
  protected isNumeric(column: IGridColumn): boolean;
1628
1721
  protected getValue(field: string): any;
1722
+ /** Whether the document has a non-empty text selection that starts or ends inside this row's grid. */
1723
+ private hasTextSelectionInGrid;
1629
1724
  private refreshSelection;
1630
1725
  static ɵfac: i0.ɵɵFactoryDeclaration<DataGridRowComponent, never>;
1631
1726
  static ɵcmp: i0.ɵɵComponentDeclaration<DataGridRowComponent, "lib-data-grid-row", never, {