From 0b7d9cad3e7727f29fa54d13dc340bae58b390aa Mon Sep 17 00:00:00 2001 From: Lukas Matta Date: Thu, 8 Feb 2024 22:13:25 +0100 Subject: [PATCH 01/13] Fix api-generator --- .../{build-apidoc.ts => build-apidoc.cjs} | 26 +++---- package.json | 2 +- src/app/showcase/doc/apidoc/index.json | 71 +++++++++++++------ 3 files changed, 66 insertions(+), 33 deletions(-) rename api-generator/{build-apidoc.ts => build-apidoc.cjs} (92%) diff --git a/api-generator/build-apidoc.ts b/api-generator/build-apidoc.cjs similarity index 92% rename from api-generator/build-apidoc.ts rename to api-generator/build-apidoc.cjs index 40af2695b7a..77d5bf6e740 100644 --- a/api-generator/build-apidoc.ts +++ b/api-generator/build-apidoc.cjs @@ -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 ed24dbe2932..6e66b9efd41 100755 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:package": "BROWSERSLIST_ENV=library ng build primeng-library && gulp build-assets", "build:check": "npm run format:check && npm run security:check", "security:check": "npm audit --production --audit-level high", - "apidoc": "node ./api-generator/build-apidoc.ts", + "apidoc": "node ./api-generator/build-apidoc.cjs", "vercel-build": "ng build" }, "repository": { diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 55e096e9ea3..1b4d0ecdcec 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -5415,7 +5415,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", @@ -8068,7 +8070,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "triggerEvent", @@ -9547,7 +9550,7 @@ "name": "placeholder", "optional": false, "readonly": false, - "type": "string", + "type": "Signal", "description": "Default text to display when no option is selected." }, { @@ -10019,6 +10022,16 @@ "name": "focus", "parameters": [], "description": "Applies focus." + }, + { + "name": "clear", + "parameters": [ + { + "name": "event", + "type": "Event" + } + ], + "description": "Clears the model." } ] } @@ -13547,7 +13560,8 @@ "name": "pattern", "optional": false, "readonly": false, - "type": "RegExp | KeyFilterPattern" + "type": "RegExp | KeyFilterPattern", + "description": "Sets the pattern for key filtering." } ] }, @@ -14404,7 +14418,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MegaMenuItem[]" + "type": "MegaMenuItem[]", + "description": "An array of menuitems." }, { "name": "style", @@ -14693,7 +14708,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "style", @@ -14843,7 +14859,8 @@ "name": "value", "optional": false, "readonly": false, - "type": null + "type": null, + "description": "An array of messages to display." }, { "name": "closable", @@ -15097,13 +15114,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", @@ -15117,7 +15136,6 @@ "optional": false, "readonly": false, "type": "string", - "default": "{0} items selected", "description": "Label to display after exceeding max selected labels e.g. ({0} items selected), defaults \"ellipsis\" keyword to indicate a text-overflow." }, { @@ -15370,13 +15388,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": "string" + "type": "Signal", + "description": "Label to display when there are no selections." }, { "name": "options", @@ -16043,13 +16064,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." } ] }, @@ -17508,7 +17531,8 @@ "name": "showPassword", "optional": false, "readonly": false, - "type": null + "type": null, + "description": "Sets the visibility of the password field." } ] } @@ -20210,7 +20234,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "menuWidth", @@ -21299,7 +21324,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", @@ -21326,7 +21353,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", @@ -23330,7 +23359,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "activeItem", @@ -23914,7 +23944,8 @@ "name": "model", "optional": false, "readonly": false, - "type": "MenuItem[]" + "type": "MenuItem[]", + "description": "An array of menuitems." }, { "name": "popup", From 0a1b65187cca4cd418ba552ca0b5ca665102a86f Mon Sep 17 00:00:00 2001 From: Lukas Matta Date: Wed, 28 Feb 2024 20:56:34 +0100 Subject: [PATCH 02/13] Rename build-apidoc to ts, regenerate docs --- .../{build-apidoc.cjs => build-apidoc.ts} | 0 package.json | 4 +-- src/app/showcase/doc/apidoc/index.json | 26 +++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) rename api-generator/{build-apidoc.cjs => build-apidoc.ts} (100%) diff --git a/api-generator/build-apidoc.cjs b/api-generator/build-apidoc.ts similarity index 100% rename from api-generator/build-apidoc.cjs rename to api-generator/build-apidoc.ts diff --git a/package.json b/package.json index 743d96bf30d..dc7457d326a 100755 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:package": "BROWSERSLIST_ENV=library ng build primeng-library && gulp build-assets", "build:check": "npm run format:check && npm run security:check", "security:check": "npm audit --production --audit-level high", - "apidoc": "node ./api-generator/build-apidoc.cjs", + "apidoc": "node ./api-generator/build-apidoc.ts", "vercel-build": "ng build" }, "repository": { @@ -89,4 +89,4 @@ "@docsearch/js": "^3.3.4", "esbuild": "^0.19.8" } -} \ No newline at end of file +} diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 4e862787ab6..49e329d2e99 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -4945,6 +4945,9 @@ } } }, + "buttongroup": { + "components": {} + }, "calendar": { "components": { "Calendar": { @@ -7199,11 +7202,11 @@ "description": "Maximum number of entries allowed." }, { - "name": "maxLength", - "optional": false, - "readonly": false, - "type": "number", - "description": "Maximum length of a chip." + "name": "maxLength", + "optional": false, + "readonly": false, + "type": "number", + "description": "Maximum length of a chip." }, { "name": "ariaLabel", @@ -9011,7 +9014,7 @@ "optional": false, "readonly": false, "type": "string", - "default": "-1", + "default": "0", "description": "Index of the close button in tabbing order." }, { @@ -11713,6 +11716,13 @@ } } }, + "floatlabel": { + "components": { + "FloatLabel": { + "description": "FloatLabel appears on top of the input field when focused." + } + } + }, "focustrap": { "components": { "FocusTrap": { @@ -13380,7 +13390,7 @@ "name": "value", "optional": false, "readonly": false, - "type": "string", + "type": "number", "description": "Input value." }, { @@ -27826,4 +27836,4 @@ } } } -} +} \ No newline at end of file From 3a06858b703480ecf129c8ab153f657ca3250029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:30:24 +0300 Subject: [PATCH 03/13] Fixed #15122 - Dropdown | Missing ariaLabel when in editable = true --- src/app/components/dropdown/dropdown.ts | 1 + 1 file changed, 1 insertion(+) 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)" From 622333363c485951521dbb75076cf20149242612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:01:25 +0300 Subject: [PATCH 04/13] Fixed #15084 - Listbox | Missing aria-label --- src/app/components/listbox/listbox.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 From 7efe9d9703f28da4e1a760debee275d3299c1a5e Mon Sep 17 00:00:00 2001 From: Roberto Orden Erena Date: Tue, 26 Mar 2024 08:10:49 +0100 Subject: [PATCH 05/13] Update calendar.ts Calendar by range showing the end date at first, else the start date --- src/app/components/calendar/calendar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From c6f18e398b449eed528905fe804ad996a5ab0a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:49:42 +0300 Subject: [PATCH 06/13] Fixed #15045 -SpeedDial | Add item template --- .../speeddial/speeddial.interface.ts | 14 ++++ src/app/components/speeddial/speeddial.ts | 74 +++++++++++-------- src/app/showcase/doc/apidoc/index.json | 72 ++++++++++++++++-- 3 files changed, 121 insertions(+), 39 deletions(-) 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/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 0f1dab08a35..24baddec558 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -1425,7 +1425,7 @@ } ], "returnType": "void", - "description": "Inserts new messages." + "description": "Insterts new messages." }, { "name": "clear", @@ -3120,6 +3120,12 @@ "optional": true, "readonly": false, "type": "string" + }, + { + "name": "browseFiles", + "optional": true, + "readonly": false, + "type": "string" } ] } @@ -5220,6 +5226,14 @@ "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": "showClear", "optional": false, @@ -10284,7 +10298,7 @@ "parameters": [ { "name": "componentType", - "type": "Type", + "type": "Type", "description": "Dynamic component for content template." }, { @@ -10293,7 +10307,7 @@ "description": "DynamicDialog object." } ], - "returnType": "DynamicDialogRef", + "returnType": "DynamicDialogRef", "description": "Displays the dialog using the dynamic dialog object options." }, { @@ -10301,7 +10315,7 @@ "parameters": [ { "name": "ref", - "type": "DynamicDialogRef" + "type": "DynamicDialogRef" } ], "returnType": "DynamicDialogComponent", @@ -10738,6 +10752,10 @@ { "name": "onMaximize", "description": "Event triggered on dialog is maximized." + }, + { + "name": "onChildComponentLoaded", + "description": "Event triggered on child component load." } ] } @@ -15855,7 +15873,7 @@ "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." }, { "name": "filterFields", @@ -17467,6 +17485,13 @@ "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": "showPageLinks", "optional": false, @@ -17487,7 +17512,7 @@ "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." }, { "name": "first", @@ -21310,6 +21335,17 @@ "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": "button", @@ -26485,6 +26521,28 @@ "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": "options", "optional": false, @@ -28512,4 +28570,4 @@ } } } -} +} \ No newline at end of file From eb731fa1c67e44cb03db2bf4580cd15e039c3182 Mon Sep 17 00:00:00 2001 From: Lukas Matta Date: Wed, 27 Mar 2024 13:44:24 +0100 Subject: [PATCH 07/13] fix typo --- src/app/components/api/messageservice.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From 52c76ba15534d0c419a4148613284050e2d32c7d Mon Sep 17 00:00:00 2001 From: Lukas Matta Date: Wed, 27 Mar 2024 13:46:53 +0100 Subject: [PATCH 08/13] Regenerate docs --- src/app/showcase/doc/apidoc/index.json | 75 +++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index df4f841b902..7ecee70bd1b 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -3120,6 +3120,18 @@ "optional": true, "readonly": false, "type": "string" + }, + { + "name": "browseFiles", + "optional": true, + "readonly": false, + "type": "string" + }, + { + "name": "maximizeLabel", + "optional": true, + "readonly": false, + "type": "string" } ] } @@ -5220,6 +5232,14 @@ "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": "showClear", "optional": false, @@ -10288,7 +10308,7 @@ "parameters": [ { "name": "componentType", - "type": "Type", + "type": "Type", "description": "Dynamic component for content template." }, { @@ -10297,7 +10317,7 @@ "description": "DynamicDialog object." } ], - "returnType": "DynamicDialogRef", + "returnType": "DynamicDialogRef", "description": "Displays the dialog using the dynamic dialog object options." }, { @@ -10305,7 +10325,7 @@ "parameters": [ { "name": "ref", - "type": "DynamicDialogRef" + "type": "DynamicDialogRef" } ], "returnType": "DynamicDialogComponent", @@ -10742,6 +10762,10 @@ { "name": "onMaximize", "description": "Event triggered on dialog is maximized." + }, + { + "name": "onChildComponentLoaded", + "description": "Event triggered on child component load." } ] } @@ -14083,6 +14107,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, @@ -15868,7 +15899,7 @@ "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." }, { "name": "filterFields", @@ -17482,6 +17513,13 @@ "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": "showPageLinks", "optional": false, @@ -17502,7 +17540,7 @@ "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." }, { "name": "first", @@ -24135,7 +24173,8 @@ "name": "activeItem", "optional": false, "readonly": false, - "type": "MenuItem" + "type": "MenuItem", + "description": "Defines the default active menuitem" }, { "name": "scrollable", @@ -26508,6 +26547,28 @@ "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": "options", "optional": false, @@ -28535,4 +28596,4 @@ } } } -} +} \ No newline at end of file From 95274939361e0e557e5b1fff556e1dac386113f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:02:26 +0300 Subject: [PATCH 09/13] =?UTF-8?q?Revert=20"Fixed=20#15158=20-=20TreeTable?= =?UTF-8?q?=20|=20Update=20selection=20logic=20and=20fix=20partial=20sel?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/treetable/treetable.ts | 38 ++++------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/src/app/components/treetable/treetable.ts b/src/app/components/treetable/treetable.ts index 9205cedba49..50f7049dbd3 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) { @@ -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({ From b146837e9ba8c39203cf39855a3d40085e8f9296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:29:18 +0300 Subject: [PATCH 10/13] Fixed #15178 - Use ObjectUtils for comparison --- src/app/components/treetable/treetable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/treetable/treetable.ts b/src/app/components/treetable/treetable.ts index 50f7049dbd3..b1aedf171f5 100755 --- a/src/app/components/treetable/treetable.ts +++ b/src/app/components/treetable/treetable.ts @@ -1849,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) { From aff4aa7dcaeb6642c1f3a6f9b5a2b4f93de9dc31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:16:44 +0300 Subject: [PATCH 11/13] Update explanation --- src/app/components/autocomplete/autocomplete.interface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: { From 2d0fbe8dd5dc7177a97869d333221da4c4b84280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:36:28 +0300 Subject: [PATCH 12/13] update table | filtermenudoc --- src/app/showcase/doc/table/filtermenudoc.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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] }}
From eacf3a2ed74ecc183f23d68f6fdee07291f2f187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:49:42 +0300 Subject: [PATCH 13/13] Fixed #15045 -SpeedDial | Add item template --- .../speeddial/speeddial.interface.ts | 14 ++++ src/app/components/speeddial/speeddial.ts | 74 +++++++++++-------- src/app/showcase/doc/apidoc/index.json | 65 ++++++++++++++-- 3 files changed, 114 insertions(+), 39 deletions(-) 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/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 7ecee70bd1b..9c1c8b3f701 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -1425,7 +1425,7 @@ } ], "returnType": "void", - "description": "Inserts new messages." + "description": "Insterts new messages." }, { "name": "clear", @@ -3126,12 +3126,6 @@ "optional": true, "readonly": false, "type": "string" - }, - { - "name": "maximizeLabel", - "optional": true, - "readonly": false, - "type": "string" } ] } @@ -5240,6 +5234,14 @@ "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, @@ -10309,6 +10311,7 @@ { "name": "componentType", "type": "Type", + "type": "Type", "description": "Dynamic component for content template." }, { @@ -10318,6 +10321,7 @@ } ], "returnType": "DynamicDialogRef", + "returnType": "DynamicDialogRef", "description": "Displays the dialog using the dynamic dialog object options." }, { @@ -10326,6 +10330,7 @@ { "name": "ref", "type": "DynamicDialogRef" + "type": "DynamicDialogRef" } ], "returnType": "DynamicDialogComponent", @@ -10763,6 +10768,10 @@ "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." @@ -15900,6 +15909,7 @@ "type": "boolean", "default": "false", "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", @@ -17520,6 +17530,13 @@ "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, @@ -17541,6 +17558,7 @@ "readonly": false, "type": "TemplateRef", "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", @@ -21365,6 +21383,17 @@ "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": "button", @@ -26569,6 +26598,28 @@ "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,