@shoper/phoenix_design_system 1.8.0 → 1.9.0-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.
Files changed (37) hide show
  1. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js +1 -1
  2. package/build/cjs/packages/phoenix/src/components/form/select/model/select_option_mapper.js +5 -5
  3. package/build/cjs/packages/phoenix/src/components/form/select/select.js +58 -30
  4. package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
  5. package/build/cjs/packages/phoenix/src/components/messages/base_message.js +1 -2
  6. package/build/cjs/packages/phoenix/src/components/messages/base_message.js.map +1 -1
  7. package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +2 -2
  8. package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js +0 -43
  9. package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js.map +1 -1
  10. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +2 -2
  11. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.d.ts +1 -1
  12. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.js +1 -1
  13. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.js.map +1 -1
  14. package/build/esm/packages/phoenix/src/components/form/select/model/select_option_mapper.js +5 -5
  15. package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +6 -0
  16. package/build/esm/packages/phoenix/src/components/form/select/select.js +57 -29
  17. package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
  18. package/build/esm/packages/phoenix/src/components/messages/base_message.d.ts +1 -1
  19. package/build/esm/packages/phoenix/src/components/messages/base_message.js +1 -2
  20. package/build/esm/packages/phoenix/src/components/messages/base_message.js.map +1 -1
  21. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.d.ts +2 -1
  22. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +2 -2
  23. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.d.ts +0 -55
  24. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js +1 -39
  25. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js.map +1 -1
  26. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.d.ts +2 -12
  27. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.js +1 -1
  28. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.js.map +1 -1
  29. package/package.json +2 -2
  30. package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js +0 -229
  31. package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js.map +0 -1
  32. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.d.ts +0 -24
  33. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js +0 -225
  34. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js.map +0 -1
  35. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.d.ts +0 -44
  36. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.js +0 -4
  37. package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.js.map +0 -1
