diff --git a/api-generator/build-apidoc.ts b/api-generator/build-apidoc.ts index 40af2695b7a..77d5bf6e740 100644 --- a/api-generator/build-apidoc.ts +++ b/api-generator/build-apidoc.ts @@ -46,6 +46,11 @@ async function main() { return text.replace(/{/g, '{').replace(/}/g, '}'); }; + const getDeprecatedText = (signature) => { + const deprecatedTag = signature?.comment?.getTag('@deprecated'); + return deprecatedTag ? parseText(deprecatedTag.content[0].text) : undefined; + }; + const modules = project.groups.find((g) => g.title === 'Modules'); if (isProcessable(modules)) { @@ -89,13 +94,10 @@ async function main() { readonly: prop.flags.isReadonly, type: prop.getSignature && prop.getSignature.type ? prop.getSignature.type.toString() : prop.type ? prop.type.toString() : null, default: prop.type && prop.type.name === 'boolean' && !prop.defaultValue ? 'false' : prop.defaultValue ? prop.defaultValue.replace(/^'|'$/g, '') : undefined, - description: prop.getSignature && prop.getSignature.comment ? prop.getSignature.comment.summary.map((s) => s.text || '').join(' ') : prop.comment && prop.comment.summary.map((s) => s.text || '').join(' '), - deprecated: - prop.getSignature && prop.getSignature.comment && prop.getSignature.comment.getTag('@deprecated') - ? parseText(prop.getSignature.comment.getTag('@deprecated').content[0].text) - : prop.comment && prop.comment.getTag('@deprecated') - ? parseText(prop.comment.getTag('@deprecated').content[0].text) - : undefined + description: ((prop.getSignature?.comment?.summary || prop.setSignature?.comment?.summary) || prop.comment?.summary)?.map((s) => s.text || '').join(' '), + deprecated: getDeprecatedText(prop.getSignature) + || getDeprecatedText(prop.setSignature) + || getDeprecatedText(prop) }); }); doc[name]['components'][componentName]['props'] = props; @@ -113,7 +115,7 @@ async function main() { name: emitter.name, parameters: [{ name: extractParameter(emitter) && extractParameter(emitter).includes('Event') ? 'event' : 'value', type: extractParameter(emitter) }], description: emitter.comment && emitter.comment.summary.map((s) => s.text || '').join(' '), - deprecated: emitter.comment && emitter.comment.getTag('@deprecated') ? parseText(emitter.comment.getTag('@deprecated').content[0].text) : undefined + deprecated: getDeprecatedText(emitter) }); }); @@ -164,7 +166,7 @@ async function main() { readonly: child.flags.isReadonly, type: child.type && child.type.toString(), description: child.comment && child.comment.summary.map((s) => s.text || '').join(' '), - deprecated: child.comment && child.comment.getTag('@deprecated') ? parseText(child.comment.getTag('@deprecated').content[0].text) : undefined + deprecated: getDeprecatedText(child) })) }); }); @@ -192,7 +194,7 @@ async function main() { readonly: child.flags.isReadonly, type: child.type && child.type.toString(), description: child.comment && child.comment.summary.map((s) => s.text || '').join(' '), - deprecated: child.comment && child.comment.getTag('@deprecated') ? parseText(child.comment.getTag('@deprecated').content[0].text) : undefined + deprecated: getDeprecatedText(child) })) }); }); @@ -243,7 +245,7 @@ async function main() { }; }), description: signature.comment && signature.comment.summary.map((s) => s.text || '').join(' '), - deprecated: signature.comment && signature.comment.getTag('@deprecated') ? parseText(signature.comment.getTag('@deprecated').content[0].text) : undefined + deprecated: getDeprecatedText(signature) }); }); }); @@ -269,7 +271,7 @@ async function main() { readonly: child.flags.isReadonly, type: child.type ? child.type.toString() : extractParameter(int), description: child.comment && child.comment.summary.map((s) => s.text || '').join(' '), - deprecated: child.comment && child.comment.getTag('@deprecated') ? parseText(child.comment.getTag('@deprecated').content[0].text) : undefined + deprecated: getDeprecatedText(child) })) }); }); diff --git a/package.json b/package.json index 925204f1fcc..dd3e3603e70 100755 --- a/package.json +++ b/package.json @@ -89,4 +89,4 @@ "@docsearch/js": "^3.3.4", "esbuild": "^0.19.8" } -} \ No newline at end of file +} diff --git a/src/app/components/api/messageservice.ts b/src/app/components/api/messageservice.ts index ae31e297884..edc18547c21 100755 --- a/src/app/components/api/messageservice.ts +++ b/src/app/components/api/messageservice.ts @@ -23,7 +23,7 @@ export class MessageService { } } /** - * Insterts new messages. + * Inserts new messages. * @param {Message[]} messages - Messages to be added. * @group Method */ diff --git a/src/app/components/autocomplete/autocomplete.interface.ts b/src/app/components/autocomplete/autocomplete.interface.ts index b38cf56552d..1a5913f4f60 100644 --- a/src/app/components/autocomplete/autocomplete.interface.ts +++ b/src/app/components/autocomplete/autocomplete.interface.ts @@ -107,7 +107,7 @@ export interface AutoCompleteTemplates { $implicit: any | any[]; }): TemplateRef<{ $implicit: any | any[] }>; /** - * Custom selected item template. + * Custom selected item template, only supported in multiple mode. * @param {Object} context - selected item data. */ selectedItem(context: { diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index e52f3574020..b13f6e88c85 100644 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -2803,7 +2803,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { updateUI() { let propValue = this.value; if (Array.isArray(propValue)) { - propValue = propValue[0]; + propValue = propValue.length === 2 ? propValue[1] : propValue[0]; } let val = this.defaultDate && this.isValidDate(this.defaultDate) && !this.value ? this.defaultDate : propValue && this.isValidDate(propValue) ? propValue : new Date(); diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 18f91e8eaf6..07ab3649e31 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -164,6 +164,7 @@ export class DropdownItem { [disabled]="disabled" aria-haspopup="listbox" [attr.placeholder]="modelValue() === undefined || modelValue() === null ? placeholder() : undefined" + [attr.aria-label]="ariaLabel || (label() === 'p-emptylabel' ? undefined : label())" (input)="onEditableInput($event)" (keydown)="onKeyDown($event)" (focus)="onInputFocus($event)" diff --git a/src/app/components/listbox/listbox.ts b/src/app/components/listbox/listbox.ts index 6fa43eef625..5d5d6b15654 100755 --- a/src/app/components/listbox/listbox.ts +++ b/src/app/components/listbox/listbox.ts @@ -273,6 +273,11 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor, * @group Props */ @Input() autoOptionFocus: boolean | undefined = true; + /** + * Defines a string that labels the input for accessibility. + * @group Props + */ + @Input() ariaLabel: string | undefined; /** * When enabled, the focused option is selected. * @group Props diff --git a/src/app/components/speeddial/speeddial.interface.ts b/src/app/components/speeddial/speeddial.interface.ts index 47874a7a79d..082a36dc97c 100644 --- a/src/app/components/speeddial/speeddial.interface.ts +++ b/src/app/components/speeddial/speeddial.interface.ts @@ -1,10 +1,24 @@ import { TemplateRef } from '@angular/core'; +import { MenuItem } from '../api/menuitem'; /** * Defines valid templates in SpeedDial. * @group Templates */ export interface SpeedDialTemplates { + /** + * Custom template of item. + */ + item(context: { + /** + * Data of the item. + */ + $implicit: MenuItem[]; + /** + * Index of the item. + */ + index: number; + }): TemplateRef<{ $implicit: MenuItem[]; index: number }>; /** * Custom template of button. */ diff --git a/src/app/components/speeddial/speeddial.ts b/src/app/components/speeddial/speeddial.ts index 45ccd671c56..7306f7d04a3 100644 --- a/src/app/components/speeddial/speeddial.ts +++ b/src/app/components/speeddial/speeddial.ts @@ -85,48 +85,53 @@ import { asapScheduler } from 'rxjs'; role="menuitem" [attr.data-pc-section]="'menuitem'" > - - - - + + + + - + + + + + + @@ -296,6 +301,8 @@ export class SpeedDial implements AfterViewInit, AfterContentInit, OnDestroy { buttonTemplate: TemplateRef | undefined; + itemTemplate: TemplateRef | undefined; + isItemClicked: boolean = false; _visible: boolean = false; @@ -338,6 +345,9 @@ export class SpeedDial implements AfterViewInit, AfterContentInit, OnDestroy { case 'button': this.buttonTemplate = item.template; break; + case 'item': + this.itemTemplate = item.template; + break; } }); } diff --git a/src/app/components/treetable/treetable.ts b/src/app/components/treetable/treetable.ts index 9205cedba49..b1aedf171f5 100755 --- a/src/app/components/treetable/treetable.ts +++ b/src/app/components/treetable/treetable.ts @@ -1813,35 +1813,19 @@ export class TreeTable implements AfterContentInit, OnInit, OnDestroy, Blockable } } - isSelected(node: TreeTableNode): boolean { + isSelected(node: TreeTableNode) { if (node && this.selection) { if (this.dataKey) { return this.selectionKeys[ObjectUtils.resolveFieldData(node.data, this.dataKey)] !== undefined; } else { - if (Array.isArray(this.selection)) { - return this.allChildrenOrNodeSelected(node); - } else { - return this.equals(node, this.selection); - } + if (Array.isArray(this.selection)) return this.findIndexInSelection(node) > -1; + else return this.equals(node, this.selection); } } return false; } - allChildrenOrNodeSelected(node: TreeTableNode): boolean { - if (this.findIndexInSelection(node) == -1 && node.parent) { - if (this.findIndexInSelection(node.parent) !== -1) { - return true; - } - } - if (!node.children) { - return this.selection.some((selectedItem) => this.equals(node, selectedItem)); - } else { - return node.children.every((child) => this.isSelected(child)) || this.selection.some((selectedItem) => this.equals(node, selectedItem)); - } - } - findIndexInSelection(node: any) { let index: number = -1; if (this.selection && this.selection.length) { @@ -1865,7 +1849,7 @@ export class TreeTable implements AfterContentInit, OnInit, OnDestroy, Blockable } equals(node1: TreeTableNode, node2: TreeTableNode) { - return this.compareSelectionBy === 'equals' ? node1 === node2 : ObjectUtils.equals(node1.data, node2.data, this.dataKey); + return this.compareSelectionBy === 'equals' ? ObjectUtils.equals(node1, node2) : ObjectUtils.equals(node1.data, node2.data, this.dataKey); } filter(value: string | string[], field: string, matchMode: string) { @@ -2949,13 +2933,13 @@ export class TTContextMenuRow {
-
+
- + - +
@@ -2988,16 +2972,6 @@ export class TTCheckbox { this.checked = this.tt.isSelected(this.rowNode.node); } - isPartialSelected() { - const node = this.rowNode.node; - if (node['partialSelected']) { - return !this.checked && node['partialSelected']; - } - if (node['partialSelected'] == undefined && node.children && node.children.length > 0) { - return !this.checked && node.children.some((child) => this.tt.isSelected(child)); - } - } - onClick(event: Event) { if (!this.disabled) { this.tt.toggleNodeWithCheckbox({ diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 0f1dab08a35..3c0617386e2 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -1425,7 +1425,8 @@ } ], "returnType": "void", - "description": "Inserts new messages." + "description": "Insterts new messages." + "description": "Insterts new messages." }, { "name": "clear", @@ -3120,6 +3121,18 @@ "optional": true, "readonly": false, "type": "string" + }, + { + "name": "browseFiles", + "optional": true, + "readonly": false, + "type": "string" + }, + { + "name": "browseFiles", + "optional": true, + "readonly": false, + "type": "string" } ] } @@ -5220,6 +5233,22 @@ "default": "false", "description": "When enabled, calendar will show week numbers." }, + { + "name": "startWeekFromFirstDayOfYear", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "When enabled, calendar will start week numbers from first day of the year." + }, + { + "name": "startWeekFromFirstDayOfYear", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "When enabled, calendar will start week numbers from first day of the year." + }, { "name": "showClear", "optional": false, @@ -5436,7 +5465,9 @@ "name": "locale", "optional": false, "readonly": false, - "type": "LocaleSettings" + "type": "LocaleSettings", + "description": "Option to set calendar locale.", + "deprecated": "Locale property has no effect, use new i18n API instead." }, { "name": "view", @@ -8113,7 +8144,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "triggerEvent", @@ -9592,7 +9624,8 @@ "name": "placeholder", "optional": false, "readonly": false, - "type": "Signal" + "type": "Signal", + "description": "Default text to display when no option is selected." }, { "name": "filterPlaceholder", @@ -10284,7 +10317,8 @@ "parameters": [ { "name": "componentType", - "type": "Type", + "type": "Type", + "type": "Type", "description": "Dynamic component for content template." }, { @@ -10293,7 +10327,8 @@ "description": "DynamicDialog object." } ], - "returnType": "DynamicDialogRef", + "returnType": "DynamicDialogRef", + "returnType": "DynamicDialogRef", "description": "Displays the dialog using the dynamic dialog object options." }, { @@ -10301,7 +10336,8 @@ "parameters": [ { "name": "ref", - "type": "DynamicDialogRef" + "type": "DynamicDialogRef" + "type": "DynamicDialogRef" } ], "returnType": "DynamicDialogComponent", @@ -10738,6 +10774,14 @@ { "name": "onMaximize", "description": "Event triggered on dialog is maximized." + }, + { + "name": "onChildComponentLoaded", + "description": "Event triggered on child component load." + }, + { + "name": "onChildComponentLoaded", + "description": "Event triggered on child component load." } ] } @@ -13844,7 +13888,8 @@ "name": "pattern", "optional": false, "readonly": false, - "type": "RegExp | KeyFilterPattern" + "type": "RegExp | KeyFilterPattern", + "description": "Sets the pattern for key filtering." } ] }, @@ -14078,6 +14123,13 @@ "default": "true", "description": "Whether to focus on the first visible or selected element when the overlay panel is shown." }, + { + "name": "ariaLabel", + "optional": false, + "readonly": false, + "type": "string", + "description": "Defines a string that labels the input for accessibility." + }, { "name": "selectOnFocus", "optional": false, @@ -14701,7 +14753,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MegaMenuItem[]" + "type": "MegaMenuItem[]", + "description": "An array of menuitems." }, { "name": "style", @@ -14990,7 +15043,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "style", @@ -15140,7 +15194,8 @@ "name": "value", "optional": false, "readonly": false, - "type": null + "type": null, + "description": "An array of messages to display." }, { "name": "closable", @@ -15540,13 +15595,15 @@ "name": "displaySelectedLabel", "optional": false, "readonly": false, - "type": "boolean" + "type": "boolean", + "description": "Whether to show labels of selected item labels or use default label." }, { "name": "maxSelectedLabels", "optional": false, "readonly": false, - "type": "number" + "type": "number", + "description": "Decides how many selected item labels to show at most." }, { "name": "selectionLimit", @@ -15812,13 +15869,16 @@ "name": "defaultLabel", "optional": false, "readonly": false, - "type": "string" + "type": "string", + "description": "Label to display when there are no selections.", + "deprecated": "Use placeholder instead." }, { "name": "placeholder", "optional": false, "readonly": false, - "type": "Signal" + "type": "Signal", + "description": "Label to display when there are no selections." }, { "name": "options", @@ -15855,7 +15915,8 @@ "readonly": false, "type": "boolean", "default": "false", - "description": "Fields used when filtering the options, defaults to optionLabel." + "description": "Indicates whether to focus on options when hovering over them, defaults to optionLabel." + "description": "Indicates whether to focus on options when hovering over them, defaults to optionLabel." }, { "name": "filterFields", @@ -16485,13 +16546,15 @@ "name": "selection", "optional": false, "readonly": false, - "type": "any[]" + "type": "any[]", + "description": "A list of values that are currently selected." }, { "name": "value", "optional": false, "readonly": false, - "type": "any[]" + "type": "any[]", + "description": "Array of values to be displayed in the component.\nIt represents the data source for the list of items." } ] }, @@ -17467,6 +17530,20 @@ "default": "false", "description": "Whether to display a input to navigate to any page." }, + { + "name": "jumpToPageItemTemplate", + "optional": false, + "readonly": false, + "type": "TemplateRef", + "description": "Template instance to inject into the jump to page dropdown item inside in the paginator." + }, + { + "name": "jumpToPageItemTemplate", + "optional": false, + "readonly": false, + "type": "TemplateRef", + "description": "Template instance to inject into the jump to page dropdown item inside in the paginator." + }, { "name": "showPageLinks", "optional": false, @@ -17487,7 +17564,8 @@ "optional": false, "readonly": false, "type": "TemplateRef", - "description": "Template instance to inject into the dropdown item inside in the paginator." + "description": "Template instance to inject into the rows per page dropdown item inside in the paginator." + "description": "Template instance to inject into the rows per page dropdown item inside in the paginator." }, { "name": "first", @@ -17950,7 +18028,8 @@ "name": "showPassword", "optional": false, "readonly": false, - "type": null + "type": null, + "description": "Sets the visibility of the password field." } ] } @@ -20659,7 +20738,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "menuWidth", @@ -21310,6 +21390,28 @@ "templates": { "description": "Defines the templates used by the component.", "values": [ + { + "parent": "speeddial", + "name": "item", + "parameters": [ + { + "name": "context", + "type": "{\n \t $implicit: MenuItem, // Data of the item.\n \t index: number, // Index of the item.\n }" + } + ], + "description": "Custom template of item." + }, + { + "parent": "speeddial", + "name": "item", + "parameters": [ + { + "name": "context", + "type": "{\n \t $implicit: MenuItem, // Data of the item.\n \t index: number, // Index of the item.\n }" + } + ], + "description": "Custom template of item." + }, { "parent": "speeddial", "name": "button", @@ -22069,7 +22171,9 @@ "name": "enterClass", "optional": false, "readonly": false, - "type": "string" + "type": "string", + "description": "Style class to add when item begins to get displayed.", + "deprecated": "Use enterFromClass instead" }, { "name": "enterFromClass", @@ -22096,7 +22200,9 @@ "name": "leaveClass", "optional": false, "readonly": false, - "type": "string" + "type": "string", + "description": "Style class to add when item begins to get hidden.", + "deprecated": "Use leaveFromClass instead" }, { "name": "leaveFromClass", @@ -24107,13 +24213,15 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "activeItem", "optional": false, "readonly": false, - "type": "MenuItem" + "type": "MenuItem", + "description": "Defines the default active menuitem" }, { "name": "scrollable", @@ -24690,7 +24798,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "popup", @@ -26485,6 +26594,50 @@ "default": "true", "description": "Clears the filter value when hiding the dropdown." }, + { + "name": "virtualScroll", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Whether the data should be loaded on demand during scroll." + }, + { + "name": "virtualScrollItemSize", + "optional": false, + "readonly": false, + "type": "number", + "description": "Height of an item in the list for VirtualScrolling." + }, + { + "name": "virtualScrollOptions", + "optional": false, + "readonly": false, + "type": "ScrollerOptions", + "description": "Whether to use the scroller feature. The properties of scroller component can be used like an object in it." + }, + { + "name": "virtualScroll", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Whether the data should be loaded on demand during scroll." + }, + { + "name": "virtualScrollItemSize", + "optional": false, + "readonly": false, + "type": "number", + "description": "Height of an item in the list for VirtualScrolling." + }, + { + "name": "virtualScrollOptions", + "optional": false, + "readonly": false, + "type": "ScrollerOptions", + "description": "Whether to use the scroller feature. The properties of scroller component can be used like an object in it." + }, { "name": "options", "optional": false, @@ -28512,4 +28665,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/app/showcase/doc/table/filtermenudoc.ts b/src/app/showcase/doc/table/filtermenudoc.ts index 93f18fbe0f1..e027dc53da7 100644 --- a/src/app/showcase/doc/table/filtermenudoc.ts +++ b/src/app/showcase/doc/table/filtermenudoc.ts @@ -98,11 +98,11 @@ import { CustomerService } from '../../service/customerservice';
Activity - - + +
- {{ activityValues[0] }} - {{ activityValues[1] }} + 0 + {{ value[0] }} - {{ value[1] }}