Modal
=============

Модальное окно + расширенные окна

Installation
-----------

```js
import Modal, {ModalSize, ModalStyle} from "@mdoffice/md-component/Modal";
import { ProcessModal } from "@mdoffice/md-component/Modal";
import { FullnessModal } from "@mdoffice/md-component/Modal";
```

Usage FullnessModal
-----

Проверка документа на полноту заполнености и вывод ошибок при наличии
```js
let fullnessModal: FullnessModal | null;
function getApplyId() {
    const id = location.search.match(/p_id=(\d+)/im);
    return id && id[1];
}

if (!fullnessModal) {
    fullnessModal = FullnessModal.create({
        urlCheck: `/ua/...checkFullness?p_id=${id}`,
        onSuccess: () => {
            ...
        }
    });
}

fullnessModal.open();
```
```js
let fullnessModal: FullnessModal | null;

if (!fullnessModal) {
    fullnessModal = FullnessModal.create({
        urlCheck: '/ua/...checkFullness',
        bodyData: {paramName: 'longPostData'},
        modalTitle: 'Перевірка документу',
        onSuccess: () => {
            ...
        }
    });
}

fullnessModal.open();
```

Примеры ответов с сервера
```json
{ "ok": true }
```
```json
{ "ok": false, "canContinue": true, "errors": ["not critical error 1", "not critical error 2"] }
```
```json
{ "ok": false, "canContinue": false, "msg": "critical error" }
```
```json
{ "ok": false }
```
