ember-attacher 3.3.0 → 4.0.0-beta.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.
Files changed (40) hide show
  1. package/dist/_app_/components/attach-popover.js +1 -0
  2. package/dist/_app_/components/attach-tooltip.js +1 -0
  3. package/dist/_app_/components/basic-attacher.js +1 -0
  4. package/dist/components/attach-popover.js +11 -0
  5. package/dist/components/attach-popover.js.map +1 -0
  6. package/dist/components/attach-tooltip.js +37 -0
  7. package/dist/components/attach-tooltip.js.map +1 -0
  8. package/{addon/components/attach-popover.js → dist/components/basic-attacher.js} +35 -18
  9. package/dist/components/basic-attacher.js.map +1 -0
  10. package/{addon → dist}/defaults.js +5 -1
  11. package/dist/defaults.js.map +1 -0
  12. package/{addon-test-support/is-visible.js → dist/test-support/index.js} +5 -1
  13. package/dist/test-support/index.js.map +1 -0
  14. package/package.json +39 -76
  15. package/.idea/codeStyles/Project.xml +0 -32
  16. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  17. package/.idea/ember-attacher.iml +0 -31
  18. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  19. package/.idea/material_theme_project_new.xml +0 -13
  20. package/.idea/modules.xml +0 -8
  21. package/.idea/vcs.xml +0 -6
  22. package/CHANGELOG.md +0 -729
  23. package/README.md +0 -321
  24. package/RELEASE.md +0 -65
  25. package/addon/-debug/helpers.js +0 -23
  26. package/addon/components/attach-tooltip.js +0 -38
  27. package/addon/styles/_mixins.scss +0 -107
  28. package/addon/styles/addon.sass +0 -5
  29. package/addon/styles/addon.scss +0 -5
  30. package/addon/styles/ember-attacher.scss +0 -137
  31. package/addon/styles/themes.scss +0 -16
  32. package/addon/styles/variables.scss +0 -3
  33. package/addon/templates/components/attach-popover.hbs +0 -29
  34. package/addon-test-support/index.js +0 -1
  35. package/app/components/attach-popover.js +0 -1
  36. package/app/components/attach-tooltip.js +0 -1
  37. package/app/templates/components/attach-popover.js +0 -1
  38. package/config/flexi.js +0 -37
  39. package/docs/upgrade-guide-2.0.md +0 -43
  40. package/index.js +0 -81
