@shoper/phoenix_design_system 1.2.13-14 → 1.2.13-16
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/input_stepper/button_stepper.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/display_stepper.js +5 -4
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/display_stepper.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/input_stepper.js +35 -23
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/input_stepper.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js +4 -0
- package/build/cjs/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/button_stepper.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_stepper.d.ts +2 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_stepper.js +5 -4
- package/build/esm/packages/phoenix/src/components/form/input_stepper/display_stepper.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.js +36 -24
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js +4 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ var input_stepper_constants = require('./input_stepper_constants.js');
|
|
|
11
11
|
exports.HButtonStepper = class HButtonStepper extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
12
12
|
};
|
|
13
13
|
tslib_es6.__decorate([
|
|
14
|
-
decorators.property({ type: String,
|
|
14
|
+
decorators.property({ type: String, reflect: true }),
|
|
15
15
|
tslib_es6.__metadata("design:type", String)
|
|
16
16
|
], exports.HButtonStepper.prototype, "step", void 0);
|
|
17
17
|
exports.HButtonStepper = tslib_es6.__decorate([
|
|
@@ -18,13 +18,14 @@ exports.HDisplayStepper = class HDisplayStepper extends phoenix_light_lit_elemen
|
|
|
18
18
|
}
|
|
19
19
|
connectedCallback() {
|
|
20
20
|
super.connectedCallback();
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const $closestInputStepper = this.closest(input_stepper_constants.INPUT_STEPPER_COMPONENT_NAMES.control);
|
|
22
|
+
if (!$closestInputStepper)
|
|
23
23
|
return;
|
|
24
|
-
this.step = Number(
|
|
25
|
-
this.controlId =
|
|
24
|
+
this.step = Number($closestInputStepper.step);
|
|
25
|
+
this.controlId = $closestInputStepper.controlId;
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
+
super.render();
|
|
28
29
|
return lit.html `<input
|
|
29
30
|
onfocus="this.select();"
|
|
30
31
|
class="${input_stepper_constants.INPUT_STEPPER_CLASS_NAMES.displayInput}"
|
|
@@ -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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -18,6 +18,12 @@ exports.HInputStepper = class HInputStepper extends phoenix_light_lit_element.Ph
|
|
|
18
18
|
this.step = 1;
|
|
19
19
|
this.stepperValue = '0';
|
|
20
20
|
this.inputReference = null;
|
|
21
|
+
this._buttonClick = (buttonElement) => {
|
|
22
|
+
const step = Number(buttonElement.getAttribute('step'));
|
|
23
|
+
if (isNaN(step))
|
|
24
|
+
return;
|
|
25
|
+
this._setValueByButton(step);
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
connectedCallback() {
|
|
23
29
|
super.connectedCallback();
|
|
@@ -31,29 +37,25 @@ exports.HInputStepper = class HInputStepper extends phoenix_light_lit_element.Ph
|
|
|
31
37
|
}
|
|
32
38
|
_subscribeToButtons() {
|
|
33
39
|
const stepperButtons = Array.from(this.querySelectorAll(input_stepper_constants.INPUT_STEPPER_COMPONENT_NAMES.button));
|
|
34
|
-
if (stepperButtons.length)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
40
|
+
if (stepperButtons.length === 0)
|
|
41
|
+
return;
|
|
42
|
+
stepperButtons.forEach((button) => {
|
|
43
|
+
button.addEventListener(input_stepper_constants.INPUT_STEPPER_EVENT_NAMES.click, () => this._buttonClick(button));
|
|
44
|
+
});
|
|
39
45
|
}
|
|
40
46
|
_subscribeToInput() {
|
|
41
|
-
if (this.inputReference)
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
if (!this.inputReference)
|
|
48
|
+
return;
|
|
49
|
+
this.inputReference.addEventListener(input_stepper_constants.INPUT_STEPPER_EVENT_NAMES.change, () => this.inputReference && this._inputChange(this.inputReference));
|
|
44
50
|
}
|
|
45
51
|
_inputChange(input) {
|
|
46
52
|
var _a, _b;
|
|
47
|
-
|
|
48
|
-
if (inputValue
|
|
53
|
+
let { value: inputValue } = (_b = (_a = input === null || input === void 0 ? void 0 : input.inputRef) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : {};
|
|
54
|
+
if (inputValue === null)
|
|
49
55
|
return;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const step = Number(buttonElement.getAttribute('step'));
|
|
54
|
-
if (isNaN(step))
|
|
55
|
-
return;
|
|
56
|
-
this._setValueByButton(step);
|
|
56
|
+
if (!this.allowFractions)
|
|
57
|
+
inputValue = this._roundToStepSize(this.step, Number(inputValue));
|
|
58
|
+
this._setValue(`${inputValue}`);
|
|
57
59
|
}
|
|
58
60
|
_setValueByButton(value) {
|
|
59
61
|
const sum = Number(this.stepperValue) + value;
|
|
@@ -69,9 +71,19 @@ exports.HInputStepper = class HInputStepper extends phoenix_light_lit_element.Ph
|
|
|
69
71
|
}
|
|
70
72
|
this.stepperValue = newValue;
|
|
71
73
|
this.inputReference.inputRef.value.value = this.stepperValue;
|
|
74
|
+
this._dispatchValueChangeEvent(this.stepperValue);
|
|
75
|
+
}
|
|
76
|
+
_dispatchValueChangeEvent(value) {
|
|
77
|
+
const valueChangeEvent = new CustomEvent(input_stepper_constants.INPUT_STEPPER_CUSTOM_EVENT_NAMES.valueChanged, {
|
|
78
|
+
bubbles: true,
|
|
79
|
+
detail: {
|
|
80
|
+
value: Number(value)
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
this.dispatchEvent(valueChangeEvent);
|
|
72
84
|
}
|
|
73
85
|
_attemptSetInputValue() {
|
|
74
|
-
if (
|
|
86
|
+
if (this.min === -Infinity && !this.value)
|
|
75
87
|
return;
|
|
76
88
|
const id = setInterval(() => {
|
|
77
89
|
var _a, _b;
|
|
@@ -91,15 +103,15 @@ exports.HInputStepper = class HInputStepper extends phoenix_light_lit_element.Ph
|
|
|
91
103
|
}
|
|
92
104
|
};
|
|
93
105
|
tslib_es6.__decorate([
|
|
94
|
-
decorators.property({ type: String,
|
|
106
|
+
decorators.property({ type: String, reflect: true }),
|
|
95
107
|
tslib_es6.__metadata("design:type", String)
|
|
96
108
|
], exports.HInputStepper.prototype, "value", void 0);
|
|
97
109
|
tslib_es6.__decorate([
|
|
98
|
-
decorators.property({ type: Number,
|
|
110
|
+
decorators.property({ type: Number, reflect: true }),
|
|
99
111
|
tslib_es6.__metadata("design:type", Number)
|
|
100
112
|
], exports.HInputStepper.prototype, "min", void 0);
|
|
101
113
|
tslib_es6.__decorate([
|
|
102
|
-
decorators.property({ type: Number,
|
|
114
|
+
decorators.property({ type: Number, reflect: true }),
|
|
103
115
|
tslib_es6.__metadata("design:type", Number)
|
|
104
116
|
], exports.HInputStepper.prototype, "max", void 0);
|
|
105
117
|
tslib_es6.__decorate([
|
|
@@ -107,11 +119,11 @@ tslib_es6.__decorate([
|
|
|
107
119
|
tslib_es6.__metadata("design:type", String)
|
|
108
120
|
], exports.HInputStepper.prototype, "controlId", void 0);
|
|
109
121
|
tslib_es6.__decorate([
|
|
110
|
-
decorators.property({ type:
|
|
122
|
+
decorators.property({ type: Boolean, attribute: 'allow-fractions', reflect: true }),
|
|
111
123
|
tslib_es6.__metadata("design:type", Boolean)
|
|
112
124
|
], exports.HInputStepper.prototype, "allowFractions", void 0);
|
|
113
125
|
tslib_es6.__decorate([
|
|
114
|
-
decorators.property({ type: Number,
|
|
126
|
+
decorators.property({ type: Number, reflect: true }),
|
|
115
127
|
tslib_es6.__metadata("design:type", Number)
|
|
116
128
|
], exports.HInputStepper.prototype, "step", void 0);
|
|
117
129
|
tslib_es6.__decorate([
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/input_stepper/input_stepper_constants.js
CHANGED
|
@@ -6,6 +6,9 @@ const INPUT_STEPPER_EVENT_NAMES = {
|
|
|
6
6
|
click: 'click',
|
|
7
7
|
change: 'change'
|
|
8
8
|
};
|
|
9
|
+
const INPUT_STEPPER_CUSTOM_EVENT_NAMES = {
|
|
10
|
+
valueChanged: 'inputStepper.valueChanged'
|
|
11
|
+
};
|
|
9
12
|
const INPUT_STEPPER_CLASS_NAMES = {
|
|
10
13
|
displayInput: 'input-stepper__value_input'
|
|
11
14
|
};
|
|
@@ -17,5 +20,6 @@ const INPUT_STEPPER_COMPONENT_NAMES = {
|
|
|
17
20
|
|
|
18
21
|
exports.INPUT_STEPPER_CLASS_NAMES = INPUT_STEPPER_CLASS_NAMES;
|
|
19
22
|
exports.INPUT_STEPPER_COMPONENT_NAMES = INPUT_STEPPER_COMPONENT_NAMES;
|
|
23
|
+
exports.INPUT_STEPPER_CUSTOM_EVENT_NAMES = INPUT_STEPPER_CUSTOM_EVENT_NAMES;
|
|
20
24
|
exports.INPUT_STEPPER_EVENT_NAMES = INPUT_STEPPER_EVENT_NAMES;
|
|
21
25
|
//# sourceMappingURL=input_stepper_constants.js.map
|
package/build/cjs/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;"}
|
|
@@ -7,7 +7,7 @@ import { INPUT_STEPPER_COMPONENT_NAMES } from './input_stepper_constants.js';
|
|
|
7
7
|
let HButtonStepper = class HButtonStepper extends PhoenixLightLitElement {
|
|
8
8
|
};
|
|
9
9
|
__decorate([
|
|
10
|
-
property({ type: String,
|
|
10
|
+
property({ type: String, reflect: true }),
|
|
11
11
|
__metadata("design:type", String)
|
|
12
12
|
], HButtonStepper.prototype, "step", void 0);
|
|
13
13
|
HButtonStepper = __decorate([
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
import { TemplateResult } from 'lit';
|
|
2
3
|
import { Ref } from 'lit/directives/ref.js';
|
|
3
4
|
export declare class HDisplayStepper extends PhoenixLightLitElement {
|
|
4
5
|
controlId: string | null;
|
|
5
6
|
inputRef: Ref<HTMLInputElement>;
|
|
6
7
|
private step;
|
|
7
8
|
connectedCallback(): void;
|
|
8
|
-
protected render():
|
|
9
|
+
protected render(): TemplateResult;
|
|
9
10
|
}
|
|
@@ -14,13 +14,14 @@ let HDisplayStepper = class HDisplayStepper extends PhoenixLightLitElement {
|
|
|
14
14
|
}
|
|
15
15
|
connectedCallback() {
|
|
16
16
|
super.connectedCallback();
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
17
|
+
const $closestInputStepper = this.closest(INPUT_STEPPER_COMPONENT_NAMES.control);
|
|
18
|
+
if (!$closestInputStepper)
|
|
19
19
|
return;
|
|
20
|
-
this.step = Number(
|
|
21
|
-
this.controlId =
|
|
20
|
+
this.step = Number($closestInputStepper.step);
|
|
21
|
+
this.controlId = $closestInputStepper.controlId;
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
+
super.render();
|
|
24
25
|
return html `<input
|
|
25
26
|
onfocus="this.select();"
|
|
26
27
|
class="${INPUT_STEPPER_CLASS_NAMES.displayInput}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,2BAA2B,+CAAmD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -2,7 +2,7 @@ import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.e
|
|
|
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 { INPUT_STEPPER_COMPONENT_NAMES, INPUT_STEPPER_EVENT_NAMES } from './input_stepper_constants.js';
|
|
5
|
+
import { INPUT_STEPPER_COMPONENT_NAMES, INPUT_STEPPER_EVENT_NAMES, INPUT_STEPPER_CUSTOM_EVENT_NAMES } from './input_stepper_constants.js';
|
|
6
6
|
|
|
7
7
|
let HInputStepper = class HInputStepper extends PhoenixLightLitElement {
|
|
8
8
|
constructor() {
|
|
@@ -14,6 +14,12 @@ let HInputStepper = class HInputStepper extends PhoenixLightLitElement {
|
|
|
14
14
|
this.step = 1;
|
|
15
15
|
this.stepperValue = '0';
|
|
16
16
|
this.inputReference = null;
|
|
17
|
+
this._buttonClick = (buttonElement) => {
|
|
18
|
+
const step = Number(buttonElement.getAttribute('step'));
|
|
19
|
+
if (isNaN(step))
|
|
20
|
+
return;
|
|
21
|
+
this._setValueByButton(step);
|
|
22
|
+
};
|
|
17
23
|
}
|
|
18
24
|
connectedCallback() {
|
|
19
25
|
super.connectedCallback();
|
|
@@ -27,29 +33,25 @@ let HInputStepper = class HInputStepper extends PhoenixLightLitElement {
|
|
|
27
33
|
}
|
|
28
34
|
_subscribeToButtons() {
|
|
29
35
|
const stepperButtons = Array.from(this.querySelectorAll(INPUT_STEPPER_COMPONENT_NAMES.button));
|
|
30
|
-
if (stepperButtons.length)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
36
|
+
if (stepperButtons.length === 0)
|
|
37
|
+
return;
|
|
38
|
+
stepperButtons.forEach((button) => {
|
|
39
|
+
button.addEventListener(INPUT_STEPPER_EVENT_NAMES.click, () => this._buttonClick(button));
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
42
|
_subscribeToInput() {
|
|
37
|
-
if (this.inputReference)
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
if (!this.inputReference)
|
|
44
|
+
return;
|
|
45
|
+
this.inputReference.addEventListener(INPUT_STEPPER_EVENT_NAMES.change, () => this.inputReference && this._inputChange(this.inputReference));
|
|
40
46
|
}
|
|
41
47
|
_inputChange(input) {
|
|
42
48
|
var _a, _b;
|
|
43
|
-
|
|
44
|
-
if (inputValue
|
|
49
|
+
let { value: inputValue } = (_b = (_a = input === null || input === void 0 ? void 0 : input.inputRef) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : {};
|
|
50
|
+
if (inputValue === null)
|
|
45
51
|
return;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const step = Number(buttonElement.getAttribute('step'));
|
|
50
|
-
if (isNaN(step))
|
|
51
|
-
return;
|
|
52
|
-
this._setValueByButton(step);
|
|
52
|
+
if (!this.allowFractions)
|
|
53
|
+
inputValue = this._roundToStepSize(this.step, Number(inputValue));
|
|
54
|
+
this._setValue(`${inputValue}`);
|
|
53
55
|
}
|
|
54
56
|
_setValueByButton(value) {
|
|
55
57
|
const sum = Number(this.stepperValue) + value;
|
|
@@ -65,9 +67,19 @@ let HInputStepper = class HInputStepper extends PhoenixLightLitElement {
|
|
|
65
67
|
}
|
|
66
68
|
this.stepperValue = newValue;
|
|
67
69
|
this.inputReference.inputRef.value.value = this.stepperValue;
|
|
70
|
+
this._dispatchValueChangeEvent(this.stepperValue);
|
|
71
|
+
}
|
|
72
|
+
_dispatchValueChangeEvent(value) {
|
|
73
|
+
const valueChangeEvent = new CustomEvent(INPUT_STEPPER_CUSTOM_EVENT_NAMES.valueChanged, {
|
|
74
|
+
bubbles: true,
|
|
75
|
+
detail: {
|
|
76
|
+
value: Number(value)
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.dispatchEvent(valueChangeEvent);
|
|
68
80
|
}
|
|
69
81
|
_attemptSetInputValue() {
|
|
70
|
-
if (
|
|
82
|
+
if (this.min === -Infinity && !this.value)
|
|
71
83
|
return;
|
|
72
84
|
const id = setInterval(() => {
|
|
73
85
|
var _a, _b;
|
|
@@ -87,15 +99,15 @@ let HInputStepper = class HInputStepper extends PhoenixLightLitElement {
|
|
|
87
99
|
}
|
|
88
100
|
};
|
|
89
101
|
__decorate([
|
|
90
|
-
property({ type: String,
|
|
102
|
+
property({ type: String, reflect: true }),
|
|
91
103
|
__metadata("design:type", String)
|
|
92
104
|
], HInputStepper.prototype, "value", void 0);
|
|
93
105
|
__decorate([
|
|
94
|
-
property({ type: Number,
|
|
106
|
+
property({ type: Number, reflect: true }),
|
|
95
107
|
__metadata("design:type", Number)
|
|
96
108
|
], HInputStepper.prototype, "min", void 0);
|
|
97
109
|
__decorate([
|
|
98
|
-
property({ type: Number,
|
|
110
|
+
property({ type: Number, reflect: true }),
|
|
99
111
|
__metadata("design:type", Number)
|
|
100
112
|
], HInputStepper.prototype, "max", void 0);
|
|
101
113
|
__decorate([
|
|
@@ -103,11 +115,11 @@ __decorate([
|
|
|
103
115
|
__metadata("design:type", String)
|
|
104
116
|
], HInputStepper.prototype, "controlId", void 0);
|
|
105
117
|
__decorate([
|
|
106
|
-
property({ type:
|
|
118
|
+
property({ type: Boolean, attribute: 'allow-fractions', reflect: true }),
|
|
107
119
|
__metadata("design:type", Boolean)
|
|
108
120
|
], HInputStepper.prototype, "allowFractions", void 0);
|
|
109
121
|
__decorate([
|
|
110
|
-
property({ type: Number,
|
|
122
|
+
property({ type: Number, reflect: true }),
|
|
111
123
|
__metadata("design:type", Number)
|
|
112
124
|
], HInputStepper.prototype, "step", void 0);
|
|
113
125
|
__decorate([
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/input_stepper/input_stepper_constants.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export declare const INPUT_STEPPER_EVENT_NAMES: {
|
|
|
2
2
|
readonly click: "click";
|
|
3
3
|
readonly change: "change";
|
|
4
4
|
};
|
|
5
|
+
export declare const INPUT_STEPPER_CUSTOM_EVENT_NAMES: {
|
|
6
|
+
readonly valueChanged: "inputStepper.valueChanged";
|
|
7
|
+
};
|
|
5
8
|
export declare const INPUT_STEPPER_CLASS_NAMES: {
|
|
6
9
|
readonly displayInput: "input-stepper__value_input";
|
|
7
10
|
};
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js
CHANGED
|
@@ -2,6 +2,9 @@ const INPUT_STEPPER_EVENT_NAMES = {
|
|
|
2
2
|
click: 'click',
|
|
3
3
|
change: 'change'
|
|
4
4
|
};
|
|
5
|
+
const INPUT_STEPPER_CUSTOM_EVENT_NAMES = {
|
|
6
|
+
valueChanged: 'inputStepper.valueChanged'
|
|
7
|
+
};
|
|
5
8
|
const INPUT_STEPPER_CLASS_NAMES = {
|
|
6
9
|
displayInput: 'input-stepper__value_input'
|
|
7
10
|
};
|
|
@@ -11,5 +14,5 @@ const INPUT_STEPPER_COMPONENT_NAMES = {
|
|
|
11
14
|
button: 'h-button-stepper'
|
|
12
15
|
};
|
|
13
16
|
|
|
14
|
-
export { INPUT_STEPPER_CLASS_NAMES, INPUT_STEPPER_COMPONENT_NAMES, INPUT_STEPPER_EVENT_NAMES };
|
|
17
|
+
export { INPUT_STEPPER_CLASS_NAMES, INPUT_STEPPER_COMPONENT_NAMES, INPUT_STEPPER_CUSTOM_EVENT_NAMES, INPUT_STEPPER_EVENT_NAMES };
|
|
15
18
|
//# sourceMappingURL=input_stepper_constants.js.map
|
package/build/esm/packages/phoenix/src/components/form/input_stepper/input_stepper_constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
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;"}
|