{"version":3,"file":"multiSelectFieldComponents.js","sources":["../../../Framework/FieldTypes/multiSelectField.partial.ts","../../../Framework/FieldTypes/multiSelectFieldComponents.ts"],"sourcesContent":["// <copyright>\r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// </copyright>\r\n//\r\nimport { Component } from \"vue\";\r\nimport { defineAsyncComponent } from \"@Obsidian/Utility/component\";\r\nimport { ComparisonType } from \"@Obsidian/Enums/Reporting/comparisonType\";\r\nimport { containsComparisonTypes } from \"@Obsidian/Core/Reporting/comparisonType\";\r\nimport { ComparisonValue } from \"@Obsidian/Types/Reporting/comparisonValue\";\r\nimport { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\nimport { FieldTypeBase } from \"./fieldType\";\r\nimport { getStandardFilterComponent } from \"./utils\";\r\n\r\nexport const enum ConfigurationValueKey {\r\n    Values = \"values\",\r\n    RepeatColumns = \"repeatColumns\",\r\n    RepeatDirection = \"repeatDirection\",\r\n    EnhancedSelection = \"enhancedselection\",\r\n\r\n    /** Only used during editing of the field type configuration. */\r\n    CustomValues = \"customValues\"\r\n}\r\n\r\n\r\n// The edit component can be quite large, so load it only as needed.\r\nconst editComponent = defineAsyncComponent(async () => {\r\n    return (await import(\"./multiSelectFieldComponents\")).EditComponent;\r\n});\r\n\r\n// Load the filter component only as needed.\r\nconst filterComponent = defineAsyncComponent(async () => {\r\n    return (await import(\"./multiSelectFieldComponents\")).FilterComponent;\r\n});\r\n\r\n// Load the configuration component only as needed.\r\nconst configurationComponent = defineAsyncComponent(async () => {\r\n    return (await import(\"./multiSelectFieldComponents\")).ConfigurationComponent;\r\n});\r\n\r\n/**\r\n * The field type handler for the MultiSelect field.\r\n */\r\nexport class MultiSelectFieldType extends FieldTypeBase {\r\n    public override getTextValue(value: string, configurationValues: Record<string, string>): string {\r\n        if (value === \"\") {\r\n            return \"\";\r\n        }\r\n\r\n        try {\r\n            const values = JSON.parse(configurationValues[ConfigurationValueKey.Values] ?? \"[]\") as ListItemBag[];\r\n            const userValues = value.split(\",\");\r\n            const selectedValues = values.filter(v => userValues.includes(v.value ?? \"\"));\r\n\r\n            return selectedValues.map(v => v.text).join(\", \");\r\n        }\r\n        catch {\r\n            return value;\r\n        }\r\n    }\r\n\r\n    public override getEditComponent(): Component {\r\n        return editComponent;\r\n    }\r\n\r\n    public override getConfigurationComponent(): Component {\r\n        return configurationComponent;\r\n    }\r\n\r\n    public override getSupportedComparisonTypes(): ComparisonType {\r\n        return containsComparisonTypes;\r\n    }\r\n\r\n    public override getFilterComponent(): Component {\r\n        return getStandardFilterComponent(this.getSupportedComparisonTypes(), filterComponent);\r\n    }\r\n\r\n    public override getFilterValueText(value: ComparisonValue, configurationValues: Record<string, string>): string {\r\n        if (value.value === \"\") {\r\n            return \"\";\r\n        }\r\n\r\n        try {\r\n            const rawValues = value.value.split(\",\");\r\n            const values = JSON.parse(configurationValues?.[ConfigurationValueKey.Values] ?? \"[]\") as ListItemBag[];\r\n            const selectedValues = values.filter(v => rawValues.includes(v.value ?? \"\"));\r\n\r\n            if (selectedValues.length >= 1) {\r\n                return `'${selectedValues.map(v => v.value).join(\"' OR '\")}'`;\r\n            }\r\n            else {\r\n                return \"\";\r\n            }\r\n        }\r\n        catch {\r\n            return value.value;\r\n        }\r\n    }\r\n\r\n    public override doesValueMatchFilter(value: string, filterValue: ComparisonValue, _configurationValues: Record<string, string>): boolean {\r\n        const selectedValues = (filterValue.value ?? \"\").split(\",\").filter(v => v !== \"\").map(v => v.toLowerCase());\r\n        let comparisonType = filterValue.comparisonType;\r\n\r\n        if (comparisonType === ComparisonType.EqualTo) {\r\n            // Treat EqualTo as if it were Contains.\r\n            comparisonType = ComparisonType.Contains;\r\n        }\r\n        else if (comparisonType === ComparisonType.NotEqualTo) {\r\n            // Treat NotEqualTo as if it were DoesNotContain.\r\n            comparisonType = ComparisonType.DoesNotContain;\r\n        }\r\n\r\n        if (comparisonType === ComparisonType.IsBlank) {\r\n            return value === \"\";\r\n        }\r\n        else if (comparisonType === ComparisonType.IsNotBlank) {\r\n            return value !== \"\";\r\n        }\r\n\r\n        if (selectedValues.length > 0) {\r\n            const userValues = value?.split(\",\").filter(v => v !== \"\").map(v => v.toLowerCase()) ?? [];\r\n\r\n            if (comparisonType === ComparisonType.Contains) {\r\n                let matchedCount = 0;\r\n\r\n                for (const userValue of userValues) {\r\n                    if (selectedValues.includes(userValue)) {\r\n                        matchedCount += 1;\r\n                    }\r\n                }\r\n\r\n                return matchedCount > 0;\r\n            }\r\n            else {\r\n                let matchedCount = 0;\r\n\r\n                for (const userValue of userValues) {\r\n                    if (selectedValues.includes(userValue)) {\r\n                        matchedCount += 1;\r\n                    }\r\n                }\r\n\r\n                return matchedCount !== selectedValues.length;\r\n            }\r\n        }\r\n\r\n        return false;\r\n    }\r\n}\r\n","// <copyright>\r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// </copyright>\r\n//\r\nimport { computed, defineComponent, inject, ref, watch } from \"vue\";\r\nimport CheckBoxList from \"@Obsidian/Controls/checkBoxList.obs\";\r\nimport DropDownList from \"@Obsidian/Controls/dropDownList.obs\";\r\nimport ListBox from \"@Obsidian/Controls/listBox.obs\";\r\nimport NumberBox from \"@Obsidian/Controls/numberBox.obs\";\r\nimport TextBox from \"@Obsidian/Controls/textBox.obs\";\r\nimport { asBoolean, asBooleanOrNull, asTrueFalseOrNull } from \"@Obsidian/Utility/booleanUtils\";\r\nimport { toNumberOrNull } from \"@Obsidian/Utility/numberUtils\";\r\nimport { updateRefValue } from \"@Obsidian/Utility/component\";\r\nimport { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\nimport { ConfigurationValueKey } from \"./multiSelectField.partial\";\r\nimport { getFieldConfigurationProps, getFieldEditorProps } from \"./utils\";\r\n\r\nexport const EditComponent = defineComponent({\r\n    name: \"MultiSelectField.Edit\",\r\n\r\n    components: {\r\n        ListBox,\r\n        CheckBoxList\r\n    },\r\n\r\n    props: getFieldEditorProps(),\r\n\r\n    setup() {\r\n        return {\r\n            isRequired: inject(\"isRequired\") as boolean\r\n        };\r\n    },\r\n\r\n    data() {\r\n        return {\r\n            internalValue: [] as string[]\r\n        };\r\n    },\r\n\r\n    computed: {\r\n        /** The options to choose from */\r\n        options(): ListItemBag[] {\r\n            try {\r\n                const valuesConfig = JSON.parse(this.configurationValues[ConfigurationValueKey.Values] ?? \"[]\") as ListItemBag[];\r\n\r\n                return valuesConfig.map(v => {\r\n                    return {\r\n                        text: v.text,\r\n                        value: v.value\r\n                    } as ListItemBag;\r\n                });\r\n            }\r\n            catch {\r\n                return [];\r\n            }\r\n        },\r\n\r\n        /** Any additional attributes that will be assigned to the list box control */\r\n        listBoxConfigAttributes(): Record<string, number | boolean> {\r\n            const attributes: Record<string, number | boolean> = {};\r\n            const enhancedSelection = this.configurationValues[ConfigurationValueKey.EnhancedSelection];\r\n\r\n            if (asBoolean(enhancedSelection)) {\r\n                attributes.enhanceForLongLists = true;\r\n            }\r\n\r\n            return attributes;\r\n        },\r\n\r\n        /** Any additional attributes that will be assigned to the check box list control */\r\n        checkBoxListConfigAttributes(): Record<string, number | boolean> {\r\n            const attributes: Record<string, number | boolean> = {};\r\n            const repeatColumnsConfig = this.configurationValues[ConfigurationValueKey.RepeatColumns];\r\n            const repeatDirection = this.configurationValues[ConfigurationValueKey.RepeatDirection];\r\n\r\n            if (repeatColumnsConfig) {\r\n                attributes[\"repeatColumns\"] = toNumberOrNull(repeatColumnsConfig) || 0;\r\n            }\r\n\r\n            if (repeatDirection !== \"1\") {\r\n                attributes[\"horizontal\"] = true;\r\n            }\r\n\r\n            return attributes;\r\n        },\r\n\r\n        /** Is the control going to be list box? */\r\n        isListBox(): boolean {\r\n            const enhancedSelection = this.configurationValues[ConfigurationValueKey.EnhancedSelection];\r\n\r\n            return asBoolean(enhancedSelection);\r\n        }\r\n    },\r\n\r\n    watch: {\r\n        internalValue() {\r\n            this.$emit(\"update:modelValue\", this.internalValue.join(\",\"));\r\n        },\r\n\r\n        modelValue: {\r\n            immediate: true,\r\n            handler() {\r\n                const value = this.modelValue || \"\";\r\n\r\n                this.internalValue = value !== \"\" ? value.split(\",\") : [];\r\n            }\r\n        }\r\n    },\r\n\r\n    template: `\r\n<ListBox v-if=\"isListBox && options.length > 0\" v-model=\"internalValue\" v-bind=\"listBoxConfigAttributes\" :items=\"options\" />\r\n<CheckBoxList v-else-if=\"options.length > 0\" v-model=\"internalValue\" v-bind=\"checkBoxListConfigAttributes\" :items=\"options\" />\r\n`\r\n});\r\n\r\nexport const FilterComponent = defineComponent({\r\n    name: \"MultiSelectField.Filter\",\r\n\r\n    components: {\r\n        CheckBoxList\r\n    },\r\n\r\n    props: getFieldEditorProps(),\r\n\r\n    setup(props, { emit }) {\r\n        const internalValue = ref(props.modelValue.split(\",\").filter(v => v !== \"\"));\r\n\r\n        const options = computed((): ListItemBag[] => {\r\n            try {\r\n                const providedOptions = JSON.parse(props.configurationValues[ConfigurationValueKey.Values] ?? \"[]\") as ListItemBag[];\r\n\r\n                return providedOptions;\r\n            }\r\n            catch {\r\n                return [];\r\n            }\r\n        });\r\n\r\n        watch(() => props.modelValue, () => {\r\n            updateRefValue(internalValue, props.modelValue.split(\",\").filter(v => v !== \"\"));\r\n        });\r\n\r\n        watch(internalValue, () => {\r\n            emit(\"update:modelValue\", internalValue.value.join(\",\"));\r\n        });\r\n\r\n        return {\r\n            internalValue,\r\n            options\r\n        };\r\n    },\r\n\r\n    template: `\r\n<CheckBoxList v-model=\"internalValue\" :items=\"options\" horizontal />\r\n`\r\n});\r\n\r\nconst repeatDirectionOptions: ListItemBag[] = [\r\n    {\r\n        value: \"0\",\r\n        text: \"Horizontal\"\r\n    },\r\n    {\r\n        value: \"1\",\r\n        text: \"Vertical\"\r\n    }\r\n];\r\n\r\nexport const ConfigurationComponent = defineComponent({\r\n    name: \"MultiSelectField.Configuration\",\r\n\r\n    components: {\r\n        DropDownList,\r\n        TextBox,\r\n        NumberBox\r\n    },\r\n\r\n    props: getFieldConfigurationProps(),\r\n\r\n    emits: [\r\n        \"update:modelValue\",\r\n        \"updateConfiguration\",\r\n        \"updateConfigurationValue\"\r\n    ],\r\n\r\n    setup(props, { emit }) {\r\n        // Define the properties that will hold the current selections.\r\n        const rawValues = ref(\"\");\r\n        const internalRawValues = ref(\"\");\r\n        const enhanceForLongLists = ref(false);\r\n        const repeatColumns = ref<number | null>(null);\r\n        const repeatDirection = ref(\"\");\r\n\r\n        const onBlur = (): void => {\r\n            internalRawValues.value = rawValues.value;\r\n        };\r\n\r\n        /**\r\n         * Update the modelValue property if any value of the dictionary has\r\n         * actually changed. This helps prevent unwanted postbacks if the value\r\n         * didn't really change - which can happen if multiple values get updated\r\n         * at the same time.\r\n         *\r\n         * @returns true if a new modelValue was emitted to the parent component.\r\n         */\r\n        const maybeUpdateModelValue = (): boolean => {\r\n            const newValue: Record<string, string> = {...props.modelValue};\r\n\r\n            // Construct the new value that will be emitted if it is different\r\n            // than the current value.\r\n            newValue[ConfigurationValueKey.CustomValues] = internalRawValues.value ?? \"\";\r\n            newValue[ConfigurationValueKey.EnhancedSelection] = asTrueFalseOrNull(enhanceForLongLists.value) ?? \"False\";\r\n            newValue[ConfigurationValueKey.RepeatColumns] = repeatColumns.value?.toString() ?? \"\";\r\n            newValue[ConfigurationValueKey.RepeatDirection] = repeatDirection.value ?? \"0\";\r\n\r\n            // Compare the new value and the old value.\r\n            const anyValueChanged = newValue[ConfigurationValueKey.CustomValues] !== (props.modelValue[ConfigurationValueKey.CustomValues] ?? \"\")\r\n                || newValue[ConfigurationValueKey.EnhancedSelection] !== (props.modelValue[ConfigurationValueKey.EnhancedSelection] ?? \"False\")\r\n                || newValue[ConfigurationValueKey.RepeatColumns] !== (props.modelValue[ConfigurationValueKey.RepeatColumns] ?? \"\")\r\n                || newValue[ConfigurationValueKey.RepeatDirection] !== (props.modelValue[ConfigurationValueKey.RepeatDirection] ?? \"0\");\r\n\r\n\r\n            // If any value changed then emit the new model value.\r\n            if (anyValueChanged) {\r\n                emit(\"update:modelValue\", newValue);\r\n                return true;\r\n            }\r\n            else {\r\n                return false;\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Emits the updateConfigurationValue if the value has actually changed.\r\n         *\r\n         * @param key The key that was possibly modified.\r\n         * @param value The new value.\r\n         */\r\n        const maybeUpdateConfiguration = (key: string, value: string): void => {\r\n            if (maybeUpdateModelValue()) {\r\n                emit(\"updateConfigurationValue\", key, value);\r\n            }\r\n        };\r\n\r\n        // Watch for changes coming in from the parent component and update our\r\n        // data to match the new information.\r\n        watch(() => [props.modelValue, props.configurationProperties], () => {\r\n            rawValues.value = props.modelValue[ConfigurationValueKey.CustomValues] ?? \"\";\r\n            internalRawValues.value = rawValues.value;\r\n            enhanceForLongLists.value = asBooleanOrNull(props.modelValue[ConfigurationValueKey.EnhancedSelection]) ?? false;\r\n            repeatColumns.value = toNumberOrNull(props.modelValue[ConfigurationValueKey.RepeatColumns]);\r\n            repeatDirection.value = props.modelValue[ConfigurationValueKey.RepeatDirection] ?? \"0\";\r\n        }, {\r\n            immediate: true\r\n        });\r\n\r\n        // Watch for changes in properties that require new configuration\r\n        // properties to be retrieved from the server.\r\n        watch([internalRawValues], () => {\r\n            if (maybeUpdateModelValue()) {\r\n                emit(\"updateConfiguration\");\r\n            }\r\n        });\r\n\r\n        // Watch for changes in properties that only require a local UI update.\r\n        watch(enhanceForLongLists, () => maybeUpdateConfiguration(ConfigurationValueKey.EnhancedSelection, asTrueFalseOrNull(enhanceForLongLists.value) ?? \"False\"));\r\n        watch(repeatColumns, () => maybeUpdateConfiguration(ConfigurationValueKey.RepeatColumns, repeatColumns.value?.toString() ?? \"\"));\r\n        watch(repeatDirection, () => maybeUpdateConfiguration(ConfigurationValueKey.RepeatDirection, repeatDirection.value ?? \"0\"));\r\n\r\n        return {\r\n            enhanceForLongLists,\r\n            onBlur,\r\n            rawValues,\r\n            repeatColumns,\r\n            repeatDirection,\r\n            repeatDirectionOptions\r\n        };\r\n    },\r\n\r\n    template: `\r\n<div>\r\n    <TextBox v-model=\"rawValues\"\r\n        label=\"Values\"\r\n        help=\"The source of the values to display in a list. Format is either 'value1,value2,value3,...', 'value1^text1,value2^text2,value3^text3,...', or a SQL Select statement that returns a result set with a 'Value' and 'Text' column <span class='tip tip-lava'></span>.\"\r\n        textMode=\"multiline\"\r\n        @blur=\"onBlur\" />\r\n\r\n    <CheckBox v-model=\"enhanceForLongLists\"\r\n        label=\"Enhance For Long Lists\"\r\n        help=\"When set, will render a searchable selection of options.\" />\r\n\r\n    <NumberBox\r\n        v-model=\"repeatColumns\"\r\n        label=\"Columns\"\r\n        help=\"Select how many columns the list should use before going to the next row. If blank or 0 then 4 columns will be displayed. There is no enforced upper limit however the block this control is used in might add contraints due to available space.\" />\r\n\r\n    <DropDownList v-model=\"repeatDirection\"\r\n        label=\"Repeat Direction\"\r\n        help=\"The direction that the list options will be displayed.\"\r\n        :items=\"repeatDirectionOptions\"\r\n        :showBlankItem=\"false\" />\r\n</div>\r\n`\r\n});\r\n"],"names":["ConfigurationValueKey","defineAsyncComponent","_asyncToGenerator","EditComponent","FilterComponent","ConfigurationComponent","defineComponent","name","components","ListBox","CheckBoxList","props","getFieldEditorProps","setup","isRequired","inject","data","internalValue","computed","options","_this$configurationVa","valuesConfig","JSON","parse","configurationValues","Values","map","v","text","value","_unused","listBoxConfigAttributes","attributes","enhancedSelection","EnhancedSelection","asBoolean","enhanceForLongLists","checkBoxListConfigAttributes","repeatColumnsConfig","RepeatColumns","repeatDirection","RepeatDirection","toNumberOrNull","isListBox","watch","$emit","join","modelValue","immediate","handler","split","template","_ref","emit","ref","filter","_props$configurationV","providedOptions","_unused2","updateRefValue","repeatDirectionOptions","DropDownList","TextBox","NumberBox","getFieldConfigurationProps","emits","_ref2","rawValues","internalRawValues","repeatColumns","onBlur","maybeUpdateModelValue","_internalRawValues$va","_asTrueFalseOrNull","_repeatColumns$value$","_repeatColumns$value","_repeatDirection$valu","_props$modelValue$Con","_props$modelValue$Con2","_props$modelValue$Con3","_props$modelValue$Con4","newValue","_objectSpread","CustomValues","asTrueFalseOrNull","toString","anyValueChanged","maybeUpdateConfiguration","key","configurationProperties","_props$modelValue$Con5","_asBooleanOrNull","_props$modelValue$Con6","asBooleanOrNull","_asTrueFalseOrNull2","_repeatColumns$value$2","_repeatColumns$value2","_repeatDirection$valu2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyBkBA,IAAAA,qBAAqB,aAArBA,qBAAqB,EAAA;QAArBA,qBAAqB,CAAA,QAAA,CAAA,GAAA,QAAA,CAAA;QAArBA,qBAAqB,CAAA,eAAA,CAAA,GAAA,eAAA,CAAA;QAArBA,qBAAqB,CAAA,iBAAA,CAAA,GAAA,iBAAA,CAAA;QAArBA,qBAAqB,CAAA,mBAAA,CAAA,GAAA,mBAAA,CAAA;QAArBA,qBAAqB,CAAA,cAAA,CAAA,GAAA,cAAA,CAAA;MAAA,EAAA,OAArBA,qBAAqB,CAAA;MAAA,CAAA,CAAA,EAAA,CAAA,CAAA;MAYjBC,oBAAoB,CA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