> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# msm-cdek-widget

> Delivery selection component based on the CDEK widget.

`msm-cdek-widget` is a web component built with Lit.

## Purpose

Let users choose a delivery option/address and handle emitted events to update the order.

## Usage

```html theme={null}
<msm-cdek-widget order-id="ORDER_ID"></msm-cdek-widget>
```

## Attributes / properties

| Name            | Type    | Default  | Notes |
| --------------- | ------- | -------- | ----- |
| `delivery-type` | string  | `"door"` |       |
| `order-id`      | string  | -        |       |
| `checked`       | boolean | -        |       |
| `disabled`      | boolean | -        |       |
| `required`      | boolean | -        |       |

## Events

| Event                     | detail                                                  | When |
| ------------------------- | ------------------------------------------------------- | ---- |
| `msm-delivery-calculated` | `prices`, `address`                                     |      |
| `msm-address-selected`    | `type`, `deliveryAmount`, `shippingAddress`, `metaInfo` |      |

### Usage

```html theme={null}
<msm-cdek-widget order-id="ORDER_ID">
</msm-cdek-widget>

<script>
  const el = document.querySelector("msm-cdek-widget");
  el.addEventListener("msm-delivery-calculated", (e) => {
    console.log(e.detail);
  });

  el.addEventListener("msm-address-selected", (e) => {
    console.log(e.detail);
  });

</script>
```

## CSS parts

* `base`
* `label`

## Slots

No documented slots.

## Methods

* `validate()`

## Notes

* Geolocation is only requested on HTTPS pages (browser limitation).
* Custom events bubble.
