Move Modal Tokens
This commit is contained in:
@@ -21,5 +21,7 @@ export * from './property-editor-ui-picker-modal.token';
|
||||
export * from './property-settings-modal.token';
|
||||
export * from './search-modal.token';
|
||||
export * from './section-picker-modal.token';
|
||||
export * from './template-modal.token';
|
||||
export * from './template-picker-modal.token';
|
||||
export * from './user-group-picker-modal.token';
|
||||
export * from './user-picker-modal.token';
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface UmbTemplateModalResult {
|
||||
}
|
||||
|
||||
// TODO: Move to libs:
|
||||
export const UMB_TEMPLATE_MODAL_TOKEN = new UmbModalToken<UmbTemplateModalData, UmbTemplateModalResult>(
|
||||
export const UMB_TEMPLATE_MODAL = new UmbModalToken<UmbTemplateModalData, UmbTemplateModalResult>(
|
||||
'Umb.Modal.Template',
|
||||
{
|
||||
type: 'sidebar',
|
||||
@@ -9,11 +9,10 @@ export interface UmbTemplatePickerModalResult {
|
||||
selection: string[] | undefined;
|
||||
}
|
||||
|
||||
// TODO: Move to libs:
|
||||
export const UMB_TEMPLATE_PICKER_MODAL_TOKEN = new UmbModalToken<
|
||||
UmbTemplatePickerModalData,
|
||||
UmbTemplatePickerModalResult
|
||||
>('Umb.Modal.TemplatePicker', {
|
||||
type: 'sidebar',
|
||||
size: 'small',
|
||||
});
|
||||
export const UMB_TEMPLATE_PICKER_MODAL = new UmbModalToken<UmbTemplatePickerModalData, UmbTemplatePickerModalResult>(
|
||||
'Umb.Modal.TemplatePicker',
|
||||
{
|
||||
type: 'sidebar',
|
||||
size: 'small',
|
||||
}
|
||||
);
|
||||
@@ -3,8 +3,8 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
||||
import { UmbTemplateCardElement } from '../template-card/template-card.element';
|
||||
import { UMB_TEMPLATE_PICKER_MODAL_TOKEN } from '../../modals/template-picker';
|
||||
import { UMB_TEMPLATE_MODAL_TOKEN } from '../../modals/template';
|
||||
import { UMB_TEMPLATE_PICKER_MODAL } from '../../../../../libs/modal/token/template-picker-modal.token';
|
||||
import { UMB_TEMPLATE_MODAL } from '../../../../../libs/modal/token/template-modal.token';
|
||||
import { UmbTemplateRepository } from '../../../templating/templates/repository/template.repository';
|
||||
import { UmbModalContext, UMB_MODAL_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
@@ -104,7 +104,7 @@ export class UmbInputTemplatePickerElement extends FormControlMixin(UmbLitElemen
|
||||
}
|
||||
|
||||
#openPicker() {
|
||||
const modalHandler = this._modalContext?.open(UMB_TEMPLATE_PICKER_MODAL_TOKEN, {
|
||||
const modalHandler = this._modalContext?.open(UMB_TEMPLATE_PICKER_MODAL, {
|
||||
multiple: true,
|
||||
selection: [...this.allowedKeys],
|
||||
});
|
||||
@@ -132,7 +132,7 @@ export class UmbInputTemplatePickerElement extends FormControlMixin(UmbLitElemen
|
||||
#openTemplate(e: CustomEvent) {
|
||||
const key = (e.target as UmbTemplateCardElement).value;
|
||||
|
||||
this._modalContext?.open(UMB_TEMPLATE_MODAL_TOKEN, {
|
||||
this._modalContext?.open(UMB_TEMPLATE_MODAL, {
|
||||
key: key as string,
|
||||
language: 'razor',
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import { css, html } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import { UmbTreeElement } from '../../components/tree/tree.element';
|
||||
import { UmbTemplatePickerModalData, UmbTemplatePickerModalResult } from '.';
|
||||
import { UmbTemplatePickerModalData, UmbTemplatePickerModalResult } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbModalBaseElement } from '@umbraco-cms/internal/modal';
|
||||
|
||||
//TODO: make a default tree-picker that can be used across multiple pickers
|
||||
|
||||
@@ -4,7 +4,7 @@ import { customElement, query, state } from 'lit/decorators.js';
|
||||
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
import { UUIInputEvent } from '@umbraco-ui/uui';
|
||||
import { UmbCodeEditor } from '../../components/code-editor';
|
||||
import { UmbTemplateModalData, UmbTemplateModalResult } from '.';
|
||||
import { UmbTemplateModalData, UmbTemplateModalResult } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbInputEvent } from '@umbraco-cms/backoffice/events';
|
||||
import { TemplateResource, TemplateResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import { UmbModalBaseElement } from '@umbraco-cms/internal/modal';
|
||||
|
||||
Reference in New Issue
Block a user