@haiilo/catalyst 5.4.0 → 6.0.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/dist/catalyst/catalyst.css +1071 -0
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +6 -0
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-ad5fca6b.entry.js +10 -0
- package/dist/catalyst/p-ad5fca6b.entry.js.map +1 -0
- package/dist/catalyst/p-d7dc291a.js +2 -0
- package/dist/catalyst/p-d7dc291a.js.map +1 -0
- package/dist/catalyst/scss/index.scss +2 -0
- package/dist/catalyst/scss/vendor/_flatpickr.scss +314 -0
- package/dist/cjs/{cat-alert_27.cjs.entry.js → cat-alert_25.cjs.entry.js} +2922 -3480
- package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-228164a1.js → cat-icon-registry-6161e2ee.js} +14 -2
- package/dist/cjs/cat-icon-registry-6161e2ee.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +12 -14
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/cat-avatar/cat-avatar.js +5 -5
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.js +5 -7
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +39 -42
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +22 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.css +6 -369
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +110 -314
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +51 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +6 -9
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +4 -5
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -6
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +13 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +0 -377
- package/dist/collection/components/cat-input/cat-input.js +14 -40
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/input-type.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +11 -13
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +11 -36
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +37 -11
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +2 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +42 -53
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +21 -25
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +4 -7
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +17 -21
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +38 -41
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +17 -22
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/index.cdn.js +6 -0
- package/dist/collection/scss/index.scss +2 -0
- package/dist/collection/scss/vendor/_flatpickr.scss +314 -0
- package/dist/collection/utils/platform.js +1 -1
- package/dist/collection/utils/platform.js.map +1 -1
- package/dist/components/cat-avatar2.js +5 -5
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-button2.js +6 -8
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +14 -15
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-datepicker.js +2725 -3028
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-dropdown2.js +6 -9
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +4 -5
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +2 -6
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +13 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-input2.js +9 -16
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +15 -9
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +5 -12
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +2 -3
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +21 -25
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +42 -53
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-tabs.js +4 -7
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +11 -11
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +14 -15
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +17 -22
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +55 -68
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.js +11 -13
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_27.entry.js → cat-alert_25.entry.js} +2922 -3478
- package/dist/esm/cat-alert_25.entry.js.map +1 -0
- package/dist/esm/{cat-icon-registry-4bd597f4.js → cat-icon-registry-f15b29d9.js} +14 -2
- package/dist/esm/cat-icon-registry-f15b29d9.js.map +1 -0
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +13 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/@types/Intl.d.ts +3 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +11 -9
- package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +1 -0
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +21 -65
- package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +3 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -0
- package/dist/types/components/cat-input/cat-input.d.ts +2 -6
- package/dist/types/components/cat-input/input-type.d.ts +1 -1
- package/dist/types/components/cat-pagination/cat-pagination.d.ts +1 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +3 -7
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +6 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -4
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +10 -8
- package/dist/types/components.d.ts +83 -417
- package/package.json +8 -10
- package/dist/catalyst/p-34e0cbba.entry.js +0 -10
- package/dist/catalyst/p-34e0cbba.entry.js.map +0 -1
- package/dist/catalyst/p-cf32399c.js +0 -2
- package/dist/catalyst/p-cf32399c.js.map +0 -1
- package/dist/cjs/cat-alert_27.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-228164a1.js.map +0 -1
- package/dist/collection/components/cat-datepicker/datepicker-type.js +0 -8
- package/dist/collection/components/cat-datepicker/datepicker-type.js.map +0 -1
- package/dist/collection/components/cat-datepicker/dayjs.config.js +0 -8
- package/dist/collection/components/cat-datepicker/dayjs.config.js.map +0 -1
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js +0 -46
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js.map +0 -1
- package/dist/collection/components/cat-label/cat-label.css +0 -22
- package/dist/collection/components/cat-label/cat-label.js +0 -134
- package/dist/collection/components/cat-label/cat-label.js.map +0 -1
- package/dist/collection/components/cat-timepicker/cat-timepicker.css +0 -5
- package/dist/collection/components/cat-timepicker/cat-timepicker.js +0 -668
- package/dist/collection/components/cat-timepicker/cat-timepicker.js.map +0 -1
- package/dist/components/cat-label.d.ts +0 -11
- package/dist/components/cat-label.js +0 -73
- package/dist/components/cat-label.js.map +0 -1
- package/dist/components/cat-timepicker.d.ts +0 -11
- package/dist/components/cat-timepicker.js +0 -258
- package/dist/components/cat-timepicker.js.map +0 -1
- package/dist/esm/cat-alert_27.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-4bd597f4.js.map +0 -1
- package/dist/types/components/cat-datepicker/datepicker-type.d.ts +0 -7
- package/dist/types/components/cat-datepicker/datepicker.d.ts +0 -1
- package/dist/types/components/cat-datepicker/dayjs.config.d.ts +0 -3
- package/dist/types/components/cat-datepicker/vanillajs-datepicker.config.d.ts +0 -4
- package/dist/types/components/cat-label/cat-label.d.ts +0 -27
- package/dist/types/components/cat-timepicker/cat-timepicker.d.ts +0 -158
|
@@ -161,6 +161,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
function evaluate(value, param) {
|
|
165
|
+
return typeof value === 'function' ? value(param) : value;
|
|
166
|
+
}
|
|
167
|
+
|
|
164
168
|
function expandPaddingObject(padding) {
|
|
165
169
|
return {
|
|
166
170
|
top: 0,
|
|
@@ -217,7 +221,7 @@ async function detectOverflow(state, options) {
|
|
|
217
221
|
elementContext = 'floating',
|
|
218
222
|
altBoundary = false,
|
|
219
223
|
padding = 0
|
|
220
|
-
} = options;
|
|
224
|
+
} = evaluate(options, state);
|
|
221
225
|
const paddingObject = getSideObjectFromPadding(padding);
|
|
222
226
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
223
227
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
@@ -360,7 +364,7 @@ const flip = function (options) {
|
|
|
360
364
|
fallbackAxisSideDirection = 'none',
|
|
361
365
|
flipAlignment = true,
|
|
362
366
|
...detectOverflowOptions
|
|
363
|
-
} = options;
|
|
367
|
+
} = evaluate(options, state);
|
|
364
368
|
const side = getSide(placement);
|
|
365
369
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
366
370
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
@@ -439,7 +443,7 @@ const flip = function (options) {
|
|
|
439
443
|
};
|
|
440
444
|
};
|
|
441
445
|
|
|
442
|
-
async function convertValueToCoords(state,
|
|
446
|
+
async function convertValueToCoords(state, options) {
|
|
443
447
|
const {
|
|
444
448
|
placement,
|
|
445
449
|
platform,
|
|
@@ -451,7 +455,7 @@ async function convertValueToCoords(state, value) {
|
|
|
451
455
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
452
456
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
453
457
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
454
|
-
const rawValue =
|
|
458
|
+
const rawValue = evaluate(options, state);
|
|
455
459
|
|
|
456
460
|
// eslint-disable-next-line prefer-const
|
|
457
461
|
let {
|
|
@@ -487,19 +491,19 @@ async function convertValueToCoords(state, value) {
|
|
|
487
491
|
* object may be passed.
|
|
488
492
|
* @see https://floating-ui.com/docs/offset
|
|
489
493
|
*/
|
|
490
|
-
const offset = function (
|
|
491
|
-
if (
|
|
492
|
-
|
|
494
|
+
const offset = function (options) {
|
|
495
|
+
if (options === void 0) {
|
|
496
|
+
options = 0;
|
|
493
497
|
}
|
|
494
498
|
return {
|
|
495
499
|
name: 'offset',
|
|
496
|
-
options
|
|
500
|
+
options,
|
|
497
501
|
async fn(state) {
|
|
498
502
|
const {
|
|
499
503
|
x,
|
|
500
504
|
y
|
|
501
505
|
} = state;
|
|
502
|
-
const diffCoords = await convertValueToCoords(state,
|
|
506
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
503
507
|
return {
|
|
504
508
|
x: x + diffCoords.x,
|
|
505
509
|
y: y + diffCoords.y,
|
|
@@ -547,7 +551,7 @@ const shift = function (options) {
|
|
|
547
551
|
}
|
|
548
552
|
},
|
|
549
553
|
...detectOverflowOptions
|
|
550
|
-
} = options;
|
|
554
|
+
} = evaluate(options, state);
|
|
551
555
|
const coords = {
|
|
552
556
|
x,
|
|
553
557
|
y
|
|
@@ -610,7 +614,7 @@ const size = function (options) {
|
|
|
610
614
|
const {
|
|
611
615
|
apply = () => {},
|
|
612
616
|
...detectOverflowOptions
|
|
613
|
-
} = options;
|
|
617
|
+
} = evaluate(options, state);
|
|
614
618
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
615
619
|
const side = getSide(placement);
|
|
616
620
|
const alignment = getAlignment(placement);
|
|
@@ -686,19 +690,6 @@ function getNodeName(node) {
|
|
|
686
690
|
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
|
|
687
691
|
}
|
|
688
692
|
|
|
689
|
-
let uaString;
|
|
690
|
-
function getUAString() {
|
|
691
|
-
if (uaString) {
|
|
692
|
-
return uaString;
|
|
693
|
-
}
|
|
694
|
-
const uaData = navigator.userAgentData;
|
|
695
|
-
if (uaData && Array.isArray(uaData.brands)) {
|
|
696
|
-
uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
697
|
-
return uaString;
|
|
698
|
-
}
|
|
699
|
-
return navigator.userAgent;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
693
|
function isHTMLElement(value) {
|
|
703
694
|
return value instanceof getWindow(value).HTMLElement;
|
|
704
695
|
}
|
|
@@ -726,36 +717,15 @@ function isTableElement(element) {
|
|
|
726
717
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
727
718
|
}
|
|
728
719
|
function isContainingBlock(element) {
|
|
729
|
-
|
|
730
|
-
const isFirefox = /firefox/i.test(getUAString());
|
|
720
|
+
const safari = isSafari();
|
|
731
721
|
const css = getComputedStyle$1(element);
|
|
732
|
-
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
733
722
|
|
|
734
|
-
// This is non-exhaustive but covers the most common CSS properties that
|
|
735
|
-
// create a containing block.
|
|
736
723
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
737
|
-
return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) ||
|
|
738
|
-
// Add type check for old browsers.
|
|
739
|
-
const contain = css.contain;
|
|
740
|
-
return contain != null ? contain.includes(value) : false;
|
|
741
|
-
});
|
|
724
|
+
return css.transform !== 'none' || css.perspective !== 'none' || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
742
725
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
* viewport offsets. In Safari, the `x`/`y` offsets are values relative to the
|
|
747
|
-
* visual viewport, while in other engines, they are values relative to the
|
|
748
|
-
* layout viewport.
|
|
749
|
-
*/
|
|
750
|
-
function isClientRectVisualViewportBased() {
|
|
751
|
-
// TODO: Try to use feature detection here instead. Feature detection for
|
|
752
|
-
// this can fail in various ways, making the userAgent check the most
|
|
753
|
-
// reliable:
|
|
754
|
-
// • Always-visible scrollbar or not
|
|
755
|
-
// • Width of <html>
|
|
756
|
-
|
|
757
|
-
// Is Safari.
|
|
758
|
-
return /^((?!chrome|android).)*safari/i.test(getUAString());
|
|
726
|
+
function isSafari() {
|
|
727
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
728
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
759
729
|
}
|
|
760
730
|
function isLastTraversableNode(node) {
|
|
761
731
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
@@ -822,8 +792,29 @@ function getScale(element) {
|
|
|
822
792
|
};
|
|
823
793
|
}
|
|
824
794
|
|
|
825
|
-
|
|
795
|
+
const noOffsets = {
|
|
796
|
+
x: 0,
|
|
797
|
+
y: 0
|
|
798
|
+
};
|
|
799
|
+
function getVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
826
800
|
var _win$visualViewport, _win$visualViewport2;
|
|
801
|
+
if (isFixed === void 0) {
|
|
802
|
+
isFixed = true;
|
|
803
|
+
}
|
|
804
|
+
if (!isSafari()) {
|
|
805
|
+
return noOffsets;
|
|
806
|
+
}
|
|
807
|
+
const win = element ? getWindow(element) : window;
|
|
808
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) {
|
|
809
|
+
return noOffsets;
|
|
810
|
+
}
|
|
811
|
+
return {
|
|
812
|
+
x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0,
|
|
813
|
+
y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
827
818
|
if (includeScale === void 0) {
|
|
828
819
|
includeScale = false;
|
|
829
820
|
}
|
|
@@ -842,10 +833,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
842
833
|
scale = getScale(element);
|
|
843
834
|
}
|
|
844
835
|
}
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
let
|
|
848
|
-
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
|
|
836
|
+
const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent);
|
|
837
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
838
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
849
839
|
let width = clientRect.width / scale.x;
|
|
850
840
|
let height = clientRect.height / scale.y;
|
|
851
841
|
if (domElement) {
|
|
@@ -1015,7 +1005,7 @@ function getViewportRect(element, strategy) {
|
|
|
1015
1005
|
if (visualViewport) {
|
|
1016
1006
|
width = visualViewport.width;
|
|
1017
1007
|
height = visualViewport.height;
|
|
1018
|
-
const visualViewportBased =
|
|
1008
|
+
const visualViewportBased = isSafari();
|
|
1019
1009
|
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1020
1010
|
x = visualViewport.offsetLeft;
|
|
1021
1011
|
y = visualViewport.offsetTop;
|
|
@@ -1058,16 +1048,12 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1058
1048
|
} else if (isElement(clippingAncestor)) {
|
|
1059
1049
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1060
1050
|
} else {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1051
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1052
|
+
rect = {
|
|
1053
|
+
...clippingAncestor,
|
|
1054
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1055
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1063
1056
|
};
|
|
1064
|
-
if (isClientRectVisualViewportBased()) {
|
|
1065
|
-
var _win$visualViewport, _win$visualViewport2;
|
|
1066
|
-
const win = getWindow(element);
|
|
1067
|
-
mutableRect.x -= ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0;
|
|
1068
|
-
mutableRect.y -= ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0;
|
|
1069
|
-
}
|
|
1070
|
-
rect = mutableRect;
|
|
1071
1057
|
}
|
|
1072
1058
|
return rectToClientRect(rect);
|
|
1073
1059
|
}
|
|
@@ -1186,7 +1172,8 @@ function getOffsetParent(element, polyfill) {
|
|
|
1186
1172
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1187
1173
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1188
1174
|
const documentElement = getDocumentElement(offsetParent);
|
|
1189
|
-
const
|
|
1175
|
+
const isFixed = strategy === 'fixed';
|
|
1176
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1190
1177
|
let scroll = {
|
|
1191
1178
|
scrollLeft: 0,
|
|
1192
1179
|
scrollTop: 0
|
|
@@ -1195,12 +1182,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1195
1182
|
x: 0,
|
|
1196
1183
|
y: 0
|
|
1197
1184
|
};
|
|
1198
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement &&
|
|
1185
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1199
1186
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1200
1187
|
scroll = getNodeScroll(offsetParent);
|
|
1201
1188
|
}
|
|
1202
1189
|
if (isHTMLElement(offsetParent)) {
|
|
1203
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1190
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1204
1191
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1205
1192
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1206
1193
|
} else if (documentElement) {
|