From 10328ee252c79e419aeb3ccb241debb48efa8e9c Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 9 May 2023 11:48:27 +0200 Subject: [PATCH] accept default data in modal token --- .../libs/modal/token/modal-token.ts | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/libs/modal/token/modal-token.ts b/src/Umbraco.Web.UI.Client/libs/modal/token/modal-token.ts index 99510c47a8..057ffe5508 100644 --- a/src/Umbraco.Web.UI.Client/libs/modal/token/modal-token.ts +++ b/src/Umbraco.Web.UI.Client/libs/modal/token/modal-token.ts @@ -1,36 +1,38 @@ import { UmbModalConfig } from '../modal.context'; -export class UmbModalToken { +export class UmbModalToken { /** * Get the data type of the token's data. * * @public - * @type {Data} + * @type {ModalDataType} * @memberOf UmbModalToken * @example `typeof MyModal.TYPE` * @returns undefined */ - readonly DATA: Data = undefined as never; + readonly DATA: ModalDataType = undefined as never; /** * Get the result type of the token * * @public - * @type {Result} + * @type {ModalResultType} * @memberOf UmbModalToken * @example `typeof MyModal.RESULT` * @returns undefined */ - readonly RESULT: Result = undefined as never; + readonly RESULT: ModalResultType = undefined as never; /** * @param alias Unique identifier for the token, * @param defaultConfig Default configuration for the modal, - * @param _desc Description for the token, - * used only for debugging purposes, - * it should but does not need to be unique + * @param defaultData Default data for the modal, */ - constructor(protected alias: string, protected defaultConfig?: UmbModalConfig, protected _desc?: string) {} + constructor( + protected alias: string, + protected defaultConfig?: UmbModalConfig, + protected defaultData?: ModalDataType + ) {} /** * This method must always return the unique alias of the token since that @@ -45,4 +47,8 @@ export class UmbModalToken { public getDefaultConfig(): UmbModalConfig | undefined { return this.defaultConfig; } + + public getDefaultData(): ModalDataType | undefined { + return this.defaultData; + } }