@exhaustive-ui/core 3.0.0-alpha.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/exhaustive-ui-core-accordion.mjs +51 -78
- package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs +72 -73
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-api.mjs +6 -13
- package/fesm2022/exhaustive-ui-core-api.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs +485 -683
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autofocus.mjs +21 -31
- package/fesm2022/exhaustive-ui-core-autofocus.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-avatar.mjs +47 -63
- package/fesm2022/exhaustive-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-badge.mjs +88 -115
- package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs +58 -91
- package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +155 -169
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-button.mjs +280 -385
- package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-carousel.mjs +379 -451
- package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +388 -507
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chart.mjs +75 -91
- package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs +109 -160
- package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chip.mjs +98 -137
- package/fesm2022/exhaustive-ui-core-chip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs +123 -190
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +157 -332
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +187 -210
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs +315 -361
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dataview.mjs +225 -272
- package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-datepicker.mjs +1012 -1157
- package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dialog.mjs +370 -507
- package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs +87 -115
- package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs +98 -105
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-drawer.mjs +174 -235
- package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +42 -280
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-editor.mjs +109 -121
- package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fieldset.mjs +90 -132
- package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs +486 -541
- package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs +13 -16
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-focustrap.mjs +44 -40
- package/fesm2022/exhaustive-ui-core-focustrap.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-galleria.mjs +642 -853
- package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-iconfield.mjs +15 -27
- package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs +8 -13
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-image.mjs +209 -251
- package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs +39 -48
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inplace.mjs +64 -98
- package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs +10 -20
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +15 -24
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputicon.mjs +11 -22
- package/fesm2022/exhaustive-ui-core-inputicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputmask.mjs +423 -392
- package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs +397 -469
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputotp.mjs +75 -95
- package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputtext.mjs +27 -36
- package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs +29 -46
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-knob.mjs +140 -187
- package/fesm2022/exhaustive-ui-core-knob.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-listbox.mjs +365 -546
- package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs +320 -371
- package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menu.mjs +298 -348
- package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menubar.mjs +277 -372
- package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-metergroup.mjs +138 -166
- package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-multiselect.mjs +647 -835
- package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-orderlist.mjs +337 -409
- package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs +114 -175
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +22 -47
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-paginator.mjs +232 -320
- package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panel.mjs +114 -174
- package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs +171 -282
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-password.mjs +317 -377
- package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-picklist.mjs +557 -655
- package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-popover.mjs +154 -181
- package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-rating.mjs +87 -119
- package/fesm2022/exhaustive-ui-core-rating.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scroller.mjs +465 -596
- package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs +147 -155
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs +81 -115
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-select.mjs +581 -784
- package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs +84 -120
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-slider.mjs +322 -352
- package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs +209 -268
- package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs +153 -249
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitter.mjs +221 -237
- package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs +56 -72
- package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-styleclass.mjs +145 -146
- package/fesm2022/exhaustive-ui-core-styleclass.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-table.mjs +2213 -2543
- package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-terminal.mjs +50 -67
- package/fesm2022/exhaustive-ui-core-terminal.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs +23 -36
- package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +318 -394
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-timeline.mjs +56 -74
- package/fesm2022/exhaustive-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs +86 -129
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +57 -94
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toolbar.mjs +36 -55
- package/fesm2022/exhaustive-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tooltip.mjs +264 -343
- package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tree.mjs +508 -639
- package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs +327 -421
- package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treetable.mjs +1267 -1473
- package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
- package/package.json +5 -5
- package/schematics/migrations/remove-dead-inputs/migration.js +213 -7
- package/schematics/migrations/renamed-inputs/migration.js +97 -0
- package/schematics/migrations/styleclass-to-class/migration.js +92 -1
- package/schematics/migrations.json +7 -2
- package/schematics/utils/removed-inputs.js +0 -0
- package/schematics/utils/renamed-inputs.js +175 -0
- package/schematics/utils/styleclass.js +24 -8
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-accordion.d.ts +8 -24
- package/types/exhaustive-ui-core-animateonscroll.d.ts +19 -21
- package/types/exhaustive-ui-core-api.d.ts +2 -3
- package/types/exhaustive-ui-core-autocomplete.d.ts +103 -176
- package/types/exhaustive-ui-core-autofocus.d.ts +4 -7
- package/types/exhaustive-ui-core-avatar.d.ts +18 -25
- package/types/exhaustive-ui-core-badge.d.ts +13 -27
- package/types/exhaustive-ui-core-blockui.d.ts +18 -30
- package/types/exhaustive-ui-core-breadcrumb.d.ts +21 -22
- package/types/exhaustive-ui-core-button.d.ts +57 -89
- package/types/exhaustive-ui-core-carousel.d.ts +56 -82
- package/types/exhaustive-ui-core-cascadeselect.d.ts +77 -111
- package/types/exhaustive-ui-core-chart.d.ts +21 -29
- package/types/exhaustive-ui-core-checkbox.d.ts +25 -39
- package/types/exhaustive-ui-core-chip.d.ts +31 -38
- package/types/exhaustive-ui-core-colorpicker.d.ts +23 -57
- package/types/exhaustive-ui-core-confirmdialog.d.ts +39 -109
- package/types/exhaustive-ui-core-confirmpopup.d.ts +24 -43
- package/types/exhaustive-ui-core-contextmenu.d.ts +54 -71
- package/types/exhaustive-ui-core-dataview.d.ts +42 -65
- package/types/exhaustive-ui-core-datepicker.d.ts +109 -191
- package/types/exhaustive-ui-core-dialog.d.ts +73 -123
- package/types/exhaustive-ui-core-dock.d.ts +16 -25
- package/types/exhaustive-ui-core-dragdrop.d.ts +32 -36
- package/types/exhaustive-ui-core-drawer.d.ts +32 -64
- package/types/exhaustive-ui-core-dynamicdialog.d.ts +9 -54
- package/types/exhaustive-ui-core-editor.d.ts +15 -25
- package/types/exhaustive-ui-core-fieldset.d.ts +15 -35
- package/types/exhaustive-ui-core-fileupload.d.ts +69 -95
- package/types/exhaustive-ui-core-floatlabel.d.ts +4 -6
- package/types/exhaustive-ui-core-focustrap.d.ts +5 -10
- package/types/exhaustive-ui-core-galleria.d.ts +124 -194
- package/types/exhaustive-ui-core-iconfield.d.ts +5 -13
- package/types/exhaustive-ui-core-icons-baseicon.d.ts +4 -5
- package/types/exhaustive-ui-core-image.d.ts +35 -68
- package/types/exhaustive-ui-core-imagecompare.d.ts +19 -20
- package/types/exhaustive-ui-core-inplace.d.ts +30 -42
- package/types/exhaustive-ui-core-inputgroup.d.ts +2 -9
- package/types/exhaustive-ui-core-inputgroupaddon.d.ts +6 -10
- package/types/exhaustive-ui-core-inputicon.d.ts +4 -11
- package/types/exhaustive-ui-core-inputmask.d.ts +53 -66
- package/types/exhaustive-ui-core-inputnumber.d.ts +62 -84
- package/types/exhaustive-ui-core-inputotp.d.ts +16 -20
- package/types/exhaustive-ui-core-inputtext.d.ts +5 -8
- package/types/exhaustive-ui-core-keyfilter.d.ts +11 -15
- package/types/exhaustive-ui-core-knob.d.ts +45 -60
- package/types/exhaustive-ui-core-listbox.d.ts +90 -126
- package/types/exhaustive-ui-core-megamenu.d.ts +45 -66
- package/types/exhaustive-ui-core-menu.d.ts +33 -53
- package/types/exhaustive-ui-core-menubar.d.ts +38 -85
- package/types/exhaustive-ui-core-metergroup.d.ts +39 -48
- package/types/exhaustive-ui-core-multiselect.d.ts +166 -219
- package/types/exhaustive-ui-core-orderlist.d.ts +58 -81
- package/types/exhaustive-ui-core-organizationchart.d.ts +32 -67
- package/types/exhaustive-ui-core-overlaybadge.d.ts +10 -20
- package/types/exhaustive-ui-core-paginator.d.ts +41 -69
- package/types/exhaustive-ui-core-panel.d.ts +18 -45
- package/types/exhaustive-ui-core-panelmenu.d.ts +31 -76
- package/types/exhaustive-ui-core-password.d.ts +56 -93
- package/types/exhaustive-ui-core-picklist.d.ts +107 -121
- package/types/exhaustive-ui-core-popover.d.ts +23 -47
- package/types/exhaustive-ui-core-rating.d.ts +18 -26
- package/types/exhaustive-ui-core-scroller.d.ts +90 -120
- package/types/exhaustive-ui-core-scrollpanel.d.ts +35 -46
- package/types/exhaustive-ui-core-scrolltop.d.ts +28 -45
- package/types/exhaustive-ui-core-select.d.ts +137 -188
- package/types/exhaustive-ui-core-selectbutton.d.ts +35 -44
- package/types/exhaustive-ui-core-slider.d.ts +52 -67
- package/types/exhaustive-ui-core-speeddial.d.ts +40 -56
- package/types/exhaustive-ui-core-splitbutton.d.ts +31 -71
- package/types/exhaustive-ui-core-splitter.d.ts +47 -59
- package/types/exhaustive-ui-core-steps.d.ts +24 -31
- package/types/exhaustive-ui-core-styleclass.d.ts +27 -33
- package/types/exhaustive-ui-core-table.d.ts +349 -453
- package/types/exhaustive-ui-core-terminal.d.ts +10 -22
- package/types/exhaustive-ui-core-textarea.d.ts +7 -10
- package/types/exhaustive-ui-core-tieredmenu.d.ts +49 -84
- package/types/exhaustive-ui-core-timeline.d.ts +20 -28
- package/types/exhaustive-ui-core-togglebutton.d.ts +32 -48
- package/types/exhaustive-ui-core-toggleswitch.d.ts +26 -37
- package/types/exhaustive-ui-core-toolbar.d.ts +17 -25
- package/types/exhaustive-ui-core-tooltip.d.ts +53 -88
- package/types/exhaustive-ui-core-tree.d.ts +82 -119
- package/types/exhaustive-ui-core-treeselect.d.ts +63 -92
- package/types/exhaustive-ui-core-treetable.d.ts +203 -280
- package/types/exhaustive-ui-core-types-chip.d.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from '@exhaustive-ui/core/types/button';
|
|
2
2
|
import * as i2 from '@angular/common';
|
|
3
|
-
import {
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, InjectionToken, input, inject, effect, Directive, booleanAttribute, contentChild, computed,
|
|
5
|
+
import { Injectable, InjectionToken, input, inject, effect, afterEveryRender, Directive, untracked, afterNextRender, booleanAttribute, contentChild, computed, signal, numberAttribute, output, contentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
6
6
|
import { addClass, isEmpty, findSingle, createElement } from '@exhaustive-ui/utils';
|
|
7
7
|
import { PrimeTemplate, SharedModule } from '@exhaustive-ui/core/api';
|
|
8
8
|
import { AutoFocus } from '@exhaustive-ui/core/autofocus';
|
|
@@ -21,33 +21,33 @@ const classes = {
|
|
|
21
21
|
root: ({ instance }) => [
|
|
22
22
|
'p-button p-component',
|
|
23
23
|
{
|
|
24
|
-
'p-button-icon-only': instance.hasIcon && !instance.label && !instance.buttonProps?.label && !instance.badge,
|
|
25
|
-
'p-button-vertical': (instance.iconPos === 'top' || instance.iconPos === 'bottom') && instance.label,
|
|
26
|
-
'p-button-loading': instance.loading || instance.buttonProps?.loading,
|
|
27
|
-
'p-button-link': instance.link || instance.buttonProps?.link,
|
|
28
|
-
[`p-button-${instance.severity || instance.buttonProps?.severity}`]: instance.severity || instance.buttonProps?.severity,
|
|
29
|
-
'p-button-raised': instance.raised || instance.buttonProps?.raised,
|
|
30
|
-
'p-button-rounded': instance.rounded || instance.buttonProps?.rounded,
|
|
31
|
-
'p-button-text': instance.text || instance.variant === 'text' || instance.buttonProps?.text || instance.buttonProps?.variant === 'text',
|
|
32
|
-
'p-button-outlined': instance.outlined || instance.variant === 'outlined' || instance.buttonProps?.outlined || instance.buttonProps?.variant === 'outlined',
|
|
33
|
-
'p-button-sm': instance.size === 'small' || instance.buttonProps?.size === 'small',
|
|
34
|
-
'p-button-lg': instance.size === 'large' || instance.buttonProps?.size === 'large',
|
|
35
|
-
'p-button-plain': instance.plain || instance.buttonProps?.plain,
|
|
36
|
-
'p-button-fluid': instance.hasFluid
|
|
24
|
+
'p-button-icon-only': instance.hasIcon() && !instance.label() && !instance.buttonProps()?.label && !instance.badge(),
|
|
25
|
+
'p-button-vertical': (instance.iconPos() === 'top' || instance.iconPos() === 'bottom') && instance.label(),
|
|
26
|
+
'p-button-loading': instance.loading() || instance.buttonProps()?.loading,
|
|
27
|
+
'p-button-link': instance.link() || instance.buttonProps()?.link,
|
|
28
|
+
[`p-button-${instance.severity() || instance.buttonProps()?.severity}`]: instance.severity() || instance.buttonProps()?.severity,
|
|
29
|
+
'p-button-raised': instance.raised() || instance.buttonProps()?.raised,
|
|
30
|
+
'p-button-rounded': instance.rounded() || instance.buttonProps()?.rounded,
|
|
31
|
+
'p-button-text': instance.text() || instance.variant() === 'text' || instance.buttonProps()?.text || instance.buttonProps()?.variant === 'text',
|
|
32
|
+
'p-button-outlined': instance.outlined() || instance.variant() === 'outlined' || instance.buttonProps()?.outlined || instance.buttonProps()?.variant === 'outlined',
|
|
33
|
+
'p-button-sm': instance.size() === 'small' || instance.buttonProps()?.size === 'small',
|
|
34
|
+
'p-button-lg': instance.size() === 'large' || instance.buttonProps()?.size === 'large',
|
|
35
|
+
'p-button-plain': instance.plain() || instance.buttonProps()?.plain,
|
|
36
|
+
'p-button-fluid': instance.hasFluid()
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
loadingIcon: 'p-button-loading-icon',
|
|
40
40
|
icon: ({ instance }) => [
|
|
41
41
|
'p-button-icon',
|
|
42
42
|
{
|
|
43
|
-
[`p-button-icon-${instance.iconPos || instance.buttonProps?.iconPos}`]: instance.label || instance.buttonProps?.label,
|
|
44
|
-
'p-button-icon-left': ((instance.iconPos === 'left' || instance.buttonProps?.iconPos === 'left') && instance.label) || instance.buttonProps?.label,
|
|
45
|
-
'p-button-icon-right': ((instance.iconPos === 'right' || instance.buttonProps?.iconPos === 'right') && instance.label) || instance.buttonProps?.label,
|
|
46
|
-
'p-button-icon-top': ((instance.iconPos === 'top' || instance.buttonProps?.iconPos === 'top') && instance.label) || instance.buttonProps?.label,
|
|
47
|
-
'p-button-icon-bottom': ((instance.iconPos === 'bottom' || instance.buttonProps?.iconPos === 'bottom') && instance.label) || instance.buttonProps?.label
|
|
43
|
+
[`p-button-icon-${instance.iconPos() || instance.buttonProps()?.iconPos}`]: instance.label() || instance.buttonProps()?.label,
|
|
44
|
+
'p-button-icon-left': ((instance.iconPos() === 'left' || instance.buttonProps()?.iconPos === 'left') && instance.label()) || instance.buttonProps()?.label,
|
|
45
|
+
'p-button-icon-right': ((instance.iconPos() === 'right' || instance.buttonProps()?.iconPos === 'right') && instance.label()) || instance.buttonProps()?.label,
|
|
46
|
+
'p-button-icon-top': ((instance.iconPos() === 'top' || instance.buttonProps()?.iconPos === 'top') && instance.label()) || instance.buttonProps()?.label,
|
|
47
|
+
'p-button-icon-bottom': ((instance.iconPos() === 'bottom' || instance.buttonProps()?.iconPos === 'bottom') && instance.label()) || instance.buttonProps()?.label
|
|
48
48
|
},
|
|
49
|
-
instance.icon,
|
|
50
|
-
instance.buttonProps?.icon
|
|
49
|
+
instance.icon(),
|
|
50
|
+
instance.buttonProps()?.icon
|
|
51
51
|
],
|
|
52
52
|
spinnerIcon: ({ instance }) => {
|
|
53
53
|
return Object.entries(instance.cx('icon'))
|
|
@@ -142,9 +142,7 @@ class ButtonLabel extends BaseComponent {
|
|
|
142
142
|
effect(() => {
|
|
143
143
|
this.pButtonLabelUnstyled() && this.directiveUnstyled.set(this.pButtonLabelUnstyled());
|
|
144
144
|
});
|
|
145
|
-
|
|
146
|
-
onAfterViewChecked() {
|
|
147
|
-
this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
|
|
145
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
|
|
148
146
|
}
|
|
149
147
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: ButtonLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
150
148
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: ButtonLabel, isStandalone: true, selector: "[pButtonLabel]", inputs: { ptButtonLabel: { classPropertyName: "ptButtonLabel", publicName: "ptButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, pButtonLabelPT: { classPropertyName: "pButtonLabelPT", publicName: "pButtonLabelPT", isSignal: true, isRequired: false, transformFunction: null }, pButtonLabelUnstyled: { classPropertyName: "pButtonLabelUnstyled", publicName: "pButtonLabelUnstyled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.p-button-label": "!$unstyled() && true" } }, providers: [ButtonStyle, { provide: BUTTON_LABEL_INSTANCE, useExisting: ButtonLabel }, { provide: PARENT_INSTANCE, useExisting: ButtonLabel }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
|
|
@@ -154,7 +152,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
154
152
|
args: [{
|
|
155
153
|
selector: '[pButtonLabel]',
|
|
156
154
|
providers: [ButtonStyle, { provide: BUTTON_LABEL_INSTANCE, useExisting: ButtonLabel }, { provide: PARENT_INSTANCE, useExisting: ButtonLabel }],
|
|
157
|
-
standalone: true,
|
|
158
155
|
host: {
|
|
159
156
|
'[class.p-button-label]': '!$unstyled() && true'
|
|
160
157
|
},
|
|
@@ -196,9 +193,7 @@ class ButtonIcon extends BaseComponent {
|
|
|
196
193
|
effect(() => {
|
|
197
194
|
this.pButtonUnstyled() && this.directiveUnstyled.set(this.pButtonUnstyled());
|
|
198
195
|
});
|
|
199
|
-
|
|
200
|
-
onAfterViewChecked() {
|
|
201
|
-
this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
|
|
196
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
|
|
202
197
|
}
|
|
203
198
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: ButtonIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
204
199
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: ButtonIcon, isStandalone: true, selector: "[pButtonIcon]", inputs: { ptButtonIcon: { classPropertyName: "ptButtonIcon", publicName: "ptButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, pButtonIconPT: { classPropertyName: "pButtonIconPT", publicName: "pButtonIconPT", isSignal: true, isRequired: false, transformFunction: null }, pButtonUnstyled: { classPropertyName: "pButtonUnstyled", publicName: "pButtonUnstyled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.p-button-icon": "!$unstyled() && true" } }, providers: [ButtonStyle, { provide: BUTTON_ICON_INSTANCE, useExisting: ButtonIcon }, { provide: PARENT_INSTANCE, useExisting: ButtonIcon }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
|
|
@@ -208,7 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
208
203
|
args: [{
|
|
209
204
|
selector: '[pButtonIcon]',
|
|
210
205
|
providers: [ButtonStyle, { provide: BUTTON_ICON_INSTANCE, useExisting: ButtonIcon }, { provide: PARENT_INSTANCE, useExisting: ButtonIcon }],
|
|
211
|
-
standalone: true,
|
|
212
206
|
host: {
|
|
213
207
|
'[class.p-button-icon]': '!$unstyled() && true'
|
|
214
208
|
},
|
|
@@ -246,10 +240,8 @@ class ButtonDirective extends BaseComponent {
|
|
|
246
240
|
*/
|
|
247
241
|
pButtonUnstyled = input(/* @ts-ignore */
|
|
248
242
|
...(ngDevMode ? [undefined, { debugName: "pButtonUnstyled" }] : /* istanbul ignore next */ []));
|
|
249
|
-
hostName = ''
|
|
250
|
-
|
|
251
|
-
this.bindDirectiveInstance.setAttrs(this.ptm('root'));
|
|
252
|
-
}
|
|
243
|
+
hostName = input('', /* @ts-ignore */
|
|
244
|
+
...(ngDevMode ? [{ debugName: "hostName" }] : /* istanbul ignore next */ []));
|
|
253
245
|
constructor() {
|
|
254
246
|
super();
|
|
255
247
|
effect(() => {
|
|
@@ -261,51 +253,100 @@ class ButtonDirective extends BaseComponent {
|
|
|
261
253
|
});
|
|
262
254
|
effect(() => {
|
|
263
255
|
const unstyled = this.$unstyled();
|
|
264
|
-
|
|
265
|
-
this.
|
|
266
|
-
|
|
256
|
+
untracked(() => {
|
|
257
|
+
if (this.initialized() && unstyled) {
|
|
258
|
+
this.setStyleClass();
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
effect(() => {
|
|
263
|
+
this._label();
|
|
264
|
+
untracked(() => {
|
|
265
|
+
if (this.initialized()) {
|
|
266
|
+
this.updateLabel();
|
|
267
|
+
this.updateIcon();
|
|
268
|
+
this.setStyleClass();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
effect(() => {
|
|
273
|
+
this._icon();
|
|
274
|
+
this._loading();
|
|
275
|
+
this.iconPos();
|
|
276
|
+
this.loadingIcon();
|
|
277
|
+
untracked(() => {
|
|
278
|
+
if (this.initialized()) {
|
|
279
|
+
this.updateIcon();
|
|
280
|
+
this.setStyleClass();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
effect(() => {
|
|
285
|
+
this._severity();
|
|
286
|
+
this.text();
|
|
287
|
+
this.plain();
|
|
288
|
+
this.raised();
|
|
289
|
+
this.size();
|
|
290
|
+
this.outlined();
|
|
291
|
+
this.rounded();
|
|
292
|
+
this.hasFluid();
|
|
293
|
+
untracked(() => {
|
|
294
|
+
if (this.initialized()) {
|
|
295
|
+
this.setStyleClass();
|
|
296
|
+
}
|
|
297
|
+
});
|
|
267
298
|
});
|
|
299
|
+
afterNextRender(() => {
|
|
300
|
+
!this.$unstyled() && addClass(this.htmlElement, this.getStyleClass().join(' '));
|
|
301
|
+
this.createIcon();
|
|
302
|
+
this.createLabel();
|
|
303
|
+
this.initialized.set(true);
|
|
304
|
+
});
|
|
305
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('root')));
|
|
268
306
|
}
|
|
269
307
|
/**
|
|
270
308
|
* Add a textual class to the button without a background initially.
|
|
271
309
|
* @group Props
|
|
272
310
|
*/
|
|
273
|
-
text = false;
|
|
311
|
+
text = input(false, { ...(ngDevMode ? { debugName: "text" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
274
312
|
/**
|
|
275
313
|
* Add a plain textual class to the button without a background initially.
|
|
276
314
|
* @group Props
|
|
277
315
|
*/
|
|
278
|
-
plain = false;
|
|
316
|
+
plain = input(false, { ...(ngDevMode ? { debugName: "plain" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
279
317
|
/**
|
|
280
318
|
* Add a shadow to indicate elevation.
|
|
281
319
|
* @group Props
|
|
282
320
|
*/
|
|
283
|
-
raised = false;
|
|
321
|
+
raised = input(false, { ...(ngDevMode ? { debugName: "raised" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
284
322
|
/**
|
|
285
323
|
* Defines the size of the button.
|
|
286
324
|
* @group Props
|
|
287
325
|
*/
|
|
288
|
-
size
|
|
326
|
+
size = input(/* @ts-ignore */
|
|
327
|
+
...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
|
|
289
328
|
/**
|
|
290
329
|
* Add a border class without a background initially.
|
|
291
330
|
* @group Props
|
|
292
331
|
*/
|
|
293
|
-
outlined = false;
|
|
332
|
+
outlined = input(false, { ...(ngDevMode ? { debugName: "outlined" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
294
333
|
/**
|
|
295
334
|
* Add a circular border radius to the button.
|
|
296
335
|
* @group Props
|
|
297
336
|
*/
|
|
298
|
-
rounded = false;
|
|
337
|
+
rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
299
338
|
/**
|
|
300
339
|
* Position of the icon.
|
|
301
340
|
* @group Props
|
|
302
341
|
*/
|
|
303
|
-
iconPos = 'left'
|
|
342
|
+
iconPos = input('left', /* @ts-ignore */
|
|
343
|
+
...(ngDevMode ? [{ debugName: "iconPos" }] : /* istanbul ignore next */ []));
|
|
304
344
|
/**
|
|
305
345
|
* Icon to display in loading state.
|
|
306
346
|
* @group Props
|
|
307
347
|
*/
|
|
308
|
-
loadingIcon
|
|
348
|
+
loadingIcon = input(/* @ts-ignore */
|
|
349
|
+
...(ngDevMode ? [undefined, { debugName: "loadingIcon" }] : /* istanbul ignore next */ []));
|
|
309
350
|
/**
|
|
310
351
|
* Spans 100% width of the container when enabled.
|
|
311
352
|
* @defaultValue undefined
|
|
@@ -318,92 +359,56 @@ class ButtonDirective extends BaseComponent {
|
|
|
318
359
|
...(ngDevMode ? [{ debugName: "labelSignal" }] : /* istanbul ignore next */ []));
|
|
319
360
|
isIconOnly = computed(() => !!(!this.labelSignal() && this.iconSignal()), /* @ts-ignore */
|
|
320
361
|
...(ngDevMode ? [{ debugName: "isIconOnly" }] : /* istanbul ignore next */ []));
|
|
321
|
-
_label
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
362
|
+
_label = computed(() => this.label() || this.buttonProps()?.label, /* @ts-ignore */
|
|
363
|
+
...(ngDevMode ? [{ debugName: "_label" }] : /* istanbul ignore next */ []));
|
|
364
|
+
_icon = computed(() => this.icon() || this.buttonProps()?.icon, /* @ts-ignore */
|
|
365
|
+
...(ngDevMode ? [{ debugName: "_icon" }] : /* istanbul ignore next */ []));
|
|
366
|
+
_loading = computed(() => this.loading() || this.buttonProps()?.loading, /* @ts-ignore */
|
|
367
|
+
...(ngDevMode ? [{ debugName: "_loading" }] : /* istanbul ignore next */ []));
|
|
368
|
+
_severity = computed(() => this.severity() || this.buttonProps()?.severity, /* @ts-ignore */
|
|
369
|
+
...(ngDevMode ? [{ debugName: "_severity" }] : /* istanbul ignore next */ []));
|
|
370
|
+
initialized = signal(undefined, /* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
327
372
|
get htmlElement() {
|
|
328
373
|
return this.el.nativeElement;
|
|
329
374
|
}
|
|
330
375
|
_internalClasses = Object.values(INTERNAL_BUTTON_CLASSES);
|
|
331
376
|
pcFluid = inject(Fluid, { optional: true, host: true, skipSelf: true });
|
|
332
|
-
isTextButton = computed(() => !!(!this.iconSignal() && this.labelSignal() && this.text), /* @ts-ignore */
|
|
377
|
+
isTextButton = computed(() => !!(!this.iconSignal() && this.labelSignal() && this.text()), /* @ts-ignore */
|
|
333
378
|
...(ngDevMode ? [{ debugName: "isTextButton" }] : /* istanbul ignore next */ []));
|
|
334
379
|
/**
|
|
335
380
|
* Text of the button.
|
|
336
381
|
* @deprecated use pButtonLabel directive instead.
|
|
337
382
|
* @group Props
|
|
338
383
|
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
set label(val) {
|
|
343
|
-
this._label = val;
|
|
344
|
-
if (this.initialized) {
|
|
345
|
-
this.updateLabel();
|
|
346
|
-
this.updateIcon();
|
|
347
|
-
this.setStyleClass();
|
|
348
|
-
}
|
|
349
|
-
}
|
|
384
|
+
label = input(/* @ts-ignore */
|
|
385
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
350
386
|
/**
|
|
351
387
|
* Name of the icon.
|
|
352
388
|
* @deprecated use pButtonIcon directive instead
|
|
353
389
|
* @group Props
|
|
354
390
|
*/
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
set icon(val) {
|
|
359
|
-
this._icon = val;
|
|
360
|
-
if (this.initialized) {
|
|
361
|
-
this.updateIcon();
|
|
362
|
-
this.setStyleClass();
|
|
363
|
-
}
|
|
364
|
-
}
|
|
391
|
+
icon = input(/* @ts-ignore */
|
|
392
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
365
393
|
/**
|
|
366
394
|
* Whether the button is in loading state.
|
|
367
395
|
* @group Props
|
|
368
396
|
*/
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
set loading(val) {
|
|
373
|
-
this._loading = val;
|
|
374
|
-
if (this.initialized) {
|
|
375
|
-
this.updateIcon();
|
|
376
|
-
this.setStyleClass();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
397
|
+
loading = input(false, /* @ts-ignore */
|
|
398
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
379
399
|
/**
|
|
380
400
|
* Used to pass all properties of the ButtonProps to the Button component.
|
|
381
401
|
* @deprecated assign props directly to the button element.
|
|
382
402
|
* @group Props
|
|
383
403
|
*/
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
set buttonProps(val) {
|
|
388
|
-
this._buttonProps = val;
|
|
389
|
-
if (val && typeof val === 'object') {
|
|
390
|
-
//@ts-ignore
|
|
391
|
-
Object.entries(val).forEach(([k, v]) => this[`_${k}`] !== v && (this[`_${k}`] = v));
|
|
392
|
-
}
|
|
393
|
-
}
|
|
404
|
+
buttonProps = input(/* @ts-ignore */
|
|
405
|
+
...(ngDevMode ? [undefined, { debugName: "buttonProps" }] : /* istanbul ignore next */ []));
|
|
394
406
|
/**
|
|
395
407
|
* Defines the style of the button.
|
|
396
408
|
* @group Props
|
|
397
409
|
*/
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
set severity(value) {
|
|
402
|
-
this._severity = value;
|
|
403
|
-
if (this.initialized) {
|
|
404
|
-
this.setStyleClass();
|
|
405
|
-
}
|
|
406
|
-
}
|
|
410
|
+
severity = input(/* @ts-ignore */
|
|
411
|
+
...(ngDevMode ? [undefined, { debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
407
412
|
spinnerIcon = `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="p-icon-spin">
|
|
408
413
|
<g clip-path="url(#clip0_417_21408)">
|
|
409
414
|
<path
|
|
@@ -417,63 +422,54 @@ class ButtonDirective extends BaseComponent {
|
|
|
417
422
|
</clipPath>
|
|
418
423
|
</defs>
|
|
419
424
|
</svg>`;
|
|
420
|
-
onAfterViewInit() {
|
|
421
|
-
!this.$unstyled() && addClass(this.htmlElement, this.getStyleClass().join(' '));
|
|
422
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
423
|
-
this.createIcon();
|
|
424
|
-
this.createLabel();
|
|
425
|
-
this.initialized = true;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
425
|
getStyleClass() {
|
|
429
426
|
const styleClass = [INTERNAL_BUTTON_CLASSES.button, INTERNAL_BUTTON_CLASSES.component];
|
|
430
|
-
if (this.
|
|
427
|
+
if (this._icon() && !this._label() && isEmpty(this.htmlElement.textContent)) {
|
|
431
428
|
styleClass.push(INTERNAL_BUTTON_CLASSES.iconOnly);
|
|
432
429
|
}
|
|
433
|
-
if (this.
|
|
430
|
+
if (this._loading()) {
|
|
434
431
|
styleClass.push(INTERNAL_BUTTON_CLASSES.disabled, INTERNAL_BUTTON_CLASSES.loading);
|
|
435
|
-
if (!this.
|
|
432
|
+
if (!this._icon() && this._label()) {
|
|
436
433
|
styleClass.push(INTERNAL_BUTTON_CLASSES.labelOnly);
|
|
437
434
|
}
|
|
438
|
-
if (this.
|
|
435
|
+
if (this._icon() && !this._label() && !isEmpty(this.htmlElement.textContent)) {
|
|
439
436
|
styleClass.push(INTERNAL_BUTTON_CLASSES.iconOnly);
|
|
440
437
|
}
|
|
441
438
|
}
|
|
442
|
-
if (this.text) {
|
|
439
|
+
if (this.text()) {
|
|
443
440
|
styleClass.push('p-button-text');
|
|
444
441
|
}
|
|
445
|
-
if (this.
|
|
446
|
-
styleClass.push(`p-button-${this.
|
|
442
|
+
if (this._severity()) {
|
|
443
|
+
styleClass.push(`p-button-${this._severity()}`);
|
|
447
444
|
}
|
|
448
|
-
if (this.plain) {
|
|
445
|
+
if (this.plain()) {
|
|
449
446
|
styleClass.push('p-button-plain');
|
|
450
447
|
}
|
|
451
|
-
if (this.raised) {
|
|
448
|
+
if (this.raised()) {
|
|
452
449
|
styleClass.push('p-button-raised');
|
|
453
450
|
}
|
|
454
|
-
if (this.size) {
|
|
455
|
-
styleClass.push(`p-button-${this.size}`);
|
|
451
|
+
if (this.size()) {
|
|
452
|
+
styleClass.push(`p-button-${this.size()}`);
|
|
456
453
|
}
|
|
457
|
-
if (this.outlined) {
|
|
454
|
+
if (this.outlined()) {
|
|
458
455
|
styleClass.push('p-button-outlined');
|
|
459
456
|
}
|
|
460
|
-
if (this.rounded) {
|
|
457
|
+
if (this.rounded()) {
|
|
461
458
|
styleClass.push('p-button-rounded');
|
|
462
459
|
}
|
|
463
|
-
if (this.size === 'small') {
|
|
460
|
+
if (this.size() === 'small') {
|
|
464
461
|
styleClass.push('p-button-sm');
|
|
465
462
|
}
|
|
466
|
-
if (this.size === 'large') {
|
|
463
|
+
if (this.size() === 'large') {
|
|
467
464
|
styleClass.push('p-button-lg');
|
|
468
465
|
}
|
|
469
|
-
if (this.hasFluid) {
|
|
466
|
+
if (this.hasFluid()) {
|
|
470
467
|
styleClass.push('p-button-fluid');
|
|
471
468
|
}
|
|
472
469
|
return this.$unstyled() ? [] : styleClass;
|
|
473
470
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
471
|
+
hasFluid = computed(() => this.fluid() ?? !!this.pcFluid, /* @ts-ignore */
|
|
472
|
+
...(ngDevMode ? [{ debugName: "hasFluid" }] : /* istanbul ignore next */ []));
|
|
477
473
|
setStyleClass() {
|
|
478
474
|
const styleClass = this.getStyleClass();
|
|
479
475
|
this.removeExistingSeverityClass();
|
|
@@ -489,19 +485,19 @@ class ButtonDirective extends BaseComponent {
|
|
|
489
485
|
}
|
|
490
486
|
createLabel() {
|
|
491
487
|
const created = findSingle(this.htmlElement, '[data-pc-section="buttonlabel"]');
|
|
492
|
-
if (!created && this.
|
|
493
|
-
let labelElement = createElement('span', { class: this.cx('label'), 'p-bind': this.ptm('buttonlabel'), 'aria-hidden': this.
|
|
494
|
-
labelElement.appendChild(this.document.createTextNode(this.
|
|
488
|
+
if (!created && this._label()) {
|
|
489
|
+
let labelElement = createElement('span', { class: this.cx('label'), 'p-bind': this.ptm('buttonlabel'), 'aria-hidden': this._icon() && !this._label() ? 'true' : null });
|
|
490
|
+
labelElement.appendChild(this.document.createTextNode(this._label()));
|
|
495
491
|
this.htmlElement.appendChild(labelElement);
|
|
496
492
|
}
|
|
497
493
|
}
|
|
498
494
|
createIcon() {
|
|
499
495
|
const created = findSingle(this.htmlElement, '[data-pc-section="buttonicon"]');
|
|
500
|
-
if (!created && (this.
|
|
501
|
-
let iconPosClass = this.
|
|
496
|
+
if (!created && (this._icon() || this._loading())) {
|
|
497
|
+
let iconPosClass = this._label() && !this.$unstyled() ? 'p-button-icon-' + this.iconPos() : null;
|
|
502
498
|
let iconClass = !this.$unstyled() && this.getIconClass();
|
|
503
499
|
let iconElement = createElement('span', { class: this.cn(this.cx('icon'), iconPosClass, iconClass), 'aria-hidden': 'true', 'p-bind': this.ptm('buttonicon') });
|
|
504
|
-
if (!this.loadingIcon && this.
|
|
500
|
+
if (!this.loadingIcon() && this._loading()) {
|
|
505
501
|
iconElement.innerHTML = this.spinnerIcon;
|
|
506
502
|
}
|
|
507
503
|
this.htmlElement.insertBefore(iconElement, this.htmlElement.firstChild);
|
|
@@ -509,24 +505,24 @@ class ButtonDirective extends BaseComponent {
|
|
|
509
505
|
}
|
|
510
506
|
updateLabel() {
|
|
511
507
|
let labelElement = findSingle(this.htmlElement, '[data-pc-section="buttonlabel"]');
|
|
512
|
-
if (!this.
|
|
508
|
+
if (!this._label()) {
|
|
513
509
|
labelElement && this.htmlElement.removeChild(labelElement);
|
|
514
510
|
return;
|
|
515
511
|
}
|
|
516
|
-
labelElement ? (labelElement.textContent = this.
|
|
512
|
+
labelElement ? (labelElement.textContent = this._label()) : this.createLabel();
|
|
517
513
|
}
|
|
518
514
|
updateIcon() {
|
|
519
515
|
let iconElement = findSingle(this.htmlElement, '[data-pc-section="buttonicon"]');
|
|
520
516
|
let labelElement = findSingle(this.htmlElement, '[data-pc-section="buttonlabel"]');
|
|
521
|
-
if (this.
|
|
517
|
+
if (this._loading() && !this.loadingIcon() && iconElement) {
|
|
522
518
|
iconElement.innerHTML = this.spinnerIcon;
|
|
523
519
|
}
|
|
524
520
|
else if (iconElement?.innerHTML) {
|
|
525
521
|
iconElement.innerHTML = '';
|
|
526
522
|
}
|
|
527
523
|
if (iconElement && !this.$unstyled()) {
|
|
528
|
-
if (this.iconPos) {
|
|
529
|
-
iconElement.className = 'p-button-icon ' + (labelElement ? 'p-button-icon-' + this.iconPos : '') + ' ' + this.getIconClass();
|
|
524
|
+
if (this.iconPos()) {
|
|
525
|
+
iconElement.className = 'p-button-icon ' + (labelElement ? 'p-button-icon-' + this.iconPos() : '') + ' ' + this.getIconClass();
|
|
530
526
|
}
|
|
531
527
|
else {
|
|
532
528
|
iconElement.className = 'p-button-icon ' + this.getIconClass();
|
|
@@ -537,19 +533,18 @@ class ButtonDirective extends BaseComponent {
|
|
|
537
533
|
}
|
|
538
534
|
}
|
|
539
535
|
getIconClass() {
|
|
540
|
-
return this.
|
|
536
|
+
return this._loading() ? 'p-button-loading-icon ' + (this.loadingIcon() ? this.loadingIcon() : 'p-icon') : this._icon() || 'p-hidden';
|
|
541
537
|
}
|
|
542
538
|
onDestroy() {
|
|
543
|
-
this.initialized
|
|
539
|
+
this.initialized.set(false);
|
|
544
540
|
}
|
|
545
541
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
546
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.2.1", type: ButtonDirective, isStandalone: true, selector: "[pButton]", inputs: { ptButtonDirective: { classPropertyName: "ptButtonDirective", publicName: "ptButtonDirective", isSignal: true, isRequired: false, transformFunction: null }, pButtonPT: { classPropertyName: "pButtonPT", publicName: "pButtonPT", isSignal: true, isRequired: false, transformFunction: null }, pButtonUnstyled: { classPropertyName: "pButtonUnstyled", publicName: "pButtonUnstyled", isSignal: true, isRequired: false, transformFunction: null }, hostName: { classPropertyName: "hostName", publicName: "hostName", isSignal:
|
|
542
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.2.1", type: ButtonDirective, isStandalone: true, selector: "[pButton]", inputs: { ptButtonDirective: { classPropertyName: "ptButtonDirective", publicName: "ptButtonDirective", isSignal: true, isRequired: false, transformFunction: null }, pButtonPT: { classPropertyName: "pButtonPT", publicName: "pButtonPT", isSignal: true, isRequired: false, transformFunction: null }, pButtonUnstyled: { classPropertyName: "pButtonUnstyled", publicName: "pButtonUnstyled", isSignal: true, isRequired: false, transformFunction: null }, hostName: { classPropertyName: "hostName", publicName: "hostName", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, plain: { classPropertyName: "plain", publicName: "plain", isSignal: true, isRequired: false, transformFunction: null }, raised: { classPropertyName: "raised", publicName: "raised", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, outlined: { classPropertyName: "outlined", publicName: "outlined", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, loadingIcon: { classPropertyName: "loadingIcon", publicName: "loadingIcon", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, buttonProps: { classPropertyName: "buttonProps", publicName: "buttonProps", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.p-button-icon-only": "!$unstyled() && isIconOnly()", "class.p-button-text": " !$unstyled() && isTextButton()" } }, providers: [ButtonStyle, { provide: BUTTON_DIRECTIVE_INSTANCE, useExisting: ButtonDirective }, { provide: PARENT_INSTANCE, useExisting: ButtonDirective }], queries: [{ propertyName: "iconSignal", first: true, predicate: ButtonIcon, descendants: true, isSignal: true }, { propertyName: "labelSignal", first: true, predicate: ButtonLabel, descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
|
|
547
543
|
}
|
|
548
544
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
549
545
|
type: Directive,
|
|
550
546
|
args: [{
|
|
551
547
|
selector: '[pButton]',
|
|
552
|
-
standalone: true,
|
|
553
548
|
providers: [ButtonStyle, { provide: BUTTON_DIRECTIVE_INSTANCE, useExisting: ButtonDirective }, { provide: PARENT_INSTANCE, useExisting: ButtonDirective }],
|
|
554
549
|
host: {
|
|
555
550
|
'[class.p-button-icon-only]': '!$unstyled() && isIconOnly()',
|
|
@@ -557,180 +552,157 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
557
552
|
},
|
|
558
553
|
hostDirectives: [Bind]
|
|
559
554
|
}]
|
|
560
|
-
}], ctorParameters: () => [], propDecorators: { ptButtonDirective: [{ type: i0.Input, args: [{ isSignal: true, alias: "ptButtonDirective", required: false }] }], pButtonPT: [{ type: i0.Input, args: [{ isSignal: true, alias: "pButtonPT", required: false }] }], pButtonUnstyled: [{ type: i0.Input, args: [{ isSignal: true, alias: "pButtonUnstyled", required: false }] }], hostName: [{
|
|
561
|
-
type: Input
|
|
562
|
-
}], text: [{
|
|
563
|
-
type: Input,
|
|
564
|
-
args: [{ transform: booleanAttribute }]
|
|
565
|
-
}], plain: [{
|
|
566
|
-
type: Input,
|
|
567
|
-
args: [{ transform: booleanAttribute }]
|
|
568
|
-
}], raised: [{
|
|
569
|
-
type: Input,
|
|
570
|
-
args: [{ transform: booleanAttribute }]
|
|
571
|
-
}], size: [{
|
|
572
|
-
type: Input
|
|
573
|
-
}], outlined: [{
|
|
574
|
-
type: Input,
|
|
575
|
-
args: [{ transform: booleanAttribute }]
|
|
576
|
-
}], rounded: [{
|
|
577
|
-
type: Input,
|
|
578
|
-
args: [{ transform: booleanAttribute }]
|
|
579
|
-
}], iconPos: [{
|
|
580
|
-
type: Input
|
|
581
|
-
}], loadingIcon: [{
|
|
582
|
-
type: Input
|
|
583
|
-
}], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], iconSignal: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ButtonIcon), { isSignal: true }] }], labelSignal: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ButtonLabel), { isSignal: true }] }], label: [{
|
|
584
|
-
type: Input
|
|
585
|
-
}], icon: [{
|
|
586
|
-
type: Input
|
|
587
|
-
}], loading: [{
|
|
588
|
-
type: Input
|
|
589
|
-
}], buttonProps: [{
|
|
590
|
-
type: Input
|
|
591
|
-
}], severity: [{
|
|
592
|
-
type: Input
|
|
593
|
-
}] } });
|
|
555
|
+
}], ctorParameters: () => [], propDecorators: { ptButtonDirective: [{ type: i0.Input, args: [{ isSignal: true, alias: "ptButtonDirective", required: false }] }], pButtonPT: [{ type: i0.Input, args: [{ isSignal: true, alias: "pButtonPT", required: false }] }], pButtonUnstyled: [{ type: i0.Input, args: [{ isSignal: true, alias: "pButtonUnstyled", required: false }] }], hostName: [{ type: i0.Input, args: [{ isSignal: true, alias: "hostName", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], plain: [{ type: i0.Input, args: [{ isSignal: true, alias: "plain", required: false }] }], raised: [{ type: i0.Input, args: [{ isSignal: true, alias: "raised", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], outlined: [{ type: i0.Input, args: [{ isSignal: true, alias: "outlined", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], loadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingIcon", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], iconSignal: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ButtonIcon), { isSignal: true }] }], labelSignal: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ButtonLabel), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], buttonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonProps", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }] } });
|
|
594
556
|
/**
|
|
595
557
|
* Button is an extension to standard button element with icons and theming.
|
|
596
558
|
* @group Components
|
|
597
559
|
*/
|
|
598
560
|
class Button extends BaseComponent {
|
|
599
561
|
componentName = 'Button';
|
|
600
|
-
hostName = ''
|
|
562
|
+
hostName = input('', /* @ts-ignore */
|
|
563
|
+
...(ngDevMode ? [{ debugName: "hostName" }] : /* istanbul ignore next */ []));
|
|
601
564
|
$pcButton = inject(BUTTON_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
602
565
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
603
566
|
_componentStyle = inject(ButtonStyle);
|
|
604
|
-
|
|
605
|
-
|
|
567
|
+
constructor() {
|
|
568
|
+
super();
|
|
569
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('host')));
|
|
606
570
|
}
|
|
607
571
|
/**
|
|
608
572
|
* Type of the button.
|
|
609
573
|
* @group Props
|
|
610
574
|
*/
|
|
611
|
-
type = 'button'
|
|
575
|
+
type = input('button', /* @ts-ignore */
|
|
576
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
612
577
|
/**
|
|
613
578
|
* Value of the badge.
|
|
614
579
|
* @group Props
|
|
615
580
|
*/
|
|
616
|
-
badge
|
|
581
|
+
badge = input(/* @ts-ignore */
|
|
582
|
+
...(ngDevMode ? [undefined, { debugName: "badge" }] : /* istanbul ignore next */ []));
|
|
617
583
|
/**
|
|
618
584
|
* When present, it specifies that the component should be disabled.
|
|
619
585
|
* @group Props
|
|
620
586
|
*/
|
|
621
|
-
disabled;
|
|
587
|
+
disabled = input(undefined, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
622
588
|
/**
|
|
623
589
|
* Add a shadow to indicate elevation.
|
|
624
590
|
* @group Props
|
|
625
591
|
*/
|
|
626
|
-
raised = false;
|
|
592
|
+
raised = input(false, { ...(ngDevMode ? { debugName: "raised" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
627
593
|
/**
|
|
628
594
|
* Add a circular border radius to the button.
|
|
629
595
|
* @group Props
|
|
630
596
|
*/
|
|
631
|
-
rounded = false;
|
|
597
|
+
rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
632
598
|
/**
|
|
633
599
|
* Add a textual class to the button without a background initially.
|
|
634
600
|
* @group Props
|
|
635
601
|
*/
|
|
636
|
-
text = false;
|
|
602
|
+
text = input(false, { ...(ngDevMode ? { debugName: "text" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
637
603
|
/**
|
|
638
604
|
* Add a plain textual class to the button without a background initially.
|
|
639
605
|
* @group Props
|
|
640
606
|
*/
|
|
641
|
-
plain = false;
|
|
607
|
+
plain = input(false, { ...(ngDevMode ? { debugName: "plain" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
642
608
|
/**
|
|
643
609
|
* Add a border class without a background initially.
|
|
644
610
|
* @group Props
|
|
645
611
|
*/
|
|
646
|
-
outlined = false;
|
|
612
|
+
outlined = input(false, { ...(ngDevMode ? { debugName: "outlined" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
647
613
|
/**
|
|
648
614
|
* Add a link style to the button.
|
|
649
615
|
* @group Props
|
|
650
616
|
*/
|
|
651
|
-
link = false;
|
|
617
|
+
link = input(false, { ...(ngDevMode ? { debugName: "link" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
652
618
|
/**
|
|
653
619
|
* Add a tabindex to the button.
|
|
654
620
|
* @group Props
|
|
655
621
|
*/
|
|
656
|
-
tabindex;
|
|
622
|
+
tabindex = input(undefined, { ...(ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
657
623
|
/**
|
|
658
624
|
* Defines the size of the button.
|
|
659
625
|
* @group Props
|
|
660
626
|
*/
|
|
661
|
-
size
|
|
627
|
+
size = input(/* @ts-ignore */
|
|
628
|
+
...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
|
|
662
629
|
/**
|
|
663
630
|
* Specifies the variant of the component.
|
|
664
631
|
* @group Props
|
|
665
632
|
*/
|
|
666
|
-
variant
|
|
633
|
+
variant = input(/* @ts-ignore */
|
|
634
|
+
...(ngDevMode ? [undefined, { debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
667
635
|
/**
|
|
668
636
|
* Inline style of the element.
|
|
669
637
|
* @group Props
|
|
670
638
|
*/
|
|
671
|
-
style
|
|
639
|
+
style = input(/* @ts-ignore */
|
|
640
|
+
...(ngDevMode ? [undefined, { debugName: "style" }] : /* istanbul ignore next */ []));
|
|
672
641
|
/**
|
|
673
642
|
* Class of the element.
|
|
674
643
|
* @group Props
|
|
675
644
|
*/
|
|
676
|
-
styleClass
|
|
677
|
-
|
|
678
|
-
* Style class of the badge.
|
|
679
|
-
* @group Props
|
|
680
|
-
* @deprecated use badgeSeverity instead.
|
|
681
|
-
*/
|
|
682
|
-
badgeClass;
|
|
645
|
+
styleClass = input(/* @ts-ignore */
|
|
646
|
+
...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
|
|
683
647
|
/**
|
|
684
648
|
* Severity type of the badge.
|
|
685
649
|
* @group Props
|
|
686
650
|
* @defaultValue secondary
|
|
687
651
|
*/
|
|
688
|
-
badgeSeverity = 'secondary'
|
|
652
|
+
badgeSeverity = input('secondary', /* @ts-ignore */
|
|
653
|
+
...(ngDevMode ? [{ debugName: "badgeSeverity" }] : /* istanbul ignore next */ []));
|
|
689
654
|
/**
|
|
690
655
|
* Used to define a string that autocomplete attribute the current element.
|
|
691
656
|
* @group Props
|
|
692
657
|
*/
|
|
693
|
-
ariaLabel
|
|
658
|
+
ariaLabel = input(/* @ts-ignore */
|
|
659
|
+
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
694
660
|
/**
|
|
695
661
|
* When present, it specifies that the component should automatically get focus on load.
|
|
696
662
|
* @group Props
|
|
697
663
|
*/
|
|
698
|
-
autofocus;
|
|
664
|
+
autofocus = input(undefined, { ...(ngDevMode ? { debugName: "autofocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
699
665
|
/**
|
|
700
666
|
* Position of the icon.
|
|
701
667
|
* @group Props
|
|
702
668
|
*/
|
|
703
|
-
iconPos = 'left'
|
|
669
|
+
iconPos = input('left', /* @ts-ignore */
|
|
670
|
+
...(ngDevMode ? [{ debugName: "iconPos" }] : /* istanbul ignore next */ []));
|
|
704
671
|
/**
|
|
705
672
|
* Name of the icon.
|
|
706
673
|
* @group Props
|
|
707
674
|
*/
|
|
708
|
-
icon
|
|
675
|
+
icon = input(/* @ts-ignore */
|
|
676
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
709
677
|
/**
|
|
710
678
|
* Text of the button.
|
|
711
679
|
* @group Props
|
|
712
680
|
*/
|
|
713
|
-
label
|
|
681
|
+
label = input(/* @ts-ignore */
|
|
682
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
714
683
|
/**
|
|
715
684
|
* Whether the button is in loading state.
|
|
716
685
|
* @group Props
|
|
717
686
|
*/
|
|
718
|
-
loading = false;
|
|
687
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
719
688
|
/**
|
|
720
689
|
* Icon to display in loading state.
|
|
721
690
|
* @group Props
|
|
722
691
|
*/
|
|
723
|
-
loadingIcon
|
|
692
|
+
loadingIcon = input(/* @ts-ignore */
|
|
693
|
+
...(ngDevMode ? [undefined, { debugName: "loadingIcon" }] : /* istanbul ignore next */ []));
|
|
724
694
|
/**
|
|
725
695
|
* Defines the style of the button.
|
|
726
696
|
* @group Props
|
|
727
697
|
*/
|
|
728
|
-
severity
|
|
698
|
+
severity = input(/* @ts-ignore */
|
|
699
|
+
...(ngDevMode ? [undefined, { debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
729
700
|
/**
|
|
730
701
|
* Used to pass all properties of the ButtonProps to the Button component.
|
|
731
702
|
* @group Props
|
|
732
703
|
*/
|
|
733
|
-
buttonProps
|
|
704
|
+
buttonProps = input(/* @ts-ignore */
|
|
705
|
+
...(ngDevMode ? [undefined, { debugName: "buttonProps" }] : /* istanbul ignore next */ []));
|
|
734
706
|
/**
|
|
735
707
|
* Spans 100% width of the container when enabled.
|
|
736
708
|
* @defaultValue undefined
|
|
@@ -779,162 +751,147 @@ class Button extends BaseComponent {
|
|
|
779
751
|
templates = contentChildren(PrimeTemplate, /* @ts-ignore */
|
|
780
752
|
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
781
753
|
pcFluid = inject(Fluid, { optional: true, host: true, skipSelf: true });
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
get dataIconP() {
|
|
824
|
-
return this.cn({
|
|
825
|
-
[this.iconPos]: this.iconPos,
|
|
826
|
-
[this.size]: this.size
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
get dataLabelP() {
|
|
830
|
-
return this.cn({
|
|
831
|
-
[this.size]: this.size,
|
|
832
|
-
'icon-only': this.hasIcon && !this.label && !this.badge
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Button, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
836
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Button, isStandalone: true, selector: "p-button", inputs: { hostName: { classPropertyName: "hostName", publicName: "hostName", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, raised: { classPropertyName: "raised", publicName: "raised", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, plain: { classPropertyName: "plain", publicName: "plain", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, outlined: { classPropertyName: "outlined", publicName: "outlined", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, link: { classPropertyName: "link", publicName: "link", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: false, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: false, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: false, isRequired: false, transformFunction: null }, badgeClass: { classPropertyName: "badgeClass", publicName: "badgeClass", isSignal: false, isRequired: false, transformFunction: null }, badgeSeverity: { classPropertyName: "badgeSeverity", publicName: "badgeSeverity", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, loadingIcon: { classPropertyName: "loadingIcon", publicName: "loadingIcon", isSignal: false, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: false, isRequired: false, transformFunction: null }, buttonProps: { classPropertyName: "buttonProps", publicName: "buttonProps", isSignal: false, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick", onFocus: "onFocus", onBlur: "onBlur" }, providers: [ButtonStyle, { provide: BUTTON_INSTANCE, useExisting: Button }, { provide: PARENT_INSTANCE, useExisting: Button }], queries: [{ propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "loadingIconTemplate", first: true, predicate: ["loadingicon"], descendants: true, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ["icon"], descendants: true, isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
754
|
+
hasFluid = computed(() => this.fluid() ?? !!this.pcFluid, /* @ts-ignore */
|
|
755
|
+
...(ngDevMode ? [{ debugName: "hasFluid" }] : /* istanbul ignore next */ []));
|
|
756
|
+
hasIcon = computed(() => this.icon() || this.buttonProps()?.icon || this.iconTemplate() || this._iconTemplate() || this.loadingIcon() || this.loadingIconTemplate() || this._loadingIconTemplate(), /* @ts-ignore */
|
|
757
|
+
...(ngDevMode ? [{ debugName: "hasIcon" }] : /* istanbul ignore next */ []));
|
|
758
|
+
_contentTemplate = computed(() => this.templates()
|
|
759
|
+
.filter((item) => item.getType() !== 'icon' && item.getType() !== 'loadingicon')
|
|
760
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
761
|
+
...(ngDevMode ? [{ debugName: "_contentTemplate" }] : /* istanbul ignore next */ []));
|
|
762
|
+
_iconTemplate = computed(() => this.templates()
|
|
763
|
+
.filter((item) => item.getType() === 'icon')
|
|
764
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
765
|
+
...(ngDevMode ? [{ debugName: "_iconTemplate" }] : /* istanbul ignore next */ []));
|
|
766
|
+
_loadingIconTemplate = computed(() => this.templates()
|
|
767
|
+
.filter((item) => item.getType() === 'loadingicon')
|
|
768
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
769
|
+
...(ngDevMode ? [{ debugName: "_loadingIconTemplate" }] : /* istanbul ignore next */ []));
|
|
770
|
+
dataP = computed(() => this.cn({
|
|
771
|
+
[this.size()]: this.size(),
|
|
772
|
+
'icon-only': this.hasIcon() && !this.label() && !this.badge(),
|
|
773
|
+
loading: this.loading(),
|
|
774
|
+
fluid: this.hasFluid(),
|
|
775
|
+
rounded: this.rounded(),
|
|
776
|
+
raised: this.raised(),
|
|
777
|
+
outlined: this.outlined() || this.variant() === 'outlined',
|
|
778
|
+
text: this.text() || this.variant() === 'text',
|
|
779
|
+
link: this.link(),
|
|
780
|
+
vertical: (this.iconPos() === 'top' || this.iconPos() === 'bottom') && this.label()
|
|
781
|
+
}), /* @ts-ignore */
|
|
782
|
+
...(ngDevMode ? [{ debugName: "dataP" }] : /* istanbul ignore next */ []));
|
|
783
|
+
dataIconP = computed(() => this.cn({
|
|
784
|
+
[this.iconPos()]: this.iconPos(),
|
|
785
|
+
[this.size()]: this.size()
|
|
786
|
+
}), /* @ts-ignore */
|
|
787
|
+
...(ngDevMode ? [{ debugName: "dataIconP" }] : /* istanbul ignore next */ []));
|
|
788
|
+
dataLabelP = computed(() => this.cn({
|
|
789
|
+
[this.size()]: this.size(),
|
|
790
|
+
'icon-only': this.hasIcon() && !this.label() && !this.badge()
|
|
791
|
+
}), /* @ts-ignore */
|
|
792
|
+
...(ngDevMode ? [{ debugName: "dataLabelP" }] : /* istanbul ignore next */ []));
|
|
793
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
794
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Button, isStandalone: true, selector: "p-button", inputs: { hostName: { classPropertyName: "hostName", publicName: "hostName", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, raised: { classPropertyName: "raised", publicName: "raised", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, plain: { classPropertyName: "plain", publicName: "plain", isSignal: true, isRequired: false, transformFunction: null }, outlined: { classPropertyName: "outlined", publicName: "outlined", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, badgeSeverity: { classPropertyName: "badgeSeverity", publicName: "badgeSeverity", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingIcon: { classPropertyName: "loadingIcon", publicName: "loadingIcon", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, buttonProps: { classPropertyName: "buttonProps", publicName: "buttonProps", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick", onFocus: "onFocus", onBlur: "onBlur" }, providers: [ButtonStyle, { provide: BUTTON_INSTANCE, useExisting: Button }, { provide: PARENT_INSTANCE, useExisting: Button }], queries: [{ propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "loadingIconTemplate", first: true, predicate: ["loadingicon"], descendants: true, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ["icon"], descendants: true, isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
837
795
|
<button
|
|
838
|
-
[attr.type]="type || buttonProps?.type"
|
|
839
|
-
[attr.aria-label]="ariaLabel || buttonProps?.ariaLabel"
|
|
840
|
-
[ngStyle]="style || buttonProps?.style"
|
|
841
|
-
[disabled]="disabled || loading || buttonProps?.disabled"
|
|
842
|
-
[class]="cn(cx('root'), styleClass, buttonProps?.styleClass)"
|
|
796
|
+
[attr.type]="type() || buttonProps()?.type"
|
|
797
|
+
[attr.aria-label]="ariaLabel() || buttonProps()?.ariaLabel"
|
|
798
|
+
[ngStyle]="style() || buttonProps()?.style"
|
|
799
|
+
[disabled]="disabled() || loading() || buttonProps()?.disabled"
|
|
800
|
+
[class]="cn(cx('root'), styleClass(), buttonProps()?.styleClass)"
|
|
843
801
|
(click)="onClick.emit($event)"
|
|
844
802
|
(focus)="onFocus.emit($event)"
|
|
845
803
|
(blur)="onBlur.emit($event)"
|
|
846
804
|
pRipple
|
|
847
|
-
[attr.tabindex]="tabindex || buttonProps?.tabindex"
|
|
848
|
-
[pAutoFocus]="autofocus || buttonProps?.autofocus"
|
|
805
|
+
[attr.tabindex]="tabindex() || buttonProps()?.tabindex"
|
|
806
|
+
[pAutoFocus]="autofocus() || buttonProps()?.autofocus"
|
|
849
807
|
[pBind]="ptm('root')"
|
|
850
|
-
[attr.data-p]="dataP"
|
|
851
|
-
[attr.data-p-disabled]="disabled || loading || buttonProps?.disabled"
|
|
852
|
-
[attr.data-p-severity]="severity || buttonProps?.severity"
|
|
808
|
+
[attr.data-p]="dataP()"
|
|
809
|
+
[attr.data-p-disabled]="disabled() || loading() || buttonProps()?.disabled"
|
|
810
|
+
[attr.data-p-severity]="severity() || buttonProps()?.severity"
|
|
853
811
|
>
|
|
854
812
|
<ng-content></ng-content>
|
|
855
|
-
<ng-container *ngTemplateOutlet="contentTemplate() || _contentTemplate"></ng-container>
|
|
856
|
-
@if (loading || buttonProps?.loading) {
|
|
857
|
-
@if (!loadingIconTemplate() && !_loadingIconTemplate) {
|
|
858
|
-
@if (loadingIcon || buttonProps?.loadingIcon) {
|
|
859
|
-
<span [class]="cn(cx('loadingIcon'), 'pi-spin', loadingIcon || buttonProps?.loadingIcon)" [pBind]="ptm('loadingIcon')" [attr.aria-hidden]="true"></span>
|
|
813
|
+
<ng-container *ngTemplateOutlet="contentTemplate() || _contentTemplate()"></ng-container>
|
|
814
|
+
@if (loading() || buttonProps()?.loading) {
|
|
815
|
+
@if (!loadingIconTemplate() && !_loadingIconTemplate()) {
|
|
816
|
+
@if (loadingIcon() || buttonProps()?.loadingIcon) {
|
|
817
|
+
<span [class]="cn(cx('loadingIcon'), 'pi-spin', loadingIcon() || buttonProps()?.loadingIcon)" [pBind]="ptm('loadingIcon')" [attr.aria-hidden]="true"></span>
|
|
860
818
|
}
|
|
861
|
-
@if (!(loadingIcon || buttonProps?.loadingIcon)) {
|
|
819
|
+
@if (!(loadingIcon() || buttonProps()?.loadingIcon)) {
|
|
862
820
|
<svg data-p-icon="spinner" [class]="cn(cx('loadingIcon'), cx('spinnerIcon'))" [pBind]="ptm('loadingIcon')" [spin]="true" [attr.aria-hidden]="true" />
|
|
863
821
|
}
|
|
864
822
|
}
|
|
865
|
-
@if (loadingIconTemplate() || _loadingIconTemplate) {
|
|
866
|
-
<ng-template *ngTemplateOutlet="loadingIconTemplate() || _loadingIconTemplate; context: { class: cx('loadingIcon'), pt: ptm('loadingIcon') }"></ng-template>
|
|
823
|
+
@if (loadingIconTemplate() || _loadingIconTemplate()) {
|
|
824
|
+
<ng-template *ngTemplateOutlet="loadingIconTemplate() || _loadingIconTemplate(); context: { class: cx('loadingIcon'), pt: ptm('loadingIcon') }"></ng-template>
|
|
867
825
|
}
|
|
868
826
|
}
|
|
869
|
-
@if (!(loading || buttonProps?.loading)) {
|
|
870
|
-
@if ((icon || buttonProps?.icon) && !iconTemplate() && !_iconTemplate) {
|
|
871
|
-
<span [class]="cn(cx('icon'), icon || buttonProps?.icon)" [pBind]="ptm('icon')" [attr.data-p]="dataIconP"></span>
|
|
827
|
+
@if (!(loading() || buttonProps()?.loading)) {
|
|
828
|
+
@if ((icon() || buttonProps()?.icon) && !iconTemplate() && !_iconTemplate()) {
|
|
829
|
+
<span [class]="cn(cx('icon'), icon() || buttonProps()?.icon)" [pBind]="ptm('icon')" [attr.data-p]="dataIconP()"></span>
|
|
872
830
|
}
|
|
873
|
-
@if (!icon && (iconTemplate() || _iconTemplate)) {
|
|
874
|
-
<ng-template *ngTemplateOutlet="iconTemplate() || _iconTemplate; context: { class: cx('icon'), pt: ptm('icon') }"></ng-template>
|
|
831
|
+
@if (!icon() && (iconTemplate() || _iconTemplate())) {
|
|
832
|
+
<ng-template *ngTemplateOutlet="iconTemplate() || _iconTemplate(); context: { class: cx('icon'), pt: ptm('icon') }"></ng-template>
|
|
875
833
|
}
|
|
876
834
|
}
|
|
877
|
-
@if (!contentTemplate() && !_contentTemplate && (label || buttonProps?.label)) {
|
|
878
|
-
<span [class]="cx('label')" [attr.aria-hidden]="(icon || buttonProps?.icon) && !(label || buttonProps?.label)" [pBind]="ptm('label')" [attr.data-p]="dataLabelP">{{ label || buttonProps?.label }}</span>
|
|
835
|
+
@if (!contentTemplate() && !_contentTemplate() && (label() || buttonProps()?.label)) {
|
|
836
|
+
<span [class]="cx('label')" [attr.aria-hidden]="(icon() || buttonProps()?.icon) && !(label() || buttonProps()?.label)" [pBind]="ptm('label')" [attr.data-p]="dataLabelP()">{{ label() || buttonProps()?.label }}</span>
|
|
879
837
|
}
|
|
880
|
-
@if (!contentTemplate() && !_contentTemplate && (badge || buttonProps?.badge)) {
|
|
881
|
-
<p-badge [value]="badge || buttonProps?.badge" [severity]="badgeSeverity || buttonProps?.badgeSeverity" [pt]="ptm('pcBadge')" [unstyled]="unstyled()"></p-badge>
|
|
838
|
+
@if (!contentTemplate() && !_contentTemplate() && (badge() || buttonProps()?.badge)) {
|
|
839
|
+
<p-badge [value]="badge() || buttonProps()?.badge" [severity]="badgeSeverity() || buttonProps()?.badgeSeverity" [pt]="ptm('pcBadge')" [unstyled]="unstyled()"></p-badge>
|
|
882
840
|
}
|
|
883
841
|
</button>
|
|
884
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: Ripple, selector: "[pRipple]" }, { kind: "directive", type: AutoFocus, selector: "[pAutoFocus]", inputs: ["pAutoFocus"] }, { kind: "component", type: SpinnerIcon, selector: "[data-p-icon=\"spinner\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i3.Badge, selector: "p-badge", inputs: ["
|
|
842
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: Ripple, selector: "[pRipple]" }, { kind: "directive", type: AutoFocus, selector: "[pAutoFocus]", inputs: ["pAutoFocus"] }, { kind: "component", type: SpinnerIcon, selector: "[data-p-icon=\"spinner\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i3.Badge, selector: "p-badge", inputs: ["badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "ngmodule", type: SharedModule }, { kind: "directive", type: Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
885
843
|
}
|
|
886
844
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Button, decorators: [{
|
|
887
845
|
type: Component,
|
|
888
846
|
args: [{
|
|
889
847
|
selector: 'p-button',
|
|
890
|
-
standalone: true,
|
|
891
848
|
imports: [CommonModule, Ripple, AutoFocus, SpinnerIcon, BadgeModule, SharedModule, Bind],
|
|
892
849
|
template: `
|
|
893
850
|
<button
|
|
894
|
-
[attr.type]="type || buttonProps?.type"
|
|
895
|
-
[attr.aria-label]="ariaLabel || buttonProps?.ariaLabel"
|
|
896
|
-
[ngStyle]="style || buttonProps?.style"
|
|
897
|
-
[disabled]="disabled || loading || buttonProps?.disabled"
|
|
898
|
-
[class]="cn(cx('root'), styleClass, buttonProps?.styleClass)"
|
|
851
|
+
[attr.type]="type() || buttonProps()?.type"
|
|
852
|
+
[attr.aria-label]="ariaLabel() || buttonProps()?.ariaLabel"
|
|
853
|
+
[ngStyle]="style() || buttonProps()?.style"
|
|
854
|
+
[disabled]="disabled() || loading() || buttonProps()?.disabled"
|
|
855
|
+
[class]="cn(cx('root'), styleClass(), buttonProps()?.styleClass)"
|
|
899
856
|
(click)="onClick.emit($event)"
|
|
900
857
|
(focus)="onFocus.emit($event)"
|
|
901
858
|
(blur)="onBlur.emit($event)"
|
|
902
859
|
pRipple
|
|
903
|
-
[attr.tabindex]="tabindex || buttonProps?.tabindex"
|
|
904
|
-
[pAutoFocus]="autofocus || buttonProps?.autofocus"
|
|
860
|
+
[attr.tabindex]="tabindex() || buttonProps()?.tabindex"
|
|
861
|
+
[pAutoFocus]="autofocus() || buttonProps()?.autofocus"
|
|
905
862
|
[pBind]="ptm('root')"
|
|
906
|
-
[attr.data-p]="dataP"
|
|
907
|
-
[attr.data-p-disabled]="disabled || loading || buttonProps?.disabled"
|
|
908
|
-
[attr.data-p-severity]="severity || buttonProps?.severity"
|
|
863
|
+
[attr.data-p]="dataP()"
|
|
864
|
+
[attr.data-p-disabled]="disabled() || loading() || buttonProps()?.disabled"
|
|
865
|
+
[attr.data-p-severity]="severity() || buttonProps()?.severity"
|
|
909
866
|
>
|
|
910
867
|
<ng-content></ng-content>
|
|
911
|
-
<ng-container *ngTemplateOutlet="contentTemplate() || _contentTemplate"></ng-container>
|
|
912
|
-
@if (loading || buttonProps?.loading) {
|
|
913
|
-
@if (!loadingIconTemplate() && !_loadingIconTemplate) {
|
|
914
|
-
@if (loadingIcon || buttonProps?.loadingIcon) {
|
|
915
|
-
<span [class]="cn(cx('loadingIcon'), 'pi-spin', loadingIcon || buttonProps?.loadingIcon)" [pBind]="ptm('loadingIcon')" [attr.aria-hidden]="true"></span>
|
|
868
|
+
<ng-container *ngTemplateOutlet="contentTemplate() || _contentTemplate()"></ng-container>
|
|
869
|
+
@if (loading() || buttonProps()?.loading) {
|
|
870
|
+
@if (!loadingIconTemplate() && !_loadingIconTemplate()) {
|
|
871
|
+
@if (loadingIcon() || buttonProps()?.loadingIcon) {
|
|
872
|
+
<span [class]="cn(cx('loadingIcon'), 'pi-spin', loadingIcon() || buttonProps()?.loadingIcon)" [pBind]="ptm('loadingIcon')" [attr.aria-hidden]="true"></span>
|
|
916
873
|
}
|
|
917
|
-
@if (!(loadingIcon || buttonProps?.loadingIcon)) {
|
|
874
|
+
@if (!(loadingIcon() || buttonProps()?.loadingIcon)) {
|
|
918
875
|
<svg data-p-icon="spinner" [class]="cn(cx('loadingIcon'), cx('spinnerIcon'))" [pBind]="ptm('loadingIcon')" [spin]="true" [attr.aria-hidden]="true" />
|
|
919
876
|
}
|
|
920
877
|
}
|
|
921
|
-
@if (loadingIconTemplate() || _loadingIconTemplate) {
|
|
922
|
-
<ng-template *ngTemplateOutlet="loadingIconTemplate() || _loadingIconTemplate; context: { class: cx('loadingIcon'), pt: ptm('loadingIcon') }"></ng-template>
|
|
878
|
+
@if (loadingIconTemplate() || _loadingIconTemplate()) {
|
|
879
|
+
<ng-template *ngTemplateOutlet="loadingIconTemplate() || _loadingIconTemplate(); context: { class: cx('loadingIcon'), pt: ptm('loadingIcon') }"></ng-template>
|
|
923
880
|
}
|
|
924
881
|
}
|
|
925
|
-
@if (!(loading || buttonProps?.loading)) {
|
|
926
|
-
@if ((icon || buttonProps?.icon) && !iconTemplate() && !_iconTemplate) {
|
|
927
|
-
<span [class]="cn(cx('icon'), icon || buttonProps?.icon)" [pBind]="ptm('icon')" [attr.data-p]="dataIconP"></span>
|
|
882
|
+
@if (!(loading() || buttonProps()?.loading)) {
|
|
883
|
+
@if ((icon() || buttonProps()?.icon) && !iconTemplate() && !_iconTemplate()) {
|
|
884
|
+
<span [class]="cn(cx('icon'), icon() || buttonProps()?.icon)" [pBind]="ptm('icon')" [attr.data-p]="dataIconP()"></span>
|
|
928
885
|
}
|
|
929
|
-
@if (!icon && (iconTemplate() || _iconTemplate)) {
|
|
930
|
-
<ng-template *ngTemplateOutlet="iconTemplate() || _iconTemplate; context: { class: cx('icon'), pt: ptm('icon') }"></ng-template>
|
|
886
|
+
@if (!icon() && (iconTemplate() || _iconTemplate())) {
|
|
887
|
+
<ng-template *ngTemplateOutlet="iconTemplate() || _iconTemplate(); context: { class: cx('icon'), pt: ptm('icon') }"></ng-template>
|
|
931
888
|
}
|
|
932
889
|
}
|
|
933
|
-
@if (!contentTemplate() && !_contentTemplate && (label || buttonProps?.label)) {
|
|
934
|
-
<span [class]="cx('label')" [attr.aria-hidden]="(icon || buttonProps?.icon) && !(label || buttonProps?.label)" [pBind]="ptm('label')" [attr.data-p]="dataLabelP">{{ label || buttonProps?.label }}</span>
|
|
890
|
+
@if (!contentTemplate() && !_contentTemplate() && (label() || buttonProps()?.label)) {
|
|
891
|
+
<span [class]="cx('label')" [attr.aria-hidden]="(icon() || buttonProps()?.icon) && !(label() || buttonProps()?.label)" [pBind]="ptm('label')" [attr.data-p]="dataLabelP()">{{ label() || buttonProps()?.label }}</span>
|
|
935
892
|
}
|
|
936
|
-
@if (!contentTemplate() && !_contentTemplate && (badge || buttonProps?.badge)) {
|
|
937
|
-
<p-badge [value]="badge || buttonProps?.badge" [severity]="badgeSeverity || buttonProps?.badgeSeverity" [pt]="ptm('pcBadge')" [unstyled]="unstyled()"></p-badge>
|
|
893
|
+
@if (!contentTemplate() && !_contentTemplate() && (badge() || buttonProps()?.badge)) {
|
|
894
|
+
<p-badge [value]="badge() || buttonProps()?.badge" [severity]="badgeSeverity() || buttonProps()?.badgeSeverity" [pt]="ptm('pcBadge')" [unstyled]="unstyled()"></p-badge>
|
|
938
895
|
}
|
|
939
896
|
</button>
|
|
940
897
|
`,
|
|
@@ -943,69 +900,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
943
900
|
providers: [ButtonStyle, { provide: BUTTON_INSTANCE, useExisting: Button }, { provide: PARENT_INSTANCE, useExisting: Button }],
|
|
944
901
|
hostDirectives: [Bind]
|
|
945
902
|
}]
|
|
946
|
-
}], propDecorators: { hostName: [{
|
|
947
|
-
type: Input
|
|
948
|
-
}], type: [{
|
|
949
|
-
type: Input
|
|
950
|
-
}], badge: [{
|
|
951
|
-
type: Input
|
|
952
|
-
}], disabled: [{
|
|
953
|
-
type: Input,
|
|
954
|
-
args: [{ transform: booleanAttribute }]
|
|
955
|
-
}], raised: [{
|
|
956
|
-
type: Input,
|
|
957
|
-
args: [{ transform: booleanAttribute }]
|
|
958
|
-
}], rounded: [{
|
|
959
|
-
type: Input,
|
|
960
|
-
args: [{ transform: booleanAttribute }]
|
|
961
|
-
}], text: [{
|
|
962
|
-
type: Input,
|
|
963
|
-
args: [{ transform: booleanAttribute }]
|
|
964
|
-
}], plain: [{
|
|
965
|
-
type: Input,
|
|
966
|
-
args: [{ transform: booleanAttribute }]
|
|
967
|
-
}], outlined: [{
|
|
968
|
-
type: Input,
|
|
969
|
-
args: [{ transform: booleanAttribute }]
|
|
970
|
-
}], link: [{
|
|
971
|
-
type: Input,
|
|
972
|
-
args: [{ transform: booleanAttribute }]
|
|
973
|
-
}], tabindex: [{
|
|
974
|
-
type: Input,
|
|
975
|
-
args: [{ transform: numberAttribute }]
|
|
976
|
-
}], size: [{
|
|
977
|
-
type: Input
|
|
978
|
-
}], variant: [{
|
|
979
|
-
type: Input
|
|
980
|
-
}], style: [{
|
|
981
|
-
type: Input
|
|
982
|
-
}], styleClass: [{
|
|
983
|
-
type: Input
|
|
984
|
-
}], badgeClass: [{
|
|
985
|
-
type: Input
|
|
986
|
-
}], badgeSeverity: [{
|
|
987
|
-
type: Input
|
|
988
|
-
}], ariaLabel: [{
|
|
989
|
-
type: Input
|
|
990
|
-
}], autofocus: [{
|
|
991
|
-
type: Input,
|
|
992
|
-
args: [{ transform: booleanAttribute }]
|
|
993
|
-
}], iconPos: [{
|
|
994
|
-
type: Input
|
|
995
|
-
}], icon: [{
|
|
996
|
-
type: Input
|
|
997
|
-
}], label: [{
|
|
998
|
-
type: Input
|
|
999
|
-
}], loading: [{
|
|
1000
|
-
type: Input,
|
|
1001
|
-
args: [{ transform: booleanAttribute }]
|
|
1002
|
-
}], loadingIcon: [{
|
|
1003
|
-
type: Input
|
|
1004
|
-
}], severity: [{
|
|
1005
|
-
type: Input
|
|
1006
|
-
}], buttonProps: [{
|
|
1007
|
-
type: Input
|
|
1008
|
-
}], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], contentTemplate: [{ type: i0.ContentChild, args: ['content', { isSignal: true }] }], loadingIconTemplate: [{ type: i0.ContentChild, args: ['loadingicon', { isSignal: true }] }], iconTemplate: [{ type: i0.ContentChild, args: ['icon', { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
903
|
+
}], ctorParameters: () => [], propDecorators: { hostName: [{ type: i0.Input, args: [{ isSignal: true, alias: "hostName", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], raised: [{ type: i0.Input, args: [{ isSignal: true, alias: "raised", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], plain: [{ type: i0.Input, args: [{ isSignal: true, alias: "plain", required: false }] }], outlined: [{ type: i0.Input, args: [{ isSignal: true, alias: "outlined", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], badgeSeverity: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeSeverity", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingIcon", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], buttonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonProps", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], contentTemplate: [{ type: i0.ContentChild, args: ['content', { isSignal: true }] }], loadingIconTemplate: [{ type: i0.ContentChild, args: ['loadingicon', { isSignal: true }] }], iconTemplate: [{ type: i0.ContentChild, args: ['icon', { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
1009
904
|
class ButtonModule {
|
|
1010
905
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: ButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1011
906
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: ButtonModule, imports: [CommonModule, ButtonDirective, Button, SharedModule, ButtonLabel, ButtonIcon], exports: [ButtonDirective, Button, ButtonLabel, ButtonIcon, SharedModule] });
|