{"version":3,"file":"rockAttributeFilter.obs.js","sources":["../../../Framework/Controls/rockAttributeFilter.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n    <component :is=\"filterComponent\"\r\n               v-model=\"internalValue\"\r\n               :configurationValues=\"configurationValues\"\r\n               :required=\"required\"\r\n               :filterMode=\"filterMode\" />\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n    import { computed, PropType } from \"vue\";\r\n    import { getFieldType } from \"@Obsidian/Utility/fieldTypes\";\r\n    import { ComparisonValue } from \"@Obsidian/Types/Reporting/comparisonValue\";\r\n    import { FilterMode } from \"@Obsidian/Core/Reporting/filterMode\";\r\n    import { useVModelPassthrough } from \"@Obsidian/Utility/component\";\r\n    import { PublicAttributeBag } from \"@Obsidian/ViewModels/Utility/publicAttributeBag\";\r\n    import { emptyGuid, toGuidOrNull } from \"@Obsidian/Utility/guid\";\r\n\r\n    const props = defineProps({\r\n        modelValue: {\r\n            type: Object as PropType<ComparisonValue>,\r\n            default: { value: \"\" }\r\n        },\r\n        attribute: {\r\n            type: Object as PropType<PublicAttributeBag>,\r\n            required: true\r\n        },\r\n        required: {\r\n            type: Boolean as PropType<boolean>,\r\n            default: false\r\n        },\r\n        filterMode: {\r\n            type: Number as PropType<FilterMode>,\r\n            default: FilterMode.Simple\r\n        }\r\n    });\r\n\r\n    const emit = defineEmits<{\r\n        (e: \"update:modelValue\", value: ComparisonValue): void;\r\n    }>();\r\n\r\n    /** The internal value used by the filter component. */\r\n    const internalValue = useVModelPassthrough(props, \"modelValue\", emit);\r\n\r\n    /** The field type instance being edited. */\r\n    const field = computed(() => {\r\n        return getFieldType(toGuidOrNull(props.attribute.fieldTypeGuid) ?? emptyGuid);\r\n    });\r\n\r\n    /** The filter component to use to display and edit the value. */\r\n    const filterComponent = computed(() => field.value?.getFilterComponent(configurationValues.value));\r\n\r\n    /** The configuration values for the editor component. */\r\n    const configurationValues = computed(() => props.attribute.configurationValues ?? {});\r\n</script>\r\n"],"names":["internalValue","useVModelPassthrough","props","emit","field","computed","_toGuidOrNull","getFieldType","toGuidOrNull","attribute","fieldTypeGuid","emptyGuid","filterComponent","_field$value","value","getFilterComponent","configurationValues","_props$attribute$conf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0CI,IAAMA,aAAa,GAAGC,oBAAoB,CAACC,KAAK,EAAE,YAAY,EAAEC,IAAI,CAAC,CAAA;MAGrE,IAAA,IAAMC,KAAK,GAAGC,QAAQ,CAAC,MAAM;MAAA,MAAA,IAAAC,aAAA,CAAA;MACzB,MAAA,OAAOC,YAAY,CAAAD,CAAAA,aAAA,GAACE,YAAY,CAACN,KAAK,CAACO,SAAS,CAACC,aAAa,CAAC,MAAAJ,IAAAA,IAAAA,aAAA,cAAAA,aAAA,GAAIK,SAAS,CAAC,CAAA;MACjF,KAAC,CAAC,CAAA;UAGF,IAAMC,eAAe,GAAGP,QAAQ,CAAC,MAAA;MAAA,MAAA,IAAAQ,YAAA,CAAA;MAAA,MAAA,OAAA,CAAAA,YAAA,GAAMT,KAAK,CAACU,KAAK,MAAAD,IAAAA,IAAAA,YAAA,KAAXA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,YAAA,CAAaE,kBAAkB,CAACC,mBAAmB,CAACF,KAAK,CAAC,CAAA;WAAC,CAAA,CAAA;UAGlG,IAAME,mBAAmB,GAAGX,QAAQ,CAAC,MAAA;MAAA,MAAA,IAAAY,qBAAA,CAAA;MAAA,MAAA,OAAA,CAAAA,qBAAA,GAAMf,KAAK,CAACO,SAAS,CAACO,mBAAmB,MAAA,IAAA,IAAAC,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI,EAAE,CAAA;WAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;"}