document picker
This commit is contained in:
@@ -9,10 +9,10 @@ export interface UmbDocumentPickerModalResult {
|
||||
selection: Array<string>;
|
||||
}
|
||||
|
||||
export const UMB_DOCUMENT_PICKER_MODAL_TOKEN = new UmbModalToken<
|
||||
UmbDocumentPickerModalData,
|
||||
UmbDocumentPickerModalResult
|
||||
>('Umb.Modal.DocumentPicker', {
|
||||
type: 'sidebar',
|
||||
size: 'small',
|
||||
});
|
||||
export const UMB_DOCUMENT_PICKER_MODAL = new UmbModalToken<UmbDocumentPickerModalData, UmbDocumentPickerModalResult>(
|
||||
'Umb.Modal.DocumentPicker',
|
||||
{
|
||||
type: 'sidebar',
|
||||
size: 'small',
|
||||
}
|
||||
);
|
||||
@@ -2,7 +2,10 @@ import { css, html } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import type { UmbTreeElement } from '../../../../shared/components/tree/tree.element';
|
||||
import { UmbDocumentPickerModalData, UmbDocumentPickerModalResult } from '.';
|
||||
import {
|
||||
UmbDocumentPickerModalData,
|
||||
UmbDocumentPickerModalResult,
|
||||
} from '../../../../../../libs/modal/token/document-picker-modal.token';
|
||||
import { UmbModalBaseElement } from '@umbraco-cms/internal/modal';
|
||||
|
||||
// TODO: make use of UmbPickerLayoutBase
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from 'lit';
|
||||
|
||||
import type { UmbDocumentPickerModalElement } from './document-picker-modal.element';
|
||||
import type { UmbDocumentPickerModalData } from './index';
|
||||
import type { UmbDocumentPickerModalData } from '../../../../../../libs/modal/token/document-picker-modal.token';
|
||||
|
||||
export default {
|
||||
title: 'API/Modals/Layouts/Content Picker',
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
||||
import { UMB_DOCUMENT_TREE_STORE_CONTEXT_TOKEN } from '../../../documents/documents/repository/document.tree.store';
|
||||
import type { UmbDocumentTreeStore } from '../../../documents/documents/repository/document.tree.store';
|
||||
import { UMB_CONFIRM_MODAL } from '../../../../../libs/modal/token/confirm-modal.token';
|
||||
import { UMB_DOCUMENT_PICKER_MODAL_TOKEN } from '../../../documents/documents/modals/document-picker';
|
||||
import { UMB_DOCUMENT_PICKER_MODAL } from '../../../../../libs/modal/token/document-picker-modal.token';
|
||||
import { UmbModalContext, UMB_MODAL_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import type { DocumentTreeItemResponseModel, EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
@@ -123,7 +123,7 @@ export class UmbInputDocumentPickerElement extends FormControlMixin(UmbLitElemen
|
||||
|
||||
private _openPicker() {
|
||||
// We send a shallow copy(good enough as its just an array of keys) of our this._selectedKeys, as we don't want the modal to manipulate our data:
|
||||
const modalHandler = this._modalContext?.open(UMB_DOCUMENT_PICKER_MODAL_TOKEN, {
|
||||
const modalHandler = this._modalContext?.open(UMB_DOCUMENT_PICKER_MODAL, {
|
||||
multiple: this.max === 1 ? false : true,
|
||||
selection: [...this._selectedKeys],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user