@vonage/vivid 5.21.0 → 5.23.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 +1 -1
- 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 +1 -1
- 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 +14 -5
- 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 -1
- 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 +2 -2
- 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 +6 -6
- package/country-group/index.cjs +1 -1
- package/country-group/index.js +1 -1
- package/custom-elements.json +1270 -1228
- 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/fab/index.cjs +1 -1
- package/fab/index.js +1 -0
- 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/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/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/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 +9 -7
- 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 +4 -3
- package/rich-text-editor/index.js +55 -27
- 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/split-button/index.cjs +1 -1
- package/split-button/index.js +2 -0
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/table/index.cjs +5 -5
- package/table/index.js +5 -5
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +2 -2
- 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/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 +1 -1
- package/unbundled/definition17.js +1 -1
- 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 +7 -7
- package/unbundled/definition30.js +7 -7
- 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/definition42.cjs +1 -0
- package/unbundled/definition42.js +1 -0
- 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 +47 -9
- package/unbundled/definition60.js +47 -9
- package/unbundled/definition61.cjs +12 -6
- package/unbundled/definition61.js +12 -6
- 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/definition67.cjs +2 -0
- package/unbundled/definition67.js +2 -0
- package/unbundled/definition69.cjs +3 -2
- package/unbundled/definition69.js +3 -2
- package/unbundled/definition7.cjs +2 -1
- package/unbundled/definition7.js +2 -1
- 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 +2 -2
- package/unbundled/definition73.js +2 -2
- 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 +1 -1
- package/unbundled/definition9.js +1 -1
- 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/numberConverter.cjs +2 -2
- package/unbundled/numberConverter.js +2 -2
- 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
|
@@ -113,12 +113,20 @@ var Kind = {
|
|
|
113
113
|
default: {
|
|
114
114
|
placement: void 0,
|
|
115
115
|
placementStrategy: require_definition$2.PlacementStrategy.AutoPlacementHorizontal,
|
|
116
|
+
shiftCrossAxis: false,
|
|
116
117
|
strategy: "absolute"
|
|
117
118
|
},
|
|
118
119
|
autocomplete: {
|
|
119
120
|
placement: "bottom-start",
|
|
120
121
|
placementStrategy: require_definition$2.PlacementStrategy.Flip,
|
|
122
|
+
shiftCrossAxis: false,
|
|
121
123
|
strategy: "fixed"
|
|
124
|
+
},
|
|
125
|
+
imageOptions: {
|
|
126
|
+
placement: "bottom",
|
|
127
|
+
placementStrategy: require_definition$2.PlacementStrategy.Flip,
|
|
128
|
+
shiftCrossAxis: true,
|
|
129
|
+
strategy: "absolute"
|
|
122
130
|
}
|
|
123
131
|
};
|
|
124
132
|
var popoverTemplate = (context) => {
|
|
@@ -127,6 +135,7 @@ var popoverTemplate = (context) => {
|
|
|
127
135
|
:anchor="${(x) => x.anchorEl}"
|
|
128
136
|
:placement="${(x) => Kind[x.kind].placement}"
|
|
129
137
|
:placementStrategy="${(x) => Kind[x.kind].placementStrategy}"
|
|
138
|
+
:shiftCrossAxis="${(x) => Kind[x.kind].shiftCrossAxis}"
|
|
130
139
|
:open="${(x) => x.open}"
|
|
131
140
|
:offset="${(x) => x.offset}"
|
|
132
141
|
:strategy="${(x) => Kind[x.kind].strategy}"
|
|
@@ -316,6 +325,8 @@ var RteCoreImpl = class extends require_slottable_request.RteFeatureImpl {
|
|
|
316
325
|
super(..._args);
|
|
317
326
|
this.name = "RteCore";
|
|
318
327
|
this.disabled = new FeatureState(false);
|
|
328
|
+
this.scrollThreshold = void 0;
|
|
329
|
+
this.scrollMargin = void 0;
|
|
319
330
|
}
|
|
320
331
|
getStyles() {
|
|
321
332
|
return [
|
|
@@ -595,6 +606,15 @@ var RteInstance = class {
|
|
|
595
606
|
else tr.setSelection(prosemirror_state.TextSelection.atStart(tr.doc));
|
|
596
607
|
dispatchTransaction(tr);
|
|
597
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* Scrolls the cursor into view.
|
|
611
|
+
* Has no effect if the editor is not currently mounted.
|
|
612
|
+
*/
|
|
613
|
+
scrollIntoView() {
|
|
614
|
+
const instance = this[require_slottable_request.impl];
|
|
615
|
+
if (!instance.view) return;
|
|
616
|
+
instance.dispatchTransaction(instance.tr.scrollIntoView());
|
|
617
|
+
}
|
|
598
618
|
};
|
|
599
619
|
var RteInstanceImpl = class {
|
|
600
620
|
getFeature(name) {
|
|
@@ -649,12 +669,15 @@ var RteInstanceImpl = class {
|
|
|
649
669
|
this.view?.updateState(this.state);
|
|
650
670
|
}
|
|
651
671
|
createView(target) {
|
|
672
|
+
const core = this.config.featureMap.get("RteCore");
|
|
652
673
|
this.view = new prosemirror_view.EditorView((editor) => {
|
|
653
674
|
editor.part = "editor";
|
|
654
675
|
target.appendChild(editor);
|
|
655
676
|
}, {
|
|
656
677
|
state: this.state,
|
|
657
|
-
dispatchTransaction: this.dispatchTransaction
|
|
678
|
+
dispatchTransaction: this.dispatchTransaction,
|
|
679
|
+
...core?.scrollThreshold !== void 0 && { scrollThreshold: core.scrollThreshold },
|
|
680
|
+
...core?.scrollMargin !== void 0 && { scrollMargin: core.scrollMargin }
|
|
658
681
|
});
|
|
659
682
|
}
|
|
660
683
|
destroyViewIfNeeded() {
|
|
@@ -1365,6 +1388,20 @@ var RteBaseImpl = class extends require_slottable_request.RteFeatureImpl {
|
|
|
1365
1388
|
},
|
|
1366
1389
|
set disabled(value) {
|
|
1367
1390
|
core.disabled.setValue(rte, value);
|
|
1391
|
+
},
|
|
1392
|
+
get scrollThreshold() {
|
|
1393
|
+
return core.scrollThreshold;
|
|
1394
|
+
},
|
|
1395
|
+
set scrollThreshold(value) {
|
|
1396
|
+
core.scrollThreshold = value;
|
|
1397
|
+
rte.view?.setProps({ scrollThreshold: value });
|
|
1398
|
+
},
|
|
1399
|
+
get scrollMargin() {
|
|
1400
|
+
return core.scrollMargin;
|
|
1401
|
+
},
|
|
1402
|
+
set scrollMargin(value) {
|
|
1403
|
+
core.scrollMargin = value;
|
|
1404
|
+
rte.view?.setProps({ scrollMargin: value });
|
|
1368
1405
|
}
|
|
1369
1406
|
};
|
|
1370
1407
|
}
|
|
@@ -1955,7 +1992,7 @@ var RteTextColorPickerFeatureImpl = class extends require_slottable_request.RteF
|
|
|
1955
1992
|
if (selectionColor === null) selectionColor = observedColor ?? null;
|
|
1956
1993
|
else if (observedColor !== selectionColor) selectionColor = mixedColor;
|
|
1957
1994
|
};
|
|
1958
|
-
state.doc.nodesBetween(from, to, (node,
|
|
1995
|
+
state.doc.nodesBetween(from, to, (node, _pos, parent) => {
|
|
1959
1996
|
if (selectionColor === mixedColor) return false;
|
|
1960
1997
|
if (!node.isLeaf) {
|
|
1961
1998
|
if (node.type.allowsMarkType(textColor) && node.childCount === 0) observeColor(this.defaultColorForNode?.[node.type.name]);
|
|
@@ -2704,7 +2741,7 @@ var InlineImageView = class {
|
|
|
2704
2741
|
this.img.className = "inline-image";
|
|
2705
2742
|
this.update(node);
|
|
2706
2743
|
this.img.addEventListener("load", () => {
|
|
2707
|
-
const pos = this.getPos
|
|
2744
|
+
const pos = this.getPos();
|
|
2708
2745
|
if (pos) {
|
|
2709
2746
|
const { state, dispatch } = this.view;
|
|
2710
2747
|
const currentNode = state.doc.nodeAt(pos);
|
|
@@ -2811,6 +2848,7 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
2811
2848
|
shouldReturnFocusToEditor: true
|
|
2812
2849
|
});
|
|
2813
2850
|
popover = rte.createComponent(Popover);
|
|
2851
|
+
popover.kind = "imageOptions";
|
|
2814
2852
|
popover.offset = 4;
|
|
2815
2853
|
const content = createDiv(ctx, {
|
|
2816
2854
|
className: "inline-image-popover",
|
|
@@ -2871,7 +2909,7 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
2871
2909
|
} }))];
|
|
2872
2910
|
}
|
|
2873
2911
|
calculateSmallWidth(naturalWidth) {
|
|
2874
|
-
return Math.min(300, naturalWidth / 2)
|
|
2912
|
+
return `${Math.min(300, naturalWidth / 2)}px`;
|
|
2875
2913
|
}
|
|
2876
2914
|
getSelectedInlineImage(state) {
|
|
2877
2915
|
const sel = state.selection;
|
|
@@ -3004,13 +3042,13 @@ var RteFileHandlerFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
3004
3042
|
if (resolved.type === "error") console.error("Error in handleFiles handler:", resolved.error);
|
|
3005
3043
|
};
|
|
3006
3044
|
return [this.contribution(insertPointPlaceholderPlugin), this.contribution(new prosemirror_state.Plugin({ props: {
|
|
3007
|
-
handlePaste: (
|
|
3045
|
+
handlePaste: (_view, event) => {
|
|
3008
3046
|
const files = Array.from(event.clipboardData.files);
|
|
3009
3047
|
if (!files.length) return false;
|
|
3010
3048
|
handleFiles(files, { type: "selection" });
|
|
3011
3049
|
return true;
|
|
3012
3050
|
},
|
|
3013
|
-
handleDrop: (view, event
|
|
3051
|
+
handleDrop: (view, event) => {
|
|
3014
3052
|
const files = Array.from(event.dataTransfer.files);
|
|
3015
3053
|
if (!files.length) return false;
|
|
3016
3054
|
let target = view.posAtCoords({
|
|
@@ -3039,7 +3077,7 @@ var RteDropHandlerFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
3039
3077
|
this.config = config;
|
|
3040
3078
|
this.name = "RteDebugFeature";
|
|
3041
3079
|
}
|
|
3042
|
-
getPlugins(
|
|
3080
|
+
getPlugins() {
|
|
3043
3081
|
const dragOverResults = /* @__PURE__ */ new WeakMap();
|
|
3044
3082
|
let lastResult = false;
|
|
3045
3083
|
const onDragOver = (event) => {
|
|
@@ -3077,7 +3115,7 @@ var RteDropHandlerFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
3077
3115
|
viewport.removeEventListener("dragleave", onDragLeave);
|
|
3078
3116
|
} };
|
|
3079
3117
|
} })), this.contribution(new prosemirror_state.Plugin({ props: { handleDOMEvents: {
|
|
3080
|
-
dragover: (
|
|
3118
|
+
dragover: (_view, event) => {
|
|
3081
3119
|
const result = this.config.onViewportDragOver?.(event) ?? false;
|
|
3082
3120
|
dragOverResults.set(event, result);
|
|
3083
3121
|
lastResult = result;
|
|
@@ -3088,7 +3126,7 @@ var RteDropHandlerFeatureImpl = class extends require_slottable_request.RteFeatu
|
|
|
3088
3126
|
}
|
|
3089
3127
|
return false;
|
|
3090
3128
|
},
|
|
3091
|
-
drop: (
|
|
3129
|
+
drop: () => {
|
|
3092
3130
|
return lastResult;
|
|
3093
3131
|
}
|
|
3094
3132
|
} } }), require_slottable_request.contributionPriority.high)];
|
|
@@ -111,12 +111,20 @@ var Kind = {
|
|
|
111
111
|
default: {
|
|
112
112
|
placement: void 0,
|
|
113
113
|
placementStrategy: PlacementStrategy.AutoPlacementHorizontal,
|
|
114
|
+
shiftCrossAxis: false,
|
|
114
115
|
strategy: "absolute"
|
|
115
116
|
},
|
|
116
117
|
autocomplete: {
|
|
117
118
|
placement: "bottom-start",
|
|
118
119
|
placementStrategy: PlacementStrategy.Flip,
|
|
120
|
+
shiftCrossAxis: false,
|
|
119
121
|
strategy: "fixed"
|
|
122
|
+
},
|
|
123
|
+
imageOptions: {
|
|
124
|
+
placement: "bottom",
|
|
125
|
+
placementStrategy: PlacementStrategy.Flip,
|
|
126
|
+
shiftCrossAxis: true,
|
|
127
|
+
strategy: "absolute"
|
|
120
128
|
}
|
|
121
129
|
};
|
|
122
130
|
var popoverTemplate = (context) => {
|
|
@@ -125,6 +133,7 @@ var popoverTemplate = (context) => {
|
|
|
125
133
|
:anchor="${(x) => x.anchorEl}"
|
|
126
134
|
:placement="${(x) => Kind[x.kind].placement}"
|
|
127
135
|
:placementStrategy="${(x) => Kind[x.kind].placementStrategy}"
|
|
136
|
+
:shiftCrossAxis="${(x) => Kind[x.kind].shiftCrossAxis}"
|
|
128
137
|
:open="${(x) => x.open}"
|
|
129
138
|
:offset="${(x) => x.offset}"
|
|
130
139
|
:strategy="${(x) => Kind[x.kind].strategy}"
|
|
@@ -314,6 +323,8 @@ var RteCoreImpl = class extends RteFeatureImpl {
|
|
|
314
323
|
super(..._args);
|
|
315
324
|
this.name = "RteCore";
|
|
316
325
|
this.disabled = new FeatureState(false);
|
|
326
|
+
this.scrollThreshold = void 0;
|
|
327
|
+
this.scrollMargin = void 0;
|
|
317
328
|
}
|
|
318
329
|
getStyles() {
|
|
319
330
|
return [
|
|
@@ -593,6 +604,15 @@ var RteInstance = class {
|
|
|
593
604
|
else tr.setSelection(TextSelection.atStart(tr.doc));
|
|
594
605
|
dispatchTransaction(tr);
|
|
595
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* Scrolls the cursor into view.
|
|
609
|
+
* Has no effect if the editor is not currently mounted.
|
|
610
|
+
*/
|
|
611
|
+
scrollIntoView() {
|
|
612
|
+
const instance = this[impl];
|
|
613
|
+
if (!instance.view) return;
|
|
614
|
+
instance.dispatchTransaction(instance.tr.scrollIntoView());
|
|
615
|
+
}
|
|
596
616
|
};
|
|
597
617
|
var RteInstanceImpl = class {
|
|
598
618
|
getFeature(name) {
|
|
@@ -647,12 +667,15 @@ var RteInstanceImpl = class {
|
|
|
647
667
|
this.view?.updateState(this.state);
|
|
648
668
|
}
|
|
649
669
|
createView(target) {
|
|
670
|
+
const core = this.config.featureMap.get("RteCore");
|
|
650
671
|
this.view = new EditorView((editor) => {
|
|
651
672
|
editor.part = "editor";
|
|
652
673
|
target.appendChild(editor);
|
|
653
674
|
}, {
|
|
654
675
|
state: this.state,
|
|
655
|
-
dispatchTransaction: this.dispatchTransaction
|
|
676
|
+
dispatchTransaction: this.dispatchTransaction,
|
|
677
|
+
...core?.scrollThreshold !== void 0 && { scrollThreshold: core.scrollThreshold },
|
|
678
|
+
...core?.scrollMargin !== void 0 && { scrollMargin: core.scrollMargin }
|
|
656
679
|
});
|
|
657
680
|
}
|
|
658
681
|
destroyViewIfNeeded() {
|
|
@@ -1363,6 +1386,20 @@ var RteBaseImpl = class extends RteFeatureImpl {
|
|
|
1363
1386
|
},
|
|
1364
1387
|
set disabled(value) {
|
|
1365
1388
|
core.disabled.setValue(rte, value);
|
|
1389
|
+
},
|
|
1390
|
+
get scrollThreshold() {
|
|
1391
|
+
return core.scrollThreshold;
|
|
1392
|
+
},
|
|
1393
|
+
set scrollThreshold(value) {
|
|
1394
|
+
core.scrollThreshold = value;
|
|
1395
|
+
rte.view?.setProps({ scrollThreshold: value });
|
|
1396
|
+
},
|
|
1397
|
+
get scrollMargin() {
|
|
1398
|
+
return core.scrollMargin;
|
|
1399
|
+
},
|
|
1400
|
+
set scrollMargin(value) {
|
|
1401
|
+
core.scrollMargin = value;
|
|
1402
|
+
rte.view?.setProps({ scrollMargin: value });
|
|
1366
1403
|
}
|
|
1367
1404
|
};
|
|
1368
1405
|
}
|
|
@@ -1953,7 +1990,7 @@ var RteTextColorPickerFeatureImpl = class extends RteFeatureImpl {
|
|
|
1953
1990
|
if (selectionColor === null) selectionColor = observedColor ?? null;
|
|
1954
1991
|
else if (observedColor !== selectionColor) selectionColor = mixedColor;
|
|
1955
1992
|
};
|
|
1956
|
-
state.doc.nodesBetween(from, to, (node,
|
|
1993
|
+
state.doc.nodesBetween(from, to, (node, _pos, parent) => {
|
|
1957
1994
|
if (selectionColor === mixedColor) return false;
|
|
1958
1995
|
if (!node.isLeaf) {
|
|
1959
1996
|
if (node.type.allowsMarkType(textColor) && node.childCount === 0) observeColor(this.defaultColorForNode?.[node.type.name]);
|
|
@@ -2702,7 +2739,7 @@ var InlineImageView = class {
|
|
|
2702
2739
|
this.img.className = "inline-image";
|
|
2703
2740
|
this.update(node);
|
|
2704
2741
|
this.img.addEventListener("load", () => {
|
|
2705
|
-
const pos = this.getPos
|
|
2742
|
+
const pos = this.getPos();
|
|
2706
2743
|
if (pos) {
|
|
2707
2744
|
const { state, dispatch } = this.view;
|
|
2708
2745
|
const currentNode = state.doc.nodeAt(pos);
|
|
@@ -2809,6 +2846,7 @@ var RteInlineImageFeatureImpl = class extends RteFeatureImpl {
|
|
|
2809
2846
|
shouldReturnFocusToEditor: true
|
|
2810
2847
|
});
|
|
2811
2848
|
popover = rte.createComponent(Popover);
|
|
2849
|
+
popover.kind = "imageOptions";
|
|
2812
2850
|
popover.offset = 4;
|
|
2813
2851
|
const content = createDiv(ctx, {
|
|
2814
2852
|
className: "inline-image-popover",
|
|
@@ -2869,7 +2907,7 @@ var RteInlineImageFeatureImpl = class extends RteFeatureImpl {
|
|
|
2869
2907
|
} }))];
|
|
2870
2908
|
}
|
|
2871
2909
|
calculateSmallWidth(naturalWidth) {
|
|
2872
|
-
return Math.min(300, naturalWidth / 2)
|
|
2910
|
+
return `${Math.min(300, naturalWidth / 2)}px`;
|
|
2873
2911
|
}
|
|
2874
2912
|
getSelectedInlineImage(state) {
|
|
2875
2913
|
const sel = state.selection;
|
|
@@ -3002,13 +3040,13 @@ var RteFileHandlerFeatureImpl = class extends RteFeatureImpl {
|
|
|
3002
3040
|
if (resolved.type === "error") console.error("Error in handleFiles handler:", resolved.error);
|
|
3003
3041
|
};
|
|
3004
3042
|
return [this.contribution(insertPointPlaceholderPlugin), this.contribution(new Plugin({ props: {
|
|
3005
|
-
handlePaste: (
|
|
3043
|
+
handlePaste: (_view, event) => {
|
|
3006
3044
|
const files = Array.from(event.clipboardData.files);
|
|
3007
3045
|
if (!files.length) return false;
|
|
3008
3046
|
handleFiles(files, { type: "selection" });
|
|
3009
3047
|
return true;
|
|
3010
3048
|
},
|
|
3011
|
-
handleDrop: (view, event
|
|
3049
|
+
handleDrop: (view, event) => {
|
|
3012
3050
|
const files = Array.from(event.dataTransfer.files);
|
|
3013
3051
|
if (!files.length) return false;
|
|
3014
3052
|
let target = view.posAtCoords({
|
|
@@ -3037,7 +3075,7 @@ var RteDropHandlerFeatureImpl = class extends RteFeatureImpl {
|
|
|
3037
3075
|
this.config = config;
|
|
3038
3076
|
this.name = "RteDebugFeature";
|
|
3039
3077
|
}
|
|
3040
|
-
getPlugins(
|
|
3078
|
+
getPlugins() {
|
|
3041
3079
|
const dragOverResults = /* @__PURE__ */ new WeakMap();
|
|
3042
3080
|
let lastResult = false;
|
|
3043
3081
|
const onDragOver = (event) => {
|
|
@@ -3075,7 +3113,7 @@ var RteDropHandlerFeatureImpl = class extends RteFeatureImpl {
|
|
|
3075
3113
|
viewport.removeEventListener("dragleave", onDragLeave);
|
|
3076
3114
|
} };
|
|
3077
3115
|
} })), this.contribution(new Plugin({ props: { handleDOMEvents: {
|
|
3078
|
-
dragover: (
|
|
3116
|
+
dragover: (_view, event) => {
|
|
3079
3117
|
const result = this.config.onViewportDragOver?.(event) ?? false;
|
|
3080
3118
|
dragOverResults.set(event, result);
|
|
3081
3119
|
lastResult = result;
|
|
@@ -3086,7 +3124,7 @@ var RteDropHandlerFeatureImpl = class extends RteFeatureImpl {
|
|
|
3086
3124
|
}
|
|
3087
3125
|
return false;
|
|
3088
3126
|
},
|
|
3089
|
-
drop: (
|
|
3127
|
+
drop: () => {
|
|
3090
3128
|
return lastResult;
|
|
3091
3129
|
}
|
|
3092
3130
|
} } }), contributionPriority.high)];
|
|
@@ -200,7 +200,10 @@ var Select = class extends require_mixins.WithLightDOMFeedback(require_with_cont
|
|
|
200
200
|
* @internal
|
|
201
201
|
*/
|
|
202
202
|
focusinHandler(e) {
|
|
203
|
-
if (!this.multiple)
|
|
203
|
+
if (!this.multiple) {
|
|
204
|
+
super.focusinHandler(e);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
204
207
|
/* v8 ignore else -- @preserve */
|
|
205
208
|
if (!this.shouldSkipFocus && e.target === e.currentTarget) {
|
|
206
209
|
this.uncheckAllOptions();
|
|
@@ -290,7 +293,7 @@ var Select = class extends require_mixins.WithLightDOMFeedback(require_with_cont
|
|
|
290
293
|
_microsoft_fast_element.Updates.enqueue(() => this.focus());
|
|
291
294
|
return;
|
|
292
295
|
}
|
|
293
|
-
const didClose = prev
|
|
296
|
+
const didClose = prev && !next;
|
|
294
297
|
const selectionChangedWhileOpen = this.indexWhenOpened !== this.selectedIndex;
|
|
295
298
|
if (didClose && selectionChangedWhileOpen) this.updateValue(true);
|
|
296
299
|
}
|
|
@@ -484,7 +487,7 @@ var Select = class extends require_mixins.WithLightDOMFeedback(require_with_cont
|
|
|
484
487
|
}
|
|
485
488
|
default:
|
|
486
489
|
/* v8 ignore else -- @preserve */
|
|
487
|
-
if (key.length === 1) this.handleTypeAhead(
|
|
490
|
+
if (key.length === 1) this.handleTypeAhead(key);
|
|
488
491
|
return;
|
|
489
492
|
}
|
|
490
493
|
}
|
|
@@ -617,7 +620,7 @@ var Select = class extends require_mixins.WithLightDOMFeedback(require_with_cont
|
|
|
617
620
|
* @internal
|
|
618
621
|
*/
|
|
619
622
|
_onClearButtonClick() {
|
|
620
|
-
if (this.multiple) this.selectedOptions
|
|
623
|
+
if (this.multiple) this.selectedOptions.forEach((o) => {
|
|
621
624
|
/* v8 ignore else -- @preserve */
|
|
622
625
|
if (!o.disabled) o.selected = false;
|
|
623
626
|
});
|
|
@@ -764,7 +767,10 @@ function renderControl(context) {
|
|
|
764
767
|
*/
|
|
765
768
|
function ifNotFromFeedback(handler) {
|
|
766
769
|
return (x, c) => {
|
|
767
|
-
if (!c.event.composedPath().includes(x._feedbackWrapper))
|
|
770
|
+
if (!c.event.composedPath().includes(x._feedbackWrapper)) {
|
|
771
|
+
handler(x, c.event);
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
768
774
|
return true;
|
|
769
775
|
};
|
|
770
776
|
}
|
|
@@ -786,7 +792,7 @@ var SelectTemplate = (context) => {
|
|
|
786
792
|
@focusin="${ifNotFromFeedback((x, e) => x.focusinHandler(e))}"
|
|
787
793
|
@focusout="${ifNotFromFeedback((x, e) => x.focusoutHandler(e))}"
|
|
788
794
|
@keydown="${ifNotFromFeedback((x, e) => {
|
|
789
|
-
x.open
|
|
795
|
+
if (x.open) require_dialog.handleEscapeKeyAndStopPropogation(e);
|
|
790
796
|
return x.keydownHandler(e);
|
|
791
797
|
})}"
|
|
792
798
|
@mousedown="${ifNotFromFeedback((x, e) => x.mousedownHandler(e))}"
|
|
@@ -199,7 +199,10 @@ var Select = class extends WithLightDOMFeedback(WithContextualHelp(WithErrorText
|
|
|
199
199
|
* @internal
|
|
200
200
|
*/
|
|
201
201
|
focusinHandler(e) {
|
|
202
|
-
if (!this.multiple)
|
|
202
|
+
if (!this.multiple) {
|
|
203
|
+
super.focusinHandler(e);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
203
206
|
/* v8 ignore else -- @preserve */
|
|
204
207
|
if (!this.shouldSkipFocus && e.target === e.currentTarget) {
|
|
205
208
|
this.uncheckAllOptions();
|
|
@@ -289,7 +292,7 @@ var Select = class extends WithLightDOMFeedback(WithContextualHelp(WithErrorText
|
|
|
289
292
|
Updates.enqueue(() => this.focus());
|
|
290
293
|
return;
|
|
291
294
|
}
|
|
292
|
-
const didClose = prev
|
|
295
|
+
const didClose = prev && !next;
|
|
293
296
|
const selectionChangedWhileOpen = this.indexWhenOpened !== this.selectedIndex;
|
|
294
297
|
if (didClose && selectionChangedWhileOpen) this.updateValue(true);
|
|
295
298
|
}
|
|
@@ -483,7 +486,7 @@ var Select = class extends WithLightDOMFeedback(WithContextualHelp(WithErrorText
|
|
|
483
486
|
}
|
|
484
487
|
default:
|
|
485
488
|
/* v8 ignore else -- @preserve */
|
|
486
|
-
if (key.length === 1) this.handleTypeAhead(
|
|
489
|
+
if (key.length === 1) this.handleTypeAhead(key);
|
|
487
490
|
return;
|
|
488
491
|
}
|
|
489
492
|
}
|
|
@@ -616,7 +619,7 @@ var Select = class extends WithLightDOMFeedback(WithContextualHelp(WithErrorText
|
|
|
616
619
|
* @internal
|
|
617
620
|
*/
|
|
618
621
|
_onClearButtonClick() {
|
|
619
|
-
if (this.multiple) this.selectedOptions
|
|
622
|
+
if (this.multiple) this.selectedOptions.forEach((o) => {
|
|
620
623
|
/* v8 ignore else -- @preserve */
|
|
621
624
|
if (!o.disabled) o.selected = false;
|
|
622
625
|
});
|
|
@@ -763,7 +766,10 @@ function renderControl(context) {
|
|
|
763
766
|
*/
|
|
764
767
|
function ifNotFromFeedback(handler) {
|
|
765
768
|
return (x, c) => {
|
|
766
|
-
if (!c.event.composedPath().includes(x._feedbackWrapper))
|
|
769
|
+
if (!c.event.composedPath().includes(x._feedbackWrapper)) {
|
|
770
|
+
handler(x, c.event);
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
767
773
|
return true;
|
|
768
774
|
};
|
|
769
775
|
}
|
|
@@ -785,7 +791,7 @@ var SelectTemplate = (context) => {
|
|
|
785
791
|
@focusin="${ifNotFromFeedback((x, e) => x.focusinHandler(e))}"
|
|
786
792
|
@focusout="${ifNotFromFeedback((x, e) => x.focusoutHandler(e))}"
|
|
787
793
|
@keydown="${ifNotFromFeedback((x, e) => {
|
|
788
|
-
x.open
|
|
794
|
+
if (x.open) handleEscapeKeyAndStopPropogation(e);
|
|
789
795
|
return x.keydownHandler(e);
|
|
790
796
|
})}"
|
|
791
797
|
@mousedown="${ifNotFromFeedback((x, e) => x.mousedownHandler(e))}"
|
|
@@ -45,7 +45,10 @@ var SelectableBox = class extends require_delegates_aria.DelegatesAria(require_v
|
|
|
45
45
|
*/
|
|
46
46
|
_handleKeydown(event) {
|
|
47
47
|
if (this.disabled) return true;
|
|
48
|
-
if ((event.code === "Space" || event.code === "Enter") && this.clickableBox)
|
|
48
|
+
if ((event.code === "Space" || event.code === "Enter") && this.clickableBox) {
|
|
49
|
+
this._handleCheckedChange();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
49
52
|
return true;
|
|
50
53
|
}
|
|
51
54
|
};
|
|
@@ -44,7 +44,10 @@ var SelectableBox = class extends DelegatesAria(VividElement) {
|
|
|
44
44
|
*/
|
|
45
45
|
_handleKeydown(event) {
|
|
46
46
|
if (this.disabled) return true;
|
|
47
|
-
if ((event.code === "Space" || event.code === "Enter") && this.clickableBox)
|
|
47
|
+
if ((event.code === "Space" || event.code === "Enter") && this.clickableBox) {
|
|
48
|
+
this._handleCheckedChange();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
48
51
|
return true;
|
|
49
52
|
}
|
|
50
53
|
};
|
|
@@ -25,7 +25,8 @@ var SideDrawer = class extends require_vivid_element.VividElement {
|
|
|
25
25
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
26
26
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
27
27
|
switch (name) {
|
|
28
|
-
case "open": this.open
|
|
28
|
+
case "open": if (this.open) this.#open();
|
|
29
|
+
else this.#close();
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
#close() {
|
|
@@ -24,7 +24,8 @@ var SideDrawer = class extends VividElement {
|
|
|
24
24
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
25
25
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
26
26
|
switch (name) {
|
|
27
|
-
case "open": this.open
|
|
27
|
+
case "open": if (this.open) this.#open();
|
|
28
|
+
else this.#close();
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
#close() {
|
|
@@ -46,6 +46,7 @@ var SplitButton = class extends require_affix.AffixIcon(require_localized.Locali
|
|
|
46
46
|
event.stopImmediatePropagation();
|
|
47
47
|
return;
|
|
48
48
|
} else this.$emit("action-click", void 0, { bubbles: false });
|
|
49
|
+
return true;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Handles indicator click events.
|
|
@@ -59,6 +60,7 @@ var SplitButton = class extends require_affix.AffixIcon(require_localized.Locali
|
|
|
59
60
|
event.stopImmediatePropagation();
|
|
60
61
|
return;
|
|
61
62
|
} else this.$emit("indicator-click", void 0, { bubbles: false });
|
|
63
|
+
return true;
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
66
|
require_decorate.__decorate([_microsoft_fast_element.attr], SplitButton.prototype, "connotation", void 0);
|
|
@@ -45,6 +45,7 @@ var SplitButton = class extends AffixIcon(Localized(DelegatesAria(VividElement))
|
|
|
45
45
|
event.stopImmediatePropagation();
|
|
46
46
|
return;
|
|
47
47
|
} else this.$emit("action-click", void 0, { bubbles: false });
|
|
48
|
+
return true;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* Handles indicator click events.
|
|
@@ -58,6 +59,7 @@ var SplitButton = class extends AffixIcon(Localized(DelegatesAria(VividElement))
|
|
|
58
59
|
event.stopImmediatePropagation();
|
|
59
60
|
return;
|
|
60
61
|
} else this.$emit("indicator-click", void 0, { bubbles: false });
|
|
62
|
+
return true;
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
65
|
__decorate([attr], SplitButton.prototype, "connotation", void 0);
|
|
@@ -29,7 +29,8 @@ var Switch = class extends require_delegates_aria.DelegatesAria(require_form_ass
|
|
|
29
29
|
readOnlyChanged() {
|
|
30
30
|
/* v8 ignore if -- @preserve */
|
|
31
31
|
if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
|
|
32
|
-
this.readOnly
|
|
32
|
+
if (this.readOnly) this.classList.add("readonly");
|
|
33
|
+
else this.classList.remove("readonly");
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* @internal
|
|
@@ -68,7 +69,7 @@ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
|
68
69
|
require_decorate.__decorate([_microsoft_fast_element.observable], Switch.prototype, "defaultSlottedNodes", void 0);
|
|
69
70
|
//#endregion
|
|
70
71
|
//#region src/lib/switch/switch.template.ts
|
|
71
|
-
var getClasses = (
|
|
72
|
+
var getClasses = (x) => (0, _microsoft_fast_web_utilities.classNames)("control", ["appearance-filled", x.checked], ["checked", x.checked], ["disabled", x.disabled], ["readonly", x.readOnly], [`connotation-${x.connotation}`, x.checked && Boolean(x.connotation)]);
|
|
72
73
|
var SwitchTemplate = _microsoft_fast_element.html`
|
|
73
74
|
<template>
|
|
74
75
|
<div
|
|
@@ -28,7 +28,8 @@ var Switch = class extends DelegatesAria(CheckableFormAssociated(VividElement))
|
|
|
28
28
|
readOnlyChanged() {
|
|
29
29
|
/* v8 ignore if -- @preserve */
|
|
30
30
|
if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
|
|
31
|
-
this.readOnly
|
|
31
|
+
if (this.readOnly) this.classList.add("readonly");
|
|
32
|
+
else this.classList.remove("readonly");
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* @internal
|
|
@@ -67,7 +68,7 @@ __decorate([attr({
|
|
|
67
68
|
__decorate([observable], Switch.prototype, "defaultSlottedNodes", void 0);
|
|
68
69
|
//#endregion
|
|
69
70
|
//#region src/lib/switch/switch.template.ts
|
|
70
|
-
var getClasses = (
|
|
71
|
+
var getClasses = (x) => classNames("control", ["appearance-filled", x.checked], ["checked", x.checked], ["disabled", x.disabled], ["readonly", x.readOnly], [`connotation-${x.connotation}`, x.checked && Boolean(x.connotation)]);
|
|
71
72
|
//#endregion
|
|
72
73
|
//#region src/lib/switch/definition.ts
|
|
73
74
|
/**
|
|
@@ -43,6 +43,7 @@ var Button = class extends require_affix.AffixIconWithTrailing(require_localized
|
|
|
43
43
|
event.stopImmediatePropagation();
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
+
return true;
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: {
|
|
@@ -94,7 +95,7 @@ function getEffectiveAppearance(appearance, pressed) {
|
|
|
94
95
|
}
|
|
95
96
|
return resolvedAppearance;
|
|
96
97
|
}
|
|
97
|
-
var getClasses = ({ connotation, appearance, shape, iconTrailing, icon, label, disabled, pending, stacked, size, iconSlottedContent, ariaExpanded, active, dropdownIndicator, pressed }) => (0, _microsoft_fast_web_utilities.classNames)("control", [`connotation-${connotation}`, Boolean(connotation)], `appearance-${getEffectiveAppearance(appearance, pressed)}`, ["disabled", disabled || pending], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ["icon-only", !label && !!(icon || iconSlottedContent?.length) && !dropdownIndicator], ["icon-trailing", iconTrailing], ["stacked",
|
|
98
|
+
var getClasses = ({ connotation, appearance, shape, iconTrailing, icon, label, disabled, pending, stacked, size, iconSlottedContent, ariaExpanded, active, dropdownIndicator, pressed }) => (0, _microsoft_fast_web_utilities.classNames)("control", [`connotation-${connotation}`, Boolean(connotation)], `appearance-${getEffectiveAppearance(appearance, pressed)}`, ["disabled", disabled || pending], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ["icon-only", !label && !!(icon || iconSlottedContent?.length) && !dropdownIndicator], ["icon-trailing", iconTrailing], ["stacked", stacked], ["active", ariaExpanded === "true" || active]);
|
|
98
99
|
function renderIconOrPending(context, icon, pending, size = require_enums.Size.Normal) {
|
|
99
100
|
if (pending && size != require_enums.Size.SuperCondensed) {
|
|
100
101
|
const progressTag = context.tagFor(require_definition$1.ProgressRing);
|
package/unbundled/definition7.js
CHANGED
|
@@ -42,6 +42,7 @@ var Button = class extends AffixIconWithTrailing(Localized(Linkable(VividFoundat
|
|
|
42
42
|
event.stopImmediatePropagation();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
+
return true;
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
__decorate([attr({ converter: {
|
|
@@ -93,7 +94,7 @@ function getEffectiveAppearance(appearance, pressed) {
|
|
|
93
94
|
}
|
|
94
95
|
return resolvedAppearance;
|
|
95
96
|
}
|
|
96
|
-
var getClasses = ({ connotation, appearance, shape, iconTrailing, icon, label, disabled, pending, stacked, size, iconSlottedContent, ariaExpanded, active, dropdownIndicator, pressed }) => classNames("control", [`connotation-${connotation}`, Boolean(connotation)], `appearance-${getEffectiveAppearance(appearance, pressed)}`, ["disabled", disabled || pending], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ["icon-only", !label && !!(icon || iconSlottedContent?.length) && !dropdownIndicator], ["icon-trailing", iconTrailing], ["stacked",
|
|
97
|
+
var getClasses = ({ connotation, appearance, shape, iconTrailing, icon, label, disabled, pending, stacked, size, iconSlottedContent, ariaExpanded, active, dropdownIndicator, pressed }) => classNames("control", [`connotation-${connotation}`, Boolean(connotation)], `appearance-${getEffectiveAppearance(appearance, pressed)}`, ["disabled", disabled || pending], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ["icon-only", !label && !!(icon || iconSlottedContent?.length) && !dropdownIndicator], ["icon-trailing", iconTrailing], ["stacked", stacked], ["active", ariaExpanded === "true" || active]);
|
|
97
98
|
function renderIconOrPending(context, icon, pending, size = Size.Normal) {
|
|
98
99
|
if (pending && size != Size.SuperCondensed) {
|
|
99
100
|
const progressTag = context.tagFor(ProgressRing);
|
|
@@ -54,7 +54,7 @@ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "fromView
|
|
|
54
54
|
require_decorate.__decorate([_microsoft_fast_element.observable], Tab.prototype, "active", void 0);
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/lib/tab/tab.template.ts
|
|
57
|
-
var getClasses = ({ connotation, disabled, active, iconTrailing, shape, removable }) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${connotation}`, Boolean(connotation) &&
|
|
57
|
+
var getClasses = ({ connotation, disabled, active, iconTrailing, shape, removable }) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${connotation}`, Boolean(connotation) && active], [`shape-${shape}`, Boolean(shape)], ["disabled", disabled], ["selected", active], ["icon-trailing", iconTrailing], ["removable", removable]);
|
|
58
58
|
function renderDismissButton(context) {
|
|
59
59
|
const affixIconTemplate = require_affix.affixIconTemplateFactory(context);
|
|
60
60
|
return _microsoft_fast_element.html`<button
|
|
@@ -53,7 +53,7 @@ __decorate([attr({ mode: "fromView" })], Tab.prototype, "tabIndex", void 0);
|
|
|
53
53
|
__decorate([observable], Tab.prototype, "active", void 0);
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/lib/tab/tab.template.ts
|
|
56
|
-
var getClasses = ({ connotation, disabled, active, iconTrailing, shape, removable }) => classNames("base", [`connotation-${connotation}`, Boolean(connotation) &&
|
|
56
|
+
var getClasses = ({ connotation, disabled, active, iconTrailing, shape, removable }) => classNames("base", [`connotation-${connotation}`, Boolean(connotation) && active], [`shape-${shape}`, Boolean(shape)], ["disabled", disabled], ["selected", active], ["icon-trailing", iconTrailing], ["removable", removable]);
|
|
57
57
|
function renderDismissButton(context) {
|
|
58
58
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
59
59
|
return html`<button
|