@shoper/phoenix_design_system 1.1.4 → 1.1.5-1
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/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/form/controllers/props_synchronizing/control_props_sync_consumer_controller.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file.js +63 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js +146 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_constants.js +38 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_icon/file_picker_icon.js +30 -0
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_icon/file_picker_icon.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input/input_control.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 -8
- 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 +47 -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 +8 -2
- 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/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/index.js +21 -0
- package/build/cjs/packages/phoenix/src/index.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/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/form/controllers/props_synchronizing/control_props_sync_consumer_controller.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.d.ts +12 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.js +61 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.d.ts +26 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js +144 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.d.ts +24 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.js +30 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_icon/file_picker_icon.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_icon/file_picker_icon.js +28 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_icon/file_picker_icon.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/input/input_control.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.js +6 -8
- 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/select.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/form/select/select.js +48 -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 +7 -1
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js +8 -2
- 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/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/index.d.ts +3 -0
- package/build/esm/packages/phoenix/src/index.js +3 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators';
|
|
4
|
+
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
6
|
+
import classnames from '../../../../external/classnames/index.js';
|
|
7
|
+
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
8
|
+
import { FILE_PICKER_CONTROL_CSS_CLASSES, FILE_ITEM_PROPS_TO_SYNC, FILE_ITEM_EVENT_NAMES } from './file_picker_constants.js';
|
|
9
|
+
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
10
|
+
import { ifDefined } from 'lit/directives/if-defined';
|
|
11
|
+
|
|
12
|
+
let HFilePicker = class HFilePicker extends PhoenixLightLitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this._$fileInputRef = createRef();
|
|
16
|
+
this._handleChangeEvent = (event) => {
|
|
17
|
+
this.fileName = this._getFileName(event);
|
|
18
|
+
this.classList.add(FILE_PICKER_CONTROL_CSS_CLASSES.filePickerHasValue);
|
|
19
|
+
};
|
|
20
|
+
this._getFileName = (event) => {
|
|
21
|
+
const targetElement = event.currentTarget;
|
|
22
|
+
const fileList = targetElement.files;
|
|
23
|
+
return fileList[0].name;
|
|
24
|
+
};
|
|
25
|
+
this._removeFileItem = (event) => {
|
|
26
|
+
const { containerId } = event.detail;
|
|
27
|
+
const $fileInput = this._$fileInputRef.value;
|
|
28
|
+
if (this.controlId === containerId) {
|
|
29
|
+
this.fileName = '';
|
|
30
|
+
if ($fileInput)
|
|
31
|
+
$fileInput.value = '';
|
|
32
|
+
}
|
|
33
|
+
this.classList.remove(FILE_PICKER_CONTROL_CSS_CLASSES.filePickerHasValue);
|
|
34
|
+
};
|
|
35
|
+
new ControlPropsSyncProviderController({
|
|
36
|
+
host: this,
|
|
37
|
+
propsToSync: [...Object.values(FILE_ITEM_PROPS_TO_SYNC)]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
this._addEventListeners();
|
|
43
|
+
this.classList.add(FILE_PICKER_CONTROL_CSS_CLASSES.filePicker);
|
|
44
|
+
const cssClasses = classnames({
|
|
45
|
+
[FILE_PICKER_CONTROL_CSS_CLASSES.filePickerDisabled]: this.disabled,
|
|
46
|
+
[FILE_PICKER_CONTROL_CSS_CLASSES.filePickerRequired]: this.required,
|
|
47
|
+
[FILE_PICKER_CONTROL_CSS_CLASSES.filePickerError]: this.error
|
|
48
|
+
});
|
|
49
|
+
if (cssClasses)
|
|
50
|
+
this.classList.add(cssClasses);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
super.disconnectedCallback();
|
|
54
|
+
this._removeEventListeners();
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
super.render();
|
|
58
|
+
return html `
|
|
59
|
+
<input
|
|
60
|
+
${ref(this._$fileInputRef)}
|
|
61
|
+
type="file"
|
|
62
|
+
class="${FILE_PICKER_CONTROL_CSS_CLASSES.filePickerInput}"
|
|
63
|
+
id="${ifDefined(this.controlId)}"
|
|
64
|
+
name="${ifDefined(this.controlName)}"
|
|
65
|
+
value="${ifDefined(this.value)}"
|
|
66
|
+
?disabled="${this.disabled}"
|
|
67
|
+
?required="${this.required}"
|
|
68
|
+
accept="${ifDefined(this.formats)}"
|
|
69
|
+
@change="${this._handleChangeEvent}"
|
|
70
|
+
hidden
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
${!this.fileName
|
|
74
|
+
? html `<label class="${FILE_PICKER_CONTROL_CSS_CLASSES.filePickerLabel}" for="${ifDefined(this.controlId)}">
|
|
75
|
+
${this.labelIconName ? html ` <h-file-picker-icon name="${this.labelIconName}" />` : nothing}
|
|
76
|
+
${this.labelText}
|
|
77
|
+
</label>`
|
|
78
|
+
: nothing}
|
|
79
|
+
|
|
80
|
+
${this.fileName ? html `<h-file name="${this.fileName}" container-id="${this.controlId}" />` : nothing}
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
_addEventListeners() {
|
|
84
|
+
document.addEventListener(FILE_ITEM_EVENT_NAMES.removed, this._removeFileItem);
|
|
85
|
+
}
|
|
86
|
+
_removeEventListeners() {
|
|
87
|
+
document.removeEventListener(FILE_ITEM_EVENT_NAMES.removed, this._removeFileItem);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: String, attribute: 'control-id', reflect: true }),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], HFilePicker.prototype, "controlId", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
property({ type: String, attribute: 'control-name' }),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], HFilePicker.prototype, "controlName", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: Boolean }),
|
|
100
|
+
__metadata("design:type", Boolean)
|
|
101
|
+
], HFilePicker.prototype, "disabled", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean }),
|
|
104
|
+
__metadata("design:type", Boolean)
|
|
105
|
+
], HFilePicker.prototype, "required", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: Boolean }),
|
|
108
|
+
__metadata("design:type", Boolean)
|
|
109
|
+
], HFilePicker.prototype, "error", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: String }),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], HFilePicker.prototype, "value", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: String, attribute: 'label-text' }),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], HFilePicker.prototype, "labelText", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: String, attribute: 'label-icon-name' }),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], HFilePicker.prototype, "labelIconName", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: String, attribute: 'remove-button-text' }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], HFilePicker.prototype, "removeButtonText", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
property({ type: String, attribute: 'remove-button-icon-name' }),
|
|
128
|
+
__metadata("design:type", String)
|
|
129
|
+
], HFilePicker.prototype, "removeButtonIconName", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
property({ type: String }),
|
|
132
|
+
__metadata("design:type", String)
|
|
133
|
+
], HFilePicker.prototype, "formats", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
state(),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], HFilePicker.prototype, "fileName", void 0);
|
|
138
|
+
HFilePicker = __decorate([
|
|
139
|
+
phoenixCustomElement('h-file-picker'),
|
|
140
|
+
__metadata("design:paramtypes", [])
|
|
141
|
+
], HFilePicker);
|
|
142
|
+
|
|
143
|
+
export { HFilePicker };
|
|
144
|
+
//# sourceMappingURL=file_picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA,uBAAuB,0CAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const FILE_ITEM_CSS_CLASSES: {
|
|
2
|
+
readonly file: "file";
|
|
3
|
+
readonly fileName: "file__name";
|
|
4
|
+
readonly fileRemoveButton: "file__remove-button";
|
|
5
|
+
};
|
|
6
|
+
export declare const FILE_ITEM_EVENT_NAMES: {
|
|
7
|
+
readonly removed: "fileItemRemoved";
|
|
8
|
+
};
|
|
9
|
+
export declare const FILE_ITEM_PROPS_TO_SYNC: {
|
|
10
|
+
readonly removeButtonText: "removeButtonText";
|
|
11
|
+
readonly removeButtonIconName: "removeButtonIconName";
|
|
12
|
+
};
|
|
13
|
+
export declare const FILE_PICKER_CONTROL_CSS_CLASSES: {
|
|
14
|
+
readonly filePicker: "file-picker";
|
|
15
|
+
readonly filePickerDisabled: "file-picker_disabled";
|
|
16
|
+
readonly filePickerRequired: "file-picker_required";
|
|
17
|
+
readonly filePickerError: "file-picker_error";
|
|
18
|
+
readonly filePickerHasValue: "file-picker_has-value";
|
|
19
|
+
readonly filePickerInput: "file-picker__input";
|
|
20
|
+
readonly filePickerLabel: "file-picker__label";
|
|
21
|
+
};
|
|
22
|
+
export declare const FILE_PICKER_ICON_CSS_CLASSES: {
|
|
23
|
+
readonly filePickerIcon: "file-picker-icon";
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const baseFileItemClass = 'file';
|
|
2
|
+
const FILE_ITEM_CSS_CLASSES = {
|
|
3
|
+
file: baseFileItemClass,
|
|
4
|
+
fileName: `${baseFileItemClass}__name`,
|
|
5
|
+
fileRemoveButton: `${baseFileItemClass}__remove-button`
|
|
6
|
+
};
|
|
7
|
+
const FILE_ITEM_EVENT_NAMES = {
|
|
8
|
+
removed: 'fileItemRemoved'
|
|
9
|
+
};
|
|
10
|
+
const FILE_ITEM_PROPS_TO_SYNC = {
|
|
11
|
+
removeButtonText: 'removeButtonText',
|
|
12
|
+
removeButtonIconName: 'removeButtonIconName'
|
|
13
|
+
};
|
|
14
|
+
const baseFilePickerControlClass = 'file-picker';
|
|
15
|
+
const FILE_PICKER_CONTROL_CSS_CLASSES = {
|
|
16
|
+
filePicker: baseFilePickerControlClass,
|
|
17
|
+
filePickerDisabled: `${baseFilePickerControlClass}_disabled`,
|
|
18
|
+
filePickerRequired: `${baseFilePickerControlClass}_required`,
|
|
19
|
+
filePickerError: `${baseFilePickerControlClass}_error`,
|
|
20
|
+
filePickerHasValue: `${baseFilePickerControlClass}_has-value`,
|
|
21
|
+
filePickerInput: `${baseFilePickerControlClass}__input`,
|
|
22
|
+
filePickerLabel: `${baseFilePickerControlClass}__label`
|
|
23
|
+
};
|
|
24
|
+
const baseFilePickerIconClass = 'file-picker-icon';
|
|
25
|
+
const FILE_PICKER_ICON_CSS_CLASSES = {
|
|
26
|
+
filePickerIcon: baseFilePickerIconClass
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { FILE_ITEM_CSS_CLASSES, FILE_ITEM_EVENT_NAMES, FILE_ITEM_PROPS_TO_SYNC, FILE_PICKER_CONTROL_CSS_CLASSES, FILE_PICKER_ICON_CSS_CLASSES };
|
|
30
|
+
//# sourceMappingURL=file_picker_constants.js.map
|
package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { PhoenixLightLitElement } from "../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
+
export declare class HFilePickerIcon extends PhoenixLightLitElement {
|
|
4
|
+
iconName: string;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
protected render(): TemplateResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators';
|
|
4
|
+
import { PhoenixLightLitElement } from '../../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
|
+
import { phoenixCustomElement } from '../../../../core/decorators/phoenix_custom_element.js';
|
|
6
|
+
import { ICON_CSS_CLASSES } from '../../../icon/icon_constants.js';
|
|
7
|
+
import { FILE_PICKER_ICON_CSS_CLASSES } from '../file_picker_constants.js';
|
|
8
|
+
|
|
9
|
+
let HFilePickerIcon = class HFilePickerIcon extends PhoenixLightLitElement {
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback();
|
|
12
|
+
this.classList.add(FILE_PICKER_ICON_CSS_CLASSES.filePickerIcon, ICON_CSS_CLASSES.icon);
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
super.render();
|
|
16
|
+
return html ` <h-icon icon-name=${this.iconName}></h-icon> `;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
property({ type: String }),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], HFilePickerIcon.prototype, "iconName", void 0);
|
|
23
|
+
HFilePickerIcon = __decorate([
|
|
24
|
+
phoenixCustomElement('h-file-picker-icon')
|
|
25
|
+
], HFilePickerIcon);
|
|
26
|
+
|
|
27
|
+
export { HFilePickerIcon };
|
|
28
|
+
//# sourceMappingURL=file_picker_icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,kDAAsD;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file_picker_types.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/file_picker/file_picker_types.ts"],"names":[],"mappings":""}
|
|
@@ -3,9 +3,9 @@ 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
5
|
import classnames from '../../../../external/classnames/index.js';
|
|
6
|
-
import { INPUT_CONTROL_TYPES, INPUT_PROPS_TO_SYNC, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
7
6
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
8
7
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
8
|
+
import { INPUT_CONTROL_TYPES, INPUT_PROPS_TO_SYNC, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
9
9
|
|
|
10
10
|
let HInput = class HInput extends PhoenixLightLitElement {
|
|
11
11
|
constructor() {
|
|
@@ -3,8 +3,8 @@ import { html } from 'lit';
|
|
|
3
3
|
import { property } 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
|
-
import { INPUT_CONTROL_TYPES, INPUT_CONTROL_EVENTS, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
7
6
|
import { ControlPropsSyncConsumerController } from '../controllers/props_synchronizing/control_props_sync_consumer_controller.js';
|
|
7
|
+
import { INPUT_CONTROL_TYPES, INPUT_CONTROL_EVENTS, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
8
8
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
9
9
|
|
|
10
10
|
let HInputControl = class HInputControl extends PhoenixLightLitElement {
|
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
|
|
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.js
CHANGED
|
@@ -3,10 +3,10 @@ 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
9
|
import { SELECT_EVENT_NAMES, SELECT_SLOT_NAMES, SELECT_CONTEXTS } from '../../select_constants.js';
|
|
9
|
-
import { Observer } from '../../../../../core/classes/observer/observer.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
|
-
this.setAttribute('slot', SELECT_SLOT_NAMES.
|
|
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
|
|
|
@@ -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,13 +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
|
+
import { HSelectToggler } from './components/toggler/select_toggler.js';
|
|
12
13
|
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
13
14
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
15
|
+
import { BREAKPOINTS } from '../../../global_constants.js';
|
|
14
16
|
import debounce_1 from '../../../../../../external/lodash/debounce.js';
|
|
15
17
|
import { MultiSelectController } from './controllers/multi_select_controller.js';
|
|
16
18
|
import { SelectController } from './controllers/select_controller.js';
|
|
@@ -22,6 +24,7 @@ import { HSelectCloseBtn } from './components/select_close_btn.js';
|
|
|
22
24
|
|
|
23
25
|
let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
24
26
|
constructor() {
|
|
27
|
+
var _a;
|
|
25
28
|
super();
|
|
26
29
|
this.multiselect = false;
|
|
27
30
|
this.opened = false;
|
|
@@ -33,9 +36,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
33
36
|
this._$optionsList = createRef();
|
|
34
37
|
this._$dropdownContent = createRef();
|
|
35
38
|
this._selectContext = new ContextProviderController(this);
|
|
36
|
-
this._setDropdownContentWidth = () => {
|
|
39
|
+
this._setDropdownContentWidth = (width) => {
|
|
37
40
|
if (this._$dropdownContent.value)
|
|
38
|
-
this._$dropdownContent.value.style.width = `${
|
|
41
|
+
this._$dropdownContent.value.style.width = `${width !== null && width !== void 0 ? width : ''}px`;
|
|
39
42
|
};
|
|
40
43
|
this._handleOptionDeselect = (event) => {
|
|
41
44
|
const selectedOption = this._selectController.getSelectOption(event.detail);
|
|
@@ -67,23 +70,26 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
67
70
|
if (!this.multiselect)
|
|
68
71
|
this._closeSelect();
|
|
69
72
|
};
|
|
73
|
+
this._handleDropdownHidden = () => {
|
|
74
|
+
this._searchValue = '';
|
|
75
|
+
this.opened = false;
|
|
76
|
+
};
|
|
70
77
|
this._closeSelect = () => {
|
|
71
78
|
var _a;
|
|
72
79
|
if (!this.opened)
|
|
73
80
|
return;
|
|
74
81
|
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
75
|
-
this._searchValue = '';
|
|
76
|
-
this.opened = false;
|
|
77
82
|
};
|
|
78
83
|
this._clearOptions = () => {
|
|
79
84
|
this._selectController.deselectOptions();
|
|
80
85
|
};
|
|
81
86
|
this._handleResize = debounce_1(() => {
|
|
82
87
|
this._closeSelect();
|
|
83
|
-
this._setDropdownContentWidth();
|
|
88
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
84
89
|
}, SELECT_RESIZE_DEBOUNCE_TIME);
|
|
85
90
|
const $options = Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
86
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';
|
|
87
93
|
}
|
|
88
94
|
updated(changedProperties) {
|
|
89
95
|
super.updated(changedProperties);
|
|
@@ -142,7 +148,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
142
148
|
}
|
|
143
149
|
firstUpdated(props) {
|
|
144
150
|
super.firstUpdated(props);
|
|
145
|
-
this._setDropdownContentWidth();
|
|
151
|
+
this._setDropdownContentWidth(this._getDropdownContentWidth());
|
|
146
152
|
}
|
|
147
153
|
_setupEvents() {
|
|
148
154
|
this.addEventListener(SELECT_EVENT_NAMES.deselectOption, this._handleOptionDeselect);
|
|
@@ -185,6 +191,15 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
185
191
|
this._selectController.options$.unsubscribe(this._optionsObserver);
|
|
186
192
|
window.removeEventListener('resize', this._handleResize);
|
|
187
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
|
+
}
|
|
188
203
|
render() {
|
|
189
204
|
var _a;
|
|
190
205
|
const options = (_a = this._selectController.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
@@ -192,17 +207,26 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
192
207
|
<h-dropdown
|
|
193
208
|
${ref(this._$dropdown)}
|
|
194
209
|
@dropdown.showed=${() => (this.opened = true)}
|
|
195
|
-
@dropdown.hidden=${this.
|
|
210
|
+
@dropdown.hidden=${this._handleDropdownHidden}
|
|
196
211
|
name=${this.controlName}
|
|
197
212
|
offset=${this.offset}
|
|
198
213
|
>
|
|
199
|
-
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.
|
|
214
|
+
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
215
|
+
|
|
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
|
+
>
|
|
221
|
+
<h-select-close-btn
|
|
222
|
+
class="${SELECT_CSS_CLASSES.selectCloseMobileButton}"
|
|
223
|
+
@selectCloseBtn.close=${this._closeSelect}
|
|
224
|
+
></h-select-close-btn>
|
|
200
225
|
|
|
201
|
-
|
|
202
|
-
<h-select-close-btn @selectCloseBtn.close=${this._closeSelect}></h-select-close-btn>
|
|
226
|
+
<div class=${SELECT_CSS_CLASSES.selectLabel}>${html `${this._getClonedPlaceholderElement()}`}</div>
|
|
203
227
|
|
|
204
228
|
${options.length > MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH
|
|
205
|
-
? html
|
|
229
|
+
? html ` <h-select-search
|
|
206
230
|
class=${SELECT_CSS_CLASSES.selectSearch}
|
|
207
231
|
${ref(this._$search)}
|
|
208
232
|
.value=${this._searchValue}
|
|
@@ -212,7 +236,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
212
236
|
${this.hasSlot(SELECT_SLOT_NAMES.content)
|
|
213
237
|
? html `
|
|
214
238
|
<h-options
|
|
215
|
-
class
|
|
239
|
+
class="${SELECT_CSS_CLASSES.selectOptions} ${this._searchNoResult()
|
|
240
|
+
? SELECT_CSS_CLASSES.selectOptionsEmpty
|
|
241
|
+
: ''}"
|
|
216
242
|
${ref(this._$optionsList)}
|
|
217
243
|
@selectOptions.clicked=${this._handleOptionClicked}
|
|
218
244
|
>
|
|
@@ -220,8 +246,8 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
220
246
|
</h-options>
|
|
221
247
|
`
|
|
222
248
|
: nothing}
|
|
223
|
-
${
|
|
224
|
-
? html
|
|
249
|
+
${this._searchNoResult()
|
|
250
|
+
? html ` <div>
|
|
225
251
|
<p class=${SELECT_CSS_CLASSES.selectNoResult}>
|
|
226
252
|
Brak wyników dla: <em class=${SELECT_CSS_CLASSES.selectSearchedPhrase}>"${this._searchValue}"</em>
|
|
227
253
|
</p>
|
|
@@ -230,10 +256,10 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
230
256
|
${this.multiselect && this._selectController.selectedOptionsCount >= 1
|
|
231
257
|
? html `
|
|
232
258
|
<section class=${SELECT_CSS_CLASSES.selectFooter}>
|
|
233
|
-
<button class="
|
|
234
|
-
<h-select-close-btn class="
|
|
235
|
-
>ok</
|
|
236
|
-
>
|
|
259
|
+
<button class="${SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>clear</button>
|
|
260
|
+
<h-select-close-btn class="${SELECT_CSS_CLASSES.selectCloseButton}" @selectCloseBtn.close=${this._closeSelect}
|
|
261
|
+
><span slot=${SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME}>ok</span>
|
|
262
|
+
</h-select-close-btn>
|
|
237
263
|
</section>
|
|
238
264
|
`
|
|
239
265
|
: nothing}
|
|
@@ -247,7 +273,8 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
247
273
|
HSelect._components = {
|
|
248
274
|
search: HSelectSearch,
|
|
249
275
|
icon: HIcon,
|
|
250
|
-
closeBtn: HSelectCloseBtn
|
|
276
|
+
closeBtn: HSelectCloseBtn,
|
|
277
|
+
toggler: HSelectToggler
|
|
251
278
|
};
|
|
252
279
|
__decorate([
|
|
253
280
|
property({ type: String }),
|
|
@@ -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,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;"}
|
|
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;"}
|
|
@@ -4,7 +4,7 @@ export declare const SELECT_CONTEXTS: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const SELECT_SLOT_NAMES: {
|
|
6
6
|
readonly content: "content";
|
|
7
|
-
readonly
|
|
7
|
+
readonly toggler: "toggler";
|
|
8
8
|
};
|
|
9
9
|
export declare const SELECT_EVENT_NAMES: {
|
|
10
10
|
readonly selectOption: "selectOption.select";
|
|
@@ -19,8 +19,14 @@ 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";
|
|
28
|
+
readonly selectCloseMobileButton: "select__close-mobile-btn";
|
|
29
|
+
readonly selectClearButton: "select__clear-btn";
|
|
30
|
+
readonly selectCloseButton: "select__close-btn";
|
|
31
|
+
readonly selectLabel: "select__label";
|
|
26
32
|
};
|