@shoper/phoenix_design_system 1.17.3-4 → 1.17.3-5

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.
@@ -3,15 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- require('lit');
7
6
  var decorators = require('lit/decorators');
8
7
  var utilities = require('@dreamcommerce/utilities');
9
8
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
10
9
  var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
11
10
  var keystrokes_controller = require('../../controllers/keystrokes_controller/keystrokes_controller.js');
12
- require('lit-html');
13
11
  var color_swatches_constants = require('./color_swatches_constants.js');
14
12
  var color_item_constants = require('./color_item/color_item_constants.js');
13
+ var color_item = require('./color_item/color_item.js');
15
14
 
16
15
  exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.PhoenixLightLitElement {
17
16
  constructor() {
@@ -139,7 +138,6 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
139
138
  this._$colorSwatchesChildren = [...this.children];
140
139
  this._setupEvents();
141
140
  this._addCssClasses();
142
- this._showAllItemsEvent();
143
141
  this.selectedColors = [...this.querySelectorAll('h-color-item[selected]')];
144
142
  this._$colors = [...this.querySelectorAll('h-color-item')];
145
143
  }
@@ -147,24 +145,6 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
147
145
  this.querySelectorAll(color_swatches_constants.COLOR_ITEM_TAG_NAME).forEach(($colorItem) => $colorItem.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
148
146
  this.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
149
147
  }
150
- _hideItems(numberOfVisibleColors) {
151
- if (!this._$colorSwatchesChildren)
152
- return;
153
- this._$colorSwatchesChildren.forEach(($colorSwatchesChild, index) => {
154
- if (index > numberOfVisibleColors - 1) {
155
- $colorSwatchesChild.setAttribute('hidden', '');
156
- }
157
- });
158
- }
159
- _showAllItemsEvent() {
160
- this.addEventListener(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.showMore, () => {
161
- if (!this._$colorSwatchesChildren)
162
- return;
163
- this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
164
- $colorSwatchesChild.removeAttribute('hidden');
165
- });
166
- });
167
- }
168
148
  _handleChangeToNextColorItem({ target }) {
169
149
  const $colorItem = target;
170
150
  const $nextFocusableElement = utilities.UiDomUtils.getNextFocusableElement($colorItem);
@@ -176,7 +156,9 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
176
156
  $nextColorItem = $nextFocusableElement;
177
157
  }
178
158
  $nextColorItem.focus();
179
- this._handleColorChange($nextColorItem);
159
+ if ($nextColorItem instanceof color_item.HColorItem) {
160
+ this._handleColorChange($nextColorItem);
161
+ }
180
162
  }
181
163
  _handleChangeToPreviousColorItem({ target }) {
182
164
  const $colorItem = target;
@@ -189,7 +171,9 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
189
171
  $previousColorItem = $previousFocusableElement;
190
172
  }
191
173
  $previousColorItem.focus();
192
- this._handleColorChange($previousColorItem);
174
+ if ($previousColorItem instanceof color_item.HColorItem) {
175
+ this._handleColorChange($previousColorItem);
176
+ }
193
177
  }
