ng-primitives 0.89.0 → 0.91.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/a11y/index.d.ts +98 -3
- package/accordion/index.d.ts +361 -7
- package/ai/index.d.ts +238 -16
- package/autofill/index.d.ts +62 -1
- package/avatar/index.d.ts +155 -5
- package/breadcrumbs/index.d.ts +200 -7
- package/button/index.d.ts +39 -3
- package/checkbox/index.d.ts +137 -2
- package/combobox/index.d.ts +414 -8
- package/common/index.d.ts +31 -4
- package/date-picker/index.d.ts +714 -18
- package/date-time/index.d.ts +289 -3
- package/date-time-luxon/index.d.ts +31 -1
- package/dialog/index.d.ts +253 -9
- package/fesm2022/ng-primitives-a11y.mjs +42 -58
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +249 -225
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-ai.mjs +61 -58
- package/fesm2022/ng-primitives-ai.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +55 -38
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +105 -145
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-breadcrumbs.mjs +106 -49
- package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +20 -42
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +110 -84
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +82 -78
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +5 -5
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +119 -112
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +48 -47
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +56 -48
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +9 -8
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +97 -64
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input-otp.mjs +44 -43
- package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +38 -54
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +59 -54
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +14 -14
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +52 -50
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +86 -72
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +38 -35
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +83 -74
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +67 -60
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +11 -12
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +43 -40
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +35 -33
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +4 -4
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +264 -237
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +9 -9
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +73 -69
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +7 -7
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +287 -253
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +173 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +105 -101
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +48 -43
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +33 -41
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +19 -19
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +160 -159
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +81 -68
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +31 -40
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +68 -60
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +50 -37
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/file-upload/index.d.ts +148 -4
- package/focus-trap/index.d.ts +98 -2
- package/form-field/index.d.ts +266 -7
- package/index.d.ts +2 -2
- package/input/index.d.ts +84 -2
- package/input-otp/index.d.ts +247 -4
- package/interactions/index.d.ts +295 -16
- package/internal/index.d.ts +201 -10
- package/listbox/index.d.ts +209 -6
- package/menu/index.d.ts +297 -8
- package/meter/index.d.ts +67 -6
- package/package.json +28 -28
- package/pagination/index.d.ts +211 -7
- package/popover/index.d.ts +224 -5
- package/portal/index.d.ts +389 -6
- package/progress/index.d.ts +124 -6
- package/radio/index.d.ts +140 -5
- package/resize/index.d.ts +29 -1
- package/roving-focus/index.d.ts +154 -4
- package/schematics/ng-add/schema.d.ts +0 -1
- package/schematics/ng-generate/__snapshots__/index.spec.ts.snap +1 -1
- package/schematics/ng-generate/templates/checkbox/checkbox.__fileSuffix@dasherize__.ts.template +2 -2
- package/schematics/ng-generate/templates/slider/slider.__fileSuffix@dasherize__.ts.template +6 -3
- package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +2 -2
- package/schematics/ng-generate/templates/toggle/toggle.__fileSuffix@dasherize__.ts.template +2 -2
- package/schematics/ng-generate/templates/toggle-group/toggle-group.__fileSuffix@dasherize__.ts.template +2 -2
- package/schematics/ng-generate/templates/toolbar/toolbar.__fileSuffix@dasherize__.ts.template +1 -1
- package/search/index.d.ts +66 -3
- package/select/index.d.ts +341 -8
- package/separator/index.d.ts +30 -2
- package/slider/index.d.ts +471 -10
- package/state/index.d.ts +68 -11
- package/switch/index.d.ts +151 -3
- package/tabs/index.d.ts +222 -7
- package/textarea/index.d.ts +87 -2
- package/toast/index.d.ts +219 -4
- package/toggle/index.d.ts +98 -2
- package/toggle-group/index.d.ts +168 -5
- package/toolbar/index.d.ts +43 -2
- package/tooltip/index.d.ts +214 -5
- package/utils/index.d.ts +170 -9
- package/a11y/active-descendant/active-descendant.d.ts +0 -42
- package/a11y/visually-hidden/visually-hidden-state.d.ts +0 -17
- package/a11y/visually-hidden/visually-hidden.d.ts +0 -50
- package/accordion/accordion/accordion-state.d.ts +0 -17
- package/accordion/accordion/accordion.d.ts +0 -50
- package/accordion/accordion-content/accordion-content.d.ts +0 -40
- package/accordion/accordion-item/accordion-item-state.d.ts +0 -17
- package/accordion/accordion-item/accordion-item.d.ts +0 -50
- package/accordion/accordion-trigger/accordion-trigger.d.ts +0 -31
- package/accordion/config/accordion-config.d.ts +0 -32
- package/ai/prompt-composer/prompt-composer-state.d.ts +0 -17
- package/ai/prompt-composer/prompt-composer.d.ts +0 -23
- package/ai/prompt-composer-dictation/prompt-composer-dictation-state.d.ts +0 -17
- package/ai/prompt-composer-dictation/prompt-composer-dictation.d.ts +0 -29
- package/ai/prompt-composer-input/prompt-composer-input-state.d.ts +0 -17
- package/ai/prompt-composer-input/prompt-composer-input.d.ts +0 -16
- package/ai/prompt-composer-submit/prompt-composer-submit-state.d.ts +0 -17
- package/ai/prompt-composer-submit/prompt-composer-submit.d.ts +0 -15
- package/ai/thread/thread-state.d.ts +0 -17
- package/ai/thread/thread.d.ts +0 -23
- package/ai/thread-message/thread-message-state.d.ts +0 -17
- package/ai/thread-message/thread-message.d.ts +0 -11
- package/ai/thread-suggestion/thread-suggestion-state.d.ts +0 -17
- package/ai/thread-suggestion/thread-suggestion.d.ts +0 -14
- package/ai/thread-viewport/thread-viewport-state.d.ts +0 -17
- package/ai/thread-viewport/thread-viewport.d.ts +0 -34
- package/autofill/autofill/autofill.d.ts +0 -19
- package/avatar/avatar/avatar-state.d.ts +0 -17
- package/avatar/avatar/avatar.d.ts +0 -29
- package/avatar/avatar-fallback/avatar-fallback.d.ts +0 -37
- package/avatar/avatar-image/avatar-image.d.ts +0 -27
- package/avatar/config/avatar-config.d.ts +0 -21
- package/breadcrumbs/breadcrumb-ellipsis/breadcrumb-ellipsis.d.ts +0 -8
- package/breadcrumbs/breadcrumb-item/breadcrumb-item.d.ts +0 -8
- package/breadcrumbs/breadcrumb-link/breadcrumb-link.d.ts +0 -9
- package/breadcrumbs/breadcrumb-list/breadcrumb-list.d.ts +0 -8
- package/breadcrumbs/breadcrumb-page/breadcrumb-page.d.ts +0 -8
- package/breadcrumbs/breadcrumb-separator/breadcrumb-separator.d.ts +0 -8
- package/breadcrumbs/breadcrumbs/breadcrumbs.d.ts +0 -8
- package/button/button/button-state.d.ts +0 -17
- package/button/button/button.d.ts +0 -15
- package/button/button/setup-button.d.ts +0 -15
- package/checkbox/checkbox/checkbox-state.d.ts +0 -17
- package/checkbox/checkbox/checkbox.d.ts +0 -45
- package/combobox/combobox/combobox-state.d.ts +0 -17
- package/combobox/combobox/combobox.d.ts +0 -222
- package/combobox/combobox-button/combobox-button.d.ts +0 -18
- package/combobox/combobox-dropdown/combobox-dropdown.d.ts +0 -21
- package/combobox/combobox-input/combobox-input.d.ts +0 -36
- package/combobox/combobox-option/combobox-option.d.ts +0 -51
- package/combobox/combobox-portal/combobox-portal.d.ts +0 -37
- package/combobox/config/combobox-config.d.ts +0 -28
- package/combobox/utils.d.ts +0 -9
- package/common/header/header-token.d.ts +0 -10
- package/common/header/header.d.ts +0 -13
- package/common/types/orientation.d.ts +0 -1
- package/common/types/selection.d.ts +0 -1
- package/date-picker/config/date-picker-config.d.ts +0 -22
- package/date-picker/date-picker/date-picker-first-day-of-week.d.ts +0 -29
- package/date-picker/date-picker/date-picker-state.d.ts +0 -9
- package/date-picker/date-picker/date-picker.d.ts +0 -129
- package/date-picker/date-picker-cell/date-picker-cell.d.ts +0 -20
- package/date-picker/date-picker-cell-render/date-picker-cell-render-token.d.ts +0 -12
- package/date-picker/date-picker-cell-render/date-picker-cell-render.d.ts +0 -39
- package/date-picker/date-picker-date-button/date-picker-date-button-token.d.ts +0 -7
- package/date-picker/date-picker-date-button/date-picker-date-button.d.ts +0 -114
- package/date-picker/date-picker-grid/date-picker-grid.d.ts +0 -16
- package/date-picker/date-picker-label/date-picker-label-token.d.ts +0 -7
- package/date-picker/date-picker-label/date-picker-label.d.ts +0 -20
- package/date-picker/date-picker-next-month/date-picker-next-month.d.ts +0 -34
- package/date-picker/date-picker-previous-month/date-picker-previous-month.d.ts +0 -34
- package/date-picker/date-picker-row-render/date-picker-row-render-token.d.ts +0 -12
- package/date-picker/date-picker-row-render/date-picker-row-render.d.ts +0 -65
- package/date-picker/date-range-picker/date-range-picker-state.d.ts +0 -19
- package/date-picker/date-range-picker/date-range-picker.d.ts +0 -149
- package/date-time/date-adapter/date-adapter-token.d.ts +0 -11
- package/date-time/date-adapter/date-adapter.d.ts +0 -169
- package/date-time/native-date-adapter/native-date-adapter.d.ts +0 -106
- package/date-time-luxon/luxon-date-adapter/luxon-date-adapter.d.ts +0 -28
- package/dialog/config/dialog-config.d.ts +0 -41
- package/dialog/dialog/dialog-ref.d.ts +0 -45
- package/dialog/dialog/dialog-state.d.ts +0 -17
- package/dialog/dialog/dialog.d.ts +0 -37
- package/dialog/dialog/dialog.service.d.ts +0 -69
- package/dialog/dialog-description/dialog-description.d.ts +0 -12
- package/dialog/dialog-overlay/dialog-overlay.d.ts +0 -16
- package/dialog/dialog-title/dialog-title.d.ts +0 -12
- package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -26
- package/file-upload/file-dropzone/file-drop-filter.d.ts +0 -2
- package/file-upload/file-dropzone/file-dropzone-state.d.ts +0 -17
- package/file-upload/file-dropzone/file-dropzone.d.ts +0 -55
- package/file-upload/file-upload/file-upload-state.d.ts +0 -17
- package/file-upload/file-upload/file-upload.d.ts +0 -72
- package/focus-trap/focus-trap/focus-trap-state.d.ts +0 -17
- package/focus-trap/focus-trap/focus-trap.d.ts +0 -85
- package/form-field/description/description.d.ts +0 -17
- package/form-field/error/error.d.ts +0 -32
- package/form-field/form-control/form-control-state.d.ts +0 -17
- package/form-field/form-control/form-control.d.ts +0 -44
- package/form-field/form-field/form-field-state.d.ts +0 -17
- package/form-field/form-field/form-field.d.ts +0 -119
- package/form-field/label/label.d.ts +0 -30
- package/input/input/input-state.d.ts +0 -17
- package/input/input/input.d.ts +0 -34
- package/input-otp/input-otp/input-otp-state.d.ts +0 -17
- package/input-otp/input-otp/input-otp.d.ts +0 -133
- package/input-otp/input-otp-input/input-otp-input.d.ts +0 -57
- package/input-otp/input-otp-slot/input-otp-slot.d.ts +0 -45
- package/interactions/config/interactions-config.d.ts +0 -30
- package/interactions/focus/focus-interaction.d.ts +0 -14
- package/interactions/focus/focus.d.ts +0 -19
- package/interactions/focus-visible/focus-visible-interaction.d.ts +0 -12
- package/interactions/focus-visible/focus-visible.d.ts +0 -19
- package/interactions/hover/hover-interaction.d.ts +0 -17
- package/interactions/hover/hover.d.ts +0 -31
- package/interactions/interactions/interactions.d.ts +0 -20
- package/interactions/move/move.d.ts +0 -114
- package/interactions/press/press-interaction.d.ts +0 -14
- package/interactions/press/press.d.ts +0 -26
- package/internal/exit-animation/exit-animation-manager.d.ts +0 -17
- package/internal/exit-animation/exit-animation.d.ts +0 -26
- package/internal/signals/explicit-effect.d.ts +0 -19
- package/internal/style-injector/style-injector.d.ts +0 -44
- package/internal/utilities/dom-removal.d.ts +0 -6
- package/internal/utilities/element-ref.d.ts +0 -6
- package/internal/utilities/mutation-observer.d.ts +0 -39
- package/internal/utilities/overflow.d.ts +0 -13
- package/internal/utilities/resize.d.ts +0 -31
- package/internal/utilities/scrolling.d.ts +0 -1
- package/listbox/listbox/listbox-state.d.ts +0 -17
- package/listbox/listbox/listbox.d.ts +0 -101
- package/listbox/listbox-header/listbox-header.d.ts +0 -9
- package/listbox/listbox-option/listbox-option.d.ts +0 -68
- package/listbox/listbox-section/listbox-section.d.ts +0 -9
- package/listbox/listbox-trigger/listbox-trigger.d.ts +0 -13
- package/menu/config/menu-config.d.ts +0 -44
- package/menu/menu/menu-token.d.ts +0 -11
- package/menu/menu/menu.d.ts +0 -22
- package/menu/menu-item/menu-item.d.ts +0 -30
- package/menu/menu-trigger/menu-trigger-state.d.ts +0 -17
- package/menu/menu-trigger/menu-trigger.d.ts +0 -98
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +0 -17
- package/menu/submenu-trigger/submenu-trigger.d.ts +0 -88
- package/meter/meter/meter-state.d.ts +0 -17
- package/meter/meter/meter.d.ts +0 -27
- package/meter/meter-indicator/meter-indicator.d.ts +0 -7
- package/meter/meter-label/meter-label.d.ts +0 -10
- package/meter/meter-track/meter-track.d.ts +0 -5
- package/meter/meter-value/meter-value.d.ts +0 -5
- package/pagination/pagination/pagination-state.d.ts +0 -17
- package/pagination/pagination/pagination.d.ts +0 -45
- package/pagination/pagination-button/pagination-button.d.ts +0 -39
- package/pagination/pagination-first/pagination-first.d.ts +0 -28
- package/pagination/pagination-last/pagination-last.d.ts +0 -28
- package/pagination/pagination-next/pagination-next.d.ts +0 -31
- package/pagination/pagination-previous/pagination-previous.d.ts +0 -31
- package/popover/config/popover-config.d.ts +0 -64
- package/popover/popover/popover.d.ts +0 -18
- package/popover/popover-arrow/popover-arrow.d.ts +0 -6
- package/popover/popover-trigger/popover-trigger-state.d.ts +0 -19
- package/popover/popover-trigger/popover-trigger.d.ts +0 -128
- package/portal/offset.d.ts +0 -39
- package/portal/overlay-arrow.d.ts +0 -1
- package/portal/overlay-token.d.ts +0 -12
- package/portal/overlay.d.ts +0 -214
- package/portal/portal.d.ts +0 -94
- package/portal/scroll-strategy.d.ts +0 -23
- package/progress/progress/progress-state.d.ts +0 -17
- package/progress/progress/progress.d.ts +0 -61
- package/progress/progress-indicator/progress-indicator.d.ts +0 -17
- package/progress/progress-label/progress-label.d.ts +0 -14
- package/progress/progress-track/progress-track.d.ts +0 -9
- package/progress/progress-value/progress-value.d.ts +0 -9
- package/radio/radio-group/radio-group-state.d.ts +0 -18
- package/radio/radio-group/radio-group.d.ts +0 -54
- package/radio/radio-indicator/radio-indicator.d.ts +0 -21
- package/radio/radio-item/radio-item-state.d.ts +0 -18
- package/radio/radio-item/radio-item.d.ts +0 -45
- package/resize/resize/resize.d.ts +0 -26
- package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +0 -17
- package/roving-focus/roving-focus-group/roving-focus-group-token.d.ts +0 -21
- package/roving-focus/roving-focus-group/roving-focus-group.d.ts +0 -94
- package/roving-focus/roving-focus-item/roving-focus-item.d.ts +0 -53
- package/search/search/search-state.d.ts +0 -17
- package/search/search/search.d.ts +0 -36
- package/search/search-clear/search-clear.d.ts +0 -16
- package/select/config/select-config.d.ts +0 -28
- package/select/native-select/native-select-state.d.ts +0 -17
- package/select/native-select/native-select.d.ts +0 -22
- package/select/select/select-state.d.ts +0 -17
- package/select/select/select.d.ts +0 -172
- package/select/select-dropdown/select-dropdown.d.ts +0 -17
- package/select/select-option/select-option.d.ts +0 -51
- package/select/select-portal/select-portal.d.ts +0 -37
- package/separator/config/separator-config.d.ts +0 -22
- package/separator/separator/separator.d.ts +0 -11
- package/slider/range-slider/range-slider/range-slider-state.d.ts +0 -17
- package/slider/range-slider/range-slider/range-slider.d.ts +0 -115
- package/slider/range-slider/range-slider-range/range-slider-range.d.ts +0 -12
- package/slider/range-slider/range-slider-thumb/range-slider-thumb.d.ts +0 -44
- package/slider/range-slider/range-slider-track/range-slider-track.d.ts +0 -22
- package/slider/slider/slider-state.d.ts +0 -17
- package/slider/slider/slider.d.ts +0 -58
- package/slider/slider-range/slider-range.d.ts +0 -12
- package/slider/slider-thumb/slider-thumb.d.ts +0 -29
- package/slider/slider-track/slider-track.d.ts +0 -22
- package/switch/switch/switch-state.d.ts +0 -17
- package/switch/switch/switch.d.ts +0 -49
- package/switch/switch-thumb/switch-thumb.d.ts +0 -13
- package/tabs/config/tabs-config.d.ts +0 -32
- package/tabs/tab-button/tab-button.d.ts +0 -59
- package/tabs/tab-list/tab-list.d.ts +0 -12
- package/tabs/tab-panel/tab-panel-token.d.ts +0 -8
- package/tabs/tab-panel/tab-panel.d.ts +0 -38
- package/tabs/tabset/tabset-state.d.ts +0 -17
- package/tabs/tabset/tabset.d.ts +0 -71
- package/textarea/textarea/textarea-state.d.ts +0 -17
- package/textarea/textarea/textarea.d.ts +0 -19
- package/toast/config/toast-config.d.ts +0 -70
- package/toast/toast/toast-context.d.ts +0 -3
- package/toast/toast/toast-manager.d.ts +0 -49
- package/toast/toast/toast-options.d.ts +0 -34
- package/toast/toast/toast-timer.d.ts +0 -14
- package/toast/toast/toast.d.ts +0 -72
- package/toggle/toggle/toggle-state.d.ts +0 -17
- package/toggle/toggle/toggle.d.ts +0 -44
- package/toggle-group/config/toggle-group-config.d.ts +0 -32
- package/toggle-group/toggle-group/toggle-group-state.d.ts +0 -17
- package/toggle-group/toggle-group/toggle-group.d.ts +0 -64
- package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +0 -17
- package/toggle-group/toggle-group-item/toggle-group-item.d.ts +0 -34
- package/toolbar/toolbar/toolbar-state.d.ts +0 -17
- package/toolbar/toolbar/toolbar.d.ts +0 -20
- package/tooltip/config/tooltip-config.d.ts +0 -59
- package/tooltip/tooltip/tooltip.d.ts +0 -17
- package/tooltip/tooltip-arrow/tooltip-arrow.d.ts +0 -6
- package/tooltip/tooltip-text-content/tooltip-text-content.component.d.ts +0 -14
- package/tooltip/tooltip-trigger/tooltip-trigger-state.d.ts +0 -17
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +0 -126
- package/utils/forms/providers.d.ts +0 -6
- package/utils/forms/status.d.ts +0 -16
- package/utils/forms/types.d.ts +0 -8
- package/utils/helpers/attributes.d.ts +0 -2
- package/utils/helpers/disposables.d.ts +0 -40
- package/utils/helpers/unique-id.d.ts +0 -6
- package/utils/helpers/validators.d.ts +0 -51
- package/utils/observables/take-until-destroyed.d.ts +0 -10
- package/utils/signals/index.d.ts +0 -22
|
@@ -1,125 +1,187 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { signal, computed, afterRenderEffect, input, Directive, booleanAttribute, inject, HOST_TAG_NAME, InjectionToken, output } from '@angular/core';
|
|
3
|
+
import { safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';
|
|
3
4
|
import { injectElementRef, injectDimensions, fromMutationObserver } from 'ng-primitives/internal';
|
|
4
|
-
import {
|
|
5
|
+
import { createPrimitive, controlled, attrBinding, deprecatedSetter, dataBinding, listener } from 'ng-primitives/state';
|
|
5
6
|
import { debounceTime } from 'rxjs/operators';
|
|
6
|
-
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
8
|
+
const [NgpAccordionStateToken, ngpAccordion, _injectAccordionState, provideAccordionState] = createPrimitive('NgpAccordion', ({ type, collapsible, value: _value = signal(null), disabled: _disabled = signal(false), orientation: _orientation = signal('vertical'), onValueChange, }) => {
|
|
9
|
+
const element = injectElementRef();
|
|
10
|
+
// Create controlled signals
|
|
11
|
+
const value = controlled(_value);
|
|
12
|
+
const disabled = controlled(_disabled);
|
|
13
|
+
const orientation = controlled(_orientation);
|
|
14
|
+
// Host bindings extracted from directive
|
|
15
|
+
attrBinding(element, 'data-orientation', orientation);
|
|
16
|
+
attrBinding(element, 'data-disabled', disabled);
|
|
17
|
+
// Setter methods
|
|
18
|
+
function setDisabled(value) {
|
|
19
|
+
disabled.set(value);
|
|
20
|
+
}
|
|
21
|
+
function setOrientation(value) {
|
|
22
|
+
orientation.set(value);
|
|
23
|
+
}
|
|
24
|
+
function setValue(newValue) {
|
|
25
|
+
value.set(newValue);
|
|
26
|
+
}
|
|
27
|
+
// Methods extracted from directive
|
|
28
|
+
/**
|
|
29
|
+
* @param value The value to check. @returns Whether the value is open. @internal
|
|
30
|
+
*/
|
|
31
|
+
function isOpen(itemValue) {
|
|
32
|
+
if (type() === 'multiple') {
|
|
33
|
+
return value()?.includes(itemValue) ?? false;
|
|
34
|
+
}
|
|
35
|
+
return value() === itemValue;
|
|
36
|
+
}
|
|
37
|
+
function toggle(itemValue) {
|
|
38
|
+
const open = isOpen(itemValue);
|
|
39
|
+
// if we are in single mode and the itemValue is already open and the accordion is not collapsible, do nothing
|
|
40
|
+
if (type() === 'single' && open && !collapsible()) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// if we are in single mode then toggle the itemValue
|
|
44
|
+
if (type() === 'single') {
|
|
45
|
+
const newValue = open ? null : itemValue;
|
|
46
|
+
value.set(newValue);
|
|
47
|
+
onValueChange?.(newValue);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// if we are in multiple mode then toggle the itemValue
|
|
51
|
+
let values = value() ?? [];
|
|
52
|
+
if (open) {
|
|
53
|
+
values = values.filter(v => v !== itemValue);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
values = [...values, itemValue];
|
|
57
|
+
}
|
|
58
|
+
value.set(values);
|
|
59
|
+
onValueChange?.(values);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
value: deprecatedSetter(value, 'setValue'),
|
|
63
|
+
disabled: deprecatedSetter(disabled, 'setDisabled'),
|
|
64
|
+
orientation: deprecatedSetter(orientation, 'setOrientation'),
|
|
65
|
+
setDisabled,
|
|
66
|
+
setOrientation,
|
|
67
|
+
setValue,
|
|
68
|
+
isOpen,
|
|
69
|
+
toggle,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
function injectAccordionState() {
|
|
73
|
+
return _injectAccordionState();
|
|
74
|
+
}
|
|
41
75
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* The dimensions of the content
|
|
65
|
-
*/
|
|
66
|
-
this.dimensions = injectDimensions();
|
|
67
|
-
/**
|
|
68
|
-
* The hidden until-found state of the content
|
|
69
|
-
*/
|
|
70
|
-
this.hidden = computed(() => !this.accordionItem().open() && this.dimensions().height === 0 ? 'until-found' : null);
|
|
71
|
-
this.accordionItem().content.set(this);
|
|
72
|
-
// any time the open state of the accordion item changes, update the dimensions
|
|
73
|
-
afterRenderEffect(() => this.updateDimensions());
|
|
74
|
-
// update dimensions when the content changes
|
|
75
|
-
fromMutationObserver(this.elementRef.nativeElement, {
|
|
76
|
-
childList: true,
|
|
77
|
-
subtree: true,
|
|
78
|
-
disabled: computed(() => !this.accordionItem().open()),
|
|
79
|
-
})
|
|
80
|
-
.pipe(debounceTime(0), safeTakeUntilDestroyed())
|
|
81
|
-
.subscribe(() => this.updateDimensions());
|
|
76
|
+
const [NgpAccordionItemStateToken, ngpAccordionItem, _injectAccordionItemState, provideAccordionItemState,] = createPrimitive('NgpAccordionItem', ({ value, disabled: _disabled = signal(false) }) => {
|
|
77
|
+
const accordion = injectAccordionState();
|
|
78
|
+
const element = injectElementRef();
|
|
79
|
+
const disabled = controlled(_disabled);
|
|
80
|
+
// Whether the accordion item is expanded.
|
|
81
|
+
const open = computed(() => accordion().isOpen(value()), ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
82
|
+
const trigger = signal(undefined, ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
83
|
+
const content = signal(undefined, ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
84
|
+
// Setup host data bindings
|
|
85
|
+
dataBinding(element, 'data-orientation', accordion().orientation);
|
|
86
|
+
dataBinding(element, 'data-open', open);
|
|
87
|
+
dataBinding(element, 'data-disabled', () => disabled() || accordion().disabled());
|
|
88
|
+
// Set the disabled state of the accordion item.
|
|
89
|
+
function setDisabled(value) {
|
|
90
|
+
disabled.set(value);
|
|
91
|
+
}
|
|
92
|
+
function setTrigger(id) {
|
|
93
|
+
trigger.set(id);
|
|
94
|
+
}
|
|
95
|
+
function setContent(id) {
|
|
96
|
+
content.set(id);
|
|
82
97
|
}
|
|
98
|
+
return {
|
|
99
|
+
value,
|
|
100
|
+
open,
|
|
101
|
+
disabled: deprecatedSetter(disabled, 'setDisabled'),
|
|
102
|
+
triggerId: deprecatedSetter(trigger, 'setTrigger'),
|
|
103
|
+
contentId: deprecatedSetter(content, 'setContent'),
|
|
104
|
+
setDisabled,
|
|
105
|
+
setTrigger,
|
|
106
|
+
setContent,
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
function injectAccordionItemState() {
|
|
110
|
+
return _injectAccordionItemState();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const [NgpAccordionContentStateToken, ngpAccordionContent, injectAccordionContentState, provideAccordionContentState,] = createPrimitive('NgpAccordionContent', ({ id = signal(uniqueId('ngp-accordion-content')) }) => {
|
|
114
|
+
const element = injectElementRef();
|
|
115
|
+
const accordion = injectAccordionState();
|
|
116
|
+
const accordionItem = injectAccordionItemState();
|
|
117
|
+
const dimensions = injectDimensions();
|
|
118
|
+
const hidden = computed(() => !accordionItem().open() && dimensions().height === 0 ? 'until-found' : null, ...(ngDevMode ? [{ debugName: "hidden" }] : []));
|
|
119
|
+
// Host bindings
|
|
120
|
+
attrBinding(element, 'role', 'region');
|
|
121
|
+
attrBinding(element, 'id', id);
|
|
122
|
+
attrBinding(element, 'aria-labelledby', accordionItem().triggerId);
|
|
123
|
+
attrBinding(element, 'hidden', hidden);
|
|
124
|
+
dataBinding(element, 'data-orientation', accordion().orientation);
|
|
125
|
+
dataBinding(element, 'data-open', accordionItem().open);
|
|
126
|
+
dataBinding(element, 'data-closed', () => !accordionItem().open());
|
|
127
|
+
listener(element, 'beforematch', onBeforeMatch);
|
|
128
|
+
// Register the content with the accordion item state
|
|
129
|
+
accordionItem().setContent(id());
|
|
83
130
|
/**
|
|
84
131
|
* Handle the beforematch event to automatically open the accordion item
|
|
85
132
|
* when the browser's find-in-page functionality tries to reveal hidden content.
|
|
86
133
|
*/
|
|
87
|
-
onBeforeMatch() {
|
|
88
|
-
const isDisabled =
|
|
89
|
-
if (isDisabled)
|
|
134
|
+
function onBeforeMatch() {
|
|
135
|
+
const isDisabled = accordion().disabled() || accordionItem().disabled();
|
|
136
|
+
if (isDisabled) {
|
|
90
137
|
return;
|
|
91
|
-
|
|
138
|
+
}
|
|
139
|
+
accordion().toggle(accordionItem().value());
|
|
92
140
|
}
|
|
93
|
-
updateDimensions() {
|
|
94
|
-
if (
|
|
141
|
+
function updateDimensions() {
|
|
142
|
+
if (accordionItem().open()) {
|
|
95
143
|
// remove the inline styles to reset them
|
|
96
|
-
|
|
97
|
-
|
|
144
|
+
element.nativeElement.style.removeProperty('--ngp-accordion-content-width');
|
|
145
|
+
element.nativeElement.style.removeProperty('--ngp-accordion-content-height');
|
|
98
146
|
// set the dimensions based on the content
|
|
99
|
-
|
|
100
|
-
|
|
147
|
+
element.nativeElement.style.setProperty('--ngp-accordion-content-width', `${element.nativeElement.scrollWidth}px`);
|
|
148
|
+
element.nativeElement.style.setProperty('--ngp-accordion-content-height', `${element.nativeElement.scrollHeight}px`);
|
|
101
149
|
}
|
|
102
150
|
}
|
|
103
|
-
|
|
104
|
-
|
|
151
|
+
// any time the open state of the accordion item changes, update the dimensions
|
|
152
|
+
afterRenderEffect(() => updateDimensions());
|
|
153
|
+
// update dimensions when the content changes
|
|
154
|
+
fromMutationObserver(element.nativeElement, {
|
|
155
|
+
childList: true,
|
|
156
|
+
subtree: true,
|
|
157
|
+
disabled: computed(() => !accordionItem().open()),
|
|
158
|
+
})
|
|
159
|
+
.pipe(debounceTime(0), safeTakeUntilDestroyed())
|
|
160
|
+
.subscribe(() => updateDimensions());
|
|
161
|
+
return {};
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Apply the `ngpAccordionContent` directive to an element that represents the content of an accordion item.
|
|
166
|
+
*/
|
|
167
|
+
class NgpAccordionContent {
|
|
168
|
+
constructor() {
|
|
169
|
+
/**
|
|
170
|
+
* The id of the content region
|
|
171
|
+
*/
|
|
172
|
+
this.id = input(uniqueId('ngp-accordion-content'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
173
|
+
ngpAccordionContent({ id: this.id });
|
|
174
|
+
}
|
|
175
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
176
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpAccordionContent, isStandalone: true, selector: "[ngpAccordionContent]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpAccordionContent"], ngImport: i0 }); }
|
|
105
177
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionContent, decorators: [{
|
|
107
179
|
type: Directive,
|
|
108
180
|
args: [{
|
|
109
181
|
selector: '[ngpAccordionContent]',
|
|
110
182
|
exportAs: 'ngpAccordionContent',
|
|
111
|
-
host: {
|
|
112
|
-
role: 'region',
|
|
113
|
-
'[id]': 'id()',
|
|
114
|
-
'[attr.data-orientation]': 'accordion().orientation()',
|
|
115
|
-
'[attr.data-open]': 'accordionItem().open() ? "" : null',
|
|
116
|
-
'[attr.data-closed]': 'accordionItem().open() ? null : ""',
|
|
117
|
-
'[attr.aria-labelledby]': 'accordionItem().triggerId()',
|
|
118
|
-
'(beforematch)': 'onBeforeMatch()',
|
|
119
|
-
'[attr.hidden]': 'hidden()',
|
|
120
|
-
},
|
|
121
183
|
}]
|
|
122
|
-
}], ctorParameters: () => [] });
|
|
184
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
123
185
|
|
|
124
186
|
/**
|
|
125
187
|
* Apply the `ngpAccordionItem` directive to an element that represents an accordion item.
|
|
@@ -133,114 +195,95 @@ class NgpAccordionItem {
|
|
|
133
195
|
/**
|
|
134
196
|
* The value of the accordion item.
|
|
135
197
|
*/
|
|
136
|
-
this.value = input(uniqueId('ngp-accordion-item'), {
|
|
137
|
-
|
|
138
|
-
|
|
198
|
+
this.value = input(uniqueId('ngp-accordion-item'), ...(ngDevMode ? [{ debugName: "value", alias: 'ngpAccordionItemValue' }] : [{
|
|
199
|
+
alias: 'ngpAccordionItemValue',
|
|
200
|
+
}]));
|
|
139
201
|
/**
|
|
140
202
|
* Whether the accordion item is disabled.
|
|
141
203
|
*/
|
|
142
|
-
this.disabled = input(false, {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
* Access the accordion trigger
|
|
148
|
-
* @internal
|
|
149
|
-
*/
|
|
150
|
-
this.trigger = signal(undefined);
|
|
151
|
-
/**
|
|
152
|
-
* Access the accordion content
|
|
153
|
-
* @internal
|
|
154
|
-
*/
|
|
155
|
-
this.content = signal(undefined);
|
|
156
|
-
/**
|
|
157
|
-
* Whether the accordion item is expanded.
|
|
158
|
-
*/
|
|
159
|
-
this.open = computed(() => this.accordion().isOpen(this.state.value()));
|
|
204
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpAccordionItemDisabled',
|
|
205
|
+
transform: booleanAttribute }] : [{
|
|
206
|
+
alias: 'ngpAccordionItemDisabled',
|
|
207
|
+
transform: booleanAttribute,
|
|
208
|
+
}]));
|
|
160
209
|
/**
|
|
161
|
-
* The
|
|
162
|
-
*/
|
|
163
|
-
this.triggerId = computed(() => this.trigger()?.id());
|
|
164
|
-
/**
|
|
165
|
-
* The content id.
|
|
210
|
+
* The accordion item state.
|
|
166
211
|
*/
|
|
167
|
-
this.
|
|
212
|
+
this.state = ngpAccordionItem({
|
|
213
|
+
value: this.value,
|
|
214
|
+
disabled: this.disabled,
|
|
215
|
+
});
|
|
168
216
|
/**
|
|
169
|
-
* The accordion item
|
|
217
|
+
* The open state of the accordion item.
|
|
170
218
|
*/
|
|
171
|
-
this.
|
|
219
|
+
this.open = this.state.open;
|
|
172
220
|
}
|
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
174
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
222
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpAccordionItem, isStandalone: true, selector: "[ngpAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpAccordionItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpAccordionItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideAccordionItemState()], exportAs: ["ngpAccordionItem"], ngImport: i0 }); }
|
|
175
223
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionItem, decorators: [{
|
|
177
225
|
type: Directive,
|
|
178
226
|
args: [{
|
|
179
227
|
selector: '[ngpAccordionItem]',
|
|
180
228
|
exportAs: 'ngpAccordionItem',
|
|
181
229
|
providers: [provideAccordionItemState()],
|
|
182
|
-
host: {
|
|
183
|
-
'[attr.data-orientation]': 'accordion().orientation()',
|
|
184
|
-
'[attr.data-open]': 'state.open() ? "" : null',
|
|
185
|
-
'[attr.data-disabled]': 'state.disabled() || accordion().disabled() ? "" : null',
|
|
186
|
-
},
|
|
187
230
|
}]
|
|
188
|
-
}] });
|
|
231
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionItemValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionItemDisabled", required: false }] }] } });
|
|
232
|
+
|
|
233
|
+
const [NgpAccordionTriggerStateToken, ngpAccordionTrigger, injectAccordionTriggerState, provideAccordionTriggerState,] = createPrimitive('NgpAccordionTrigger', ({ id = signal(uniqueId('ngp-accordion-trigger')) }) => {
|
|
234
|
+
const element = injectElementRef();
|
|
235
|
+
const tagName = inject(HOST_TAG_NAME);
|
|
236
|
+
const accordion = injectAccordionState();
|
|
237
|
+
const accordionItem = injectAccordionItemState();
|
|
238
|
+
// Host bindings
|
|
239
|
+
attrBinding(element, 'id', id);
|
|
240
|
+
attrBinding(element, 'type', tagName === 'button' ? 'button' : null);
|
|
241
|
+
attrBinding(element, 'aria-controls', accordionItem().contentId);
|
|
242
|
+
attrBinding(element, 'aria-expanded', accordionItem().open);
|
|
243
|
+
dataBinding(element, 'data-orientation', accordion().orientation);
|
|
244
|
+
dataBinding(element, 'data-open', accordionItem().open);
|
|
245
|
+
dataBinding(element, 'data-disabled', () => accordionItem().disabled() || accordion().disabled());
|
|
246
|
+
// register the trigger with the accordion item
|
|
247
|
+
accordionItem().setTrigger(id());
|
|
248
|
+
// Methods
|
|
249
|
+
function toggle() {
|
|
250
|
+
if (accordionItem().disabled() || accordion().disabled()) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
accordion().toggle(accordionItem().value());
|
|
254
|
+
}
|
|
255
|
+
// Event listeners
|
|
256
|
+
listener(element, 'click', toggle);
|
|
257
|
+
return { id, toggle };
|
|
258
|
+
});
|
|
189
259
|
|
|
190
260
|
/**
|
|
191
261
|
* Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.
|
|
192
262
|
*/
|
|
193
263
|
class NgpAccordionTrigger {
|
|
194
264
|
constructor() {
|
|
195
|
-
/**
|
|
196
|
-
* The tag name of the element.
|
|
197
|
-
*/
|
|
198
|
-
this.tagName = inject(HOST_TAG_NAME);
|
|
199
|
-
/**
|
|
200
|
-
* Access the parent accordion.
|
|
201
|
-
*/
|
|
202
|
-
this.accordion = injectAccordionState();
|
|
203
|
-
/**
|
|
204
|
-
* The item instance.
|
|
205
|
-
*/
|
|
206
|
-
this.accordionItem = injectAccordionItemState();
|
|
207
265
|
/**
|
|
208
266
|
* The id of the trigger.
|
|
209
267
|
*/
|
|
210
|
-
this.id = input(uniqueId('ngp-accordion-trigger'));
|
|
211
|
-
this.
|
|
268
|
+
this.id = input(uniqueId('ngp-accordion-trigger'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
269
|
+
this.state = ngpAccordionTrigger({ id: this.id });
|
|
212
270
|
}
|
|
213
271
|
/**
|
|
214
272
|
* Toggle the accordion item.
|
|
215
273
|
*/
|
|
216
274
|
toggle() {
|
|
217
|
-
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
this.accordion().toggle(this.accordionItem().value());
|
|
275
|
+
this.state.toggle();
|
|
221
276
|
}
|
|
222
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
223
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
277
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
278
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpAccordionTrigger, isStandalone: true, selector: "[ngpAccordionTrigger]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpAccordionTrigger"], ngImport: i0 }); }
|
|
224
279
|
}
|
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordionTrigger, decorators: [{
|
|
226
281
|
type: Directive,
|
|
227
282
|
args: [{
|
|
228
283
|
selector: '[ngpAccordionTrigger]',
|
|
229
284
|
exportAs: 'ngpAccordionTrigger',
|
|
230
|
-
host: {
|
|
231
|
-
'[id]': 'id()',
|
|
232
|
-
'[attr.type]': 'tagName === "button" ? "button" : null',
|
|
233
|
-
'[attr.data-orientation]': 'accordion().orientation()',
|
|
234
|
-
'[attr.data-open]': 'accordionItem().open() ? "" : null',
|
|
235
|
-
'[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? "" : null',
|
|
236
|
-
'[attr.aria-controls]': 'accordionItem().contentId()',
|
|
237
|
-
'[attr.aria-expanded]': 'accordionItem().open()',
|
|
238
|
-
},
|
|
239
285
|
}]
|
|
240
|
-
}],
|
|
241
|
-
type: HostListener,
|
|
242
|
-
args: ['click']
|
|
243
|
-
}] } });
|
|
286
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
244
287
|
|
|
245
288
|
const defaultAccordionConfig = {
|
|
246
289
|
type: 'single',
|
|
@@ -281,22 +324,23 @@ class NgpAccordion {
|
|
|
281
324
|
/**
|
|
282
325
|
* The type of the accordion.
|
|
283
326
|
*/
|
|
284
|
-
this.type = input(this.config.type, {
|
|
285
|
-
|
|
286
|
-
|
|
327
|
+
this.type = input(this.config.type, ...(ngDevMode ? [{ debugName: "type", alias: 'ngpAccordionType' }] : [{
|
|
328
|
+
alias: 'ngpAccordionType',
|
|
329
|
+
}]));
|
|
287
330
|
/**
|
|
288
331
|
* Whether the accordion is collapsible.
|
|
289
332
|
*/
|
|
290
|
-
this.collapsible = input(this.config.collapsible, {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
333
|
+
this.collapsible = input(this.config.collapsible, ...(ngDevMode ? [{ debugName: "collapsible", alias: 'ngpAccordionCollapsible',
|
|
334
|
+
transform: booleanAttribute }] : [{
|
|
335
|
+
alias: 'ngpAccordionCollapsible',
|
|
336
|
+
transform: booleanAttribute,
|
|
337
|
+
}]));
|
|
294
338
|
/**
|
|
295
339
|
* The value of the accordion.
|
|
296
340
|
*/
|
|
297
|
-
this.value = input(null, {
|
|
298
|
-
|
|
299
|
-
|
|
341
|
+
this.value = input(null, ...(ngDevMode ? [{ debugName: "value", alias: 'ngpAccordionValue' }] : [{
|
|
342
|
+
alias: 'ngpAccordionValue',
|
|
343
|
+
}]));
|
|
300
344
|
/**
|
|
301
345
|
* Event emitted when the accordion value changes.
|
|
302
346
|
*/
|
|
@@ -306,20 +350,28 @@ class NgpAccordion {
|
|
|
306
350
|
/**
|
|
307
351
|
* Whether the accordion is disabled.
|
|
308
352
|
*/
|
|
309
|
-
this.disabled = input(false, {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
353
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpAccordionDisabled',
|
|
354
|
+
transform: booleanAttribute }] : [{
|
|
355
|
+
alias: 'ngpAccordionDisabled',
|
|
356
|
+
transform: booleanAttribute,
|
|
357
|
+
}]));
|
|
313
358
|
/**
|
|
314
359
|
* The accordion orientation.
|
|
315
360
|
*/
|
|
316
|
-
this.orientation = input(this.config.orientation, {
|
|
317
|
-
|
|
318
|
-
|
|
361
|
+
this.orientation = input(this.config.orientation, ...(ngDevMode ? [{ debugName: "orientation", alias: 'ngpAccordionOrientation' }] : [{
|
|
362
|
+
alias: 'ngpAccordionOrientation',
|
|
363
|
+
}]));
|
|
319
364
|
/**
|
|
320
365
|
* The accordion state.
|
|
321
366
|
*/
|
|
322
|
-
this.state =
|
|
367
|
+
this.state = ngpAccordion({
|
|
368
|
+
type: this.type,
|
|
369
|
+
collapsible: this.collapsible,
|
|
370
|
+
value: this.value,
|
|
371
|
+
disabled: this.disabled,
|
|
372
|
+
orientation: this.orientation,
|
|
373
|
+
onValueChange: value => this.valueChange.emit(value),
|
|
374
|
+
});
|
|
323
375
|
}
|
|
324
376
|
/**
|
|
325
377
|
* @param value The value to check.
|
|
@@ -327,54 +379,26 @@ class NgpAccordion {
|
|
|
327
379
|
* @internal
|
|
328
380
|
*/
|
|
329
381
|
isOpen(value) {
|
|
330
|
-
|
|
331
|
-
return this.state.value()?.includes(value) ?? false;
|
|
332
|
-
}
|
|
333
|
-
return this.state.value() === value;
|
|
382
|
+
return this.state.isOpen(value);
|
|
334
383
|
}
|
|
335
384
|
toggle(value) {
|
|
336
|
-
|
|
337
|
-
// if we are in single mode and the value is already open and the accordion is not collapsible, do nothing
|
|
338
|
-
if (this.state.type() === 'single' && isOpen && !this.state.collapsible()) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
// if we are in single mode then toggle the value
|
|
342
|
-
if (this.state.type() === 'single') {
|
|
343
|
-
const newValue = isOpen ? null : value;
|
|
344
|
-
this.state.value.set(newValue);
|
|
345
|
-
this.valueChange.emit(newValue);
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
// if we are in multiple mode then toggle the value
|
|
349
|
-
let values = this.state.value() ?? [];
|
|
350
|
-
if (isOpen) {
|
|
351
|
-
values = values.filter(v => v !== value);
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
values = [...values, value];
|
|
355
|
-
}
|
|
356
|
-
this.state.value.set(values);
|
|
357
|
-
this.valueChange.emit(values);
|
|
385
|
+
this.state.toggle(value);
|
|
358
386
|
}
|
|
359
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
360
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
388
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpAccordion, isStandalone: true, selector: "[ngpAccordion]", inputs: { type: { classPropertyName: "type", publicName: "ngpAccordionType", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "ngpAccordionCollapsible", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpAccordionValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpAccordionDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpAccordionOrientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpAccordionValueChange" }, providers: [provideAccordionState()], exportAs: ["ngpAccordion"], ngImport: i0 }); }
|
|
361
389
|
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpAccordion, decorators: [{
|
|
363
391
|
type: Directive,
|
|
364
392
|
args: [{
|
|
365
393
|
selector: '[ngpAccordion]',
|
|
366
394
|
exportAs: 'ngpAccordion',
|
|
367
395
|
providers: [provideAccordionState()],
|
|
368
|
-
host: {
|
|
369
|
-
'[attr.data-orientation]': 'state.orientation()',
|
|
370
|
-
'[attr.data-disabled]': 'state.disabled() ? "" : null',
|
|
371
|
-
},
|
|
372
396
|
}]
|
|
373
|
-
}] });
|
|
397
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionType", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionCollapsible", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionValue", required: false }] }], valueChange: [{ type: i0.Output, args: ["ngpAccordionValueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionDisabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpAccordionOrientation", required: false }] }] } });
|
|
374
398
|
|
|
375
399
|
/**
|
|
376
400
|
* Generated bundle index. Do not edit.
|
|
377
401
|
*/
|
|
378
402
|
|
|
379
|
-
export { NgpAccordion, NgpAccordionContent, NgpAccordionItem, NgpAccordionTrigger, injectAccordionItemState, injectAccordionState, provideAccordionConfig, provideAccordionItemState, provideAccordionState };
|
|
403
|
+
export { NgpAccordion, NgpAccordionContent, NgpAccordionContentStateToken, NgpAccordionItem, NgpAccordionItemStateToken, NgpAccordionStateToken, NgpAccordionTrigger, NgpAccordionTriggerStateToken, injectAccordionContentState, injectAccordionItemState, injectAccordionState, injectAccordionTriggerState, ngpAccordion, ngpAccordionContent, ngpAccordionItem, ngpAccordionTrigger, provideAccordionConfig, provideAccordionContentState, provideAccordionItemState, provideAccordionState, provideAccordionTriggerState };
|
|
380
404
|
//# sourceMappingURL=ng-primitives-accordion.mjs.map
|