@oicl/openbridge-webcomponents 2.0.0-next.78 → 2.0.0-next.79
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/bundle/openbridge-webcomponents.bundle.js +77 -8
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +77 -5
- package/dist/components/input/input.d.ts +1 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.js +2 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +9 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +12 -2
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/slider/slider.d.ts +14 -1
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +17 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider-double/slider-double.d.ts +17 -1
- package/dist/components/slider-double/slider-double.d.ts.map +1 -1
- package/dist/components/slider-double/slider-double.js +15 -0
- package/dist/components/slider-double/slider-double.js.map +1 -1
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +4 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/toggle-button-group/toggle-button-group.js +15 -3
- package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts +4 -0
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts.map +1 -1
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js +10 -3
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.d.ts +2 -0
- package/dist/components/toggle-switch/toggle-switch.d.ts.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.js +8 -0
- package/dist/components/toggle-switch/toggle-switch.js.map +1 -1
- package/package.json +1 -1
|
@@ -75812,12 +75812,23 @@ let ObcSlider = class extends i$4 {
|
|
|
75812
75812
|
this.value = value;
|
|
75813
75813
|
this.dispatchEvent(new CustomEvent("value", { detail: this.value }));
|
|
75814
75814
|
}
|
|
75815
|
+
/**
|
|
75816
|
+
* Fires the `change` event with the current value.
|
|
75817
|
+
*
|
|
75818
|
+
* @fires change
|
|
75819
|
+
*/
|
|
75820
|
+
fireChangeEvent() {
|
|
75821
|
+
this.dispatchEvent(
|
|
75822
|
+
new CustomEvent("change", { detail: this.value })
|
|
75823
|
+
);
|
|
75824
|
+
}
|
|
75815
75825
|
/**
|
|
75816
75826
|
* Decrements the value by `stepClick` when the left icon button is clicked.
|
|
75817
75827
|
*/
|
|
75818
75828
|
onReduceClick() {
|
|
75819
75829
|
if (this.disabled) return;
|
|
75820
75830
|
this.onInput(Math.max(this.value - this.stepClick, this.min));
|
|
75831
|
+
this.fireChangeEvent();
|
|
75821
75832
|
}
|
|
75822
75833
|
/**
|
|
75823
75834
|
* Increments the value by `stepClick` when the right icon button is clicked.
|
|
@@ -75825,6 +75836,7 @@ let ObcSlider = class extends i$4 {
|
|
|
75825
75836
|
onIncreaseClick() {
|
|
75826
75837
|
if (this.disabled) return;
|
|
75827
75838
|
this.onInput(Math.min(this.value + this.stepClick, this.max));
|
|
75839
|
+
this.fireChangeEvent();
|
|
75828
75840
|
}
|
|
75829
75841
|
get slider() {
|
|
75830
75842
|
return this.renderRoot.querySelector('input[type="range"]');
|
|
@@ -75882,12 +75894,14 @@ let ObcSlider = class extends i$4 {
|
|
|
75882
75894
|
window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
75883
75895
|
window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
75884
75896
|
this.stopAnimation();
|
|
75897
|
+
this.fireChangeEvent();
|
|
75885
75898
|
}
|
|
75886
75899
|
onTouchEnd() {
|
|
75887
75900
|
this.isTouchActive = false;
|
|
75888
75901
|
window.removeEventListener("touchmove", this.onWindowTouchMove);
|
|
75889
75902
|
window.removeEventListener("touchend", this.onWindowTouchEnd);
|
|
75890
75903
|
this.stopAnimation();
|
|
75904
|
+
this.fireChangeEvent();
|
|
75891
75905
|
}
|
|
75892
75906
|
updateTargetValue(e2) {
|
|
75893
75907
|
const rect2 = this.slider.getBoundingClientRect();
|
|
@@ -75981,6 +75995,9 @@ let ObcSlider = class extends i$4 {
|
|
|
75981
75995
|
@input=${(event) => {
|
|
75982
75996
|
this.value = Number(event.target.value);
|
|
75983
75997
|
this.dispatchEvent(new CustomEvent("value", { detail: this.value }));
|
|
75998
|
+
}}
|
|
75999
|
+
@change=${() => {
|
|
76000
|
+
this.fireChangeEvent();
|
|
75984
76001
|
}}
|
|
75985
76002
|
@mousedown=${this.onMouseDown}
|
|
75986
76003
|
@touchstart=${this.onTouchStart}
|
|
@@ -77278,6 +77295,13 @@ let ObcToggleSwitch = class extends i$4 {
|
|
|
77278
77295
|
e2.target.checked = this.checked;
|
|
77279
77296
|
}
|
|
77280
77297
|
}
|
|
77298
|
+
_fireChangeEvent(e2) {
|
|
77299
|
+
if (this.disabled) {
|
|
77300
|
+
e2.preventDefault();
|
|
77301
|
+
return;
|
|
77302
|
+
}
|
|
77303
|
+
this.dispatchEvent(new CustomEvent("change"));
|
|
77304
|
+
}
|
|
77281
77305
|
render() {
|
|
77282
77306
|
return b`
|
|
77283
77307
|
<label
|
|
@@ -77302,6 +77326,7 @@ let ObcToggleSwitch = class extends i$4 {
|
|
|
77302
77326
|
.checked=${this.checked}
|
|
77303
77327
|
?disabled=${this.disabled}
|
|
77304
77328
|
@input=${this._tryChange}
|
|
77329
|
+
@change=${this._fireChangeEvent}
|
|
77305
77330
|
/>
|
|
77306
77331
|
</div>
|
|
77307
77332
|
</div>
|
|
@@ -78084,7 +78109,7 @@ let ObcToggleButtonGroup = class extends i$4 {
|
|
|
78084
78109
|
if (this.disabled) return null;
|
|
78085
78110
|
return Array.from(this.options).find((opt) => !opt.disabled) || null;
|
|
78086
78111
|
}
|
|
78087
|
-
updateSelection(newValue,
|
|
78112
|
+
updateSelection(newValue, emitValueEvent = true, emitChangeEvent = false) {
|
|
78088
78113
|
const oldValue = this.value;
|
|
78089
78114
|
if (!this.hasAnyEnabledOption()) {
|
|
78090
78115
|
this.options.forEach((option) => {
|
|
@@ -78113,13 +78138,20 @@ let ObcToggleButtonGroup = class extends i$4 {
|
|
|
78113
78138
|
option.selected = option.value === newValue;
|
|
78114
78139
|
});
|
|
78115
78140
|
this.setNoDivider();
|
|
78116
|
-
if (
|
|
78141
|
+
if (emitValueEvent && oldValue !== newValue) {
|
|
78117
78142
|
this.dispatchEvent(
|
|
78118
78143
|
new CustomEvent("value", {
|
|
78119
78144
|
detail: { value: newValue, previousValue: oldValue }
|
|
78120
78145
|
})
|
|
78121
78146
|
);
|
|
78122
78147
|
}
|
|
78148
|
+
if (emitChangeEvent && oldValue !== newValue) {
|
|
78149
|
+
this.dispatchEvent(
|
|
78150
|
+
new CustomEvent("change", {
|
|
78151
|
+
detail: { value: newValue }
|
|
78152
|
+
})
|
|
78153
|
+
);
|
|
78154
|
+
}
|
|
78123
78155
|
}
|
|
78124
78156
|
updateActivated(newValue) {
|
|
78125
78157
|
if (newValue) {
|
|
@@ -78220,8 +78252,13 @@ let ObcToggleButtonGroup = class extends i$4 {
|
|
|
78220
78252
|
detail: { value, previousValue: this.value }
|
|
78221
78253
|
})
|
|
78222
78254
|
);
|
|
78255
|
+
this.dispatchEvent(
|
|
78256
|
+
new CustomEvent("change", {
|
|
78257
|
+
detail: { value }
|
|
78258
|
+
})
|
|
78259
|
+
);
|
|
78223
78260
|
} else {
|
|
78224
|
-
this.updateSelection(value);
|
|
78261
|
+
this.updateSelection(value, true, true);
|
|
78225
78262
|
}
|
|
78226
78263
|
}
|
|
78227
78264
|
willUpdate(changedProperties) {
|
|
@@ -94348,7 +94385,14 @@ let ObcPagination = class extends i$4 {
|
|
|
94348
94385
|
this.fullWidth = false;
|
|
94349
94386
|
this.disabled = false;
|
|
94350
94387
|
this.handlePageChange = (event) => {
|
|
94351
|
-
this.setCurrentPage(Number(event.detail.value));
|
|
94388
|
+
const success = this.setCurrentPage(Number(event.detail.value));
|
|
94389
|
+
if (success) {
|
|
94390
|
+
this.dispatchEvent(
|
|
94391
|
+
new CustomEvent("select-page", {
|
|
94392
|
+
detail: { page: Number(event.detail.value) }
|
|
94393
|
+
})
|
|
94394
|
+
);
|
|
94395
|
+
}
|
|
94352
94396
|
};
|
|
94353
94397
|
this.handleFirstClick = () => {
|
|
94354
94398
|
if (!this.canNavigateFirst) return;
|
|
@@ -94409,13 +94453,16 @@ let ObcPagination = class extends i$4 {
|
|
|
94409
94453
|
}
|
|
94410
94454
|
setCurrentPage(newPage) {
|
|
94411
94455
|
const page = Math.max(1, Math.min(newPage, this.validatedPages));
|
|
94412
|
-
if (page === this.currentPage)
|
|
94456
|
+
if (page === this.currentPage) {
|
|
94457
|
+
return false;
|
|
94458
|
+
}
|
|
94413
94459
|
this.currentPage = page;
|
|
94414
94460
|
this.dispatchEvent(
|
|
94415
94461
|
new CustomEvent("value", {
|
|
94416
94462
|
detail: { value: page }
|
|
94417
94463
|
})
|
|
94418
94464
|
);
|
|
94465
|
+
return true;
|
|
94419
94466
|
}
|
|
94420
94467
|
dispatchNavigateEvent(action) {
|
|
94421
94468
|
this.dispatchEvent(
|
|
@@ -100664,6 +100711,18 @@ let ObcSliderDouble = class extends i$4 {
|
|
|
100664
100711
|
new CustomEvent("value", { detail: { low: this.low, high: this.high } })
|
|
100665
100712
|
);
|
|
100666
100713
|
}
|
|
100714
|
+
/**
|
|
100715
|
+
* Fires the `change` event with the current low and high values.
|
|
100716
|
+
*
|
|
100717
|
+
* @fires change
|
|
100718
|
+
*/
|
|
100719
|
+
fireChangeEvent() {
|
|
100720
|
+
this.dispatchEvent(
|
|
100721
|
+
new CustomEvent("change", {
|
|
100722
|
+
detail: { low: this.low, high: this.high }
|
|
100723
|
+
})
|
|
100724
|
+
);
|
|
100725
|
+
}
|
|
100667
100726
|
lowClickValue(e2) {
|
|
100668
100727
|
const rect2 = this.minInput.getBoundingClientRect();
|
|
100669
100728
|
const left = rect2.left + this.THUMB_WIDTH - this.THUMB_VISIBLE_WIDTH / 2;
|
|
@@ -100751,6 +100810,7 @@ let ObcSliderDouble = class extends i$4 {
|
|
|
100751
100810
|
window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
100752
100811
|
window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
100753
100812
|
this.stopAnimation();
|
|
100813
|
+
this.fireChangeEvent();
|
|
100754
100814
|
}
|
|
100755
100815
|
updateTargetValue(e2) {
|
|
100756
100816
|
const unroundedValue = this.isTargetingLow ? this.lowClickValue(e2) : this.highClickValue(e2);
|
|
@@ -100867,6 +100927,7 @@ let ObcSliderDouble = class extends i$4 {
|
|
|
100867
100927
|
.value=${this.low.toString()}
|
|
100868
100928
|
?disabled=${this.variant === "no-input" || this.disabled}
|
|
100869
100929
|
@input=${this.onInput}
|
|
100930
|
+
@change=${() => this.fireChangeEvent()}
|
|
100870
100931
|
/>
|
|
100871
100932
|
<input
|
|
100872
100933
|
type="range"
|
|
@@ -100877,6 +100938,7 @@ let ObcSliderDouble = class extends i$4 {
|
|
|
100877
100938
|
.value=${this.high.toString()}
|
|
100878
100939
|
?disabled=${this.variant === "no-input" || this.disabled}
|
|
100879
100940
|
@input=${this.onInput}
|
|
100941
|
+
@change=${() => this.fireChangeEvent()}
|
|
100880
100942
|
/>
|
|
100881
100943
|
<div class="interactive-track"></div>
|
|
100882
100944
|
<div class="thumb min"></div>
|
|
@@ -107401,7 +107463,7 @@ let ObcToggleButtonVerticalGroup = class extends i$4 {
|
|
|
107401
107463
|
if (this.disabled) return null;
|
|
107402
107464
|
return Array.from(this.options).find((opt) => !opt.disabled) || null;
|
|
107403
107465
|
}
|
|
107404
|
-
updateSelection(newValue,
|
|
107466
|
+
updateSelection(newValue, emitValueEvent = true, emitChangeEvent = false) {
|
|
107405
107467
|
const oldValue = this.value;
|
|
107406
107468
|
if (!this.hasAnyEnabledOption()) {
|
|
107407
107469
|
this.options.forEach((option) => {
|
|
@@ -107430,13 +107492,20 @@ let ObcToggleButtonVerticalGroup = class extends i$4 {
|
|
|
107430
107492
|
option.selected = option.value === newValue;
|
|
107431
107493
|
});
|
|
107432
107494
|
this.updateDividers();
|
|
107433
|
-
if (
|
|
107495
|
+
if (emitValueEvent && oldValue !== newValue) {
|
|
107434
107496
|
this.dispatchEvent(
|
|
107435
107497
|
new CustomEvent("value", {
|
|
107436
107498
|
detail: { value: newValue, previousValue: oldValue }
|
|
107437
107499
|
})
|
|
107438
107500
|
);
|
|
107439
107501
|
}
|
|
107502
|
+
if (emitChangeEvent && oldValue !== newValue) {
|
|
107503
|
+
this.dispatchEvent(
|
|
107504
|
+
new CustomEvent("change", {
|
|
107505
|
+
detail: { value: newValue }
|
|
107506
|
+
})
|
|
107507
|
+
);
|
|
107508
|
+
}
|
|
107440
107509
|
}
|
|
107441
107510
|
firstUpdated(changed) {
|
|
107442
107511
|
super.firstUpdated(changed);
|
|
@@ -107535,7 +107604,7 @@ let ObcToggleButtonVerticalGroup = class extends i$4 {
|
|
|
107535
107604
|
}
|
|
107536
107605
|
onOptionSelected(e2) {
|
|
107537
107606
|
const { value } = e2.detail;
|
|
107538
|
-
this.updateSelection(value);
|
|
107607
|
+
this.updateSelection(value, true, true);
|
|
107539
107608
|
}
|
|
107540
107609
|
render() {
|
|
107541
107610
|
const classes = {
|