@myrmidon/cadmus-item-editor 17.0.2 → 18.0.1
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.
|
@@ -1,1317 +1,2156 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { BehaviorSubject, forkJoin } from
|
|
4
|
-
import * as i1 from
|
|
5
|
-
import * as
|
|
6
|
-
import { DatePipe } from
|
|
7
|
-
import { toSignal } from
|
|
8
|
-
import { MatTooltip } from
|
|
9
|
-
import * as i1$1 from
|
|
10
|
-
import {
|
|
11
|
-
import { take } from
|
|
12
|
-
import { MatCard, MatCardContent } from
|
|
13
|
-
import { CdkCopyToClipboard } from
|
|
14
|
-
import { MatProgressBar } from
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { MatInput } from
|
|
18
|
-
import { MatSelect } from
|
|
19
|
-
import { MatOption } from
|
|
20
|
-
import { MatButton, MatIconButton } from
|
|
21
|
-
import { MatIcon } from
|
|
22
|
-
import { MatDivider } from
|
|
23
|
-
import { MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle
|
|
24
|
-
import { FlagSetComponent } from
|
|
25
|
-
import { MESSAGE_ITEM_LIST_REPOSITORY_RESET } from
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import * as
|
|
30
|
-
import * as
|
|
31
|
-
import { MAT_DIALOG_DATA } from
|
|
32
|
-
import { RefLookupComponent } from
|
|
33
|
-
import * as i2
|
|
34
|
-
import * as i3
|
|
35
|
-
import * as i4 from
|
|
36
|
-
import * as i8 from
|
|
37
|
-
import * as i10 from
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
class PartsScopeEditorComponent {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
.
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: ItemEditorComponent, isStandalone: true, selector: "cadmus-item-editor", ngImport: i0, template: "<mat-card appearance=\"outlined\">\r\n <mat-card-content>\r\n <div>\r\n <cadmus-current-item-bar />\r\n </div>\r\n @if (busy()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id() ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- title -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>title</mat-label>\r\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\r\n @if (\r\n title.hasError(\"required\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>enter title</mat-error>\r\n }\r\n @if (\r\n title.hasError(\"maxLength\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>title too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto title -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateTitle()\"\r\n >\r\n <mat-icon matTooltip=\"Generate title\">auto_awesome</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- sortKey -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>sort key</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n [formControl]=\"sortKey\"\r\n />\r\n @if (\r\n sortKey.hasError(\"required\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>enter sort key</mat-error>\r\n }\r\n @if (\r\n sortKey.hasError(\"maxLength\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>sort key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div class=\"flex-row\">\r\n <mat-form-field class=\"item\">\r\n <mat-label>description</mat-label>\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n [formControl]=\"description\"\r\n ></textarea>\r\n @if (\r\n description.hasError(\"required\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>enter description</mat-error>\r\n }\r\n @if (\r\n description.hasError(\"maxLength\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto description -->\r\n <button\r\n class=\"item fit\"\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateDescription()\"\r\n >\r\n <mat-icon matTooltip=\"Generate description\"\r\n >auto_awesome</mat-icon\r\n >\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- facet -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>facet</mat-label>\r\n <mat-select [formControl]=\"facetCtrl\" required=\"true\">\r\n @for (f of facets(); track f.id) {\r\n <mat-option [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <mat-label>group ID</mat-label>\r\n <input matInput [formControl]=\"group\" />\r\n @if (\r\n group.hasError(\"maxLength\") && (group.dirty || group.touched)\r\n ) {\r\n <mat-error>too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <fieldset>\r\n <legend>flags</legend>\r\n <!-- read-only admin flags for non-admin users -->\r\n @if (adminFlagDefs().length) {\r\n <div class=\"admin-flags\">\r\n @for (def of adminFlagDefs(); track def.id) {\r\n <span class=\"admin-flag\">\r\n <span [style.color]=\"'#' + def.colorKey\">◆</span>\r\n {{ def.label }}\r\n </span>\r\n }\r\n </div>\r\n }\r\n <!-- editable flags -->\r\n @if (flagSetFlags().length) {\r\n <cadmus-ui-flag-set\r\n [hideToolbar]=\"true\"\r\n [flags]=\"flagSetFlags()\"\r\n [checkedIds]=\"checkedFlagIds()\"\r\n (checkedIdsChange)=\"onFlagCheckedIdsChange($event)\"\r\n />\r\n }\r\n </fieldset>\r\n <br />\r\n\r\n <!-- action buttons -->\r\n @if (userLevel() > 1) {\r\n <div class=\"form-row\">\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n class=\"mat-warn\"\r\n (click)=\"onGenerateItems()\"\r\n >\r\n <mat-icon>copy_all</mat-icon> generate\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n [disabled]=\"busy()\"\r\n matTooltip=\"Save metadata\"\r\n (click)=\"save()\"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n }\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n @if (id()) {\r\n <mat-tab label=\"Parts\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\" class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>part</mat-label>\r\n <mat-select [formControl]=\"newPartType\" required>\r\n @for (\r\n p of newPartDefinitions();\r\n track p.typeId + \":\" + (p.roleId || \"\")\r\n ) {\r\n <mat-option [value]=\"p\">\r\n <span\r\n [style.color]=\"'#' + p.colorKey\"\r\n class=\"new-part-icon\"\r\n >⬤</span\r\n >\r\n {{ getPartIdName(p.typeId, p.roleId) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n <button\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy() || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n part\r\n </button>\r\n </form>\r\n </div>\r\n <mat-divider></mat-divider>\r\n @for (group of partGroups(); track group.key) {\r\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n <table class=\"parts-table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th class=\"noif-lt-xs\">modified</th>\r\n <th class=\"noif-lt-xs\">user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of group.parts;\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <!-- edit -->\r\n <td class=\"fit-width\">\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"busy()\"\r\n (click)=\"editPart(part)\"\r\n matTooltip=\"Edit this part\"\r\n >\r\n <mat-icon class=\"mat-primary\">create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n @if (\r\n user()?.roles?.length &&\r\n (user()?.roles?.includes(\"admin\") ||\r\n user()?.roles?.includes(\"editor\") ||\r\n user()?.roles?.includes(\"operator\"))\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy()\"\r\n (click)=\"deletePart(part)\"\r\n matTooltip=\"Delete this part\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n <!-- copy ID -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n <!-- copy into item -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy part into another item\"\r\n (click)=\"onCopyPart(part)\"\r\n >\r\n <mat-icon>open_in_new</mat-icon>\r\n </button>\r\n <!-- preview -->\r\n @if (\r\n part | hasPreview: previewJKeys() : previewFKeys()\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Preview this part\"\r\n (click)=\"previewPart(part)\"\r\n >\r\n <mat-icon>preview</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td class=\"noif-lt-xs\">\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </td>\r\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n }\r\n <cadmus-missing-parts\r\n [facetDefinition]=\"facet()\"\r\n [partDefinitions]=\"\r\n $safeNavigationMigration(facet()?.partDefinitions)\r\n \"\r\n [parts]=\"parts()\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n (addRequest)=\"addPart($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n\r\n <!-- layers -->\r\n @if (id()) {\r\n <mat-tab label=\"Layers\">\r\n <table id=\"layers\">\r\n <thead>\r\n <th aria-label=\"actions\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of layerPartInfos();\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <td class=\"fit-width\">\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td\r\n [class.count-n]=\"part.fragmentCount\"\r\n [class.count-z]=\"!part.fragmentCount\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n @if (!part.isAbsent) {\r\n <span>\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </span>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n }\r\n\r\n <!-- thesaurus scopes -->\r\n @if (parts().length) {\r\n <mat-tab label=\"Th-Scopes\">\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts()\"\r\n [readonly]=\"userLevel() < 2 || busy() ? true : false\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".full-width{width:100%}.flex-field{flex:1 0 auto}table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}table#layers td{padding:0 6px}table#layers th{text-align:left}div.new-part{margin-left:32px}span.new-part-role{color:var(--mat-sys-on-surface-variant);margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:var(--mat-sys-success)}td.count-z{text-align:center;color:var(--mat-sys-error)}input.id{font-family:Courier New,Courier,monospace;color:var(--mat-sys-on-surface-variant);min-width:22em}.admin-flags{margin-bottom:4px}.admin-flag{margin-left:12px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{margin-top:6px}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width:599px){.noif-lt-xs{display:none}}.flex-row{display:flex;flex-wrap:wrap}.flex-row .item{box-sizing:border-box}.flex-row .item.fit{flex:0 0 auto}.flex-row .item:not(.fit){flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MissingPartsComponent, selector: "cadmus-missing-parts", inputs: ["facetDefinition", "partDefinitions", "parts", "typeThesaurus"], outputs: ["addRequest"] }, { kind: "component", type: PartsScopeEditorComponent, selector: "cadmus-parts-scope-editor", inputs: ["parts", "readonly"], outputs: ["setScopeRequest"] }, { kind: "component", type: PartBadgeComponent, selector: "cadmus-part-badge", inputs: ["badgeType", "typeThesaurus", "facetDefinition", "partTypeIds"] }, { kind: "component", type: CurrentItemBarComponent, selector: "cadmus-current-item-bar" }, { kind: "component", type: FlagSetComponent, selector: "cadmus-ui-flag-set", inputs: ["flags", "checkedIds", "allowCustom", "hideToolbar", "numbering"], outputs: ["checkedIdsChange"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: HasPreviewPipe, name: "hasPreview" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
], template: "<mat-card appearance=\"outlined\">\r\n <mat-card-content>\r\n <div>\r\n <cadmus-current-item-bar />\r\n </div>\r\n @if (busy()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id() ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- title -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>title</mat-label>\r\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\r\n @if (\r\n title.hasError(\"required\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>enter title</mat-error>\r\n }\r\n @if (\r\n title.hasError(\"maxLength\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>title too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto title -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateTitle()\"\r\n >\r\n <mat-icon matTooltip=\"Generate title\">auto_awesome</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- sortKey -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>sort key</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n [formControl]=\"sortKey\"\r\n />\r\n @if (\r\n sortKey.hasError(\"required\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>enter sort key</mat-error>\r\n }\r\n @if (\r\n sortKey.hasError(\"maxLength\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>sort key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div class=\"flex-row\">\r\n <mat-form-field class=\"item\">\r\n <mat-label>description</mat-label>\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n [formControl]=\"description\"\r\n ></textarea>\r\n @if (\r\n description.hasError(\"required\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>enter description</mat-error>\r\n }\r\n @if (\r\n description.hasError(\"maxLength\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto description -->\r\n <button\r\n class=\"item fit\"\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateDescription()\"\r\n >\r\n <mat-icon matTooltip=\"Generate description\"\r\n >auto_awesome</mat-icon\r\n >\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- facet -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>facet</mat-label>\r\n <mat-select [formControl]=\"facetCtrl\" required=\"true\">\r\n @for (f of facets(); track f.id) {\r\n <mat-option [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <mat-label>group ID</mat-label>\r\n <input matInput [formControl]=\"group\" />\r\n @if (\r\n group.hasError(\"maxLength\") && (group.dirty || group.touched)\r\n ) {\r\n <mat-error>too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <fieldset>\r\n <legend>flags</legend>\r\n <!-- read-only admin flags for non-admin users -->\r\n @if (adminFlagDefs().length) {\r\n <div class=\"admin-flags\">\r\n @for (def of adminFlagDefs(); track def.id) {\r\n <span class=\"admin-flag\">\r\n <span [style.color]=\"'#' + def.colorKey\">◆</span>\r\n {{ def.label }}\r\n </span>\r\n }\r\n </div>\r\n }\r\n <!-- editable flags -->\r\n @if (flagSetFlags().length) {\r\n <cadmus-ui-flag-set\r\n [hideToolbar]=\"true\"\r\n [flags]=\"flagSetFlags()\"\r\n [checkedIds]=\"checkedFlagIds()\"\r\n (checkedIdsChange)=\"onFlagCheckedIdsChange($event)\"\r\n />\r\n }\r\n </fieldset>\r\n <br />\r\n\r\n <!-- action buttons -->\r\n @if (userLevel() > 1) {\r\n <div class=\"form-row\">\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n class=\"mat-warn\"\r\n (click)=\"onGenerateItems()\"\r\n >\r\n <mat-icon>copy_all</mat-icon> generate\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n [disabled]=\"busy()\"\r\n matTooltip=\"Save metadata\"\r\n (click)=\"save()\"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n }\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n @if (id()) {\r\n <mat-tab label=\"Parts\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\" class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>part</mat-label>\r\n <mat-select [formControl]=\"newPartType\" required>\r\n @for (\r\n p of newPartDefinitions();\r\n track p.typeId + \":\" + (p.roleId || \"\")\r\n ) {\r\n <mat-option [value]=\"p\">\r\n <span\r\n [style.color]=\"'#' + p.colorKey\"\r\n class=\"new-part-icon\"\r\n >⬤</span\r\n >\r\n {{ getPartIdName(p.typeId, p.roleId) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n <button\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy() || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n part\r\n </button>\r\n </form>\r\n </div>\r\n <mat-divider></mat-divider>\r\n @for (group of partGroups(); track group.key) {\r\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n <table class=\"parts-table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th class=\"noif-lt-xs\">modified</th>\r\n <th class=\"noif-lt-xs\">user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of group.parts;\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <!-- edit -->\r\n <td class=\"fit-width\">\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"busy()\"\r\n (click)=\"editPart(part)\"\r\n matTooltip=\"Edit this part\"\r\n >\r\n <mat-icon class=\"mat-primary\">create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n @if (\r\n user()?.roles?.length &&\r\n (user()?.roles?.includes(\"admin\") ||\r\n user()?.roles?.includes(\"editor\") ||\r\n user()?.roles?.includes(\"operator\"))\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy()\"\r\n (click)=\"deletePart(part)\"\r\n matTooltip=\"Delete this part\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n <!-- copy ID -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n <!-- copy into item -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy part into another item\"\r\n (click)=\"onCopyPart(part)\"\r\n >\r\n <mat-icon>open_in_new</mat-icon>\r\n </button>\r\n <!-- preview -->\r\n @if (\r\n part | hasPreview: previewJKeys() : previewFKeys()\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Preview this part\"\r\n (click)=\"previewPart(part)\"\r\n >\r\n <mat-icon>preview</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td class=\"noif-lt-xs\">\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </td>\r\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n }\r\n <cadmus-missing-parts\r\n [facetDefinition]=\"facet()\"\r\n [partDefinitions]=\"\r\n $safeNavigationMigration(facet()?.partDefinitions)\r\n \"\r\n [parts]=\"parts()\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n (addRequest)=\"addPart($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n\r\n <!-- layers -->\r\n @if (id()) {\r\n <mat-tab label=\"Layers\">\r\n <table id=\"layers\">\r\n <thead>\r\n <th aria-label=\"actions\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of layerPartInfos();\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <td class=\"fit-width\">\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td\r\n [class.count-n]=\"part.fragmentCount\"\r\n [class.count-z]=\"!part.fragmentCount\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n @if (!part.isAbsent) {\r\n <span>\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </span>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n }\r\n\r\n <!-- thesaurus scopes -->\r\n @if (parts().length) {\r\n <mat-tab label=\"Th-Scopes\">\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts()\"\r\n [readonly]=\"userLevel() < 2 || busy() ? true : false\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".full-width{width:100%}.flex-field{flex:1 0 auto}table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}table#layers td{padding:0 6px}table#layers th{text-align:left}div.new-part{margin-left:32px}span.new-part-role{color:var(--mat-sys-on-surface-variant);margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:var(--mat-sys-success)}td.count-z{text-align:center;color:var(--mat-sys-error)}input.id{font-family:Courier New,Courier,monospace;color:var(--mat-sys-on-surface-variant);min-width:22em}.admin-flags{margin-bottom:4px}.admin-flag{margin-left:12px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{margin-top:6px}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width:599px){.noif-lt-xs{display:none}}.flex-row{display:flex;flex-wrap:wrap}.flex-row .item{box-sizing:border-box}.flex-row .item.fit{flex:0 0 auto}.flex-row .item:not(.fit){flex:1 1 auto}\n"] }]
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Inject, Injectable, Pipe, computed, effect, input, output, signal } from "@angular/core";
|
|
3
|
+
import { BehaviorSubject, forkJoin } from "rxjs";
|
|
4
|
+
import * as i1$2 from "@myrmidon/cadmus-state";
|
|
5
|
+
import * as i2$1 from "@myrmidon/cadmus-api";
|
|
6
|
+
import { DatePipe } from "@angular/common";
|
|
7
|
+
import { toSignal } from "@angular/core/rxjs-interop";
|
|
8
|
+
import { MatTooltip } from "@angular/material/tooltip";
|
|
9
|
+
import * as i1$1 from "@angular/forms";
|
|
10
|
+
import { ReactiveFormsModule, Validators } from "@angular/forms";
|
|
11
|
+
import { take } from "rxjs/operators";
|
|
12
|
+
import { MatCard, MatCardContent } from "@angular/material/card";
|
|
13
|
+
import { CdkCopyToClipboard } from "@angular/cdk/clipboard";
|
|
14
|
+
import { MatProgressBar } from "@angular/material/progress-bar";
|
|
15
|
+
import { MatTab, MatTabGroup } from "@angular/material/tabs";
|
|
16
|
+
import { MatError, MatFormField, MatHint, MatLabel } from "@angular/material/form-field";
|
|
17
|
+
import { MatInput } from "@angular/material/input";
|
|
18
|
+
import { MatSelect } from "@angular/material/select";
|
|
19
|
+
import { MatOption } from "@angular/material/core";
|
|
20
|
+
import { MatButton, MatIconButton } from "@angular/material/button";
|
|
21
|
+
import { MatIcon } from "@angular/material/icon";
|
|
22
|
+
import { MatDivider } from "@angular/material/divider";
|
|
23
|
+
import { MatExpansionPanel, MatExpansionPanelDescription, MatExpansionPanelHeader, MatExpansionPanelTitle } from "@angular/material/expansion";
|
|
24
|
+
import { FlagSetComponent } from "@myrmidon/cadmus-ui-flag-set";
|
|
25
|
+
import { MESSAGE_ITEM_LIST_REPOSITORY_RESET } from "@myrmidon/cadmus-item-list";
|
|
26
|
+
import { CustomValidators, PartBadgeComponent, getPartIdName } from "@myrmidon/cadmus-ui";
|
|
27
|
+
import { MatCheckbox } from "@angular/material/checkbox";
|
|
28
|
+
import * as i3$1 from "@myrmidon/ngx-mat-tools";
|
|
29
|
+
import * as i5 from "@myrmidon/ngx-tools";
|
|
30
|
+
import * as i1 from "@angular/material/dialog";
|
|
31
|
+
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
|
|
32
|
+
import { RefLookupComponent } from "@myrmidon/cadmus-refs-lookup";
|
|
33
|
+
import * as i2 from "@myrmidon/cadmus-refs-asserted-ids";
|
|
34
|
+
import * as i3 from "@angular/router";
|
|
35
|
+
import * as i4 from "@angular/material/snack-bar";
|
|
36
|
+
import * as i8 from "@myrmidon/cadmus-core";
|
|
37
|
+
import * as i10 from "@myrmidon/auth-jwt-login";
|
|
38
|
+
var EditedItemRepository = class EditedItemRepository {
|
|
39
|
+
_appRepository;
|
|
40
|
+
_itemService;
|
|
41
|
+
_loading$;
|
|
42
|
+
_item$;
|
|
43
|
+
_parts$;
|
|
44
|
+
_partGroups$;
|
|
45
|
+
_layersPartInfo$;
|
|
46
|
+
_facet$;
|
|
47
|
+
_newPartDefinitions$;
|
|
48
|
+
get loading$() {
|
|
49
|
+
return this._loading$.asObservable();
|
|
50
|
+
}
|
|
51
|
+
get item$() {
|
|
52
|
+
return this._item$.asObservable();
|
|
53
|
+
}
|
|
54
|
+
get parts$() {
|
|
55
|
+
return this._parts$.asObservable();
|
|
56
|
+
}
|
|
57
|
+
get partGroups$() {
|
|
58
|
+
return this._partGroups$.asObservable();
|
|
59
|
+
}
|
|
60
|
+
get layers$() {
|
|
61
|
+
return this._layersPartInfo$.asObservable();
|
|
62
|
+
}
|
|
63
|
+
get facet$() {
|
|
64
|
+
return this._facet$.asObservable();
|
|
65
|
+
}
|
|
66
|
+
get newPartDefinitions$() {
|
|
67
|
+
return this._newPartDefinitions$.asObservable();
|
|
68
|
+
}
|
|
69
|
+
constructor(_appRepository, _itemService) {
|
|
70
|
+
this._appRepository = _appRepository;
|
|
71
|
+
this._itemService = _itemService;
|
|
72
|
+
this._loading$ = new BehaviorSubject(void 0);
|
|
73
|
+
this._item$ = new BehaviorSubject(void 0);
|
|
74
|
+
this._parts$ = new BehaviorSubject([]);
|
|
75
|
+
this._partGroups$ = new BehaviorSubject([]);
|
|
76
|
+
this._layersPartInfo$ = new BehaviorSubject([]);
|
|
77
|
+
this._facet$ = new BehaviorSubject(void 0);
|
|
78
|
+
this._newPartDefinitions$ = new BehaviorSubject([]);
|
|
79
|
+
this._appRepository.load();
|
|
80
|
+
}
|
|
81
|
+
getItem() {
|
|
82
|
+
return this._item$.value;
|
|
83
|
+
}
|
|
84
|
+
getFacet() {
|
|
85
|
+
return this._facet$.value;
|
|
86
|
+
}
|
|
87
|
+
getExistingPartTypeAndRoleIds() {
|
|
88
|
+
const groups = this.getPartGroups();
|
|
89
|
+
if (!groups) return [];
|
|
90
|
+
const results = [];
|
|
91
|
+
for (const group of groups) for (const part of group.parts) results.push({
|
|
92
|
+
typeId: part.typeId,
|
|
93
|
+
roleId: part.roleId
|
|
94
|
+
});
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
97
|
+
getNewPartDefinitions() {
|
|
98
|
+
const facet = this.getFacet();
|
|
99
|
+
if (!facet) return [];
|
|
100
|
+
const existingTypeRoleIds = this.getExistingPartTypeAndRoleIds();
|
|
101
|
+
const defs = [];
|
|
102
|
+
for (const def of facet.partDefinitions) {
|
|
103
|
+
if (def.roleId?.startsWith("fr.")) continue;
|
|
104
|
+
if (existingTypeRoleIds.find((tr) => {
|
|
105
|
+
return tr.typeId === def.typeId && (!tr.roleId && !def.roleId || tr.roleId === def.roleId);
|
|
106
|
+
})) continue;
|
|
107
|
+
defs.push(def);
|
|
108
|
+
}
|
|
109
|
+
defs.sort((a, b) => {
|
|
110
|
+
return (a.sortKey || "").localeCompare(b.sortKey || "");
|
|
111
|
+
});
|
|
112
|
+
return defs;
|
|
113
|
+
}
|
|
114
|
+
getPartGroups() {
|
|
115
|
+
return this._partGroups$.value;
|
|
116
|
+
}
|
|
117
|
+
pickDefaultFacet(facets) {
|
|
118
|
+
if (!facets.length) return;
|
|
119
|
+
const defaultFacet = facets.find((f) => f.id === "default");
|
|
120
|
+
if (defaultFacet) return defaultFacet;
|
|
121
|
+
return facets[0];
|
|
122
|
+
}
|
|
123
|
+
load(itemId) {
|
|
124
|
+
const facets = this._appRepository.getFacets();
|
|
125
|
+
this._loading$.next(true);
|
|
126
|
+
if (!itemId) this._itemService.getItemLayerInfo("new", true).subscribe((layers) => {
|
|
127
|
+
const facet = this.pickDefaultFacet(facets);
|
|
128
|
+
this._loading$.next(false);
|
|
129
|
+
this._item$.next({
|
|
130
|
+
id: "",
|
|
131
|
+
title: "",
|
|
132
|
+
description: "",
|
|
133
|
+
facetId: facet?.id || "",
|
|
134
|
+
groupId: "",
|
|
135
|
+
sortKey: "",
|
|
136
|
+
flags: 0,
|
|
137
|
+
timeCreated: /* @__PURE__ */ new Date(),
|
|
138
|
+
creatorId: "",
|
|
139
|
+
timeModified: /* @__PURE__ */ new Date(),
|
|
140
|
+
userId: ""
|
|
141
|
+
});
|
|
142
|
+
this._parts$.next([]);
|
|
143
|
+
this._partGroups$.next([]);
|
|
144
|
+
this._layersPartInfo$.next(layers);
|
|
145
|
+
this._facet$.next(facet);
|
|
146
|
+
this._newPartDefinitions$.next(this.getNewPartDefinitions());
|
|
147
|
+
});
|
|
148
|
+
else forkJoin({
|
|
149
|
+
item: this._itemService.getItem(itemId, true),
|
|
150
|
+
layers: this._itemService.getItemLayerInfo(itemId, true)
|
|
151
|
+
}).subscribe({ next: (result) => {
|
|
152
|
+
this._loading$.next(false);
|
|
153
|
+
const itemFacet = facets.find((f) => {
|
|
154
|
+
return f.id === result.item.facetId;
|
|
155
|
+
});
|
|
156
|
+
const facetParts = itemFacet ? itemFacet.partDefinitions : [];
|
|
157
|
+
this._item$.next(result.item);
|
|
158
|
+
this._parts$.next(result.item.parts || []);
|
|
159
|
+
this._partGroups$.next(this._itemService.groupParts(result.item.parts || [], facetParts));
|
|
160
|
+
this._layersPartInfo$.next(result.layers);
|
|
161
|
+
this._facet$.next(itemFacet);
|
|
162
|
+
this._newPartDefinitions$.next(this.getNewPartDefinitions());
|
|
163
|
+
} });
|
|
164
|
+
}
|
|
165
|
+
ensureItemLoaded(id) {
|
|
166
|
+
if (this.getItem()?.id === id) return;
|
|
167
|
+
this.load(id);
|
|
168
|
+
}
|
|
169
|
+
save(item) {
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
this._itemService.addItem(item).subscribe({
|
|
172
|
+
next: (saved) => {
|
|
173
|
+
const itemFacet = this._appRepository.getFacets().find((f) => {
|
|
174
|
+
return f.id === saved.facetId;
|
|
175
|
+
});
|
|
176
|
+
this._item$.next(saved);
|
|
177
|
+
this._facet$.next(itemFacet);
|
|
178
|
+
this._newPartDefinitions$.next(this.getNewPartDefinitions());
|
|
179
|
+
resolve(saved);
|
|
180
|
+
},
|
|
181
|
+
error: (error) => {
|
|
182
|
+
console.error(`Error saving item ${item.id}`, error);
|
|
183
|
+
reject({
|
|
184
|
+
message: "Error saving item " + item.id,
|
|
185
|
+
error
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
deletePart(id) {
|
|
192
|
+
return new Promise((resolve, reject) => {
|
|
193
|
+
const itemId = this._item$.value?.id;
|
|
194
|
+
if (!itemId) {
|
|
195
|
+
reject({ message: "Cannot delete part of unsaved item" });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this._itemService.deletePart(id).subscribe({
|
|
199
|
+
next: (_) => {
|
|
200
|
+
this.load(itemId);
|
|
201
|
+
resolve(id);
|
|
202
|
+
},
|
|
203
|
+
error: (error) => {
|
|
204
|
+
console.error(`Error deleting item's part ${id}`, error);
|
|
205
|
+
reject({
|
|
206
|
+
message: "Error deleting item's part " + id,
|
|
207
|
+
error
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
addNewLayerPart(typeId, roleId) {
|
|
214
|
+
return new Promise((resolve, reject) => {
|
|
215
|
+
const itemId = this._item$.value?.id;
|
|
216
|
+
if (!itemId) {
|
|
217
|
+
reject({ message: "Cannot add part to unsaved item" });
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const part = {
|
|
221
|
+
itemId,
|
|
222
|
+
typeId,
|
|
223
|
+
roleId,
|
|
224
|
+
id: "",
|
|
225
|
+
creatorId: "",
|
|
226
|
+
userId: "",
|
|
227
|
+
timeCreated: /* @__PURE__ */ new Date(),
|
|
228
|
+
timeModified: /* @__PURE__ */ new Date()
|
|
229
|
+
};
|
|
230
|
+
this._itemService.addPart(part).subscribe({
|
|
231
|
+
next: (part) => {
|
|
232
|
+
this.load(itemId);
|
|
233
|
+
resolve(part);
|
|
234
|
+
},
|
|
235
|
+
error: (error) => {
|
|
236
|
+
console.error(`Error adding new layer part for item ${itemId}`, error);
|
|
237
|
+
reject({
|
|
238
|
+
message: "Error adding new layer part for item " + itemId,
|
|
239
|
+
error
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
setPartThesaurusScope(ids, scope) {
|
|
246
|
+
return new Promise((resolve, reject) => {
|
|
247
|
+
const itemId = this._item$.value?.id;
|
|
248
|
+
if (!itemId) {
|
|
249
|
+
reject({ message: "Cannot set scope for unsaved item" });
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
this._itemService.setPartThesaurusScope(ids, scope).subscribe({
|
|
253
|
+
next: (_) => {
|
|
254
|
+
this.load(itemId);
|
|
255
|
+
resolve(true);
|
|
256
|
+
},
|
|
257
|
+
error: (error) => {
|
|
258
|
+
console.error("Error setting item's part scope", error);
|
|
259
|
+
reject({
|
|
260
|
+
message: "Error setting item's part scope",
|
|
261
|
+
error
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
268
|
+
minVersion: "12.0.0",
|
|
269
|
+
version: "22.2.0",
|
|
270
|
+
ngImport: i0,
|
|
271
|
+
type: EditedItemRepository,
|
|
272
|
+
deps: [{ token: i1$2.AppRepository }, { token: i2$1.ItemService }],
|
|
273
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
274
|
+
});
|
|
275
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
276
|
+
minVersion: "12.0.0",
|
|
277
|
+
version: "22.2.0",
|
|
278
|
+
ngImport: i0,
|
|
279
|
+
type: EditedItemRepository,
|
|
280
|
+
providedIn: "root"
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
284
|
+
minVersion: "12.0.0",
|
|
285
|
+
version: "22.2.0",
|
|
286
|
+
ngImport: i0,
|
|
287
|
+
type: EditedItemRepository,
|
|
288
|
+
decorators: [{
|
|
289
|
+
type: Injectable,
|
|
290
|
+
args: [{ providedIn: "root" }]
|
|
291
|
+
}],
|
|
292
|
+
ctorParameters: () => [{ type: i1$2.AppRepository }, { type: i2$1.ItemService }]
|
|
293
|
+
});
|
|
294
|
+
var CurrentItemBarComponent = class CurrentItemBarComponent {
|
|
295
|
+
item;
|
|
296
|
+
constructor(repository) {
|
|
297
|
+
this.item = toSignal(repository.item$);
|
|
298
|
+
}
|
|
299
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
300
|
+
minVersion: "12.0.0",
|
|
301
|
+
version: "22.2.0",
|
|
302
|
+
ngImport: i0,
|
|
303
|
+
type: CurrentItemBarComponent,
|
|
304
|
+
deps: [{ token: EditedItemRepository }],
|
|
305
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
306
|
+
});
|
|
307
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
308
|
+
minVersion: "17.0.0",
|
|
309
|
+
version: "22.2.0",
|
|
310
|
+
type: CurrentItemBarComponent,
|
|
311
|
+
isStandalone: true,
|
|
312
|
+
selector: "cadmus-current-item-bar",
|
|
313
|
+
ngImport: i0,
|
|
314
|
+
template: "@if (item(); as item) {\n <div class=\"item-bar\">\n <span class=\"title\">{{ item.title }}</span>\n <span class=\"id\">{{ item.id }}</span>\n ⬤\n <span class=\"dsc\">\n {{ item.description }} ⬤\n <span matTooltip=\"Created\"\n >{{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }}\n {{ item.creatorId }}</span\n >\n ⬤\n <span matTooltip=\"Last saved\"\n >{{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\n {{ item.userId }}</span\n >\n </span>\n </div>\n}\n",
|
|
315
|
+
styles: ["div.item-bar{border:1px solid var(--mat-sys-on-surface-variant);border-radius:4px;background-color:var(--mat-sys-surface-container);color:var(--mat-sys-on-primary-container);margin:6px;padding:8px}.title{font-size:1.2em;font-weight:700;margin-right:.5em}.id{font-size:.8em;font-family:Courier New,Courier,monospace;margin-right:.5em}.dsc{font-size:.9em}\n"],
|
|
316
|
+
dependencies: [{
|
|
317
|
+
kind: "directive",
|
|
318
|
+
type: MatTooltip,
|
|
319
|
+
selector: "[matTooltip]",
|
|
320
|
+
inputs: [
|
|
321
|
+
"matTooltipPosition",
|
|
322
|
+
"matTooltipPositionAtOrigin",
|
|
323
|
+
"matTooltipDisabled",
|
|
324
|
+
"matTooltipShowDelay",
|
|
325
|
+
"matTooltipHideDelay",
|
|
326
|
+
"matTooltipTouchGestures",
|
|
327
|
+
"matTooltip",
|
|
328
|
+
"matTooltipClass"
|
|
329
|
+
],
|
|
330
|
+
exportAs: ["matTooltip"]
|
|
331
|
+
}, {
|
|
332
|
+
kind: "pipe",
|
|
333
|
+
type: DatePipe,
|
|
334
|
+
name: "date"
|
|
335
|
+
}],
|
|
336
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
340
|
+
minVersion: "12.0.0",
|
|
341
|
+
version: "22.2.0",
|
|
342
|
+
ngImport: i0,
|
|
343
|
+
type: CurrentItemBarComponent,
|
|
344
|
+
decorators: [{
|
|
345
|
+
type: Component,
|
|
346
|
+
args: [{
|
|
347
|
+
selector: "cadmus-current-item-bar",
|
|
348
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
349
|
+
imports: [DatePipe, MatTooltip],
|
|
350
|
+
template: "@if (item(); as item) {\n <div class=\"item-bar\">\n <span class=\"title\">{{ item.title }}</span>\n <span class=\"id\">{{ item.id }}</span>\n ⬤\n <span class=\"dsc\">\n {{ item.description }} ⬤\n <span matTooltip=\"Created\"\n >{{ item.timeCreated | date: \"yyyy-MM-dd HH:mm:ss\" }}\n {{ item.creatorId }}</span\n >\n ⬤\n <span matTooltip=\"Last saved\"\n >{{ item.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\n {{ item.userId }}</span\n >\n </span>\n </div>\n}\n",
|
|
351
|
+
styles: ["div.item-bar{border:1px solid var(--mat-sys-on-surface-variant);border-radius:4px;background-color:var(--mat-sys-surface-container);color:var(--mat-sys-on-primary-container);margin:6px;padding:8px}.title{font-size:1.2em;font-weight:700;margin-right:.5em}.id{font-size:.8em;font-family:Courier New,Courier,monospace;margin-right:.5em}.dsc{font-size:.9em}\n"]
|
|
352
|
+
}]
|
|
353
|
+
}],
|
|
354
|
+
ctorParameters: () => [{ type: EditedItemRepository }]
|
|
355
|
+
});
|
|
356
|
+
var CurrentLayerPartBarComponent = class CurrentLayerPartBarComponent {
|
|
357
|
+
_appRepository;
|
|
358
|
+
_editedItemRepository;
|
|
359
|
+
_facetService;
|
|
360
|
+
_facet;
|
|
361
|
+
_part;
|
|
362
|
+
typeId;
|
|
363
|
+
roleId;
|
|
364
|
+
color;
|
|
365
|
+
constructor(_appRepository, _editedItemRepository, editedLayerRepository, _facetService) {
|
|
366
|
+
this._appRepository = _appRepository;
|
|
367
|
+
this._editedItemRepository = _editedItemRepository;
|
|
368
|
+
this._facetService = _facetService;
|
|
369
|
+
this._facet = toSignal(this._editedItemRepository.facet$);
|
|
370
|
+
this._part = toSignal(editedLayerRepository.part$);
|
|
371
|
+
this.typeId = computed(() => {
|
|
372
|
+
const part = this._part();
|
|
373
|
+
if (!part) return void 0;
|
|
374
|
+
return this.getTypeIdName(part.typeId);
|
|
375
|
+
}, ...ngDevMode ? [{ debugName: "typeId" }] : /* istanbul ignore next */ []);
|
|
376
|
+
this.roleId = computed(() => {
|
|
377
|
+
const part = this._part();
|
|
378
|
+
if (!part) return void 0;
|
|
379
|
+
return this.getRoleIdName(part.roleId);
|
|
380
|
+
}, ...ngDevMode ? [{ debugName: "roleId" }] : /* istanbul ignore next */ []);
|
|
381
|
+
this.color = computed(() => {
|
|
382
|
+
const part = this._part();
|
|
383
|
+
this._facet();
|
|
384
|
+
if (!part) return void 0;
|
|
385
|
+
return this.getPartColor(part.typeId, part.roleId);
|
|
386
|
+
}, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
387
|
+
}
|
|
388
|
+
getTypeIdName(typeId) {
|
|
389
|
+
const typeThesaurus = this._appRepository.getTypeThesaurus();
|
|
390
|
+
if (!typeThesaurus) return typeId;
|
|
391
|
+
const i = typeId.lastIndexOf(":");
|
|
392
|
+
if (i > -1) typeId = typeId.substring(0, i);
|
|
393
|
+
const entry = typeThesaurus.entries?.find((e) => e.id === typeId);
|
|
394
|
+
return entry ? entry.value : typeId;
|
|
395
|
+
}
|
|
396
|
+
getRoleIdName(roleId) {
|
|
397
|
+
if (!roleId || !roleId.startsWith("fr.")) return roleId;
|
|
398
|
+
return this.getTypeIdName(roleId);
|
|
399
|
+
}
|
|
400
|
+
getPartColor(typeId, roleId) {
|
|
401
|
+
const facet = this._editedItemRepository.getFacet();
|
|
402
|
+
return this._facetService.getPartColor(typeId, roleId, facet);
|
|
403
|
+
}
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
405
|
+
minVersion: "12.0.0",
|
|
406
|
+
version: "22.2.0",
|
|
407
|
+
ngImport: i0,
|
|
408
|
+
type: CurrentLayerPartBarComponent,
|
|
409
|
+
deps: [
|
|
410
|
+
{ token: i1$2.AppRepository },
|
|
411
|
+
{ token: EditedItemRepository },
|
|
412
|
+
{ token: i1$2.EditedLayerRepository },
|
|
413
|
+
{ token: i2$1.FacetService }
|
|
414
|
+
],
|
|
415
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
416
|
+
});
|
|
417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
418
|
+
minVersion: "14.0.0",
|
|
419
|
+
version: "22.2.0",
|
|
420
|
+
type: CurrentLayerPartBarComponent,
|
|
421
|
+
isStandalone: true,
|
|
422
|
+
selector: "cadmus-current-layer-part-bar",
|
|
423
|
+
ngImport: i0,
|
|
424
|
+
template: "<div>\n <span class=\"type-id\" [style.background-color]=\"color()\">{{ typeId() }}</span>\n <span class=\"role-id\">{{ roleId() }}</span>\n</div>\n",
|
|
425
|
+
styles: ["span.type-id{padding:4px;border-radius:6px}span.role-id{padding:4px}\n"],
|
|
426
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
427
|
+
});
|
|
428
|
+
};
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
430
|
+
minVersion: "12.0.0",
|
|
431
|
+
version: "22.2.0",
|
|
432
|
+
ngImport: i0,
|
|
433
|
+
type: CurrentLayerPartBarComponent,
|
|
434
|
+
decorators: [{
|
|
435
|
+
type: Component,
|
|
436
|
+
args: [{
|
|
437
|
+
selector: "cadmus-current-layer-part-bar",
|
|
438
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
439
|
+
template: "<div>\n <span class=\"type-id\" [style.background-color]=\"color()\">{{ typeId() }}</span>\n <span class=\"role-id\">{{ roleId() }}</span>\n</div>\n",
|
|
440
|
+
styles: ["span.type-id{padding:4px;border-radius:6px}span.role-id{padding:4px}\n"]
|
|
441
|
+
}]
|
|
442
|
+
}],
|
|
443
|
+
ctorParameters: () => [
|
|
444
|
+
{ type: i1$2.AppRepository },
|
|
445
|
+
{ type: EditedItemRepository },
|
|
446
|
+
{ type: i1$2.EditedLayerRepository },
|
|
447
|
+
{ type: i2$1.FacetService }
|
|
448
|
+
]
|
|
449
|
+
});
|
|
450
|
+
var PartsScopeEditorComponent = class PartsScopeEditorComponent {
|
|
451
|
+
_formBuilder;
|
|
452
|
+
_facetService;
|
|
453
|
+
_dialogService;
|
|
454
|
+
_appRepository;
|
|
455
|
+
_colorService;
|
|
456
|
+
_editedItemRepository;
|
|
457
|
+
parts = input(...ngDevMode ? [void 0, { debugName: "parts" }] : /* istanbul ignore next */ []);
|
|
458
|
+
readonly = input(...ngDevMode ? [void 0, { debugName: "readonly" }] : /* istanbul ignore next */ []);
|
|
459
|
+
setScopeRequest = output();
|
|
460
|
+
checks;
|
|
461
|
+
scope;
|
|
462
|
+
form;
|
|
463
|
+
constructor(_formBuilder, _facetService, _dialogService, _appRepository, _colorService, _editedItemRepository) {
|
|
464
|
+
this._formBuilder = _formBuilder;
|
|
465
|
+
this._facetService = _facetService;
|
|
466
|
+
this._dialogService = _dialogService;
|
|
467
|
+
this._appRepository = _appRepository;
|
|
468
|
+
this._colorService = _colorService;
|
|
469
|
+
this._editedItemRepository = _editedItemRepository;
|
|
470
|
+
this.checks = _formBuilder.array([], CustomValidators.minChecked(1));
|
|
471
|
+
this.scope = _formBuilder.control(null, [Validators.maxLength(50), Validators.pattern(/^[-a-zA-Z0-9_]+$/)]);
|
|
472
|
+
this.form = _formBuilder.group({
|
|
473
|
+
checks: this.checks,
|
|
474
|
+
scope: this.scope
|
|
475
|
+
});
|
|
476
|
+
this._appRepository.load();
|
|
477
|
+
effect(() => {
|
|
478
|
+
this.updateForm(this.parts());
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
updateForm(parts) {
|
|
482
|
+
this.checks.clear();
|
|
483
|
+
if (!parts?.length) return;
|
|
484
|
+
for (let i = 0; i < parts.length; i++) this.checks.push(this._formBuilder.control(false));
|
|
485
|
+
this.form.updateValueAndValidity();
|
|
486
|
+
}
|
|
487
|
+
onCheckChanged() {
|
|
488
|
+
this.form.updateValueAndValidity();
|
|
489
|
+
}
|
|
490
|
+
getPartColor(typeId, roleId) {
|
|
491
|
+
const facet = this._editedItemRepository.getFacet();
|
|
492
|
+
return this._facetService.getPartColor(typeId, roleId, facet);
|
|
493
|
+
}
|
|
494
|
+
getContrastColor(typeId, roleId) {
|
|
495
|
+
const rgb = this.getPartColor(typeId, roleId);
|
|
496
|
+
return this._colorService.getContrastColor(rgb);
|
|
497
|
+
}
|
|
498
|
+
getTypeIdName(typeId) {
|
|
499
|
+
const typeThesaurus = this._appRepository.getTypeThesaurus();
|
|
500
|
+
if (!typeThesaurus) return typeId;
|
|
501
|
+
const i = typeId.lastIndexOf(":");
|
|
502
|
+
if (i > -1) typeId = typeId.substring(0, i);
|
|
503
|
+
const entry = typeThesaurus.entries?.find((e) => e.id === typeId);
|
|
504
|
+
return entry ? entry.value : typeId;
|
|
505
|
+
}
|
|
506
|
+
getRoleIdName(roleId) {
|
|
507
|
+
if (!roleId || !roleId.startsWith("fr.")) return roleId;
|
|
508
|
+
return this.getTypeIdName(roleId);
|
|
509
|
+
}
|
|
510
|
+
submit() {
|
|
511
|
+
if (this.form.invalid || !this.parts()?.length) return;
|
|
512
|
+
const ids = [];
|
|
513
|
+
const parts = this.parts();
|
|
514
|
+
for (let i = 0; i < this.checks.length; i++) if (this.checks.controls[i].value === true) ids.push(parts[i].id);
|
|
515
|
+
let msg = this.scope.value ? `Assign scope "${this.scope.value}" to ${ids.length} part` : `Remove scope from ${ids.length} part`;
|
|
516
|
+
msg += ids.length > 1 ? "s?" : "?";
|
|
517
|
+
this._dialogService.confirm("Confirm Scopes", msg).subscribe((result) => {
|
|
518
|
+
if (!result) return;
|
|
519
|
+
this.setScopeRequest.emit({
|
|
520
|
+
ids,
|
|
521
|
+
scope: this.scope.value
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
526
|
+
minVersion: "12.0.0",
|
|
527
|
+
version: "22.2.0",
|
|
528
|
+
ngImport: i0,
|
|
529
|
+
type: PartsScopeEditorComponent,
|
|
530
|
+
deps: [
|
|
531
|
+
{ token: i1$1.FormBuilder },
|
|
532
|
+
{ token: i2$1.FacetService },
|
|
533
|
+
{ token: i3$1.DialogService },
|
|
534
|
+
{ token: i1$2.AppRepository },
|
|
535
|
+
{ token: i5.ColorService },
|
|
536
|
+
{ token: EditedItemRepository }
|
|
537
|
+
],
|
|
538
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
539
|
+
});
|
|
540
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
541
|
+
minVersion: "17.0.0",
|
|
542
|
+
version: "22.2.0",
|
|
543
|
+
type: PartsScopeEditorComponent,
|
|
544
|
+
isStandalone: true,
|
|
545
|
+
selector: "cadmus-parts-scope-editor",
|
|
546
|
+
inputs: {
|
|
547
|
+
parts: {
|
|
548
|
+
classPropertyName: "parts",
|
|
549
|
+
publicName: "parts",
|
|
550
|
+
isSignal: true,
|
|
551
|
+
isRequired: false,
|
|
552
|
+
transformFunction: null
|
|
553
|
+
},
|
|
554
|
+
readonly: {
|
|
555
|
+
classPropertyName: "readonly",
|
|
556
|
+
publicName: "readonly",
|
|
557
|
+
isSignal: true,
|
|
558
|
+
isRequired: false,
|
|
559
|
+
transformFunction: null
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
outputs: { setScopeRequest: "setScopeRequest" },
|
|
563
|
+
ngImport: i0,
|
|
564
|
+
template: "<form [formGroup]=\"form\" (submit)=\"submit()\">\n <table id=\"parts\" formArrayName=\"checks\">\n <thead>\n <tr>\n <th aria-label=\"select\"></th>\n <th>type</th>\n <th>role</th>\n <th>scope</th>\n <th>modified</th>\n <th>user</th>\n </tr>\n </thead>\n <tbody>\n @for (\n part of parts() ?? [];\n track part.typeId + \":\" + (part.roleId ?? \"\");\n let i = $index\n ) {\n <tr>\n <td class=\"fit-width\">\n <mat-checkbox [formControlName]=\"i\" (change)=\"onCheckChanged()\" />\n </td>\n <td>\n <span\n class=\"model-type\"\n [style.background-color]=\"getPartColor(part.typeId, part.roleId)\"\n [style.color]=\"getContrastColor(part.typeId, part.roleId)\"\n >{{ getTypeIdName(part.typeId) }}</span\n >\n </td>\n <td>{{ getRoleIdName(part.roleId ?? \"\") }}</td>\n <td>{{ part.thesaurusScope }}</td>\n <td>{{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}</td>\n <td>{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>scope</mat-label>\n <input matInput formControlName=\"scope\" />\n @if (scope.hasError(\"maxLength\") && (scope.dirty || scope.touched)) {\n <mat-error>too long</mat-error>\n }\n @if (scope.hasError(\"pattern\") && (scope.dirty || scope.touched)) {\n <mat-error>invalid scope</mat-error>\n }\n </mat-form-field>\n <button\n mat-flat-button\n class=\"mat-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid || readonly()\"\n matTooltip=\"Assign the scope to the checked parts\"\n >\n assign\n </button>\n </div>\n</form>\n",
|
|
565
|
+
styles: ["table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}span.model-type{padding:4px;border-radius:6px}table#parts{border-collapse:separate;border-spacing:0 8px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"],
|
|
566
|
+
dependencies: [
|
|
567
|
+
{
|
|
568
|
+
kind: "ngmodule",
|
|
569
|
+
type: ReactiveFormsModule
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
kind: "directive",
|
|
573
|
+
type: i1$1.ɵNgNoValidate,
|
|
574
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
kind: "directive",
|
|
578
|
+
type: i1$1.DefaultValueAccessor,
|
|
579
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
kind: "directive",
|
|
583
|
+
type: i1$1.NgControlStatus,
|
|
584
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
kind: "directive",
|
|
588
|
+
type: i1$1.NgControlStatusGroup,
|
|
589
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
kind: "directive",
|
|
593
|
+
type: i1$1.FormGroupDirective,
|
|
594
|
+
selector: "[formGroup]",
|
|
595
|
+
inputs: ["formGroup"],
|
|
596
|
+
outputs: ["ngSubmit"],
|
|
597
|
+
exportAs: ["ngForm"]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
kind: "directive",
|
|
601
|
+
type: i1$1.FormControlName,
|
|
602
|
+
selector: "[formControlName]",
|
|
603
|
+
inputs: [
|
|
604
|
+
"formControlName",
|
|
605
|
+
"disabled",
|
|
606
|
+
"ngModel"
|
|
607
|
+
],
|
|
608
|
+
outputs: ["ngModelChange"]
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
kind: "directive",
|
|
612
|
+
type: i1$1.FormArrayName,
|
|
613
|
+
selector: "[formArrayName]",
|
|
614
|
+
inputs: ["formArrayName"]
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
kind: "component",
|
|
618
|
+
type: MatCheckbox,
|
|
619
|
+
selector: "mat-checkbox",
|
|
620
|
+
inputs: [
|
|
621
|
+
"aria-label",
|
|
622
|
+
"aria-labelledby",
|
|
623
|
+
"aria-describedby",
|
|
624
|
+
"aria-expanded",
|
|
625
|
+
"aria-controls",
|
|
626
|
+
"aria-owns",
|
|
627
|
+
"id",
|
|
628
|
+
"required",
|
|
629
|
+
"labelPosition",
|
|
630
|
+
"name",
|
|
631
|
+
"value",
|
|
632
|
+
"disableRipple",
|
|
633
|
+
"tabIndex",
|
|
634
|
+
"color",
|
|
635
|
+
"disabledInteractive",
|
|
636
|
+
"checked",
|
|
637
|
+
"disabled",
|
|
638
|
+
"indeterminate"
|
|
639
|
+
],
|
|
640
|
+
outputs: ["change", "indeterminateChange"],
|
|
641
|
+
exportAs: ["matCheckbox"]
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
kind: "component",
|
|
645
|
+
type: MatFormField,
|
|
646
|
+
selector: "mat-form-field",
|
|
647
|
+
inputs: [
|
|
648
|
+
"hideRequiredMarker",
|
|
649
|
+
"color",
|
|
650
|
+
"floatLabel",
|
|
651
|
+
"appearance",
|
|
652
|
+
"subscriptSizing",
|
|
653
|
+
"hintLabel"
|
|
654
|
+
],
|
|
655
|
+
exportAs: ["matFormField"]
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
kind: "directive",
|
|
659
|
+
type: MatLabel,
|
|
660
|
+
selector: "mat-label"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
kind: "directive",
|
|
664
|
+
type: MatInput,
|
|
665
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
666
|
+
inputs: [
|
|
667
|
+
"disabled",
|
|
668
|
+
"id",
|
|
669
|
+
"placeholder",
|
|
670
|
+
"name",
|
|
671
|
+
"required",
|
|
672
|
+
"type",
|
|
673
|
+
"errorStateMatcher",
|
|
674
|
+
"aria-describedby",
|
|
675
|
+
"value",
|
|
676
|
+
"readonly",
|
|
677
|
+
"disabledInteractive"
|
|
678
|
+
],
|
|
679
|
+
exportAs: ["matInput"]
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
kind: "directive",
|
|
683
|
+
type: MatError,
|
|
684
|
+
selector: "mat-error, [matError]",
|
|
685
|
+
inputs: ["id"]
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
kind: "component",
|
|
689
|
+
type: MatButton,
|
|
690
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
691
|
+
inputs: ["matButton"],
|
|
692
|
+
exportAs: ["matButton", "matAnchor"]
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
kind: "directive",
|
|
696
|
+
type: MatTooltip,
|
|
697
|
+
selector: "[matTooltip]",
|
|
698
|
+
inputs: [
|
|
699
|
+
"matTooltipPosition",
|
|
700
|
+
"matTooltipPositionAtOrigin",
|
|
701
|
+
"matTooltipDisabled",
|
|
702
|
+
"matTooltipShowDelay",
|
|
703
|
+
"matTooltipHideDelay",
|
|
704
|
+
"matTooltipTouchGestures",
|
|
705
|
+
"matTooltip",
|
|
706
|
+
"matTooltipClass"
|
|
707
|
+
],
|
|
708
|
+
exportAs: ["matTooltip"]
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
kind: "pipe",
|
|
712
|
+
type: DatePipe,
|
|
713
|
+
name: "date"
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
717
|
+
});
|
|
718
|
+
};
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
720
|
+
minVersion: "12.0.0",
|
|
721
|
+
version: "22.2.0",
|
|
722
|
+
ngImport: i0,
|
|
723
|
+
type: PartsScopeEditorComponent,
|
|
724
|
+
decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{
|
|
727
|
+
selector: "cadmus-parts-scope-editor",
|
|
728
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
729
|
+
imports: [
|
|
730
|
+
ReactiveFormsModule,
|
|
731
|
+
MatCheckbox,
|
|
732
|
+
MatFormField,
|
|
733
|
+
MatLabel,
|
|
734
|
+
MatInput,
|
|
735
|
+
MatError,
|
|
736
|
+
MatButton,
|
|
737
|
+
MatTooltip,
|
|
738
|
+
DatePipe
|
|
739
|
+
],
|
|
740
|
+
template: "<form [formGroup]=\"form\" (submit)=\"submit()\">\n <table id=\"parts\" formArrayName=\"checks\">\n <thead>\n <tr>\n <th aria-label=\"select\"></th>\n <th>type</th>\n <th>role</th>\n <th>scope</th>\n <th>modified</th>\n <th>user</th>\n </tr>\n </thead>\n <tbody>\n @for (\n part of parts() ?? [];\n track part.typeId + \":\" + (part.roleId ?? \"\");\n let i = $index\n ) {\n <tr>\n <td class=\"fit-width\">\n <mat-checkbox [formControlName]=\"i\" (change)=\"onCheckChanged()\" />\n </td>\n <td>\n <span\n class=\"model-type\"\n [style.background-color]=\"getPartColor(part.typeId, part.roleId)\"\n [style.color]=\"getContrastColor(part.typeId, part.roleId)\"\n >{{ getTypeIdName(part.typeId) }}</span\n >\n </td>\n <td>{{ getRoleIdName(part.roleId ?? \"\") }}</td>\n <td>{{ part.thesaurusScope }}</td>\n <td>{{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}</td>\n <td>{{ part.userId }}</td>\n </tr>\n }\n </tbody>\n </table>\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label>scope</mat-label>\n <input matInput formControlName=\"scope\" />\n @if (scope.hasError(\"maxLength\") && (scope.dirty || scope.touched)) {\n <mat-error>too long</mat-error>\n }\n @if (scope.hasError(\"pattern\") && (scope.dirty || scope.touched)) {\n <mat-error>invalid scope</mat-error>\n }\n </mat-form-field>\n <button\n mat-flat-button\n class=\"mat-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid || readonly()\"\n matTooltip=\"Assign the scope to the checked parts\"\n >\n assign\n </button>\n </div>\n</form>\n",
|
|
741
|
+
styles: ["table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}span.model-type{padding:4px;border-radius:6px}table#parts{border-collapse:separate;border-spacing:0 8px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"]
|
|
742
|
+
}]
|
|
743
|
+
}],
|
|
744
|
+
ctorParameters: () => [
|
|
745
|
+
{ type: i1$1.FormBuilder },
|
|
746
|
+
{ type: i2$1.FacetService },
|
|
747
|
+
{ type: i3$1.DialogService },
|
|
748
|
+
{ type: i1$2.AppRepository },
|
|
749
|
+
{ type: i5.ColorService },
|
|
750
|
+
{ type: EditedItemRepository }
|
|
751
|
+
],
|
|
752
|
+
propDecorators: {
|
|
753
|
+
parts: [{
|
|
754
|
+
type: i0.Input,
|
|
755
|
+
args: [{
|
|
756
|
+
isSignal: true,
|
|
757
|
+
alias: "parts",
|
|
758
|
+
required: false
|
|
759
|
+
}]
|
|
760
|
+
}],
|
|
761
|
+
readonly: [{
|
|
762
|
+
type: i0.Input,
|
|
763
|
+
args: [{
|
|
764
|
+
isSignal: true,
|
|
765
|
+
alias: "readonly",
|
|
766
|
+
required: false
|
|
767
|
+
}]
|
|
768
|
+
}],
|
|
769
|
+
setScopeRequest: [{
|
|
770
|
+
type: i0.Output,
|
|
771
|
+
args: ["setScopeRequest"]
|
|
772
|
+
}]
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
var ItemLookupDialogComponent = class ItemLookupDialogComponent {
|
|
776
|
+
dialogRef;
|
|
777
|
+
config;
|
|
778
|
+
itemLookupService;
|
|
779
|
+
constructor(dialogRef, config, itemLookupService) {
|
|
780
|
+
this.dialogRef = dialogRef;
|
|
781
|
+
this.config = config;
|
|
782
|
+
this.itemLookupService = itemLookupService;
|
|
783
|
+
}
|
|
784
|
+
onCancel() {
|
|
785
|
+
this.dialogRef.close(null);
|
|
786
|
+
}
|
|
787
|
+
onItemLookupChange(value) {
|
|
788
|
+
this.dialogRef.close(value);
|
|
789
|
+
}
|
|
790
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
791
|
+
minVersion: "12.0.0",
|
|
792
|
+
version: "22.2.0",
|
|
793
|
+
ngImport: i0,
|
|
794
|
+
type: ItemLookupDialogComponent,
|
|
795
|
+
deps: [
|
|
796
|
+
{ token: i1.MatDialogRef },
|
|
797
|
+
{ token: MAT_DIALOG_DATA },
|
|
798
|
+
{ token: i2.ItemRefLookupService }
|
|
799
|
+
],
|
|
800
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
801
|
+
});
|
|
802
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
803
|
+
minVersion: "14.0.0",
|
|
804
|
+
version: "22.2.0",
|
|
805
|
+
type: ItemLookupDialogComponent,
|
|
806
|
+
isStandalone: true,
|
|
807
|
+
selector: "cadmus-item-lookup-dialog",
|
|
808
|
+
ngImport: i0,
|
|
809
|
+
template: "<div id=\"container\">\r\n <h3>Select Item</h3>\r\n <cadmus-refs-lookup\r\n [service]=\"itemLookupService\"\r\n label=\"item\"\r\n (itemChange)=\"onItemLookupChange($event)\"\r\n />\r\n</div>\r\n",
|
|
810
|
+
styles: ["#container{padding:16px}\n"],
|
|
811
|
+
dependencies: [{
|
|
812
|
+
kind: "component",
|
|
813
|
+
type: RefLookupComponent,
|
|
814
|
+
selector: "cadmus-refs-lookup",
|
|
815
|
+
inputs: [
|
|
816
|
+
"label",
|
|
817
|
+
"limit",
|
|
818
|
+
"baseFilter",
|
|
819
|
+
"service",
|
|
820
|
+
"item",
|
|
821
|
+
"itemId",
|
|
822
|
+
"required",
|
|
823
|
+
"hasMore",
|
|
824
|
+
"linkTemplate",
|
|
825
|
+
"optDialog",
|
|
826
|
+
"options",
|
|
827
|
+
"lookupProviderOptions"
|
|
828
|
+
],
|
|
829
|
+
outputs: [
|
|
830
|
+
"itemChange",
|
|
831
|
+
"optionsChange",
|
|
832
|
+
"moreRequest"
|
|
833
|
+
]
|
|
834
|
+
}],
|
|
835
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
836
|
+
});
|
|
837
|
+
};
|
|
838
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
839
|
+
minVersion: "12.0.0",
|
|
840
|
+
version: "22.2.0",
|
|
841
|
+
ngImport: i0,
|
|
842
|
+
type: ItemLookupDialogComponent,
|
|
843
|
+
decorators: [{
|
|
844
|
+
type: Component,
|
|
845
|
+
args: [{
|
|
846
|
+
selector: "cadmus-item-lookup-dialog",
|
|
847
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
848
|
+
imports: [RefLookupComponent],
|
|
849
|
+
template: "<div id=\"container\">\r\n <h3>Select Item</h3>\r\n <cadmus-refs-lookup\r\n [service]=\"itemLookupService\"\r\n label=\"item\"\r\n (itemChange)=\"onItemLookupChange($event)\"\r\n />\r\n</div>\r\n",
|
|
850
|
+
styles: ["#container{padding:16px}\n"]
|
|
851
|
+
}]
|
|
852
|
+
}],
|
|
853
|
+
ctorParameters: () => [
|
|
854
|
+
{ type: i1.MatDialogRef },
|
|
855
|
+
{
|
|
856
|
+
type: i1.MatDialogConfig,
|
|
857
|
+
decorators: [{
|
|
858
|
+
type: Inject,
|
|
859
|
+
args: [MAT_DIALOG_DATA]
|
|
860
|
+
}]
|
|
861
|
+
},
|
|
862
|
+
{ type: i2.ItemRefLookupService }
|
|
863
|
+
]
|
|
864
|
+
});
|
|
865
|
+
var ItemGenerateDialogComponent = class ItemGenerateDialogComponent {
|
|
866
|
+
dialogRef;
|
|
867
|
+
config;
|
|
868
|
+
flags = signal([], ...ngDevMode ? [{ debugName: "flags" }] : /* istanbul ignore next */ []);
|
|
869
|
+
itemCount;
|
|
870
|
+
itemTitle;
|
|
871
|
+
itemFlags;
|
|
872
|
+
form;
|
|
873
|
+
constructor(formBuilder, dialogRef, config) {
|
|
874
|
+
this.dialogRef = dialogRef;
|
|
875
|
+
this.config = config;
|
|
876
|
+
this.itemCount = formBuilder.control(1, {
|
|
877
|
+
nonNullable: true,
|
|
878
|
+
validators: [
|
|
879
|
+
Validators.required,
|
|
880
|
+
Validators.min(1),
|
|
881
|
+
Validators.max(100)
|
|
882
|
+
]
|
|
883
|
+
});
|
|
884
|
+
this.itemTitle = formBuilder.control("", {
|
|
885
|
+
nonNullable: true,
|
|
886
|
+
validators: [Validators.required, Validators.maxLength(500)]
|
|
887
|
+
});
|
|
888
|
+
this.itemFlags = formBuilder.control([], { nonNullable: true });
|
|
889
|
+
this.form = formBuilder.group({
|
|
890
|
+
itemCount: this.itemCount,
|
|
891
|
+
itemTitle: this.itemTitle,
|
|
892
|
+
itemFlags: this.itemFlags
|
|
893
|
+
});
|
|
894
|
+
this.flags.set(config?.flags || []);
|
|
895
|
+
}
|
|
896
|
+
apply() {
|
|
897
|
+
if (!this.form.valid) return;
|
|
898
|
+
const flags = this.itemFlags.value.reduce((acc, f) => acc | f.id, 0);
|
|
899
|
+
this.dialogRef.close({
|
|
900
|
+
count: this.itemCount.value,
|
|
901
|
+
title: this.itemTitle.value,
|
|
902
|
+
flags
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
906
|
+
minVersion: "12.0.0",
|
|
907
|
+
version: "22.2.0",
|
|
908
|
+
ngImport: i0,
|
|
909
|
+
type: ItemGenerateDialogComponent,
|
|
910
|
+
deps: [
|
|
911
|
+
{ token: i1$1.FormBuilder },
|
|
912
|
+
{ token: i1.MatDialogRef },
|
|
913
|
+
{ token: MAT_DIALOG_DATA }
|
|
914
|
+
],
|
|
915
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
916
|
+
});
|
|
917
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
918
|
+
minVersion: "17.0.0",
|
|
919
|
+
version: "22.2.0",
|
|
920
|
+
type: ItemGenerateDialogComponent,
|
|
921
|
+
isStandalone: true,
|
|
922
|
+
selector: "cadmus-item-generate-dialog",
|
|
923
|
+
ngImport: i0,
|
|
924
|
+
template: "<div id=\"container\">\n <h3>Generate Items</h3>\n <form [formGroup]=\"form\" (submit)=\"apply()\">\n <!-- count -->\n <div>\n <mat-form-field class=\"input-nr\">\n <mat-label>count</mat-label>\n <input matInput type=\"number\" min=\"1\" [formControl]=\"itemCount\" />\n <mat-hint>number of items to generate</mat-hint>\n @if (\n itemCount.errors?.[\"required\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count required</mat-error>\n }\n @if (\n itemCount.errors?.[\"min\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count too low</mat-error>\n }\n @if (\n itemCount.errors?.[\"max\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count too high</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- title -->\n <div>\n <mat-form-field>\n <mat-label>title</mat-label>\n <input matInput [formControl]=\"itemTitle\" />\n <mat-hint>title template ({{ \"{0}\" }}=N)</mat-hint>\n @if (\n itemTitle.errors?.[\"required\"] &&\n (itemTitle.dirty || itemTitle.touched)\n ) {\n <mat-error>title required</mat-error>\n }\n @if (\n itemTitle.errors?.[\"maxlength\"] &&\n (itemTitle.dirty || itemTitle.touched)\n ) {\n <mat-error>title too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n @if (flags().length) {\n <div>\n <mat-form-field>\n <mat-label>flags</mat-label>\n <mat-select [formControl]=\"itemFlags\" multiple>\n @for (flag of flags(); track flag.id) {\n <mat-option [value]=\"flag\">\n <span class=\"flag-bullet\" [style.color]=\"'#' + flag.colorKey\"\n >⬤</span\n >\n {{ flag.label }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n }\n\n <!-- apply button -->\n <div>\n <button\n mat-flat-button\n class=\"mat-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n generate\n </button>\n </div>\n </form>\n</div>\n",
|
|
925
|
+
styles: ["#container{padding:16px}.flag-bullet{margin-right:.5em}.input-nr{width:5em}\n"],
|
|
926
|
+
dependencies: [
|
|
927
|
+
{
|
|
928
|
+
kind: "ngmodule",
|
|
929
|
+
type: ReactiveFormsModule
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
kind: "directive",
|
|
933
|
+
type: i1$1.ɵNgNoValidate,
|
|
934
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
kind: "directive",
|
|
938
|
+
type: i1$1.DefaultValueAccessor,
|
|
939
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
kind: "directive",
|
|
943
|
+
type: i1$1.NumberValueAccessor,
|
|
944
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
kind: "directive",
|
|
948
|
+
type: i1$1.NgControlStatus,
|
|
949
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
kind: "directive",
|
|
953
|
+
type: i1$1.NgControlStatusGroup,
|
|
954
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
kind: "directive",
|
|
958
|
+
type: i1$1.MinValidator,
|
|
959
|
+
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
960
|
+
inputs: ["min"]
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
kind: "directive",
|
|
964
|
+
type: i1$1.FormControlDirective,
|
|
965
|
+
selector: "[formControl]",
|
|
966
|
+
inputs: [
|
|
967
|
+
"formControl",
|
|
968
|
+
"disabled",
|
|
969
|
+
"ngModel"
|
|
970
|
+
],
|
|
971
|
+
outputs: ["ngModelChange"],
|
|
972
|
+
exportAs: ["ngForm"]
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
kind: "directive",
|
|
976
|
+
type: i1$1.FormGroupDirective,
|
|
977
|
+
selector: "[formGroup]",
|
|
978
|
+
inputs: ["formGroup"],
|
|
979
|
+
outputs: ["ngSubmit"],
|
|
980
|
+
exportAs: ["ngForm"]
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
kind: "component",
|
|
984
|
+
type: MatFormField,
|
|
985
|
+
selector: "mat-form-field",
|
|
986
|
+
inputs: [
|
|
987
|
+
"hideRequiredMarker",
|
|
988
|
+
"color",
|
|
989
|
+
"floatLabel",
|
|
990
|
+
"appearance",
|
|
991
|
+
"subscriptSizing",
|
|
992
|
+
"hintLabel"
|
|
993
|
+
],
|
|
994
|
+
exportAs: ["matFormField"]
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
kind: "directive",
|
|
998
|
+
type: MatLabel,
|
|
999
|
+
selector: "mat-label"
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
kind: "directive",
|
|
1003
|
+
type: MatInput,
|
|
1004
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
1005
|
+
inputs: [
|
|
1006
|
+
"disabled",
|
|
1007
|
+
"id",
|
|
1008
|
+
"placeholder",
|
|
1009
|
+
"name",
|
|
1010
|
+
"required",
|
|
1011
|
+
"type",
|
|
1012
|
+
"errorStateMatcher",
|
|
1013
|
+
"aria-describedby",
|
|
1014
|
+
"value",
|
|
1015
|
+
"readonly",
|
|
1016
|
+
"disabledInteractive"
|
|
1017
|
+
],
|
|
1018
|
+
exportAs: ["matInput"]
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
kind: "directive",
|
|
1022
|
+
type: MatHint,
|
|
1023
|
+
selector: "mat-hint",
|
|
1024
|
+
inputs: ["align", "id"]
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
kind: "directive",
|
|
1028
|
+
type: MatError,
|
|
1029
|
+
selector: "mat-error, [matError]",
|
|
1030
|
+
inputs: ["id"]
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
kind: "component",
|
|
1034
|
+
type: MatSelect,
|
|
1035
|
+
selector: "mat-select",
|
|
1036
|
+
inputs: [
|
|
1037
|
+
"aria-describedby",
|
|
1038
|
+
"panelClass",
|
|
1039
|
+
"disabled",
|
|
1040
|
+
"disableRipple",
|
|
1041
|
+
"tabIndex",
|
|
1042
|
+
"hideSingleSelectionIndicator",
|
|
1043
|
+
"placeholder",
|
|
1044
|
+
"required",
|
|
1045
|
+
"multiple",
|
|
1046
|
+
"disableOptionCentering",
|
|
1047
|
+
"compareWith",
|
|
1048
|
+
"value",
|
|
1049
|
+
"aria-label",
|
|
1050
|
+
"aria-labelledby",
|
|
1051
|
+
"errorStateMatcher",
|
|
1052
|
+
"typeaheadDebounceInterval",
|
|
1053
|
+
"sortComparator",
|
|
1054
|
+
"id",
|
|
1055
|
+
"panelWidth",
|
|
1056
|
+
"canSelectNullableOptions"
|
|
1057
|
+
],
|
|
1058
|
+
outputs: [
|
|
1059
|
+
"openedChange",
|
|
1060
|
+
"opened",
|
|
1061
|
+
"closed",
|
|
1062
|
+
"selectionChange",
|
|
1063
|
+
"valueChange"
|
|
1064
|
+
],
|
|
1065
|
+
exportAs: ["matSelect"]
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
kind: "component",
|
|
1069
|
+
type: MatOption,
|
|
1070
|
+
selector: "mat-option",
|
|
1071
|
+
inputs: [
|
|
1072
|
+
"value",
|
|
1073
|
+
"id",
|
|
1074
|
+
"disabled"
|
|
1075
|
+
],
|
|
1076
|
+
outputs: ["onSelectionChange"],
|
|
1077
|
+
exportAs: ["matOption"]
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
kind: "component",
|
|
1081
|
+
type: MatButton,
|
|
1082
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
1083
|
+
inputs: ["matButton"],
|
|
1084
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1085
|
+
}
|
|
1086
|
+
],
|
|
1087
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1091
|
+
minVersion: "12.0.0",
|
|
1092
|
+
version: "22.2.0",
|
|
1093
|
+
ngImport: i0,
|
|
1094
|
+
type: ItemGenerateDialogComponent,
|
|
1095
|
+
decorators: [{
|
|
1096
|
+
type: Component,
|
|
1097
|
+
args: [{
|
|
1098
|
+
selector: "cadmus-item-generate-dialog",
|
|
1099
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1100
|
+
imports: [
|
|
1101
|
+
ReactiveFormsModule,
|
|
1102
|
+
MatFormField,
|
|
1103
|
+
MatLabel,
|
|
1104
|
+
MatInput,
|
|
1105
|
+
MatHint,
|
|
1106
|
+
MatError,
|
|
1107
|
+
MatSelect,
|
|
1108
|
+
MatOption,
|
|
1109
|
+
MatButton
|
|
1110
|
+
],
|
|
1111
|
+
template: "<div id=\"container\">\n <h3>Generate Items</h3>\n <form [formGroup]=\"form\" (submit)=\"apply()\">\n <!-- count -->\n <div>\n <mat-form-field class=\"input-nr\">\n <mat-label>count</mat-label>\n <input matInput type=\"number\" min=\"1\" [formControl]=\"itemCount\" />\n <mat-hint>number of items to generate</mat-hint>\n @if (\n itemCount.errors?.[\"required\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count required</mat-error>\n }\n @if (\n itemCount.errors?.[\"min\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count too low</mat-error>\n }\n @if (\n itemCount.errors?.[\"max\"] && (itemCount.dirty || itemCount.touched)\n ) {\n <mat-error>count too high</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- title -->\n <div>\n <mat-form-field>\n <mat-label>title</mat-label>\n <input matInput [formControl]=\"itemTitle\" />\n <mat-hint>title template ({{ \"{0}\" }}=N)</mat-hint>\n @if (\n itemTitle.errors?.[\"required\"] &&\n (itemTitle.dirty || itemTitle.touched)\n ) {\n <mat-error>title required</mat-error>\n }\n @if (\n itemTitle.errors?.[\"maxlength\"] &&\n (itemTitle.dirty || itemTitle.touched)\n ) {\n <mat-error>title too long</mat-error>\n }\n </mat-form-field>\n </div>\n\n <!-- flags -->\n @if (flags().length) {\n <div>\n <mat-form-field>\n <mat-label>flags</mat-label>\n <mat-select [formControl]=\"itemFlags\" multiple>\n @for (flag of flags(); track flag.id) {\n <mat-option [value]=\"flag\">\n <span class=\"flag-bullet\" [style.color]=\"'#' + flag.colorKey\"\n >⬤</span\n >\n {{ flag.label }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n }\n\n <!-- apply button -->\n <div>\n <button\n mat-flat-button\n class=\"mat-primary\"\n type=\"submit\"\n [disabled]=\"form.invalid\"\n >\n generate\n </button>\n </div>\n </form>\n</div>\n",
|
|
1112
|
+
styles: ["#container{padding:16px}.flag-bullet{margin-right:.5em}.input-nr{width:5em}\n"]
|
|
1113
|
+
}]
|
|
1114
|
+
}],
|
|
1115
|
+
ctorParameters: () => [
|
|
1116
|
+
{ type: i1$1.FormBuilder },
|
|
1117
|
+
{ type: i1.MatDialogRef },
|
|
1118
|
+
{
|
|
1119
|
+
type: i1.MatDialogConfig,
|
|
1120
|
+
decorators: [{
|
|
1121
|
+
type: Inject,
|
|
1122
|
+
args: [MAT_DIALOG_DATA]
|
|
1123
|
+
}]
|
|
1124
|
+
}
|
|
1125
|
+
]
|
|
1126
|
+
});
|
|
1127
|
+
var MissingPartsComponent = class MissingPartsComponent {
|
|
1128
|
+
facetDefinition = input(...ngDevMode ? [void 0, { debugName: "facetDefinition" }] : /* istanbul ignore next */ []);
|
|
1129
|
+
partDefinitions = input(...ngDevMode ? [void 0, { debugName: "partDefinitions" }] : /* istanbul ignore next */ []);
|
|
1130
|
+
parts = input(...ngDevMode ? [void 0, { debugName: "parts" }] : /* istanbul ignore next */ []);
|
|
1131
|
+
missingDefinitions = signal([], ...ngDevMode ? [{ debugName: "missingDefinitions" }] : /* istanbul ignore next */ []);
|
|
1132
|
+
typeThesaurus = input(...ngDevMode ? [void 0, { debugName: "typeThesaurus" }] : /* istanbul ignore next */ []);
|
|
1133
|
+
addRequest = output();
|
|
1134
|
+
constructor() {
|
|
1135
|
+
effect(() => {
|
|
1136
|
+
this.updateMissing(this.partDefinitions(), this.parts());
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
partExists(typeId, roleId, parts) {
|
|
1140
|
+
if (!parts) return false;
|
|
1141
|
+
return parts.some((p) => p.typeId === typeId && (!p.roleId && !roleId || p.roleId === roleId));
|
|
1142
|
+
}
|
|
1143
|
+
updateMissing(definitions, parts) {
|
|
1144
|
+
const missingDefinitions = [];
|
|
1145
|
+
if (!definitions) return;
|
|
1146
|
+
for (let i = 0; i < definitions.length; i++) {
|
|
1147
|
+
const def = definitions[i];
|
|
1148
|
+
if (def.isRequired && !this.partExists(def.typeId, def.roleId, parts)) missingDefinitions.push(def);
|
|
1149
|
+
}
|
|
1150
|
+
this.missingDefinitions.set(missingDefinitions);
|
|
1151
|
+
}
|
|
1152
|
+
requestAddPart(definition) {
|
|
1153
|
+
this.addRequest.emit(definition);
|
|
1154
|
+
}
|
|
1155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1156
|
+
minVersion: "12.0.0",
|
|
1157
|
+
version: "22.2.0",
|
|
1158
|
+
ngImport: i0,
|
|
1159
|
+
type: MissingPartsComponent,
|
|
1160
|
+
deps: [],
|
|
1161
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1162
|
+
});
|
|
1163
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1164
|
+
minVersion: "17.0.0",
|
|
1165
|
+
version: "22.2.0",
|
|
1166
|
+
type: MissingPartsComponent,
|
|
1167
|
+
isStandalone: true,
|
|
1168
|
+
selector: "cadmus-missing-parts",
|
|
1169
|
+
inputs: {
|
|
1170
|
+
facetDefinition: {
|
|
1171
|
+
classPropertyName: "facetDefinition",
|
|
1172
|
+
publicName: "facetDefinition",
|
|
1173
|
+
isSignal: true,
|
|
1174
|
+
isRequired: false,
|
|
1175
|
+
transformFunction: null
|
|
1176
|
+
},
|
|
1177
|
+
partDefinitions: {
|
|
1178
|
+
classPropertyName: "partDefinitions",
|
|
1179
|
+
publicName: "partDefinitions",
|
|
1180
|
+
isSignal: true,
|
|
1181
|
+
isRequired: false,
|
|
1182
|
+
transformFunction: null
|
|
1183
|
+
},
|
|
1184
|
+
parts: {
|
|
1185
|
+
classPropertyName: "parts",
|
|
1186
|
+
publicName: "parts",
|
|
1187
|
+
isSignal: true,
|
|
1188
|
+
isRequired: false,
|
|
1189
|
+
transformFunction: null
|
|
1190
|
+
},
|
|
1191
|
+
typeThesaurus: {
|
|
1192
|
+
classPropertyName: "typeThesaurus",
|
|
1193
|
+
publicName: "typeThesaurus",
|
|
1194
|
+
isSignal: true,
|
|
1195
|
+
isRequired: false,
|
|
1196
|
+
transformFunction: null
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
outputs: { addRequest: "addRequest" },
|
|
1200
|
+
ngImport: i0,
|
|
1201
|
+
template: "@if (missingDefinitions().length) {\n <div>\n <fieldset>\n <legend>\n <mat-icon class=\"mat-warn\">warning</mat-icon> Missing Parts\n </legend>\n <table>\n <tbody>\n @for (\n def of missingDefinitions();\n track def.typeId + \":\" + (def.roleId ?? \"\")\n ) {\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add this part\"\n (click)=\"requestAddPart(def)\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td [matTooltip]=\"def.description\">\n <cadmus-part-badge\n [partTypeIds]=\"def\"\n [facetDefinition]=\"facetDefinition()\"\n [typeThesaurus]=\"typeThesaurus()\"\n />\n </td>\n </tr>\n }\n </tbody>\n </table>\n </fieldset>\n </div>\n}\n",
|
|
1202
|
+
styles: ["fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px}legend{color:var(--mat-sys-on-surface-variant)}\n"],
|
|
1203
|
+
dependencies: [
|
|
1204
|
+
{
|
|
1205
|
+
kind: "component",
|
|
1206
|
+
type: MatIcon,
|
|
1207
|
+
selector: "mat-icon",
|
|
1208
|
+
inputs: [
|
|
1209
|
+
"color",
|
|
1210
|
+
"inline",
|
|
1211
|
+
"svgIcon",
|
|
1212
|
+
"fontSet",
|
|
1213
|
+
"fontIcon"
|
|
1214
|
+
],
|
|
1215
|
+
exportAs: ["matIcon"]
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
kind: "component",
|
|
1219
|
+
type: MatIconButton,
|
|
1220
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
1221
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
kind: "directive",
|
|
1225
|
+
type: MatTooltip,
|
|
1226
|
+
selector: "[matTooltip]",
|
|
1227
|
+
inputs: [
|
|
1228
|
+
"matTooltipPosition",
|
|
1229
|
+
"matTooltipPositionAtOrigin",
|
|
1230
|
+
"matTooltipDisabled",
|
|
1231
|
+
"matTooltipShowDelay",
|
|
1232
|
+
"matTooltipHideDelay",
|
|
1233
|
+
"matTooltipTouchGestures",
|
|
1234
|
+
"matTooltip",
|
|
1235
|
+
"matTooltipClass"
|
|
1236
|
+
],
|
|
1237
|
+
exportAs: ["matTooltip"]
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
kind: "component",
|
|
1241
|
+
type: PartBadgeComponent,
|
|
1242
|
+
selector: "cadmus-part-badge",
|
|
1243
|
+
inputs: [
|
|
1244
|
+
"badgeType",
|
|
1245
|
+
"typeThesaurus",
|
|
1246
|
+
"facetDefinition",
|
|
1247
|
+
"partTypeIds"
|
|
1248
|
+
]
|
|
1249
|
+
}
|
|
1250
|
+
],
|
|
1251
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1252
|
+
});
|
|
1253
|
+
};
|
|
1254
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1255
|
+
minVersion: "12.0.0",
|
|
1256
|
+
version: "22.2.0",
|
|
1257
|
+
ngImport: i0,
|
|
1258
|
+
type: MissingPartsComponent,
|
|
1259
|
+
decorators: [{
|
|
1260
|
+
type: Component,
|
|
1261
|
+
args: [{
|
|
1262
|
+
selector: "cadmus-missing-parts",
|
|
1263
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1264
|
+
imports: [
|
|
1265
|
+
MatIcon,
|
|
1266
|
+
MatIconButton,
|
|
1267
|
+
MatTooltip,
|
|
1268
|
+
PartBadgeComponent
|
|
1269
|
+
],
|
|
1270
|
+
template: "@if (missingDefinitions().length) {\n <div>\n <fieldset>\n <legend>\n <mat-icon class=\"mat-warn\">warning</mat-icon> Missing Parts\n </legend>\n <table>\n <tbody>\n @for (\n def of missingDefinitions();\n track def.typeId + \":\" + (def.roleId ?? \"\")\n ) {\n <tr>\n <td>\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add this part\"\n (click)=\"requestAddPart(def)\"\n >\n <mat-icon>add_circle</mat-icon>\n </button>\n </td>\n <td [matTooltip]=\"def.description\">\n <cadmus-part-badge\n [partTypeIds]=\"def\"\n [facetDefinition]=\"facetDefinition()\"\n [typeThesaurus]=\"typeThesaurus()\"\n />\n </td>\n </tr>\n }\n </tbody>\n </table>\n </fieldset>\n </div>\n}\n",
|
|
1271
|
+
styles: ["fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px}legend{color:var(--mat-sys-on-surface-variant)}\n"]
|
|
1272
|
+
}]
|
|
1273
|
+
}],
|
|
1274
|
+
ctorParameters: () => [],
|
|
1275
|
+
propDecorators: {
|
|
1276
|
+
facetDefinition: [{
|
|
1277
|
+
type: i0.Input,
|
|
1278
|
+
args: [{
|
|
1279
|
+
isSignal: true,
|
|
1280
|
+
alias: "facetDefinition",
|
|
1281
|
+
required: false
|
|
1282
|
+
}]
|
|
1283
|
+
}],
|
|
1284
|
+
partDefinitions: [{
|
|
1285
|
+
type: i0.Input,
|
|
1286
|
+
args: [{
|
|
1287
|
+
isSignal: true,
|
|
1288
|
+
alias: "partDefinitions",
|
|
1289
|
+
required: false
|
|
1290
|
+
}]
|
|
1291
|
+
}],
|
|
1292
|
+
parts: [{
|
|
1293
|
+
type: i0.Input,
|
|
1294
|
+
args: [{
|
|
1295
|
+
isSignal: true,
|
|
1296
|
+
alias: "parts",
|
|
1297
|
+
required: false
|
|
1298
|
+
}]
|
|
1299
|
+
}],
|
|
1300
|
+
typeThesaurus: [{
|
|
1301
|
+
type: i0.Input,
|
|
1302
|
+
args: [{
|
|
1303
|
+
isSignal: true,
|
|
1304
|
+
alias: "typeThesaurus",
|
|
1305
|
+
required: false
|
|
1306
|
+
}]
|
|
1307
|
+
}],
|
|
1308
|
+
addRequest: [{
|
|
1309
|
+
type: i0.Output,
|
|
1310
|
+
args: ["addRequest"]
|
|
1311
|
+
}]
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
var HasPreviewPipe = class HasPreviewPipe {
|
|
1315
|
+
transform(value, rKeys, fKeys) {
|
|
1316
|
+
if (!value) return false;
|
|
1317
|
+
if (value.roleId === "base-text") return fKeys?.find((k) => k === value.typeId) || rKeys?.find((k) => k === value.typeId) ? true : false;
|
|
1318
|
+
const key = value.roleId ? `${value.typeId}|${value.roleId}` : value.typeId;
|
|
1319
|
+
return rKeys?.find((k) => k === key) ? true : false;
|
|
1320
|
+
}
|
|
1321
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1322
|
+
minVersion: "12.0.0",
|
|
1323
|
+
version: "22.2.0",
|
|
1324
|
+
ngImport: i0,
|
|
1325
|
+
type: HasPreviewPipe,
|
|
1326
|
+
deps: [],
|
|
1327
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
1328
|
+
});
|
|
1329
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1330
|
+
minVersion: "14.0.0",
|
|
1331
|
+
version: "22.2.0",
|
|
1332
|
+
ngImport: i0,
|
|
1333
|
+
type: HasPreviewPipe,
|
|
1334
|
+
isStandalone: true,
|
|
1335
|
+
name: "hasPreview"
|
|
1336
|
+
});
|
|
1337
|
+
};
|
|
1338
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1339
|
+
minVersion: "12.0.0",
|
|
1340
|
+
version: "22.2.0",
|
|
1341
|
+
ngImport: i0,
|
|
1342
|
+
type: HasPreviewPipe,
|
|
1343
|
+
decorators: [{
|
|
1344
|
+
type: Pipe,
|
|
1345
|
+
args: [{ name: "hasPreview" }]
|
|
1346
|
+
}]
|
|
1347
|
+
});
|
|
1348
|
+
var ItemEditorComponent = class ItemEditorComponent {
|
|
1349
|
+
itemLookupService;
|
|
1350
|
+
dialog;
|
|
1351
|
+
_router;
|
|
1352
|
+
_route;
|
|
1353
|
+
_snackbar;
|
|
1354
|
+
_appRepository;
|
|
1355
|
+
_repository;
|
|
1356
|
+
_itemService;
|
|
1357
|
+
_libraryRouteService;
|
|
1358
|
+
_dialogService;
|
|
1359
|
+
_authService;
|
|
1360
|
+
_userLevelService;
|
|
1361
|
+
_messaging;
|
|
1362
|
+
_envService;
|
|
1363
|
+
item;
|
|
1364
|
+
parts;
|
|
1365
|
+
partGroups;
|
|
1366
|
+
layerPartInfos;
|
|
1367
|
+
facet;
|
|
1368
|
+
newPartDefinitions;
|
|
1369
|
+
facets;
|
|
1370
|
+
typeThesaurus;
|
|
1371
|
+
previewJKeys;
|
|
1372
|
+
previewFKeys;
|
|
1373
|
+
flagDefinitions;
|
|
1374
|
+
id = signal(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
1375
|
+
_currentUser;
|
|
1376
|
+
user;
|
|
1377
|
+
userLevel;
|
|
1378
|
+
busy = signal(false, ...ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []);
|
|
1379
|
+
hasMetadataBuilders = signal(false, ...ngDevMode ? [{ debugName: "hasMetadataBuilders" }] : /* istanbul ignore next */ []);
|
|
1380
|
+
_flagsValue;
|
|
1381
|
+
flagSetFlags;
|
|
1382
|
+
adminFlagDefs;
|
|
1383
|
+
checkedFlagIds;
|
|
1384
|
+
newPartType;
|
|
1385
|
+
newPart;
|
|
1386
|
+
title;
|
|
1387
|
+
sortKey;
|
|
1388
|
+
description;
|
|
1389
|
+
facetCtrl;
|
|
1390
|
+
group;
|
|
1391
|
+
flags;
|
|
1392
|
+
metadata;
|
|
1393
|
+
constructor(itemLookupService, dialog, _router, _route, _snackbar, _appRepository, _repository, _itemService, _libraryRouteService, _dialogService, _authService, _userLevelService, _messaging, _envService, _formBuilder) {
|
|
1394
|
+
this.itemLookupService = itemLookupService;
|
|
1395
|
+
this.dialog = dialog;
|
|
1396
|
+
this._router = _router;
|
|
1397
|
+
this._route = _route;
|
|
1398
|
+
this._snackbar = _snackbar;
|
|
1399
|
+
this._appRepository = _appRepository;
|
|
1400
|
+
this._repository = _repository;
|
|
1401
|
+
this._itemService = _itemService;
|
|
1402
|
+
this._libraryRouteService = _libraryRouteService;
|
|
1403
|
+
this._dialogService = _dialogService;
|
|
1404
|
+
this._authService = _authService;
|
|
1405
|
+
this._userLevelService = _userLevelService;
|
|
1406
|
+
this._messaging = _messaging;
|
|
1407
|
+
this._envService = _envService;
|
|
1408
|
+
this.id.set(this._route.snapshot.params["id"]);
|
|
1409
|
+
if (this.id() === "new") this.id.set(void 0);
|
|
1410
|
+
this.hasMetadataBuilders.set(String(this._envService.get("hasMetadataBuilders")) === "true");
|
|
1411
|
+
this.newPartType = _formBuilder.control(null, Validators.required);
|
|
1412
|
+
this.newPart = _formBuilder.group({ newPartType: this.newPartType });
|
|
1413
|
+
this.title = _formBuilder.control(null, [Validators.required, Validators.maxLength(500)]);
|
|
1414
|
+
this.sortKey = _formBuilder.control(null, [Validators.required, Validators.maxLength(500)]);
|
|
1415
|
+
this.sortKey.disable();
|
|
1416
|
+
this.description = _formBuilder.control(null, [Validators.required, Validators.maxLength(1e3)]);
|
|
1417
|
+
this.facetCtrl = _formBuilder.control(null, Validators.required);
|
|
1418
|
+
this.group = _formBuilder.control(null, Validators.maxLength(100));
|
|
1419
|
+
this.flags = _formBuilder.control(0, { nonNullable: true });
|
|
1420
|
+
this.metadata = _formBuilder.group({
|
|
1421
|
+
title: this.title,
|
|
1422
|
+
sortKey: this.sortKey,
|
|
1423
|
+
description: this.description,
|
|
1424
|
+
facet: this.facetCtrl,
|
|
1425
|
+
group: this.group,
|
|
1426
|
+
flags: this.flags
|
|
1427
|
+
});
|
|
1428
|
+
this.item = toSignal(this._repository.item$);
|
|
1429
|
+
this.parts = toSignal(this._repository.parts$, { requireSync: true });
|
|
1430
|
+
this.partGroups = toSignal(this._repository.partGroups$, { requireSync: true });
|
|
1431
|
+
this.layerPartInfos = toSignal(this._repository.layers$, { requireSync: true });
|
|
1432
|
+
this.facet = toSignal(this._repository.facet$);
|
|
1433
|
+
this.newPartDefinitions = toSignal(this._repository.newPartDefinitions$, { requireSync: true });
|
|
1434
|
+
this.facets = toSignal(this._appRepository.facets$, { requireSync: true });
|
|
1435
|
+
this.typeThesaurus = toSignal(this._appRepository.typeThesaurus$);
|
|
1436
|
+
this.previewJKeys = toSignal(this._appRepository.previewJKeys$, { requireSync: true });
|
|
1437
|
+
this.previewFKeys = toSignal(this._appRepository.previewFKeys$, { requireSync: true });
|
|
1438
|
+
this.flagDefinitions = toSignal(this._appRepository.flags$, { requireSync: true });
|
|
1439
|
+
this._currentUser = toSignal(this._authService.currentUser$, { initialValue: null });
|
|
1440
|
+
this.user = computed(() => this._currentUser() ?? void 0, ...ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []);
|
|
1441
|
+
this.userLevel = computed(() => {
|
|
1442
|
+
this._currentUser();
|
|
1443
|
+
return this._userLevelService.getCurrentUserLevel();
|
|
1444
|
+
}, ...ngDevMode ? [{ debugName: "userLevel" }] : /* istanbul ignore next */ []);
|
|
1445
|
+
this._flagsValue = toSignal(this.flags.valueChanges, { initialValue: 0 });
|
|
1446
|
+
this.flagSetFlags = computed(() => this.flagDefinitions().filter((def) => this.userLevel() >= 4 || !def.isAdmin).map((def) => ({
|
|
1447
|
+
id: String(def.id),
|
|
1448
|
+
label: def.label,
|
|
1449
|
+
color: "#" + def.colorKey
|
|
1450
|
+
})), ...ngDevMode ? [{ debugName: "flagSetFlags" }] : /* istanbul ignore next */ []);
|
|
1451
|
+
this.adminFlagDefs = computed(() => {
|
|
1452
|
+
if (this.userLevel() >= 4) return [];
|
|
1453
|
+
return this.flagDefinitions().filter((def) => def.isAdmin === true);
|
|
1454
|
+
}, ...ngDevMode ? [{ debugName: "adminFlagDefs" }] : /* istanbul ignore next */ []);
|
|
1455
|
+
this.checkedFlagIds = computed(() => {
|
|
1456
|
+
const value = this._flagsValue();
|
|
1457
|
+
return this.flagDefinitions().filter((def) => (value & def.id) !== 0).map((def) => String(def.id));
|
|
1458
|
+
}, ...ngDevMode ? [{ debugName: "checkedFlagIds" }] : /* istanbul ignore next */ []);
|
|
1459
|
+
effect(() => {
|
|
1460
|
+
this.updateMetadataForm(this.item());
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
ngOnInit() {
|
|
1464
|
+
this._repository.load(this.id());
|
|
1465
|
+
}
|
|
1466
|
+
canDeactivate() {
|
|
1467
|
+
return !this.metadata.dirty;
|
|
1468
|
+
}
|
|
1469
|
+
updateMetadataForm(item) {
|
|
1470
|
+
if (!item) this.metadata.reset();
|
|
1471
|
+
else {
|
|
1472
|
+
this.title.setValue(item.title);
|
|
1473
|
+
this.sortKey.setValue(item.sortKey);
|
|
1474
|
+
this.description.setValue(item.description);
|
|
1475
|
+
this.facetCtrl.setValue(item.facetId ?? null);
|
|
1476
|
+
this.group.setValue(item.groupId ?? null);
|
|
1477
|
+
this.flags.setValue(item.flags);
|
|
1478
|
+
this.metadata.markAsPristine();
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
onFlagCheckedIdsChange(ids) {
|
|
1482
|
+
let value = 0;
|
|
1483
|
+
if (this.userLevel() < 4) {
|
|
1484
|
+
const current = this.flags.value;
|
|
1485
|
+
for (const def of this.flagDefinitions()) if (def.isAdmin && (current & def.id) !== 0) value |= def.id;
|
|
1486
|
+
}
|
|
1487
|
+
for (const id of ids) value |= Number(id);
|
|
1488
|
+
this.flags.setValue(value);
|
|
1489
|
+
this.flags.markAsDirty();
|
|
1490
|
+
}
|
|
1491
|
+
getTypeIdName(typeId) {
|
|
1492
|
+
const typeThesaurus = this._appRepository.getTypeThesaurus();
|
|
1493
|
+
if (!typeThesaurus) return typeId;
|
|
1494
|
+
const i = typeId.lastIndexOf(":");
|
|
1495
|
+
if (i > -1) typeId = typeId.substring(0, i);
|
|
1496
|
+
const entry = typeThesaurus.entries?.find((e) => e.id === typeId);
|
|
1497
|
+
return entry ? entry.value : typeId;
|
|
1498
|
+
}
|
|
1499
|
+
getRoleIdName(roleId) {
|
|
1500
|
+
if (!roleId || !roleId.startsWith("fr.")) return roleId;
|
|
1501
|
+
return this.getTypeIdName(roleId);
|
|
1502
|
+
}
|
|
1503
|
+
save() {
|
|
1504
|
+
if (this.busy() || !this.metadata.valid) return;
|
|
1505
|
+
const currentItem = this._repository.getItem();
|
|
1506
|
+
if (!currentItem) return;
|
|
1507
|
+
const item = { ...currentItem };
|
|
1508
|
+
item.title = this.title.value?.trim() || "";
|
|
1509
|
+
item.sortKey = this.sortKey.value?.trim() || "";
|
|
1510
|
+
item.description = this.description.value?.trim() || "";
|
|
1511
|
+
item.facetId = this.facetCtrl.value?.trim() || "";
|
|
1512
|
+
item.groupId = this.group.value?.trim() || "";
|
|
1513
|
+
item.flags = this.flags.value;
|
|
1514
|
+
this.busy.set(true);
|
|
1515
|
+
this._repository.save(item).then((saved) => {
|
|
1516
|
+
this._messaging.sendMessage(MESSAGE_ITEM_LIST_REPOSITORY_RESET);
|
|
1517
|
+
this.metadata.markAsPristine();
|
|
1518
|
+
if (!item.id) {
|
|
1519
|
+
this.id.set(saved.id);
|
|
1520
|
+
this._router.navigate(["/items", saved.id]);
|
|
1521
|
+
}
|
|
1522
|
+
}).finally(() => {
|
|
1523
|
+
this.busy.set(false);
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
partExists(typeId, roleId) {
|
|
1527
|
+
const groups = this._repository.getPartGroups();
|
|
1528
|
+
if (!groups) return false;
|
|
1529
|
+
return groups.some((g) => {
|
|
1530
|
+
return g.parts.some((p) => p.typeId === typeId && (!p.roleId && !roleId || p.roleId === roleId));
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
getPartIdName(typeId, roleId) {
|
|
1534
|
+
return getPartIdName(typeId, roleId, this._appRepository.getTypeThesaurus());
|
|
1535
|
+
}
|
|
1536
|
+
addPart(def) {
|
|
1537
|
+
if (!def && !this.newPartType.valid) return;
|
|
1538
|
+
if (!this.id()) {
|
|
1539
|
+
this._snackbar.open("Please save the item before adding parts", "OK", { duration: 3e3 });
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
const typeId = def ? def.typeId : this.newPartType.value.typeId;
|
|
1543
|
+
const roleId = def ? def.roleId : this.newPartType.value.roleId;
|
|
1544
|
+
if (this.partExists(typeId, roleId)) return;
|
|
1545
|
+
const route = this._libraryRouteService.buildPartEditorRoute(this.id(), "new", typeId, roleId);
|
|
1546
|
+
this._router.navigate([route.route], route.rid ? { queryParams: { rid: route.rid } } : {});
|
|
1547
|
+
}
|
|
1548
|
+
editPart(part) {
|
|
1549
|
+
const route = this._libraryRouteService.buildPartEditorRoute(part.itemId, part.id, part.typeId, part.roleId);
|
|
1550
|
+
this._router.navigate([route.route], route.rid ? { queryParams: { rid: route.rid } } : {});
|
|
1551
|
+
}
|
|
1552
|
+
previewPart(part) {
|
|
1553
|
+
if (part.roleId?.startsWith("fr.")) this._itemService.getBaseTextPart(part.itemId).pipe(take(1)).subscribe((p) => {
|
|
1554
|
+
this._router.navigate([
|
|
1555
|
+
"preview",
|
|
1556
|
+
part.itemId,
|
|
1557
|
+
p.part.id,
|
|
1558
|
+
"text"
|
|
1559
|
+
], { queryParams: { lid: part.roleId } });
|
|
1560
|
+
});
|
|
1561
|
+
else if (part.roleId === "base-text") this._router.navigate([
|
|
1562
|
+
"preview",
|
|
1563
|
+
part.itemId,
|
|
1564
|
+
part.id,
|
|
1565
|
+
"text"
|
|
1566
|
+
]);
|
|
1567
|
+
else this._router.navigate([
|
|
1568
|
+
"preview",
|
|
1569
|
+
part.itemId,
|
|
1570
|
+
part.id
|
|
1571
|
+
]);
|
|
1572
|
+
}
|
|
1573
|
+
deletePart(part) {
|
|
1574
|
+
if (this.busy()) return;
|
|
1575
|
+
this._dialogService.confirm("Confirm Deletion", `Delete part "${part.typeId}"?`).subscribe((result) => {
|
|
1576
|
+
if (!result) return;
|
|
1577
|
+
this.busy.set(true);
|
|
1578
|
+
this._repository.deletePart(part.id).then((_) => {
|
|
1579
|
+
this.busy.set(false);
|
|
1580
|
+
}, (error) => {
|
|
1581
|
+
this.busy.set(false);
|
|
1582
|
+
console.error(error);
|
|
1583
|
+
this._snackbar.open("Error deleting part", "OK");
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
addLayerPart(part) {
|
|
1588
|
+
if (this.busy()) return;
|
|
1589
|
+
let name = this.getTypeIdName(part.typeId);
|
|
1590
|
+
if (part.roleId) name += " for " + this.getRoleIdName(part.roleId);
|
|
1591
|
+
this._dialogService.confirm("Confirm Addition", `Add layer "${name}"?`).subscribe((result) => {
|
|
1592
|
+
if (!result) return;
|
|
1593
|
+
this.busy.set(true);
|
|
1594
|
+
this._repository.addNewLayerPart(part.typeId, part.roleId).finally(() => this.busy.set(false));
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
setPartsScope(request) {
|
|
1598
|
+
this._repository.setPartThesaurusScope(request.ids, request.scope);
|
|
1599
|
+
}
|
|
1600
|
+
onCopyPart(part) {
|
|
1601
|
+
if (this.busy()) return;
|
|
1602
|
+
this.dialog.open(ItemLookupDialogComponent, {
|
|
1603
|
+
height: "180px",
|
|
1604
|
+
width: "250px",
|
|
1605
|
+
data: {}
|
|
1606
|
+
}).afterClosed().subscribe((targetItem) => {
|
|
1607
|
+
if (!targetItem || part.itemId === targetItem.id) return;
|
|
1608
|
+
if (this.facetCtrl.value !== targetItem.facetId) {
|
|
1609
|
+
this._snackbar.open("Cannot copy part to an item with a different facet", "OK");
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
this.busy.set(true);
|
|
1613
|
+
this._itemService.partWithTypeAndRoleExists(targetItem.id, part.typeId, part.roleId).subscribe((exists) => {
|
|
1614
|
+
if (exists) {
|
|
1615
|
+
this._snackbar.open("Part already exists in target item", "OK");
|
|
1616
|
+
this.busy.set(false);
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
part.id = "";
|
|
1620
|
+
part.itemId = targetItem.id;
|
|
1621
|
+
this._itemService.addPart(part).subscribe({
|
|
1622
|
+
next: (_) => {
|
|
1623
|
+
this._snackbar.open("Part copied", "OK", { duration: 3e3 });
|
|
1624
|
+
},
|
|
1625
|
+
error: (error) => {
|
|
1626
|
+
console.error(error);
|
|
1627
|
+
this._snackbar.open("Error copying part", "OK");
|
|
1628
|
+
},
|
|
1629
|
+
complete: () => {
|
|
1630
|
+
this.busy.set(false);
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
});
|
|
1634
|
+
});
|
|
1635
|
+
}
|
|
1636
|
+
onGenerateItems() {
|
|
1637
|
+
if (this.busy()) return;
|
|
1638
|
+
this.dialog.open(ItemGenerateDialogComponent, {
|
|
1639
|
+
height: "400px",
|
|
1640
|
+
width: "350px",
|
|
1641
|
+
data: { flags: this.flagDefinitions() }
|
|
1642
|
+
}).afterClosed().subscribe((data) => {
|
|
1643
|
+
if (!data) return;
|
|
1644
|
+
this.busy.set(true);
|
|
1645
|
+
this._itemService.generateItems(data.count, this.id(), data.title, data.flags).subscribe({
|
|
1646
|
+
next: (_) => {
|
|
1647
|
+
this._messaging.sendMessage(MESSAGE_ITEM_LIST_REPOSITORY_RESET);
|
|
1648
|
+
this._snackbar.open("Items generated", "OK", { duration: 3e3 });
|
|
1649
|
+
},
|
|
1650
|
+
error: (error) => {
|
|
1651
|
+
console.error(error);
|
|
1652
|
+
this._snackbar.open("Error generating items", "OK");
|
|
1653
|
+
},
|
|
1654
|
+
complete: () => {
|
|
1655
|
+
this.busy.set(false);
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
generateTitle() {
|
|
1661
|
+
if (this.busy()) return;
|
|
1662
|
+
this.busy.set(true);
|
|
1663
|
+
this._itemService.getItemMetadata(this.id(), "T").subscribe({
|
|
1664
|
+
next: (title) => {
|
|
1665
|
+
const result = title["T"];
|
|
1666
|
+
if (result) {
|
|
1667
|
+
this.title.setValue(result);
|
|
1668
|
+
this.title.markAsDirty();
|
|
1669
|
+
this.title.updateValueAndValidity();
|
|
1670
|
+
} else this._snackbar.open("No title generated", "OK", { duration: 3e3 });
|
|
1671
|
+
},
|
|
1672
|
+
error: (error) => {
|
|
1673
|
+
console.error(error);
|
|
1674
|
+
this._snackbar.open("Error generating title", "OK");
|
|
1675
|
+
},
|
|
1676
|
+
complete: () => {
|
|
1677
|
+
this.busy.set(false);
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
generateDescription() {
|
|
1682
|
+
if (this.busy()) return;
|
|
1683
|
+
this.busy.set(true);
|
|
1684
|
+
this._itemService.getItemMetadata(this.id(), "D").subscribe({
|
|
1685
|
+
next: (description) => {
|
|
1686
|
+
const result = description["D"];
|
|
1687
|
+
if (result) {
|
|
1688
|
+
this.description.setValue(result);
|
|
1689
|
+
this.description.markAsDirty();
|
|
1690
|
+
this.description.updateValueAndValidity();
|
|
1691
|
+
} else this._snackbar.open("No description generated", "OK", { duration: 3e3 });
|
|
1692
|
+
},
|
|
1693
|
+
error: (error) => {
|
|
1694
|
+
console.error(error);
|
|
1695
|
+
this._snackbar.open("Error generating description", "OK");
|
|
1696
|
+
},
|
|
1697
|
+
complete: () => {
|
|
1698
|
+
this.busy.set(false);
|
|
1699
|
+
}
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1703
|
+
minVersion: "12.0.0",
|
|
1704
|
+
version: "22.2.0",
|
|
1705
|
+
ngImport: i0,
|
|
1706
|
+
type: ItemEditorComponent,
|
|
1707
|
+
deps: [
|
|
1708
|
+
{ token: i2.ItemRefLookupService },
|
|
1709
|
+
{ token: i1.MatDialog },
|
|
1710
|
+
{ token: i3.Router },
|
|
1711
|
+
{ token: i3.ActivatedRoute },
|
|
1712
|
+
{ token: i4.MatSnackBar },
|
|
1713
|
+
{ token: i1$2.AppRepository },
|
|
1714
|
+
{ token: EditedItemRepository },
|
|
1715
|
+
{ token: i2$1.ItemService },
|
|
1716
|
+
{ token: i8.LibraryRouteService },
|
|
1717
|
+
{ token: i3$1.DialogService },
|
|
1718
|
+
{ token: i10.AuthJwtService },
|
|
1719
|
+
{ token: i2$1.UserLevelService },
|
|
1720
|
+
{ token: i2$1.MessagingService },
|
|
1721
|
+
{ token: i5.EnvService },
|
|
1722
|
+
{ token: i1$1.FormBuilder }
|
|
1723
|
+
],
|
|
1724
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1725
|
+
});
|
|
1726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1727
|
+
minVersion: "17.0.0",
|
|
1728
|
+
version: "22.2.0",
|
|
1729
|
+
type: ItemEditorComponent,
|
|
1730
|
+
isStandalone: true,
|
|
1731
|
+
selector: "cadmus-item-editor",
|
|
1732
|
+
ngImport: i0,
|
|
1733
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-content>\r\n <div>\r\n <cadmus-current-item-bar />\r\n </div>\r\n @if (busy()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id() ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- title -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>title</mat-label>\r\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\r\n @if (\r\n title.hasError(\"required\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>enter title</mat-error>\r\n }\r\n @if (\r\n title.hasError(\"maxLength\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>title too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto title -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateTitle()\"\r\n >\r\n <mat-icon matTooltip=\"Generate title\">auto_awesome</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- sortKey -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>sort key</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n [formControl]=\"sortKey\"\r\n />\r\n @if (\r\n sortKey.hasError(\"required\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>enter sort key</mat-error>\r\n }\r\n @if (\r\n sortKey.hasError(\"maxLength\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>sort key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div class=\"flex-row\">\r\n <mat-form-field class=\"item\">\r\n <mat-label>description</mat-label>\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n [formControl]=\"description\"\r\n ></textarea>\r\n @if (\r\n description.hasError(\"required\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>enter description</mat-error>\r\n }\r\n @if (\r\n description.hasError(\"maxLength\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto description -->\r\n <button\r\n class=\"item fit\"\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateDescription()\"\r\n >\r\n <mat-icon matTooltip=\"Generate description\"\r\n >auto_awesome</mat-icon\r\n >\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- facet -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>facet</mat-label>\r\n <mat-select [formControl]=\"facetCtrl\" required=\"true\">\r\n @for (f of facets(); track f.id) {\r\n <mat-option [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <mat-label>group ID</mat-label>\r\n <input matInput [formControl]=\"group\" />\r\n @if (\r\n group.hasError(\"maxLength\") && (group.dirty || group.touched)\r\n ) {\r\n <mat-error>too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <fieldset>\r\n <legend>flags</legend>\r\n <!-- read-only admin flags for non-admin users -->\r\n @if (adminFlagDefs().length) {\r\n <div class=\"admin-flags\">\r\n @for (def of adminFlagDefs(); track def.id) {\r\n <span class=\"admin-flag\">\r\n <span [style.color]=\"'#' + def.colorKey\">◆</span>\r\n {{ def.label }}\r\n </span>\r\n }\r\n </div>\r\n }\r\n <!-- editable flags -->\r\n @if (flagSetFlags().length) {\r\n <cadmus-ui-flag-set\r\n [hideToolbar]=\"true\"\r\n [flags]=\"flagSetFlags()\"\r\n [checkedIds]=\"checkedFlagIds()\"\r\n (checkedIdsChange)=\"onFlagCheckedIdsChange($event)\"\r\n />\r\n }\r\n </fieldset>\r\n <br />\r\n\r\n <!-- action buttons -->\r\n @if (userLevel() > 1) {\r\n <div class=\"form-row\">\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n class=\"mat-warn\"\r\n (click)=\"onGenerateItems()\"\r\n >\r\n <mat-icon>copy_all</mat-icon> generate\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n [disabled]=\"busy()\"\r\n matTooltip=\"Save metadata\"\r\n (click)=\"save()\"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n }\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n @if (id()) {\r\n <mat-tab label=\"Parts\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\" class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>part</mat-label>\r\n <mat-select [formControl]=\"newPartType\" required>\r\n @for (\r\n p of newPartDefinitions();\r\n track p.typeId + \":\" + (p.roleId || \"\")\r\n ) {\r\n <mat-option [value]=\"p\">\r\n <span\r\n [style.color]=\"'#' + p.colorKey\"\r\n class=\"new-part-icon\"\r\n >⬤</span\r\n >\r\n {{ getPartIdName(p.typeId, p.roleId) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n <button\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy() || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n part\r\n </button>\r\n </form>\r\n </div>\r\n <mat-divider></mat-divider>\r\n @for (group of partGroups(); track group.key) {\r\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n <table class=\"parts-table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th class=\"noif-lt-xs\">modified</th>\r\n <th class=\"noif-lt-xs\">user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of group.parts;\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <!-- edit -->\r\n <td class=\"fit-width\">\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"busy()\"\r\n (click)=\"editPart(part)\"\r\n matTooltip=\"Edit this part\"\r\n >\r\n <mat-icon class=\"mat-primary\">create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n @if (\r\n user()?.roles?.length &&\r\n (user()?.roles?.includes(\"admin\") ||\r\n user()?.roles?.includes(\"editor\") ||\r\n user()?.roles?.includes(\"operator\"))\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy()\"\r\n (click)=\"deletePart(part)\"\r\n matTooltip=\"Delete this part\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n <!-- copy ID -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n <!-- copy into item -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy part into another item\"\r\n (click)=\"onCopyPart(part)\"\r\n >\r\n <mat-icon>open_in_new</mat-icon>\r\n </button>\r\n <!-- preview -->\r\n @if (\r\n part | hasPreview: previewJKeys() : previewFKeys()\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Preview this part\"\r\n (click)=\"previewPart(part)\"\r\n >\r\n <mat-icon>preview</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td class=\"noif-lt-xs\">\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </td>\r\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n }\r\n <cadmus-missing-parts\r\n [facetDefinition]=\"facet()\"\r\n [partDefinitions]=\"\r\n $safeNavigationMigration(facet()?.partDefinitions)\r\n \"\r\n [parts]=\"parts()\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n (addRequest)=\"addPart($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n\r\n <!-- layers -->\r\n @if (id()) {\r\n <mat-tab label=\"Layers\">\r\n <table id=\"layers\">\r\n <thead>\r\n <th aria-label=\"actions\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of layerPartInfos();\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <td class=\"fit-width\">\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td\r\n [class.count-n]=\"part.fragmentCount\"\r\n [class.count-z]=\"!part.fragmentCount\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n @if (!part.isAbsent) {\r\n <span>\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </span>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n }\r\n\r\n <!-- thesaurus scopes -->\r\n @if (parts().length) {\r\n <mat-tab label=\"Th-Scopes\">\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts()\"\r\n [readonly]=\"userLevel() < 2 || busy() ? true : false\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n",
|
|
1734
|
+
styles: [".full-width{width:100%}.flex-field{flex:1 0 auto}table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}table#layers td{padding:0 6px}table#layers th{text-align:left}div.new-part{margin-left:32px}span.new-part-role{color:var(--mat-sys-on-surface-variant);margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:var(--mat-sys-success)}td.count-z{text-align:center;color:var(--mat-sys-error)}input.id{font-family:Courier New,Courier,monospace;color:var(--mat-sys-on-surface-variant);min-width:22em}.admin-flags{margin-bottom:4px}.admin-flag{margin-left:12px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{margin-top:6px}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width:599px){.noif-lt-xs{display:none}}.flex-row{display:flex;flex-wrap:wrap}.flex-row .item{box-sizing:border-box}.flex-row .item.fit{flex:0 0 auto}.flex-row .item:not(.fit){flex:1 1 auto}\n"],
|
|
1735
|
+
dependencies: [
|
|
1736
|
+
{
|
|
1737
|
+
kind: "component",
|
|
1738
|
+
type: MatCard,
|
|
1739
|
+
selector: "mat-card",
|
|
1740
|
+
inputs: ["appearance"],
|
|
1741
|
+
exportAs: ["matCard"]
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
kind: "directive",
|
|
1745
|
+
type: MatCardContent,
|
|
1746
|
+
selector: "mat-card-content"
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
kind: "directive",
|
|
1750
|
+
type: MatTooltip,
|
|
1751
|
+
selector: "[matTooltip]",
|
|
1752
|
+
inputs: [
|
|
1753
|
+
"matTooltipPosition",
|
|
1754
|
+
"matTooltipPositionAtOrigin",
|
|
1755
|
+
"matTooltipDisabled",
|
|
1756
|
+
"matTooltipShowDelay",
|
|
1757
|
+
"matTooltipHideDelay",
|
|
1758
|
+
"matTooltipTouchGestures",
|
|
1759
|
+
"matTooltip",
|
|
1760
|
+
"matTooltipClass"
|
|
1761
|
+
],
|
|
1762
|
+
exportAs: ["matTooltip"]
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
kind: "directive",
|
|
1766
|
+
type: CdkCopyToClipboard,
|
|
1767
|
+
selector: "[cdkCopyToClipboard]",
|
|
1768
|
+
inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"],
|
|
1769
|
+
outputs: ["cdkCopyToClipboardCopied"]
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
kind: "component",
|
|
1773
|
+
type: MatProgressBar,
|
|
1774
|
+
selector: "mat-progress-bar",
|
|
1775
|
+
inputs: [
|
|
1776
|
+
"color",
|
|
1777
|
+
"value",
|
|
1778
|
+
"bufferValue",
|
|
1779
|
+
"mode"
|
|
1780
|
+
],
|
|
1781
|
+
outputs: ["animationEnd"],
|
|
1782
|
+
exportAs: ["matProgressBar"]
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
kind: "component",
|
|
1786
|
+
type: MatTabGroup,
|
|
1787
|
+
selector: "mat-tab-group",
|
|
1788
|
+
inputs: [
|
|
1789
|
+
"color",
|
|
1790
|
+
"fitInkBarToContent",
|
|
1791
|
+
"mat-stretch-tabs",
|
|
1792
|
+
"mat-align-tabs",
|
|
1793
|
+
"dynamicHeight",
|
|
1794
|
+
"selectedIndex",
|
|
1795
|
+
"headerPosition",
|
|
1796
|
+
"animationDuration",
|
|
1797
|
+
"contentTabIndex",
|
|
1798
|
+
"disablePagination",
|
|
1799
|
+
"disableRipple",
|
|
1800
|
+
"preserveContent",
|
|
1801
|
+
"backgroundColor",
|
|
1802
|
+
"aria-label",
|
|
1803
|
+
"aria-labelledby"
|
|
1804
|
+
],
|
|
1805
|
+
outputs: [
|
|
1806
|
+
"selectedIndexChange",
|
|
1807
|
+
"focusChange",
|
|
1808
|
+
"animationDone",
|
|
1809
|
+
"selectedTabChange"
|
|
1810
|
+
],
|
|
1811
|
+
exportAs: ["matTabGroup"]
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
kind: "component",
|
|
1815
|
+
type: MatTab,
|
|
1816
|
+
selector: "mat-tab",
|
|
1817
|
+
inputs: [
|
|
1818
|
+
"disabled",
|
|
1819
|
+
"label",
|
|
1820
|
+
"aria-label",
|
|
1821
|
+
"aria-labelledby",
|
|
1822
|
+
"labelClass",
|
|
1823
|
+
"bodyClass",
|
|
1824
|
+
"id"
|
|
1825
|
+
],
|
|
1826
|
+
exportAs: ["matTab"]
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
kind: "ngmodule",
|
|
1830
|
+
type: ReactiveFormsModule
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
kind: "directive",
|
|
1834
|
+
type: i1$1.ɵNgNoValidate,
|
|
1835
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
kind: "directive",
|
|
1839
|
+
type: i1$1.DefaultValueAccessor,
|
|
1840
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
kind: "directive",
|
|
1844
|
+
type: i1$1.NgControlStatus,
|
|
1845
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
1846
|
+
},
|
|
1847
|
+
{
|
|
1848
|
+
kind: "directive",
|
|
1849
|
+
type: i1$1.NgControlStatusGroup,
|
|
1850
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
kind: "directive",
|
|
1854
|
+
type: i1$1.RequiredValidator,
|
|
1855
|
+
selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
|
|
1856
|
+
inputs: ["required"]
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
kind: "directive",
|
|
1860
|
+
type: i1$1.FormControlDirective,
|
|
1861
|
+
selector: "[formControl]",
|
|
1862
|
+
inputs: [
|
|
1863
|
+
"formControl",
|
|
1864
|
+
"disabled",
|
|
1865
|
+
"ngModel"
|
|
1866
|
+
],
|
|
1867
|
+
outputs: ["ngModelChange"],
|
|
1868
|
+
exportAs: ["ngForm"]
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
kind: "directive",
|
|
1872
|
+
type: i1$1.FormGroupDirective,
|
|
1873
|
+
selector: "[formGroup]",
|
|
1874
|
+
inputs: ["formGroup"],
|
|
1875
|
+
outputs: ["ngSubmit"],
|
|
1876
|
+
exportAs: ["ngForm"]
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
kind: "component",
|
|
1880
|
+
type: MatFormField,
|
|
1881
|
+
selector: "mat-form-field",
|
|
1882
|
+
inputs: [
|
|
1883
|
+
"hideRequiredMarker",
|
|
1884
|
+
"color",
|
|
1885
|
+
"floatLabel",
|
|
1886
|
+
"appearance",
|
|
1887
|
+
"subscriptSizing",
|
|
1888
|
+
"hintLabel"
|
|
1889
|
+
],
|
|
1890
|
+
exportAs: ["matFormField"]
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
kind: "directive",
|
|
1894
|
+
type: MatLabel,
|
|
1895
|
+
selector: "mat-label"
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
kind: "directive",
|
|
1899
|
+
type: MatInput,
|
|
1900
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
1901
|
+
inputs: [
|
|
1902
|
+
"disabled",
|
|
1903
|
+
"id",
|
|
1904
|
+
"placeholder",
|
|
1905
|
+
"name",
|
|
1906
|
+
"required",
|
|
1907
|
+
"type",
|
|
1908
|
+
"errorStateMatcher",
|
|
1909
|
+
"aria-describedby",
|
|
1910
|
+
"value",
|
|
1911
|
+
"readonly",
|
|
1912
|
+
"disabledInteractive"
|
|
1913
|
+
],
|
|
1914
|
+
exportAs: ["matInput"]
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
kind: "directive",
|
|
1918
|
+
type: MatError,
|
|
1919
|
+
selector: "mat-error, [matError]",
|
|
1920
|
+
inputs: ["id"]
|
|
1921
|
+
},
|
|
1922
|
+
{
|
|
1923
|
+
kind: "component",
|
|
1924
|
+
type: MatSelect,
|
|
1925
|
+
selector: "mat-select",
|
|
1926
|
+
inputs: [
|
|
1927
|
+
"aria-describedby",
|
|
1928
|
+
"panelClass",
|
|
1929
|
+
"disabled",
|
|
1930
|
+
"disableRipple",
|
|
1931
|
+
"tabIndex",
|
|
1932
|
+
"hideSingleSelectionIndicator",
|
|
1933
|
+
"placeholder",
|
|
1934
|
+
"required",
|
|
1935
|
+
"multiple",
|
|
1936
|
+
"disableOptionCentering",
|
|
1937
|
+
"compareWith",
|
|
1938
|
+
"value",
|
|
1939
|
+
"aria-label",
|
|
1940
|
+
"aria-labelledby",
|
|
1941
|
+
"errorStateMatcher",
|
|
1942
|
+
"typeaheadDebounceInterval",
|
|
1943
|
+
"sortComparator",
|
|
1944
|
+
"id",
|
|
1945
|
+
"panelWidth",
|
|
1946
|
+
"canSelectNullableOptions"
|
|
1947
|
+
],
|
|
1948
|
+
outputs: [
|
|
1949
|
+
"openedChange",
|
|
1950
|
+
"opened",
|
|
1951
|
+
"closed",
|
|
1952
|
+
"selectionChange",
|
|
1953
|
+
"valueChange"
|
|
1954
|
+
],
|
|
1955
|
+
exportAs: ["matSelect"]
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
kind: "component",
|
|
1959
|
+
type: MatOption,
|
|
1960
|
+
selector: "mat-option",
|
|
1961
|
+
inputs: [
|
|
1962
|
+
"value",
|
|
1963
|
+
"id",
|
|
1964
|
+
"disabled"
|
|
1965
|
+
],
|
|
1966
|
+
outputs: ["onSelectionChange"],
|
|
1967
|
+
exportAs: ["matOption"]
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
kind: "component",
|
|
1971
|
+
type: MatButton,
|
|
1972
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
1973
|
+
inputs: ["matButton"],
|
|
1974
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
kind: "component",
|
|
1978
|
+
type: MatIcon,
|
|
1979
|
+
selector: "mat-icon",
|
|
1980
|
+
inputs: [
|
|
1981
|
+
"color",
|
|
1982
|
+
"inline",
|
|
1983
|
+
"svgIcon",
|
|
1984
|
+
"fontSet",
|
|
1985
|
+
"fontIcon"
|
|
1986
|
+
],
|
|
1987
|
+
exportAs: ["matIcon"]
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
kind: "component",
|
|
1991
|
+
type: MatDivider,
|
|
1992
|
+
selector: "mat-divider",
|
|
1993
|
+
inputs: ["vertical", "inset"]
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
kind: "component",
|
|
1997
|
+
type: MatExpansionPanel,
|
|
1998
|
+
selector: "mat-expansion-panel",
|
|
1999
|
+
inputs: ["hideToggle", "togglePosition"],
|
|
2000
|
+
outputs: ["afterExpand", "afterCollapse"],
|
|
2001
|
+
exportAs: ["matExpansionPanel"]
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
kind: "component",
|
|
2005
|
+
type: MatExpansionPanelHeader,
|
|
2006
|
+
selector: "mat-expansion-panel-header",
|
|
2007
|
+
inputs: [
|
|
2008
|
+
"expandedHeight",
|
|
2009
|
+
"collapsedHeight",
|
|
2010
|
+
"tabIndex"
|
|
2011
|
+
]
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
kind: "directive",
|
|
2015
|
+
type: MatExpansionPanelTitle,
|
|
2016
|
+
selector: "mat-panel-title"
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
kind: "directive",
|
|
2020
|
+
type: MatExpansionPanelDescription,
|
|
2021
|
+
selector: "mat-panel-description"
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
kind: "component",
|
|
2025
|
+
type: MatIconButton,
|
|
2026
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
2027
|
+
exportAs: ["matButton", "matAnchor"]
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
kind: "component",
|
|
2031
|
+
type: MissingPartsComponent,
|
|
2032
|
+
selector: "cadmus-missing-parts",
|
|
2033
|
+
inputs: [
|
|
2034
|
+
"facetDefinition",
|
|
2035
|
+
"partDefinitions",
|
|
2036
|
+
"parts",
|
|
2037
|
+
"typeThesaurus"
|
|
2038
|
+
],
|
|
2039
|
+
outputs: ["addRequest"]
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
kind: "component",
|
|
2043
|
+
type: PartsScopeEditorComponent,
|
|
2044
|
+
selector: "cadmus-parts-scope-editor",
|
|
2045
|
+
inputs: ["parts", "readonly"],
|
|
2046
|
+
outputs: ["setScopeRequest"]
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
kind: "component",
|
|
2050
|
+
type: PartBadgeComponent,
|
|
2051
|
+
selector: "cadmus-part-badge",
|
|
2052
|
+
inputs: [
|
|
2053
|
+
"badgeType",
|
|
2054
|
+
"typeThesaurus",
|
|
2055
|
+
"facetDefinition",
|
|
2056
|
+
"partTypeIds"
|
|
2057
|
+
]
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
kind: "component",
|
|
2061
|
+
type: CurrentItemBarComponent,
|
|
2062
|
+
selector: "cadmus-current-item-bar"
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
kind: "component",
|
|
2066
|
+
type: FlagSetComponent,
|
|
2067
|
+
selector: "cadmus-ui-flag-set",
|
|
2068
|
+
inputs: [
|
|
2069
|
+
"flags",
|
|
2070
|
+
"checkedIds",
|
|
2071
|
+
"allowCustom",
|
|
2072
|
+
"hideToolbar",
|
|
2073
|
+
"numbering"
|
|
2074
|
+
],
|
|
2075
|
+
outputs: ["checkedIdsChange"]
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
kind: "pipe",
|
|
2079
|
+
type: DatePipe,
|
|
2080
|
+
name: "date"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
kind: "pipe",
|
|
2084
|
+
type: HasPreviewPipe,
|
|
2085
|
+
name: "hasPreview"
|
|
2086
|
+
}
|
|
2087
|
+
],
|
|
2088
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2089
|
+
});
|
|
2090
|
+
};
|
|
2091
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2092
|
+
minVersion: "12.0.0",
|
|
2093
|
+
version: "22.2.0",
|
|
2094
|
+
ngImport: i0,
|
|
2095
|
+
type: ItemEditorComponent,
|
|
2096
|
+
decorators: [{
|
|
2097
|
+
type: Component,
|
|
2098
|
+
args: [{
|
|
2099
|
+
selector: "cadmus-item-editor",
|
|
2100
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2101
|
+
imports: [
|
|
2102
|
+
MatCard,
|
|
2103
|
+
MatCardContent,
|
|
2104
|
+
MatTooltip,
|
|
2105
|
+
CdkCopyToClipboard,
|
|
2106
|
+
MatProgressBar,
|
|
2107
|
+
MatTabGroup,
|
|
2108
|
+
MatTab,
|
|
2109
|
+
ReactiveFormsModule,
|
|
2110
|
+
MatFormField,
|
|
2111
|
+
MatLabel,
|
|
2112
|
+
MatInput,
|
|
2113
|
+
MatError,
|
|
2114
|
+
MatSelect,
|
|
2115
|
+
MatOption,
|
|
2116
|
+
MatButton,
|
|
2117
|
+
MatIcon,
|
|
2118
|
+
MatDivider,
|
|
2119
|
+
MatExpansionPanel,
|
|
2120
|
+
MatExpansionPanelHeader,
|
|
2121
|
+
MatExpansionPanelTitle,
|
|
2122
|
+
MatExpansionPanelDescription,
|
|
2123
|
+
MatIconButton,
|
|
2124
|
+
MissingPartsComponent,
|
|
2125
|
+
DatePipe,
|
|
2126
|
+
HasPreviewPipe,
|
|
2127
|
+
PartsScopeEditorComponent,
|
|
2128
|
+
PartBadgeComponent,
|
|
2129
|
+
CurrentItemBarComponent,
|
|
2130
|
+
FlagSetComponent
|
|
2131
|
+
],
|
|
2132
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-content>\r\n <div>\r\n <cadmus-current-item-bar />\r\n </div>\r\n @if (busy()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n\r\n <!-- item content -->\r\n <mat-tab-group [selectedIndex]=\"id() ? 1 : 0\">\r\n <!-- metadata -->\r\n <mat-tab label=\"Metadata\">\r\n <form [formGroup]=\"metadata\" (ngSubmit)=\"save()\">\r\n <div class=\"form-row\">\r\n <!-- title -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>title</mat-label>\r\n <input matInput type=\"text\" id=\"title\" [formControl]=\"title\" />\r\n @if (\r\n title.hasError(\"required\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>enter title</mat-error>\r\n }\r\n @if (\r\n title.hasError(\"maxLength\") && (title.touched || title.dirty)\r\n ) {\r\n <mat-error>title too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto title -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateTitle()\"\r\n >\r\n <mat-icon matTooltip=\"Generate title\">auto_awesome</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- sortKey -->\r\n <mat-form-field class=\"flex-field\">\r\n <mat-label>sort key</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"sortKey\"\r\n [formControl]=\"sortKey\"\r\n />\r\n @if (\r\n sortKey.hasError(\"required\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>enter sort key</mat-error>\r\n }\r\n @if (\r\n sortKey.hasError(\"maxLength\") &&\r\n (sortKey.touched || sortKey.dirty)\r\n ) {\r\n <mat-error>sort key too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- description -->\r\n <div class=\"flex-row\">\r\n <mat-form-field class=\"item\">\r\n <mat-label>description</mat-label>\r\n <textarea\r\n rows=\"2\"\r\n matInput\r\n id=\"description\"\r\n [formControl]=\"description\"\r\n ></textarea>\r\n @if (\r\n description.hasError(\"required\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>enter description</mat-error>\r\n }\r\n @if (\r\n description.hasError(\"maxLength\") &&\r\n (description.touched || description.dirty)\r\n ) {\r\n <mat-error>description too long</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n @if (hasMetadataBuilders()) {\r\n <!-- auto description -->\r\n <button\r\n class=\"item fit\"\r\n type=\"button\"\r\n mat-icon-button\r\n [disabled]=\"busy()\"\r\n (click)=\"generateDescription()\"\r\n >\r\n <mat-icon matTooltip=\"Generate description\"\r\n >auto_awesome</mat-icon\r\n >\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- facet -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>facet</mat-label>\r\n <mat-select [formControl]=\"facetCtrl\" required=\"true\">\r\n @for (f of facets(); track f.id) {\r\n <mat-option [value]=\"f.id\">\r\n {{ f.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>please select a facet</mat-error>\r\n </mat-form-field>\r\n\r\n <!-- group -->\r\n <mat-form-field>\r\n <mat-label>group ID</mat-label>\r\n <input matInput [formControl]=\"group\" />\r\n @if (\r\n group.hasError(\"maxLength\") && (group.dirty || group.touched)\r\n ) {\r\n <mat-error>too long</mat-error>\r\n }\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- flags -->\r\n <fieldset>\r\n <legend>flags</legend>\r\n <!-- read-only admin flags for non-admin users -->\r\n @if (adminFlagDefs().length) {\r\n <div class=\"admin-flags\">\r\n @for (def of adminFlagDefs(); track def.id) {\r\n <span class=\"admin-flag\">\r\n <span [style.color]=\"'#' + def.colorKey\">◆</span>\r\n {{ def.label }}\r\n </span>\r\n }\r\n </div>\r\n }\r\n <!-- editable flags -->\r\n @if (flagSetFlags().length) {\r\n <cadmus-ui-flag-set\r\n [hideToolbar]=\"true\"\r\n [flags]=\"flagSetFlags()\"\r\n [checkedIds]=\"checkedFlagIds()\"\r\n (checkedIdsChange)=\"onFlagCheckedIdsChange($event)\"\r\n />\r\n }\r\n </fieldset>\r\n <br />\r\n\r\n <!-- action buttons -->\r\n @if (userLevel() > 1) {\r\n <div class=\"form-row\">\r\n <button\r\n type=\"button\"\r\n mat-flat-button\r\n class=\"mat-warn\"\r\n (click)=\"onGenerateItems()\"\r\n >\r\n <mat-icon>copy_all</mat-icon> generate\r\n </button>\r\n <button\r\n type=\"submit\"\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n [disabled]=\"busy()\"\r\n matTooltip=\"Save metadata\"\r\n (click)=\"save()\"\r\n >\r\n <mat-icon>save</mat-icon> save\r\n </button>\r\n </div>\r\n }\r\n </form>\r\n </mat-tab>\r\n\r\n <!-- parts -->\r\n @if (id()) {\r\n <mat-tab label=\"Parts\">\r\n <div class=\"new-part\">\r\n <form [formGroup]=\"newPart\" class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label>part</mat-label>\r\n <mat-select [formControl]=\"newPartType\" required>\r\n @for (\r\n p of newPartDefinitions();\r\n track p.typeId + \":\" + (p.roleId || \"\")\r\n ) {\r\n <mat-option [value]=\"p\">\r\n <span\r\n [style.color]=\"'#' + p.colorKey\"\r\n class=\"new-part-icon\"\r\n >⬤</span\r\n >\r\n {{ getPartIdName(p.typeId, p.roleId) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-error>part type required</mat-error>\r\n </mat-form-field>\r\n <button\r\n mat-flat-button\r\n class=\"mat-primary\"\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy() || !newPart.valid\"\r\n (click)=\"addPart()\"\r\n matTooltip=\"Add a new part of the selected type\"\r\n >\r\n <mat-icon>add_circle</mat-icon>\r\n part\r\n </button>\r\n </form>\r\n </div>\r\n <mat-divider></mat-divider>\r\n @for (group of partGroups(); track group.key) {\r\n <mat-expansion-panel expanded=\"true\" class=\"group-header\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n ><strong>{{ group.label }}</strong></mat-panel-title\r\n >\r\n <mat-panel-description>{{\r\n group.parts.length\r\n }}</mat-panel-description>\r\n </mat-expansion-panel-header>\r\n <table class=\"parts-table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th class=\"noif-lt-xs\">modified</th>\r\n <th class=\"noif-lt-xs\">user</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of group.parts;\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <!-- edit -->\r\n <td class=\"fit-width\">\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"busy()\"\r\n (click)=\"editPart(part)\"\r\n matTooltip=\"Edit this part\"\r\n >\r\n <mat-icon class=\"mat-primary\">create</mat-icon>\r\n </button>\r\n <!-- delete -->\r\n @if (\r\n user()?.roles?.length &&\r\n (user()?.roles?.includes(\"admin\") ||\r\n user()?.roles?.includes(\"editor\") ||\r\n user()?.roles?.includes(\"operator\"))\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"userLevel() < 2 || busy()\"\r\n (click)=\"deletePart(part)\"\r\n matTooltip=\"Delete this part\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n <!-- copy ID -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n <!-- copy into item -->\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy part into another item\"\r\n (click)=\"onCopyPart(part)\"\r\n >\r\n <mat-icon>open_in_new</mat-icon>\r\n </button>\r\n <!-- preview -->\r\n @if (\r\n part | hasPreview: previewJKeys() : previewFKeys()\r\n ) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Preview this part\"\r\n (click)=\"previewPart(part)\"\r\n >\r\n <mat-icon>preview</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td class=\"noif-lt-xs\">\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </td>\r\n <td class=\"noif-lt-xs\">{{ part.userId }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-expansion-panel>\r\n }\r\n <cadmus-missing-parts\r\n [facetDefinition]=\"facet()\"\r\n [partDefinitions]=\"\r\n $safeNavigationMigration(facet()?.partDefinitions)\r\n \"\r\n [parts]=\"parts()\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n (addRequest)=\"addPart($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n\r\n <!-- layers -->\r\n @if (id()) {\r\n <mat-tab label=\"Layers\">\r\n <table id=\"layers\">\r\n <thead>\r\n <th aria-label=\"actions\"></th>\r\n <th>type</th>\r\n <th>role</th>\r\n <th>frr.</th>\r\n <th>last modified</th>\r\n </thead>\r\n <tbody>\r\n @for (\r\n part of layerPartInfos();\r\n track part.typeId + \":\" + (part.roleId || \"\")\r\n ) {\r\n <tr>\r\n <td class=\"fit-width\">\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Edit this layer part\"\r\n (click)=\"editPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"addLayerPart(part)\"\r\n >\r\n <mat-icon class=\"mat-primary\">add_circle</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Delete this layer part\"\r\n [disabled]=\"userLevel() < 2\"\r\n (click)=\"deletePart(part)\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete</mat-icon>\r\n </button>\r\n }\r\n @if (!part.isAbsent) {\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Copy this part ID\"\r\n [cdkCopyToClipboard]=\"part.id\"\r\n >\r\n <mat-icon>assignment</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"1\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td>\r\n <cadmus-part-badge\r\n [partTypeIds]=\"part\"\r\n [facetDefinition]=\"facet()\"\r\n [badgeType]=\"2\"\r\n [typeThesaurus]=\"typeThesaurus()\"\r\n />\r\n </td>\r\n <td\r\n [class.count-n]=\"part.fragmentCount\"\r\n [class.count-z]=\"!part.fragmentCount\"\r\n >\r\n {{ part.fragmentCount }}\r\n </td>\r\n <td>\r\n @if (!part.isAbsent) {\r\n <span>\r\n {{ part.timeModified | date: \"yyyy-MM-dd HH:mm:ss\" }}\r\n </span>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </mat-tab>\r\n }\r\n\r\n <!-- thesaurus scopes -->\r\n @if (parts().length) {\r\n <mat-tab label=\"Th-Scopes\">\r\n <cadmus-parts-scope-editor\r\n [parts]=\"parts()\"\r\n [readonly]=\"userLevel() < 2 || busy() ? true : false\"\r\n (setScopeRequest)=\"setPartsScope($event)\"\r\n />\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n </mat-card-content>\r\n</mat-card>\r\n",
|
|
2133
|
+
styles: [".full-width{width:100%}.flex-field{flex:1 0 auto}table{width:100%;border-collapse:collapse;color:var(--mat-sys-on-surface-variant)}tbody tr:nth-child(odd){background-color:var(--mat-sys-surface-container)}th{text-align:left;font-weight:400;color:var(--mat-sys-on-surface-variant)}tbody tr:hover{background-color:var(--mat-sys-surface-container-high)}td.fit-width{width:1px;white-space:nowrap}tbody tr.selected{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}table#layers td{padding:0 6px}table#layers th{text-align:left}div.new-part{margin-left:32px}span.new-part-role{color:var(--mat-sys-on-surface-variant);margin-left:8px;vertical-align:middle}span.new-part-icon{margin:0 4px;vertical-align:middle}td.count-n{text-align:center;color:var(--mat-sys-success)}td.count-z{text-align:center;color:var(--mat-sys-error)}input.id{font-family:Courier New,Courier,monospace;color:var(--mat-sys-on-surface-variant);min-width:22em}.admin-flags{margin-bottom:4px}.admin-flag{margin-left:12px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}.group-header{margin-top:6px}table.parts-table{width:100%}table.parts-table th{text-align:left}fieldset{border:1px solid var(--mat-sys-on-surface-variant);border-radius:6px;padding:6px;margin:8px 0}@media only screen and (max-width:599px){.noif-lt-xs{display:none}}.flex-row{display:flex;flex-wrap:wrap}.flex-row .item{box-sizing:border-box}.flex-row .item.fit{flex:0 0 auto}.flex-row .item:not(.fit){flex:1 1 auto}\n"]
|
|
2134
|
+
}]
|
|
2135
|
+
}],
|
|
2136
|
+
ctorParameters: () => [
|
|
2137
|
+
{ type: i2.ItemRefLookupService },
|
|
2138
|
+
{ type: i1.MatDialog },
|
|
2139
|
+
{ type: i3.Router },
|
|
2140
|
+
{ type: i3.ActivatedRoute },
|
|
2141
|
+
{ type: i4.MatSnackBar },
|
|
2142
|
+
{ type: i1$2.AppRepository },
|
|
2143
|
+
{ type: EditedItemRepository },
|
|
2144
|
+
{ type: i2$1.ItemService },
|
|
2145
|
+
{ type: i8.LibraryRouteService },
|
|
2146
|
+
{ type: i3$1.DialogService },
|
|
2147
|
+
{ type: i10.AuthJwtService },
|
|
2148
|
+
{ type: i2$1.UserLevelService },
|
|
2149
|
+
{ type: i2$1.MessagingService },
|
|
2150
|
+
{ type: i5.EnvService },
|
|
2151
|
+
{ type: i1$1.FormBuilder }
|
|
2152
|
+
]
|
|
2153
|
+
});
|
|
1316
2154
|
export { CurrentItemBarComponent, CurrentLayerPartBarComponent, EditedItemRepository, ItemEditorComponent, ItemGenerateDialogComponent, ItemLookupDialogComponent };
|
|
1317
|
-
|
|
2155
|
+
|
|
2156
|
+
//# sourceMappingURL=myrmidon-cadmus-item-editor.mjs.map
|