@@ -1,137 +0,0 @@
1
- .ember-attacher {
2
- width: max-content;
3
- position: absolute;
4
- top: 0;
5
- left: 0;
6
- display: none;
7
- perspective: 800px;
8
- transition-timing-function: cubic-bezier(.165, .84, .44, 1);
9
- z-index: 9999;
10
-
11
- @each $position in $positions {
12
- &[x-placement^=#{$position}] {
13
- div[x-arrow] {
14
- @include arrow($position, 10px);
15
- }
16
-
17
- div[x-circle] {
18
- @include circle-transform-hide($position);
19
- opacity: 0;
20
- transform-origin: nth($circle-origins, index($positions, $position));
21
- }
22
-
23
- > .ember-attacher-fill {
24
- @include ember-attacher-hide-transform($position, 'shift');
25
- opacity: 0;
26
- }
27
-
28
- > .ember-attacher-none {
29
- @include ember-attacher-hide-transform($position, 'none');
30
- opacity: 1;
31
-
32
- }
33
-
34
- > .ember-attacher-fade {
35
- @include ember-attacher-show-transform($position, 'fade');
36
- opacity: 0;
37
- }
38
-
39
- > .ember-attacher-shift {
40
- @include ember-attacher-hide-transform($position, 'shift');
41
- opacity: 0;
42
- }
43
-
44
- > .ember-attacher-scale {
45
- @include ember-attacher-hide-transform($position, 'scale');
46
- opacity: 0;
47
- }
48
-
49
- > .ember-attacher-perspective {
50
- @include ember-attacher-hide-transform($position, 'perspective');
51
- opacity: 0;
52
- transform-origin: nth($origins, index($positions, $position));
53
- }
54
-
55
- > .ember-attacher-show {
56
- > div[x-circle] {
57
- opacity: 1;
58
- transform: scale(1.2) translate(-50%, -50%);
59
- }
60
-
61
- &.ember-attacher-fade,
62
- &.ember-attacher-fill,
63
- &.ember-attacher-none,
64
- &.ember-attacher-shift {
65
- @include ember-attacher-show-transform($position, 'fade');
66
- opacity: 1;
67
- }
68
-
69
- &.ember-attacher-scale {
70
- @include ember-attacher-show-transform($position, 'scale');
71
- opacity: 1;
72
- }
73
-
74
- &.ember-attacher-perspective {
75
- @include ember-attacher-show-transform($position, 'perspective');
76
- opacity: 1;
77
- }
78
- }
79
- }
80
- }
81
- }
82
-
83
- .ember-attacher-tooltip {
84
- background-color: #333;
85
- border-radius: 4px;
86
- color: #fff;
87
- -moz-osx-font-smoothing: grayscale;
88
- -webkit-font-smoothing: antialiased;
89
- max-width: 400px;
90
- padding: .5rem 1rem;
91
- position: relative;
92
- text-align: center;
93
- will-change: transform;
94
-
95
- &.ember-attacher-fill {
96
- background-color: transparent;
97
- overflow: hidden;
98
- }
99
-
100
- > div[x-arrow] {
101
- background-color: #333;
102
- border: 1px solid;
103
- border-color: transparent transparent #333 #333;
104
- height: 10px;
105
- position: absolute;
106
- width: 10px;
107
- z-index: -1;
108
- }
109
-
110
- > div[x-circle] {
111
- background-color: #333;
112
- border-radius: 50%;
113
- left: 50%;
114
- opacity: 0;
115
- overflow: hidden;
116
- position: absolute;
117
- transition: all ease-out;
118
- width: 120%;
119
- width: calc(100% + 2rem);
120
- will-change: transform;
121
- z-index: -1;
122
-
123
- &::before {
124
- content: '';
125
- padding-top: 100%;
126
- padding-top: calc(75% + 2rem);
127
- float: left;
128
- }
129
- }
130
- }
131
-
132
- @media (max-width: 450px) {
133
- .ember-attacher-tooltip {
134
- max-width: 96%;
135
- max-width: calc(100% - 42px);
136
- }
137
- }
@@ -1,16 +0,0 @@
1
- .ember-attacher-light-theme {
2
- background-color: #f3f6f9;
3
- border: 1px solid #ced2e2;
4
- box-shadow: 0 0 16px -4px rgba(0, 20, 40, 0.2), 0 0 80px -10px rgba(0, 20, 40, 0.3);
5
- color: #203d5d;
6
-
7
-
8
- > div[x-arrow] {
9
- background-color: #f3f6f9;
10
- border-color: transparent transparent #ced2e2 #ced2e2;
11
- }
12
-
13
- > div[x-circle] {
14
- background-color: #f3f6f9;
15
- }
16
- }
@@ -1,3 +0,0 @@
1
- $positions: 'top', 'bottom', 'left', 'right';
2
- $origins: bottom, top, right, left;
3
- $circle-origins: 0% 50%, 0% -50%, 50% 5%, -50% 5%;
@@ -1,29 +0,0 @@
1
- {{~#unless this.renderFloatingElement}}
2
- <meta hidden {{did-insert this.onParentFinderInsert}} {{did-update this.onIsShownChange this.isShown}}/>
3
- {{~/unless~}}
4
-
5
- {{~#if this.renderFloatingElement~}}
6
- <MaybeInElement @destinationElement={{this._floatingElementContainer}} @renderInPlace={{@renderInPlace}}>
7
- <div
8
- class="ember-attacher"
9
- id={{this.id}}
10
- role={{this.ariaRole}}
11
- {{did-insert this.didInsertFloatingElement}}
12
- {{did-update this.onIsShownChange this.isShown}}
13
- {{did-update this.onTargetOrTriggerChange this.hideOn this.showOn @explicitTarget}}
14
- {{did-update this.onOptionsChange this.autoUpdate this.animation this.arrow this.useCapture this.placement this._renderInPlace this._currentTarget this._middleware}}
15
- {{will-destroy this.willDestroyFloatingElement}}
16
- ...attributes
17
- >
18
- <div class={{this._class}} style={{this._style}}>
19
- {{yield (hash hide=this.hide)}}
20
- {{#if this.arrow}}
21
- <div x-arrow {{did-insert this.didInsertArrow}}></div>
22
- {{/if}}
23
- {{#if this.isFillAnimation}}
24
- <div x-circle style="{{this._circleTransitionDuration}}"></div>
25
- {{/if}}
26
- </div>
27
- </div>
28
- </MaybeInElement>
29
- {{~/if~}}
@@ -1 +0,0 @@
1
- export { isVisible } from './is-visible';
@@ -1 +0,0 @@
1
- export { default } from 'ember-attacher/components/attach-popover';
@@ -1 +0,0 @@
1
- export { default } from 'ember-attacher/components/attach-tooltip';
@@ -1 +0,0 @@
1
- export { default } from 'ember-attacher/templates/components/attach-popover';
package/config/flexi.js DELETED
@@ -1,37 +0,0 @@
1
- /* eslint-env node */
2
- 'use strict';
3
-
4
- module.exports = {
5
- // breakpoints, order does not matter, they will be sorted by `begin`
6
- // `name` is used for layout names and booleans on the device/layout service
7
- // `prefix` is used for column classes, column attributes, and container breakpoint classes
8
- // `begin` is the pixel value at which this breakpoint becomes active
9
- breakpoints: [
10
- { name: 'mobile', prefix: 'xs', begin: 0 },
11
- { name: 'largemobile', prefix: 'lm', begin: 512 },
12
- { name: 'tablet', prefix: 'sm', begin: 768 },
13
- { name: 'desktop', prefix: 'md', begin: 992 },
14
- { name: 'huge', prefix: 'lg', begin: 1200 }
15
- ],
16
-
17
- // the number of columns for the grid
18
- columns: 24,
19
-
20
- // optional, used for column classes: '<colPrefix>-<breakpointPrefix>-<columnNumber>'
21
- columnPrefix: 'col',
22
-
23
- // if false, @media css is not included
24
- includeMediaCSS: true,
25
-
26
- // if false, default element styles are not included
27
- includeElementCSS: true,
28
-
29
- // if true, will convert layout attributes on non-layout elements to classes as well
30
- transformAllElementLayoutAttributes: false,
31
-
32
- // grid and layout element gutters
33
- gutterPadding: '0',
34
-
35
- // if false, no styles are included (trumps 'includeMediaCSS' and 'includeElementCSS')
36
- includeCSS: true
37
- };
@@ -1,43 +0,0 @@
1
- # ember-attacher 2.0
2
-
3
- ## Quick Summary
4
-
5
- - ember-popper was replaced by the [Floating UI](https://github.com/floating-ui/floating-ui)
6
- - ember edition was changed to "octane"
7
- - ember-test-waiters are used now to wait until positioning inside `requestAnimationFrame` happen in tests
8
- - we dropped support for node < 12 and ember-source < 3.16
9
-
10
- ## Details
11
-
12
- ### API Changes
13
-
14
- - instead of popper [modifiers](https://popper.js.org/docs/v2/modifiers/) you should use Floating UI [middleware](https://floating-ui.com/docs/middleware).
15
- You can import the default ones (like [offset](https://floating-ui.com/docs/offset) or [flip](https://floating-ui.com/docs/flip)) directly from `@floating-ui/dom`
16
-
17
- For example
18
- ```js
19
- const modifiers = { offset: { offset: 10 } };
20
- ```
21
- will become
22
- ```js
23
- import { offset } from '@floating-ui/dom';
24
- ...
25
- const middleware = [offset(10)]
26
- ```
27
- - `popperContainer` is `floatingElementContainer` now
28
- - `popperOptions` is `floatingUiOptions` now. The object is passed to Floating UI [computePosition](https://floating-ui.com/docs/computePosition) function.
29
- - `popperTarget` is `explicitTarget` now.
30
- - Instead of `registerAPI` used to update your tooltip or popover manually, you should use `autoUpdate` [option](https://github.com/tylerturdenpants/ember-attacher#options).
31
- It adds listeners that will automatically call an update function when necessary (if the user scrolls or resizes the screen, etc.).
32
- - For more details see Floating UI [migration guide](https://floating-ui.com/docs/migration). Pay attention that `ember-attacher` v1 used Popper v1.
33
-
34
- ### IDs and CSS classes changes
35
-
36
- - The prefix for the default floating element's `id` is now "-floating" instead of "-popper".
37
- - The default `ember-attacher-popper` class is now `ember-attacher-floating`
38
-
39
- ### Compatibility
40
-
41
- For Ember.js below the v3.20 you may need to install [@ember/render-modifiers](https://github.com/emberjs/ember-render-modifiers) (`ember install @ember/render-modifiers`).
42
-
43
- The addon may work with the ember-source < 3.16, yet the support is not guaranteed.
package/index.js DELETED
@@ -1,81 +0,0 @@
1
- /* eslint-env node */
2
- 'use strict';
3
-
4
- const FilterImports = require('babel-plugin-filter-imports');
5
- const Funnel = require('broccoli-funnel');
6
-
7
- module.exports = {
8
- name: require('./package').name,
9
-
10
- included(parent) {
11
- this._super.included.apply(this, arguments);
12
- let app = this.app;
13
-
14
- while (!app && parent) {
15
- if (parent.app) {
16
- app = parent.app;
17
- } else {
18
- parent = parent.parent;
19
- }
20
- }
21
-
22
- this._env = app.env;
23
- this._setupBabelOptions(app.env);
24
- },
25
-
26
- _hasSetupBabelOptions: false,
27
- _setupBabelOptions(env) {
28
- if (this._hasSetupBabelOptions) {
29
- return;
30
- }
31
-
32
- if (/production/.test(env)) {
33
- // In some versions of Ember, this.options is undefined during tests
34
- this.options = this.options || {};
35
-
36
- // Make sure the babel options are accessible
37
- const babelOptions = this.options.babel = this.options.babel || {};
38
-
39
- babelOptions.plugins = babelOptions.plugins || [];
40
- babelOptions.postTransformPlugins = babelOptions.postTransformPlugins || [];
41
-
42
- const strippedImports = {
43
- 'imports': {
44
- 'ember-attacher/-debug/helpers': [
45
- 'assert',
46
- 'debug',
47
- 'debugOnError',
48
- 'stripInProduction'
49
- ]
50
- }
51
- };
52
- babelOptions.plugins.push([FilterImports, strippedImports]);
53
- }
54
-
55
- this._hasSetupBabelOptions = true;
56
- },
57
-
58
- treeForAddon(tree) {
59
- if (/production/.test(this._env)) {
60
- tree = new Funnel(tree, { exclude: [/-debug/] });
61
- }
62
-
63
- return this._super.treeForAddon.call(this, tree);
64
- },
65
-
66
- treeForAddonTestSupport(tree) {
67
- // intentionally not calling _super here
68
- // so that can have our `import`'s be
69
- // import { click, fillIn } from 'ember-native-dom-helpers';
70
-
71
- const namespacedTree = new Funnel(tree, {
72
- srcDir: '/',
73
- destDir: `/${this.moduleName()}`,
74
- annotation: `Addon#treeForTestSupport (${this.name})`
75
- });
76
-
77
- return this.preprocessJs(namespacedTree, '/', this.name, {
78
- registry: this.registry
79
- });
80
- }
81
- };