{"version":3,"file":"booleanFieldComponents.js","sources":["../../../Framework/FieldTypes/booleanField.partial.ts","../../../Framework/FieldTypes/booleanFieldComponents.ts"],"sourcesContent":["// \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// \r\n//\r\nimport { Component } from \"vue\";\r\nimport { ComparisonType } from \"@Obsidian/Enums/Reporting/comparisonType\";\r\nimport { asBooleanOrNull } from \"@Obsidian/Utility/booleanUtils\";\r\nimport { defineAsyncComponent } from \"@Obsidian/Utility/component\";\r\nimport { FieldTypeBase } from \"./fieldType\";\r\nimport { getStandardFilterComponent } from \"./utils\";\r\n\r\nexport const enum ConfigurationValueKey {\r\n BooleanControlType = \"BooleanControlType\",\r\n FalseText = \"falsetext\",\r\n TrueText = \"truetext\"\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(\"./booleanFieldComponents\")).EditComponent;\r\n});\r\n\r\n// The configuration component can be quite large, so load it only as needed.\r\nconst configurationComponent = defineAsyncComponent(async () => {\r\n return (await import(\"./booleanFieldComponents\")).ConfigurationComponent;\r\n});\r\n\r\n// Only load the filter component as needed.\r\nconst filterComponent = defineAsyncComponent(async () => {\r\n return (await import(\"./booleanFieldComponents\")).FilterComponent;\r\n});\r\n\r\n/**\r\n * The field type handler for the Boolean field.\r\n */\r\nexport class BooleanFieldType extends FieldTypeBase {\r\n public override getCondensedTextValue(value: string, _configurationValues: Record): string {\r\n const boolValue = asBooleanOrNull(value);\r\n\r\n if (boolValue === null) {\r\n return \"\";\r\n }\r\n else if (boolValue === true) {\r\n return \"Y\";\r\n }\r\n else {\r\n return \"N\";\r\n }\r\n }\r\n\r\n public override getTextValue(value: string, configurationValues: Record): string {\r\n const boolValue = asBooleanOrNull(value);\r\n\r\n if (boolValue === null) {\r\n return \"\";\r\n }\r\n else if (boolValue === true) {\r\n return configurationValues[ConfigurationValueKey.TrueText] || \"Yes\";\r\n }\r\n else {\r\n return configurationValues[ConfigurationValueKey.FalseText] || \"No\";\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 ComparisonType.EqualTo | ComparisonType.NotEqualTo;\r\n }\r\n\r\n public override getFilterComponent(): Component {\r\n return getStandardFilterComponent(this.getSupportedComparisonTypes(), filterComponent);\r\n }\r\n}\r\n","// \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// \r\n//\r\nimport { defineComponent, ref, computed, watch } from \"vue\";\r\nimport { getFieldConfigurationProps, getFieldEditorProps } from \"./utils\";\r\nimport { asTrueFalseOrNull, asBoolean } from \"@Obsidian/Utility/booleanUtils\";\r\nimport { ConfigurationValueKey } from \"./booleanField.partial\";\r\nimport DropDownList from \"@Obsidian/Controls/dropDownList\";\r\nimport Toggle from \"@Obsidian/Controls/toggle\";\r\nimport CheckBox from \"@Obsidian/Controls/checkBox\";\r\nimport TextBox from \"@Obsidian/Controls/textBox\";\r\nimport { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\nimport { toNumberOrNull } from \"@Obsidian/Utility/numberUtils\";\r\n\r\nenum BooleanControlType {\r\n DropDown,\r\n Checkbox,\r\n Toggle\r\n}\r\n\r\nexport const EditComponent = defineComponent({\r\n name: \"BooleanField.Edit\",\r\n components: {\r\n DropDownList,\r\n Toggle,\r\n CheckBox\r\n },\r\n props: getFieldEditorProps(),\r\n\r\n emits: [\"update:modelValue\"],\r\n\r\n setup(props, { emit }) {\r\n // Internal values\r\n const internalBooleanValue = ref(asBoolean(props.modelValue));\r\n const internalValue = ref(asTrueFalseOrNull(props.modelValue) || \"\");\r\n\r\n // Which control type should be used for value selection\r\n const booleanControlType = computed((): BooleanControlType => {\r\n const controlType = props.configurationValues[ConfigurationValueKey.BooleanControlType];\r\n\r\n switch (controlType) {\r\n case \"1\":\r\n return BooleanControlType.Checkbox;\r\n case \"2\":\r\n return BooleanControlType.Toggle;\r\n default:\r\n return BooleanControlType.DropDown;\r\n }\r\n });\r\n\r\n // Helpers to determine control type in the template\r\n const isToggle = computed((): boolean => booleanControlType.value === BooleanControlType.Toggle);\r\n const isCheckBox = computed((): boolean => booleanControlType.value === BooleanControlType.Checkbox);\r\n\r\n // What labels does the user see for the true/false values\r\n const trueText = computed((): string => {\r\n let trueText = \"Yes\";\r\n const trueConfig = props.configurationValues[ConfigurationValueKey.TrueText];\r\n\r\n if (trueConfig) {\r\n trueText = trueConfig;\r\n }\r\n\r\n return trueText || \"Yes\";\r\n });\r\n\r\n const falseText = computed((): string => {\r\n let falseText = \"No\";\r\n const falseConfig = props.configurationValues[ConfigurationValueKey.FalseText];\r\n\r\n if (falseConfig) {\r\n falseText = falseConfig;\r\n }\r\n\r\n return falseText || \"No\";\r\n });\r\n \r\n // configuration for a toggle button\r\n const toggleOptions = computed((): Record => ({\r\n trueText: trueText.value,\r\n falseText: falseText.value\r\n }));\r\n\r\n // configuration for a dropdown control\r\n const dropDownListOptions = computed((): ListItemBag[] => {\r\n const trueVal = asTrueFalseOrNull(true);\r\n const falseVal = asTrueFalseOrNull(false);\r\n\r\n return [\r\n { text: falseText.value, value: falseVal },\r\n { text: trueText.value, value: trueVal }\r\n ] as ListItemBag[];\r\n });\r\n\r\n // Sync internal values and modelValue\r\n watch(internalValue, () => {\r\n if (booleanControlType.value === BooleanControlType.DropDown) {\r\n emit(\"update:modelValue\", internalValue.value);\r\n }\r\n });\r\n\r\n watch(internalBooleanValue, () => {\r\n if (booleanControlType.value !== BooleanControlType.DropDown) {\r\n emit(\"update:modelValue\", asTrueFalseOrNull(internalBooleanValue.value) || \"\");\r\n }\r\n });\r\n\r\n watch(() => props.modelValue, () => {\r\n internalValue.value = asTrueFalseOrNull(props.modelValue) || \"\";\r\n internalBooleanValue.value = asBoolean(props.modelValue);\r\n });\r\n\r\n return {\r\n internalBooleanValue,\r\n internalValue,\r\n booleanControlType,\r\n isToggle,\r\n isCheckBox,\r\n toggleOptions,\r\n dropDownListOptions\r\n };\r\n },\r\n template: `\r\n\r\n\r\n\r\n`\r\n});\r\n\r\nexport const FilterComponent = defineComponent({\r\n name: \"BooleanField.Filter\",\r\n components: {\r\n DropDownList\r\n },\r\n props: getFieldEditorProps(),\r\n\r\n emits: [\r\n \"update:modelValue\"\r\n ],\r\n\r\n setup(props, { emit }) {\r\n // Internal values\r\n const internalValue = ref(asTrueFalseOrNull(props.modelValue) || \"\");\r\n\r\n // Sync internal values and modelValue\r\n watch(internalValue, () => {\r\n emit(\"update:modelValue\", internalValue.value);\r\n });\r\n\r\n watch(() => props.modelValue, () => {\r\n internalValue.value = asTrueFalseOrNull(props.modelValue) || \"\";\r\n });\r\n\r\n // What labels does the user see for the true/false values\r\n const trueText = computed((): string => {\r\n const trueConfig = props.configurationValues[ConfigurationValueKey.TrueText];\r\n\r\n return trueConfig || \"Yes\";\r\n });\r\n\r\n const falseText = computed((): string => {\r\n const falseConfig = props.configurationValues[ConfigurationValueKey.FalseText];\r\n\r\n return falseConfig || \"No\";\r\n });\r\n\r\n // configuration for a dropdown control\r\n const dropDownListOptions = computed((): ListItemBag[] => {\r\n const trueVal = asTrueFalseOrNull(true);\r\n const falseVal = asTrueFalseOrNull(false);\r\n\r\n return [\r\n { text: falseText.value, value: falseVal },\r\n { text: trueText.value, value: trueVal }\r\n ] as ListItemBag[];\r\n });\r\n\r\n return {\r\n internalValue,\r\n dropDownListOptions\r\n };\r\n },\r\n template: `\r\n\r\n`\r\n});\r\n\r\nexport const ConfigurationComponent = defineComponent({\r\n name: \"BooleanField.Configuration\",\r\n\r\n components: { TextBox, DropDownList },\r\n\r\n props: getFieldConfigurationProps(),\r\n\r\n emits: [\"update:modelValue\", \"updateConfiguration\", \"updateConfigurationValue\"],\r\n\r\n setup(props, { emit }) {\r\n const trueText = ref(\"Yes\");\r\n const falseText = ref(\"No\");\r\n const controlType = ref(BooleanControlType.DropDown);\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 = {};\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.TrueText] = trueText.value ?? \"Yes\";\r\n newValue[ConfigurationValueKey.FalseText] = falseText.value ?? \"No\";\r\n newValue[ConfigurationValueKey.BooleanControlType] = controlType.value?.toString() ?? BooleanControlType.DropDown.toString();\r\n\r\n // Compare the new value and the old value.\r\n const anyValueChanged = newValue[ConfigurationValueKey.TrueText] !== (props.modelValue[ConfigurationValueKey.TrueText] ?? \"Yes\")\r\n || newValue[ConfigurationValueKey.FalseText] !== (props.modelValue[ConfigurationValueKey.FalseText] ?? \"No\")\r\n || newValue[ConfigurationValueKey.BooleanControlType] !== (props.modelValue[ConfigurationValueKey.BooleanControlType] ?? BooleanControlType.DropDown);\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 trueText.value = props.modelValue[ConfigurationValueKey.TrueText] ?? \"Yes\";\r\n falseText.value = props.modelValue[ConfigurationValueKey.FalseText] ?? \"No\";\r\n controlType.value = toNumberOrNull(props.modelValue[ConfigurationValueKey.BooleanControlType]) ?? 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([], () => {\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(trueText, () => maybeUpdateConfiguration(ConfigurationValueKey.TrueText, trueText.value ?? \"Yes\"));\r\n watch(falseText, () => maybeUpdateConfiguration(ConfigurationValueKey.FalseText, falseText.value ?? \"No\"));\r\n watch(controlType, () => maybeUpdateConfiguration(ConfigurationValueKey.BooleanControlType, controlType.value?.toString() ?? \"0\"));\r\n\r\n const controlTypeOptions = [\r\n { text: \"Drop Down\", value: BooleanControlType.DropDown },\r\n { text: \"Checkbox\", value: BooleanControlType.Checkbox },\r\n { text: \"Toggle\", value: BooleanControlType.Toggle }\r\n ];\r\n\r\n return { controlTypeOptions, trueText, falseText, controlType };\r\n },\r\n\r\n template: `\r\n\r\n \r\n \r\n \r\n
\r\n`\r\n});\r\n"],"names":["ConfigurationValueKey","defineAsyncComponent","_asyncToGenerator","EditComponent","ConfigurationComponent","FilterComponent","BooleanControlType","defineComponent","name","components","DropDownList","Toggle","CheckBox","props","getFieldEditorProps","emits","setup","_ref","emit","internalBooleanValue","ref","asBoolean","modelValue","internalValue","asTrueFalseOrNull","booleanControlType","computed","controlType","configurationValues","Checkbox","DropDown","isToggle","value","isCheckBox","trueText","trueConfig","TrueText","falseText","falseConfig","FalseText","toggleOptions","dropDownListOptions","trueVal","falseVal","text","watch","template","_ref2","TextBox","getFieldConfigurationProps","_ref3","maybeUpdateModelValue","_trueText$value","_falseText$value","_controlType$value$to","_controlType$value","_props$modelValue$Con","_props$modelValue$Con2","_props$modelValue$Con3","newValue","toString","anyValueChanged","maybeUpdateConfiguration","key","configurationProperties","_props$modelValue$Con4","_props$modelValue$Con5","_toNumberOrNull","toNumberOrNull","immediate","_trueText$value2","_falseText$value2","_controlType$value$to2","_controlType$value2","controlTypeOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuBkBA,IAAAA,qBAAqB,aAArBA,qBAAqB,EAAA;QAArBA,qBAAqB,CAAA,oBAAA,CAAA,GAAA,oBAAA,CAAA;QAArBA,qBAAqB,CAAA,WAAA,CAAA,GAAA,WAAA,CAAA;QAArBA,qBAAqB,CAAA,UAAA,CAAA,GAAA,UAAA,CAAA;MAAA,EAAA,OAArBA,qBAAqB,CAAA;MAAA,CAAA,CAAA,EAAA,CAAA,CAAA;MAQjBC,oBAAoB,CAAAC,iBAAA,CAAC,aAAY;MACnD,EAAA,OAAO,OAAO,cAAO,0BAA0B,CAAC,EAAEC,aAAa,CAAA;MACnE,CAAC,CAAC,EAAA;MAG6BF,oBAAoB,CAAAC,iBAAA,CAAC,aAAY;MAC5D,EAAA,OAAO,OAAO,cAAO,0BAA0B,CAAC,EAAEE,sBAAsB,CAAA;MAC5E,CAAC,CAAC,EAAA;MAGsBH,oBAAoB,CAAAC,iBAAA,CAAC,aAAY;MACrD,EAAA,OAAO,OAAO,cAAO,0BAA0B,CAAC,EAAEG,eAAe,CAAA;MACrE,CAAC,CAAC;;MClB6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