@ember-eui/core 5.10.0 → 5.10.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.
@@ -63,7 +63,7 @@
63
63
  @beforeOptionsComponent={{@beforeOptionsComponent}}
64
64
  @placeholder={{@placeholder}}
65
65
  @searchPlaceholder={{@searchPlaceholder}}
66
- @optionsComponent={{component "eui-combo-box/options" rowHeight=@rowHeight}}
66
+ @optionsComponent={{component "eui-combo-box/options" rowHeight=@rowHeight class=@optionsClass}}
67
67
  @extra={{@extra}}
68
68
  @groupComponent={{component "eui-combo-box/group"}}
69
69
  @triggerClass={{class-names
@@ -25,6 +25,7 @@
25
25
  style="max-height: 200px; overflow-y: auto;"
26
26
  role="listbox"
27
27
  aria-controls="ember-power-select-trigger-{{@select.uniqueId}}"
28
+ class={{@class}}
28
29
  ...attributes
29
30
  {{did-insert this.addHandlers}}
30
31
  {{will-destroy this.removeHandlers}}
@@ -1,7 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { tracked } from '@glimmer/tracking';
4
- import { uniqueId } from '../../helpers/unique-id';
4
+ import { guidFor } from '@ember/object/internals';
5
5
  import { isWithinRange } from '../../utils/number';
6
6
 
7
7
  import { EuiRangeInputArgs } from '../eui-range-input/types';
@@ -87,7 +87,7 @@ export default class EuiDualRangeComponent extends Component<EuiDualRangeArgs> {
87
87
  @argOrDefault([]) levels!: EuiRangeLevel[];
88
88
 
89
89
  //State
90
- @tracked id: string = this.args.id || uniqueId();
90
+ @tracked id: string = this.args.id || guidFor({});
91
91
  @tracked hasFocus = false;
92
92
  @tracked rangeSliderRefAvailable = false;
93
93
  @tracked isPopoverOpen = false;
@@ -6,7 +6,7 @@ import {
6
6
  colorToClassMap,
7
7
  typeToPathMap
8
8
  } from '../../utils/css-mappings/eui-icon';
9
- import { uniqueId } from '../../helpers/unique-id';
9
+ import { guidFor } from '@ember/object/internals';
10
10
  import { htmlSafe } from '@ember/template';
11
11
  import { getOwner } from '@ember/application';
12
12
 
@@ -178,7 +178,7 @@ export default class EuiIcon extends Component<EuiIconArgs> {
178
178
  // The svg aria-labelledby attribute gets this titleId
179
179
  // The svg title element gets this titleId as an id
180
180
  if (!this.args['aria-label'] && !this.args['aria-labelledby'] && title) {
181
- titleId = uniqueId();
181
+ titleId = guidFor({});
182
182
  }
183
183
  return titleId;
184
184
  }
@@ -11,7 +11,7 @@ import {
11
11
  defaultParsingPlugins,
12
12
  defaultProcessingPlugins
13
13
  } from '../../utils/markdown/plugins/markdown-default-plugins';
14
- import { uniqueId } from '../../helpers/unique-id';
14
+ import { guidFor } from '@ember/object/internals';
15
15
  import unified from 'unified';
16
16
  import * as MarkdownTooltipPlugin from '../../utils/markdown/plugins/markdown-tooltip';
17
17
  import {
@@ -121,7 +121,7 @@ export default class EuiMarkdownEditorComponent extends Component<EuiMarkdownEdi
121
121
  declare processingPluginList: typeof defaultProcessingPlugins;
122
122
 
123
123
  @tracked selectedNode: Node | null = null;
124
- @tracked editorId = this.args.editorId ?? uniqueId();
124
+ @tracked editorId = this.args.editorId ?? guidFor({});
125
125
  @tracked viewMode = this.args.initialViewMode || MODE_EDITING;
126
126
  @tracked textareaRef: HTMLTextAreaElement | null = null;
127
127
  @tracked previewRef: HTMLDivElement | null = null;
@@ -1,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { tracked } from '@glimmer/tracking';
3
- import { uniqueId } from '../../helpers/unique-id';
3
+ import { guidFor } from '@ember/object/internals';
4
4
  import { keysOf } from '../common';
5
5
 
6
6
  interface InsertPositionsMap {
@@ -32,7 +32,7 @@ export default class EuiPortal extends Component<EuiPortalArgs> {
32
32
  const { insert } = this.args;
33
33
 
34
34
  this.portalNode = document.createElement('div');
35
- this.portalNode.id = `${uniqueId()}-portal`;
35
+ this.portalNode.id = `${guidFor({})}-portal`;
36
36
 
37
37
  if (insert == null) {
38
38
  // no insertion defined, append to body
@@ -1,7 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { tracked } from '@glimmer/tracking';
4
- import { uniqueId } from '../../helpers/unique-id';
4
+ import { guidFor } from '@ember/object/internals';
5
5
  import { isWithinRange } from '../../utils/number';
6
6
  import { EuiRangeInputArgs } from '../eui-range-input/types';
7
7
  import { EuiRangeLevel } from '../eui-range-levels';
@@ -81,7 +81,7 @@ export default class EuiRangeComponent extends Component<EuiRangeArgs> {
81
81
  preventPopoverClose = false;
82
82
 
83
83
  //State
84
- @tracked id: string = this.args.id || uniqueId();
84
+ @tracked id: string = this.args.id || guidFor({});
85
85
  @tracked isPopoverOpen = false;
86
86
  ///
87
87
 
@@ -1,11 +1,11 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { argOrDefaultDecorator as argOrDefault } from '../../helpers/arg-or-default';
4
- import { uniqueId } from '../../helpers/unique-id';
5
4
  import { tracked, cached } from '@glimmer/tracking';
6
5
  import { findPopoverPosition } from '../../utils/popover';
7
6
  import { keys } from '../../utils/keys';
8
7
  import { later, cancel, scheduleOnce, next } from '@ember/runloop';
8
+ import { guidFor } from '@ember/object/internals';
9
9
 
10
10
  export type ToolTipPositions = 'top' | 'right' | 'bottom' | 'left';
11
11
 
@@ -104,7 +104,7 @@ export default class EuiToolTip extends Component<EuiTooltipArgs> {
104
104
  @tracked calculatedPosition: ToolTipPositions = this.position;
105
105
  @tracked toolTipStyles: ToolTipStyles = DEFAULT_TOOLTIP_STYLES;
106
106
  @tracked arrowStyles: undefined | { left: string; top: string };
107
- @tracked id: string = this.args.id || uniqueId();
107
+ @tracked id: string = this.args.id || guidFor({});
108
108
  @tracked _attachTo: undefined | HTMLElement | string | null = null;
109
109
 
110
110
  private timeoutId?: ReturnType<typeof later>;
@@ -1,5 +1,5 @@
1
1
  import Modifier from 'ember-modifier';
2
- import { uniqueId } from '../helpers/unique-id';
2
+ import { guidFor } from '@ember/object/internals';
3
3
  import { action } from '@ember/object';
4
4
 
5
5
  interface OutsideClickDetectorModifierArgs {
@@ -46,7 +46,7 @@ export default class OutsideClickDetector extends Modifier<OutsideClickDetectorM
46
46
  }
47
47
 
48
48
  didInstall(): void {
49
- this.id = uniqueId();
49
+ this.id = guidFor({});
50
50
  document.addEventListener('mouseup', this.onClickOutside);
51
51
  document.addEventListener('touchend', this.onClickOutside);
52
52
  this.addElementEvents();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "5.10.0",
3
+ "version": "5.10.2",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -78,6 +78,7 @@
78
78
  "ember-style-modifier": "^0.7.0",
79
79
  "ember-svg-jar": "^2.3.4",
80
80
  "ember-truth-helpers": "^3.0.0",
81
+ "ember-unique-id-helper-polyfill": "^1.2.2",
81
82
  "lodash-es": "^4.17.21",
82
83
  "mdast-util-to-hast": "^10.0.0",
83
84
  "refractor": "^3.5.0",
@@ -185,5 +186,5 @@
185
186
  "volta": {
186
187
  "extends": "../../package.json"
187
188
  },
188
- "gitHead": "f362b88c26b899191769be04f0a65e04eccc75ac"
189
+ "gitHead": "0388fd81182e0bc01bbbee79b4084cacc5762dd8"
189
190
  }
@@ -1,23 +0,0 @@
1
- import { helper } from '@ember/component/helper';
2
- import { guidFor } from '@ember/object/internals';
3
- import { isPresent } from '@ember/utils';
4
-
5
- interface Identifiable {
6
- ref: number | string | Element | Record<string, unknown>;
7
- }
8
-
9
- /**
10
- * Returns a guid for the passed `ref`.
11
- * The guid is stable, meaning that passing the same `ref` will yield the same guid.
12
- * If no parameter is passed it will generate the next available guid.
13
- *
14
- * @param { any } ref
15
- */
16
- export function uniqueId(
17
- _?: any[],
18
- { ref }: { ref?: Identifiable } = {}
19
- ): string {
20
- return isPresent(ref) ? guidFor(ref) : guidFor({});
21
- }
22
-
23
- export default helper(uniqueId);
@@ -1 +0,0 @@
1
- export { default, uniqueId } from '@ember-eui/core/helpers/unique-id';