@shoper/phoenix_design_system 1.1.4-9 → 1.1.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.
- package/build/cjs/packages/phoenix/src/components/accordion/accordion.js +1 -1
- package/build/cjs/packages/phoenix/src/components/accordion/accordion_group.js +2 -2
- package/build/cjs/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js +7 -0
- package/build/cjs/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js +2 -4
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_constants.js +3 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +13 -8
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.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/controllers/props_synchronizing/control_props_sync_provider_controller.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_close_btn.js +2 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_close_btn.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_components_constatns.js +2 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/select_components_constatns.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js +7 -13
- package/build/cjs/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +36 -20
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select_constants.js +2 -0
- package/build/cjs/packages/phoenix/src/components/form/select/select_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/icon/icon_constants.js +6 -0
- package/build/cjs/packages/phoenix/src/components/icon/icon_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +1 -1
- package/build/cjs/packages/phoenix/src/core/context/context_consumer_controller.js +1 -1
- package/build/cjs/packages/phoenix/src/index.js +9 -2
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion.js +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion_group.js +2 -2
- package/build/esm/packages/phoenix/src/components/backdrop/controller/backdrop_controller.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js +7 -0
- package/build/esm/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +2 -4
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.js +3 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +15 -10
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.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/controllers/props_synchronizing/control_props_sync_provider_controller.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_close_btn.js +2 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_close_btn.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_components_constatns.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/form/select/components/select_components_constatns.js +2 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/select_components_constatns.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js +8 -14
- package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler_constants.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/form/select/select.js +37 -21
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.d.ts +2 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js +2 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/icon/icon_constants.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/icon/icon_constants.js +6 -1
- package/build/esm/packages/phoenix/src/components/icon/icon_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.js +1 -1
- package/build/esm/packages/phoenix/src/core/context/context_consumer_controller.js +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +1 -0
- package/build/esm/packages/phoenix/src/index.js +2 -1
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
package/build/esm/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { BACKDROP_EVENTS } from '../backdrop_constants.js';
|
|
2
2
|
|
|
3
3
|
class BackdropController {
|
|
4
|
+
constructor() {
|
|
5
|
+
this._isVisible = false;
|
|
6
|
+
}
|
|
4
7
|
hide() {
|
|
5
8
|
this._dispatchEvent(BACKDROP_EVENTS.hide);
|
|
9
|
+
this._isVisible = false;
|
|
6
10
|
}
|
|
7
11
|
show() {
|
|
12
|
+
if (this._isVisible)
|
|
13
|
+
return;
|
|
8
14
|
this._dispatchEvent(BACKDROP_EVENTS.show);
|
|
15
|
+
this._isVisible = true;
|
|
9
16
|
}
|
|
10
17
|
_dispatchEvent(eventName) {
|
|
11
18
|
const hideBackdropEvent = new CustomEvent(eventName, {
|
package/build/esm/packages/phoenix/src/components/backdrop/controller/backdrop_controller.js.map
CHANGED
|
@@ -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;"}
|
|
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;"}
|
|
@@ -5,11 +5,11 @@ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/pho
|
|
|
5
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
6
6
|
import { property } from '@lit/reactive-element/decorators.js';
|
|
7
7
|
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
8
|
+
import { html } from 'lit-html';
|
|
8
9
|
import { BREAKPOINTS, SCROLLABLE_CLASS_NAME } from '../../global_constants.js';
|
|
9
10
|
import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_VISIBLE_CLASS, DROPDOWN_CONTENT_SHOW, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_HIDE, DROPDOWN_CONTENT_NAME, DROPDOWN_TOGGLER_NAME } from './dropdown_constants.js';
|
|
10
11
|
import { DIRECTIONS, RELATIVE_POSITION_CONTROLLER_EVENTS, DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
|
|
11
12
|
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
|
|
12
|
-
import { html } from 'lit-html';
|
|
13
13
|
import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
|
|
14
14
|
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
15
15
|
import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
@@ -269,11 +269,9 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
269
269
|
return this._findRootDropdown(element.parentElement || document.body);
|
|
270
270
|
}
|
|
271
271
|
_setupListeners() {
|
|
272
|
-
var _a;
|
|
273
272
|
this.addEventListener(RELATIVE_POSITION_CONTROLLER_EVENTS.disabledPositioning, this._handleDisabledPositioning);
|
|
274
273
|
this.addEventListener(RELATIVE_POSITION_CONTROLLER_EVENTS.enabledPositioning, this._handleEnabledPositioning);
|
|
275
|
-
|
|
276
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.addEventListener(DROPDOWN_EVENTS.toggle, this.toggle);
|
|
274
|
+
this.addEventListener(DROPDOWN_EVENTS.toggle, this.toggle);
|
|
277
275
|
document.addEventListener(DROPDOWN_EVENTS.hide, this.hide);
|
|
278
276
|
window.addEventListener('resize', this._observeScrollToggling);
|
|
279
277
|
document.addEventListener('keydown', this._closeDropdownOnEscape);
|
|
@@ -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,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -16,3 +16,4 @@ export declare const DROPDOWN_TOGGLER_CSS_CLASS: string;
|
|
|
16
16
|
export declare const DROPDOWN_CONTENT_VISIBLE_CLASS: string;
|
|
17
17
|
export declare const DROPDOWN_CONTENT_SHOW: string;
|
|
18
18
|
export declare const DROPDOWN_CONTENT_HIDE: string;
|
|
19
|
+
export declare const DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME = "toggleOnHover";
|
|
@@ -16,7 +16,8 @@ const DROPDOWN_CONTENT_CSS_CLASS = `${DROPDOWN_CSS_CLASS}__content`;
|
|
|
16
16
|
const DROPDOWN_TOGGLER_CSS_CLASS = `${DROPDOWN_CSS_CLASS}__toggler`;
|
|
17
17
|
const DROPDOWN_CONTENT_VISIBLE_CLASS = `${DROPDOWN_CONTENT_CSS_CLASS}_visible`;
|
|
18
18
|
const DROPDOWN_CONTENT_SHOW = `${DROPDOWN_CONTENT_CSS_CLASS}_show`;
|
|
19
|
-
const DROPDOWN_CONTENT_HIDE = `${DROPDOWN_CONTENT_CSS_CLASS}_hide`;
|
|
19
|
+
const DROPDOWN_CONTENT_HIDE = `${DROPDOWN_CONTENT_CSS_CLASS}_hide`;
|
|
20
|
+
const DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME = 'toggleOnHover';
|
|
20
21
|
|
|
21
|
-
export { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_CSS_CLASS, DROPDOWN_CONTENT_HIDE, DROPDOWN_CONTENT_NAME, DROPDOWN_CONTENT_SHOW, DROPDOWN_CONTENT_VISIBLE_CLASS, DROPDOWN_CSS_CLASS, DROPDOWN_EVENTS, DROPDOWN_NAME, DROPDOWN_TOGGLER_CSS_CLASS, DROPDOWN_TOGGLER_NAME };
|
|
22
|
+
export { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_CSS_CLASS, DROPDOWN_CONTENT_HIDE, DROPDOWN_CONTENT_NAME, DROPDOWN_CONTENT_SHOW, DROPDOWN_CONTENT_VISIBLE_CLASS, DROPDOWN_CSS_CLASS, DROPDOWN_EVENTS, DROPDOWN_NAME, DROPDOWN_TOGGLER_CSS_CLASS, DROPDOWN_TOGGLER_NAME, DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME };
|
|
22
23
|
//# sourceMappingURL=dropdown_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;"}
|
|
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;"}
|
|
@@ -4,10 +4,10 @@ export declare class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
4
4
|
private _btnController;
|
|
5
5
|
private _toggleElementAriaController;
|
|
6
6
|
private _$dropdown;
|
|
7
|
-
toggleOnHover: boolean;
|
|
8
7
|
constructor();
|
|
9
8
|
connectedCallback(): void;
|
|
10
9
|
private _dispatchToggleDropdownEventWithKeyboard;
|
|
10
|
+
private _dispatchToggleDropdownEventOnMobile;
|
|
11
11
|
private _dispatchToggleDropdownEvent;
|
|
12
12
|
private _handleFocusToOpenedDropdown;
|
|
13
13
|
disconnectedCallback(): void;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { property
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
3
3
|
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
4
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
6
6
|
import { BtnController } from '../../controllers/btn_controller/btn_controller.js';
|
|
7
|
-
import {
|
|
7
|
+
import { BREAKPOINTS } from '../../global_constants.js';
|
|
8
|
+
import { DROPDOWN_EVENTS, DROPDOWN_CONTENT_NAME, DROPDOWN_TOGGLER_CSS_CLASS, DROPDOWN_CONTAINER_NAME, DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME } from './dropdown_constants.js';
|
|
8
9
|
import { ToggleElementAriaController } from '../../controllers/toggle_element_aria_controller/toggle_element_aria_controller.js';
|
|
9
10
|
|
|
10
11
|
let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
11
12
|
constructor() {
|
|
12
13
|
super();
|
|
13
14
|
this.name = '';
|
|
14
|
-
this.toggleOnHover = false;
|
|
15
15
|
this._dispatchToggleDropdownEventWithKeyboard = (ev) => {
|
|
16
16
|
ev.stopImmediatePropagation();
|
|
17
17
|
this._dispatchToggleDropdownEvent(ev);
|
|
18
18
|
};
|
|
19
|
+
this._dispatchToggleDropdownEventOnMobile = (ev) => {
|
|
20
|
+
if (window.innerWidth > BREAKPOINTS.xs)
|
|
21
|
+
return;
|
|
22
|
+
this._dispatchToggleDropdownEvent(ev);
|
|
23
|
+
};
|
|
19
24
|
this._dispatchToggleDropdownEvent = (ev) => {
|
|
20
25
|
ev.preventDefault();
|
|
21
26
|
const toggleDropdownEvent = new CustomEvent(DROPDOWN_EVENTS.toggle, {
|
|
@@ -42,15 +47,19 @@ let HDropdownToggler = class HDropdownToggler extends PhoenixLightLitElement {
|
|
|
42
47
|
var _a;
|
|
43
48
|
super.connectedCallback();
|
|
44
49
|
this._btnController = new BtnController(this, this._dispatchToggleDropdownEventWithKeyboard);
|
|
45
|
-
this._$dropdown = this.
|
|
50
|
+
this._$dropdown = this.closest(DROPDOWN_CONTAINER_NAME);
|
|
46
51
|
if (this._$dropdown.isOpened)
|
|
47
52
|
this._toggleElementAriaController = new ToggleElementAriaController({
|
|
48
53
|
host: this,
|
|
49
54
|
initialAriaExpandedValue: this._$dropdown.isOpened()
|
|
50
55
|
});
|
|
51
|
-
this.toggleOnHover = ((_a = this._$dropdown) === null || _a === void 0 ? void 0 : _a.getAttribute('toggleOnHover')) !== null;
|
|
52
|
-
this.addEventListener('click', this._dispatchToggleDropdownEvent);
|
|
53
56
|
document.addEventListener('keydown', this._handleFocusToOpenedDropdown);
|
|
57
|
+
const hasToggleOnHover = (_a = this._$dropdown) === null || _a === void 0 ? void 0 : _a.hasAttribute(DROPDOWN_TOGGLE_ON_HOVER_ATTRIBUTE_NAME);
|
|
58
|
+
if (hasToggleOnHover) {
|
|
59
|
+
this.addEventListener('click', this._dispatchToggleDropdownEventOnMobile);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.addEventListener('click', this._dispatchToggleDropdownEvent);
|
|
54
63
|
}
|
|
55
64
|
disconnectedCallback() {
|
|
56
65
|
super.disconnectedCallback();
|
|
@@ -61,10 +70,6 @@ __decorate([
|
|
|
61
70
|
property({ type: String, reflect: true }),
|
|
62
71
|
__metadata("design:type", Object)
|
|
63
72
|
], HDropdownToggler.prototype, "name", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
state(),
|
|
66
|
-
__metadata("design:type", Object)
|
|
67
|
-
], HDropdownToggler.prototype, "toggleOnHover", void 0);
|
|
68
73
|
HDropdownToggler = __decorate([
|
|
69
74
|
phoenixCustomElement('h-dropdown-toggler'),
|
|
70
75
|
__metadata("design:paramtypes", [])
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -3,8 +3,8 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
3
3
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
4
4
|
import { property } from '@lit/reactive-element/decorators.js';
|
|
5
5
|
import classnames from '../../../../external/classnames/index.js';
|
|
6
|
-
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
7
6
|
import { html } from 'lit-html';
|
|
7
|
+
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
8
8
|
import { ControlPropsSyncConsumerController } from '../controllers/props_synchronizing/control_props_sync_consumer_controller.js';
|
|
9
9
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
10
10
|
import { CHECKBOX_CONTROL_EVENTS, CHECKBOX_CONTROL_CSS_CLASSES } from './checkbox_constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import 'lit';
|
|
3
|
-
import { ContextProviderController } from '../../../../core/context/context_provider_controller.js';
|
|
4
3
|
import { BehaviorSubject } from '../../../../core/classes/behavior_subject/behavior_subject.js';
|
|
4
|
+
import { ContextProviderController } from '../../../../core/context/context_provider_controller.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS, FORM_CONTROL_CONTEXTS } from './control_props_sync_controller_constants.js';
|
|
6
6
|
|
|
7
7
|
var _ControlPropsSyncProviderController_host, _ControlPropsSyncProviderController_controlPropsProvider, _ControlPropsSyncProviderController_propsObservable, _ControlPropsSyncProviderController_propsToSync;
|
package/build/esm/packages/phoenix/src/components/form/select/components/select_close_btn.js
CHANGED
|
@@ -3,6 +3,7 @@ import { PhoenixLightLitElement } from '../../../../core/phoenix_light_lit_eleme
|
|
|
3
3
|
import { phoenixCustomElement } from '../../../../core/decorators/phoenix_custom_element.js';
|
|
4
4
|
import { SELECT_CLOSE_BTN_EVENT_NAMES, SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME, SELECT_RELATED_COMPONENTS_NAMES } from './select_components_constatns.js';
|
|
5
5
|
import { BtnController } from '../../../../controllers/btn_controller/btn_controller.js';
|
|
6
|
+
import { ICONS_SIZES } from '../../../icon/icon_constants.js';
|
|
6
7
|
import { html } from 'lit-html';
|
|
7
8
|
|
|
8
9
|
let HSelectCloseBtn = class HSelectCloseBtn extends PhoenixLightLitElement {
|
|
@@ -24,7 +25,7 @@ let HSelectCloseBtn = class HSelectCloseBtn extends PhoenixLightLitElement {
|
|
|
24
25
|
render() {
|
|
25
26
|
return html `${this.hasSlot(SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME)
|
|
26
27
|
? this.getSlot(SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME)
|
|
27
|
-
: html ` <icon icon-name="icon-x"></icon>`} `;
|
|
28
|
+
: html ` <h-icon size=${ICONS_SIZES.l} icon-name="icon-x"></h-icon>`} `;
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
31
|
HSelectCloseBtn = __decorate([
|
package/build/esm/packages/phoenix/src/components/form/select/components/select_close_btn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,kDAAsD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,2BAA2B,kDAAsD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -17,6 +17,7 @@ export declare const SELECT_RELATED_COMPONENTS_NAMES: {
|
|
|
17
17
|
readonly toggler: "h-select-toggler";
|
|
18
18
|
readonly closeBtn: "h-select-close-btn";
|
|
19
19
|
readonly search: "h-select-search";
|
|
20
|
+
readonly placeholder: "h-placeholder";
|
|
20
21
|
};
|
|
21
22
|
export declare const SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME = "content";
|
|
22
23
|
export declare const SELECT_INPUT_PLACEHOLDER_SLOT_NAME = "placeholder";
|
|
@@ -16,7 +16,8 @@ const SELECT_RELATED_COMPONENTS_NAMES = {
|
|
|
16
16
|
optionContent: 'h-option-content',
|
|
17
17
|
toggler: 'h-select-toggler',
|
|
18
18
|
closeBtn: 'h-select-close-btn',
|
|
19
|
-
search: 'h-select-search'
|
|
19
|
+
search: 'h-select-search',
|
|
20
|
+
placeholder: 'h-placeholder'
|
|
20
21
|
};
|
|
21
22
|
const SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME = 'content';
|
|
22
23
|
const SELECT_INPUT_PLACEHOLDER_SLOT_NAME = 'placeholder';
|
|
@@ -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;"}
|
|
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;"}
|
package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { SelectOption } from "../../model/select_option";
|
|
|
3
3
|
import { TemplateResult } from 'lit-html';
|
|
4
4
|
import { BehaviorSubject } from "../../../../../core/classes/behavior_subject/behavior_subject";
|
|
5
5
|
export declare class HSelectToggler extends PhoenixLightLitElement {
|
|
6
|
-
placeholder: string;
|
|
7
6
|
selectedOptions$: BehaviorSubject<SelectOption[]> | null;
|
|
8
7
|
isMultiselect: boolean;
|
|
9
8
|
private _contextConsumer;
|
package/build/esm/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { state } from 'lit/decorators';
|
|
3
3
|
import { PhoenixLightLitElement } from '../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
4
|
import { phoenixCustomElement } from '../../../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { SELECT_INPUT_PLACEHOLDER_SLOT_NAME, SELECT_RELATED_COMPONENTS_NAMES } from '../select_components_constatns.js';
|
|
6
6
|
import { Observer } from '../../../../../core/classes/observer/observer.js';
|
|
7
|
-
import { SELECT_EVENT_NAMES, SELECT_CONTEXTS } from '../../select_constants.js';
|
|
8
7
|
import { html } from 'lit-html';
|
|
9
|
-
import { observe } from '../../../../../directives/observable_directive.js';
|
|
10
8
|
import { ContextConsumerController } from '../../../../../core/context/context_consumer_controller.js';
|
|
9
|
+
import { SELECT_EVENT_NAMES, SELECT_SLOT_NAMES, SELECT_CONTEXTS } from '../../select_constants.js';
|
|
10
|
+
import { observe } from '../../../../../directives/observable_directive.js';
|
|
11
11
|
import { SELECT_TOGGLER_CSS_CLASSES } from './select_toggler_constants.js';
|
|
12
12
|
|
|
13
13
|
let HSelectToggler = class HSelectToggler extends PhoenixLightLitElement {
|
|
@@ -28,7 +28,7 @@ let HSelectToggler = class HSelectToggler extends PhoenixLightLitElement {
|
|
|
28
28
|
}
|
|
29
29
|
connectedCallback() {
|
|
30
30
|
super.connectedCallback();
|
|
31
|
-
|
|
31
|
+
this.setAttribute('slot', SELECT_SLOT_NAMES.toggler);
|
|
32
32
|
this.setAttribute('role', 'textbox');
|
|
33
33
|
this.classList.add(SELECT_TOGGLER_CSS_CLASSES.selectToggler);
|
|
34
34
|
this._subscribeObserver();
|
|
@@ -51,19 +51,17 @@ let HSelectToggler = class HSelectToggler extends PhoenixLightLitElement {
|
|
|
51
51
|
${observe(this.selectedOptions$, (selectOptions) => {
|
|
52
52
|
var _a;
|
|
53
53
|
if (!selectOptions.length)
|
|
54
|
-
return html
|
|
55
|
-
|
|
56
|
-
>`;
|
|
57
|
-
return html `<ul class=${SELECT_TOGGLER_CSS_CLASSES.selectTogglerValues}>
|
|
54
|
+
return html `${(_a = this.getSlot(SELECT_INPUT_PLACEHOLDER_SLOT_NAME)) !== null && _a !== void 0 ? _a : 'Select'}`;
|
|
55
|
+
return html ` <ul class=${SELECT_TOGGLER_CSS_CLASSES.selectTogglerValues}>
|
|
58
56
|
${this.isMultiselect
|
|
59
|
-
? selectOptions.map((option) => html
|
|
57
|
+
? selectOptions.map((option) => html ` <li>
|
|
60
58
|
<h-tag @tag.remove=${() => this._dispatchOptionDeselect(option)}>
|
|
61
59
|
${option.content}
|
|
62
60
|
|
|
63
61
|
<h-tag-remove-button></h-tag-remove-button>
|
|
64
62
|
</h-tag>
|
|
65
63
|
</li>`)
|
|
66
|
-
: html
|
|
64
|
+
: html ` <li>${selectOptions[0].content}</li>`}
|
|
67
65
|
</ul>`;
|
|
68
66
|
})}
|
|
69
67
|
|
|
@@ -71,10 +69,6 @@ let HSelectToggler = class HSelectToggler extends PhoenixLightLitElement {
|
|
|
71
69
|
`;
|
|
72
70
|
}
|
|
73
71
|
};
|
|
74
|
-
__decorate([
|
|
75
|
-
property({ attribute: true }),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], HSelectToggler.prototype, "placeholder", void 0);
|
|
78
72
|
__decorate([
|
|
79
73
|
state(),
|
|
80
74
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -19,6 +19,7 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
19
19
|
private _selectContext;
|
|
20
20
|
private _listBoxController;
|
|
21
21
|
private _optionsObserver;
|
|
22
|
+
private $placeholder;
|
|
22
23
|
constructor();
|
|
23
24
|
updated(changedProperties: PropertyValues): void;
|
|
24
25
|
private _focusElementAfterSelectOpened;
|
|
@@ -33,6 +34,7 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
33
34
|
private _removeHTMLOptions;
|
|
34
35
|
private _handleOptionClicked;
|
|
35
36
|
private _handleSearch;
|
|
37
|
+
private _handleDropdownHidden;
|
|
36
38
|
private _closeSelect;
|
|
37
39
|
private _clearOptions;
|
|
38
40
|
protected update(changedProperties: PropertyValues): void;
|
|
@@ -41,5 +43,8 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
41
43
|
replaceOptions(options: SelectOption[]): void;
|
|
42
44
|
disconnectedCallback(): void;
|
|
43
45
|
private _handleResize;
|
|
46
|
+
private _getDropdownContentWidth;
|
|
47
|
+
private _getClonedPlaceholderElement;
|
|
48
|
+
private _searchNoResult;
|
|
44
49
|
protected render(): TemplateResult;
|
|
45
50
|
}
|
|
@@ -4,14 +4,16 @@ import { state } from 'lit/decorators';
|
|
|
4
4
|
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
5
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
6
6
|
import { property } from '@lit/reactive-element/decorators.js';
|
|
7
|
-
import { SELECT_RELATED_COMPONENTS_NAMES, SELECT_CLOSE_BTN_EVENT_NAMES } from './components/select_components_constatns.js';
|
|
7
|
+
import { SELECT_RELATED_COMPONENTS_NAMES, SELECT_INPUT_PLACEHOLDER_SLOT_NAME, SELECT_CLOSE_BTN_EVENT_NAMES, SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME } from './components/select_components_constatns.js';
|
|
8
8
|
import { Observer } from '../../../core/classes/observer/observer.js';
|
|
9
9
|
import { HIcon } from '../../icon/icon.js';
|
|
10
|
-
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
11
10
|
import { SELECT_SLOT_NAMES, SELECT_CSS_CLASSES, SELECT_CONTEXTS, SELECT_EVENT_NAMES, MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH, SELECT_RESIZE_DEBOUNCE_TIME } from './select_constants.js';
|
|
11
|
+
import { observe } from '../../../directives/observable_directive.js';
|
|
12
|
+
import { HSelectToggler } from './components/toggler/select_toggler.js';
|
|
13
|
+
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
12
14
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
15
|
+
import { BREAKPOINTS } from '../../../global_constants.js';
|
|
13
16
|
import debounce_1 from '../../../../../../external/lodash/debounce.js';
|
|
14
|
-
import { observe } from '../../../directives/observable_directive.js';
|
|
15
17
|
import { MultiSelectController } from './controllers/multi_select_controller.js';
|
|
16
18
|
import { SelectController } from './controllers/select_controller.js';
|
|
17
19
|
import { HSelectSearch } from './components/search/select_search.js';
|
|
@@ -19,10 +21,10 @@ import { ListBoxKeyboardController } from '../../../controllers/list_box_control
|
|
|
19
21
|
import { SelectOptionMapper } from './model/select_option_mapper.js';
|
|
20
22
|
import { SelectControlUtils } from './select_utils.js';
|
|
21
23
|
import { HSelectCloseBtn } from './components/select_close_btn.js';
|
|
22
|
-
import { HSelectToggler } from './components/toggler/select_toggler.js';
|
|
23
24
|
|
|
24
25
|
let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
25
26
|
constructor() {
|
|
27
|
+
var _a;
|
|
26
28
|
super();
|
|
27
29
|
this.multiselect = false;
|
|
28
30
|
this.opened = false;
|
|
@@ -34,9 +36,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
34
36
|
this._$optionsList = createRef();
|
|
35
37
|
this._$dropdownContent = createRef();
|
|
36
38
|
this._selectContext = new ContextProviderController(this);
|
|
37
|
-
this._setDropdownContentWidth = () => {
|
|
39
|
+
this._setDropdownContentWidth = (width) => {
|
|
38
40
|
if (this._$dropdownContent.value)
|
|
39
|
-
this._$dropdownContent.value.style.width = `${
|
|
41
|
+
this._$dropdownContent.value.style.width = `${width !== null && width !== void 0 ? width : ''}px`;
|
|
40
42
|
};
|
|
41
43
|
this._handleOptionDeselect = (event) => {
|
|
42
44
|
const selectedOption = this._selectController.getSelectOption(event.detail);
|
|
@@ -68,23 +70,26 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
68
70
|
if (!this.multiselect)
|
|
69
71
|
this._closeSelect();
|
|
70
72
|
};
|
|
73
|
+
this._handleDropdownHidden = () => {
|
|
74
|
+
this._searchValue = '';
|
|
75
|
+
this.opened = false;
|
|
76
|
+
};
|
|
71
77
|
this._closeSelect = () => {
|
|
72
78
|
var _a;
|
|
73
79
|
if (!this.opened)
|
|
74
80
|
return;
|
|
75
81
|
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
76
|
-
this._searchValue = '';
|
|
77
|
-
this.opened = false;
|
|
78
82
|
};
|
|
79
83
|
this._clearOptions = () => {
|
|
80
84
|
this._selectController.deselectOptions();
|
|
81
85
|
};
|
|
82
86
|
this._handleResize = debounce_1(() => {
|
|
83
87
|
this._closeSelect();
|
|
84
|
-
this._setDropdownContentWidth();
|
|
88
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
85
89
|
}, SELECT_RESIZE_DEBOUNCE_TIME);
|
|
86
90
|
const $options = Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
87
91
|
$options.forEach(($option) => $option.setAttribute('slot', SELECT_SLOT_NAMES.content));
|
|
92
|
+
this.$placeholder = (_a = this.querySelector(`[slot="${SELECT_INPUT_PLACEHOLDER_SLOT_NAME}"]`)) !== null && _a !== void 0 ? _a : 'Select';
|
|
88
93
|
}
|
|
89
94
|
updated(changedProperties) {
|
|
90
95
|
super.updated(changedProperties);
|
|
@@ -143,7 +148,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
143
148
|
}
|
|
144
149
|
firstUpdated(props) {
|
|
145
150
|
super.firstUpdated(props);
|
|
146
|
-
this._setDropdownContentWidth();
|
|
151
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
147
152
|
}
|
|
148
153
|
_setupEvents() {
|
|
149
154
|
this.addEventListener(SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
|
|
@@ -186,6 +191,15 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
186
191
|
this._selectController.options$.unsubscribe(this._optionsObserver);
|
|
187
192
|
window.removeEventListener('resize', this._handleResize);
|
|
188
193
|
}
|
|
194
|
+
_getDropdownContentWidth() {
|
|
195
|
+
return document.documentElement.clientWidth < BREAKPOINTS.xs ? undefined : this.getBoundingClientRect().width;
|
|
196
|
+
}
|
|
197
|
+
_getClonedPlaceholderElement() {
|
|
198
|
+
return this.$placeholder instanceof HTMLElement ? this.$placeholder.cloneNode(true) : this.$placeholder;
|
|
199
|
+
}
|
|
200
|
+
_searchNoResult() {
|
|
201
|
+
return Boolean(!this._selectController.visibleOptionsCount && Object.keys(this._$options).length);
|
|
202
|
+
}
|
|
189
203
|
render() {
|
|
190
204
|
var _a;
|
|
191
205
|
const options = (_a = this._selectController.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
@@ -193,23 +207,23 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
193
207
|
<h-dropdown
|
|
194
208
|
${ref(this._$dropdown)}
|
|
195
209
|
@dropdown.showed=${() => (this.opened = true)}
|
|
196
|
-
@dropdown.hidden=${this.
|
|
210
|
+
@dropdown.hidden=${this._handleDropdownHidden}
|
|
197
211
|
name=${this.controlName}
|
|
198
212
|
offset=${this.offset}
|
|
199
213
|
>
|
|
200
|
-
<h-dropdown-toggler name=${this.controlName}>
|
|
201
|
-
<h-select-toggler>
|
|
202
|
-
<span slot="placeholder">${this.getSlot(SELECT_SLOT_NAMES.toggler)}</span>
|
|
203
|
-
</h-select-toggler>
|
|
204
|
-
</h-dropdown-toggler>
|
|
214
|
+
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
205
215
|
|
|
206
|
-
<h-dropdown-content
|
|
216
|
+
<h-dropdown-content
|
|
217
|
+
class="${SELECT_CSS_CLASSES.selectContent} ${this.error ? SELECT_CSS_CLASSES.selectContentError : ''}"
|
|
218
|
+
${ref(this._$dropdownContent)}
|
|
219
|
+
name=${this.controlName}
|
|
220
|
+
>
|
|
207
221
|
<h-select-close-btn
|
|
208
222
|
class="${SELECT_CSS_CLASSES.selectCloseMobileButton}"
|
|
209
223
|
@selectCloseBtn.close=${this._closeSelect}
|
|
210
224
|
></h-select-close-btn>
|
|
211
225
|
|
|
212
|
-
<
|
|
226
|
+
<div class=${SELECT_CSS_CLASSES.selectLabel}>${html `${this._getClonedPlaceholderElement()}`}</div>
|
|
213
227
|
|
|
214
228
|
${options.length > MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH
|
|
215
229
|
? html ` <h-select-search
|
|
@@ -222,7 +236,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
222
236
|
${this.hasSlot(SELECT_SLOT_NAMES.content)
|
|
223
237
|
? html `
|
|
224
238
|
<h-options
|
|
225
|
-
class
|
|
239
|
+
class="${SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
|
|
240
|
+
? SELECT_CSS_CLASSES.selectOptionsEmpty
|
|
241
|
+
: ''}"
|
|
226
242
|
${ref(this._$optionsList)}
|
|
227
243
|
@selectOptions.clicked=${this._handleOptionClicked}
|
|
228
244
|
>
|
|
@@ -230,7 +246,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
230
246
|
</h-options>
|
|
231
247
|
`
|
|
232
248
|
: nothing}
|
|
233
|
-
${
|
|
249
|
+
${this._searchNoResult()
|
|
234
250
|
? html ` <div>
|
|
235
251
|
<p class=${SELECT_CSS_CLASSES.selectNoResult}>
|
|
236
252
|
Brak wyników dla: <em class=${SELECT_CSS_CLASSES.selectSearchedPhrase}>"${this._searchValue}"</em>
|
|
@@ -242,7 +258,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
242
258
|
<section class=${SELECT_CSS_CLASSES.selectFooter}>
|
|
243
259
|
<button class="${SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>clear</button>
|
|
244
260
|
<h-select-close-btn class="${SELECT_CSS_CLASSES.selectCloseButton}" @selectCloseBtn.close=${this._closeSelect}
|
|
245
|
-
>ok
|
|
261
|
+
><span slot=${SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME}>ok</span>
|
|
246
262
|
</h-select-close-btn>
|
|
247
263
|
</section>
|
|
248
264
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+CAAmD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+CAAmD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -19,7 +19,9 @@ export declare const SELECT_CSS_CLASSES: {
|
|
|
19
19
|
readonly selectDisabled: "select_disabled";
|
|
20
20
|
readonly selectSearch: "select__search";
|
|
21
21
|
readonly selectOptions: "select__options";
|
|
22
|
+
readonly selectOptionsEmpty: "select__options_empty";
|
|
22
23
|
readonly selectContent: "select__content";
|
|
24
|
+
readonly selectContentError: "select__content_error";
|
|
23
25
|
readonly selectFooter: "select__footer";
|
|
24
26
|
readonly selectNoResult: "select__no-result";
|
|
25
27
|
readonly selectSearchedPhrase: "select__searched-phrase";
|
|
@@ -20,7 +20,9 @@ const SELECT_CSS_CLASSES = {
|
|
|
20
20
|
selectDisabled: `${baseSelectClass}_disabled`,
|
|
21
21
|
selectSearch: `${baseSelectClass}__search`,
|
|
22
22
|
selectOptions: `${baseSelectClass}__options`,
|
|
23
|
+
selectOptionsEmpty: `${baseSelectClass}__options_empty`,
|
|
23
24
|
selectContent: `${baseSelectClass}__content`,
|
|
25
|
+
selectContentError: `${baseSelectClass}__content_error`,
|
|
24
26
|
selectFooter: `${baseSelectClass}__footer`,
|
|
25
27
|
selectNoResult: `${baseSelectClass}__no-result`,
|
|
26
28
|
selectSearchedPhrase: `${baseSelectClass}__searched-phrase`,
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -13,4 +13,9 @@ export declare const ICON_SIZES_CSS_CLASS_MAP: {
|
|
|
13
13
|
readonly xl: "icon_xl";
|
|
14
14
|
readonly xxl: "icon_xxl";
|
|
15
15
|
};
|
|
16
|
+
export declare const ICONS_SIZES: {
|
|
17
|
+
readonly l: "l";
|
|
18
|
+
readonly xl: "xl";
|
|
19
|
+
readonly xxl: "xxl";
|
|
20
|
+
};
|
|
16
21
|
export declare type TIconSize = Any.Keys<typeof ICON_SIZES_CSS_CLASS_MAP>;
|
|
@@ -12,7 +12,12 @@ const ICON_SIZES_CSS_CLASS_MAP = {
|
|
|
12
12
|
l: ICON_CSS_CLASSES.iconSizeL,
|
|
13
13
|
xl: ICON_CSS_CLASSES.iconSizeXl,
|
|
14
14
|
xxl: ICON_CSS_CLASSES.iconSizeXxl
|
|
15
|
+
};
|
|
16
|
+
const ICONS_SIZES = {
|
|
17
|
+
l: 'l',
|
|
18
|
+
xl: 'xl',
|
|
19
|
+
xxl: 'xxl'
|
|
15
20
|
};
|
|
16
21
|
|
|
17
|
-
export { ICON_CSS_CLASSES, ICON_SIZES_CSS_CLASS_MAP };
|
|
22
|
+
export { ICONS_SIZES, ICON_CSS_CLASSES, ICON_SIZES_CSS_CLASS_MAP };
|
|
18
23
|
//# sourceMappingURL=icon_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;"}
|
|
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;"}
|
|
@@ -2,9 +2,9 @@ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.
|
|
|
2
2
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
3
3
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
4
4
|
import { property, state } from '@lit/reactive-element/decorators.js';
|
|
5
|
+
import { html } from 'lit-html';
|
|
5
6
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
6
7
|
import { PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
|
|
7
|
-
import { html } from 'lit-html';
|
|
8
8
|
import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
|
|
9
9
|
import '@lit/reactive-element';
|
|
10
10
|
import { MODAL_OPENED_PROP, FOCUSABLE_ELEMENTS_WITHIN_MODAL, MODALS_PORTAL_NAME, MODAL_EVENTS } from './modal_constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import 'lit';
|
|
3
|
-
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
4
3
|
import { CONTEXT_ASYNC_CONSUMER_DEFAULT_INTERVAL_RATE, CONTEXT_ASYNC_CONSUMER_DFAULT_MAX_WAITING_TIME } from './context_constants.js';
|
|
4
|
+
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
5
5
|
|
|
6
6
|
var _ContextConsumerController_host, _ContextConsumerController_asyncConsumerSentinelId, _ContextConsumerController_asyncConsumerIntervalId;
|
|
7
7
|
class ContextConsumerController {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { HOption } from "./components/form/select/components/option/select_option";
|
|
2
2
|
export { HOptionContent } from "./components/form/select/components/option/select_option_content";
|
|
3
3
|
export { HOptions } from "./components/form/select/components/select_options";
|
|
4
|
+
export { HSelectToggler } from "./components/form/select/components/toggler/select_toggler";
|
|
4
5
|
export { HSelect } from "./components/form/select/select";
|
|
5
6
|
export { DEFAULT_SLOT_NAME } from "./core/phoenix_light_lit_element/phoenix_light_lit_elements_constants";
|
|
6
7
|
export { IPhoenixWebComponentClass } from "./global_types";
|