ember-sortable 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,20 @@
1
- Version 9 of Highlight.js has reached EOL and is no longer supported.
2
- Please upgrade or ask whatever dependency you are using to upgrade.
3
- https://github.com/highlightjs/highlight.js/issues/2877
1
+ # ember-sortable changelog
2
+
3
+
4
4
 
5
+ ## v4.0.1 (2022-10-03)
6
+
7
+ #### :memo: Documentation
8
+ * [#480](https://github.com/adopted-ember-addons/ember-sortable/pull/480) fix type in modifier migration doc ([@nlfurniss](https://github.com/nlfurniss))
9
+ * [#475](https://github.com/adopted-ember-addons/ember-sortable/pull/475) Update CHANGELOG.md ([@sandstrom](https://github.com/sandstrom))
5
10
 
11
+ #### :house: Internal
12
+ * [#487](https://github.com/adopted-ember-addons/ember-sortable/pull/487) Resolve `ember-modifier.no-args-property` deprecation warnings ([@bertdeblock](https://github.com/bertdeblock))
13
+
14
+ #### Committers: 3
15
+ - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
16
+ - Nathaniel Furniss ([@nlfurniss](https://github.com/nlfurniss))
17
+ - [@sandstrom](https://github.com/sandstrom)
6
18
 
7
19
  ## v4.0.0 (2022-05-16)
8
20
 
@@ -708,6 +720,6 @@ Must provide GITHUB_AUTH
708
720
 
709
721
  - [#28](https://github.com/jgwhite/ember-sortable/pull/28) Add `model` attr to `sortable-group` [@ujamer](https://github.com/ujamer)
710
722
 
711
- ### 1.0.0 (2015-05-13)
723
+ ### 1.0.0 (2015-05-13)
712
724
 
713
725
  First stable release.
@@ -32,7 +32,7 @@ To use modifiers, you must use angle-bracket syntax
32
32
  {{#sortable-group model=model.items onChange=(action 'reorderItems') as |group|}}
33
33
  {{#each group.model as |item|}}
34
34
  {{#group.item model=item}}
35
- {{tem.name}}
35
+ {{item.name}}
36
36
  {{/group.item}}
37
37
  {{/each}}
38
38
  {{/sortable-group}}
@@ -44,7 +44,7 @@ To use modifiers, you must use angle-bracket syntax
44
44
  <ol {{sortable-group onChange=(action 'reorderItems')}}>
45
45
  {{#each model.items as |item|}}
46
46
  <li {{sortable-item model=item}}>
47
- {{tem.name}}
47
+ {{item.name}}
48
48
  </li>
49
49
  {{/each}}
50
50
  </ol>
@@ -73,7 +73,7 @@ To use modifiers, you must use angle-bracket syntax
73
73
  <ol {{sortable-group onChange=(action 'reorderItems')}}>
74
74
  {{#each model.items as |item|}}
75
75
  <li {{sortable-item model=item}}>
76
- {{tem.name}}
76
+ {{item.name}}
77
77
  <span class='handle' {{sortable-handle}}>&varr;</span>
78
78
  </li>
79
79
  {{/each}}
@@ -87,7 +87,7 @@ To use modifiers, you must use angle-bracket syntax
87
87
  <ol {{sortable-group onChange=(action 'reorderItems' model)}}>
88
88
  {{#each model.items as |item|}}
89
89
  <li {{sortable-item model=item}}>
90
- {{tem.name}}
90
+ {{item.name}}
91
91
  <span class='handle' {{sortable-handle}}>&varr;</span>
92
92
  </li>
93
93
  {{/each}}
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ember-sortable
1
+ # ember-sortable
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/ember-sortable.svg)](http://badge.fury.io/js/ember-sortable)
4
4
  [![Build Status](https://github.com/adopted-ember-addons/ember-sortable/workflows/build/badge.svg?branch=master)](https://github.com/adopted-ember-addons/ember-sortable/actions?query=branch%3Amaster+workflow%3A%22build%22)
@@ -12,29 +12,10 @@ Sortable UI primitives for Ember.
12
12
 
13
13
  [Check out the demo](https://adopted-ember-addons.github.io/ember-sortable/demo/)
14
14
 
15
- ## v2 -> v3 Migration
16
-
17
- The component versions have been removed and you must use the modifier.
18
- The modifier version does not support `groupModel`, use the currying of the `fn` helper.
19
-
20
- ## v1 -> v2 Migration
21
-
22
- If you are migrating from `1.x.x` to `2.x.x`,
23
- For components, please read this [migration guide](/MIGRATION_GUIDE_V2.md).
24
- For modifiers, please read this [migration guide](/MIGRATION_GUIDE_MODIFIERS.md).
25
-
26
15
  ## Requirements
27
16
 
28
17
  In version 3.0.0+, Node.js v12 or above And Ember.js v3.24 or above
29
18
 
30
- In version 2.0.0+, our `closest` polyfill seems to break some app's `production` build. To mitigate this, the `closest` polyfill will only enabled if it doesn't break the `production` build (if the `polyfill` file is recognized by the build). Affected apps will need to supply their own [closest](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill) polyfill to ensure compatibility with IE. This issue is tracked [here](https://github.com/adopted-ember-addons/ember-sortable/issues/333).
31
-
32
- We require the `ember-decorators-polyfill` to be installed if you are using this addon with versions of Ember < 3.10.0.
33
-
34
- Version 1.0 depends upon the availability of 2D CSS transforms.
35
- Check [the matrix on caniuse.com](http://caniuse.com/#feat=transforms2d)
36
- to see if your target browsers are compatible.
37
-
38
19
  ## Installation
39
20
 
40
21
  ```sh
@@ -396,6 +377,23 @@ await drag('mouse', '[data-test-scrollable-demo-handle] .handle', () => {
396
377
  await triggerKeyEvent('[data-test-vertical-demo-handle]', 'keydown', ENTER_KEY_CODE);
397
378
  ```
398
379
 
380
+ ## Migrating
381
+
382
+ ### v3 -> v4
383
+
384
+ None, just make sure Node v14+ and Ember is v3.24+. Although older versions might work, but are no longer tested against. Specifically ember-modifier dropped support for older versions of Ember.
385
+
386
+ ### v2 -> v3
387
+
388
+ The component versions have been removed and you must use the modifier.
389
+ The modifier version does not support `groupModel`, use the currying of the `fn` helper.
390
+
391
+ ### v1 -> v2
392
+
393
+ If you are migrating from `1.x.x` to `2.x.x`,
394
+ For components, please read this [migration guide](/MIGRATION_GUIDE_V2.md).
395
+ For modifiers, please read this [migration guide](/MIGRATION_GUIDE_MODIFIERS.md).
396
+
399
397
  ## Developing
400
398
 
401
399
  ### Setup
@@ -57,7 +57,7 @@ export default class SortableGroupModifier extends Modifier {
57
57
  /** End of keyboard utils */
58
58
 
59
59
  get disabled() {
60
- return this.args.named.disabled || false;
60
+ return this.named.disabled || false;
61
61
  }
62
62
 
63
63
  /** Start of a11y properties */
@@ -74,7 +74,7 @@ export default class SortableGroupModifier extends Modifier {
74
74
  * }
75
75
  */
76
76
  get handleVisualClass() {
77
- return this.args.named.handleVisualClass || NO_MODEL;
77
+ return this.named.handleVisualClass || NO_MODEL;
78
78
  }
79
79
 
80
80
  /**
@@ -89,15 +89,15 @@ export default class SortableGroupModifier extends Modifier {
89
89
  * }
90
90
  */
91
91
  get a11yAnnouncementConfig() {
92
- return this.args.named.a11yAnnouncementConfig || defaultA11yAnnouncementConfig;
92
+ return this.named.a11yAnnouncementConfig || defaultA11yAnnouncementConfig;
93
93
  }
94
94
 
95
95
  get itemVisualClass() {
96
- return this.args.named.itemVisualClass || 'is-activated';
96
+ return this.named.itemVisualClass || 'is-activated';
97
97
  }
98
98
 
99
99
  get a11yItemName() {
100
- return this.args.named.a11yItemName || 'item';
100
+ return this.named.a11yItemName || 'item';
101
101
  }
102
102
  /** End of a11y properties */
103
103
 
@@ -473,7 +473,7 @@ export default class SortableGroupModifier extends Modifier {
473
473
  @default y
474
474
  */
475
475
  get direction() {
476
- return this.args.named.direction || 'y';
476
+ return this.named.direction || 'y';
477
477
  }
478
478
 
479
479
  /**
@@ -486,7 +486,7 @@ export default class SortableGroupModifier extends Modifier {
486
486
  @default null
487
487
  */
488
488
  get onChange() {
489
- return this.args.named.onChange;
489
+ return this.named.onChange;
490
490
  }
491
491
 
492
492
  @service('ember-sortable-internal-state')
@@ -500,11 +500,9 @@ export default class SortableGroupModifier extends Modifier {
500
500
  * @returns {*|string}
501
501
  */
502
502
  get groupName() {
503
- return this.args.named.groupName || '_EmberSortableGroup';
503
+ return this.named.groupName || '_EmberSortableGroup';
504
504
  }
505
505
 
506
- _groupDef = this.sortableService.fetchGroup(this.groupName);
507
-
508
506
  /**
509
507
  This is an array of SortableItemModifiers
510
508
 
@@ -719,12 +717,14 @@ export default class SortableGroupModifier extends Modifier {
719
717
  registerDestructor(this, cleanup);
720
718
  }
721
719
 
722
- modify(element /*, positional, named*/) {
720
+ modify(element, _positional, named) {
723
721
  this.element = element;
722
+ this.named = named;
724
723
 
725
724
  this.removeEventListener();
726
725
 
727
726
  if (!this.didSetup) {
727
+ this._groupDef = this.sortableService.fetchGroup(this.groupName);
728
728
  this.announcer = this._createAnnouncer();
729
729
  this.element.insertAdjacentElement('afterend', this.announcer);
730
730
  this.sortableService.registerGroup(this.groupName, this);
@@ -63,7 +63,7 @@ export default class SortableItemModifier extends Modifier {
63
63
  }
64
64
 
65
65
  get model() {
66
- return this.args.named.model;
66
+ return this.named.model;
67
67
  }
68
68
 
69
69
  get direction() {
@@ -82,7 +82,7 @@ export default class SortableItemModifier extends Modifier {
82
82
  * @returns {*|string}
83
83
  */
84
84
  get groupName() {
85
- return this.args.named.groupName || '_EmberSortableGroup';
85
+ return this.named.groupName || '_EmberSortableGroup';
86
86
  }
87
87
 
88
88
  /**
@@ -93,7 +93,7 @@ export default class SortableItemModifier extends Modifier {
93
93
  @default 125
94
94
  */
95
95
  get updateInterval() {
96
- return this.args.named.updateInterval || 125;
96
+ return this.named.updateInterval || 125;
97
97
  }
98
98
 
99
99
  /**
@@ -103,7 +103,7 @@ export default class SortableItemModifier extends Modifier {
103
103
  @default 0[px]
104
104
  */
105
105
  get spacing() {
106
- return this.args.named.spacing || 0;
106
+ return this.named.spacing || 0;
107
107
  }
108
108
 
109
109
  /**
@@ -115,7 +115,7 @@ export default class SortableItemModifier extends Modifier {
115
115
  get isDisabled() {
116
116
  deprecate(
117
117
  '"isDraggingDisabled" is deprecated. Please migrate to "disabled" named argument',
118
- !('isDraggingDisabled' in this.args.named),
118
+ !('isDraggingDisabled' in this.named),
119
119
  {
120
120
  id: 'ember-sortable.is-dragging-disabled',
121
121
  url: 'https://github.com/adopted-ember-addons/ember-sortable#readme',
@@ -128,7 +128,7 @@ export default class SortableItemModifier extends Modifier {
128
128
  }
129
129
  );
130
130
 
131
- return this.groupDisabled || this.args.named.disabled || this.args.named.isDraggingDisabled || false;
131
+ return this.groupDisabled || this.named.disabled || this.named.isDraggingDisabled || false;
132
132
  }
133
133
 
134
134
  /**
@@ -143,7 +143,7 @@ export default class SortableItemModifier extends Modifier {
143
143
  @default "[data-sortable-handle]"
144
144
  */
145
145
  get handle() {
146
- return this.args.named.handle || '[data-sortable-handle]';
146
+ return this.named.handle || '[data-sortable-handle]';
147
147
  }
148
148
 
149
149
  handleElement;
@@ -159,7 +159,7 @@ export default class SortableItemModifier extends Modifier {
159
159
  * @default 0
160
160
  */
161
161
  get distance() {
162
- return this.args.named.distance || 0;
162
+ return this.named.distance || 0;
163
163
  }
164
164
 
165
165
  /**
@@ -191,7 +191,7 @@ export default class SortableItemModifier extends Modifier {
191
191
  @default null
192
192
  */
193
193
  get onDragStart() {
194
- return this.args.named.onDragStart || ((item) => item);
194
+ return this.named.onDragStart || ((item) => item);
195
195
  }
196
196
 
197
197
  /**
@@ -202,7 +202,7 @@ export default class SortableItemModifier extends Modifier {
202
202
  @default null
203
203
  */
204
204
  get onDragStop() {
205
- return this.args.named.onDragStop || ((item) => item);
205
+ return this.named.onDragStop || ((item) => item);
206
206
  }
207
207
 
208
208
  /**
@@ -244,7 +244,7 @@ export default class SortableItemModifier extends Modifier {
244
244
  @property disableCheckScrollBounds
245
245
  */
246
246
  get disableCheckScrollBounds() {
247
- return this.args.named.disableCheckScrollBounds != undefined ? this.args.named.disableCheckScrollBounds : isTesting;
247
+ return this.named.disableCheckScrollBounds != undefined ? this.named.disableCheckScrollBounds : isTesting;
248
248
  }
249
249
 
250
250
  /**
@@ -819,8 +819,9 @@ export default class SortableItemModifier extends Modifier {
819
819
  registerDestructor(this, cleanup);
820
820
  }
821
821
 
822
- modify(element /*, positional, named*/) {
822
+ modify(element, _positional, named) {
823
823
  this.element = element;
824
+ this.named = named;
824
825
 
825
826
  this.element.classList.add(this.className);
826
827
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-sortable",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Sortable UI primitives for Ember.",
5
5
  "keywords": [
6
6
  "ember-addon",