ember-attacher 1.3.0-beta.3 → 2.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/.github/dependabot.yml +0 -3
- package/.github/workflows/ci.yml +2 -2
- package/CHANGELOG.md +45 -0
- package/README.md +77 -31
- package/addon/components/attach-popover.js +299 -232
- package/addon/components/attach-tooltip.js +17 -33
- package/addon/defaults.js +5 -4
- 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 +42 -34
- package/app/styles/app.scss +0 -1
- package/yarn-error.log +0 -14650
package/.github/dependabot.yml
CHANGED
package/.github/workflows/ci.yml
CHANGED
|
@@ -37,7 +37,7 @@ on:
|
|
|
37
37
|
pull_request:
|
|
38
38
|
|
|
39
39
|
env:
|
|
40
|
-
NODE_VERSION: '
|
|
40
|
+
NODE_VERSION: '14'
|
|
41
41
|
|
|
42
42
|
jobs:
|
|
43
43
|
lint:
|
|
@@ -176,9 +176,9 @@ jobs:
|
|
|
176
176
|
fail-fast: true
|
|
177
177
|
matrix:
|
|
178
178
|
ember-try-scenario: [
|
|
179
|
-
ember-lts-3.12,
|
|
180
179
|
ember-lts-3.16,
|
|
181
180
|
ember-lts-3.20,
|
|
181
|
+
ember-lts-3.26,
|
|
182
182
|
ember-release,
|
|
183
183
|
ember-default,
|
|
184
184
|
ember-default-with-jquery
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
## v2.0.1 (2023-05-15)
|
|
3
|
+
|
|
4
|
+
#### :boom: Breaking Change
|
|
5
|
+
* [#772](https://github.com/tylerturdenpants/ember-attacher/pull/772) Convert to Glimmer component ([@pzubar](https://github.com/pzubar))
|
|
6
|
+
* [#743](https://github.com/tylerturdenpants/ember-attacher/pull/743) Migration to the Floating UI ([@pzubar](https://github.com/pzubar))
|
|
7
|
+
|
|
8
|
+
#### :rocket: Enhancement
|
|
9
|
+
* [#772](https://github.com/tylerturdenpants/ember-attacher/pull/772) Convert to Glimmer component ([@pzubar](https://github.com/pzubar))
|
|
10
|
+
* [#759](https://github.com/tylerturdenpants/ember-attacher/pull/759) Bump dependencies ([@pzubar](https://github.com/pzubar))
|
|
11
|
+
* [#743](https://github.com/tylerturdenpants/ember-attacher/pull/743) Migration to the Floating UI ([@pzubar](https://github.com/pzubar))
|
|
12
|
+
* [#561](https://github.com/tylerturdenpants/ember-attacher/pull/561) Avoid forcing dart ([@kmccullough](https://github.com/kmccullough))
|
|
13
|
+
|
|
14
|
+
#### :house: Internal
|
|
15
|
+
* [#759](https://github.com/tylerturdenpants/ember-attacher/pull/759) Bump dependencies ([@pzubar](https://github.com/pzubar))
|
|
16
|
+
|
|
17
|
+
#### Committers: 2
|
|
18
|
+
- Kerry McCullough ([@kmccullough](https://github.com/kmccullough))
|
|
19
|
+
- Petro Zubar ([@pzubar](https://github.com/pzubar))
|
|
20
|
+
|
|
21
|
+
## v1.3.0 (2021-09-09)
|
|
22
|
+
|
|
23
|
+
#### :rocket: Enhancement
|
|
24
|
+
* [#553](https://github.com/kybishop/ember-attacher/pull/553) Remove warning for popover/tooltip in config ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
25
|
+
* [#550](https://github.com/kybishop/ember-attacher/pull/550) Better default handling ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
26
|
+
* [#488](https://github.com/kybishop/ember-attacher/pull/488) Remove excess whitespace content ([@kmccullough](https://github.com/kmccullough))
|
|
27
|
+
* [#446](https://github.com/kybishop/ember-attacher/pull/446) add svg-jar to replace ember-font-awesome ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
28
|
+
* [#427](https://github.com/kybishop/ember-attacher/pull/427) update to ember-qunit 5 ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
29
|
+
|
|
30
|
+
#### :bug: Bug Fix
|
|
31
|
+
* [#479](https://github.com/kybishop/ember-attacher/pull/479) Remove addons that use old AST builder syntax API's ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
32
|
+
|
|
33
|
+
#### :house: Internal
|
|
34
|
+
* [#553](https://github.com/kybishop/ember-attacher/pull/553) Remove warning for popover/tooltip in config ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
35
|
+
* [#549](https://github.com/kybishop/ember-attacher/pull/549) Use github-actions-setup-for-ember-addon ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
36
|
+
* [#446](https://github.com/kybishop/ember-attacher/pull/446) add svg-jar to replace ember-font-awesome ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
37
|
+
* [#427](https://github.com/kybishop/ember-attacher/pull/427) update to ember-qunit 5 ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
38
|
+
* [#479](https://github.com/kybishop/ember-attacher/pull/479) Remove addons that use old AST builder syntax API's ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
39
|
+
|
|
40
|
+
#### Committers: 4
|
|
41
|
+
- Kerry McCullough ([@kmccullough](https://github.com/kmccullough))
|
|
42
|
+
- Peter Wagenet ([@wagenet](https://github.com/wagenet))
|
|
43
|
+
- Ryan Mark ([@tylerturdenpants](https://github.com/tylerturdenpants))
|
|
44
|
+
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)
|
|
45
|
+
|
|
1
46
|
## v1.3.0-beta.3 (2021-09-02)
|
|
2
47
|
|
|
3
48
|
#### :rocket: Enhancement
|
package/README.md
CHANGED
|
@@ -10,35 +10,47 @@
|
|
|
10
10
|
|
|
11
11
|
------------------------------------------------------------------------------
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
***NOTE***
|
|
14
|
+
|
|
15
|
+
The addon's dummy application needs a serious upgrade. I [@tylerturdenpants](https://github.com/tylerturdenpants) have removed as much orf the support on flexi and flexi styles that I can, but the dummy app will still produces warnings regarding SASS division.
|
|
16
|
+
|
|
17
|
+
Additionally, this app likely has support beyond ember 3.24, but test fail locally since not all babel related issues during testing have been resolved.
|
|
18
|
+
|
|
19
|
+
As the only supporter of this addon, a father, and a full time employee at a software company, I really need the help to fully pull flexi out and to revamp the dummy app. Once these blockers are removed I can do the work to bring this addon into the future.
|
|
20
|
+
|
|
21
|
+
----
|
|
22
|
+
|
|
23
|
+
* Ember.js v3.16 or above
|
|
14
24
|
* Ember CLI v3.13 or above
|
|
15
|
-
* Node.js
|
|
25
|
+
* Node.js v12 or above
|
|
16
26
|
|
|
17
27
|
Tooltips and popovers made easy.
|
|
18
|
-
Just drop an
|
|
28
|
+
Just drop an `<AttachTooltip/>` or `<AttachPopover/>` in a parent and your floating element is ready to go!
|
|
19
29
|
|
|
20
30
|
```hbs
|
|
21
31
|
<button>
|
|
22
32
|
Click me
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
<AttachTooltip>
|
|
25
35
|
I'm a tooltip!
|
|
26
|
-
|
|
36
|
+
</AttachTooltip>
|
|
27
37
|
</button>
|
|
28
38
|
|
|
29
39
|
<button class="other-button">
|
|
30
40
|
No click me!
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
<AttachPopover
|
|
43
|
+
@class='ember-attacher'
|
|
44
|
+
@hideOn='click'
|
|
45
|
+
@isShown={{true}}
|
|
46
|
+
@showOn='click'
|
|
47
|
+
>
|
|
36
48
|
I'm a popover!
|
|
37
|
-
|
|
49
|
+
</AttachPopover>
|
|
38
50
|
</button>
|
|
39
51
|
```
|
|
40
52
|
|
|
41
|
-
See [the example site](https://
|
|
53
|
+
See [the example site](https://tylerturdenpants.github.io/ember-attacher/) for a demonstration of all
|
|
42
54
|
available options.
|
|
43
55
|
|
|
44
56
|
## Installation
|
|
@@ -47,21 +59,24 @@ available options.
|
|
|
47
59
|
ember install ember-attacher
|
|
48
60
|
```
|
|
49
61
|
|
|
62
|
+
If you're upgrading from 1.x to 2.x [see the upgrade guide](./docs/upgrade-guide-2.0.md).
|
|
63
|
+
|
|
64
|
+
|
|
50
65
|
## Components
|
|
51
66
|
|
|
52
|
-
###
|
|
67
|
+
### `<AttachPopover/>`
|
|
53
68
|
|
|
54
69
|
A popover attacher.
|
|
55
70
|
|
|
56
71
|
* Has no default class or roles.
|
|
57
72
|
* Does not modify the target in any way.
|
|
58
|
-
* Adds `aria-hidden` attribute to the
|
|
73
|
+
* Adds `aria-hidden` attribute to the floating element
|
|
59
74
|
|
|
60
|
-
###
|
|
75
|
+
### `<AttachTooltip/>`
|
|
61
76
|
|
|
62
|
-
A tooltip attacher. Subclass of
|
|
77
|
+
A tooltip attacher. Subclass of `<AttachPopover/>`
|
|
63
78
|
|
|
64
|
-
* Has the default class `'ember-attacher-
|
|
79
|
+
* Has the default class `'ember-attacher-floating ember-attacher-tooltip'`
|
|
65
80
|
* The default tooltip classes can be modified by altering the `tooltipClass`
|
|
66
81
|
default. See [here](#user-defined-defaults) for details on editing default values.
|
|
67
82
|
|
|
@@ -80,6 +95,12 @@ Below is a list of all available options, along with their defaults.
|
|
|
80
95
|
|
|
81
96
|
// Whether or not an arrow will be displayed next to the attachment.
|
|
82
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,
|
|
83
104
|
|
|
84
105
|
// A class that will be applied to the attachment.
|
|
85
106
|
class: null,
|
|
@@ -117,8 +138,8 @@ Below is a list of all available options, along with their defaults.
|
|
|
117
138
|
// Useful for performance reasons, but will hide your attachment from search engines.
|
|
118
139
|
lazyRender: false,
|
|
119
140
|
|
|
120
|
-
//
|
|
121
|
-
|
|
141
|
+
// A middleware array that will be merged into computePosition options
|
|
142
|
+
middleware: null,
|
|
122
143
|
|
|
123
144
|
// A function to be fired when the attachment's visibility changes. The new visibility is passed
|
|
124
145
|
// to the function as an arg.
|
|
@@ -129,18 +150,18 @@ Below is a list of all available options, along with their defaults.
|
|
|
129
150
|
placement: 'top',
|
|
130
151
|
|
|
131
152
|
// The container where the attachment's DOM will be inserted.
|
|
132
|
-
|
|
153
|
+
floatingElementContainer: '.ember-application',
|
|
133
154
|
|
|
134
|
-
// An options object that will be passed to
|
|
135
|
-
|
|
155
|
+
// An options object that will be passed to Floating UI "computePosition" function.
|
|
156
|
+
floatingUiOptions: null,
|
|
136
157
|
|
|
137
158
|
// NOT RECOMMENDED: We currently allow you to pass an explicit target, but this may be removed
|
|
138
159
|
// in a future release.
|
|
139
160
|
// Please provide your thoughts here: https://github.com/kybishop/ember-attacher/issues/109
|
|
140
|
-
|
|
161
|
+
explicitTarget: null,
|
|
141
162
|
|
|
142
163
|
// Whether or not to render the attachment in place in the DOM, as opposed to
|
|
143
|
-
// on the
|
|
164
|
+
// on the floatingElementContainer. NOTE: Rendering in place can cause z-index issues.
|
|
144
165
|
renderInPlace: false,
|
|
145
166
|
|
|
146
167
|
// The delay, in milliseconds, before the attachment will be shown.
|
|
@@ -163,7 +184,7 @@ Below is a list of all available options, along with their defaults.
|
|
|
163
184
|
|
|
164
185
|
## User-defined defaults
|
|
165
186
|
|
|
166
|
-
User-defined defaults can be set in the consuming app or addon's config/environment.js. These defaults will be applied to every
|
|
187
|
+
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/>`
|
|
167
188
|
|
|
168
189
|
```javascript
|
|
169
190
|
// config/environment.js
|
|
@@ -199,6 +220,29 @@ module.exports = function(environment) {
|
|
|
199
220
|
}
|
|
200
221
|
```
|
|
201
222
|
|
|
223
|
+
And finally you can do shared defaults along with user-defined separated defaults:
|
|
224
|
+
|
|
225
|
+
```javascript
|
|
226
|
+
// config/environment.js
|
|
227
|
+
|
|
228
|
+
module.exports = function(environment) {
|
|
229
|
+
var ENV = {
|
|
230
|
+
emberAttacher: {
|
|
231
|
+
showDuration: 300,
|
|
232
|
+
hideDuration: 300,
|
|
233
|
+
tooltip: {
|
|
234
|
+
animation: 'fade',
|
|
235
|
+
arrow: true
|
|
236
|
+
},
|
|
237
|
+
popover: {
|
|
238
|
+
animation: 'shift',
|
|
239
|
+
arrow: false
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
202
246
|
The full list of editable defaults can be seen [here](https://github.com/kybishop/ember-attacher/blob/master/addon/defaults.js).
|
|
203
247
|
|
|
204
248
|
## Styles
|
|
@@ -220,11 +264,13 @@ test('example', async function(assert) {
|
|
|
220
264
|
<button id="toggle">
|
|
221
265
|
Click me, captain!
|
|
222
266
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
267
|
+
<AttachPopover
|
|
268
|
+
@id='attachment'
|
|
269
|
+
@hideOn='click'
|
|
270
|
+
@showOn='click'
|
|
271
|
+
>
|
|
226
272
|
Click-toggled popover
|
|
227
|
-
|
|
273
|
+
<AttachPopover/>
|
|
228
274
|
</button>
|
|
229
275
|
`);
|
|
230
276
|
|
|
@@ -249,7 +295,7 @@ See the [Contributing](CONTRIBUTING.md) guide for details.
|
|
|
249
295
|
|
|
250
296
|
Attachments are composed of two containers:
|
|
251
297
|
|
|
252
|
-
* [An outer container](https://github.com/kybishop/ember-attacher/blob/master/addon/templates/components/attach-popover.hbs#L2) for positioning (via [
|
|
298
|
+
* [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)).
|
|
253
299
|
* [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.
|
|
254
300
|
|
|
255
301
|
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.
|
|
@@ -267,8 +313,8 @@ Note that animations require an implementation for each position (left, right, t
|
|
|
267
313
|
* [tippy.js](https://github.com/atomiks/tippyjs), the library that inspired
|
|
268
314
|
ember-attacher.
|
|
269
315
|
|
|
270
|
-
* [
|
|
271
|
-
positioning
|
|
316
|
+
* [floating-ui](https://github.com/floating-ui/floating-ui), the library that powers
|
|
317
|
+
positioning
|
|
272
318
|
|
|
273
319
|
* [ember-tooltips](https://github.com/sir-dunxalot/ember-tooltips), the addon that
|
|
274
320
|
influenced much of ember-attacher's API.
|