@@ -23,7 +23,7 @@ exports.HDropdown = HDropdown_1 = class HDropdown extends phoenix_light_lit_elem
23
23
  constructor() {
24
24
  super();
25
25
  this.opened = false;
26
- this.direction = relative_position_controller_constants.DIRECTIONS.bottomCenter;
26
+ this.direction = utilities.DIRECTIONS.bottomCenter;
27
27
  this.toggleOnHover = false;
28
28
  this.name = '';
29
29
  this.transition = 'direction';
@@ -7,19 +7,19 @@ var select_option = require('./select_option.js');
7
7
 
8
8
  class SelectOptionMapper {
9
9
  static toModel($option) {
10
- var _a;
11
- const optionContent = (_a = $option.querySelector(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.optionContent)) === null || _a === void 0 ? void 0 : _a.textContent;
12
- const value = $option.getAttribute('value');
10
+ const $optionContent = $option.querySelector(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.optionContent);
11
+ const optionContentText = ($optionContent === null || $optionContent === void 0 ? void 0 : $optionContent.textContent) || ($optionContent === null || $optionContent === void 0 ? void 0 : $optionContent.innerText);
12
+ const value = $option.value;
13
13
  if (!value)
14
14
  throw new Error('h-option must contain a unique value');
15
- if (!optionContent)
15
+ if (!optionContentText)
16
16
  throw new Error('h-options must contains a h-option-content element inside');
17
17
  return select_option.SelectOption.create({
18
18
  value,
19
19
  disabled: $option.hasAttribute('disabled'),
20
20
  hidden: $option.hasAttribute('hidden'),
21
21
  inactive: $option.hasAttribute('inactive'),
22
- content: optionContent,
22
+ content: optionContentText,
23
23
  selected: $option.hasAttribute('selected')
24
24
  });
25
25
  }
@@ -11,7 +11,8 @@ var decorators_js = require('@lit/reactive-element/decorators.js');
11
11
  var select_components_constatns = require('./components/select_components_constatns.js');
12
12
  var observer = require('../../../core/classes/observer/observer.js');
13
13
  var icon = require('../../icon/icon.js');
14
- var select_option = require('./components/option/select_option.js');
14
+ var select_option$1 = require('./components/option/select_option.js');
15
+ var select_option = require('./model/select_option.js');
15
16
  var select_constants = require('./select_constants.js');
16
17
  var observable_directive = require('../../../directives/observable_directive.js');
17
18
  var select_toggler = require('./components/toggler/select_toggler.js');
@@ -27,6 +28,7 @@ var multi_select_controller = require('./controllers/multi_select_controller.js'
27
28
  var select_utils = require('./select_utils.js');
28
29
  var select_controller = require('./controllers/select_controller.js');
29
30
  var select_option_mapper = require('./model/select_option_mapper.js');
31
+ var repeat = require('lit/directives/repeat');
30
32
 
31
33
  exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLitElement {
32
34
  constructor() {
@@ -143,6 +145,9 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
143
145
  this.classList.remove(select_constants.SELECT_CSS_CLASSES.selectOpened);
144
146
  }
145
147
  }
148
+ if (changedProperties.has('optionsList')) {
149
+ this._updateOptions();
150
+ }
146
151
  if (this._$optionsList.value && !this._listBoxController)
147
152
  this._listBoxController = new list_box_keyboard_controller.ListBoxKeyboardController({
148
153
  host: this,
@@ -163,15 +168,25 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
163
168
  this._selectController = this.multiple ? new multi_select_controller.MultiSelectController({ host: this }) : new select_controller.SelectController({ host: this });
164
169
  this._selectContext.provide(select_constants.SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
165
170
  this._selectContext.provide(select_constants.SELECT_CONTEXTS.isMultiselect, this.multiple);
166
- const $options = this.hasSlot(select_constants.SELECT_SLOT_NAMES.content)
167
- ? this.getSlot(select_constants.SELECT_SLOT_NAMES.content)
168
- .map((litElement) => litElement.values[0])
169
- .filter((element) => element instanceof select_option.HOption)
170
- : Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
171
171
  this._optionsObserver = new observer.Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
172
172
  this._selectController.options$.subscribe(this._optionsObserver);
173
+ this._updateOptions();
174
+ this._setupEvents();
175
+ }
176
+ attributeChangedCallback(name, _old, value) {
177
+ super.attributeChangedCallback(name, _old, value);
178
+ switch (name) {
179
+ case 'error':
180
+ this.error ? this.classList.add(select_constants.SELECT_CSS_CLASSES.selectError) : this.classList.remove(select_constants.SELECT_CSS_CLASSES.selectError);
181
+ break;
182
+ case 'disabled':
183
+ this.disabled ? this.classList.add(select_constants.SELECT_CSS_CLASSES.selectDisabled) : this.classList.remove(select_constants.SELECT_CSS_CLASSES.selectDisabled);
184
+ }
185
+ }
186
+ _updateOptions() {
187
+ const $options = this._getOptions();
173
188
  this._$options = $options.reduce((acc, $option) => {
174
- const value = $option.getAttribute('value');
189
+ const value = $option.value;
175
190
  if (!value)
176
191
  throw Error('Select option must hava a value');
177
192
  if (acc[value] !== undefined)
@@ -185,17 +200,22 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
185
200
  this._selectController.options$.notify(options);
186
201
  if (options.length)
187
202
  this._selectController.selectedOptions$.notify(options.filter((option) => option.selected));
188
- this._setupEvents();
189
203
  }
190
- attributeChangedCallback(name, _old, value) {
191
- super.attributeChangedCallback(name, _old, value);
192
- switch (name) {
193
- case 'error':
194
- this.error ? this.classList.add(select_constants.SELECT_CSS_CLASSES.selectError) : this.classList.remove(select_constants.SELECT_CSS_CLASSES.selectError);
195
- break;
196
- case 'disabled':
197
- this.disabled ? this.classList.add(select_constants.SELECT_CSS_CLASSES.selectDisabled) : this.classList.remove(select_constants.SELECT_CSS_CLASSES.selectDisabled);
204
+ _getOptions() {
205
+ let $options;
206
+ if (this.optionsList) {
207
+ $options = this.optionsList.map(option => {
208
+ return select_utils.SelectControlUtils.createHTMLOption(select_option.SelectOption.create(option));
209
+ });
210
+ }
211
+ else {
212
+ $options = this.hasSlot(select_constants.SELECT_SLOT_NAMES.content)
213
+ ? this.getSlot(select_constants.SELECT_SLOT_NAMES.content)
214
+ .map((litElement) => litElement.values[0])
215
+ .filter((element) => element instanceof select_option$1.HOption)
216
+ : Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
198
217
  }
218
+ return $options;
199
219
  }
200
220
  _setupEvents() {
201
221
  this.addEventListener(select_constants.SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
@@ -292,20 +312,24 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
292
312
  @selectSearch.search=${this._handleSearch}
293
313
  ></h-select-search>`
294
314
  : lit.nothing}
295
- ${this.hasSlot(select_constants.SELECT_SLOT_NAMES.content)
296
- ? lit.html `
297
- <h-options
298
- class="${select_constants.SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
299
- ? select_constants.SELECT_CSS_CLASSES.selectOptionsEmpty
300
- : ''}"
301
- ${ref_js.ref(this._$optionsList)}
302
- @selectOptions.clicked=${this._handleOptionClicked}
303
- @selectOptions.updated=${this._handleOptionUpdated}
304
- >
305
- ${this.getSlot(select_constants.SELECT_SLOT_NAMES.content)}
306
- </h-options>
307
- `
308
- : lit.nothing}
315
+
316
+ <h-options
317
+ class="${select_constants.SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
318
+ ? select_constants.SELECT_CSS_CLASSES.selectOptionsEmpty
319
+ : ''}"
320
+ ${ref_js.ref(this._$optionsList)}
321
+ @selectOptions.clicked=${this._handleOptionClicked}
322
+ @selectOptions.updated=${this._handleOptionUpdated}
323
+ >
324
+ ${this.getSlot(select_constants.SELECT_SLOT_NAMES.content)}
325
+
326
+ ${this.optionsList ? repeat.repeat(this.optionsList, (option) => option.value, (option) => {
327
+ return lit.html ` <h-option value=${option.value}>
328
+ <h-option-content>${option.content}</h-option-content>
329
+ </h-option>`;
330
+ }) : lit.nothing}
331
+ </h-options>
332
+
309
333
  ${this._searchNoResult()
310
334
  ? lit.html ` <div>
311
335
  <p class=${select_constants.SELECT_CSS_CLASSES.selectNoResult}>
@@ -379,6 +403,10 @@ tslib_es6.__decorate([
379
403
  decorators_js.property({ type: Boolean }),
380
404
  tslib_es6.__metadata("design:type", Boolean)
381
405
  ], exports.HSelect.prototype, "required", void 0);
406
+ tslib_es6.__decorate([
407
+ decorators_js.property({ type: Array }),
408
+ tslib_es6.__metadata("design:type", Array)
409
+ ], exports.HSelect.prototype, "optionsList", void 0);
382
410
  tslib_es6.__decorate([
383
411
  decorators.state(),
384
412
  tslib_es6.__metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -7,7 +7,6 @@ var decorators = require('lit/decorators');
7
7
  var utilities = require('@dreamcommerce/utilities');
8
8
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
9
9
  var keystrokes_controller = require('../../controllers/keystrokes_controller/keystrokes_controller.js');
10
- var relative_position_controller_constants = require('../../controllers/relative_position_controller/relative_position_controller_constants.js');
11
10
  var portal_constants = require('../portal/portal_constants.js');
12
11
  var click_outside_controller = require('../../controllers/click_outside_controller/click_outside_controller.js');
13
12
  var relative_position_controller = require('../../controllers/relative_position_controller/relative_position_controller.js');
@@ -18,7 +17,7 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
18
17
  super();
19
18
  this.opened = false;
20
19
  this.portalTarget = base_message_constants.DEFAULT_MESSAGE_PORTAL_NAME;
21
- this.direction = relative_position_controller_constants.DIRECTIONS.topCenter;
20
+ this.direction = utilities.DIRECTIONS.topCenter;
22
21
  this.offset = base_message_constants.DEFAULT_MESSAGE_OFFSET;
23
22
  this._setupEventListeners = () => {
24
23
  this.addEventListener('mouseenter', this.open);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  require('lit');
7
+ var utilities = require('@dreamcommerce/utilities');
7
8
  var global_constants = require('../../global_constants.js');
8
9
  var relative_position_controller_constants = require('./relative_position_controller_constants.js');
9
- var relative_position_calculator = require('./relative_position_calculator.js');
10
10
  var throttle = require('../../../../../external/lodash/throttle.js');
11
11
 
12
12
  var _RelativePositionController_host, _RelativePositionController_container, _RelativePositionController_direction, _RelativePositionController_nearestScrollableElement, _RelativePositionController_relativeElement, _RelativePositionController_elementToPosition, _RelativePositionController_disablePositioningOnCondition, _RelativePositionController_portalElementsNames, _RelativePositionController_isInitiallyScrollable, _RelativePositionController_initialMaxHeight, _RelativePositionController_initialHeight, _RelativePositionController_calculatedDirection, _RelativePositionController_hasPositioningBeenDisabled, _RelativePositionController_doesCurrentlyHaveShrinkMode, _RelativePositionController_offset, _RelativePositionController_mobileElementPosition, _RelativePositionController_throttledReposition, _RelativePositionController_throttledRepositionForScroll;
@@ -75,7 +75,7 @@ class RelativePositionController {
75
75
  const positionElementRect = tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_initialHeight, "f")
76
76
  ? { ...tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_elementToPosition, "f").getBoundingClientRect().toJSON(), height: tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_initialHeight, "f") }
77
77
  : tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_elementToPosition, "f").getBoundingClientRect();
78
- const position = new relative_position_calculator.PositionCalculator({
78
+ const position = new utilities.RelativePositionCalculator({
79
79
  direction: shouldNotReposition && tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_calculatedDirection, "f") ? tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_calculatedDirection, "f") : tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_direction, "f"),
80
80
  relativeElementRect: tslib_es6.__classPrivateFieldGet(this, _RelativePositionController_relativeElement, "f").getBoundingClientRect(),
81
81
  positionElementRect,
@@ -2,44 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const VERTICAL_DIRECTIONS = {
6
- bottomLeft: 'bottom-left',
7
- bottomRight: 'bottom-right',
8
- bottomCenter: 'bottom-center',
9
- topLeft: 'top-left',
10
- topRight: 'top-right',
11
- topCenter: 'top-center'
12
- };
13
- const HORIZONTAL_DIRECTIONS = {
14
- rightTop: 'right-top',
15
- rightCenter: 'right-center',
16
- rightBottom: 'right-bottom',
17
- leftTop: 'left-top',
18
- leftCenter: 'left-center',
19
- leftBottom: 'left-bottom'
20
- };
21
- const CENTER_DIRECTIONS = {
22
- centerTop: 'center-top',
23
- centerRight: 'center-right',
24
- centerBottom: 'center-bottom',
25
- centerLeft: 'center-left',
26
- top: 'top',
27
- right: 'right',
28
- bottom: 'bottom',
29
- left: 'left'
30
- };
31
- const DIRECTIONS = {
32
- ...HORIZONTAL_DIRECTIONS,
33
- ...VERTICAL_DIRECTIONS,
34
- ...CENTER_DIRECTIONS
35
- };
36
- const CALCULATOR_DIRECTIONS = {
37
- bottom: 'bottom',
38
- top: 'top',
39
- left: 'left',
40
- right: 'right',
41
- center: 'center'
42
- };
43
5
  const NON_STATIC_POSITIONS = ['relative', 'absolute', 'fixed', 'sticky'];
44
6
  const OVERFLOW_SCROLL = 'scroll';
45
7
  const OVERFLOW_AUTO = 'auto';
@@ -57,12 +19,8 @@ const MOBILE_ELEMENT_POSITIONS = {
57
19
  right: 'right'
58
20
  };
59
21
 
60
- exports.CALCULATOR_DIRECTIONS = CALCULATOR_DIRECTIONS;
61
- exports.CENTER_DIRECTIONS = CENTER_DIRECTIONS;
62
22
  exports.DEFAULT_SCROLL_THROTTLE_WAIT_TIME = DEFAULT_SCROLL_THROTTLE_WAIT_TIME;
63
23
  exports.DEFAULT_THROTTLE_WAIT_TIME = DEFAULT_THROTTLE_WAIT_TIME;
64
- exports.DIRECTIONS = DIRECTIONS;
65
- exports.HORIZONTAL_DIRECTIONS = HORIZONTAL_DIRECTIONS;
66
24
  exports.MOBILE_ELEMENT_POSITIONS = MOBILE_ELEMENT_POSITIONS;
67
25
  exports.NON_STATIC_POSITIONS = NON_STATIC_POSITIONS;
68
26
  exports.OVERFLOW_AUTO = OVERFLOW_AUTO;
@@ -70,5 +28,4 @@ exports.OVERFLOW_SCROLL = OVERFLOW_SCROLL;
70
28
  exports.RELATIVE_POSITION_CONTROLLER_EVENTS = RELATIVE_POSITION_CONTROLLER_EVENTS;
71
29
  exports.SHRINK_MODE_BOTTOM_MARGIN = SHRINK_MODE_BOTTOM_MARGIN;
72
30
  exports.SHRINK_MODE_MIN_HEIGHT = SHRINK_MODE_MIN_HEIGHT;
73
- exports.VERTICAL_DIRECTIONS = VERTICAL_DIRECTIONS;
74
31
  //# sourceMappingURL=relative_position_controller_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { UiDomUtils } from '@dreamcommerce/utilities';
2
+ import { DIRECTIONS, UiDomUtils } from '@dreamcommerce/utilities';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
4
4
  import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
5
  import { property } from '@lit/reactive-element/decorators.js';
@@ -7,7 +7,7 @@ import { KeystrokesController } from '../../controllers/keystrokes_controller/ke
7
7
  import { html } from 'lit-html';
8
8
  import { BREAKPOINTS, SCROLLABLE_CLASS_NAME } from '../../global_constants.js';
9
9
  import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_CSS_CLASSES, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_NAME, DROPDOWN_CONTENT_WIDTH, DROPDOWN_TOGGLER_NAME } from './dropdown_constants.js';
10
- import { DIRECTIONS, RELATIVE_POSITION_CONTROLLER_EVENTS, DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
10
+ import { RELATIVE_POSITION_CONTROLLER_EVENTS, DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
11
11
  import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
12
12
  import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
13
13
  import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
@@ -1,6 +1,6 @@
1
1
  import { Any } from 'ts-toolbelt';
2
2
  import { DROPDOWN_CONTENT_WIDTH } from "./dropdown_constants";
3
- import { VERTICAL_DIRECTIONS } from "../../controllers/relative_position_controller/relative_position_controller_constants";
3
+ import { VERTICAL_DIRECTIONS } from '@dreamcommerce/utilities';
4
4
  export declare type TDropdownSelectors = {
5
5
  getDropdownPortalTargetName(): string;
6
6
  getDropdownContainerName(): string;
@@ -1,4 +1,4 @@
1
1
  import 'ts-toolbelt';
2
2
  import '@phoenixRoot/components/dropdown/dropdown_constants';
3
- import '@phoenixRoot/controllers/relative_position_controller/relative_position_controller_constants';
3
+ import '@dreamcommerce/utilities';
4
4
  //# sourceMappingURL=dropdown_types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown_types.js","sourceRoot":"","sources":["../../../../../../../src/components/dropdown/dropdown_types.ts"],"names":[],"mappings":"AAAA,OAAoB,aAAa,CAAC;AAClC,OAAuC,qDAAqD,CAAC;AAC7F,OAAoC,8FAA8F,CAAC"}
1
+ {"version":3,"file":"dropdown_types.js","sourceRoot":"","sources":["../../../../../../../src/components/dropdown/dropdown_types.ts"],"names":[],"mappings":"AAAA,OAAoB,aAAa,CAAC;AAClC,OAAuC,qDAAqD,CAAC;AAC7F,OAAoC,0BAA0B,CAAC"}
@@ -3,19 +3,19 @@ import { SelectOption } from './select_option.js';
3
3
 
4
4
  class SelectOptionMapper {
5
5
  static toModel($option) {
6
- var _a;
7
- const optionContent = (_a = $option.querySelector(SELECT_RELATED_COMPONENTS_NAMES.optionContent)) === null || _a === void 0 ? void 0 : _a.textContent;
8
- const value = $option.getAttribute('value');
6
+ const $optionContent = $option.querySelector(SELECT_RELATED_COMPONENTS_NAMES.optionContent);
7
+ const optionContentText = ($optionContent === null || $optionContent === void 0 ? void 0 : $optionContent.textContent) || ($optionContent === null || $optionContent === void 0 ? void 0 : $optionContent.innerText);
8
+ const value = $option.value;
9
9
  if (!value)
10
10
  throw new Error('h-option must contain a unique value');
11
- if (!optionContent)
11
+ if (!optionContentText)
12
12
  throw new Error('h-options must contains a h-option-content element inside');
13
13
  return SelectOption.create({
14
14
  value,
15
15
  disabled: $option.hasAttribute('disabled'),
16
16
  hidden: $option.hasAttribute('hidden'),
17
17
  inactive: $option.hasAttribute('inactive'),
18
- content: optionContent,
18
+ content: optionContentText,
19
19
  selected: $option.hasAttribute('selected')
20
20
  });
21
21
  }
@@ -15,6 +15,10 @@ export declare class HSelect extends PhoenixLightLitElement {
15
15
  searchDisabled: boolean;
16
16
  type: TSelectType;
17
17
  required: boolean;
18
+ optionsList?: {
19
+ value: string;
20
+ content: string;
21
+ }[];
18
22
  get selectedIndex(): number;
19
23
  set selectedIndex(index: number);
20
24
  get selectedOptions(): HOption[];
@@ -37,6 +41,8 @@ export declare class HSelect extends PhoenixLightLitElement {
37
41
  private _focusElementAfterSelectOpened;
38
42
  connectedCallback(): void;
39
43
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
44
+ private _updateOptions;
45
+ private _getOptions;
40
46
  private _setupEvents;
41
47
  private _handleOptionDeselect;
42
48
  private _updateOptionsView;
@@ -8,6 +8,7 @@ import { SELECT_RELATED_COMPONENTS_NAMES, SELECT_INPUT_PLACEHOLDER_SLOT_NAME, SE
8
8
  import { Observer } from '../../../core/classes/observer/observer.js';
9
9
  import { HIcon } from '../../icon/icon.js';
10
10
  import { HOption } from './components/option/select_option.js';
11
+ import { SelectOption } from './model/select_option.js';
11
12
  import { SELECT_TYPES, SELECT_SLOT_NAMES, SELECT_CSS_CLASSES, SELECT_CONTEXTS, SELECT_EVENT_NAMES, MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH } from './select_constants.js';
12
13
  import { observe } from '../../../directives/observable_directive.js';
13
14
  import { HSelectToggler } from './components/toggler/select_toggler.js';
@@ -23,6 +24,7 @@ import { MultiSelectController } from './controllers/multi_select_controller.js'
23
24
  import { SelectControlUtils } from './select_utils.js';
24
25
  import { SelectController } from './controllers/select_controller.js';
25
26
  import { SelectOptionMapper } from './model/select_option_mapper.js';
27
+ import { repeat } from 'lit/directives/repeat';
26
28
 
27
29
  let HSelect = class HSelect extends PhoenixLightLitElement {
28
30
  constructor() {
@@ -139,6 +141,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
139
141
  this.classList.remove(SELECT_CSS_CLASSES.selectOpened);
140
142
  }
141
143
  }
144
+ if (changedProperties.has('optionsList')) {
145
+ this._updateOptions();
146
+ }
142
147
  if (this._$optionsList.value && !this._listBoxController)
143
148
  this._listBoxController = new ListBoxKeyboardController({
144
149
  host: this,
@@ -159,15 +164,25 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
159
164
  this._selectController = this.multiple ? new MultiSelectController({ host: this }) : new SelectController({ host: this });
160
165
  this._selectContext.provide(SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
161
166
  this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.multiple);
162
- const $options = this.hasSlot(SELECT_SLOT_NAMES.content)
163
- ? this.getSlot(SELECT_SLOT_NAMES.content)
164
- .map((litElement) => litElement.values[0])
165
- .filter((element) => element instanceof HOption)
166
- : Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
167
167
  this._optionsObserver = new Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
168
168
  this._selectController.options$.subscribe(this._optionsObserver);
169
+ this._updateOptions();
170
+ this._setupEvents();
171
+ }
172
+ attributeChangedCallback(name, _old, value) {
173
+ super.attributeChangedCallback(name, _old, value);
174
+ switch (name) {
175
+ case 'error':
176
+ this.error ? this.classList.add(SELECT_CSS_CLASSES.selectError) : this.classList.remove(SELECT_CSS_CLASSES.selectError);
177
+ break;
178
+ case 'disabled':
179
+ this.disabled ? this.classList.add(SELECT_CSS_CLASSES.selectDisabled) : this.classList.remove(SELECT_CSS_CLASSES.selectDisabled);
180
+ }
181
+ }
182
+ _updateOptions() {
183
+ const $options = this._getOptions();
169
184
  this._$options = $options.reduce((acc, $option) => {
170
- const value = $option.getAttribute('value');
185
+ const value = $option.value;
171
186
  if (!value)
172
187
  throw Error('Select option must hava a value');
173
188
  if (acc[value] !== undefined)
@@ -181,17 +196,22 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
181
196
  this._selectController.options$.notify(options);
182
197
  if (options.length)
183
198
  this._selectController.selectedOptions$.notify(options.filter((option) => option.selected));
184
- this._setupEvents();
185
199
  }
186
- attributeChangedCallback(name, _old, value) {
187
- super.attributeChangedCallback(name, _old, value);
188
- switch (name) {
189
- case 'error':
190
- this.error ? this.classList.add(SELECT_CSS_CLASSES.selectError) : this.classList.remove(SELECT_CSS_CLASSES.selectError);
191
- break;
192
- case 'disabled':
193
- this.disabled ? this.classList.add(SELECT_CSS_CLASSES.selectDisabled) : this.classList.remove(SELECT_CSS_CLASSES.selectDisabled);
200
+ _getOptions() {
201
+ let $options;
202
+ if (this.optionsList) {
203
+ $options = this.optionsList.map(option => {
204
+ return SelectControlUtils.createHTMLOption(SelectOption.create(option));
205
+ });
206
+ }
207
+ else {
208
+ $options = this.hasSlot(SELECT_SLOT_NAMES.content)
209
+ ? this.getSlot(SELECT_SLOT_NAMES.content)
210
+ .map((litElement) => litElement.values[0])
211
+ .filter((element) => element instanceof HOption)
212
+ : Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
194
213
  }
214
+ return $options;
195
215
  }
196
216
  _setupEvents() {
197
217
  this.addEventListener(SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
@@ -288,20 +308,24 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
288
308
  @selectSearch.search=${this._handleSearch}
289
309
  ></h-select-search>`
290
310
  : nothing}
291
- ${this.hasSlot(SELECT_SLOT_NAMES.content)
292
- ? html `
293
- <h-options
294
- class="${SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
295
- ? SELECT_CSS_CLASSES.selectOptionsEmpty
296
- : ''}"
297
- ${ref(this._$optionsList)}
298
- @selectOptions.clicked=${this._handleOptionClicked}
299
- @selectOptions.updated=${this._handleOptionUpdated}
300
- >
301
- ${this.getSlot(SELECT_SLOT_NAMES.content)}
302
- </h-options>
303
- `
304
- : nothing}
311
+
312
+ <h-options
313
+ class="${SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
314
+ ? SELECT_CSS_CLASSES.selectOptionsEmpty
315
+ : ''}"
316
+ ${ref(this._$optionsList)}
317
+ @selectOptions.clicked=${this._handleOptionClicked}
318
+ @selectOptions.updated=${this._handleOptionUpdated}
319
+ >
320
+ ${this.getSlot(SELECT_SLOT_NAMES.content)}
321
+
322
+ ${this.optionsList ? repeat(this.optionsList, (option) => option.value, (option) => {
323
+ return html ` <h-option value=${option.value}>
324
+ <h-option-content>${option.content}</h-option-content>
325
+ </h-option>`;
326
+ }) : nothing}
327
+ </h-options>
328
+
305
329
  ${this._searchNoResult()
306
330
  ? html ` <div>
307
331
  <p class=${SELECT_CSS_CLASSES.selectNoResult}>
@@ -375,6 +399,10 @@ __decorate([
375
399
  property({ type: Boolean }),
376
400
  __metadata("design:type", Boolean)
377
401
  ], HSelect.prototype, "required", void 0);
402
+ __decorate([
403
+ property({ type: Array }),
404
+ __metadata("design:type", Array)
405
+ ], HSelect.prototype, "optionsList", void 0);
378
406
  __decorate([
379
407
  state(),
380
408
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,6 +1,6 @@
1
1
  import { IBaseMessage } from './base_message_types';
2
2
  import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
3
- import type { TDirection } from "../../controllers/relative_position_controller/relative_position_controller_types";
3
+ import type { TDirection } from '@dreamcommerce/utilities';
4
4
  export declare class BaseMessage extends PhoenixLightLitElement implements IBaseMessage {
5
5
  opened: boolean;
6
6
  portalTarget: string;
@@ -1,9 +1,8 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import { property } from 'lit/decorators';
3
- import { UiDomUtils } from '@dreamcommerce/utilities';
3
+ import { DIRECTIONS, UiDomUtils } from '@dreamcommerce/utilities';
4
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
5
5
  import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
6
- import { DIRECTIONS } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
7
6
  import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP, PORTAL_TARGET_ATTRIBUTE_NAME } from '../portal/portal_constants.js';
8
7
  import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
9
8
  import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,4 +1,5 @@
1
- import { IRelativePositionController, TDirection, TRelativePositionControllerConstructorOptions } from "./relative_position_controller_types";
1
+ import { IRelativePositionController, TRelativePositionControllerConstructorOptions } from "./relative_position_controller_types";
2
+ import { TDirection } from '@dreamcommerce/utilities';
2
3
  export declare class RelativePositionController implements IRelativePositionController {
3
4
  #private;
4
5
  constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition, portalElementsNames, offset, mobileElementPosition }: TRelativePositionControllerConstructorOptions);
@@ -1,8 +1,8 @@
1
1
  import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import 'lit';
3
+ import { RelativePositionCalculator } from '@dreamcommerce/utilities';
3
4
  import { SCROLLABLE_CLASS_NAME } from '../../global_constants.js';
4
5
  import { MOBILE_ELEMENT_POSITIONS, RELATIVE_POSITION_CONTROLLER_EVENTS, OVERFLOW_SCROLL, OVERFLOW_AUTO, NON_STATIC_POSITIONS, SHRINK_MODE_BOTTOM_MARGIN, SHRINK_MODE_MIN_HEIGHT, DEFAULT_THROTTLE_WAIT_TIME, DEFAULT_SCROLL_THROTTLE_WAIT_TIME } from './relative_position_controller_constants.js';
5
- import { PositionCalculator } from './relative_position_calculator.js';
6
6
  import throttle_1 from '../../../../../external/lodash/throttle.js';
7
7
 
8
8
  var _RelativePositionController_host, _RelativePositionController_container, _RelativePositionController_direction, _RelativePositionController_nearestScrollableElement, _RelativePositionController_relativeElement, _RelativePositionController_elementToPosition, _RelativePositionController_disablePositioningOnCondition, _RelativePositionController_portalElementsNames, _RelativePositionController_isInitiallyScrollable, _RelativePositionController_initialMaxHeight, _RelativePositionController_initialHeight, _RelativePositionController_calculatedDirection, _RelativePositionController_hasPositioningBeenDisabled, _RelativePositionController_doesCurrentlyHaveShrinkMode, _RelativePositionController_offset, _RelativePositionController_mobileElementPosition, _RelativePositionController_throttledReposition, _RelativePositionController_throttledRepositionForScroll;
@@ -71,7 +71,7 @@ class RelativePositionController {
71
71
  const positionElementRect = __classPrivateFieldGet(this, _RelativePositionController_initialHeight, "f")
72
72
  ? { ...__classPrivateFieldGet(this, _RelativePositionController_elementToPosition, "f").getBoundingClientRect().toJSON(), height: __classPrivateFieldGet(this, _RelativePositionController_initialHeight, "f") }
73
73
  : __classPrivateFieldGet(this, _RelativePositionController_elementToPosition, "f").getBoundingClientRect();
74
- const position = new PositionCalculator({
74
+ const position = new RelativePositionCalculator({
75
75
  direction: shouldNotReposition && __classPrivateFieldGet(this, _RelativePositionController_calculatedDirection, "f") ? __classPrivateFieldGet(this, _RelativePositionController_calculatedDirection, "f") : __classPrivateFieldGet(this, _RelativePositionController_direction, "f"),
76
76
  relativeElementRect: __classPrivateFieldGet(this, _RelativePositionController_relativeElement, "f").getBoundingClientRect(),
77
77
  positionElementRect,