From 707da4e58c98b1f580eeb83bd1ced1ca67ae77ea Mon Sep 17 00:00:00 2001 From: Fahad <44726129+DaPotatoMan@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:13:37 +0600 Subject: [PATCH] feat(dx): Improve hinted string types --- components/lib/autocomplete/AutoComplete.d.ts | 4 ++-- components/lib/badge/Badge.d.ts | 4 ++-- components/lib/button/Button.d.ts | 6 +++--- components/lib/calendar/Calendar.d.ts | 4 ++-- components/lib/cascadeselect/CascadeSelect.d.ts | 4 ++-- components/lib/colorpicker/ColorPicker.d.ts | 4 ++-- components/lib/contextmenu/ContextMenu.d.ts | 4 ++-- components/lib/datatable/DataTable.d.ts | 8 ++++---- components/lib/dialog/Dialog.d.ts | 4 ++-- components/lib/dropdown/Dropdown.d.ts | 6 +++--- components/lib/inlinemessage/InlineMessage.d.ts | 4 ++-- components/lib/listbox/Listbox.d.ts | 4 ++-- components/lib/menu/Menu.d.ts | 4 ++-- components/lib/message/Message.d.ts | 4 ++-- components/lib/multiselect/MultiSelect.d.ts | 6 +++--- components/lib/overlaypanel/OverlayPanel.d.ts | 4 ++-- components/lib/password/Password.d.ts | 4 ++-- components/lib/portal/Portal.d.ts | 4 ++-- components/lib/splitbutton/SplitButton.d.ts | 6 +++--- components/lib/styleclass/StyleClass.d.ts | 4 ++-- components/lib/tag/Tag.d.ts | 4 ++-- components/lib/tieredmenu/TieredMenu.d.ts | 4 ++-- components/lib/tree/Tree.d.ts | 4 ++-- components/lib/treeselect/TreeSelect.d.ts | 4 ++-- components/lib/treetable/TreeTable.d.ts | 8 ++++---- components/lib/ts-helpers.d.ts | 2 ++ 26 files changed, 60 insertions(+), 58 deletions(-) diff --git a/components/lib/autocomplete/AutoComplete.d.ts b/components/lib/autocomplete/AutoComplete.d.ts index ea0b357ec3..763d69f67d 100755 --- a/components/lib/autocomplete/AutoComplete.d.ts +++ b/components/lib/autocomplete/AutoComplete.d.ts @@ -11,7 +11,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue import { ComponentHooks } from '../basecomponent'; import { ButtonPassThroughOptions } from '../button'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; export declare type AutoCompletePassThroughOptionType = AutoCompletePassThroughAttributes | ((options: AutoCompletePassThroughMethodOptions) => AutoCompletePassThroughAttributes | string) | string | null | undefined; @@ -384,7 +384,7 @@ export interface AutoCompleteProps { * Special keywords are 'body' for document body and 'self' for the element itself. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions. * @defaultValue false diff --git a/components/lib/badge/Badge.d.ts b/components/lib/badge/Badge.d.ts index 83405a6731..1d165b7fc3 100644 --- a/components/lib/badge/Badge.d.ts +++ b/components/lib/badge/Badge.d.ts @@ -10,7 +10,7 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type BadgePassThroughOptionType = BadgePassThroughAttributes | ((options: BadgePassThroughMethodOptions) => BadgePassThroughAttributes | string) | string | null | undefined; @@ -70,7 +70,7 @@ export interface BadgeProps { /** * Severity type of the badge. */ - severity?: 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast' | string | null | undefined; + severity?: HintedString<'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast'> | null | undefined; /** * Size of the badge, valid options are 'large' and 'xlarge'. */ diff --git a/components/lib/button/Button.d.ts b/components/lib/button/Button.d.ts index 260f6fbb32..eae282387f 100755 --- a/components/lib/button/Button.d.ts +++ b/components/lib/button/Button.d.ts @@ -10,7 +10,7 @@ import { ButtonHTMLAttributes, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes | string) | string | null | undefined; @@ -119,7 +119,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { /** * Severity type of the badge. */ - badgeSeverity?: 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast' | string | null | undefined; + badgeSeverity?: HintedString<'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast'> | null | undefined; /** * Whether the button is in loading state. * @defaultValue false @@ -137,7 +137,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { /** * Defines the style of the button. */ - severity?: 'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | 'contrast' | string | undefined; + severity?: HintedString<'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | 'contrast'> | undefined; /** * Add a shadow to indicate elevation. * @defaultValue false diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index f210b7b79b..c2a31db130 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -11,7 +11,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue import { ComponentHooks } from '../basecomponent'; import { ButtonPassThroughOptions } from '../button'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type CalendarPassThroughOptionType = CalendarPassThroughAttributes | ((options: CalendarPassThroughMethodOptions) => CalendarPassThroughAttributes | string) | string | null | undefined; @@ -739,7 +739,7 @@ export interface CalendarProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Identifier of the element. */ diff --git a/components/lib/cascadeselect/CascadeSelect.d.ts b/components/lib/cascadeselect/CascadeSelect.d.ts index f7380ec7a5..d6aa6b4ae8 100644 --- a/components/lib/cascadeselect/CascadeSelect.d.ts +++ b/components/lib/cascadeselect/CascadeSelect.d.ts @@ -10,7 +10,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type CascadeSelectPassThroughOptionType = CascadeSelectPassThroughAttributes | ((options: CascadeSelectPassThroughMethodOptions) => CascadeSelectPassThroughAttributes | string) | string | null | undefined; @@ -322,7 +322,7 @@ export interface CascadeSelectProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether the dropdown is in loading state. * @defaultValue false diff --git a/components/lib/colorpicker/ColorPicker.d.ts b/components/lib/colorpicker/ColorPicker.d.ts index 387f4e0f59..f04e4e3adb 100755 --- a/components/lib/colorpicker/ColorPicker.d.ts +++ b/components/lib/colorpicker/ColorPicker.d.ts @@ -10,7 +10,7 @@ import { TransitionProps } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type ColorPickerPassThroughOptionType = ColorPickerPassThroughAttributes | ((options: ColorPickerPassThroughMethodOptions) => ColorPickerPassThroughAttributes | string) | string | null | undefined; @@ -181,7 +181,7 @@ export interface ColorPickerProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Used to pass attributes to DOM elements inside the component. * @type {ColorPickerPassThroughOptions} diff --git a/components/lib/contextmenu/ContextMenu.d.ts b/components/lib/contextmenu/ContextMenu.d.ts index 6e2ebf046b..8952a4eaaa 100755 --- a/components/lib/contextmenu/ContextMenu.d.ts +++ b/components/lib/contextmenu/ContextMenu.d.ts @@ -12,7 +12,7 @@ import { TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { MenuItem } from '../menuitem'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type ContextMenuPassThroughOptionType = ContextMenuPassThroughAttributes | ((options: ContextMenuPassThroughMethodOptions) => ContextMenuPassThroughAttributes | string) | string | null | undefined; @@ -231,7 +231,7 @@ export interface ContextMenuProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether to automatically manage layering. * @defaultValue true diff --git a/components/lib/datatable/DataTable.d.ts b/components/lib/datatable/DataTable.d.ts index 6c4e36b432..a1d5552fb9 100755 --- a/components/lib/datatable/DataTable.d.ts +++ b/components/lib/datatable/DataTable.d.ts @@ -14,7 +14,7 @@ import { ColumnGroupPassThroughOptionType } from '../columngroup'; import { PaginatorPassThroughOptionType } from '../paginator'; import { PassThroughOptions } from '../passthrough'; import { RowPassThroughOptionType } from '../row'; -import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough, HintedString } from '../ts-helpers'; import { VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; export declare type DataTablePassThroughOptionType = DataTablePassThroughAttributes | ((options: DataTablePassThroughMethodOptions) => DataTablePassThroughAttributes | string) | string | null | undefined; @@ -94,7 +94,7 @@ export interface DataTableFilterMetaData { /** * Filter match mode */ - matchMode: 'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter' | string | undefined; + matchMode: HintedString<'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter'> | undefined; } /** @@ -196,7 +196,7 @@ export interface DataTableSortEvent { /** * Match modes per field */ - filterMatchModes: 'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter' | string | undefined; + filterMatchModes: HintedString<'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter'> | undefined; } /** @@ -1080,7 +1080,7 @@ export interface DataTableProps { /** * Height of the scroll viewport in fixed pixels or the 'flex' keyword for a dynamic size. */ - scrollHeight?: 'flex' | string | undefined; + scrollHeight?: HintedString<'flex'> | undefined; /** * Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it. * Note: Currently only vertical orientation mode is supported. diff --git a/components/lib/dialog/Dialog.d.ts b/components/lib/dialog/Dialog.d.ts index 5cf3c5b194..13df1dbc8e 100755 --- a/components/lib/dialog/Dialog.d.ts +++ b/components/lib/dialog/Dialog.d.ts @@ -10,7 +10,7 @@ import { HTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type DialogPassThroughOptionType = DialogPassThroughAttributes | ((options: DialogPassThroughMethodOptions) => DialogPassThroughAttributes | string) | string | null | undefined; @@ -259,7 +259,7 @@ export interface DialogProps { * A valid query selector or an HTMLElement to specify where the dialog gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Style of the dynamic dialog. */ diff --git a/components/lib/dropdown/Dropdown.d.ts b/components/lib/dropdown/Dropdown.d.ts index b6e2e47dac..e8c0915f29 100755 --- a/components/lib/dropdown/Dropdown.d.ts +++ b/components/lib/dropdown/Dropdown.d.ts @@ -10,7 +10,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; export declare type DropdownPassThroughOptionType = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions) => DropdownPassThroughAttributes | string) | string | null | undefined; @@ -305,7 +305,7 @@ export interface DropdownProps { * Defines the filtering algorithm to use when searching the options. * @defaultValue contains */ - filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | undefined; + filterMatchMode?: HintedString<'contains' | 'startsWith' | 'endsWith'> | undefined; /** * Fields used when filtering the options, defaults to optionLabel. */ @@ -384,7 +384,7 @@ export interface DropdownProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether the dropdown is in loading state. * @defaultValue false diff --git a/components/lib/inlinemessage/InlineMessage.d.ts b/components/lib/inlinemessage/InlineMessage.d.ts index 17ceef2167..e4c3a8af8f 100755 --- a/components/lib/inlinemessage/InlineMessage.d.ts +++ b/components/lib/inlinemessage/InlineMessage.d.ts @@ -10,7 +10,7 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type InlineMessagePassThroughOptionType = InlineMessagePassThroughAttributes | ((options: InlineMessagePassThroughMethodOptions) => InlineMessagePassThroughAttributes | string) | string | null | undefined; @@ -94,7 +94,7 @@ export interface InlineMessageProps { * Severity level of the message. * @defaultValue info */ - severity?: 'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast' | string | undefined; + severity?: HintedString<'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast'> | undefined; /** * Display a custom icon for the message. * @deprecated since v3.27.0. Use 'icon' slot. diff --git a/components/lib/listbox/Listbox.d.ts b/components/lib/listbox/Listbox.d.ts index f58860b56c..405c47f810 100755 --- a/components/lib/listbox/Listbox.d.ts +++ b/components/lib/listbox/Listbox.d.ts @@ -10,7 +10,7 @@ import { InputHTMLAttributes, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; export declare type ListboxPassThroughOptionType = ListboxPassThroughAttributes | ((options: ListboxPassThroughMethodOptions) => ListboxPassThroughAttributes | string) | string | null | undefined; @@ -282,7 +282,7 @@ export interface ListboxProps { * Defines the filtering algorithm to use when searching the options. * @defaultValue contains */ - filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | undefined; + filterMatchMode?: HintedString<'contains' | 'startsWith' | 'endsWith'> | undefined; /** * Fields used when filtering the options, defaults to optionLabel. */ diff --git a/components/lib/menu/Menu.d.ts b/components/lib/menu/Menu.d.ts index 282eadb72c..9197a54499 100755 --- a/components/lib/menu/Menu.d.ts +++ b/components/lib/menu/Menu.d.ts @@ -11,7 +11,7 @@ import { TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { MenuItem } from '../menuitem'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type MenuPassThroughOptionType = MenuPassThroughAttributes | ((options: MenuPassThroughMethodOptions) => MenuPassThroughAttributes | string) | string | null | undefined; @@ -205,7 +205,7 @@ export interface MenuProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether to automatically manage layering. * @defaultValue true diff --git a/components/lib/message/Message.d.ts b/components/lib/message/Message.d.ts index f6f8a4930a..1d366c0bbb 100755 --- a/components/lib/message/Message.d.ts +++ b/components/lib/message/Message.d.ts @@ -10,7 +10,7 @@ import { ButtonHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type MessagePassThroughOptionType = MessagePassThroughAttributes | ((options: MessagePassThroughMethodOptions) => MessagePassThroughAttributes | string) | string | null | undefined; @@ -118,7 +118,7 @@ export interface MessageProps { * Severity level of the message. * @defaultValue info */ - severity?: 'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast' | string | undefined; + severity?: HintedString<'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast'> | undefined; /** * Whether the message can be closed manually using the close icon. * @defaultValue true diff --git a/components/lib/multiselect/MultiSelect.d.ts b/components/lib/multiselect/MultiSelect.d.ts index 45a37fc508..7e9acc9dc5 100755 --- a/components/lib/multiselect/MultiSelect.d.ts +++ b/components/lib/multiselect/MultiSelect.d.ts @@ -10,7 +10,7 @@ import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; export declare type MultiSelectPassThroughOptionType = MultiSelectPassThroughAttributes | ((options: MultiSelectPassThroughMethodOptions) => MultiSelectPassThroughAttributes | string) | string | null | undefined; @@ -395,7 +395,7 @@ export interface MultiSelectProps { * Defines the filtering algorithm to use when searching the options. * @defaultValue contains */ - filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | undefined; + filterMatchMode?: HintedString<'contains' | 'startsWith' | 'endsWith'> | undefined; /** * Fields used when filtering the options, defaults to optionLabel. */ @@ -404,7 +404,7 @@ export interface MultiSelectProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Defines how the selected items are displayed. * @defaultValue comma diff --git a/components/lib/overlaypanel/OverlayPanel.d.ts b/components/lib/overlaypanel/OverlayPanel.d.ts index 2567528ea5..c2c96bd12e 100755 --- a/components/lib/overlaypanel/OverlayPanel.d.ts +++ b/components/lib/overlaypanel/OverlayPanel.d.ts @@ -10,7 +10,7 @@ import { TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type OverlayPanelPassThroughOptionType = OverlayPanelPassThroughAttributes | ((options: OverlayPanelPassThroughMethodOptions) => OverlayPanelPassThroughAttributes | string) | string | null | undefined; @@ -136,7 +136,7 @@ export interface OverlayPanelProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Base zIndex value to use in layering. * @defaultValue 0 diff --git a/components/lib/password/Password.d.ts b/components/lib/password/Password.d.ts index 1b9de5e3b3..b803db01d0 100755 --- a/components/lib/password/Password.d.ts +++ b/components/lib/password/Password.d.ts @@ -11,7 +11,7 @@ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue import { ComponentHooks } from '../basecomponent'; import { InputTextPassThroughOptions } from '../inputtext'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, Nullable, PassThrough, HintedString } from '../ts-helpers'; export declare type PasswordPassThroughOptionType = PasswordPassThroughAttributes | ((options: PasswordPassThroughMethodOptions) => PasswordPassThroughAttributes | string) | string | null | undefined; @@ -205,7 +205,7 @@ export interface PasswordProps extends InputHTMLAttributes { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether to show an icon to display the password as plain text. * @defaultValue false diff --git a/components/lib/portal/Portal.d.ts b/components/lib/portal/Portal.d.ts index 42cb9e9bb0..9d5c7434a4 100644 --- a/components/lib/portal/Portal.d.ts +++ b/components/lib/portal/Portal.d.ts @@ -1,7 +1,7 @@ import { VNode } from 'vue'; -import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, HintedString } from '../ts-helpers'; -type PortalAppendToType = 'body' | 'self' | string | undefined | HTMLElement; +type PortalAppendToType = HintedString<'body' | 'self'> | undefined | HTMLElement; export interface PortalProps { /** diff --git a/components/lib/splitbutton/SplitButton.d.ts b/components/lib/splitbutton/SplitButton.d.ts index 2e5fd43d29..8fe7c3467b 100755 --- a/components/lib/splitbutton/SplitButton.d.ts +++ b/components/lib/splitbutton/SplitButton.d.ts @@ -13,7 +13,7 @@ import { ButtonPassThroughOptions } from '../button'; import { MenuItem } from '../menuitem'; import { PassThroughOptions } from '../passthrough'; import { TieredMenuPassThroughOptions, TieredMenuRouterBindProps } from '../tieredmenu'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type SplitButtonPassThroughOptionType = SplitButtonPassThroughAttributes | ((options: SplitButtonPassThroughMethodOptions) => SplitButtonPassThroughAttributes | string) | string | null | undefined; @@ -141,7 +141,7 @@ export interface SplitButtonProps { * Special keywords are 'body' for document body and 'self' for the element itself. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * When present, it specifies that the element should be disabled. * @defaultValue false @@ -171,7 +171,7 @@ export interface SplitButtonProps { /** * Defines the style of the button. */ - severity?: 'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | 'contrast' | string | undefined; + severity?: HintedString<'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | 'contrast'> | undefined; /** * Add a shadow to indicate elevation. * @defaultValue false diff --git a/components/lib/styleclass/StyleClass.d.ts b/components/lib/styleclass/StyleClass.d.ts index ed2e4ca378..3fe455ca96 100644 --- a/components/lib/styleclass/StyleClass.d.ts +++ b/components/lib/styleclass/StyleClass.d.ts @@ -9,7 +9,7 @@ import { DirectiveBinding, ObjectDirective } from 'vue'; import { DirectiveHooks } from '../basedirective'; import { PassThroughOptions } from '../passthrough'; -import { PassThrough } from '../ts-helpers'; +import { PassThrough, HintedString } from '../ts-helpers'; /** * Defines options of StyleClass. @@ -18,7 +18,7 @@ export interface StyleClassOptions { /** * Selector to define the target element. Available selectors are '@next', '@prev', '@parent' and '@grandparent'. */ - selector?: '@next' | '@prev' | '@parent' | '@grandparent' | string | undefined; + selector?: HintedString<'@next' | '@prev' | '@parent' | '@grandparent'> | undefined; /** * Style class to add when item begins to get displayed. * @deprecated since v3.41.0. Use 'enterFromClass' option instead. diff --git a/components/lib/tag/Tag.d.ts b/components/lib/tag/Tag.d.ts index 78f4483283..a3575caafd 100644 --- a/components/lib/tag/Tag.d.ts +++ b/components/lib/tag/Tag.d.ts @@ -10,7 +10,7 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type TagPassThroughOptionType = TagPassThroughAttributes | ((options: TagPassThroughMethodOptions) => TagPassThroughAttributes | string) | string | null | undefined; @@ -82,7 +82,7 @@ export interface TagProps { /** * Severity type of the tag. */ - severity?: 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'contrast' | string | undefined; + severity?: HintedString<'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'contrast'> | undefined; /** * Whether the corners of the tag are rounded. * @defaultValue false diff --git a/components/lib/tieredmenu/TieredMenu.d.ts b/components/lib/tieredmenu/TieredMenu.d.ts index dc87800e8f..9878db7991 100755 --- a/components/lib/tieredmenu/TieredMenu.d.ts +++ b/components/lib/tieredmenu/TieredMenu.d.ts @@ -11,7 +11,7 @@ import { TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { MenuItem } from '../menuitem'; import { PassThroughOptions } from '../passthrough'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type TieredMenuPassThroughOptionType = TieredMenuPassThroughAttributes | ((options: TieredMenuPassThroughMethodOptions) => TieredMenuPassThroughAttributes | string) | string | null | undefined; @@ -230,7 +230,7 @@ export interface TieredMenuProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Whether to automatically manage layering. * @defaultValue true diff --git a/components/lib/tree/Tree.d.ts b/components/lib/tree/Tree.d.ts index e74cd087b8..ea9a390f36 100755 --- a/components/lib/tree/Tree.d.ts +++ b/components/lib/tree/Tree.d.ts @@ -11,7 +11,7 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { TreeNode } from '../treenode'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type TreePassThroughOptionType = TreePassThroughAttributes | ((options: TreePassThroughMethodOptions) => TreePassThroughAttributes | string) | string | null | undefined; @@ -279,7 +279,7 @@ export interface TreeProps { /** * Height of the scroll viewport in fixed units or the 'flex' keyword for a dynamic size. */ - scrollHeight?: 'flex' | string | undefined; + scrollHeight?: HintedString<'flex'> | undefined; /** * Defines a string value that labels an interactive element. */ diff --git a/components/lib/treeselect/TreeSelect.d.ts b/components/lib/treeselect/TreeSelect.d.ts index cdf66c25ce..d6039f5d12 100644 --- a/components/lib/treeselect/TreeSelect.d.ts +++ b/components/lib/treeselect/TreeSelect.d.ts @@ -12,7 +12,7 @@ import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { TreeExpandedKeys, TreePassThroughOptions } from '../tree'; import { TreeNode } from '../treenode'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type TreeSelectPassThroughOptionType = TreeSelectPassThroughAttributes | ((options: TreeSelectPassThroughMethodOptions) => TreeSelectPassThroughAttributes | string) | string | null | undefined; @@ -210,7 +210,7 @@ export interface TreeSelectProps { * A valid query selector or an HTMLElement to specify where the overlay gets attached. * @defaultValue body */ - appendTo?: 'body' | 'self' | string | undefined | HTMLElement; + appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; /** * Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. * @defaultValue No results found diff --git a/components/lib/treetable/TreeTable.d.ts b/components/lib/treetable/TreeTable.d.ts index bfba4f38cc..e968f77d7b 100755 --- a/components/lib/treetable/TreeTable.d.ts +++ b/components/lib/treetable/TreeTable.d.ts @@ -13,7 +13,7 @@ import { ColumnPassThroughOptionType } from '../column'; import { PaginatorPassThroughOptionType } from '../paginator'; import { PassThroughOptions } from '../passthrough'; import { TreeNode } from '../treenode'; -import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; +import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers'; export declare type TreeTablePassThroughOptionType = TreeTablePassThroughAttributes | ((options: TreeTablePassThroughMethodOptions) => TreeTablePassThroughAttributes | string) | string | null | undefined; @@ -76,7 +76,7 @@ export interface TreeTableFilterMetaData { /** * Filter match mode */ - matchMode: 'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter' | string | undefined; + matchMode: HintedString<'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter'> | undefined; } /** @@ -142,7 +142,7 @@ export interface TreeTableSortEvent { /** * Match modes per field */ - filterMatchModes: 'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter' | string | undefined; + filterMatchModes: HintedString<'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | 'between' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter'> | undefined; } /** @@ -585,7 +585,7 @@ export interface TreeTableProps { /** * Height of the scroll viewport in fixed pixels or the 'flex' keyword for a dynamic size. */ - scrollHeight?: 'flex' | string | undefined; + scrollHeight?: HintedString<'flex'> | undefined; /** * Orientation of the scrolling. * @defaultValue vertical diff --git a/components/lib/ts-helpers.d.ts b/components/lib/ts-helpers.d.ts index c1f5a31efe..6973f402dd 100644 --- a/components/lib/ts-helpers.d.ts +++ b/components/lib/ts-helpers.d.ts @@ -36,3 +36,5 @@ export declare type Nullable = T | null | undefined; export declare type PassThrough = T | object | undefined; export declare type DefaultPassThrough = T | ((instance?: VNode) => T | undefined) | undefined; + +export declare type HintedString = (string & {}) | T; \ No newline at end of file