@umbraco-cms/backoffice 1.0.0-next.6c429eee → 1.0.0-next.70bfba05

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/modal.d.ts CHANGED
@@ -1,24 +1,23 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable } from 'rxjs';
3
- import * as lit_html from 'lit-html';
4
3
  import * as lit from 'lit';
5
4
  import { LitElement, TemplateResult } from 'lit';
5
+ import * as lit_html from 'lit-html';
6
6
  import { UUIModalDialogElement, UUIModalSidebarElement, UUIModalSidebarSize } from '@umbraco-ui/uui';
7
- import { UmbControllerHostElement, UmbControllerInterface } from './controller';
8
- import { UmbContextToken } from './context-api';
9
- import { Params } from './router';
10
- import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbPickerModalData as UmbPickerModalData$1 } from './modal';
11
- import { LanguageResponseModel, FolderReponseModel } from './backend-api';
12
- import { UserDetails } from './models';
7
+ import { UmbControllerHostElement, UmbControllerInterface } from '@umbraco-cms/backoffice/controller-api';
8
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
9
+ import { Params } from '@umbraco-cms/backoffice/router';
10
+ import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbTreePickerModalData as UmbTreePickerModalData$1, UmbPickerModalResult as UmbPickerModalResult$1, UmbPickerModalData as UmbPickerModalData$1 } from '@umbraco-cms/backoffice/modal';
11
+ import { DocumentTreeItemResponseModel, EntityTreeItemResponseModel, LanguageResponseModel, ContentTreeItemResponseModel, UserResponseModel, FolderReponseModel, FolderTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
13
12
 
14
13
  declare class UmbSearchModalElement extends LitElement {
15
14
  #private;
16
- static styles: lit.CSSResult[];
17
15
  private _input;
18
16
  private _search;
19
17
  private _groups;
20
18
  connectedCallback(): void;
21
19
  render(): lit_html.TemplateResult<1>;
20
+ static styles: lit.CSSResult[];
22
21
  }
23
22
 
24
23
  declare global {
@@ -27,38 +26,36 @@ declare global {
27
26
  }
28
27
  }
29
28
 
30
- declare class UmbModalToken<Data extends object = object, Result = unknown> {
29
+ declare class UmbModalToken<ModalDataType extends object = object, ModalResultType = unknown> {
31
30
  protected alias: string;
32
31
  protected defaultConfig?: UmbModalConfig | undefined;
33
- protected _desc?: string | undefined;
32
+ protected defaultData?: ModalDataType | undefined;
34
33
  /**
35
34
  * Get the data type of the token's data.
36
35
  *
37
36
  * @public
38
- * @type {Data}
37
+ * @type {ModalDataType}
39
38
  * @memberOf UmbModalToken
40
39
  * @example `typeof MyModal.TYPE`
41
40
  * @returns undefined
42
41
  */
43
- readonly DATA: Data;
42
+ readonly DATA: ModalDataType;
44
43
  /**
45
44
  * Get the result type of the token
46
45
  *
47
46
  * @public
48
- * @type {Result}
47
+ * @type {ModalResultType}
49
48
  * @memberOf UmbModalToken
50
49
  * @example `typeof MyModal.RESULT`
51
50
  * @returns undefined
52
51
  */
53
- readonly RESULT: Result;
52
+ readonly RESULT: ModalResultType;
54
53
  /**
55
54
  * @param alias Unique identifier for the token,
56
55
  * @param defaultConfig Default configuration for the modal,
57
- * @param _desc Description for the token,
58
- * used only for debugging purposes,
59
- * it should but does not need to be unique
56
+ * @param defaultData Default data for the modal,
60
57
  */
61
- constructor(alias: string, defaultConfig?: UmbModalConfig | undefined, _desc?: string | undefined);
58
+ constructor(alias: string, defaultConfig?: UmbModalConfig | undefined, defaultData?: ModalDataType | undefined);
62
59
  /**
63
60
  * This method must always return the unique alias of the token since that
64
61
  * will be used to look up the token in the injector.
@@ -67,6 +64,7 @@ declare class UmbModalToken<Data extends object = object, Result = unknown> {
67
64
  */
68
65
  toString(): string;
69
66
  getDefaultConfig(): UmbModalConfig | undefined;
67
+ getDefaultData(): ModalDataType | undefined;
70
68
  }
71
69
 
72
70
  /**
@@ -208,23 +206,13 @@ interface UmbContextDebuggerModalData {
208
206
  }
209
207
  declare const UMB_CONTEXT_DEBUGGER_MODAL: UmbModalToken$1<UmbContextDebuggerModalData, unknown>;
210
208
 
211
- interface UmbDocumentPickerModalData {
212
- multiple?: boolean;
213
- selection?: Array<string>;
214
- }
215
- interface UmbDocumentPickerModalResult {
216
- selection: Array<string>;
217
- }
218
- declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbDocumentPickerModalResult>;
209
+ type UmbDocumentPickerModalData = UmbTreePickerModalData$1<DocumentTreeItemResponseModel>;
210
+ type UmbDocumentPickerModalResult = UmbPickerModalResult$1;
211
+ declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbPickerModalResult$1>;
219
212
 
220
- interface UmbDocumentTypePickerModalData {
221
- multiple?: boolean;
222
- selection?: Array<string>;
223
- }
224
- interface UmbDocumentTypePickerModalResult {
225
- selection: Array<string>;
226
- }
227
- declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult>;
213
+ type UmbDocumentTypePickerModalData = UmbTreePickerModalData$1<EntityTreeItemResponseModel>;
214
+ type UmbDocumentTypePickerModalResult = UmbPickerModalResult$1;
215
+ declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbPickerModalResult$1>;
228
216
 
229
217
  declare enum OEmbedStatus {
230
218
  NotSupported = 0,
@@ -267,8 +255,8 @@ interface UmbExportDictionaryModalResult {
267
255
  declare const UMB_EXPORT_DICTIONARY_MODAL: UmbModalToken$1<UmbExportDictionaryModalData, UmbExportDictionaryModalResult>;
268
256
 
269
257
  interface UmbIconPickerModalData {
270
- multiple: boolean;
271
- selection: string[];
258
+ color: string | undefined;
259
+ icon: string | undefined;
272
260
  }
273
261
  interface UmbIconPickerModalResult {
274
262
  color: string | undefined;
@@ -289,11 +277,11 @@ declare const UMB_INVITE_USER_MODAL: UmbModalToken$1<object, unknown>;
289
277
 
290
278
  interface UmbLanguagePickerModalData {
291
279
  multiple?: boolean;
292
- selection?: Array<string>;
280
+ selection?: Array<string | null>;
293
281
  filter?: (language: LanguageResponseModel) => boolean;
294
282
  }
295
283
  interface UmbLanguagePickerModalResult {
296
- selection: Array<string>;
284
+ selection: Array<string | null>;
297
285
  }
298
286
  declare const UMB_LANGUAGE_PICKER_MODAL: UmbModalToken$1<UmbLanguagePickerModalData, UmbLanguagePickerModalResult>;
299
287
 
@@ -323,14 +311,9 @@ interface UmbLinkPickerConfig {
323
311
  }
324
312
  declare const UMB_LINK_PICKER_MODAL: UmbModalToken$1<UmbLinkPickerModalData, UmbLinkPickerModalResult>;
325
313
 
326
- interface UmbMediaPickerModalData {
327
- multiple?: boolean;
328
- selection: Array<string>;
329
- }
330
- interface UmbMediaPickerModalResult {
331
- selection: Array<string>;
332
- }
333
- declare const UMB_MEDIA_PICKER_MODAL: UmbModalToken$1<UmbMediaPickerModalData, UmbMediaPickerModalResult>;
314
+ type UmbMediaTreePickerModalData = UmbTreePickerModalData$1<ContentTreeItemResponseModel>;
315
+ type UmbMediaTreePickerModalResult = UmbPickerModalResult$1;
316
+ declare const UMB_MEDIA_TREE_PICKER_MODAL: UmbModalToken$1<UmbMediaTreePickerModalData, UmbPickerModalResult$1>;
334
317
 
335
318
  interface UmbPropertyEditorUIPickerModalData {
336
319
  selection?: Array<string>;
@@ -360,9 +343,12 @@ declare const UMB_SEARCH_MODAL: UmbModalToken$1<object, unknown>;
360
343
 
361
344
  interface UmbSectionPickerModalData {
362
345
  multiple: boolean;
363
- selection: string[];
346
+ selection: Array<string | null>;
364
347
  }
365
- declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, unknown>;
348
+ interface UmbSectionPickerModalResult {
349
+ selection: Array<string | null>;
350
+ }
351
+ declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, UmbSectionPickerModalResult>;
366
352
 
367
353
  interface UmbTemplateModalData {
368
354
  id: string;
@@ -373,18 +359,17 @@ interface UmbTemplateModalResult {
373
359
  }
374
360
  declare const UMB_TEMPLATE_MODAL: UmbModalToken$1<UmbTemplateModalData, UmbTemplateModalResult>;
375
361
 
376
- interface UmbTemplatePickerModalData {
377
- multiple: boolean;
378
- selection: string[];
379
- }
380
- interface UmbTemplatePickerModalResult {
381
- selection: string[] | undefined;
382
- }
383
- declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbTemplatePickerModalResult>;
362
+ type UmbTemplatePickerModalData = UmbTreePickerModalData$1<EntityTreeItemResponseModel>;
363
+ type UmbTemplatePickerModalResult = UmbPickerModalResult$1;
364
+ declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbPickerModalResult$1>;
384
365
 
385
- declare const UMB_USER_GROUP_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
366
+ declare const UMB_USER_GROUP_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<any>, unknown>;
386
367
 
387
- declare const UMB_USER_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
368
+ type UmbUserPickerModalData = UmbPickerModalData$1<UserResponseModel>;
369
+ interface UmbUserPickerModalResult {
370
+ selection: Array<string | null>;
371
+ }
372
+ declare const UMB_USER_PICKER_MODAL: UmbModalToken$1<UmbUserPickerModalData, UmbUserPickerModalResult>;
388
373
 
389
374
  interface UmbFolderModalData {
390
375
  repositoryAlias: string;
@@ -395,13 +380,41 @@ interface UmbFolderModalResult {
395
380
  }
396
381
  declare const UMB_FOLDER_MODAL: UmbModalToken$1<UmbFolderModalData, UmbFolderModalResult>;
397
382
 
398
- interface UmbPickerModalData<T> {
383
+ interface UmbPartialViewPickerModalData {
399
384
  multiple: boolean;
400
- selection: Array<string>;
401
- filter?: (language: T) => boolean;
385
+ selection: string[];
402
386
  }
403
- interface UmbPickerModalResult<T> {
404
- selection: Array<string>;
387
+ interface UmbPartialViewPickerModalResult {
388
+ selection: Array<string | null> | undefined;
389
+ }
390
+ declare const UMB_PARTIAL_VIEW_PICKER_MODAL_ALIAS = "Umb.Modal.PartialViewPicker";
391
+ declare const UMB_PARTIAL_VIEW_PICKER_MODAL: UmbModalToken$1<UmbPartialViewPickerModalData, UmbPartialViewPickerModalResult>;
392
+
393
+ interface UmbDictionaryItemPickerModalData {
394
+ multiple: boolean;
395
+ selection: string[];
396
+ }
397
+ interface UmbDictionaryItemPickerModalResult {
398
+ selection: Array<string | null>;
399
+ }
400
+ declare const UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS = "Umb.Modal.DictionaryItemPicker";
401
+ declare const UMB_DICTIONARY_ITEM_PICKER_MODAL: UmbModalToken$1<UmbDictionaryItemPickerModalData, UmbDictionaryItemPickerModalResult>;
402
+
403
+ type UmbDataTypePickerModalData = UmbTreePickerModalData$1<FolderTreeItemResponseModel>;
404
+ type UmbDataTypePickerModalResult = UmbPickerModalResult$1;
405
+ declare const UMB_DATA_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDataTypePickerModalData, UmbPickerModalResult$1>;
406
+
407
+ interface UmbPickerModalData<ItemType> {
408
+ multiple?: boolean;
409
+ selection?: Array<string | null>;
410
+ filter?: (item: ItemType) => boolean;
411
+ pickableFilter?: (item: ItemType) => boolean;
412
+ }
413
+ interface UmbPickerModalResult {
414
+ selection: Array<string | null>;
415
+ }
416
+ interface UmbTreePickerModalData<TreeItemType> extends UmbPickerModalData<TreeItemType> {
417
+ treeAlias?: string;
405
418
  }
406
419
 
407
- export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DOCUMENT_PICKER_MODAL, UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_FOLDER_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_TEMPLATE_MODAL, UMB_TEMPLATE_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbFolderModalData, UmbFolderModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaPickerModalData, UmbMediaPickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData, UmbTemplateModalData, UmbTemplateModalResult, UmbTemplatePickerModalData, UmbTemplatePickerModalResult };
420
+ export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DATA_TYPE_PICKER_MODAL, UMB_DICTIONARY_ITEM_PICKER_MODAL, UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS, UMB_DOCUMENT_PICKER_MODAL, UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_FOLDER_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_TREE_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PARTIAL_VIEW_PICKER_MODAL, UMB_PARTIAL_VIEW_PICKER_MODAL_ALIAS, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_TEMPLATE_MODAL, UMB_TEMPLATE_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDataTypePickerModalData, UmbDataTypePickerModalResult, UmbDictionaryItemPickerModalData, UmbDictionaryItemPickerModalResult, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbFolderModalData, UmbFolderModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaTreePickerModalData, UmbMediaTreePickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPartialViewPickerModalData, UmbPartialViewPickerModalResult, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData, UmbSectionPickerModalResult, UmbTemplateModalData, UmbTemplateModalResult, UmbTemplatePickerModalData, UmbTemplatePickerModalResult, UmbTreePickerModalData, UmbUserPickerModalData, UmbUserPickerModalResult };
package/models.d.ts CHANGED
@@ -1,80 +1,17 @@
1
- import { EntityTreeItemResponseModel, FolderTreeItemResponseModel, PackageManifestResponseModel } from './backend-api';
2
-
3
- type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
4
- type ClassConstructor<T> = new (...args: any[]) => T;
5
- interface Entity {
6
- id: string;
7
- name: string;
8
- icon: string;
9
- type: string;
10
- hasChildren: boolean;
11
- parentId: string | null;
12
- }
13
1
  /** Tried to find a common base of our entities — used by Entity Workspace Context */
14
- type BaseEntity = {
2
+ type UmbEntityBase = {
15
3
  id?: string;
16
4
  name?: string;
17
5
  };
18
- interface UserEntity extends Entity {
19
- type: 'user';
20
- }
21
- type UserStatus = 'enabled' | 'inactive' | 'invited' | 'disabled';
22
- interface UserDetails extends UserEntity {
23
- email: string;
24
- status: UserStatus;
25
- language: string;
26
- lastLoginDate?: string;
27
- lastLockoutDate?: string;
28
- lastPasswordChangeDate?: string;
29
- updateDate: string;
30
- createDate: string;
31
- failedLoginAttempts: number;
32
- userGroups: Array<string>;
33
- contentStartNodes: Array<string>;
34
- mediaStartNodes: Array<string>;
35
- }
36
- interface UserGroupEntity extends Entity {
37
- type: 'user-group';
38
- }
39
- interface UserGroupDetails extends UserGroupEntity {
40
- sections: Array<string>;
41
- contentStartNode?: string;
42
- mediaStartNode?: string;
43
- permissions: Array<string>;
44
- }
45
- interface MemberTypeDetails extends EntityTreeItemResponseModel {
46
- id: string;
47
- alias: string;
48
- properties: [];
49
- }
50
- interface MediaTypeDetails extends FolderTreeItemResponseModel {
51
- id: string;
52
- alias: string;
53
- properties: [];
54
- }
55
- interface MemberGroupDetails extends EntityTreeItemResponseModel {
56
- id: string;
57
- }
58
- interface MemberDetails extends EntityTreeItemResponseModel {
59
- id: string;
60
- }
61
- interface DocumentBlueprintDetails {
62
- id: string;
63
- name: string;
64
- type: 'document-blueprint';
65
- properties: Array<any>;
66
- data: Array<any>;
67
- icon: string;
68
- documentTypeKey: string;
69
- }
70
- interface SwatchDetails {
6
+ interface UmbSwatchDetails {
71
7
  label: string;
72
8
  value: string;
73
9
  }
74
- type UmbPackage = PackageManifestResponseModel;
75
- type PackageManifestResponse = UmbPackage[];
76
- type UmbPackageWithMigrationStatus = UmbPackage & {
77
- hasPendingMigrations: boolean;
78
- };
10
+ interface ServertimeOffset {
11
+ /**
12
+ * offset in minutes relative to UTC
13
+ */
14
+ offset: number;
15
+ }
79
16
 
80
- export { BaseEntity, ClassConstructor, DocumentBlueprintDetails, Entity, HTMLElementConstructor, MediaTypeDetails, MemberDetails, MemberGroupDetails, MemberTypeDetails, PackageManifestResponse, SwatchDetails, UmbPackage, UmbPackageWithMigrationStatus, UserDetails, UserEntity, UserGroupDetails, UserGroupEntity, UserStatus };
17
+ export { ServertimeOffset, UmbEntityBase, UmbSwatchDetails };
package/notification.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as rxjs from 'rxjs';
2
- import { UmbContextToken } from './context-api';
2
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
3
3
 
4
4
  /**
5
5
  * @export
@@ -1,6 +1,6 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable, BehaviorSubject } from 'rxjs';
3
- import { UmbControllerInterface, UmbControllerHostElement } from './controller';
3
+ import { UmbControllerInterface, UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
4
4
 
5
5
  declare class UmbObserver<T> {
6
6
  #private;
@@ -18,55 +18,55 @@ declare class UmbObserverController<T = unknown> extends UmbObserver<T> implemen
18
18
 
19
19
  /**
20
20
  * @export
21
- * @class BasicState
21
+ * @class UmbBasicState
22
22
  * @extends {BehaviorSubject<T>}
23
23
  * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
24
24
  */
25
- declare class BasicState<T> extends BehaviorSubject<T> {
25
+ declare class UmbBasicState<T> extends BehaviorSubject<T> {
26
26
  constructor(initialData: T);
27
27
  next(newData: T): void;
28
28
  }
29
29
 
30
30
  /**
31
31
  * @export
32
- * @class BooleanState
32
+ * @class UmbBooleanState
33
33
  * @extends {BehaviorSubject<T>}
34
34
  * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
35
35
  */
36
- declare class BooleanState<T> extends BasicState<T | boolean> {
36
+ declare class UmbBooleanState<T> extends UmbBasicState<T | boolean> {
37
37
  constructor(initialData: T | boolean);
38
38
  }
39
39
 
40
40
  /**
41
41
  * @export
42
- * @class NumberState
42
+ * @class UmbNumberState
43
43
  * @extends {BehaviorSubject<T>}
44
44
  * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
45
45
  */
46
- declare class NumberState<T> extends BasicState<T | number> {
46
+ declare class UmbNumberState<T> extends UmbBasicState<T | number> {
47
47
  constructor(initialData: T | number);
48
48
  }
49
49
 
50
50
  /**
51
51
  * @export
52
- * @class StringState
53
- * @extends {BasicState<T>}
52
+ * @class UmbStringState
53
+ * @extends {UmbBasicState<T>}
54
54
  * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
55
55
  */
56
- declare class StringState<T> extends BasicState<T | string> {
56
+ declare class UmbStringState<T> extends UmbBasicState<T | string> {
57
57
  constructor(initialData: T | string);
58
58
  }
59
59
 
60
- interface ClassStateData {
61
- equal(otherClass: ClassStateData): boolean;
60
+ interface UmbClassStateData {
61
+ equal(otherClass: UmbClassStateData): boolean;
62
62
  }
63
63
  /**
64
64
  * @export
65
- * @class ClassState
65
+ * @class UmbClassState
66
66
  * @extends {BehaviorSubject<T>}
67
67
  * @description - A RxJS BehaviorSubject which can hold class instance which has a equal method to compare in coming instances for changes.
68
68
  */
69
- declare class ClassState<T extends ClassStateData | undefined | null> extends BehaviorSubject<T> {
69
+ declare class UmbClassState<T extends UmbClassStateData | undefined | null> extends BehaviorSubject<T> {
70
70
  constructor(initialData: T);
71
71
  next(newData: T): void;
72
72
  }
@@ -77,12 +77,12 @@ type MemoizationFunction<R> = (previousResult: R, currentResult: R) => boolean;
77
77
 
78
78
  /**
79
79
  * @export
80
- * @class DeepState
80
+ * @class UmbDeepState
81
81
  * @extends {BehaviorSubject<T>}
82
82
  * @description - A RxJS BehaviorSubject which deepFreezes the data to ensure its not manipulated from any implementations.
83
83
  * Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.
84
84
  */
85
- declare class DeepState<T> extends BehaviorSubject<T> {
85
+ declare class UmbDeepState<T> extends BehaviorSubject<T> {
86
86
  constructor(initialData: T);
87
87
  getObservablePart<ReturnType>(mappingFunction: MappingFunction<T, ReturnType>, memoizationFunction?: MemoizationFunction<ReturnType>): rxjs.Observable<ReturnType>;
88
88
  next(newData: T): void;
@@ -90,14 +90,14 @@ declare class DeepState<T> extends BehaviorSubject<T> {
90
90
 
91
91
  /**
92
92
  * @export
93
- * @class ArrayState
94
- * @extends {DeepState<T>}
93
+ * @class UmbArrayState
94
+ * @extends {UmbDeepState<T>}
95
95
  * @description - A RxJS BehaviorSubject which deepFreezes the object-data to ensure its not manipulated from any implementations.
96
96
  * Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.
97
97
  *
98
98
  * The ArrayState provides methods to append data when the data is an Object.
99
99
  */
100
- declare class ArrayState<T> extends DeepState<T[]> {
100
+ declare class UmbArrayState<T> extends UmbDeepState<T[]> {
101
101
  #private;
102
102
  constructor(initialData: T[], getUniqueMethod?: (entry: T) => unknown);
103
103
  /**
@@ -109,7 +109,7 @@ declare class ArrayState<T> extends DeepState<T[]> {
109
109
  * { key: 1, value: 'foo'},
110
110
  * { key: 2, value: 'bar'}
111
111
  * ];
112
- * const myState = new ArrayState(data, (x) => x.key);
112
+ * const myState = new UmbArrayState(data, (x) => x.key);
113
113
  * myState.sortBy((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0));
114
114
  */
115
115
  sortBy(sortMethod?: (a: T, b: T) => number): this;
@@ -117,35 +117,35 @@ declare class ArrayState<T> extends DeepState<T[]> {
117
117
  /**
118
118
  * @method remove
119
119
  * @param {unknown[]} uniques - The unique values to remove.
120
- * @return {ArrayState<T>} Reference to it self.
120
+ * @return {UmbArrayState<T>} Reference to it self.
121
121
  * @description - Remove some new data of this Subject.
122
122
  * @example <caption>Example remove entry with id '1' and '2'</caption>
123
123
  * const data = [
124
124
  * { id: 1, value: 'foo'},
125
125
  * { id: 2, value: 'bar'}
126
126
  * ];
127
- * const myState = new ArrayState(data, (x) => x.id);
127
+ * const myState = new UmbArrayState(data, (x) => x.id);
128
128
  * myState.remove([1, 2]);
129
129
  */
130
130
  remove(uniques: unknown[]): this;
131
131
  /**
132
132
  * @method removeOne
133
133
  * @param {unknown} unique - The unique value to remove.
134
- * @return {ArrayState<T>} Reference to it self.
134
+ * @return {UmbArrayState<T>} Reference to it self.
135
135
  * @description - Remove some new data of this Subject.
136
136
  * @example <caption>Example remove entry with id '1'</caption>
137
137
  * const data = [
138
138
  * { id: 1, value: 'foo'},
139
139
  * { id: 2, value: 'bar'}
140
140
  * ];
141
- * const myState = new ArrayState(data, (x) => x.id);
141
+ * const myState = new UmbArrayState(data, (x) => x.id);
142
142
  * myState.removeOne(1);
143
143
  */
144
144
  removeOne(unique: unknown): this;
145
145
  /**
146
146
  * @method filter
147
147
  * @param {unknown} filterMethod - The unique value to remove.
148
- * @return {ArrayState<T>} Reference to it self.
148
+ * @return {UmbArrayState<T>} Reference to it self.
149
149
  * @description - Remove some new data of this Subject.
150
150
  * @example <caption>Example remove entry with key '1'</caption>
151
151
  * const data = [
@@ -153,7 +153,7 @@ declare class ArrayState<T> extends DeepState<T[]> {
153
153
  * { key: 2, value: 'bar'},
154
154
  * { key: 3, value: 'poo'}
155
155
  * ];
156
- * const myState = new ArrayState(data, (x) => x.key);
156
+ * const myState = new UmbArrayState(data, (x) => x.key);
157
157
  * myState.filter((entry) => entry.key !== 1);
158
158
  *
159
159
  * Result:
@@ -167,28 +167,28 @@ declare class ArrayState<T> extends DeepState<T[]> {
167
167
  /**
168
168
  * @method appendOne
169
169
  * @param {T} entry - new data to be added in this Subject.
170
- * @return {ArrayState<T>} Reference to it self.
170
+ * @return {UmbArrayState<T>} Reference to it self.
171
171
  * @description - Append some new data to this Subject.
172
172
  * @example <caption>Example append some data.</caption>
173
173
  * const data = [
174
174
  * { key: 1, value: 'foo'},
175
175
  * { key: 2, value: 'bar'}
176
176
  * ];
177
- * const myState = new ArrayState(data);
177
+ * const myState = new UmbArrayState(data);
178
178
  * myState.append({ key: 1, value: 'replaced-foo'});
179
179
  */
180
180
  appendOne(entry: T): this;
181
181
  /**
182
182
  * @method append
183
183
  * @param {T[]} entries - A array of new data to be added in this Subject.
184
- * @return {ArrayState<T>} Reference to it self.
184
+ * @return {UmbArrayState<T>} Reference to it self.
185
185
  * @description - Append some new data to this Subject, if it compares to existing data it will replace it.
186
186
  * @example <caption>Example append some data.</caption>
187
187
  * const data = [
188
188
  * { key: 1, value: 'foo'},
189
189
  * { key: 2, value: 'bar'}
190
190
  * ];
191
- * const myState = new ArrayState(data);
191
+ * const myState = new UmbArrayState(data);
192
192
  * myState.append([
193
193
  * { key: 1, value: 'replaced-foo'},
194
194
  * { key: 3, value: 'another-bla'}
@@ -199,14 +199,14 @@ declare class ArrayState<T> extends DeepState<T[]> {
199
199
  * @method updateOne
200
200
  * @param {unknown} unique - Unique value to find entry to update.
201
201
  * @param {Partial<T>} entry - new data to be added in this Subject.
202
- * @return {ArrayState<T>} Reference to it self.
202
+ * @return {UmbArrayState<T>} Reference to it self.
203
203
  * @description - Update a item with some new data, requires the ArrayState to be constructed with a getUnique method.
204
204
  * @example <caption>Example append some data.</caption>
205
205
  * const data = [
206
206
  * { key: 1, value: 'foo'},
207
207
  * { key: 2, value: 'bar'}
208
208
  * ];
209
- * const myState = new ArrayState(data, (x) => x.key);
209
+ * const myState = new UmbArrayState(data, (x) => x.key);
210
210
  * myState.updateOne(2, {value: 'updated-bar'});
211
211
  */
212
212
  updateOne(unique: unknown, entry: Partial<T>): this;
@@ -214,22 +214,22 @@ declare class ArrayState<T> extends DeepState<T[]> {
214
214
 
215
215
  /**
216
216
  * @export
217
- * @class ObjectState
218
- * @extends {DeepState<T>}
217
+ * @class UmbObjectState
218
+ * @extends {UmbDeepState<T>}
219
219
  * @description - A RxJS BehaviorSubject which deepFreezes the object-data to ensure its not manipulated from any implementations.
220
220
  * Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.
221
221
  *
222
- * The ObjectState provides methods to append data when the data is an Object.
222
+ * The UmbObjectState provides methods to append data when the data is an Object.
223
223
  */
224
- declare class ObjectState<T> extends DeepState<T> {
224
+ declare class UmbObjectState<T> extends UmbDeepState<T> {
225
225
  /**
226
226
  * @method update
227
227
  * @param {Partial<T>} partialData - A object containing some of the data to update in this Subject.
228
228
  * @description - Append some new data to this Object.
229
- * @return {ObjectState<T>} Reference to it self.
229
+ * @return {UmbObjectState<T>} Reference to it self.
230
230
  * @example <caption>Example append some data.</caption>
231
231
  * const data = {key: 'myKey', value: 'myInitialValue'};
232
- * const myState = new ObjectState(data);
232
+ * const myState = new UmbObjectState(data);
233
233
  * myState.update({value: 'myNewValue'});
234
234
  */
235
235
  update(partialData: Partial<T>): this;
@@ -254,13 +254,25 @@ declare function createObservablePart<R, T>(source$: Observable<T>, mappingFunct
254
254
  * @param {(mappable: T) => R} mappingFunction - Method to return the part for this Observable to return.
255
255
  * @param {(previousResult: R, currentResult: R) => boolean} [memoizationFunction] - Method to Compare if the data has changed. Should return true when data is different.
256
256
  * @description - Creates a RxJS Observable from RxJS Subject.
257
- * @example <caption>Example append new entry for a ArrayState or a part of DeepState/ObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
257
+ * @example <caption>Example append new entry for a ArrayState or a part of UmbDeepState/UmbObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
258
258
  * const entry = {id: 'myKey', value: 'myValue'};
259
259
  * const newDataSet = appendToFrozenArray(mySubject.getValue(), entry, x => x.id === id);
260
260
  * mySubject.next(newDataSet);
261
261
  */
262
262
  declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (entry: T) => unknown): T[];
263
263
 
264
+ /**
265
+ * @export
266
+ * @method filterFrozenArray
267
+ * @param {Array<T>} data - RxJS Subject to use for this Observable.
268
+ * @param {(entry: T) => boolean} filterMethod - Method to filter the array.
269
+ * @description - Creates a RxJS Observable from RxJS Subject.
270
+ * @example <caption>Example remove an entry of a ArrayState or a part of DeepState/ObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
271
+ * const newDataSet = filterFrozenArray(mySubject.getValue(), x => x.id !== "myKey");
272
+ * mySubject.next(newDataSet);
273
+ */
274
+ declare function filterFrozenArray<T>(data: T[], filterMethod: (entry: T) => boolean): T[];
275
+
264
276
  /**
265
277
  * @export
266
278
  * @method partialUpdateFrozenArray
@@ -268,11 +280,11 @@ declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (
268
280
  * @param {(mappable: T) => R} mappingFunction - Method to return the part for this Observable to return.
269
281
  * @param {(previousResult: R, currentResult: R) => boolean} [memoizationFunction] - Method to Compare if the data has changed. Should return true when data is different.
270
282
  * @description - Creates a RxJS Observable from RxJS Subject.
271
- * @example <caption>Example append new entry for a ArrayState or a part of DeepState/ObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
283
+ * @example <caption>Example append new entry for a ArrayState or a part of UmbDeepState/UmbObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
272
284
  * const partialEntry = {value: 'myValue'};
273
285
  * const newDataSet = partialUpdateFrozenArray(mySubject.getValue(), partialEntry, x => x.key === 'myKey');
274
286
  * mySubject.next(newDataSet);
275
287
  */
276
288
  declare function partialUpdateFrozenArray<T>(data: T[], partialEntry: Partial<T>, findMethod: (entry: T) => boolean): T[];
277
289
 
278
- export { ArrayState, BasicState, BooleanState, ClassState, DeepState, MappingFunction, NumberState, ObjectState, StringState, UmbObserver, UmbObserverController, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
290
+ export { MappingFunction, UmbArrayState, UmbBasicState, UmbBooleanState, UmbClassState, UmbDeepState, UmbNumberState, UmbObjectState, UmbObserver, UmbObserverController, UmbStringState, appendToFrozenArray, createObservablePart, filterFrozenArray, partialUpdateFrozenArray };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-cms/backoffice",
3
- "version": "1.0.0-next.6c429eee",
3
+ "version": "1.0.0-next.70bfba05",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "umbraco",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "peerDependencies": {
28
28
  "@types/uuid": "^9.0.1",
29
- "@umbraco-ui/uui": "^1.2.0-rc.0",
29
+ "@umbraco-ui/uui": "1.2.1",
30
30
  "rxjs": "^7.8.0"
31
31
  },
32
32
  "customElements": "custom-elements.json"