@vonage/vivid 5.20.1 → 5.22.0
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/accordion/index.cjs +1 -1
- package/accordion/index.js +2 -2
- package/alert/index.cjs +1 -1
- package/alert/index.js +2 -2
- package/audio-player/index.cjs +3 -5
- package/audio-player/index.js +30 -32
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/banner/index.cjs +1 -1
- package/banner/index.js +2 -2
- package/bundled/affix.cjs +4 -4
- package/bundled/affix.js +4 -4
- package/bundled/base-color-picker.cjs +2 -2
- package/bundled/base-color-picker.js +2 -2
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +1 -1
- package/bundled/definition13.cjs +1 -1
- package/bundled/definition13.js +1 -1
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +2 -2
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +2 -2
- package/bundled/definition17.cjs +1 -1
- package/bundled/definition17.js +1 -1
- package/bundled/definition18.cjs +2 -2
- package/bundled/definition18.js +15 -6
- package/bundled/definition19.cjs +1 -1
- package/bundled/definition19.js +1 -1
- package/bundled/definition20.cjs +1 -1
- package/bundled/definition20.js +1 -1
- package/bundled/definition21.cjs +1 -1
- package/bundled/definition21.js +2 -2
- package/bundled/definition24.cjs +1 -1
- package/bundled/definition24.js +1 -1
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +3 -3
- package/bundled/definition4.cjs +1 -1
- package/bundled/definition4.js +1 -1
- package/bundled/definition5.cjs +1 -1
- package/bundled/definition5.js +1 -1
- package/bundled/definition6.cjs +1 -1
- package/bundled/definition6.js +2 -2
- package/bundled/definition8.cjs +1 -1
- package/bundled/definition8.js +12 -6
- package/bundled/definition9.cjs +1 -1
- package/bundled/definition9.js +1 -1
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +2 -2
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +5 -5
- package/bundled/numberConverter.cjs +1 -1
- package/bundled/numberConverter.js +1 -1
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +1 -1
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +1 -1
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +3 -3
- package/color-picker/index.cjs +20 -20
- package/color-picker/index.js +22 -22
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +7 -7
- package/country-group/index.cjs +1 -1
- package/country-group/index.js +1 -1
- package/custom-elements.json +227 -185
- package/data-grid/index.cjs +2 -2
- package/data-grid/index.js +12 -10
- package/dial-pad/index.cjs +1 -1
- package/dial-pad/index.js +2 -2
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +1 -1
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/lib/audio-player/audio-player.d.ts +0 -1
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +16 -16
- package/lib/color-picker/color-picker.d.ts +16 -16
- package/lib/combobox/combobox.d.ts +21 -21
- package/lib/date-picker/date-picker.d.ts +26 -26
- package/lib/date-range-picker/date-range-picker.d.ts +14 -14
- package/lib/date-time-picker/date-time-picker.d.ts +24 -24
- package/lib/dial-pad/dial-pad.d.ts +1 -1
- package/lib/file-picker/file-picker.d.ts +21 -21
- package/lib/menu/menu.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +22 -22
- package/lib/popup/popup.d.ts +2 -1
- package/lib/radio/radio.d.ts +16 -16
- package/lib/range-slider/range-slider.d.ts +10 -10
- package/lib/rich-text-editor/popover.d.ts +1 -1
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/feature.d.ts +5 -5
- package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/drop-handler.d.ts +1 -2
- package/lib/rich-text-editor/rte/features/internal/core.d.ts +8 -0
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +6 -0
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/instance.d.ts +1 -0
- package/lib/rich-text-editor/rte/public-interface.d.ts +3 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +1 -1
- package/lib/searchable-select/searchable-select.d.ts +21 -21
- package/lib/select/select.d.ts +22 -22
- package/lib/simple-color-picker/simple-color-picker.d.ts +5 -5
- package/lib/slider/slider.d.ts +5 -5
- package/lib/switch/switch.d.ts +5 -5
- package/lib/table/table-body.template.d.ts +1 -2
- package/lib/table/table-cell.template.d.ts +1 -2
- package/lib/table/table-head.template.d.ts +1 -2
- package/lib/table/table-row.template.d.ts +1 -2
- package/lib/table/table.template.d.ts +1 -2
- package/lib/text-area/text-area.d.ts +21 -21
- package/lib/text-field/text-field.d.ts +22 -22
- package/lib/time-picker/time-picker.d.ts +12 -12
- package/locales/de-DE.cjs +178 -4
- package/locales/de-DE.js +179 -2
- package/locales/en-GB.cjs +9 -4
- package/locales/en-GB.js +10 -2
- package/locales/en-US.cjs +2 -270
- package/locales/en-US.js +1 -267
- package/locales/ja-JP.cjs +171 -4
- package/locales/ja-JP.js +172 -2
- package/locales/zh-CN.cjs +172 -4
- package/locales/zh-CN.js +173 -2
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/package.json +7 -4
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +9 -2
- package/popover/index.cjs +1 -1
- package/popover/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +21 -19
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/index.cjs +13 -12
- package/rich-text-editor/index.js +1085 -1057
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +6 -1
- package/shared/color-picker/base-color-picker.d.ts +5 -5
- package/shared/feedback/mixins.d.ts +1 -1
- package/shared/foundation/button/button.d.ts +5 -5
- package/shared/foundation/form-associated/form-associated.d.ts +10 -10
- package/shared/foundation/listbox/listbox.d.ts +1 -1
- package/shared/patterns/form-elements/form-element.d.ts +5 -5
- package/shared/patterns/form-elements/with-contextual-help.d.ts +5 -5
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/picker-field/mixins/calendar-picker.d.ts +6 -6
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +6 -6
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +8 -8
- package/shared/picker-field/mixins/single-date-picker.d.ts +6 -6
- package/shared/picker-field/mixins/single-value-picker.d.ts +6 -6
- package/shared/picker-field/mixins/time-selection-picker.d.ts +6 -6
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +12 -12
- package/shared/picker-field/picker-field.d.ts +21 -21
- package/shared/utils/slottable-request.d.ts +1 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/table/index.cjs +5 -5
- package/table/index.js +5 -5
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +0 -2
- package/unbundled/affix.cjs +4 -4
- package/unbundled/affix.js +4 -4
- package/unbundled/base-color-picker.cjs +3 -3
- package/unbundled/base-color-picker.js +3 -3
- package/unbundled/button.cjs +5 -5
- package/unbundled/button.js +5 -5
- package/unbundled/chunk.cjs +15 -0
- package/unbundled/chunk.js +13 -0
- package/unbundled/definition10.cjs +15 -4
- package/unbundled/definition10.js +15 -4
- package/unbundled/definition11.cjs +3 -3
- package/unbundled/definition11.js +3 -3
- package/unbundled/definition12.cjs +1 -1
- package/unbundled/definition12.js +1 -1
- package/unbundled/definition13.cjs +2 -2
- package/unbundled/definition13.js +2 -2
- package/unbundled/definition14.cjs +73 -76
- package/unbundled/definition14.js +73 -76
- package/unbundled/definition15.cjs +1 -1
- package/unbundled/definition15.js +1 -1
- package/unbundled/definition17.cjs +2 -2
- package/unbundled/definition17.js +2 -2
- package/unbundled/definition19.cjs +2 -1
- package/unbundled/definition19.js +2 -1
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition21.cjs +3 -3
- package/unbundled/definition21.js +3 -3
- package/unbundled/definition23.cjs +2 -2
- package/unbundled/definition23.js +2 -2
- package/unbundled/definition24.cjs +1 -1
- package/unbundled/definition24.js +1 -1
- package/unbundled/definition27.cjs +1 -1
- package/unbundled/definition27.js +1 -1
- package/unbundled/definition28.cjs +23 -23
- package/unbundled/definition28.js +23 -23
- package/unbundled/definition29.cjs +1 -1
- package/unbundled/definition29.js +1 -1
- package/unbundled/definition3.cjs +2 -2
- package/unbundled/definition3.js +2 -2
- package/unbundled/definition30.cjs +8 -8
- package/unbundled/definition30.js +8 -8
- package/unbundled/definition32.cjs +1 -1
- package/unbundled/definition32.js +1 -1
- package/unbundled/definition34.cjs +9 -8
- package/unbundled/definition34.js +9 -8
- package/unbundled/definition35.cjs +1 -1
- package/unbundled/definition35.js +1 -1
- package/unbundled/definition39.cjs +2 -2
- package/unbundled/definition39.js +2 -2
- package/unbundled/definition40.cjs +1 -1
- package/unbundled/definition40.js +1 -1
- package/unbundled/definition43.cjs +1 -1
- package/unbundled/definition43.js +1 -1
- package/unbundled/definition44.cjs +1 -1
- package/unbundled/definition44.js +1 -1
- package/unbundled/definition48.cjs +1 -1
- package/unbundled/definition48.js +1 -1
- package/unbundled/definition49.cjs +1 -1
- package/unbundled/definition49.js +1 -1
- package/unbundled/definition5.cjs +1 -1
- package/unbundled/definition5.js +1 -1
- package/unbundled/definition53.cjs +10 -3
- package/unbundled/definition53.js +10 -3
- package/unbundled/definition55.cjs +1 -1
- package/unbundled/definition55.js +1 -1
- package/unbundled/definition56.cjs +1 -1
- package/unbundled/definition56.js +1 -1
- package/unbundled/definition57.cjs +4 -5
- package/unbundled/definition57.js +4 -5
- package/unbundled/definition58.cjs +20 -19
- package/unbundled/definition58.js +20 -19
- package/unbundled/definition59.cjs +1 -1
- package/unbundled/definition59.js +1 -1
- package/unbundled/definition60.cjs +890 -851
- package/unbundled/definition60.js +890 -851
- package/unbundled/definition61.cjs +13 -7
- package/unbundled/definition61.js +13 -7
- package/unbundled/definition63.cjs +1 -1
- package/unbundled/definition63.js +1 -1
- package/unbundled/definition64.cjs +4 -1
- package/unbundled/definition64.js +4 -1
- package/unbundled/definition65.cjs +2 -1
- package/unbundled/definition65.js +2 -1
- package/unbundled/definition69.cjs +4 -3
- package/unbundled/definition69.js +4 -3
- package/unbundled/definition7.cjs +2 -2
- package/unbundled/definition7.js +2 -2
- package/unbundled/definition71.cjs +1 -1
- package/unbundled/definition71.js +1 -1
- package/unbundled/definition72.cjs +5 -5
- package/unbundled/definition72.js +5 -5
- package/unbundled/definition73.cjs +3 -3
- package/unbundled/definition73.js +3 -3
- package/unbundled/definition75.cjs +1 -1
- package/unbundled/definition75.js +1 -1
- package/unbundled/definition78.cjs +1 -1
- package/unbundled/definition78.js +1 -1
- package/unbundled/definition79.cjs +0 -2
- package/unbundled/definition79.js +0 -2
- package/unbundled/definition80.cjs +1 -1
- package/unbundled/definition80.js +1 -1
- package/unbundled/definition9.cjs +2 -2
- package/unbundled/definition9.js +2 -2
- package/unbundled/en-US.cjs +449 -0
- package/unbundled/en-US.js +445 -0
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +2 -2
- package/unbundled/listbox.cjs +7 -7
- package/unbundled/listbox.js +7 -7
- package/unbundled/localized.cjs +2 -2
- package/unbundled/localized.js +1 -1
- package/unbundled/numberConverter.cjs +1 -1
- package/unbundled/numberConverter.js +1 -1
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/slottable-request.cjs +5 -5
- package/unbundled/slottable-request.js +5 -5
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/unbundled/with-contextual-help.cjs +4 -1
- package/unbundled/with-contextual-help.js +4 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +60 -18
|
@@ -22,7 +22,7 @@ function formatTime(time) {
|
|
|
22
22
|
if (!time || Number.isNaN(time)) return "0:00";
|
|
23
23
|
const min = Math.floor(time / 60);
|
|
24
24
|
const sec = Math.floor(time % 60);
|
|
25
|
-
return min
|
|
25
|
+
return `${min}:${sec < 10 ? `0${sec}` : sec}`;
|
|
26
26
|
}
|
|
27
27
|
var PAUSE = true;
|
|
28
28
|
var PLAY = false;
|
|
@@ -44,6 +44,75 @@ var validSkipByConverter = {
|
|
|
44
44
|
* @event {CustomEvent<undefined>} pause - Fires when the audio playback is paused.
|
|
45
45
|
*/
|
|
46
46
|
var AudioPlayer = class extends require_localized.Localized(require_vivid_element.VividElement) {
|
|
47
|
+
constructor(..._args) {
|
|
48
|
+
super(..._args);
|
|
49
|
+
this.playButtonAriaLabel = null;
|
|
50
|
+
this.pauseButtonAriaLabel = null;
|
|
51
|
+
this.sliderAriaLabel = null;
|
|
52
|
+
this.skipForwardButtonAriaLabel = null;
|
|
53
|
+
this.skipBackwardButtonAriaLabel = null;
|
|
54
|
+
this.disabled = false;
|
|
55
|
+
this.notime = false;
|
|
56
|
+
this.playbackRates = null;
|
|
57
|
+
this.#playerEl = new Audio();
|
|
58
|
+
this.#isProgrammaticSliderUpdate = false;
|
|
59
|
+
this.durationFallback = false;
|
|
60
|
+
this.#onPlay = () => {
|
|
61
|
+
if (!this.#sliderEl?.isDragging) this.$emit("play", void 0, { bubbles: false });
|
|
62
|
+
};
|
|
63
|
+
this.#onPause = () => {
|
|
64
|
+
if (!this.#sliderEl?.isDragging) this.$emit("pause", void 0, { bubbles: false });
|
|
65
|
+
};
|
|
66
|
+
this.#pausedChanged = (pausing) => {
|
|
67
|
+
if (pausing === this.paused) {
|
|
68
|
+
this.#setPausedState();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (!this.paused) this.#playerEl.pause();
|
|
72
|
+
else {
|
|
73
|
+
this.#updateProgress();
|
|
74
|
+
this.#playerEl.play();
|
|
75
|
+
}
|
|
76
|
+
this.#setPausedState();
|
|
77
|
+
};
|
|
78
|
+
this.#updateProgress = () => {
|
|
79
|
+
_microsoft_fast_element.Observable.notify(this, "currentTime");
|
|
80
|
+
const duration = this.duration;
|
|
81
|
+
const currentTime = this.currentTime;
|
|
82
|
+
const isValid = Number.isFinite(duration) && duration > 0 && Number.isFinite(currentTime) && currentTime >= 0;
|
|
83
|
+
const percent = isValid ? currentTime / duration * 100 : 0;
|
|
84
|
+
/* v8 ignore else -- @preserve */
|
|
85
|
+
if (this.#sliderEl) {
|
|
86
|
+
this.#isProgrammaticSliderUpdate = true;
|
|
87
|
+
this.#sliderEl.value = percent.toString();
|
|
88
|
+
this.#isProgrammaticSliderUpdate = false;
|
|
89
|
+
}
|
|
90
|
+
if (isValid && percent === 100) this.pause();
|
|
91
|
+
};
|
|
92
|
+
this.#updateTotalTime = () => {
|
|
93
|
+
_microsoft_fast_element.Observable.notify(this, "duration");
|
|
94
|
+
if (!Number.isFinite(this.#playerEl.duration) || this.#playerEl.duration <= 0) {
|
|
95
|
+
if (this.durationFallback) this.#fetchAndCacheAudioBuffer();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
this.#updateCurrentTimeOnSliderChange = () => {
|
|
99
|
+
if (!this.paused && this.#sliderEl.isDragging) {
|
|
100
|
+
this.pause();
|
|
101
|
+
this.#dragInterval = window.setInterval(() => {
|
|
102
|
+
/* v8 ignore else -- @preserve */
|
|
103
|
+
if (!this.#sliderEl.isDragging || !this.isConnected) {
|
|
104
|
+
clearInterval(this.#dragInterval);
|
|
105
|
+
if (this.isConnected) this.play();
|
|
106
|
+
}
|
|
107
|
+
}, 0);
|
|
108
|
+
}
|
|
109
|
+
if (this.#isProgrammaticSliderUpdate) return;
|
|
110
|
+
this.currentTime = this.duration * Number(this.#sliderEl.value) / 100;
|
|
111
|
+
};
|
|
112
|
+
this.#setPausedState = () => {
|
|
113
|
+
_microsoft_fast_element.Observable.notify(this, "paused");
|
|
114
|
+
};
|
|
115
|
+
}
|
|
47
116
|
/**
|
|
48
117
|
* @internal
|
|
49
118
|
*/
|
|
@@ -133,76 +202,6 @@ var AudioPlayer = class extends require_localized.Localized(require_vivid_elemen
|
|
|
133
202
|
}
|
|
134
203
|
#playerEl;
|
|
135
204
|
#isProgrammaticSliderUpdate;
|
|
136
|
-
constructor() {
|
|
137
|
-
super();
|
|
138
|
-
this.playButtonAriaLabel = null;
|
|
139
|
-
this.pauseButtonAriaLabel = null;
|
|
140
|
-
this.sliderAriaLabel = null;
|
|
141
|
-
this.skipForwardButtonAriaLabel = null;
|
|
142
|
-
this.skipBackwardButtonAriaLabel = null;
|
|
143
|
-
this.disabled = false;
|
|
144
|
-
this.notime = false;
|
|
145
|
-
this.playbackRates = null;
|
|
146
|
-
this.#playerEl = new Audio();
|
|
147
|
-
this.#isProgrammaticSliderUpdate = false;
|
|
148
|
-
this.durationFallback = false;
|
|
149
|
-
this.#onPlay = () => {
|
|
150
|
-
if (!this.#sliderEl?.isDragging) this.$emit("play", void 0, { bubbles: false });
|
|
151
|
-
};
|
|
152
|
-
this.#onPause = () => {
|
|
153
|
-
if (!this.#sliderEl?.isDragging) this.$emit("pause", void 0, { bubbles: false });
|
|
154
|
-
};
|
|
155
|
-
this.#pausedChanged = (pausing) => {
|
|
156
|
-
if (pausing === this.paused) {
|
|
157
|
-
this.#setPausedState();
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (!this.paused) this.#playerEl.pause();
|
|
161
|
-
else {
|
|
162
|
-
this.#updateProgress();
|
|
163
|
-
this.#playerEl.play();
|
|
164
|
-
}
|
|
165
|
-
this.#setPausedState();
|
|
166
|
-
};
|
|
167
|
-
this.#updateProgress = () => {
|
|
168
|
-
_microsoft_fast_element.Observable.notify(this, "currentTime");
|
|
169
|
-
const duration = this.duration;
|
|
170
|
-
const currentTime = this.currentTime;
|
|
171
|
-
const isValid = Number.isFinite(duration) && duration > 0 && Number.isFinite(currentTime) && currentTime >= 0;
|
|
172
|
-
const percent = isValid ? currentTime / duration * 100 : 0;
|
|
173
|
-
/* v8 ignore else -- @preserve */
|
|
174
|
-
if (this.#sliderEl) {
|
|
175
|
-
this.#isProgrammaticSliderUpdate = true;
|
|
176
|
-
this.#sliderEl.value = percent.toString();
|
|
177
|
-
this.#isProgrammaticSliderUpdate = false;
|
|
178
|
-
}
|
|
179
|
-
if (isValid && percent === 100) this.pause();
|
|
180
|
-
};
|
|
181
|
-
this.#updateTotalTime = () => {
|
|
182
|
-
_microsoft_fast_element.Observable.notify(this, "duration");
|
|
183
|
-
if (!Number.isFinite(this.#playerEl.duration) || this.#playerEl.duration <= 0) {
|
|
184
|
-
if (this.durationFallback) this.#fetchAndCacheAudioBuffer();
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
this.#updateCurrentTimeOnSliderChange = () => {
|
|
188
|
-
if (!this.paused && this.#sliderEl.isDragging) {
|
|
189
|
-
this.pause();
|
|
190
|
-
this.#dragInterval = window.setInterval(() => {
|
|
191
|
-
/* v8 ignore else -- @preserve */
|
|
192
|
-
if (!this.#sliderEl.isDragging || !this.isConnected) {
|
|
193
|
-
clearInterval(this.#dragInterval);
|
|
194
|
-
if (this.isConnected) this.play();
|
|
195
|
-
}
|
|
196
|
-
}, 0);
|
|
197
|
-
}
|
|
198
|
-
if (this.#isProgrammaticSliderUpdate) return;
|
|
199
|
-
/* v8 ignore else -- @preserve */
|
|
200
|
-
if (this.#playerEl) this.currentTime = this.duration * Number(this.#sliderEl.value) / 100;
|
|
201
|
-
};
|
|
202
|
-
this.#setPausedState = () => {
|
|
203
|
-
_microsoft_fast_element.Observable.notify(this, "paused");
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
205
|
connectedCallback() {
|
|
207
206
|
super.connectedCallback();
|
|
208
207
|
this.#playerEl.addEventListener("timeupdate", this.#updateProgress);
|
|
@@ -275,7 +274,7 @@ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
|
275
274
|
})], AudioPlayer.prototype, "durationFallback", void 0);
|
|
276
275
|
//#endregion
|
|
277
276
|
//#region src/lib/audio-player/audio-player.template.ts
|
|
278
|
-
var getClasses = ({ notime, disabled, duration, skipBy, playbackRates }) => (0, _microsoft_fast_web_utilities.classNames)(["disabled",
|
|
277
|
+
var getClasses = ({ notime, disabled, duration, skipBy, playbackRates }) => (0, _microsoft_fast_web_utilities.classNames)(["disabled", disabled || !duration], ["two-lines", !notime && (Boolean(Number(skipBy)) || Boolean(playbackRates))], ["playback", Boolean(playbackRates)]);
|
|
279
278
|
var isMenuItemChekced = (playbackRate, { parent }) => {
|
|
280
279
|
return playbackRate === parent.playbackRate;
|
|
281
280
|
};
|
|
@@ -330,12 +329,10 @@ function renderSlider(context) {
|
|
|
330
329
|
}
|
|
331
330
|
function renderTimestamp() {
|
|
332
331
|
return _microsoft_fast_element.html` <div class="time-stamp">
|
|
333
|
-
<span class="current-time"
|
|
334
|
-
>${(x) => formatTime(x.currentTime || 0)}</span
|
|
335
|
-
>
|
|
332
|
+
<span class="current-time">${(x) => formatTime(x.currentTime || 0)}</span>
|
|
336
333
|
${(0, _microsoft_fast_element.when)((x) => x.duration && x.duration !== Infinity, _microsoft_fast_element.html`
|
|
337
334
|
<span>/</span>
|
|
338
|
-
<span class="total-time">${(x) => formatTime(x
|
|
335
|
+
<span class="total-time">${(x) => formatTime(x.duration)}</span>
|
|
339
336
|
`)}
|
|
340
337
|
</div>`;
|
|
341
338
|
}
|
|
@@ -21,7 +21,7 @@ function formatTime(time) {
|
|
|
21
21
|
if (!time || Number.isNaN(time)) return "0:00";
|
|
22
22
|
const min = Math.floor(time / 60);
|
|
23
23
|
const sec = Math.floor(time % 60);
|
|
24
|
-
return min
|
|
24
|
+
return `${min}:${sec < 10 ? `0${sec}` : sec}`;
|
|
25
25
|
}
|
|
26
26
|
var PAUSE = true;
|
|
27
27
|
var PLAY = false;
|
|
@@ -43,6 +43,75 @@ var validSkipByConverter = {
|
|
|
43
43
|
* @event {CustomEvent<undefined>} pause - Fires when the audio playback is paused.
|
|
44
44
|
*/
|
|
45
45
|
var AudioPlayer = class extends Localized(VividElement) {
|
|
46
|
+
constructor(..._args) {
|
|
47
|
+
super(..._args);
|
|
48
|
+
this.playButtonAriaLabel = null;
|
|
49
|
+
this.pauseButtonAriaLabel = null;
|
|
50
|
+
this.sliderAriaLabel = null;
|
|
51
|
+
this.skipForwardButtonAriaLabel = null;
|
|
52
|
+
this.skipBackwardButtonAriaLabel = null;
|
|
53
|
+
this.disabled = false;
|
|
54
|
+
this.notime = false;
|
|
55
|
+
this.playbackRates = null;
|
|
56
|
+
this.#playerEl = new Audio();
|
|
57
|
+
this.#isProgrammaticSliderUpdate = false;
|
|
58
|
+
this.durationFallback = false;
|
|
59
|
+
this.#onPlay = () => {
|
|
60
|
+
if (!this.#sliderEl?.isDragging) this.$emit("play", void 0, { bubbles: false });
|
|
61
|
+
};
|
|
62
|
+
this.#onPause = () => {
|
|
63
|
+
if (!this.#sliderEl?.isDragging) this.$emit("pause", void 0, { bubbles: false });
|
|
64
|
+
};
|
|
65
|
+
this.#pausedChanged = (pausing) => {
|
|
66
|
+
if (pausing === this.paused) {
|
|
67
|
+
this.#setPausedState();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (!this.paused) this.#playerEl.pause();
|
|
71
|
+
else {
|
|
72
|
+
this.#updateProgress();
|
|
73
|
+
this.#playerEl.play();
|
|
74
|
+
}
|
|
75
|
+
this.#setPausedState();
|
|
76
|
+
};
|
|
77
|
+
this.#updateProgress = () => {
|
|
78
|
+
Observable.notify(this, "currentTime");
|
|
79
|
+
const duration = this.duration;
|
|
80
|
+
const currentTime = this.currentTime;
|
|
81
|
+
const isValid = Number.isFinite(duration) && duration > 0 && Number.isFinite(currentTime) && currentTime >= 0;
|
|
82
|
+
const percent = isValid ? currentTime / duration * 100 : 0;
|
|
83
|
+
/* v8 ignore else -- @preserve */
|
|
84
|
+
if (this.#sliderEl) {
|
|
85
|
+
this.#isProgrammaticSliderUpdate = true;
|
|
86
|
+
this.#sliderEl.value = percent.toString();
|
|
87
|
+
this.#isProgrammaticSliderUpdate = false;
|
|
88
|
+
}
|
|
89
|
+
if (isValid && percent === 100) this.pause();
|
|
90
|
+
};
|
|
91
|
+
this.#updateTotalTime = () => {
|
|
92
|
+
Observable.notify(this, "duration");
|
|
93
|
+
if (!Number.isFinite(this.#playerEl.duration) || this.#playerEl.duration <= 0) {
|
|
94
|
+
if (this.durationFallback) this.#fetchAndCacheAudioBuffer();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
this.#updateCurrentTimeOnSliderChange = () => {
|
|
98
|
+
if (!this.paused && this.#sliderEl.isDragging) {
|
|
99
|
+
this.pause();
|
|
100
|
+
this.#dragInterval = window.setInterval(() => {
|
|
101
|
+
/* v8 ignore else -- @preserve */
|
|
102
|
+
if (!this.#sliderEl.isDragging || !this.isConnected) {
|
|
103
|
+
clearInterval(this.#dragInterval);
|
|
104
|
+
if (this.isConnected) this.play();
|
|
105
|
+
}
|
|
106
|
+
}, 0);
|
|
107
|
+
}
|
|
108
|
+
if (this.#isProgrammaticSliderUpdate) return;
|
|
109
|
+
this.currentTime = this.duration * Number(this.#sliderEl.value) / 100;
|
|
110
|
+
};
|
|
111
|
+
this.#setPausedState = () => {
|
|
112
|
+
Observable.notify(this, "paused");
|
|
113
|
+
};
|
|
114
|
+
}
|
|
46
115
|
/**
|
|
47
116
|
* @internal
|
|
48
117
|
*/
|
|
@@ -132,76 +201,6 @@ var AudioPlayer = class extends Localized(VividElement) {
|
|
|
132
201
|
}
|
|
133
202
|
#playerEl;
|
|
134
203
|
#isProgrammaticSliderUpdate;
|
|
135
|
-
constructor() {
|
|
136
|
-
super();
|
|
137
|
-
this.playButtonAriaLabel = null;
|
|
138
|
-
this.pauseButtonAriaLabel = null;
|
|
139
|
-
this.sliderAriaLabel = null;
|
|
140
|
-
this.skipForwardButtonAriaLabel = null;
|
|
141
|
-
this.skipBackwardButtonAriaLabel = null;
|
|
142
|
-
this.disabled = false;
|
|
143
|
-
this.notime = false;
|
|
144
|
-
this.playbackRates = null;
|
|
145
|
-
this.#playerEl = new Audio();
|
|
146
|
-
this.#isProgrammaticSliderUpdate = false;
|
|
147
|
-
this.durationFallback = false;
|
|
148
|
-
this.#onPlay = () => {
|
|
149
|
-
if (!this.#sliderEl?.isDragging) this.$emit("play", void 0, { bubbles: false });
|
|
150
|
-
};
|
|
151
|
-
this.#onPause = () => {
|
|
152
|
-
if (!this.#sliderEl?.isDragging) this.$emit("pause", void 0, { bubbles: false });
|
|
153
|
-
};
|
|
154
|
-
this.#pausedChanged = (pausing) => {
|
|
155
|
-
if (pausing === this.paused) {
|
|
156
|
-
this.#setPausedState();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (!this.paused) this.#playerEl.pause();
|
|
160
|
-
else {
|
|
161
|
-
this.#updateProgress();
|
|
162
|
-
this.#playerEl.play();
|
|
163
|
-
}
|
|
164
|
-
this.#setPausedState();
|
|
165
|
-
};
|
|
166
|
-
this.#updateProgress = () => {
|
|
167
|
-
Observable.notify(this, "currentTime");
|
|
168
|
-
const duration = this.duration;
|
|
169
|
-
const currentTime = this.currentTime;
|
|
170
|
-
const isValid = Number.isFinite(duration) && duration > 0 && Number.isFinite(currentTime) && currentTime >= 0;
|
|
171
|
-
const percent = isValid ? currentTime / duration * 100 : 0;
|
|
172
|
-
/* v8 ignore else -- @preserve */
|
|
173
|
-
if (this.#sliderEl) {
|
|
174
|
-
this.#isProgrammaticSliderUpdate = true;
|
|
175
|
-
this.#sliderEl.value = percent.toString();
|
|
176
|
-
this.#isProgrammaticSliderUpdate = false;
|
|
177
|
-
}
|
|
178
|
-
if (isValid && percent === 100) this.pause();
|
|
179
|
-
};
|
|
180
|
-
this.#updateTotalTime = () => {
|
|
181
|
-
Observable.notify(this, "duration");
|
|
182
|
-
if (!Number.isFinite(this.#playerEl.duration) || this.#playerEl.duration <= 0) {
|
|
183
|
-
if (this.durationFallback) this.#fetchAndCacheAudioBuffer();
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
this.#updateCurrentTimeOnSliderChange = () => {
|
|
187
|
-
if (!this.paused && this.#sliderEl.isDragging) {
|
|
188
|
-
this.pause();
|
|
189
|
-
this.#dragInterval = window.setInterval(() => {
|
|
190
|
-
/* v8 ignore else -- @preserve */
|
|
191
|
-
if (!this.#sliderEl.isDragging || !this.isConnected) {
|
|
192
|
-
clearInterval(this.#dragInterval);
|
|
193
|
-
if (this.isConnected) this.play();
|
|
194
|
-
}
|
|
195
|
-
}, 0);
|
|
196
|
-
}
|
|
197
|
-
if (this.#isProgrammaticSliderUpdate) return;
|
|
198
|
-
/* v8 ignore else -- @preserve */
|
|
199
|
-
if (this.#playerEl) this.currentTime = this.duration * Number(this.#sliderEl.value) / 100;
|
|
200
|
-
};
|
|
201
|
-
this.#setPausedState = () => {
|
|
202
|
-
Observable.notify(this, "paused");
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
204
|
connectedCallback() {
|
|
206
205
|
super.connectedCallback();
|
|
207
206
|
this.#playerEl.addEventListener("timeupdate", this.#updateProgress);
|
|
@@ -274,7 +273,7 @@ __decorate([attr({
|
|
|
274
273
|
})], AudioPlayer.prototype, "durationFallback", void 0);
|
|
275
274
|
//#endregion
|
|
276
275
|
//#region src/lib/audio-player/audio-player.template.ts
|
|
277
|
-
var getClasses = ({ notime, disabled, duration, skipBy, playbackRates }) => classNames(["disabled",
|
|
276
|
+
var getClasses = ({ notime, disabled, duration, skipBy, playbackRates }) => classNames(["disabled", disabled || !duration], ["two-lines", !notime && (Boolean(Number(skipBy)) || Boolean(playbackRates))], ["playback", Boolean(playbackRates)]);
|
|
278
277
|
var isMenuItemChekced = (playbackRate, { parent }) => {
|
|
279
278
|
return playbackRate === parent.playbackRate;
|
|
280
279
|
};
|
|
@@ -329,12 +328,10 @@ function renderSlider(context) {
|
|
|
329
328
|
}
|
|
330
329
|
function renderTimestamp() {
|
|
331
330
|
return html` <div class="time-stamp">
|
|
332
|
-
<span class="current-time"
|
|
333
|
-
>${(x) => formatTime(x.currentTime || 0)}</span
|
|
334
|
-
>
|
|
331
|
+
<span class="current-time">${(x) => formatTime(x.currentTime || 0)}</span>
|
|
335
332
|
${when((x) => x.duration && x.duration !== Infinity, html`
|
|
336
333
|
<span>/</span>
|
|
337
|
-
<span class="total-time">${(x) => formatTime(x
|
|
334
|
+
<span class="total-time">${(x) => formatTime(x.duration)}</span>
|
|
338
335
|
`)}
|
|
339
336
|
</div>`;
|
|
340
337
|
}
|
|
@@ -41,7 +41,7 @@ var getClasses = ({ appearance, connotation, shape, size }) => (0, _microsoft_fa
|
|
|
41
41
|
*/
|
|
42
42
|
function renderIcon(iconTag) {
|
|
43
43
|
return _microsoft_fast_element.html`
|
|
44
|
-
<${iconTag} name="${(x) => x.icon ?
|
|
44
|
+
<${iconTag} name="${(x) => x.icon ? x.icon : "user-line"}"></${iconTag}>
|
|
45
45
|
`;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -40,7 +40,7 @@ var getClasses = ({ appearance, connotation, shape, size }) => classNames("base"
|
|
|
40
40
|
*/
|
|
41
41
|
function renderIcon(iconTag) {
|
|
42
42
|
return html`
|
|
43
|
-
<${iconTag} name="${(x) => x.icon ?
|
|
43
|
+
<${iconTag} name="${(x) => x.icon ? x.icon : "user-line"}"></${iconTag}>
|
|
44
44
|
`;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
@@ -10,7 +10,7 @@ const require_enums = require("./enums.cjs");
|
|
|
10
10
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
11
11
|
let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
|
|
12
12
|
//#region src/lib/banner/banner.scss?inline
|
|
13
|
-
var banner_default = ":host{display:block}.control.connotation-success{--_connotation-color-primary:var(--vvd-banner-success-primary,var(--vvd-color-success-500));--_connotation-color-primary-text:var(--vvd-banner-success-primary-text,var(--vvd-color-canvas))}.control.connotation-alert{--_connotation-color-primary:var(--vvd-banner-alert-primary,var(--vvd-color-alert-500));--_connotation-color-primary-text:var(--vvd-banner-alert-primary-text,var(--vvd-color-canvas))}.control.connotation-announcement{--_connotation-color-primary:var(--vvd-banner-announcement-primary,var(--vvd-color-announcement-500));--_connotation-color-primary-text:var(--vvd-banner-announcement-primary-text,var(--vvd-color-canvas))}.control.connotation-warning{--_connotation-color-primary:var(--vvd-banner-warning-primary,var(--vvd-color-warning-300));--_connotation-color-primary-text:var(--vvd-banner-warning-primary-text,var(--vvd-color-canvas-text))}.control:not(.connotation-success,.connotation-alert,.connotation-announcement,.connotation-warning){--_connotation-color-primary:var(--vvd-banner-information-primary,var(--vvd-color-information-500));--_connotation-color-primary-text:var(--vvd-banner-information-primary-text,var(--vvd-color-canvas))}.control{--_appearance-color-text:var(--_connotation-color-primary-text);--_appearance-color-fill:var(--_connotation-color-primary);--_appearance-color-outline:transparent;background-color:var(--_appearance-color-fill);max-height:160px;color:var(--_appearance-color-text);transition:max-height var(--transition-delay,.2s);overflow:hidden}.control.removing{max-height:0}.header{box-sizing:border-box;font:var(--vvd-typography-base-bold);inline-size:100%;min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 20));align-items:center;display:flex}.header .content{flex-grow:1;justify-content:center;align-items:center;column-gap:16px;inline-size:100%;padding:10px 16px;display:flex}.header .content slot[name=icon]{flex-shrink:0;font-size:20px;line-height:1}.header .content .action-items{flex-shrink:0}.header .dismiss-button{flex-shrink:0;margin-inline-end:8px}";
|
|
13
|
+
var banner_default = ":host{display:block}.control.connotation-success{--_connotation-color-primary:var(--vvd-banner-success-primary,var(--vvd-color-success-500));--_connotation-color-primary-text:var(--vvd-banner-success-primary-text,var(--vvd-color-canvas))}.control.connotation-alert{--_connotation-color-primary:var(--vvd-banner-alert-primary,var(--vvd-color-alert-500));--_connotation-color-primary-text:var(--vvd-banner-alert-primary-text,var(--vvd-color-canvas))}.control.connotation-announcement{--_connotation-color-primary:var(--vvd-banner-announcement-primary,var(--vvd-color-announcement-500));--_connotation-color-primary-text:var(--vvd-banner-announcement-primary-text,var(--vvd-color-canvas))}.control.connotation-warning{--_connotation-color-primary:var(--vvd-banner-warning-primary,var(--vvd-color-warning-300));--_connotation-color-primary-text:var(--vvd-banner-warning-primary-text,var(--vvd-color-canvas-text))}.control:not(.connotation-success,.connotation-alert,.connotation-announcement,.connotation-warning){--_connotation-color-primary:var(--vvd-banner-information-primary,var(--vvd-color-information-500));--_connotation-color-primary-text:var(--vvd-banner-information-primary-text,var(--vvd-color-canvas))}.control{--_appearance-color-text:var(--_connotation-color-primary-text);--_appearance-color-fill:var(--_connotation-color-primary);--_appearance-color-outline:transparent;background-color:var(--_appearance-color-fill);max-height:160px;color:var(--_appearance-color-text);transition:max-height var(--transition-delay,.2s);overflow:hidden}@media (prefers-reduced-motion:reduce){.control{transition-duration:.01ms}}.control.removing{max-height:0}.header{box-sizing:border-box;font:var(--vvd-typography-base-bold);inline-size:100%;min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 20));align-items:center;display:flex}.header .content{flex-grow:1;justify-content:center;align-items:center;column-gap:16px;inline-size:100%;padding:10px 16px;display:flex}.header .content slot[name=icon]{flex-shrink:0;font-size:20px;line-height:1}.header .content .action-items{flex-shrink:0}.header .dismiss-button{flex-shrink:0;margin-inline-end:8px}";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/lib/banner/banner.ts
|
|
16
16
|
var CONNOTATION_ICON_MAP = {
|
|
@@ -37,7 +37,7 @@ var Banner = class extends require_affix.AffixIcon(require_localized.Localized(r
|
|
|
37
37
|
this.removable = false;
|
|
38
38
|
this.#handleRemoveEnd = () => {
|
|
39
39
|
this.$emit("removed");
|
|
40
|
-
this.parentElement
|
|
40
|
+
this.parentElement?.removeChild(this);
|
|
41
41
|
};
|
|
42
42
|
this.#closeOnKeyDown = (e) => {
|
|
43
43
|
if (e.key !== "Escape" || !this.removable) return;
|
|
@@ -9,7 +9,7 @@ import { r as Connotation } from "./enums.js";
|
|
|
9
9
|
import { attr, html, observable, slotted, when } from "@microsoft/fast-element";
|
|
10
10
|
import { classNames } from "@microsoft/fast-web-utilities";
|
|
11
11
|
//#region src/lib/banner/banner.scss?inline
|
|
12
|
-
var banner_default = ":host{display:block}.control.connotation-success{--_connotation-color-primary:var(--vvd-banner-success-primary,var(--vvd-color-success-500));--_connotation-color-primary-text:var(--vvd-banner-success-primary-text,var(--vvd-color-canvas))}.control.connotation-alert{--_connotation-color-primary:var(--vvd-banner-alert-primary,var(--vvd-color-alert-500));--_connotation-color-primary-text:var(--vvd-banner-alert-primary-text,var(--vvd-color-canvas))}.control.connotation-announcement{--_connotation-color-primary:var(--vvd-banner-announcement-primary,var(--vvd-color-announcement-500));--_connotation-color-primary-text:var(--vvd-banner-announcement-primary-text,var(--vvd-color-canvas))}.control.connotation-warning{--_connotation-color-primary:var(--vvd-banner-warning-primary,var(--vvd-color-warning-300));--_connotation-color-primary-text:var(--vvd-banner-warning-primary-text,var(--vvd-color-canvas-text))}.control:not(.connotation-success,.connotation-alert,.connotation-announcement,.connotation-warning){--_connotation-color-primary:var(--vvd-banner-information-primary,var(--vvd-color-information-500));--_connotation-color-primary-text:var(--vvd-banner-information-primary-text,var(--vvd-color-canvas))}.control{--_appearance-color-text:var(--_connotation-color-primary-text);--_appearance-color-fill:var(--_connotation-color-primary);--_appearance-color-outline:transparent;background-color:var(--_appearance-color-fill);max-height:160px;color:var(--_appearance-color-text);transition:max-height var(--transition-delay,.2s);overflow:hidden}.control.removing{max-height:0}.header{box-sizing:border-box;font:var(--vvd-typography-base-bold);inline-size:100%;min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 20));align-items:center;display:flex}.header .content{flex-grow:1;justify-content:center;align-items:center;column-gap:16px;inline-size:100%;padding:10px 16px;display:flex}.header .content slot[name=icon]{flex-shrink:0;font-size:20px;line-height:1}.header .content .action-items{flex-shrink:0}.header .dismiss-button{flex-shrink:0;margin-inline-end:8px}";
|
|
12
|
+
var banner_default = ":host{display:block}.control.connotation-success{--_connotation-color-primary:var(--vvd-banner-success-primary,var(--vvd-color-success-500));--_connotation-color-primary-text:var(--vvd-banner-success-primary-text,var(--vvd-color-canvas))}.control.connotation-alert{--_connotation-color-primary:var(--vvd-banner-alert-primary,var(--vvd-color-alert-500));--_connotation-color-primary-text:var(--vvd-banner-alert-primary-text,var(--vvd-color-canvas))}.control.connotation-announcement{--_connotation-color-primary:var(--vvd-banner-announcement-primary,var(--vvd-color-announcement-500));--_connotation-color-primary-text:var(--vvd-banner-announcement-primary-text,var(--vvd-color-canvas))}.control.connotation-warning{--_connotation-color-primary:var(--vvd-banner-warning-primary,var(--vvd-color-warning-300));--_connotation-color-primary-text:var(--vvd-banner-warning-primary-text,var(--vvd-color-canvas-text))}.control:not(.connotation-success,.connotation-alert,.connotation-announcement,.connotation-warning){--_connotation-color-primary:var(--vvd-banner-information-primary,var(--vvd-color-information-500));--_connotation-color-primary-text:var(--vvd-banner-information-primary-text,var(--vvd-color-canvas))}.control{--_appearance-color-text:var(--_connotation-color-primary-text);--_appearance-color-fill:var(--_connotation-color-primary);--_appearance-color-outline:transparent;background-color:var(--_appearance-color-fill);max-height:160px;color:var(--_appearance-color-text);transition:max-height var(--transition-delay,.2s);overflow:hidden}@media (prefers-reduced-motion:reduce){.control{transition-duration:.01ms}}.control.removing{max-height:0}.header{box-sizing:border-box;font:var(--vvd-typography-base-bold);inline-size:100%;min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 20));align-items:center;display:flex}.header .content{flex-grow:1;justify-content:center;align-items:center;column-gap:16px;inline-size:100%;padding:10px 16px;display:flex}.header .content slot[name=icon]{flex-shrink:0;font-size:20px;line-height:1}.header .content .action-items{flex-shrink:0}.header .dismiss-button{flex-shrink:0;margin-inline-end:8px}";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/lib/banner/banner.ts
|
|
15
15
|
var CONNOTATION_ICON_MAP = {
|
|
@@ -36,7 +36,7 @@ var Banner = class extends AffixIcon(Localized(DelegatesAria(VividElement))) {
|
|
|
36
36
|
this.removable = false;
|
|
37
37
|
this.#handleRemoveEnd = () => {
|
|
38
38
|
this.$emit("removed");
|
|
39
|
-
this.parentElement
|
|
39
|
+
this.parentElement?.removeChild(this);
|
|
40
40
|
};
|
|
41
41
|
this.#closeOnKeyDown = (e) => {
|
|
42
42
|
if (e.key !== "Escape" || !this.removable) return;
|
|
@@ -61,7 +61,8 @@ var Breadcrumb = class extends require_delegates_aria.DelegatesAria(require_vivi
|
|
|
61
61
|
*/
|
|
62
62
|
setAriaCurrent(item, isLastNode) {
|
|
63
63
|
const childNodeWithHref = this.findChildWithHref(item);
|
|
64
|
-
if (childNodeWithHref !== null) isLastNode
|
|
64
|
+
if (childNodeWithHref !== null) if (isLastNode) childNodeWithHref.setAttribute("aria-current", "page");
|
|
65
|
+
else childNodeWithHref.removeAttribute("aria-current");
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
require_decorate.__decorate([_microsoft_fast_element.observable], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0);
|
|
@@ -60,7 +60,8 @@ var Breadcrumb = class extends DelegatesAria(VividElement) {
|
|
|
60
60
|
*/
|
|
61
61
|
setAriaCurrent(item, isLastNode) {
|
|
62
62
|
const childNodeWithHref = this.findChildWithHref(item);
|
|
63
|
-
if (childNodeWithHref !== null) isLastNode
|
|
63
|
+
if (childNodeWithHref !== null) if (isLastNode) childNodeWithHref.setAttribute("aria-current", "page");
|
|
64
|
+
else childNodeWithHref.removeAttribute("aria-current");
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
__decorate([observable], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0);
|
|
@@ -93,7 +93,7 @@ var header = (context, hTagName) => {
|
|
|
93
93
|
`;
|
|
94
94
|
};
|
|
95
95
|
var AccordionItemTemplate = (context) => _microsoft_fast_element.html`
|
|
96
|
-
${(x) => header(context,
|
|
96
|
+
${(x) => header(context, `h${x.headinglevel}`)}
|
|
97
97
|
<div
|
|
98
98
|
id="${(x) => x.id}-panel"
|
|
99
99
|
aria-labelledby="${(x) => x.id}"
|
package/unbundled/definition2.js
CHANGED
|
@@ -92,7 +92,7 @@ var header = (context, hTagName) => {
|
|
|
92
92
|
`;
|
|
93
93
|
};
|
|
94
94
|
var AccordionItemTemplate = (context) => html`
|
|
95
|
-
${(x) => header(context,
|
|
95
|
+
${(x) => header(context, `h${x.headinglevel}`)}
|
|
96
96
|
<div
|
|
97
97
|
id="${(x) => x.id}-panel"
|
|
98
98
|
aria-labelledby="${(x) => x.id}"
|
|
@@ -44,7 +44,7 @@ function getDay(el) {
|
|
|
44
44
|
if (cellOrHeader) {
|
|
45
45
|
const { parentElement } = cellOrHeader;
|
|
46
46
|
/* v8 ignore else -- @preserve */
|
|
47
|
-
if (parentElement) return
|
|
47
|
+
if (parentElement) return Array.from(parentElement.children).indexOf(cellOrHeader);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
function getHour(e, el, hours) {
|
|
@@ -58,7 +58,7 @@ function getHour(e, el, hours) {
|
|
|
58
58
|
var getEventContext = function(e) {
|
|
59
59
|
if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");
|
|
60
60
|
const [el] = e.composedPath();
|
|
61
|
-
if (!(el
|
|
61
|
+
if (!(el instanceof HTMLElement && this.shadowRoot.contains(el))) throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");
|
|
62
62
|
const day = getDay(el);
|
|
63
63
|
let hour;
|
|
64
64
|
if (e instanceof MouseEvent) hour = getHour(e, el, this._hours);
|
|
@@ -97,7 +97,7 @@ var Calendar = class extends require_vivid_element.VividElement {
|
|
|
97
97
|
this.stickyMode = require_enums.Sticky.All;
|
|
98
98
|
this._hours = 24;
|
|
99
99
|
this._days = 7;
|
|
100
|
-
this.hoursAsDatetime = Array.from({ length: this._hours - 1 }).fill(new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(
|
|
100
|
+
this.hoursAsDatetime = Array.from({ length: this._hours - 1 }).fill(new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(i + 1)));
|
|
101
101
|
this._generateDaysArr = (dateArr) => {
|
|
102
102
|
if (dateArr.length == this._days) return dateArr;
|
|
103
103
|
const lastDate = new Date(dateArr[dateArr.length - 1]);
|
|
@@ -43,7 +43,7 @@ function getDay(el) {
|
|
|
43
43
|
if (cellOrHeader) {
|
|
44
44
|
const { parentElement } = cellOrHeader;
|
|
45
45
|
/* v8 ignore else -- @preserve */
|
|
46
|
-
if (parentElement) return
|
|
46
|
+
if (parentElement) return Array.from(parentElement.children).indexOf(cellOrHeader);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
function getHour(e, el, hours) {
|
|
@@ -57,7 +57,7 @@ function getHour(e, el, hours) {
|
|
|
57
57
|
var getEventContext = function(e) {
|
|
58
58
|
if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");
|
|
59
59
|
const [el] = e.composedPath();
|
|
60
|
-
if (!(el
|
|
60
|
+
if (!(el instanceof HTMLElement && this.shadowRoot.contains(el))) throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");
|
|
61
61
|
const day = getDay(el);
|
|
62
62
|
let hour;
|
|
63
63
|
if (e instanceof MouseEvent) hour = getHour(e, el, this._hours);
|
|
@@ -96,7 +96,7 @@ var Calendar = class extends VividElement {
|
|
|
96
96
|
this.stickyMode = Sticky.All;
|
|
97
97
|
this._hours = 24;
|
|
98
98
|
this._days = 7;
|
|
99
|
-
this.hoursAsDatetime = Array.from({ length: this._hours - 1 }).fill(new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(
|
|
99
|
+
this.hoursAsDatetime = Array.from({ length: this._hours - 1 }).fill(new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(i + 1)));
|
|
100
100
|
this._generateDaysArr = (dateArr) => {
|
|
101
101
|
if (dateArr.length == this._days) return dateArr;
|
|
102
102
|
const lastDate = new Date(dateArr[dateArr.length - 1]);
|
|
@@ -78,7 +78,7 @@ var Checkbox = class extends require_delegates_aria.DelegatesAria(require_mixins
|
|
|
78
78
|
*/
|
|
79
79
|
checkedChanged(prev, next) {
|
|
80
80
|
super.checkedChanged(prev, next);
|
|
81
|
-
this.ariaChecked = next
|
|
81
|
+
this.ariaChecked = next ? "true" : "false";
|
|
82
82
|
if (prev !== void 0) this.$emit("input");
|
|
83
83
|
}
|
|
84
84
|
};
|
|
@@ -96,7 +96,7 @@ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
|
96
96
|
require_decorate.__decorate([_microsoft_fast_element.observable], Checkbox.prototype, "slottedContent", void 0);
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/lib/checkbox/checkbox.template.ts
|
|
99
|
-
var getClasses = ({ connotation, readOnly, checked, disabled, indeterminate, errorValidationMessage, successText, label, slottedContent }) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${connotation}`, Boolean(connotation)], ["readonly",
|
|
99
|
+
var getClasses = ({ connotation, readOnly, checked, disabled, indeterminate, errorValidationMessage, successText, label, slottedContent }) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${connotation}`, Boolean(connotation)], ["readonly", readOnly], ["checked", checked || indeterminate], ["disabled", disabled], ["error connotation-alert", Boolean(errorValidationMessage)], ["success connotation-success", !!successText], ["hide-label", !label && !slottedContent?.length]);
|
|
100
100
|
var CheckboxTemplate = (context) => {
|
|
101
101
|
const iconTag = context.tagFor(require_definition.Icon);
|
|
102
102
|
return _microsoft_fast_element.html`<template>
|
|
@@ -77,7 +77,7 @@ var Checkbox = class extends DelegatesAria(WithFeedback(WithErrorText(WithSucces
|
|
|
77
77
|
*/
|
|
78
78
|
checkedChanged(prev, next) {
|
|
79
79
|
super.checkedChanged(prev, next);
|
|
80
|
-
this.ariaChecked = next
|
|
80
|
+
this.ariaChecked = next ? "true" : "false";
|
|
81
81
|
if (prev !== void 0) this.$emit("input");
|
|
82
82
|
}
|
|
83
83
|
};
|
|
@@ -95,7 +95,7 @@ __decorate([attr({
|
|
|
95
95
|
__decorate([observable], Checkbox.prototype, "slottedContent", void 0);
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region src/lib/checkbox/checkbox.template.ts
|
|
98
|
-
var getClasses = ({ connotation, readOnly, checked, disabled, indeterminate, errorValidationMessage, successText, label, slottedContent }) => classNames("base", [`connotation-${connotation}`, Boolean(connotation)], ["readonly",
|
|
98
|
+
var getClasses = ({ connotation, readOnly, checked, disabled, indeterminate, errorValidationMessage, successText, label, slottedContent }) => classNames("base", [`connotation-${connotation}`, Boolean(connotation)], ["readonly", readOnly], ["checked", checked || indeterminate], ["disabled", disabled], ["error connotation-alert", Boolean(errorValidationMessage)], ["success connotation-success", !!successText], ["hide-label", !label && !slottedContent?.length]);
|
|
99
99
|
var CheckboxTemplate = (context) => {
|
|
100
100
|
const iconTag = context.tagFor(Icon);
|
|
101
101
|
return html`<template>
|
|
@@ -70,7 +70,7 @@ var Toggletip = class extends require_localized.Localized(require_anchored.Ancho
|
|
|
70
70
|
#setupAnchor(a) {
|
|
71
71
|
a.addEventListener("click", this.#openIfClosed, true);
|
|
72
72
|
this.#originalAriaLabel = a.ariaLabel;
|
|
73
|
-
a.ariaLabel =
|
|
73
|
+
a.ariaLabel = this.locale.toggletip.anchorLabel(a.ariaLabel || "");
|
|
74
74
|
this.#updateAnchor(a);
|
|
75
75
|
}
|
|
76
76
|
#updateAnchor(a) {
|
|
@@ -69,7 +69,7 @@ var Toggletip = class extends Localized(Anchored(VividElement)) {
|
|
|
69
69
|
#setupAnchor(a) {
|
|
70
70
|
a.addEventListener("click", this.#openIfClosed, true);
|
|
71
71
|
this.#originalAriaLabel = a.ariaLabel;
|
|
72
|
-
a.ariaLabel =
|
|
72
|
+
a.ariaLabel = this.locale.toggletip.anchorLabel(a.ariaLabel || "");
|
|
73
73
|
this.#updateAnchor(a);
|
|
74
74
|
}
|
|
75
75
|
#updateAnchor(a) {
|
|
@@ -96,7 +96,7 @@ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "fromView
|
|
|
96
96
|
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], Tooltip.prototype, "open", void 0);
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/lib/tooltip/tooltip.template.ts
|
|
99
|
-
var getClasses = ({ open }) => (0, _microsoft_fast_web_utilities.classNames)("control", ["open",
|
|
99
|
+
var getClasses = ({ open }) => (0, _microsoft_fast_web_utilities.classNames)("control", ["open", open]);
|
|
100
100
|
var TooltipTemplate = (context) => {
|
|
101
101
|
const popupTag = context.tagFor(require_definition.Popup);
|
|
102
102
|
return _microsoft_fast_element.html`
|
|
@@ -95,7 +95,7 @@ __decorate([attr({ mode: "fromView" })], Tooltip.prototype, "placement", void 0)
|
|
|
95
95
|
__decorate([attr({ mode: "boolean" })], Tooltip.prototype, "open", void 0);
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region src/lib/tooltip/tooltip.template.ts
|
|
98
|
-
var getClasses = ({ open }) => classNames("control", ["open",
|
|
98
|
+
var getClasses = ({ open }) => classNames("control", ["open", open]);
|
|
99
99
|
var TooltipTemplate = (context) => {
|
|
100
100
|
const popupTag = context.tagFor(Popup);
|
|
101
101
|
return html`
|