@shoper/phoenix_design_system 0.22.5-2 → 0.22.5-4
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/packages/phoenix/src/components/dropdown/dropdown.js +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message.js +130 -0
- package/build/cjs/packages/phoenix/src/components/{color_swatches/color_swatches.js.map → messages/base_message.js.map} +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message_constants.js +16 -0
- package/build/cjs/packages/phoenix/src/components/{color_swatches/color_swatches_constants.js.map → messages/base_message_constants.js.map} +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message_content.js +32 -0
- package/build/cjs/packages/phoenix/src/components/messages/base_message_content.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/messages/hints/hint.js +30 -0
- package/build/cjs/packages/phoenix/src/components/messages/hints/hint.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/messages/hints/hint_constants.js +14 -0
- package/build/{esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map → cjs/packages/phoenix/src/components/messages/hints/hint_constants.js.map} +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/hints/hint_content.js +19 -0
- package/build/cjs/packages/phoenix/src/components/messages/hints/hint_content.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/messages/tooltips/tooltip.js +30 -0
- package/build/cjs/packages/phoenix/src/components/messages/tooltips/tooltip.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/messages/tooltips/tooltip_constants.js +14 -0
- package/build/cjs/packages/phoenix/src/components/{color_swatches/color_item/color_item_constants.js.map → messages/tooltips/tooltip_constants.js.map} +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/tooltips/tooltip_content.js +19 -0
- package/build/cjs/packages/phoenix/src/components/messages/tooltips/tooltip_content.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js +3 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +1 -1
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js +22 -2
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +30 -14
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +2 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.js +2 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_types.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message.d.ts +20 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message.js +126 -0
- package/build/esm/packages/phoenix/src/components/{color_swatches/color_swatches.js.map → messages/base_message.js.map} +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js +8 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message_content.d.ts +6 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message_content.js +28 -0
- package/build/esm/packages/phoenix/src/components/messages/base_message_content.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint.d.ts +6 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint.js +28 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint_constants.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/{color_swatches/color_item/color_item_constants.js.map → messages/hints/hint_constants.js.map} +0 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint_content.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint_content.js +17 -0
- package/build/esm/packages/phoenix/src/components/messages/hints/hint_content.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip.d.ts +6 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip.js +28 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_content.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_content.js +17 -0
- package/build/esm/packages/phoenix/src/components/messages/tooltips/tooltip_content.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js +3 -2
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.d.ts +34 -0
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js +20 -3
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.d.ts +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +5 -2
- package/build/esm/packages/phoenix/src/index.js +5 -2
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js +0 -69
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +0 -12
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +0 -85
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +0 -17
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.d.ts +0 -14
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +0 -67
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +0 -7
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.d.ts +0 -5
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js +0 -2
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +0 -16
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +0 -83
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.d.ts +0 -8
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +0 -12
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.d.ts +0 -3
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js +0 -2
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/color_swatches/color_swatches_control.d.ts +0 -5
- package/build/esm/packages/phoenix/src/components/form/color_swatches/color_swatches_control.js +0 -19
- package/build/esm/packages/phoenix/src/components/form/color_swatches/color_swatches_control.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
3
|
+
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
4
|
+
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
|
+
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP, PORTAL_TARGET_ATTRIBUTE_NAME } from '../portal/portal_constants.js';
|
|
6
|
+
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
7
|
+
import { DIRECTIONS } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
|
|
8
|
+
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
9
|
+
import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
|
|
10
|
+
import { DEFAULT_MESSAGE_PORTAL_NAME, DEFAULT_MESSAGE_OFFSET, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_CLASS_NAME } from './base_message_constants.js';
|
|
11
|
+
|
|
12
|
+
class BaseMessage extends PhoenixLightLitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.opened = false;
|
|
16
|
+
this.portalTarget = DEFAULT_MESSAGE_PORTAL_NAME;
|
|
17
|
+
this.direction = DIRECTIONS.topCenter;
|
|
18
|
+
this.offset = DEFAULT_MESSAGE_OFFSET;
|
|
19
|
+
this._setupEventListeners = () => {
|
|
20
|
+
this.addEventListener('mouseenter', this._open);
|
|
21
|
+
this.addEventListener('mouseout', this._close);
|
|
22
|
+
this.addEventListener('focus', this._open);
|
|
23
|
+
};
|
|
24
|
+
this._positionMessage = () => {
|
|
25
|
+
requestAnimationFrame(() => {
|
|
26
|
+
var _a;
|
|
27
|
+
(_a = this._$messageContent) === null || _a === void 0 ? void 0 : _a.setAttribute('direction', this._positionController.position());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
this._open = () => {
|
|
31
|
+
if (this.opened)
|
|
32
|
+
return;
|
|
33
|
+
this.opened = true;
|
|
34
|
+
};
|
|
35
|
+
this._close = () => {
|
|
36
|
+
if (!this.opened)
|
|
37
|
+
return;
|
|
38
|
+
const transitionDuration = parseFloat(getComputedStyle(this._$messageContent || this).transitionDuration) * 1000;
|
|
39
|
+
window.requestAnimationFrame(() => {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = this._$messageContent) === null || _a === void 0 ? void 0 : _a.classList.add(MESSAGE_REMOVED_CLASS_NAME);
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
this.opened = false;
|
|
44
|
+
}, transitionDuration);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
this._handleFocusWithinMessage = (ev) => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest(`.${MESSAGE_CLASS_NAME}`)) !== this)
|
|
50
|
+
this._close();
|
|
51
|
+
if (!document.activeElement)
|
|
52
|
+
return;
|
|
53
|
+
const $focusableElements = UiDomUtils.getFocusableElements(this);
|
|
54
|
+
const activeElementIndex = $focusableElements.indexOf(document.activeElement);
|
|
55
|
+
// jeśli jest przedostatni, to następnym elementem jest sentinel
|
|
56
|
+
const isPenultimate = activeElementIndex + 1 === $focusableElements.length - 1;
|
|
57
|
+
if (!isPenultimate)
|
|
58
|
+
return;
|
|
59
|
+
this._close();
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
const $focusableParentElements = UiDomUtils.getFocusableElements(this.parentElement);
|
|
62
|
+
const sentinelIndex = $focusableParentElements.indexOf(document.activeElement) + 1;
|
|
63
|
+
$focusableParentElements[sentinelIndex + 1].focus();
|
|
64
|
+
};
|
|
65
|
+
this._clickOutsideController = new ClickOutsideController({
|
|
66
|
+
host: this,
|
|
67
|
+
container: this,
|
|
68
|
+
action: this._close
|
|
69
|
+
});
|
|
70
|
+
new KeystrokesController({
|
|
71
|
+
host: this,
|
|
72
|
+
keys: ['tab'],
|
|
73
|
+
callback: this._handleFocusWithinMessage
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
connectedCallback() {
|
|
77
|
+
super.connectedCallback();
|
|
78
|
+
BaseMessage._appendMessagePortal();
|
|
79
|
+
if (!this._$messageContent)
|
|
80
|
+
this._$messageContent = this.querySelector('h-tooltip-content');
|
|
81
|
+
if (!this._positionController && this._$messageContent)
|
|
82
|
+
this._positionController = new RelativePositionController({
|
|
83
|
+
host: this,
|
|
84
|
+
direction: this.direction,
|
|
85
|
+
relativeElement: this,
|
|
86
|
+
elementToPosition: this._$messageContent,
|
|
87
|
+
offset: this.offset
|
|
88
|
+
});
|
|
89
|
+
this.setAttribute('tabindex', '0');
|
|
90
|
+
this._setupEventListeners();
|
|
91
|
+
this.className = MESSAGE_CLASS_NAME;
|
|
92
|
+
}
|
|
93
|
+
static _appendMessagePortal() {
|
|
94
|
+
const $messagePortalTarget = document.querySelector(`[name="${DEFAULT_MESSAGE_PORTAL_NAME}"]`);
|
|
95
|
+
if ($messagePortalTarget)
|
|
96
|
+
return;
|
|
97
|
+
const $portalTarget = document.createElement(PORTAL_TARGET_COMPONENT_NAME);
|
|
98
|
+
$portalTarget.setAttribute(PORTAL_TARGET_NAME_PROP, DEFAULT_MESSAGE_PORTAL_NAME);
|
|
99
|
+
document.body.appendChild($portalTarget);
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
super.disconnectedCallback();
|
|
103
|
+
this.removeEventListener('mouseenter', this._open);
|
|
104
|
+
this.removeEventListener('mouseout', this._close);
|
|
105
|
+
this.removeEventListener('focus', this._open);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
__decorate([
|
|
109
|
+
property({ type: Boolean, reflect: true }),
|
|
110
|
+
__metadata("design:type", Object)
|
|
111
|
+
], BaseMessage.prototype, "opened", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String, attribute: PORTAL_TARGET_ATTRIBUTE_NAME }),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], BaseMessage.prototype, "portalTarget", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: String, reflect: true }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], BaseMessage.prototype, "direction", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: String }),
|
|
122
|
+
__metadata("design:type", Number)
|
|
123
|
+
], BaseMessage.prototype, "offset", void 0);
|
|
124
|
+
|
|
125
|
+
export { BaseMessage };
|
|
126
|
+
//# sourceMappingURL=base_message.js.map
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DEFAULT_MESSAGE_PORTAL_NAME = "message-portal";
|
|
2
|
+
export declare const MESSAGE_CONTENT_SLOT_NAME = "message-content";
|
|
3
|
+
export declare const MESSAGE_CLASS_NAME = "message";
|
|
4
|
+
export declare const MESSAGE_REMOVED_CLASS_NAME: string;
|
|
5
|
+
export declare const DEFAULT_MESSAGE_OFFSET = 8;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const DEFAULT_MESSAGE_PORTAL_NAME = 'message-portal';
|
|
2
|
+
const MESSAGE_CONTENT_SLOT_NAME = 'message-content';
|
|
3
|
+
const MESSAGE_CLASS_NAME = 'message';
|
|
4
|
+
const MESSAGE_REMOVED_CLASS_NAME = `${MESSAGE_CLASS_NAME}_removed`;
|
|
5
|
+
const DEFAULT_MESSAGE_OFFSET = 8;
|
|
6
|
+
|
|
7
|
+
export { DEFAULT_MESSAGE_OFFSET, DEFAULT_MESSAGE_PORTAL_NAME, MESSAGE_CLASS_NAME, MESSAGE_CONTENT_SLOT_NAME, MESSAGE_REMOVED_CLASS_NAME };
|
|
8
|
+
//# sourceMappingURL=base_message_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
3
|
+
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
|
+
import { PORTAL_TARGET_ATTRIBUTE_NAME } from '../portal/portal_constants.js';
|
|
5
|
+
import { DEFAULT_MESSAGE_PORTAL_NAME, MESSAGE_CONTENT_SLOT_NAME } from './base_message_constants.js';
|
|
6
|
+
|
|
7
|
+
class BaseMessageContent extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.portalTarget = DEFAULT_MESSAGE_PORTAL_NAME;
|
|
11
|
+
this._setupAriaAttributes = () => {
|
|
12
|
+
this.setAttribute('role', 'tooltip');
|
|
13
|
+
this.setAttribute('inert', '');
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback();
|
|
18
|
+
this.slot = MESSAGE_CONTENT_SLOT_NAME;
|
|
19
|
+
this._setupAriaAttributes();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
property({ type: String, attribute: PORTAL_TARGET_ATTRIBUTE_NAME }),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], BaseMessageContent.prototype, "portalTarget", void 0);
|
|
26
|
+
|
|
27
|
+
export { BaseMessageContent };
|
|
28
|
+
//# sourceMappingURL=base_message_content.js.map
|
|
@@ -0,0 +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;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
3
|
+
import { html } from 'lit-html';
|
|
4
|
+
import { MESSAGE_CONTENT_SLOT_NAME } from '../base_message_constants.js';
|
|
5
|
+
import { BaseMessage } from '../base_message.js';
|
|
6
|
+
import { HINT_CLASS_NAME, HINT_ELEMENT_NAME } from './hint_constants.js';
|
|
7
|
+
|
|
8
|
+
let HHint = class HHint extends BaseMessage {
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
this.classList.add(HINT_CLASS_NAME);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
super.render();
|
|
15
|
+
return html `
|
|
16
|
+
<h-portal ?disabled="${!this.opened}" @portal.open="${this._positionMessage}" to="${this.portalTarget}" hidden>
|
|
17
|
+
${this.getSlot(MESSAGE_CONTENT_SLOT_NAME)}
|
|
18
|
+
</h-portal>
|
|
19
|
+
<div tabindex="0"></div>
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
HHint = __decorate([
|
|
24
|
+
phoenixCustomElement(HINT_ELEMENT_NAME)
|
|
25
|
+
], HHint);
|
|
26
|
+
|
|
27
|
+
export { HHint };
|
|
28
|
+
//# sourceMappingURL=hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;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,7 @@
|
|
|
1
|
+
export declare const HINT_ELEMENT_NAME = "h-hint";
|
|
2
|
+
export declare const HINT_CONTENT_ELEMENT_NAME = "h-hint-content";
|
|
3
|
+
export declare const HINT_CLASS_NAME = "hint";
|
|
4
|
+
export declare const HINT_CONTENT_CLASS_NAME: string;
|
|
5
|
+
export declare const HINT_REMOVED_CLASS_NAME: string;
|
|
6
|
+
export declare const TOOLTIP_CONTENT_SLOT_NAME = "tooltip-content";
|
|
7
|
+
export declare const DEFAULT_TOOLTIP_OFFSET = 8;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const HINT_ELEMENT_NAME = 'h-hint';
|
|
2
|
+
const HINT_CONTENT_ELEMENT_NAME = 'h-hint-content';
|
|
3
|
+
const HINT_CLASS_NAME = 'hint';
|
|
4
|
+
const HINT_CONTENT_CLASS_NAME = `${HINT_CLASS_NAME}__content`;
|
|
5
|
+
|
|
6
|
+
export { HINT_CLASS_NAME, HINT_CONTENT_CLASS_NAME, HINT_CONTENT_ELEMENT_NAME, HINT_ELEMENT_NAME };
|
|
7
|
+
//# sourceMappingURL=hint_constants.js.map
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __decorate } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
3
|
+
import { HINT_CONTENT_CLASS_NAME, HINT_CONTENT_ELEMENT_NAME } from './hint_constants.js';
|
|
4
|
+
import { BaseMessageContent } from '../base_message_content.js';
|
|
5
|
+
|
|
6
|
+
let HHintContent = class HHintContent extends BaseMessageContent {
|
|
7
|
+
connectedCallback() {
|
|
8
|
+
super.connectedCallback();
|
|
9
|
+
this.className = HINT_CONTENT_CLASS_NAME;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
HHintContent = __decorate([
|
|
13
|
+
phoenixCustomElement(HINT_CONTENT_ELEMENT_NAME)
|
|
14
|
+
], HHintContent);
|
|
15
|
+
|
|
16
|
+
export { HHintContent };
|
|
17
|
+
//# sourceMappingURL=hint_content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
3
|
+
import { html } from 'lit-html';
|
|
4
|
+
import { MESSAGE_CONTENT_SLOT_NAME } from '../base_message_constants.js';
|
|
5
|
+
import { BaseMessage } from '../base_message.js';
|
|
6
|
+
import { TOOLTIP_CLASS_NAME, TOOLTIP_ELEMENT_NAME } from './tooltip_constants.js';
|
|
7
|
+
|
|
8
|
+
let HTooltip = class HTooltip extends BaseMessage {
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
this.classList.add(TOOLTIP_CLASS_NAME);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
super.render();
|
|
15
|
+
return html `
|
|
16
|
+
<h-portal ?disabled="${!this.opened}" @portal.open="${this._positionMessage}" to="${this.portalTarget}" hidden>
|
|
17
|
+
${this.getSlot(MESSAGE_CONTENT_SLOT_NAME)}
|
|
18
|
+
</h-portal>
|
|
19
|
+
<div tabindex="0"></div>
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
HTooltip = __decorate([
|
|
24
|
+
phoenixCustomElement(TOOLTIP_ELEMENT_NAME)
|
|
25
|
+
], HTooltip);
|
|
26
|
+
|
|
27
|
+
export { HTooltip };
|
|
28
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;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,7 @@
|
|
|
1
|
+
const TOOLTIP_ELEMENT_NAME = 'h-tooltip';
|
|
2
|
+
const TOOLTIP_CONTENT_ELEMENT_NAME = 'h-tooltip-content';
|
|
3
|
+
const TOOLTIP_CLASS_NAME = 'tooltip';
|
|
4
|
+
const TOOLTIP_CONTENT_CLASS_NAME = `${TOOLTIP_CLASS_NAME}__content`;
|
|
5
|
+
|
|
6
|
+
export { TOOLTIP_CLASS_NAME, TOOLTIP_CONTENT_CLASS_NAME, TOOLTIP_CONTENT_ELEMENT_NAME, TOOLTIP_ELEMENT_NAME };
|
|
7
|
+
//# sourceMappingURL=tooltip_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __decorate } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
3
|
+
import { BaseMessageContent } from '../base_message_content.js';
|
|
4
|
+
import { TOOLTIP_CONTENT_CLASS_NAME, TOOLTIP_CONTENT_ELEMENT_NAME } from './tooltip_constants.js';
|
|
5
|
+
|
|
6
|
+
let HTooltipContent = class HTooltipContent extends BaseMessageContent {
|
|
7
|
+
connectedCallback() {
|
|
8
|
+
super.connectedCallback();
|
|
9
|
+
this.className = TOOLTIP_CONTENT_CLASS_NAME;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
HTooltipContent = __decorate([
|
|
13
|
+
phoenixCustomElement(TOOLTIP_CONTENT_ELEMENT_NAME)
|
|
14
|
+
], HTooltipContent);
|
|
15
|
+
|
|
16
|
+
export { HTooltipContent };
|
|
17
|
+
//# sourceMappingURL=tooltip_content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,6 +6,7 @@ export declare const PORTAL_EVENTS: {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const PORTAL_TARGET_NAME_PROP = "name";
|
|
8
8
|
export declare const PORTAL_TARGET_COMPONENT_NAME = "h-portal-target";
|
|
9
|
+
export declare const PORTAL_TARGET_ATTRIBUTE_NAME = "portal-target";
|
|
9
10
|
declare global {
|
|
10
11
|
interface HTMLElementTagNameMap {
|
|
11
12
|
'h-portal': HPortal;
|
|
@@ -3,7 +3,8 @@ const PORTAL_EVENTS = {
|
|
|
3
3
|
close: 'portal.close'
|
|
4
4
|
};
|
|
5
5
|
const PORTAL_TARGET_NAME_PROP = 'name';
|
|
6
|
-
const PORTAL_TARGET_COMPONENT_NAME = 'h-portal-target';
|
|
6
|
+
const PORTAL_TARGET_COMPONENT_NAME = 'h-portal-target';
|
|
7
|
+
const PORTAL_TARGET_ATTRIBUTE_NAME = 'portal-target';
|
|
7
8
|
|
|
8
|
-
export { PORTAL_EVENTS, PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP };
|
|
9
|
+
export { PORTAL_EVENTS, PORTAL_TARGET_ATTRIBUTE_NAME, PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP };
|
|
9
10
|
//# sourceMappingURL=portal_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;"}
|
|
@@ -7,7 +7,7 @@ import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
|
7
7
|
|
|
8
8
|
var _RelativePositionController_host, _RelativePositionController_container, _RelativePositionController_nearestNonStaticElementFromElementToPosition, _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_throttledReposition, _RelativePositionController_throttledRepositionForScroll;
|
|
9
9
|
class RelativePositionController {
|
|
10
|
-
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition = () =>
|
|
10
|
+
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition = () => false, portalElementsNames = [], offset = 0 }) {
|
|
11
11
|
_RelativePositionController_host.set(this, void 0);
|
|
12
12
|
_RelativePositionController_container.set(this, void 0);
|
|
13
13
|
_RelativePositionController_nearestNonStaticElementFromElementToPosition.set(this, void 0);
|
|
@@ -1,4 +1,38 @@
|
|
|
1
|
+
export declare const VERTICAL_DIRECTIONS: {
|
|
2
|
+
readonly bottomLeft: "bottom-left";
|
|
3
|
+
readonly bottomRight: "bottom-right";
|
|
4
|
+
readonly bottomCenter: "bottom-center";
|
|
5
|
+
readonly topLeft: "top-left";
|
|
6
|
+
readonly topRight: "top-right";
|
|
7
|
+
readonly topCenter: "top-center";
|
|
8
|
+
};
|
|
9
|
+
export declare const HORIZONTAL_DIRECTIONS: {
|
|
10
|
+
readonly rightTop: "right-top";
|
|
11
|
+
readonly rightCenter: "right-center";
|
|
12
|
+
readonly rightBottom: "right-bottom";
|
|
13
|
+
readonly leftTop: "left-top";
|
|
14
|
+
readonly leftCenter: "left-center";
|
|
15
|
+
readonly leftBottom: "left-bottom";
|
|
16
|
+
};
|
|
17
|
+
export declare const CENTER_DIRECTIONS: {
|
|
18
|
+
readonly centerTop: "center-top";
|
|
19
|
+
readonly centerRight: "center-right";
|
|
20
|
+
readonly centerBottom: "center-bottom";
|
|
21
|
+
readonly centerLeft: "center-left";
|
|
22
|
+
readonly top: "top";
|
|
23
|
+
readonly right: "right";
|
|
24
|
+
readonly bottom: "bottom";
|
|
25
|
+
readonly left: "left";
|
|
26
|
+
};
|
|
1
27
|
export declare const DIRECTIONS: {
|
|
28
|
+
readonly centerTop: "center-top";
|
|
29
|
+
readonly centerRight: "center-right";
|
|
30
|
+
readonly centerBottom: "center-bottom";
|
|
31
|
+
readonly centerLeft: "center-left";
|
|
32
|
+
readonly top: "top";
|
|
33
|
+
readonly right: "right";
|
|
34
|
+
readonly bottom: "bottom";
|
|
35
|
+
readonly left: "left";
|
|
2
36
|
readonly bottomLeft: "bottom-left";
|
|
3
37
|
readonly bottomRight: "bottom-right";
|
|
4
38
|
readonly bottomCenter: "bottom-center";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const VERTICAL_DIRECTIONS = {
|
|
2
2
|
bottomLeft: 'bottom-left',
|
|
3
3
|
bottomRight: 'bottom-right',
|
|
4
4
|
bottomCenter: 'bottom-center',
|
|
5
5
|
topLeft: 'top-left',
|
|
6
6
|
topRight: 'top-right',
|
|
7
|
-
topCenter: 'top-center'
|
|
7
|
+
topCenter: 'top-center'
|
|
8
|
+
};
|
|
9
|
+
const HORIZONTAL_DIRECTIONS = {
|
|
8
10
|
rightTop: 'right-top',
|
|
9
11
|
rightCenter: 'right-center',
|
|
10
12
|
rightBottom: 'right-bottom',
|
|
@@ -12,6 +14,21 @@ const DIRECTIONS = {
|
|
|
12
14
|
leftCenter: 'left-center',
|
|
13
15
|
leftBottom: 'left-bottom'
|
|
14
16
|
};
|
|
17
|
+
const CENTER_DIRECTIONS = {
|
|
18
|
+
centerTop: 'center-top',
|
|
19
|
+
centerRight: 'center-right',
|
|
20
|
+
centerBottom: 'center-bottom',
|
|
21
|
+
centerLeft: 'center-left',
|
|
22
|
+
top: 'top',
|
|
23
|
+
right: 'right',
|
|
24
|
+
bottom: 'bottom',
|
|
25
|
+
left: 'left'
|
|
26
|
+
};
|
|
27
|
+
const DIRECTIONS = {
|
|
28
|
+
...HORIZONTAL_DIRECTIONS,
|
|
29
|
+
...VERTICAL_DIRECTIONS,
|
|
30
|
+
...CENTER_DIRECTIONS
|
|
31
|
+
};
|
|
15
32
|
const CALCULATOR_DIRECTIONS = {
|
|
16
33
|
bottom: 'bottom',
|
|
17
34
|
top: 'top',
|
|
@@ -32,5 +49,5 @@ const RELATIVE_POSITION_CONTROLLER_EVENTS = {
|
|
|
32
49
|
disabledPositioning: `${RELATIVE_POSITION_CONTROLLER_EVENT_NAME}.disabledPositioning`
|
|
33
50
|
};
|
|
34
51
|
|
|
35
|
-
export { CALCULATOR_DIRECTIONS, DEFAULT_SCROLL_THROTTLE_WAIT_TIME, DEFAULT_THROTTLE_WAIT_TIME, DIRECTIONS, NON_STATIC_POSITIONS, OVERFLOW_AUTO, OVERFLOW_SCROLL, RELATIVE_POSITION_CONTROLLER_EVENTS, SHRINK_MODE_BOTTOM_MARGIN, SHRINK_MODE_MIN_HEIGHT };
|
|
52
|
+
export { CALCULATOR_DIRECTIONS, CENTER_DIRECTIONS, DEFAULT_SCROLL_THROTTLE_WAIT_TIME, DEFAULT_THROTTLE_WAIT_TIME, DIRECTIONS, HORIZONTAL_DIRECTIONS, NON_STATIC_POSITIONS, OVERFLOW_AUTO, OVERFLOW_SCROLL, RELATIVE_POSITION_CONTROLLER_EVENTS, SHRINK_MODE_BOTTOM_MARGIN, SHRINK_MODE_MIN_HEIGHT, VERTICAL_DIRECTIONS };
|
|
36
53
|
//# 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;"}
|
|
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;"}
|
package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, nothing
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
|
|
2
2
|
export declare class PhoenixLightLitElement extends LitElement {
|
|
3
3
|
_slots: Record<string, TemplateResult[]>;
|
|
4
4
|
protected childrenToWatch: string[];
|
|
@@ -65,8 +65,6 @@ export { RelativePositionController } from './controllers/relative_position_cont
|
|
|
65
65
|
export { ToggleElementAriaController } from './controllers/toggle_element_aria_controller/toggle_element_aria_controller';
|
|
66
66
|
export { HBackdrop } from './components/backdrop/backdrop';
|
|
67
67
|
export { BackdropController } from "./components/backdrop/controller/backdrop_controller";
|
|
68
|
-
export { HColorSwatches } from './components/color_swatches/color_swatches';
|
|
69
|
-
export { HColorItem } from './components/color_swatches/color_item/color_item';
|
|
70
68
|
export { VisibilityController } from './controllers/visibility_controller/visibility_controller';
|
|
71
69
|
export * from './controllers/visibility_controller/visibility_controller_types';
|
|
72
70
|
export { HSlider } from './components/slider/slider';
|
|
@@ -77,3 +75,8 @@ export { HTabPanel } from './components/tabs/tab_panel';
|
|
|
77
75
|
export { TABS_EVENT_NAMES } from './components/tabs/tabs_constants';
|
|
78
76
|
export { HScrollTo } from './components/scroll_to/scroll_to';
|
|
79
77
|
export * from './components/scroll_to/scroll_to_types';
|
|
78
|
+
export { BaseMessage } from "./components/messages/base_message";
|
|
79
|
+
export { HHint } from "./components/messages/hints/hint";
|
|
80
|
+
export { HHintContent } from "./components/messages/hints/hint_content";
|
|
81
|
+
export { HTooltip } from "./components/messages/tooltips/tooltip";
|
|
82
|
+
export { HTooltipContent } from "./components/messages/tooltips/tooltip_content";
|
|
@@ -56,8 +56,6 @@ export { HToggleButtonGroup } from './components/groups/toggle_button_group/togg
|
|
|
56
56
|
export { HToggleButton } from './components/groups/toggle_button_group/toggle_button.js';
|
|
57
57
|
export { CLICK_OUTSIDE_CONTROLLER_MESSAGES } from './controllers/click_outside_controller/click_outside_controller_messages.js';
|
|
58
58
|
export { HBackdrop } from './components/backdrop/backdrop.js';
|
|
59
|
-
export { HColorItem } from './components/color_swatches/color_item/color_item.js';
|
|
60
|
-
export { HColorSwatches } from './components/color_swatches/color_swatches.js';
|
|
61
59
|
export { VisibilityController } from './controllers/visibility_controller/visibility_controller.js';
|
|
62
60
|
export { HSlider } from './components/slider/slider.js';
|
|
63
61
|
export { HTab } from './components/tabs/tab/tab.js';
|
|
@@ -65,4 +63,9 @@ export { HTabPanel } from './components/tabs/tab_panel.js';
|
|
|
65
63
|
export { TABS_EVENT_NAMES } from './components/tabs/tabs_constants.js';
|
|
66
64
|
export { HTabs } from './components/tabs/tabs.js';
|
|
67
65
|
export { HScrollTo } from './components/scroll_to/scroll_to.js';
|
|
66
|
+
export { BaseMessage } from './components/messages/base_message.js';
|
|
67
|
+
export { HHint } from './components/messages/hints/hint.js';
|
|
68
|
+
export { HHintContent } from './components/messages/hints/hint_content.js';
|
|
69
|
+
export { HTooltip } from './components/messages/tooltips/tooltip.js';
|
|
70
|
+
export { HTooltipContent } from './components/messages/tooltips/tooltip_content.js';
|
|
68
71
|
//# sourceMappingURL=index.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;"}
|
|
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;"}
|
package/package.json
CHANGED
|
@@ -1,69 +0,0 @@
|
|
|
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_item_constants = require('./color_item_constants.js');
|
|
11
|
-
var color_swatches_constants = require('../color_swatches_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.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorItem);
|
|
32
|
-
}
|
|
33
|
-
attributeChangedCallback(name, value, newValue) {
|
|
34
|
-
super.attributeChangedCallback(name, value, newValue);
|
|
35
|
-
switch (name) {
|
|
36
|
-
case color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE: {
|
|
37
|
-
this._syncAriaPressed();
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
_syncAriaPressed() {
|
|
43
|
-
this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
|
|
44
|
-
}
|
|
45
|
-
setupEvents() {
|
|
46
|
-
this.addEventListener('click', this._dispatchClickedEvent);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
tslib_es6.__decorate([
|
|
50
|
-
decorators.property({ type: String }),
|
|
51
|
-
tslib_es6.__metadata("design:type", String)
|
|
52
|
-
], exports.HColorItem.prototype, "color", void 0);
|
|
53
|
-
tslib_es6.__decorate([
|
|
54
|
-
decorators.property({ type: String }),
|
|
55
|
-
tslib_es6.__metadata("design:type", String)
|
|
56
|
-
], exports.HColorItem.prototype, "label", void 0);
|
|
57
|
-
tslib_es6.__decorate([
|
|
58
|
-
decorators.property({ type: Boolean, attribute: true }),
|
|
59
|
-
tslib_es6.__metadata("design:type", Boolean)
|
|
60
|
-
], exports.HColorItem.prototype, "disabled", void 0);
|
|
61
|
-
tslib_es6.__decorate([
|
|
62
|
-
decorators.property({ type: Boolean, attribute: true }),
|
|
63
|
-
tslib_es6.__metadata("design:type", Boolean)
|
|
64
|
-
], exports.HColorItem.prototype, "selected", void 0);
|
|
65
|
-
exports.HColorItem = tslib_es6.__decorate([
|
|
66
|
-
phoenix_custom_element.phoenixCustomElement('h-color-item'),
|
|
67
|
-
tslib_es6.__metadata("design:paramtypes", [])
|
|
68
|
-
], exports.HColorItem);
|
|
69
|
-
//# sourceMappingURL=color_item.js.map
|
package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;"}
|