diff --git a/addon/src/modifiers/sortable-group.ts b/addon/src/modifiers/sortable-group.ts index e53ef410..8a1fcd50 100644 --- a/addon/src/modifiers/sortable-group.ts +++ b/addon/src/modifiers/sortable-group.ts @@ -1,7 +1,7 @@ /* eslint-disable ember/no-computed-properties-in-native-classes */ /* eslint-disable ember/no-incorrect-calls-with-inline-anonymous-functions */ import Modifier from 'ember-modifier'; -import { action, computed, set } from '@ember/object'; +import { action, set } from '@ember/object'; import { isDownArrowKey, isEnterKey, @@ -625,7 +625,6 @@ export default class SortableGroupModifier extends Modifier record !== item, + ); + } + + @action + addItemToHorizontal() { + this.mutableRecords = [ + ...this.mutableRecords, + `Item ${this.mutableRecords.length + 1}`, + ]; + } } diff --git a/test-app/app/styles/app.css b/test-app/app/styles/app.css index 5fba0d8a..022a817c 100644 --- a/test-app/app/styles/app.css +++ b/test-app/app/styles/app.css @@ -295,3 +295,39 @@ .word-break { word-wrap: break-word; } + +.flex { + display: flex; +} + +.flex-1 { + flex: 1; +} + +.inline-flex { + display: inline-flex; +} + +.align-items-center { + align-items: center; +} + +.space-between { + justify-content: space-between; +} + +.flex-column { + flex-direction: column; +} + +.flex-row { + flex-direction: row; +} + +.full-width { + width: 100%; +} + +.mr-5 { + margin-right: 5px; +} \ No newline at end of file diff --git a/test-app/app/templates/index.hbs b/test-app/app/templates/index.hbs index d3fcad84..9ffaeea5 100644 --- a/test-app/app/templates/index.hbs +++ b/test-app/app/templates/index.hbs @@ -1,10 +1,10 @@ -
+

Ember Sortable

-
+

Vertical

    {{item}} - + @@ -28,18 +33,30 @@
-
+

Vertical with different sized models and inputs

    {{#each this.differentSizedModels as |item index|}} -
  1. - - - +
  2. + + +
  3. @@ -47,27 +64,91 @@
-
+

Horizontal

    {{#each @model.items as |item|~}} -
  1. +
  2. {{~/each}}
- + +
+

Horizontal Mutable +     +

+ +
+ +
    + {{#each this.mutableRecords as |item|~}} +
  1. + + +
  2. + {{~/each}} +
+
    + {{#each this.mutableRecords as |item|~}} +
  1. + + +
  2. + {{~/each}} +
+
+
+
@@ -76,16 +157,24 @@
-
+
{{#each @model.itemsGrid as |item|~}} -
+
@@ -96,28 +185,32 @@
-
+

Grid demo 2 (no negative margin on group)

    {{#each @model.itemsGrid2 as |item|~}} -
  1. +
  2. {{~/each}}
-
+

Table

{{! template-lint-disable table-groups}} @@ -128,10 +221,18 @@ Item - + {{#each @model.items as |item|}} - - + + {{item}} {{/each}} @@ -141,15 +242,21 @@

Table with conditional cells

- +
-
+

Vertical with 15px spacing

-
    +
      {{#each @model.items as |item|}} -
    1. +
    2. {{item}} @@ -158,15 +265,15 @@
-
+

Vertical with distance set to 15

-
    +
      {{#each @model.items as |item|}}
    1. {{item}} @@ -176,15 +283,18 @@
-
+

Scrollable

-
-
    +
    +
      {{#each @model.items as |item|}} -
    1. +
    2. {{item}} - +
    3. @@ -200,24 +310,36 @@ -
      -
      +
      +

      Vertical

        {{#each @model.items as |item|}} -
      1. +
      2. {{item}} - +
      3. @@ -225,4 +347,4 @@
      -
      +
      \ No newline at end of file