@shoper/phoenix_design_system 1.2.0-4 → 1.2.0-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/packages/phoenix/src/components/form/select/components/option/select_option.js +5 -6
- package/build/cjs/packages/phoenix/src/components/form/select/components/option/select_option.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/base_select_controller.js +13 -13
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/multi_select_controller.js +6 -6
- package/build/cjs/packages/phoenix/src/components/form/select/controllers/select_controller.js +2 -2
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +79 -23
- 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 +5 -0
- package/build/cjs/packages/phoenix/src/components/form/select/select_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select_utils.js +6 -0
- package/build/cjs/packages/phoenix/src/components/form/select/select_utils.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +1 -1
- package/build/cjs/packages/phoenix/src/index.js +0 -21
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_input.d.ts +9 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_input.js +49 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_input.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.d.ts +19 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.js +93 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.d.ts +11 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js +12 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_types.js +3 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/stepper_action_button.d.ts +8 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/stepper_action_button.js +35 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/stepper_action_button.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.d.ts +2 -1
- package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.js +5 -6
- package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/controllers/base_select_controller.d.ts +10 -10
- package/build/esm/packages/phoenix/src/components/form/select/controllers/base_select_controller.js +13 -13
- package/build/esm/packages/phoenix/src/components/form/select/controllers/multi_select_controller.d.ts +3 -3
- package/build/esm/packages/phoenix/src/components/form/select/controllers/multi_select_controller.js +6 -6
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_controller.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_controller.js +2 -2
- package/build/esm/packages/phoenix/src/components/form/select/controllers/select_controllers_types.d.ts +9 -9
- package/build/esm/packages/phoenix/src/components/form/select/select.d.ts +16 -3
- package/build/esm/packages/phoenix/src/components/form/select/select.js +80 -24
- 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 +4 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js +5 -1
- package/build/esm/packages/phoenix/src/components/form/select/select_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select_types.d.ts +2 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_utils.d.ts +2 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_utils.js +6 -0
- package/build/esm/packages/phoenix/src/components/form/select/select_utils.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.js +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +0 -3
- package/build/esm/packages/phoenix/src/index.js +0 -3
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +2 -2
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file.js +0 -67
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file_model.js +0 -18
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file/file_model.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js +0 -177
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_constants.js +0 -37
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_constants.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_label.js +0 -59
- package/build/cjs/packages/phoenix/src/components/form/file_picker/file_picker_label.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.d.ts +0 -12
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.js +0 -65
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file_model.d.ts +0 -9
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file_model.js +0 -14
- package/build/esm/packages/phoenix/src/components/form/file_picker/file/file_model.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.d.ts +0 -31
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js +0 -175
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.d.ts +0 -29
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.js +0 -29
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_label.d.ts +0 -13
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_label.js +0 -57
- package/build/esm/packages/phoenix/src/components/form/file_picker/file_picker_label.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_stepper.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/input_stepper/input_stepper.ts"],"names":[],"mappings":"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"}
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const INPUT_STEPPER_EVENT_NAMES: {
|
|
2
|
+
readonly change: "inputStepper.change";
|
|
3
|
+
readonly valueChanged: "inputStepper.valueChanged";
|
|
4
|
+
};
|
|
5
|
+
export declare const DISPLAY_INPUT_EVENT_NAMES: {
|
|
6
|
+
readonly change: "displayInput.change";
|
|
7
|
+
};
|
|
8
|
+
export declare const INPUT_STEPPER_ACTION_TYPES: {
|
|
9
|
+
readonly increment: "increment";
|
|
10
|
+
readonly decrement: "decrement";
|
|
11
|
+
};
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const INPUT_STEPPER_EVENT_NAMES = {
|
|
2
|
+
change: 'inputStepper.change',
|
|
3
|
+
valueChanged: 'inputStepper.valueChanged'
|
|
4
|
+
};
|
|
5
|
+
export const DISPLAY_INPUT_EVENT_NAMES = {
|
|
6
|
+
change: 'displayInput.change'
|
|
7
|
+
};
|
|
8
|
+
export const INPUT_STEPPER_ACTION_TYPES = {
|
|
9
|
+
increment: 'increment',
|
|
10
|
+
decrement: 'decrement'
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=input_stepper_constants.js.map
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_stepper_constants.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/input_stepper/input_stepper_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,MAAM,EAAE,qBAAqB;IAC7B,YAAY,EAAE,2BAA2B;CACnC,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,MAAM,EAAE,qBAAqB;CACvB,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;CAChB,CAAC"}
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_stepper_types.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/input_stepper/input_stepper_types.ts"],"names":[],"mappings":"AAAA,OAAoB,aAAa,CAAC;AAClC,OAA2C,2BAA2B,CAAC"}
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/stepper_action_button.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
import type { TInputStepperAction } from './input_stepper_types';
|
|
3
|
+
export declare class HStepperActionButton extends PhoenixLightLitElement {
|
|
4
|
+
action: TInputStepperAction;
|
|
5
|
+
constructor();
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
private _dispatchChangeEvent;
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { BtnController } from '@phoenixRoot/controllers/btn_controller/btn_controller';
|
|
3
|
+
import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
|
|
4
|
+
import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
|
|
5
|
+
import { property } from 'lit/decorators';
|
|
6
|
+
import { INPUT_STEPPER_EVENT_NAMES } from './input_stepper_constants';
|
|
7
|
+
let HStepperActionButton = class HStepperActionButton extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this._dispatchChangeEvent = () => {
|
|
11
|
+
const unitaryValueChangeEvent = new CustomEvent(INPUT_STEPPER_EVENT_NAMES.change, {
|
|
12
|
+
bubbles: true,
|
|
13
|
+
detail: {
|
|
14
|
+
action: this.action
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
this.dispatchEvent(unitaryValueChangeEvent);
|
|
18
|
+
};
|
|
19
|
+
new BtnController(this, this._dispatchChangeEvent);
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
super.connectedCallback();
|
|
23
|
+
this.addEventListener('click', this._dispatchChangeEvent);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
property({ type: String, attribute: 'action', reflect: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], HStepperActionButton.prototype, "action", void 0);
|
|
30
|
+
HStepperActionButton = __decorate([
|
|
31
|
+
phoenixCustomElement('h-stepper-action-button'),
|
|
32
|
+
__metadata("design:paramtypes", [])
|
|
33
|
+
], HStepperActionButton);
|
|
34
|
+
export { HStepperActionButton };
|
|
35
|
+
//# sourceMappingURL=stepper_action_button.js.map
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/stepper_action_button.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper_action_button.js","sourceRoot":"","sources":["../../../../../../../../src/components/form/input_stepper/stepper_action_button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAItE,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,sBAAsB;IAI5D;QACI,KAAK,EAAE,CAAC;QASJ,yBAAoB,GAAG,GAAS,EAAE;YACtC,MAAM,uBAAuB,GAAG,IAAI,WAAW,CAAC,yBAAyB,CAAC,MAAM,EAAE;gBAC9E,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;iBACtB;aACJ,CAAC,CAAC;YACH,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;QAChD,CAAC,CAAC;QAhBE,IAAI,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACvD,CAAC;IAEM,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC9D,CAAC;CAWJ,CAAA;AArBG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDACnC;AAFnB,oBAAoB;IADhC,oBAAoB,CAAC,yBAAyB,CAAC;;GACnC,oBAAoB,CAuBhC;SAvBY,oBAAoB"}
|
package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
import { PropertyValues } from '@lit/reactive-element';
|
|
2
3
|
export declare class HOption extends PhoenixLightLitElement {
|
|
3
4
|
value: string;
|
|
4
5
|
selected: boolean;
|
|
@@ -9,7 +10,7 @@ export declare class HOption extends PhoenixLightLitElement {
|
|
|
9
10
|
connectedCallback(): void;
|
|
10
11
|
private _setupEvents;
|
|
11
12
|
private _dispatchClickedEvent;
|
|
12
|
-
|
|
13
|
+
updated(changedProperties: PropertyValues): void;
|
|
13
14
|
private _addSelectedIcon;
|
|
14
15
|
private _removeSelectedIcon;
|
|
15
16
|
}
|
package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.js
CHANGED
|
@@ -5,6 +5,7 @@ import { property } from '@lit/reactive-element/decorators.js';
|
|
|
5
5
|
import { SELECT_OPTION_EVENT_NAMES, SELECT_RELATED_COMPONENTS_NAMES } from '../select_components_constatns.js';
|
|
6
6
|
import { BtnController } from '../../../../../controllers/btn_controller/btn_controller.js';
|
|
7
7
|
import { SELECT_OPTION_CSS_CLASSES } from './select_option_constants.js';
|
|
8
|
+
import '@lit/reactive-element';
|
|
8
9
|
|
|
9
10
|
let HOption = class HOption extends PhoenixLightLitElement {
|
|
10
11
|
constructor() {
|
|
@@ -33,12 +34,10 @@ let HOption = class HOption extends PhoenixLightLitElement {
|
|
|
33
34
|
_setupEvents() {
|
|
34
35
|
this.addEventListener('click', this._dispatchClickedEvent);
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
super.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.selected ? this._addSelectedIcon() : this._removeSelectedIcon();
|
|
41
|
-
}
|
|
37
|
+
updated(changedProperties) {
|
|
38
|
+
super.updated(changedProperties);
|
|
39
|
+
if (changedProperties.has('selected'))
|
|
40
|
+
this.selected ? this._addSelectedIcon() : this._removeSelectedIcon();
|
|
42
41
|
}
|
|
43
42
|
_addSelectedIcon() {
|
|
44
43
|
this._$checkedIcon = document.createElement('h-icon');
|
package/build/esm/packages/phoenix/src/components/form/select/components/option/select_option.js.map
CHANGED
|
@@ -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;
|
|
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;"}
|
|
@@ -13,15 +13,15 @@ export declare abstract class BaseSelectController implements ISelectController,
|
|
|
13
13
|
constructor({ host }: SelectControllerConstructorOptions);
|
|
14
14
|
private _setupComputedStateObserver;
|
|
15
15
|
private _calculateValuesRelatedToOptions;
|
|
16
|
-
|
|
17
|
-
abstract
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
protected
|
|
25
|
-
|
|
16
|
+
toggle(option: SelectOption): void;
|
|
17
|
+
abstract select(option: SelectOption): void;
|
|
18
|
+
remove(optionValue: string): void;
|
|
19
|
+
add(option: SelectOption, position?: number): void;
|
|
20
|
+
replace(options: SelectOption[]): void;
|
|
21
|
+
deselectAll(): void;
|
|
22
|
+
deselect(option: SelectOption): void;
|
|
23
|
+
filter(value: string): void;
|
|
24
|
+
protected requestUpdate(): void;
|
|
25
|
+
getOption(selectValue: string): SelectOption | undefined;
|
|
26
26
|
hostConnected(): void;
|
|
27
27
|
}
|
package/build/esm/packages/phoenix/src/components/form/select/controllers/base_select_controller.js
CHANGED
|
@@ -25,16 +25,16 @@ class BaseSelectController {
|
|
|
25
25
|
this._optionsObserver = new Observer(this._calculateValuesRelatedToOptions);
|
|
26
26
|
this.options$.subscribe(this._optionsObserver);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
option.selected ? this.
|
|
28
|
+
toggle(option) {
|
|
29
|
+
option.selected ? this.deselect(option) : this.select(option);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
remove(optionValue) {
|
|
32
32
|
const options = this.options$.getValue();
|
|
33
33
|
if (!options)
|
|
34
34
|
return;
|
|
35
35
|
this.options$.notify(options.filter((option) => option.value !== optionValue));
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
add(option, position) {
|
|
38
38
|
var _a;
|
|
39
39
|
const options = (_a = this.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
40
40
|
if (position === undefined) {
|
|
@@ -44,22 +44,22 @@ class BaseSelectController {
|
|
|
44
44
|
}
|
|
45
45
|
this.options$.notify([...options.slice(0, position - 1), option, ...options.slice(position - 1)]);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
replace(options) {
|
|
48
48
|
this.options$.notify(options);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
deselectAll() {
|
|
51
51
|
var _a;
|
|
52
52
|
(_a = this.options$.getValue()) === null || _a === void 0 ? void 0 : _a.forEach((option) => (option.selected = false));
|
|
53
53
|
this.selectedOptions$.notify([]);
|
|
54
|
-
this.
|
|
54
|
+
this.requestUpdate();
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
deselect(option) {
|
|
57
57
|
var _a;
|
|
58
58
|
(_a = this.options$.getValue()) === null || _a === void 0 ? void 0 : _a.forEach((option) => (option.selected = false));
|
|
59
59
|
this.selectedOptions$.notify([]);
|
|
60
|
-
this.
|
|
60
|
+
this.requestUpdate();
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
filter(value) {
|
|
63
63
|
const selectOptions = this.options$.getValue();
|
|
64
64
|
if (!selectOptions)
|
|
65
65
|
return;
|
|
@@ -68,16 +68,16 @@ class BaseSelectController {
|
|
|
68
68
|
filtered.forEach((option) => {
|
|
69
69
|
option.hidden = false;
|
|
70
70
|
});
|
|
71
|
-
this.
|
|
71
|
+
this.requestUpdate();
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
requestUpdate() {
|
|
74
74
|
const selectOptions = this.options$.getValue();
|
|
75
75
|
if (!selectOptions)
|
|
76
76
|
return;
|
|
77
77
|
this.options$.notify([...selectOptions]);
|
|
78
78
|
this.host.requestUpdate();
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
getOption(selectValue) {
|
|
81
81
|
var _a;
|
|
82
82
|
return (_a = this.options$.getValue()) === null || _a === void 0 ? void 0 : _a.find((option) => option.value === selectValue);
|
|
83
83
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SelectOption } from "../model/select_option";
|
|
2
2
|
import { BaseSelectController } from "./base_select_controller";
|
|
3
3
|
export declare class MultiSelectController extends BaseSelectController {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
toggle(option: SelectOption): void;
|
|
5
|
+
select(option: SelectOption): void;
|
|
6
|
+
deselect(option: SelectOption): void;
|
|
7
7
|
}
|
package/build/esm/packages/phoenix/src/components/form/select/controllers/multi_select_controller.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { BaseSelectController } from './base_select_controller.js';
|
|
2
2
|
|
|
3
3
|
class MultiSelectController extends BaseSelectController {
|
|
4
|
-
|
|
5
|
-
option.selected ? this.
|
|
4
|
+
toggle(option) {
|
|
5
|
+
option.selected ? this.deselect(option) : this.select(option);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
select(option) {
|
|
8
8
|
option.selected = true;
|
|
9
9
|
this.selectedOptions$.notify((selectedOptions) => [...selectedOptions, option]);
|
|
10
|
-
this.
|
|
10
|
+
this.requestUpdate();
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
deselect(option) {
|
|
13
13
|
option.selected = false;
|
|
14
14
|
this.selectedOptions$.notify((selectedOptions) => selectedOptions.filter((currOption) => currOption.value !== option.value));
|
|
15
|
-
this.
|
|
15
|
+
this.requestUpdate();
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
package/build/esm/packages/phoenix/src/components/form/select/controllers/select_controller.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectOption } from "../model/select_option";
|
|
2
2
|
import { BaseSelectController } from "./base_select_controller";
|
|
3
3
|
export declare class SelectController extends BaseSelectController {
|
|
4
|
-
|
|
4
|
+
select(option: SelectOption): void;
|
|
5
5
|
}
|
package/build/esm/packages/phoenix/src/components/form/select/controllers/select_controller.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BaseSelectController } from './base_select_controller.js';
|
|
2
2
|
|
|
3
3
|
class SelectController extends BaseSelectController {
|
|
4
|
-
|
|
4
|
+
select(option) {
|
|
5
5
|
var _a;
|
|
6
6
|
const selectedOptions = (_a = this.options$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
7
7
|
selectedOptions.forEach((option) => (option.selected = false));
|
|
8
8
|
option.selected = true;
|
|
9
9
|
this.selectedOptions$.notify([option]);
|
|
10
|
-
this.
|
|
10
|
+
this.requestUpdate();
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -10,13 +10,13 @@ export interface ISelectController {
|
|
|
10
10
|
options$: BehaviorSubject<SelectOption[]>;
|
|
11
11
|
visibleOptionsCount: number;
|
|
12
12
|
selectedOptionsCount: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
deselectAll(): void;
|
|
14
|
+
deselect(option: SelectOption): void;
|
|
15
|
+
filter(value: string): void;
|
|
16
|
+
toggle(option: SelectOption): void;
|
|
17
|
+
select(option: SelectOption): void;
|
|
18
|
+
getOption(selectValue: string): SelectOption | undefined;
|
|
19
|
+
remove(optionValue: string): void;
|
|
20
|
+
add(option: SelectOption, position?: number): void;
|
|
21
|
+
replace(options: SelectOption[]): void;
|
|
22
22
|
}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
import { HOption } from "./components/option/select_option";
|
|
2
3
|
import { TemplateResult, PropertyValues } from 'lit';
|
|
3
4
|
import { SelectOption } from "./model/select_option";
|
|
5
|
+
import type { TSelectType } from "./select_types";
|
|
4
6
|
export declare class HSelect extends PhoenixLightLitElement {
|
|
5
7
|
private static _components;
|
|
6
8
|
controlName: string;
|
|
7
|
-
|
|
9
|
+
controlId: string;
|
|
10
|
+
multiple: boolean;
|
|
8
11
|
opened: boolean;
|
|
9
12
|
offset: number;
|
|
10
13
|
error: boolean;
|
|
11
14
|
disabled: boolean;
|
|
15
|
+
type: TSelectType;
|
|
16
|
+
required: boolean;
|
|
17
|
+
get selectedIndex(): number;
|
|
18
|
+
set selectedIndex(index: number);
|
|
19
|
+
get selectedOptions(): HOption[];
|
|
20
|
+
get name(): string;
|
|
21
|
+
get id(): string;
|
|
22
|
+
get options(): HOption[];
|
|
12
23
|
private _searchValue;
|
|
13
24
|
private _selectController;
|
|
14
25
|
private _$options;
|
|
@@ -33,14 +44,16 @@ export declare class HSelect extends PhoenixLightLitElement {
|
|
|
33
44
|
private _appendNewHTMLOption;
|
|
34
45
|
private _removeHTMLOptions;
|
|
35
46
|
private _handleOptionClicked;
|
|
47
|
+
private _selectOption;
|
|
36
48
|
private _handleSearch;
|
|
37
49
|
private _handleDropdownHidden;
|
|
38
50
|
private _closeSelect;
|
|
39
51
|
private _clearOptions;
|
|
52
|
+
private _dispatchChangeEvent;
|
|
40
53
|
protected update(changedProperties: PropertyValues): void;
|
|
41
|
-
|
|
54
|
+
add(option: SelectOption, position?: number): void;
|
|
42
55
|
removeOption(optionValue: string): void;
|
|
43
|
-
|
|
56
|
+
replace(options: SelectOption[]): void;
|
|
44
57
|
disconnectedCallback(): void;
|
|
45
58
|
private _handleResize;
|
|
46
59
|
private _getDropdownContentWidth;
|
|
@@ -7,7 +7,7 @@ import { property } from '@lit/reactive-element/decorators.js';
|
|
|
7
7
|
import { SELECT_RELATED_COMPONENTS_NAMES, SELECT_INPUT_PLACEHOLDER_SLOT_NAME, SELECT_CLOSE_BTN_EVENT_NAMES, SELECT_CLOSE_BUTTON_CONTENT_SLOT_NAME } from './components/select_components_constatns.js';
|
|
8
8
|
import { Observer } from '../../../core/classes/observer/observer.js';
|
|
9
9
|
import { HIcon } from '../../icon/icon.js';
|
|
10
|
-
import { 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 { SELECT_TYPES, SELECT_SLOT_NAMES, SELECT_CSS_CLASSES, SELECT_CONTEXTS, SELECT_EVENT_NAMES, MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH, SELECT_RESIZE_DEBOUNCE_TIME } from './select_constants.js';
|
|
11
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';
|
|
@@ -26,9 +26,10 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
26
26
|
constructor() {
|
|
27
27
|
var _a;
|
|
28
28
|
super();
|
|
29
|
-
this.
|
|
29
|
+
this.multiple = false;
|
|
30
30
|
this.opened = false;
|
|
31
31
|
this.offset = 2;
|
|
32
|
+
this.type = SELECT_TYPES.select;
|
|
32
33
|
this._searchValue = '';
|
|
33
34
|
this._$options = {};
|
|
34
35
|
this._$dropdown = createRef();
|
|
@@ -41,10 +42,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
41
42
|
this._$dropdownContent.value.style.width = `${width !== null && width !== void 0 ? width : ''}px`;
|
|
42
43
|
};
|
|
43
44
|
this._handleOptionDeselect = (event) => {
|
|
44
|
-
const selectedOption = this._selectController.
|
|
45
|
+
const selectedOption = this._selectController.getOption(event.detail);
|
|
45
46
|
if (!selectedOption)
|
|
46
47
|
return;
|
|
47
|
-
this._selectController.
|
|
48
|
+
this._selectController.deselect(selectedOption);
|
|
49
|
+
this._dispatchChangeEvent();
|
|
48
50
|
};
|
|
49
51
|
this._updateOptionsView = (options) => {
|
|
50
52
|
if (options.length < Object.keys(this._$options).length)
|
|
@@ -59,16 +61,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
59
61
|
SelectControlUtils.syncHTMLOptionWithModel(option, $option);
|
|
60
62
|
if (!selected)
|
|
61
63
|
return;
|
|
62
|
-
$option.setAttribute(this.
|
|
64
|
+
$option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', 'true');
|
|
63
65
|
});
|
|
64
66
|
};
|
|
65
67
|
this._handleOptionClicked = (event) => {
|
|
66
|
-
|
|
67
|
-
if (!selectedOption)
|
|
68
|
-
return;
|
|
69
|
-
this._selectController.toggleOption(selectedOption);
|
|
70
|
-
if (!this.multiselect)
|
|
71
|
-
this._closeSelect();
|
|
68
|
+
this._selectOption(event.detail.$option.value);
|
|
72
69
|
};
|
|
73
70
|
this._handleDropdownHidden = () => {
|
|
74
71
|
this._searchValue = '';
|
|
@@ -81,7 +78,11 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
81
78
|
(_a = this._$dropdown.value) === null || _a === void 0 ? void 0 : _a.hide();
|
|
82
79
|
};
|
|
83
80
|
this._clearOptions = () => {
|
|
84
|
-
this._selectController.
|
|
81
|
+
this._selectController.deselectAll();
|
|
82
|
+
this._dispatchChangeEvent();
|
|
83
|
+
};
|
|
84
|
+
this._dispatchChangeEvent = () => {
|
|
85
|
+
this.dispatchEvent(new Event('change'));
|
|
85
86
|
};
|
|
86
87
|
this._handleResize = debounce_1(() => {
|
|
87
88
|
this._closeSelect();
|
|
@@ -90,6 +91,39 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
90
91
|
const $options = Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
91
92
|
$options.forEach(($option) => $option.setAttribute('slot', SELECT_SLOT_NAMES.content));
|
|
92
93
|
this.$placeholder = (_a = this.querySelector(`[slot="${SELECT_INPUT_PLACEHOLDER_SLOT_NAME}"]`)) !== null && _a !== void 0 ? _a : 'Select';
|
|
94
|
+
if (this.multiple)
|
|
95
|
+
this.type = SELECT_TYPES.multiple;
|
|
96
|
+
}
|
|
97
|
+
get selectedIndex() {
|
|
98
|
+
const selectedOptions = this._selectController.selectedOptions$.getValue();
|
|
99
|
+
if (!selectedOptions || selectedOptions.length === 0)
|
|
100
|
+
return -1;
|
|
101
|
+
const htmlOptions = Object.values(this._$options);
|
|
102
|
+
return this.multiple
|
|
103
|
+
? SelectControlUtils.getFirstIndexSelectedOption(htmlOptions)
|
|
104
|
+
: SelectControlUtils.getLastIndexOfSelectedOption(htmlOptions);
|
|
105
|
+
}
|
|
106
|
+
set selectedIndex(index) {
|
|
107
|
+
const option = Object.values(this._$options)[index];
|
|
108
|
+
if (!option) {
|
|
109
|
+
this._selectController.deselectAll();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this._selectOption(option.value);
|
|
113
|
+
}
|
|
114
|
+
get selectedOptions() {
|
|
115
|
+
var _a;
|
|
116
|
+
const selectedOptions = (_a = this._selectController.selectedOptions$.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
117
|
+
return selectedOptions.filter((option) => option.selected).map((option) => this._$options[option.value]);
|
|
118
|
+
}
|
|
119
|
+
get name() {
|
|
120
|
+
return this.controlName;
|
|
121
|
+
}
|
|
122
|
+
get id() {
|
|
123
|
+
return this.controlId;
|
|
124
|
+
}
|
|
125
|
+
get options() {
|
|
126
|
+
return Object.values(this._$options);
|
|
93
127
|
}
|
|
94
128
|
updated(changedProperties) {
|
|
95
129
|
super.updated(changedProperties);
|
|
@@ -116,9 +150,9 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
116
150
|
connectedCallback() {
|
|
117
151
|
super.connectedCallback();
|
|
118
152
|
this.classList.add(SELECT_CSS_CLASSES.select);
|
|
119
|
-
this._selectController = this.
|
|
153
|
+
this._selectController = this.multiple ? new MultiSelectController({ host: this }) : new SelectController({ host: this });
|
|
120
154
|
this._selectContext.provide(SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
121
|
-
this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.
|
|
155
|
+
this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
122
156
|
const $options = Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
123
157
|
this._optionsObserver = new Observer((selectedOptions) => this._updateOptionsView(selectedOptions));
|
|
124
158
|
this._selectController.options$.subscribe(this._optionsObserver);
|
|
@@ -162,29 +196,38 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
162
196
|
const { value, selected } = option;
|
|
163
197
|
const $option = SelectControlUtils.createHTMLOption(option);
|
|
164
198
|
if (selected)
|
|
165
|
-
$option.setAttribute(this.
|
|
199
|
+
$option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', 'true');
|
|
166
200
|
this._$options[value] = $option;
|
|
167
201
|
SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
168
202
|
}
|
|
169
203
|
_removeHTMLOptions(optionsValues) {
|
|
170
204
|
this._$options = SelectControlUtils.removeHTMLOptions(Object.values(this._$options), optionsValues);
|
|
171
205
|
}
|
|
206
|
+
_selectOption(value) {
|
|
207
|
+
const option = this._selectController.getOption(value);
|
|
208
|
+
if (!option)
|
|
209
|
+
return;
|
|
210
|
+
this._selectController.toggle(option);
|
|
211
|
+
if (!this.multiple)
|
|
212
|
+
this._closeSelect();
|
|
213
|
+
this._dispatchChangeEvent();
|
|
214
|
+
}
|
|
172
215
|
_handleSearch({ detail }) {
|
|
173
216
|
this._searchValue = detail;
|
|
174
217
|
}
|
|
175
218
|
update(changedProperties) {
|
|
176
219
|
super.update(changedProperties);
|
|
177
220
|
if (changedProperties.has('_searchValue'))
|
|
178
|
-
this._selectController.
|
|
221
|
+
this._selectController.filter(this._searchValue);
|
|
179
222
|
}
|
|
180
|
-
|
|
181
|
-
this._selectController.
|
|
223
|
+
add(option, position) {
|
|
224
|
+
this._selectController.add(option, position);
|
|
182
225
|
}
|
|
183
226
|
removeOption(optionValue) {
|
|
184
|
-
this._selectController.
|
|
227
|
+
this._selectController.remove(optionValue);
|
|
185
228
|
}
|
|
186
|
-
|
|
187
|
-
this._selectController.
|
|
229
|
+
replace(options) {
|
|
230
|
+
this._selectController.replace(options);
|
|
188
231
|
}
|
|
189
232
|
disconnectedCallback() {
|
|
190
233
|
super.disconnectedCallback();
|
|
@@ -214,6 +257,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
214
257
|
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
215
258
|
|
|
216
259
|
<h-dropdown-content
|
|
260
|
+
@focusout=${this._dispatchChangeEvent}
|
|
217
261
|
class="${SELECT_CSS_CLASSES.selectContent} ${this.error ? SELECT_CSS_CLASSES.selectContentError : ''}"
|
|
218
262
|
${ref(this._$dropdownContent)}
|
|
219
263
|
name=${this.controlName}
|
|
@@ -253,7 +297,7 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
253
297
|
</p>
|
|
254
298
|
</div>`
|
|
255
299
|
: nothing}
|
|
256
|
-
${this.
|
|
300
|
+
${this.multiple && this._selectController.selectedOptionsCount >= 1
|
|
257
301
|
? html `
|
|
258
302
|
<section class=${SELECT_CSS_CLASSES.selectFooter}>
|
|
259
303
|
<button class="${SELECT_CSS_CLASSES.selectClearButton}" @click=${this._clearOptions}>clear</button>
|
|
@@ -277,13 +321,17 @@ HSelect._components = {
|
|
|
277
321
|
toggler: HSelectToggler
|
|
278
322
|
};
|
|
279
323
|
__decorate([
|
|
280
|
-
property({ type: String }),
|
|
324
|
+
property({ type: String, attribute: 'control-name' }),
|
|
281
325
|
__metadata("design:type", String)
|
|
282
326
|
], HSelect.prototype, "controlName", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
property({ type: String, attribute: 'control-id' }),
|
|
329
|
+
__metadata("design:type", String)
|
|
330
|
+
], HSelect.prototype, "controlId", void 0);
|
|
283
331
|
__decorate([
|
|
284
332
|
property({ type: Boolean }),
|
|
285
333
|
__metadata("design:type", Boolean)
|
|
286
|
-
], HSelect.prototype, "
|
|
334
|
+
], HSelect.prototype, "multiple", void 0);
|
|
287
335
|
__decorate([
|
|
288
336
|
property({ type: Boolean }),
|
|
289
337
|
__metadata("design:type", Boolean)
|
|
@@ -300,6 +348,14 @@ __decorate([
|
|
|
300
348
|
property({ type: Boolean }),
|
|
301
349
|
__metadata("design:type", Boolean)
|
|
302
350
|
], HSelect.prototype, "disabled", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
property({ type: String }),
|
|
353
|
+
__metadata("design:type", String)
|
|
354
|
+
], HSelect.prototype, "type", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
property({ type: Boolean }),
|
|
357
|
+
__metadata("design:type", Boolean)
|
|
358
|
+
], HSelect.prototype, "required", void 0);
|
|
303
359
|
__decorate([
|
|
304
360
|
state(),
|
|
305
361
|
__metadata("design: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;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;"}
|
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,6 +6,10 @@ export declare const SELECT_SLOT_NAMES: {
|
|
|
6
6
|
readonly content: "content";
|
|
7
7
|
readonly toggler: "toggler";
|
|
8
8
|
};
|
|
9
|
+
export declare const SELECT_TYPES: {
|
|
10
|
+
readonly select: "select-one";
|
|
11
|
+
readonly multiple: "select-multiple";
|
|
12
|
+
};
|
|
9
13
|
export declare const SELECT_EVENT_NAMES: {
|
|
10
14
|
readonly selectOption: "selectOption.select";
|
|
11
15
|
readonly deselectOption: "selectOption.deselect";
|
|
@@ -6,6 +6,10 @@ const SELECT_SLOT_NAMES = {
|
|
|
6
6
|
content: 'content',
|
|
7
7
|
toggler: 'toggler'
|
|
8
8
|
};
|
|
9
|
+
const SELECT_TYPES = {
|
|
10
|
+
select: 'select-one',
|
|
11
|
+
multiple: 'select-multiple'
|
|
12
|
+
};
|
|
9
13
|
const SELECT_EVENT_NAMES = {
|
|
10
14
|
selectOption: 'selectOption.select',
|
|
11
15
|
deselectOption: 'selectOption.deselect'
|
|
@@ -32,5 +36,5 @@ const SELECT_CSS_CLASSES = {
|
|
|
32
36
|
selectLabel: `${baseSelectClass}__label`
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
export { MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH, SELECT_CONTEXTS, SELECT_CSS_CLASSES, SELECT_EVENT_NAMES, SELECT_RESIZE_DEBOUNCE_TIME, SELECT_SLOT_NAMES };
|
|
39
|
+
export { MIN_NUMBER_OF_OPTIONS_TO_SHOW_SEARCH, SELECT_CONTEXTS, SELECT_CSS_CLASSES, SELECT_EVENT_NAMES, SELECT_RESIZE_DEBOUNCE_TIME, SELECT_SLOT_NAMES, SELECT_TYPES };
|
|
36
40
|
//# sourceMappingURL=select_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|