194
178
  _toggleColorItem($colorItem) {
195
179
  this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorChangeForSingleMode($colorItem);
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -83,6 +83,7 @@ var toggle_button = require('./components/groups/toggle_button_group/toggle_butt
83
83
  var click_outside_controller_messages = require('./controllers/click_outside_controller/click_outside_controller_messages.js');
84
84
  var backdrop = require('./components/backdrop/backdrop.js');
85
85
  var color_swatches_control_constants = require('./components/form/color_swatches_control/color_swatches_control_constants.js');
86
+ var show_more_button = require('./components/show-more/show_more_button.js');
86
87
  var color_swatches = require('./components/color_swatches/color_swatches.js');
87
88
  var color_item = require('./components/color_swatches/color_item/color_item.js');
88
89
  var color_swatches_control = require('./components/form/color_swatches_control/color_swatches_control.js');
@@ -125,7 +126,6 @@ var toggle = require('./components/toggle/toggle.js');
125
126
  var toggle_button$1 = require('./components/toggle/toggle_button.js');
126
127
  var navigator_share = require('./components/navigator/navigator_share/navigator_share.js');
127
128
  var navigator_controller = require('./components/navigator/navigator_controller/navigator_controller.js');
128
- var show_more_button = require('./components/show-more/show_more_button.js');
129
129
  var show_more = require('./components/show-more/show_more.js');
130
130
 
131
131
 
@@ -511,6 +511,12 @@ Object.defineProperty(exports, 'HBackdrop', {
511
511
  }
512
512
  });
513
513
  exports.COLOR_SWATCHES_CONTROL_EVENT_NAMES = color_swatches_control_constants.COLOR_SWATCHES_CONTROL_EVENT_NAMES;
514
+ Object.defineProperty(exports, 'HShowMoreButton', {
515
+ enumerable: true,
516
+ get: function () {
517
+ return show_more_button.HShowMoreButton;
518
+ }
519
+ });
514
520
  Object.defineProperty(exports, 'HColorSwatches', {
515
521
  enumerable: true,
516
522
  get: function () {
@@ -750,12 +756,6 @@ Object.defineProperty(exports, 'NavigatorController', {
750
756
  return navigator_controller.NavigatorController;
751
757
  }
752
758
  });
753
- Object.defineProperty(exports, 'HShowMoreButton', {
754
- enumerable: true,
755
- get: function () {
756
- return show_more_button.HShowMoreButton;
757
- }
758
- });
759
759
  Object.defineProperty(exports, 'HShowMore', {
760
760
  enumerable: true,
761
761
  get: function () {
@@ -9,8 +9,6 @@ export declare class HColorSwatches extends PhoenixLightLitElement {
9
9
  clearAllColors(): void;
10
10
  connectedCallback(): void;
11
11
  private _addCssClasses;
12
- private _hideItems;
13
- private _showAllItemsEvent;
14
12
  private _setupEvents;
15
13
  private _setupCheckboxGroupEvents;
16
14
  private _setupRadioGroupEvents;
@@ -1,13 +1,12 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import 'lit';
3
2
  import { property } from 'lit/decorators';
4
3
  import { UiDomUtils, ArrayUtils } from '@dreamcommerce/utilities';
5
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
6
5
  import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
7
6
  import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
8
- import 'lit-html';
9
7
  import { COLOR_SWATCHES_EVENT_NAMES, COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES } from './color_swatches_constants.js';
10
8
  import { COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item/color_item_constants.js';
9
+ import { HColorItem } from './color_item/color_item.js';
11
10
 
12
11
  let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
13
12
  constructor() {
@@ -135,7 +134,6 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
135
134
  this._$colorSwatchesChildren = [...this.children];
136
135
  this._setupEvents();
137
136
  this._addCssClasses();
138
- this._showAllItemsEvent();
139
137
  this.selectedColors = [...this.querySelectorAll('h-color-item[selected]')];
140
138
  this._$colors = [...this.querySelectorAll('h-color-item')];
141
139
  }
@@ -143,24 +141,6 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
143
141
  this.querySelectorAll(COLOR_ITEM_TAG_NAME).forEach(($colorItem) => $colorItem.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
144
142
  this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
145
143
  }
146
- _hideItems(numberOfVisibleColors) {
147
- if (!this._$colorSwatchesChildren)
148
- return;
149
- this._$colorSwatchesChildren.forEach(($colorSwatchesChild, index) => {
150
- if (index > numberOfVisibleColors - 1) {
151
- $colorSwatchesChild.setAttribute('hidden', '');
152
- }
153
- });
154
- }
155
- _showAllItemsEvent() {
156
- this.addEventListener(COLOR_SWATCHES_EVENT_NAMES.showMore, () => {
157
- if (!this._$colorSwatchesChildren)
158
- return;
159
- this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
160
- $colorSwatchesChild.removeAttribute('hidden');
161
- });
162
- });
163
- }
164
144
  _handleChangeToNextColorItem({ target }) {
165
145
  const $colorItem = target;
166
146
  const $nextFocusableElement = UiDomUtils.getNextFocusableElement($colorItem);
@@ -172,7 +152,9 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
172
152
  $nextColorItem = $nextFocusableElement;
173
153
  }
174
154
  $nextColorItem.focus();
175
- this._handleColorChange($nextColorItem);
155
+ if ($nextColorItem instanceof HColorItem) {
156
+ this._handleColorChange($nextColorItem);
157
+ }
176
158
  }
177
159
  _handleChangeToPreviousColorItem({ target }) {
178
160
  const $colorItem = target;
@@ -185,7 +167,9 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
185
167
  $previousColorItem = $previousFocusableElement;
186
168
  }
187
169
  $previousColorItem.focus();
188
- this._handleColorChange($previousColorItem);
170
+ if ($previousColorItem instanceof HColorItem) {
171
+ this._handleColorChange($previousColorItem);
172
+ }
189
173
  }
190
174
  _toggleColorItem($colorItem) {
191
175
  this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorChangeForSingleMode($colorItem);
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -79,6 +79,7 @@ export { HToggleButton } from './components/groups/toggle_button_group/toggle_bu
79
79
  export { CLICK_OUTSIDE_CONTROLLER_MESSAGES } from './controllers/click_outside_controller/click_outside_controller_messages.js';
80
80
  export { HBackdrop } from './components/backdrop/backdrop.js';
81
81
  export { COLOR_SWATCHES_CONTROL_EVENT_NAMES } from './components/form/color_swatches_control/color_swatches_control_constants.js';
82
+ export { HShowMoreButton } from './components/show-more/show_more_button.js';
82
83
  export { HColorSwatches } from './components/color_swatches/color_swatches.js';
83
84
  export { HColorItem } from './components/color_swatches/color_item/color_item.js';
84
85
  export { HColorSwatchesControl } from './components/form/color_swatches_control/color_swatches_control.js';
@@ -121,6 +122,5 @@ export { HToggle } from './components/toggle/toggle.js';
121
122
  export { HToggleBtn } from './components/toggle/toggle_button.js';
122
123
  export { NavigatorShare } from './components/navigator/navigator_share/navigator_share.js';
123
124
  export { NavigatorController } from './components/navigator/navigator_controller/navigator_controller.js';
124
- export { HShowMoreButton } from './components/show-more/show_more_button.js';
125
125
  export { HShowMore } from './components/show-more/show_more.js';
126
126
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.17.3-4",
5
+ "version": "1.17.3-5",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",