@public-ui/hydrate 3.1.1 → 3.1.2-rc.1
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/dist/index.js +114 -111
- package/dist/index.mjs +114 -111
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ function _mergeNamespaces(n, m) {
|
|
|
146
146
|
|
|
147
147
|
const NAMESPACE = 'kolibri';
|
|
148
148
|
const BUILD = /* kolibri */ { hydratedSelectorName: "hydrated", slotRelocation: true, state: true, updatable: true};
|
|
149
|
-
const Env = /* kolibri */ {"kolibriVersion":"3.1.1"};
|
|
149
|
+
const Env = /* kolibri */ {"kolibriVersion":"3.1.2-rc.1"};
|
|
150
150
|
|
|
151
151
|
function getDefaultExportFromCjs (x) {
|
|
152
152
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -25552,6 +25552,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
25552
25552
|
return coords;
|
|
25553
25553
|
}
|
|
25554
25554
|
|
|
25555
|
+
/**
|
|
25556
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
25557
|
+
* element is overflowing a given clipping boundary on each side.
|
|
25558
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
25559
|
+
* - negative = how many pixels left before it will overflow
|
|
25560
|
+
* - 0 = lies flush with the boundary
|
|
25561
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
25562
|
+
*/
|
|
25563
|
+
async function detectOverflow(state, options) {
|
|
25564
|
+
var _await$platform$isEle;
|
|
25565
|
+
if (options === void 0) {
|
|
25566
|
+
options = {};
|
|
25567
|
+
}
|
|
25568
|
+
const {
|
|
25569
|
+
x,
|
|
25570
|
+
y,
|
|
25571
|
+
platform,
|
|
25572
|
+
rects,
|
|
25573
|
+
elements,
|
|
25574
|
+
strategy
|
|
25575
|
+
} = state;
|
|
25576
|
+
const {
|
|
25577
|
+
boundary = 'clippingAncestors',
|
|
25578
|
+
rootBoundary = 'viewport',
|
|
25579
|
+
elementContext = 'floating',
|
|
25580
|
+
altBoundary = false,
|
|
25581
|
+
padding = 0
|
|
25582
|
+
} = evaluate(options, state);
|
|
25583
|
+
const paddingObject = getPaddingObject(padding);
|
|
25584
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
25585
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
25586
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
25587
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
25588
|
+
boundary,
|
|
25589
|
+
rootBoundary,
|
|
25590
|
+
strategy
|
|
25591
|
+
}));
|
|
25592
|
+
const rect = elementContext === 'floating' ? {
|
|
25593
|
+
x,
|
|
25594
|
+
y,
|
|
25595
|
+
width: rects.floating.width,
|
|
25596
|
+
height: rects.floating.height
|
|
25597
|
+
} : rects.reference;
|
|
25598
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
25599
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
25600
|
+
x: 1,
|
|
25601
|
+
y: 1
|
|
25602
|
+
} : {
|
|
25603
|
+
x: 1,
|
|
25604
|
+
y: 1
|
|
25605
|
+
};
|
|
25606
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
25607
|
+
elements,
|
|
25608
|
+
rect,
|
|
25609
|
+
offsetParent,
|
|
25610
|
+
strategy
|
|
25611
|
+
}) : rect);
|
|
25612
|
+
return {
|
|
25613
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
25614
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
25615
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
25616
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25617
|
+
};
|
|
25618
|
+
}
|
|
25619
|
+
|
|
25555
25620
|
/**
|
|
25556
25621
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
25557
25622
|
* next to a given reference element.
|
|
@@ -25581,6 +25646,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25581
25646
|
let middlewareData = {};
|
|
25582
25647
|
let resetCount = 0;
|
|
25583
25648
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
25649
|
+
var _platform$detectOverf;
|
|
25584
25650
|
const {
|
|
25585
25651
|
name,
|
|
25586
25652
|
fn
|
|
@@ -25598,7 +25664,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25598
25664
|
strategy,
|
|
25599
25665
|
middlewareData,
|
|
25600
25666
|
rects,
|
|
25601
|
-
platform
|
|
25667
|
+
platform: {
|
|
25668
|
+
...platform,
|
|
25669
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
25670
|
+
},
|
|
25602
25671
|
elements: {
|
|
25603
25672
|
reference,
|
|
25604
25673
|
floating
|
|
@@ -25643,71 +25712,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25643
25712
|
};
|
|
25644
25713
|
};
|
|
25645
25714
|
|
|
25646
|
-
/**
|
|
25647
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
25648
|
-
* element is overflowing a given clipping boundary on each side.
|
|
25649
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
25650
|
-
* - negative = how many pixels left before it will overflow
|
|
25651
|
-
* - 0 = lies flush with the boundary
|
|
25652
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
25653
|
-
*/
|
|
25654
|
-
async function detectOverflow(state, options) {
|
|
25655
|
-
var _await$platform$isEle;
|
|
25656
|
-
if (options === void 0) {
|
|
25657
|
-
options = {};
|
|
25658
|
-
}
|
|
25659
|
-
const {
|
|
25660
|
-
x,
|
|
25661
|
-
y,
|
|
25662
|
-
platform,
|
|
25663
|
-
rects,
|
|
25664
|
-
elements,
|
|
25665
|
-
strategy
|
|
25666
|
-
} = state;
|
|
25667
|
-
const {
|
|
25668
|
-
boundary = 'clippingAncestors',
|
|
25669
|
-
rootBoundary = 'viewport',
|
|
25670
|
-
elementContext = 'floating',
|
|
25671
|
-
altBoundary = false,
|
|
25672
|
-
padding = 0
|
|
25673
|
-
} = evaluate(options, state);
|
|
25674
|
-
const paddingObject = getPaddingObject(padding);
|
|
25675
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
25676
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
25677
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
25678
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
25679
|
-
boundary,
|
|
25680
|
-
rootBoundary,
|
|
25681
|
-
strategy
|
|
25682
|
-
}));
|
|
25683
|
-
const rect = elementContext === 'floating' ? {
|
|
25684
|
-
x,
|
|
25685
|
-
y,
|
|
25686
|
-
width: rects.floating.width,
|
|
25687
|
-
height: rects.floating.height
|
|
25688
|
-
} : rects.reference;
|
|
25689
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
25690
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
25691
|
-
x: 1,
|
|
25692
|
-
y: 1
|
|
25693
|
-
} : {
|
|
25694
|
-
x: 1,
|
|
25695
|
-
y: 1
|
|
25696
|
-
};
|
|
25697
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
25698
|
-
elements,
|
|
25699
|
-
rect,
|
|
25700
|
-
offsetParent,
|
|
25701
|
-
strategy
|
|
25702
|
-
}) : rect);
|
|
25703
|
-
return {
|
|
25704
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
25705
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
25706
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
25707
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25708
|
-
};
|
|
25709
|
-
}
|
|
25710
|
-
|
|
25711
25715
|
/**
|
|
25712
25716
|
* Provides data to position an inner element of the floating element so that it
|
|
25713
25717
|
* appears centered to the reference element.
|
|
@@ -25840,7 +25844,7 @@ const flip$1 = function (options) {
|
|
|
25840
25844
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
25841
25845
|
}
|
|
25842
25846
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
25843
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
25847
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
25844
25848
|
const overflows = [];
|
|
25845
25849
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
25846
25850
|
if (checkMainAxis) {
|
|
@@ -26024,7 +26028,8 @@ const shift$1 = function (options) {
|
|
|
26024
26028
|
const {
|
|
26025
26029
|
x,
|
|
26026
26030
|
y,
|
|
26027
|
-
placement
|
|
26031
|
+
placement,
|
|
26032
|
+
platform
|
|
26028
26033
|
} = state;
|
|
26029
26034
|
const {
|
|
26030
26035
|
mainAxis: checkMainAxis = true,
|
|
@@ -26047,7 +26052,7 @@ const shift$1 = function (options) {
|
|
|
26047
26052
|
x,
|
|
26048
26053
|
y
|
|
26049
26054
|
};
|
|
26050
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26055
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
26051
26056
|
const crossAxis = getSideAxis(getSide(placement));
|
|
26052
26057
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
26053
26058
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -31000,44 +31005,17 @@ class KolTooltipWc {
|
|
|
31000
31005
|
void this.hideTooltip();
|
|
31001
31006
|
}
|
|
31002
31007
|
};
|
|
31003
|
-
this.handleMouseEnter = () => {
|
|
31004
|
-
const isNewVisit = this.isNewVisit();
|
|
31005
|
-
this.hasMouseIn = true;
|
|
31006
|
-
if (isNewVisit) {
|
|
31007
|
-
this.isHiddenForCurrentVisit = false;
|
|
31008
|
-
}
|
|
31009
|
-
this.showOrHideTooltip();
|
|
31010
|
-
};
|
|
31011
|
-
this.handleMouseleave = (event) => {
|
|
31012
|
-
var _a, _b;
|
|
31013
|
-
this.hasMouseIn = (_b = (_a = this.tooltipElement) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget)) !== null && _b !== void 0 ? _b : false;
|
|
31014
|
-
this.resetHideFlag();
|
|
31015
|
-
this.showOrHideTooltip();
|
|
31016
|
-
};
|
|
31017
|
-
this.handleFocusIn = () => {
|
|
31018
|
-
const isNewVisit = this.isNewVisit();
|
|
31019
|
-
this.hasFocusIn = true;
|
|
31020
|
-
if (isNewVisit) {
|
|
31021
|
-
this.isHiddenForCurrentVisit = false;
|
|
31022
|
-
}
|
|
31023
|
-
this.showOrHideTooltip();
|
|
31024
|
-
};
|
|
31025
|
-
this.handleFocusout = () => {
|
|
31026
|
-
this.hasFocusIn = false;
|
|
31027
|
-
this.resetHideFlag();
|
|
31028
|
-
this.showOrHideTooltip();
|
|
31029
|
-
};
|
|
31030
31008
|
this.addListeners = (el) => {
|
|
31031
|
-
el.addEventListener('mouseenter', this.handleMouseEnter);
|
|
31032
|
-
el.addEventListener('mouseleave', this.
|
|
31033
|
-
el.addEventListener('focusin', this.handleFocusIn);
|
|
31034
|
-
el.addEventListener('focusout', this.
|
|
31009
|
+
el.addEventListener('mouseenter', this.handleMouseEnter.bind(this));
|
|
31010
|
+
el.addEventListener('mouseleave', this.handleMouseLeave.bind(this));
|
|
31011
|
+
el.addEventListener('focusin', this.handleFocusIn.bind(this));
|
|
31012
|
+
el.addEventListener('focusout', this.handleFocusOut.bind(this));
|
|
31035
31013
|
};
|
|
31036
31014
|
this.removeListeners = (el) => {
|
|
31037
|
-
el.removeEventListener('mouseenter', this.handleMouseEnter);
|
|
31038
|
-
el.removeEventListener('mouseleave', this.
|
|
31039
|
-
el.removeEventListener('focusin', this.handleFocusIn);
|
|
31040
|
-
el.removeEventListener('focusout', this.
|
|
31015
|
+
el.removeEventListener('mouseenter', this.handleMouseEnter.bind(this));
|
|
31016
|
+
el.removeEventListener('mouseleave', this.handleMouseLeave.bind(this));
|
|
31017
|
+
el.removeEventListener('focusin', this.handleFocusIn.bind(this));
|
|
31018
|
+
el.removeEventListener('focusout', this.handleFocusOut.bind(this));
|
|
31041
31019
|
};
|
|
31042
31020
|
this.resyncListeners = (last, next, replacePreviousSibling = false) => {
|
|
31043
31021
|
if (last) {
|
|
@@ -31100,8 +31078,34 @@ class KolTooltipWc {
|
|
|
31100
31078
|
}
|
|
31101
31079
|
getDocument().removeEventListener('keyup', this.hideTooltipByEscape);
|
|
31102
31080
|
}
|
|
31081
|
+
handleMouseEnter() {
|
|
31082
|
+
const isNewVisit = this.isNewVisit();
|
|
31083
|
+
this.hasMouseIn = true;
|
|
31084
|
+
if (isNewVisit) {
|
|
31085
|
+
this.isHiddenForCurrentVisit = false;
|
|
31086
|
+
}
|
|
31087
|
+
this.showOrHideTooltip();
|
|
31088
|
+
}
|
|
31089
|
+
handleMouseLeave() {
|
|
31090
|
+
this.hasMouseIn = false;
|
|
31091
|
+
this.resetHideFlag();
|
|
31092
|
+
this.showOrHideTooltip();
|
|
31093
|
+
}
|
|
31094
|
+
handleFocusIn() {
|
|
31095
|
+
const isNewVisit = this.isNewVisit();
|
|
31096
|
+
this.hasFocusIn = true;
|
|
31097
|
+
if (isNewVisit) {
|
|
31098
|
+
this.isHiddenForCurrentVisit = false;
|
|
31099
|
+
}
|
|
31100
|
+
this.showOrHideTooltip();
|
|
31101
|
+
}
|
|
31102
|
+
handleFocusOut() {
|
|
31103
|
+
this.hasFocusIn = false;
|
|
31104
|
+
this.resetHideFlag();
|
|
31105
|
+
this.showOrHideTooltip();
|
|
31106
|
+
}
|
|
31103
31107
|
render() {
|
|
31104
|
-
return (hAsync(Host, { key: '
|
|
31108
|
+
return (hAsync(Host, { key: '06b88a008110f4aa881af6b482e0a567301e8485', class: "kol-tooltip" }, hAsync("div", { key: 'f90973a436d4462581de6ee6fe819efe42fecd6c', class: "kol-tooltip__floating", hidden: this.state._label.length === 0, ref: this.catchTooltipElement }, hAsync("div", { key: 'c84c65420bd6cf538ccb2e6b5c130c2796d0ddec', class: "kol-tooltip__arrow", ref: this.catchArrowElement }), hAsync(KolSpanFc, { key: '079d51f0417933162ab521d5874d6bc40a3ab572', class: "kol-tooltip__content", id: this.state._id, badgeText: this._badgeText, label: this.state._label }))));
|
|
31105
31109
|
}
|
|
31106
31110
|
validateBadgeText(value) {
|
|
31107
31111
|
validateBadgeText(this, value);
|
|
@@ -31124,14 +31128,13 @@ class KolTooltipWc {
|
|
|
31124
31128
|
this.validateLabel(this._label);
|
|
31125
31129
|
}
|
|
31126
31130
|
handleEventListeners() {
|
|
31127
|
-
var _a
|
|
31128
|
-
|
|
31129
|
-
this.resyncListeners(this.previousSibling, nextSibling, true);
|
|
31131
|
+
var _a;
|
|
31132
|
+
this.resyncListeners(this.previousSibling, (_a = this.host) === null || _a === void 0 ? void 0 : _a.previousElementSibling, true);
|
|
31130
31133
|
this.resyncListeners(this.tooltipElement, this.tooltipElement);
|
|
31131
31134
|
}
|
|
31132
31135
|
connectedCallback() {
|
|
31133
|
-
var _a
|
|
31134
|
-
this.previousSibling = (
|
|
31136
|
+
var _a;
|
|
31137
|
+
this.previousSibling = (_a = this.host) === null || _a === void 0 ? void 0 : _a.previousElementSibling;
|
|
31135
31138
|
}
|
|
31136
31139
|
componentDidRender() {
|
|
31137
31140
|
this.handleEventListeners();
|
package/dist/index.mjs
CHANGED
|
@@ -144,7 +144,7 @@ function _mergeNamespaces(n, m) {
|
|
|
144
144
|
|
|
145
145
|
const NAMESPACE = 'kolibri';
|
|
146
146
|
const BUILD = /* kolibri */ { hydratedSelectorName: "hydrated", slotRelocation: true, state: true, updatable: true};
|
|
147
|
-
const Env = /* kolibri */ {"kolibriVersion":"3.1.1"};
|
|
147
|
+
const Env = /* kolibri */ {"kolibriVersion":"3.1.2-rc.1"};
|
|
148
148
|
|
|
149
149
|
function getDefaultExportFromCjs (x) {
|
|
150
150
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -25550,6 +25550,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
25550
25550
|
return coords;
|
|
25551
25551
|
}
|
|
25552
25552
|
|
|
25553
|
+
/**
|
|
25554
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
25555
|
+
* element is overflowing a given clipping boundary on each side.
|
|
25556
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
25557
|
+
* - negative = how many pixels left before it will overflow
|
|
25558
|
+
* - 0 = lies flush with the boundary
|
|
25559
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
25560
|
+
*/
|
|
25561
|
+
async function detectOverflow(state, options) {
|
|
25562
|
+
var _await$platform$isEle;
|
|
25563
|
+
if (options === void 0) {
|
|
25564
|
+
options = {};
|
|
25565
|
+
}
|
|
25566
|
+
const {
|
|
25567
|
+
x,
|
|
25568
|
+
y,
|
|
25569
|
+
platform,
|
|
25570
|
+
rects,
|
|
25571
|
+
elements,
|
|
25572
|
+
strategy
|
|
25573
|
+
} = state;
|
|
25574
|
+
const {
|
|
25575
|
+
boundary = 'clippingAncestors',
|
|
25576
|
+
rootBoundary = 'viewport',
|
|
25577
|
+
elementContext = 'floating',
|
|
25578
|
+
altBoundary = false,
|
|
25579
|
+
padding = 0
|
|
25580
|
+
} = evaluate(options, state);
|
|
25581
|
+
const paddingObject = getPaddingObject(padding);
|
|
25582
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
25583
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
25584
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
25585
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
25586
|
+
boundary,
|
|
25587
|
+
rootBoundary,
|
|
25588
|
+
strategy
|
|
25589
|
+
}));
|
|
25590
|
+
const rect = elementContext === 'floating' ? {
|
|
25591
|
+
x,
|
|
25592
|
+
y,
|
|
25593
|
+
width: rects.floating.width,
|
|
25594
|
+
height: rects.floating.height
|
|
25595
|
+
} : rects.reference;
|
|
25596
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
25597
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
25598
|
+
x: 1,
|
|
25599
|
+
y: 1
|
|
25600
|
+
} : {
|
|
25601
|
+
x: 1,
|
|
25602
|
+
y: 1
|
|
25603
|
+
};
|
|
25604
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
25605
|
+
elements,
|
|
25606
|
+
rect,
|
|
25607
|
+
offsetParent,
|
|
25608
|
+
strategy
|
|
25609
|
+
}) : rect);
|
|
25610
|
+
return {
|
|
25611
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
25612
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
25613
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
25614
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25615
|
+
};
|
|
25616
|
+
}
|
|
25617
|
+
|
|
25553
25618
|
/**
|
|
25554
25619
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
25555
25620
|
* next to a given reference element.
|
|
@@ -25579,6 +25644,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25579
25644
|
let middlewareData = {};
|
|
25580
25645
|
let resetCount = 0;
|
|
25581
25646
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
25647
|
+
var _platform$detectOverf;
|
|
25582
25648
|
const {
|
|
25583
25649
|
name,
|
|
25584
25650
|
fn
|
|
@@ -25596,7 +25662,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25596
25662
|
strategy,
|
|
25597
25663
|
middlewareData,
|
|
25598
25664
|
rects,
|
|
25599
|
-
platform
|
|
25665
|
+
platform: {
|
|
25666
|
+
...platform,
|
|
25667
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
25668
|
+
},
|
|
25600
25669
|
elements: {
|
|
25601
25670
|
reference,
|
|
25602
25671
|
floating
|
|
@@ -25641,71 +25710,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
25641
25710
|
};
|
|
25642
25711
|
};
|
|
25643
25712
|
|
|
25644
|
-
/**
|
|
25645
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
25646
|
-
* element is overflowing a given clipping boundary on each side.
|
|
25647
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
25648
|
-
* - negative = how many pixels left before it will overflow
|
|
25649
|
-
* - 0 = lies flush with the boundary
|
|
25650
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
25651
|
-
*/
|
|
25652
|
-
async function detectOverflow(state, options) {
|
|
25653
|
-
var _await$platform$isEle;
|
|
25654
|
-
if (options === void 0) {
|
|
25655
|
-
options = {};
|
|
25656
|
-
}
|
|
25657
|
-
const {
|
|
25658
|
-
x,
|
|
25659
|
-
y,
|
|
25660
|
-
platform,
|
|
25661
|
-
rects,
|
|
25662
|
-
elements,
|
|
25663
|
-
strategy
|
|
25664
|
-
} = state;
|
|
25665
|
-
const {
|
|
25666
|
-
boundary = 'clippingAncestors',
|
|
25667
|
-
rootBoundary = 'viewport',
|
|
25668
|
-
elementContext = 'floating',
|
|
25669
|
-
altBoundary = false,
|
|
25670
|
-
padding = 0
|
|
25671
|
-
} = evaluate(options, state);
|
|
25672
|
-
const paddingObject = getPaddingObject(padding);
|
|
25673
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
25674
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
25675
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
25676
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
25677
|
-
boundary,
|
|
25678
|
-
rootBoundary,
|
|
25679
|
-
strategy
|
|
25680
|
-
}));
|
|
25681
|
-
const rect = elementContext === 'floating' ? {
|
|
25682
|
-
x,
|
|
25683
|
-
y,
|
|
25684
|
-
width: rects.floating.width,
|
|
25685
|
-
height: rects.floating.height
|
|
25686
|
-
} : rects.reference;
|
|
25687
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
25688
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
25689
|
-
x: 1,
|
|
25690
|
-
y: 1
|
|
25691
|
-
} : {
|
|
25692
|
-
x: 1,
|
|
25693
|
-
y: 1
|
|
25694
|
-
};
|
|
25695
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
25696
|
-
elements,
|
|
25697
|
-
rect,
|
|
25698
|
-
offsetParent,
|
|
25699
|
-
strategy
|
|
25700
|
-
}) : rect);
|
|
25701
|
-
return {
|
|
25702
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
25703
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
25704
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
25705
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25706
|
-
};
|
|
25707
|
-
}
|
|
25708
|
-
|
|
25709
25713
|
/**
|
|
25710
25714
|
* Provides data to position an inner element of the floating element so that it
|
|
25711
25715
|
* appears centered to the reference element.
|
|
@@ -25838,7 +25842,7 @@ const flip$1 = function (options) {
|
|
|
25838
25842
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
25839
25843
|
}
|
|
25840
25844
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
25841
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
25845
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
25842
25846
|
const overflows = [];
|
|
25843
25847
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
25844
25848
|
if (checkMainAxis) {
|
|
@@ -26022,7 +26026,8 @@ const shift$1 = function (options) {
|
|
|
26022
26026
|
const {
|
|
26023
26027
|
x,
|
|
26024
26028
|
y,
|
|
26025
|
-
placement
|
|
26029
|
+
placement,
|
|
26030
|
+
platform
|
|
26026
26031
|
} = state;
|
|
26027
26032
|
const {
|
|
26028
26033
|
mainAxis: checkMainAxis = true,
|
|
@@ -26045,7 +26050,7 @@ const shift$1 = function (options) {
|
|
|
26045
26050
|
x,
|
|
26046
26051
|
y
|
|
26047
26052
|
};
|
|
26048
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
26053
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
26049
26054
|
const crossAxis = getSideAxis(getSide(placement));
|
|
26050
26055
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
26051
26056
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -30998,44 +31003,17 @@ class KolTooltipWc {
|
|
|
30998
31003
|
void this.hideTooltip();
|
|
30999
31004
|
}
|
|
31000
31005
|
};
|
|
31001
|
-
this.handleMouseEnter = () => {
|
|
31002
|
-
const isNewVisit = this.isNewVisit();
|
|
31003
|
-
this.hasMouseIn = true;
|
|
31004
|
-
if (isNewVisit) {
|
|
31005
|
-
this.isHiddenForCurrentVisit = false;
|
|
31006
|
-
}
|
|
31007
|
-
this.showOrHideTooltip();
|
|
31008
|
-
};
|
|
31009
|
-
this.handleMouseleave = (event) => {
|
|
31010
|
-
var _a, _b;
|
|
31011
|
-
this.hasMouseIn = (_b = (_a = this.tooltipElement) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget)) !== null && _b !== void 0 ? _b : false;
|
|
31012
|
-
this.resetHideFlag();
|
|
31013
|
-
this.showOrHideTooltip();
|
|
31014
|
-
};
|
|
31015
|
-
this.handleFocusIn = () => {
|
|
31016
|
-
const isNewVisit = this.isNewVisit();
|
|
31017
|
-
this.hasFocusIn = true;
|
|
31018
|
-
if (isNewVisit) {
|
|
31019
|
-
this.isHiddenForCurrentVisit = false;
|
|
31020
|
-
}
|
|
31021
|
-
this.showOrHideTooltip();
|
|
31022
|
-
};
|
|
31023
|
-
this.handleFocusout = () => {
|
|
31024
|
-
this.hasFocusIn = false;
|
|
31025
|
-
this.resetHideFlag();
|
|
31026
|
-
this.showOrHideTooltip();
|
|
31027
|
-
};
|
|
31028
31006
|
this.addListeners = (el) => {
|
|
31029
|
-
el.addEventListener('mouseenter', this.handleMouseEnter);
|
|
31030
|
-
el.addEventListener('mouseleave', this.
|
|
31031
|
-
el.addEventListener('focusin', this.handleFocusIn);
|
|
31032
|
-
el.addEventListener('focusout', this.
|
|
31007
|
+
el.addEventListener('mouseenter', this.handleMouseEnter.bind(this));
|
|
31008
|
+
el.addEventListener('mouseleave', this.handleMouseLeave.bind(this));
|
|
31009
|
+
el.addEventListener('focusin', this.handleFocusIn.bind(this));
|
|
31010
|
+
el.addEventListener('focusout', this.handleFocusOut.bind(this));
|
|
31033
31011
|
};
|
|
31034
31012
|
this.removeListeners = (el) => {
|
|
31035
|
-
el.removeEventListener('mouseenter', this.handleMouseEnter);
|
|
31036
|
-
el.removeEventListener('mouseleave', this.
|
|
31037
|
-
el.removeEventListener('focusin', this.handleFocusIn);
|
|
31038
|
-
el.removeEventListener('focusout', this.
|
|
31013
|
+
el.removeEventListener('mouseenter', this.handleMouseEnter.bind(this));
|
|
31014
|
+
el.removeEventListener('mouseleave', this.handleMouseLeave.bind(this));
|
|
31015
|
+
el.removeEventListener('focusin', this.handleFocusIn.bind(this));
|
|
31016
|
+
el.removeEventListener('focusout', this.handleFocusOut.bind(this));
|
|
31039
31017
|
};
|
|
31040
31018
|
this.resyncListeners = (last, next, replacePreviousSibling = false) => {
|
|
31041
31019
|
if (last) {
|
|
@@ -31098,8 +31076,34 @@ class KolTooltipWc {
|
|
|
31098
31076
|
}
|
|
31099
31077
|
getDocument().removeEventListener('keyup', this.hideTooltipByEscape);
|
|
31100
31078
|
}
|
|
31079
|
+
handleMouseEnter() {
|
|
31080
|
+
const isNewVisit = this.isNewVisit();
|
|
31081
|
+
this.hasMouseIn = true;
|
|
31082
|
+
if (isNewVisit) {
|
|
31083
|
+
this.isHiddenForCurrentVisit = false;
|
|
31084
|
+
}
|
|
31085
|
+
this.showOrHideTooltip();
|
|
31086
|
+
}
|
|
31087
|
+
handleMouseLeave() {
|
|
31088
|
+
this.hasMouseIn = false;
|
|
31089
|
+
this.resetHideFlag();
|
|
31090
|
+
this.showOrHideTooltip();
|
|
31091
|
+
}
|
|
31092
|
+
handleFocusIn() {
|
|
31093
|
+
const isNewVisit = this.isNewVisit();
|
|
31094
|
+
this.hasFocusIn = true;
|
|
31095
|
+
if (isNewVisit) {
|
|
31096
|
+
this.isHiddenForCurrentVisit = false;
|
|
31097
|
+
}
|
|
31098
|
+
this.showOrHideTooltip();
|
|
31099
|
+
}
|
|
31100
|
+
handleFocusOut() {
|
|
31101
|
+
this.hasFocusIn = false;
|
|
31102
|
+
this.resetHideFlag();
|
|
31103
|
+
this.showOrHideTooltip();
|
|
31104
|
+
}
|
|
31101
31105
|
render() {
|
|
31102
|
-
return (hAsync(Host, { key: '
|
|
31106
|
+
return (hAsync(Host, { key: '06b88a008110f4aa881af6b482e0a567301e8485', class: "kol-tooltip" }, hAsync("div", { key: 'f90973a436d4462581de6ee6fe819efe42fecd6c', class: "kol-tooltip__floating", hidden: this.state._label.length === 0, ref: this.catchTooltipElement }, hAsync("div", { key: 'c84c65420bd6cf538ccb2e6b5c130c2796d0ddec', class: "kol-tooltip__arrow", ref: this.catchArrowElement }), hAsync(KolSpanFc, { key: '079d51f0417933162ab521d5874d6bc40a3ab572', class: "kol-tooltip__content", id: this.state._id, badgeText: this._badgeText, label: this.state._label }))));
|
|
31103
31107
|
}
|
|
31104
31108
|
validateBadgeText(value) {
|
|
31105
31109
|
validateBadgeText(this, value);
|
|
@@ -31122,14 +31126,13 @@ class KolTooltipWc {
|
|
|
31122
31126
|
this.validateLabel(this._label);
|
|
31123
31127
|
}
|
|
31124
31128
|
handleEventListeners() {
|
|
31125
|
-
var _a
|
|
31126
|
-
|
|
31127
|
-
this.resyncListeners(this.previousSibling, nextSibling, true);
|
|
31129
|
+
var _a;
|
|
31130
|
+
this.resyncListeners(this.previousSibling, (_a = this.host) === null || _a === void 0 ? void 0 : _a.previousElementSibling, true);
|
|
31128
31131
|
this.resyncListeners(this.tooltipElement, this.tooltipElement);
|
|
31129
31132
|
}
|
|
31130
31133
|
connectedCallback() {
|
|
31131
|
-
var _a
|
|
31132
|
-
this.previousSibling = (
|
|
31134
|
+
var _a;
|
|
31135
|
+
this.previousSibling = (_a = this.host) === null || _a === void 0 ? void 0 : _a.previousElementSibling;
|
|
31133
31136
|
}
|
|
31134
31137
|
componentDidRender() {
|
|
31135
31138
|
this.handleEventListeners();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/hydrate",
|
|
3
|
-
"version": "3.1.1",
|
|
3
|
+
"version": "3.1.2-rc.1",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"prettier": "3.8.1",
|
|
53
53
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
54
54
|
"rimraf": "6.1.2",
|
|
55
|
-
"@public-ui/components": "3.1.1"
|
|
55
|
+
"@public-ui/components": "3.1.2-rc.1"
|
|
56
56
|
},
|
|
57
57
|
"sideEffects": false,
|
|
58
58
|
"type": "commonjs",
|