ember-attacher 3.0.0 → 3.1.0
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,9 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
## v3.1.0 (2024-03-07)
|
|
6
|
+
|
|
7
|
+
#### :boom: Breaking Change
|
|
8
|
+
* [#843](https://github.com/tylerturdenpants/ember-attacher/pull/843) Drop ember-in-element-polyfill from dependencies ([@pzubar](https://github.com/pzubar))
|
|
5
9
|
|
|
6
10
|
#### :rocket: Enhancement
|
|
11
|
+
* [#887](https://github.com/tylerturdenpants/ember-attacher/pull/887) [chore]: Bump ember-cli-babel from 7.26.11 to 8.2.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
7
12
|
* [#820](https://github.com/tylerturdenpants/ember-attacher/pull/820) Fix the "cancelAnimationFrame is not defined" error in fastboot ([@pzubar](https://github.com/pzubar))
|
|
8
13
|
* [#790](https://github.com/tylerturdenpants/ember-attacher/pull/790) Bump ember-maybe-in-element to supress build-time warning ([@pzubar](https://github.com/pzubar))
|
|
9
14
|
* [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
|
|
@@ -15,6 +20,8 @@
|
|
|
15
20
|
* [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
|
|
16
21
|
|
|
17
22
|
#### :house: Internal
|
|
23
|
+
* [#867](https://github.com/tylerturdenpants/ember-attacher/pull/867) [chore]: Bump ember-truth-helpers from 3.1.1 to 4.0.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
24
|
+
* [#928](https://github.com/tylerturdenpants/ember-attacher/pull/928) [chore]: Bump ip from 1.1.8 to 1.1.9 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
18
25
|
* [#827](https://github.com/tylerturdenpants/ember-attacher/pull/827) [chore]: Bump @ember/test-helpers from 2.9.3 to 2.9.4 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
19
26
|
* [#786](https://github.com/tylerturdenpants/ember-attacher/pull/786) [chore]: Bump @ember/string from 3.0.1 to 3.1.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
20
27
|
* [#833](https://github.com/tylerturdenpants/ember-attacher/pull/833) [chore]: Bump ember-source from 4.12.0 to 4.12.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
|
@@ -27,6 +34,14 @@
|
|
|
27
34
|
#### Committers: 1
|
|
28
35
|
- Petro Zubar ([@pzubar](https://github.com/pzubar))
|
|
29
36
|
|
|
37
|
+
## v3.0.0 (2024-03-06)
|
|
38
|
+
|
|
39
|
+
#### :boom: Breaking Change
|
|
40
|
+
* [#843](https://github.com/tylerturdenpants/ember-attacher/pull/843) Drop ember-in-element-polyfill from dependencies ([@pzubar](https://github.com/pzubar))
|
|
41
|
+
|
|
42
|
+
#### Committers: 1
|
|
43
|
+
- Petro Zubar ([@pzubar](https://github.com/pzubar))
|
|
44
|
+
|
|
30
45
|
## v2.0.8 (2024-01-16)
|
|
31
46
|
|
|
32
47
|
#### :rocket: Enhancement
|
|
@@ -696,4 +711,4 @@
|
|
|
696
711
|
|
|
697
712
|
|
|
698
713
|
|
|
699
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
|
714
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { action } from '@ember/object';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
|
-
import { cancel, debounce, later, next, run } from '@ember/runloop';
|
|
3
|
+
import { cancel, debounce, later, next, run, once } from '@ember/runloop';
|
|
4
4
|
import { getOwner } from '@ember/application';
|
|
5
5
|
import { guidFor } from '@ember/object/internals';
|
|
6
6
|
import { htmlSafe, isHTMLSafe } from '@ember/template';
|
|
@@ -10,6 +10,7 @@ import { isEmpty, typeOf } from '@ember/utils';
|
|
|
10
10
|
import { autoUpdate, computePosition, arrow, flip, limitShift, shift } from '@floating-ui/dom';
|
|
11
11
|
import { buildWaiter } from '@ember/test-waiters';
|
|
12
12
|
import { tracked } from '@glimmer/tracking';
|
|
13
|
+
import { modifier } from 'ember-modifier';
|
|
13
14
|
import DEFAULTS from '../defaults';
|
|
14
15
|
|
|
15
16
|
const animationTestWaiter = buildWaiter('attach-popover');
|
|
@@ -293,20 +294,18 @@ export default class AttachPopover extends Component {
|
|
|
293
294
|
this._hide();
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
|
|
297
|
-
onParentFinderInsert(element) {
|
|
297
|
+
onParentFinderInsert = modifier((element) => {
|
|
298
298
|
this.parentElement = element.parentElement;
|
|
299
|
-
this
|
|
300
|
-
}
|
|
299
|
+
once(this, '_initializeAttacher')
|
|
300
|
+
});
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
_ensureArgumentsAreValid() {
|
|
302
|
+
_ensureArgumentsAreValid([arrow, useCapture]) {
|
|
304
303
|
stripInProduction(() => {
|
|
305
|
-
if (
|
|
304
|
+
if (arrow && this.isFillAnimation) {
|
|
306
305
|
warn('Animation: \'fill\' is not compatible with arrow: true', { id: 70015 });
|
|
307
306
|
}
|
|
308
307
|
|
|
309
|
-
if (
|
|
308
|
+
if (useCapture !== this._lastUseCaptureArgumentValue) {
|
|
310
309
|
warn(
|
|
311
310
|
'The value of the useCapture argument was mutated',
|
|
312
311
|
{ id: 'ember-attacher.use-capture-mutated' }
|
|
@@ -403,15 +402,11 @@ export default class AttachPopover extends Component {
|
|
|
403
402
|
});
|
|
404
403
|
}
|
|
405
404
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
@action
|
|
412
|
-
onIsShownChange() {
|
|
413
|
-
const isShown = this.isShown;
|
|
405
|
+
onTargetOrTriggerChange = modifier((_, _positional) => {
|
|
406
|
+
once(this, '_initializeAttacher', ..._positional);
|
|
407
|
+
});
|
|
414
408
|
|
|
409
|
+
onIsShownChange = modifier((_, [isShown]) => {
|
|
415
410
|
if (isShown === true && this._isHidden) {
|
|
416
411
|
this._show();
|
|
417
412
|
|
|
@@ -421,7 +416,18 @@ export default class AttachPopover extends Component {
|
|
|
421
416
|
} else if (isShown === false && !this._isHidden) {
|
|
422
417
|
this._hide();
|
|
423
418
|
}
|
|
424
|
-
}
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
initializeAttacher = modifier((floatingElement) => {
|
|
422
|
+
this._floatingElement = floatingElement;
|
|
423
|
+
|
|
424
|
+
if (this.renderInPlace) {
|
|
425
|
+
this.parentElement = floatingElement.parentElement;
|
|
426
|
+
once(this, '_initializeAttacher');
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return () => this._cleanup?.();
|
|
430
|
+
});
|
|
425
431
|
|
|
426
432
|
/**
|
|
427
433
|
* ================== SHOW ATTACHMENT LOGIC ==================
|
|
@@ -768,31 +774,14 @@ export default class AttachPopover extends Component {
|
|
|
768
774
|
});
|
|
769
775
|
}
|
|
770
776
|
|
|
771
|
-
|
|
772
|
-
didInsertFloatingElement(floatingElement) {
|
|
773
|
-
this._floatingElement = floatingElement;
|
|
774
|
-
|
|
775
|
-
if (this.renderInPlace) {
|
|
776
|
-
this.parentElement = floatingElement.parentElement;
|
|
777
|
-
this._initializeAttacher();
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
@action
|
|
782
|
-
didInsertArrow(element) {
|
|
777
|
+
didInsertArrow = modifier((element) => {
|
|
783
778
|
this._arrowElement = element;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
@action
|
|
787
|
-
onOptionsChange() {
|
|
788
|
-
this._ensureArgumentsAreValid();
|
|
789
|
-
this._update();
|
|
790
|
-
}
|
|
779
|
+
})
|
|
791
780
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
this
|
|
795
|
-
}
|
|
781
|
+
onOptionsChange = modifier((_, positional) => {
|
|
782
|
+
this._ensureArgumentsAreValid(positional);
|
|
783
|
+
once(this, '_update')
|
|
784
|
+
})
|
|
796
785
|
|
|
797
786
|
_update() {
|
|
798
787
|
this._cleanup?.();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{~#unless this.renderFloatingElement}}
|
|
2
|
-
<meta hidden {{
|
|
2
|
+
<meta hidden {{this.onParentFinderInsert}} {{this.onIsShownChange this.isShown}}/>
|
|
3
3
|
{{~/unless~}}
|
|
4
4
|
|
|
5
5
|
{{~#if this.renderFloatingElement~}}
|
|
@@ -8,17 +8,16 @@
|
|
|
8
8
|
class="ember-attacher"
|
|
9
9
|
id={{this.id}}
|
|
10
10
|
role={{this.ariaRole}}
|
|
11
|
-
{{
|
|
12
|
-
{{
|
|
13
|
-
{{
|
|
14
|
-
{{
|
|
15
|
-
{{will-destroy this.willDestroyFloatingElement}}
|
|
11
|
+
{{this.onIsShownChange this.isShown}}
|
|
12
|
+
{{this.onTargetOrTriggerChange this.hideOn this.showOn @explicitTarget}}
|
|
13
|
+
{{this.onOptionsChange this.arrow this.useCapture this.autoUpdate this.animation this.placement this._renderInPlace this._currentTarget this._middleware}}
|
|
14
|
+
{{this.initializeAttacher}}
|
|
16
15
|
...attributes
|
|
17
16
|
>
|
|
18
17
|
<div class={{this._class}} style={{this._style}}>
|
|
19
|
-
{{yield (hash hide=
|
|
18
|
+
{{yield (hash hide=this.hide)}}
|
|
20
19
|
{{#if this.arrow}}
|
|
21
|
-
<div x-arrow {{
|
|
20
|
+
<div x-arrow {{this.didInsertArrow}}></div>
|
|
22
21
|
{{/if}}
|
|
23
22
|
{{#if this.isFillAnimation}}
|
|
24
23
|
<div x-circle style="{{this._circleTransitionDuration}}"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-attacher",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Tooltips and popovers for Ember.js apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
"@floating-ui/dom": "^1.6.3",
|
|
33
33
|
"babel-plugin-filter-imports": "^4.0.0",
|
|
34
34
|
"broccoli-funnel": "~3.0.8",
|
|
35
|
-
"ember-auto-import": "^2.7.
|
|
36
|
-
"ember-cli-babel": "^
|
|
35
|
+
"ember-auto-import": "^2.7.2",
|
|
36
|
+
"ember-cli-babel": "^8.2.0",
|
|
37
37
|
"ember-cli-htmlbars": "^6.3.0",
|
|
38
38
|
"ember-cli-sass": "^11.0.1",
|
|
39
39
|
"ember-maybe-in-element": "^2.1.0",
|
|
40
|
+
"ember-modifier": "^4.1.0",
|
|
40
41
|
"sass": "^1.71.1"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
@@ -45,15 +46,14 @@
|
|
|
45
46
|
"@babel/helper-get-function-arity": "^7.16.7",
|
|
46
47
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
47
48
|
"@ember/optional-features": "^2.0.0",
|
|
48
|
-
"@ember/render-modifiers": "^2.0.5",
|
|
49
49
|
"@ember/string": "^3.1.1",
|
|
50
50
|
"@ember/test-helpers": "~2.9.4",
|
|
51
51
|
"@ember/test-waiters": "^3.1.0",
|
|
52
|
-
"@embroider/test-setup": "^
|
|
52
|
+
"@embroider/test-setup": "^3.0.0",
|
|
53
53
|
"@glimmer/component": "^1.1.2",
|
|
54
54
|
"@glimmer/tracking": "^1.1.2",
|
|
55
55
|
"@html-next/flexi-default-styles": "^2.2.0",
|
|
56
|
-
"@release-it-plugins/lerna-changelog": "^
|
|
56
|
+
"@release-it-plugins/lerna-changelog": "^6.1.0",
|
|
57
57
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
58
58
|
"broccoli-asset-rev": "^3.0.0",
|
|
59
59
|
"ember-cli": "~4.12.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"ember-source": "~4.12.3",
|
|
69
69
|
"ember-source-channel-url": "^3.0.0",
|
|
70
70
|
"ember-svg-jar": "~2.4.7",
|
|
71
|
-
"ember-truth-helpers": "^
|
|
71
|
+
"ember-truth-helpers": "^4.0.3",
|
|
72
72
|
"ember-try": "~3.0.0",
|
|
73
73
|
"eslint": "~8.55.0",
|
|
74
74
|
"eslint-plugin-decorator-position": "^5.0.2",
|