pdm-ui-kit 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -3
- package/esm2020/lib/components/button-group/button-group.component.mjs +208 -182
- package/esm2020/lib/components/combobox/combobox.component.mjs +136 -14
- package/esm2020/lib/components/context-menu/context-menu.component.mjs +121 -42
- package/esm2020/lib/components/data-table/data-table.component.mjs +3 -3
- package/esm2020/lib/components/date-picker/date-picker.component.mjs +66 -54
- package/esm2020/lib/components/dialog/dialog.component.mjs +111 -94
- package/esm2020/lib/components/hover-card/hover-card.component.mjs +185 -24
- package/esm2020/lib/components/input/input.component.mjs +15 -15
- package/esm2020/lib/components/input-group/input-group.component.mjs +14 -14
- package/esm2020/lib/components/menubar/menubar.component.mjs +105 -29
- package/esm2020/lib/components/popover/popover.component.mjs +107 -75
- package/esm2020/lib/components/select/select.component.mjs +23 -22
- package/esm2020/lib/components/table/table.component.mjs +77 -68
- package/esm2020/lib/components/tabs/tabs.component.mjs +6 -6
- package/esm2020/lib/components/toggle-group/toggle-group.component.mjs +6 -6
- package/esm2020/lib/components/tooltip/tooltip.component.mjs +162 -19
- package/esm2020/lib/overlay/z-index-helper.mjs +69 -0
- package/esm2020/lib/utils/z-index.mjs +25 -28
- package/esm2020/public-api.mjs +67 -66
- package/fesm2015/pdm-ui-kit.mjs +1376 -654
- package/fesm2015/pdm-ui-kit.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit.mjs +1380 -654
- package/fesm2020/pdm-ui-kit.mjs.map +1 -1
- package/lib/components/button-group/button-group.component.d.ts +8 -2
- package/lib/components/combobox/combobox.component.d.ts +20 -3
- package/lib/components/context-menu/context-menu.component.d.ts +17 -8
- package/lib/components/date-picker/date-picker.component.d.ts +5 -6
- package/lib/components/dialog/dialog.component.d.ts +5 -5
- package/lib/components/hover-card/hover-card.component.d.ts +27 -4
- package/lib/components/input/input.component.d.ts +3 -3
- package/lib/components/input-group/input-group.component.d.ts +1 -1
- package/lib/components/menubar/menubar.component.d.ts +16 -8
- package/lib/components/popover/popover.component.d.ts +13 -12
- package/lib/components/select/select.component.d.ts +4 -5
- package/lib/components/table/table.component.d.ts +2 -2
- package/lib/components/tabs/tabs.component.d.ts +1 -1
- package/lib/components/toggle-group/toggle-group.component.d.ts +1 -1
- package/lib/components/tooltip/tooltip.component.d.ts +21 -3
- package/lib/overlay/z-index-helper.d.ts +36 -0
- package/lib/utils/z-index.d.ts +14 -18
- package/package.json +6 -6
- package/public-api.d.ts +66 -65
- package/src/lib/styles/tokens.css +182 -0
package/fesm2020/pdm-ui-kit.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import * as i1 from '@angular/common';
|
|
|
2
2
|
import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, HostListener, ViewChild, ViewChildren, ElementRef, PLATFORM_ID, Directive, Inject, ContentChildren, NgModule } from '@angular/core';
|
|
5
|
-
import * as i1$
|
|
5
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
6
6
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
7
|
-
import { icons } from 'lucide';
|
|
8
|
-
import * as i1$1 from '@angular/platform-browser';
|
|
9
7
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
|
+
import { icons } from 'lucide';
|
|
9
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
10
10
|
import { format } from 'date-fns';
|
|
11
11
|
|
|
12
12
|
class PdmAccordionComponent {
|
|
@@ -314,198 +314,224 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
314
314
|
type: Input
|
|
315
315
|
}] } });
|
|
316
316
|
|
|
317
|
+
const ROOT_LAYOUT = {
|
|
318
|
+
horizontal: "flex flex-col sm:flex-row sm:items-center sm:flex-wrap",
|
|
319
|
+
vertical: "flex flex-col items-stretch",
|
|
320
|
+
};
|
|
321
|
+
const ATTACHMENT_EDGE_CLASSES = {
|
|
322
|
+
horizontal: [
|
|
323
|
+
"[&>*]:rounded-none",
|
|
324
|
+
"[&>*:first-child]:rounded-l-md",
|
|
325
|
+
"[&>*:last-child]:rounded-r-md",
|
|
326
|
+
"[&>*:not(:first-child)]:border-l-0",
|
|
327
|
+
"[&>*:not(:first-child)]:-ml-px",
|
|
328
|
+
],
|
|
329
|
+
vertical: [
|
|
330
|
+
"[&>*]:rounded-none",
|
|
331
|
+
"[&>*:first-child]:rounded-t-md",
|
|
332
|
+
"[&>*:last-child]:rounded-b-md",
|
|
333
|
+
"[&>*:not(:first-child)]:border-t-0",
|
|
334
|
+
"[&>*:not(:first-child)]:-mt-px",
|
|
335
|
+
],
|
|
336
|
+
};
|
|
337
|
+
const ATTACHMENT_CONTROL_CLASSES = {
|
|
338
|
+
horizontal: [
|
|
339
|
+
"[&>pdm-button]:flex",
|
|
340
|
+
"[&>pdm-button>button]:h-9",
|
|
341
|
+
"[&>pdm-button>button]:!rounded-none",
|
|
342
|
+
"[&>pdm-button>button]:shadow-none",
|
|
343
|
+
"[&>pdm-button:first-child>button]:!rounded-l-md",
|
|
344
|
+
"[&>pdm-button:last-child>button]:!rounded-r-md",
|
|
345
|
+
"[&>pdm-input]:flex-1",
|
|
346
|
+
"[&>pdm-input>div]:w-full",
|
|
347
|
+
"[&>pdm-input>div]:!rounded-none",
|
|
348
|
+
"[&>pdm-input>div]:shadow-none",
|
|
349
|
+
"[&>pdm-input>div>input]:!rounded-none",
|
|
350
|
+
"[&>pdm-input>div>input]:bg-background",
|
|
351
|
+
"[&>pdm-input>div>input]:shadow-none",
|
|
352
|
+
"[&>pdm-input:first-child>div]:!rounded-l-md",
|
|
353
|
+
"[&>pdm-input:last-child>div]:!rounded-r-md",
|
|
354
|
+
"[&>pdm-input:first-child>div>input]:!rounded-l-md",
|
|
355
|
+
"[&>pdm-input:last-child>div>input]:!rounded-r-md",
|
|
356
|
+
"[&>pdm-input-group>div]:!rounded-none",
|
|
357
|
+
"[&>pdm-input-group>div]:shadow-none",
|
|
358
|
+
"[&>pdm-input-group:first-child>div]:!rounded-l-md",
|
|
359
|
+
"[&>pdm-input-group:last-child>div]:!rounded-r-md",
|
|
360
|
+
"[&>pdm-select>select]:!rounded-none",
|
|
361
|
+
"[&>pdm-select>select]:shadow-none",
|
|
362
|
+
"[&>pdm-select>div>button]:!rounded-none",
|
|
363
|
+
"[&>pdm-select>div>button]:shadow-none",
|
|
364
|
+
"[&>pdm-select:first-child>select]:!rounded-l-md",
|
|
365
|
+
"[&>pdm-select:last-child>select]:!rounded-r-md",
|
|
366
|
+
"[&>pdm-select:first-child>div>button]:!rounded-l-md",
|
|
367
|
+
"[&>pdm-select:last-child>div>button]:!rounded-r-md",
|
|
368
|
+
"[&>pdm-select:not(:first-child)>div>button]:!rounded-l-none",
|
|
369
|
+
"[&>pdm-select:not(:last-child)>div>button]:!rounded-r-none",
|
|
370
|
+
"[&>pdm-tooltip>span>*]:rounded-none",
|
|
371
|
+
"[&>pdm-tooltip>span>*]:shadow-none",
|
|
372
|
+
"[&>pdm-tooltip:not(:first-child)>span>*]:border-l-0",
|
|
373
|
+
"[&>pdm-tooltip>span>button]:!rounded-none",
|
|
374
|
+
"[&>pdm-tooltip>span>button]:shadow-none",
|
|
375
|
+
"[&>pdm-tooltip:first-child>span>button]:!rounded-l-md",
|
|
376
|
+
"[&>pdm-tooltip:last-child>span>button]:!rounded-r-md",
|
|
377
|
+
"[&>pdm-tooltip>span>input]:!rounded-none",
|
|
378
|
+
"[&>pdm-tooltip>span>input]:bg-background",
|
|
379
|
+
"[&>pdm-tooltip>span>input]:shadow-none",
|
|
380
|
+
"[&>pdm-tooltip:first-child>span>input]:!rounded-l-md",
|
|
381
|
+
"[&>pdm-tooltip:last-child>span>input]:!rounded-r-md",
|
|
382
|
+
"[&>pdm-tooltip>span>select]:!rounded-none",
|
|
383
|
+
"[&>pdm-tooltip>span>select]:shadow-none",
|
|
384
|
+
"[&>pdm-tooltip:first-child>span>select]:!rounded-l-md",
|
|
385
|
+
"[&>pdm-tooltip:last-child>span>select]:!rounded-r-md",
|
|
386
|
+
"[&>pdm-tooltip>span>pdm-button>button]:!rounded-none",
|
|
387
|
+
"[&>pdm-tooltip>span>pdm-button>button]:shadow-none",
|
|
388
|
+
"[&>pdm-tooltip:first-child>span>pdm-button>button]:!rounded-l-md",
|
|
389
|
+
"[&>pdm-tooltip:last-child>span>pdm-button>button]:!rounded-r-md",
|
|
390
|
+
"[&>pdm-tooltip>span>pdm-input>div]:!rounded-none",
|
|
391
|
+
"[&>pdm-tooltip>span>pdm-input>div]:shadow-none",
|
|
392
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:!rounded-none",
|
|
393
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:bg-background",
|
|
394
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:shadow-none",
|
|
395
|
+
"[&>pdm-tooltip:first-child>span>pdm-input>div]:!rounded-l-md",
|
|
396
|
+
"[&>pdm-tooltip:last-child>span>pdm-input>div]:!rounded-r-md",
|
|
397
|
+
"[&>pdm-tooltip:first-child>span>pdm-input>div>input]:!rounded-l-md",
|
|
398
|
+
"[&>pdm-tooltip:last-child>span>pdm-input>div>input]:!rounded-r-md",
|
|
399
|
+
"[&>pdm-tooltip>span>pdm-input-group>div]:!rounded-none",
|
|
400
|
+
"[&>pdm-tooltip>span>pdm-input-group>div]:shadow-none",
|
|
401
|
+
"[&>pdm-tooltip:first-child>span>pdm-input-group>div]:!rounded-l-md",
|
|
402
|
+
"[&>pdm-tooltip:last-child>span>pdm-input-group>div]:!rounded-r-md",
|
|
403
|
+
"[&>pdm-tooltip>span>pdm-select>select]:!rounded-none",
|
|
404
|
+
"[&>pdm-tooltip>span>pdm-select>select]:shadow-none",
|
|
405
|
+
"[&>pdm-tooltip>span>pdm-select>div>button]:!rounded-none",
|
|
406
|
+
"[&>pdm-tooltip>span>pdm-select>div>button]:shadow-none",
|
|
407
|
+
"[&>pdm-tooltip:first-child>span>pdm-select>select]:!rounded-l-md",
|
|
408
|
+
"[&>pdm-tooltip:last-child>span>pdm-select>select]:!rounded-r-md",
|
|
409
|
+
"[&>pdm-tooltip:first-child>span>pdm-select>div>button]:!rounded-l-md",
|
|
410
|
+
"[&>pdm-tooltip:last-child>span>pdm-select>div>button]:!rounded-r-md",
|
|
411
|
+
"[&>pdm-tooltip:not(:first-child)>span>pdm-select>div>button]:!rounded-l-none",
|
|
412
|
+
"[&>pdm-tooltip:not(:last-child)>span>pdm-select>div>button]:!rounded-r-none",
|
|
413
|
+
],
|
|
414
|
+
vertical: [
|
|
415
|
+
"[&>*]:rounded-none",
|
|
416
|
+
"[&>*:first-child]:rounded-t-md",
|
|
417
|
+
"[&>*:last-child]:rounded-b-md",
|
|
418
|
+
"[&>*:not(:first-child)]:border-t-0",
|
|
419
|
+
"[&>*:not(:first-child)]:-mt-px",
|
|
420
|
+
"[&>pdm-button]:flex",
|
|
421
|
+
"[&>pdm-button>button]:h-9",
|
|
422
|
+
"[&>pdm-button>button]:!rounded-none",
|
|
423
|
+
"[&>pdm-button>button]:shadow-none",
|
|
424
|
+
"[&>pdm-button:first-child>button]:!rounded-t-md",
|
|
425
|
+
"[&>pdm-button:last-child>button]:!rounded-b-md",
|
|
426
|
+
"[&>pdm-input>div]:!rounded-none",
|
|
427
|
+
"[&>pdm-input>div]:shadow-none",
|
|
428
|
+
"[&>pdm-input>div>input]:!rounded-none",
|
|
429
|
+
"[&>pdm-input>div>input]:bg-background",
|
|
430
|
+
"[&>pdm-input>div>input]:shadow-none",
|
|
431
|
+
"[&>pdm-input:first-child>div]:!rounded-t-md",
|
|
432
|
+
"[&>pdm-input:last-child>div]:!rounded-b-md",
|
|
433
|
+
"[&>pdm-input:first-child>div>input]:!rounded-t-md",
|
|
434
|
+
"[&>pdm-input:last-child>div>input]:!rounded-b-md",
|
|
435
|
+
"[&>pdm-input-group>div]:!rounded-none",
|
|
436
|
+
"[&>pdm-input-group>div]:shadow-none",
|
|
437
|
+
"[&>pdm-input-group:first-child>div]:!rounded-t-md",
|
|
438
|
+
"[&>pdm-input-group:last-child>div]:!rounded-b-md",
|
|
439
|
+
"[&>pdm-select>select]:!rounded-none",
|
|
440
|
+
"[&>pdm-select>select]:shadow-none",
|
|
441
|
+
"[&>pdm-select>div>button]:!rounded-none",
|
|
442
|
+
"[&>pdm-select>div>button]:shadow-none",
|
|
443
|
+
"[&>pdm-select:first-child>select]:!rounded-t-md",
|
|
444
|
+
"[&>pdm-select:last-child>select]:!rounded-b-md",
|
|
445
|
+
"[&>pdm-select:first-child>div>button]:!rounded-t-md",
|
|
446
|
+
"[&>pdm-select:last-child>div>button]:!rounded-b-md",
|
|
447
|
+
"[&>pdm-select:not(:first-child)>div>button]:!rounded-t-none",
|
|
448
|
+
"[&>pdm-select:not(:last-child)>div>button]:!rounded-b-none",
|
|
449
|
+
"[&>pdm-tooltip>span>*]:rounded-none",
|
|
450
|
+
"[&>pdm-tooltip>span>*]:shadow-none",
|
|
451
|
+
"[&>pdm-tooltip:not(:first-child)>span>*]:border-t-0",
|
|
452
|
+
"[&>pdm-tooltip>span>button]:!rounded-none",
|
|
453
|
+
"[&>pdm-tooltip>span>button]:shadow-none",
|
|
454
|
+
"[&>pdm-tooltip:first-child>span>button]:!rounded-t-md",
|
|
455
|
+
"[&>pdm-tooltip:last-child>span>button]:!rounded-b-md",
|
|
456
|
+
"[&>pdm-tooltip>span>input]:!rounded-none",
|
|
457
|
+
"[&>pdm-tooltip>span>input]:bg-background",
|
|
458
|
+
"[&>pdm-tooltip>span>input]:shadow-none",
|
|
459
|
+
"[&>pdm-tooltip:first-child>span>input]:!rounded-t-md",
|
|
460
|
+
"[&>pdm-tooltip:last-child>span>input]:!rounded-b-md",
|
|
461
|
+
"[&>pdm-tooltip>span>select]:!rounded-none",
|
|
462
|
+
"[&>pdm-tooltip>span>select]:shadow-none",
|
|
463
|
+
"[&>pdm-tooltip:first-child>span>select]:!rounded-t-md",
|
|
464
|
+
"[&>pdm-tooltip:last-child>span>select]:!rounded-b-md",
|
|
465
|
+
"[&>pdm-tooltip>span>pdm-button>button]:!rounded-none",
|
|
466
|
+
"[&>pdm-tooltip>span>pdm-button>button]:shadow-none",
|
|
467
|
+
"[&>pdm-tooltip:first-child>span>pdm-button>button]:!rounded-t-md",
|
|
468
|
+
"[&>pdm-tooltip:last-child>span>pdm-button>button]:!rounded-b-md",
|
|
469
|
+
"[&>pdm-tooltip>span>pdm-input>div]:!rounded-none",
|
|
470
|
+
"[&>pdm-tooltip>span>pdm-input>div]:shadow-none",
|
|
471
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:!rounded-none",
|
|
472
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:bg-background",
|
|
473
|
+
"[&>pdm-tooltip>span>pdm-input>div>input]:shadow-none",
|
|
474
|
+
"[&>pdm-tooltip:first-child>span>pdm-input>div]:!rounded-t-md",
|
|
475
|
+
"[&>pdm-tooltip:last-child>span>pdm-input>div]:!rounded-b-md",
|
|
476
|
+
"[&>pdm-tooltip:first-child>span>pdm-input>div>input]:!rounded-t-md",
|
|
477
|
+
"[&>pdm-tooltip:last-child>span>pdm-input>div>input]:!rounded-b-md",
|
|
478
|
+
"[&>pdm-tooltip>span>pdm-input-group>div]:!rounded-none",
|
|
479
|
+
"[&>pdm-tooltip>span>pdm-input-group>div]:shadow-none",
|
|
480
|
+
"[&>pdm-tooltip:first-child>span>pdm-input-group>div]:!rounded-t-md",
|
|
481
|
+
"[&>pdm-tooltip:last-child>span>pdm-input-group>div]:!rounded-b-md",
|
|
482
|
+
"[&>pdm-tooltip>span>pdm-select>select]:!rounded-none",
|
|
483
|
+
"[&>pdm-tooltip>span>pdm-select>select]:shadow-none",
|
|
484
|
+
"[&>pdm-tooltip>span>pdm-select>div>button]:!rounded-none",
|
|
485
|
+
"[&>pdm-tooltip>span>pdm-select>div>button]:shadow-none",
|
|
486
|
+
"[&>pdm-tooltip:first-child>span>pdm-select>select]:!rounded-t-md",
|
|
487
|
+
"[&>pdm-tooltip:last-child>span>pdm-select>select]:!rounded-b-md",
|
|
488
|
+
"[&>pdm-tooltip:first-child>span>pdm-select>div>button]:!rounded-t-md",
|
|
489
|
+
"[&>pdm-tooltip:last-child>span>pdm-select>div>button]:!rounded-b-md",
|
|
490
|
+
"[&>pdm-tooltip:not(:first-child)>span>pdm-select>div>button]:!rounded-t-none",
|
|
491
|
+
"[&>pdm-tooltip:not(:last-child)>span>pdm-select>div>button]:!rounded-b-none",
|
|
492
|
+
],
|
|
493
|
+
};
|
|
494
|
+
const FOCUS_STACKING_CLASS = "*:focus-visible:relative *:focus-visible:z-10";
|
|
495
|
+
const SEPARATOR_CLASSES = "overflow-hidden rounded-md border border-border bg-secondary shadow-sm";
|
|
317
496
|
class PdmButtonGroupComponent {
|
|
318
497
|
constructor() {
|
|
319
|
-
this.variant =
|
|
498
|
+
this.variant = "default";
|
|
320
499
|
this.separated = true;
|
|
321
|
-
this.className =
|
|
500
|
+
this.className = "";
|
|
501
|
+
}
|
|
502
|
+
get axis() {
|
|
503
|
+
return this.orientation ?? this.direction ?? "horizontal";
|
|
504
|
+
}
|
|
505
|
+
get isVertical() {
|
|
506
|
+
return this.variant === "orientation" || this.axis === "vertical";
|
|
507
|
+
}
|
|
508
|
+
get shouldAttach() {
|
|
509
|
+
return !this.separated && this.variant !== "default";
|
|
510
|
+
}
|
|
511
|
+
get ariaOrientation() {
|
|
512
|
+
return this.isVertical ? "vertical" : "horizontal";
|
|
322
513
|
}
|
|
323
514
|
get rootClasses() {
|
|
324
|
-
const effectiveOrientation = this.orientation ?? this.direction ?? 'horizontal';
|
|
325
|
-
const isVertical = this.variant === 'orientation' || effectiveOrientation === 'vertical';
|
|
326
|
-
const isGroup = this.variant === 'group';
|
|
327
|
-
const isAttached = !this.separated && this.variant !== 'default';
|
|
328
|
-
const isSeparator = this.variant === 'separator';
|
|
329
|
-
const attachedClasses = isAttached && !isGroup
|
|
330
|
-
? isVertical
|
|
331
|
-
? [
|
|
332
|
-
'[&>*]:rounded-none',
|
|
333
|
-
'[&>*:first-child]:rounded-t-md',
|
|
334
|
-
'[&>*:last-child]:rounded-b-md',
|
|
335
|
-
'[&>*:not(:first-child)]:border-t-0',
|
|
336
|
-
'[&>*:not(:first-child)]:-mt-px'
|
|
337
|
-
].join(' ')
|
|
338
|
-
: [
|
|
339
|
-
'[&>*]:rounded-none',
|
|
340
|
-
'[&>*:first-child]:rounded-l-md',
|
|
341
|
-
'[&>*:last-child]:rounded-r-md',
|
|
342
|
-
'[&>*:not(:first-child)]:border-l-0',
|
|
343
|
-
'[&>*:not(:first-child)]:-ml-px'
|
|
344
|
-
].join(' ')
|
|
345
|
-
: '';
|
|
346
|
-
const groupHorizontalClasses = isGroup && !isVertical && !this.separated
|
|
347
|
-
? [
|
|
348
|
-
'[&>*]:rounded-none',
|
|
349
|
-
'[&>*:first-child]:rounded-l-md',
|
|
350
|
-
'[&>*:last-child]:rounded-r-md',
|
|
351
|
-
'[&>*:not(:first-child)]:-ml-px',
|
|
352
|
-
'[&>*:not(:first-child)]:border-l-0',
|
|
353
|
-
'[&>pdm-button]:flex',
|
|
354
|
-
'[&>pdm-button>button]:h-9',
|
|
355
|
-
'[&>pdm-input]:flex-1',
|
|
356
|
-
'[&>pdm-input>div]:w-full',
|
|
357
|
-
'[&>pdm-select>select]:!rounded-none',
|
|
358
|
-
'[&>pdm-select:first-child>select]:!rounded-l-md',
|
|
359
|
-
'[&>pdm-select:last-child>select]:!rounded-r-md',
|
|
360
|
-
'[&>pdm-select>select]:shadow-none',
|
|
361
|
-
'[&>pdm-select>div>button]:!rounded-none',
|
|
362
|
-
'[&>pdm-select:first-child>div>button]:!rounded-l-md',
|
|
363
|
-
'[&>pdm-select:last-child>div>button]:!rounded-r-md',
|
|
364
|
-
'[&>pdm-select:not(:first-child)>div>button]:!rounded-l-none',
|
|
365
|
-
'[&>pdm-select:not(:last-child)>div>button]:!rounded-r-none',
|
|
366
|
-
'[&>pdm-select>div>button]:shadow-none',
|
|
367
|
-
'[&>pdm-button>button]:!rounded-none',
|
|
368
|
-
'[&>pdm-button:first-child>button]:!rounded-l-md',
|
|
369
|
-
'[&>pdm-button:last-child>button]:!rounded-r-md',
|
|
370
|
-
'[&>pdm-input>div>input]:!rounded-none',
|
|
371
|
-
'[&>pdm-input:first-child>div>input]:!rounded-l-md',
|
|
372
|
-
'[&>pdm-input:last-child>div>input]:!rounded-r-md',
|
|
373
|
-
'[&>pdm-input-group>div]:!rounded-none',
|
|
374
|
-
'[&>pdm-input-group:first-child>div]:!rounded-l-md',
|
|
375
|
-
'[&>pdm-input-group:last-child>div]:!rounded-r-md',
|
|
376
|
-
'[&>pdm-input>div>input]:bg-background',
|
|
377
|
-
'[&>pdm-input>div>input]:shadow-none',
|
|
378
|
-
'[&>pdm-button>button]:rounded-l-none',
|
|
379
|
-
'[&>pdm-button>button]:shadow-none',
|
|
380
|
-
'[&>pdm-tooltip>span>*]:rounded-none',
|
|
381
|
-
'[&>pdm-tooltip:first-child>span>*]:rounded-l-md',
|
|
382
|
-
'[&>pdm-tooltip:last-child>span>*]:rounded-r-md',
|
|
383
|
-
'[&>pdm-tooltip:not(:first-child)>span>*]:border-l-0',
|
|
384
|
-
'[&>pdm-tooltip>span>pdm-button>button]:!rounded-none',
|
|
385
|
-
'[&>pdm-tooltip:first-child>span>pdm-button>button]:!rounded-l-md',
|
|
386
|
-
'[&>pdm-tooltip:last-child>span>pdm-button>button]:!rounded-r-md',
|
|
387
|
-
'[&>pdm-tooltip>span>pdm-button>button]:shadow-none',
|
|
388
|
-
'[&>pdm-tooltip>span>button]:!rounded-none',
|
|
389
|
-
'[&>pdm-tooltip:first-child>span>button]:!rounded-l-md',
|
|
390
|
-
'[&>pdm-tooltip:last-child>span>button]:!rounded-r-md',
|
|
391
|
-
'[&>pdm-tooltip>span>button]:shadow-none',
|
|
392
|
-
'[&>pdm-tooltip>span>pdm-input>div>input]:!rounded-none',
|
|
393
|
-
'[&>pdm-tooltip:first-child>span>pdm-input>div>input]:!rounded-l-md',
|
|
394
|
-
'[&>pdm-tooltip:last-child>span>pdm-input>div>input]:!rounded-r-md',
|
|
395
|
-
'[&>pdm-tooltip>span>pdm-input>div>input]:shadow-none',
|
|
396
|
-
'[&>pdm-tooltip>span>input]:!rounded-none',
|
|
397
|
-
'[&>pdm-tooltip:first-child>span>input]:!rounded-l-md',
|
|
398
|
-
'[&>pdm-tooltip:last-child>span>input]:!rounded-r-md',
|
|
399
|
-
'[&>pdm-tooltip>span>input]:shadow-none',
|
|
400
|
-
'[&>pdm-tooltip>span>pdm-input-group>div]:!rounded-none',
|
|
401
|
-
'[&>pdm-tooltip:first-child>span>pdm-input-group>div]:!rounded-l-md',
|
|
402
|
-
'[&>pdm-tooltip:last-child>span>pdm-input-group>div]:!rounded-r-md',
|
|
403
|
-
'[&>pdm-tooltip>span>pdm-select>select]:!rounded-none',
|
|
404
|
-
'[&>pdm-tooltip:first-child>span>pdm-select>select]:!rounded-l-md',
|
|
405
|
-
'[&>pdm-tooltip:last-child>span>pdm-select>select]:!rounded-r-md',
|
|
406
|
-
'[&>pdm-tooltip>span>pdm-select>select]:shadow-none',
|
|
407
|
-
'[&>pdm-tooltip>span>pdm-select>div>button]:!rounded-none',
|
|
408
|
-
'[&>pdm-tooltip:first-child>span>pdm-select>div>button]:!rounded-l-md',
|
|
409
|
-
'[&>pdm-tooltip:last-child>span>pdm-select>div>button]:!rounded-r-md',
|
|
410
|
-
'[&>pdm-tooltip:not(:first-child)>span>pdm-select>div>button]:!rounded-l-none',
|
|
411
|
-
'[&>pdm-tooltip:not(:last-child)>span>pdm-select>div>button]:!rounded-r-none',
|
|
412
|
-
'[&>pdm-tooltip>span>pdm-select>div>button]:shadow-none',
|
|
413
|
-
'[&>pdm-tooltip>span>select]:!rounded-none',
|
|
414
|
-
'[&>pdm-tooltip:first-child>span>select]:!rounded-l-md',
|
|
415
|
-
'[&>pdm-tooltip:last-child>span>select]:!rounded-r-md',
|
|
416
|
-
'[&>pdm-tooltip>span>select]:shadow-none'
|
|
417
|
-
].join(' ')
|
|
418
|
-
: '';
|
|
419
|
-
const groupVerticalClasses = isGroup && isVertical && !this.separated
|
|
420
|
-
? [
|
|
421
|
-
'[&>*]:rounded-none',
|
|
422
|
-
'[&>*:first-child]:rounded-t-md',
|
|
423
|
-
'[&>*:last-child]:rounded-b-md',
|
|
424
|
-
'[&>*:not(:first-child)]:-mt-px',
|
|
425
|
-
'[&>*:not(:first-child)]:border-t-0',
|
|
426
|
-
'[&>pdm-button]:flex',
|
|
427
|
-
'[&>pdm-button>button]:h-9',
|
|
428
|
-
'[&>pdm-button>button]:!rounded-none',
|
|
429
|
-
'[&>pdm-button:first-child>button]:!rounded-t-md',
|
|
430
|
-
'[&>pdm-button:last-child>button]:!rounded-b-md',
|
|
431
|
-
'[&>pdm-input>div>input]:!rounded-none',
|
|
432
|
-
'[&>pdm-input:first-child>div>input]:!rounded-t-md',
|
|
433
|
-
'[&>pdm-input:last-child>div>input]:!rounded-b-md',
|
|
434
|
-
'[&>pdm-input-group>div]:!rounded-none',
|
|
435
|
-
'[&>pdm-input-group:first-child>div]:!rounded-t-md',
|
|
436
|
-
'[&>pdm-input-group:last-child>div]:!rounded-b-md',
|
|
437
|
-
'[&>pdm-select>select]:!rounded-none',
|
|
438
|
-
'[&>pdm-select:first-child>select]:!rounded-t-md',
|
|
439
|
-
'[&>pdm-select:last-child>select]:!rounded-b-md',
|
|
440
|
-
'[&>pdm-select>select]:shadow-none',
|
|
441
|
-
'[&>pdm-select>div>button]:!rounded-none',
|
|
442
|
-
'[&>pdm-select:first-child>div>button]:!rounded-t-md',
|
|
443
|
-
'[&>pdm-select:last-child>div>button]:!rounded-b-md',
|
|
444
|
-
'[&>pdm-select:not(:first-child)>div>button]:!rounded-t-none',
|
|
445
|
-
'[&>pdm-select:not(:last-child)>div>button]:!rounded-b-none',
|
|
446
|
-
'[&>pdm-select>div>button]:shadow-none',
|
|
447
|
-
'[&>pdm-input>div>input]:bg-background',
|
|
448
|
-
'[&>pdm-input>div>input]:shadow-none',
|
|
449
|
-
'[&>pdm-button>button]:shadow-none',
|
|
450
|
-
'[&>pdm-tooltip>span>*]:rounded-none',
|
|
451
|
-
'[&>pdm-tooltip:first-child>span>*]:rounded-t-md',
|
|
452
|
-
'[&>pdm-tooltip:last-child>span>*]:rounded-b-md',
|
|
453
|
-
'[&>pdm-tooltip:not(:first-child)>span>*]:border-t-0',
|
|
454
|
-
'[&>pdm-tooltip>span>pdm-button>button]:!rounded-none',
|
|
455
|
-
'[&>pdm-tooltip:first-child>span>pdm-button>button]:!rounded-t-md',
|
|
456
|
-
'[&>pdm-tooltip:last-child>span>pdm-button>button]:!rounded-b-md',
|
|
457
|
-
'[&>pdm-tooltip>span>pdm-button>button]:shadow-none',
|
|
458
|
-
'[&>pdm-tooltip>span>button]:!rounded-none',
|
|
459
|
-
'[&>pdm-tooltip:first-child>span>button]:!rounded-t-md',
|
|
460
|
-
'[&>pdm-tooltip:last-child>span>button]:!rounded-b-md',
|
|
461
|
-
'[&>pdm-tooltip>span>button]:shadow-none',
|
|
462
|
-
'[&>pdm-tooltip>span>pdm-input>div>input]:!rounded-none',
|
|
463
|
-
'[&>pdm-tooltip:first-child>span>pdm-input>div>input]:!rounded-t-md',
|
|
464
|
-
'[&>pdm-tooltip:last-child>span>pdm-input>div>input]:!rounded-b-md',
|
|
465
|
-
'[&>pdm-tooltip>span>pdm-input>div>input]:shadow-none',
|
|
466
|
-
'[&>pdm-tooltip>span>input]:!rounded-none',
|
|
467
|
-
'[&>pdm-tooltip:first-child>span>input]:!rounded-t-md',
|
|
468
|
-
'[&>pdm-tooltip:last-child>span>input]:!rounded-b-md',
|
|
469
|
-
'[&>pdm-tooltip>span>input]:shadow-none',
|
|
470
|
-
'[&>pdm-tooltip>span>pdm-input-group>div]:!rounded-none',
|
|
471
|
-
'[&>pdm-tooltip:first-child>span>pdm-input-group>div]:!rounded-t-md',
|
|
472
|
-
'[&>pdm-tooltip:last-child>span>pdm-input-group>div]:!rounded-b-md',
|
|
473
|
-
'[&>pdm-tooltip>span>pdm-select>select]:!rounded-none',
|
|
474
|
-
'[&>pdm-tooltip:first-child>span>pdm-select>select]:!rounded-t-md',
|
|
475
|
-
'[&>pdm-tooltip:last-child>span>pdm-select>select]:!rounded-b-md',
|
|
476
|
-
'[&>pdm-tooltip>span>pdm-select>select]:shadow-none',
|
|
477
|
-
'[&>pdm-tooltip>span>pdm-select>div>button]:!rounded-none',
|
|
478
|
-
'[&>pdm-tooltip:first-child>span>pdm-select>div>button]:!rounded-t-md',
|
|
479
|
-
'[&>pdm-tooltip:last-child>span>pdm-select>div>button]:!rounded-b-md',
|
|
480
|
-
'[&>pdm-tooltip:not(:first-child)>span>pdm-select>div>button]:!rounded-t-none',
|
|
481
|
-
'[&>pdm-tooltip:not(:last-child)>span>pdm-select>div>button]:!rounded-b-none',
|
|
482
|
-
'[&>pdm-tooltip>span>pdm-select>div>button]:shadow-none',
|
|
483
|
-
'[&>pdm-tooltip>span>select]:!rounded-none',
|
|
484
|
-
'[&>pdm-tooltip:first-child>span>select]:!rounded-t-md',
|
|
485
|
-
'[&>pdm-tooltip:last-child>span>select]:!rounded-b-md',
|
|
486
|
-
'[&>pdm-tooltip>span>select]:shadow-none'
|
|
487
|
-
].join(' ')
|
|
488
|
-
: '';
|
|
489
515
|
return [
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
this.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
this.className
|
|
516
|
+
ROOT_LAYOUT[this.isVertical ? "vertical" : "horizontal"],
|
|
517
|
+
this.variant === "default" || this.separated ? "gap-2" : "gap-0",
|
|
518
|
+
this.shouldAttach
|
|
519
|
+
? ATTACHMENT_EDGE_CLASSES[this.isVertical ? "vertical" : "horizontal"].join(" ")
|
|
520
|
+
: "",
|
|
521
|
+
this.shouldAttach
|
|
522
|
+
? ATTACHMENT_CONTROL_CLASSES[this.isVertical ? "vertical" : "horizontal"].join(" ")
|
|
523
|
+
: "",
|
|
524
|
+
this.shouldAttach ? FOCUS_STACKING_CLASS : "",
|
|
525
|
+
this.variant === "separator" ? SEPARATOR_CLASSES : "",
|
|
526
|
+
this.className,
|
|
501
527
|
];
|
|
502
528
|
}
|
|
503
529
|
}
|
|
504
530
|
PdmButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
505
|
-
PdmButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmButtonGroupComponent, selector: "pdm-button-group", inputs: { variant: "variant", orientation: "orientation", direction: "direction", separated: "separated", className: "className" }, ngImport: i0, template: "<div\n role=\"group\"\n [attr.aria-orientation]=\"
|
|
531
|
+
PdmButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmButtonGroupComponent, selector: "pdm-button-group", inputs: { variant: "variant", orientation: "orientation", direction: "direction", separated: "separated", className: "className" }, ngImport: i0, template: "<div\n role=\"group\"\n [attr.aria-orientation]=\"ariaOrientation\"\n [ngClass]=\"rootClasses\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
506
532
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmButtonGroupComponent, decorators: [{
|
|
507
533
|
type: Component,
|
|
508
|
-
args: [{ selector:
|
|
534
|
+
args: [{ selector: "pdm-button-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n role=\"group\"\n [attr.aria-orientation]=\"ariaOrientation\"\n [ngClass]=\"rootClasses\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
509
535
|
}], propDecorators: { variant: [{
|
|
510
536
|
type: Input
|
|
511
537
|
}], orientation: [{
|
|
@@ -1535,35 +1561,212 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1535
1561
|
type: Output
|
|
1536
1562
|
}] } });
|
|
1537
1563
|
|
|
1564
|
+
/**
|
|
1565
|
+
* Z-Index helper for overlay components.
|
|
1566
|
+
*
|
|
1567
|
+
* CRITICAL: Consumer custom panelClass MUST NOT replace the base z-index.
|
|
1568
|
+
* This helper ensures z-index is preserved when merging custom classes.
|
|
1569
|
+
*/
|
|
1570
|
+
/**
|
|
1571
|
+
* Base z-index class for overlays - MUST be included in any overlay panel.
|
|
1572
|
+
* This ensures overlays appear above modals (z-50) and drawers (z-40).
|
|
1573
|
+
*/
|
|
1574
|
+
const OVERLAY_BASE_Z_INDEX = "z-[70]";
|
|
1575
|
+
/**
|
|
1576
|
+
* Merge consumer's panelClass with our base z-index.
|
|
1577
|
+
* Consumer classes are APPENDED, not replacing our z-index guarantee.
|
|
1578
|
+
*
|
|
1579
|
+
* @param baseZIndex - Base z-index class to enforce (default: OVERLAY_BASE_Z_INDEX)
|
|
1580
|
+
* @param consumerClasses - Optional additional classes from consumer
|
|
1581
|
+
* @returns Array of classes safe for CDK Overlay panelClass
|
|
1582
|
+
*/
|
|
1583
|
+
function mergeOverlayPanelClass(baseZIndex = OVERLAY_BASE_Z_INDEX, consumerClasses) {
|
|
1584
|
+
const baseClasses = baseZIndex.split(" ");
|
|
1585
|
+
if (!consumerClasses) {
|
|
1586
|
+
return baseClasses;
|
|
1587
|
+
}
|
|
1588
|
+
const consumerClassArray = Array.isArray(consumerClasses)
|
|
1589
|
+
? consumerClasses
|
|
1590
|
+
: consumerClasses.split(" ");
|
|
1591
|
+
// Consumer classes are appended AFTER base classes
|
|
1592
|
+
// This ensures z-index from baseClasses is preserved first
|
|
1593
|
+
return [...baseClasses, ...consumerClassArray];
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Create OverlayConfig with guaranteed z-index.
|
|
1597
|
+
* Use this instead of direct OverlayConfig to ensure z-index enforcement.
|
|
1598
|
+
*
|
|
1599
|
+
* @param baseConfig - Base overlay configuration
|
|
1600
|
+
* @param consumerPanelClass - Optional consumer panelClass to merge
|
|
1601
|
+
* @returns OverlayConfig with z-index guarantee
|
|
1602
|
+
*/
|
|
1603
|
+
function createZIndexEnforcedOverlay(baseConfig, consumerPanelClass) {
|
|
1604
|
+
const mergedClasses = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, consumerPanelClass);
|
|
1605
|
+
const existingPanelClass = baseConfig.panelClass;
|
|
1606
|
+
if (existingPanelClass) {
|
|
1607
|
+
const existingArray = Array.isArray(existingPanelClass)
|
|
1608
|
+
? existingPanelClass
|
|
1609
|
+
: existingPanelClass.split(" ");
|
|
1610
|
+
return {
|
|
1611
|
+
...baseConfig,
|
|
1612
|
+
panelClass: [...mergedClasses, ...existingArray],
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
return {
|
|
1616
|
+
...baseConfig,
|
|
1617
|
+
panelClass: mergedClasses,
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Helper to extract z-index from a class string for debugging.
|
|
1622
|
+
*/
|
|
1623
|
+
function extractZIndex(classes) {
|
|
1624
|
+
const classArray = Array.isArray(classes) ? classes : classes.split(" ");
|
|
1625
|
+
for (const cls of classArray) {
|
|
1626
|
+
if (cls.startsWith("z-") || cls.startsWith("z-[")) {
|
|
1627
|
+
return cls;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return null;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1538
1633
|
class PdmComboboxComponent {
|
|
1539
|
-
constructor() {
|
|
1634
|
+
constructor(overlay, viewContainerRef, elementRef, cdr) {
|
|
1635
|
+
this.overlay = overlay;
|
|
1636
|
+
this.viewContainerRef = viewContainerRef;
|
|
1637
|
+
this.elementRef = elementRef;
|
|
1638
|
+
this.cdr = cdr;
|
|
1540
1639
|
this.open = false;
|
|
1541
|
-
this.placeholder =
|
|
1542
|
-
this.searchPlaceholder =
|
|
1543
|
-
this.className =
|
|
1544
|
-
this.options = [
|
|
1545
|
-
|
|
1640
|
+
this.placeholder = "Select framework...";
|
|
1641
|
+
this.searchPlaceholder = "Search framework";
|
|
1642
|
+
this.className = "";
|
|
1643
|
+
this.options = [
|
|
1644
|
+
"Next.js",
|
|
1645
|
+
"SvelteKit",
|
|
1646
|
+
"Nuxt.js",
|
|
1647
|
+
"Remix",
|
|
1648
|
+
"Astro",
|
|
1649
|
+
];
|
|
1650
|
+
this.value = "";
|
|
1546
1651
|
this.width = 200;
|
|
1652
|
+
this.panelClassName = "";
|
|
1547
1653
|
this.openChange = new EventEmitter();
|
|
1548
1654
|
this.valueChange = new EventEmitter();
|
|
1655
|
+
this.overlayRef = null;
|
|
1656
|
+
this.outsideClickSub = null;
|
|
1657
|
+
}
|
|
1658
|
+
ngOnDestroy() {
|
|
1659
|
+
this.destroyOverlay();
|
|
1549
1660
|
}
|
|
1550
1661
|
get selectedLabel() {
|
|
1551
1662
|
return this.value || this.placeholder;
|
|
1552
1663
|
}
|
|
1553
1664
|
toggle() {
|
|
1554
|
-
|
|
1665
|
+
if (this.open) {
|
|
1666
|
+
this.close();
|
|
1667
|
+
}
|
|
1668
|
+
else {
|
|
1669
|
+
this.openPanel();
|
|
1670
|
+
}
|
|
1555
1671
|
}
|
|
1556
1672
|
select(option) {
|
|
1557
1673
|
this.valueChange.emit(option);
|
|
1674
|
+
this.value = option;
|
|
1675
|
+
this.close();
|
|
1676
|
+
}
|
|
1677
|
+
onEscape() {
|
|
1678
|
+
if (this.open) {
|
|
1679
|
+
this.close();
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
openPanel() {
|
|
1683
|
+
if (this.overlayRef)
|
|
1684
|
+
return;
|
|
1685
|
+
const triggerEl = this.triggerRef?.nativeElement;
|
|
1686
|
+
if (!triggerEl)
|
|
1687
|
+
return;
|
|
1688
|
+
this.open = true;
|
|
1689
|
+
this.openChange.emit(true);
|
|
1690
|
+
this.cdr.markForCheck();
|
|
1691
|
+
const positionStrategy = this.overlay
|
|
1692
|
+
.position()
|
|
1693
|
+
.flexibleConnectedTo(triggerEl)
|
|
1694
|
+
.withPositions(this.getPositionConfigs())
|
|
1695
|
+
.withFlexibleDimensions(false)
|
|
1696
|
+
.withPush(true);
|
|
1697
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
1698
|
+
this.overlayRef = this.overlay.create({
|
|
1699
|
+
positionStrategy,
|
|
1700
|
+
panelClass,
|
|
1701
|
+
});
|
|
1702
|
+
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
1703
|
+
this.overlayRef.attach(portal);
|
|
1704
|
+
// Close on click outside
|
|
1705
|
+
this.outsideClickSub = this.overlayRef
|
|
1706
|
+
.outsidePointerEvents()
|
|
1707
|
+
.subscribe(() => {
|
|
1708
|
+
this.close();
|
|
1709
|
+
});
|
|
1710
|
+
this.cdr.markForCheck();
|
|
1711
|
+
}
|
|
1712
|
+
close() {
|
|
1713
|
+
if (!this.overlayRef)
|
|
1714
|
+
return;
|
|
1715
|
+
this.open = false;
|
|
1558
1716
|
this.openChange.emit(false);
|
|
1717
|
+
this.cdr.markForCheck();
|
|
1718
|
+
this.destroyOverlay();
|
|
1719
|
+
}
|
|
1720
|
+
destroyOverlay() {
|
|
1721
|
+
if (this.outsideClickSub) {
|
|
1722
|
+
this.outsideClickSub.unsubscribe();
|
|
1723
|
+
this.outsideClickSub = null;
|
|
1724
|
+
}
|
|
1725
|
+
if (this.overlayRef) {
|
|
1726
|
+
this.overlayRef.detach();
|
|
1727
|
+
this.overlayRef.dispose();
|
|
1728
|
+
this.overlayRef = null;
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
getPositionConfigs() {
|
|
1732
|
+
return [
|
|
1733
|
+
{
|
|
1734
|
+
originX: "start",
|
|
1735
|
+
originY: "bottom",
|
|
1736
|
+
overlayX: "start",
|
|
1737
|
+
overlayY: "top",
|
|
1738
|
+
offsetY: 4,
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
originX: "start",
|
|
1742
|
+
originY: "top",
|
|
1743
|
+
overlayX: "start",
|
|
1744
|
+
overlayY: "bottom",
|
|
1745
|
+
offsetY: -4,
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
originX: "end",
|
|
1749
|
+
originY: "bottom",
|
|
1750
|
+
overlayX: "end",
|
|
1751
|
+
overlayY: "top",
|
|
1752
|
+
offsetY: 4,
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
originX: "start",
|
|
1756
|
+
originY: "bottom",
|
|
1757
|
+
overlayX: "end",
|
|
1758
|
+
overlayY: "top",
|
|
1759
|
+
offsetY: 4,
|
|
1760
|
+
},
|
|
1761
|
+
];
|
|
1559
1762
|
}
|
|
1560
1763
|
}
|
|
1561
|
-
PdmComboboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1562
|
-
PdmComboboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmComboboxComponent, selector: "pdm-combobox", inputs: { open: "open", placeholder: "placeholder", searchPlaceholder: "searchPlaceholder", className: "className", options: "options", value: "value", width: "width" }, outputs: { openChange: "openChange", valueChange: "valueChange" }, ngImport: i0, template: "<div [ngClass]=\"['flex flex-col gap-1', className]\" [style.width.px]=\"width\">\n <button\n type=\"button\"\n class=\"flex h-9 w-full appearance-none items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggle()\"\n >\n <span
|
|
1764
|
+
PdmComboboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmComboboxComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1765
|
+
PdmComboboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmComboboxComponent, selector: "pdm-combobox", inputs: { open: "open", placeholder: "placeholder", searchPlaceholder: "searchPlaceholder", className: "className", options: "options", value: "value", width: "width", panelClassName: "panelClassName" }, outputs: { openChange: "openChange", valueChange: "valueChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"['flex flex-col gap-1', className]\" [style.width.px]=\"width\">\n <button\n #triggerEl\n type=\"button\"\n class=\"flex h-9 w-full appearance-none items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"'listbox'\"\n (click)=\"toggle()\"\n >\n <span\n class=\"min-w-0 flex-1 truncate text-left text-sm font-medium text-foreground\"\n >{{ selectedLabel }}</span\n >\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 15L12 20L17 15\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path\n d=\"M17 9L12 4L7 9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <div\n class=\"w-full rounded-md border border-border bg-popover p-0 text-popover-foreground shadow-md\"\n >\n <div class=\"flex items-center gap-2 border-b border-border px-3 py-2\">\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-muted-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"11\"\n cy=\"11\"\n r=\"7\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n ></circle>\n <path\n d=\"M20 20L16.6 16.6\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n <div class=\"flex-1 py-2 text-sm text-muted-foreground\">\n {{ searchPlaceholder }}\n </div>\n </div>\n\n <div class=\"p-1\">\n <button\n *ngFor=\"let option of options\"\n type=\"button\"\n class=\"flex w-full appearance-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground\"\n [ngClass]=\"option === value ? 'bg-accent text-accent-foreground' : ''\"\n role=\"option\"\n [attr.aria-selected]=\"option === value\"\n (click)=\"select(option)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ option }}</span>\n <svg\n *ngIf=\"option === value\"\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 12.5L9.2 16.7L19 7\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1563
1766
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmComboboxComponent, decorators: [{
|
|
1564
1767
|
type: Component,
|
|
1565
|
-
args: [{ selector:
|
|
1566
|
-
}], propDecorators: { open: [{
|
|
1768
|
+
args: [{ selector: "pdm-combobox", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"['flex flex-col gap-1', className]\" [style.width.px]=\"width\">\n <button\n #triggerEl\n type=\"button\"\n class=\"flex h-9 w-full appearance-none items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"'listbox'\"\n (click)=\"toggle()\"\n >\n <span\n class=\"min-w-0 flex-1 truncate text-left text-sm font-medium text-foreground\"\n >{{ selectedLabel }}</span\n >\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 15L12 20L17 15\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path\n d=\"M17 9L12 4L7 9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <div\n class=\"w-full rounded-md border border-border bg-popover p-0 text-popover-foreground shadow-md\"\n >\n <div class=\"flex items-center gap-2 border-b border-border px-3 py-2\">\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-muted-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"11\"\n cy=\"11\"\n r=\"7\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n ></circle>\n <path\n d=\"M20 20L16.6 16.6\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n <div class=\"flex-1 py-2 text-sm text-muted-foreground\">\n {{ searchPlaceholder }}\n </div>\n </div>\n\n <div class=\"p-1\">\n <button\n *ngFor=\"let option of options\"\n type=\"button\"\n class=\"flex w-full appearance-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground\"\n [ngClass]=\"option === value ? 'bg-accent text-accent-foreground' : ''\"\n role=\"option\"\n [attr.aria-selected]=\"option === value\"\n (click)=\"select(option)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ option }}</span>\n <svg\n *ngIf=\"option === value\"\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 12.5L9.2 16.7L19 7\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
1769
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { open: [{
|
|
1567
1770
|
type: Input
|
|
1568
1771
|
}], placeholder: [{
|
|
1569
1772
|
type: Input
|
|
@@ -1577,10 +1780,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1577
1780
|
type: Input
|
|
1578
1781
|
}], width: [{
|
|
1579
1782
|
type: Input
|
|
1783
|
+
}], panelClassName: [{
|
|
1784
|
+
type: Input
|
|
1580
1785
|
}], openChange: [{
|
|
1581
1786
|
type: Output
|
|
1582
1787
|
}], valueChange: [{
|
|
1583
1788
|
type: Output
|
|
1789
|
+
}], triggerRef: [{
|
|
1790
|
+
type: ViewChild,
|
|
1791
|
+
args: ["triggerEl"]
|
|
1792
|
+
}], panelTemplateRef: [{
|
|
1793
|
+
type: ViewChild,
|
|
1794
|
+
args: ["panelTemplate"]
|
|
1795
|
+
}], onEscape: [{
|
|
1796
|
+
type: HostListener,
|
|
1797
|
+
args: ["document:keydown.escape"]
|
|
1584
1798
|
}] } });
|
|
1585
1799
|
|
|
1586
1800
|
const FALLBACK_NODE = [['circle', { cx: '12', cy: '12', r: '9' }]];
|
|
@@ -1699,12 +1913,12 @@ class PdmIconComponent {
|
|
|
1699
1913
|
.replace(/>/g, '>');
|
|
1700
1914
|
}
|
|
1701
1915
|
}
|
|
1702
|
-
PdmIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmIconComponent, deps: [{ token: i1$
|
|
1916
|
+
PdmIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmIconComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
1703
1917
|
PdmIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmIconComponent, selector: "pdm-icon", inputs: { name: "name", library: "library", assetUrl: "assetUrl", size: "size", strokeWidth: "strokeWidth", className: "className", ariaLabel: "ariaLabel", decorative: "decorative" }, ngImport: i0, template: "<ng-container *ngIf=\"assetUrl; else inlineIcon\">\n <img\n [src]=\"assetUrl\"\n [style.width.px]=\"resolvedSize\"\n [style.height.px]=\"resolvedSize\"\n [ngClass]=\"className\"\n [attr.role]=\"decorative ? null : 'img'\"\n [attr.aria-hidden]=\"decorative ? 'true' : null\"\n [attr.aria-label]=\"!decorative ? ariaLabel || name : null\"\n alt=\"\"\n />\n</ng-container>\n\n<ng-template #inlineIcon>\n <span\n [ngClass]=\"className\"\n [style.display]=\"'inline-flex'\"\n [style.align-items]=\"'center'\"\n [style.justify-content]=\"'center'\"\n [style.line-height]=\"0\"\n [style.width.px]=\"resolvedSize\"\n [style.height.px]=\"resolvedSize\"\n [attr.role]=\"decorative ? null : 'img'\"\n [attr.aria-hidden]=\"decorative ? 'true' : null\"\n [attr.aria-label]=\"!decorative ? ariaLabel || name : null\"\n [innerHTML]=\"svgMarkup\"\n ></span>\n</ng-template>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex-shrink:0}:host svg{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1704
1918
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmIconComponent, decorators: [{
|
|
1705
1919
|
type: Component,
|
|
1706
1920
|
args: [{ selector: 'pdm-icon', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"assetUrl; else inlineIcon\">\n <img\n [src]=\"assetUrl\"\n [style.width.px]=\"resolvedSize\"\n [style.height.px]=\"resolvedSize\"\n [ngClass]=\"className\"\n [attr.role]=\"decorative ? null : 'img'\"\n [attr.aria-hidden]=\"decorative ? 'true' : null\"\n [attr.aria-label]=\"!decorative ? ariaLabel || name : null\"\n alt=\"\"\n />\n</ng-container>\n\n<ng-template #inlineIcon>\n <span\n [ngClass]=\"className\"\n [style.display]=\"'inline-flex'\"\n [style.align-items]=\"'center'\"\n [style.justify-content]=\"'center'\"\n [style.line-height]=\"0\"\n [style.width.px]=\"resolvedSize\"\n [style.height.px]=\"resolvedSize\"\n [attr.role]=\"decorative ? null : 'img'\"\n [attr.aria-hidden]=\"decorative ? 'true' : null\"\n [attr.aria-label]=\"!decorative ? ariaLabel || name : null\"\n [innerHTML]=\"svgMarkup\"\n ></span>\n</ng-template>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex-shrink:0}:host svg{display:block}\n"] }]
|
|
1707
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
1921
|
+
}], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; }, propDecorators: { name: [{
|
|
1708
1922
|
type: Input
|
|
1709
1923
|
}], library: [{
|
|
1710
1924
|
type: Input
|
|
@@ -1794,72 +2008,140 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1794
2008
|
}] } });
|
|
1795
2009
|
|
|
1796
2010
|
class PdmContextMenuComponent {
|
|
1797
|
-
constructor(
|
|
1798
|
-
this.
|
|
2011
|
+
constructor(overlay, viewContainerRef, _elementRef, cdr) {
|
|
2012
|
+
this.overlay = overlay;
|
|
2013
|
+
this.viewContainerRef = viewContainerRef;
|
|
2014
|
+
this._elementRef = _elementRef;
|
|
2015
|
+
this.cdr = cdr;
|
|
1799
2016
|
this.items = [
|
|
1800
|
-
{ type:
|
|
1801
|
-
{
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
{
|
|
1810
|
-
|
|
1811
|
-
|
|
2017
|
+
{ type: "item", label: "Back", value: "back", inset: true, shortcut: "⌘[" },
|
|
2018
|
+
{
|
|
2019
|
+
type: "item",
|
|
2020
|
+
label: "Forward",
|
|
2021
|
+
value: "forward",
|
|
2022
|
+
inset: true,
|
|
2023
|
+
shortcut: "⌘]",
|
|
2024
|
+
disabled: true,
|
|
2025
|
+
},
|
|
2026
|
+
{
|
|
2027
|
+
type: "item",
|
|
2028
|
+
label: "Reload",
|
|
2029
|
+
value: "reload",
|
|
2030
|
+
inset: true,
|
|
2031
|
+
shortcut: "⌘R",
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
type: "item",
|
|
2035
|
+
label: "More Tools",
|
|
2036
|
+
value: "more-tools",
|
|
2037
|
+
inset: true,
|
|
2038
|
+
showChevron: true,
|
|
2039
|
+
},
|
|
2040
|
+
{ type: "separator" },
|
|
2041
|
+
{
|
|
2042
|
+
type: "item",
|
|
2043
|
+
label: "Show Bookmarks Bar",
|
|
2044
|
+
value: "show-bookmarks",
|
|
2045
|
+
checked: true,
|
|
2046
|
+
},
|
|
2047
|
+
{ type: "item", label: "Show Full URLs", value: "show-urls", inset: true },
|
|
2048
|
+
{ type: "separator" },
|
|
2049
|
+
{ type: "label", label: "People" },
|
|
2050
|
+
{ type: "separator" },
|
|
2051
|
+
{ type: "item", label: "Pedro Duarte", value: "pedro", selectedDot: true },
|
|
2052
|
+
{ type: "item", label: "Colm Tuite", value: "colm", inset: true },
|
|
1812
2053
|
];
|
|
1813
|
-
this.className =
|
|
1814
|
-
this.triggerLabel =
|
|
2054
|
+
this.className = "";
|
|
2055
|
+
this.triggerLabel = "Right click here";
|
|
1815
2056
|
this.width = 300;
|
|
1816
2057
|
this.height = 150;
|
|
2058
|
+
this.panelClassName = "";
|
|
1817
2059
|
this.itemSelect = new EventEmitter();
|
|
1818
2060
|
this.open = false;
|
|
1819
2061
|
this.x = 0;
|
|
1820
2062
|
this.y = 0;
|
|
2063
|
+
this.overlayRef = null;
|
|
2064
|
+
this.outsideClickSub = null;
|
|
1821
2065
|
}
|
|
1822
|
-
ngOnInit() {
|
|
1823
|
-
this.boundPointerDown = (event) => this.onDocumentPointerDown(event);
|
|
1824
|
-
document.addEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
1825
|
-
}
|
|
2066
|
+
ngOnInit() { }
|
|
1826
2067
|
ngOnDestroy() {
|
|
1827
|
-
|
|
1828
|
-
document.removeEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
1829
|
-
}
|
|
2068
|
+
this.destroyOverlay();
|
|
1830
2069
|
}
|
|
1831
2070
|
onContextMenu(event) {
|
|
1832
2071
|
event.preventDefault();
|
|
2072
|
+
event.stopPropagation();
|
|
1833
2073
|
this.x = event.clientX;
|
|
1834
2074
|
this.y = event.clientY;
|
|
1835
2075
|
this.open = true;
|
|
2076
|
+
this.cdr.markForCheck();
|
|
2077
|
+
this.createOverlay();
|
|
1836
2078
|
}
|
|
1837
2079
|
select(item) {
|
|
1838
|
-
if (item.disabled ||
|
|
2080
|
+
if (item.disabled ||
|
|
2081
|
+
item.type === "separator" ||
|
|
2082
|
+
item.type === "label" ||
|
|
2083
|
+
!item.value)
|
|
1839
2084
|
return;
|
|
1840
2085
|
this.itemSelect.emit(item.value);
|
|
1841
2086
|
this.open = false;
|
|
2087
|
+
this.cdr.markForCheck();
|
|
2088
|
+
this.destroyOverlay();
|
|
1842
2089
|
}
|
|
1843
|
-
|
|
1844
|
-
if (this.open) {
|
|
1845
|
-
|
|
2090
|
+
onDocumentClick(event) {
|
|
2091
|
+
if (this.open && event.type === "click") {
|
|
2092
|
+
// Don't close on click inside the menu
|
|
2093
|
+
if (this.overlayRef &&
|
|
2094
|
+
this.overlayRef.overlayElement.contains(event.target)) {
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
this.close();
|
|
1846
2098
|
}
|
|
1847
2099
|
}
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
|
|
2100
|
+
createOverlay() {
|
|
2101
|
+
this.destroyOverlay();
|
|
2102
|
+
// Create global position strategy at cursor position
|
|
2103
|
+
const positionStrategy = this.overlay
|
|
2104
|
+
.position()
|
|
2105
|
+
.global()
|
|
2106
|
+
.left(`${this.x}px`)
|
|
2107
|
+
.top(`${this.y}px`);
|
|
2108
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
2109
|
+
this.overlayRef = this.overlay.create({
|
|
2110
|
+
positionStrategy,
|
|
2111
|
+
panelClass,
|
|
2112
|
+
});
|
|
2113
|
+
const portal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef);
|
|
2114
|
+
this.overlayRef.attach(portal);
|
|
2115
|
+
// Close on click outside
|
|
2116
|
+
this.outsideClickSub = this.overlayRef
|
|
2117
|
+
.outsidePointerEvents()
|
|
2118
|
+
.subscribe(() => {
|
|
2119
|
+
this.close();
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
close() {
|
|
2123
|
+
this.open = false;
|
|
2124
|
+
this.cdr.markForCheck();
|
|
2125
|
+
this.destroyOverlay();
|
|
2126
|
+
}
|
|
2127
|
+
destroyOverlay() {
|
|
2128
|
+
if (this.outsideClickSub) {
|
|
2129
|
+
this.outsideClickSub.unsubscribe();
|
|
2130
|
+
this.outsideClickSub = null;
|
|
2131
|
+
}
|
|
2132
|
+
if (this.overlayRef) {
|
|
2133
|
+
this.overlayRef.detach();
|
|
2134
|
+
this.overlayRef.dispose();
|
|
2135
|
+
this.overlayRef = null;
|
|
1854
2136
|
}
|
|
1855
2137
|
}
|
|
1856
2138
|
}
|
|
1857
|
-
PdmContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmContextMenuComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1858
|
-
PdmContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmContextMenuComponent, selector: "pdm-context-menu", inputs: { items: "items", className: "className", triggerLabel: "triggerLabel", width: "width", height: "height" }, outputs: { itemSelect: "itemSelect" }, host: { listeners: { "document:keydown.escape": "
|
|
2139
|
+
PdmContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmContextMenuComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2140
|
+
PdmContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmContextMenuComponent, selector: "pdm-context-menu", inputs: { items: "items", className: "className", triggerLabel: "triggerLabel", width: "width", height: "height", panelClassName: "panelClassName" }, outputs: { itemSelect: "itemSelect" }, host: { listeners: { "document:keydown.escape": "onDocumentClick()", "document:click": "onDocumentClick()" } }, viewQueries: [{ propertyName: "menuTemplateRef", first: true, predicate: ["menuTemplate"], descendants: true }], ngImport: i0, template: "<div\n class=\"relative\"\n [ngClass]=\"className\"\n (contextmenu)=\"onContextMenu($event)\"\n>\n <div\n class=\"flex items-center justify-center rounded-md border border-dashed border-border\"\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n >\n <span class=\"text-sm font-medium text-foreground\">{{ triggerLabel }}</span>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #menuTemplate>\n <div\n class=\"min-w-48 max-w-xs rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md sm:min-w-52\"\n >\n <div>\n <ng-container *ngFor=\"let item of items\">\n <div\n *ngIf=\"item.type === 'separator'\"\n class=\"-mx-1 my-1 h-px bg-muted\"\n ></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n class=\"px-2 py-1.5 text-sm font-semibold text-foreground\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n class=\"relative flex w-full appearance-none cursor-default select-none items-center rounded-sm border-0 bg-transparent py-1.5 pr-2 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\"\n [ngClass]=\"item.inset ? 'pl-8' : 'px-2'\"\n (click)=\"select(item)\"\n >\n <span\n class=\"mr-2 inline-flex w-4 shrink-0 items-center justify-center text-foreground\"\n >\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 12.5L9.2 16.7L19 7\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n <span\n *ngIf=\"item.selectedDot\"\n class=\"h-2 w-2 rounded-full bg-foreground\"\n ></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate text-foreground\">{{\n item.label\n }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{\n item.shortcut\n }}</span>\n <svg\n *ngIf=\"item.showChevron\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-muted-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 6L15 12L9 18\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1859
2141
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmContextMenuComponent, decorators: [{
|
|
1860
2142
|
type: Component,
|
|
1861
|
-
args: [{ selector:
|
|
1862
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { items: [{
|
|
2143
|
+
args: [{ selector: "pdm-context-menu", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"relative\"\n [ngClass]=\"className\"\n (contextmenu)=\"onContextMenu($event)\"\n>\n <div\n class=\"flex items-center justify-center rounded-md border border-dashed border-border\"\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n >\n <span class=\"text-sm font-medium text-foreground\">{{ triggerLabel }}</span>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #menuTemplate>\n <div\n class=\"min-w-48 max-w-xs rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md sm:min-w-52\"\n >\n <div>\n <ng-container *ngFor=\"let item of items\">\n <div\n *ngIf=\"item.type === 'separator'\"\n class=\"-mx-1 my-1 h-px bg-muted\"\n ></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n class=\"px-2 py-1.5 text-sm font-semibold text-foreground\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n class=\"relative flex w-full appearance-none cursor-default select-none items-center rounded-sm border-0 bg-transparent py-1.5 pr-2 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\"\n [ngClass]=\"item.inset ? 'pl-8' : 'px-2'\"\n (click)=\"select(item)\"\n >\n <span\n class=\"mr-2 inline-flex w-4 shrink-0 items-center justify-center text-foreground\"\n >\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 12.5L9.2 16.7L19 7\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n <span\n *ngIf=\"item.selectedDot\"\n class=\"h-2 w-2 rounded-full bg-foreground\"\n ></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate text-foreground\">{{\n item.label\n }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{\n item.shortcut\n }}</span>\n <svg\n *ngIf=\"item.showChevron\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-muted-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 6L15 12L9 18\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </ng-container>\n </div>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
2144
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
1863
2145
|
type: Input
|
|
1864
2146
|
}], className: [{
|
|
1865
2147
|
type: Input
|
|
@@ -1869,11 +2151,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1869
2151
|
type: Input
|
|
1870
2152
|
}], height: [{
|
|
1871
2153
|
type: Input
|
|
2154
|
+
}], panelClassName: [{
|
|
2155
|
+
type: Input
|
|
1872
2156
|
}], itemSelect: [{
|
|
1873
2157
|
type: Output
|
|
1874
|
-
}],
|
|
2158
|
+
}], menuTemplateRef: [{
|
|
2159
|
+
type: ViewChild,
|
|
2160
|
+
args: ["menuTemplate"]
|
|
2161
|
+
}], onDocumentClick: [{
|
|
1875
2162
|
type: HostListener,
|
|
1876
|
-
args: [
|
|
2163
|
+
args: ["document:keydown.escape"]
|
|
2164
|
+
}, {
|
|
2165
|
+
type: HostListener,
|
|
2166
|
+
args: ["document:click"]
|
|
1877
2167
|
}] } });
|
|
1878
2168
|
|
|
1879
2169
|
/**
|
|
@@ -2045,7 +2335,7 @@ class PdmTableComponent {
|
|
|
2045
2335
|
* - data: tabla con bordes y espaciado para data
|
|
2046
2336
|
* - interactive: tabla con hover, sticky header y estilos interactivos
|
|
2047
2337
|
*/
|
|
2048
|
-
this.variant =
|
|
2338
|
+
this.variant = "default";
|
|
2049
2339
|
/**
|
|
2050
2340
|
* Estrategia responsive para la tabla
|
|
2051
2341
|
* - scroll: scroll horizontal en mobile (default, más simple)
|
|
@@ -2053,11 +2343,11 @@ class PdmTableComponent {
|
|
|
2053
2343
|
* - stack: convierte filas en cards en mobile (requiere data-label en celdas)
|
|
2054
2344
|
* - collapse: oculta columnas menos importantes en mobile
|
|
2055
2345
|
*/
|
|
2056
|
-
this.responsiveStrategy =
|
|
2346
|
+
this.responsiveStrategy = "scroll";
|
|
2057
2347
|
/**
|
|
2058
2348
|
* Clases CSS adicionales para el wrapper
|
|
2059
2349
|
*/
|
|
2060
|
-
this.className =
|
|
2350
|
+
this.className = "";
|
|
2061
2351
|
/**
|
|
2062
2352
|
* Si es true, aplica padding negativo en mobile para scroll edge-to-edge
|
|
2063
2353
|
* Útil cuando la tabla está dentro de un container con padding
|
|
@@ -2065,119 +2355,128 @@ class PdmTableComponent {
|
|
|
2065
2355
|
this.fullBleed = false;
|
|
2066
2356
|
}
|
|
2067
2357
|
get wrapperClasses() {
|
|
2068
|
-
const baseClasses = [
|
|
2358
|
+
const baseClasses = ["relative", "w-full"];
|
|
2069
2359
|
const strategyClasses = this.getResponsiveStrategyClasses();
|
|
2070
2360
|
const variantClasses = this.getVariantWrapperClasses();
|
|
2071
2361
|
// Full bleed: scroll edge-to-edge en mobile
|
|
2072
|
-
if (this.fullBleed && this.responsiveStrategy ===
|
|
2073
|
-
baseClasses.push(
|
|
2362
|
+
if (this.fullBleed && this.responsiveStrategy === "scroll") {
|
|
2363
|
+
baseClasses.push("-mx-4", "px-4", "sm:mx-0", "sm:px-0");
|
|
2074
2364
|
}
|
|
2075
2365
|
return [
|
|
2076
2366
|
...baseClasses,
|
|
2077
2367
|
...strategyClasses,
|
|
2078
2368
|
...variantClasses,
|
|
2079
|
-
this.className
|
|
2369
|
+
this.className,
|
|
2080
2370
|
].filter(Boolean);
|
|
2081
2371
|
}
|
|
2082
2372
|
get tableClasses() {
|
|
2083
|
-
const baseClasses = [
|
|
2373
|
+
const baseClasses = ["w-full", "caption-bottom", "text-sm"];
|
|
2084
2374
|
const variantClasses = this.getVariantTableClasses();
|
|
2085
2375
|
const cellClasses = this.getCellClasses();
|
|
2086
2376
|
return [...baseClasses, ...variantClasses, ...cellClasses].filter(Boolean);
|
|
2087
2377
|
}
|
|
2088
2378
|
getResponsiveStrategyClasses() {
|
|
2089
2379
|
const strategy = TABLE_RESPONSIVE[this.responsiveStrategy];
|
|
2090
|
-
if (this.responsiveStrategy ===
|
|
2091
|
-
return [
|
|
2380
|
+
if (this.responsiveStrategy === "scroll") {
|
|
2381
|
+
return ["overflow-x-auto"];
|
|
2092
2382
|
}
|
|
2093
|
-
if (this.responsiveStrategy ===
|
|
2094
|
-
return [
|
|
2383
|
+
if (this.responsiveStrategy === "wrap") {
|
|
2384
|
+
return ["overflow-x-auto"];
|
|
2095
2385
|
}
|
|
2096
|
-
if (this.responsiveStrategy ===
|
|
2386
|
+
if (this.responsiveStrategy === "stack") {
|
|
2097
2387
|
// Stack requiere lógica en el template, aquí solo el wrapper
|
|
2098
2388
|
return [];
|
|
2099
2389
|
}
|
|
2100
|
-
if (this.responsiveStrategy ===
|
|
2101
|
-
return [
|
|
2390
|
+
if (this.responsiveStrategy === "collapse") {
|
|
2391
|
+
return ["overflow-x-auto"];
|
|
2102
2392
|
}
|
|
2103
|
-
return [
|
|
2393
|
+
return ["overflow-auto"];
|
|
2104
2394
|
}
|
|
2105
2395
|
getVariantWrapperClasses() {
|
|
2106
|
-
if (this.variant ===
|
|
2107
|
-
return [
|
|
2396
|
+
if (this.variant === "interactive") {
|
|
2397
|
+
return ["rounded-xl", "border", "border-border", "bg-background"];
|
|
2108
2398
|
}
|
|
2109
|
-
if (this.variant ===
|
|
2110
|
-
return [
|
|
2399
|
+
if (this.variant === "data") {
|
|
2400
|
+
return ["rounded-md", "border", "border-border", "bg-background"];
|
|
2111
2401
|
}
|
|
2112
2402
|
return [];
|
|
2113
2403
|
}
|
|
2114
2404
|
getVariantTableClasses() {
|
|
2115
|
-
if (this.variant ===
|
|
2405
|
+
if (this.variant === "data") {
|
|
2116
2406
|
return [
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2407
|
+
"border-collapse",
|
|
2408
|
+
"text-foreground",
|
|
2409
|
+
"[&_thead_tr]:border-b",
|
|
2410
|
+
"[&_thead_tr]:border-border",
|
|
2411
|
+
"[&_tbody_tr]:border-b",
|
|
2412
|
+
"[&_tbody_tr]:border-border",
|
|
2413
|
+
"[&_tbody_tr:last-child]:border-b-0",
|
|
2414
|
+
"[&_th]:h-10",
|
|
2415
|
+
"[&_th]:px-2",
|
|
2416
|
+
"[&_th]:text-left",
|
|
2417
|
+
"[&_th]:align-middle",
|
|
2418
|
+
"[&_th]:font-medium",
|
|
2419
|
+
"[&_td]:p-2",
|
|
2420
|
+
"[&_td]:align-middle",
|
|
2131
2421
|
];
|
|
2132
2422
|
}
|
|
2133
|
-
if (this.variant ===
|
|
2423
|
+
if (this.variant === "interactive") {
|
|
2134
2424
|
return [
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2425
|
+
"text-foreground",
|
|
2426
|
+
"[&_thead]:sticky",
|
|
2427
|
+
"[&_thead]:top-0",
|
|
2428
|
+
"[&_thead]:z-10",
|
|
2429
|
+
"[&_thead]:bg-muted/70",
|
|
2430
|
+
"[&_thead_tr]:border-b",
|
|
2431
|
+
"[&_thead_tr]:border-border",
|
|
2432
|
+
"[&_th]:h-12",
|
|
2433
|
+
"[&_th]:px-4",
|
|
2434
|
+
"[&_th]:text-left",
|
|
2435
|
+
"[&_th]:align-middle",
|
|
2436
|
+
"[&_th]:text-sm",
|
|
2437
|
+
"[&_th]:font-medium",
|
|
2438
|
+
"[&_tbody_tr]:border-b",
|
|
2439
|
+
"[&_tbody_tr]:border-border",
|
|
2440
|
+
"[&_tbody_tr]:transition-colors",
|
|
2441
|
+
"[&_tbody_tr:hover]:bg-muted/50",
|
|
2442
|
+
"[&_tbody_tr:last-child]:border-b-0",
|
|
2443
|
+
"[&_td]:h-14",
|
|
2444
|
+
"[&_td]:px-4",
|
|
2445
|
+
"[&_td]:align-middle",
|
|
2446
|
+
"[&_td]:text-sm",
|
|
2447
|
+
"[&_svg]:text-muted-foreground",
|
|
2158
2448
|
];
|
|
2159
2449
|
}
|
|
2160
2450
|
return [];
|
|
2161
2451
|
}
|
|
2162
2452
|
getCellClasses() {
|
|
2163
2453
|
// Manejo responsive de whitespace
|
|
2164
|
-
if (this.responsiveStrategy ===
|
|
2454
|
+
if (this.responsiveStrategy === "scroll") {
|
|
2165
2455
|
// En scroll, permitir wrap en mobile, nowrap en desktop
|
|
2166
|
-
return [
|
|
2456
|
+
return [
|
|
2457
|
+
"[&_td]:whitespace-normal",
|
|
2458
|
+
"[&_th]:whitespace-normal",
|
|
2459
|
+
"sm:[&_td]:whitespace-nowrap",
|
|
2460
|
+
"sm:[&_th]:whitespace-nowrap",
|
|
2461
|
+
];
|
|
2167
2462
|
}
|
|
2168
|
-
if (this.responsiveStrategy ===
|
|
2463
|
+
if (this.responsiveStrategy === "wrap") {
|
|
2169
2464
|
// En wrap, siempre permitir wrap
|
|
2170
|
-
return [
|
|
2465
|
+
return [
|
|
2466
|
+
"[&_td]:whitespace-normal",
|
|
2467
|
+
"[&_td]:break-words",
|
|
2468
|
+
"[&_th]:whitespace-normal",
|
|
2469
|
+
];
|
|
2171
2470
|
}
|
|
2172
2471
|
// Default: nowrap (comportamiento anterior para backward compatibility)
|
|
2173
2472
|
return [];
|
|
2174
2473
|
}
|
|
2175
2474
|
}
|
|
2176
2475
|
PdmTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2177
|
-
PdmTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTableComponent, selector: "pdm-table", inputs: { variant: "variant", responsiveStrategy: "responsiveStrategy", className: "className", fullBleed: "fullBleed" }, ngImport: i0, template: "<div [ngClass]=\"wrapperClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table-container' : null\">\n <table #tableElement [ngClass]=\"tableClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table' : null\">\n <ng-content></ng-content>\n </table>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2476
|
+
PdmTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTableComponent, selector: "pdm-table", inputs: { variant: "variant", responsiveStrategy: "responsiveStrategy", className: "className", fullBleed: "fullBleed" }, ngImport: i0, template: "<div [ngClass]=\"wrapperClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table-container' : null\">\n <table #tableElement [ngClass]=\"tableClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table' : null\">\n <ng-content></ng-content>\n </table>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2178
2477
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTableComponent, decorators: [{
|
|
2179
2478
|
type: Component,
|
|
2180
|
-
args: [{ selector:
|
|
2479
|
+
args: [{ selector: "pdm-table", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"wrapperClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table-container' : null\">\n <table #tableElement [ngClass]=\"tableClasses\" [attr.data-slot]=\"variant === 'interactive' ? 'table' : null\">\n <ng-content></ng-content>\n </table>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
2181
2480
|
}], propDecorators: { variant: [{
|
|
2182
2481
|
type: Input
|
|
2183
2482
|
}], responsiveStrategy: [{
|
|
@@ -2423,10 +2722,10 @@ class PdmDataTableComponent {
|
|
|
2423
2722
|
}
|
|
2424
2723
|
}
|
|
2425
2724
|
PdmDataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2426
|
-
PdmDataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDataTableComponent, selector: "pdm-data-table", inputs: { className: "className", columns: "columns", responsiveStrategy: "responsiveStrategy", selectable: "selectable", showActions: "showActions", showFilter: "showFilter", showPagination: "showPagination", showColumnSelector: "showColumnSelector", filterPlaceholder: "filterPlaceholder", columnsLabel: "columnsLabel", previousLabel: "previousLabel", nextLabel: "nextLabel", emptyLabel: "emptyLabel", rowsSelectedLabel: "rowsSelectedLabel", statusLabel: "statusLabel", emailLabel: "emailLabel", amountLabel: "amountLabel", rows: "rows", page: "page", pageSize: "pageSize", query: "query", filterFn: "filterFn" }, outputs: { queryChange: "queryChange", rowAction: "rowAction", pageChange: "pageChange", selectionChange: "selectionChange", columnSort: "columnSort" }, ngImport: i0, template: "<section [ngClass]=\"['flex w-full flex-col', className]\">\n <!-- Toolbar: Filtro + Selector de columnas -->\n <div
|
|
2725
|
+
PdmDataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDataTableComponent, selector: "pdm-data-table", inputs: { className: "className", columns: "columns", responsiveStrategy: "responsiveStrategy", selectable: "selectable", showActions: "showActions", showFilter: "showFilter", showPagination: "showPagination", showColumnSelector: "showColumnSelector", filterPlaceholder: "filterPlaceholder", columnsLabel: "columnsLabel", previousLabel: "previousLabel", nextLabel: "nextLabel", emptyLabel: "emptyLabel", rowsSelectedLabel: "rowsSelectedLabel", statusLabel: "statusLabel", emailLabel: "emailLabel", amountLabel: "amountLabel", rows: "rows", page: "page", pageSize: "pageSize", query: "query", filterFn: "filterFn" }, outputs: { queryChange: "queryChange", rowAction: "rowAction", pageChange: "pageChange", selectionChange: "selectionChange", columnSort: "columnSort" }, ngImport: i0, template: "<section [ngClass]=\"['flex w-full flex-col', className]\">\n <!-- Toolbar: Filtro + Selector de columnas -->\n <div\n *ngIf=\"showFilter || showColumnSelector\"\n class=\"flex w-full flex-col gap-2 py-4 sm:flex-row sm:items-center\"\n >\n <input\n *ngIf=\"showFilter\"\n type=\"text\"\n [placeholder]=\"filterPlaceholder\"\n [value]=\"query\"\n (input)=\"onQueryInput($event)\"\n class=\"h-9 flex-1 rounded-md border border-input bg-transparent px-3 py-1 text-sm text-foreground shadow-sm placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n\n <button\n *ngIf=\"showColumnSelector\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-medium text-foreground shadow-sm whitespace-nowrap\"\n >\n <span>{{ columnsLabel }}</span>\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 10L12 15L17 10\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </div>\n\n <!-- Tabla con responsive -->\n <pdm-table\n variant=\"data\"\n [responsiveStrategy]=\"responsiveStrategy\"\n [fullBleed]=\"false\"\n >\n <thead>\n <tr>\n <!-- Columna de selecci\u00F3n -->\n <th *ngIf=\"selectable\" class=\"w-10 px-2 py-2 text-left font-medium\">\n <input\n type=\"checkbox\"\n (change)=\"onToggleAll($event)\"\n class=\"h-4 w-4 rounded-sm border border-input\"\n />\n </th>\n\n <!-- Columnas din\u00E1micas -->\n <th\n *ngFor=\"let column of effectiveColumns\"\n [ngClass]=\"getHeaderClass(column)\"\n [ngStyle]=\"getColumnStyle(column)\"\n >\n <!-- Header sortable -->\n <button\n *ngIf=\"column.sortable\"\n type=\"button\"\n (click)=\"onSort(column)\"\n class=\"inline-flex appearance-none items-center gap-1 rounded-sm border-0 bg-transparent px-3 py-2 text-sm hover:underline\"\n >\n <span>{{ column.label }}</span>\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8 6L4 10L8 14M16 18L20 14L16 10\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n\n <!-- Header no sortable -->\n <span *ngIf=\"!column.sortable\">{{ column.label }}</span>\n </th>\n\n <!-- Columna de acciones -->\n <th *ngIf=\"showActions\" class=\"w-10 px-2 py-2\"></th>\n </tr>\n </thead>\n\n <tbody>\n <!-- Filas con datos -->\n <tr *ngFor=\"let row of pagedRows\">\n <!-- Celda de selecci\u00F3n -->\n <td *ngIf=\"selectable\" class=\"px-2 py-2\">\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n class=\"h-4 w-4 rounded-sm border border-input\"\n />\n </td>\n\n <!-- Celdas din\u00E1micas -->\n <td\n *ngFor=\"let column of effectiveColumns\"\n [ngClass]=\"getCellClass(column)\"\n >\n <!-- Template personalizado si existe -->\n <ng-container *ngIf=\"column.cellTemplate; else defaultCell\">\n <ng-container\n *ngTemplateOutlet=\"\n column.cellTemplate;\n context: { $implicit: row, value: row[column.key] }\n \"\n >\n </ng-container>\n </ng-container>\n\n <!-- Renderizado default -->\n <ng-template #defaultCell>\n {{ getCellValue(row, column) }}\n </ng-template>\n </td>\n\n <!-- Celda de acciones -->\n <td *ngIf=\"showActions\" class=\"px-2 py-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 appearance-none items-center justify-center border-0 bg-transparent p-0 hover:text-foreground\"\n (click)=\"onAction(row)\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"6\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n <circle cx=\"12\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n <circle cx=\"18\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n </svg>\n </button>\n </td>\n </tr>\n\n <!-- Fila vac\u00EDa -->\n <tr *ngIf=\"pagedRows.length === 0\">\n <td\n [attr.colspan]=\"\n effectiveColumns.length +\n (selectable ? 1 : 0) +\n (showActions ? 1 : 0)\n \"\n class=\"px-3 py-6 text-center text-sm text-muted-foreground\"\n >\n {{ emptyLabel }}\n </td>\n </tr>\n </tbody>\n </pdm-table>\n\n <!-- Footer: Info + Paginaci\u00F3n -->\n <div\n *ngIf=\"showPagination || selectable\"\n class=\"flex w-full flex-wrap items-center gap-2 py-4 sm:flex-nowrap\"\n >\n <p\n *ngIf=\"selectable\"\n class=\"m-0 flex-1 pr-2 text-sm text-muted-foreground whitespace-nowrap\"\n >\n {{ selectedCount }} of {{ rows.length }} {{ rowsSelectedLabel }}\n </p>\n\n <div *ngIf=\"showPagination\" class=\"flex items-center gap-2 ml-auto\">\n <span class=\"text-sm text-muted-foreground whitespace-nowrap\">\n Page {{ page }} of {{ totalPages }}\n </span>\n <button\n type=\"button\"\n class=\"h-9 appearance-none rounded-md border border-input bg-background px-4 text-sm font-medium text-foreground shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n [disabled]=\"page <= 1\"\n (click)=\"previous()\"\n >\n {{ previousLabel }}\n </button>\n <button\n type=\"button\"\n class=\"h-9 appearance-none rounded-md border border-input bg-background px-4 text-sm font-medium text-foreground shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n [disabled]=\"page >= totalPages\"\n (click)=\"next()\"\n >\n {{ nextLabel }}\n </button>\n </div>\n </div>\n</section>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PdmTableComponent, selector: "pdm-table", inputs: ["variant", "responsiveStrategy", "className", "fullBleed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2427
2726
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDataTableComponent, decorators: [{
|
|
2428
2727
|
type: Component,
|
|
2429
|
-
args: [{ selector: 'pdm-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<section [ngClass]=\"['flex w-full flex-col', className]\">\n <!-- Toolbar: Filtro + Selector de columnas -->\n <div
|
|
2728
|
+
args: [{ selector: 'pdm-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<section [ngClass]=\"['flex w-full flex-col', className]\">\n <!-- Toolbar: Filtro + Selector de columnas -->\n <div\n *ngIf=\"showFilter || showColumnSelector\"\n class=\"flex w-full flex-col gap-2 py-4 sm:flex-row sm:items-center\"\n >\n <input\n *ngIf=\"showFilter\"\n type=\"text\"\n [placeholder]=\"filterPlaceholder\"\n [value]=\"query\"\n (input)=\"onQueryInput($event)\"\n class=\"h-9 flex-1 rounded-md border border-input bg-transparent px-3 py-1 text-sm text-foreground shadow-sm placeholder:text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n\n <button\n *ngIf=\"showColumnSelector\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-medium text-foreground shadow-sm whitespace-nowrap\"\n >\n <span>{{ columnsLabel }}</span>\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 10L12 15L17 10\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n </div>\n\n <!-- Tabla con responsive -->\n <pdm-table\n variant=\"data\"\n [responsiveStrategy]=\"responsiveStrategy\"\n [fullBleed]=\"false\"\n >\n <thead>\n <tr>\n <!-- Columna de selecci\u00F3n -->\n <th *ngIf=\"selectable\" class=\"w-10 px-2 py-2 text-left font-medium\">\n <input\n type=\"checkbox\"\n (change)=\"onToggleAll($event)\"\n class=\"h-4 w-4 rounded-sm border border-input\"\n />\n </th>\n\n <!-- Columnas din\u00E1micas -->\n <th\n *ngFor=\"let column of effectiveColumns\"\n [ngClass]=\"getHeaderClass(column)\"\n [ngStyle]=\"getColumnStyle(column)\"\n >\n <!-- Header sortable -->\n <button\n *ngIf=\"column.sortable\"\n type=\"button\"\n (click)=\"onSort(column)\"\n class=\"inline-flex appearance-none items-center gap-1 rounded-sm border-0 bg-transparent px-3 py-2 text-sm hover:underline\"\n >\n <span>{{ column.label }}</span>\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8 6L4 10L8 14M16 18L20 14L16 10\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </svg>\n </button>\n\n <!-- Header no sortable -->\n <span *ngIf=\"!column.sortable\">{{ column.label }}</span>\n </th>\n\n <!-- Columna de acciones -->\n <th *ngIf=\"showActions\" class=\"w-10 px-2 py-2\"></th>\n </tr>\n </thead>\n\n <tbody>\n <!-- Filas con datos -->\n <tr *ngFor=\"let row of pagedRows\">\n <!-- Celda de selecci\u00F3n -->\n <td *ngIf=\"selectable\" class=\"px-2 py-2\">\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n class=\"h-4 w-4 rounded-sm border border-input\"\n />\n </td>\n\n <!-- Celdas din\u00E1micas -->\n <td\n *ngFor=\"let column of effectiveColumns\"\n [ngClass]=\"getCellClass(column)\"\n >\n <!-- Template personalizado si existe -->\n <ng-container *ngIf=\"column.cellTemplate; else defaultCell\">\n <ng-container\n *ngTemplateOutlet=\"\n column.cellTemplate;\n context: { $implicit: row, value: row[column.key] }\n \"\n >\n </ng-container>\n </ng-container>\n\n <!-- Renderizado default -->\n <ng-template #defaultCell>\n {{ getCellValue(row, column) }}\n </ng-template>\n </td>\n\n <!-- Celda de acciones -->\n <td *ngIf=\"showActions\" class=\"px-2 py-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 w-8 appearance-none items-center justify-center border-0 bg-transparent p-0 hover:text-foreground\"\n (click)=\"onAction(row)\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n class=\"h-4 w-4\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"6\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n <circle cx=\"12\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n <circle cx=\"18\" cy=\"12\" r=\"1.5\" fill=\"currentColor\"></circle>\n </svg>\n </button>\n </td>\n </tr>\n\n <!-- Fila vac\u00EDa -->\n <tr *ngIf=\"pagedRows.length === 0\">\n <td\n [attr.colspan]=\"\n effectiveColumns.length +\n (selectable ? 1 : 0) +\n (showActions ? 1 : 0)\n \"\n class=\"px-3 py-6 text-center text-sm text-muted-foreground\"\n >\n {{ emptyLabel }}\n </td>\n </tr>\n </tbody>\n </pdm-table>\n\n <!-- Footer: Info + Paginaci\u00F3n -->\n <div\n *ngIf=\"showPagination || selectable\"\n class=\"flex w-full flex-wrap items-center gap-2 py-4 sm:flex-nowrap\"\n >\n <p\n *ngIf=\"selectable\"\n class=\"m-0 flex-1 pr-2 text-sm text-muted-foreground whitespace-nowrap\"\n >\n {{ selectedCount }} of {{ rows.length }} {{ rowsSelectedLabel }}\n </p>\n\n <div *ngIf=\"showPagination\" class=\"flex items-center gap-2 ml-auto\">\n <span class=\"text-sm text-muted-foreground whitespace-nowrap\">\n Page {{ page }} of {{ totalPages }}\n </span>\n <button\n type=\"button\"\n class=\"h-9 appearance-none rounded-md border border-input bg-background px-4 text-sm font-medium text-foreground shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n [disabled]=\"page <= 1\"\n (click)=\"previous()\"\n >\n {{ previousLabel }}\n </button>\n <button\n type=\"button\"\n class=\"h-9 appearance-none rounded-md border border-input bg-background px-4 text-sm font-medium text-foreground shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n [disabled]=\"page >= totalPages\"\n (click)=\"next()\"\n >\n {{ nextLabel }}\n </button>\n </div>\n </div>\n</section>\n" }]
|
|
2430
2729
|
}], propDecorators: { className: [{
|
|
2431
2730
|
type: Input
|
|
2432
2731
|
}], columns: [{
|
|
@@ -2559,8 +2858,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2559
2858
|
|
|
2560
2859
|
let nextDatePickerId = 0;
|
|
2561
2860
|
class PdmDatePickerComponent {
|
|
2562
|
-
constructor(
|
|
2563
|
-
this.elementRef = elementRef;
|
|
2861
|
+
constructor(cdr, overlay, viewContainerRef) {
|
|
2564
2862
|
this.cdr = cdr;
|
|
2565
2863
|
this.overlay = overlay;
|
|
2566
2864
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -2571,21 +2869,21 @@ class PdmDatePickerComponent {
|
|
|
2571
2869
|
this.triggerFocused = false;
|
|
2572
2870
|
this.overlayRef = null;
|
|
2573
2871
|
this.backdropSub = null;
|
|
2574
|
-
this.id =
|
|
2575
|
-
this.variant =
|
|
2576
|
-
this.label =
|
|
2577
|
-
this.labelClassName =
|
|
2578
|
-
this.className =
|
|
2579
|
-
this.triggerClassName =
|
|
2872
|
+
this.id = "";
|
|
2873
|
+
this.variant = "single";
|
|
2874
|
+
this.label = "";
|
|
2875
|
+
this.labelClassName = "";
|
|
2876
|
+
this.className = "";
|
|
2877
|
+
this.triggerClassName = "";
|
|
2580
2878
|
/**
|
|
2581
2879
|
* Additional CSS classes applied to the overlay panel.
|
|
2582
2880
|
* Backward-compatible: mapped to `overlayOptions.panelClass` when `overlayOptions` is not set.
|
|
2583
2881
|
* When both are supplied, `overlayOptions.panelClass` takes precedence.
|
|
2584
2882
|
*/
|
|
2585
|
-
this.panelClassName =
|
|
2586
|
-
this.placeholder =
|
|
2587
|
-
this.rangePlaceholder =
|
|
2588
|
-
this.format =
|
|
2883
|
+
this.panelClassName = "";
|
|
2884
|
+
this.placeholder = "Pick a date";
|
|
2885
|
+
this.rangePlaceholder = "Pick a date range";
|
|
2886
|
+
this.format = "MMM d, yyyy";
|
|
2589
2887
|
this.disabled = false;
|
|
2590
2888
|
this.readonly = false;
|
|
2591
2889
|
this.required = false;
|
|
@@ -2606,7 +2904,7 @@ class PdmDatePickerComponent {
|
|
|
2606
2904
|
set open(value) {
|
|
2607
2905
|
if (this._open === !!value)
|
|
2608
2906
|
return;
|
|
2609
|
-
if (
|
|
2907
|
+
if (value) {
|
|
2610
2908
|
this.openPanel();
|
|
2611
2909
|
}
|
|
2612
2910
|
else {
|
|
@@ -2627,7 +2925,7 @@ class PdmDatePickerComponent {
|
|
|
2627
2925
|
this._rangeValue = value
|
|
2628
2926
|
? {
|
|
2629
2927
|
start: this.normalizeDate(value.start),
|
|
2630
|
-
end: this.normalizeDate(value.end)
|
|
2928
|
+
end: this.normalizeDate(value.end),
|
|
2631
2929
|
}
|
|
2632
2930
|
: null;
|
|
2633
2931
|
this.cdr.markForCheck();
|
|
@@ -2639,7 +2937,7 @@ class PdmDatePickerComponent {
|
|
|
2639
2937
|
this.destroyOverlay();
|
|
2640
2938
|
}
|
|
2641
2939
|
get resolvedVariant() {
|
|
2642
|
-
return this.variant ===
|
|
2940
|
+
return this.variant === "range" ? "range" : "single";
|
|
2643
2941
|
}
|
|
2644
2942
|
get triggerId() {
|
|
2645
2943
|
return this.id || `${this.instanceId}-trigger`;
|
|
@@ -2648,13 +2946,13 @@ class PdmDatePickerComponent {
|
|
|
2648
2946
|
return `${this.id || this.instanceId}-panel`;
|
|
2649
2947
|
}
|
|
2650
2948
|
get hasSingleValue() {
|
|
2651
|
-
return this.resolvedVariant ===
|
|
2949
|
+
return this.resolvedVariant === "single" && !!this._value;
|
|
2652
2950
|
}
|
|
2653
2951
|
get hasRangeValue() {
|
|
2654
|
-
return this.resolvedVariant ===
|
|
2952
|
+
return this.resolvedVariant === "range" && !!this._rangeValue?.start;
|
|
2655
2953
|
}
|
|
2656
2954
|
get displayText() {
|
|
2657
|
-
if (this.resolvedVariant ===
|
|
2955
|
+
if (this.resolvedVariant === "single") {
|
|
2658
2956
|
return this._value ? this.formatDate(this._value) : this.placeholder;
|
|
2659
2957
|
}
|
|
2660
2958
|
const start = this._rangeValue?.start ?? null;
|
|
@@ -2668,29 +2966,29 @@ class PdmDatePickerComponent {
|
|
|
2668
2966
|
return `${this.formatDate(start)} - ${this.formatDate(end)}`;
|
|
2669
2967
|
}
|
|
2670
2968
|
get textClasses() {
|
|
2671
|
-
const hasValue = this.resolvedVariant ===
|
|
2969
|
+
const hasValue = this.resolvedVariant === "single"
|
|
2970
|
+
? this.hasSingleValue
|
|
2971
|
+
: this.hasRangeValue;
|
|
2672
2972
|
return [
|
|
2673
|
-
|
|
2674
|
-
hasValue ?
|
|
2973
|
+
"min-w-0 flex-1 truncate text-left text-sm leading-5",
|
|
2974
|
+
hasValue ? "text-foreground" : "text-muted-foreground",
|
|
2675
2975
|
];
|
|
2676
2976
|
}
|
|
2677
2977
|
get rootClasses() {
|
|
2678
2978
|
return [
|
|
2679
|
-
|
|
2680
|
-
this.resolvedVariant ===
|
|
2681
|
-
this.className
|
|
2979
|
+
"grid gap-2",
|
|
2980
|
+
this.resolvedVariant === "range" ? "w-[280px]" : "w-[197px]",
|
|
2981
|
+
this.className,
|
|
2682
2982
|
];
|
|
2683
2983
|
}
|
|
2684
2984
|
get triggerClasses() {
|
|
2685
2985
|
const focusStyle = this._open || this.triggerFocused;
|
|
2686
2986
|
return [
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
focusStyle
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
this.invalid ? 'border-destructive ring-destructive/20' : '',
|
|
2693
|
-
this.triggerClassName
|
|
2987
|
+
"border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive relative flex w-full appearance-none items-center gap-2 overflow-hidden rounded-lg border bg-background px-3 py-[7.5px] text-left text-sm shadow-sm outline-none transition-colors",
|
|
2988
|
+
"min-h-[36px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
2989
|
+
focusStyle ? "border-ring ring-2 ring-ring/50" : "",
|
|
2990
|
+
this.invalid ? "border-destructive ring-destructive/20" : "",
|
|
2991
|
+
this.triggerClassName,
|
|
2694
2992
|
];
|
|
2695
2993
|
}
|
|
2696
2994
|
toggleOpen() {
|
|
@@ -2721,16 +3019,22 @@ class PdmDatePickerComponent {
|
|
|
2721
3019
|
this._rangeValue = value
|
|
2722
3020
|
? {
|
|
2723
3021
|
start: this.normalizeDate(value.start),
|
|
2724
|
-
end: this.normalizeDate(value.end)
|
|
3022
|
+
end: this.normalizeDate(value.end),
|
|
2725
3023
|
}
|
|
2726
3024
|
: null;
|
|
2727
3025
|
this.rangeValueChange.emit(this._rangeValue
|
|
2728
3026
|
? {
|
|
2729
|
-
start: this._rangeValue.start
|
|
2730
|
-
|
|
3027
|
+
start: this._rangeValue.start
|
|
3028
|
+
? this.cloneDate(this._rangeValue.start)
|
|
3029
|
+
: null,
|
|
3030
|
+
end: this._rangeValue.end
|
|
3031
|
+
? this.cloneDate(this._rangeValue.end)
|
|
3032
|
+
: null,
|
|
2731
3033
|
}
|
|
2732
3034
|
: null);
|
|
2733
|
-
if (this.closeOnSelect &&
|
|
3035
|
+
if (this.closeOnSelect &&
|
|
3036
|
+
this._rangeValue?.start &&
|
|
3037
|
+
this._rangeValue?.end) {
|
|
2734
3038
|
this.setOpen(false);
|
|
2735
3039
|
return;
|
|
2736
3040
|
}
|
|
@@ -2765,20 +3069,26 @@ class PdmDatePickerComponent {
|
|
|
2765
3069
|
this.openChange.emit(true);
|
|
2766
3070
|
this.cdr.markForCheck();
|
|
2767
3071
|
const positionStrategy = createFlexiblePositionStrategy(this.overlay, triggerEl, 8);
|
|
2768
|
-
//
|
|
3072
|
+
// CRITICAL: Use mergeOverlayPanelClass to ensure z-index is never lost.
|
|
3073
|
+
// Consumer classes are appended AFTER base z-index.
|
|
3074
|
+
const zIndexEnforced = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
3075
|
+
// Resolve panelClass: overlayOptions.panelClass wins; otherwise use z-index enforced.
|
|
2769
3076
|
const resolvedPanelClass = this.overlayOptions?.panelClass
|
|
2770
|
-
|
|
3077
|
+
? mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.overlayOptions.panelClass)
|
|
3078
|
+
: zIndexEnforced;
|
|
2771
3079
|
this.overlayRef = this.overlay.create({
|
|
2772
3080
|
positionStrategy,
|
|
2773
3081
|
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
2774
|
-
// Consumer overrides are spread
|
|
3082
|
+
// Consumer overrides are spread first.
|
|
2775
3083
|
...this.overlayOptions,
|
|
2776
|
-
// panelClass always
|
|
2777
|
-
panelClass: resolvedPanelClass
|
|
3084
|
+
// panelClass always enforced last to preserve z-index.
|
|
3085
|
+
panelClass: resolvedPanelClass,
|
|
2778
3086
|
});
|
|
2779
3087
|
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
2780
3088
|
this.overlayRef.attach(portal);
|
|
2781
|
-
this.backdropSub = this.overlayRef
|
|
3089
|
+
this.backdropSub = this.overlayRef
|
|
3090
|
+
.outsidePointerEvents()
|
|
3091
|
+
.subscribe((event) => {
|
|
2782
3092
|
const target = event.target;
|
|
2783
3093
|
if (!triggerEl.contains(target)) {
|
|
2784
3094
|
this.closePanel();
|
|
@@ -2806,10 +3116,10 @@ class PdmDatePickerComponent {
|
|
|
2806
3116
|
}
|
|
2807
3117
|
formatDate(date) {
|
|
2808
3118
|
try {
|
|
2809
|
-
return format(date, this.format ||
|
|
3119
|
+
return format(date, this.format || "MMM d, yyyy");
|
|
2810
3120
|
}
|
|
2811
3121
|
catch {
|
|
2812
|
-
return format(date,
|
|
3122
|
+
return format(date, "MMM d, yyyy");
|
|
2813
3123
|
}
|
|
2814
3124
|
}
|
|
2815
3125
|
normalizeDate(value) {
|
|
@@ -2822,17 +3132,17 @@ class PdmDatePickerComponent {
|
|
|
2822
3132
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
2823
3133
|
}
|
|
2824
3134
|
}
|
|
2825
|
-
PdmDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, deps: [{ token: i0.
|
|
3135
|
+
PdmDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2826
3136
|
PdmDatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDatePickerComponent, selector: "pdm-date-picker", inputs: { id: "id", variant: "variant", label: "label", labelClassName: "labelClassName", className: "className", triggerClassName: "triggerClassName", panelClassName: "panelClassName", overlayOptions: "overlayOptions", placeholder: "placeholder", rangePlaceholder: "rangePlaceholder", format: "format", disabled: "disabled", readonly: "readonly", required: "required", invalid: "invalid", allowSameDayRange: "allowSameDayRange", closeOnSelect: "closeOnSelect", minDate: "minDate", maxDate: "maxDate", minYear: "minYear", maxYear: "maxYear", disabledDates: "disabledDates", isDateDisabled: "isDateDisabled", open: "open", value: "value", rangeValue: "rangeValue" }, outputs: { valueChange: "valueChange", rangeValueChange: "rangeValueChange", openChange: "openChange", monthChange: "monthChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmCalendarComponent, selector: "pdm-calendar", inputs: ["variant", "className", "disabledDates", "minDate", "maxDate", "minYear", "maxYear", "isDateDisabled", "allowSameDayRange", "readonly", "value", "rangeValue", "month"], outputs: ["valueChange", "rangeValueChange", "monthChange", "dateClick", "disabledDateClick"] }, { kind: "component", type: PdmLabelComponent, selector: "pdm-label", inputs: ["forId", "required", "className"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2827
3137
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, decorators: [{
|
|
2828
3138
|
type: Component,
|
|
2829
|
-
args: [{ selector:
|
|
2830
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
3139
|
+
args: [{ selector: "pdm-date-picker", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n" }]
|
|
3140
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { triggerRef: [{
|
|
2831
3141
|
type: ViewChild,
|
|
2832
|
-
args: [
|
|
3142
|
+
args: ["triggerEl"]
|
|
2833
3143
|
}], panelTemplateRef: [{
|
|
2834
3144
|
type: ViewChild,
|
|
2835
|
-
args: [
|
|
3145
|
+
args: ["panelTemplate"]
|
|
2836
3146
|
}], id: [{
|
|
2837
3147
|
type: Input
|
|
2838
3148
|
}], variant: [{
|
|
@@ -2895,7 +3205,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2895
3205
|
type: Input
|
|
2896
3206
|
}], onEscape: [{
|
|
2897
3207
|
type: HostListener,
|
|
2898
|
-
args: [
|
|
3208
|
+
args: ["document:keydown.escape"]
|
|
2899
3209
|
}] } });
|
|
2900
3210
|
|
|
2901
3211
|
/**
|
|
@@ -2905,15 +3215,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2905
3215
|
* 1. base (z-0) - Elementos normales del DOM
|
|
2906
3216
|
* 2. dropdown (z-10) - Selects, combobox, date-pickers
|
|
2907
3217
|
* 3. sticky (z-20) - Headers, navigation bars
|
|
2908
|
-
* 4.
|
|
3218
|
+
* 4. drawerBackdrop (z-30) - Backdrop de drawers
|
|
2909
3219
|
* 5. drawer (z-40) - Sidebar drawer, sheets laterales
|
|
2910
|
-
* 6.
|
|
2911
|
-
* 7. modal
|
|
2912
|
-
* 8. popover (z-
|
|
3220
|
+
* 6. modalBackdrop (z-40) - Backdrop de modals ( mismo nivel que drawer)
|
|
3221
|
+
* 7. modal (z-50) - Dialogs, alert-dialogs
|
|
3222
|
+
* 8. popover (z-[70]) - Tooltips, dropdowns DENTRO de modals
|
|
2913
3223
|
* 9. toast (z-[100]) - Notificaciones que deben estar sobre TODO
|
|
2914
3224
|
*
|
|
2915
3225
|
* REGLA CRÍTICA:
|
|
2916
|
-
* - Componentes overlay (select options, dropdown menu, tooltip) SIEMPRE z-
|
|
3226
|
+
* - Componentes overlay (select options, dropdown menu, tooltip) SIEMPRE z-[70] o mayor
|
|
2917
3227
|
* - Esto permite que funcionen DENTRO de modals (z-50)
|
|
2918
3228
|
* - Backdrop de modal debe ser z-40 para estar DEBAJO del contenido del modal (z-50)
|
|
2919
3229
|
*/
|
|
@@ -2921,57 +3231,53 @@ const Z_INDEX = {
|
|
|
2921
3231
|
/**
|
|
2922
3232
|
* Base - contenido normal del DOM
|
|
2923
3233
|
*/
|
|
2924
|
-
base:
|
|
3234
|
+
base: "z-0",
|
|
2925
3235
|
/**
|
|
2926
3236
|
* Dropdown - Selects, combobox, date-pickers
|
|
2927
|
-
* Debe estar SOBRE contenido normal pero BAJO
|
|
3237
|
+
* Debe estar SOBRE contenido normal pero BAJO overlays
|
|
2928
3238
|
*/
|
|
2929
|
-
dropdown:
|
|
3239
|
+
dropdown: "z-10",
|
|
2930
3240
|
/**
|
|
2931
3241
|
* Sticky - Headers, navigation fija
|
|
2932
3242
|
*/
|
|
2933
|
-
sticky:
|
|
2934
|
-
/**
|
|
2935
|
-
* Overlay - Popovers, hover cards, context menus
|
|
2936
|
-
* Debe estar SOBRE sticky pero BAJO modals
|
|
2937
|
-
*/
|
|
2938
|
-
overlay: 'z-30',
|
|
3243
|
+
sticky: "z-20",
|
|
2939
3244
|
/**
|
|
2940
3245
|
* Drawer backdrop - Backdrop de sidebar drawer
|
|
2941
|
-
* Debe estar DEBAJO del drawer panel
|
|
3246
|
+
* Debe estar DEBAJO del drawer panel y DEBAJO de modals
|
|
2942
3247
|
*/
|
|
2943
|
-
drawerBackdrop:
|
|
3248
|
+
drawerBackdrop: "z-30",
|
|
2944
3249
|
/**
|
|
2945
3250
|
* Drawer - Sidebar drawer, sheets laterales
|
|
2946
3251
|
* Debe estar SOBRE su backdrop pero BAJO modals
|
|
2947
3252
|
*/
|
|
2948
|
-
drawer:
|
|
3253
|
+
drawer: "z-40",
|
|
2949
3254
|
/**
|
|
2950
3255
|
* Modal backdrop - Backdrop de dialogs
|
|
2951
|
-
*
|
|
3256
|
+
* Mismo nivel que drawer backdrop (z-40)
|
|
2952
3257
|
*/
|
|
2953
|
-
modalBackdrop:
|
|
3258
|
+
modalBackdrop: "z-40",
|
|
2954
3259
|
/**
|
|
2955
|
-
* Modal - Dialogs, alert-dialogs
|
|
3260
|
+
* Modal - Dialogs, alert-dialogs
|
|
2956
3261
|
* Debe estar SOBRE su backdrop
|
|
2957
3262
|
*/
|
|
2958
|
-
modal:
|
|
3263
|
+
modal: "z-50",
|
|
2959
3264
|
/**
|
|
2960
3265
|
* Popover - Tooltips, dropdowns, selects options DENTRO de modals
|
|
2961
3266
|
* CRÍTICO: Debe ser MAYOR que modal (z-50) para aparecer sobre modals
|
|
3267
|
+
* USAR SIEMPRE mergeOverlayPanelClass() para asegurar este valor
|
|
2962
3268
|
*/
|
|
2963
|
-
popover:
|
|
3269
|
+
popover: "z-[70]",
|
|
2964
3270
|
/**
|
|
2965
3271
|
* Toast - Notificaciones globales
|
|
2966
3272
|
* Debe estar sobre TODO
|
|
2967
3273
|
*/
|
|
2968
|
-
toast:
|
|
3274
|
+
toast: "z-[100]",
|
|
2969
3275
|
};
|
|
2970
3276
|
/**
|
|
2971
3277
|
* Helper para debugging z-index issues
|
|
2972
3278
|
*/
|
|
2973
3279
|
function logZIndexStack(element) {
|
|
2974
|
-
if (typeof window ===
|
|
3280
|
+
if (typeof window === "undefined")
|
|
2975
3281
|
return;
|
|
2976
3282
|
let current = element;
|
|
2977
3283
|
const stack = [];
|
|
@@ -2979,11 +3285,12 @@ function logZIndexStack(element) {
|
|
|
2979
3285
|
const computed = window.getComputedStyle(current);
|
|
2980
3286
|
const zIndex = computed.zIndex;
|
|
2981
3287
|
const position = computed.position;
|
|
2982
|
-
if (zIndex !==
|
|
3288
|
+
if (zIndex !== "auto") {
|
|
2983
3289
|
stack.push({
|
|
2984
|
-
element: current.tagName +
|
|
3290
|
+
element: current.tagName +
|
|
3291
|
+
(current.className ? `.${current.className.split(" ")[0]}` : ""),
|
|
2985
3292
|
zIndex,
|
|
2986
|
-
position
|
|
3293
|
+
position,
|
|
2987
3294
|
});
|
|
2988
3295
|
}
|
|
2989
3296
|
current = current.parentElement;
|
|
@@ -3014,7 +3321,7 @@ function logZIndexStack(element) {
|
|
|
3014
3321
|
class PdmDialogComponent {
|
|
3015
3322
|
constructor() {
|
|
3016
3323
|
this.open = false;
|
|
3017
|
-
this.variant =
|
|
3324
|
+
this.variant = "default";
|
|
3018
3325
|
/**
|
|
3019
3326
|
* Tamaño del dialog
|
|
3020
3327
|
* - responsive: fullscreen mobile, modal desktop (recomendado)
|
|
@@ -3024,21 +3331,21 @@ class PdmDialogComponent {
|
|
|
3024
3331
|
* - xl: 800px max
|
|
3025
3332
|
* - desktop/mobile/mobile-fullscreen: legacy, deprecado
|
|
3026
3333
|
*/
|
|
3027
|
-
this.size =
|
|
3028
|
-
this.title =
|
|
3029
|
-
this.description =
|
|
3334
|
+
this.size = "responsive";
|
|
3335
|
+
this.title = "Edit profile";
|
|
3336
|
+
this.description = "";
|
|
3030
3337
|
this.closeOnBackdrop = true;
|
|
3031
3338
|
this.closeOnEsc = true;
|
|
3032
3339
|
this.showCloseButton = true;
|
|
3033
3340
|
this.showHeader = true;
|
|
3034
3341
|
this.showFooter = true;
|
|
3035
|
-
this.primaryActionText =
|
|
3036
|
-
this.secondaryActionText =
|
|
3037
|
-
this.alignFooter =
|
|
3038
|
-
this.headerClassName =
|
|
3039
|
-
this.bodyClassName =
|
|
3040
|
-
this.footerClassName =
|
|
3041
|
-
this.className =
|
|
3342
|
+
this.primaryActionText = "Save changes";
|
|
3343
|
+
this.secondaryActionText = "Cancel";
|
|
3344
|
+
this.alignFooter = "right";
|
|
3345
|
+
this.headerClassName = "";
|
|
3346
|
+
this.bodyClassName = "";
|
|
3347
|
+
this.footerClassName = "";
|
|
3348
|
+
this.className = "";
|
|
3042
3349
|
this.openChange = new EventEmitter();
|
|
3043
3350
|
this.primaryAction = new EventEmitter();
|
|
3044
3351
|
this.secondaryAction = new EventEmitter();
|
|
@@ -3064,131 +3371,148 @@ class PdmDialogComponent {
|
|
|
3064
3371
|
}
|
|
3065
3372
|
get panelClassName() {
|
|
3066
3373
|
// Legacy sizes (backward compatibility)
|
|
3067
|
-
if (this.size ===
|
|
3068
|
-
return this.
|
|
3374
|
+
if (this.size === "desktop") {
|
|
3375
|
+
return this.buildPanelClasses([
|
|
3376
|
+
"max-w-[640px]",
|
|
3377
|
+
"max-h-[calc(100vh-2rem)]",
|
|
3378
|
+
"rounded-[10px]",
|
|
3379
|
+
]);
|
|
3069
3380
|
}
|
|
3070
|
-
if (this.size ===
|
|
3071
|
-
return this.
|
|
3381
|
+
if (this.size === "mobile") {
|
|
3382
|
+
return this.buildPanelClasses([
|
|
3383
|
+
"max-w-[320px]",
|
|
3384
|
+
"min-h-[240px]",
|
|
3385
|
+
"rounded-[10px]",
|
|
3386
|
+
]);
|
|
3072
3387
|
}
|
|
3073
|
-
if (this.size ===
|
|
3074
|
-
return this.
|
|
3388
|
+
if (this.size === "mobile-fullscreen") {
|
|
3389
|
+
return this.buildPanelClasses([
|
|
3390
|
+
"max-w-[320px]",
|
|
3391
|
+
"h-[min(100dvh,640px)]",
|
|
3392
|
+
"rounded-none",
|
|
3393
|
+
"sm:rounded-[10px]",
|
|
3394
|
+
]);
|
|
3075
3395
|
}
|
|
3076
3396
|
// New responsive mode (recomendado)
|
|
3077
|
-
if (this.size ===
|
|
3078
|
-
return this.
|
|
3397
|
+
if (this.size === "responsive") {
|
|
3398
|
+
return this.buildPanelClasses([
|
|
3079
3399
|
// Mobile: fullscreen con bordes redondeados solo arriba
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3400
|
+
"w-full",
|
|
3401
|
+
"h-full",
|
|
3402
|
+
"max-h-[100dvh]",
|
|
3403
|
+
"rounded-t-[10px]",
|
|
3404
|
+
"sm:rounded-[10px]",
|
|
3085
3405
|
// Desktop: modal centrado
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3406
|
+
"sm:w-auto",
|
|
3407
|
+
"sm:h-auto",
|
|
3408
|
+
"sm:max-w-[640px]",
|
|
3409
|
+
"sm:max-h-[calc(100vh-4rem)]",
|
|
3090
3410
|
]);
|
|
3091
3411
|
}
|
|
3092
3412
|
// New size options
|
|
3093
3413
|
const sizeMap = {
|
|
3094
|
-
sm:
|
|
3095
|
-
md:
|
|
3096
|
-
lg:
|
|
3097
|
-
xl:
|
|
3414
|
+
sm: "sm:max-w-[400px]",
|
|
3415
|
+
md: "sm:max-w-[500px]",
|
|
3416
|
+
lg: "sm:max-w-[640px]",
|
|
3417
|
+
xl: "sm:max-w-[800px]",
|
|
3098
3418
|
};
|
|
3099
3419
|
const maxWidth = sizeMap[this.size] || sizeMap.lg;
|
|
3100
|
-
return this.
|
|
3420
|
+
return this.buildPanelClasses([
|
|
3101
3421
|
// Mobile: fullscreen
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3422
|
+
"w-full",
|
|
3423
|
+
"h-full",
|
|
3424
|
+
"max-h-[100dvh]",
|
|
3425
|
+
"rounded-t-[10px]",
|
|
3106
3426
|
// Desktop: modal
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3427
|
+
"sm:rounded-[10px]",
|
|
3428
|
+
"sm:w-auto",
|
|
3429
|
+
"sm:h-auto",
|
|
3110
3430
|
maxWidth,
|
|
3111
|
-
|
|
3431
|
+
"sm:max-h-[calc(100vh-4rem)]",
|
|
3112
3432
|
]);
|
|
3113
3433
|
}
|
|
3114
|
-
|
|
3434
|
+
buildPanelClasses(sizeClasses) {
|
|
3115
3435
|
const base = [
|
|
3116
|
-
|
|
3436
|
+
"relative",
|
|
3117
3437
|
Z_INDEX.modal,
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3438
|
+
"flex",
|
|
3439
|
+
"flex-col",
|
|
3440
|
+
"border",
|
|
3441
|
+
"border-border",
|
|
3442
|
+
"bg-background",
|
|
3443
|
+
"text-foreground",
|
|
3444
|
+
"shadow-lg",
|
|
3445
|
+
"overflow-hidden",
|
|
3126
3446
|
...sizeClasses,
|
|
3127
|
-
this.className
|
|
3447
|
+
this.className,
|
|
3128
3448
|
];
|
|
3129
|
-
return base.filter(Boolean).join(
|
|
3449
|
+
return base.filter(Boolean).join(" ");
|
|
3130
3450
|
}
|
|
3131
3451
|
get bodyWrapperClassName() {
|
|
3452
|
+
// min-h-0 is CRITICAL for flex child to shrink and allow internal scroll
|
|
3132
3453
|
const base = [
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3454
|
+
"flex-1",
|
|
3455
|
+
"min-h-0",
|
|
3456
|
+
"overflow-y-auto",
|
|
3457
|
+
"px-4",
|
|
3458
|
+
"py-6",
|
|
3459
|
+
"sm:px-6",
|
|
3460
|
+
this.bodyClassName,
|
|
3139
3461
|
];
|
|
3140
|
-
return base.filter(Boolean).join(
|
|
3462
|
+
return base.filter(Boolean).join(" ");
|
|
3141
3463
|
}
|
|
3142
3464
|
get headerWrapperClassName() {
|
|
3143
3465
|
const base = [
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
this.headerClassName
|
|
3466
|
+
"flex",
|
|
3467
|
+
"items-start",
|
|
3468
|
+
"justify-between",
|
|
3469
|
+
"gap-3",
|
|
3470
|
+
"p-4",
|
|
3471
|
+
"sm:p-6",
|
|
3472
|
+
"border-b",
|
|
3473
|
+
"border-border",
|
|
3474
|
+
this.headerClassName,
|
|
3153
3475
|
];
|
|
3154
|
-
return base.filter(Boolean).join(
|
|
3476
|
+
return base.filter(Boolean).join(" ");
|
|
3155
3477
|
}
|
|
3156
3478
|
get footerWrapperClassName() {
|
|
3157
|
-
const effectiveAlign = this.alignFooter ===
|
|
3479
|
+
const effectiveAlign = this.alignFooter === "right" && this.variant === "custom-close"
|
|
3480
|
+
? "left"
|
|
3481
|
+
: this.alignFooter;
|
|
3158
3482
|
const base = [
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3483
|
+
"p-4",
|
|
3484
|
+
"sm:p-6",
|
|
3485
|
+
"border-t",
|
|
3486
|
+
"border-border",
|
|
3163
3487
|
// Mobile: siempre full-width
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3488
|
+
"flex",
|
|
3489
|
+
"flex-col",
|
|
3490
|
+
"gap-2",
|
|
3167
3491
|
// Desktop: según alignFooter
|
|
3168
|
-
effectiveAlign ===
|
|
3169
|
-
?
|
|
3170
|
-
:
|
|
3171
|
-
effectiveAlign ===
|
|
3172
|
-
effectiveAlign ===
|
|
3173
|
-
this.footerClassName
|
|
3492
|
+
effectiveAlign === "full-width"
|
|
3493
|
+
? "sm:flex-col"
|
|
3494
|
+
: "sm:flex-row sm:items-center",
|
|
3495
|
+
effectiveAlign === "left" ? "sm:justify-start" : "",
|
|
3496
|
+
effectiveAlign === "right" ? "sm:justify-end" : "",
|
|
3497
|
+
this.footerClassName,
|
|
3174
3498
|
];
|
|
3175
|
-
return base.filter(Boolean).join(
|
|
3499
|
+
return base.filter(Boolean).join(" ");
|
|
3176
3500
|
}
|
|
3177
3501
|
get containerClassName() {
|
|
3178
|
-
// Container con backdrop z-
|
|
3502
|
+
// Container con backdrop z-40
|
|
3179
3503
|
// Mobile: fullscreen desde el bottom
|
|
3180
3504
|
// Desktop: centrado
|
|
3181
3505
|
return responsive({
|
|
3182
3506
|
default: `fixed inset-x-0 bottom-0 ${Z_INDEX.modalBackdrop} flex items-end justify-center`,
|
|
3183
|
-
sm: `fixed inset-0 ${Z_INDEX.modalBackdrop} flex items-center justify-center p-4
|
|
3507
|
+
sm: `fixed inset-0 ${Z_INDEX.modalBackdrop} flex items-center justify-center p-4`,
|
|
3184
3508
|
});
|
|
3185
3509
|
}
|
|
3186
3510
|
}
|
|
3187
3511
|
PdmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3188
|
-
PdmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDialogComponent, selector: "pdm-dialog", inputs: { open: "open", variant: "variant", size: "size", title: "title", description: "description", closeOnBackdrop: "closeOnBackdrop", closeOnEsc: "closeOnEsc", showCloseButton: "showCloseButton", showHeader: "showHeader", showFooter: "showFooter", primaryActionText: "primaryActionText", secondaryActionText: "secondaryActionText", alignFooter: "alignFooter", headerClassName: "headerClassName", bodyClassName: "bodyClassName", footerClassName: "footerClassName", className: "className" }, outputs: { openChange: "openChange", primaryAction: "primaryAction", secondaryAction: "secondaryAction" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, ngImport: i0, template: "<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <!-- Backdrop -->\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n \n <!-- Dialog Panel -->\n <section role=\"dialog\" aria-modal=\"true\" [ngClass]=\"panelClassName\">\n <!-- Header -->\n <div *ngIf=\"showHeader\" [ngClass]=\"headerWrapperClassName\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 mt-2 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <button\n *ngIf=\"showCloseButton\"\n type=\"button\"\n class=\"inline-flex h-6 w-6 flex-shrink-0 appearance-none items-center justify-center rounded-sm border-0 bg-transparent p-0 text-foreground opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 6L18 18M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n </button>\n </div>\n\n <!-- Body -->\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n\n <!-- Footer -->\n <div *ngIf=\"showFooter\" [ngClass]=\"footerWrapperClassName\">\n <ng-container *ngIf=\"variant === 'custom-close'; else defaultActions\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n </ng-container>\n\n <ng-template #defaultActions>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\"\n (click)=\"onPrimaryAction()\"\n >\n {{ primaryActionText }}\n </button>\n </ng-template>\n </div>\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3512
|
+
PdmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDialogComponent, selector: "pdm-dialog", inputs: { open: "open", variant: "variant", size: "size", title: "title", description: "description", closeOnBackdrop: "closeOnBackdrop", closeOnEsc: "closeOnEsc", showCloseButton: "showCloseButton", showHeader: "showHeader", showFooter: "showFooter", primaryActionText: "primaryActionText", secondaryActionText: "secondaryActionText", alignFooter: "alignFooter", headerClassName: "headerClassName", bodyClassName: "bodyClassName", footerClassName: "footerClassName", className: "className" }, outputs: { openChange: "openChange", primaryAction: "primaryAction", secondaryAction: "secondaryAction" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, ngImport: i0, template: "<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <!-- Backdrop -->\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n \n <!-- Dialog Panel -->\n <section role=\"dialog\" aria-modal=\"true\" [ngClass]=\"panelClassName\">\n <!-- Header -->\n <div *ngIf=\"showHeader\" [ngClass]=\"headerWrapperClassName\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 mt-2 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <button\n *ngIf=\"showCloseButton\"\n type=\"button\"\n class=\"inline-flex h-6 w-6 flex-shrink-0 appearance-none items-center justify-center rounded-sm border-0 bg-transparent p-0 text-foreground opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 6L18 18M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n </button>\n </div>\n\n <!-- Body -->\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n\n <!-- Footer -->\n <div *ngIf=\"showFooter\" [ngClass]=\"footerWrapperClassName\">\n <ng-container *ngIf=\"variant === 'custom-close'; else defaultActions\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n </ng-container>\n\n <ng-template #defaultActions>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\"\n (click)=\"onPrimaryAction()\"\n >\n {{ primaryActionText }}\n </button>\n </ng-template>\n </div>\n </section>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3189
3513
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDialogComponent, decorators: [{
|
|
3190
3514
|
type: Component,
|
|
3191
|
-
args: [{ selector:
|
|
3515
|
+
args: [{ selector: "pdm-dialog", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <!-- Backdrop -->\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n \n <!-- Dialog Panel -->\n <section role=\"dialog\" aria-modal=\"true\" [ngClass]=\"panelClassName\">\n <!-- Header -->\n <div *ngIf=\"showHeader\" [ngClass]=\"headerWrapperClassName\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 mt-2 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <button\n *ngIf=\"showCloseButton\"\n type=\"button\"\n class=\"inline-flex h-6 w-6 flex-shrink-0 appearance-none items-center justify-center rounded-sm border-0 bg-transparent p-0 text-foreground opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 6L18 18M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n </button>\n </div>\n\n <!-- Body -->\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n\n <!-- Footer -->\n <div *ngIf=\"showFooter\" [ngClass]=\"footerWrapperClassName\">\n <ng-container *ngIf=\"variant === 'custom-close'; else defaultActions\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n </ng-container>\n\n <ng-template #defaultActions>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 w-full appearance-none items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\"\n (click)=\"onPrimaryAction()\"\n >\n {{ primaryActionText }}\n </button>\n </ng-template>\n </div>\n </section>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
3192
3516
|
}], propDecorators: { open: [{
|
|
3193
3517
|
type: Input
|
|
3194
3518
|
}], variant: [{
|
|
@@ -3231,7 +3555,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
3231
3555
|
type: Output
|
|
3232
3556
|
}], onEsc: [{
|
|
3233
3557
|
type: HostListener,
|
|
3234
|
-
args: [
|
|
3558
|
+
args: ["document:keydown.escape"]
|
|
3235
3559
|
}] } });
|
|
3236
3560
|
|
|
3237
3561
|
/**
|
|
@@ -3682,12 +4006,12 @@ class PdmDropdownMenuComponent {
|
|
|
3682
4006
|
}
|
|
3683
4007
|
}
|
|
3684
4008
|
}
|
|
3685
|
-
PdmDropdownMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$
|
|
4009
|
+
PdmDropdownMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3686
4010
|
PdmDropdownMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDropdownMenuComponent, selector: "pdm-dropdown-menu", inputs: { triggerText: "triggerText", variant: "variant", items: "items", closeOnSelect: "closeOnSelect", className: "className", panelClassName: "panelClassName", overlayOptions: "overlayOptions" }, outputs: { itemSelect: "itemSelect", itemsChange: "itemsChange" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<button\n #triggerEl\n type=\"button\"\n [ngClass]=\"[\n 'inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n className\n ]\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggle()\"\n>\n {{ triggerText }}\n</button>\n\n<ng-template #panelTemplate>\n <div\n class=\"min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\"\n >\n <ng-container *ngFor=\"let item of resolvedItems\">\n <div *ngIf=\"item.type === 'separator'\" class=\"-mx-1 my-1 h-px bg-muted\"></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n [ngClass]=\"['px-2 py-1.5 text-sm font-semibold text-foreground', item.inset ? 'pl-8' : '']\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative flex w-full appearance-none cursor-default select-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',\n item.inset ? 'pl-8' : ''\n ]\"\n (click)=\"select(item)\"\n >\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center\">\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5 12.5L9.2 16.7L19 7\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <span *ngIf=\"item.radioSelected\" class=\"h-2 w-2 rounded-full bg-foreground\"></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{ item.shortcut }}</span>\n <span *ngIf=\"item.showChevron\" class=\"text-sm text-muted-foreground\">\u203A</span>\n </button>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3687
4011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, decorators: [{
|
|
3688
4012
|
type: Component,
|
|
3689
4013
|
args: [{ selector: 'pdm-dropdown-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #triggerEl\n type=\"button\"\n [ngClass]=\"[\n 'inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n className\n ]\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggle()\"\n>\n {{ triggerText }}\n</button>\n\n<ng-template #panelTemplate>\n <div\n class=\"min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\"\n >\n <ng-container *ngFor=\"let item of resolvedItems\">\n <div *ngIf=\"item.type === 'separator'\" class=\"-mx-1 my-1 h-px bg-muted\"></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n [ngClass]=\"['px-2 py-1.5 text-sm font-semibold text-foreground', item.inset ? 'pl-8' : '']\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative flex w-full appearance-none cursor-default select-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',\n item.inset ? 'pl-8' : ''\n ]\"\n (click)=\"select(item)\"\n >\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center\">\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5 12.5L9.2 16.7L19 7\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <span *ngIf=\"item.radioSelected\" class=\"h-2 w-2 rounded-full bg-foreground\"></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{ item.shortcut }}</span>\n <span *ngIf=\"item.showChevron\" class=\"text-sm text-muted-foreground\">\u203A</span>\n </button>\n </ng-container>\n </div>\n</ng-template>\n" }]
|
|
3690
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$
|
|
4014
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { triggerText: [{
|
|
3691
4015
|
type: Input
|
|
3692
4016
|
}], variant: [{
|
|
3693
4017
|
type: Input
|
|
@@ -4044,35 +4368,178 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4044
4368
|
}] } });
|
|
4045
4369
|
|
|
4046
4370
|
class PdmHoverCardComponent {
|
|
4047
|
-
constructor() {
|
|
4048
|
-
this.
|
|
4049
|
-
this.
|
|
4050
|
-
this.
|
|
4051
|
-
this.
|
|
4371
|
+
constructor(overlay, viewContainerRef, elementRef, cdr) {
|
|
4372
|
+
this.overlay = overlay;
|
|
4373
|
+
this.viewContainerRef = viewContainerRef;
|
|
4374
|
+
this.elementRef = elementRef;
|
|
4375
|
+
this.cdr = cdr;
|
|
4376
|
+
this.className = "";
|
|
4377
|
+
this.panelClassName = "";
|
|
4378
|
+
this.side = "bottom";
|
|
4379
|
+
this.align = "start";
|
|
4052
4380
|
this.panelWidth = 304;
|
|
4053
4381
|
this.open = false;
|
|
4382
|
+
this.overlayRef = null;
|
|
4383
|
+
this.showTimeout = null;
|
|
4384
|
+
this.hideTimeout = null;
|
|
4054
4385
|
}
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4386
|
+
ngOnDestroy() {
|
|
4387
|
+
this.clearTimeouts();
|
|
4388
|
+
this.destroyOverlay();
|
|
4389
|
+
}
|
|
4390
|
+
onMouseEnter() {
|
|
4391
|
+
this.clearTimeouts();
|
|
4392
|
+
this.showTimeout = setTimeout(() => this.show(), 150);
|
|
4393
|
+
}
|
|
4394
|
+
onMouseLeave() {
|
|
4395
|
+
this.clearTimeouts();
|
|
4396
|
+
this.hideTimeout = setTimeout(() => this.hide(), 150);
|
|
4397
|
+
}
|
|
4398
|
+
onFocusIn() {
|
|
4399
|
+
this.clearTimeouts();
|
|
4400
|
+
this.show();
|
|
4401
|
+
}
|
|
4402
|
+
onFocusOut() {
|
|
4403
|
+
this.clearTimeouts();
|
|
4404
|
+
this.hide();
|
|
4405
|
+
}
|
|
4406
|
+
clearTimeouts() {
|
|
4407
|
+
if (this.showTimeout) {
|
|
4408
|
+
clearTimeout(this.showTimeout);
|
|
4409
|
+
this.showTimeout = null;
|
|
4410
|
+
}
|
|
4411
|
+
if (this.hideTimeout) {
|
|
4412
|
+
clearTimeout(this.hideTimeout);
|
|
4413
|
+
this.hideTimeout = null;
|
|
4414
|
+
}
|
|
4415
|
+
}
|
|
4416
|
+
show() {
|
|
4417
|
+
if (this.open)
|
|
4418
|
+
return;
|
|
4419
|
+
this.open = true;
|
|
4420
|
+
this.cdr.markForCheck();
|
|
4421
|
+
this.createOverlay();
|
|
4422
|
+
}
|
|
4423
|
+
hide() {
|
|
4424
|
+
if (!this.open)
|
|
4425
|
+
return;
|
|
4426
|
+
this.open = false;
|
|
4427
|
+
this.cdr.markForCheck();
|
|
4428
|
+
this.destroyOverlay();
|
|
4429
|
+
}
|
|
4430
|
+
createOverlay() {
|
|
4431
|
+
if (this.overlayRef)
|
|
4432
|
+
return;
|
|
4433
|
+
const triggerEl = this.elementRef.nativeElement.querySelector("[pdmHoverTrigger]") ||
|
|
4434
|
+
this.elementRef.nativeElement;
|
|
4435
|
+
const positionStrategy = this.overlay
|
|
4436
|
+
.position()
|
|
4437
|
+
.flexibleConnectedTo(triggerEl)
|
|
4438
|
+
.withPositions(this.getPositionConfigs())
|
|
4439
|
+
.withFlexibleDimensions(false)
|
|
4440
|
+
.withPush(true);
|
|
4441
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
4442
|
+
this.overlayRef = this.overlay.create({
|
|
4443
|
+
positionStrategy,
|
|
4444
|
+
panelClass,
|
|
4445
|
+
});
|
|
4446
|
+
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
4447
|
+
this.overlayRef.attach(portal);
|
|
4448
|
+
}
|
|
4449
|
+
destroyOverlay() {
|
|
4450
|
+
if (this.overlayRef) {
|
|
4451
|
+
this.overlayRef.detach();
|
|
4452
|
+
this.overlayRef.dispose();
|
|
4453
|
+
this.overlayRef = null;
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
getPositionConfigs() {
|
|
4457
|
+
// Map our side/align to CDK positions
|
|
4458
|
+
const configs = [];
|
|
4459
|
+
// Primary position based on side
|
|
4460
|
+
switch (this.side) {
|
|
4461
|
+
case "top":
|
|
4462
|
+
configs.push({
|
|
4463
|
+
originX: this.getAlignX(),
|
|
4464
|
+
originY: "top",
|
|
4465
|
+
overlayX: this.getAlignX(),
|
|
4466
|
+
overlayY: "bottom",
|
|
4467
|
+
offsetY: -8,
|
|
4468
|
+
});
|
|
4469
|
+
break;
|
|
4470
|
+
case "right":
|
|
4471
|
+
configs.push({
|
|
4472
|
+
originX: "end",
|
|
4473
|
+
originY: this.getAlignY(),
|
|
4474
|
+
overlayX: "start",
|
|
4475
|
+
overlayY: this.getAlignY(),
|
|
4476
|
+
offsetX: 8,
|
|
4477
|
+
});
|
|
4478
|
+
break;
|
|
4479
|
+
case "bottom":
|
|
4480
|
+
default:
|
|
4481
|
+
configs.push({
|
|
4482
|
+
originX: this.getAlignX(),
|
|
4483
|
+
originY: "bottom",
|
|
4484
|
+
overlayX: this.getAlignX(),
|
|
4485
|
+
overlayY: "top",
|
|
4486
|
+
offsetY: 8,
|
|
4487
|
+
});
|
|
4488
|
+
break;
|
|
4489
|
+
case "left":
|
|
4490
|
+
configs.push({
|
|
4491
|
+
originX: "start",
|
|
4492
|
+
originY: this.getAlignY(),
|
|
4493
|
+
overlayX: "end",
|
|
4494
|
+
overlayY: this.getAlignY(),
|
|
4495
|
+
offsetX: -8,
|
|
4496
|
+
});
|
|
4497
|
+
break;
|
|
4498
|
+
}
|
|
4499
|
+
// Add fallback positions
|
|
4500
|
+
switch (this.side) {
|
|
4501
|
+
case "top":
|
|
4502
|
+
case "bottom":
|
|
4503
|
+
configs.push({
|
|
4504
|
+
originX: "center",
|
|
4505
|
+
originY: this.side === "top" ? "top" : "bottom",
|
|
4506
|
+
overlayX: "center",
|
|
4507
|
+
overlayY: this.side === "top" ? "bottom" : "top",
|
|
4508
|
+
offsetY: this.side === "top" ? -8 : 8,
|
|
4509
|
+
});
|
|
4510
|
+
break;
|
|
4511
|
+
case "left":
|
|
4512
|
+
case "right":
|
|
4513
|
+
configs.push({
|
|
4514
|
+
originX: this.side === "left" ? "start" : "end",
|
|
4515
|
+
originY: "center",
|
|
4516
|
+
overlayX: this.side === "left" ? "end" : "start",
|
|
4517
|
+
overlayY: "center",
|
|
4518
|
+
offsetX: this.side === "left" ? -8 : 8,
|
|
4519
|
+
});
|
|
4520
|
+
break;
|
|
4521
|
+
}
|
|
4522
|
+
return configs;
|
|
4523
|
+
}
|
|
4524
|
+
getAlignX() {
|
|
4525
|
+
return this.align;
|
|
4526
|
+
}
|
|
4527
|
+
getAlignY() {
|
|
4528
|
+
// Map 'start'/'end' to 'top'/'bottom' for Y axis
|
|
4529
|
+
const alignMap = {
|
|
4530
|
+
start: "top",
|
|
4531
|
+
center: "center",
|
|
4532
|
+
end: "bottom",
|
|
4066
4533
|
};
|
|
4067
|
-
return
|
|
4534
|
+
return alignMap[this.align];
|
|
4068
4535
|
}
|
|
4069
4536
|
}
|
|
4070
|
-
PdmHoverCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmHoverCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4071
|
-
PdmHoverCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmHoverCardComponent, selector: "pdm-hover-card", inputs: { className: "className", panelClassName: "panelClassName", side: "side", align: "align", panelWidth: "panelWidth" }, ngImport: i0, template: "<div\n class=\"relative inline-flex\"\n [ngClass]=\"className\"\n (mouseenter)=\"
|
|
4537
|
+
PdmHoverCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmHoverCardComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4538
|
+
PdmHoverCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmHoverCardComponent, selector: "pdm-hover-card", inputs: { className: "className", panelClassName: "panelClassName", side: "side", align: "align", panelWidth: "panelWidth" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()" } }, viewQueries: [{ propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div\n class=\"relative inline-flex\"\n [ngClass]=\"className\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n <div>\n <ng-content select=\"[pdmHoverTrigger]\"></ng-content>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <section\n [style.width.px]=\"panelWidth\"\n class=\"rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md\"\n >\n <ng-content select=\"[pdmHoverContent]\"></ng-content>\n </section>\n </ng-template>\n</div>\n", styles: [":host{display:inline-flex}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4072
4539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmHoverCardComponent, decorators: [{
|
|
4073
4540
|
type: Component,
|
|
4074
|
-
args: [{ selector:
|
|
4075
|
-
}], propDecorators: { className: [{
|
|
4541
|
+
args: [{ selector: "pdm-hover-card", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"relative inline-flex\"\n [ngClass]=\"className\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n <div>\n <ng-content select=\"[pdmHoverTrigger]\"></ng-content>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <section\n [style.width.px]=\"panelWidth\"\n class=\"rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md\"\n >\n <ng-content select=\"[pdmHoverContent]\"></ng-content>\n </section>\n </ng-template>\n</div>\n", styles: [":host{display:inline-flex}\n"] }]
|
|
4542
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { className: [{
|
|
4076
4543
|
type: Input
|
|
4077
4544
|
}], panelClassName: [{
|
|
4078
4545
|
type: Input
|
|
@@ -4082,6 +4549,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4082
4549
|
type: Input
|
|
4083
4550
|
}], panelWidth: [{
|
|
4084
4551
|
type: Input
|
|
4552
|
+
}], panelTemplateRef: [{
|
|
4553
|
+
type: ViewChild,
|
|
4554
|
+
args: ["panelTemplate"]
|
|
4555
|
+
}], onMouseEnter: [{
|
|
4556
|
+
type: HostListener,
|
|
4557
|
+
args: ["mouseenter"]
|
|
4558
|
+
}], onMouseLeave: [{
|
|
4559
|
+
type: HostListener,
|
|
4560
|
+
args: ["mouseleave"]
|
|
4561
|
+
}], onFocusIn: [{
|
|
4562
|
+
type: HostListener,
|
|
4563
|
+
args: ["focusin"]
|
|
4564
|
+
}], onFocusOut: [{
|
|
4565
|
+
type: HostListener,
|
|
4566
|
+
args: ["focusout"]
|
|
4085
4567
|
}] } });
|
|
4086
4568
|
|
|
4087
4569
|
class PdmItemComponent {
|
|
@@ -4106,21 +4588,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4106
4588
|
|
|
4107
4589
|
class PdmInputComponent {
|
|
4108
4590
|
constructor() {
|
|
4109
|
-
this.id =
|
|
4110
|
-
this.type =
|
|
4111
|
-
this.value =
|
|
4112
|
-
this.placeholder =
|
|
4591
|
+
this.id = "";
|
|
4592
|
+
this.type = "text";
|
|
4593
|
+
this.value = "";
|
|
4594
|
+
this.placeholder = "";
|
|
4113
4595
|
this.disabled = false;
|
|
4114
4596
|
this.readonly = false;
|
|
4115
4597
|
this.required = false;
|
|
4116
4598
|
this.invalid = false;
|
|
4117
|
-
this.size =
|
|
4118
|
-
this.roundness =
|
|
4119
|
-
this.className =
|
|
4120
|
-
this.inputClassName =
|
|
4121
|
-
this.label =
|
|
4122
|
-
this.helperText =
|
|
4123
|
-
this.errorText =
|
|
4599
|
+
this.size = "regular";
|
|
4600
|
+
this.roundness = "default";
|
|
4601
|
+
this.className = "";
|
|
4602
|
+
this.inputClassName = "";
|
|
4603
|
+
this.label = "";
|
|
4604
|
+
this.helperText = "";
|
|
4605
|
+
this.errorText = "";
|
|
4124
4606
|
this.valueChange = new EventEmitter();
|
|
4125
4607
|
this.blurred = new EventEmitter();
|
|
4126
4608
|
}
|
|
@@ -4132,10 +4614,10 @@ class PdmInputComponent {
|
|
|
4132
4614
|
}
|
|
4133
4615
|
}
|
|
4134
4616
|
PdmInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4135
|
-
PdmInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmInputComponent, selector: "pdm-input", inputs: { id: "id", type: "type", value: "value", placeholder: "placeholder", disabled: "disabled", readonly: "readonly", required: "required", invalid: "invalid", size: "size", roundness: "roundness", className: "className", inputClassName: "inputClassName", label: "label", helperText: "helperText", errorText: "errorText" }, outputs: { valueChange: "valueChange", blurred: "blurred" }, ngImport: i0, template: "<div [ngClass]=\"['grid w-full gap-3', className]\">\n <label\n *ngIf=\"label\"\n [attr.for]=\"id\"\n [ngClass]=\"[\n 'text-sm font-medium leading-none',\n invalid ? 'text-destructive' : 'text-foreground'\n ]\"\n >{{ label }}</label\n >\n <input\n [id]=\"id\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive aria-invalid:placeholder:text-destructive/70 placeholder:text-muted-foreground w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n size === 'large' ? 'h-10 px-4 text-sm' : '',\n size === 'regular' ? 'h-9 px-3 text-sm' : '',\n size === 'small' ? 'h-8 px-2 text-sm' : '',\n size === 'mini' ? 'h-6 px-1.5 text-xs' : '',\n roundness === 'round' ? 'rounded-full' : 'rounded-lg',\n type === 'file' ? 'text-sm' : 'text-foreground',\n inputClassName,\n ]\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <p *ngIf=\"!invalid && helperText\" class=\"m-0 text-sm text-muted-foreground\">\n {{ helperText }}\n </p>\n <p *ngIf=\"invalid && errorText\" class=\"m-0 text-sm text-destructive\">\n {{ errorText }}\n </p>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4617
|
+
PdmInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmInputComponent, selector: "pdm-input", inputs: { id: "id", type: "type", value: "value", placeholder: "placeholder", disabled: "disabled", readonly: "readonly", required: "required", invalid: "invalid", size: "size", roundness: "roundness", className: "className", inputClassName: "inputClassName", label: "label", helperText: "helperText", errorText: "errorText" }, outputs: { valueChange: "valueChange", blurred: "blurred" }, ngImport: i0, template: "<div [ngClass]=\"['grid w-full gap-3', className]\">\n <label\n *ngIf=\"label\"\n [attr.for]=\"id\"\n [ngClass]=\"[\n 'text-sm font-medium leading-none',\n invalid ? 'text-destructive' : 'text-foreground'\n ]\"\n >{{ label }}</label\n >\n <input\n [id]=\"id\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive aria-invalid:placeholder:text-destructive/70 placeholder:text-muted-foreground w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n size === 'large' ? 'h-10 px-4 text-sm' : '',\n size === 'regular' ? 'h-9 px-3 text-sm' : '',\n size === 'small' ? 'h-8 px-2 text-sm' : '',\n size === 'mini' ? 'h-6 px-1.5 text-xs' : '',\n roundness === 'round' ? 'rounded-full' : 'rounded-lg',\n type === 'file' ? 'text-sm' : 'text-foreground',\n inputClassName,\n ]\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <p *ngIf=\"!invalid && helperText\" class=\"m-0 text-sm text-muted-foreground\">\n {{ helperText }}\n </p>\n <p *ngIf=\"invalid && errorText\" class=\"m-0 text-sm text-destructive\">\n {{ errorText }}\n </p>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4136
4618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmInputComponent, decorators: [{
|
|
4137
4619
|
type: Component,
|
|
4138
|
-
args: [{ selector:
|
|
4620
|
+
args: [{ selector: "pdm-input", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"['grid w-full gap-3', className]\">\n <label\n *ngIf=\"label\"\n [attr.for]=\"id\"\n [ngClass]=\"[\n 'text-sm font-medium leading-none',\n invalid ? 'text-destructive' : 'text-foreground'\n ]\"\n >{{ label }}</label\n >\n <input\n [id]=\"id\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive aria-invalid:placeholder:text-destructive/70 placeholder:text-muted-foreground w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n size === 'large' ? 'h-10 px-4 text-sm' : '',\n size === 'regular' ? 'h-9 px-3 text-sm' : '',\n size === 'small' ? 'h-8 px-2 text-sm' : '',\n size === 'mini' ? 'h-6 px-1.5 text-xs' : '',\n roundness === 'round' ? 'rounded-full' : 'rounded-lg',\n type === 'file' ? 'text-sm' : 'text-foreground',\n inputClassName,\n ]\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <p *ngIf=\"!invalid && helperText\" class=\"m-0 text-sm text-muted-foreground\">\n {{ helperText }}\n </p>\n <p *ngIf=\"invalid && errorText\" class=\"m-0 text-sm text-destructive\">\n {{ errorText }}\n </p>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
4139
4621
|
}], propDecorators: { id: [{
|
|
4140
4622
|
type: Input
|
|
4141
4623
|
}], type: [{
|
|
@@ -4249,18 +4731,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4249
4731
|
|
|
4250
4732
|
class PdmInputGroupComponent {
|
|
4251
4733
|
constructor() {
|
|
4252
|
-
this.id =
|
|
4253
|
-
this.type =
|
|
4254
|
-
this.value =
|
|
4255
|
-
this.placeholder =
|
|
4734
|
+
this.id = "";
|
|
4735
|
+
this.type = "text";
|
|
4736
|
+
this.value = "";
|
|
4737
|
+
this.placeholder = "";
|
|
4256
4738
|
this.disabled = false;
|
|
4257
4739
|
this.invalid = false;
|
|
4258
|
-
this.prefixText =
|
|
4259
|
-
this.suffixText =
|
|
4260
|
-
this.prefixIcon =
|
|
4261
|
-
this.suffixIcon =
|
|
4262
|
-
this.buttonText =
|
|
4263
|
-
this.className =
|
|
4740
|
+
this.prefixText = "";
|
|
4741
|
+
this.suffixText = "";
|
|
4742
|
+
this.prefixIcon = "";
|
|
4743
|
+
this.suffixIcon = "";
|
|
4744
|
+
this.buttonText = "";
|
|
4745
|
+
this.className = "";
|
|
4264
4746
|
this.valueChange = new EventEmitter();
|
|
4265
4747
|
this.buttonClick = new EventEmitter();
|
|
4266
4748
|
}
|
|
@@ -4272,10 +4754,10 @@ class PdmInputGroupComponent {
|
|
|
4272
4754
|
}
|
|
4273
4755
|
}
|
|
4274
4756
|
PdmInputGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmInputGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4275
|
-
PdmInputGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmInputGroupComponent, selector: "pdm-input-group", inputs: { id: "id", type: "type", value: "value", placeholder: "placeholder", disabled: "disabled", invalid: "invalid", prefixText: "prefixText", suffixText: "suffixText", prefixIcon: "prefixIcon", suffixIcon: "suffixIcon", buttonText: "buttonText", className: "className" }, outputs: { valueChange: "valueChange", buttonClick: "buttonClick" }, ngImport: i0, template: "<div\n [ngClass]=\"[\n 'flex w-full items-
|
|
4757
|
+
PdmInputGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmInputGroupComponent, selector: "pdm-input-group", inputs: { id: "id", type: "type", value: "value", placeholder: "placeholder", disabled: "disabled", invalid: "invalid", prefixText: "prefixText", suffixText: "suffixText", prefixIcon: "prefixIcon", suffixIcon: "suffixIcon", buttonText: "buttonText", className: "className" }, outputs: { valueChange: "valueChange", buttonClick: "buttonClick" }, ngImport: i0, template: "<div\n [ngClass]=\"[\n 'flex w-full flex-col items-stretch gap-2 sm:flex-row sm:items-center',\n disabled ? 'opacity-50' : '',\n className,\n ]\"\n>\n <div\n [ngClass]=\"[\n 'flex h-9 min-w-0 flex-1 items-center overflow-hidden rounded-md border border-input bg-transparent px-3 py-1 text-sm text-foreground shadow-sm transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/50',\n invalid ? 'border-destructive focus-within:ring-destructive' : '',\n disabled ? 'cursor-not-allowed' : '',\n ]\"\n >\n <div\n *ngIf=\"prefixText || prefixIcon\"\n class=\"inline-flex h-full shrink-0 items-center gap-2 pr-2 text-sm text-muted-foreground\"\n >\n <pdm-icon *ngIf=\"prefixIcon\" [name]=\"prefixIcon\" [size]=\"16\"></pdm-icon>\n <span *ngIf=\"prefixText\">{{ prefixText }}</span>\n <ng-content select=\"[pdmInputGroupPrefix]\"></ng-content>\n </div>\n\n <input\n [id]=\"id\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"[\n 'h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-sm text-foreground outline-none placeholder:text-muted-foreground aria-invalid:placeholder:text-destructive/70',\n type === 'file'\n ? 'text-sm file:mr-2 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground'\n : '',\n ]\"\n (input)=\"onInput($event)\"\n />\n\n <div\n *ngIf=\"!buttonText && (suffixText || suffixIcon)\"\n class=\"inline-flex h-full shrink-0 items-center gap-2 pl-2 text-sm text-muted-foreground\"\n >\n <pdm-icon *ngIf=\"suffixIcon\" [name]=\"suffixIcon\" [size]=\"16\"></pdm-icon>\n <span *ngIf=\"suffixText\" class=\"font-medium\">{{ suffixText }}</span>\n <ng-content select=\"[pdmInputGroupSuffix]\"></ng-content>\n </div>\n </div>\n\n <button\n *ngIf=\"buttonText\"\n type=\"button\"\n [disabled]=\"disabled\"\n class=\"inline-flex h-9 w-full shrink-0 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed sm:w-auto\"\n (click)=\"onButtonClick($event)\"\n >\n {{ buttonText }}\n </button>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4276
4758
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmInputGroupComponent, decorators: [{
|
|
4277
4759
|
type: Component,
|
|
4278
|
-
args: [{ selector:
|
|
4760
|
+
args: [{ selector: "pdm-input-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [ngClass]=\"[\n 'flex w-full flex-col items-stretch gap-2 sm:flex-row sm:items-center',\n disabled ? 'opacity-50' : '',\n className,\n ]\"\n>\n <div\n [ngClass]=\"[\n 'flex h-9 min-w-0 flex-1 items-center overflow-hidden rounded-md border border-input bg-transparent px-3 py-1 text-sm text-foreground shadow-sm transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/50',\n invalid ? 'border-destructive focus-within:ring-destructive' : '',\n disabled ? 'cursor-not-allowed' : '',\n ]\"\n >\n <div\n *ngIf=\"prefixText || prefixIcon\"\n class=\"inline-flex h-full shrink-0 items-center gap-2 pr-2 text-sm text-muted-foreground\"\n >\n <pdm-icon *ngIf=\"prefixIcon\" [name]=\"prefixIcon\" [size]=\"16\"></pdm-icon>\n <span *ngIf=\"prefixText\">{{ prefixText }}</span>\n <ng-content select=\"[pdmInputGroupPrefix]\"></ng-content>\n </div>\n\n <input\n [id]=\"id\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"[\n 'h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-sm text-foreground outline-none placeholder:text-muted-foreground aria-invalid:placeholder:text-destructive/70',\n type === 'file'\n ? 'text-sm file:mr-2 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground'\n : '',\n ]\"\n (input)=\"onInput($event)\"\n />\n\n <div\n *ngIf=\"!buttonText && (suffixText || suffixIcon)\"\n class=\"inline-flex h-full shrink-0 items-center gap-2 pl-2 text-sm text-muted-foreground\"\n >\n <pdm-icon *ngIf=\"suffixIcon\" [name]=\"suffixIcon\" [size]=\"16\"></pdm-icon>\n <span *ngIf=\"suffixText\" class=\"font-medium\">{{ suffixText }}</span>\n <ng-content select=\"[pdmInputGroupSuffix]\"></ng-content>\n </div>\n </div>\n\n <button\n *ngIf=\"buttonText\"\n type=\"button\"\n [disabled]=\"disabled\"\n class=\"inline-flex h-9 w-full shrink-0 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed sm:w-auto\"\n (click)=\"onButtonClick($event)\"\n >\n {{ buttonText }}\n </button>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
4279
4761
|
}], propDecorators: { id: [{
|
|
4280
4762
|
type: Input
|
|
4281
4763
|
}], type: [{
|
|
@@ -4458,35 +4940,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4458
4940
|
}] } });
|
|
4459
4941
|
|
|
4460
4942
|
class PdmMenubarComponent {
|
|
4461
|
-
constructor(elementRef, cdr) {
|
|
4943
|
+
constructor(overlay, viewContainerRef, elementRef, cdr) {
|
|
4944
|
+
this.overlay = overlay;
|
|
4945
|
+
this.viewContainerRef = viewContainerRef;
|
|
4462
4946
|
this.elementRef = elementRef;
|
|
4463
4947
|
this.cdr = cdr;
|
|
4464
4948
|
this.menus = [];
|
|
4465
|
-
this.className =
|
|
4949
|
+
this.className = "";
|
|
4950
|
+
this.panelClassName = "";
|
|
4466
4951
|
this.itemSelect = new EventEmitter();
|
|
4467
4952
|
this.openIndex = -1;
|
|
4953
|
+
this.overlayRef = null;
|
|
4954
|
+
this.outsideClickSub = null;
|
|
4468
4955
|
}
|
|
4469
|
-
ngOnInit() {
|
|
4470
|
-
this.boundPointerDown = (event) => this.onDocumentPointerDown(event);
|
|
4471
|
-
document.addEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
4472
|
-
}
|
|
4956
|
+
ngOnInit() { }
|
|
4473
4957
|
ngOnDestroy() {
|
|
4474
|
-
|
|
4475
|
-
document.removeEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
4476
|
-
}
|
|
4958
|
+
this.destroyOverlay();
|
|
4477
4959
|
}
|
|
4478
|
-
|
|
4960
|
+
onDocumentClickOrEsc(event) {
|
|
4961
|
+
// Close on escape
|
|
4962
|
+
if (event.type === "keydown") {
|
|
4963
|
+
if (this.openIndex >= 0) {
|
|
4964
|
+
this.openIndex = -1;
|
|
4965
|
+
this.cdr.markForCheck();
|
|
4966
|
+
}
|
|
4967
|
+
return;
|
|
4968
|
+
}
|
|
4969
|
+
// Close on click outside
|
|
4479
4970
|
if (this.openIndex >= 0) {
|
|
4480
|
-
|
|
4481
|
-
this.
|
|
4971
|
+
const target = event.target;
|
|
4972
|
+
if (!this.elementRef.nativeElement.contains(target)) {
|
|
4973
|
+
this.openIndex = -1;
|
|
4974
|
+
this.cdr.markForCheck();
|
|
4975
|
+
}
|
|
4482
4976
|
}
|
|
4483
4977
|
}
|
|
4484
|
-
toggle(index) {
|
|
4978
|
+
toggle(index, event) {
|
|
4979
|
+
event.stopPropagation();
|
|
4485
4980
|
this.openIndex = this.openIndex === index ? -1 : index;
|
|
4981
|
+
this.cdr.markForCheck();
|
|
4982
|
+
if (this.openIndex >= 0) {
|
|
4983
|
+
this.createOverlay(event);
|
|
4984
|
+
}
|
|
4985
|
+
else {
|
|
4986
|
+
this.destroyOverlay();
|
|
4987
|
+
}
|
|
4486
4988
|
}
|
|
4487
4989
|
select(value) {
|
|
4488
4990
|
this.itemSelect.emit(value);
|
|
4489
4991
|
this.openIndex = -1;
|
|
4992
|
+
this.cdr.markForCheck();
|
|
4993
|
+
this.destroyOverlay();
|
|
4490
4994
|
}
|
|
4491
4995
|
selectItem(item) {
|
|
4492
4996
|
if (item.disabled || !item.value) {
|
|
@@ -4494,32 +4998,83 @@ class PdmMenubarComponent {
|
|
|
4494
4998
|
}
|
|
4495
4999
|
this.select(item.value);
|
|
4496
5000
|
}
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
const
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
5001
|
+
createOverlay(event) {
|
|
5002
|
+
this.destroyOverlay();
|
|
5003
|
+
const triggerEl = event.currentTarget;
|
|
5004
|
+
const positionStrategy = this.overlay
|
|
5005
|
+
.position()
|
|
5006
|
+
.flexibleConnectedTo(triggerEl)
|
|
5007
|
+
.withPositions(this.getPositionConfigs())
|
|
5008
|
+
.withFlexibleDimensions(false)
|
|
5009
|
+
.withPush(true);
|
|
5010
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
5011
|
+
this.overlayRef = this.overlay.create({
|
|
5012
|
+
positionStrategy,
|
|
5013
|
+
panelClass,
|
|
5014
|
+
});
|
|
5015
|
+
const portal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef);
|
|
5016
|
+
this.overlayRef.attach(portal);
|
|
5017
|
+
// Close on click outside
|
|
5018
|
+
this.outsideClickSub = this.overlayRef
|
|
5019
|
+
.outsidePointerEvents()
|
|
5020
|
+
.subscribe(() => {
|
|
4504
5021
|
this.openIndex = -1;
|
|
4505
5022
|
this.cdr.markForCheck();
|
|
5023
|
+
this.destroyOverlay();
|
|
5024
|
+
});
|
|
5025
|
+
}
|
|
5026
|
+
destroyOverlay() {
|
|
5027
|
+
if (this.outsideClickSub) {
|
|
5028
|
+
this.outsideClickSub.unsubscribe();
|
|
5029
|
+
this.outsideClickSub = null;
|
|
4506
5030
|
}
|
|
5031
|
+
if (this.overlayRef) {
|
|
5032
|
+
this.overlayRef.detach();
|
|
5033
|
+
this.overlayRef.dispose();
|
|
5034
|
+
this.overlayRef = null;
|
|
5035
|
+
}
|
|
5036
|
+
}
|
|
5037
|
+
getPositionConfigs() {
|
|
5038
|
+
return [
|
|
5039
|
+
{
|
|
5040
|
+
originX: "start",
|
|
5041
|
+
originY: "bottom",
|
|
5042
|
+
overlayX: "start",
|
|
5043
|
+
overlayY: "top",
|
|
5044
|
+
offsetY: 4,
|
|
5045
|
+
},
|
|
5046
|
+
{
|
|
5047
|
+
originX: "start",
|
|
5048
|
+
originY: "top",
|
|
5049
|
+
overlayX: "start",
|
|
5050
|
+
overlayY: "bottom",
|
|
5051
|
+
offsetY: -4,
|
|
5052
|
+
},
|
|
5053
|
+
];
|
|
4507
5054
|
}
|
|
4508
5055
|
}
|
|
4509
|
-
PdmMenubarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmMenubarComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4510
|
-
PdmMenubarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmMenubarComponent, selector: "pdm-menubar", inputs: { menus: "menus", className: "className" }, outputs: { itemSelect: "itemSelect" }, host: { listeners: { "document:keydown.escape": "
|
|
5056
|
+
PdmMenubarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmMenubarComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5057
|
+
PdmMenubarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmMenubarComponent, selector: "pdm-menubar", inputs: { menus: "menus", className: "className", panelClassName: "panelClassName" }, outputs: { itemSelect: "itemSelect" }, host: { listeners: { "document:click": "onDocumentClickOrEsc()", "document:keydown.escape": "onDocumentClickOrEsc()" } }, viewQueries: [{ propertyName: "menuTemplateRef", first: true, predicate: ["menuTemplate"], descendants: true }], ngImport: i0, template: "<nav\n role=\"menubar\"\n [ngClass]=\"[\n 'inline-flex h-9 items-center gap-0.5 rounded-md border border-border bg-background p-1 shadow-sm',\n className,\n ]\"\n>\n <div *ngFor=\"let menu of menus; let i = index\" class=\"relative\">\n <button\n type=\"button\"\n class=\"inline-flex h-7 appearance-none items-center rounded-sm border-0 bg-transparent px-3 text-sm text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n [attr.aria-expanded]=\"openIndex === i\"\n (click)=\"toggle(i, $event)\"\n >\n {{ menu.label }}\n </button>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #menuTemplate>\n <div\n class=\"min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md sm:min-w-48\"\n >\n <button\n *ngFor=\"let item of menus[openIndex]?.items || []\"\n type=\"button\"\n [disabled]=\"item.disabled || !item.value\"\n class=\"relative flex w-full appearance-none cursor-default select-none items-center rounded-sm border-0 bg-transparent px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\"\n (click)=\"selectItem(item)\"\n >\n {{ item.label }}\n </button>\n </div>\n </ng-template>\n</nav>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4511
5058
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmMenubarComponent, decorators: [{
|
|
4512
5059
|
type: Component,
|
|
4513
|
-
args: [{ selector:
|
|
4514
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { menus: [{
|
|
5060
|
+
args: [{ selector: "pdm-menubar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav\n role=\"menubar\"\n [ngClass]=\"[\n 'inline-flex h-9 items-center gap-0.5 rounded-md border border-border bg-background p-1 shadow-sm',\n className,\n ]\"\n>\n <div *ngFor=\"let menu of menus; let i = index\" class=\"relative\">\n <button\n type=\"button\"\n class=\"inline-flex h-7 appearance-none items-center rounded-sm border-0 bg-transparent px-3 text-sm text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n [attr.aria-expanded]=\"openIndex === i\"\n (click)=\"toggle(i, $event)\"\n >\n {{ menu.label }}\n </button>\n </div>\n\n <!-- Template for CDK Overlay -->\n <ng-template #menuTemplate>\n <div\n class=\"min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md sm:min-w-48\"\n >\n <button\n *ngFor=\"let item of menus[openIndex]?.items || []\"\n type=\"button\"\n [disabled]=\"item.disabled || !item.value\"\n class=\"relative flex w-full appearance-none cursor-default select-none items-center rounded-sm border-0 bg-transparent px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\"\n (click)=\"selectItem(item)\"\n >\n {{ item.label }}\n </button>\n </div>\n </ng-template>\n</nav>\n", styles: [":host{display:block}\n"] }]
|
|
5061
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { menus: [{
|
|
4515
5062
|
type: Input
|
|
4516
5063
|
}], className: [{
|
|
4517
5064
|
type: Input
|
|
5065
|
+
}], panelClassName: [{
|
|
5066
|
+
type: Input
|
|
4518
5067
|
}], itemSelect: [{
|
|
4519
5068
|
type: Output
|
|
4520
|
-
}],
|
|
5069
|
+
}], menuTemplateRef: [{
|
|
5070
|
+
type: ViewChild,
|
|
5071
|
+
args: ["menuTemplate"]
|
|
5072
|
+
}], onDocumentClickOrEsc: [{
|
|
4521
5073
|
type: HostListener,
|
|
4522
|
-
args: [
|
|
5074
|
+
args: ["document:click"]
|
|
5075
|
+
}, {
|
|
5076
|
+
type: HostListener,
|
|
5077
|
+
args: ["document:keydown.escape"]
|
|
4523
5078
|
}] } });
|
|
4524
5079
|
|
|
4525
5080
|
class PdmNativeSelectComponent {
|
|
@@ -4735,18 +5290,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4735
5290
|
}] } });
|
|
4736
5291
|
|
|
4737
5292
|
class PdmSelectComponent {
|
|
4738
|
-
constructor(
|
|
4739
|
-
this.elementRef = elementRef;
|
|
5293
|
+
constructor(cdr, overlay, viewContainerRef) {
|
|
4740
5294
|
this.cdr = cdr;
|
|
4741
5295
|
this.overlay = overlay;
|
|
4742
5296
|
this.viewContainerRef = viewContainerRef;
|
|
4743
|
-
this.id =
|
|
4744
|
-
this.value =
|
|
5297
|
+
this.id = "";
|
|
5298
|
+
this.value = "";
|
|
4745
5299
|
this.options = [];
|
|
4746
5300
|
this.disabled = false;
|
|
4747
5301
|
this.invalid = false;
|
|
4748
|
-
this.className =
|
|
4749
|
-
this.placeholder =
|
|
5302
|
+
this.className = "";
|
|
5303
|
+
this.placeholder = "Select an option";
|
|
4750
5304
|
this.open = false;
|
|
4751
5305
|
this.valueChange = new EventEmitter();
|
|
4752
5306
|
this.overlayRef = null;
|
|
@@ -4769,7 +5323,7 @@ class PdmSelectComponent {
|
|
|
4769
5323
|
return this.projectedOptions.map((d) => ({
|
|
4770
5324
|
label: d.resolvedLabel,
|
|
4771
5325
|
value: d.value,
|
|
4772
|
-
disabled: d.disabled
|
|
5326
|
+
disabled: d.disabled,
|
|
4773
5327
|
}));
|
|
4774
5328
|
}
|
|
4775
5329
|
return this.options;
|
|
@@ -4821,11 +5375,13 @@ class PdmSelectComponent {
|
|
|
4821
5375
|
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
4822
5376
|
width: triggerEl.offsetWidth,
|
|
4823
5377
|
// Consumer overrides are spread last — they win over every default above.
|
|
4824
|
-
...this.overlayOptions
|
|
5378
|
+
...this.overlayOptions,
|
|
4825
5379
|
});
|
|
4826
5380
|
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
4827
5381
|
this.overlayRef.attach(portal);
|
|
4828
|
-
this.backdropSub = this.overlayRef
|
|
5382
|
+
this.backdropSub = this.overlayRef
|
|
5383
|
+
.outsidePointerEvents()
|
|
5384
|
+
.subscribe((event) => {
|
|
4829
5385
|
const target = event.target;
|
|
4830
5386
|
if (!triggerEl.contains(target)) {
|
|
4831
5387
|
this.closePanel();
|
|
@@ -4851,12 +5407,12 @@ class PdmSelectComponent {
|
|
|
4851
5407
|
}
|
|
4852
5408
|
}
|
|
4853
5409
|
}
|
|
4854
|
-
PdmSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, deps: [{ token: i0.
|
|
4855
|
-
PdmSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmSelectComponent, selector: "pdm-select", inputs: { id: "id", value: "value", options: "options", disabled: "disabled", invalid: "invalid", className: "className", placeholder: "placeholder", overlayOptions: "overlayOptions" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "projectedOptions", predicate: PdmSelectOptionDirective }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5410
|
+
PdmSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5411
|
+
PdmSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmSelectComponent, selector: "pdm-select", inputs: { id: "id", value: "value", options: "options", disabled: "disabled", invalid: "invalid", className: "className", placeholder: "placeholder", overlayOptions: "overlayOptions" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "projectedOptions", predicate: PdmSelectOptionDirective }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4856
5412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, decorators: [{
|
|
4857
5413
|
type: Component,
|
|
4858
|
-
args: [{ selector:
|
|
4859
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
5414
|
+
args: [{ selector: "pdm-select", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n 'border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
|
|
5415
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { id: [{
|
|
4860
5416
|
type: Input
|
|
4861
5417
|
}], value: [{
|
|
4862
5418
|
type: Input
|
|
@@ -4876,16 +5432,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4876
5432
|
type: Output
|
|
4877
5433
|
}], triggerRef: [{
|
|
4878
5434
|
type: ViewChild,
|
|
4879
|
-
args: [
|
|
5435
|
+
args: ["triggerEl"]
|
|
4880
5436
|
}], panelTemplateRef: [{
|
|
4881
5437
|
type: ViewChild,
|
|
4882
|
-
args: [
|
|
5438
|
+
args: ["panelTemplate"]
|
|
4883
5439
|
}], projectedOptions: [{
|
|
4884
5440
|
type: ContentChildren,
|
|
4885
5441
|
args: [PdmSelectOptionDirective]
|
|
4886
5442
|
}], onEscape: [{
|
|
4887
5443
|
type: HostListener,
|
|
4888
|
-
args: [
|
|
5444
|
+
args: ["document:keydown.escape"]
|
|
4889
5445
|
}] } });
|
|
4890
5446
|
|
|
4891
5447
|
class PdmPaginationComponent {
|
|
@@ -4956,51 +5512,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4956
5512
|
}] } });
|
|
4957
5513
|
|
|
4958
5514
|
class PdmPopoverComponent {
|
|
4959
|
-
constructor(elementRef, cdr) {
|
|
5515
|
+
constructor(overlay, viewContainerRef, elementRef, cdr) {
|
|
5516
|
+
this.overlay = overlay;
|
|
5517
|
+
this.viewContainerRef = viewContainerRef;
|
|
4960
5518
|
this.elementRef = elementRef;
|
|
4961
5519
|
this.cdr = cdr;
|
|
4962
5520
|
this._open = false;
|
|
4963
|
-
this.triggerText =
|
|
4964
|
-
this.className =
|
|
4965
|
-
this.panelClassName =
|
|
5521
|
+
this.triggerText = "Open";
|
|
5522
|
+
this.className = "";
|
|
5523
|
+
this.panelClassName = "";
|
|
4966
5524
|
this.showTrigger = true;
|
|
4967
5525
|
this.openChange = new EventEmitter();
|
|
4968
|
-
this.
|
|
4969
|
-
|
|
4970
|
-
ngOnInit() {
|
|
4971
|
-
this.boundPointerDown = (event) => this.onDocumentPointerDown(event);
|
|
4972
|
-
document.addEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
5526
|
+
this.overlayRef = null;
|
|
5527
|
+
this.outsideClickSub = null;
|
|
4973
5528
|
}
|
|
5529
|
+
ngOnInit() { }
|
|
4974
5530
|
ngOnDestroy() {
|
|
4975
|
-
|
|
4976
|
-
document.removeEventListener('pointerdown', this.boundPointerDown, { capture: true });
|
|
4977
|
-
}
|
|
5531
|
+
this.destroyOverlay();
|
|
4978
5532
|
}
|
|
4979
5533
|
set open(value) {
|
|
4980
|
-
this._open
|
|
4981
|
-
|
|
4982
|
-
|
|
5534
|
+
if (this._open === !!value)
|
|
5535
|
+
return;
|
|
5536
|
+
if (value) {
|
|
5537
|
+
this.openPanel();
|
|
4983
5538
|
}
|
|
4984
5539
|
else {
|
|
4985
|
-
this.
|
|
5540
|
+
this.closePanel();
|
|
4986
5541
|
}
|
|
4987
|
-
this.cdr.markForCheck();
|
|
4988
5542
|
}
|
|
4989
5543
|
get open() {
|
|
4990
5544
|
return this._open;
|
|
4991
5545
|
}
|
|
4992
|
-
get panelClasses() {
|
|
4993
|
-
const baseClasses = 'min-w-80 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md';
|
|
4994
|
-
return [
|
|
4995
|
-
this.panelPlacement === 'top'
|
|
4996
|
-
? `absolute bottom-full left-0 ${Z_INDEX.popover} mb-2 ${baseClasses}`
|
|
4997
|
-
: `absolute left-0 top-full ${Z_INDEX.popover} mt-2 ${baseClasses}`,
|
|
4998
|
-
this.panelClassName
|
|
4999
|
-
];
|
|
5000
|
-
}
|
|
5001
5546
|
toggle() {
|
|
5002
5547
|
this.open = !this.open;
|
|
5003
|
-
this.openChange.emit(this.open);
|
|
5004
5548
|
}
|
|
5005
5549
|
onEsc() {
|
|
5006
5550
|
if (this.open) {
|
|
@@ -5008,48 +5552,99 @@ class PdmPopoverComponent {
|
|
|
5008
5552
|
this.openChange.emit(false);
|
|
5009
5553
|
}
|
|
5010
5554
|
}
|
|
5011
|
-
|
|
5012
|
-
this.
|
|
5013
|
-
}
|
|
5014
|
-
onDocumentPointerDown(event) {
|
|
5015
|
-
if (!this.open)
|
|
5555
|
+
openPanel() {
|
|
5556
|
+
if (this.overlayRef)
|
|
5016
5557
|
return;
|
|
5017
|
-
const
|
|
5018
|
-
if (
|
|
5558
|
+
const triggerEl = this.triggerRef?.nativeElement;
|
|
5559
|
+
if (!triggerEl)
|
|
5560
|
+
return;
|
|
5561
|
+
this._open = true;
|
|
5562
|
+
this.openChange.emit(true);
|
|
5563
|
+
this.cdr.markForCheck();
|
|
5564
|
+
const positionStrategy = this.overlay
|
|
5565
|
+
.position()
|
|
5566
|
+
.flexibleConnectedTo(triggerEl)
|
|
5567
|
+
.withPositions(this.getPositionConfigs())
|
|
5568
|
+
.withFlexibleDimensions(false)
|
|
5569
|
+
.withPush(true);
|
|
5570
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX, this.panelClassName);
|
|
5571
|
+
this.overlayRef = this.overlay.create({
|
|
5572
|
+
positionStrategy,
|
|
5573
|
+
panelClass,
|
|
5574
|
+
});
|
|
5575
|
+
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
5576
|
+
this.overlayRef.attach(portal);
|
|
5577
|
+
// Close on click outside
|
|
5578
|
+
this.outsideClickSub = this.overlayRef
|
|
5579
|
+
.outsidePointerEvents()
|
|
5580
|
+
.subscribe(() => {
|
|
5019
5581
|
this.open = false;
|
|
5020
5582
|
this.openChange.emit(false);
|
|
5021
|
-
}
|
|
5022
|
-
|
|
5023
|
-
schedulePanelPlacementUpdate() {
|
|
5024
|
-
setTimeout(() => this.updatePanelPlacement());
|
|
5583
|
+
});
|
|
5584
|
+
this.cdr.markForCheck();
|
|
5025
5585
|
}
|
|
5026
|
-
|
|
5027
|
-
if (!this.
|
|
5028
|
-
return;
|
|
5029
|
-
const anchorEl = this.triggerRef?.nativeElement || this.anchorRef?.nativeElement;
|
|
5030
|
-
const panelEl = this.panelRef?.nativeElement;
|
|
5031
|
-
if (!anchorEl || !panelEl || typeof window === 'undefined') {
|
|
5586
|
+
closePanel() {
|
|
5587
|
+
if (!this.overlayRef)
|
|
5032
5588
|
return;
|
|
5589
|
+
this._open = false;
|
|
5590
|
+
this.openChange.emit(false);
|
|
5591
|
+
this.cdr.markForCheck();
|
|
5592
|
+
this.destroyOverlay();
|
|
5593
|
+
}
|
|
5594
|
+
destroyOverlay() {
|
|
5595
|
+
if (this.outsideClickSub) {
|
|
5596
|
+
this.outsideClickSub.unsubscribe();
|
|
5597
|
+
this.outsideClickSub = null;
|
|
5033
5598
|
}
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
const spaceBelow = Math.max(0, viewportHeight - anchorRect.bottom - gap);
|
|
5039
|
-
const spaceAbove = Math.max(0, anchorRect.top - gap);
|
|
5040
|
-
const nextPlacement = spaceBelow < panelHeight && spaceAbove > spaceBelow ? 'top' : 'bottom';
|
|
5041
|
-
if (this.panelPlacement !== nextPlacement) {
|
|
5042
|
-
this.panelPlacement = nextPlacement;
|
|
5043
|
-
this.cdr.markForCheck();
|
|
5599
|
+
if (this.overlayRef) {
|
|
5600
|
+
this.overlayRef.detach();
|
|
5601
|
+
this.overlayRef.dispose();
|
|
5602
|
+
this.overlayRef = null;
|
|
5044
5603
|
}
|
|
5045
5604
|
}
|
|
5605
|
+
getPositionConfigs() {
|
|
5606
|
+
return [
|
|
5607
|
+
// Bottom (default)
|
|
5608
|
+
{
|
|
5609
|
+
originX: "start",
|
|
5610
|
+
originY: "bottom",
|
|
5611
|
+
overlayX: "start",
|
|
5612
|
+
overlayY: "top",
|
|
5613
|
+
offsetY: 8,
|
|
5614
|
+
},
|
|
5615
|
+
// Top (fallback)
|
|
5616
|
+
{
|
|
5617
|
+
originX: "start",
|
|
5618
|
+
originY: "top",
|
|
5619
|
+
overlayX: "start",
|
|
5620
|
+
overlayY: "bottom",
|
|
5621
|
+
offsetY: -8,
|
|
5622
|
+
},
|
|
5623
|
+
// Right
|
|
5624
|
+
{
|
|
5625
|
+
originX: "end",
|
|
5626
|
+
originY: "bottom",
|
|
5627
|
+
overlayX: "start",
|
|
5628
|
+
overlayY: "top",
|
|
5629
|
+
offsetY: 8,
|
|
5630
|
+
},
|
|
5631
|
+
// Left
|
|
5632
|
+
{
|
|
5633
|
+
originX: "start",
|
|
5634
|
+
originY: "bottom",
|
|
5635
|
+
overlayX: "end",
|
|
5636
|
+
overlayY: "top",
|
|
5637
|
+
offsetY: 8,
|
|
5638
|
+
},
|
|
5639
|
+
];
|
|
5640
|
+
}
|
|
5046
5641
|
}
|
|
5047
|
-
PdmPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmPopoverComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5048
|
-
PdmPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmPopoverComponent, selector: "pdm-popover", inputs: { triggerText: "triggerText", className: "className", panelClassName: "panelClassName", showTrigger: "showTrigger", open: "open" }, outputs: { openChange: "openChange" }, host: { listeners: { "document:keydown.escape": "onEsc()"
|
|
5642
|
+
PdmPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmPopoverComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5643
|
+
PdmPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmPopoverComponent, selector: "pdm-popover", inputs: { triggerText: "triggerText", className: "className", panelClassName: "panelClassName", showTrigger: "showTrigger", open: "open" }, outputs: { openChange: "openChange" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"relative inline-block\" [ngClass]=\"className\">\n <button\n #triggerEl\n *ngIf=\"showTrigger\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground shadow-sm\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"'dialog'\"\n (click)=\"toggle()\"\n >\n {{ triggerText }}\n </button>\n\n <!-- Trigger slot for custom trigger -->\n <ng-content select=\"[pdmPopoverTrigger]\"></ng-content>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <div\n class=\"min-w-80 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5049
5644
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmPopoverComponent, decorators: [{
|
|
5050
5645
|
type: Component,
|
|
5051
|
-
args: [{ selector:
|
|
5052
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { triggerText: [{
|
|
5646
|
+
args: [{ selector: "pdm-popover", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"relative inline-block\" [ngClass]=\"className\">\n <button\n #triggerEl\n *ngIf=\"showTrigger\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground shadow-sm\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"'dialog'\"\n (click)=\"toggle()\"\n >\n {{ triggerText }}\n </button>\n\n <!-- Trigger slot for custom trigger -->\n <ng-content select=\"[pdmPopoverTrigger]\"></ng-content>\n\n <!-- Template for CDK Overlay -->\n <ng-template #panelTemplate>\n <div\n class=\"min-w-80 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:inline-block}\n"] }]
|
|
5647
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { triggerText: [{
|
|
5053
5648
|
type: Input
|
|
5054
5649
|
}], className: [{
|
|
5055
5650
|
type: Input
|
|
@@ -5059,26 +5654,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5059
5654
|
type: Input
|
|
5060
5655
|
}], openChange: [{
|
|
5061
5656
|
type: Output
|
|
5062
|
-
}], anchorRef: [{
|
|
5063
|
-
type: ViewChild,
|
|
5064
|
-
args: ['anchorEl']
|
|
5065
5657
|
}], triggerRef: [{
|
|
5066
5658
|
type: ViewChild,
|
|
5067
|
-
args: [
|
|
5068
|
-
}],
|
|
5659
|
+
args: ["triggerEl"]
|
|
5660
|
+
}], panelTemplateRef: [{
|
|
5069
5661
|
type: ViewChild,
|
|
5070
|
-
args: [
|
|
5662
|
+
args: ["panelTemplate"]
|
|
5071
5663
|
}], open: [{
|
|
5072
5664
|
type: Input
|
|
5073
5665
|
}], onEsc: [{
|
|
5074
5666
|
type: HostListener,
|
|
5075
|
-
args: [
|
|
5076
|
-
}], onViewportChange: [{
|
|
5077
|
-
type: HostListener,
|
|
5078
|
-
args: ['window:resize']
|
|
5079
|
-
}, {
|
|
5080
|
-
type: HostListener,
|
|
5081
|
-
args: ['window:scroll']
|
|
5667
|
+
args: ["document:keydown.escape"]
|
|
5082
5668
|
}] } });
|
|
5083
5669
|
|
|
5084
5670
|
class PdmProgressComponent {
|
|
@@ -5530,8 +6116,8 @@ class PdmTabsComponent {
|
|
|
5530
6116
|
constructor(cdr) {
|
|
5531
6117
|
this.cdr = cdr;
|
|
5532
6118
|
this.items = [];
|
|
5533
|
-
this.value =
|
|
5534
|
-
this.className =
|
|
6119
|
+
this.value = "";
|
|
6120
|
+
this.className = "";
|
|
5535
6121
|
this.valueChange = new EventEmitter();
|
|
5536
6122
|
}
|
|
5537
6123
|
select(item) {
|
|
@@ -5543,10 +6129,10 @@ class PdmTabsComponent {
|
|
|
5543
6129
|
}
|
|
5544
6130
|
}
|
|
5545
6131
|
PdmTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTabsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5546
|
-
PdmTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTabsComponent, selector: "pdm-tabs", inputs: { items: "items", value: "value", className: "className" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div [ngClass]=\"['w-full', className]\">\n <div\n role=\"tablist\"\n class=\"inline-flex h-8 w-full items-center overflow-x-auto scrollbar-thin rounded-lg bg-muted p-[3px] text-muted-foreground md:w-fit\"\n >\n <button\n *ngFor=\"let item of items\"\n role=\"tab\"\n [attr.aria-selected]=\"value === item.value\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative inline-flex h-[calc(100%-1px)] appearance-none flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-3 py-0.5 text-sm font-medium transition-all focus-visible:border-ring focus-visible:outline-none focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 md:flex-initial md:px-4',\n value === item.value ? 'bg-background text-foreground shadow-sm' : 'bg-transparent text-muted-foreground'\n ]\"\n (click)=\"select(item)\"\n type=\"button\"\n >\n {{ item.label }}\n </button>\n </div>\n <div class=\"mt-4\">\n <ng-content></ng-content>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6132
|
+
PdmTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTabsComponent, selector: "pdm-tabs", inputs: { items: "items", value: "value", className: "className" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div [ngClass]=\"['w-full', className]\">\n <div\n role=\"tablist\"\n class=\"inline-flex h-8 w-full items-center overflow-x-auto scrollbar-thin rounded-lg bg-muted p-[3px] text-muted-foreground md:w-fit\"\n >\n <button\n *ngFor=\"let item of items\"\n role=\"tab\"\n [attr.aria-selected]=\"value === item.value\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative inline-flex h-[calc(100%-1px)] appearance-none flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-3 py-0.5 text-sm font-medium transition-all focus-visible:border-ring focus-visible:outline-none focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 md:flex-initial md:px-4',\n value === item.value ? 'bg-background text-foreground shadow-sm' : 'bg-transparent text-muted-foreground'\n ]\"\n (click)=\"select(item)\"\n type=\"button\"\n >\n {{ item.label }}\n </button>\n </div>\n <div class=\"mt-4\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5547
6133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTabsComponent, decorators: [{
|
|
5548
6134
|
type: Component,
|
|
5549
|
-
args: [{ selector:
|
|
6135
|
+
args: [{ selector: "pdm-tabs", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"['w-full', className]\">\n <div\n role=\"tablist\"\n class=\"inline-flex h-8 w-full items-center overflow-x-auto scrollbar-thin rounded-lg bg-muted p-[3px] text-muted-foreground md:w-fit\"\n >\n <button\n *ngFor=\"let item of items\"\n role=\"tab\"\n [attr.aria-selected]=\"value === item.value\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative inline-flex h-[calc(100%-1px)] appearance-none flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-3 py-0.5 text-sm font-medium transition-all focus-visible:border-ring focus-visible:outline-none focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 md:flex-initial md:px-4',\n value === item.value ? 'bg-background text-foreground shadow-sm' : 'bg-transparent text-muted-foreground'\n ]\"\n (click)=\"select(item)\"\n type=\"button\"\n >\n {{ item.label }}\n </button>\n </div>\n <div class=\"mt-4\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
5550
6136
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
5551
6137
|
type: Input
|
|
5552
6138
|
}], value: [{
|
|
@@ -5654,8 +6240,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5654
6240
|
class PdmToggleGroupComponent {
|
|
5655
6241
|
constructor() {
|
|
5656
6242
|
this.items = [];
|
|
5657
|
-
this.value =
|
|
5658
|
-
this.className =
|
|
6243
|
+
this.value = "";
|
|
6244
|
+
this.className = "";
|
|
5659
6245
|
this.valueChange = new EventEmitter();
|
|
5660
6246
|
}
|
|
5661
6247
|
onSelect(next, disabled) {
|
|
@@ -5665,10 +6251,10 @@ class PdmToggleGroupComponent {
|
|
|
5665
6251
|
}
|
|
5666
6252
|
}
|
|
5667
6253
|
PdmToggleGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmToggleGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5668
|
-
PdmToggleGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmToggleGroupComponent, selector: "pdm-toggle-group", inputs: { items: "items", value: "value", className: "className" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div
|
|
6254
|
+
PdmToggleGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmToggleGroupComponent, selector: "pdm-toggle-group", inputs: { items: "items", value: "value", className: "className" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div\n [ngClass]=\"[\n 'flex flex-wrap items-center rounded-md border border-border p-1 gap-1',\n className,\n ]\"\n role=\"group\"\n>\n <button\n *ngFor=\"let item of items\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [attr.aria-pressed]=\"item.value === value\"\n [ngClass]=\"[\n 'inline-flex h-8 appearance-none items-center justify-center rounded-sm border-0 bg-transparent px-2.5 text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n item.value === value\n ? 'bg-accent text-accent-foreground'\n : 'text-foreground hover:bg-accent hover:text-accent-foreground',\n ]\"\n (click)=\"onSelect(item.value, item.disabled)\"\n >\n {{ item.label }}\n </button>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5669
6255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmToggleGroupComponent, decorators: [{
|
|
5670
6256
|
type: Component,
|
|
5671
|
-
args: [{ selector:
|
|
6257
|
+
args: [{ selector: "pdm-toggle-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [ngClass]=\"[\n 'flex flex-wrap items-center rounded-md border border-border p-1 gap-1',\n className,\n ]\"\n role=\"group\"\n>\n <button\n *ngFor=\"let item of items\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [attr.aria-pressed]=\"item.value === value\"\n [ngClass]=\"[\n 'inline-flex h-8 appearance-none items-center justify-center rounded-sm border-0 bg-transparent px-2.5 text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n item.value === value\n ? 'bg-accent text-accent-foreground'\n : 'text-foreground hover:bg-accent hover:text-accent-foreground',\n ]\"\n (click)=\"onSelect(item.value, item.disabled)\"\n >\n {{ item.label }}\n </button>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
5672
6258
|
}], propDecorators: { items: [{
|
|
5673
6259
|
type: Input
|
|
5674
6260
|
}], value: [{
|
|
@@ -5680,33 +6266,173 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5680
6266
|
}] } });
|
|
5681
6267
|
|
|
5682
6268
|
class PdmTooltipComponent {
|
|
5683
|
-
constructor() {
|
|
5684
|
-
this.
|
|
5685
|
-
this.
|
|
5686
|
-
this.
|
|
6269
|
+
constructor(overlay, viewContainerRef, elementRef, cdr) {
|
|
6270
|
+
this.overlay = overlay;
|
|
6271
|
+
this.viewContainerRef = viewContainerRef;
|
|
6272
|
+
this.elementRef = elementRef;
|
|
6273
|
+
this.cdr = cdr;
|
|
6274
|
+
this.text = "";
|
|
6275
|
+
this.side = "top";
|
|
6276
|
+
this.className = "";
|
|
5687
6277
|
this.open = false;
|
|
6278
|
+
this.overlayRef = null;
|
|
6279
|
+
}
|
|
6280
|
+
ngOnDestroy() {
|
|
6281
|
+
this.destroyOverlay();
|
|
6282
|
+
}
|
|
6283
|
+
onMouseEnter() {
|
|
6284
|
+
this.show();
|
|
6285
|
+
}
|
|
6286
|
+
onMouseLeave() {
|
|
6287
|
+
this.hide();
|
|
6288
|
+
}
|
|
6289
|
+
onFocusIn() {
|
|
6290
|
+
this.show();
|
|
5688
6291
|
}
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
6292
|
+
onFocusOut() {
|
|
6293
|
+
this.hide();
|
|
6294
|
+
}
|
|
6295
|
+
show() {
|
|
6296
|
+
if (this.open || !this.text)
|
|
6297
|
+
return;
|
|
6298
|
+
this.open = true;
|
|
6299
|
+
this.cdr.markForCheck();
|
|
6300
|
+
this.createOverlay();
|
|
6301
|
+
}
|
|
6302
|
+
hide() {
|
|
6303
|
+
if (!this.open)
|
|
6304
|
+
return;
|
|
6305
|
+
this.open = false;
|
|
6306
|
+
this.cdr.markForCheck();
|
|
6307
|
+
this.destroyOverlay();
|
|
6308
|
+
}
|
|
6309
|
+
createOverlay() {
|
|
6310
|
+
if (this.overlayRef)
|
|
6311
|
+
return;
|
|
6312
|
+
const triggerEl = this.elementRef.nativeElement.querySelector(":scope > *") ||
|
|
6313
|
+
this.elementRef.nativeElement;
|
|
6314
|
+
const positionStrategy = this.overlay
|
|
6315
|
+
.position()
|
|
6316
|
+
.flexibleConnectedTo(triggerEl)
|
|
6317
|
+
.withPositions(this.getPositionConfigs())
|
|
6318
|
+
.withFlexibleDimensions(false)
|
|
6319
|
+
.withPush(true);
|
|
6320
|
+
const panelClass = mergeOverlayPanelClass(OVERLAY_BASE_Z_INDEX);
|
|
6321
|
+
this.overlayRef = this.overlay.create({
|
|
6322
|
+
positionStrategy,
|
|
6323
|
+
panelClass,
|
|
6324
|
+
});
|
|
6325
|
+
const portal = new TemplatePortal(this.tooltipTemplate, this.viewContainerRef);
|
|
6326
|
+
this.overlayRef.attach(portal);
|
|
6327
|
+
}
|
|
6328
|
+
destroyOverlay() {
|
|
6329
|
+
if (this.overlayRef) {
|
|
6330
|
+
this.overlayRef.detach();
|
|
6331
|
+
this.overlayRef.dispose();
|
|
6332
|
+
this.overlayRef = null;
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
getPositionConfigs() {
|
|
6336
|
+
const offset = 4;
|
|
6337
|
+
switch (this.side) {
|
|
6338
|
+
case "bottom":
|
|
6339
|
+
return [
|
|
6340
|
+
{
|
|
6341
|
+
originX: "center",
|
|
6342
|
+
originY: "bottom",
|
|
6343
|
+
overlayX: "center",
|
|
6344
|
+
overlayY: "top",
|
|
6345
|
+
offsetY: offset,
|
|
6346
|
+
},
|
|
6347
|
+
{
|
|
6348
|
+
originX: "center",
|
|
6349
|
+
originY: "top",
|
|
6350
|
+
overlayX: "center",
|
|
6351
|
+
overlayY: "bottom",
|
|
6352
|
+
offsetY: -offset,
|
|
6353
|
+
},
|
|
6354
|
+
];
|
|
6355
|
+
case "left":
|
|
6356
|
+
return [
|
|
6357
|
+
{
|
|
6358
|
+
originX: "start",
|
|
6359
|
+
originY: "center",
|
|
6360
|
+
overlayX: "end",
|
|
6361
|
+
overlayY: "center",
|
|
6362
|
+
offsetX: -offset,
|
|
6363
|
+
},
|
|
6364
|
+
{
|
|
6365
|
+
originX: "end",
|
|
6366
|
+
originY: "center",
|
|
6367
|
+
overlayX: "start",
|
|
6368
|
+
overlayY: "center",
|
|
6369
|
+
offsetX: offset,
|
|
6370
|
+
},
|
|
6371
|
+
];
|
|
6372
|
+
case "right":
|
|
6373
|
+
return [
|
|
6374
|
+
{
|
|
6375
|
+
originX: "end",
|
|
6376
|
+
originY: "center",
|
|
6377
|
+
overlayX: "start",
|
|
6378
|
+
overlayY: "center",
|
|
6379
|
+
offsetX: offset,
|
|
6380
|
+
},
|
|
6381
|
+
{
|
|
6382
|
+
originX: "start",
|
|
6383
|
+
originY: "center",
|
|
6384
|
+
overlayX: "end",
|
|
6385
|
+
overlayY: "center",
|
|
6386
|
+
offsetX: -offset,
|
|
6387
|
+
},
|
|
6388
|
+
];
|
|
6389
|
+
case "top":
|
|
6390
|
+
default:
|
|
6391
|
+
return [
|
|
6392
|
+
{
|
|
6393
|
+
originX: "center",
|
|
6394
|
+
originY: "top",
|
|
6395
|
+
overlayX: "center",
|
|
6396
|
+
overlayY: "bottom",
|
|
6397
|
+
offsetY: -offset,
|
|
6398
|
+
},
|
|
6399
|
+
{
|
|
6400
|
+
originX: "center",
|
|
6401
|
+
originY: "bottom",
|
|
6402
|
+
overlayX: "center",
|
|
6403
|
+
overlayY: "top",
|
|
6404
|
+
offsetY: offset,
|
|
6405
|
+
},
|
|
6406
|
+
];
|
|
6407
|
+
}
|
|
5697
6408
|
}
|
|
5698
6409
|
}
|
|
5699
|
-
PdmTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5700
|
-
PdmTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTooltipComponent, selector: "pdm-tooltip", inputs: { text: "text", side: "side", className: "className" }, ngImport: i0, template: "<span
|
|
6410
|
+
PdmTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTooltipComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6411
|
+
PdmTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmTooltipComponent, selector: "pdm-tooltip", inputs: { text: "text", side: "side", className: "className" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()" } }, viewQueries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["tooltipTemplate"], descendants: true }], ngImport: i0, template: "<span\n class=\"relative inline-flex\"\n [ngClass]=\"className\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n <ng-content></ng-content>\n\n <!-- Template for CDK Overlay -->\n <ng-template #tooltipTemplate>\n <span\n class=\"pointer-events-none overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-xs text-background animate-in fade-in-0 zoom-in-95\"\n >\n {{ text }}\n </span>\n </ng-template>\n</span>\n", styles: [":host{display:inline-flex}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5701
6412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmTooltipComponent, decorators: [{
|
|
5702
6413
|
type: Component,
|
|
5703
|
-
args: [{ selector:
|
|
5704
|
-
}], propDecorators: { text: [{
|
|
6414
|
+
args: [{ selector: "pdm-tooltip", changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"relative inline-flex\"\n [ngClass]=\"className\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n <ng-content></ng-content>\n\n <!-- Template for CDK Overlay -->\n <ng-template #tooltipTemplate>\n <span\n class=\"pointer-events-none overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-xs text-background animate-in fade-in-0 zoom-in-95\"\n >\n {{ text }}\n </span>\n </ng-template>\n</span>\n", styles: [":host{display:inline-flex}\n"] }]
|
|
6415
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { text: [{
|
|
5705
6416
|
type: Input
|
|
5706
6417
|
}], side: [{
|
|
5707
6418
|
type: Input
|
|
5708
6419
|
}], className: [{
|
|
5709
6420
|
type: Input
|
|
6421
|
+
}], tooltipTemplate: [{
|
|
6422
|
+
type: ViewChild,
|
|
6423
|
+
args: ["tooltipTemplate"]
|
|
6424
|
+
}], onMouseEnter: [{
|
|
6425
|
+
type: HostListener,
|
|
6426
|
+
args: ["mouseenter"]
|
|
6427
|
+
}], onMouseLeave: [{
|
|
6428
|
+
type: HostListener,
|
|
6429
|
+
args: ["mouseleave"]
|
|
6430
|
+
}], onFocusIn: [{
|
|
6431
|
+
type: HostListener,
|
|
6432
|
+
args: ["focusin"]
|
|
6433
|
+
}], onFocusOut: [{
|
|
6434
|
+
type: HostListener,
|
|
6435
|
+
args: ["focusout"]
|
|
5710
6436
|
}] } });
|
|
5711
6437
|
|
|
5712
6438
|
const COMPONENTS = [
|
|
@@ -5907,5 +6633,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5907
6633
|
* Generated bundle index. Do not edit.
|
|
5908
6634
|
*/
|
|
5909
6635
|
|
|
5910
|
-
export { BREAKPOINTS, PdmAccordionComponent, PdmAlertComponent, PdmAlertDialogComponent, PdmAspectRatioComponent, PdmAvatarComponent, PdmBadgeComponent, PdmBreadcrumbComponent, PdmButtonComponent, PdmButtonGroupComponent, PdmCalendarComponent, PdmCardComponent, PdmCarouselComponent, PdmChartComponent, PdmCheckboxComponent, PdmCollapsibleComponent, PdmComboboxComponent, PdmCommandComponent, PdmContextMenuComponent, PdmDataTableComponent, PdmDatePickerComponent, PdmDialogComponent, PdmDraggableTableComponent, PdmDrawerComponent, PdmDropdownMenuComponent, PdmEmptyComponent, PdmFieldComponent, PdmHoverCardComponent, PdmIconComponent, PdmInputComponent, PdmInputGroupComponent, PdmInputOtpComponent, PdmInputPasswordComponent, PdmItemComponent, PdmKbdComponent, PdmLabelComponent, PdmMenubarComponent, PdmNativeSelectComponent, PdmNavigationMenuComponent, PdmOutsideClickDirective, PdmPaginationComponent, PdmPopoverComponent, PdmProgressComponent, PdmRadioGroupComponent, PdmScrollAreaComponent, PdmSelectComponent, PdmSelectOptionDirective, PdmSeparatorComponent, PdmSheetComponent, PdmSidebarComponent, PdmSkeletonComponent, PdmSliderComponent, PdmSonnerComponent, PdmSpinnerComponent, PdmSwitchComponent, PdmTableComponent, PdmTabsComponent, PdmTextareaComponent, PdmToggleComponent, PdmToggleGroupComponent, PdmTooltipComponent, PdmUiKitModule, RESPONSIVE_CONTAINER, RESPONSIVE_DISPLAY, TABLE_RESPONSIVE, Z_INDEX, createFlexiblePositionStrategy, logZIndexStack, overflowResponsive, responsive, spacingResponsive, widthResponsive };
|
|
6636
|
+
export { BREAKPOINTS, OVERLAY_BASE_Z_INDEX, PdmAccordionComponent, PdmAlertComponent, PdmAlertDialogComponent, PdmAspectRatioComponent, PdmAvatarComponent, PdmBadgeComponent, PdmBreadcrumbComponent, PdmButtonComponent, PdmButtonGroupComponent, PdmCalendarComponent, PdmCardComponent, PdmCarouselComponent, PdmChartComponent, PdmCheckboxComponent, PdmCollapsibleComponent, PdmComboboxComponent, PdmCommandComponent, PdmContextMenuComponent, PdmDataTableComponent, PdmDatePickerComponent, PdmDialogComponent, PdmDraggableTableComponent, PdmDrawerComponent, PdmDropdownMenuComponent, PdmEmptyComponent, PdmFieldComponent, PdmHoverCardComponent, PdmIconComponent, PdmInputComponent, PdmInputGroupComponent, PdmInputOtpComponent, PdmInputPasswordComponent, PdmItemComponent, PdmKbdComponent, PdmLabelComponent, PdmMenubarComponent, PdmNativeSelectComponent, PdmNavigationMenuComponent, PdmOutsideClickDirective, PdmPaginationComponent, PdmPopoverComponent, PdmProgressComponent, PdmRadioGroupComponent, PdmScrollAreaComponent, PdmSelectComponent, PdmSelectOptionDirective, PdmSeparatorComponent, PdmSheetComponent, PdmSidebarComponent, PdmSkeletonComponent, PdmSliderComponent, PdmSonnerComponent, PdmSpinnerComponent, PdmSwitchComponent, PdmTableComponent, PdmTabsComponent, PdmTextareaComponent, PdmToggleComponent, PdmToggleGroupComponent, PdmTooltipComponent, PdmUiKitModule, RESPONSIVE_CONTAINER, RESPONSIVE_DISPLAY, TABLE_RESPONSIVE, Z_INDEX, createFlexiblePositionStrategy, createZIndexEnforcedOverlay, extractZIndex, logZIndexStack, mergeOverlayPanelClass, overflowResponsive, responsive, spacingResponsive, widthResponsive };
|
|
5911
6637
|
//# sourceMappingURL=pdm-ui-kit.mjs.map
|