<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">customer_address_listing.customer_address_listing_data_source</item>
        </item>
    </argument>
    <settings>
        <spinner>customer_address_columns</spinner>
        <deps>
            <dep>customer_address_listing.customer_address_listing_data_source</dep>
        </deps>
    </settings>
    <dataSource name="customer_address_listing_data_source" component="Magento_Ui/js/grid/provider">
        <settings>
            <filterUrlParams>
                <param name="id">*</param>
            </filterUrlParams>
            <storageConfig>
                <param name="indexField" xsi:type="string">entity_id</param>
            </storageConfig>
            <updateUrl path="mui/index/render"/>
        </settings>
        <aclResource>Magento_Customer::manage</aclResource>
        <dataProvider class="Magento\Customer\Ui\Component\Listing\Address\DataProvider" name="customer_address_listing_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>entity_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>
    <listingToolbar name="listing_top">
        <bookmark name="bookmarks"/>
        <columnsControls name="columns_controls"/>
        <filterSearch name="fulltext"/>
        <filters name="listing_filters" component="Magento_Customer/js/grid/filters/filters">
            <settings>
                <storageConfig>
                    <param name="provider" xsi:type="string">customer_address_listing.customer_address_listing.listing_top.bookmarks</param>
                    <param name="namespace" xsi:type="string">current.filters</param>
                </storageConfig>
                <childDefaults>
                    <param name="provider" xsi:type="string">customer_address_listing.customer_address_listing.listing_top.listing_filters</param>
                    <param name="imports" xsi:type="array">
                        <item name="visible" xsi:type="string">customer_address_listing.customer_address_listing.listing_top.bookmarks:current.columns.${ $.index }.visible</item>
                    </param>
                </childDefaults>
            </settings>
        </filters>
        <massaction name="listing_massaction" component="Magento_Customer/js/grid/massactions">
            <action name="delete">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="isAjax" xsi:type="boolean">true</item>
                    </item>
                </argument>
                <settings>
                    <url path="customer/address/massDelete"/>
                    <type>delete</type>
                    <label translate="true">Delete</label>
                    <confirm>
                        <message translate="true">Are you sure to delete selected address?</message>
                        <title translate="true">Delete items</title>
                    </confirm>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
    <columns name="customer_address_columns">
        <settings>
            <editorConfig>
                <param name="clientConfig" xsi:type="array">
                    <item name="saveUrl" xsi:type="url" path="customer/index/inlineEdit"/>
                    <item name="validateBeforeSave" xsi:type="boolean">false</item>
                </param>
                <param name="indexField" xsi:type="string">entity_id</param>
                <param name="enabled" xsi:type="boolean">true</param>
                <param name="selectProvider" xsi:type="string">customer_address_listing.customer_address_listing.address_columns.ids</param>
            </editorConfig>
            <childDefaults>
                <param name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">customer_address_listing.customer_address_listing.address_columns_editor</item>
                    <item name="target" xsi:type="string">startEdit</item>
                    <item name="params" xsi:type="array">
                        <item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
                        <item name="1" xsi:type="boolean">true</item>
                    </item>
                </param>
            </childDefaults>
        </settings>
        <selectionsColumn name="ids" sortOrder="10">
            <settings>
                <indexField>entity_id</indexField>
            </settings>
        </selectionsColumn>
        <column name="firstname" sortOrder="20">
            <settings>
                <filter>text</filter>
                <label translate="true">First Name</label>
            </settings>
        </column>
        <column name="lastname" sortOrder="40">
            <settings>
                <filter>text</filter>
                <label translate="true">Last Name</label>
            </settings>
        </column>
        <column name="street" sortOrder="80">
            <settings>
                <filter>text</filter>
                <label translate="true">Street Address</label>
            </settings>
        </column>
        <column name="city" sortOrder="81">
            <settings>
                <filter>text</filter>
                <label translate="true">City</label>
            </settings>
        </column>
        <column name="region" sortOrder="91">
            <settings>
                <filter>text</filter>
                <label translate="true">State</label>
            </settings>
        </column>
        <column name="postcode" sortOrder="92">
            <settings>
                <filter>text</filter>
                <label translate="true">Zip/Postal Code</label>
            </settings>
        </column>
        <column name="country_id" component="Magento_Ui/js/grid/columns/select" sortOrder="90">
            <settings>
                <filter>select</filter>
                <options class="Magento\Customer\Ui\Component\Listing\Address\Column\Countries"/>
                <dataType>select</dataType>
                <label translate="true">Country</label>
            </settings>
        </column>
        <column name="telephone" sortOrder="93">
            <settings>
                <filter>text</filter>
                <editor>
                    <editorType>text</editorType>
                </editor>
                <label translate="true">Phone</label>
            </settings>
        </column>
        <actionsColumn name="actions" class="Magento\Customer\Ui\Component\Listing\Address\Column\Actions" component="Magento_Customer/js/grid/columns/actions">
            <settings>
                <indexField>entity_id</indexField>
            </settings>
        </actionsColumn>
    </columns>
</listing>
