Background: for T322209, I have an HTMLMultiSelectField, and an HTMLInfoField whose visibility should be toggled depending on whether certain options are selected in the multiselect. If the possible options for the multiselect are 1, 2, 3, 4, and 5, I want the info field to be hidden if none of 1, 2, and 3 are selected. Encoding this with the currently supported hide-if syntax is impossible for two reasons. First, only scalars can be used in comparisons, which means fields like HTMLMultiSelectField (whose value is an array) cannot be used in hide-if altogether. Secondarily, even if array values were supported, I could still only use equality checks. Hence, the hide-if conditions would be something like: x === [] OR x === [4] OR x === [5] OR x === [4,5], which is quite heavy. This can easily get out of hand depending on the number of options that control the hide-if.
Proposal: allow arrays to be used as values in hide-if/disable-if conditions. This could be limited to arrays of scalars for the time being. Then, add support for operations on said arrays. An in_array equivalent would perhaps be a good start, and still be simple enough. The conditions above would be rewritten as in_array( 4, x ) OR in_array( 5, x ). Support for array intersection would be even nicer, but I guess that's more niche, and therefore not necessary.
