{"version":3,"file":"addressControl.obs.js","sources":["../../../Framework/Controls/addressControl.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n    <RockFormField formGroupClasses=\"address-control\" #default=\"{ uniqueId, field }\" name=\"addresscontrol\" v-model.lazy=\"internalValue\">\r\n        <div class=\"control-wrapper\">\r\n            <Loading :id=\"id || uniqueId\" :isLoading=\"isLoading\">\r\n                <div class=\"form-row\" v-if=\"country.isVisible\">\r\n                    <div class=\"form-group col-sm-6\">\r\n                        <DropDownList v-model=\"internalValue.country\" :items=\"countryOptions\" :validationTitle=\"country.label\" :rules=\"country.rules\" :disabled=\"disabled\" />\r\n                    </div>\r\n                </div>\r\n                <div class=\"form-group\" v-if=\"address1.isVisible\">\r\n                    <TextBox v-model=\"internalValue.street1\" :placeholder=\"address1.label\" :validationTitle=\"address1.label\" :rules=\"address1.rules\" :disabled=\"disabled\" />\r\n                </div>\r\n                <div class=\"form-group\" v-if=\"address2.isVisible\">\r\n                    <TextBox v-model=\"internalValue.street2\" :placeholder=\"address2.label\" :validationTitle=\"address2.label\" :rules=\"address2.rules\" :disabled=\"disabled\" />\r\n                </div>\r\n                <div class=\"form-row\">\r\n                    <div class=\"form-group\" :class=\"county.isVisible ? 'col-sm-3' : 'col-sm-6'\" v-if=\"city.isVisible\">\r\n                        <TextBox v-model=\"internalValue.city\" :placeholder=\"city.label\" :validationTitle=\"city.label\" :rules=\"city.rules\" :disabled=\"disabled\" />\r\n                    </div>\r\n                    <div class=\"form-group col-sm-3\" v-if=\"county.isVisible\">\r\n                        <TextBox v-model=\"internalValue.locality\" :placeholder=\"county.label\" :validationTitle=\"county.label\" :rules=\"county.rules\" :disabled=\"disabled\" />\r\n                    </div>\r\n                    <div class=\"form-group col-sm-3\" v-if=\"state.isVisible\">\r\n                        <DropDownList v-if=\"hasStateList\" :showBlankItem=\"false\" v-model=\"internalValue.state\" :items=\"stateOptions\" :validationTitle=\"state.label\" :rules=\"state.rules\" :disabled=\"disabled\" />\r\n                        <TextBox v-else v-model=\"internalValue.state\" :placeholder=\"state.label\" :validationTitle=\"state.label\" :rules=\"state.rules\" :disabled=\"disabled\" />\r\n                    </div>\r\n                    <div class=\"form-group col-sm-3\" v-if=\"zip.isVisible\">\r\n                        <TextBox v-model=\"internalValue.postalCode\" :placeholder=\"zip.label\" :validationTitle=\"zip.label\" :rules=\"zip.rules\" inputmode=\"numeric\" :disabled=\"disabled\" />\r\n                    </div>\r\n                </div>\r\n            </Loading>\r\n        </div>\r\n    </RockFormField>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\n    import { PropType, reactive, ref, watch } from \"vue\";\r\n    import RockFormField from \"./rockFormField\";\r\n    import DropDownList from \"./dropDownList\";\r\n    import TextBox from \"./textBox\";\r\n    import { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\n    import { AddressControlBag } from \"@Obsidian/ViewModels/Controls/addressControlBag\";\r\n    import { AddressControlGetConfigurationOptionsBag } from \"@Obsidian/ViewModels/Rest/Controls/addressControlGetConfigurationOptionsBag\";\r\n    import { AddressControlConfigurationBag } from \"@Obsidian/ViewModels/Rest/Controls/addressControlConfigurationBag\";\r\n    import { RequirementLevel } from \"@Obsidian/Enums/Controls/requirementLevel\";\r\n    import { post } from \"@Obsidian/Utility/http\";\r\n    import Loading from \"./loading\";\r\n\r\n\r\n    type FullAddress = Required<{\r\n        [Property in keyof AddressControlBag]: NonNullable<AddressControlBag[Property]>\r\n    }>;\r\n\r\n    const props = defineProps({\r\n        modelValue: {\r\n            type: Object as PropType<AddressControlBag>,\r\n            default: {}\r\n        },\r\n\r\n        disabled: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: false\r\n        },\r\n\r\n        id: {\r\n            type: String as PropType<string>,\r\n            default: \"\"\r\n        },\r\n\r\n        showCounty: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: false\r\n        },\r\n\r\n        showAddressLine2: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: true\r\n        },\r\n\r\n        useCountryAbbreviation: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: false\r\n        },\r\n\r\n        /**\r\n         * If true, doesn't apply any \"required\" rules to any of the individual fields, preventing\r\n         * the RockForm from showing an error if they're not filled. This allows parent components to\r\n         * handle validation, which is especially useful if the address itself isn't required.\r\n         */\r\n        disableFrontEndValidation: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: false\r\n        }\r\n    });\r\n\r\n    const emit = defineEmits<{\r\n        (e: \"update:modelValue\", value: AddressControlBag): void\r\n    }>();\r\n\r\n    const internalValue = reactive<FullAddress>({\r\n        city: props.modelValue.city ?? \"\",\r\n        country: props.modelValue.country ?? \"\",\r\n        postalCode: props.modelValue.postalCode ?? \"\",\r\n        state: props.modelValue.state ?? \"\",\r\n        street1: props.modelValue.street1 ?? \"\",\r\n        street2: props.modelValue.street2 ?? \"\",\r\n        locality: props.modelValue.locality ?? \"\"\r\n    });\r\n\r\n    watch(internalValue, () => {\r\n        emit(\"update:modelValue\", internalValue);\r\n    });\r\n\r\n    watch(() => props.modelValue, () => {\r\n        // Update internalValue if there are differences\r\n        Object.entries(props.modelValue).forEach(([key, val]) => {\r\n            if (val === null || val === undefined) {\r\n                internalValue[key] = \"\";\r\n            }\r\n            else if (val !== internalValue[key]) {\r\n                internalValue[key] = val;\r\n            }\r\n        });\r\n    });\r\n\r\n    const isLoading = ref<boolean>(false);\r\n\r\n    type FieldConfig = {\r\n        isVisible: boolean,\r\n        label: string,\r\n        rules: string\r\n    };\r\n\r\n    const country = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"Country\",\r\n        rules: \"\"\r\n    });\r\n    const address1 = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"Address Line 1\",\r\n        rules: \"\"\r\n    });\r\n    const address2 = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"Address Line 2\",\r\n        rules: \"\"\r\n    });\r\n    const city = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"City\",\r\n        rules: \"\"\r\n    });\r\n    const county = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"County\",\r\n        rules: \"\"\r\n    });\r\n    const state = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"State\",\r\n        rules: \"\"\r\n    });\r\n    const zip = reactive<FieldConfig>({\r\n        isVisible: true,\r\n        label: \"Zip\",\r\n        rules: \"\"\r\n    });\r\n\r\n    const countryOptions = ref<ListItemBag[]>([]);\r\n    const stateOptions = ref<ListItemBag[]>([]);\r\n    const hasStateList = ref<boolean>(false);\r\n\r\n    async function getConfiguration(): Promise<void> {\r\n        isLoading.value = true;\r\n        const options: Partial<AddressControlGetConfigurationOptionsBag> = {\r\n            useCountryAbbreviation: props.useCountryAbbreviation,\r\n            countryCode: props.modelValue.country\r\n        };\r\n\r\n        // TODO: At some point, we should find some way to cache this\r\n        const result = await post<AddressControlConfigurationBag>(\"/api/v2/Controls/AddressControlGetConfiguration\", undefined, options);\r\n\r\n        if (result.isSuccess && result.data) {\r\n            const data = result.data;\r\n\r\n            // Label and rules are static\r\n            country.isVisible = data.showCountrySelection;\r\n\r\n            // Label is static\r\n            address1.isVisible = data.addressLine1Requirement != RequirementLevel.Unavailable;\r\n            address1.rules = getRules(data.addressLine1Requirement);\r\n\r\n            // Address Line 2 is only shown if it's required or it's requested by the prop; Label is static\r\n            address2.isVisible = data.addressLine2Requirement == RequirementLevel.Required || (props.showAddressLine2 && data.addressLine2Requirement != RequirementLevel.Unavailable);\r\n            address2.rules = getRules(data.addressLine2Requirement);\r\n\r\n            city.isVisible = data.cityRequirement != RequirementLevel.Unavailable;\r\n            city.rules = getRules(data.cityRequirement);\r\n            city.label = data.cityLabel ?? city.label;\r\n\r\n            // County / Locality is only shown if it's required or it's requested by the prop\r\n            county.isVisible = data.localityRequirement == RequirementLevel.Required || (props.showCounty && data.localityRequirement != RequirementLevel.Unavailable);\r\n            county.rules = getRules(data.localityRequirement);\r\n            county.label = data.localityLabel ?? county.label;\r\n\r\n            state.isVisible = data.stateRequirement != RequirementLevel.Unavailable;\r\n            state.rules = getRules(data.stateRequirement);\r\n            state.label = data.stateLabel ?? state.label;\r\n\r\n            zip.isVisible = data.postalCodeRequirement != RequirementLevel.Unavailable;\r\n            zip.rules = getRules(data.postalCodeRequirement);\r\n            zip.label = data.postalCodeLabel ?? zip.label;\r\n\r\n            countryOptions.value = data.countries ?? [];\r\n            stateOptions.value = data.states ?? [];\r\n            hasStateList.value = data.hasStateList;\r\n\r\n            const countryValue = (data.selectedCountry || data.defaultCountry) ?? \"\";\r\n            const stateValue = data.defaultState ?? \"\";\r\n\r\n            // If we don't have a country set yet, and we have a good countryValue, set to that\r\n            if (!internalValue.country && countryValue) {\r\n                internalValue.country = countryValue;\r\n            }\r\n\r\n            // If we don't have a state set yet, and we have a good stateValue, set to that\r\n            if (!internalValue.state && stateValue) {\r\n                internalValue.state = stateValue;\r\n            }\r\n        }\r\n        else {\r\n            console.error(result.errorMessage ?? \"Unknown error while loading data.\");\r\n        }\r\n        isLoading.value = false;\r\n    }\r\n\r\n    function getRules(reqLvl: RequirementLevel): string {\r\n        return reqLvl == RequirementLevel.Required && !props.disableFrontEndValidation ? \"required\" : \"\";\r\n    }\r\n\r\n    watch(() => internalValue.country, (currentVal, oldVal) => {\r\n        if (currentVal != oldVal) {\r\n            getConfiguration();\r\n        }\r\n    }, { deep: true });\r\n\r\n    // Initialize with configuration from the server\r\n    getConfiguration();\r\n\r\n</script>"],"names":["internalValue","reactive","city","_props$modelValue$cit","props","modelValue","country","_props$modelValue$cou","postalCode","_props$modelValue$pos","state","_props$modelValue$sta","street1","_props$modelValue$str","street2","_props$modelValue$str2","locality","_props$modelValue$loc","watch","emit","Object","entries","forEach","_ref2","_ref3","_slicedToArray","key","val","undefined","isLoading","ref","isVisible","label","rules","address1","address2","county","zip","countryOptions","stateOptions","hasStateList","getConfiguration","_getConfiguration","apply","arguments","_asyncToGenerator","value","options","useCountryAbbreviation","countryCode","result","post","isSuccess","data","_data$cityLabel","_data$localityLabel","_data$stateLabel","_data$postalCodeLabel","_data$countries","_data$states","_ref5","_data$defaultState","showCountrySelection","addressLine1Requirement","RequirementLevel","Unavailable","getRules","addressLine2Requirement","Required","showAddressLine2","cityRequirement","cityLabel","localityRequirement","showCounty","localityLabel","stateRequirement","stateLabel","postalCodeRequirement","postalCodeLabel","countries","states","countryValue","selectedCountry","defaultCountry","stateValue","defaultState","_result$errorMessage","console","error","errorMessage","reqLvl","disableFrontEndValidation","currentVal","oldVal","deep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoGI,IAAMA,aAAa,GAAGC,QAAQ,CAAc;MACxCC,MAAAA,IAAI,EAAAC,CAAAA,qBAAA,GAAEC,KAAK,CAACC,UAAU,CAACH,IAAI,MAAAC,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAI,EAAE;MACjCG,MAAAA,OAAO,EAAAC,CAAAA,qBAAA,GAAEH,KAAK,CAACC,UAAU,CAACC,OAAO,MAAAC,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAI,EAAE;MACvCC,MAAAA,UAAU,EAAAC,CAAAA,qBAAA,GAAEL,KAAK,CAACC,UAAU,CAACG,UAAU,MAAAC,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAI,EAAE;MAC7CC,MAAAA,KAAK,EAAAC,CAAAA,qBAAA,GAAEP,KAAK,CAACC,UAAU,CAACK,KAAK,MAAAC,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAI,EAAE;MACnCC,MAAAA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