@shoper/phoenix_design_system 1.1.4-2 → 1.1.4-21
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_content.js +1 -1
- package/build/cjs/packages/phoenix/src/components/accordion/accordion_group.js +1 -1
- package/build/cjs/packages/phoenix/src/components/accordion/accordion_toggler.js +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js +3 -5
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/controllers/props_synchronizing/control_props_sync_consumer_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 +6 -12
- 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 +30 -17
- 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 +1 -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.js +19 -5
- package/build/cjs/packages/phoenix/src/components/icon/icon.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion_content.js +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion_group.js +1 -1
- package/build/esm/packages/phoenix/src/components/accordion/accordion_toggler.js +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js +3 -5
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/controllers/props_synchronizing/control_props_sync_consumer_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 +31 -18
- 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 +1 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js +1 -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.d.ts +7 -2
- package/build/esm/packages/phoenix/src/components/icon/icon.js +19 -5
- package/build/esm/packages/phoenix/src/components/icon/icon.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
|
6
6
|
var decorators = require('lit/decorators');
|
|
7
7
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
8
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
9
|
-
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
10
9
|
var observer = require('../../core/classes/observer/observer.js');
|
|
10
|
+
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
11
11
|
var accordion_constants = require('./accordion_constants.js');
|
|
12
12
|
var transition_controller = require('../../controllers/transition_controller/transition_controller.js');
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
|
6
6
|
var decorators = require('lit/decorators');
|
|
7
7
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
8
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
9
|
-
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
10
9
|
var observer = require('../../core/classes/observer/observer.js');
|
|
10
|
+
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
11
11
|
var behavior_subject = require('../../core/classes/behavior_subject/behavior_subject.js');
|
|
12
12
|
var context_provider_controller = require('../../core/context/context_provider_controller.js');
|
|
13
13
|
var accordion_constants = require('./accordion_constants.js');
|
|
@@ -6,8 +6,8 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
|
6
6
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
7
7
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
8
8
|
var btn_controller = require('../../controllers/btn_controller/btn_controller.js');
|
|
9
|
-
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
10
9
|
var observer = require('../../core/classes/observer/observer.js');
|
|
10
|
+
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
11
11
|
var accordion_constants = require('./accordion_constants.js');
|
|
12
12
|
|
|
13
13
|
exports.HAccordionToggler = class HAccordionToggler extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
@@ -11,11 +11,8 @@ var dropdown_constants = require('./dropdown_constants.js');
|
|
|
11
11
|
|
|
12
12
|
exports.HDropdownContent = class HDropdownContent extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(
|
|
14
|
+
super();
|
|
15
15
|
this.name = '';
|
|
16
|
-
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback();
|
|
19
16
|
this.classList.add(dropdown_constants.DROPDOWN_CONTENT_CSS_CLASS);
|
|
20
17
|
this.setAttribute('role', 'menu');
|
|
21
18
|
this.slot = this.hasAttribute('slot') ? this.slot : 'content';
|
|
@@ -33,6 +30,7 @@ tslib_es6.__decorate([
|
|
|
33
30
|
tslib_es6.__metadata("design:type", Object)
|
|
34
31
|
], exports.HDropdownContent.prototype, "name", void 0);
|
|
35
32
|
exports.HDropdownContent = tslib_es6.__decorate([
|
|
36
|
-
phoenix_custom_element.phoenixCustomElement('h-dropdown-content')
|
|
33
|
+
phoenix_custom_element.phoenixCustomElement('h-dropdown-content'),
|
|
34
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
37
35
|
], exports.HDropdownContent);
|
|
38
36
|
//# sourceMappingURL=dropdown_content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../../../external/tslib/tslib.es6.js');
|
|
6
6
|
require('lit');
|
|
7
|
-
var context_consumer_controller = require('../../../../core/context/context_consumer_controller.js');
|
|
8
7
|
var observer = require('../../../../core/classes/observer/observer.js');
|
|
8
|
+
var context_consumer_controller = require('../../../../core/context/context_consumer_controller.js');
|
|
9
9
|
var control_props_sync_controller_constants = require('./control_props_sync_controller_constants.js');
|
|
10
10
|
|
|
11
11
|
var _ControlPropsSyncConsumerController_host, _ControlPropsSyncConsumerController_contextConsumer, _ControlPropsSyncConsumerController_basePropsObservable, _ControlPropsSyncConsumerController_propsObserver, _ControlPropsSyncConsumerController_onPropsUpdated;
|
package/build/cjs/packages/phoenix/src/components/form/select/components/select_close_btn.js
CHANGED
|
@@ -7,6 +7,7 @@ var phoenix_light_lit_element = require('../../../../core/phoenix_light_lit_elem
|
|
|
7
7
|
var phoenix_custom_element = require('../../../../core/decorators/phoenix_custom_element.js');
|
|
8
8
|
var select_components_constatns = require('./select_components_constatns.js');
|
|
9
9
|
var btn_controller = require('../../../../controllers/btn_controller/btn_controller.js');
|
|
10
|
+
var icon_constants = require('../../../icon/icon_constants.js');
|
|
10
11
|
var litHtml = require('lit-html');
|
|
11
12
|
|
|
12
13
|
exports.HSelectCloseBtn = class HSelectCloseBtn extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
@@ -28,7 +29,7 @@ exports.HSelectCloseBtn = class HSelectCloseBtn extends phoenix_light_lit_elemen
|
|
|
28
29
|
render() {
|
|
29
30
|
return litHtml.html `${this.hasSlot(select_components_constatns.SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME)
|
|
30
31
|
? this.getSlot(select_components_constatns.SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME)
|
|
31
|
-
: litHtml.html
|
|
32
|
+
: litHtml.html ` <h-icon size=${icon_constants.ICON_SIZES_CSS_CLASS_MAP.l} icon-name="icon-x"></h-icon>`} `;
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
exports.HSelectCloseBtn = tslib_es6.__decorate([
|
package/build/cjs/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;AACA;AACA;AACA;AACA,wBAAwB,kDAAsD;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;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,kDAAsD;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;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -20,7 +20,8 @@ const SELECT_RELATED_COMPONENTS_NAMES = {
|
|
|
20
20
|
optionContent: 'h-option-content',
|
|
21
21
|
toggler: 'h-select-toggler',
|
|
22
22
|
closeBtn: 'h-select-close-btn',
|
|
23
|
-
search: 'h-select-search'
|
|
23
|
+
search: 'h-select-search',
|
|
24
|
+
placeholder: 'h-placeholder'
|
|
24
25
|
};
|
|
25
26
|
const SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME = 'content';
|
|
26
27
|
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;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;"}
|
package/build/cjs/packages/phoenix/src/components/form/select/components/toggler/select_toggler.js
CHANGED
|
@@ -7,10 +7,10 @@ var decorators = require('lit/decorators');
|
|
|
7
7
|
var phoenix_light_lit_element = require('../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
8
|
var phoenix_custom_element = require('../../../../../core/decorators/phoenix_custom_element.js');
|
|
9
9
|
var select_components_constatns = require('../select_components_constatns.js');
|
|
10
|
+
var observer = require('../../../../../core/classes/observer/observer.js');
|
|
10
11
|
var litHtml = require('lit-html');
|
|
11
12
|
var context_consumer_controller = require('../../../../../core/context/context_consumer_controller.js');
|
|
12
13
|
var select_constants = require('../../select_constants.js');
|
|
13
|
-
var observer = require('../../../../../core/classes/observer/observer.js');
|
|
14
14
|
var observable_directive = require('../../../../../directives/observable_directive.js');
|
|
15
15
|
var select_toggler_constants = require('./select_toggler_constants.js');
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ exports.HSelectToggler = class HSelectToggler extends phoenix_light_lit_element.
|
|
|
32
32
|
}
|
|
33
33
|
connectedCallback() {
|
|
34
34
|
super.connectedCallback();
|
|
35
|
-
|
|
35
|
+
this.setAttribute('slot', select_constants.SELECT_SLOT_NAMES.toggler);
|
|
36
36
|
this.setAttribute('role', 'textbox');
|
|
37
37
|
this.classList.add(select_toggler_constants.SELECT_TOGGLER_CSS_CLASSES.selectToggler);
|
|
38
38
|
this._subscribeObserver();
|
|
@@ -55,19 +55,17 @@ exports.HSelectToggler = class HSelectToggler extends phoenix_light_lit_element.
|
|
|
55
55
|
${observable_directive.observe(this.selectedOptions$, (selectOptions) => {
|
|
56
56
|
var _a;
|
|
57
57
|
if (!selectOptions.length)
|
|
58
|
-
return litHtml.html
|
|
59
|
-
|
|
60
|
-
>`;
|
|
61
|
-
return litHtml.html `<ul class=${select_toggler_constants.SELECT_TOGGLER_CSS_CLASSES.selectTogglerValues}>
|
|
58
|
+
return litHtml.html `${(_a = this.getSlot(select_components_constatns.SELECT_INPUT_PLACEHOLDER_SLOT_NAME)) !== null && _a !== void 0 ? _a : 'Select'}`;
|
|
59
|
+
return litHtml.html ` <ul class=${select_toggler_constants.SELECT_TOGGLER_CSS_CLASSES.selectTogglerValues}>
|
|
62
60
|
${this.isMultiselect
|
|
63
|
-
? selectOptions.map((option) => litHtml.html
|
|
61
|
+
? selectOptions.map((option) => litHtml.html ` <li>
|
|
64
62
|
<h-tag @tag.remove=${() => this._dispatchOptionDeselect(option)}>
|
|
65
63
|
${option.content}
|
|
66
64
|
|
|
67
65
|
<h-tag-remove-button></h-tag-remove-button>
|
|
68
66
|
</h-tag>
|
|
69
67
|
</li>`)
|
|
70
|
-
: litHtml.html
|
|
68
|
+
: litHtml.html ` <li>${selectOptions[0].content}</li>`}
|
|
71
69
|
</ul>`;
|
|
72
70
|
})}
|
|
73
71
|
|
|
@@ -75,10 +73,6 @@ exports.HSelectToggler = class HSelectToggler extends phoenix_light_lit_element.
|
|
|
75
73
|
`;
|
|
76
74
|
}
|
|
77
75
|
};
|
|
78
|
-
tslib_es6.__decorate([
|
|
79
|
-
decorators.property({ attribute: true }),
|
|
80
|
-
tslib_es6.__metadata("design:type", String)
|
|
81
|
-
], exports.HSelectToggler.prototype, "placeholder", void 0);
|
|
82
76
|
tslib_es6.__decorate([
|
|
83
77
|
decorators.state(),
|
|
84
78
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -9,13 +9,14 @@ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element
|
|
|
9
9
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
10
10
|
var decorators_js = require('@lit/reactive-element/decorators.js');
|
|
11
11
|
var select_components_constatns = require('./components/select_components_constatns.js');
|
|
12
|
+
var observer = require('../../../core/classes/observer/observer.js');
|
|
12
13
|
var icon = require('../../icon/icon.js');
|
|
13
14
|
var select_constants = require('./select_constants.js');
|
|
14
|
-
var observer = require('../../../core/classes/observer/observer.js');
|
|
15
15
|
var observable_directive = require('../../../directives/observable_directive.js');
|
|
16
16
|
var select_toggler = require('./components/toggler/select_toggler.js');
|
|
17
17
|
var context_provider_controller = require('../../../core/context/context_provider_controller.js');
|
|
18
18
|
var ref_js = require('lit-html/directives/ref.js');
|
|
19
|
+
var global_constants = require('../../../global_constants.js');
|
|
19
20
|
var debounce = require('../../../../../../external/lodash/debounce.js');
|
|
20
21
|
var multi_select_controller = require('./controllers/multi_select_controller.js');
|
|
21
22
|
var select_controller = require('./controllers/select_controller.js');
|
|
@@ -27,6 +28,7 @@ var select_close_btn = require('./components/select_close_btn.js');
|
|
|
27
28
|
|
|
28
29
|
exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
29
30
|
constructor() {
|
|
31
|
+
var _a;
|
|
30
32
|
super();
|
|
31
33
|
this.multiselect = false;
|
|
32
34
|
this.opened = false;
|
|
@@ -38,9 +40,9 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
38
40
|
this._$optionsList = ref_js.createRef();
|
|
39
41
|
this._$dropdownContent = ref_js.createRef();
|
|
40
42
|
this._selectContext = new context_provider_controller.ContextProviderController(this);
|
|
41
|
-
this._setDropdownContentWidth = () => {
|
|
43
|
+
this._setDropdownContentWidth = (width) => {
|
|
42
44
|
if (this._$dropdownContent.value)
|
|
43
|
-
this._$dropdownContent.value.style.width = `${
|
|
45
|
+
this._$dropdownContent.value.style.width = `${width}px`;
|
|
44
46
|
};
|
|
45
47
|
this._handleOptionDeselect = (event) => {
|
|
46
48
|
const selectedOption = this._selectController.getSelectOption(event.detail);
|
|
@@ -72,23 +74,26 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
72
74
|
if (!this.multiselect)
|
|
73
75
|
this._closeSelect();
|
|
74
76
|
};
|
|
77
|
+
this._handleDropdownHidden = () => {
|
|
78
|
+
this._searchValue = '';
|
|
79
|
+
this.opened = false;
|
|
80
|
+
};
|
|
75
81
|
this._closeSelect = () => {
|
|
76
82
|
var _a;
|
|
77
83
|
if (!this.opened)
|
|
78
84
|
return;
|
|
79
85
|
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
80
|
-
this._searchValue = '';
|
|
81
|
-
this.opened = false;
|
|
82
86
|
};
|
|
83
87
|
this._clearOptions = () => {
|
|
84
88
|
this._selectController.deselectOptions();
|
|
85
89
|
};
|
|
86
90
|
this._handleResize = debounce['default'](() => {
|
|
87
91
|
this._closeSelect();
|
|
88
|
-
this._setDropdownContentWidth();
|
|
92
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
89
93
|
}, select_constants.SELECT_RESIZE_DEBOUNCE_TIME);
|
|
90
94
|
const $options = Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
91
95
|
$options.forEach(($option) => $option.setAttribute('slot', select_constants.SELECT_SLOT_NAMES.content));
|
|
96
|
+
this.$placeholder = (_a = this.querySelector(`[slot="${select_components_constatns.SELECT_INPUT_PLACEHOLDER_SLOT_NAME}"]`)) !== null && _a !== void 0 ? _a : 'Select';
|
|
92
97
|
}
|
|
93
98
|
updated(changedProperties) {
|
|
94
99
|
super.updated(changedProperties);
|
|
@@ -147,7 +152,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
147
152
|
}
|
|
148
153
|
firstUpdated(props) {
|
|
149
154
|
super.firstUpdated(props);
|
|
150
|
-
this._setDropdownContentWidth();
|
|
155
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
151
156
|
}
|
|
152
157
|
_setupEvents() {
|
|
153
158
|
this.addEventListener(select_constants.SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
|
|
@@ -190,6 +195,16 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
190
195
|
this._selectController.options$.unsubscribe(this._optionsObserver);
|
|
191
196
|
window.removeEventListener('resize', this._handleResize);
|
|
192
197
|
}
|
|
198
|
+
_getDropdownContentWidth() {
|
|
199
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
200
|
+
return documentWidth < global_constants.BREAKPOINTS.xs ? documentWidth : this.getBoundingClientRect().width;
|
|
201
|
+
}
|
|
202
|
+
_getClonedPlaceholderElement() {
|
|
203
|
+
return this.$placeholder instanceof HTMLElement ? this.$placeholder.cloneNode(true) : this.$placeholder;
|
|
204
|
+
}
|
|
205
|
+
_searchNoResult() {
|
|
206
|
+
return Boolean(!this._selectController.visibleOptionsCount && Object.keys(this._$options).length);
|
|
207
|
+
}
|
|
193
208
|
render() {
|
|
194
209
|
var _a;
|
|
195
210
|
const options = (_a = this._selectController.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
@@ -197,15 +212,11 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
197
212
|
<h-dropdown
|
|
198
213
|
${ref_js.ref(this._$dropdown)}
|
|
199
214
|
@dropdown.showed=${() => (this.opened = true)}
|
|
200
|
-
@dropdown.hidden=${this.
|
|
215
|
+
@dropdown.hidden=${this._handleDropdownHidden}
|
|
201
216
|
name=${this.controlName}
|
|
202
217
|
offset=${this.offset}
|
|
203
218
|
>
|
|
204
|
-
<h-dropdown-toggler name=${this.controlName}>
|
|
205
|
-
<h-select-toggler>
|
|
206
|
-
<span slot="placeholder">${this.getSlot(select_constants.SELECT_SLOT_NAMES.toggler)}</span>
|
|
207
|
-
</h-select-toggler>
|
|
208
|
-
</h-dropdown-toggler>
|
|
219
|
+
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(select_constants.SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
209
220
|
|
|
210
221
|
<h-dropdown-content class=${select_constants.SELECT_CSS_CLASSES.selectContent} ${ref_js.ref(this._$dropdownContent)} name=${this.controlName}>
|
|
211
222
|
<h-select-close-btn
|
|
@@ -213,7 +224,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
213
224
|
@selectCloseBtn.close=${this._closeSelect}
|
|
214
225
|
></h-select-close-btn>
|
|
215
226
|
|
|
216
|
-
<
|
|
227
|
+
<div class=${select_constants.SELECT_CSS_CLASSES.selectLabel}>${lit.html `${this._getClonedPlaceholderElement()}`}</div>
|
|
217
228
|
|
|
218
229
|
${options.length > select_constants.MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH
|
|
219
230
|
? lit.html ` <h-select-search
|
|
@@ -226,7 +237,9 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
226
237
|
${this.hasSlot(select_constants.SELECT_SLOT_NAMES.content)
|
|
227
238
|
? lit.html `
|
|
228
239
|
<h-options
|
|
229
|
-
class
|
|
240
|
+
class="${select_constants.SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
|
|
241
|
+
? select_constants.SELECT_CSS_CLASSES.selectOptionsEmpty
|
|
242
|
+
: ''}"
|
|
230
243
|
${ref_js.ref(this._$optionsList)}
|
|
231
244
|
@selectOptions.clicked=${this._handleOptionClicked}
|
|
232
245
|
>
|
|
@@ -234,7 +247,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
234
247
|
</h-options>
|
|
235
248
|
`
|
|
236
249
|
: lit.nothing}
|
|
237
|
-
${
|
|
250
|
+
${this._searchNoResult()
|
|
238
251
|
? lit.html ` <div>
|
|
239
252
|
<p class=${select_constants.SELECT_CSS_CLASSES.selectNoResult}>
|
|
240
253
|
Brak wyników dla: <em class=${select_constants.SELECT_CSS_CLASSES.selectSearchedPhrase}>"${this._searchValue}"</em>
|
|
@@ -246,7 +259,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
246
259
|
<section class=${select_constants.SELECT_CSS_CLASSES.selectFooter}>
|
|
247
260
|
<button class="${select_constants.SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>clear</button>
|
|
248
261
|
<h-select-close-btn class="${select_constants.SELECT_CSS_CLASSES.selectCloseButton}" @selectCloseBtn.close=${this._closeSelect}
|
|
249
|
-
>ok
|
|
262
|
+
><span slot=${select_components_constatns.SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME}>ok</span>
|
|
250
263
|
</h-select-close-btn>
|
|
251
264
|
</section>
|
|
252
265
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,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;"}
|
|
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,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;"}
|
|
@@ -24,6 +24,7 @@ const SELECT_CSS_CLASSES = {
|
|
|
24
24
|
selectDisabled: `${baseSelectClass}_disabled`,
|
|
25
25
|
selectSearch: `${baseSelectClass}__search`,
|
|
26
26
|
selectOptions: `${baseSelectClass}__options`,
|
|
27
|
+
selectOptionsEmpty: `${baseSelectClass}__options_empty`,
|
|
27
28
|
selectContent: `${baseSelectClass}__content`,
|
|
28
29
|
selectFooter: `${baseSelectClass}__footer`,
|
|
29
30
|
selectNoResult: `${baseSelectClass}__no-result`,
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -10,19 +10,27 @@ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_eleme
|
|
|
10
10
|
var icon_constants = require('./icon_constants.js');
|
|
11
11
|
var index = require('../../../external/classnames/index.js');
|
|
12
12
|
var namespaced_attribure_directive = require('../../directives/namespaced_attribure_directive.js');
|
|
13
|
+
var observer = require('../../core/classes/observer/observer.js');
|
|
14
|
+
var subject = require('../../core/classes/subject/subject.js');
|
|
13
15
|
|
|
14
16
|
var HIcon_1;
|
|
15
17
|
exports.HIcon = HIcon_1 = class HIcon extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
16
18
|
constructor() {
|
|
17
|
-
super(
|
|
19
|
+
super();
|
|
18
20
|
this.filled = false;
|
|
19
21
|
this.clickable = false;
|
|
20
22
|
this.noStroke = false;
|
|
23
|
+
this._srcObserverCallback = (src) => {
|
|
24
|
+
if (src)
|
|
25
|
+
this.requestUpdate();
|
|
26
|
+
};
|
|
27
|
+
this._srcObserver = new observer.Observer(this._srcObserverCallback);
|
|
28
|
+
HIcon_1.src.subscribe(this._srcObserver);
|
|
21
29
|
}
|
|
22
30
|
connectedCallback() {
|
|
23
31
|
var _a;
|
|
24
32
|
super.connectedCallback();
|
|
25
|
-
|
|
33
|
+
HIcon_1.src.subscribe(this._srcObserver);
|
|
26
34
|
this._cssClasses = index['default'](icon_constants.ICON_CSS_CLASSES.icon, {
|
|
27
35
|
[icon_constants.ICON_SIZES_CSS_CLASS_MAP[(_a = this.size) !== null && _a !== void 0 ? _a : '']]: Boolean(this.size),
|
|
28
36
|
[icon_constants.ICON_CSS_CLASSES.iconFilled]: this.filled,
|
|
@@ -30,15 +38,20 @@ exports.HIcon = HIcon_1 = class HIcon extends phoenix_light_lit_element.PhoenixL
|
|
|
30
38
|
[icon_constants.ICON_CSS_CLASSES.iconClickable]: this.clickable
|
|
31
39
|
});
|
|
32
40
|
}
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
HIcon_1.src.unsubscribe(this._srcObserver);
|
|
43
|
+
}
|
|
33
44
|
render() {
|
|
34
|
-
|
|
45
|
+
if (!HIcon_1.src.getValue())
|
|
46
|
+
return null;
|
|
35
47
|
return lit.html `
|
|
36
48
|
<svg class="${this._cssClasses}">
|
|
37
|
-
<use xlink:href="${namespaced_attribure_directive.namespacedAttribute('http://www.w3.org/1999/xlink', `${HIcon_1.src}#${this.iconName}`)}"></use>
|
|
49
|
+
<use xlink:href="${namespaced_attribure_directive.namespacedAttribute('http://www.w3.org/1999/xlink', `${HIcon_1.src.getValue()}#${this.iconName}`)}"></use>
|
|
38
50
|
</svg>
|
|
39
51
|
`;
|
|
40
52
|
}
|
|
41
53
|
};
|
|
54
|
+
exports.HIcon.src = new subject.Subject();
|
|
42
55
|
tslib_es6.__decorate([
|
|
43
56
|
decorators.property({ type: String, attribute: 'icon-name' }),
|
|
44
57
|
tslib_es6.__metadata("design:type", String)
|
|
@@ -60,6 +73,7 @@ tslib_es6.__decorate([
|
|
|
60
73
|
tslib_es6.__metadata("design:type", Boolean)
|
|
61
74
|
], exports.HIcon.prototype, "noStroke", void 0);
|
|
62
75
|
exports.HIcon = HIcon_1 = tslib_es6.__decorate([
|
|
63
|
-
phoenix_custom_element.phoenixCustomElement('h-icon')
|
|
76
|
+
phoenix_custom_element.phoenixCustomElement('h-icon'),
|
|
77
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
64
78
|
], exports.HIcon);
|
|
65
79
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA,oBAAoB,uCAA2C;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA,oBAAoB,uCAA2C;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -2,8 +2,8 @@ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.
|
|
|
2
2
|
import { property } 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
|
-
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
6
5
|
import { Observer } from '../../core/classes/observer/observer.js';
|
|
6
|
+
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
7
7
|
import { ACCORDION_CONTEXTS } from './accordion_constants.js';
|
|
8
8
|
import { TransitionController } from '../../controllers/transition_controller/transition_controller.js';
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.
|
|
|
2
2
|
import { property, 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
|
-
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
6
5
|
import { Observer } from '../../core/classes/observer/observer.js';
|
|
6
|
+
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
7
7
|
import { BehaviorSubject } from '../../core/classes/behavior_subject/behavior_subject.js';
|
|
8
8
|
import { ContextProviderController } from '../../core/context/context_provider_controller.js';
|
|
9
9
|
import { ACCORDION_MODE, ACCORDION_CONTEXTS, ACCORDION_EVENTS } from './accordion_constants.js';
|
|
@@ -2,8 +2,8 @@ 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 { BtnController } from '../../controllers/btn_controller/btn_controller.js';
|
|
5
|
-
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
6
5
|
import { Observer } from '../../core/classes/observer/observer.js';
|
|
6
|
+
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
7
7
|
import { ACCORDION_EVENTS, ACCORDION_CONTEXTS } from './accordion_constants.js';
|
|
8
8
|
|
|
9
9
|
let HAccordionToggler = class HAccordionToggler extends PhoenixLightLitElement {
|
|
@@ -2,6 +2,6 @@ import { TemplateResult } from 'lit';
|
|
|
2
2
|
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
3
|
export declare class HDropdownContent extends PhoenixLightLitElement {
|
|
4
4
|
name: string;
|
|
5
|
-
|
|
5
|
+
constructor();
|
|
6
6
|
protected render(): TemplateResult;
|
|
7
7
|
}
|
|
@@ -7,11 +7,8 @@ import { DROPDOWN_CONTENT_CSS_CLASS } from './dropdown_constants.js';
|
|
|
7
7
|
|
|
8
8
|
let HDropdownContent = class HDropdownContent extends PhoenixLightLitElement {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(
|
|
10
|
+
super();
|
|
11
11
|
this.name = '';
|
|
12
|
-
}
|
|
13
|
-
connectedCallback() {
|
|
14
|
-
super.connectedCallback();
|
|
15
12
|
this.classList.add(DROPDOWN_CONTENT_CSS_CLASS);
|
|
16
13
|
this.setAttribute('role', 'menu');
|
|
17
14
|
this.slot = this.hasAttribute('slot') ? this.slot : 'content';
|
|
@@ -29,7 +26,8 @@ __decorate([
|
|
|
29
26
|
__metadata("design:type", Object)
|
|
30
27
|
], HDropdownContent.prototype, "name", void 0);
|
|
31
28
|
HDropdownContent = __decorate([
|
|
32
|
-
phoenixCustomElement('h-dropdown-content')
|
|
29
|
+
phoenixCustomElement('h-dropdown-content'),
|
|
30
|
+
__metadata("design:paramtypes", [])
|
|
33
31
|
], HDropdownContent);
|
|
34
32
|
|
|
35
33
|
export { HDropdownContent };
|
|
@@ -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;
|
|
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;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import 'lit';
|
|
3
|
-
import { ContextConsumerController } from '../../../../core/context/context_consumer_controller.js';
|
|
4
3
|
import { Observer } from '../../../../core/classes/observer/observer.js';
|
|
4
|
+
import { ContextConsumerController } from '../../../../core/context/context_consumer_controller.js';
|
|
5
5
|
import { FORM_CONTROL_CONTEXTS } from './control_props_sync_controller_constants.js';
|
|
6
6
|
|
|
7
7
|
var _ControlPropsSyncConsumerController_host, _ControlPropsSyncConsumerController_contextConsumer, _ControlPropsSyncConsumerController_basePropsObservable, _ControlPropsSyncConsumerController_propsObserver, _ControlPropsSyncConsumerController_onPropsUpdated;
|
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 { ICON_SIZES_CSS_CLASS_MAP } 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
|
|
28
|
+
: html ` <h-icon size=${ICON_SIZES_CSS_CLASS_MAP.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,12 +1,12 @@
|
|
|
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
|
+
import { Observer } from '../../../../../core/classes/observer/observer.js';
|
|
6
7
|
import { html } from 'lit-html';
|
|
7
8
|
import { ContextConsumerController } from '../../../../../core/context/context_consumer_controller.js';
|
|
8
|
-
import { SELECT_EVENT_NAMES, SELECT_CONTEXTS } from '../../select_constants.js';
|
|
9
|
-
import { Observer } from '../../../../../core/classes/observer/observer.js';
|
|
9
|
+
import { SELECT_EVENT_NAMES, SELECT_SLOT_NAMES, SELECT_CONTEXTS } from '../../select_constants.js';
|
|
10
10
|
import { observe } from '../../../../../directives/observable_directive.js';
|
|
11
11
|
import { SELECT_TOGGLER_CSS_CLASSES } from './select_toggler_constants.js';
|
|
12
12
|
|
|
@@ -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,15 @@ 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
|
+
import { Observer } from '../../../core/classes/observer/observer.js';
|
|
8
9
|
import { HIcon } from '../../icon/icon.js';
|
|
9
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';
|
|
10
|
-
import { Observer } from '../../../core/classes/observer/observer.js';
|
|
11
11
|
import { observe } from '../../../directives/observable_directive.js';
|
|
12
12
|
import { HSelectToggler } from './components/toggler/select_toggler.js';
|
|
13
13
|
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
14
14
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
15
|
+
import { BREAKPOINTS } from '../../../global_constants.js';
|
|
15
16
|
import debounce_1 from '../../../../../../external/lodash/debounce.js';
|
|
16
17
|
import { MultiSelectController } from './controllers/multi_select_controller.js';
|
|
17
18
|
import { SelectController } from './controllers/select_controller.js';
|
|
@@ -23,6 +24,7 @@ import { HSelectCloseBtn } from './components/select_close_btn.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}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,16 @@ 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
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
196
|
+
return documentWidth < BREAKPOINTS.xs ? documentWidth : this.getBoundingClientRect().width;
|
|
197
|
+
}
|
|
198
|
+
_getClonedPlaceholderElement() {
|
|
199
|
+
return this.$placeholder instanceof HTMLElement ? this.$placeholder.cloneNode(true) : this.$placeholder;
|
|
200
|
+
}
|
|
201
|
+
_searchNoResult() {
|
|
202
|
+
return Boolean(!this._selectController.visibleOptionsCount && Object.keys(this._$options).length);
|
|
203
|
+
}
|
|
189
204
|
render() {
|
|
190
205
|
var _a;
|
|
191
206
|
const options = (_a = this._selectController.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
@@ -193,15 +208,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
193
208
|
<h-dropdown
|
|
194
209
|
${ref(this._$dropdown)}
|
|
195
210
|
@dropdown.showed=${() => (this.opened = true)}
|
|
196
|
-
@dropdown.hidden=${this.
|
|
211
|
+
@dropdown.hidden=${this._handleDropdownHidden}
|
|
197
212
|
name=${this.controlName}
|
|
198
213
|
offset=${this.offset}
|
|
199
214
|
>
|
|
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>
|
|
215
|
+
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
205
216
|
|
|
206
217
|
<h-dropdown-content class=${SELECT_CSS_CLASSES.selectContent} ${ref(this._$dropdownContent)} name=${this.controlName}>
|
|
207
218
|
<h-select-close-btn
|
|
@@ -209,7 +220,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
209
220
|
@selectCloseBtn.close=${this._closeSelect}
|
|
210
221
|
></h-select-close-btn>
|
|
211
222
|
|
|
212
|
-
<
|
|
223
|
+
<div class=${SELECT_CSS_CLASSES.selectLabel}>${html `${this._getClonedPlaceholderElement()}`}</div>
|
|
213
224
|
|
|
214
225
|
${options.length > MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH
|
|
215
226
|
? html ` <h-select-search
|
|
@@ -222,7 +233,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
222
233
|
${this.hasSlot(SELECT_SLOT_NAMES.content)
|
|
223
234
|
? html `
|
|
224
235
|
<h-options
|
|
225
|
-
class
|
|
236
|
+
class="${SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
|
|
237
|
+
? SELECT_CSS_CLASSES.selectOptionsEmpty
|
|
238
|
+
: ''}"
|
|
226
239
|
${ref(this._$optionsList)}
|
|
227
240
|
@selectOptions.clicked=${this._handleOptionClicked}
|
|
228
241
|
>
|
|
@@ -230,7 +243,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
230
243
|
</h-options>
|
|
231
244
|
`
|
|
232
245
|
: nothing}
|
|
233
|
-
${
|
|
246
|
+
${this._searchNoResult()
|
|
234
247
|
? html ` <div>
|
|
235
248
|
<p class=${SELECT_CSS_CLASSES.selectNoResult}>
|
|
236
249
|
Brak wyników dla: <em class=${SELECT_CSS_CLASSES.selectSearchedPhrase}>"${this._searchValue}"</em>
|
|
@@ -242,7 +255,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
242
255
|
<section class=${SELECT_CSS_CLASSES.selectFooter}>
|
|
243
256
|
<button class="${SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>clear</button>
|
|
244
257
|
<h-select-close-btn class="${SELECT_CSS_CLASSES.selectCloseButton}" @selectCloseBtn.close=${this._closeSelect}
|
|
245
|
-
>ok
|
|
258
|
+
><span slot=${SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME}>ok</span>
|
|
246
259
|
</h-select-close-btn>
|
|
247
260
|
</section>
|
|
248
261
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,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;"}
|
|
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;"}
|
|
@@ -19,6 +19,7 @@ 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";
|
|
23
24
|
readonly selectFooter: "select__footer";
|
|
24
25
|
readonly selectNoResult: "select__no-result";
|
|
@@ -20,6 +20,7 @@ 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`,
|
|
24
25
|
selectFooter: `${baseSelectClass}__footer`,
|
|
25
26
|
selectNoResult: `${baseSelectClass}__no-result`,
|
|
@@ -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;"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { TIconSize } from "./icon_constants";
|
|
3
3
|
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
4
|
+
import { Subject } from "../../core/classes/subject/subject";
|
|
4
5
|
export declare class HIcon extends PhoenixLightLitElement {
|
|
5
|
-
static src: string
|
|
6
|
+
static src: Subject<string>;
|
|
6
7
|
iconName: string;
|
|
7
8
|
size?: TIconSize | undefined;
|
|
8
9
|
filled: boolean;
|
|
9
10
|
clickable: boolean;
|
|
10
11
|
noStroke: boolean;
|
|
11
12
|
private _cssClasses;
|
|
13
|
+
private _srcObserver;
|
|
14
|
+
constructor();
|
|
15
|
+
private _srcObserverCallback;
|
|
12
16
|
connectedCallback(): void;
|
|
13
|
-
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
protected render(): TemplateResult | null;
|
|
14
19
|
}
|
|
@@ -6,19 +6,27 @@ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_eleme
|
|
|
6
6
|
import { ICON_CSS_CLASSES, ICON_SIZES_CSS_CLASS_MAP } from './icon_constants.js';
|
|
7
7
|
import classnames from '../../../external/classnames/index.js';
|
|
8
8
|
import { namespacedAttribute } from '../../directives/namespaced_attribure_directive.js';
|
|
9
|
+
import { Observer } from '../../core/classes/observer/observer.js';
|
|
10
|
+
import { Subject } from '../../core/classes/subject/subject.js';
|
|
9
11
|
|
|
10
12
|
var HIcon_1;
|
|
11
13
|
let HIcon = HIcon_1 = class HIcon extends PhoenixLightLitElement {
|
|
12
14
|
constructor() {
|
|
13
|
-
super(
|
|
15
|
+
super();
|
|
14
16
|
this.filled = false;
|
|
15
17
|
this.clickable = false;
|
|
16
18
|
this.noStroke = false;
|
|
19
|
+
this._srcObserverCallback = (src) => {
|
|
20
|
+
if (src)
|
|
21
|
+
this.requestUpdate();
|
|
22
|
+
};
|
|
23
|
+
this._srcObserver = new Observer(this._srcObserverCallback);
|
|
24
|
+
HIcon_1.src.subscribe(this._srcObserver);
|
|
17
25
|
}
|
|
18
26
|
connectedCallback() {
|
|
19
27
|
var _a;
|
|
20
28
|
super.connectedCallback();
|
|
21
|
-
|
|
29
|
+
HIcon_1.src.subscribe(this._srcObserver);
|
|
22
30
|
this._cssClasses = classnames(ICON_CSS_CLASSES.icon, {
|
|
23
31
|
[ICON_SIZES_CSS_CLASS_MAP[(_a = this.size) !== null && _a !== void 0 ? _a : '']]: Boolean(this.size),
|
|
24
32
|
[ICON_CSS_CLASSES.iconFilled]: this.filled,
|
|
@@ -26,15 +34,20 @@ let HIcon = HIcon_1 = class HIcon extends PhoenixLightLitElement {
|
|
|
26
34
|
[ICON_CSS_CLASSES.iconClickable]: this.clickable
|
|
27
35
|
});
|
|
28
36
|
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
HIcon_1.src.unsubscribe(this._srcObserver);
|
|
39
|
+
}
|
|
29
40
|
render() {
|
|
30
|
-
|
|
41
|
+
if (!HIcon_1.src.getValue())
|
|
42
|
+
return null;
|
|
31
43
|
return html `
|
|
32
44
|
<svg class="${this._cssClasses}">
|
|
33
|
-
<use xlink:href="${namespacedAttribute('http://www.w3.org/1999/xlink', `${HIcon_1.src}#${this.iconName}`)}"></use>
|
|
45
|
+
<use xlink:href="${namespacedAttribute('http://www.w3.org/1999/xlink', `${HIcon_1.src.getValue()}#${this.iconName}`)}"></use>
|
|
34
46
|
</svg>
|
|
35
47
|
`;
|
|
36
48
|
}
|
|
37
49
|
};
|
|
50
|
+
HIcon.src = new Subject();
|
|
38
51
|
__decorate([
|
|
39
52
|
property({ type: String, attribute: 'icon-name' }),
|
|
40
53
|
__metadata("design:type", String)
|
|
@@ -56,7 +69,8 @@ __decorate([
|
|
|
56
69
|
__metadata("design:type", Boolean)
|
|
57
70
|
], HIcon.prototype, "noStroke", void 0);
|
|
58
71
|
HIcon = HIcon_1 = __decorate([
|
|
59
|
-
phoenixCustomElement('h-icon')
|
|
72
|
+
phoenixCustomElement('h-icon'),
|
|
73
|
+
__metadata("design:paramtypes", [])
|
|
60
74
|
], HIcon);
|
|
61
75
|
|
|
62
76
|
export { HIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA,uBAAuB,uCAA2C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA,uBAAuB,uCAA2C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|