diff --git a/src/Umbraco.Web.UI.Client/examples/sorter-with-nested-containers/sorter-group.ts b/src/Umbraco.Web.UI.Client/examples/sorter-with-nested-containers/sorter-group.ts index 4e1e37b39f..34fb05f6a4 100644 --- a/src/Umbraco.Web.UI.Client/examples/sorter-with-nested-containers/sorter-group.ts +++ b/src/Umbraco.Web.UI.Client/examples/sorter-with-nested-containers/sorter-group.ts @@ -11,18 +11,6 @@ export type ModelEntryType = { children?: ModelEntryType[]; }; -const SORTER_CONFIG: UmbSorterConfig = { - getUniqueOfElement: (element) => { - return element.name; - }, - getUniqueOfModel: (modelEntry) => { - return modelEntry.name; - }, - identifier: 'string-that-identifies-all-example-sorters', - itemSelector: 'example-sorter-item', - containerSelector: '.sorter-container', -}; - @customElement('example-sorter-group') export class ExampleSorterGroup extends UmbElementMixin(LitElement) { @property({ type: Array, attribute: false }) @@ -38,7 +26,15 @@ export class ExampleSorterGroup extends UmbElementMixin(LitElement) { private _items?: ModelEntryType[]; #sorter = new UmbSorterController(this, { - ...SORTER_CONFIG, + getUniqueOfElement: (element) => { + return element.name; + }, + getUniqueOfModel: (modelEntry) => { + return modelEntry.name; + }, + identifier: 'string-that-identifies-all-example-sorters', + itemSelector: 'example-sorter-item', + containerSelector: '.sorter-container', onChange: ({ model }) => { const oldValue = this._items; this._items = model; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts index f1db694ead..7009e4947a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/sorter/sorter.controller.ts @@ -60,7 +60,7 @@ function destroyPreventEvent(element: Element) { type INTERNAL_UmbSorterConfig = { getUniqueOfElement: (element: ElementType) => string | null | symbol | number; getUniqueOfModel: (modeEntry: T) => string | null | symbol | number; - identifier: string; + identifier: string | symbol; itemSelector: string; disabledItemSelector?: string; containerSelector: string; @@ -97,9 +97,9 @@ type INTERNAL_UmbSorterConfig = { // External type with some properties optional, as they have defaults: export type UmbSorterConfig = Omit< INTERNAL_UmbSorterConfig, - 'ignorerSelector' | 'containerSelector' + 'ignorerSelector' | 'containerSelector' | 'identifier' > & - Partial, 'ignorerSelector' | 'containerSelector'>>; + Partial, 'ignorerSelector' | 'containerSelector' | 'identifier'>>; /** * @export @@ -109,8 +109,6 @@ export type UmbSorterConfig = */ export class UmbSorterController implements UmbController { // - //static initiativeSorter?: UmbSorterController; - // A sorter that is requested to become the next sorter: static dropSorter?: UmbSorterController; @@ -151,6 +149,7 @@ export class UmbSorterController