mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Co-locate select-kit component templates (#20779)
This commit is contained in:
parent
69a72015f0
commit
b3e063bc63
@ -1,12 +1,10 @@
|
|||||||
import ComboBoxSelectBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
import ComboBoxSelectBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/category-drop/category-drop-header";
|
|
||||||
import { readOnly } from "@ember/object/computed";
|
import { readOnly } from "@ember/object/computed";
|
||||||
import { schedule } from "@ember/runloop";
|
import { schedule } from "@ember/runloop";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default ComboBoxSelectBoxHeaderComponent.extend({
|
export default ComboBoxSelectBoxHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["category-drop-header"],
|
classNames: ["category-drop-header"],
|
||||||
classNameBindings: ["categoryStyleClass"],
|
classNameBindings: ["categoryStyleClass"],
|
||||||
categoryStyleClass: readOnly("site.category_style"),
|
categoryStyleClass: readOnly("site.category_style"),
|
||||||
|
@ -4,12 +4,10 @@ import Category from "discourse/models/category";
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/category-row";
|
|
||||||
import { setting } from "discourse/lib/computed";
|
import { setting } from "discourse/lib/computed";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["category-row"],
|
classNames: ["category-row"],
|
||||||
hideParentCategory: bool("selectKit.options.hideParentCategory"),
|
hideParentCategory: bool("selectKit.options.hideParentCategory"),
|
||||||
allowUncategorized: bool("selectKit.options.allowUncategorized"),
|
allowUncategorized: bool("selectKit.options.allowUncategorized"),
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/color-palettes/color-palettes-row";
|
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
classNames: ["color-palettes-row"],
|
classNames: ["color-palettes-row"],
|
||||||
layout,
|
|
||||||
|
|
||||||
palettes: computed("item.colors.[]", function () {
|
palettes: computed("item.colors.[]", function () {
|
||||||
return htmlSafe(
|
return htmlSafe(
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { and, reads } from "@ember/object/computed";
|
import { and, reads } from "@ember/object/computed";
|
||||||
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/combo-box/combo-box-header";
|
|
||||||
|
|
||||||
export default SingleSelectHeaderComponent.extend({
|
export default SingleSelectHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["combo-box-header"],
|
classNames: ["combo-box-header"],
|
||||||
clearable: reads("selectKit.options.clearable"),
|
clearable: reads("selectKit.options.clearable"),
|
||||||
caretUpIcon: reads("selectKit.options.caretUpIcon"),
|
caretUpIcon: reads("selectKit.options.caretUpIcon"),
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
import layout from "select-kit/templates/components/create-color-row";
|
|
||||||
import { schedule } from "@ember/runloop";
|
import { schedule } from "@ember/runloop";
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["create-color-row"],
|
classNames: ["create-color-row"],
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/dropdown-select-box/dropdown-select-box-header";
|
|
||||||
import { readOnly } from "@ember/object/computed";
|
import { readOnly } from "@ember/object/computed";
|
||||||
|
|
||||||
export default SingleSelectHeaderComponent.extend({
|
export default SingleSelectHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["dropdown-select-box-header"],
|
classNames: ["dropdown-select-box-header"],
|
||||||
classNameBindings: ["btnClassName", "btnStyleClass"],
|
classNameBindings: ["btnClassName", "btnStyleClass"],
|
||||||
showFullTitle: readOnly("selectKit.options.showFullTitle"),
|
showFullTitle: readOnly("selectKit.options.showFullTitle"),
|
||||||
@ -19,7 +17,6 @@ export default SingleSelectHeaderComponent.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
caretUpIcon: readOnly("selectKit.options.caretUpIcon"),
|
caretUpIcon: readOnly("selectKit.options.caretUpIcon"),
|
||||||
|
|
||||||
caretDownIcon: readOnly("selectKit.options.caretDownIcon"),
|
caretDownIcon: readOnly("selectKit.options.caretDownIcon"),
|
||||||
|
|
||||||
caretIcon: computed(
|
caretIcon: computed(
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/dropdown-select-box/dropdown-select-box-row";
|
|
||||||
import { readOnly } from "@ember/object/computed";
|
import { readOnly } from "@ember/object/computed";
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["dropdown-select-box-row"],
|
classNames: ["dropdown-select-box-row"],
|
||||||
|
|
||||||
description: readOnly("item.description"),
|
description: readOnly("item.description"),
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/email-group-user-chooser-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["email-group-user-chooser-row"],
|
classNames: ["email-group-user-chooser-row"],
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/flair-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["flair-row"],
|
classNames: ["flair-row"],
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import ComboBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
import ComboBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
||||||
import layout from "select-kit/templates/components/future-date-input-selector/future-date-input-selector-header";
|
|
||||||
|
|
||||||
export default ComboBoxHeaderComponent.extend({
|
export default ComboBoxHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: "future-date-input-selector-header",
|
classNames: "future-date-input-selector-header",
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/future-date-input-selector/future-date-input-selector-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["future-date-input-selector-row"],
|
classNames: ["future-date-input-selector-row"],
|
||||||
});
|
});
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import ComboBoxSelectBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
|
||||||
import layout from "select-kit/templates/components/mini-tag-chooser/mini-tag-chooser-header";
|
|
||||||
|
|
||||||
export default ComboBoxSelectBoxHeaderComponent.extend({
|
|
||||||
layout,
|
|
||||||
classNames: ["mini-tag-chooser-header"],
|
|
||||||
});
|
|
@ -1,13 +1,9 @@
|
|||||||
import { reads } from "@ember/object/computed";
|
import { reads } from "@ember/object/computed";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/mini-tag-chooser/selected-collection";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
|
|
||||||
layout,
|
|
||||||
|
|
||||||
selectedTags: reads("collection.content.selectedTags.[]"),
|
selectedTags: reads("collection.content.selectedTags.[]"),
|
||||||
|
|
||||||
tags: computed("selectedTags.[]", "selectKit.filter", function () {
|
tags: computed("selectedTags.[]", "selectKit.filter", function () {
|
||||||
|
@ -2,12 +2,10 @@ import SelectKitComponent from "select-kit/components/select-kit";
|
|||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import { isPresent } from "@ember/utils";
|
import { isPresent } from "@ember/utils";
|
||||||
import { next } from "@ember/runloop";
|
import { next } from "@ember/runloop";
|
||||||
import layout from "select-kit/templates/components/multi-select";
|
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
|
|
||||||
export default SelectKitComponent.extend({
|
export default SelectKitComponent.extend({
|
||||||
pluginApiIdentifiers: ["multi-select"],
|
pluginApiIdentifiers: ["multi-select"],
|
||||||
layout,
|
|
||||||
classNames: ["multi-select"],
|
classNames: ["multi-select"],
|
||||||
multiSelect: true,
|
multiSelect: true,
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/multi-select/format-selected-content";
|
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
import UtilsMixin from "select-kit/mixins/utils";
|
import UtilsMixin from "select-kit/mixins/utils";
|
||||||
|
|
||||||
export default Component.extend(UtilsMixin, {
|
export default Component.extend(UtilsMixin, {
|
||||||
tagName: "",
|
tagName: "",
|
||||||
layout,
|
|
||||||
content: null,
|
content: null,
|
||||||
selectKit: null,
|
selectKit: null,
|
||||||
|
|
||||||
|
@ -2,11 +2,9 @@ import I18n from "I18n";
|
|||||||
import SelectKitFilterComponent from "select-kit/components/select-kit/select-kit-filter";
|
import SelectKitFilterComponent from "select-kit/components/select-kit/select-kit-filter";
|
||||||
import { isEmpty } from "@ember/utils";
|
import { isEmpty } from "@ember/utils";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-filter";
|
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
|
|
||||||
export default SelectKitFilterComponent.extend({
|
export default SelectKitFilterComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["multi-select-filter"],
|
classNames: ["multi-select-filter"],
|
||||||
|
|
||||||
@discourseComputed("placeholder", "selectKit.hasSelection")
|
@discourseComputed("placeholder", "selectKit.hasSelection")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
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 { computed } from "@ember/object";
|
||||||
import { reads } from "@ember/object/computed";
|
import { reads } from "@ember/object/computed";
|
||||||
|
|
||||||
@ -7,11 +6,10 @@ export default SelectKitHeaderComponent.extend({
|
|||||||
tagName: "summary",
|
tagName: "summary",
|
||||||
classNames: ["multi-select-header"],
|
classNames: ["multi-select-header"],
|
||||||
attributeBindings: ["ariaLabel:aria-label"],
|
attributeBindings: ["ariaLabel:aria-label"],
|
||||||
layout,
|
|
||||||
|
|
||||||
caretUpIcon: reads("selectKit.options.caretUpIcon"),
|
caretUpIcon: reads("selectKit.options.caretUpIcon"),
|
||||||
caretDownIcon: reads("selectKit.options.caretDownIcon"),
|
caretDownIcon: reads("selectKit.options.caretDownIcon"),
|
||||||
ariaLabel: reads("selectKit.options.headerAriaLabel"),
|
ariaLabel: reads("selectKit.options.headerAriaLabel"),
|
||||||
|
|
||||||
caretIcon: computed(
|
caretIcon: computed(
|
||||||
"selectKit.isExpanded",
|
"selectKit.isExpanded",
|
||||||
"caretUpIcon",
|
"caretUpIcon",
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import SelectedNameComponent from "select-kit/components/selected-name";
|
import SelectedNameComponent from "select-kit/components/selected-name";
|
||||||
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/multi-select/selected-category";
|
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default SelectedNameComponent.extend({
|
export default SelectedNameComponent.extend({
|
||||||
classNames: ["selected-category"],
|
classNames: ["selected-category"],
|
||||||
layout,
|
|
||||||
|
|
||||||
badge: computed("item", function () {
|
badge: computed("item", function () {
|
||||||
return htmlSafe(
|
return htmlSafe(
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
{{#if this.category}}
|
||||||
|
<div class="category-status" aria-hidden="true">
|
||||||
|
{{#if this.hasParentCategory}}
|
||||||
|
{{#unless this.hideParentCategory}}
|
||||||
|
{{this.badgeForParentCategory}}
|
||||||
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
|
{{this.badgeForCategory}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if this.shouldDisplayDescription}}
|
||||||
|
<div class="category-desc" aria-hidden="true">{{dir-span
|
||||||
|
this.descriptionText
|
||||||
|
htmlSafe="true"
|
||||||
|
}}</div>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{html-safe this.label}}
|
||||||
|
{{/if}}
|
@ -1,11 +1,9 @@
|
|||||||
import CategoryRowComponent from "select-kit/components/category-row";
|
import CategoryRowComponent from "select-kit/components/category-row";
|
||||||
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/category-row";
|
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default CategoryRowComponent.extend({
|
export default CategoryRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: "none category-row",
|
classNames: "none category-row",
|
||||||
|
|
||||||
@discourseComputed("category")
|
@discourseComputed("category")
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
import DropdownSelectBoxHeaderComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-header";
|
import DropdownSelectBoxHeaderComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-header";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
import layout from "select-kit/templates/components/notifications-filter/notifications-filter-header";
|
|
||||||
|
|
||||||
export default DropdownSelectBoxHeaderComponent.extend({
|
export default DropdownSelectBoxHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
|
|
||||||
classNames: ["notifications-filter-header"],
|
classNames: ["notifications-filter-header"],
|
||||||
|
|
||||||
label: fmt("value", "user.user_notifications.filters.%@"),
|
label: fmt("value", "user.user_notifications.filters.%@"),
|
||||||
|
|
||||||
@discourseComputed("selectKit.isExpanded")
|
@discourseComputed("selectKit.isExpanded")
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import DropdownSelectBoxHeaderComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-header";
|
import DropdownSelectBoxHeaderComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-header";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/period-chooser/period-chooser-header";
|
|
||||||
|
|
||||||
export default DropdownSelectBoxHeaderComponent.extend({
|
export default DropdownSelectBoxHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["period-chooser-header"],
|
classNames: ["period-chooser-header"],
|
||||||
|
|
||||||
@discourseComputed("selectKit.isExpanded")
|
@discourseComputed("selectKit.isExpanded")
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";
|
import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/period-chooser/period-chooser-row";
|
|
||||||
|
|
||||||
export default DropdownSelectBoxRowComponent.extend({
|
export default DropdownSelectBoxRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["period-chooser-row"],
|
classNames: ["period-chooser-row"],
|
||||||
|
|
||||||
@discourseComputed("rowName")
|
@discourseComputed("rowName")
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import layout from "select-kit/templates/components/pinned-button";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
pluginApiIdentifiers: ["pinned-button"],
|
pluginApiIdentifiers: ["pinned-button"],
|
||||||
descriptionKey: "help",
|
descriptionKey: "help",
|
||||||
classNames: "pinned-button",
|
classNames: "pinned-button",
|
||||||
classNameBindings: ["isHidden"],
|
classNameBindings: ["isHidden"],
|
||||||
layout,
|
|
||||||
|
|
||||||
@discourseComputed("topic.pinned_globally", "pinned")
|
@discourseComputed("topic.pinned_globally", "pinned")
|
||||||
reasonText(pinnedGlobally, pinned) {
|
reasonText(pinnedGlobally, pinned) {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import layout from "select-kit/templates/components/select-kit/errors-collection";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
layout,
|
|
||||||
tagName: "",
|
tagName: "",
|
||||||
});
|
});
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { bind } from "@ember/runloop";
|
import { bind } from "@ember/runloop";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-body";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
layout,
|
|
||||||
classNames: ["select-kit-body"],
|
classNames: ["select-kit-body"],
|
||||||
classNameBindings: ["emptyBody:empty-body"],
|
classNameBindings: ["emptyBody:empty-body"],
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-collection";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
layout,
|
|
||||||
tagName: "",
|
tagName: "",
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: "create",
|
classNames: "create",
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
{{#unless this.isHidden}}
|
||||||
|
{{! filter-input-search prevents 1password from attempting autocomplete }}
|
||||||
|
{{! template-lint-disable no-down-event-binding }}
|
||||||
|
|
||||||
|
<Input
|
||||||
|
tabindex={{0}}
|
||||||
|
class="filter-input"
|
||||||
|
placeholder={{this.placeholder}}
|
||||||
|
autocomplete="off"
|
||||||
|
autocorrect="off"
|
||||||
|
autocapitalize="off"
|
||||||
|
name="filter-input-search"
|
||||||
|
spellcheck={{false}}
|
||||||
|
@value={{readonly this.selectKit.filter}}
|
||||||
|
@type="search"
|
||||||
|
{{on "paste" (action "onPaste")}}
|
||||||
|
{{on "keydown" (action "onKeydown")}}
|
||||||
|
{{on "keyup" (action "onKeyup")}}
|
||||||
|
{{on "input" (action "onInput")}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{{#if this.selectKit.options.filterIcon}}
|
||||||
|
{{d-icon this.selectKit.options.filterIcon class="filter-icon"}}
|
||||||
|
{{/if}}
|
||||||
|
{{/unless}}
|
@ -4,11 +4,9 @@ import UtilsMixin from "select-kit/mixins/utils";
|
|||||||
import { action, computed } from "@ember/object";
|
import { action, computed } from "@ember/object";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { isPresent } from "@ember/utils";
|
import { isPresent } from "@ember/utils";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-filter";
|
|
||||||
import { not } from "@ember/object/computed";
|
import { not } from "@ember/object/computed";
|
||||||
|
|
||||||
export default Component.extend(UtilsMixin, {
|
export default Component.extend(UtilsMixin, {
|
||||||
layout,
|
|
||||||
classNames: ["select-kit-filter"],
|
classNames: ["select-kit-filter"],
|
||||||
classNameBindings: ["isExpanded:is-expanded"],
|
classNameBindings: ["isExpanded:is-expanded"],
|
||||||
attributeBindings: ["role"],
|
attributeBindings: ["role"],
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{{#each this.icons as |icon|}}
|
||||||
|
{{d-icon icon translatedTitle=this.dasherizedTitle}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<span class="name">
|
||||||
|
{{this.label}}
|
||||||
|
</span>
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: "none",
|
classNames: "none",
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{{#each this.icons as |icon|}}
|
||||||
|
{{d-icon icon translatedTitle=this.dasherizedTitle}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<span class="name">
|
||||||
|
{{this.label}}
|
||||||
|
</span>
|
@ -3,16 +3,15 @@ import Component from "@ember/component";
|
|||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import UtilsMixin from "select-kit/mixins/utils";
|
import UtilsMixin from "select-kit/mixins/utils";
|
||||||
import { guidFor } from "@ember/object/internals";
|
import { guidFor } from "@ember/object/internals";
|
||||||
import layout from "select-kit/templates/components/select-kit/select-kit-row";
|
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
import { reads } from "@ember/object/computed";
|
import { reads } from "@ember/object/computed";
|
||||||
import { dasherize } from "@ember/string";
|
import { dasherize } from "@ember/string";
|
||||||
|
|
||||||
export default Component.extend(UtilsMixin, {
|
export default Component.extend(UtilsMixin, {
|
||||||
layout,
|
|
||||||
classNames: ["select-kit-row"],
|
classNames: ["select-kit-row"],
|
||||||
tagName: "li",
|
tagName: "li",
|
||||||
tabIndex: 0,
|
tabIndex: 0,
|
||||||
|
|
||||||
attributeBindings: [
|
attributeBindings: [
|
||||||
"tabIndex",
|
"tabIndex",
|
||||||
"title",
|
"title",
|
||||||
@ -24,6 +23,7 @@ export default Component.extend(UtilsMixin, {
|
|||||||
"guid:data-guid",
|
"guid:data-guid",
|
||||||
"rowLang:lang",
|
"rowLang:lang",
|
||||||
],
|
],
|
||||||
|
|
||||||
classNameBindings: [
|
classNameBindings: [
|
||||||
"isHighlighted",
|
"isHighlighted",
|
||||||
"isSelected",
|
"isSelected",
|
||||||
@ -31,8 +31,8 @@ export default Component.extend(UtilsMixin, {
|
|||||||
"isNone:none",
|
"isNone:none",
|
||||||
"item.classNames",
|
"item.classNames",
|
||||||
],
|
],
|
||||||
index: 0,
|
|
||||||
|
|
||||||
|
index: 0,
|
||||||
role: "menuitemradio",
|
role: "menuitemradio",
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -2,15 +2,12 @@ import { computed } from "@ember/object";
|
|||||||
import { or } from "@ember/object/computed";
|
import { or } from "@ember/object/computed";
|
||||||
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
||||||
import UtilsMixin from "select-kit/mixins/utils";
|
import UtilsMixin from "select-kit/mixins/utils";
|
||||||
import layout from "select-kit/templates/components/select-kit/single-select-header";
|
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
|
|
||||||
export default SelectKitHeaderComponent.extend(UtilsMixin, {
|
export default SelectKitHeaderComponent.extend(UtilsMixin, {
|
||||||
tagName: "summary",
|
tagName: "summary",
|
||||||
layout,
|
|
||||||
classNames: ["single-select-header"],
|
classNames: ["single-select-header"],
|
||||||
attributeBindings: ["name", "ariaLabel:aria-label"],
|
attributeBindings: ["name", "ariaLabel:aria-label"],
|
||||||
|
|
||||||
ariaLabel: or("selectKit.options.headerAriaLabel", "name"),
|
ariaLabel: or("selectKit.options.headerAriaLabel", "name"),
|
||||||
|
|
||||||
focusIn(event) {
|
focusIn(event) {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import layout from "select-kit/templates/components/selected-choice-category";
|
|
||||||
import SelectedChoiceComponent from "select-kit/components/selected-choice";
|
import SelectedChoiceComponent from "select-kit/components/selected-choice";
|
||||||
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
@ -6,7 +5,6 @@ import { htmlSafe } from "@ember/template";
|
|||||||
|
|
||||||
export default SelectedChoiceComponent.extend({
|
export default SelectedChoiceComponent.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
layout,
|
|
||||||
extraClass: "selected-choice-category",
|
extraClass: "selected-choice-category",
|
||||||
|
|
||||||
badge: computed("item", function () {
|
badge: computed("item", function () {
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import { guidFor } from "@ember/object/internals";
|
import { guidFor } from "@ember/object/internals";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import layout from "select-kit/templates/components/selected-choice";
|
|
||||||
import UtilsMixin from "select-kit/mixins/utils";
|
import UtilsMixin from "select-kit/mixins/utils";
|
||||||
|
|
||||||
export default Component.extend(UtilsMixin, {
|
export default Component.extend(UtilsMixin, {
|
||||||
tagName: "",
|
tagName: "",
|
||||||
layout,
|
|
||||||
item: null,
|
item: null,
|
||||||
selectKit: null,
|
selectKit: null,
|
||||||
extraClass: null,
|
extraClass: null,
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
{{#if this.item.url}}
|
||||||
|
<AvatarFlair
|
||||||
|
@flairName={{this.item.name}}
|
||||||
|
@flairUrl={{this.item.url}}
|
||||||
|
@flairBgColor={{this.item.bgColor}}
|
||||||
|
@flairColor={{this.item.color}}
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<span>{{this.label}}</span>
|
@ -1,7 +1,5 @@
|
|||||||
import SelectedNameComponent from "select-kit/components/selected-name";
|
import SelectedNameComponent from "select-kit/components/selected-name";
|
||||||
import layout from "select-kit/templates/components/flair-row";
|
|
||||||
|
|
||||||
export default SelectedNameComponent.extend({
|
export default SelectedNameComponent.extend({
|
||||||
layout,
|
|
||||||
tagName: "",
|
tagName: "",
|
||||||
});
|
});
|
||||||
|
@ -2,13 +2,11 @@ import { guidFor } from "@ember/object/internals";
|
|||||||
import { computed, get } from "@ember/object";
|
import { computed, get } from "@ember/object";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import UtilsMixin from "select-kit/mixins/utils";
|
import UtilsMixin from "select-kit/mixins/utils";
|
||||||
import layout from "select-kit/templates/components/selected-name";
|
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
import { reads } from "@ember/object/computed";
|
import { reads } from "@ember/object/computed";
|
||||||
|
|
||||||
export default Component.extend(UtilsMixin, {
|
export default Component.extend(UtilsMixin, {
|
||||||
tagName: "",
|
tagName: "",
|
||||||
layout,
|
|
||||||
name: null,
|
name: null,
|
||||||
value: null,
|
value: null,
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import SelectKitComponent from "select-kit/components/select-kit";
|
import SelectKitComponent from "select-kit/components/select-kit";
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import { isEmpty } from "@ember/utils";
|
import { isEmpty } from "@ember/utils";
|
||||||
import layout from "select-kit/templates/components/single-select";
|
|
||||||
|
|
||||||
export default SelectKitComponent.extend({
|
export default SelectKitComponent.extend({
|
||||||
pluginApiIdentifiers: ["single-select"],
|
pluginApiIdentifiers: ["single-select"],
|
||||||
layout,
|
|
||||||
classNames: ["single-select"],
|
classNames: ["single-select"],
|
||||||
singleSelect: true,
|
singleSelect: true,
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/tag-chooser-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["tag-chooser-row"],
|
classNames: ["tag-chooser-row"],
|
||||||
});
|
});
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import layout from "select-kit/templates/components/tag-drop/more-tags-collection";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
|
|
||||||
layout,
|
|
||||||
|
|
||||||
collection: null,
|
collection: null,
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import ComboBoxSelectBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
import ComboBoxSelectBoxHeaderComponent from "select-kit/components/combo-box/combo-box-header";
|
||||||
import layout from "select-kit/templates/components/tag-drop/tag-drop-header";
|
|
||||||
|
|
||||||
export default ComboBoxSelectBoxHeaderComponent.extend({
|
export default ComboBoxSelectBoxHeaderComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: "tag-drop-header",
|
classNames: "tag-drop-header",
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/tag-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["tag-row"],
|
classNames: ["tag-row"],
|
||||||
});
|
});
|
||||||
|
@ -5,10 +5,8 @@ import { NotificationLevels } from "discourse/lib/notification-levels";
|
|||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import layout from "select-kit/templates/components/topic-notifications-button";
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
layout,
|
|
||||||
classNames: ["topic-notifications-button"],
|
classNames: ["topic-notifications-button"],
|
||||||
classNameBindings: ["isLoading"],
|
classNameBindings: ["isLoading"],
|
||||||
appendReason: true,
|
appendReason: true,
|
||||||
@ -17,6 +15,7 @@ export default Component.extend({
|
|||||||
topic: null,
|
topic: null,
|
||||||
showCaret: true,
|
showCaret: true,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
|
||||||
icon: computed("isLoading", function () {
|
icon: computed("isLoading", function () {
|
||||||
return this.isLoading ? "spinner" : null;
|
return this.isLoading ? "spinner" : null;
|
||||||
}),
|
}),
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/topic-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["topic-row"],
|
classNames: ["topic-row"],
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||||
import layout from "select-kit/templates/components/user-chooser/user-row";
|
|
||||||
|
|
||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layout,
|
|
||||||
classNames: ["user-row"],
|
classNames: ["user-row"],
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user