@worktile/theia 19.3.4 → 19.4.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/fesm2022/worktile-theia.mjs +636 -14
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/interfaces/editor.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/table/components/table.component.d.ts +11 -0
- package/plugins/table/components/table.component.scss +32 -1
- package/plugins/table/table.types.d.ts +1 -0
|
@@ -10,7 +10,7 @@ import { cloneDeep, map, assign, defaults, groupBy, uniq, isEqual } from 'lodash
|
|
|
10
10
|
export { assign, cloneDeep, debounce, defaults, groupBy, isEqual, map, uniq } from 'lodash';
|
|
11
11
|
import { Editor, Element, Span, Range, Path, Node, Point, Text, Transforms, Operation, createEditor } from 'slate';
|
|
12
12
|
import * as i4 from 'slate-angular';
|
|
13
|
-
import { FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, getClipboardData, AngularEditor, hotkeys, getPlainText as getPlainText$1, createClipboardData, setClipboardData,
|
|
13
|
+
import { FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, getClipboardData, AngularEditor, hotkeys, getPlainText as getPlainText$1, createClipboardData, setClipboardData, BaseElementComponent, IS_SAFARI, ELEMENT_TO_COMPONENT, BaseTextComponent, SlateModule, hasBlockCard, isCardLeft, SlateChildrenOutlet, defaultScrollSelectionIntoView, getDataTransferClipboard, withAngular } from 'slate-angular';
|
|
14
14
|
import { HistoryEditor, withHistory } from 'slate-history';
|
|
15
15
|
import { NODE_TO_PARENT, NODE_TO_INDEX, NODE_TO_ELEMENT, EDITOR_TO_ELEMENT } from 'slate-dom';
|
|
16
16
|
import { TheiaConverter } from '@atinc/selene';
|
|
@@ -219,6 +219,18 @@ const DEFAULT_LANGUAGE = {
|
|
|
219
219
|
value: 'javascript'
|
|
220
220
|
};
|
|
221
221
|
const CODE_MODES = [
|
|
222
|
+
{
|
|
223
|
+
showName: 'APL',
|
|
224
|
+
value: 'apl'
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
showName: 'ASN.1',
|
|
228
|
+
value: 'asn.1'
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
showName: 'Brainfuck',
|
|
232
|
+
value: 'brainfuck'
|
|
233
|
+
},
|
|
222
234
|
{
|
|
223
235
|
showName: 'C',
|
|
224
236
|
value: 'c'
|
|
@@ -235,66 +247,510 @@ const CODE_MODES = [
|
|
|
235
247
|
showName: 'C-like',
|
|
236
248
|
value: 'clike'
|
|
237
249
|
},
|
|
250
|
+
{
|
|
251
|
+
showName: 'Ceylon',
|
|
252
|
+
value: 'ceylon'
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
showName: 'Clojure',
|
|
256
|
+
value: 'clojure'
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
showName: 'Closure Stylesheets (GSS)',
|
|
260
|
+
value: 'gss'
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
showName: 'CMake',
|
|
264
|
+
value: 'cmake'
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
showName: 'COBOL',
|
|
268
|
+
value: 'cobol'
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
showName: 'CoffeeScript',
|
|
272
|
+
value: 'coffeescript'
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
showName: 'Common Lisp',
|
|
276
|
+
value: 'commonlisp'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
showName: 'Crystal',
|
|
280
|
+
value: 'crystal'
|
|
281
|
+
},
|
|
238
282
|
{
|
|
239
283
|
showName: 'CSS',
|
|
240
284
|
value: 'css'
|
|
241
285
|
},
|
|
286
|
+
{
|
|
287
|
+
showName: 'Cypher',
|
|
288
|
+
value: 'cypher'
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
showName: 'Cython',
|
|
292
|
+
value: 'cython'
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
showName: 'D',
|
|
296
|
+
value: 'd'
|
|
297
|
+
},
|
|
242
298
|
{
|
|
243
299
|
showName: 'Dart',
|
|
244
300
|
value: 'dart'
|
|
245
301
|
},
|
|
246
302
|
{
|
|
247
|
-
showName: 'Django',
|
|
303
|
+
showName: 'Django (templating language)',
|
|
248
304
|
value: 'django'
|
|
249
305
|
},
|
|
250
306
|
{
|
|
251
307
|
showName: 'Dockerfile',
|
|
252
308
|
value: 'dockerfile'
|
|
253
309
|
},
|
|
310
|
+
{
|
|
311
|
+
showName: 'diff',
|
|
312
|
+
value: 'diff'
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
showName: 'DTD',
|
|
316
|
+
value: 'dtd'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
showName: 'Dylan',
|
|
320
|
+
value: 'dylan'
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
showName: 'EBNF',
|
|
324
|
+
value: 'ebnf'
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
showName: 'ECL',
|
|
328
|
+
value: 'ecl'
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
showName: 'Eiffel',
|
|
332
|
+
value: 'eiffel'
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
showName: 'Elixir',
|
|
336
|
+
value: 'elixir'
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
showName: 'Elm',
|
|
340
|
+
value: 'elm'
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
showName: 'Erlang',
|
|
344
|
+
value: 'erlang'
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
showName: 'Factor',
|
|
348
|
+
value: 'factor'
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
showName: 'FCL',
|
|
352
|
+
value: 'fcl'
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
showName: 'Forth',
|
|
356
|
+
value: 'forth'
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
showName: 'Fortran',
|
|
360
|
+
value: 'fortran'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
showName: 'F#',
|
|
364
|
+
value: 'fsharp'
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
showName: 'Gas (AT&T-style assembly)',
|
|
368
|
+
value: 'gas'
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
showName: 'Gherkin',
|
|
372
|
+
value: 'gherkin'
|
|
373
|
+
},
|
|
254
374
|
{
|
|
255
375
|
showName: 'Go',
|
|
256
376
|
value: 'go'
|
|
257
377
|
},
|
|
258
378
|
{
|
|
259
|
-
showName: '
|
|
260
|
-
value: '
|
|
379
|
+
showName: 'Groovy',
|
|
380
|
+
value: 'groovy'
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
showName: 'HAML',
|
|
384
|
+
value: 'haml'
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
showName: 'Handlebars',
|
|
388
|
+
value: 'handlebars'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
showName: 'Haskell (Literate)',
|
|
392
|
+
value: 'haskell-literate'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
showName: 'Haxe',
|
|
396
|
+
value: 'haxe'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
showName: 'HTML embedded (JSP, ASP.NET)',
|
|
400
|
+
value: 'htmlembedded'
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
showName: 'HTML mixed-mode',
|
|
404
|
+
value: 'htmlmixed'
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
showName: 'HTTP',
|
|
408
|
+
value: 'http'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
showName: 'IDL',
|
|
412
|
+
value: 'idl'
|
|
261
413
|
},
|
|
262
414
|
{
|
|
263
415
|
showName: 'Java',
|
|
264
416
|
value: 'java'
|
|
265
417
|
},
|
|
266
418
|
DEFAULT_LANGUAGE,
|
|
419
|
+
{
|
|
420
|
+
showName: 'JavaScript (JSX)',
|
|
421
|
+
value: 'jsx'
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
showName: 'Jinja2',
|
|
425
|
+
value: 'jinja2'
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
showName: 'Julia',
|
|
429
|
+
value: 'julia'
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
showName: 'Kotlin',
|
|
433
|
+
value: 'kotlin'
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
showName: 'LESS',
|
|
437
|
+
value: 'less'
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
showName: 'LiveScript',
|
|
441
|
+
value: 'livescript'
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
showName: 'Lua',
|
|
445
|
+
value: 'lua'
|
|
446
|
+
},
|
|
267
447
|
{
|
|
268
448
|
showName: 'Markdown',
|
|
269
449
|
value: 'markdown'
|
|
270
450
|
},
|
|
451
|
+
{
|
|
452
|
+
showName: 'Mathematica',
|
|
453
|
+
value: 'mathematica'
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
showName: 'mbox',
|
|
457
|
+
value: 'mbox'
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
showName: 'mIRC',
|
|
461
|
+
value: 'mirc'
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
showName: 'Modelica',
|
|
465
|
+
value: 'modelica'
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
showName: 'MscGen',
|
|
469
|
+
value: 'mscgen'
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
showName: 'MUMPS',
|
|
473
|
+
value: 'mumps'
|
|
474
|
+
},
|
|
271
475
|
{
|
|
272
476
|
showName: 'Nginx',
|
|
273
477
|
value: 'nginx'
|
|
274
478
|
},
|
|
275
479
|
{
|
|
276
|
-
showName: '
|
|
277
|
-
value: '
|
|
480
|
+
showName: 'NSIS',
|
|
481
|
+
value: 'nsis'
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
showName: 'N-Triples/N-Quads',
|
|
485
|
+
value: 'ntriples'
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
showName: 'Objective C',
|
|
489
|
+
value: 'objective-c'
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
showName: 'OCaml',
|
|
493
|
+
value: 'ocaml'
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
showName: 'Octave (MATLAB)',
|
|
497
|
+
value: 'octave'
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
showName: 'Oz',
|
|
501
|
+
value: 'oz'
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
showName: 'Pascal',
|
|
505
|
+
value: 'pascal'
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
showName: 'PEG.js',
|
|
509
|
+
value: 'pegjs'
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
showName: 'Perl',
|
|
513
|
+
value: 'perl'
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
showName: 'PGP (ASCII armor)',
|
|
517
|
+
value: 'asciiarmor'
|
|
278
518
|
},
|
|
279
519
|
{
|
|
280
520
|
showName: 'PHP',
|
|
281
521
|
value: 'php'
|
|
282
522
|
},
|
|
523
|
+
{
|
|
524
|
+
showName: 'Pig Latin',
|
|
525
|
+
value: 'pig'
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
showName: 'PowerShell',
|
|
529
|
+
value: 'powershell'
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
showName: 'Properties files',
|
|
533
|
+
value: 'properties'
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
showName: 'ProtoBuf',
|
|
537
|
+
value: 'protobuf'
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
showName: 'Pug',
|
|
541
|
+
value: 'pug'
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
showName: 'Puppet',
|
|
545
|
+
value: 'puppet'
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
showName: 'Python',
|
|
549
|
+
value: 'python'
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
showName: 'Q',
|
|
553
|
+
value: 'q'
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
showName: 'R',
|
|
557
|
+
value: 'r'
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
showName: 'RPM',
|
|
561
|
+
value: 'rpm'
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
showName: 'reStructuredText',
|
|
565
|
+
value: 'rst'
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
showName: 'Ruby',
|
|
569
|
+
value: 'ruby'
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
showName: 'Rust',
|
|
573
|
+
value: 'rust'
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
showName: 'SAS',
|
|
577
|
+
value: 'sas'
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
showName: 'Sass',
|
|
581
|
+
value: 'sass'
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
showName: 'Spreadsheet',
|
|
585
|
+
value: 'spreadsheet'
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
showName: 'Scala',
|
|
589
|
+
value: 'scala'
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
showName: 'Scheme',
|
|
593
|
+
value: 'scheme'
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
showName: 'SCSS',
|
|
597
|
+
value: 'scss'
|
|
598
|
+
},
|
|
283
599
|
{
|
|
284
600
|
showName: 'Shell',
|
|
285
601
|
value: 'shell'
|
|
286
602
|
},
|
|
287
603
|
{
|
|
288
|
-
showName: '
|
|
604
|
+
showName: 'Sieve',
|
|
605
|
+
value: 'sieve'
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
showName: 'Slim',
|
|
609
|
+
value: 'slim'
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
showName: 'Smalltalk',
|
|
613
|
+
value: 'smalltalk'
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
showName: 'Smarty',
|
|
617
|
+
value: 'smarty'
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
showName: 'Solr',
|
|
621
|
+
value: 'solr'
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
showName: 'Soy',
|
|
625
|
+
value: 'soy'
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
showName: 'Stylus',
|
|
629
|
+
value: 'stylus'
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
showName: 'SQL (several dialects)',
|
|
289
633
|
value: 'sql'
|
|
290
634
|
},
|
|
635
|
+
{
|
|
636
|
+
showName: 'SPARQL',
|
|
637
|
+
value: 'sparql'
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
showName: 'Squirrel',
|
|
641
|
+
value: 'squirrel'
|
|
642
|
+
},
|
|
291
643
|
{
|
|
292
644
|
showName: 'Swift',
|
|
293
645
|
value: 'swift'
|
|
294
646
|
},
|
|
647
|
+
{
|
|
648
|
+
showName: 'sTeX, LaTeX',
|
|
649
|
+
value: 'stex'
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
showName: 'Tcl',
|
|
653
|
+
value: 'tcl'
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
showName: 'Textile',
|
|
657
|
+
value: 'textile'
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
showName: 'Tiddlywiki',
|
|
661
|
+
value: 'tiddlywiki'
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
showName: 'Tiki wiki',
|
|
665
|
+
value: 'tiki'
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
showName: 'TOML',
|
|
669
|
+
value: 'toml'
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
showName: 'Tornado (templating language)',
|
|
673
|
+
value: 'tornado'
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
showName: 'troff (for manpages)',
|
|
677
|
+
value: 'troff'
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
showName: 'TTCN',
|
|
681
|
+
value: 'ttcn'
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
showName: 'TTCN Configuration',
|
|
685
|
+
value: 'ttcn-cfg'
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
showName: 'Turtle',
|
|
689
|
+
value: 'turtle'
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
showName: 'Twig',
|
|
693
|
+
value: 'twig'
|
|
694
|
+
},
|
|
295
695
|
{
|
|
296
696
|
showName: 'TypeScript',
|
|
297
697
|
value: 'typescript'
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
showName: 'VB.NET',
|
|
701
|
+
value: 'vb'
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
showName: 'VBScript',
|
|
705
|
+
value: 'vbscript'
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
showName: 'Velocity',
|
|
709
|
+
value: 'velocity'
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
showName: 'Verilog/SystemVerilog',
|
|
713
|
+
value: 'verilog'
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
showName: 'VHDL',
|
|
717
|
+
value: 'vhdl'
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
showName: 'Vue.js app',
|
|
721
|
+
value: 'vue'
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
showName: 'Web IDL',
|
|
725
|
+
value: 'webidl'
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
showName: 'WebAssembly Text Format',
|
|
729
|
+
value: 'wast'
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
showName: 'XML/HTML',
|
|
733
|
+
value: 'xml'
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
showName: 'XQuery',
|
|
737
|
+
value: 'xquery'
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
showName: 'Yacas',
|
|
741
|
+
value: 'yacas'
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
showName: 'YAML',
|
|
745
|
+
value: 'yaml'
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
showName: 'YAML frontmatter',
|
|
749
|
+
value: 'yaml-frontmatter'
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
showName: 'Z80',
|
|
753
|
+
value: 'z80'
|
|
298
754
|
}
|
|
299
755
|
];
|
|
300
756
|
const CODEMIRROR_PADDING_TOP = 10;
|
|
@@ -1750,10 +2206,6 @@ const setClipboardDataByDom = async (e, fragment, data) => {
|
|
|
1750
2206
|
function copyNode(e, element, thyNotifyService, locale) {
|
|
1751
2207
|
const copyFailTips = (locale && locale() && locale().copyFailed) ?? '复制失败';
|
|
1752
2208
|
const copySuccessTips = (locale && locale() && locale().copySuccess) ?? '复制成功';
|
|
1753
|
-
if (!isClipboardWriteSupported()) {
|
|
1754
|
-
thyNotifyService?.error(copyFailTips);
|
|
1755
|
-
return;
|
|
1756
|
-
}
|
|
1757
2209
|
const fragment = cloneDeep(element);
|
|
1758
2210
|
return setClipboardDataByDom(e, fragment)
|
|
1759
2211
|
.then(() => {
|
|
@@ -4744,6 +5196,7 @@ const TABLE_BORDER$1 = 1;
|
|
|
4744
5196
|
const TABLE_PADDING$1 = 8;
|
|
4745
5197
|
const TABLE_CONTROL = 11;
|
|
4746
5198
|
const TABLE_NUMBER_COLUMN = 45;
|
|
5199
|
+
const TABLE_HORIZONTAL_SCROLL_HEIGHT = 16; // table component horizontal scrollbar height
|
|
4747
5200
|
const TableWithStickyRowClass = 'the-table-with-sticky-row';
|
|
4748
5201
|
var FullscreenState;
|
|
4749
5202
|
(function (FullscreenState) {
|
|
@@ -11655,7 +12108,7 @@ const createImagePlugin = (locale) => createPluginFactory({
|
|
|
11655
12108
|
menuItems: [
|
|
11656
12109
|
{
|
|
11657
12110
|
key: ElementKinds.image,
|
|
11658
|
-
keywords: `tp,tupian,image,
|
|
12111
|
+
keywords: `tp,tupian,image,picture,${locale().image}`,
|
|
11659
12112
|
execute: editor => ImageEditor.openUpload(editor),
|
|
11660
12113
|
active: editor => ImageEditor.isActive(editor),
|
|
11661
12114
|
name: locale().image,
|
|
@@ -15311,6 +15764,8 @@ class TheTable extends TheBaseElement {
|
|
|
15311
15764
|
this.theTableContextMenuService.closeContextMenu();
|
|
15312
15765
|
this.tableStore.isExistSelectedCell && this.tableStore.clearSelectedCells();
|
|
15313
15766
|
}
|
|
15767
|
+
// 表格数据变化,更新横向滚动条
|
|
15768
|
+
this.updateHorizontalScrollbar();
|
|
15314
15769
|
}
|
|
15315
15770
|
}
|
|
15316
15771
|
// 需要等待内容更新后,才可以执行 useRowControls,否则获取的高度可能不正确
|
|
@@ -15343,6 +15798,7 @@ class TheTable extends TheBaseElement {
|
|
|
15343
15798
|
this.destroy$ = new Subject();
|
|
15344
15799
|
this.rowControls = [];
|
|
15345
15800
|
this.colControls = [];
|
|
15801
|
+
this.isMouseOverTable = false;
|
|
15346
15802
|
this.getOutletParent = () => {
|
|
15347
15803
|
return this.tbodyElement.nativeElement;
|
|
15348
15804
|
};
|
|
@@ -15454,6 +15910,7 @@ class TheTable extends TheBaseElement {
|
|
|
15454
15910
|
this.listenTableContextMenuEvent();
|
|
15455
15911
|
this.listenTableWrapperScroll();
|
|
15456
15912
|
this.subscribeScrollContainerScroll(this.tableWrapperLeft);
|
|
15913
|
+
this.initHorizontalScrollbar();
|
|
15457
15914
|
if (isPrintMode) {
|
|
15458
15915
|
this.cdr.markForCheck();
|
|
15459
15916
|
}
|
|
@@ -15464,6 +15921,7 @@ class TheTable extends TheBaseElement {
|
|
|
15464
15921
|
this.getWrapperWidthAndLeft();
|
|
15465
15922
|
this.setHeaderRowShadow();
|
|
15466
15923
|
this.setStickyElementLeftStyle();
|
|
15924
|
+
this.updateHorizontalScrollbar();
|
|
15467
15925
|
});
|
|
15468
15926
|
this.contextService.theEditorResized$.pipe(takeUntil(this.destroy$)).subscribe(result => {
|
|
15469
15927
|
if (result.widthChanged) {
|
|
@@ -15471,6 +15929,7 @@ class TheTable extends TheBaseElement {
|
|
|
15471
15929
|
this.setTableScrollingShadow();
|
|
15472
15930
|
this.setGridColumnsStyle();
|
|
15473
15931
|
this.setHeaderRowShadow();
|
|
15932
|
+
this.updateHorizontalScrollbar();
|
|
15474
15933
|
}
|
|
15475
15934
|
});
|
|
15476
15935
|
});
|
|
@@ -15536,6 +15995,8 @@ class TheTable extends TheBaseElement {
|
|
|
15536
15995
|
const maxHeaderRowHeight = (24 + 8) * 11; // 超出 11 行,取消冻结
|
|
15537
15996
|
this.isStickyTop = headerRowHeight <= maxHeaderRowHeight;
|
|
15538
15997
|
}
|
|
15998
|
+
// 更新漂浮滚动条
|
|
15999
|
+
this.updateHorizontalScrollbar();
|
|
15539
16000
|
}
|
|
15540
16001
|
return this.isStickyTop;
|
|
15541
16002
|
}), distinctUntilChanged())
|
|
@@ -16064,6 +16525,161 @@ class TheTable extends TheBaseElement {
|
|
|
16064
16525
|
this.destroy$.next();
|
|
16065
16526
|
this.destroy$.complete();
|
|
16066
16527
|
}
|
|
16528
|
+
initHorizontalScrollbar() {
|
|
16529
|
+
if (!this.horizontalScrollbarContainer || !this.horizontalScrollbarContent) {
|
|
16530
|
+
return;
|
|
16531
|
+
}
|
|
16532
|
+
this.bindTableMouseEvents();
|
|
16533
|
+
this.bindScrollbarEvents();
|
|
16534
|
+
this.updateHorizontalScrollbar();
|
|
16535
|
+
}
|
|
16536
|
+
// 绑定鼠标和滚轮事件,用于处理表格横向滚动条显隐
|
|
16537
|
+
bindTableMouseEvents() {
|
|
16538
|
+
if (!this.nativeElement) {
|
|
16539
|
+
return;
|
|
16540
|
+
}
|
|
16541
|
+
// 鼠标移入表格时,更新滚动条是否显示固定
|
|
16542
|
+
fromEvent(this.nativeElement, 'mouseenter')
|
|
16543
|
+
.pipe(takeUntil(this.destroy$))
|
|
16544
|
+
.subscribe(() => {
|
|
16545
|
+
this.isMouseOverTable = true;
|
|
16546
|
+
this.updateHorizontalScrollbar();
|
|
16547
|
+
});
|
|
16548
|
+
fromEvent(this.nativeElement, 'mouseleave')
|
|
16549
|
+
.pipe(takeUntil(this.destroy$))
|
|
16550
|
+
.subscribe(() => {
|
|
16551
|
+
this.isMouseOverTable = false;
|
|
16552
|
+
this.updateHorizontalScrollbar();
|
|
16553
|
+
});
|
|
16554
|
+
// 在表格上的滚轮滚动监听,处理滚动过程中超过可视范围滚动条的显隐
|
|
16555
|
+
// 页面的垂直滚动由使用方的页面决定,表格组件无法准确获取,这里通过监听滚轮实现
|
|
16556
|
+
fromEvent(this.nativeElement, 'wheel', { passive: false })
|
|
16557
|
+
.pipe(takeUntil(this.destroy$))
|
|
16558
|
+
.subscribe((event) => {
|
|
16559
|
+
// 只有在鼠标在表格上时才处理
|
|
16560
|
+
if (!this.isMouseOverTable) {
|
|
16561
|
+
return;
|
|
16562
|
+
}
|
|
16563
|
+
const isHorizontalScroll = Math.abs(event.deltaX) > Math.abs(event.deltaY) || event.shiftKey;
|
|
16564
|
+
if (isHorizontalScroll && this.horizontalScrollbarContainer) {
|
|
16565
|
+
event.preventDefault();
|
|
16566
|
+
let deltaX = event.deltaX;
|
|
16567
|
+
// 如果是 Shift + 滚轮,将垂直滚动转换为横向滚动
|
|
16568
|
+
if (event.shiftKey && Math.abs(event.deltaY) > Math.abs(event.deltaX)) {
|
|
16569
|
+
deltaX = event.deltaY;
|
|
16570
|
+
}
|
|
16571
|
+
const scrollbarContainer = this.horizontalScrollbarContainer.nativeElement;
|
|
16572
|
+
const newScrollLeft = Math.max(0, Math.min(scrollbarContainer.scrollLeft + deltaX, scrollbarContainer.scrollWidth - scrollbarContainer.clientWidth));
|
|
16573
|
+
// 同步滚动到滚动条
|
|
16574
|
+
scrollbarContainer.scrollLeft = newScrollLeft;
|
|
16575
|
+
}
|
|
16576
|
+
else {
|
|
16577
|
+
// 纵向滚动,需要延迟执行是否需要固定滚动条
|
|
16578
|
+
setTimeout(() => {
|
|
16579
|
+
this.updateScrollbarFixedState();
|
|
16580
|
+
}, 100);
|
|
16581
|
+
}
|
|
16582
|
+
});
|
|
16583
|
+
}
|
|
16584
|
+
// 监听横向滚动条滚动事件
|
|
16585
|
+
bindScrollbarEvents() {
|
|
16586
|
+
if (!this.horizontalScrollbarContainer || !this.horizontalScrollbarContent) {
|
|
16587
|
+
return;
|
|
16588
|
+
}
|
|
16589
|
+
// 滚动条滚动事件同步到表格
|
|
16590
|
+
fromEvent(this.horizontalScrollbarContainer.nativeElement, 'scroll')
|
|
16591
|
+
.pipe(takeUntil(this.destroy$))
|
|
16592
|
+
.subscribe(() => {
|
|
16593
|
+
const scrollLeft = this.horizontalScrollbarContainer.nativeElement.scrollLeft;
|
|
16594
|
+
if (this.tableWrapper.nativeElement.scrollLeft !== scrollLeft) {
|
|
16595
|
+
this.tableWrapper.nativeElement.scrollLeft = scrollLeft;
|
|
16596
|
+
}
|
|
16597
|
+
});
|
|
16598
|
+
}
|
|
16599
|
+
updateHorizontalScrollbar() {
|
|
16600
|
+
this.updateScrollbarVisibility();
|
|
16601
|
+
this.updateScrollbarFixedState();
|
|
16602
|
+
}
|
|
16603
|
+
// 更新横向滚动条可见性
|
|
16604
|
+
updateScrollbarVisibility() {
|
|
16605
|
+
if (!this.tableWrapper || !this.horizontalScrollbarContainer || !this.horizontalScrollbarContent) {
|
|
16606
|
+
return;
|
|
16607
|
+
}
|
|
16608
|
+
const tableWrapper = this.tableWrapper.nativeElement;
|
|
16609
|
+
const scrollbarContainer = this.horizontalScrollbarContainer.nativeElement;
|
|
16610
|
+
const scrollbarContent = this.horizontalScrollbarContent.nativeElement;
|
|
16611
|
+
const hasHorizontalScroll = tableWrapper.scrollWidth > tableWrapper.clientWidth;
|
|
16612
|
+
if (!hasHorizontalScroll) {
|
|
16613
|
+
this.renderer.removeClass(scrollbarContainer, 'visible');
|
|
16614
|
+
return;
|
|
16615
|
+
}
|
|
16616
|
+
this.renderer.setStyle(scrollbarContent, 'width', `${tableWrapper.scrollWidth}px`);
|
|
16617
|
+
this.renderer.addClass(scrollbarContainer, 'visible');
|
|
16618
|
+
}
|
|
16619
|
+
// 更新横向滚动条固定状态
|
|
16620
|
+
updateScrollbarFixedState() {
|
|
16621
|
+
if (this.editor.options.disabledTableStickyScrollbar || !this.horizontalScrollbarContainer) {
|
|
16622
|
+
return;
|
|
16623
|
+
}
|
|
16624
|
+
if (!this.isMouseOverTable) {
|
|
16625
|
+
this.setScrollbarFixed(false, 0);
|
|
16626
|
+
return;
|
|
16627
|
+
}
|
|
16628
|
+
const tableRect = this.nativeElement.getBoundingClientRect();
|
|
16629
|
+
const viewportHeight = this.getViewportHeight();
|
|
16630
|
+
const scrollbarBottomPosition = tableRect.bottom;
|
|
16631
|
+
// 是否在可视范围内
|
|
16632
|
+
const isScrollbarOutOfView = scrollbarBottomPosition > viewportHeight && tableRect.top < viewportHeight;
|
|
16633
|
+
this.setScrollbarFixed(isScrollbarOutOfView, viewportHeight);
|
|
16634
|
+
}
|
|
16635
|
+
getViewportHeight() {
|
|
16636
|
+
try {
|
|
16637
|
+
const scrollContainer = this.contextService.getScrollContainer();
|
|
16638
|
+
if (scrollContainer && scrollContainer !== document.documentElement && scrollContainer !== document.body) {
|
|
16639
|
+
// 如果有自定义滚动容器且不是 html/body 元素,使用容器的可视高度
|
|
16640
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
16641
|
+
return containerRect.height > window.innerHeight ? window.innerHeight : containerRect.bottom;
|
|
16642
|
+
}
|
|
16643
|
+
else if (scrollContainer === null) {
|
|
16644
|
+
// 没有自定义滚动容器,使用 theEditor 的滚动容器
|
|
16645
|
+
const theRect = this.contextService.getOptions().nativeElement.getBoundingClientRect();
|
|
16646
|
+
// 判断大于视窗高度为了兼容 theEditor 不是滚动容器,且高度已经超过视窗高度,导致滚动条位置计算错误
|
|
16647
|
+
return theRect.height > window.innerHeight ? window.innerHeight : theRect.bottom;
|
|
16648
|
+
}
|
|
16649
|
+
return window.innerHeight;
|
|
16650
|
+
}
|
|
16651
|
+
catch (error) {
|
|
16652
|
+
// 获取失败使用视窗高度
|
|
16653
|
+
return window.innerHeight;
|
|
16654
|
+
}
|
|
16655
|
+
}
|
|
16656
|
+
setScrollbarFixed(fixed, viewportHeight) {
|
|
16657
|
+
if (!this.horizontalScrollbarContainer) {
|
|
16658
|
+
return;
|
|
16659
|
+
}
|
|
16660
|
+
const scrollbar = this.horizontalScrollbarContainer.nativeElement;
|
|
16661
|
+
const currentScrollLeft = scrollbar.scrollLeft;
|
|
16662
|
+
if (fixed) {
|
|
16663
|
+
const tableRect = this.nativeElement.getBoundingClientRect();
|
|
16664
|
+
this.renderer.addClass(scrollbar, 'fixed');
|
|
16665
|
+
this.renderer.setStyle(scrollbar, 'left', `${Math.max(0, tableRect.left)}px`);
|
|
16666
|
+
this.renderer.setStyle(scrollbar, 'width', `${tableRect.width}px`);
|
|
16667
|
+
this.renderer.setStyle(scrollbar, 'top', `${viewportHeight - TABLE_HORIZONTAL_SCROLL_HEIGHT}px`);
|
|
16668
|
+
this.renderer.removeStyle(scrollbar, 'bottom');
|
|
16669
|
+
}
|
|
16670
|
+
else {
|
|
16671
|
+
this.renderer.removeClass(scrollbar, 'fixed');
|
|
16672
|
+
this.renderer.removeStyle(scrollbar, 'left');
|
|
16673
|
+
this.renderer.removeStyle(scrollbar, 'width');
|
|
16674
|
+
this.renderer.removeStyle(scrollbar, 'top');
|
|
16675
|
+
this.renderer.setStyle(scrollbar, 'bottom', `-${TABLE_HORIZONTAL_SCROLL_HEIGHT}px`);
|
|
16676
|
+
}
|
|
16677
|
+
requestAnimationFrame(() => {
|
|
16678
|
+
if (scrollbar.scrollLeft !== currentScrollLeft) {
|
|
16679
|
+
scrollbar.scrollLeft = currentScrollLeft;
|
|
16680
|
+
}
|
|
16681
|
+
});
|
|
16682
|
+
}
|
|
16067
16683
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TheTable, deps: [{ token: TableCellEventDispatcher }, { token: ColumnResizeNotifierSource }, { token: TableStore }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: TableService }, { token: TheTableContextMenuService }, { token: TableFreezeColumnPipe }, { token: TableFreezeRowPipe }, { token: i0.Renderer2 }, { token: TheContextService }, { token: THE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16068
16684
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TheTable, isStandalone: true, selector: "ng-component", host: { properties: { "class.the-table-with-controls": "isInTable || tableStore.isRightClicking || tableStore.isFocusedInput", "class.the-table-with-sticky-column": "isFreezeColumn", "class.the-numbered-table": "element?.options?.numberedColumn", "class.the-table-selection-hide": "tableStore.isCellSelecting || tableStore.isRightClicking || tableStore.isFocusedInput" } }, providers: [
|
|
16069
16685
|
TableStore,
|
|
@@ -16077,7 +16693,7 @@ class TheTable extends TheBaseElement {
|
|
|
16077
16693
|
provide: THE_TABLE_COMPONENT_TOKEN,
|
|
16078
16694
|
useExisting: TheTable
|
|
16079
16695
|
}
|
|
16080
|
-
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }, { propertyName: "tableRowControlsWrapper", first: true, predicate: ["tableRowControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "columnControlsWrapper", first: true, predicate: ["columnControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "cornerControl", first: true, predicate: ["cornerControl"], descendants: true, read: ElementRef }, { propertyName: "rowControlsInner", first: true, predicate: ["rowControlsInner"], descendants: true, read: ElementRef }, { propertyName: "headerRowLeftShadow", first: true, predicate: ["headerRowLeftShadow"], descendants: true, read: ElementRef }, { propertyName: "headerRowRightShadow", first: true, predicate: ["headerRowRightShadow"], descendants: true, read: ElementRef }, { propertyName: "colgroup", first: true, predicate: ["colgroup"], descendants: true, read: ElementRef }, { propertyName: "rowControlsButtonWrapper", predicate: ["rowControlsButtonWrapper"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"the-table-container\" theColumnResize>\n <div #tableRowControlsWrapper class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls\"\n #cornerControl\n contenteditable=\"false\"\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (pointerdown)=\"onSelectTable($event)\"></div>\n @if (!(element | hasHeaderRow) && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n @if (!element?.options?.headerColumn && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n @for (control of rowControls; track trackByFnRowControls(i); let i = $index) {\n <div\n class=\"the-table-row-control-button-wrap\"\n #rowControlsButtonWrapper\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n @if (!readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !element?.options?.numberedColumn) {\n <button\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n contenteditable=\"false\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n }\n @if (element?.options?.numberedColumn) {\n <div\n contenteditable=\"false\"\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">\n {{ (element | hasHeaderRow) && i === 0 ? '' : (element | hasHeaderRow) ? i : i + 1 }}\n </p>\n </div>\n }\n @if (!isMobileMode) {\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup #colgroup>\n <!--\u63A7\u5236\u5E8F\u53F7\u5217\u5BBD\u5EA6-->\n @if (readonly && element?.options?.numberedColumn) {\n <col class=\"the-table-number-col\" />\n }\n @for (col of columns; track $index) {\n <col [ngStyle]=\"{ width: col.width + 'px' }\" />\n }\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n @if (readonly && element?.options?.numberedColumn) {\n <th class=\"the-table-number-col\"></th>\n }\n @for (control of colControls; track trackByFnColControls(i); let i = $index) {\n <th\n #colControl\n class=\"the-table-col-control\"\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0,\n 'the-sticky-cell': i === 0 && isFreezeColumn\n }\"\n (pointerdown)=\"onColMousedown($event, i)\"\n >\n @if ((isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !isMobileMode) {\n <the-table-insert-mark type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\" [parentElement]=\"colControl\">\n </the-table-insert-mark>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody #tbody></tbody>\n @if (!element?.options?.headerColumn) {\n <div #headerRowLeftShadow class=\"header-row-shadow header-row-left-shadow\" contenteditable=\"false\"></div>\n }\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TheInsertMark, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore", "parentElement"] }, { kind: "directive", type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { kind: "pipe", type: TableHasHeaderRowPipe, name: "hasHeaderRow" }] }); }
|
|
16696
|
+
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: ElementRef, static: true }, { propertyName: "tableRowControlsWrapper", first: true, predicate: ["tableRowControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "columnControlsWrapper", first: true, predicate: ["columnControlsWrapper"], descendants: true, read: ElementRef }, { propertyName: "cornerControl", first: true, predicate: ["cornerControl"], descendants: true, read: ElementRef }, { propertyName: "rowControlsInner", first: true, predicate: ["rowControlsInner"], descendants: true, read: ElementRef }, { propertyName: "headerRowLeftShadow", first: true, predicate: ["headerRowLeftShadow"], descendants: true, read: ElementRef }, { propertyName: "headerRowRightShadow", first: true, predicate: ["headerRowRightShadow"], descendants: true, read: ElementRef }, { propertyName: "colgroup", first: true, predicate: ["colgroup"], descendants: true, read: ElementRef }, { propertyName: "horizontalScrollbarContainer", first: true, predicate: ["horizontalScrollbarContainer"], descendants: true, read: ElementRef, static: true }, { propertyName: "horizontalScrollbarContent", first: true, predicate: ["horizontalScrollbarContent"], descendants: true, read: ElementRef, static: true }, { propertyName: "rowControlsButtonWrapper", predicate: ["rowControlsButtonWrapper"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div class=\"the-table-container\" theColumnResize>\n <div #tableRowControlsWrapper class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls\"\n #cornerControl\n contenteditable=\"false\"\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (pointerdown)=\"onSelectTable($event)\"></div>\n @if (!(element | hasHeaderRow) && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n @if (!element?.options?.headerColumn && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n @for (control of rowControls; track trackByFnRowControls(i); let i = $index) {\n <div\n class=\"the-table-row-control-button-wrap\"\n #rowControlsButtonWrapper\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n @if (!readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !element?.options?.numberedColumn) {\n <button\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n contenteditable=\"false\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n }\n @if (element?.options?.numberedColumn) {\n <div\n contenteditable=\"false\"\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">\n {{ (element | hasHeaderRow) && i === 0 ? '' : (element | hasHeaderRow) ? i : i + 1 }}\n </p>\n </div>\n }\n @if (!isMobileMode) {\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup #colgroup>\n <!--\u63A7\u5236\u5E8F\u53F7\u5217\u5BBD\u5EA6-->\n @if (readonly && element?.options?.numberedColumn) {\n <col class=\"the-table-number-col\" />\n }\n @for (col of columns; track $index) {\n <col [ngStyle]=\"{ width: col.width + 'px' }\" />\n }\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n @if (readonly && element?.options?.numberedColumn) {\n <th class=\"the-table-number-col\"></th>\n }\n @for (control of colControls; track trackByFnColControls(i); let i = $index) {\n <th\n #colControl\n class=\"the-table-col-control\"\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0,\n 'the-sticky-cell': i === 0 && isFreezeColumn\n }\"\n (pointerdown)=\"onColMousedown($event, i)\"\n >\n @if ((isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !isMobileMode) {\n <the-table-insert-mark type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\" [parentElement]=\"colControl\">\n </the-table-insert-mark>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody #tbody></tbody>\n @if (!element?.options?.headerColumn) {\n <div #headerRowLeftShadow class=\"header-row-shadow header-row-left-shadow\" contenteditable=\"false\"></div>\n }\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n <div class=\"the-table-horizontal-scrollbar-container\" #horizontalScrollbarContainer>\n <div class=\"the-table-horizontal-scrollbar-content\" #horizontalScrollbarContent></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TheInsertMark, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore", "parentElement"] }, { kind: "directive", type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { kind: "pipe", type: TableHasHeaderRowPipe, name: "hasHeaderRow" }] }); }
|
|
16081
16697
|
}
|
|
16082
16698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TheTable, decorators: [{
|
|
16083
16699
|
type: Component,
|
|
@@ -16098,7 +16714,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
16098
16714
|
'[class.the-table-with-sticky-column]': 'isFreezeColumn',
|
|
16099
16715
|
'[class.the-numbered-table]': 'element?.options?.numberedColumn',
|
|
16100
16716
|
'[class.the-table-selection-hide]': 'tableStore.isCellSelecting || tableStore.isRightClicking || tableStore.isFocusedInput'
|
|
16101
|
-
}, imports: [NgClass, NgStyle, TheInsertMark, TheColumnResizeDirective, TableHasHeaderRowPipe], template: "<div class=\"the-table-container\" theColumnResize>\n <div #tableRowControlsWrapper class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls\"\n #cornerControl\n contenteditable=\"false\"\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (pointerdown)=\"onSelectTable($event)\"></div>\n @if (!(element | hasHeaderRow) && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n @if (!element?.options?.headerColumn && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n @for (control of rowControls; track trackByFnRowControls(i); let i = $index) {\n <div\n class=\"the-table-row-control-button-wrap\"\n #rowControlsButtonWrapper\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n @if (!readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !element?.options?.numberedColumn) {\n <button\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n contenteditable=\"false\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n }\n @if (element?.options?.numberedColumn) {\n <div\n contenteditable=\"false\"\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">\n {{ (element | hasHeaderRow) && i === 0 ? '' : (element | hasHeaderRow) ? i : i + 1 }}\n </p>\n </div>\n }\n @if (!isMobileMode) {\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup #colgroup>\n <!--\u63A7\u5236\u5E8F\u53F7\u5217\u5BBD\u5EA6-->\n @if (readonly && element?.options?.numberedColumn) {\n <col class=\"the-table-number-col\" />\n }\n @for (col of columns; track $index) {\n <col [ngStyle]=\"{ width: col.width + 'px' }\" />\n }\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n @if (readonly && element?.options?.numberedColumn) {\n <th class=\"the-table-number-col\"></th>\n }\n @for (control of colControls; track trackByFnColControls(i); let i = $index) {\n <th\n #colControl\n class=\"the-table-col-control\"\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0,\n 'the-sticky-cell': i === 0 && isFreezeColumn\n }\"\n (pointerdown)=\"onColMousedown($event, i)\"\n >\n @if ((isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !isMobileMode) {\n <the-table-insert-mark type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\" [parentElement]=\"colControl\">\n </the-table-insert-mark>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody #tbody></tbody>\n @if (!element?.options?.headerColumn) {\n <div #headerRowLeftShadow class=\"header-row-shadow header-row-left-shadow\" contenteditable=\"false\"></div>\n }\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n</div>\n" }]
|
|
16717
|
+
}, imports: [NgClass, NgStyle, TheInsertMark, TheColumnResizeDirective, TableHasHeaderRowPipe], template: "<div class=\"the-table-container\" theColumnResize>\n <div #tableRowControlsWrapper class=\"the-table-row-controls-wrapper\">\n <div\n class=\"the-table-corner-controls\"\n #cornerControl\n contenteditable=\"false\"\n [ngClass]=\"{\n visible: !readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput),\n 'control-active': isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (pointerdown)=\"onSelectTable($event)\"></div>\n @if (!(element | hasHeaderRow) && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n @if (!element?.options?.headerColumn && !isMobileMode) {\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n }\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\" #rowControlsInner>\n @for (control of rowControls; track trackByFnRowControls(i); let i = $index) {\n <div\n class=\"the-table-row-control-button-wrap\"\n #rowControlsButtonWrapper\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n @if (!readonly && (isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !element?.options?.numberedColumn) {\n <button\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n type=\"button\"\n contenteditable=\"false\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n }\n @if (element?.options?.numberedColumn) {\n <div\n contenteditable=\"false\"\n (pointerdown)=\"onRowMousedown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">\n {{ (element | hasHeaderRow) && i === 0 ? '' : (element | hasHeaderRow) ? i : i + 1 }}\n </p>\n </div>\n }\n @if (!isMobileMode) {\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable>\n <colgroup #colgroup>\n <!--\u63A7\u5236\u5E8F\u53F7\u5217\u5BBD\u5EA6-->\n @if (readonly && element?.options?.numberedColumn) {\n <col class=\"the-table-number-col\" />\n }\n @for (col of columns; track $index) {\n <col [ngStyle]=\"{ width: col.width + 'px' }\" />\n }\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper the-sticky-row\" #columnControlsWrapper>\n @if (readonly && element?.options?.numberedColumn) {\n <th class=\"the-table-number-col\"></th>\n }\n @for (control of colControls; track trackByFnColControls(i); let i = $index) {\n <th\n #colControl\n class=\"the-table-col-control\"\n contenteditable=\"false\"\n [ngClass]=\"{\n 'control-active': tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0,\n 'the-sticky-cell': i === 0 && isFreezeColumn\n }\"\n (pointerdown)=\"onColMousedown($event, i)\"\n >\n @if ((isInTable || tableStore.isRightClicking || tableStore.isFocusedInput) && !isMobileMode) {\n <the-table-insert-mark type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\" [parentElement]=\"colControl\">\n </the-table-insert-mark>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody #tbody></tbody>\n @if (!element?.options?.headerColumn) {\n <div #headerRowLeftShadow class=\"header-row-shadow header-row-left-shadow\" contenteditable=\"false\"></div>\n }\n <div class=\"header-row-shadow header-row-right-shadow\" #headerRowRightShadow contenteditable=\"false\"></div>\n </table>\n </div>\n <div class=\"the-table-horizontal-scrollbar-container\" #horizontalScrollbarContainer>\n <div class=\"the-table-horizontal-scrollbar-content\" #horizontalScrollbarContent></div>\n </div>\n</div>\n" }]
|
|
16102
16718
|
}], ctorParameters: () => [{ type: TableCellEventDispatcher }, { type: ColumnResizeNotifierSource }, { type: TableStore }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: TableService }, { type: TheTableContextMenuService }, { type: TableFreezeColumnPipe }, { type: TableFreezeRowPipe }, { type: i0.Renderer2 }, { type: TheContextService }, { type: TheModeConfig, decorators: [{
|
|
16103
16719
|
type: Inject,
|
|
16104
16720
|
args: [THE_MODE_TOKEN]
|
|
@@ -16135,6 +16751,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
16135
16751
|
}], rowControlsButtonWrapper: [{
|
|
16136
16752
|
type: ViewChildren,
|
|
16137
16753
|
args: ['rowControlsButtonWrapper', { read: ElementRef }]
|
|
16754
|
+
}], horizontalScrollbarContainer: [{
|
|
16755
|
+
type: ViewChild,
|
|
16756
|
+
args: ['horizontalScrollbarContainer', { read: ElementRef, static: true }]
|
|
16757
|
+
}], horizontalScrollbarContent: [{
|
|
16758
|
+
type: ViewChild,
|
|
16759
|
+
args: ['horizontalScrollbarContent', { read: ElementRef, static: true }]
|
|
16138
16760
|
}] } });
|
|
16139
16761
|
|
|
16140
16762
|
const OVERLAY_ACTIVE_CLASS = 'the-resizable-overlay-thumb-active';
|