@shoper/phoenix_design_system 0.23.0-1 → 0.24.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.
- package/build/cjs/{external → packages/phoenix/external}/classnames/index.js +16 -10
- package/build/{esm → cjs/packages/phoenix}/external/classnames/index.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js +70 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +12 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +115 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +22 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js +38 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +12 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js +73 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js +13 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/tabs/tabs.js +0 -1
- package/build/cjs/packages/phoenix/src/components/tabs/tabs.js.map +1 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +4 -11
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +28 -0
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/{external → packages/phoenix/external}/classnames/index.js +16 -10
- package/build/{cjs → esm/packages/phoenix}/external/classnames/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.d.ts +14 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +68 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +21 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +113 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.d.ts +11 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +15 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.d.ts +9 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js +36 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.d.ts +14 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js +71 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js +9 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/groups/toggle_button_group/toggle_button.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.js +0 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.js.map +1 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.d.ts +1 -4
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +4 -11
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +4 -0
- package/build/esm/packages/phoenix/src/index.js +4 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _commonjsHelpers = require('
|
|
5
|
+
var _commonjsHelpers = require('../../../../_virtual/_commonjsHelpers.js');
|
|
6
6
|
|
|
7
7
|
/*!
|
|
8
|
-
Copyright (c)
|
|
8
|
+
Copyright (c) 2018 Jed Watson.
|
|
9
9
|
Licensed under the MIT License (MIT), see
|
|
10
10
|
http://jedwatson.github.io/classnames
|
|
11
11
|
*/
|
|
@@ -17,7 +17,7 @@ var classnames = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
17
17
|
|
|
18
18
|
var hasOwn = {}.hasOwnProperty;
|
|
19
19
|
|
|
20
|
-
function classNames
|
|
20
|
+
function classNames() {
|
|
21
21
|
var classes = [];
|
|
22
22
|
|
|
23
23
|
for (var i = 0; i < arguments.length; i++) {
|
|
@@ -28,16 +28,22 @@ var classnames = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
28
28
|
|
|
29
29
|
if (argType === 'string' || argType === 'number') {
|
|
30
30
|
classes.push(arg);
|
|
31
|
-
} else if (Array.isArray(arg)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
} else if (Array.isArray(arg)) {
|
|
32
|
+
if (arg.length) {
|
|
33
|
+
var inner = classNames.apply(null, arg);
|
|
34
|
+
if (inner) {
|
|
35
|
+
classes.push(inner);
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
} else if (argType === 'object') {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
if (arg.toString === Object.prototype.toString) {
|
|
40
|
+
for (var key in arg) {
|
|
41
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
42
|
+
classes.push(key);
|
|
43
|
+
}
|
|
40
44
|
}
|
|
45
|
+
} else {
|
|
46
|
+
classes.push(arg.toString());
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
}
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var decorators = require('lit/decorators');
|
|
7
|
+
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
|
+
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
9
|
+
var btn_controller = require('../../../controllers/btn_controller.js');
|
|
10
|
+
var color_swatches_constants = require('../color_swatches_constants.js');
|
|
11
|
+
var color_item_constants = require('./color_item_constants.js');
|
|
12
|
+
|
|
13
|
+
exports.HColorItem = class HColorItem extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
this.selected = false;
|
|
18
|
+
this._dispatchClickedEvent = () => {
|
|
19
|
+
this.dispatchEvent(new Event(color_item_constants.COLOR_ITEM_EVENT_NAMES.selected, {
|
|
20
|
+
bubbles: true
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
this._btnController = new btn_controller.BtnController(this, this._dispatchClickedEvent);
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback();
|
|
27
|
+
this.setupEvents();
|
|
28
|
+
this.style.backgroundColor = this.color;
|
|
29
|
+
this._syncAriaPressed();
|
|
30
|
+
this.setAttribute('aria-label', this.label ? this.label : this.color);
|
|
31
|
+
this.disabled && this.removeAttribute('tabindex');
|
|
32
|
+
this.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorItem);
|
|
33
|
+
}
|
|
34
|
+
attributeChangedCallback(name, value, newValue) {
|
|
35
|
+
super.attributeChangedCallback(name, value, newValue);
|
|
36
|
+
switch (name) {
|
|
37
|
+
case color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE: {
|
|
38
|
+
this._syncAriaPressed();
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_syncAriaPressed() {
|
|
44
|
+
this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
|
|
45
|
+
}
|
|
46
|
+
setupEvents() {
|
|
47
|
+
!this.disabled && this.addEventListener('click', this._dispatchClickedEvent);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
tslib_es6.__decorate([
|
|
51
|
+
decorators.property({ type: String }),
|
|
52
|
+
tslib_es6.__metadata("design:type", String)
|
|
53
|
+
], exports.HColorItem.prototype, "color", void 0);
|
|
54
|
+
tslib_es6.__decorate([
|
|
55
|
+
decorators.property({ type: String }),
|
|
56
|
+
tslib_es6.__metadata("design:type", String)
|
|
57
|
+
], exports.HColorItem.prototype, "label", void 0);
|
|
58
|
+
tslib_es6.__decorate([
|
|
59
|
+
decorators.property({ type: Boolean, attribute: true }),
|
|
60
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
61
|
+
], exports.HColorItem.prototype, "disabled", void 0);
|
|
62
|
+
tslib_es6.__decorate([
|
|
63
|
+
decorators.property({ type: Boolean, attribute: true }),
|
|
64
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
65
|
+
], exports.HColorItem.prototype, "selected", void 0);
|
|
66
|
+
exports.HColorItem = tslib_es6.__decorate([
|
|
67
|
+
phoenix_custom_element.phoenixCustomElement('h-color-item'),
|
|
68
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
69
|
+
], exports.HColorItem);
|
|
70
|
+
//# sourceMappingURL=color_item.js.map
|
|
@@ -0,0 +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;"}
|
package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const COLOR_ITEM_EVENT_NAMES = {
|
|
6
|
+
selected: 'colorItemSelected'
|
|
7
|
+
};
|
|
8
|
+
const COLOR_ITEM_SELECTED_ATTRIBUTE = 'selected';
|
|
9
|
+
|
|
10
|
+
exports.COLOR_ITEM_EVENT_NAMES = COLOR_ITEM_EVENT_NAMES;
|
|
11
|
+
exports.COLOR_ITEM_SELECTED_ATTRIBUTE = COLOR_ITEM_SELECTED_ATTRIBUTE;
|
|
12
|
+
//# sourceMappingURL=color_item_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var decorators = require('lit/decorators');
|
|
7
|
+
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
|
+
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
9
|
+
var color_swatches_constants = require('./color_swatches_constants.js');
|
|
10
|
+
var color_item_constants = require('./color_item/color_item_constants.js');
|
|
11
|
+
var show_more_constants = require('./show-more/show_more_constants.js');
|
|
12
|
+
|
|
13
|
+
exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.multiple = false;
|
|
17
|
+
this.selectedColors = [];
|
|
18
|
+
this._handleColorClicked = ({ target }) => {
|
|
19
|
+
const $colorItem = target;
|
|
20
|
+
this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorClickedForSingleMode($colorItem);
|
|
21
|
+
};
|
|
22
|
+
this._dispatchColorSelectEvent = () => {
|
|
23
|
+
const detail = {
|
|
24
|
+
colors: this._setColorsDispatchValue(this.selectedColors)
|
|
25
|
+
};
|
|
26
|
+
this.dispatchEvent(new CustomEvent(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.selected, {
|
|
27
|
+
bubbles: true,
|
|
28
|
+
detail
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
this._setupEvents();
|
|
35
|
+
this._addCssClasses();
|
|
36
|
+
this.numberOfVisibleColors && this._hideItems(this.numberOfVisibleColors);
|
|
37
|
+
this._showAllItemsEvent();
|
|
38
|
+
}
|
|
39
|
+
_addCssClasses() {
|
|
40
|
+
this.querySelectorAll(color_swatches_constants.COLOR_ITEM_TAG_NAME).forEach(($colorItem) => $colorItem.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
|
|
41
|
+
this.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
|
|
42
|
+
}
|
|
43
|
+
_hideItems(numberOfVisibleColors) {
|
|
44
|
+
this.querySelectorAll(color_swatches_constants.COLOR_ITEM_TAG_NAME).forEach(($colorItem, index) => {
|
|
45
|
+
if (index > numberOfVisibleColors - 1) {
|
|
46
|
+
$colorItem.setAttribute(color_swatches_constants.COLOR_SWATCHES_HIDDEN_ATTRIBUTE, '');
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
_showAllItemsEvent() {
|
|
51
|
+
this.addEventListener(show_more_constants.SHOW_MORE_EVENT_NAMES.showMore, () => {
|
|
52
|
+
var _a;
|
|
53
|
+
this.querySelectorAll(color_swatches_constants.COLOR_ITEM_TAG_NAME).forEach(($colorItem) => {
|
|
54
|
+
$colorItem.removeAttribute(color_swatches_constants.COLOR_SWATCHES_HIDDEN_ATTRIBUTE);
|
|
55
|
+
});
|
|
56
|
+
(_a = this.querySelector('h-color-swatches-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute(color_swatches_constants.COLOR_SWATCHES_HIDDEN_ATTRIBUTE, '');
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
_setupEvents() {
|
|
60
|
+
this.addEventListener(color_item_constants.COLOR_ITEM_EVENT_NAMES.selected, this._handleColorClicked);
|
|
61
|
+
}
|
|
62
|
+
_handleColorClickedForMultipleMode($colorItem) {
|
|
63
|
+
!this._isColorAlreadyExistInArray($colorItem)
|
|
64
|
+
? (this.selectedColors = [...this.selectedColors, $colorItem])
|
|
65
|
+
: this._removeExistingColorFromArray($colorItem);
|
|
66
|
+
this._toggleSelectedAttribute($colorItem);
|
|
67
|
+
this._dispatchColorSelectEvent();
|
|
68
|
+
}
|
|
69
|
+
_handleColorClickedForSingleMode($colorItem) {
|
|
70
|
+
const $previouslySelected = this.selectedColors[0];
|
|
71
|
+
this._toggleSelectedAttribute($colorItem);
|
|
72
|
+
if ($previouslySelected && $previouslySelected !== $colorItem)
|
|
73
|
+
$previouslySelected.removeAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE);
|
|
74
|
+
this.selectedColors = $previouslySelected === $colorItem ? [] : [$colorItem];
|
|
75
|
+
this._dispatchColorSelectEvent();
|
|
76
|
+
}
|
|
77
|
+
_toggleSelectedAttribute($colorItem) {
|
|
78
|
+
$colorItem.hasAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
|
|
79
|
+
? $colorItem.removeAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
|
|
80
|
+
: $colorItem.setAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE, '');
|
|
81
|
+
}
|
|
82
|
+
_isColorAlreadyExistInArray($colorItem) {
|
|
83
|
+
return this.selectedColors.includes($colorItem);
|
|
84
|
+
}
|
|
85
|
+
_removeExistingColorFromArray($colorItem) {
|
|
86
|
+
const indexOfAlreadyExistingColor = this.selectedColors.indexOf($colorItem);
|
|
87
|
+
this.selectedColors.splice(indexOfAlreadyExistingColor, 1);
|
|
88
|
+
}
|
|
89
|
+
_setColorsDispatchValue(selectedColors) {
|
|
90
|
+
if (this.selectedColors.length > 1)
|
|
91
|
+
return this._getOnlyColorValues(selectedColors);
|
|
92
|
+
if (this.selectedColors.length === 1)
|
|
93
|
+
return selectedColors[0].color;
|
|
94
|
+
return '';
|
|
95
|
+
}
|
|
96
|
+
_getOnlyColorValues(selectedColors) {
|
|
97
|
+
return selectedColors.map((selectedColor) => selectedColor.color);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
tslib_es6.__decorate([
|
|
101
|
+
decorators.property({ type: Boolean }),
|
|
102
|
+
tslib_es6.__metadata("design:type", Object)
|
|
103
|
+
], exports.HColorSwatches.prototype, "multiple", void 0);
|
|
104
|
+
tslib_es6.__decorate([
|
|
105
|
+
decorators.property({ type: Number, attribute: 'number-of-visible-colors' }),
|
|
106
|
+
tslib_es6.__metadata("design:type", Number)
|
|
107
|
+
], exports.HColorSwatches.prototype, "numberOfVisibleColors", void 0);
|
|
108
|
+
tslib_es6.__decorate([
|
|
109
|
+
decorators.state(),
|
|
110
|
+
tslib_es6.__metadata("design:type", Array)
|
|
111
|
+
], exports.HColorSwatches.prototype, "selectedColors", void 0);
|
|
112
|
+
exports.HColorSwatches = tslib_es6.__decorate([
|
|
113
|
+
phoenix_custom_element.phoenixCustomElement('h-color-swatches')
|
|
114
|
+
], exports.HColorSwatches);
|
|
115
|
+
//# sourceMappingURL=color_swatches.js.map
|
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const baseCssClass = 'color-swatches';
|
|
6
|
+
const COLOR_ITEM_TAG_NAME = 'h-color-item';
|
|
7
|
+
const COLOR_SWATCHES_CSS_CLASSES = {
|
|
8
|
+
colorItem: 'color-item',
|
|
9
|
+
colorSwatches: baseCssClass,
|
|
10
|
+
colorSwatchesItem: `${baseCssClass}__color-item`,
|
|
11
|
+
colorSwatchesItems: `${baseCssClass}__color-items`
|
|
12
|
+
};
|
|
13
|
+
const COLOR_SWATCHES_EVENT_NAMES = {
|
|
14
|
+
selected: 'colorSwatchesSelected'
|
|
15
|
+
};
|
|
16
|
+
const COLOR_SWATCHES_HIDDEN_ATTRIBUTE = 'hidden';
|
|
17
|
+
|
|
18
|
+
exports.COLOR_ITEM_TAG_NAME = COLOR_ITEM_TAG_NAME;
|
|
19
|
+
exports.COLOR_SWATCHES_CSS_CLASSES = COLOR_SWATCHES_CSS_CLASSES;
|
|
20
|
+
exports.COLOR_SWATCHES_EVENT_NAMES = COLOR_SWATCHES_EVENT_NAMES;
|
|
21
|
+
exports.COLOR_SWATCHES_HIDDEN_ATTRIBUTE = COLOR_SWATCHES_HIDDEN_ATTRIBUTE;
|
|
22
|
+
//# sourceMappingURL=color_swatches_constants.js.map
|
package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map
ADDED
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
7
|
+
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
8
|
+
var btn_controller = require('../../../controllers/btn_controller.js');
|
|
9
|
+
var show_more_constants = require('./show_more_constants.js');
|
|
10
|
+
|
|
11
|
+
exports.HColorSwatchesShowMore = class HColorSwatchesShowMore extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this._dispatchClickedEvent = () => {
|
|
15
|
+
this.dispatchEvent(new CustomEvent(show_more_constants.SHOW_MORE_EVENT_NAMES.showMore, {
|
|
16
|
+
bubbles: true
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
this._btnController = new btn_controller.BtnController(this, this._dispatchClickedEvent);
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
super.connectedCallback();
|
|
23
|
+
this.setupEvents();
|
|
24
|
+
this._addCssClasses();
|
|
25
|
+
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASS);
|
|
26
|
+
}
|
|
27
|
+
_addCssClasses() {
|
|
28
|
+
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASS);
|
|
29
|
+
}
|
|
30
|
+
setupEvents() {
|
|
31
|
+
this.addEventListener('click', this._dispatchClickedEvent);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.HColorSwatchesShowMore = tslib_es6.__decorate([
|
|
35
|
+
phoenix_custom_element.phoenixCustomElement('h-color-swatches-show-more'),
|
|
36
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
37
|
+
], exports.HColorSwatchesShowMore);
|
|
38
|
+
//# sourceMappingURL=show_more.js.map
|
|
@@ -0,0 +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;"}
|
package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const SHOW_MORE_CSS_CLASS = 'color-swatches-show-more';
|
|
6
|
+
const SHOW_MORE_EVENT_NAMES = {
|
|
7
|
+
showMore: 'colorSwatchesShowMore'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.SHOW_MORE_CSS_CLASS = SHOW_MORE_CSS_CLASS;
|
|
11
|
+
exports.SHOW_MORE_EVENT_NAMES = SHOW_MORE_EVENT_NAMES;
|
|
12
|
+
//# sourceMappingURL=show_more_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,7 +8,7 @@ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element
|
|
|
8
8
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var control_props_sync_controller_constants = require('../controllers/props_synchronizing/control_props_sync_controller_constants.js');
|
|
10
10
|
var control_props_sync_provider_controller = require('../controllers/props_synchronizing/control_props_sync_provider_controller.js');
|
|
11
|
-
var index = require('
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
12
|
var checkbox_constants = require('./checkbox_constants.js');
|
|
13
13
|
|
|
14
14
|
exports.HCheckbox = class HCheckbox extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
@@ -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,oBAAoB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,7 +8,7 @@ var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_el
|
|
|
8
8
|
var litHtml = require('lit-html');
|
|
9
9
|
var decorators_js = require('@lit/reactive-element/decorators.js');
|
|
10
10
|
var ref_js = require('lit-html/directives/ref.js');
|
|
11
|
-
var index = require('
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
12
|
var control_props_sync_consumer_controller = require('../controllers/props_synchronizing/control_props_sync_consumer_controller.js');
|
|
13
13
|
var ifDefined_js = require('lit-html/directives/if-defined.js');
|
|
14
14
|
var checkbox_constants = require('./checkbox_constants.js');
|
|
@@ -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,oBAAoB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var lit = require('lit');
|
|
7
|
+
var decorators = require('lit/decorators');
|
|
8
|
+
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
|
+
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
10
|
+
var input_constants = require('../input/input_constants.js');
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
|
+
var color_swatches_control_constants = require('./color_swatches_control_constants.js');
|
|
13
|
+
var color_swatches_constants = require('../../color_swatches/color_swatches_constants.js');
|
|
14
|
+
|
|
15
|
+
exports.HColorSwatchesControl = class HColorSwatchesControl extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback();
|
|
18
|
+
this._setupEvents();
|
|
19
|
+
this.classList.add(color_swatches_control_constants.COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControl);
|
|
20
|
+
const cssClasses = index['default']({
|
|
21
|
+
[color_swatches_control_constants.COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControlDisabled]: this.disabled,
|
|
22
|
+
[color_swatches_control_constants.COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControlError]: this.error
|
|
23
|
+
});
|
|
24
|
+
if (cssClasses)
|
|
25
|
+
this.classList.add(cssClasses);
|
|
26
|
+
}
|
|
27
|
+
_setupEvents() {
|
|
28
|
+
this.addEventListener(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.selected, (event) => {
|
|
29
|
+
const eventValue = event.detail.colors;
|
|
30
|
+
this.selectedColors = Array.isArray(eventValue) ? this._serializeArrayOfColors(eventValue) : eventValue;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
_serializeArrayOfColors(colors) {
|
|
34
|
+
return colors.reduce((colorPrev, colorCurr) => {
|
|
35
|
+
return colorPrev ? `${colorPrev}, ${colorCurr}` : colorCurr;
|
|
36
|
+
}, '');
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return lit.html `
|
|
40
|
+
<h-input controlName="${this.name}">
|
|
41
|
+
<h-input-control type="${input_constants.INPUT_CONTROL_TYPES.hidden}" value="${this.selectedColors}"></h-input-control>
|
|
42
|
+
</h-input>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
tslib_es6.__decorate([
|
|
47
|
+
decorators.property({ type: String, attribute: 'control-id' }),
|
|
48
|
+
tslib_es6.__metadata("design:type", String)
|
|
49
|
+
], exports.HColorSwatchesControl.prototype, "controlId", void 0);
|
|
50
|
+
tslib_es6.__decorate([
|
|
51
|
+
decorators.property({ type: String }),
|
|
52
|
+
tslib_es6.__metadata("design:type", String)
|
|
53
|
+
], exports.HColorSwatchesControl.prototype, "name", void 0);
|
|
54
|
+
tslib_es6.__decorate([
|
|
55
|
+
decorators.property({ type: Boolean }),
|
|
56
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
57
|
+
], exports.HColorSwatchesControl.prototype, "disabled", void 0);
|
|
58
|
+
tslib_es6.__decorate([
|
|
59
|
+
decorators.property({ type: Boolean }),
|
|
60
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
61
|
+
], exports.HColorSwatchesControl.prototype, "required", void 0);
|
|
62
|
+
tslib_es6.__decorate([
|
|
63
|
+
decorators.property({ type: Boolean }),
|
|
64
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
65
|
+
], exports.HColorSwatchesControl.prototype, "error", void 0);
|
|
66
|
+
tslib_es6.__decorate([
|
|
67
|
+
decorators.state(),
|
|
68
|
+
tslib_es6.__metadata("design:type", Object)
|
|
69
|
+
], exports.HColorSwatchesControl.prototype, "selectedColors", void 0);
|
|
70
|
+
exports.HColorSwatchesControl = tslib_es6.__decorate([
|
|
71
|
+
phoenix_custom_element.phoenixCustomElement('h-color-swatches-control')
|
|
72
|
+
], exports.HColorSwatchesControl);
|
|
73
|
+
//# sourceMappingURL=color_swatches_control.js.map
|
|
@@ -0,0 +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,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const baseColorSwatchesControlClass = 'color-swatches-control';
|
|
6
|
+
const COLOR_SWATCHES_CONTROL_CSS_CLASSES = {
|
|
7
|
+
colorSwatchesControl: baseColorSwatchesControlClass,
|
|
8
|
+
colorSwatchesControlDisabled: `${baseColorSwatchesControlClass}_disabled`,
|
|
9
|
+
colorSwatchesControlError: `${baseColorSwatchesControlClass}_error`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.COLOR_SWATCHES_CONTROL_CSS_CLASSES = COLOR_SWATCHES_CONTROL_CSS_CLASSES;
|
|
13
|
+
//# sourceMappingURL=color_swatches_control_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -9,7 +9,7 @@ var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_el
|
|
|
9
9
|
var input_constants = require('./input_constants.js');
|
|
10
10
|
var control_props_sync_controller_constants = require('../controllers/props_synchronizing/control_props_sync_controller_constants.js');
|
|
11
11
|
var control_props_sync_provider_controller = require('../controllers/props_synchronizing/control_props_sync_provider_controller.js');
|
|
12
|
-
var index = require('
|
|
12
|
+
var index = require('../../../../external/classnames/index.js');
|
|
13
13
|
|
|
14
14
|
exports.HInput = class HInput extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
15
15
|
constructor() {
|
|
@@ -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,oBAAoB,
|
|
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,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,7 +8,7 @@ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element
|
|
|
8
8
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var control_props_sync_controller_constants = require('../controllers/props_synchronizing/control_props_sync_controller_constants.js');
|
|
10
10
|
var control_props_sync_provider_controller = require('../controllers/props_synchronizing/control_props_sync_provider_controller.js');
|
|
11
|
-
var index = require('
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
12
|
var checkbox_constants = require('../checkbox/checkbox_constants.js');
|
|
13
13
|
var radio_constants = require('./radio_constants.js');
|
|
14
14
|
|
|
@@ -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,oBAAoB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,7 +8,7 @@ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element
|
|
|
8
8
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var control_props_sync_controller_constants = require('../controllers/props_synchronizing/control_props_sync_controller_constants.js');
|
|
10
10
|
var control_props_sync_provider_controller = require('../controllers/props_synchronizing/control_props_sync_provider_controller.js');
|
|
11
|
-
var index = require('
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
12
|
var checkbox_constants = require('../checkbox/checkbox_constants.js');
|
|
13
13
|
var switch_constants = require('./switch_constants.js');
|
|
14
14
|
|
|
@@ -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,oBAAoB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,7 +8,7 @@ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element
|
|
|
8
8
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var control_props_sync_controller_constants = require('../controllers/props_synchronizing/control_props_sync_controller_constants.js');
|
|
10
10
|
var control_props_sync_provider_controller = require('../controllers/props_synchronizing/control_props_sync_provider_controller.js');
|
|
11
|
-
var index = require('
|
|
11
|
+
var index = require('../../../../external/classnames/index.js');
|
|
12
12
|
var textarea_constants = require('./textarea_constants.js');
|
|
13
13
|
|
|
14
14
|
exports.HTextarea = class HTextarea extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
@@ -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,oBAAoB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA,oBAAoB,0CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -15,7 +15,6 @@ var tabs_constants = require('./tabs_constants.js');
|
|
|
15
15
|
exports.HTabs = class HTabs extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
this.watchChildrenRendered = true;
|
|
19
18
|
this._handleArrowNavigation = ({ key }) => {
|
|
20
19
|
const currentTabIndex = this._getFocusedTabIndex();
|
|
21
20
|
if (currentTabIndex === undefined)
|
|
@@ -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;
|
|
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;"}
|
package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js
CHANGED
|
@@ -12,8 +12,6 @@ class PhoenixLightLitElement extends lit.LitElement {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this._slots = {};
|
|
15
|
-
this.watchChildrenRendered = false;
|
|
16
|
-
this.watchChildrenConnected = false;
|
|
17
15
|
this.isWebComponentConnected = false;
|
|
18
16
|
this.isWebComponentRendered = false;
|
|
19
17
|
this._childrenForConnectionToWatch = [];
|
|
@@ -56,16 +54,14 @@ class PhoenixLightLitElement extends lit.LitElement {
|
|
|
56
54
|
this._dispatchLifecycleEvent(phoenix_light_lit_elements_constants.PHOENIX_LIGHT_LIT_ELEMENTS_EVENT_NAMES.rendered);
|
|
57
55
|
this.isWebComponentRendered = true;
|
|
58
56
|
}
|
|
59
|
-
|
|
57
|
+
_setupChildrenWatch() {
|
|
60
58
|
this._childrenForConnectionToWatch = this.childrenToWatch ? this.childrenToWatch : this._getComponentsNamesForConnectionToWatch();
|
|
59
|
+
this._childrenForRenderToWatch = this.childrenToWatch ? this.childrenToWatch : this._getComponentsNamesForRenderedToWatch();
|
|
61
60
|
if (!this._childrenForConnectionToWatch.length)
|
|
62
61
|
this.allChildrenConnected();
|
|
63
|
-
this.addEventListener(phoenix_light_lit_elements_constants.PHOENIX_LIGHT_LIT_ELEMENTS_EVENT_NAMES.connected, this._handleComponentConnected);
|
|
64
|
-
}
|
|
65
|
-
_setupChildrenRenderWatch() {
|
|
66
|
-
this._childrenForRenderToWatch = this.childrenToWatch ? this.childrenToWatch : this._getComponentsNamesForRenderedToWatch();
|
|
67
62
|
if (!this._childrenForRenderToWatch.length)
|
|
68
63
|
this.allChildrenRendered();
|
|
64
|
+
this.addEventListener(phoenix_light_lit_elements_constants.PHOENIX_LIGHT_LIT_ELEMENTS_EVENT_NAMES.connected, this._handleComponentConnected);
|
|
69
65
|
this.addEventListener(phoenix_light_lit_elements_constants.PHOENIX_LIGHT_LIT_ELEMENTS_EVENT_NAMES.rendered, this._handleComponentRendered);
|
|
70
66
|
}
|
|
71
67
|
_getComponentsNamesForConnectionToWatch() {
|
|
@@ -78,10 +74,7 @@ class PhoenixLightLitElement extends lit.LitElement {
|
|
|
78
74
|
super.connectedCallback();
|
|
79
75
|
this._dispatchLifecycleEvent(phoenix_light_lit_elements_constants.PHOENIX_LIGHT_LIT_ELEMENTS_EVENT_NAMES.connected);
|
|
80
76
|
this.isWebComponentConnected = true;
|
|
81
|
-
|
|
82
|
-
this._setupChildrenConnectedWatch();
|
|
83
|
-
if (this.watchChildrenRendered)
|
|
84
|
-
this._setupChildrenRenderWatch();
|
|
77
|
+
this._setupChildrenWatch();
|
|
85
78
|
}
|
|
86
79
|
allChildrenConnected() { }
|
|
87
80
|
allChildrenRendered() { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;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;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;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;"}
|