ember-attacher 1.3.0 → 2.0.2
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/.idea/ember-attacher.iml +29 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +36 -0
- package/README.md +49 -33
- package/addon/components/attach-popover.js +310 -234
- package/addon/components/attach-tooltip.js +17 -33
- package/addon/defaults.js +7 -5
- package/addon/styles/_mixins.scss +4 -6
- package/addon/styles/ember-attacher.scss +5 -0
- package/addon/templates/components/attach-popover.hbs +26 -22
- package/addon-test-support/is-visible.js +1 -1
- package/docs/upgrade-guide-2.0.md +43 -0
- package/index.js +0 -2
- package/package.json +45 -39
- package/.github/ISSUE_TEMPLATE.md +0 -3
- package/.github/dependabot.yml +0 -74
- package/.github/workflows/ci.yml +0 -221
- package/app/styles/app.scss +0 -1
- package/config/dependency-lint.js +0 -5
- package/config/environment.js +0 -6
- package/yarn-error.log +0 -14650
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<sourceFolder url="file://$MODULE_DIR$/addon" isTestSource="false" />
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" />
|
|
7
|
+
<sourceFolder url="file://$MODULE_DIR$/public" isTestSource="false" />
|
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/test-app" isTestSource="true" />
|
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test-app/app" isTestSource="true" />
|
|
11
|
+
<sourceFolder url="file://$MODULE_DIR$/test-app/tests/acceptance" isTestSource="true" />
|
|
12
|
+
<sourceFolder url="file://$MODULE_DIR$/test-app/tests/integration" isTestSource="true" />
|
|
13
|
+
<sourceFolder url="file://$MODULE_DIR$/test-app/tests/unit" isTestSource="true" />
|
|
14
|
+
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
|
15
|
+
<sourceFolder url="file://$MODULE_DIR$/tests/acceptance" isTestSource="true" />
|
|
16
|
+
<sourceFolder url="file://$MODULE_DIR$/tests/dummy/app" isTestSource="true" />
|
|
17
|
+
<sourceFolder url="file://$MODULE_DIR$/tests/integration" isTestSource="true" />
|
|
18
|
+
<sourceFolder url="file://$MODULE_DIR$/tests/unit" isTestSource="true" />
|
|
19
|
+
<excludeFolder url="file://$MODULE_DIR$/.bower_components.ember-try" />
|
|
20
|
+
<excludeFolder url="file://$MODULE_DIR$/.node_modules.ember-try" />
|
|
21
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
22
|
+
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
|
23
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
24
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
25
|
+
</content>
|
|
26
|
+
<orderEntry type="inheritedJdk" />
|
|
27
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
28
|
+
</component>
|
|
29
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/ember-attacher.iml" filepath="$PROJECT_DIR$/.idea/ember-attacher.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
## v2.0.2 (2023-05-18)
|
|
4
|
+
|
|
5
|
+
#### :rocket: Enhancement
|
|
6
|
+
* [#790](https://github.com/tylerturdenpants/ember-attacher/pull/790) Bump ember-maybe-in-element to supress build-time warning ([@pzubar](https://github.com/pzubar))
|
|
7
|
+
* [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fix
|
|
10
|
+
* [#784](https://github.com/tylerturdenpants/ember-attacher/pull/784) Prevent overflow by default ([@pzubar](https://github.com/pzubar))
|
|
11
|
+
|
|
12
|
+
#### :house: Internal
|
|
13
|
+
* [#783](https://github.com/tylerturdenpants/ember-attacher/pull/783) Upgrade Ember to v4 ([@pzubar](https://github.com/pzubar))
|
|
14
|
+
|
|
15
|
+
#### Committers: 1
|
|
16
|
+
- Petro Zubar ([@pzubar](https://github.com/pzubar))
|
|
17
|
+
|
|
18
|
+
## v2.0.1 (2023-05-15)
|
|
19
|
+
|
|
20
|
+
#### :boom: Breaking Change
|
|
21
|
+
* [#772](https://github.com/tylerturdenpants/ember-attacher/pull/772) Convert to Glimmer component ([@pzubar](https://github.com/pzubar))
|
|
22
|
+
* [#743](https://github.com/tylerturdenpants/ember-attacher/pull/743) Migration to the Floating UI ([@pzubar](https://github.com/pzubar))
|
|
23
|
+
|
|
24
|
+
#### :rocket: Enhancement
|
|
25
|
+
* [#772](https://github.com/tylerturdenpants/ember-attacher/pull/772) Convert to Glimmer component ([@pzubar](https://github.com/pzubar))
|
|
26
|
+
* [#759](https://github.com/tylerturdenpants/ember-attacher/pull/759) Bump dependencies ([@pzubar](https://github.com/pzubar))
|
|
27
|
+
* [#743](https://github.com/tylerturdenpants/ember-attacher/pull/743) Migration to the Floating UI ([@pzubar](https://github.com/pzubar))
|
|
28
|
+
* [#561](https://github.com/tylerturdenpants/ember-attacher/pull/561) Avoid forcing dart ([@kmccullough](https://github.com/kmccullough))
|
|
29
|
+
|
|
30
|
+
#### :house: Internal
|
|
31
|
+
* [#759](https://github.com/tylerturdenpants/ember-attacher/pull/759) Bump dependencies ([@pzubar](https://github.com/pzubar))
|
|
32
|
+
|
|
33
|
+
#### Committers: 2
|
|
34
|
+
- Kerry McCullough ([@kmccullough](https://github.com/kmccullough))
|
|
35
|
+
- Petro Zubar ([@pzubar](https://github.com/pzubar))
|
|
36
|
+
|
|
1
37
|
## v1.3.0 (2021-09-09)
|
|
2
38
|
|
|
3
39
|
#### :rocket: Enhancement
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/ember-attacher)
|
|
5
5
|
[](https://www.npmjs.com/package/ember-attacher)
|
|
6
6
|
[](http://emberobserver.com/addons/ember-attacher)
|
|
7
|
-
[](https://github.com/tylerturdenpants/ember-attacher/actions/workflows/ci.yml)
|
|
8
8
|
|
|
9
9
|
## Compatibility
|
|
10
10
|
|
|
@@ -20,35 +20,37 @@
|
|
|
20
20
|
|
|
21
21
|
----
|
|
22
22
|
|
|
23
|
-
* Ember.js v3.
|
|
23
|
+
* Ember.js v3.16 or above
|
|
24
24
|
* Ember CLI v3.13 or above
|
|
25
|
-
* Node.js
|
|
25
|
+
* Node.js v12 or above
|
|
26
26
|
|
|
27
27
|
Tooltips and popovers made easy.
|
|
28
|
-
Just drop an
|
|
28
|
+
Just drop an `<AttachTooltip/>` or `<AttachPopover/>` in a parent and your floating element is ready to go!
|
|
29
29
|
|
|
30
30
|
```hbs
|
|
31
31
|
<button>
|
|
32
32
|
Click me
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
<AttachTooltip>
|
|
35
35
|
I'm a tooltip!
|
|
36
|
-
|
|
36
|
+
</AttachTooltip>
|
|
37
37
|
</button>
|
|
38
38
|
|
|
39
39
|
<button class="other-button">
|
|
40
40
|
No click me!
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
<AttachPopover
|
|
43
|
+
@class='ember-attacher'
|
|
44
|
+
@hideOn='click'
|
|
45
|
+
@isShown={{true}}
|
|
46
|
+
@showOn='click'
|
|
47
|
+
>
|
|
46
48
|
I'm a popover!
|
|
47
|
-
|
|
49
|
+
</AttachPopover>
|
|
48
50
|
</button>
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
See [the example site](https://
|
|
53
|
+
See [the example site](https://tylerturdenpants.github.io/ember-attacher/) for a demonstration of all
|
|
52
54
|
available options.
|
|
53
55
|
|
|
54
56
|
## Installation
|
|
@@ -57,21 +59,24 @@ available options.
|
|
|
57
59
|
ember install ember-attacher
|
|
58
60
|
```
|
|
59
61
|
|
|
62
|
+
If you're upgrading from 1.x to 2.x [see the upgrade guide](./docs/upgrade-guide-2.0.md).
|
|
63
|
+
|
|
64
|
+
|
|
60
65
|
## Components
|
|
61
66
|
|
|
62
|
-
###
|
|
67
|
+
### `<AttachPopover/>`
|
|
63
68
|
|
|
64
69
|
A popover attacher.
|
|
65
70
|
|
|
66
71
|
* Has no default class or roles.
|
|
67
72
|
* Does not modify the target in any way.
|
|
68
|
-
* Adds `aria-hidden` attribute to the
|
|
73
|
+
* Adds `aria-hidden` attribute to the floating element
|
|
69
74
|
|
|
70
|
-
###
|
|
75
|
+
### `<AttachTooltip/>`
|
|
71
76
|
|
|
72
|
-
A tooltip attacher. Subclass of
|
|
77
|
+
A tooltip attacher. Subclass of `<AttachPopover/>`
|
|
73
78
|
|
|
74
|
-
* Has the default class `'ember-attacher-
|
|
79
|
+
* Has the default class `'ember-attacher-floating ember-attacher-tooltip'`
|
|
75
80
|
* The default tooltip classes can be modified by altering the `tooltipClass`
|
|
76
81
|
default. See [here](#user-defined-defaults) for details on editing default values.
|
|
77
82
|
|
|
@@ -90,6 +95,12 @@ Below is a list of all available options, along with their defaults.
|
|
|
90
95
|
|
|
91
96
|
// Whether or not an arrow will be displayed next to the attachment.
|
|
92
97
|
arrow: false,
|
|
98
|
+
|
|
99
|
+
// Add listeners that will automatically call an update function
|
|
100
|
+
// Pass `true` to use the Floating UI default options or Options object to override them
|
|
101
|
+
// Example: { ancestorScroll: false }
|
|
102
|
+
// For more details see https://floating-ui.com/docs/autoUpdate
|
|
103
|
+
autoUpdate: false,
|
|
93
104
|
|
|
94
105
|
// A class that will be applied to the attachment.
|
|
95
106
|
class: null,
|
|
@@ -127,8 +138,8 @@ Below is a list of all available options, along with their defaults.
|
|
|
127
138
|
// Useful for performance reasons, but will hide your attachment from search engines.
|
|
128
139
|
lazyRender: false,
|
|
129
140
|
|
|
130
|
-
//
|
|
131
|
-
|
|
141
|
+
// A middleware array that will be merged into computePosition options
|
|
142
|
+
middleware: null,
|
|
132
143
|
|
|
133
144
|
// A function to be fired when the attachment's visibility changes. The new visibility is passed
|
|
134
145
|
// to the function as an arg.
|
|
@@ -139,18 +150,18 @@ Below is a list of all available options, along with their defaults.
|
|
|
139
150
|
placement: 'top',
|
|
140
151
|
|
|
141
152
|
// The container where the attachment's DOM will be inserted.
|
|
142
|
-
|
|
153
|
+
floatingElementContainer: '.ember-application',
|
|
143
154
|
|
|
144
|
-
// An options object that will be passed to
|
|
145
|
-
|
|
155
|
+
// An options object that will be passed to Floating UI "computePosition" function.
|
|
156
|
+
floatingUiOptions: null,
|
|
146
157
|
|
|
147
158
|
// NOT RECOMMENDED: We currently allow you to pass an explicit target, but this may be removed
|
|
148
159
|
// in a future release.
|
|
149
160
|
// Please provide your thoughts here: https://github.com/kybishop/ember-attacher/issues/109
|
|
150
|
-
|
|
161
|
+
explicitTarget: null,
|
|
151
162
|
|
|
152
163
|
// Whether or not to render the attachment in place in the DOM, as opposed to
|
|
153
|
-
// on the
|
|
164
|
+
// on the floatingElementContainer. NOTE: Rendering in place can cause z-index issues.
|
|
154
165
|
renderInPlace: false,
|
|
155
166
|
|
|
156
167
|
// The delay, in milliseconds, before the attachment will be shown.
|
|
@@ -167,13 +178,16 @@ Below is a list of all available options, along with their defaults.
|
|
|
167
178
|
// than the bubbling phase. This should be set to true when there are elements on the page that
|
|
168
179
|
// are stopping event propagation in the bubbling phase, and as a result preventing correct
|
|
169
180
|
// showing and hiding of popovers and tooltips.
|
|
170
|
-
useCapture: false
|
|
181
|
+
useCapture: false,
|
|
182
|
+
|
|
183
|
+
// The default padding if collision happens. Set "false" if no collision prevention needed
|
|
184
|
+
overflowPadding: 5
|
|
171
185
|
}
|
|
172
186
|
```
|
|
173
187
|
|
|
174
188
|
## User-defined defaults
|
|
175
189
|
|
|
176
|
-
User-defined defaults can be set in the consuming app or addon's config/environment.js. These defaults will be applied to every
|
|
190
|
+
User-defined defaults can be set in the consuming app or addon's config/environment.js. These defaults will be applied to every `<AttachPopover/>` and `<AttachTooltip/>`
|
|
177
191
|
|
|
178
192
|
```javascript
|
|
179
193
|
// config/environment.js
|
|
@@ -253,11 +267,13 @@ test('example', async function(assert) {
|
|
|
253
267
|
<button id="toggle">
|
|
254
268
|
Click me, captain!
|
|
255
269
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
270
|
+
<AttachPopover
|
|
271
|
+
@id='attachment'
|
|
272
|
+
@hideOn='click'
|
|
273
|
+
@showOn='click'
|
|
274
|
+
>
|
|
259
275
|
Click-toggled popover
|
|
260
|
-
|
|
276
|
+
<AttachPopover/>
|
|
261
277
|
</button>
|
|
262
278
|
`);
|
|
263
279
|
|
|
@@ -282,7 +298,7 @@ See the [Contributing](CONTRIBUTING.md) guide for details.
|
|
|
282
298
|
|
|
283
299
|
Attachments are composed of two containers:
|
|
284
300
|
|
|
285
|
-
* [An outer container](https://github.com/kybishop/ember-attacher/blob/master/addon/templates/components/attach-popover.hbs#L2) for positioning (via [
|
|
301
|
+
* [An outer container](https://github.com/kybishop/ember-attacher/blob/master/addon/templates/components/attach-popover.hbs#L2) for positioning (via [floating-ui](https://github.com/floating-ui/floating-ui)).
|
|
286
302
|
* [An inner container](https://github.com/kybishop/ember-attacher/blob/master/addon/templates/components/attach-popover.hbs#L12) for the content. This is the container that is animated.
|
|
287
303
|
|
|
288
304
|
The outer container is positioned right next to the target via the CSS `transform` property. The inner container is required because animations also use `transform`, which would otherwise conflict with the container's position.
|
|
@@ -300,8 +316,8 @@ Note that animations require an implementation for each position (left, right, t
|
|
|
300
316
|
* [tippy.js](https://github.com/atomiks/tippyjs), the library that inspired
|
|
301
317
|
ember-attacher.
|
|
302
318
|
|
|
303
|
-
* [
|
|
304
|
-
positioning
|
|
319
|
+
* [floating-ui](https://github.com/floating-ui/floating-ui), the library that powers
|
|
320
|
+
positioning
|
|
305
321
|
|
|
306
322
|
* [ember-tooltips](https://github.com/sir-dunxalot/ember-tooltips), the addon that
|
|
307
323
|
influenced much of ember-attacher's API.
|