@linzjs/lui 21.26.2 → 21.26.3
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/CHANGELOG.md +7 -0
- package/dist/components/Splitter/helpers/transition.d.ts +1 -1
- package/dist/index.js +50 -41
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +50 -41
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/lui.esm.js
CHANGED
|
@@ -58410,7 +58410,7 @@ var LuiPagination = function (_a) {
|
|
|
58410
58410
|
React__default.createElement("div", { className: "pagination" }, renderPaginationNumbers())))));
|
|
58411
58411
|
};
|
|
58412
58412
|
|
|
58413
|
-
var css_248z$2 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.Separator {\n background-color: #eaeaea;\n position: absolute;\n display: flex;\n justify-content: space-around;\n transition-property: background-color;\n transition-delay: 750ms;\n transition-duration:
|
|
58413
|
+
var css_248z$2 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.Separator {\n background-color: #eaeaea;\n position: absolute;\n display: flex;\n justify-content: space-around;\n transition-property: background-color;\n transition-delay: 750ms;\n transition-duration: 0ms;\n}\n.Separator-arrows {\n align-self: center;\n position: relative;\n opacity: 0;\n transition-property: opacity;\n transition-delay: 750ms;\n transition-duration: 0ms;\n}\n.Separator:focus-within, .Separator:hover, .Separator:focus, .Separator:active {\n background-color: #73c8e1;\n transition-delay: 0ms;\n transition-duration: 0ms;\n}\n.Separator:focus-within .Separator-arrows, .Separator:hover .Separator-arrows, .Separator:focus .Separator-arrows, .Separator:active .Separator-arrows {\n opacity: 1;\n transition-delay: 0ms;\n transition-duration: 0ms;\n display: inline-block;\n}";
|
|
58414
58414
|
styleInject(css_248z$2);
|
|
58415
58415
|
|
|
58416
58416
|
var css_248z$1 = ".Control {\n transition: opacity 0.2s ease;\n position: absolute;\n margin-left: 0 !important;\n display: flex;\n justify-content: space-around;\n align-items: center;\n}";
|
|
@@ -58652,29 +58652,6 @@ var getSeparatorPosition = function (separatorRef, drag) {
|
|
|
58652
58652
|
return clampSeparator({ value: value });
|
|
58653
58653
|
};
|
|
58654
58654
|
|
|
58655
|
-
var transitionFactory = function (attrs, ms) {
|
|
58656
|
-
return attrs.map(function (key) { return "".concat(key, " ").concat(ms, "ms"); }).join(', ');
|
|
58657
|
-
};
|
|
58658
|
-
var barTransition = function (ms) {
|
|
58659
|
-
return transitionFactory(['left', 'top', 'right', 'bottom'], ms);
|
|
58660
|
-
};
|
|
58661
|
-
var gridTransition = function (ms) {
|
|
58662
|
-
return transitionFactory(['grid-template-columns', 'grid-template-rows'], ms);
|
|
58663
|
-
};
|
|
58664
|
-
var transition = function (separator) {
|
|
58665
|
-
var _a;
|
|
58666
|
-
var splitter = (_a = separator.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
58667
|
-
var delay = function (ms) {
|
|
58668
|
-
if (splitter) {
|
|
58669
|
-
separator.current.style.transition = barTransition(ms);
|
|
58670
|
-
splitter.style.transition = gridTransition(ms);
|
|
58671
|
-
}
|
|
58672
|
-
};
|
|
58673
|
-
var stop = function () { return delay(0); };
|
|
58674
|
-
var resume = function () { return delay(300); };
|
|
58675
|
-
return { stop: stop, resume: resume };
|
|
58676
|
-
};
|
|
58677
|
-
|
|
58678
58655
|
/**
|
|
58679
58656
|
* It captures window events to report a new position.
|
|
58680
58657
|
* Provides necessary handlers for separator.
|
|
@@ -58718,7 +58695,6 @@ var animateSeparator = function (separatorRef, animate) {
|
|
|
58718
58695
|
var splitter = separator === null || separator === void 0 ? void 0 : separator.parentElement;
|
|
58719
58696
|
if (separator && splitter) {
|
|
58720
58697
|
if (animate === 'clear-transition') {
|
|
58721
|
-
transition(separatorRef).stop();
|
|
58722
58698
|
splitter.style.cursor =
|
|
58723
58699
|
separator.getAttribute('aria-orientation') === 'vertical'
|
|
58724
58700
|
? 'col-resize'
|
|
@@ -58726,22 +58702,40 @@ var animateSeparator = function (separatorRef, animate) {
|
|
|
58726
58702
|
splitter.classList.add('resizing');
|
|
58727
58703
|
}
|
|
58728
58704
|
else {
|
|
58729
|
-
transition(separatorRef).resume();
|
|
58730
58705
|
splitter.style.cursor = '';
|
|
58731
58706
|
splitter.classList.remove('resizing');
|
|
58732
58707
|
}
|
|
58733
58708
|
}
|
|
58734
58709
|
};
|
|
58735
58710
|
|
|
58736
|
-
var
|
|
58737
|
-
|
|
58738
|
-
useEffect(function () { return transition(separator).resume(); }, [count]);
|
|
58739
|
-
return useCallback(function (val, config) {
|
|
58740
|
-
transition(separator).stop();
|
|
58741
|
-
setValueNow(val, config);
|
|
58742
|
-
setCount(function (p) { return p + 1; });
|
|
58743
|
-
}, [setValueNow]);
|
|
58711
|
+
var transitionFactory = function (attrs, ms) {
|
|
58712
|
+
return attrs.map(function (key) { return "".concat(key, " ").concat(ms, "ms"); }).join(', ');
|
|
58744
58713
|
};
|
|
58714
|
+
var barTransition = function (ms) {
|
|
58715
|
+
return transitionFactory(['left', 'top', 'right', 'bottom'], ms);
|
|
58716
|
+
};
|
|
58717
|
+
var gridTransition = function (ms) {
|
|
58718
|
+
return transitionFactory(['grid-template-columns', 'grid-template-rows'], ms);
|
|
58719
|
+
};
|
|
58720
|
+
var transition = function (props) {
|
|
58721
|
+
var _a;
|
|
58722
|
+
var separator = Object.hasOwn(props, 'current')
|
|
58723
|
+
? props
|
|
58724
|
+
: { current: props };
|
|
58725
|
+
var splitter = (_a = separator.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
58726
|
+
var delay = function (ms) {
|
|
58727
|
+
if (splitter) {
|
|
58728
|
+
separator.current.style.transition = barTransition(ms);
|
|
58729
|
+
splitter.style.transition = gridTransition(ms);
|
|
58730
|
+
}
|
|
58731
|
+
};
|
|
58732
|
+
var stop = function () { return delay(0); };
|
|
58733
|
+
var resume = function () {
|
|
58734
|
+
return delay((splitter === null || splitter === void 0 ? void 0 : splitter.classList.contains('resizing')) ? 0 : 300);
|
|
58735
|
+
};
|
|
58736
|
+
return { stop: stop, resume: resume };
|
|
58737
|
+
};
|
|
58738
|
+
|
|
58745
58739
|
/**
|
|
58746
58740
|
* Moves separator as per ratio changes. Centers on first render if ratio is undefined.
|
|
58747
58741
|
*/
|
|
@@ -58750,6 +58744,9 @@ var useRatioEffect = function (setValueNow, separator, ratio, startAt) {
|
|
|
58750
58744
|
var _a = getSeparatorAttributes({ ref: separator }), valueMax = _a.valueMax, valueMin = _a.valueMin;
|
|
58751
58745
|
var isCalculating = valueMax === Infinity || valueMin === -Infinity;
|
|
58752
58746
|
useEffect(function () {
|
|
58747
|
+
if (!firstRun.current && ratio !== undefined && !isCalculating) {
|
|
58748
|
+
transition(separator).resume();
|
|
58749
|
+
}
|
|
58753
58750
|
if (firstRun.current || ratio !== undefined || isCalculating) {
|
|
58754
58751
|
firstRun.current = false;
|
|
58755
58752
|
// If ratio is undefined, setValueNow will place the separator in the middle as a starting point.
|
|
@@ -58762,7 +58759,6 @@ var useRatioEffect = function (setValueNow, separator, ratio, startAt) {
|
|
|
58762
58759
|
* Re-arranges the splitter if the limits or orientation change.
|
|
58763
58760
|
*/
|
|
58764
58761
|
var useConfigEffect = function (setValueNow, separator) {
|
|
58765
|
-
var setValueNow_static = useSetValueNow_static(setValueNow, separator);
|
|
58766
58762
|
useEffect(function () {
|
|
58767
58763
|
var callback = function (attr) {
|
|
58768
58764
|
return function (_a) {
|
|
@@ -58779,7 +58775,7 @@ var useConfigEffect = function (setValueNow, separator) {
|
|
|
58779
58775
|
// In such case, the newValueNow is moved along with the delimiter.
|
|
58780
58776
|
var newValueNow = !wasInBoundary ? valueNow : newValue;
|
|
58781
58777
|
if (wasInBoundary || valueMax < valueNow || valueMin > valueNow) {
|
|
58782
|
-
|
|
58778
|
+
setValueNow(newValueNow, { min: valueMin, max: valueMax });
|
|
58783
58779
|
}
|
|
58784
58780
|
else {
|
|
58785
58781
|
var threshold = 0.01;
|
|
@@ -58798,7 +58794,7 @@ var useConfigEffect = function (setValueNow, separator) {
|
|
|
58798
58794
|
}
|
|
58799
58795
|
var newVal = ((primary + offset) / container) * 100;
|
|
58800
58796
|
if (Math.abs(newVal - valueNow) >= threshold) {
|
|
58801
|
-
|
|
58797
|
+
setValueNow(newVal, { min: valueMin, max: valueMax });
|
|
58802
58798
|
}
|
|
58803
58799
|
}
|
|
58804
58800
|
};
|
|
@@ -58828,16 +58824,22 @@ var useConfigEffect = function (setValueNow, separator) {
|
|
|
58828
58824
|
var useValueNowEffect = function (setValueNow, separator) {
|
|
58829
58825
|
useEffect(function () {
|
|
58830
58826
|
var observer = new MutationObserver(function (_a) {
|
|
58831
|
-
var
|
|
58827
|
+
var _b = _a[0], target = _b.target, oldValue = _b.oldValue;
|
|
58832
58828
|
var el = target;
|
|
58833
58829
|
var splitter = target.parentElement;
|
|
58834
58830
|
var newValueNow = Number(el.getAttribute('aria-valuenow'));
|
|
58835
58831
|
if (!splitter.classList.contains('resizing')) {
|
|
58836
|
-
|
|
58832
|
+
if (Number(oldValue) !== newValueNow) {
|
|
58833
|
+
transition(separator).resume();
|
|
58834
|
+
setValueNow(newValueNow);
|
|
58835
|
+
}
|
|
58837
58836
|
}
|
|
58838
58837
|
});
|
|
58839
58838
|
var attributeFilter = ['aria-valuenow'];
|
|
58840
|
-
observer.observe(separator.current, {
|
|
58839
|
+
observer.observe(separator.current, {
|
|
58840
|
+
attributeFilter: attributeFilter,
|
|
58841
|
+
attributeOldValue: true
|
|
58842
|
+
});
|
|
58841
58843
|
return function () { return observer.disconnect(); };
|
|
58842
58844
|
}, [separator, setValueNow]);
|
|
58843
58845
|
};
|
|
@@ -59126,19 +59128,26 @@ var Separator = forwardRef$1(function (_a, forwardRef) {
|
|
|
59126
59128
|
var _a;
|
|
59127
59129
|
var newValueNow = keyDownHandler(e);
|
|
59128
59130
|
if (values().valueNow !== newValueNow) {
|
|
59131
|
+
transition(separator).resume();
|
|
59129
59132
|
setValueNow(newValueNow);
|
|
59130
59133
|
e.preventDefault();
|
|
59131
59134
|
}
|
|
59132
59135
|
(_a = props === null || props === void 0 ? void 0 : props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
59133
|
-
}, className: clsx('Separator', props.className)
|
|
59136
|
+
}, className: clsx('Separator', props.className), onTransitionEnd: function (e) {
|
|
59137
|
+
var _a;
|
|
59138
|
+
transition(separator).stop();
|
|
59139
|
+
(_a = props.onTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
59140
|
+
} }),
|
|
59134
59141
|
React__default.createElement("span", __assign({}, parts === null || parts === void 0 ? void 0 : parts.container, { className: clsx('Separator-arrows', (_b = parts === null || parts === void 0 ? void 0 : parts.container) === null || _b === void 0 ? void 0 : _b.className), onMouseDown: cancelEvent, onTouchStart: cancelEvent }),
|
|
59135
59142
|
React__default.createElement(Control, __assign({}, parts === null || parts === void 0 ? void 0 : parts.primary, { side: "primary", onClick: function (e) {
|
|
59136
59143
|
var _a, _b;
|
|
59144
|
+
transition(separator).resume();
|
|
59137
59145
|
setValueNow(controlClickHandler(e, 'primary'));
|
|
59138
59146
|
(_b = (_a = parts === null || parts === void 0 ? void 0 : parts.primary) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
59139
59147
|
} })),
|
|
59140
59148
|
React__default.createElement(Control, __assign({}, parts === null || parts === void 0 ? void 0 : parts.secondary, { side: "secondary", onClick: function (e) {
|
|
59141
59149
|
var _a, _b;
|
|
59150
|
+
transition(separator).resume();
|
|
59142
59151
|
setValueNow(controlClickHandler(e, 'secondary'));
|
|
59143
59152
|
(_b = (_a = parts === null || parts === void 0 ? void 0 : parts.secondary) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
59144
59153
|
} })))));
|