discourse/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-header.js
Joffrey JAFFEUX cb59681d86
DEV: select-kit third major update with focus on accessibility (#13303)
Major changes included:
- better support for screen readers
- trapping focus in modals
- better tabbing order in composer
- alerts on no content found/number of items found
- better autofocus in modals
- mini-tag-chooser is now a multi-select component
- each multi-select-component will now display selection on one row
2021-08-23 10:44:19 +02:00

22 lines
708 B
JavaScript

import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
import layout from "select-kit/templates/components/multi-select/multi-select-header";
import { computed } from "@ember/object";
import { reads } from "@ember/object/computed";
export default SelectKitHeaderComponent.extend({
tagName: "summary",
classNames: ["multi-select-header"],
layout,
caretUpIcon: reads("selectKit.options.caretUpIcon"),
caretDownIcon: reads("selectKit.options.caretDownIcon"),
caretIcon: computed(
"selectKit.isExpanded",
"caretUpIcon",
"caretDownIcon",
function () {
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
}
),
});