@univerjs/design 0.2.6 → 0.2.8
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/lib/cjs/index.js +11 -9
- package/lib/es/index.js +895 -567
- package/lib/index.css +1 -1
- package/lib/types/components/avatar/Avatar.d.ts +0 -1
- package/lib/types/components/avatar/Avatar.stories.d.ts +0 -1
- package/lib/types/components/button/Button.d.ts +0 -1
- package/lib/types/components/button/Button.stories.d.ts +0 -1
- package/lib/types/components/cascader-list/CascaderList.d.ts +0 -1
- package/lib/types/components/cascader-list/CascaderList.stories.d.ts +0 -1
- package/lib/types/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/types/components/checkbox/Checkbox.stories.d.ts +0 -1
- package/lib/types/components/checkbox-group/CheckboxGroup.d.ts +0 -1
- package/lib/types/components/checkbox-group/CheckboxGroup.stories.d.ts +0 -1
- package/lib/types/components/color-picker/ColorPicker.d.ts +0 -1
- package/lib/types/components/color-picker/ColorPicker.stories.d.ts +0 -1
- package/lib/types/components/config-provider/ConfigProvider.d.ts +0 -1
- package/lib/types/components/config-provider/ConfigProvider.stories.d.ts +0 -1
- package/lib/types/components/confirm/Confirm.d.ts +0 -1
- package/lib/types/components/confirm/Confirm.stories.d.ts +0 -1
- package/lib/types/components/date-picker/DatePanel.d.ts +0 -1
- package/lib/types/components/date-picker/DatePicker.d.ts +0 -1
- package/lib/types/components/date-picker/DatePicker.stories.d.ts +0 -1
- package/lib/types/components/date-range-picker/DateRangePicker.d.ts +0 -1
- package/lib/types/components/date-range-picker/DateRangePicker.stories.d.ts +0 -1
- package/lib/types/components/design-token/Palette.stories.d.ts +0 -1
- package/lib/types/components/dialog/Dialog.d.ts +16 -1
- package/lib/types/components/dialog/Dialog.stories.d.ts +0 -1
- package/lib/types/components/draggable-list/DraggableList.d.ts +0 -1
- package/lib/types/components/draggable-list/DraggableList.stories.d.ts +0 -1
- package/lib/types/components/dropdown/Dropdown.d.ts +0 -1
- package/lib/types/components/dropdown/Dropdown.stories.d.ts +0 -1
- package/lib/types/components/form-layout/FormLayout.d.ts +0 -1
- package/lib/types/components/form-layout/FormLayout.stories.d.ts +0 -1
- package/lib/types/components/icon/Icon.stories.d.ts +0 -1
- package/lib/types/components/input/Input.d.ts +0 -1
- package/lib/types/components/input/Input.stories.d.ts +0 -1
- package/lib/types/components/input/InputWithSlot.d.ts +0 -1
- package/lib/types/components/input/InputWithSlot.stories.d.ts +0 -1
- package/lib/types/components/input-number/InputNumber.d.ts +1 -2
- package/lib/types/components/input-number/InputNumber.stories.d.ts +0 -1
- package/lib/types/components/mentions/Mentions.d.ts +0 -1
- package/lib/types/components/mentions/Mentions.stories.d.ts +0 -1
- package/lib/types/components/menu/Menu.d.ts +0 -1
- package/lib/types/components/message/Message.d.ts +0 -1
- package/lib/types/components/message/Message.stories.d.ts +0 -1
- package/lib/types/components/pager/Pager.d.ts +0 -1
- package/lib/types/components/pager/Pager.stories.d.ts +0 -1
- package/lib/types/components/popup/Popup.d.ts +0 -1
- package/lib/types/components/popup/Popup.stories.d.ts +0 -1
- package/lib/types/components/popup/RectPopup.d.ts +0 -1
- package/lib/types/components/radio/Radio.d.ts +0 -1
- package/lib/types/components/radio/Radio.stories.d.ts +0 -1
- package/lib/types/components/radio-group/RadioGroup.d.ts +0 -1
- package/lib/types/components/radio-group/RadioGroup.stories.d.ts +0 -1
- package/lib/types/components/scrollbar/Scrollbar.d.ts +0 -1
- package/lib/types/components/scrollbar/Scrollbar.stories.d.ts +0 -1
- package/lib/types/components/segmented/Segmented.d.ts +0 -1
- package/lib/types/components/segmented/Segmented.stories.d.ts +0 -1
- package/lib/types/components/select/Select.d.ts +0 -1
- package/lib/types/components/select/Select.stories.d.ts +0 -1
- package/lib/types/components/select-list/SelectList.d.ts +0 -1
- package/lib/types/components/select-list/SelectList.stories.d.ts +0 -1
- package/lib/types/components/slider/Slider.d.ts +0 -1
- package/lib/types/components/slider/Slider.stories.d.ts +0 -1
- package/lib/types/components/switch/Switch.d.ts +0 -1
- package/lib/types/components/textarea/Textarea.d.ts +0 -1
- package/lib/types/components/textarea/Textarea.stories.d.ts +0 -1
- package/lib/types/components/tooltip/Tooltip.d.ts +1 -2
- package/lib/types/components/tooltip/Tooltip.stories.d.ts +0 -1
- package/lib/types/components/tooltip/placements.d.ts +0 -1
- package/lib/types/components/tree/Tree.d.ts +0 -1
- package/lib/types/components/tree/Tree.stories.d.ts +0 -1
- package/lib/types/components/tree/util.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/locale/interface.d.ts +0 -1
- package/lib/types/locale/ru-RU.d.ts +0 -1
- package/lib/types/locale/vi-VN.d.ts +0 -1
- package/lib/types/locale/zh-CN.d.ts +0 -1
- package/lib/types/locale/zh-TW.d.ts +0 -1
- package/lib/umd/index.js +11 -9
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -650,7 +650,7 @@ const checkbox = "univer-checkbox", checkboxTargetInput = "univer-checkbox-targe
|
|
|
650
650
|
checkboxTarget
|
|
651
651
|
};
|
|
652
652
|
function Checkbox(props) {
|
|
653
|
-
const { children, className, style: style2, checked = !1, indeterminate = !1, value, disabled = !1, onChange } = props, inputRef = useRef(null);
|
|
653
|
+
const { children, className, style: style2, checked = !1, indeterminate = !1, value, disabled = !1, onChange, contentClassName } = props, inputRef = useRef(null);
|
|
654
654
|
function handleChange(e2) {
|
|
655
655
|
var _a3, _b;
|
|
656
656
|
if (e2.stopPropagation(), !(!onChange || disabled))
|
|
@@ -676,7 +676,7 @@ function Checkbox(props) {
|
|
|
676
676
|
disabled,
|
|
677
677
|
onChange: handleChange
|
|
678
678
|
}
|
|
679
|
-
), /* @__PURE__ */ React__default.createElement("span", { className: styles$q.checkboxTargetInner })), /* @__PURE__ */ React__default.createElement("span",
|
|
679
|
+
), /* @__PURE__ */ React__default.createElement("span", { className: styles$q.checkboxTargetInner })), /* @__PURE__ */ React__default.createElement("span", { className: contentClassName }, children));
|
|
680
680
|
}
|
|
681
681
|
__name(Checkbox, "Checkbox");
|
|
682
682
|
const checkboxGroup = "univer-checkbox-group", checkboxGroupDirectionVertical = "univer-checkbox-group-direction-vertical", styles$p = {
|
|
@@ -698,55 +698,55 @@ function CheckboxGroup(props) {
|
|
|
698
698
|
}) : child));
|
|
699
699
|
}
|
|
700
700
|
__name(CheckboxGroup, "CheckboxGroup");
|
|
701
|
-
function _extends$
|
|
702
|
-
return _extends$
|
|
701
|
+
function _extends$6() {
|
|
702
|
+
return _extends$6 = Object.assign ? Object.assign.bind() : function(n2) {
|
|
703
703
|
for (var e2 = 1; e2 < arguments.length; e2++) {
|
|
704
704
|
var t2 = arguments[e2];
|
|
705
705
|
for (var r in t2) ({}).hasOwnProperty.call(t2, r) && (n2[r] = t2[r]);
|
|
706
706
|
}
|
|
707
707
|
return n2;
|
|
708
|
-
}, _extends$
|
|
708
|
+
}, _extends$6.apply(null, arguments);
|
|
709
709
|
}
|
|
710
|
-
__name(_extends$
|
|
711
|
-
function _typeof$
|
|
710
|
+
__name(_extends$6, "_extends$6");
|
|
711
|
+
function _typeof$3(o) {
|
|
712
712
|
"@babel/helpers - typeof";
|
|
713
|
-
return _typeof$
|
|
713
|
+
return _typeof$3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
714
714
|
return typeof o2;
|
|
715
715
|
} : function(o2) {
|
|
716
716
|
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
717
|
-
}, _typeof$
|
|
717
|
+
}, _typeof$3(o);
|
|
718
718
|
}
|
|
719
|
-
__name(_typeof$
|
|
720
|
-
function toPrimitive$
|
|
721
|
-
if (_typeof$
|
|
719
|
+
__name(_typeof$3, "_typeof$3");
|
|
720
|
+
function toPrimitive$2(t2, r) {
|
|
721
|
+
if (_typeof$3(t2) != "object" || !t2) return t2;
|
|
722
722
|
var e2 = t2[Symbol.toPrimitive];
|
|
723
723
|
if (e2 !== void 0) {
|
|
724
724
|
var i = e2.call(t2, r || "default");
|
|
725
|
-
if (_typeof$
|
|
725
|
+
if (_typeof$3(i) != "object") return i;
|
|
726
726
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
727
727
|
}
|
|
728
728
|
return (r === "string" ? String : Number)(t2);
|
|
729
729
|
}
|
|
730
|
-
__name(toPrimitive$
|
|
731
|
-
function toPropertyKey$
|
|
732
|
-
var i = toPrimitive$
|
|
733
|
-
return _typeof$
|
|
730
|
+
__name(toPrimitive$2, "toPrimitive$2");
|
|
731
|
+
function toPropertyKey$2(t2) {
|
|
732
|
+
var i = toPrimitive$2(t2, "string");
|
|
733
|
+
return _typeof$3(i) == "symbol" ? i : i + "";
|
|
734
734
|
}
|
|
735
|
-
__name(toPropertyKey$
|
|
736
|
-
function _defineProperty$
|
|
737
|
-
return (r = toPropertyKey$
|
|
735
|
+
__name(toPropertyKey$2, "toPropertyKey$2");
|
|
736
|
+
function _defineProperty$c(e2, r, t2) {
|
|
737
|
+
return (r = toPropertyKey$2(r)) in e2 ? Object.defineProperty(e2, r, {
|
|
738
738
|
value: t2,
|
|
739
739
|
enumerable: !0,
|
|
740
740
|
configurable: !0,
|
|
741
741
|
writable: !0
|
|
742
742
|
}) : e2[r] = t2, e2;
|
|
743
743
|
}
|
|
744
|
-
__name(_defineProperty$
|
|
745
|
-
function _arrayWithHoles$
|
|
744
|
+
__name(_defineProperty$c, "_defineProperty$c");
|
|
745
|
+
function _arrayWithHoles$2(r) {
|
|
746
746
|
if (Array.isArray(r)) return r;
|
|
747
747
|
}
|
|
748
|
-
__name(_arrayWithHoles$
|
|
749
|
-
function _iterableToArrayLimit$
|
|
748
|
+
__name(_arrayWithHoles$2, "_arrayWithHoles$2");
|
|
749
|
+
function _iterableToArrayLimit$2(r, l2) {
|
|
750
750
|
var t2 = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
751
751
|
if (t2 != null) {
|
|
752
752
|
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
@@ -767,31 +767,31 @@ function _iterableToArrayLimit$1(r, l2) {
|
|
|
767
767
|
return a;
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
__name(_iterableToArrayLimit$
|
|
771
|
-
function _arrayLikeToArray(r, a) {
|
|
770
|
+
__name(_iterableToArrayLimit$2, "_iterableToArrayLimit$2");
|
|
771
|
+
function _arrayLikeToArray$1(r, a) {
|
|
772
772
|
(a == null || a > r.length) && (a = r.length);
|
|
773
773
|
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r[e2];
|
|
774
774
|
return n2;
|
|
775
775
|
}
|
|
776
|
-
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
777
|
-
function _unsupportedIterableToArray(r, a) {
|
|
776
|
+
__name(_arrayLikeToArray$1, "_arrayLikeToArray$1");
|
|
777
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
778
778
|
if (r) {
|
|
779
|
-
if (typeof r == "string") return _arrayLikeToArray(r, a);
|
|
779
|
+
if (typeof r == "string") return _arrayLikeToArray$1(r, a);
|
|
780
780
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
781
|
-
return t2 === "Object" && r.constructor && (t2 = r.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a) : void 0;
|
|
781
|
+
return t2 === "Object" && r.constructor && (t2 = r.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r, a) : void 0;
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
785
|
-
function _nonIterableRest$
|
|
784
|
+
__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1");
|
|
785
|
+
function _nonIterableRest$2() {
|
|
786
786
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
787
787
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
788
788
|
}
|
|
789
|
-
__name(_nonIterableRest$
|
|
790
|
-
function _slicedToArray$
|
|
791
|
-
return _arrayWithHoles$
|
|
789
|
+
__name(_nonIterableRest$2, "_nonIterableRest$2");
|
|
790
|
+
function _slicedToArray$2(r, e2) {
|
|
791
|
+
return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e2) || _unsupportedIterableToArray$1(r, e2) || _nonIterableRest$2();
|
|
792
792
|
}
|
|
793
|
-
__name(_slicedToArray$
|
|
794
|
-
function ownKeys$
|
|
793
|
+
__name(_slicedToArray$2, "_slicedToArray$2");
|
|
794
|
+
function ownKeys$9(e2, r) {
|
|
795
795
|
var t2 = Object.keys(e2);
|
|
796
796
|
if (Object.getOwnPropertySymbols) {
|
|
797
797
|
var o = Object.getOwnPropertySymbols(e2);
|
|
@@ -801,43 +801,43 @@ function ownKeys$8(e2, r) {
|
|
|
801
801
|
}
|
|
802
802
|
return t2;
|
|
803
803
|
}
|
|
804
|
-
__name(ownKeys$
|
|
805
|
-
function _objectSpread2$
|
|
804
|
+
__name(ownKeys$9, "ownKeys$9");
|
|
805
|
+
function _objectSpread2$2(e2) {
|
|
806
806
|
for (var r = 1; r < arguments.length; r++) {
|
|
807
807
|
var t2 = arguments[r] != null ? arguments[r] : {};
|
|
808
|
-
r % 2 ? ownKeys$
|
|
809
|
-
_defineProperty$
|
|
810
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$
|
|
808
|
+
r % 2 ? ownKeys$9(Object(t2), !0).forEach(function(r2) {
|
|
809
|
+
_defineProperty$c(e2, r2, t2[r2]);
|
|
810
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$9(Object(t2)).forEach(function(r2) {
|
|
811
811
|
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
812
812
|
});
|
|
813
813
|
}
|
|
814
814
|
return e2;
|
|
815
815
|
}
|
|
816
|
-
__name(_objectSpread2$
|
|
817
|
-
function _classCallCheck$
|
|
816
|
+
__name(_objectSpread2$2, "_objectSpread2$2");
|
|
817
|
+
function _classCallCheck$2(a, n2) {
|
|
818
818
|
if (!(a instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
819
819
|
}
|
|
820
|
-
__name(_classCallCheck$
|
|
821
|
-
function _defineProperties$
|
|
820
|
+
__name(_classCallCheck$2, "_classCallCheck$2");
|
|
821
|
+
function _defineProperties$2(e2, r) {
|
|
822
822
|
for (var t2 = 0; t2 < r.length; t2++) {
|
|
823
823
|
var o = r[t2];
|
|
824
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey$
|
|
824
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey$2(o.key), o);
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
__name(_defineProperties$
|
|
828
|
-
function _createClass$
|
|
829
|
-
return r && _defineProperties$
|
|
827
|
+
__name(_defineProperties$2, "_defineProperties$2");
|
|
828
|
+
function _createClass$2(e2, r, t2) {
|
|
829
|
+
return r && _defineProperties$2(e2.prototype, r), Object.defineProperty(e2, "prototype", {
|
|
830
830
|
writable: !1
|
|
831
831
|
}), e2;
|
|
832
832
|
}
|
|
833
|
-
__name(_createClass$
|
|
834
|
-
function _setPrototypeOf$
|
|
835
|
-
return _setPrototypeOf$
|
|
833
|
+
__name(_createClass$2, "_createClass$2");
|
|
834
|
+
function _setPrototypeOf$4(t2, e2) {
|
|
835
|
+
return _setPrototypeOf$4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
|
836
836
|
return t3.__proto__ = e3, t3;
|
|
837
|
-
}, _setPrototypeOf$
|
|
837
|
+
}, _setPrototypeOf$4(t2, e2);
|
|
838
838
|
}
|
|
839
|
-
__name(_setPrototypeOf$
|
|
840
|
-
function _inherits$
|
|
839
|
+
__name(_setPrototypeOf$4, "_setPrototypeOf$4");
|
|
840
|
+
function _inherits$2(t2, e2) {
|
|
841
841
|
if (typeof e2 != "function" && e2 !== null) throw new TypeError("Super expression must either be null or a function");
|
|
842
842
|
t2.prototype = Object.create(e2 && e2.prototype, {
|
|
843
843
|
constructor: {
|
|
@@ -847,69 +847,70 @@ function _inherits$1(t2, e2) {
|
|
|
847
847
|
}
|
|
848
848
|
}), Object.defineProperty(t2, "prototype", {
|
|
849
849
|
writable: !1
|
|
850
|
-
}), e2 && _setPrototypeOf$
|
|
850
|
+
}), e2 && _setPrototypeOf$4(t2, e2);
|
|
851
851
|
}
|
|
852
|
-
__name(_inherits$
|
|
853
|
-
function _getPrototypeOf$
|
|
854
|
-
return _getPrototypeOf$
|
|
852
|
+
__name(_inherits$2, "_inherits$2");
|
|
853
|
+
function _getPrototypeOf$2(t2) {
|
|
854
|
+
return _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
|
855
855
|
return t3.__proto__ || Object.getPrototypeOf(t3);
|
|
856
|
-
}, _getPrototypeOf$
|
|
856
|
+
}, _getPrototypeOf$2(t2);
|
|
857
857
|
}
|
|
858
|
-
__name(_getPrototypeOf$
|
|
859
|
-
function _isNativeReflectConstruct$
|
|
858
|
+
__name(_getPrototypeOf$2, "_getPrototypeOf$2");
|
|
859
|
+
function _isNativeReflectConstruct$2() {
|
|
860
860
|
try {
|
|
861
861
|
var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
862
862
|
}));
|
|
863
863
|
} catch {
|
|
864
864
|
}
|
|
865
|
-
return (_isNativeReflectConstruct$
|
|
865
|
+
return (_isNativeReflectConstruct$2 = /* @__PURE__ */ __name(function() {
|
|
866
866
|
return !!t2;
|
|
867
867
|
}, "_isNativeReflectConstruct"))();
|
|
868
868
|
}
|
|
869
|
-
__name(_isNativeReflectConstruct$
|
|
870
|
-
function _assertThisInitialized$
|
|
869
|
+
__name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct$2");
|
|
870
|
+
function _assertThisInitialized$2(e2) {
|
|
871
871
|
if (e2 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
872
872
|
return e2;
|
|
873
873
|
}
|
|
874
|
-
__name(_assertThisInitialized$
|
|
875
|
-
function _possibleConstructorReturn$
|
|
876
|
-
if (e2 && (_typeof$
|
|
874
|
+
__name(_assertThisInitialized$2, "_assertThisInitialized$2");
|
|
875
|
+
function _possibleConstructorReturn$2(t2, e2) {
|
|
876
|
+
if (e2 && (_typeof$3(e2) == "object" || typeof e2 == "function")) return e2;
|
|
877
877
|
if (e2 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
878
|
-
return _assertThisInitialized$
|
|
878
|
+
return _assertThisInitialized$2(t2);
|
|
879
879
|
}
|
|
880
|
-
__name(_possibleConstructorReturn$
|
|
881
|
-
function _createSuper$
|
|
882
|
-
var r = _isNativeReflectConstruct$
|
|
880
|
+
__name(_possibleConstructorReturn$2, "_possibleConstructorReturn$2");
|
|
881
|
+
function _createSuper$2(t2) {
|
|
882
|
+
var r = _isNativeReflectConstruct$2();
|
|
883
883
|
return function() {
|
|
884
|
-
var e2, o = _getPrototypeOf$
|
|
884
|
+
var e2, o = _getPrototypeOf$2(t2);
|
|
885
885
|
if (r) {
|
|
886
|
-
var s = _getPrototypeOf$
|
|
886
|
+
var s = _getPrototypeOf$2(this).constructor;
|
|
887
887
|
e2 = Reflect.construct(o, arguments, s);
|
|
888
888
|
} else e2 = o.apply(this, arguments);
|
|
889
|
-
return _possibleConstructorReturn$
|
|
889
|
+
return _possibleConstructorReturn$2(this, e2);
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
|
-
__name(_createSuper$
|
|
893
|
-
function _objectWithoutPropertiesLoose$
|
|
892
|
+
__name(_createSuper$2, "_createSuper$2");
|
|
893
|
+
function _objectWithoutPropertiesLoose$4(r, e2) {
|
|
894
894
|
if (r == null) return {};
|
|
895
895
|
var t2 = {};
|
|
896
896
|
for (var n2 in r) if ({}.hasOwnProperty.call(r, n2)) {
|
|
897
|
-
if (e2.
|
|
897
|
+
if (e2.includes(n2)) continue;
|
|
898
898
|
t2[n2] = r[n2];
|
|
899
899
|
}
|
|
900
900
|
return t2;
|
|
901
901
|
}
|
|
902
|
-
__name(_objectWithoutPropertiesLoose$
|
|
903
|
-
function _objectWithoutProperties$
|
|
902
|
+
__name(_objectWithoutPropertiesLoose$4, "_objectWithoutPropertiesLoose$4");
|
|
903
|
+
function _objectWithoutProperties$2(e2, t2) {
|
|
904
904
|
if (e2 == null) return {};
|
|
905
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
905
|
+
var o, r, i = _objectWithoutPropertiesLoose$4(e2, t2);
|
|
906
906
|
if (Object.getOwnPropertySymbols) {
|
|
907
|
-
var
|
|
908
|
-
for (r = 0; r <
|
|
907
|
+
var s = Object.getOwnPropertySymbols(e2);
|
|
908
|
+
for (r = 0; r < s.length; r++) o = s[r], t2.includes(o) || {}.propertyIsEnumerable.call(e2, o) && (i[o] = e2[o]);
|
|
909
909
|
}
|
|
910
910
|
return i;
|
|
911
911
|
}
|
|
912
|
-
__name(_objectWithoutProperties$
|
|
912
|
+
__name(_objectWithoutProperties$2, "_objectWithoutProperties$2");
|
|
913
|
+
const round = Math.round;
|
|
913
914
|
function splitColorStr(str, parseNum) {
|
|
914
915
|
const match2 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], numList = match2.map((item) => parseFloat(item));
|
|
915
916
|
for (let i = 0; i < 3; i += 1)
|
|
@@ -917,67 +918,100 @@ function splitColorStr(str, parseNum) {
|
|
|
917
918
|
return match2[3] ? numList[3] = match2[3].includes("%") ? numList[3] / 100 : numList[3] : numList[3] = 1, numList;
|
|
918
919
|
}
|
|
919
920
|
__name(splitColorStr, "splitColorStr");
|
|
920
|
-
|
|
921
|
-
|
|
921
|
+
const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ? num : num / 100, "parseHSVorHSL");
|
|
922
|
+
function limitRange(value, max) {
|
|
923
|
+
const mergedMax = max || 255;
|
|
924
|
+
return value > mergedMax ? mergedMax : value < 0 ? 0 : value;
|
|
922
925
|
}
|
|
923
|
-
__name(
|
|
924
|
-
const
|
|
926
|
+
__name(limitRange, "limitRange");
|
|
927
|
+
const _FastColor = class _FastColor {
|
|
925
928
|
constructor(input2) {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
+
_defineProperty$c(this, "isValid", !0), _defineProperty$c(this, "r", 0), _defineProperty$c(this, "g", 0), _defineProperty$c(this, "b", 0), _defineProperty$c(this, "a", 1), _defineProperty$c(this, "_h", void 0), _defineProperty$c(this, "_s", void 0), _defineProperty$c(this, "_l", void 0), _defineProperty$c(this, "_v", void 0), _defineProperty$c(this, "_max", void 0), _defineProperty$c(this, "_min", void 0), _defineProperty$c(this, "_brightness", void 0);
|
|
930
|
+
function matchFormat(str) {
|
|
931
|
+
return str[0] in input2 && str[1] in input2 && str[2] in input2;
|
|
932
|
+
}
|
|
933
|
+
if (__name(matchFormat, "matchFormat"), input2) if (typeof input2 == "string") {
|
|
929
934
|
let matchPrefix = function(prefix) {
|
|
930
935
|
return trimStr.startsWith(prefix);
|
|
931
936
|
};
|
|
932
937
|
__name(matchPrefix, "matchPrefix");
|
|
933
938
|
const trimStr = input2.trim();
|
|
934
939
|
/^#?[A-F\d]{3,8}$/i.test(trimStr) ? this.fromHexString(trimStr) : matchPrefix("rgb") ? this.fromRgbString(trimStr) : matchPrefix("hsl") ? this.fromHslString(trimStr) : (matchPrefix("hsv") || matchPrefix("hsb")) && this.fromHsvString(trimStr);
|
|
935
|
-
} else if (
|
|
936
|
-
this.r = input2.r, this.g = input2.g, this.b = input2.b, this.a =
|
|
937
|
-
else if ("
|
|
940
|
+
} else if (input2 instanceof _FastColor)
|
|
941
|
+
this.r = input2.r, this.g = input2.g, this.b = input2.b, this.a = input2.a, this._h = input2._h, this._s = input2._s, this._l = input2._l, this._v = input2._v;
|
|
942
|
+
else if (matchFormat("rgb"))
|
|
943
|
+
this.r = limitRange(input2.r), this.g = limitRange(input2.g), this.b = limitRange(input2.b), this.a = typeof input2.a == "number" ? limitRange(input2.a, 1) : 1;
|
|
944
|
+
else if (matchFormat("hsl"))
|
|
938
945
|
this.fromHsl(input2);
|
|
939
|
-
else if ("
|
|
946
|
+
else if (matchFormat("hsv"))
|
|
940
947
|
this.fromHsv(input2);
|
|
941
948
|
else
|
|
942
949
|
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input2));
|
|
943
950
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
get h() {
|
|
948
|
-
return this.getHue();
|
|
951
|
+
// ======================= Setter =======================
|
|
952
|
+
setR(value) {
|
|
953
|
+
return this._sc("r", value);
|
|
949
954
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
*/
|
|
953
|
-
get s() {
|
|
954
|
-
return this.getSaturation();
|
|
955
|
+
setG(value) {
|
|
956
|
+
return this._sc("g", value);
|
|
955
957
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
*/
|
|
959
|
-
get l() {
|
|
960
|
-
return this.getLightness();
|
|
958
|
+
setB(value) {
|
|
959
|
+
return this._sc("b", value);
|
|
961
960
|
}
|
|
961
|
+
setA(value) {
|
|
962
|
+
return this._sc("a", value, 1);
|
|
963
|
+
}
|
|
964
|
+
setHue(value) {
|
|
965
|
+
const hsv = this.toHsv();
|
|
966
|
+
return hsv.h = value, this._c(hsv);
|
|
967
|
+
}
|
|
968
|
+
// ======================= Getter =======================
|
|
962
969
|
/**
|
|
963
|
-
*
|
|
970
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
971
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
964
972
|
*/
|
|
965
|
-
|
|
966
|
-
|
|
973
|
+
getLuminance() {
|
|
974
|
+
function adjustGamma(raw) {
|
|
975
|
+
const val = raw / 255;
|
|
976
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
977
|
+
}
|
|
978
|
+
__name(adjustGamma, "adjustGamma");
|
|
979
|
+
const R = adjustGamma(this.r), G = adjustGamma(this.g), B = adjustGamma(this.b);
|
|
980
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
967
981
|
}
|
|
968
|
-
|
|
969
|
-
|
|
982
|
+
getHue() {
|
|
983
|
+
if (typeof this._h > "u") {
|
|
984
|
+
const delta = this.getMax() - this.getMin();
|
|
985
|
+
delta === 0 ? this._h = 0 : this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
986
|
+
}
|
|
987
|
+
return this._h;
|
|
970
988
|
}
|
|
971
|
-
|
|
972
|
-
|
|
989
|
+
getSaturation() {
|
|
990
|
+
if (typeof this._s > "u") {
|
|
991
|
+
const delta = this.getMax() - this.getMin();
|
|
992
|
+
delta === 0 ? this._s = 0 : this._s = delta / this.getMax();
|
|
993
|
+
}
|
|
994
|
+
return this._s;
|
|
973
995
|
}
|
|
974
|
-
|
|
975
|
-
return this.
|
|
996
|
+
getLightness() {
|
|
997
|
+
return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
|
|
998
|
+
}
|
|
999
|
+
getValue() {
|
|
1000
|
+
return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
|
|
976
1001
|
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
1004
|
+
* Note: this is not the b of HSB
|
|
1005
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
1006
|
+
*/
|
|
1007
|
+
getBrightness() {
|
|
1008
|
+
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
1009
|
+
}
|
|
1010
|
+
// ======================== Func ========================
|
|
977
1011
|
darken(amount = 10) {
|
|
978
1012
|
const h2 = this.getHue(), s = this.getSaturation();
|
|
979
1013
|
let l2 = this.getLightness() - amount / 100;
|
|
980
|
-
return l2 < 0 && (l2 = 0),
|
|
1014
|
+
return l2 < 0 && (l2 = 0), this._c({
|
|
981
1015
|
h: h2,
|
|
982
1016
|
s,
|
|
983
1017
|
l: l2,
|
|
@@ -987,13 +1021,26 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
987
1021
|
lighten(amount = 10) {
|
|
988
1022
|
const h2 = this.getHue(), s = this.getSaturation();
|
|
989
1023
|
let l2 = this.getLightness() + amount / 100;
|
|
990
|
-
return l2 > 1 && (l2 = 1),
|
|
1024
|
+
return l2 > 1 && (l2 = 1), this._c({
|
|
991
1025
|
h: h2,
|
|
992
1026
|
s,
|
|
993
1027
|
l: l2,
|
|
994
1028
|
a: this.a
|
|
995
1029
|
});
|
|
996
1030
|
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
1033
|
+
* 0 means no mixing (return current color).
|
|
1034
|
+
*/
|
|
1035
|
+
mix(input2, amount = 50) {
|
|
1036
|
+
const color = this._c(input2), p2 = amount / 100, calc = /* @__PURE__ */ __name((key) => (color[key] - this[key]) * p2 + this[key], "calc"), rgba = {
|
|
1037
|
+
r: round(calc("r")),
|
|
1038
|
+
g: round(calc("g")),
|
|
1039
|
+
b: round(calc("b")),
|
|
1040
|
+
a: round(calc("a") * 100) / 100
|
|
1041
|
+
};
|
|
1042
|
+
return this._c(rgba);
|
|
1043
|
+
}
|
|
997
1044
|
/**
|
|
998
1045
|
* Mix the color with pure white, from 0 to 100.
|
|
999
1046
|
* Providing 0 will do nothing, providing 100 will always return white.
|
|
@@ -1018,76 +1065,30 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1018
1065
|
a: 1
|
|
1019
1066
|
}, amount);
|
|
1020
1067
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
b: (rgb2.b - rgb1.b) * p2 + rgb1.b,
|
|
1030
|
-
a: (rgb2.a - rgb1.a) * p2 + rgb1.a
|
|
1031
|
-
};
|
|
1032
|
-
return new _FastColor(rgba);
|
|
1033
|
-
}
|
|
1034
|
-
getAlpha() {
|
|
1035
|
-
return this.a;
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* Returns the perceived luminance of a color, from 0-1.
|
|
1039
|
-
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
1040
|
-
*/
|
|
1041
|
-
getLuminance() {
|
|
1042
|
-
let R, G, B;
|
|
1043
|
-
const RsRGB = this.r / 255, GsRGB = this.g / 255, BsRGB = this.b / 255;
|
|
1044
|
-
return RsRGB <= 0.03928 ? R = RsRGB / 12.92 : R = Math.pow((RsRGB + 0.055) / 1.055, 2.4), GsRGB <= 0.03928 ? G = GsRGB / 12.92 : G = Math.pow((GsRGB + 0.055) / 1.055, 2.4), BsRGB <= 0.03928 ? B = BsRGB / 12.92 : B = Math.pow((BsRGB + 0.055) / 1.055, 2.4), 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1045
|
-
}
|
|
1046
|
-
getHue() {
|
|
1047
|
-
if (typeof this._h > "u") {
|
|
1048
|
-
const delta = this.max - this.min;
|
|
1049
|
-
delta === 0 ? this._h = 0 : this._h = Math.round(60 * (this.r === this.max ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.max ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1050
|
-
}
|
|
1051
|
-
return this._h;
|
|
1052
|
-
}
|
|
1053
|
-
getSaturation() {
|
|
1054
|
-
if (typeof this._s > "u") {
|
|
1055
|
-
const delta = this.max - this.min;
|
|
1056
|
-
delta === 0 ? this._s = 0 : this._s = delta / this.max;
|
|
1057
|
-
}
|
|
1058
|
-
return this._s;
|
|
1059
|
-
}
|
|
1060
|
-
getLightness() {
|
|
1061
|
-
return typeof this._l > "u" && (this._l = (this.max + this.min) / 510), this._l;
|
|
1062
|
-
}
|
|
1063
|
-
getValue() {
|
|
1064
|
-
return typeof this._v > "u" && (this._v = this.max / 255), this._v;
|
|
1068
|
+
onBackground(background) {
|
|
1069
|
+
const bg = this._c(background), alpha = this.a + bg.a * (1 - this.a), calc = /* @__PURE__ */ __name((key) => round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha), "calc");
|
|
1070
|
+
return this._c({
|
|
1071
|
+
r: calc("r"),
|
|
1072
|
+
g: calc("g"),
|
|
1073
|
+
b: calc("b"),
|
|
1074
|
+
a: alpha
|
|
1075
|
+
});
|
|
1065
1076
|
}
|
|
1077
|
+
// ======================= Status =======================
|
|
1066
1078
|
isDark() {
|
|
1067
1079
|
return this.getBrightness() < 128;
|
|
1068
1080
|
}
|
|
1069
1081
|
isLight() {
|
|
1070
1082
|
return this.getBrightness() >= 128;
|
|
1071
1083
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
*/
|
|
1076
|
-
getBrightness() {
|
|
1077
|
-
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
1078
|
-
}
|
|
1079
|
-
onBackground(background) {
|
|
1080
|
-
const bg = new _FastColor(background), alpha = this.a + bg.a * (1 - this.a);
|
|
1081
|
-
return new _FastColor({
|
|
1082
|
-
r: Math.round((this.r * this.a + bg.r * bg.a * (1 - this.a)) / alpha),
|
|
1083
|
-
g: Math.round((this.g * this.a + bg.g * bg.a * (1 - this.a)) / alpha),
|
|
1084
|
-
b: Math.round((this.b * this.a + bg.b * bg.a * (1 - this.a)) / alpha),
|
|
1085
|
-
a: alpha
|
|
1086
|
-
});
|
|
1084
|
+
// ======================== MISC ========================
|
|
1085
|
+
equals(other) {
|
|
1086
|
+
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
1087
1087
|
}
|
|
1088
|
-
|
|
1089
|
-
return this.
|
|
1088
|
+
clone() {
|
|
1089
|
+
return this._c(this);
|
|
1090
1090
|
}
|
|
1091
|
+
// ======================= Format =======================
|
|
1091
1092
|
toHexString() {
|
|
1092
1093
|
let hex = "#";
|
|
1093
1094
|
const rHex = (this.r || 0).toString(16);
|
|
@@ -1096,28 +1097,31 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1096
1097
|
hex += gHex.length === 2 ? gHex : "0" + gHex;
|
|
1097
1098
|
const bHex = (this.b || 0).toString(16);
|
|
1098
1099
|
if (hex += bHex.length === 2 ? bHex : "0" + bHex, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
|
|
1099
|
-
const aHex =
|
|
1100
|
+
const aHex = round(this.a * 255).toString(16);
|
|
1100
1101
|
hex += aHex.length === 2 ? aHex : "0" + aHex;
|
|
1101
1102
|
}
|
|
1102
1103
|
return hex;
|
|
1103
1104
|
}
|
|
1105
|
+
/** CSS support color pattern */
|
|
1104
1106
|
toHsl() {
|
|
1105
1107
|
return {
|
|
1106
|
-
h: this.
|
|
1107
|
-
s: this.
|
|
1108
|
-
l: this.
|
|
1108
|
+
h: this.getHue(),
|
|
1109
|
+
s: this.getSaturation(),
|
|
1110
|
+
l: this.getLightness(),
|
|
1109
1111
|
a: this.a
|
|
1110
1112
|
};
|
|
1111
1113
|
}
|
|
1114
|
+
/** CSS support color pattern */
|
|
1112
1115
|
toHslString() {
|
|
1113
|
-
const h2 = this.
|
|
1116
|
+
const h2 = this.getHue(), s = round(this.getSaturation() * 100), l2 = round(this.getLightness() * 100);
|
|
1114
1117
|
return this.a !== 1 ? `hsla(${h2},${s}%,${l2}%,${this.a})` : `hsl(${h2},${s}%,${l2}%)`;
|
|
1115
1118
|
}
|
|
1119
|
+
/** Same as toHsb */
|
|
1116
1120
|
toHsv() {
|
|
1117
1121
|
return {
|
|
1118
|
-
h: this.
|
|
1119
|
-
s: this.
|
|
1120
|
-
v: this.
|
|
1122
|
+
h: this.getHue(),
|
|
1123
|
+
s: this.getSaturation(),
|
|
1124
|
+
v: this.getValue(),
|
|
1121
1125
|
a: this.a
|
|
1122
1126
|
};
|
|
1123
1127
|
}
|
|
@@ -1135,10 +1139,19 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1135
1139
|
toString() {
|
|
1136
1140
|
return this.toRgbString();
|
|
1137
1141
|
}
|
|
1138
|
-
|
|
1142
|
+
// ====================== Privates ======================
|
|
1143
|
+
/** Return a new FastColor object with one channel changed */
|
|
1144
|
+
_sc(rgb, value, max) {
|
|
1145
|
+
const clone = this.clone();
|
|
1146
|
+
return clone[rgb] = limitRange(value, max), clone;
|
|
1147
|
+
}
|
|
1148
|
+
_c(input2) {
|
|
1149
|
+
return new this.constructor(input2);
|
|
1150
|
+
}
|
|
1151
|
+
getMax() {
|
|
1139
1152
|
return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
|
|
1140
1153
|
}
|
|
1141
|
-
|
|
1154
|
+
getMin() {
|
|
1142
1155
|
return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
|
|
1143
1156
|
}
|
|
1144
1157
|
fromHexString(trimStr) {
|
|
@@ -1155,13 +1168,14 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1155
1168
|
a
|
|
1156
1169
|
}) {
|
|
1157
1170
|
if (this._h = h2 % 360, this._s = s, this._l = l2, this.a = typeof a == "number" ? a : 1, s <= 0) {
|
|
1158
|
-
const rgb =
|
|
1171
|
+
const rgb = round(l2 * 255);
|
|
1159
1172
|
this.r = rgb, this.g = rgb, this.b = rgb;
|
|
1160
1173
|
}
|
|
1174
|
+
let r = 0, g2 = 0, b2 = 0;
|
|
1161
1175
|
const huePrime = h2 / 60, chroma = (1 - Math.abs(2 * l2 - 1)) * s, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
1162
|
-
|
|
1176
|
+
huePrime >= 0 && huePrime < 1 ? (r = chroma, g2 = secondComponent) : huePrime >= 1 && huePrime < 2 ? (r = secondComponent, g2 = chroma) : huePrime >= 2 && huePrime < 3 ? (g2 = chroma, b2 = secondComponent) : huePrime >= 3 && huePrime < 4 ? (g2 = secondComponent, b2 = chroma) : huePrime >= 4 && huePrime < 5 ? (r = secondComponent, b2 = chroma) : huePrime >= 5 && huePrime < 6 && (r = chroma, b2 = secondComponent);
|
|
1163
1177
|
const lightnessModification = l2 - chroma / 2;
|
|
1164
|
-
this.r =
|
|
1178
|
+
this.r = round((r + lightnessModification) * 255), this.g = round((g2 + lightnessModification) * 255), this.b = round((b2 + lightnessModification) * 255);
|
|
1165
1179
|
}
|
|
1166
1180
|
fromHsv({
|
|
1167
1181
|
h: h2,
|
|
@@ -1170,10 +1184,10 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1170
1184
|
a
|
|
1171
1185
|
}) {
|
|
1172
1186
|
this._h = h2 % 360, this._s = s, this._v = v2, this.a = typeof a == "number" ? a : 1;
|
|
1173
|
-
const vv =
|
|
1187
|
+
const vv = round(v2 * 255);
|
|
1174
1188
|
if (this.r = vv, this.g = vv, this.b = vv, s <= 0)
|
|
1175
1189
|
return;
|
|
1176
|
-
const hh = h2 / 60, i = Math.floor(hh), ff = hh - i, p2 =
|
|
1190
|
+
const hh = h2 / 60, i = Math.floor(hh), ff = hh - i, p2 = round(v2 * (1 - s) * 255), q2 = round(v2 * (1 - s * ff) * 255), t2 = round(v2 * (1 - s * (1 - ff)) * 255);
|
|
1177
1191
|
switch (i) {
|
|
1178
1192
|
case 0:
|
|
1179
1193
|
this.g = t2, this.b = p2;
|
|
@@ -1196,8 +1210,8 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1196
1210
|
break;
|
|
1197
1211
|
}
|
|
1198
1212
|
}
|
|
1199
|
-
fromHsvString(
|
|
1200
|
-
const cells = splitColorStr(
|
|
1213
|
+
fromHsvString(trimStr) {
|
|
1214
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1201
1215
|
this.fromHsv({
|
|
1202
1216
|
h: cells[0],
|
|
1203
1217
|
s: cells[1],
|
|
@@ -1205,8 +1219,8 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1205
1219
|
a: cells[3]
|
|
1206
1220
|
});
|
|
1207
1221
|
}
|
|
1208
|
-
fromHslString(
|
|
1209
|
-
const cells = splitColorStr(
|
|
1222
|
+
fromHslString(trimStr) {
|
|
1223
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1210
1224
|
this.fromHsl({
|
|
1211
1225
|
h: cells[0],
|
|
1212
1226
|
s: cells[1],
|
|
@@ -1214,10 +1228,10 @@ const parseHSVorHSL = /* @__PURE__ */ __name((num, _, index2) => index2 === 0 ?
|
|
|
1214
1228
|
a: cells[3]
|
|
1215
1229
|
});
|
|
1216
1230
|
}
|
|
1217
|
-
fromRgbString(
|
|
1218
|
-
const cells = splitColorStr(
|
|
1231
|
+
fromRgbString(trimStr) {
|
|
1232
|
+
const cells = splitColorStr(trimStr, (num, txt) => (
|
|
1219
1233
|
// Convert percentage to number. e.g. 50% -> 128
|
|
1220
|
-
txt.includes("%") ?
|
|
1234
|
+
txt.includes("%") ? round(num / 100 * 255) : num
|
|
1221
1235
|
));
|
|
1222
1236
|
this.r = cells[0], this.g = cells[1], this.b = cells[2], this.a = cells[3];
|
|
1223
1237
|
}
|
|
@@ -1229,20 +1243,20 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1229
1243
|
}, "getRoundNumber"), convertHsb2Hsv = /* @__PURE__ */ __name(function(color) {
|
|
1230
1244
|
if (color instanceof FastColor)
|
|
1231
1245
|
return color;
|
|
1232
|
-
if (color && _typeof$
|
|
1233
|
-
var _ref = color, b2 = _ref.b, resets = _objectWithoutProperties$
|
|
1234
|
-
return _objectSpread2$
|
|
1246
|
+
if (color && _typeof$3(color) === "object" && "h" in color && "b" in color) {
|
|
1247
|
+
var _ref = color, b2 = _ref.b, resets = _objectWithoutProperties$2(_ref, _excluded$x);
|
|
1248
|
+
return _objectSpread2$2(_objectSpread2$2({}, resets), {}, {
|
|
1235
1249
|
v: b2
|
|
1236
1250
|
});
|
|
1237
1251
|
}
|
|
1238
1252
|
return typeof color == "string" && /hsb/.test(color) ? color.replace(/hsb/, "hsv") : color;
|
|
1239
1253
|
}, "convertHsb2Hsv"), Color = /* @__PURE__ */ function(_FastColor2) {
|
|
1240
|
-
_inherits$
|
|
1241
|
-
var _super = _createSuper$
|
|
1254
|
+
_inherits$2(Color2, _FastColor2);
|
|
1255
|
+
var _super = _createSuper$2(Color2);
|
|
1242
1256
|
function Color2(color) {
|
|
1243
|
-
return _classCallCheck$
|
|
1257
|
+
return _classCallCheck$2(this, Color2), _super.call(this, convertHsb2Hsv(color));
|
|
1244
1258
|
}
|
|
1245
|
-
return __name(Color2, "Color"), _createClass$
|
|
1259
|
+
return __name(Color2, "Color"), _createClass$2(Color2, [{
|
|
1246
1260
|
key: "toHsbString",
|
|
1247
1261
|
value: /* @__PURE__ */ __name(function() {
|
|
1248
1262
|
var hsb = this.toHsb(), saturation = getRoundNumber(hsb.s * 100), lightness = getRoundNumber(hsb.b * 100), hue = getRoundNumber(hsb.h), alpha = hsb.a, hsbString = "hsb(".concat(hue, ", ").concat(saturation, "%, ").concat(lightness, "%)"), hsbaString = "hsba(".concat(hue, ", ").concat(saturation, "%, ").concat(lightness, "%, ").concat(alpha.toFixed(alpha === 0 ? 0 : 2), ")");
|
|
@@ -1251,8 +1265,8 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1251
1265
|
}, {
|
|
1252
1266
|
key: "toHsb",
|
|
1253
1267
|
value: /* @__PURE__ */ __name(function() {
|
|
1254
|
-
var _this$toHsv = this.toHsv(), v2 = _this$toHsv.v, resets = _objectWithoutProperties$
|
|
1255
|
-
return _objectSpread2$
|
|
1268
|
+
var _this$toHsv = this.toHsv(), v2 = _this$toHsv.v, resets = _objectWithoutProperties$2(_this$toHsv, _excluded2$7);
|
|
1269
|
+
return _objectSpread2$2(_objectSpread2$2({}, resets), {}, {
|
|
1256
1270
|
b: v2,
|
|
1257
1271
|
a: this.a
|
|
1258
1272
|
});
|
|
@@ -1265,11 +1279,11 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1265
1279
|
if (type2)
|
|
1266
1280
|
switch (type2) {
|
|
1267
1281
|
case "hue":
|
|
1268
|
-
return generateColor(_objectSpread2$
|
|
1282
|
+
return generateColor(_objectSpread2$2(_objectSpread2$2({}, hsb), {}, {
|
|
1269
1283
|
h: hueOffset <= 0 ? 0 : hueOffset
|
|
1270
1284
|
}));
|
|
1271
1285
|
case "alpha":
|
|
1272
|
-
return generateColor(_objectSpread2$
|
|
1286
|
+
return generateColor(_objectSpread2$2(_objectSpread2$2({}, hsb), {}, {
|
|
1273
1287
|
a: alphaOffset <= 0 ? 0 : alphaOffset
|
|
1274
1288
|
}));
|
|
1275
1289
|
}
|
|
@@ -1279,28 +1293,26 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1279
1293
|
b: bright >= 1 ? 1 : bright,
|
|
1280
1294
|
a: hsb.a
|
|
1281
1295
|
});
|
|
1282
|
-
}, "calculateColor"),
|
|
1283
|
-
var
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
y: (1 - hsb.b) * height2 - centerOffsetY
|
|
1301
|
-
};
|
|
1296
|
+
}, "calculateColor"), calcOffset = /* @__PURE__ */ __name(function(color, type2) {
|
|
1297
|
+
var hsb = color.toHsb();
|
|
1298
|
+
switch (type2) {
|
|
1299
|
+
case "hue":
|
|
1300
|
+
return {
|
|
1301
|
+
x: hsb.h / 360 * 100,
|
|
1302
|
+
y: 50
|
|
1303
|
+
};
|
|
1304
|
+
case "alpha":
|
|
1305
|
+
return {
|
|
1306
|
+
x: color.a * 100,
|
|
1307
|
+
y: 50
|
|
1308
|
+
};
|
|
1309
|
+
default:
|
|
1310
|
+
return {
|
|
1311
|
+
x: hsb.s * 100,
|
|
1312
|
+
y: (1 - hsb.b) * 100
|
|
1313
|
+
};
|
|
1302
1314
|
}
|
|
1303
|
-
}, "
|
|
1315
|
+
}, "calcOffset"), classnames = { exports: {} };
|
|
1304
1316
|
/*!
|
|
1305
1317
|
Copyright (c) 2018 Jed Watson.
|
|
1306
1318
|
Licensed under the MIT License (MIT), see
|
|
@@ -1362,36 +1374,31 @@ function getPosition(e2) {
|
|
|
1362
1374
|
}
|
|
1363
1375
|
__name(getPosition, "getPosition");
|
|
1364
1376
|
function useColorDrag(props) {
|
|
1365
|
-
var
|
|
1377
|
+
var targetRef = props.targetRef, containerRef = props.containerRef, direction = props.direction, onDragChange = props.onDragChange, onDragChangeComplete = props.onDragChangeComplete, calculate = props.calculate, color = props.color, disabledDrag = props.disabledDrag, _useState = useState({
|
|
1366
1378
|
x: 0,
|
|
1367
1379
|
y: 0
|
|
1368
|
-
}), _useState2 = _slicedToArray$
|
|
1369
|
-
flag: !1
|
|
1370
|
-
});
|
|
1380
|
+
}), _useState2 = _slicedToArray$2(_useState, 2), offsetValue = _useState2[0], setOffsetValue = _useState2[1], mouseMoveRef = useRef(null), mouseUpRef = useRef(null);
|
|
1371
1381
|
useEffect(function() {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
calcOffset && setOffsetValue(calcOffset);
|
|
1375
|
-
}
|
|
1376
|
-
}, [color, containerRef]), useEffect(function() {
|
|
1382
|
+
setOffsetValue(calculate());
|
|
1383
|
+
}, [color]), useEffect(function() {
|
|
1377
1384
|
return function() {
|
|
1378
1385
|
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), document.removeEventListener("touchmove", mouseMoveRef.current), document.removeEventListener("touchend", mouseUpRef.current), mouseMoveRef.current = null, mouseUpRef.current = null;
|
|
1379
1386
|
};
|
|
1380
1387
|
}, []);
|
|
1381
1388
|
var updateOffset = /* @__PURE__ */ __name(function(e2) {
|
|
1382
|
-
var _getPosition = getPosition(e2), pageX = _getPosition.pageX, pageY = _getPosition.pageY, _containerRef$current = containerRef.current.getBoundingClientRect(), rectX = _containerRef$current.x, rectY = _containerRef$current.y, width2 = _containerRef$current.width, height2 = _containerRef$current.height, _targetRef$current$ge = targetRef.current.getBoundingClientRect(), targetWidth = _targetRef$current$ge.width, targetHeight = _targetRef$current$ge.height, centerOffsetX = targetWidth / 2, centerOffsetY = targetHeight / 2, offsetX = Math.max(0, Math.min(pageX - rectX, width2)) - centerOffsetX, offsetY = Math.max(0, Math.min(pageY - rectY, height2)) - centerOffsetY,
|
|
1389
|
+
var _getPosition = getPosition(e2), pageX = _getPosition.pageX, pageY = _getPosition.pageY, _containerRef$current = containerRef.current.getBoundingClientRect(), rectX = _containerRef$current.x, rectY = _containerRef$current.y, width2 = _containerRef$current.width, height2 = _containerRef$current.height, _targetRef$current$ge = targetRef.current.getBoundingClientRect(), targetWidth = _targetRef$current$ge.width, targetHeight = _targetRef$current$ge.height, centerOffsetX = targetWidth / 2, centerOffsetY = targetHeight / 2, offsetX = Math.max(0, Math.min(pageX - rectX, width2)) - centerOffsetX, offsetY = Math.max(0, Math.min(pageY - rectY, height2)) - centerOffsetY, calcOffset3 = {
|
|
1383
1390
|
x: offsetX,
|
|
1384
1391
|
y: direction === "x" ? offsetValue.y : offsetY
|
|
1385
1392
|
};
|
|
1386
1393
|
if (targetWidth === 0 && targetHeight === 0 || targetWidth !== targetHeight)
|
|
1387
1394
|
return !1;
|
|
1388
|
-
|
|
1395
|
+
onDragChange == null || onDragChange(calcOffset3);
|
|
1389
1396
|
}, "updateOffset"), onDragMove = /* @__PURE__ */ __name(function(e2) {
|
|
1390
1397
|
e2.preventDefault(), updateOffset(e2);
|
|
1391
1398
|
}, "onDragMove"), onDragStop = /* @__PURE__ */ __name(function(e2) {
|
|
1392
|
-
e2.preventDefault(),
|
|
1399
|
+
e2.preventDefault(), document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), document.removeEventListener("touchmove", mouseMoveRef.current), document.removeEventListener("touchend", mouseUpRef.current), mouseMoveRef.current = null, mouseUpRef.current = null, onDragChangeComplete == null || onDragChangeComplete();
|
|
1393
1400
|
}, "onDragStop"), onDragStart = /* @__PURE__ */ __name(function(e2) {
|
|
1394
|
-
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), !disabledDrag && (updateOffset(e2),
|
|
1401
|
+
document.removeEventListener("mousemove", mouseMoveRef.current), document.removeEventListener("mouseup", mouseUpRef.current), !disabledDrag && (updateOffset(e2), document.addEventListener("mousemove", onDragMove), document.addEventListener("mouseup", onDragStop), document.addEventListener("touchmove", onDragMove), document.addEventListener("touchend", onDragStop), mouseMoveRef.current = onDragMove, mouseUpRef.current = onDragStop);
|
|
1395
1402
|
}, "onDragStart");
|
|
1396
1403
|
return [offsetValue, onDragStart];
|
|
1397
1404
|
}
|
|
@@ -1407,6 +1414,55 @@ function useEvent(callback) {
|
|
|
1407
1414
|
return memoFn;
|
|
1408
1415
|
}
|
|
1409
1416
|
__name(useEvent, "useEvent");
|
|
1417
|
+
function _arrayWithHoles$1(r) {
|
|
1418
|
+
if (Array.isArray(r)) return r;
|
|
1419
|
+
}
|
|
1420
|
+
__name(_arrayWithHoles$1, "_arrayWithHoles$1");
|
|
1421
|
+
function _iterableToArrayLimit$1(r, l2) {
|
|
1422
|
+
var t2 = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
1423
|
+
if (t2 != null) {
|
|
1424
|
+
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
1425
|
+
try {
|
|
1426
|
+
if (i = (t2 = t2.call(r)).next, l2 === 0) {
|
|
1427
|
+
if (Object(t2) !== t2) return;
|
|
1428
|
+
f2 = !1;
|
|
1429
|
+
} else for (; !(f2 = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l2); f2 = !0) ;
|
|
1430
|
+
} catch (r2) {
|
|
1431
|
+
o = !0, n2 = r2;
|
|
1432
|
+
} finally {
|
|
1433
|
+
try {
|
|
1434
|
+
if (!f2 && t2.return != null && (u2 = t2.return(), Object(u2) !== u2)) return;
|
|
1435
|
+
} finally {
|
|
1436
|
+
if (o) throw n2;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
return a;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1");
|
|
1443
|
+
function _arrayLikeToArray(r, a) {
|
|
1444
|
+
(a == null || a > r.length) && (a = r.length);
|
|
1445
|
+
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r[e2];
|
|
1446
|
+
return n2;
|
|
1447
|
+
}
|
|
1448
|
+
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
1449
|
+
function _unsupportedIterableToArray(r, a) {
|
|
1450
|
+
if (r) {
|
|
1451
|
+
if (typeof r == "string") return _arrayLikeToArray(r, a);
|
|
1452
|
+
var t2 = {}.toString.call(r).slice(8, -1);
|
|
1453
|
+
return t2 === "Object" && r.constructor && (t2 = r.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a) : void 0;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
1457
|
+
function _nonIterableRest$1() {
|
|
1458
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1460
|
+
}
|
|
1461
|
+
__name(_nonIterableRest$1, "_nonIterableRest$1");
|
|
1462
|
+
function _slicedToArray$1(r, e2) {
|
|
1463
|
+
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e2) || _unsupportedIterableToArray(r, e2) || _nonIterableRest$1();
|
|
1464
|
+
}
|
|
1465
|
+
__name(_slicedToArray$1, "_slicedToArray$1");
|
|
1410
1466
|
function canUseDom() {
|
|
1411
1467
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
1412
1468
|
}
|
|
@@ -1439,19 +1495,19 @@ function useSafeState(defaultValue) {
|
|
|
1439
1495
|
return __name(safeSetState, "safeSetState"), [value, safeSetState];
|
|
1440
1496
|
}
|
|
1441
1497
|
__name(useSafeState, "useSafeState");
|
|
1442
|
-
function hasValue$
|
|
1498
|
+
function hasValue$1(value) {
|
|
1443
1499
|
return value !== void 0;
|
|
1444
1500
|
}
|
|
1445
|
-
__name(hasValue$
|
|
1501
|
+
__name(hasValue$1, "hasValue$1");
|
|
1446
1502
|
function useMergedState(defaultStateValue, option) {
|
|
1447
1503
|
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState, _useState = useSafeState(function() {
|
|
1448
|
-
return hasValue$
|
|
1504
|
+
return hasValue$1(value) ? value : hasValue$1(defaultValue) ? typeof defaultValue == "function" ? defaultValue() : defaultValue : typeof defaultStateValue == "function" ? defaultStateValue() : defaultStateValue;
|
|
1449
1505
|
}), _useState2 = _slicedToArray$1(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1], mergedValue = value !== void 0 ? value : innerValue, postMergedValue = postState ? postState(mergedValue) : mergedValue, onChangeFn = useEvent(onChange), _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray$1(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
1450
1506
|
useLayoutUpdateEffect(function() {
|
|
1451
1507
|
var prev = prevValue[0];
|
|
1452
1508
|
innerValue !== prev && onChangeFn(innerValue, prev);
|
|
1453
1509
|
}, [prevValue]), useLayoutUpdateEffect(function() {
|
|
1454
|
-
hasValue$
|
|
1510
|
+
hasValue$1(value) || setInnerValue(value);
|
|
1455
1511
|
}, [value]);
|
|
1456
1512
|
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
1457
1513
|
setInnerValue(updater, ignoreDestroy), setPrevValue([mergedValue], ignoreDestroy);
|
|
@@ -1459,6 +1515,15 @@ function useMergedState(defaultStateValue, option) {
|
|
|
1459
1515
|
return [postMergedValue, triggerChange];
|
|
1460
1516
|
}
|
|
1461
1517
|
__name(useMergedState, "useMergedState");
|
|
1518
|
+
function _typeof$2(o) {
|
|
1519
|
+
"@babel/helpers - typeof";
|
|
1520
|
+
return _typeof$2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
1521
|
+
return typeof o2;
|
|
1522
|
+
} : function(o2) {
|
|
1523
|
+
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
1524
|
+
}, _typeof$2(o);
|
|
1525
|
+
}
|
|
1526
|
+
__name(_typeof$2, "_typeof$2");
|
|
1462
1527
|
var reactIs = { exports: {} }, reactIs_production_min = {};
|
|
1463
1528
|
/**
|
|
1464
1529
|
* @license React
|
|
@@ -1597,25 +1662,73 @@ function isReactElement(node) {
|
|
|
1597
1662
|
}
|
|
1598
1663
|
__name(isReactElement, "isReactElement");
|
|
1599
1664
|
Number(version$1.split(".")[0]) >= 19;
|
|
1600
|
-
function
|
|
1665
|
+
function toPrimitive$1(t2, r) {
|
|
1666
|
+
if (_typeof$2(t2) != "object" || !t2) return t2;
|
|
1667
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
1668
|
+
if (e2 !== void 0) {
|
|
1669
|
+
var i = e2.call(t2, r || "default");
|
|
1670
|
+
if (_typeof$2(i) != "object") return i;
|
|
1671
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1672
|
+
}
|
|
1673
|
+
return (r === "string" ? String : Number)(t2);
|
|
1674
|
+
}
|
|
1675
|
+
__name(toPrimitive$1, "toPrimitive$1");
|
|
1676
|
+
function toPropertyKey$1(t2) {
|
|
1677
|
+
var i = toPrimitive$1(t2, "string");
|
|
1678
|
+
return _typeof$2(i) == "symbol" ? i : i + "";
|
|
1679
|
+
}
|
|
1680
|
+
__name(toPropertyKey$1, "toPropertyKey$1");
|
|
1681
|
+
function _defineProperty$b(e2, r, t2) {
|
|
1682
|
+
return (r = toPropertyKey$1(r)) in e2 ? Object.defineProperty(e2, r, {
|
|
1683
|
+
value: t2,
|
|
1684
|
+
enumerable: !0,
|
|
1685
|
+
configurable: !0,
|
|
1686
|
+
writable: !0
|
|
1687
|
+
}) : e2[r] = t2, e2;
|
|
1688
|
+
}
|
|
1689
|
+
__name(_defineProperty$b, "_defineProperty$b");
|
|
1690
|
+
function ownKeys$8(e2, r) {
|
|
1691
|
+
var t2 = Object.keys(e2);
|
|
1692
|
+
if (Object.getOwnPropertySymbols) {
|
|
1693
|
+
var o = Object.getOwnPropertySymbols(e2);
|
|
1694
|
+
r && (o = o.filter(function(r2) {
|
|
1695
|
+
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
1696
|
+
})), t2.push.apply(t2, o);
|
|
1697
|
+
}
|
|
1698
|
+
return t2;
|
|
1699
|
+
}
|
|
1700
|
+
__name(ownKeys$8, "ownKeys$8");
|
|
1701
|
+
function _objectSpread2$1(e2) {
|
|
1702
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
1703
|
+
var t2 = arguments[r] != null ? arguments[r] : {};
|
|
1704
|
+
r % 2 ? ownKeys$8(Object(t2), !0).forEach(function(r2) {
|
|
1705
|
+
_defineProperty$b(e2, r2, t2[r2]);
|
|
1706
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$8(Object(t2)).forEach(function(r2) {
|
|
1707
|
+
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
return e2;
|
|
1711
|
+
}
|
|
1712
|
+
__name(_objectSpread2$1, "_objectSpread2$1");
|
|
1713
|
+
function _arrayWithoutHoles$3(r) {
|
|
1601
1714
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
1602
1715
|
}
|
|
1603
|
-
__name(_arrayWithoutHoles$
|
|
1604
|
-
function _iterableToArray$
|
|
1716
|
+
__name(_arrayWithoutHoles$3, "_arrayWithoutHoles$3");
|
|
1717
|
+
function _iterableToArray$3(r) {
|
|
1605
1718
|
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
1606
1719
|
}
|
|
1607
|
-
__name(_iterableToArray$
|
|
1608
|
-
function _nonIterableSpread$
|
|
1720
|
+
__name(_iterableToArray$3, "_iterableToArray$3");
|
|
1721
|
+
function _nonIterableSpread$3() {
|
|
1609
1722
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1610
1723
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1611
1724
|
}
|
|
1612
|
-
__name(_nonIterableSpread$
|
|
1613
|
-
function _toConsumableArray$
|
|
1614
|
-
return _arrayWithoutHoles$
|
|
1725
|
+
__name(_nonIterableSpread$3, "_nonIterableSpread$3");
|
|
1726
|
+
function _toConsumableArray$4(r) {
|
|
1727
|
+
return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray(r) || _nonIterableSpread$3();
|
|
1615
1728
|
}
|
|
1616
|
-
__name(_toConsumableArray$
|
|
1729
|
+
__name(_toConsumableArray$4, "_toConsumableArray$4");
|
|
1617
1730
|
function _toArray(r) {
|
|
1618
|
-
return _arrayWithHoles$1(r) || _iterableToArray$
|
|
1731
|
+
return _arrayWithHoles$1(r) || _iterableToArray$3(r) || _unsupportedIterableToArray(r) || _nonIterableRest$1();
|
|
1619
1732
|
}
|
|
1620
1733
|
__name(_toArray, "_toArray");
|
|
1621
1734
|
var warned$1 = {}, preMessage$1 = /* @__PURE__ */ __name(function(fn) {
|
|
@@ -1648,7 +1761,7 @@ warningOnce$1.noteOnce = noteOnce$1;
|
|
|
1648
1761
|
var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
1649
1762
|
var _ref$size = _ref.size, size = _ref$size === void 0 ? "default" : _ref$size, color = _ref.color, prefixCls = _ref.prefixCls;
|
|
1650
1763
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1651
|
-
className: clsx("".concat(prefixCls, "-handler"), _defineProperty$
|
|
1764
|
+
className: clsx("".concat(prefixCls, "-handler"), _defineProperty$c({}, "".concat(prefixCls, "-handler-sm"), size === "small")),
|
|
1652
1765
|
style: {
|
|
1653
1766
|
backgroundColor: color
|
|
1654
1767
|
}
|
|
@@ -1657,19 +1770,20 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1657
1770
|
var children = _ref.children, style2 = _ref.style, prefixCls = _ref.prefixCls;
|
|
1658
1771
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1659
1772
|
className: "".concat(prefixCls, "-palette"),
|
|
1660
|
-
style: _objectSpread2$
|
|
1773
|
+
style: _objectSpread2$2({
|
|
1661
1774
|
position: "relative"
|
|
1662
1775
|
}, style2)
|
|
1663
1776
|
}, children);
|
|
1664
1777
|
}, "Palette"), Transform = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
1665
|
-
var children = props.children,
|
|
1778
|
+
var children = props.children, x = props.x, y = props.y;
|
|
1666
1779
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1667
1780
|
ref,
|
|
1668
1781
|
style: {
|
|
1669
1782
|
position: "absolute",
|
|
1670
|
-
left:
|
|
1671
|
-
top:
|
|
1672
|
-
zIndex: 1
|
|
1783
|
+
left: "".concat(x, "%"),
|
|
1784
|
+
top: "".concat(y, "%"),
|
|
1785
|
+
zIndex: 1,
|
|
1786
|
+
transform: "translate(-50%, -50%)"
|
|
1673
1787
|
}
|
|
1674
1788
|
}, children);
|
|
1675
1789
|
}), Picker$1 = /* @__PURE__ */ __name(function(_ref) {
|
|
@@ -1685,15 +1799,15 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1685
1799
|
color,
|
|
1686
1800
|
containerRef: pickerRef,
|
|
1687
1801
|
targetRef: transformRef,
|
|
1688
|
-
calculate: /* @__PURE__ */ __name(function(
|
|
1689
|
-
return
|
|
1802
|
+
calculate: /* @__PURE__ */ __name(function() {
|
|
1803
|
+
return calcOffset(color);
|
|
1690
1804
|
}, "calculate"),
|
|
1691
1805
|
onDragChange,
|
|
1692
1806
|
onDragChangeComplete: /* @__PURE__ */ __name(function() {
|
|
1693
1807
|
return onChangeComplete == null ? void 0 : onChangeComplete(colorRef.current);
|
|
1694
1808
|
}, "onDragChangeComplete"),
|
|
1695
1809
|
disabledDrag: disabled
|
|
1696
|
-
}), _useColorDrag2 = _slicedToArray$
|
|
1810
|
+
}), _useColorDrag2 = _slicedToArray$2(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1];
|
|
1697
1811
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1698
1812
|
ref: pickerRef,
|
|
1699
1813
|
className: "".concat(prefixCls, "-select"),
|
|
@@ -1702,7 +1816,8 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1702
1816
|
}, /* @__PURE__ */ React__default.createElement(Palette, {
|
|
1703
1817
|
prefixCls
|
|
1704
1818
|
}, /* @__PURE__ */ React__default.createElement(Transform, {
|
|
1705
|
-
|
|
1819
|
+
x: offset2.x,
|
|
1820
|
+
y: offset2.y,
|
|
1706
1821
|
ref: transformRef
|
|
1707
1822
|
}, /* @__PURE__ */ React__default.createElement(Handler, {
|
|
1708
1823
|
color: color.toRgbString(),
|
|
@@ -1714,24 +1829,18 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1714
1829
|
backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
|
|
1715
1830
|
}
|
|
1716
1831
|
})));
|
|
1717
|
-
}, "Picker")
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
var mergeState;
|
|
1725
|
-
return hasValue$1(value) ? mergeState = value : hasValue$1(defaultValue) ? mergeState = defaultValue : mergeState = defaultStateValue, generateColor(mergeState);
|
|
1726
|
-
}), _useState2 = _slicedToArray$1(_useState, 2), colorValue = _useState2[0], setColorValue = _useState2[1];
|
|
1727
|
-
return useEffect(function() {
|
|
1728
|
-
value && setColorValue(generateColor(value));
|
|
1729
|
-
}, [value]), [colorValue, setColorValue];
|
|
1832
|
+
}, "Picker"), useColorState = /* @__PURE__ */ __name(function(defaultValue, value) {
|
|
1833
|
+
var _useMergedState = useMergedState(defaultValue, {
|
|
1834
|
+
value
|
|
1835
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedValue = _useMergedState2[0], setValue = _useMergedState2[1], color = useMemo$1(function() {
|
|
1836
|
+
return generateColor(mergedValue);
|
|
1837
|
+
}, [mergedValue]);
|
|
1838
|
+
return [color, setValue];
|
|
1730
1839
|
}, "useColorState"), Gradient = /* @__PURE__ */ __name(function(_ref) {
|
|
1731
1840
|
var colors = _ref.colors, children = _ref.children, _ref$direction = _ref.direction, direction = _ref$direction === void 0 ? "to right" : _ref$direction, type2 = _ref.type, prefixCls = _ref.prefixCls, gradientColors = useMemo$1(function() {
|
|
1732
1841
|
return colors.map(function(color, idx) {
|
|
1733
1842
|
var result = generateColor(color);
|
|
1734
|
-
return type2 === "alpha" && idx === colors.length - 1 && result.
|
|
1843
|
+
return type2 === "alpha" && idx === colors.length - 1 && (result = new Color(result.setA(1))), result.toRgbString();
|
|
1735
1844
|
}).join(",");
|
|
1736
1845
|
}, [colors, type2]);
|
|
1737
1846
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -1744,7 +1853,7 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1744
1853
|
}, children);
|
|
1745
1854
|
}, "Gradient"), Slider$1 = /* @__PURE__ */ __name(function(props) {
|
|
1746
1855
|
var prefixCls = props.prefixCls, colors = props.colors, disabled = props.disabled, onChange = props.onChange, onChangeComplete = props.onChangeComplete, color = props.color, type2 = props.type, sliderRef = useRef(), transformRef = useRef(), colorRef = useRef(color), getValue = /* @__PURE__ */ __name(function(c2) {
|
|
1747
|
-
return type2 === "hue" ? c2.getHue() : c2.
|
|
1856
|
+
return type2 === "hue" ? c2.getHue() : c2.a * 100;
|
|
1748
1857
|
}, "getValue"), onDragChange = useEvent(function(offsetValue) {
|
|
1749
1858
|
var calcColor = calculateColor({
|
|
1750
1859
|
offset: offsetValue,
|
|
@@ -1758,8 +1867,8 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1758
1867
|
color,
|
|
1759
1868
|
targetRef: transformRef,
|
|
1760
1869
|
containerRef: sliderRef,
|
|
1761
|
-
calculate: /* @__PURE__ */ __name(function(
|
|
1762
|
-
return
|
|
1870
|
+
calculate: /* @__PURE__ */ __name(function() {
|
|
1871
|
+
return calcOffset(color, type2);
|
|
1763
1872
|
}, "calculate"),
|
|
1764
1873
|
onDragChange,
|
|
1765
1874
|
onDragChangeComplete: /* @__PURE__ */ __name(function() {
|
|
@@ -1767,7 +1876,15 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1767
1876
|
}, "onDragChangeComplete"),
|
|
1768
1877
|
direction: "x",
|
|
1769
1878
|
disabledDrag: disabled
|
|
1770
|
-
}), _useColorDrag2 = _slicedToArray$
|
|
1879
|
+
}), _useColorDrag2 = _slicedToArray$2(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1], handleColor = React__default.useMemo(function() {
|
|
1880
|
+
if (type2 === "hue") {
|
|
1881
|
+
var hsb = color.toHsb();
|
|
1882
|
+
hsb.s = 1, hsb.b = 1, hsb.a = 1;
|
|
1883
|
+
var lightColor = new Color(hsb);
|
|
1884
|
+
return lightColor;
|
|
1885
|
+
}
|
|
1886
|
+
return color;
|
|
1887
|
+
}, [color, type2]), gradientList = React__default.useMemo(function() {
|
|
1771
1888
|
return colors.map(function(info) {
|
|
1772
1889
|
return "".concat(info.color, " ").concat(info.percent, "%");
|
|
1773
1890
|
});
|
|
@@ -1780,11 +1897,12 @@ var useColorState = /* @__PURE__ */ __name(function(defaultStateValue, option) {
|
|
|
1780
1897
|
}, /* @__PURE__ */ React__default.createElement(Palette, {
|
|
1781
1898
|
prefixCls
|
|
1782
1899
|
}, /* @__PURE__ */ React__default.createElement(Transform, {
|
|
1783
|
-
|
|
1900
|
+
x: offset2.x,
|
|
1901
|
+
y: offset2.y,
|
|
1784
1902
|
ref: transformRef
|
|
1785
1903
|
}, /* @__PURE__ */ React__default.createElement(Handler, {
|
|
1786
1904
|
size: "small",
|
|
1787
|
-
color:
|
|
1905
|
+
color: handleColor.toHexString(),
|
|
1788
1906
|
prefixCls
|
|
1789
1907
|
})), /* @__PURE__ */ React__default.createElement(Gradient, {
|
|
1790
1908
|
colors: gradientList,
|
|
@@ -1820,51 +1938,50 @@ var HUE_COLORS = [{
|
|
|
1820
1938
|
}, {
|
|
1821
1939
|
color: "rgb(255, 0, 0)",
|
|
1822
1940
|
percent: 100
|
|
1823
|
-
}]
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
value,
|
|
1827
|
-
defaultValue
|
|
1828
|
-
}), _useColorState2 = _slicedToArray$1(_useColorState, 2), colorValue = _useColorState2[0], setColorValue = _useColorState2[1], alphaColor = useMemo$1(function() {
|
|
1829
|
-
var rgb = generateColor(colorValue.toRgbString());
|
|
1830
|
-
return rgb.setAlpha(1), rgb.toRgbString();
|
|
1941
|
+
}], ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
1942
|
+
var value = props.value, defaultValue = props.defaultValue, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? ColorPickerPrefixCls : _props$prefixCls, onChange = props.onChange, onChangeComplete = props.onChangeComplete, className = props.className, style2 = props.style, panelRender = props.panelRender, _props$disabledAlpha = props.disabledAlpha, disabledAlpha = _props$disabledAlpha === void 0 ? !1 : _props$disabledAlpha, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? !1 : _props$disabled, components = props.components, _useComponent = useComponent(components), _useComponent2 = _slicedToArray$2(_useComponent, 1), Slider3 = _useComponent2[0], _useColorState = useColorState(defaultValue || defaultColor, value), _useColorState2 = _slicedToArray$2(_useColorState, 2), colorValue = _useColorState2[0], setColorValue = _useColorState2[1], alphaColor = useMemo$1(function() {
|
|
1943
|
+
return colorValue.setA(1).toRgbString();
|
|
1831
1944
|
}, [colorValue]), handleChange = /* @__PURE__ */ __name(function(data, type2) {
|
|
1832
1945
|
value || setColorValue(data), onChange == null || onChange(data, type2);
|
|
1833
|
-
}, "
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1946
|
+
}, "handleChange2"), getHueColor = /* @__PURE__ */ __name(function(hue) {
|
|
1947
|
+
return new Color(colorValue.setHue(hue));
|
|
1948
|
+
}, "getHueColor2"), getAlphaColor = /* @__PURE__ */ __name(function(alpha) {
|
|
1949
|
+
return new Color(colorValue.setA(alpha / 100));
|
|
1950
|
+
}, "getAlphaColor2"), onHueChange = /* @__PURE__ */ __name(function(hue) {
|
|
1951
|
+
handleChange(getHueColor(hue), {
|
|
1952
|
+
type: "hue",
|
|
1953
|
+
value: hue
|
|
1954
|
+
});
|
|
1955
|
+
}, "onHueChange2"), onAlphaChange = /* @__PURE__ */ __name(function(alpha) {
|
|
1956
|
+
handleChange(getAlphaColor(alpha), {
|
|
1957
|
+
type: "alpha",
|
|
1958
|
+
value: alpha
|
|
1959
|
+
});
|
|
1960
|
+
}, "onAlphaChange2"), onHueChangeComplete = /* @__PURE__ */ __name(function(hue) {
|
|
1844
1961
|
onChangeComplete && onChangeComplete(getHueColor(hue));
|
|
1845
|
-
}, "
|
|
1962
|
+
}, "onHueChangeComplete2"), onAlphaChangeComplete = /* @__PURE__ */ __name(function(alpha) {
|
|
1846
1963
|
onChangeComplete && onChangeComplete(getAlphaColor(alpha));
|
|
1847
|
-
}, "
|
|
1964
|
+
}, "onAlphaChangeComplete2"), mergeCls = clsx("".concat(prefixCls, "-panel"), className, _defineProperty$c({}, "".concat(prefixCls, "-panel-disabled"), disabled)), sharedSliderProps = {
|
|
1848
1965
|
prefixCls,
|
|
1849
1966
|
disabled,
|
|
1850
1967
|
color: colorValue
|
|
1851
|
-
}, defaultPanel = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Picker$1, _extends$
|
|
1968
|
+
}, defaultPanel = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Picker$1, _extends$6({
|
|
1852
1969
|
onChange: handleChange
|
|
1853
1970
|
}, sharedSliderProps, {
|
|
1854
1971
|
onChangeComplete
|
|
1855
1972
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
1856
1973
|
className: "".concat(prefixCls, "-slider-container")
|
|
1857
1974
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
1858
|
-
className: clsx("".concat(prefixCls, "-slider-group"), _defineProperty$
|
|
1859
|
-
}, /* @__PURE__ */ React__default.createElement(Slider3, _extends$
|
|
1975
|
+
className: clsx("".concat(prefixCls, "-slider-group"), _defineProperty$c({}, "".concat(prefixCls, "-slider-group-disabled-alpha"), disabledAlpha))
|
|
1976
|
+
}, /* @__PURE__ */ React__default.createElement(Slider3, _extends$6({}, sharedSliderProps, {
|
|
1860
1977
|
type: "hue",
|
|
1861
1978
|
colors: HUE_COLORS,
|
|
1862
1979
|
min: 0,
|
|
1863
|
-
max:
|
|
1980
|
+
max: 359,
|
|
1864
1981
|
value: colorValue.getHue(),
|
|
1865
1982
|
onChange: onHueChange,
|
|
1866
1983
|
onChangeComplete: onHueChangeComplete
|
|
1867
|
-
})), !disabledAlpha && /* @__PURE__ */ React__default.createElement(Slider3, _extends$
|
|
1984
|
+
})), !disabledAlpha && /* @__PURE__ */ React__default.createElement(Slider3, _extends$6({}, sharedSliderProps, {
|
|
1868
1985
|
type: "alpha",
|
|
1869
1986
|
colors: [{
|
|
1870
1987
|
percent: 0,
|
|
@@ -1875,7 +1992,7 @@ const ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
|
1875
1992
|
}],
|
|
1876
1993
|
min: 0,
|
|
1877
1994
|
max: 100,
|
|
1878
|
-
value: colorValue.
|
|
1995
|
+
value: colorValue.a * 100,
|
|
1879
1996
|
onChange: onAlphaChange,
|
|
1880
1997
|
onChangeComplete: onAlphaChangeComplete
|
|
1881
1998
|
}))), /* @__PURE__ */ React__default.createElement(ColorBlock, {
|
|
@@ -1887,7 +2004,8 @@ const ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
|
1887
2004
|
style: style2,
|
|
1888
2005
|
ref
|
|
1889
2006
|
}, typeof panelRender == "function" ? panelRender(defaultPanel) : defaultPanel);
|
|
1890
|
-
})
|
|
2007
|
+
});
|
|
2008
|
+
const colorPicker = "univer-color-picker", colorPickerHidden = "univer-color-picker-hidden", colorPickerPanel = "univer-color-picker-panel", colorPickerPanelDisabled = "univer-color-picker-panel-disabled", colorPickerSelect = "univer-color-picker-select", colorPickerPalette = "univer-color-picker-palette", colorPickerGradient = "univer-color-picker-gradient", colorPickerSaturation = "univer-color-picker-saturation", colorPickerHandler = "univer-color-picker-handler", colorPickerSlider = "univer-color-picker-slider", colorPickerColorBlocks = "univer-color-picker-color-blocks", colorPickerColorBlock = "univer-color-picker-color-block", colorPickerColorBlockInner = "univer-color-picker-color-block-inner", colorPickerSliderContainer = "univer-color-picker-slider-container", colorPickerSliderGroup = "univer-color-picker-slider-group", colorPickerSliderGroupDisabledAlpha = "univer-color-picker-slider-group-disabled-alpha", styles$o = {
|
|
1891
2009
|
colorPicker,
|
|
1892
2010
|
colorPickerHidden,
|
|
1893
2011
|
colorPickerPanel,
|
|
@@ -2018,6 +2136,16 @@ function ColorPicker(props) {
|
|
|
2018
2136
|
)))), /* @__PURE__ */ React__default.createElement("section", { onClick: handleStopPropagation }, /* @__PURE__ */ React__default.createElement(ColorPicker$1, { prefixCls: styles$o.colorPicker, disabledAlpha: !0, onChangeComplete: handleChange })));
|
|
2019
2137
|
}
|
|
2020
2138
|
__name(ColorPicker, "ColorPicker");
|
|
2139
|
+
function _extends$5() {
|
|
2140
|
+
return _extends$5 = Object.assign ? Object.assign.bind() : function(n2) {
|
|
2141
|
+
for (var e2 = 1; e2 < arguments.length; e2++) {
|
|
2142
|
+
var t2 = arguments[e2];
|
|
2143
|
+
for (var r in t2) ({}).hasOwnProperty.call(t2, r) && (n2[r] = t2[r]);
|
|
2144
|
+
}
|
|
2145
|
+
return n2;
|
|
2146
|
+
}, _extends$5.apply(null, arguments);
|
|
2147
|
+
}
|
|
2148
|
+
__name(_extends$5, "_extends$5");
|
|
2021
2149
|
var OrderContext = /* @__PURE__ */ React$6.createContext(null), EMPTY_LIST$2 = [];
|
|
2022
2150
|
function useDom(render2, debug) {
|
|
2023
2151
|
var _React$useState = React$6.useState(function() {
|
|
@@ -2027,7 +2155,7 @@ function useDom(render2, debug) {
|
|
|
2027
2155
|
return defaultEle;
|
|
2028
2156
|
}), _React$useState2 = _slicedToArray$1(_React$useState, 1), ele = _React$useState2[0], appendedRef = React$6.useRef(!1), queueCreate = React$6.useContext(OrderContext), _React$useState3 = React$6.useState(EMPTY_LIST$2), _React$useState4 = _slicedToArray$1(_React$useState3, 2), queue = _React$useState4[0], setQueue = _React$useState4[1], mergedQueueCreate = queueCreate || (appendedRef.current ? void 0 : function(appendFn) {
|
|
2029
2157
|
setQueue(function(origin) {
|
|
2030
|
-
var newQueue = [appendFn].concat(_toConsumableArray$
|
|
2158
|
+
var newQueue = [appendFn].concat(_toConsumableArray$4(origin));
|
|
2031
2159
|
return newQueue;
|
|
2032
2160
|
});
|
|
2033
2161
|
});
|
|
@@ -2864,7 +2992,104 @@ function findDOMNode$1(node) {
|
|
|
2864
2992
|
return null;
|
|
2865
2993
|
}
|
|
2866
2994
|
__name(findDOMNode$1, "findDOMNode$1");
|
|
2867
|
-
|
|
2995
|
+
function _objectWithoutPropertiesLoose$3(r, e2) {
|
|
2996
|
+
if (r == null) return {};
|
|
2997
|
+
var t2 = {};
|
|
2998
|
+
for (var n2 in r) if ({}.hasOwnProperty.call(r, n2)) {
|
|
2999
|
+
if (e2.indexOf(n2) >= 0) continue;
|
|
3000
|
+
t2[n2] = r[n2];
|
|
3001
|
+
}
|
|
3002
|
+
return t2;
|
|
3003
|
+
}
|
|
3004
|
+
__name(_objectWithoutPropertiesLoose$3, "_objectWithoutPropertiesLoose$3");
|
|
3005
|
+
function _objectWithoutProperties$1(e2, t2) {
|
|
3006
|
+
if (e2 == null) return {};
|
|
3007
|
+
var o, r, i = _objectWithoutPropertiesLoose$3(e2, t2);
|
|
3008
|
+
if (Object.getOwnPropertySymbols) {
|
|
3009
|
+
var n2 = Object.getOwnPropertySymbols(e2);
|
|
3010
|
+
for (r = 0; r < n2.length; r++) o = n2[r], t2.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e2, o) && (i[o] = e2[o]);
|
|
3011
|
+
}
|
|
3012
|
+
return i;
|
|
3013
|
+
}
|
|
3014
|
+
__name(_objectWithoutProperties$1, "_objectWithoutProperties$1");
|
|
3015
|
+
var Context = /* @__PURE__ */ React$6.createContext({});
|
|
3016
|
+
function _classCallCheck$1(a, n2) {
|
|
3017
|
+
if (!(a instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
3018
|
+
}
|
|
3019
|
+
__name(_classCallCheck$1, "_classCallCheck$1");
|
|
3020
|
+
function _defineProperties$1(e2, r) {
|
|
3021
|
+
for (var t2 = 0; t2 < r.length; t2++) {
|
|
3022
|
+
var o = r[t2];
|
|
3023
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey$1(o.key), o);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
__name(_defineProperties$1, "_defineProperties$1");
|
|
3027
|
+
function _createClass$1(e2, r, t2) {
|
|
3028
|
+
return r && _defineProperties$1(e2.prototype, r), t2 && _defineProperties$1(e2, t2), Object.defineProperty(e2, "prototype", {
|
|
3029
|
+
writable: !1
|
|
3030
|
+
}), e2;
|
|
3031
|
+
}
|
|
3032
|
+
__name(_createClass$1, "_createClass$1");
|
|
3033
|
+
function _setPrototypeOf$3(t2, e2) {
|
|
3034
|
+
return _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
|
3035
|
+
return t3.__proto__ = e3, t3;
|
|
3036
|
+
}, _setPrototypeOf$3(t2, e2);
|
|
3037
|
+
}
|
|
3038
|
+
__name(_setPrototypeOf$3, "_setPrototypeOf$3");
|
|
3039
|
+
function _inherits$1(t2, e2) {
|
|
3040
|
+
if (typeof e2 != "function" && e2 !== null) throw new TypeError("Super expression must either be null or a function");
|
|
3041
|
+
t2.prototype = Object.create(e2 && e2.prototype, {
|
|
3042
|
+
constructor: {
|
|
3043
|
+
value: t2,
|
|
3044
|
+
writable: !0,
|
|
3045
|
+
configurable: !0
|
|
3046
|
+
}
|
|
3047
|
+
}), Object.defineProperty(t2, "prototype", {
|
|
3048
|
+
writable: !1
|
|
3049
|
+
}), e2 && _setPrototypeOf$3(t2, e2);
|
|
3050
|
+
}
|
|
3051
|
+
__name(_inherits$1, "_inherits$1");
|
|
3052
|
+
function _getPrototypeOf$1(t2) {
|
|
3053
|
+
return _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
|
3054
|
+
return t3.__proto__ || Object.getPrototypeOf(t3);
|
|
3055
|
+
}, _getPrototypeOf$1(t2);
|
|
3056
|
+
}
|
|
3057
|
+
__name(_getPrototypeOf$1, "_getPrototypeOf$1");
|
|
3058
|
+
function _isNativeReflectConstruct$1() {
|
|
3059
|
+
try {
|
|
3060
|
+
var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
3061
|
+
}));
|
|
3062
|
+
} catch {
|
|
3063
|
+
}
|
|
3064
|
+
return (_isNativeReflectConstruct$1 = /* @__PURE__ */ __name(function() {
|
|
3065
|
+
return !!t2;
|
|
3066
|
+
}, "_isNativeReflectConstruct"))();
|
|
3067
|
+
}
|
|
3068
|
+
__name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct$1");
|
|
3069
|
+
function _assertThisInitialized$1(e2) {
|
|
3070
|
+
if (e2 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3071
|
+
return e2;
|
|
3072
|
+
}
|
|
3073
|
+
__name(_assertThisInitialized$1, "_assertThisInitialized$1");
|
|
3074
|
+
function _possibleConstructorReturn$1(t2, e2) {
|
|
3075
|
+
if (e2 && (_typeof$2(e2) == "object" || typeof e2 == "function")) return e2;
|
|
3076
|
+
if (e2 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
3077
|
+
return _assertThisInitialized$1(t2);
|
|
3078
|
+
}
|
|
3079
|
+
__name(_possibleConstructorReturn$1, "_possibleConstructorReturn$1");
|
|
3080
|
+
function _createSuper$1(t2) {
|
|
3081
|
+
var r = _isNativeReflectConstruct$1();
|
|
3082
|
+
return function() {
|
|
3083
|
+
var e2, o = _getPrototypeOf$1(t2);
|
|
3084
|
+
if (r) {
|
|
3085
|
+
var s = _getPrototypeOf$1(this).constructor;
|
|
3086
|
+
e2 = Reflect.construct(o, arguments, s);
|
|
3087
|
+
} else e2 = o.apply(this, arguments);
|
|
3088
|
+
return _possibleConstructorReturn$1(this, e2);
|
|
3089
|
+
};
|
|
3090
|
+
}
|
|
3091
|
+
__name(_createSuper$1, "_createSuper$1");
|
|
3092
|
+
var DomWrapper$1 = /* @__PURE__ */ function(_React$Component) {
|
|
2868
3093
|
_inherits$1(DomWrapper2, _React$Component);
|
|
2869
3094
|
var _super = _createSuper$1(DomWrapper2);
|
|
2870
3095
|
function DomWrapper2() {
|
|
@@ -4645,14 +4870,18 @@ function Dialog(props) {
|
|
|
4645
4870
|
preservePositionOnDestroy = !1,
|
|
4646
4871
|
footer,
|
|
4647
4872
|
onClose,
|
|
4648
|
-
mask
|
|
4873
|
+
mask,
|
|
4874
|
+
dialogStyles,
|
|
4875
|
+
closable,
|
|
4876
|
+
maskClosable
|
|
4649
4877
|
} = props, [dragDisabled, setDragDisabled] = useState(!1), [positionOffset, setPositionOffset] = useState(null), { mountContainer } = useContext(ConfigContext), TitleIfDraggable = draggable ? /* @__PURE__ */ React__default.createElement(
|
|
4650
4878
|
"div",
|
|
4651
4879
|
{
|
|
4652
4880
|
className: styles$n.dialogTitleContent,
|
|
4653
4881
|
style: {
|
|
4654
4882
|
width: "100%",
|
|
4655
|
-
cursor: "pointer"
|
|
4883
|
+
cursor: "pointer",
|
|
4884
|
+
...dialogStyles == null ? void 0 : dialogStyles.header
|
|
4656
4885
|
},
|
|
4657
4886
|
onMouseOver: /* @__PURE__ */ __name(() => {
|
|
4658
4887
|
dragDisabled && setDragDisabled(!1);
|
|
@@ -4711,7 +4940,10 @@ function Dialog(props) {
|
|
|
4711
4940
|
footer,
|
|
4712
4941
|
mask: needMask,
|
|
4713
4942
|
style: style2,
|
|
4714
|
-
onClose
|
|
4943
|
+
onClose,
|
|
4944
|
+
styles: dialogStyles,
|
|
4945
|
+
closable,
|
|
4946
|
+
maskClosable
|
|
4715
4947
|
},
|
|
4716
4948
|
children
|
|
4717
4949
|
);
|
|
@@ -4749,6 +4981,23 @@ function Confirm(props) {
|
|
|
4749
4981
|
);
|
|
4750
4982
|
}
|
|
4751
4983
|
__name(Confirm, "Confirm");
|
|
4984
|
+
function _arrayWithoutHoles$2(r) {
|
|
4985
|
+
if (Array.isArray(r)) return _arrayLikeToArray$1(r);
|
|
4986
|
+
}
|
|
4987
|
+
__name(_arrayWithoutHoles$2, "_arrayWithoutHoles$2");
|
|
4988
|
+
function _iterableToArray$2(r) {
|
|
4989
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
4990
|
+
}
|
|
4991
|
+
__name(_iterableToArray$2, "_iterableToArray$2");
|
|
4992
|
+
function _nonIterableSpread$2() {
|
|
4993
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4994
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
4995
|
+
}
|
|
4996
|
+
__name(_nonIterableSpread$2, "_nonIterableSpread$2");
|
|
4997
|
+
function _toConsumableArray$3(r) {
|
|
4998
|
+
return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$2();
|
|
4999
|
+
}
|
|
5000
|
+
__name(_toConsumableArray$3, "_toConsumableArray$3");
|
|
4752
5001
|
function omit$2(obj, fields) {
|
|
4753
5002
|
var clone = Object.assign({}, obj);
|
|
4754
5003
|
return Array.isArray(fields) && fields.forEach(function(key) {
|
|
@@ -5214,7 +5463,7 @@ function Arrow(props) {
|
|
|
5214
5463
|
__name(Arrow, "Arrow");
|
|
5215
5464
|
function Mask2(props) {
|
|
5216
5465
|
var prefixCls = props.prefixCls, open = props.open, zIndex = props.zIndex, mask = props.mask, motion = props.motion;
|
|
5217
|
-
return mask ? /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$
|
|
5466
|
+
return mask ? /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$6({}, motion, {
|
|
5218
5467
|
motionAppear: !0,
|
|
5219
5468
|
visible: open,
|
|
5220
5469
|
removeOnLeave: !0
|
|
@@ -5235,7 +5484,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5235
5484
|
}, function(_, next) {
|
|
5236
5485
|
return next.cache;
|
|
5237
5486
|
}), Popup$3 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
5238
|
-
var popup2 = props.popup, className = props.className, prefixCls = props.prefixCls, style2 = props.style, target = props.target, _onVisibleChanged = props.onVisibleChanged, open = props.open, keepDom = props.keepDom, fresh = props.fresh, onClick = props.onClick, mask = props.mask, arrow = props.arrow, arrowPos = props.arrowPos, align = props.align, motion = props.motion, maskMotion = props.maskMotion, forceRender = props.forceRender, getPopupContainer = props.getPopupContainer, autoDestroy = props.autoDestroy, Portal2 = props.portal, zIndex = props.zIndex, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onPointerEnter = props.onPointerEnter, ready = props.ready, offsetX = props.offsetX, offsetY = props.offsetY, offsetR = props.offsetR, offsetB = props.offsetB, onAlign = props.onAlign, onPrepare = props.onPrepare, stretch = props.stretch, targetWidth = props.targetWidth, targetHeight = props.targetHeight, childNode = typeof popup2 == "function" ? popup2() : popup2, isNodeVisible = open || keepDom, getPopupContainerNeedParams = (getPopupContainer == null ? void 0 : getPopupContainer.length) > 0, _React$useState = React$6.useState(!getPopupContainer || !getPopupContainerNeedParams), _React$useState2 = _slicedToArray$
|
|
5487
|
+
var popup2 = props.popup, className = props.className, prefixCls = props.prefixCls, style2 = props.style, target = props.target, _onVisibleChanged = props.onVisibleChanged, open = props.open, keepDom = props.keepDom, fresh = props.fresh, onClick = props.onClick, mask = props.mask, arrow = props.arrow, arrowPos = props.arrowPos, align = props.align, motion = props.motion, maskMotion = props.maskMotion, forceRender = props.forceRender, getPopupContainer = props.getPopupContainer, autoDestroy = props.autoDestroy, Portal2 = props.portal, zIndex = props.zIndex, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onPointerEnter = props.onPointerEnter, ready = props.ready, offsetX = props.offsetX, offsetY = props.offsetY, offsetR = props.offsetR, offsetB = props.offsetB, onAlign = props.onAlign, onPrepare = props.onPrepare, stretch = props.stretch, targetWidth = props.targetWidth, targetHeight = props.targetHeight, childNode = typeof popup2 == "function" ? popup2() : popup2, isNodeVisible = open || keepDom, getPopupContainerNeedParams = (getPopupContainer == null ? void 0 : getPopupContainer.length) > 0, _React$useState = React$6.useState(!getPopupContainer || !getPopupContainerNeedParams), _React$useState2 = _slicedToArray$2(_React$useState, 2), show = _React$useState2[0], setShow = _React$useState2[1];
|
|
5239
5488
|
if (useLayoutEffect$1(function() {
|
|
5240
5489
|
!show && getPopupContainerNeedParams && target && setShow(!0);
|
|
5241
5490
|
}, [show, getPopupContainerNeedParams, target]), !show)
|
|
@@ -5267,7 +5516,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5267
5516
|
onResize: onAlign,
|
|
5268
5517
|
disabled: !open
|
|
5269
5518
|
}, function(resizeObserverRef) {
|
|
5270
|
-
return /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$
|
|
5519
|
+
return /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$6({
|
|
5271
5520
|
motionAppear: !0,
|
|
5272
5521
|
motionEnter: !0,
|
|
5273
5522
|
motionLeave: !0,
|
|
@@ -5287,7 +5536,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5287
5536
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
5288
5537
|
ref: composeRef(resizeObserverRef, ref, motionRef),
|
|
5289
5538
|
className: cls,
|
|
5290
|
-
style: _objectSpread2$
|
|
5539
|
+
style: _objectSpread2$2(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({
|
|
5291
5540
|
"--arrow-x": "".concat(arrowPos.x || 0, "px"),
|
|
5292
5541
|
"--arrow-y": "".concat(arrowPos.y || 0, "px")
|
|
5293
5542
|
}, offsetStyle), miscStyle), motionStyle), {}, {
|
|
@@ -5392,7 +5641,7 @@ function getPxValue(val) {
|
|
|
5392
5641
|
}
|
|
5393
5642
|
__name(getPxValue, "getPxValue");
|
|
5394
5643
|
function getVisibleArea(initArea, scrollerList) {
|
|
5395
|
-
var visibleArea = _objectSpread2$
|
|
5644
|
+
var visibleArea = _objectSpread2$2({}, initArea);
|
|
5396
5645
|
return (scrollerList || []).forEach(function(ele) {
|
|
5397
5646
|
if (!(ele instanceof HTMLBodyElement || ele instanceof HTMLHtmlElement)) {
|
|
5398
5647
|
var _getWin$getComputedSt2 = getWin(ele).getComputedStyle(ele), overflow = _getWin$getComputedSt2.overflow, overflowClipMargin = _getWin$getComputedSt2.overflowClipMargin, borderTopWidth = _getWin$getComputedSt2.borderTopWidth, borderBottomWidth = _getWin$getComputedSt2.borderBottomWidth, borderLeftWidth = _getWin$getComputedSt2.borderLeftWidth, borderRightWidth = _getWin$getComputedSt2.borderRightWidth, eleRect = ele.getBoundingClientRect(), eleOutHeight = ele.offsetHeight, eleInnerHeight = ele.clientHeight, eleOutWidth = ele.offsetWidth, eleInnerWidth = ele.clientWidth, borderTopNum = getPxValue(borderTopWidth), borderBottomNum = getPxValue(borderBottomWidth), borderLeftNum = getPxValue(borderLeftWidth), borderRightNum = getPxValue(borderRightWidth), scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1e3) / 1e3), scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1e3) / 1e3), eleScrollWidth = (eleOutWidth - eleInnerWidth - borderLeftNum - borderRightNum) * scaleX, eleScrollHeight = (eleOutHeight - eleInnerHeight - borderTopNum - borderBottomNum) * scaleY, scaledBorderTopWidth = borderTopNum * scaleY, scaledBorderBottomWidth = borderBottomNum * scaleY, scaledBorderLeftWidth = borderLeftNum * scaleX, scaledBorderRightWidth = borderRightNum * scaleX, clipMarginWidth = 0, clipMarginHeight = 0;
|
|
@@ -5412,7 +5661,7 @@ function getUnitOffset(size) {
|
|
|
5412
5661
|
}
|
|
5413
5662
|
__name(getUnitOffset, "getUnitOffset");
|
|
5414
5663
|
function getNumberOffset(rect, offset2) {
|
|
5415
|
-
var _ref = offset2 || [], _ref2 = _slicedToArray$
|
|
5664
|
+
var _ref = offset2 || [], _ref2 = _slicedToArray$2(_ref, 2), offsetX = _ref2[0], offsetY = _ref2[1];
|
|
5416
5665
|
return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
|
|
5417
5666
|
}
|
|
5418
5667
|
__name(getNumberOffset, "getNumberOffset");
|
|
@@ -5453,7 +5702,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5453
5702
|
scaleX: 1,
|
|
5454
5703
|
scaleY: 1,
|
|
5455
5704
|
align: builtinPlacements[placement] || {}
|
|
5456
|
-
}), _React$useState2 = _slicedToArray$
|
|
5705
|
+
}), _React$useState2 = _slicedToArray$2(_React$useState, 2), offsetInfo = _React$useState2[0], setOffsetInfo = _React$useState2[1], alignCountRef = React$6.useRef(0), scrollerList = React$6.useMemo(function() {
|
|
5457
5706
|
return popupEle ? collectScroller(popupEle) : [];
|
|
5458
5707
|
}, [popupEle]), prevFlipRef = React$6.useRef({}), resetFlipCache = /* @__PURE__ */ __name(function() {
|
|
5459
5708
|
prevFlipRef.current = {};
|
|
@@ -5468,7 +5717,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5468
5717
|
nextPopupY = popupRect.y + nextOffsetY, nextPopupBottom = nextPopupY + popupHeight, nextPopupX = popupRect.x + nextOffsetX, nextPopupRight = nextPopupX + popupWidth;
|
|
5469
5718
|
};
|
|
5470
5719
|
__name(getIntersectionVisibleArea, "getIntersectionVisibleArea"), __name(syncNextPopupPosition, "syncNextPopupPosition");
|
|
5471
|
-
var _popupElement$parentE, _popupElement$parentE2, popupElement = popupEle, doc = popupElement.ownerDocument, win = getWin(popupElement), _win$getComputedStyle = win.getComputedStyle(popupElement), width2 = _win$getComputedStyle.width, height2 = _win$getComputedStyle.height, popupPosition = _win$getComputedStyle.position, originLeft = popupElement.style.left, originTop = popupElement.style.top, originRight = popupElement.style.right, originBottom = popupElement.style.bottom, originOverflow = popupElement.style.overflow, placementInfo = _objectSpread2$
|
|
5720
|
+
var _popupElement$parentE, _popupElement$parentE2, popupElement = popupEle, doc = popupElement.ownerDocument, win = getWin(popupElement), _win$getComputedStyle = win.getComputedStyle(popupElement), width2 = _win$getComputedStyle.width, height2 = _win$getComputedStyle.height, popupPosition = _win$getComputedStyle.position, originLeft = popupElement.style.left, originTop = popupElement.style.top, originRight = popupElement.style.right, originBottom = popupElement.style.bottom, originOverflow = popupElement.style.overflow, placementInfo = _objectSpread2$2(_objectSpread2$2({}, builtinPlacements[placement]), popupAlign), placeholderElement = doc.createElement("div");
|
|
5472
5721
|
(_popupElement$parentE = popupElement.parentElement) === null || _popupElement$parentE === void 0 || _popupElement$parentE.appendChild(placeholderElement), placeholderElement.style.left = "".concat(popupElement.offsetLeft, "px"), placeholderElement.style.top = "".concat(popupElement.offsetTop, "px"), placeholderElement.style.position = popupPosition, placeholderElement.style.height = "".concat(popupElement.offsetHeight, "px"), placeholderElement.style.width = "".concat(popupElement.offsetWidth, "px"), popupElement.style.left = "0", popupElement.style.top = "0", popupElement.style.right = "auto", popupElement.style.bottom = "auto", popupElement.style.overflow = "hidden";
|
|
5473
5722
|
var targetRect;
|
|
5474
5723
|
if (Array.isArray(target))
|
|
@@ -5506,9 +5755,9 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5506
5755
|
var _scaleX = toNum(Math.round(popupWidth / parseFloat(width2) * 1e3) / 1e3), _scaleY = toNum(Math.round(popupHeight / parseFloat(height2) * 1e3) / 1e3);
|
|
5507
5756
|
if (_scaleX === 0 || _scaleY === 0 || isDOM(target) && !isVisible(target))
|
|
5508
5757
|
return;
|
|
5509
|
-
var offset2 = placementInfo.offset, targetOffset2 = placementInfo.targetOffset, _getNumberOffset = getNumberOffset(popupRect, offset2), _getNumberOffset2 = _slicedToArray$
|
|
5758
|
+
var offset2 = placementInfo.offset, targetOffset2 = placementInfo.targetOffset, _getNumberOffset = getNumberOffset(popupRect, offset2), _getNumberOffset2 = _slicedToArray$2(_getNumberOffset, 2), popupOffsetX = _getNumberOffset2[0], popupOffsetY = _getNumberOffset2[1], _getNumberOffset3 = getNumberOffset(targetRect, targetOffset2), _getNumberOffset4 = _slicedToArray$2(_getNumberOffset3, 2), targetOffsetX = _getNumberOffset4[0], targetOffsetY = _getNumberOffset4[1];
|
|
5510
5759
|
targetRect.x -= targetOffsetX, targetRect.y -= targetOffsetY;
|
|
5511
|
-
var _ref3 = placementInfo.points || [], _ref4 = _slicedToArray$
|
|
5760
|
+
var _ref3 = placementInfo.points || [], _ref4 = _slicedToArray$2(_ref3, 2), popupPoint = _ref4[0], targetPoint = _ref4[1], targetPoints = splitPoints(targetPoint), popupPoints = splitPoints(popupPoint), targetAlignPoint = getAlignPoint(targetRect, targetPoints), popupAlignPoint = getAlignPoint(popupRect, popupPoints), nextAlignInfo = _objectSpread2$2({}, placementInfo), nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX, nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY, originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY), originIntersectionRecommendArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY, visibleRegionArea), targetAlignPointTL = getAlignPoint(targetRect, ["t", "l"]), popupAlignPointTL = getAlignPoint(popupRect, ["t", "l"]), targetAlignPointBR = getAlignPoint(targetRect, ["b", "r"]), popupAlignPointBR = getAlignPoint(popupRect, ["b", "r"]), overflow = placementInfo.overflow || {}, adjustX = overflow.adjustX, adjustY = overflow.adjustY, shiftX = overflow.shiftX, shiftY = overflow.shiftY, supportAdjust = /* @__PURE__ */ __name(function(val) {
|
|
5512
5761
|
return typeof val == "boolean" ? val : val >= 0;
|
|
5513
5762
|
}, "supportAdjust"), nextPopupY, nextPopupBottom, nextPopupX, nextPopupRight;
|
|
5514
5763
|
syncNextPopupPosition();
|
|
@@ -5577,7 +5826,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5577
5826
|
});
|
|
5578
5827
|
}, "triggerAlign"), resetReady = /* @__PURE__ */ __name(function() {
|
|
5579
5828
|
setOffsetInfo(function(ori) {
|
|
5580
|
-
return _objectSpread2$
|
|
5829
|
+
return _objectSpread2$2(_objectSpread2$2({}, ori), {}, {
|
|
5581
5830
|
ready: !1
|
|
5582
5831
|
});
|
|
5583
5832
|
});
|
|
@@ -5614,9 +5863,9 @@ function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable,
|
|
|
5614
5863
|
var openRef = React$6.useRef(open);
|
|
5615
5864
|
openRef.current = open, React$6.useEffect(function() {
|
|
5616
5865
|
if (clickToHide && popupEle && (!mask || maskClosable)) {
|
|
5617
|
-
var onTriggerClose = /* @__PURE__ */ __name(function(
|
|
5618
|
-
var
|
|
5619
|
-
openRef.current && !inPopupOrChild(target) && triggerOpen(!1);
|
|
5866
|
+
var onTriggerClose = /* @__PURE__ */ __name(function(e2) {
|
|
5867
|
+
var _e$composedPath;
|
|
5868
|
+
openRef.current && !inPopupOrChild(((_e$composedPath = e2.composedPath) === null || _e$composedPath === void 0 || (_e$composedPath = _e$composedPath.call(e2)) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath[0]) || e2.target) && triggerOpen(!1);
|
|
5620
5869
|
}, "onTriggerClose2"), win = getWin(popupEle);
|
|
5621
5870
|
win.addEventListener("mousedown", onTriggerClose, !0), win.addEventListener("contextmenu", onTriggerClose, !0);
|
|
5622
5871
|
var targetShadowRoot = getShadowRoot(targetEle);
|
|
@@ -5630,7 +5879,7 @@ __name(useWinClick, "useWinClick");
|
|
|
5630
5879
|
var _excluded$v = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "fresh", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
|
|
5631
5880
|
function generateTrigger() {
|
|
5632
5881
|
var PortalComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Portal, Trigger2 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
5633
|
-
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-trigger-popup" : _props$prefixCls, children = props.children, _props$action = props.action, action = _props$action === void 0 ? "hover" : _props$action, showAction = props.showAction, hideAction = props.hideAction, popupVisible = props.popupVisible, defaultPopupVisible = props.defaultPopupVisible, onPopupVisibleChange = props.onPopupVisibleChange, afterPopupVisibleChange = props.afterPopupVisibleChange, mouseEnterDelay = props.mouseEnterDelay, _props$mouseLeaveDela = props.mouseLeaveDelay, mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela, focusDelay = props.focusDelay, blurDelay = props.blurDelay, mask = props.mask, _props$maskClosable = props.maskClosable, maskClosable = _props$maskClosable === void 0 ? !0 : _props$maskClosable, getPopupContainer = props.getPopupContainer, forceRender = props.forceRender, autoDestroy = props.autoDestroy, destroyPopupOnHide = props.destroyPopupOnHide, popup2 = props.popup, popupClassName = props.popupClassName, popupStyle = props.popupStyle, popupPlacement = props.popupPlacement, _props$builtinPlaceme = props.builtinPlacements, builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme, popupAlign = props.popupAlign, zIndex = props.zIndex, stretch = props.stretch, getPopupClassNameFromAlign = props.getPopupClassNameFromAlign, fresh = props.fresh, alignPoint = props.alignPoint, onPopupClick = props.onPopupClick, onPopupAlign = props.onPopupAlign, arrow = props.arrow, popupMotion = props.popupMotion, maskMotion = props.maskMotion, popupTransitionName = props.popupTransitionName, popupAnimation = props.popupAnimation, maskTransitionName = props.maskTransitionName, maskAnimation = props.maskAnimation, className = props.className, getTriggerDOMNode = props.getTriggerDOMNode, restProps = _objectWithoutProperties$
|
|
5882
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-trigger-popup" : _props$prefixCls, children = props.children, _props$action = props.action, action = _props$action === void 0 ? "hover" : _props$action, showAction = props.showAction, hideAction = props.hideAction, popupVisible = props.popupVisible, defaultPopupVisible = props.defaultPopupVisible, onPopupVisibleChange = props.onPopupVisibleChange, afterPopupVisibleChange = props.afterPopupVisibleChange, mouseEnterDelay = props.mouseEnterDelay, _props$mouseLeaveDela = props.mouseLeaveDelay, mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela, focusDelay = props.focusDelay, blurDelay = props.blurDelay, mask = props.mask, _props$maskClosable = props.maskClosable, maskClosable = _props$maskClosable === void 0 ? !0 : _props$maskClosable, getPopupContainer = props.getPopupContainer, forceRender = props.forceRender, autoDestroy = props.autoDestroy, destroyPopupOnHide = props.destroyPopupOnHide, popup2 = props.popup, popupClassName = props.popupClassName, popupStyle = props.popupStyle, popupPlacement = props.popupPlacement, _props$builtinPlaceme = props.builtinPlacements, builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme, popupAlign = props.popupAlign, zIndex = props.zIndex, stretch = props.stretch, getPopupClassNameFromAlign = props.getPopupClassNameFromAlign, fresh = props.fresh, alignPoint = props.alignPoint, onPopupClick = props.onPopupClick, onPopupAlign = props.onPopupAlign, arrow = props.arrow, popupMotion = props.popupMotion, maskMotion = props.maskMotion, popupTransitionName = props.popupTransitionName, popupAnimation = props.popupAnimation, maskTransitionName = props.maskTransitionName, maskAnimation = props.maskAnimation, className = props.className, getTriggerDOMNode = props.getTriggerDOMNode, restProps = _objectWithoutProperties$2(props, _excluded$v), mergedAutoDestroy = autoDestroy || destroyPopupOnHide || !1, _React$useState = React$6.useState(!1), _React$useState2 = _slicedToArray$2(_React$useState, 2), mobile = _React$useState2[0], setMobile = _React$useState2[1];
|
|
5634
5883
|
useLayoutEffect$1(function() {
|
|
5635
5884
|
setMobile(isMobile());
|
|
5636
5885
|
}, []);
|
|
@@ -5640,16 +5889,16 @@ function generateTrigger() {
|
|
|
5640
5889
|
subPopupElements.current[id2] = subPopupEle, parentContext == null || parentContext.registerSubPopup(id2, subPopupEle);
|
|
5641
5890
|
}, "registerSubPopup")
|
|
5642
5891
|
};
|
|
5643
|
-
}, [parentContext]), id = useId$1(), _React$useState3 = React$6.useState(null), _React$useState4 = _slicedToArray$
|
|
5892
|
+
}, [parentContext]), id = useId$1(), _React$useState3 = React$6.useState(null), _React$useState4 = _slicedToArray$2(_React$useState3, 2), popupEle = _React$useState4[0], setPopupEle = _React$useState4[1], externalPopupRef = React$6.useRef(null), setPopupRef = useEvent(function(node) {
|
|
5644
5893
|
externalPopupRef.current = node, isDOM(node) && popupEle !== node && setPopupEle(node), parentContext == null || parentContext.registerSubPopup(id, node);
|
|
5645
|
-
}), _React$useState5 = React$6.useState(null), _React$useState6 = _slicedToArray$
|
|
5894
|
+
}), _React$useState5 = React$6.useState(null), _React$useState6 = _slicedToArray$2(_React$useState5, 2), targetEle = _React$useState6[0], setTargetEle = _React$useState6[1], externalForwardRef = React$6.useRef(null), setTargetRef = useEvent(function(node) {
|
|
5646
5895
|
isDOM(node) && targetEle !== node && (setTargetEle(node), externalForwardRef.current = node);
|
|
5647
5896
|
}), child = React$6.Children.only(children), originChildProps = (child == null ? void 0 : child.props) || {}, cloneProps = {}, inPopupOrChild = useEvent(function(ele) {
|
|
5648
5897
|
var _getShadowRoot, _getShadowRoot2, childDOM = targetEle;
|
|
5649
5898
|
return (childDOM == null ? void 0 : childDOM.contains(ele)) || ((_getShadowRoot = getShadowRoot(childDOM)) === null || _getShadowRoot === void 0 ? void 0 : _getShadowRoot.host) === ele || ele === childDOM || (popupEle == null ? void 0 : popupEle.contains(ele)) || ((_getShadowRoot2 = getShadowRoot(popupEle)) === null || _getShadowRoot2 === void 0 ? void 0 : _getShadowRoot2.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function(subPopupEle) {
|
|
5650
5899
|
return (subPopupEle == null ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;
|
|
5651
5900
|
});
|
|
5652
|
-
}), mergePopupMotion = getMotion$1(prefixCls, popupMotion, popupAnimation, popupTransitionName), mergeMaskMotion = getMotion$1(prefixCls, maskMotion, maskAnimation, maskTransitionName), _React$useState7 = React$6.useState(defaultPopupVisible || !1), _React$useState8 = _slicedToArray$
|
|
5901
|
+
}), mergePopupMotion = getMotion$1(prefixCls, popupMotion, popupAnimation, popupTransitionName), mergeMaskMotion = getMotion$1(prefixCls, maskMotion, maskAnimation, maskTransitionName), _React$useState7 = React$6.useState(defaultPopupVisible || !1), _React$useState8 = _slicedToArray$2(_React$useState7, 2), internalOpen = _React$useState8[0], setInternalOpen = _React$useState8[1], mergedOpen = popupVisible != null ? popupVisible : internalOpen, setMergedOpen = useEvent(function(nextOpen) {
|
|
5653
5902
|
popupVisible === void 0 && setInternalOpen(nextOpen);
|
|
5654
5903
|
});
|
|
5655
5904
|
useLayoutEffect$1(function() {
|
|
@@ -5673,13 +5922,13 @@ function generateTrigger() {
|
|
|
5673
5922
|
React$6.useEffect(function() {
|
|
5674
5923
|
return clearDelay;
|
|
5675
5924
|
}, []);
|
|
5676
|
-
var _React$useState9 = React$6.useState(!1), _React$useState10 = _slicedToArray$
|
|
5925
|
+
var _React$useState9 = React$6.useState(!1), _React$useState10 = _slicedToArray$2(_React$useState9, 2), inMotion = _React$useState10[0], setInMotion = _React$useState10[1];
|
|
5677
5926
|
useLayoutEffect$1(function(firstMount) {
|
|
5678
5927
|
(!firstMount || mergedOpen) && setInMotion(!0);
|
|
5679
5928
|
}, [mergedOpen]);
|
|
5680
|
-
var _React$useState11 = React$6.useState(null), _React$useState12 = _slicedToArray$
|
|
5929
|
+
var _React$useState11 = React$6.useState(null), _React$useState12 = _slicedToArray$2(_React$useState11, 2), motionPrepareResolve = _React$useState12[0], setMotionPrepareResolve = _React$useState12[1], _React$useState13 = React$6.useState([0, 0]), _React$useState14 = _slicedToArray$2(_React$useState13, 2), mousePos = _React$useState14[0], setMousePos = _React$useState14[1], setMousePosByEvent = /* @__PURE__ */ __name(function(event) {
|
|
5681
5930
|
setMousePos([event.clientX, event.clientY]);
|
|
5682
|
-
}, "setMousePosByEvent2"), _useAlign = useAlign(mergedOpen, popupEle, alignPoint ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign), _useAlign2 = _slicedToArray$
|
|
5931
|
+
}, "setMousePosByEvent2"), _useAlign = useAlign(mergedOpen, popupEle, alignPoint ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign), _useAlign2 = _slicedToArray$2(_useAlign, 11), ready = _useAlign2[0], offsetX = _useAlign2[1], offsetY = _useAlign2[2], offsetR = _useAlign2[3], offsetB = _useAlign2[4], arrowX = _useAlign2[5], arrowY = _useAlign2[6], scaleX = _useAlign2[7], scaleY = _useAlign2[8], alignInfo = _useAlign2[9], onAlign = _useAlign2[10], _useAction = useAction(mobile, action, showAction, hideAction), _useAction2 = _slicedToArray$2(_useAction, 2), showActions = _useAction2[0], hideActions = _useAction2[1], clickToShow = showActions.has("click"), clickToHide = hideActions.has("click") || hideActions.has("contextMenu"), triggerAlign = useEvent(function() {
|
|
5683
5932
|
inMotion || onAlign();
|
|
5684
5933
|
}), onScroll = /* @__PURE__ */ __name(function() {
|
|
5685
5934
|
openRef.current && alignPoint && clickToHide && triggerOpen(!1);
|
|
@@ -5700,7 +5949,7 @@ function generateTrigger() {
|
|
|
5700
5949
|
forceAlign: triggerAlign
|
|
5701
5950
|
};
|
|
5702
5951
|
});
|
|
5703
|
-
var _React$useState15 = React$6.useState(0), _React$useState16 = _slicedToArray$
|
|
5952
|
+
var _React$useState15 = React$6.useState(0), _React$useState16 = _slicedToArray$2(_React$useState15, 2), targetWidth = _React$useState16[0], setTargetWidth = _React$useState16[1], _React$useState17 = React$6.useState(0), _React$useState18 = _slicedToArray$2(_React$useState17, 2), targetHeight = _React$useState18[0], setTargetHeight = _React$useState18[1], syncTargetSize = /* @__PURE__ */ __name(function() {
|
|
5704
5953
|
if (stretch && targetEle) {
|
|
5705
5954
|
var rect = targetEle.getBoundingClientRect();
|
|
5706
5955
|
setTargetWidth(rect.width), setTargetHeight(rect.height);
|
|
@@ -5754,7 +6003,7 @@ function generateTrigger() {
|
|
|
5754
6003
|
args[_key3 - 1] = arguments[_key3];
|
|
5755
6004
|
(_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 || _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));
|
|
5756
6005
|
}), className && (cloneProps.className = clsx(originChildProps.className, className));
|
|
5757
|
-
var mergedChildrenProps = _objectSpread2$
|
|
6006
|
+
var mergedChildrenProps = _objectSpread2$2(_objectSpread2$2({}, originChildProps), cloneProps), passedProps = {}, passedEventList = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
|
|
5758
6007
|
passedEventList.forEach(function(eventName) {
|
|
5759
6008
|
restProps[eventName] && (passedProps[eventName] = function() {
|
|
5760
6009
|
for (var _mergedChildrenProps$, _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++)
|
|
@@ -5762,10 +6011,10 @@ function generateTrigger() {
|
|
|
5762
6011
|
(_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 || _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args)), restProps[eventName].apply(restProps, args);
|
|
5763
6012
|
});
|
|
5764
6013
|
});
|
|
5765
|
-
var triggerNode = /* @__PURE__ */ React$6.cloneElement(child, _objectSpread2$
|
|
6014
|
+
var triggerNode = /* @__PURE__ */ React$6.cloneElement(child, _objectSpread2$2(_objectSpread2$2({}, mergedChildrenProps), passedProps)), arrowPos = {
|
|
5766
6015
|
x: arrowX,
|
|
5767
6016
|
y: arrowY
|
|
5768
|
-
}, innerArrow = arrow ? _objectSpread2$
|
|
6017
|
+
}, innerArrow = arrow ? _objectSpread2$2({}, arrow !== !0 ? arrow : {}) : null;
|
|
5769
6018
|
return /* @__PURE__ */ React$6.createElement(React$6.Fragment, null, /* @__PURE__ */ React$6.createElement(RefResizeObserver, {
|
|
5770
6019
|
disabled: !mergedOpen,
|
|
5771
6020
|
ref: setTargetRef,
|
|
@@ -5873,7 +6122,7 @@ function PickerTrigger(_ref) {
|
|
|
5873
6122
|
popup: popupElement,
|
|
5874
6123
|
popupAlign,
|
|
5875
6124
|
popupVisible: visible,
|
|
5876
|
-
popupClassName: clsx(popupClassName, _defineProperty$
|
|
6125
|
+
popupClassName: clsx(popupClassName, _defineProperty$c(_defineProperty$c({}, "".concat(dropdownPrefixCls, "-range"), range), "".concat(dropdownPrefixCls, "-rtl"), direction === "rtl")),
|
|
5877
6126
|
popupStyle,
|
|
5878
6127
|
stretch: "minWidth",
|
|
5879
6128
|
getPopupContainer,
|
|
@@ -5937,7 +6186,7 @@ function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
|
5937
6186
|
return dateRender && info.type === "date" ? dateRender(date, info.today) : monthCellRender && info.type === "month" ? monthCellRender(date, info.locale) : info.originNode;
|
|
5938
6187
|
};
|
|
5939
6188
|
}, [cellRender, monthCellRender, dateRender]), onInternalCellRender = React$6.useCallback(function(date, info) {
|
|
5940
|
-
return mergedCellRender(date, _objectSpread2$
|
|
6189
|
+
return mergedCellRender(date, _objectSpread2$2(_objectSpread2$2({}, info), {}, {
|
|
5941
6190
|
range
|
|
5942
6191
|
}));
|
|
5943
6192
|
}, [mergedCellRender, range]);
|
|
@@ -5945,7 +6194,7 @@ function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
|
5945
6194
|
}
|
|
5946
6195
|
__name(useCellRender, "useCellRender");
|
|
5947
6196
|
function useFieldsInvalidate(calendarValue, isInvalidateDate) {
|
|
5948
|
-
var allowEmpty = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], _React$useState = React$6.useState([!1, !1]), _React$useState2 = _slicedToArray$
|
|
6197
|
+
var allowEmpty = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], _React$useState = React$6.useState([!1, !1]), _React$useState2 = _slicedToArray$2(_React$useState, 2), fieldsInvalidates = _React$useState2[0], setFieldsInvalidates = _React$useState2[1], onSelectorInvalid = /* @__PURE__ */ __name(function(invalid, index2) {
|
|
5949
6198
|
setFieldsInvalidates(function(ori) {
|
|
5950
6199
|
return fillIndex(ori, index2, invalid);
|
|
5951
6200
|
});
|
|
@@ -5969,7 +6218,7 @@ function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showM
|
|
|
5969
6218
|
__name(fillTimeFormat, "fillTimeFormat");
|
|
5970
6219
|
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
|
|
5971
6220
|
var fieldDateTimeFormat = locale.fieldDateTimeFormat, fieldDateFormat = locale.fieldDateFormat, fieldTimeFormat = locale.fieldTimeFormat, fieldMonthFormat = locale.fieldMonthFormat, fieldYearFormat = locale.fieldYearFormat, fieldWeekFormat = locale.fieldWeekFormat, fieldQuarterFormat = locale.fieldQuarterFormat, yearFormat = locale.yearFormat, cellYearFormat = locale.cellYearFormat, cellQuarterFormat = locale.cellQuarterFormat, dayFormat = locale.dayFormat, cellDateFormat = locale.cellDateFormat, timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
|
|
5972
|
-
return _objectSpread2$
|
|
6221
|
+
return _objectSpread2$2(_objectSpread2$2({}, locale), {}, {
|
|
5973
6222
|
fieldDateTimeFormat: fieldDateTimeFormat || "YYYY-MM-DD ".concat(timeFormat),
|
|
5974
6223
|
fieldDateFormat: fieldDateFormat || "YYYY-MM-DD",
|
|
5975
6224
|
fieldTimeFormat: fieldTimeFormat || timeFormat,
|
|
@@ -6021,7 +6270,7 @@ var showTimeKeys = [
|
|
|
6021
6270
|
];
|
|
6022
6271
|
function pickTimeProps(props) {
|
|
6023
6272
|
var timeProps = pickProps(props, showTimeKeys), format2 = props.format, picker = props.picker, propFormat = null;
|
|
6024
|
-
return format2 && (propFormat = format2, Array.isArray(propFormat) && (propFormat = propFormat[0]), propFormat = _typeof$
|
|
6273
|
+
return format2 && (propFormat = format2, Array.isArray(propFormat) && (propFormat = propFormat[0]), propFormat = _typeof$3(propFormat) === "object" ? propFormat.format : propFormat), picker === "time" && (timeProps.format = propFormat), [timeProps, propFormat];
|
|
6025
6274
|
}
|
|
6026
6275
|
__name(pickTimeProps, "pickTimeProps");
|
|
6027
6276
|
function isStringFormat(format2) {
|
|
@@ -6050,10 +6299,10 @@ function fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMil
|
|
|
6050
6299
|
}
|
|
6051
6300
|
__name(fillShowConfig, "fillShowConfig");
|
|
6052
6301
|
function getTimeProps(componentProps) {
|
|
6053
|
-
var showTime = componentProps.showTime, _pickTimeProps = pickTimeProps(componentProps), _pickTimeProps2 = _slicedToArray$
|
|
6302
|
+
var showTime = componentProps.showTime, _pickTimeProps = pickTimeProps(componentProps), _pickTimeProps2 = _slicedToArray$2(_pickTimeProps, 2), pickedProps = _pickTimeProps2[0], propFormat = _pickTimeProps2[1], showTimeConfig = showTime && _typeof$3(showTime) === "object" ? showTime : {}, timeConfig = _objectSpread2$2(_objectSpread2$2({
|
|
6054
6303
|
defaultOpenValue: showTimeConfig.defaultOpenValue || showTimeConfig.defaultValue
|
|
6055
|
-
}, pickedProps), showTimeConfig), showMillisecond = timeConfig.showMillisecond, showHour = timeConfig.showHour, showMinute = timeConfig.showMinute, showSecond = timeConfig.showSecond, hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond), _fillShowConfig = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig2 = _slicedToArray$
|
|
6056
|
-
return showHour = _fillShowConfig2[0], showMinute = _fillShowConfig2[1], showSecond = _fillShowConfig2[2], [timeConfig, _objectSpread2$
|
|
6304
|
+
}, pickedProps), showTimeConfig), showMillisecond = timeConfig.showMillisecond, showHour = timeConfig.showHour, showMinute = timeConfig.showMinute, showSecond = timeConfig.showSecond, hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond), _fillShowConfig = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig2 = _slicedToArray$2(_fillShowConfig, 3);
|
|
6305
|
+
return showHour = _fillShowConfig2[0], showMinute = _fillShowConfig2[1], showSecond = _fillShowConfig2[2], [timeConfig, _objectSpread2$2(_objectSpread2$2({}, timeConfig), {}, {
|
|
6057
6306
|
showHour,
|
|
6058
6307
|
showMinute,
|
|
6059
6308
|
showSecond,
|
|
@@ -6073,10 +6322,10 @@ function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, loca
|
|
|
6073
6322
|
}
|
|
6074
6323
|
var showHour = pickedProps.showHour, showMinute = pickedProps.showMinute, showSecond = pickedProps.showSecond, showMillisecond = pickedProps.showMillisecond, use12Hours = pickedProps.use12Hours, showMeridiem = checkShow(baselineFormat, ["a", "A", "LT", "LLL", "LTS"], use12Hours), hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
|
|
6075
6324
|
hasShowConfig || (showHour = checkShow(baselineFormat, ["H", "h", "k", "LT", "LLL"]), showMinute = checkShow(baselineFormat, ["m", "LT", "LLL"]), showSecond = checkShow(baselineFormat, ["s", "LTS"]), showMillisecond = checkShow(baselineFormat, ["SSS"]));
|
|
6076
|
-
var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig4 = _slicedToArray$
|
|
6325
|
+
var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig4 = _slicedToArray$2(_fillShowConfig3, 3);
|
|
6077
6326
|
showHour = _fillShowConfig4[0], showMinute = _fillShowConfig4[1], showSecond = _fillShowConfig4[2];
|
|
6078
6327
|
var timeFormat = showTimeFormat || fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem);
|
|
6079
|
-
return _objectSpread2$
|
|
6328
|
+
return _objectSpread2$2(_objectSpread2$2({}, pickedProps), {}, {
|
|
6080
6329
|
// Format
|
|
6081
6330
|
format: timeFormat,
|
|
6082
6331
|
// Show Config
|
|
@@ -6093,7 +6342,7 @@ __name(fillShowTimeConfig, "fillShowTimeConfig");
|
|
|
6093
6342
|
function fillClearIcon(prefixCls, allowClear, clearIcon) {
|
|
6094
6343
|
if (allowClear === !1)
|
|
6095
6344
|
return null;
|
|
6096
|
-
var config2 = allowClear && _typeof$
|
|
6345
|
+
var config2 = allowClear && _typeof$3(allowClear) === "object" ? allowClear : {};
|
|
6097
6346
|
return config2.clearIcon || clearIcon || /* @__PURE__ */ React$6.createElement("span", {
|
|
6098
6347
|
className: "".concat(prefixCls, "-clear-btn")
|
|
6099
6348
|
});
|
|
@@ -6214,7 +6463,7 @@ function useDisabledBoundary(generateConfig2, locale, disabledDate, minDate, max
|
|
|
6214
6463
|
__name(useDisabledBoundary, "useDisabledBoundary");
|
|
6215
6464
|
function useFieldFormat(picker, locale, format2) {
|
|
6216
6465
|
return React$6.useMemo(function() {
|
|
6217
|
-
var rawFormat = getRowFormat(picker, locale, format2), formatList = toArray$1(rawFormat), firstFormat = formatList[0], maskFormat = _typeof$
|
|
6466
|
+
var rawFormat = getRowFormat(picker, locale, format2), formatList = toArray$1(rawFormat), firstFormat = formatList[0], maskFormat = _typeof$3(firstFormat) === "object" && firstFormat.type === "mask" ? firstFormat.format : null;
|
|
6218
6467
|
return [
|
|
6219
6468
|
// Format list
|
|
6220
6469
|
formatList.map(function(config2) {
|
|
@@ -6232,7 +6481,7 @@ function useInputReadOnly(formatList, inputReadOnly, multiple) {
|
|
|
6232
6481
|
__name(useInputReadOnly, "useInputReadOnly");
|
|
6233
6482
|
function useInvalidate(generateConfig2, picker, disabledDate, showTime) {
|
|
6234
6483
|
var isInvalidate = useEvent(function(date, info) {
|
|
6235
|
-
var outsideInfo = _objectSpread2$
|
|
6484
|
+
var outsideInfo = _objectSpread2$2({
|
|
6236
6485
|
type: picker
|
|
6237
6486
|
}, info);
|
|
6238
6487
|
if (delete outsideInfo.activeIndex, // Date object is invalid
|
|
@@ -6260,17 +6509,17 @@ function useList(value) {
|
|
|
6260
6509
|
}
|
|
6261
6510
|
__name(useList, "useList");
|
|
6262
6511
|
function useFilledProps(props, updater) {
|
|
6263
|
-
var generateConfig2 = props.generateConfig, locale = props.locale, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, _props$styles = props.styles, styles2 = _props$styles === void 0 ? {} : _props$styles, _props$classNames = props.classNames, classNames = _props$classNames === void 0 ? {} : _props$classNames, _props$order = props.order, order = _props$order === void 0 ? !0 : _props$order, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, inputRender = props.inputRender, allowClear = props.allowClear, clearIcon = props.clearIcon, needConfirm = props.needConfirm, multiple = props.multiple, format2 = props.format, inputReadOnly = props.inputReadOnly, disabledDate = props.disabledDate, minDate = props.minDate, maxDate = props.maxDate, showTime = props.showTime, value = props.value, defaultValue = props.defaultValue, pickerValue = props.pickerValue, defaultPickerValue = props.defaultPickerValue, values3 = useList(value), defaultValues = useList(defaultValue), pickerValues = useList(pickerValue), defaultPickerValues = useList(defaultPickerValue), internalPicker = picker === "date" && showTime ? "datetime" : picker, multipleInteractivePicker = internalPicker === "time" || internalPicker === "datetime", complexPicker = multipleInteractivePicker || multiple, mergedNeedConfirm = needConfirm != null ? needConfirm : multipleInteractivePicker, _getTimeProps = getTimeProps(props), _getTimeProps2 = _slicedToArray$
|
|
6512
|
+
var generateConfig2 = props.generateConfig, locale = props.locale, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, _props$styles = props.styles, styles2 = _props$styles === void 0 ? {} : _props$styles, _props$classNames = props.classNames, classNames = _props$classNames === void 0 ? {} : _props$classNames, _props$order = props.order, order = _props$order === void 0 ? !0 : _props$order, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, inputRender = props.inputRender, allowClear = props.allowClear, clearIcon = props.clearIcon, needConfirm = props.needConfirm, multiple = props.multiple, format2 = props.format, inputReadOnly = props.inputReadOnly, disabledDate = props.disabledDate, minDate = props.minDate, maxDate = props.maxDate, showTime = props.showTime, value = props.value, defaultValue = props.defaultValue, pickerValue = props.pickerValue, defaultPickerValue = props.defaultPickerValue, values3 = useList(value), defaultValues = useList(defaultValue), pickerValues = useList(pickerValue), defaultPickerValues = useList(defaultPickerValue), internalPicker = picker === "date" && showTime ? "datetime" : picker, multipleInteractivePicker = internalPicker === "time" || internalPicker === "datetime", complexPicker = multipleInteractivePicker || multiple, mergedNeedConfirm = needConfirm != null ? needConfirm : multipleInteractivePicker, _getTimeProps = getTimeProps(props), _getTimeProps2 = _slicedToArray$2(_getTimeProps, 4), timeProps = _getTimeProps2[0], localeTimeProps = _getTimeProps2[1], showTimeFormat = _getTimeProps2[2], propFormat = _getTimeProps2[3], mergedLocale = useLocale(locale, localeTimeProps), mergedShowTime = React$6.useMemo(function() {
|
|
6264
6513
|
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale);
|
|
6265
6514
|
}, [internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale]), filledProps = React$6.useMemo(function() {
|
|
6266
|
-
return _objectSpread2$
|
|
6515
|
+
return _objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
6267
6516
|
prefixCls,
|
|
6268
6517
|
locale: mergedLocale,
|
|
6269
6518
|
picker,
|
|
6270
6519
|
styles: styles2,
|
|
6271
6520
|
classNames,
|
|
6272
6521
|
order,
|
|
6273
|
-
components: _objectSpread2$
|
|
6522
|
+
components: _objectSpread2$2({
|
|
6274
6523
|
input: inputRender
|
|
6275
6524
|
}, components),
|
|
6276
6525
|
clearIcon: fillClearIcon(prefixCls, allowClear, clearIcon),
|
|
@@ -6280,8 +6529,8 @@ function useFilledProps(props, updater) {
|
|
|
6280
6529
|
pickerValue: pickerValues,
|
|
6281
6530
|
defaultPickerValue: defaultPickerValues
|
|
6282
6531
|
}, void 0);
|
|
6283
|
-
}, [props]), _useFieldFormat = useFieldFormat(internalPicker, mergedLocale, format2), _useFieldFormat2 = _slicedToArray$
|
|
6284
|
-
return _objectSpread2$
|
|
6532
|
+
}, [props]), _useFieldFormat = useFieldFormat(internalPicker, mergedLocale, format2), _useFieldFormat2 = _slicedToArray$2(_useFieldFormat, 2), formatList = _useFieldFormat2[0], maskFormat = _useFieldFormat2[1], mergedInputReadOnly = useInputReadOnly(formatList, inputReadOnly, multiple), disabledBoundaryDate = useDisabledBoundary(generateConfig2, locale, disabledDate, minDate, maxDate), isInvalidateDate = useInvalidate(generateConfig2, picker, disabledBoundaryDate, mergedShowTime), mergedProps = React$6.useMemo(function() {
|
|
6533
|
+
return _objectSpread2$2(_objectSpread2$2({}, filledProps), {}, {
|
|
6285
6534
|
needConfirm: mergedNeedConfirm,
|
|
6286
6535
|
inputReadOnly: mergedInputReadOnly,
|
|
6287
6536
|
disabledDate: disabledBoundaryDate
|
|
@@ -6293,7 +6542,7 @@ __name(useFilledProps, "useFilledProps");
|
|
|
6293
6542
|
function useDelayState(value, defaultValue, onChange) {
|
|
6294
6543
|
var _useMergedState = useMergedState(defaultValue, {
|
|
6295
6544
|
value
|
|
6296
|
-
}), _useMergedState2 = _slicedToArray$
|
|
6545
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), state = _useMergedState2[0], setState = _useMergedState2[1], nextValueRef = React__default.useRef(value), rafRef = React__default.useRef(), cancelRaf = /* @__PURE__ */ __name(function() {
|
|
6297
6546
|
wrapperRaf.cancel(rafRef.current);
|
|
6298
6547
|
}, "cancelRaf"), doUpdate = useEvent(function() {
|
|
6299
6548
|
setState(nextValueRef.current), onChange && state !== nextValueRef.current && onChange(nextValueRef.current);
|
|
@@ -6308,7 +6557,7 @@ __name(useDelayState, "useDelayState");
|
|
|
6308
6557
|
function useOpen(open, defaultOpen) {
|
|
6309
6558
|
var disabledList = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], onOpenChange = arguments.length > 3 ? arguments[3] : void 0, mergedOpen = disabledList.every(function(disabled) {
|
|
6310
6559
|
return disabled;
|
|
6311
|
-
}) ? !1 : open, _useDelayState = useDelayState(mergedOpen, defaultOpen || !1, onOpenChange), _useDelayState2 = _slicedToArray$
|
|
6560
|
+
}) ? !1 : open, _useDelayState = useDelayState(mergedOpen, defaultOpen || !1, onOpenChange), _useDelayState2 = _slicedToArray$2(_useDelayState, 2), rafOpen = _useDelayState2[0], setRafOpen = _useDelayState2[1];
|
|
6312
6561
|
function setOpen(next) {
|
|
6313
6562
|
var config2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6314
6563
|
(!config2.inherit || rafOpen) && setRafOpen(next, config2.force);
|
|
@@ -6357,7 +6606,7 @@ function useLockEffect(condition, callback) {
|
|
|
6357
6606
|
}
|
|
6358
6607
|
__name(useLockEffect, "useLockEffect");
|
|
6359
6608
|
function useRangeActive(disabled) {
|
|
6360
|
-
var empty = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], mergedOpen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, _React$useState = React$6.useState(0), _React$useState2 = _slicedToArray$
|
|
6609
|
+
var empty = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], mergedOpen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, _React$useState = React$6.useState(0), _React$useState2 = _slicedToArray$2(_React$useState, 2), activeIndex = _React$useState2[0], setActiveIndex = _React$useState2[1], _React$useState3 = React$6.useState(!1), _React$useState4 = _slicedToArray$2(_React$useState3, 2), focused = _React$useState4[0], setFocused = _React$useState4[1], activeListRef = React$6.useRef([]), lastOperationRef = React$6.useRef(null), triggerFocus2 = /* @__PURE__ */ __name(function(nextFocus) {
|
|
6361
6610
|
setFocused(nextFocus);
|
|
6362
6611
|
}, "triggerFocus"), lastOperation = /* @__PURE__ */ __name(function(type2) {
|
|
6363
6612
|
return type2 && (lastOperationRef.current = type2), lastOperationRef.current;
|
|
@@ -6396,15 +6645,15 @@ function useRangePickerValue(generateConfig2, locale, calendarValue, modes, open
|
|
|
6396
6645
|
var defaultPickerValue = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : EMPTY_LIST$1, pickerValue = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : EMPTY_LIST$1, timeDefaultValue = arguments.length > 10 && arguments[10] !== void 0 ? arguments[10] : EMPTY_LIST$1, onPickerValueChange = arguments.length > 11 ? arguments[11] : void 0, minDate = arguments.length > 12 ? arguments[12] : void 0, maxDate = arguments.length > 13 ? arguments[13] : void 0, isTimePicker = pickerMode === "time", mergedActiveIndex = activeIndex || 0, getDefaultPickerValue = /* @__PURE__ */ __name(function(index2) {
|
|
6397
6646
|
var now = generateConfig2.getNow();
|
|
6398
6647
|
return isTimePicker && (now = fillTime(generateConfig2, now)), defaultPickerValue[index2] || calendarValue[index2] || now;
|
|
6399
|
-
}, "getDefaultPickerValue"), _pickerValue = _slicedToArray$
|
|
6648
|
+
}, "getDefaultPickerValue"), _pickerValue = _slicedToArray$2(pickerValue, 2), startPickerValue = _pickerValue[0], endPickerValue = _pickerValue[1], _useMergedState = useMergedState(function() {
|
|
6400
6649
|
return getDefaultPickerValue(0);
|
|
6401
6650
|
}, {
|
|
6402
6651
|
value: startPickerValue
|
|
6403
|
-
}), _useMergedState2 = _slicedToArray$
|
|
6652
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedStartPickerValue = _useMergedState2[0], setStartPickerValue = _useMergedState2[1], _useMergedState3 = useMergedState(function() {
|
|
6404
6653
|
return getDefaultPickerValue(1);
|
|
6405
6654
|
}, {
|
|
6406
6655
|
value: endPickerValue
|
|
6407
|
-
}), _useMergedState4 = _slicedToArray$
|
|
6656
|
+
}), _useMergedState4 = _slicedToArray$2(_useMergedState3, 2), mergedEndPickerValue = _useMergedState4[0], setEndPickerValue = _useMergedState4[1], currentPickerValue = React$6.useMemo(function() {
|
|
6408
6657
|
var current = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex];
|
|
6409
6658
|
return isTimePicker ? current : fillTime(generateConfig2, current, timeDefaultValue[mergedActiveIndex]);
|
|
6410
6659
|
}, [isTimePicker, mergedStartPickerValue, mergedEndPickerValue, mergedActiveIndex, generateConfig2, timeDefaultValue]), setCurrentPickerValue = /* @__PURE__ */ __name(function(nextPickerValue) {
|
|
@@ -6436,7 +6685,7 @@ function useRangePickerValue(generateConfig2, locale, calendarValue, modes, open
|
|
|
6436
6685
|
}
|
|
6437
6686
|
__name(useRangePickerValue, "useRangePickerValue");
|
|
6438
6687
|
function useSyncState(defaultValue, controlledValue) {
|
|
6439
|
-
var valueRef = React$6.useRef(defaultValue), _React$useState = React$6.useState({}), _React$useState2 = _slicedToArray$
|
|
6688
|
+
var valueRef = React$6.useRef(defaultValue), _React$useState = React$6.useState({}), _React$useState2 = _slicedToArray$2(_React$useState, 2), forceUpdate = _React$useState2[1], getter = /* @__PURE__ */ __name(function(useControlledValueFirst) {
|
|
6440
6689
|
return useControlledValueFirst && controlledValue !== void 0 ? controlledValue : valueRef.current;
|
|
6441
6690
|
}, "getter"), setter = /* @__PURE__ */ __name(function(nextValue) {
|
|
6442
6691
|
valueRef.current = nextValue, forceUpdate({});
|
|
@@ -6474,7 +6723,7 @@ function orderDates(dates, generateConfig2) {
|
|
|
6474
6723
|
}
|
|
6475
6724
|
__name(orderDates, "orderDates");
|
|
6476
6725
|
function useCalendarValue(mergedValue) {
|
|
6477
|
-
var _useSyncState = useSyncState(mergedValue), _useSyncState2 = _slicedToArray$
|
|
6726
|
+
var _useSyncState = useSyncState(mergedValue), _useSyncState2 = _slicedToArray$2(_useSyncState, 2), calendarValue = _useSyncState2[0], setCalendarValue = _useSyncState2[1], syncWithValue = useEvent(function() {
|
|
6478
6727
|
setCalendarValue(mergedValue);
|
|
6479
6728
|
});
|
|
6480
6729
|
return React$6.useEffect(function() {
|
|
@@ -6485,12 +6734,12 @@ __name(useCalendarValue, "useCalendarValue");
|
|
|
6485
6734
|
function useInnerValue(generateConfig2, locale, formatList, rangeValue, order, defaultValue, value, onCalendarChange, onOk) {
|
|
6486
6735
|
var _useMergedState = useMergedState(defaultValue, {
|
|
6487
6736
|
value
|
|
6488
|
-
}), _useMergedState2 = _slicedToArray$
|
|
6737
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), innerValue = _useMergedState2[0], setInnerValue = _useMergedState2[1], mergedValue = innerValue || EMPTY_VALUE, _useCalendarValue = useCalendarValue(mergedValue), _useCalendarValue2 = _slicedToArray$2(_useCalendarValue, 2), calendarValue = _useCalendarValue2[0], setCalendarValue = _useCalendarValue2[1], _useUtil = useUtil(generateConfig2, locale, formatList), _useUtil2 = _slicedToArray$2(_useUtil, 2), getDateTexts = _useUtil2[0], isSameDates = _useUtil2[1], triggerCalendarChange = useEvent(function(nextCalendarValues) {
|
|
6489
6738
|
var clone = _toConsumableArray$3(nextCalendarValues);
|
|
6490
6739
|
order && (clone = orderDates(clone.filter(function(date) {
|
|
6491
6740
|
return date;
|
|
6492
6741
|
}), generateConfig2));
|
|
6493
|
-
var _isSameDates = isSameDates(calendarValue(), clone), _isSameDates2 = _slicedToArray$
|
|
6742
|
+
var _isSameDates = isSameDates(calendarValue(), clone), _isSameDates2 = _slicedToArray$2(_isSameDates, 2), isSameMergedDates = _isSameDates2[0], isSameStart = _isSameDates2[1];
|
|
6494
6743
|
if (!isSameMergedDates && (setCalendarValue(clone), onCalendarChange)) {
|
|
6495
6744
|
var cellTexts = getDateTexts(clone);
|
|
6496
6745
|
onCalendarChange(clone, cellTexts, {
|
|
@@ -6506,7 +6755,7 @@ __name(useInnerValue, "useInnerValue");
|
|
|
6506
6755
|
function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, open, isInvalidateDate) {
|
|
6507
6756
|
var generateConfig2 = info.generateConfig, locale = info.locale, picker = info.picker, onChange = info.onChange, allowEmpty = info.allowEmpty, order = info.order, orderOnChange = disabled.some(function(d2) {
|
|
6508
6757
|
return d2;
|
|
6509
|
-
}) ? !1 : order, _useUtil3 = useUtil(generateConfig2, locale, formatList), _useUtil4 = _slicedToArray$
|
|
6758
|
+
}) ? !1 : order, _useUtil3 = useUtil(generateConfig2, locale, formatList), _useUtil4 = _slicedToArray$2(_useUtil3, 2), getDateTexts = _useUtil4[0], isSameDates = _useUtil4[1], _useSyncState3 = useSyncState(mergedValue), _useSyncState4 = _slicedToArray$2(_useSyncState3, 2), submitValue = _useSyncState4[0], setSubmitValue = _useSyncState4[1], syncWithValue = useEvent(function() {
|
|
6510
6759
|
setSubmitValue(mergedValue);
|
|
6511
6760
|
});
|
|
6512
6761
|
React$6.useEffect(function() {
|
|
@@ -6518,7 +6767,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
6518
6767
|
for (var maxLen = Math.max(disabled.length, clone.length), i = 0; i < maxLen; i += 1)
|
|
6519
6768
|
disabled[i] || (clone[i] = null);
|
|
6520
6769
|
orderOnChange && clone[0] && clone[1] && (clone = orderDates(clone, generateConfig2)), triggerCalendarChange(clone);
|
|
6521
|
-
var _clone = clone, _clone2 = _slicedToArray$
|
|
6770
|
+
var _clone = clone, _clone2 = _slicedToArray$2(_clone, 2), start = _clone2[0], end = _clone2[1], startEmpty = !start, endEmpty = !end, validateEmptyDateRange = allowEmpty ? (
|
|
6522
6771
|
// Validate empty start
|
|
6523
6772
|
(!startEmpty || allowEmpty[0]) && // Validate empty end
|
|
6524
6773
|
(!endEmpty || allowEmpty[1])
|
|
@@ -6538,7 +6787,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
6538
6787
|
);
|
|
6539
6788
|
if (allPassed) {
|
|
6540
6789
|
setInnerValue(clone);
|
|
6541
|
-
var _isSameDates3 = isSameDates(clone, mergedValue), _isSameDates4 = _slicedToArray$
|
|
6790
|
+
var _isSameDates3 = isSameDates(clone, mergedValue), _isSameDates4 = _slicedToArray$2(_isSameDates3, 1), isSameMergedDates = _isSameDates4[0];
|
|
6542
6791
|
onChange && !isSameMergedDates && onChange(
|
|
6543
6792
|
// Return null directly if all date are empty
|
|
6544
6793
|
isNullValue && clone.every(function(val) {
|
|
@@ -6606,9 +6855,9 @@ function useTimeInfo(generateConfig2) {
|
|
|
6606
6855
|
return [disabledConfig.disabledHours || disabledHours || emptyDisabled, disabledConfig.disabledMinutes || disabledMinutes || emptyDisabled, disabledConfig.disabledSeconds || disabledSeconds || emptyDisabled, disabledConfig.disabledMilliseconds || emptyDisabled];
|
|
6607
6856
|
}, [disabledTime, disabledHours, disabledMinutes, disabledSeconds]), _React$useMemo = React$6.useMemo(function() {
|
|
6608
6857
|
return getDisabledTimes(mergedDate);
|
|
6609
|
-
}, [mergedDate, getDisabledTimes]), _React$useMemo2 = _slicedToArray$
|
|
6858
|
+
}, [mergedDate, getDisabledTimes]), _React$useMemo2 = _slicedToArray$2(_React$useMemo, 4), mergedDisabledHours = _React$useMemo2[0], mergedDisabledMinutes = _React$useMemo2[1], mergedDisabledSeconds = _React$useMemo2[2], mergedDisabledMilliseconds = _React$useMemo2[3], getAllUnits = React$6.useCallback(function(getDisabledHours, getDisabledMinutes, getDisabledSeconds, getDisabledMilliseconds) {
|
|
6610
6859
|
var hours = generateUnits(0, 23, hourStep, hideDisabledOptions, getDisabledHours()), rowHourUnits2 = use12Hours ? hours.map(function(unit) {
|
|
6611
|
-
return _objectSpread2$
|
|
6860
|
+
return _objectSpread2$2(_objectSpread2$2({}, unit), {}, {
|
|
6612
6861
|
label: leftPad(unit.value % 12 || 12, 2)
|
|
6613
6862
|
});
|
|
6614
6863
|
}) : hours, getMinuteUnits2 = /* @__PURE__ */ __name(function(nextHour) {
|
|
@@ -6621,12 +6870,12 @@ function useTimeInfo(generateConfig2) {
|
|
|
6621
6870
|
return [rowHourUnits2, getMinuteUnits2, getSecondUnits2, getMillisecondUnits2];
|
|
6622
6871
|
}, [hideDisabledOptions, hourStep, use12Hours, millisecondStep, minuteStep, secondStep]), _React$useMemo3 = React$6.useMemo(function() {
|
|
6623
6872
|
return getAllUnits(mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds);
|
|
6624
|
-
}, [getAllUnits, mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds]), _React$useMemo4 = _slicedToArray$
|
|
6873
|
+
}, [getAllUnits, mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds]), _React$useMemo4 = _slicedToArray$2(_React$useMemo3, 4), rowHourUnits = _React$useMemo4[0], getMinuteUnits = _React$useMemo4[1], getSecondUnits = _React$useMemo4[2], getMillisecondUnits = _React$useMemo4[3], getValidTime = /* @__PURE__ */ __name(function(nextTime, certainDate) {
|
|
6625
6874
|
var getCheckHourUnits = /* @__PURE__ */ __name(function() {
|
|
6626
6875
|
return rowHourUnits;
|
|
6627
6876
|
}, "getCheckHourUnits2"), getCheckMinuteUnits = getMinuteUnits, getCheckSecondUnits = getSecondUnits, getCheckMillisecondUnits = getMillisecondUnits;
|
|
6628
6877
|
if (certainDate) {
|
|
6629
|
-
var _getDisabledTimes = getDisabledTimes(certainDate), _getDisabledTimes2 = _slicedToArray$
|
|
6878
|
+
var _getDisabledTimes = getDisabledTimes(certainDate), _getDisabledTimes2 = _slicedToArray$2(_getDisabledTimes, 4), targetDisabledHours = _getDisabledTimes2[0], targetDisabledMinutes = _getDisabledTimes2[1], targetDisabledSeconds = _getDisabledTimes2[2], targetDisabledMilliseconds = _getDisabledTimes2[3], _getAllUnits = getAllUnits(targetDisabledHours, targetDisabledMinutes, targetDisabledSeconds, targetDisabledMilliseconds), _getAllUnits2 = _slicedToArray$2(_getAllUnits, 4), targetRowHourUnits = _getAllUnits2[0], targetGetMinuteUnits = _getAllUnits2[1], targetGetSecondUnits = _getAllUnits2[2], targetGetMillisecondUnits = _getAllUnits2[3];
|
|
6630
6879
|
getCheckHourUnits = /* @__PURE__ */ __name(function() {
|
|
6631
6880
|
return targetRowHourUnits;
|
|
6632
6881
|
}, "getCheckHourUnits2"), getCheckMinuteUnits = targetGetMinuteUnits, getCheckSecondUnits = targetGetSecondUnits, getCheckMillisecondUnits = targetGetMillisecondUnits;
|
|
@@ -6646,7 +6895,7 @@ function useTimeInfo(generateConfig2) {
|
|
|
6646
6895
|
}
|
|
6647
6896
|
__name(useTimeInfo, "useTimeInfo");
|
|
6648
6897
|
function Footer(props) {
|
|
6649
|
-
var mode = props.mode, internalMode = props.internalMode, renderExtraFooter = props.renderExtraFooter, showNow = props.showNow, showTime = props.showTime, onSubmit = props.onSubmit, onNow = props.onNow, invalid = props.invalid, needConfirm = props.needConfirm, generateConfig2 = props.generateConfig, disabledDate = props.disabledDate, _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, locale = _React$useContext.locale, _React$useContext$but = _React$useContext.button, Button2 = _React$useContext$but === void 0 ? "button" : _React$useContext$but, now = generateConfig2.getNow(), _useTimeInfo = useTimeInfo(generateConfig2, showTime, now), _useTimeInfo2 = _slicedToArray$
|
|
6898
|
+
var mode = props.mode, internalMode = props.internalMode, renderExtraFooter = props.renderExtraFooter, showNow = props.showNow, showTime = props.showTime, onSubmit = props.onSubmit, onNow = props.onNow, invalid = props.invalid, needConfirm = props.needConfirm, generateConfig2 = props.generateConfig, disabledDate = props.disabledDate, _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, locale = _React$useContext.locale, _React$useContext$but = _React$useContext.button, Button2 = _React$useContext$but === void 0 ? "button" : _React$useContext$but, now = generateConfig2.getNow(), _useTimeInfo = useTimeInfo(generateConfig2, showTime, now), _useTimeInfo2 = _slicedToArray$2(_useTimeInfo, 1), getValidTime = _useTimeInfo2[0], extraNode = renderExtraFooter == null ? void 0 : renderExtraFooter(mode), nowDisabled = disabledDate(now, {
|
|
6650
6899
|
type: mode
|
|
6651
6900
|
}), onInternalNow = /* @__PURE__ */ __name(function() {
|
|
6652
6901
|
if (!nowDisabled) {
|
|
@@ -6730,10 +6979,10 @@ function PanelBody(props) {
|
|
|
6730
6979
|
type: type2
|
|
6731
6980
|
});
|
|
6732
6981
|
col === 0 && (rowStartDate = currentDate, prefixColumn && rowNode.push(prefixColumn(rowStartDate)));
|
|
6733
|
-
var
|
|
6982
|
+
var inRange = !1, rangeStart = !1, rangeEnd = !1;
|
|
6734
6983
|
if (cellSelection && hoverRangeValue) {
|
|
6735
|
-
var _hoverRangeValue = _slicedToArray$
|
|
6736
|
-
|
|
6984
|
+
var _hoverRangeValue = _slicedToArray$2(hoverRangeValue, 2), hoverStart = _hoverRangeValue[0], hoverEnd = _hoverRangeValue[1];
|
|
6985
|
+
inRange = isInRange(generateConfig2, hoverStart, hoverEnd, currentDate), rangeStart = isSame(generateConfig2, locale, currentDate, hoverStart, type2), rangeEnd = isSame(generateConfig2, locale, currentDate, hoverEnd, type2);
|
|
6737
6986
|
}
|
|
6738
6987
|
var title = titleFormat ? formatValue(currentDate, {
|
|
6739
6988
|
locale,
|
|
@@ -6745,9 +6994,9 @@ function PanelBody(props) {
|
|
|
6745
6994
|
rowNode.push(/* @__PURE__ */ React$6.createElement("td", {
|
|
6746
6995
|
key: col,
|
|
6747
6996
|
title,
|
|
6748
|
-
className: clsx(cellPrefixCls, _objectSpread2$
|
|
6997
|
+
className: clsx(cellPrefixCls, _objectSpread2$2(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function(date) {
|
|
6749
6998
|
return isSame(generateConfig2, locale, currentDate, date, type2);
|
|
6750
|
-
})), "".concat(cellPrefixCls, "-in-range"),
|
|
6999
|
+
})), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue && // WeekPicker use row instead
|
|
6751
7000
|
type2 !== "week" && matchValues(currentDate)), getCellClassName(currentDate))),
|
|
6752
7001
|
onClick: /* @__PURE__ */ __name(function() {
|
|
6753
7002
|
disabled || onSelect2(currentDate);
|
|
@@ -6862,13 +7111,13 @@ function PanelHeader(props) {
|
|
|
6862
7111
|
}
|
|
6863
7112
|
__name(PanelHeader, "PanelHeader");
|
|
6864
7113
|
function DatePanel$1(props) {
|
|
6865
|
-
var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, _props$mode = props.mode, mode = _props$mode === void 0 ? "date" : _props$mode, disabledDate = props.disabledDate, onSelect2 = props.onSelect, onHover = props.onHover, showWeek = props.showWeek, panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel"), cellPrefixCls = "".concat(prefixCls, "-cell"), isWeek = mode === "week", _useInfo = useInfo(props, mode), _useInfo2 = _slicedToArray$
|
|
7114
|
+
var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, _props$mode = props.mode, mode = _props$mode === void 0 ? "date" : _props$mode, disabledDate = props.disabledDate, onSelect2 = props.onSelect, onHover = props.onHover, showWeek = props.showWeek, panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel"), cellPrefixCls = "".concat(prefixCls, "-cell"), isWeek = mode === "week", _useInfo = useInfo(props, mode), _useInfo2 = _slicedToArray$2(_useInfo, 2), info = _useInfo2[0], now = _useInfo2[1], weekFirstDay = generateConfig2.locale.getWeekFirstDay(locale.locale), monthStartDate = generateConfig2.setDate(pickerValue, 1), baseDate = getWeekStartDate(locale.locale, generateConfig2, monthStartDate), month = generateConfig2.getMonth(pickerValue), showPrefixColumn = showWeek === void 0 ? isWeek : showWeek, prefixColumn = showPrefixColumn ? function(date) {
|
|
6866
7115
|
var disabled = disabledDate == null ? void 0 : disabledDate(date, {
|
|
6867
7116
|
type: "week"
|
|
6868
7117
|
});
|
|
6869
7118
|
return /* @__PURE__ */ React$6.createElement("td", {
|
|
6870
7119
|
key: "week",
|
|
6871
|
-
className: clsx(cellPrefixCls, "".concat(cellPrefixCls, "-week"), _defineProperty$
|
|
7120
|
+
className: clsx(cellPrefixCls, "".concat(cellPrefixCls, "-week"), _defineProperty$c({}, "".concat(cellPrefixCls, "-disabled"), disabled)),
|
|
6872
7121
|
onClick: /* @__PURE__ */ __name(function() {
|
|
6873
7122
|
disabled || onSelect2(date);
|
|
6874
7123
|
}, "onClick"),
|
|
@@ -6899,7 +7148,7 @@ function DatePanel$1(props) {
|
|
|
6899
7148
|
generateConfig: generateConfig2
|
|
6900
7149
|
});
|
|
6901
7150
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
6902
|
-
var classObj = _defineProperty$
|
|
7151
|
+
var classObj = _defineProperty$c(_defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), isSameMonth(generateConfig2, date, pickerValue)), "".concat(prefixCls, "-cell-today"), isSameDate(generateConfig2, date, now));
|
|
6903
7152
|
return classObj;
|
|
6904
7153
|
}, "getCellClassName"), monthsLocale = locale.shortMonths || (generateConfig2.locale.getShortMonths ? generateConfig2.locale.getShortMonths(locale.locale) : []), yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
6905
7154
|
type: "button",
|
|
@@ -6947,7 +7196,7 @@ function DatePanel$1(props) {
|
|
|
6947
7196
|
var clone = generateConfig2.setDate(date, 1);
|
|
6948
7197
|
return clone = generateConfig2.addMonth(clone, 1), generateConfig2.addDate(clone, -1);
|
|
6949
7198
|
}, "getEnd")
|
|
6950
|
-
}, monthYearNodes), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7199
|
+
}, monthYearNodes), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({
|
|
6951
7200
|
titleFormat: locale.fieldDateFormat
|
|
6952
7201
|
}, props, {
|
|
6953
7202
|
colNum: WEEK_DAY_COUNT,
|
|
@@ -6997,9 +7246,9 @@ function useScrollTo$1(ulRef, value) {
|
|
|
6997
7246
|
__name(useScrollTo$1, "useScrollTo$1");
|
|
6998
7247
|
var SCROLL_DELAY = 300;
|
|
6999
7248
|
function TimeColumn(props) {
|
|
7000
|
-
var units = props.units, value = props.value, optionalValue = props.optionalValue, type2 = props.type, onChange = props.onChange, onDblClick = props.onDblClick, changeOnScroll = props.changeOnScroll, _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, cellRender = _usePanelContext.cellRender, now = _usePanelContext.now, locale = _usePanelContext.locale, panelPrefixCls = "".concat(prefixCls, "-time-panel"), cellPrefixCls = "".concat(prefixCls, "-time-panel-cell"), ulRef = React$6.useRef(null), checkDelayRef = React$6.useRef(), clearDelayCheck = /* @__PURE__ */ __name(function() {
|
|
7249
|
+
var units = props.units, value = props.value, optionalValue = props.optionalValue, type2 = props.type, onChange = props.onChange, onHover = props.onHover, onDblClick = props.onDblClick, changeOnScroll = props.changeOnScroll, _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, cellRender = _usePanelContext.cellRender, now = _usePanelContext.now, locale = _usePanelContext.locale, panelPrefixCls = "".concat(prefixCls, "-time-panel"), cellPrefixCls = "".concat(prefixCls, "-time-panel-cell"), ulRef = React$6.useRef(null), checkDelayRef = React$6.useRef(), clearDelayCheck = /* @__PURE__ */ __name(function() {
|
|
7001
7250
|
clearTimeout(checkDelayRef.current);
|
|
7002
|
-
}, "clearDelayCheck"), _useScrollTo = useScrollTo$1(ulRef, value != null ? value : optionalValue), _useScrollTo2 = _slicedToArray$
|
|
7251
|
+
}, "clearDelayCheck"), _useScrollTo = useScrollTo$1(ulRef, value != null ? value : optionalValue), _useScrollTo2 = _slicedToArray$2(_useScrollTo, 3), syncScroll = _useScrollTo2[0], stopScroll = _useScrollTo2[1], isScrolling = _useScrollTo2[2];
|
|
7003
7252
|
useLayoutEffect$1(function() {
|
|
7004
7253
|
return syncScroll(), clearDelayCheck(), function() {
|
|
7005
7254
|
stopScroll(), clearDelayCheck();
|
|
@@ -7030,13 +7279,19 @@ function TimeColumn(props) {
|
|
|
7030
7279
|
}, label);
|
|
7031
7280
|
return /* @__PURE__ */ React$6.createElement("li", {
|
|
7032
7281
|
key: unitValue,
|
|
7033
|
-
className: clsx(cellPrefixCls, _defineProperty$
|
|
7282
|
+
className: clsx(cellPrefixCls, _defineProperty$c(_defineProperty$c({}, "".concat(cellPrefixCls, "-selected"), value === unitValue), "".concat(cellPrefixCls, "-disabled"), disabled)),
|
|
7034
7283
|
onClick: /* @__PURE__ */ __name(function() {
|
|
7035
7284
|
disabled || onChange(unitValue);
|
|
7036
7285
|
}, "onClick"),
|
|
7037
7286
|
onDoubleClick: /* @__PURE__ */ __name(function() {
|
|
7038
7287
|
!disabled && onDblClick && onDblClick();
|
|
7039
7288
|
}, "onDoubleClick"),
|
|
7289
|
+
onMouseEnter: /* @__PURE__ */ __name(function() {
|
|
7290
|
+
onHover(unitValue);
|
|
7291
|
+
}, "onMouseEnter"),
|
|
7292
|
+
onMouseLeave: /* @__PURE__ */ __name(function() {
|
|
7293
|
+
onHover(null);
|
|
7294
|
+
}, "onMouseLeave"),
|
|
7040
7295
|
"data-value": unitValue
|
|
7041
7296
|
}, cellRender ? cellRender(unitValue, {
|
|
7042
7297
|
prefixCls,
|
|
@@ -7054,10 +7309,10 @@ function isAM(hour) {
|
|
|
7054
7309
|
}
|
|
7055
7310
|
__name(isAM, "isAM");
|
|
7056
7311
|
function TimePanelBody(props) {
|
|
7057
|
-
var showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, showMillisecond = props.showMillisecond, showMeridiem = props.use12Hours, changeOnScroll = props.changeOnScroll, _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, values3 = _usePanelContext.values, generateConfig2 = _usePanelContext.generateConfig, locale = _usePanelContext.locale, onSelect2 = _usePanelContext.onSelect, pickerValue = _usePanelContext.pickerValue, value = (values3 == null ? void 0 : values3[0]) || null, _React$useContext = React$6.useContext(PickerHackContext), onCellDblClick = _React$useContext.onCellDblClick, _useTimeInfo = useTimeInfo(generateConfig2, props, value), _useTimeInfo2 = _slicedToArray$
|
|
7312
|
+
var showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, showMillisecond = props.showMillisecond, showMeridiem = props.use12Hours, changeOnScroll = props.changeOnScroll, _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, values3 = _usePanelContext.values, generateConfig2 = _usePanelContext.generateConfig, locale = _usePanelContext.locale, onSelect2 = _usePanelContext.onSelect, onHover = _usePanelContext.onHover, pickerValue = _usePanelContext.pickerValue, value = (values3 == null ? void 0 : values3[0]) || null, _React$useContext = React$6.useContext(PickerHackContext), onCellDblClick = _React$useContext.onCellDblClick, _useTimeInfo = useTimeInfo(generateConfig2, props, value), _useTimeInfo2 = _slicedToArray$2(_useTimeInfo, 5), getValidTime = _useTimeInfo2[0], rowHourUnits = _useTimeInfo2[1], getMinuteUnits = _useTimeInfo2[2], getSecondUnits = _useTimeInfo2[3], getMillisecondUnits = _useTimeInfo2[4], getUnitValue = /* @__PURE__ */ __name(function(func) {
|
|
7058
7313
|
var valueUnitVal = value && generateConfig2[func](value), pickerUnitValue = pickerValue && generateConfig2[func](pickerValue);
|
|
7059
7314
|
return [valueUnitVal, pickerUnitValue];
|
|
7060
|
-
}, "getUnitValue"), _getUnitValue = getUnitValue("getHour"), _getUnitValue2 = _slicedToArray$
|
|
7315
|
+
}, "getUnitValue"), _getUnitValue = getUnitValue("getHour"), _getUnitValue2 = _slicedToArray$2(_getUnitValue, 2), hour = _getUnitValue2[0], pickerHour = _getUnitValue2[1], _getUnitValue3 = getUnitValue("getMinute"), _getUnitValue4 = _slicedToArray$2(_getUnitValue3, 2), minute = _getUnitValue4[0], pickerMinute = _getUnitValue4[1], _getUnitValue5 = getUnitValue("getSecond"), _getUnitValue6 = _slicedToArray$2(_getUnitValue5, 2), second = _getUnitValue6[0], pickerSecond = _getUnitValue6[1], _getUnitValue7 = getUnitValue("getMillisecond"), _getUnitValue8 = _slicedToArray$2(_getUnitValue7, 2), millisecond = _getUnitValue8[0], pickerMillisecond = _getUnitValue8[1], meridiem = hour === null ? null : isAM(hour) ? "am" : "pm", hourUnits = React$6.useMemo(function() {
|
|
7061
7316
|
return showMeridiem ? isAM(hour) ? rowHourUnits.filter(function(h2) {
|
|
7062
7317
|
return isAM(h2.value);
|
|
7063
7318
|
}) : rowHourUnits.filter(function(h2) {
|
|
@@ -7109,56 +7364,83 @@ function TimePanelBody(props) {
|
|
|
7109
7364
|
return num != null;
|
|
7110
7365
|
}, "isNotNull");
|
|
7111
7366
|
return isNotNull(hour) ? (tmpl = generateConfig2.setHour(tmpl, hour), tmpl = generateConfig2.setMinute(tmpl, minute), tmpl = generateConfig2.setSecond(tmpl, second), tmpl = generateConfig2.setMillisecond(tmpl, millisecond)) : isNotNull(pickerHour) ? (tmpl = generateConfig2.setHour(tmpl, pickerHour), tmpl = generateConfig2.setMinute(tmpl, pickerMinute), tmpl = generateConfig2.setSecond(tmpl, pickerSecond), tmpl = generateConfig2.setMillisecond(tmpl, pickerMillisecond)) : isNotNull(validHour) && (tmpl = generateConfig2.setHour(tmpl, validHour), tmpl = generateConfig2.setMinute(tmpl, validMinute), tmpl = generateConfig2.setSecond(tmpl, validSecond), tmpl = generateConfig2.setMillisecond(tmpl, validMillisecond)), tmpl;
|
|
7112
|
-
}, [value, pickerValue, hour, minute, second, millisecond, validHour, validMinute, validSecond, validMillisecond, pickerHour, pickerMinute, pickerSecond, pickerMillisecond, generateConfig2]),
|
|
7113
|
-
|
|
7367
|
+
}, [value, pickerValue, hour, minute, second, millisecond, validHour, validMinute, validSecond, validMillisecond, pickerHour, pickerMinute, pickerSecond, pickerMillisecond, generateConfig2]), fillColumnValue = /* @__PURE__ */ __name(function(val, func) {
|
|
7368
|
+
return val === null ? null : generateConfig2[func](triggerDateTmpl, val);
|
|
7369
|
+
}, "fillColumnValue"), getNextHourTime = /* @__PURE__ */ __name(function(val) {
|
|
7370
|
+
return fillColumnValue(val, "setHour");
|
|
7371
|
+
}, "getNextHourTime"), getNextMinuteTime = /* @__PURE__ */ __name(function(val) {
|
|
7372
|
+
return fillColumnValue(val, "setMinute");
|
|
7373
|
+
}, "getNextMinuteTime"), getNextSecondTime = /* @__PURE__ */ __name(function(val) {
|
|
7374
|
+
return fillColumnValue(val, "setSecond");
|
|
7375
|
+
}, "getNextSecondTime"), getNextMillisecondTime = /* @__PURE__ */ __name(function(val) {
|
|
7376
|
+
return fillColumnValue(val, "setMillisecond");
|
|
7377
|
+
}, "getNextMillisecondTime"), getMeridiemTime = /* @__PURE__ */ __name(function(val) {
|
|
7378
|
+
return val === null ? null : val === "am" && !isAM(hour) ? generateConfig2.setHour(triggerDateTmpl, hour - 12) : val === "pm" && isAM(hour) ? generateConfig2.setHour(triggerDateTmpl, hour + 12) : triggerDateTmpl;
|
|
7379
|
+
}, "getMeridiemTime"), onHourChange = /* @__PURE__ */ __name(function(val) {
|
|
7380
|
+
triggerChange(getNextHourTime(val));
|
|
7114
7381
|
}, "onHourChange"), onMinuteChange = /* @__PURE__ */ __name(function(val) {
|
|
7115
|
-
triggerChange(
|
|
7382
|
+
triggerChange(getNextMinuteTime(val));
|
|
7116
7383
|
}, "onMinuteChange"), onSecondChange = /* @__PURE__ */ __name(function(val) {
|
|
7117
|
-
triggerChange(
|
|
7384
|
+
triggerChange(getNextSecondTime(val));
|
|
7118
7385
|
}, "onSecondChange"), onMillisecondChange = /* @__PURE__ */ __name(function(val) {
|
|
7119
|
-
triggerChange(
|
|
7386
|
+
triggerChange(getNextMillisecondTime(val));
|
|
7120
7387
|
}, "onMillisecondChange"), onMeridiemChange = /* @__PURE__ */ __name(function(val) {
|
|
7121
|
-
|
|
7122
|
-
}, "onMeridiemChange"),
|
|
7388
|
+
triggerChange(getMeridiemTime(val));
|
|
7389
|
+
}, "onMeridiemChange"), onHourHover = /* @__PURE__ */ __name(function(val) {
|
|
7390
|
+
onHover(getNextHourTime(val));
|
|
7391
|
+
}, "onHourHover"), onMinuteHover = /* @__PURE__ */ __name(function(val) {
|
|
7392
|
+
onHover(getNextMinuteTime(val));
|
|
7393
|
+
}, "onMinuteHover"), onSecondHover = /* @__PURE__ */ __name(function(val) {
|
|
7394
|
+
onHover(getNextSecondTime(val));
|
|
7395
|
+
}, "onSecondHover"), onMillisecondHover = /* @__PURE__ */ __name(function(val) {
|
|
7396
|
+
onHover(getNextMillisecondTime(val));
|
|
7397
|
+
}, "onMillisecondHover"), onMeridiemHover = /* @__PURE__ */ __name(function(val) {
|
|
7398
|
+
onHover(getMeridiemTime(val));
|
|
7399
|
+
}, "onMeridiemHover"), sharedColumnProps = {
|
|
7123
7400
|
onDblClick: onCellDblClick,
|
|
7124
7401
|
changeOnScroll
|
|
7125
7402
|
};
|
|
7126
7403
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
7127
7404
|
className: "".concat(prefixCls, "-content")
|
|
7128
|
-
}, showHour && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$
|
|
7405
|
+
}, showHour && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7129
7406
|
units: hourUnits,
|
|
7130
7407
|
value: hour,
|
|
7131
7408
|
optionalValue: pickerHour,
|
|
7132
7409
|
type: "hour",
|
|
7133
|
-
onChange: onHourChange
|
|
7134
|
-
|
|
7410
|
+
onChange: onHourChange,
|
|
7411
|
+
onHover: onHourHover
|
|
7412
|
+
}, sharedColumnProps)), showMinute && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7135
7413
|
units: minuteUnits,
|
|
7136
7414
|
value: minute,
|
|
7137
7415
|
optionalValue: pickerMinute,
|
|
7138
7416
|
type: "minute",
|
|
7139
|
-
onChange: onMinuteChange
|
|
7140
|
-
|
|
7417
|
+
onChange: onMinuteChange,
|
|
7418
|
+
onHover: onMinuteHover
|
|
7419
|
+
}, sharedColumnProps)), showSecond && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7141
7420
|
units: secondUnits,
|
|
7142
7421
|
value: second,
|
|
7143
7422
|
optionalValue: pickerSecond,
|
|
7144
7423
|
type: "second",
|
|
7145
|
-
onChange: onSecondChange
|
|
7146
|
-
|
|
7424
|
+
onChange: onSecondChange,
|
|
7425
|
+
onHover: onSecondHover
|
|
7426
|
+
}, sharedColumnProps)), showMillisecond && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7147
7427
|
units: millisecondUnits,
|
|
7148
7428
|
value: millisecond,
|
|
7149
7429
|
optionalValue: pickerMillisecond,
|
|
7150
7430
|
type: "millisecond",
|
|
7151
|
-
onChange: onMillisecondChange
|
|
7152
|
-
|
|
7431
|
+
onChange: onMillisecondChange,
|
|
7432
|
+
onHover: onMillisecondHover
|
|
7433
|
+
}, sharedColumnProps)), showMeridiem && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7153
7434
|
units: meridiemUnits,
|
|
7154
7435
|
value: meridiem,
|
|
7155
7436
|
type: "meridiem",
|
|
7156
|
-
onChange: onMeridiemChange
|
|
7437
|
+
onChange: onMeridiemChange,
|
|
7438
|
+
onHover: onMeridiemHover
|
|
7157
7439
|
}, sharedColumnProps)));
|
|
7158
7440
|
}
|
|
7159
7441
|
__name(TimePanelBody, "TimePanelBody");
|
|
7160
7442
|
function TimePanel(props) {
|
|
7161
|
-
var prefixCls = props.prefixCls, value = props.value, locale = props.locale, generateConfig2 = props.generateConfig, showTime = props.showTime, _ref = showTime || {}, format2 = _ref.format, panelPrefixCls = "".concat(prefixCls, "-time-panel"), _useInfo = useInfo(props, "time"), _useInfo2 = _slicedToArray$
|
|
7443
|
+
var prefixCls = props.prefixCls, value = props.value, locale = props.locale, generateConfig2 = props.generateConfig, showTime = props.showTime, _ref = showTime || {}, format2 = _ref.format, panelPrefixCls = "".concat(prefixCls, "-time-panel"), _useInfo = useInfo(props, "time"), _useInfo2 = _slicedToArray$2(_useInfo, 1), info = _useInfo2[0];
|
|
7162
7444
|
return /* @__PURE__ */ React$6.createElement(PanelContext.Provider, {
|
|
7163
7445
|
value: info
|
|
7164
7446
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
@@ -7171,7 +7453,7 @@ function TimePanel(props) {
|
|
|
7171
7453
|
}
|
|
7172
7454
|
__name(TimePanel, "TimePanel");
|
|
7173
7455
|
function DateTimePanel(props) {
|
|
7174
|
-
var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, showTime = props.showTime, onSelect2 = props.onSelect, value = props.value, pickerValue = props.pickerValue, onHover = props.onHover, panelPrefixCls = "".concat(prefixCls, "-datetime-panel"), _useTimeInfo = useTimeInfo(generateConfig2, showTime), _useTimeInfo2 = _slicedToArray$
|
|
7456
|
+
var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, showTime = props.showTime, onSelect2 = props.onSelect, value = props.value, pickerValue = props.pickerValue, onHover = props.onHover, panelPrefixCls = "".concat(prefixCls, "-datetime-panel"), _useTimeInfo = useTimeInfo(generateConfig2, showTime), _useTimeInfo2 = _slicedToArray$2(_useTimeInfo, 1), getValidTime = _useTimeInfo2[0], mergeTime = /* @__PURE__ */ __name(function(date) {
|
|
7175
7457
|
return value ? fillTime(generateConfig2, date, value) : fillTime(generateConfig2, date, pickerValue);
|
|
7176
7458
|
}, "mergeTime"), onDateHover = /* @__PURE__ */ __name(function(date) {
|
|
7177
7459
|
onHover == null || onHover(date && mergeTime(date));
|
|
@@ -7181,14 +7463,14 @@ function DateTimePanel(props) {
|
|
|
7181
7463
|
}, "onDateSelect");
|
|
7182
7464
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
7183
7465
|
className: panelPrefixCls
|
|
7184
|
-
}, /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$
|
|
7466
|
+
}, /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$6({}, props, {
|
|
7185
7467
|
onSelect: onDateSelect,
|
|
7186
7468
|
onHover: onDateHover
|
|
7187
7469
|
})), /* @__PURE__ */ React$6.createElement(TimePanel, props));
|
|
7188
7470
|
}
|
|
7189
7471
|
__name(DateTimePanel, "DateTimePanel");
|
|
7190
7472
|
function DecadePanel(props) {
|
|
7191
|
-
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, panelPrefixCls = "".concat(prefixCls, "-decade-panel"), _useInfo = useInfo(props, "decade"), _useInfo2 = _slicedToArray$
|
|
7473
|
+
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, panelPrefixCls = "".concat(prefixCls, "-decade-panel"), _useInfo = useInfo(props, "decade"), _useInfo2 = _slicedToArray$2(_useInfo, 1), info = _useInfo2[0], getStartYear = /* @__PURE__ */ __name(function(date) {
|
|
7192
7474
|
var startYear = Math.floor(generateConfig2.getYear(pickerValue) / 100) * 100;
|
|
7193
7475
|
return generateConfig2.setYear(date, startYear);
|
|
7194
7476
|
}, "getStartYear"), getEndYear = /* @__PURE__ */ __name(function(date) {
|
|
@@ -7208,7 +7490,7 @@ function DecadePanel(props) {
|
|
|
7208
7490
|
});
|
|
7209
7491
|
return "".concat(startYearStr, "-").concat(endYearStr);
|
|
7210
7492
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
7211
|
-
return _defineProperty$
|
|
7493
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), isSameDecade(generateConfig2, date, startYearDate) || isSameDecade(generateConfig2, date, endYearDate) || isInRange(generateConfig2, startYearDate, endYearDate, date));
|
|
7212
7494
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7213
7495
|
var baseStartDate = generateConfig2.setDate(currentDate, 1), baseStartMonth = generateConfig2.setMonth(baseStartDate, 0), baseStartYear = generateConfig2.setYear(baseStartMonth, Math.floor(generateConfig2.getYear(baseStartMonth) / 10) * 10), baseEndYear = generateConfig2.addYear(baseStartYear, 10), baseEndDate = generateConfig2.addDate(baseEndYear, -1);
|
|
7214
7496
|
return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
|
|
@@ -7232,7 +7514,7 @@ function DecadePanel(props) {
|
|
|
7232
7514
|
onChange: onPickerValueChange,
|
|
7233
7515
|
getStart: getStartYear,
|
|
7234
7516
|
getEnd: getEndYear
|
|
7235
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7517
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7236
7518
|
disabledDate: mergedDisabledDate,
|
|
7237
7519
|
colNum: 3,
|
|
7238
7520
|
rowNum: 4,
|
|
@@ -7244,7 +7526,7 @@ function DecadePanel(props) {
|
|
|
7244
7526
|
}
|
|
7245
7527
|
__name(DecadePanel, "DecadePanel");
|
|
7246
7528
|
function MonthPanel(props) {
|
|
7247
|
-
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-month-panel"), _useInfo = useInfo(props, "month"), _useInfo2 = _slicedToArray$
|
|
7529
|
+
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-month-panel"), _useInfo = useInfo(props, "month"), _useInfo2 = _slicedToArray$2(_useInfo, 1), info = _useInfo2[0], baseDate = generateConfig2.setMonth(pickerValue, 0), monthsLocale = locale.shortMonths || (generateConfig2.locale.getShortMonths ? generateConfig2.locale.getShortMonths(locale.locale) : []), getCellDate = /* @__PURE__ */ __name(function(date, offset2) {
|
|
7248
7530
|
return generateConfig2.addMonth(date, offset2);
|
|
7249
7531
|
}, "getCellDate"), getCellText = /* @__PURE__ */ __name(function(date) {
|
|
7250
7532
|
var month = generateConfig2.getMonth(date);
|
|
@@ -7254,7 +7536,7 @@ function MonthPanel(props) {
|
|
|
7254
7536
|
generateConfig: generateConfig2
|
|
7255
7537
|
}) : monthsLocale[month];
|
|
7256
7538
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function() {
|
|
7257
|
-
return _defineProperty$
|
|
7539
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), !0);
|
|
7258
7540
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7259
7541
|
var startDate = generateConfig2.setDate(currentDate, 1), nextMonthStartDate = generateConfig2.setMonth(startDate, generateConfig2.getMonth(startDate) + 1), endDate = generateConfig2.addDate(nextMonthStartDate, -1);
|
|
7260
7542
|
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
|
|
@@ -7287,7 +7569,7 @@ function MonthPanel(props) {
|
|
|
7287
7569
|
getEnd: /* @__PURE__ */ __name(function(date) {
|
|
7288
7570
|
return generateConfig2.setMonth(date, 11);
|
|
7289
7571
|
}, "getEnd")
|
|
7290
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7572
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7291
7573
|
disabledDate: mergedDisabledDate,
|
|
7292
7574
|
titleFormat: locale.fieldMonthFormat,
|
|
7293
7575
|
colNum: 3,
|
|
@@ -7300,7 +7582,7 @@ function MonthPanel(props) {
|
|
|
7300
7582
|
}
|
|
7301
7583
|
__name(MonthPanel, "MonthPanel");
|
|
7302
7584
|
function QuarterPanel(props) {
|
|
7303
|
-
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-quarter-panel"), _useInfo = useInfo(props, "quarter"), _useInfo2 = _slicedToArray$
|
|
7585
|
+
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-quarter-panel"), _useInfo = useInfo(props, "quarter"), _useInfo2 = _slicedToArray$2(_useInfo, 1), info = _useInfo2[0], baseDate = generateConfig2.setMonth(pickerValue, 0), getCellDate = /* @__PURE__ */ __name(function(date, offset2) {
|
|
7304
7586
|
return generateConfig2.addMonth(date, offset2 * 3);
|
|
7305
7587
|
}, "getCellDate"), getCellText = /* @__PURE__ */ __name(function(date) {
|
|
7306
7588
|
return formatValue(date, {
|
|
@@ -7309,7 +7591,7 @@ function QuarterPanel(props) {
|
|
|
7309
7591
|
generateConfig: generateConfig2
|
|
7310
7592
|
});
|
|
7311
7593
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function() {
|
|
7312
|
-
return _defineProperty$
|
|
7594
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), !0);
|
|
7313
7595
|
}, "getCellClassName"), yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
7314
7596
|
type: "button",
|
|
7315
7597
|
key: "year",
|
|
@@ -7339,7 +7621,7 @@ function QuarterPanel(props) {
|
|
|
7339
7621
|
getEnd: /* @__PURE__ */ __name(function(date) {
|
|
7340
7622
|
return generateConfig2.setMonth(date, 11);
|
|
7341
7623
|
}, "getEnd")
|
|
7342
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7624
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7343
7625
|
titleFormat: locale.fieldQuarterFormat,
|
|
7344
7626
|
colNum: 4,
|
|
7345
7627
|
rowNum: 1,
|
|
@@ -7354,19 +7636,19 @@ function WeekPanel(props) {
|
|
|
7354
7636
|
var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale = props.locale, value = props.value, hoverValue = props.hoverValue, hoverRangeValue = props.hoverRangeValue, localeName = locale.locale, rowPrefixCls = "".concat(prefixCls, "-week-panel-row"), rowClassName = /* @__PURE__ */ __name(function(currentDate) {
|
|
7355
7637
|
var rangeCls = {};
|
|
7356
7638
|
if (hoverRangeValue) {
|
|
7357
|
-
var _hoverRangeValue = _slicedToArray$
|
|
7639
|
+
var _hoverRangeValue = _slicedToArray$2(hoverRangeValue, 2), rangeStart = _hoverRangeValue[0], rangeEnd = _hoverRangeValue[1], isRangeStart = isSameWeek(generateConfig2, localeName, rangeStart, currentDate), isRangeEnd = isSameWeek(generateConfig2, localeName, rangeEnd, currentDate);
|
|
7358
7640
|
rangeCls["".concat(rowPrefixCls, "-range-start")] = isRangeStart, rangeCls["".concat(rowPrefixCls, "-range-end")] = isRangeEnd, rangeCls["".concat(rowPrefixCls, "-range-hover")] = !isRangeStart && !isRangeEnd && isInRange(generateConfig2, rangeStart, rangeEnd, currentDate);
|
|
7359
7641
|
}
|
|
7360
7642
|
return hoverValue && (rangeCls["".concat(rowPrefixCls, "-hover")] = hoverValue.some(function(date) {
|
|
7361
7643
|
return isSameWeek(generateConfig2, localeName, currentDate, date);
|
|
7362
7644
|
})), clsx(
|
|
7363
7645
|
rowPrefixCls,
|
|
7364
|
-
_defineProperty$
|
|
7646
|
+
_defineProperty$c({}, "".concat(rowPrefixCls, "-selected"), !hoverRangeValue && isSameWeek(generateConfig2, localeName, value, currentDate)),
|
|
7365
7647
|
// Patch for hover range
|
|
7366
7648
|
rangeCls
|
|
7367
7649
|
);
|
|
7368
7650
|
}, "rowClassName");
|
|
7369
|
-
return /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$
|
|
7651
|
+
return /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$6({}, props, {
|
|
7370
7652
|
mode: "week",
|
|
7371
7653
|
panelName: "week",
|
|
7372
7654
|
rowClassName
|
|
@@ -7374,7 +7656,7 @@ function WeekPanel(props) {
|
|
|
7374
7656
|
}
|
|
7375
7657
|
__name(WeekPanel, "WeekPanel");
|
|
7376
7658
|
function YearPanel(props) {
|
|
7377
|
-
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-year-panel"), _useInfo = useInfo(props, "year"), _useInfo2 = _slicedToArray$
|
|
7659
|
+
var prefixCls = props.prefixCls, locale = props.locale, generateConfig2 = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, panelPrefixCls = "".concat(prefixCls, "-year-panel"), _useInfo = useInfo(props, "year"), _useInfo2 = _slicedToArray$2(_useInfo, 1), info = _useInfo2[0], getStartYear = /* @__PURE__ */ __name(function(date) {
|
|
7378
7660
|
var startYear = Math.floor(generateConfig2.getYear(pickerValue) / 10) * 10;
|
|
7379
7661
|
return generateConfig2.setYear(date, startYear);
|
|
7380
7662
|
}, "getStartYear"), getEndYear = /* @__PURE__ */ __name(function(date) {
|
|
@@ -7389,10 +7671,10 @@ function YearPanel(props) {
|
|
|
7389
7671
|
generateConfig: generateConfig2
|
|
7390
7672
|
});
|
|
7391
7673
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
7392
|
-
return _defineProperty$
|
|
7674
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), isSameYear(generateConfig2, date, startYearDate) || isSameYear(generateConfig2, date, endYearDate) || isInRange(generateConfig2, startYearDate, endYearDate, date));
|
|
7393
7675
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7394
|
-
var startMonth = generateConfig2.setMonth(currentDate, 0), startDate = generateConfig2.setDate(startMonth, 1), endMonth = generateConfig2.
|
|
7395
|
-
return disabledDate(startDate, disabledInfo) && disabledDate(
|
|
7676
|
+
var startMonth = generateConfig2.setMonth(currentDate, 0), startDate = generateConfig2.setDate(startMonth, 1), endMonth = generateConfig2.addYear(startDate, 1), endDate = generateConfig2.addDate(endMonth, -1);
|
|
7677
|
+
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
|
|
7396
7678
|
} : null, yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
7397
7679
|
type: "button",
|
|
7398
7680
|
key: "decade",
|
|
@@ -7422,7 +7704,7 @@ function YearPanel(props) {
|
|
|
7422
7704
|
onChange: onPickerValueChange,
|
|
7423
7705
|
getStart: getStartYear,
|
|
7424
7706
|
getEnd: getEndYear
|
|
7425
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7707
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7426
7708
|
disabledDate: mergedDisabledDate,
|
|
7427
7709
|
titleFormat: locale.fieldYearFormat,
|
|
7428
7710
|
colNum: 3,
|
|
@@ -7451,16 +7733,16 @@ function PickerPanel(props, ref) {
|
|
|
7451
7733
|
nativeElement: rootRef.current
|
|
7452
7734
|
};
|
|
7453
7735
|
});
|
|
7454
|
-
var _getTimeProps = getTimeProps(props), _getTimeProps2 = _slicedToArray$
|
|
7736
|
+
var _getTimeProps = getTimeProps(props), _getTimeProps2 = _slicedToArray$2(_getTimeProps, 4), timeProps = _getTimeProps2[0], localeTimeProps = _getTimeProps2[1], showTimeFormat = _getTimeProps2[2], propFormat = _getTimeProps2[3], filledLocale = useLocale(locale, localeTimeProps), internalPicker = picker === "date" && showTime ? "datetime" : picker, mergedShowTime = React$6.useMemo(function() {
|
|
7455
7737
|
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, filledLocale);
|
|
7456
7738
|
}, [internalPicker, showTimeFormat, propFormat, timeProps, filledLocale]), now = generateConfig2.getNow(), _useMergedState = useMergedState(picker, {
|
|
7457
7739
|
value: mode,
|
|
7458
7740
|
postState: /* @__PURE__ */ __name(function(val) {
|
|
7459
7741
|
return val || "date";
|
|
7460
7742
|
}, "postState")
|
|
7461
|
-
}), _useMergedState2 = _slicedToArray$
|
|
7743
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedMode = _useMergedState2[0], setMergedMode = _useMergedState2[1], internalMode = mergedMode === "date" && mergedShowTime ? "datetime" : mergedMode, toggleDates = useToggleDates(generateConfig2, locale, internalPicker), _useMergedState3 = useMergedState(defaultValue, {
|
|
7462
7744
|
value
|
|
7463
|
-
}), _useMergedState4 = _slicedToArray$
|
|
7745
|
+
}), _useMergedState4 = _slicedToArray$2(_useMergedState3, 2), innerValue = _useMergedState4[0], setMergedValue = _useMergedState4[1], mergedValue = React$6.useMemo(function() {
|
|
7464
7746
|
var values3 = toArray$1(innerValue).filter(function(val) {
|
|
7465
7747
|
return val;
|
|
7466
7748
|
});
|
|
@@ -7476,7 +7758,7 @@ function PickerPanel(props, ref) {
|
|
|
7476
7758
|
}
|
|
7477
7759
|
}), _useMergedState5 = useMergedState(defaultPickerValue || mergedValue[0] || now, {
|
|
7478
7760
|
value: pickerValue
|
|
7479
|
-
}), _useMergedState6 = _slicedToArray$
|
|
7761
|
+
}), _useMergedState6 = _slicedToArray$2(_useMergedState5, 2), mergedPickerValue = _useMergedState6[0], setInternalPickerValue = _useMergedState6[1];
|
|
7480
7762
|
React$6.useEffect(function() {
|
|
7481
7763
|
mergedValue[0] && !pickerValue && setInternalPickerValue(mergedValue[0]);
|
|
7482
7764
|
}, [mergedValue[0]]);
|
|
@@ -7499,13 +7781,13 @@ function PickerPanel(props, ref) {
|
|
|
7499
7781
|
}, "onPanelValueSelect2"), hoverRangeDate = React$6.useMemo(function() {
|
|
7500
7782
|
var start, end;
|
|
7501
7783
|
if (Array.isArray(hoverRangeValue)) {
|
|
7502
|
-
var _hoverRangeValue = _slicedToArray$
|
|
7784
|
+
var _hoverRangeValue = _slicedToArray$2(hoverRangeValue, 2);
|
|
7503
7785
|
start = _hoverRangeValue[0], end = _hoverRangeValue[1];
|
|
7504
7786
|
} else
|
|
7505
7787
|
start = hoverRangeValue;
|
|
7506
7788
|
return !start && !end ? null : (start = start || end, end = end || start, generateConfig2.isAfter(start, end) ? [end, start] : [start, end]);
|
|
7507
7789
|
}, [hoverRangeValue, generateConfig2]), onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender), PanelComponent = components[internalMode] || DefaultComponents[internalMode] || DatePanel$1, parentHackContext = React$6.useContext(PickerHackContext), pickerPanelContext = React$6.useMemo(function() {
|
|
7508
|
-
return _objectSpread2$
|
|
7790
|
+
return _objectSpread2$2(_objectSpread2$2({}, parentHackContext), {}, {
|
|
7509
7791
|
hideHeader
|
|
7510
7792
|
});
|
|
7511
7793
|
}, [parentHackContext, hideHeader]), panelCls = "".concat(mergedPrefixCls, "-panel"), panelProps = pickProps(props, [
|
|
@@ -7528,8 +7810,8 @@ function PickerPanel(props, ref) {
|
|
|
7528
7810
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
7529
7811
|
ref: rootRef,
|
|
7530
7812
|
tabIndex,
|
|
7531
|
-
className: clsx(panelCls, _defineProperty$
|
|
7532
|
-
}, /* @__PURE__ */ React$6.createElement(PanelComponent, _extends$
|
|
7813
|
+
className: clsx(panelCls, _defineProperty$c({}, "".concat(panelCls, "-rtl"), direction === "rtl"))
|
|
7814
|
+
}, /* @__PURE__ */ React$6.createElement(PanelComponent, _extends$6({}, panelProps, {
|
|
7533
7815
|
// Time
|
|
7534
7816
|
showTime: mergedShowTime,
|
|
7535
7817
|
prefixCls: mergedPrefixCls,
|
|
@@ -7561,7 +7843,7 @@ function PopupPanel(props) {
|
|
|
7561
7843
|
onCellDblClick: /* @__PURE__ */ __name(function() {
|
|
7562
7844
|
needConfirm && onSubmit();
|
|
7563
7845
|
}, "onCellDblClick")
|
|
7564
|
-
}, hideHeader = picker === "time", pickerProps = _objectSpread2$
|
|
7846
|
+
}, hideHeader = picker === "time", pickerProps = _objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
7565
7847
|
hoverValue: null,
|
|
7566
7848
|
hoverRangeValue: null,
|
|
7567
7849
|
hideHeader
|
|
@@ -7569,18 +7851,18 @@ function PopupPanel(props) {
|
|
|
7569
7851
|
return range ? pickerProps.hoverRangeValue = hoverValue : pickerProps.hoverValue = hoverValue, multiplePanel ? /* @__PURE__ */ React$6.createElement("div", {
|
|
7570
7852
|
className: "".concat(prefixCls, "-panels")
|
|
7571
7853
|
}, /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7572
|
-
value: _objectSpread2$
|
|
7854
|
+
value: _objectSpread2$2(_objectSpread2$2({}, sharedContext), {}, {
|
|
7573
7855
|
hideNext: !0
|
|
7574
7856
|
})
|
|
7575
7857
|
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, pickerProps)), /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7576
|
-
value: _objectSpread2$
|
|
7858
|
+
value: _objectSpread2$2(_objectSpread2$2({}, sharedContext), {}, {
|
|
7577
7859
|
hidePrev: !0
|
|
7578
7860
|
})
|
|
7579
|
-
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, _extends$
|
|
7861
|
+
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, _extends$6({}, pickerProps, {
|
|
7580
7862
|
pickerValue: nextPickerValue,
|
|
7581
7863
|
onPickerValueChange: onSecondPickerValueChange
|
|
7582
7864
|
})))) : /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7583
|
-
value: _objectSpread2$
|
|
7865
|
+
value: _objectSpread2$2({}, sharedContext)
|
|
7584
7866
|
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, pickerProps));
|
|
7585
7867
|
}
|
|
7586
7868
|
__name(PopupPanel, "PopupPanel");
|
|
@@ -7610,7 +7892,7 @@ function PresetPanel(props) {
|
|
|
7610
7892
|
}
|
|
7611
7893
|
__name(PresetPanel, "PresetPanel");
|
|
7612
7894
|
function Popup$2(props) {
|
|
7613
|
-
var panelRender = props.panelRender, internalMode = props.internalMode, picker = props.picker, showNow = props.showNow, range = props.range, multiple = props.multiple, _props$activeOffset = props.activeOffset, activeOffset = _props$activeOffset === void 0 ? 0 : _props$activeOffset, placement = props.placement, presets = props.presets, onPresetHover = props.onPresetHover, onPresetSubmit = props.onPresetSubmit, onFocus = props.onFocus, onBlur2 = props.onBlur, onPanelMouseDown = props.onPanelMouseDown, direction = props.direction, value = props.value, onSelect2 = props.onSelect, isInvalid = props.isInvalid, defaultOpenValue = props.defaultOpenValue, onOk = props.onOk, onSubmit = props.onSubmit, _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, panelPrefixCls = "".concat(prefixCls, "-panel"), rtl = direction === "rtl", arrowRef = React$6.useRef(null), wrapperRef = React$6.useRef(null), _React$useState = React$6.useState(0), _React$useState2 = _slicedToArray$
|
|
7895
|
+
var panelRender = props.panelRender, internalMode = props.internalMode, picker = props.picker, showNow = props.showNow, range = props.range, multiple = props.multiple, _props$activeOffset = props.activeOffset, activeOffset = _props$activeOffset === void 0 ? 0 : _props$activeOffset, placement = props.placement, presets = props.presets, onPresetHover = props.onPresetHover, onPresetSubmit = props.onPresetSubmit, onFocus = props.onFocus, onBlur2 = props.onBlur, onPanelMouseDown = props.onPanelMouseDown, direction = props.direction, value = props.value, onSelect2 = props.onSelect, isInvalid = props.isInvalid, defaultOpenValue = props.defaultOpenValue, onOk = props.onOk, onSubmit = props.onSubmit, _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, panelPrefixCls = "".concat(prefixCls, "-panel"), rtl = direction === "rtl", arrowRef = React$6.useRef(null), wrapperRef = React$6.useRef(null), _React$useState = React$6.useState(0), _React$useState2 = _slicedToArray$2(_React$useState, 2), containerWidth = _React$useState2[0], setContainerWidth = _React$useState2[1], _React$useState3 = React$6.useState(0), _React$useState4 = _slicedToArray$2(_React$useState3, 2), containerOffset = _React$useState4[0], setContainerOffset = _React$useState4[1], onResize2 = /* @__PURE__ */ __name(function(info) {
|
|
7614
7896
|
info.offsetWidth && setContainerWidth(info.offsetWidth);
|
|
7615
7897
|
}, "onResize");
|
|
7616
7898
|
React$6.useEffect(function() {
|
|
@@ -7642,9 +7924,9 @@ function Popup$2(props) {
|
|
|
7642
7924
|
presets,
|
|
7643
7925
|
onClick: onPresetSubmit,
|
|
7644
7926
|
onHover: onPresetHover
|
|
7645
|
-
}), /* @__PURE__ */ React$6.createElement("div", null, /* @__PURE__ */ React$6.createElement(PopupPanel, _extends$
|
|
7927
|
+
}), /* @__PURE__ */ React$6.createElement("div", null, /* @__PURE__ */ React$6.createElement(PopupPanel, _extends$6({}, props, {
|
|
7646
7928
|
value: popupPanelValue
|
|
7647
|
-
})), /* @__PURE__ */ React$6.createElement(Footer, _extends$
|
|
7929
|
+
})), /* @__PURE__ */ React$6.createElement(Footer, _extends$6({}, props, {
|
|
7648
7930
|
showNow: multiple ? !1 : showNow,
|
|
7649
7931
|
invalid: disableSubmit,
|
|
7650
7932
|
onSubmit: onFooterSubmit
|
|
@@ -7658,7 +7940,7 @@ function Popup$2(props) {
|
|
|
7658
7940
|
// Used for Today Button style, safe to remove if no need
|
|
7659
7941
|
"".concat(prefixCls, "-").concat(internalMode, "-panel-container")
|
|
7660
7942
|
),
|
|
7661
|
-
style: _defineProperty$
|
|
7943
|
+
style: _defineProperty$c(_defineProperty$c({}, rtl ? marginRight : marginLeft, containerOffset), rtl ? marginLeft : marginRight, "auto"),
|
|
7662
7944
|
onFocus,
|
|
7663
7945
|
onBlur: onBlur2
|
|
7664
7946
|
}, mergedNodes);
|
|
@@ -7671,7 +7953,7 @@ function Popup$2(props) {
|
|
|
7671
7953
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
7672
7954
|
ref: arrowRef,
|
|
7673
7955
|
className: "".concat(prefixCls, "-range-arrow"),
|
|
7674
|
-
style: _defineProperty$
|
|
7956
|
+
style: _defineProperty$c({}, offsetUnit, activeOffset)
|
|
7675
7957
|
}), /* @__PURE__ */ React$6.createElement(RefResizeObserver, {
|
|
7676
7958
|
onResize: onResize2
|
|
7677
7959
|
}, renderNode));
|
|
@@ -7712,7 +7994,7 @@ function useInputProps(props, postProps) {
|
|
|
7712
7994
|
var pickedAttrs = pickAttrs(props, {
|
|
7713
7995
|
aria: !0,
|
|
7714
7996
|
data: !0
|
|
7715
|
-
}), inputProps = _objectSpread2$
|
|
7997
|
+
}), inputProps = _objectSpread2$2(_objectSpread2$2({}, pickedAttrs), {}, {
|
|
7716
7998
|
// ============== Shared ==============
|
|
7717
7999
|
format: maskFormat,
|
|
7718
8000
|
validateFormat: /* @__PURE__ */ __name(function(text) {
|
|
@@ -7790,15 +8072,15 @@ function useRootProps(props) {
|
|
|
7790
8072
|
__name(useRootProps, "useRootProps");
|
|
7791
8073
|
var _excluded$u = ["icon", "type"], _excluded2$5 = ["onClear"];
|
|
7792
8074
|
function Icon$1(props) {
|
|
7793
|
-
var icon = props.icon, type2 = props.type, restProps = _objectWithoutProperties$
|
|
7794
|
-
return icon ? /* @__PURE__ */ React$6.createElement("span", _extends$
|
|
8075
|
+
var icon = props.icon, type2 = props.type, restProps = _objectWithoutProperties$2(props, _excluded$u), _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls;
|
|
8076
|
+
return icon ? /* @__PURE__ */ React$6.createElement("span", _extends$6({
|
|
7795
8077
|
className: "".concat(prefixCls, "-").concat(type2)
|
|
7796
8078
|
}, restProps), icon) : null;
|
|
7797
8079
|
}
|
|
7798
8080
|
__name(Icon$1, "Icon$1");
|
|
7799
8081
|
function ClearIcon(_ref) {
|
|
7800
|
-
var onClear = _ref.onClear, restProps = _objectWithoutProperties$
|
|
7801
|
-
return /* @__PURE__ */ React$6.createElement(Icon$1, _extends$
|
|
8082
|
+
var onClear = _ref.onClear, restProps = _objectWithoutProperties$2(_ref, _excluded2$5);
|
|
8083
|
+
return /* @__PURE__ */ React$6.createElement(Icon$1, _extends$6({}, restProps, {
|
|
7802
8084
|
type: "clear",
|
|
7803
8085
|
role: "button",
|
|
7804
8086
|
onMouseDown: /* @__PURE__ */ __name(function(e2) {
|
|
@@ -7812,7 +8094,7 @@ function ClearIcon(_ref) {
|
|
|
7812
8094
|
__name(ClearIcon, "ClearIcon");
|
|
7813
8095
|
var FORMAT_KEYS = ["YYYY", "MM", "DD", "HH", "mm", "ss", "SSS"], REPLACE_KEY = "顧", MaskFormat = /* @__PURE__ */ function() {
|
|
7814
8096
|
function MaskFormat2(format2) {
|
|
7815
|
-
_classCallCheck$
|
|
8097
|
+
_classCallCheck$2(this, MaskFormat2), _defineProperty$c(this, "format", void 0), _defineProperty$c(this, "maskFormat", void 0), _defineProperty$c(this, "cells", void 0), _defineProperty$c(this, "maskCells", void 0), this.format = format2;
|
|
7816
8098
|
var replaceKeys = FORMAT_KEYS.map(function(key) {
|
|
7817
8099
|
return "(".concat(key, ")");
|
|
7818
8100
|
}).join("|"), replaceReg = new RegExp(replaceKeys, "g");
|
|
@@ -7838,7 +8120,7 @@ var FORMAT_KEYS = ["YYYY", "MM", "DD", "HH", "mm", "ss", "SSS"], REPLACE_KEY = "
|
|
|
7838
8120
|
return cell.mask;
|
|
7839
8121
|
});
|
|
7840
8122
|
}
|
|
7841
|
-
return __name(MaskFormat2, "MaskFormat"), _createClass$
|
|
8123
|
+
return __name(MaskFormat2, "MaskFormat"), _createClass$2(MaskFormat2, [{
|
|
7842
8124
|
key: "getSelection",
|
|
7843
8125
|
value: /* @__PURE__ */ __name(function(maskCellIndex) {
|
|
7844
8126
|
var _ref = this.maskCells[maskCellIndex] || {}, start = _ref.start, end = _ref.end;
|
|
@@ -7891,7 +8173,7 @@ __name(getMaskRange, "getMaskRange");
|
|
|
7891
8173
|
var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateFormat", "onChange", "onInput", "helped", "onHelp", "onSubmit", "onKeyDown", "preserveInvalidOnBlur", "invalid", "clearIcon"], Input$3 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
7892
8174
|
var active = props.active, _props$showActiveCls = props.showActiveCls, showActiveCls = _props$showActiveCls === void 0 ? !0 : _props$showActiveCls, suffixIcon = props.suffixIcon, format2 = props.format, validateFormat = props.validateFormat, onChange = props.onChange;
|
|
7893
8175
|
props.onInput;
|
|
7894
|
-
var helped = props.helped, onHelp = props.onHelp, onSubmit = props.onSubmit, onKeyDown2 = props.onKeyDown, _props$preserveInvali = props.preserveInvalidOnBlur, preserveInvalidOnBlur = _props$preserveInvali === void 0 ? !1 : _props$preserveInvali, invalid = props.invalid, clearIcon = props.clearIcon, restProps = _objectWithoutProperties$
|
|
8176
|
+
var helped = props.helped, onHelp = props.onHelp, onSubmit = props.onSubmit, onKeyDown2 = props.onKeyDown, _props$preserveInvali = props.preserveInvalidOnBlur, preserveInvalidOnBlur = _props$preserveInvali === void 0 ? !1 : _props$preserveInvali, invalid = props.invalid, clearIcon = props.clearIcon, restProps = _objectWithoutProperties$2(props, _excluded$t), value = props.value, onFocus = props.onFocus, onBlur2 = props.onBlur, onMouseUp = props.onMouseUp, _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, _React$useContext$inp = _React$useContext.input, Component = _React$useContext$inp === void 0 ? "input" : _React$useContext$inp, inputPrefixCls = "".concat(prefixCls, "-input"), _React$useState = React$6.useState(!1), _React$useState2 = _slicedToArray$2(_React$useState, 2), focused = _React$useState2[0], setFocused = _React$useState2[1], _React$useState3 = React$6.useState(value), _React$useState4 = _slicedToArray$2(_React$useState3, 2), internalInputValue = _React$useState4[0], setInputValue = _React$useState4[1], _React$useState5 = React$6.useState(""), _React$useState6 = _slicedToArray$2(_React$useState5, 2), focusCellText = _React$useState6[0], setFocusCellText = _React$useState6[1], _React$useState7 = React$6.useState(null), _React$useState8 = _slicedToArray$2(_React$useState7, 2), focusCellIndex = _React$useState8[0], setFocusCellIndex = _React$useState8[1], _React$useState9 = React$6.useState(null), _React$useState10 = _slicedToArray$2(_React$useState9, 2), forceSelectionSyncMark = _React$useState10[0], forceSelectionSync = _React$useState10[1], inputValue = internalInputValue || "";
|
|
7895
8177
|
React$6.useEffect(function() {
|
|
7896
8178
|
setInputValue(value);
|
|
7897
8179
|
}, [value]);
|
|
@@ -7912,7 +8194,7 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
7912
8194
|
return new MaskFormat(format2 || "");
|
|
7913
8195
|
}, [format2]), _React$useMemo = React$6.useMemo(function() {
|
|
7914
8196
|
return helped ? [0, 0] : maskFormat.getSelection(focusCellIndex);
|
|
7915
|
-
}, [maskFormat, focusCellIndex, helped]), _React$useMemo2 = _slicedToArray$
|
|
8197
|
+
}, [maskFormat, focusCellIndex, helped]), _React$useMemo2 = _slicedToArray$2(_React$useMemo, 2), selectionStart = _React$useMemo2[0], selectionEnd = _React$useMemo2[1], onModify = /* @__PURE__ */ __name(function(text) {
|
|
7916
8198
|
text && text !== format2 && text !== value && onHelp();
|
|
7917
8199
|
}, "onModify2"), triggerInputChange = useEvent(function(text) {
|
|
7918
8200
|
validateFormat(text) && onChange(text), setInputValue(text), onModify(text);
|
|
@@ -7949,7 +8231,7 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
7949
8231
|
return nextIndex = Math.max(nextIndex, 0), nextIndex = Math.min(nextIndex, maskFormat.size() - 1), nextIndex;
|
|
7950
8232
|
});
|
|
7951
8233
|
}, "offsetCellIndex2"), offsetCellValue = /* @__PURE__ */ __name(function(offset2) {
|
|
7952
|
-
var _getMaskRange = getMaskRange(cellFormat), _getMaskRange2 = _slicedToArray$
|
|
8234
|
+
var _getMaskRange = getMaskRange(cellFormat), _getMaskRange2 = _slicedToArray$2(_getMaskRange, 3), rangeStart = _getMaskRange2[0], rangeEnd = _getMaskRange2[1], rangeDefault = _getMaskRange2[2], currentText = inputValue.slice(selectionStart, selectionEnd), currentTextNum = Number(currentText);
|
|
7953
8235
|
if (isNaN(currentTextNum))
|
|
7954
8236
|
return String(rangeDefault || (offset2 > 0 ? rangeStart : rangeEnd));
|
|
7955
8237
|
var num = currentTextNum + offset2, range = rangeEnd - rangeStart + 1;
|
|
@@ -8010,8 +8292,8 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
8010
8292
|
} : {};
|
|
8011
8293
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
8012
8294
|
ref: holderRef,
|
|
8013
|
-
className: clsx(inputPrefixCls, _defineProperty$
|
|
8014
|
-
}, /* @__PURE__ */ React$6.createElement(Component, _extends$
|
|
8295
|
+
className: clsx(inputPrefixCls, _defineProperty$c(_defineProperty$c({}, "".concat(inputPrefixCls, "-active"), active && showActiveCls), "".concat(inputPrefixCls, "-placeholder"), helped))
|
|
8296
|
+
}, /* @__PURE__ */ React$6.createElement(Component, _extends$6({
|
|
8015
8297
|
ref: inputRef,
|
|
8016
8298
|
"aria-invalid": invalid,
|
|
8017
8299
|
autoComplete: "off"
|
|
@@ -8320,7 +8602,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8320
8602
|
props.onOpenChange;
|
|
8321
8603
|
var _onMouseDown = props.onMouseDown;
|
|
8322
8604
|
props.required, props["aria-required"];
|
|
8323
|
-
var autoFocus = props.autoFocus, removeIcon = props.removeIcon, restProps = _objectWithoutProperties$
|
|
8605
|
+
var autoFocus = props.autoFocus, removeIcon = props.removeIcon, restProps = _objectWithoutProperties$2(props, _excluded$p), rtl = direction === "rtl", _React$useContext = React$6.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, rootRef = React$6.useRef(), inputRef = React$6.useRef();
|
|
8324
8606
|
React$6.useImperativeHandle(ref, function() {
|
|
8325
8607
|
return {
|
|
8326
8608
|
nativeElement: rootRef.current,
|
|
@@ -8341,7 +8623,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8341
8623
|
return oriDate && !isSame(generateConfig2, locale, oriDate, date, internalPicker);
|
|
8342
8624
|
});
|
|
8343
8625
|
onChange(nextValues), open || onSubmit();
|
|
8344
|
-
}, "onMultipleRemove2"), _useInputProps = useInputProps(_objectSpread2$
|
|
8626
|
+
}, "onMultipleRemove2"), _useInputProps = useInputProps(_objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
8345
8627
|
onChange: onSingleChange
|
|
8346
8628
|
}), function(_ref) {
|
|
8347
8629
|
var valueTexts = _ref.valueTexts;
|
|
@@ -8349,7 +8631,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8349
8631
|
value: valueTexts[0] || "",
|
|
8350
8632
|
active: focused
|
|
8351
8633
|
};
|
|
8352
|
-
}), _useInputProps2 = _slicedToArray$
|
|
8634
|
+
}), _useInputProps2 = _slicedToArray$2(_useInputProps, 2), getInputProps = _useInputProps2[0], getText = _useInputProps2[1], showClear = !!(clearIcon && value.length && !disabled), selectorNode = multiple ? /* @__PURE__ */ React$6.createElement(React$6.Fragment, null, /* @__PURE__ */ React$6.createElement(MultipleDates, {
|
|
8353
8635
|
prefixCls,
|
|
8354
8636
|
value,
|
|
8355
8637
|
onRemove: onMultipleRemove,
|
|
@@ -8370,7 +8652,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8370
8652
|
}), showClear && /* @__PURE__ */ React$6.createElement(ClearIcon, {
|
|
8371
8653
|
icon: clearIcon,
|
|
8372
8654
|
onClear
|
|
8373
|
-
})) : /* @__PURE__ */ React$6.createElement(Input$3, _extends$
|
|
8655
|
+
})) : /* @__PURE__ */ React$6.createElement(Input$3, _extends$6({
|
|
8374
8656
|
ref: inputRef
|
|
8375
8657
|
}, getInputProps(), {
|
|
8376
8658
|
autoFocus,
|
|
@@ -8381,8 +8663,8 @@ function SingleSelector$1(props, ref) {
|
|
|
8381
8663
|
}),
|
|
8382
8664
|
showActiveCls: !1
|
|
8383
8665
|
}));
|
|
8384
|
-
return /* @__PURE__ */ React$6.createElement("div", _extends$
|
|
8385
|
-
className: clsx(prefixCls, _defineProperty$
|
|
8666
|
+
return /* @__PURE__ */ React$6.createElement("div", _extends$6({}, rootProps, {
|
|
8667
|
+
className: clsx(prefixCls, _defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c({}, "".concat(prefixCls, "-multiple"), multiple), "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-invalid"), invalid), "".concat(prefixCls, "-rtl"), rtl), className),
|
|
8386
8668
|
style: style2,
|
|
8387
8669
|
ref: rootRef,
|
|
8388
8670
|
onClick,
|
|
@@ -8395,28 +8677,28 @@ function SingleSelector$1(props, ref) {
|
|
|
8395
8677
|
__name(SingleSelector$1, "SingleSelector$1");
|
|
8396
8678
|
var RefSingleSelector = /* @__PURE__ */ React$6.forwardRef(SingleSelector$1);
|
|
8397
8679
|
function Picker2(props, ref) {
|
|
8398
|
-
var _useFilledProps = useFilledProps(props), _useFilledProps2 = _slicedToArray$
|
|
8680
|
+
var _useFilledProps = useFilledProps(props), _useFilledProps2 = _slicedToArray$2(_useFilledProps, 6), filledProps = _useFilledProps2[0], internalPicker = _useFilledProps2[1], complexPicker = _useFilledProps2[2], formatList = _useFilledProps2[3], maskFormat = _useFilledProps2[4], isInvalidateDate = _useFilledProps2[5], _ref = filledProps, prefixCls = _ref.prefixCls, styles2 = _ref.styles, classNames = _ref.classNames, order = _ref.order, defaultValue = _ref.defaultValue, value = _ref.value, needConfirm = _ref.needConfirm, onChange = _ref.onChange, onKeyDown2 = _ref.onKeyDown, disabled = _ref.disabled, disabledDate = _ref.disabledDate, minDate = _ref.minDate, maxDate = _ref.maxDate, defaultOpen = _ref.defaultOpen, open = _ref.open, onOpenChange = _ref.onOpenChange, locale = _ref.locale, generateConfig2 = _ref.generateConfig, picker = _ref.picker, showNow = _ref.showNow, showToday = _ref.showToday, showTime = _ref.showTime, mode = _ref.mode, onPanelChange = _ref.onPanelChange, onCalendarChange = _ref.onCalendarChange, onOk = _ref.onOk, multiple = _ref.multiple, defaultPickerValue = _ref.defaultPickerValue, pickerValue = _ref.pickerValue, onPickerValueChange = _ref.onPickerValueChange, inputReadOnly = _ref.inputReadOnly, suffixIcon = _ref.suffixIcon, removeIcon = _ref.removeIcon, onFocus = _ref.onFocus, onBlur2 = _ref.onBlur, presets = _ref.presets, components = _ref.components, cellRender = _ref.cellRender, dateRender = _ref.dateRender, monthCellRender = _ref.monthCellRender, onClick = _ref.onClick, selectorRef = usePickerRef(ref);
|
|
8399
8681
|
function pickerParam(values3) {
|
|
8400
8682
|
return values3 === null ? null : multiple ? values3 : values3[0];
|
|
8401
8683
|
}
|
|
8402
8684
|
__name(pickerParam, "pickerParam");
|
|
8403
|
-
var toggleDates = useToggleDates(generateConfig2, locale, internalPicker), _useOpen = useOpen(open, defaultOpen, [disabled], onOpenChange), _useOpen2 = _slicedToArray$
|
|
8685
|
+
var toggleDates = useToggleDates(generateConfig2, locale, internalPicker), _useOpen = useOpen(open, defaultOpen, [disabled], onOpenChange), _useOpen2 = _slicedToArray$2(_useOpen, 2), mergedOpen = _useOpen2[0], triggerOpen = _useOpen2[1], onInternalCalendarChange = /* @__PURE__ */ __name(function(dates, dateStrings, info) {
|
|
8404
8686
|
if (onCalendarChange) {
|
|
8405
|
-
var filteredInfo = _objectSpread2$
|
|
8687
|
+
var filteredInfo = _objectSpread2$2({}, info);
|
|
8406
8688
|
delete filteredInfo.range, onCalendarChange(pickerParam(dates), pickerParam(dateStrings), filteredInfo);
|
|
8407
8689
|
}
|
|
8408
8690
|
}, "onInternalCalendarChange2"), onInternalOk = /* @__PURE__ */ __name(function(dates) {
|
|
8409
8691
|
onOk == null || onOk(pickerParam(dates));
|
|
8410
|
-
}, "onInternalOk2"), _useInnerValue = useInnerValue(generateConfig2, locale, formatList, !1, order, defaultValue, value, onInternalCalendarChange, onInternalOk), _useInnerValue2 = _slicedToArray$
|
|
8692
|
+
}, "onInternalOk2"), _useInnerValue = useInnerValue(generateConfig2, locale, formatList, !1, order, defaultValue, value, onInternalCalendarChange, onInternalOk), _useInnerValue2 = _slicedToArray$2(_useInnerValue, 5), mergedValue = _useInnerValue2[0], setInnerValue = _useInnerValue2[1], getCalendarValue = _useInnerValue2[2], triggerCalendarChange = _useInnerValue2[3], triggerOk = _useInnerValue2[4], calendarValue = getCalendarValue(), _useRangeActive = useRangeActive([disabled]), _useRangeActive2 = _slicedToArray$2(_useRangeActive, 4), focused = _useRangeActive2[0], triggerFocus2 = _useRangeActive2[1], lastOperation = _useRangeActive2[2], activeIndex = _useRangeActive2[3], onSharedFocus = /* @__PURE__ */ __name(function(event) {
|
|
8411
8693
|
triggerFocus2(!0), onFocus == null || onFocus(event, {});
|
|
8412
8694
|
}, "onSharedFocus2"), onSharedBlur = /* @__PURE__ */ __name(function(event) {
|
|
8413
8695
|
triggerFocus2(!1), onBlur2 == null || onBlur2(event, {});
|
|
8414
8696
|
}, "onSharedBlur2"), _useMergedState = useMergedState(picker, {
|
|
8415
8697
|
value: mode
|
|
8416
|
-
}), _useMergedState2 = _slicedToArray$
|
|
8698
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedMode = _useMergedState2[0], setMode = _useMergedState2[1], internalMode = mergedMode === "date" && showTime ? "datetime" : mergedMode, mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday), onInternalChange = onChange && function(dates, dateStrings) {
|
|
8417
8699
|
onChange(pickerParam(dates), pickerParam(dateStrings));
|
|
8418
8700
|
}, _useRangeValue = useRangeValue(
|
|
8419
|
-
_objectSpread2$
|
|
8701
|
+
_objectSpread2$2(_objectSpread2$2({}, filledProps), {}, {
|
|
8420
8702
|
onChange: onInternalChange
|
|
8421
8703
|
}),
|
|
8422
8704
|
mergedValue,
|
|
@@ -8429,13 +8711,13 @@ function Picker2(props, ref) {
|
|
|
8429
8711
|
focused,
|
|
8430
8712
|
mergedOpen,
|
|
8431
8713
|
isInvalidateDate
|
|
8432
|
-
), _useRangeValue2 = _slicedToArray$
|
|
8714
|
+
), _useRangeValue2 = _slicedToArray$2(_useRangeValue, 2), triggerSubmitChange = _useRangeValue2[1], _useFieldsInvalidate = useFieldsInvalidate(calendarValue, isInvalidateDate), _useFieldsInvalidate2 = _slicedToArray$2(_useFieldsInvalidate, 2), submitInvalidates = _useFieldsInvalidate2[0], onSelectorInvalid = _useFieldsInvalidate2[1], submitInvalidate = React$6.useMemo(function() {
|
|
8433
8715
|
return submitInvalidates.some(function(invalidated) {
|
|
8434
8716
|
return invalidated;
|
|
8435
8717
|
});
|
|
8436
8718
|
}, [submitInvalidates]), onInternalPickerValueChange = /* @__PURE__ */ __name(function(dates, info) {
|
|
8437
8719
|
if (onPickerValueChange) {
|
|
8438
|
-
var cleanInfo = _objectSpread2$
|
|
8720
|
+
var cleanInfo = _objectSpread2$2(_objectSpread2$2({}, info), {}, {
|
|
8439
8721
|
mode: info.mode[0]
|
|
8440
8722
|
});
|
|
8441
8723
|
delete cleanInfo.range, onPickerValueChange(dates[0], cleanInfo);
|
|
@@ -8456,7 +8738,7 @@ function Picker2(props, ref) {
|
|
|
8456
8738
|
onInternalPickerValueChange,
|
|
8457
8739
|
minDate,
|
|
8458
8740
|
maxDate
|
|
8459
|
-
), _useRangePickerValue2 = _slicedToArray$
|
|
8741
|
+
), _useRangePickerValue2 = _slicedToArray$2(_useRangePickerValue, 2), currentPickerValue = _useRangePickerValue2[0], setCurrentPickerValue = _useRangePickerValue2[1], triggerModeChange = useEvent(function(nextPickerValue, nextMode, triggerEvent) {
|
|
8460
8742
|
if (setMode(nextMode), onPanelChange && triggerEvent !== !1) {
|
|
8461
8743
|
var lastPickerValue = nextPickerValue || calendarValue[calendarValue.length - 1];
|
|
8462
8744
|
onPanelChange(lastPickerValue, nextMode);
|
|
@@ -8471,7 +8753,7 @@ function Picker2(props, ref) {
|
|
|
8471
8753
|
triggerSubmitChange(null), triggerOpen(!1, {
|
|
8472
8754
|
force: !0
|
|
8473
8755
|
});
|
|
8474
|
-
}, "onSelectorClear2"), _React$useState = React$6.useState(null), _React$useState2 = _slicedToArray$
|
|
8756
|
+
}, "onSelectorClear2"), _React$useState = React$6.useState(null), _React$useState2 = _slicedToArray$2(_React$useState, 2), hoverSource = _React$useState2[0], setHoverSource = _React$useState2[1], _React$useState3 = React$6.useState(null), _React$useState4 = _slicedToArray$2(_React$useState3, 2), internalHoverValue = _React$useState4[0], setInternalHoverValue = _React$useState4[1], hoverValues = React$6.useMemo(function() {
|
|
8475
8757
|
var values3 = [internalHoverValue].concat(_toConsumableArray$3(calendarValue)).filter(function(date) {
|
|
8476
8758
|
return date;
|
|
8477
8759
|
});
|
|
@@ -8505,10 +8787,10 @@ function Picker2(props, ref) {
|
|
|
8505
8787
|
triggerOpen(!1);
|
|
8506
8788
|
}, "onPopupClose2"), onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender), panelProps = React$6.useMemo(function() {
|
|
8507
8789
|
var domProps = pickAttrs(filledProps, !1), restProps = omit$2(filledProps, [].concat(_toConsumableArray$3(Object.keys(domProps)), ["onChange", "onCalendarChange", "style", "className", "onPanelChange"]));
|
|
8508
|
-
return _objectSpread2$
|
|
8790
|
+
return _objectSpread2$2(_objectSpread2$2({}, restProps), {}, {
|
|
8509
8791
|
multiple: filledProps.multiple
|
|
8510
8792
|
});
|
|
8511
|
-
}, [filledProps]), panel = /* @__PURE__ */ React$6.createElement(Popup$2, _extends$
|
|
8793
|
+
}, [filledProps]), panel = /* @__PURE__ */ React$6.createElement(Popup$2, _extends$6({}, panelProps, {
|
|
8512
8794
|
showNow: mergedShowNow,
|
|
8513
8795
|
showTime,
|
|
8514
8796
|
disabledDate,
|
|
@@ -8564,7 +8846,7 @@ function Picker2(props, ref) {
|
|
|
8564
8846
|
!mergedOpen && lastOp === "input" && (triggerOpen(!1), triggerConfirm()), !mergedOpen && complexPicker && !needConfirm && lastOp === "panel" && (triggerOpen(!0), triggerConfirm());
|
|
8565
8847
|
}, [mergedOpen]), /* @__PURE__ */ React$6.createElement(PickerContext.Provider, {
|
|
8566
8848
|
value: context
|
|
8567
|
-
}, /* @__PURE__ */ React$6.createElement(PickerTrigger, _extends$
|
|
8849
|
+
}, /* @__PURE__ */ React$6.createElement(PickerTrigger, _extends$6({}, pickTriggerProps(filledProps), {
|
|
8568
8850
|
popupElement: panel,
|
|
8569
8851
|
popupStyle: styles2.popup,
|
|
8570
8852
|
popupClassName: classNames.popup,
|
|
@@ -8572,7 +8854,7 @@ function Picker2(props, ref) {
|
|
|
8572
8854
|
onClose: onPopupClose
|
|
8573
8855
|
}), /* @__PURE__ */ React$6.createElement(
|
|
8574
8856
|
RefSingleSelector,
|
|
8575
|
-
_extends$
|
|
8857
|
+
_extends$6({}, filledProps, {
|
|
8576
8858
|
// Ref
|
|
8577
8859
|
ref: selectorRef,
|
|
8578
8860
|
suffixIcon,
|
|
@@ -8604,7 +8886,7 @@ function Picker2(props, ref) {
|
|
|
8604
8886
|
)));
|
|
8605
8887
|
}
|
|
8606
8888
|
__name(Picker2, "Picker");
|
|
8607
|
-
var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interopRequireDefault = { exports: {} };
|
|
8889
|
+
var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interopRequireDefault$1 = { exports: {} };
|
|
8608
8890
|
(function(module) {
|
|
8609
8891
|
function _interopRequireDefault2(e2) {
|
|
8610
8892
|
return e2 && e2.__esModule ? e2 : {
|
|
@@ -8612,8 +8894,8 @@ var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interop
|
|
|
8612
8894
|
};
|
|
8613
8895
|
}
|
|
8614
8896
|
__name(_interopRequireDefault2, "_interopRequireDefault"), module.exports = _interopRequireDefault2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
8615
|
-
})(interopRequireDefault);
|
|
8616
|
-
var interopRequireDefaultExports = interopRequireDefault.exports, warning$1 = {};
|
|
8897
|
+
})(interopRequireDefault$1);
|
|
8898
|
+
var interopRequireDefaultExports$1 = interopRequireDefault$1.exports, warning$1 = {};
|
|
8617
8899
|
Object.defineProperty(warning$1, "__esModule", {
|
|
8618
8900
|
value: !0
|
|
8619
8901
|
});
|
|
@@ -8653,7 +8935,7 @@ warningOnce.preMessage = preMessage;
|
|
|
8653
8935
|
warningOnce.resetWarned = resetWarned;
|
|
8654
8936
|
warningOnce.noteOnce = noteOnce;
|
|
8655
8937
|
warning$1.default = warningOnce;
|
|
8656
|
-
var _interopRequireDefault$a = interopRequireDefaultExports.default;
|
|
8938
|
+
var _interopRequireDefault$a = interopRequireDefaultExports$1.default;
|
|
8657
8939
|
Object.defineProperty(dayjs, "__esModule", {
|
|
8658
8940
|
value: !0
|
|
8659
8941
|
});
|
|
@@ -9250,9 +9532,9 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9250
9532
|
nativeElement: groupRef.current || containerRef.current
|
|
9251
9533
|
};
|
|
9252
9534
|
}), hasAffix) {
|
|
9253
|
-
var
|
|
9535
|
+
var clearIcon = null;
|
|
9254
9536
|
if (allowClear) {
|
|
9255
|
-
var
|
|
9537
|
+
var needClear = !disabled && !readOnly && value, clearIconCls = "".concat(prefixCls, "-clear-icon"), iconNode = _typeof$3(allowClear) === "object" && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : "✖";
|
|
9256
9538
|
clearIcon = /* @__PURE__ */ React__default.createElement("span", {
|
|
9257
9539
|
onClick: /* @__PURE__ */ __name(function(event) {
|
|
9258
9540
|
handleReset == null || handleReset(event), onClear == null || onClear();
|
|
@@ -9260,16 +9542,16 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9260
9542
|
onMouseDown: /* @__PURE__ */ __name(function(e2) {
|
|
9261
9543
|
return e2.preventDefault();
|
|
9262
9544
|
}, "onMouseDown"),
|
|
9263
|
-
className: clsx(clearIconCls, (
|
|
9545
|
+
className: clsx(clearIconCls, _defineProperty$c(_defineProperty$c({}, "".concat(clearIconCls, "-hidden"), !needClear), "".concat(clearIconCls, "-has-suffix"), !!suffix)),
|
|
9264
9546
|
role: "button",
|
|
9265
9547
|
tabIndex: -1
|
|
9266
9548
|
}, iconNode);
|
|
9267
9549
|
}
|
|
9268
|
-
var affixWrapperPrefixCls = "".concat(prefixCls, "-affix-wrapper"), affixWrapperCls = clsx(affixWrapperPrefixCls, (
|
|
9550
|
+
var affixWrapperPrefixCls = "".concat(prefixCls, "-affix-wrapper"), affixWrapperCls = clsx(affixWrapperPrefixCls, _defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c(_defineProperty$c({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(affixWrapperPrefixCls, "-disabled"), disabled), "".concat(affixWrapperPrefixCls, "-focused"), focused), "".concat(affixWrapperPrefixCls, "-readonly"), readOnly), "".concat(affixWrapperPrefixCls, "-input-with-clear-btn"), suffix && allowClear && value), classes == null ? void 0 : classes.affixWrapper, classNames == null ? void 0 : classNames.affixWrapper, classNames == null ? void 0 : classNames.variant), suffixNode = (suffix || allowClear) && /* @__PURE__ */ React__default.createElement("span", {
|
|
9269
9551
|
className: clsx("".concat(prefixCls, "-suffix"), classNames == null ? void 0 : classNames.suffix),
|
|
9270
9552
|
style: styles2 == null ? void 0 : styles2.suffix
|
|
9271
9553
|
}, clearIcon, suffix);
|
|
9272
|
-
element2 = /* @__PURE__ */ React__default.createElement(AffixWrapperComponent, _extends$
|
|
9554
|
+
element2 = /* @__PURE__ */ React__default.createElement(AffixWrapperComponent, _extends$6({
|
|
9273
9555
|
className: affixWrapperCls,
|
|
9274
9556
|
style: styles2 == null ? void 0 : styles2.affixWrapper,
|
|
9275
9557
|
onClick: onInputClick
|
|
@@ -9281,7 +9563,7 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9281
9563
|
}, prefix), element2, suffixNode);
|
|
9282
9564
|
}
|
|
9283
9565
|
if (hasAddon(props)) {
|
|
9284
|
-
var wrapperCls = "".concat(prefixCls, "-group"), addonCls = "".concat(wrapperCls, "-addon"), groupWrapperCls = "".concat(wrapperCls, "-wrapper"), mergedWrapperClassName = clsx("".concat(prefixCls, "-wrapper"), wrapperCls, classes == null ? void 0 : classes.wrapper, classNames == null ? void 0 : classNames.wrapper), mergedGroupClassName = clsx(groupWrapperCls, _defineProperty$
|
|
9566
|
+
var wrapperCls = "".concat(prefixCls, "-group"), addonCls = "".concat(wrapperCls, "-addon"), groupWrapperCls = "".concat(wrapperCls, "-wrapper"), mergedWrapperClassName = clsx("".concat(prefixCls, "-wrapper"), wrapperCls, classes == null ? void 0 : classes.wrapper, classNames == null ? void 0 : classNames.wrapper), mergedGroupClassName = clsx(groupWrapperCls, _defineProperty$c({}, "".concat(groupWrapperCls, "-disabled"), disabled), classes == null ? void 0 : classes.group, classNames == null ? void 0 : classNames.groupWrapper);
|
|
9285
9567
|
element2 = /* @__PURE__ */ React__default.createElement(GroupWrapperComponent, {
|
|
9286
9568
|
className: mergedGroupClassName,
|
|
9287
9569
|
ref: groupRef
|
|
@@ -9295,16 +9577,16 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9295
9577
|
}
|
|
9296
9578
|
return /* @__PURE__ */ React__default.cloneElement(element2, {
|
|
9297
9579
|
className: clsx((_element$props = element2.props) === null || _element$props === void 0 ? void 0 : _element$props.className, className) || null,
|
|
9298
|
-
style: _objectSpread2$
|
|
9580
|
+
style: _objectSpread2$2(_objectSpread2$2({}, (_element$props2 = element2.props) === null || _element$props2 === void 0 ? void 0 : _element$props2.style), style2),
|
|
9299
9581
|
hidden
|
|
9300
9582
|
});
|
|
9301
9583
|
}), _excluded$n = ["show"];
|
|
9302
9584
|
function useCount(count, showCount) {
|
|
9303
9585
|
return React$6.useMemo(function() {
|
|
9304
9586
|
var mergedConfig = {};
|
|
9305
|
-
showCount && (mergedConfig.show = _typeof$
|
|
9306
|
-
var _ref = mergedConfig, show = _ref.show, rest = _objectWithoutProperties$
|
|
9307
|
-
return _objectSpread2$
|
|
9587
|
+
showCount && (mergedConfig.show = _typeof$3(showCount) === "object" && showCount.formatter ? showCount.formatter : !!showCount), mergedConfig = _objectSpread2$2(_objectSpread2$2({}, mergedConfig), count);
|
|
9588
|
+
var _ref = mergedConfig, show = _ref.show, rest = _objectWithoutProperties$2(_ref, _excluded$n);
|
|
9589
|
+
return _objectSpread2$2(_objectSpread2$2({}, rest), {}, {
|
|
9308
9590
|
show: !!show,
|
|
9309
9591
|
showFormatter: typeof show == "function" ? show : void 0,
|
|
9310
9592
|
strategy: rest.strategy || function(value) {
|
|
@@ -9315,11 +9597,11 @@ function useCount(count, showCount) {
|
|
|
9315
9597
|
}
|
|
9316
9598
|
__name(useCount, "useCount");
|
|
9317
9599
|
var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "onKeyUp", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"], Input$2 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
9318
|
-
var autoComplete = props.autoComplete, onChange = props.onChange, onFocus = props.onFocus, onBlur2 = props.onBlur, onPressEnter = props.onPressEnter, onKeyDown2 = props.onKeyDown, onKeyUp = props.onKeyUp, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-input" : _props$prefixCls, disabled = props.disabled, htmlSize = props.htmlSize, className = props.className, maxLength = props.maxLength, suffix = props.suffix, showCount = props.showCount, count = props.count, _props$type = props.type, type2 = _props$type === void 0 ? "text" : _props$type, classes = props.classes, classNames = props.classNames, styles2 = props.styles, _onCompositionStart = props.onCompositionStart, onCompositionEnd = props.onCompositionEnd, rest = _objectWithoutProperties$
|
|
9600
|
+
var autoComplete = props.autoComplete, onChange = props.onChange, onFocus = props.onFocus, onBlur2 = props.onBlur, onPressEnter = props.onPressEnter, onKeyDown2 = props.onKeyDown, onKeyUp = props.onKeyUp, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-input" : _props$prefixCls, disabled = props.disabled, htmlSize = props.htmlSize, className = props.className, maxLength = props.maxLength, suffix = props.suffix, showCount = props.showCount, count = props.count, _props$type = props.type, type2 = _props$type === void 0 ? "text" : _props$type, classes = props.classes, classNames = props.classNames, styles2 = props.styles, _onCompositionStart = props.onCompositionStart, onCompositionEnd = props.onCompositionEnd, rest = _objectWithoutProperties$2(props, _excluded$m), _useState = useState(!1), _useState2 = _slicedToArray$2(_useState, 2), focused = _useState2[0], setFocused = _useState2[1], compositionRef = useRef(!1), keyLockRef = useRef(!1), inputRef = useRef(null), holderRef = useRef(null), focus = /* @__PURE__ */ __name(function(option) {
|
|
9319
9601
|
inputRef.current && triggerFocus(inputRef.current, option);
|
|
9320
9602
|
}, "focus"), _useMergedState = useMergedState(props.defaultValue, {
|
|
9321
9603
|
value: props.value
|
|
9322
|
-
}), _useMergedState2 = _slicedToArray$
|
|
9604
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), value = _useMergedState2[0], setValue = _useMergedState2[1], formatValue2 = value == null ? "" : String(value), _useState3 = useState(null), _useState4 = _slicedToArray$2(_useState3, 2), selection = _useState4[0], setSelection = _useState4[1], countConfig = useCount(count, showCount), mergedMax = countConfig.max || maxLength, valueLength = countConfig.strategy(formatValue2), isOutOfRange = !!mergedMax && valueLength > mergedMax;
|
|
9323
9605
|
useImperativeHandle(ref, function() {
|
|
9324
9606
|
var _holderRef$current;
|
|
9325
9607
|
return {
|
|
@@ -9398,9 +9680,10 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9398
9680
|
"classes",
|
|
9399
9681
|
"htmlSize",
|
|
9400
9682
|
"styles",
|
|
9401
|
-
"classNames"
|
|
9683
|
+
"classNames",
|
|
9684
|
+
"onClear"
|
|
9402
9685
|
]);
|
|
9403
|
-
return /* @__PURE__ */ React__default.createElement("input", _extends$
|
|
9686
|
+
return /* @__PURE__ */ React__default.createElement("input", _extends$6({
|
|
9404
9687
|
autoComplete
|
|
9405
9688
|
}, otherProps, {
|
|
9406
9689
|
onChange: onInternalChange,
|
|
@@ -9408,7 +9691,7 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9408
9691
|
onBlur: handleBlur,
|
|
9409
9692
|
onKeyDown: handleKeyDown,
|
|
9410
9693
|
onKeyUp: handleKeyUp,
|
|
9411
|
-
className: clsx(prefixCls, _defineProperty$
|
|
9694
|
+
className: clsx(prefixCls, _defineProperty$c({}, "".concat(prefixCls, "-disabled"), disabled), classNames == null ? void 0 : classNames.input),
|
|
9412
9695
|
style: styles2 == null ? void 0 : styles2.input,
|
|
9413
9696
|
ref: inputRef,
|
|
9414
9697
|
size: htmlSize,
|
|
@@ -9427,13 +9710,13 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9427
9710
|
maxLength: mergedMax
|
|
9428
9711
|
}) : "".concat(valueLength).concat(hasMaxLength ? " / ".concat(mergedMax) : "");
|
|
9429
9712
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, countConfig.show && /* @__PURE__ */ React__default.createElement("span", {
|
|
9430
|
-
className: clsx("".concat(prefixCls, "-show-count-suffix"), _defineProperty$
|
|
9431
|
-
style: _objectSpread2$
|
|
9713
|
+
className: clsx("".concat(prefixCls, "-show-count-suffix"), _defineProperty$c({}, "".concat(prefixCls, "-show-count-has-suffix"), !!suffix), classNames == null ? void 0 : classNames.count),
|
|
9714
|
+
style: _objectSpread2$2({}, styles2 == null ? void 0 : styles2.count)
|
|
9432
9715
|
}, dataCount), suffix);
|
|
9433
9716
|
}
|
|
9434
9717
|
return null;
|
|
9435
9718
|
}, "getSuffix");
|
|
9436
|
-
return /* @__PURE__ */ React__default.createElement(BaseInput, _extends$
|
|
9719
|
+
return /* @__PURE__ */ React__default.createElement(BaseInput, _extends$6({}, rest, {
|
|
9437
9720
|
prefixCls,
|
|
9438
9721
|
className: clsx(className, outOfRangeCls),
|
|
9439
9722
|
handleReset,
|
|
@@ -10159,8 +10442,7 @@ const inputNumber = "univer-input-number", inputNumberFocused = "univer-input-nu
|
|
|
10159
10442
|
inputNumberHandlerDown,
|
|
10160
10443
|
inputNumberHandlerDownDisabled,
|
|
10161
10444
|
inputNumberHandlerUpDisabled
|
|
10162
|
-
}
|
|
10163
|
-
function InputNumber(props) {
|
|
10445
|
+
}, InputNumber = forwardRef((props, ref) => {
|
|
10164
10446
|
const {
|
|
10165
10447
|
className,
|
|
10166
10448
|
value,
|
|
@@ -10193,11 +10475,11 @@ function InputNumber(props) {
|
|
|
10193
10475
|
onClick,
|
|
10194
10476
|
onKeyDown: onKeyDown2,
|
|
10195
10477
|
onChange: handleChange,
|
|
10196
|
-
onPressEnter
|
|
10478
|
+
onPressEnter,
|
|
10479
|
+
ref
|
|
10197
10480
|
}
|
|
10198
10481
|
);
|
|
10199
|
-
}
|
|
10200
|
-
__name(InputNumber, "InputNumber");
|
|
10482
|
+
});
|
|
10201
10483
|
function isEqual(obj1, obj2) {
|
|
10202
10484
|
var shallow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, refSet = /* @__PURE__ */ new Set();
|
|
10203
10485
|
function deepEqual(a, b2) {
|
|
@@ -10268,7 +10550,7 @@ var PathTrackerContext = /* @__PURE__ */ React$6.createContext(EmptyList);
|
|
|
10268
10550
|
function useFullPath(eventKey) {
|
|
10269
10551
|
var parentKeyPath = React$6.useContext(PathTrackerContext);
|
|
10270
10552
|
return React$6.useMemo(function() {
|
|
10271
|
-
return eventKey !== void 0 ? [].concat(_toConsumableArray$
|
|
10553
|
+
return eventKey !== void 0 ? [].concat(_toConsumableArray$4(parentKeyPath), [eventKey]) : parentKeyPath;
|
|
10272
10554
|
}, [parentKeyPath, eventKey]);
|
|
10273
10555
|
}
|
|
10274
10556
|
__name(useFullPath, "useFullPath");
|
|
@@ -10288,7 +10570,7 @@ function focusable(node) {
|
|
|
10288
10570
|
}
|
|
10289
10571
|
__name(focusable, "focusable");
|
|
10290
10572
|
function getFocusNodeList(node) {
|
|
10291
|
-
var includePositive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, res = _toConsumableArray$
|
|
10573
|
+
var includePositive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, res = _toConsumableArray$4(node.querySelectorAll("*")).filter(function(child) {
|
|
10292
10574
|
return focusable(child, includePositive);
|
|
10293
10575
|
});
|
|
10294
10576
|
return focusable(node, includePositive) && res.unshift(node), res;
|
|
@@ -10465,11 +10747,11 @@ function useKeyRecords() {
|
|
|
10465
10747
|
return pathKeyList.includes(eventKey);
|
|
10466
10748
|
});
|
|
10467
10749
|
}, [getKeyPath]), getKeys = /* @__PURE__ */ __name(function() {
|
|
10468
|
-
var keys4 = _toConsumableArray$
|
|
10750
|
+
var keys4 = _toConsumableArray$4(key2pathRef.current.keys());
|
|
10469
10751
|
return overflowKeys.length && keys4.push(OVERFLOW_KEY), keys4;
|
|
10470
10752
|
}, "getKeys2"), getSubPathKeys = useCallback(function(key) {
|
|
10471
10753
|
var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT), pathKeys = /* @__PURE__ */ new Set();
|
|
10472
|
-
return _toConsumableArray$
|
|
10754
|
+
return _toConsumableArray$4(path2keyRef.current.keys()).forEach(function(pathKey) {
|
|
10473
10755
|
pathKey.startsWith(connectedPath) && pathKeys.add(path2keyRef.current.get(pathKey));
|
|
10474
10756
|
}), pathKeys;
|
|
10475
10757
|
}, []);
|
|
@@ -10581,7 +10863,7 @@ var _excluded$i = ["title", "attribute", "elementRef"], _excluded2$2 = ["style",
|
|
|
10581
10863
|
return {
|
|
10582
10864
|
key: eventKey,
|
|
10583
10865
|
// Note: For legacy code is reversed which not like other antd component
|
|
10584
|
-
keyPath: _toConsumableArray$
|
|
10866
|
+
keyPath: _toConsumableArray$4(connectedKeys).reverse(),
|
|
10585
10867
|
item: legacyMenuItemRef.current,
|
|
10586
10868
|
domEvent: e2
|
|
10587
10869
|
};
|
|
@@ -10651,7 +10933,7 @@ function parseChildren(children, keyPath) {
|
|
|
10651
10933
|
return toArray$3(children).map(function(child, index2) {
|
|
10652
10934
|
if (/* @__PURE__ */ React$6.isValidElement(child)) {
|
|
10653
10935
|
var _eventKey, _child$props, key = child.key, eventKey = (_eventKey = (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.eventKey) !== null && _eventKey !== void 0 ? _eventKey : key, emptyKey = eventKey == null;
|
|
10654
|
-
emptyKey && (eventKey = "tmp_key-".concat([].concat(_toConsumableArray$
|
|
10936
|
+
emptyKey && (eventKey = "tmp_key-".concat([].concat(_toConsumableArray$4(keyPath), [index2]).join("-")));
|
|
10655
10937
|
var cloneProps = {
|
|
10656
10938
|
key: eventKey,
|
|
10657
10939
|
eventKey
|
|
@@ -11075,7 +11357,7 @@ var _excluded$d = ["prefixCls", "rootClassName", "style", "className", "tabIndex
|
|
|
11075
11357
|
var targetKey = info.key, exist = mergedSelectKeys.includes(targetKey), newSelectKeys;
|
|
11076
11358
|
multiple ? exist ? newSelectKeys = mergedSelectKeys.filter(function(key) {
|
|
11077
11359
|
return key !== targetKey;
|
|
11078
|
-
}) : newSelectKeys = [].concat(_toConsumableArray$
|
|
11360
|
+
}) : newSelectKeys = [].concat(_toConsumableArray$4(mergedSelectKeys), [targetKey]) : newSelectKeys = [targetKey], setMergedSelectKeys(newSelectKeys);
|
|
11079
11361
|
var selectInfo = _objectSpread2$1(_objectSpread2$1({}, info), {}, {
|
|
11080
11362
|
selectedKeys: newSelectKeys
|
|
11081
11363
|
});
|
|
@@ -11298,7 +11580,16 @@ var _typeofExports = _typeof$1.exports;
|
|
|
11298
11580
|
}
|
|
11299
11581
|
__name(_interopRequireWildcard2, "_interopRequireWildcard"), module.exports = _interopRequireWildcard2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
11300
11582
|
})(interopRequireWildcard);
|
|
11301
|
-
var interopRequireWildcardExports = interopRequireWildcard.exports,
|
|
11583
|
+
var interopRequireWildcardExports = interopRequireWildcard.exports, interopRequireDefault = { exports: {} };
|
|
11584
|
+
(function(module) {
|
|
11585
|
+
function _interopRequireDefault2(e2) {
|
|
11586
|
+
return e2 && e2.__esModule ? e2 : {
|
|
11587
|
+
default: e2
|
|
11588
|
+
};
|
|
11589
|
+
}
|
|
11590
|
+
__name(_interopRequireDefault2, "_interopRequireDefault"), module.exports = _interopRequireDefault2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
11591
|
+
})(interopRequireDefault);
|
|
11592
|
+
var interopRequireDefaultExports = interopRequireDefault.exports, regeneratorRuntime = { exports: {} };
|
|
11302
11593
|
(function(module) {
|
|
11303
11594
|
var _typeof3 = _typeofExports.default;
|
|
11304
11595
|
function _regeneratorRuntime() {
|
|
@@ -12480,6 +12771,8 @@ function Scrollbar(props) {
|
|
|
12480
12771
|
const containerRef = useRef(null), contentRef = useRef(null), [thumbHeight, setThumbHeight] = useState(0), [thumbTop, setThumbTop] = useState(0);
|
|
12481
12772
|
useEffect(() => {
|
|
12482
12773
|
function resize() {
|
|
12774
|
+
if (!containerRef.current)
|
|
12775
|
+
return;
|
|
12483
12776
|
const { height: containerHeight } = containerRef.current.parentElement.getBoundingClientRect(), { scrollHeight } = contentRef.current;
|
|
12484
12777
|
setThumbHeight(containerHeight / scrollHeight * 100), containerRef.current.style.height = `${containerHeight}px`;
|
|
12485
12778
|
}
|
|
@@ -13066,7 +13359,7 @@ var getSeparatedContent = /* @__PURE__ */ __name(function(text, tokens, end) {
|
|
|
13066
13359
|
return [str];
|
|
13067
13360
|
var list2 = str.split(token);
|
|
13068
13361
|
return match2 = match2 || list2.length > 1, list2.reduce(function(prevList, unitStr) {
|
|
13069
|
-
return [].concat(_toConsumableArray$
|
|
13362
|
+
return [].concat(_toConsumableArray$4(prevList), _toConsumableArray$4(separate2(unitStr, restTokens)));
|
|
13070
13363
|
}, []).filter(Boolean);
|
|
13071
13364
|
}, "separate"), list = separate(text, tokens);
|
|
13072
13365
|
return match2 ? typeof end < "u" ? list.slice(0, end) : list : null;
|
|
@@ -13160,10 +13453,10 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13160
13453
|
}, [mergedOpen]), React$6.useEffect(function() {
|
|
13161
13454
|
innerOpen && disabled && setInnerOpen(!1), disabled && !blurRef.current && setMockFocused(!1);
|
|
13162
13455
|
}, [disabled]);
|
|
13163
|
-
var _useLock = useLock(), _useLock2 = _slicedToArray$1(_useLock, 2), getClearLock = _useLock2[0], setClearLock = _useLock2[1], onInternalKeyDown = /* @__PURE__ */ __name(function(event) {
|
|
13164
|
-
var clearLock = getClearLock(),
|
|
13165
|
-
if (
|
|
13166
|
-
for (var cloneDisplayValues = _toConsumableArray$
|
|
13456
|
+
var _useLock = useLock(), _useLock2 = _slicedToArray$1(_useLock, 2), getClearLock = _useLock2[0], setClearLock = _useLock2[1], keyLockRef = React$6.useRef(!1), onInternalKeyDown = /* @__PURE__ */ __name(function(event) {
|
|
13457
|
+
var clearLock = getClearLock(), key = event.key, isEnterKey = key === "Enter";
|
|
13458
|
+
if (isEnterKey && (mode !== "combobox" && event.preventDefault(), mergedOpen || onToggleOpen(!0)), setClearLock(!!mergedSearchValue), key === "Backspace" && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
|
|
13459
|
+
for (var cloneDisplayValues = _toConsumableArray$4(displayValues), removedDisplayValue = null, i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
|
|
13167
13460
|
var current = cloneDisplayValues[i];
|
|
13168
13461
|
if (!current.disabled) {
|
|
13169
13462
|
cloneDisplayValues.splice(i, 1), removedDisplayValue = current;
|
|
@@ -13177,11 +13470,11 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13177
13470
|
}
|
|
13178
13471
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)
|
|
13179
13472
|
rest[_key - 1] = arguments[_key];
|
|
13180
|
-
if (mergedOpen) {
|
|
13473
|
+
if (mergedOpen && (!isEnterKey || !keyLockRef.current)) {
|
|
13181
13474
|
var _listRef$current2;
|
|
13182
13475
|
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.onKeyDown.apply(_listRef$current2, [event].concat(rest));
|
|
13183
13476
|
}
|
|
13184
|
-
onKeyDown2 == null || onKeyDown2.apply(void 0, [event].concat(rest));
|
|
13477
|
+
isEnterKey && (keyLockRef.current = !0), onKeyDown2 == null || onKeyDown2.apply(void 0, [event].concat(rest));
|
|
13185
13478
|
}, "onInternalKeyDown2"), onInternalKeyUp = /* @__PURE__ */ __name(function(event) {
|
|
13186
13479
|
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)
|
|
13187
13480
|
rest[_key2 - 1] = arguments[_key2];
|
|
@@ -13189,7 +13482,7 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13189
13482
|
var _listRef$current3;
|
|
13190
13483
|
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || _listRef$current3.onKeyUp.apply(_listRef$current3, [event].concat(rest));
|
|
13191
13484
|
}
|
|
13192
|
-
onKeyUp == null || onKeyUp.apply(void 0, [event].concat(rest));
|
|
13485
|
+
event.key === "Enter" && (keyLockRef.current = !1), onKeyUp == null || onKeyUp.apply(void 0, [event].concat(rest));
|
|
13193
13486
|
}, "onInternalKeyUp2"), onSelectorRemove = /* @__PURE__ */ __name(function(val) {
|
|
13194
13487
|
var newValues = displayValues.filter(function(i) {
|
|
13195
13488
|
return i !== val;
|
|
@@ -13571,12 +13864,18 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
|
|
|
13571
13864
|
}, "onTouchMove"), onTouchEnd = /* @__PURE__ */ __name(function() {
|
|
13572
13865
|
touchedRef.current = !1, cleanUpEvents();
|
|
13573
13866
|
}, "onTouchEnd"), onTouchStart = /* @__PURE__ */ __name(function(e2) {
|
|
13574
|
-
cleanUpEvents(), e2.touches.length === 1 && !touchedRef.current && (touchedRef.current = !0, touchXRef.current = Math.ceil(e2.touches[0].pageX), touchYRef.current = Math.ceil(e2.touches[0].pageY), elementRef.current = e2.target, elementRef.current.addEventListener("touchmove", onTouchMove
|
|
13867
|
+
cleanUpEvents(), e2.touches.length === 1 && !touchedRef.current && (touchedRef.current = !0, touchXRef.current = Math.ceil(e2.touches[0].pageX), touchYRef.current = Math.ceil(e2.touches[0].pageY), elementRef.current = e2.target, elementRef.current.addEventListener("touchmove", onTouchMove, {
|
|
13868
|
+
passive: !1
|
|
13869
|
+
}), elementRef.current.addEventListener("touchend", onTouchEnd, {
|
|
13870
|
+
passive: !0
|
|
13871
|
+
}));
|
|
13575
13872
|
}, "onTouchStart");
|
|
13576
13873
|
cleanUpEvents = /* @__PURE__ */ __name(function() {
|
|
13577
13874
|
elementRef.current && (elementRef.current.removeEventListener("touchmove", onTouchMove), elementRef.current.removeEventListener("touchend", onTouchEnd));
|
|
13578
13875
|
}, "cleanUpEvents"), useLayoutEffect$1(function() {
|
|
13579
|
-
return inVirtual && listRef.current.addEventListener("touchstart", onTouchStart
|
|
13876
|
+
return inVirtual && listRef.current.addEventListener("touchstart", onTouchStart, {
|
|
13877
|
+
passive: !0
|
|
13878
|
+
}), function() {
|
|
13580
13879
|
var _listRef$current;
|
|
13581
13880
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.removeEventListener("touchstart", onTouchStart), cleanUpEvents(), clearInterval(intervalRef.current);
|
|
13582
13881
|
};
|
|
@@ -13691,7 +13990,11 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13691
13990
|
var onScrollbarTouchStart = /* @__PURE__ */ __name(function(e2) {
|
|
13692
13991
|
e2.preventDefault();
|
|
13693
13992
|
}, "onScrollbarTouchStart2"), scrollbarEle = scrollbarRef.current, thumbEle = thumbRef.current;
|
|
13694
|
-
return scrollbarEle.addEventListener("touchstart", onScrollbarTouchStart
|
|
13993
|
+
return scrollbarEle.addEventListener("touchstart", onScrollbarTouchStart, {
|
|
13994
|
+
passive: !1
|
|
13995
|
+
}), thumbEle.addEventListener("touchstart", onThumbMouseDown, {
|
|
13996
|
+
passive: !1
|
|
13997
|
+
}), function() {
|
|
13695
13998
|
scrollbarEle.removeEventListener("touchstart", onScrollbarTouchStart), thumbEle.removeEventListener("touchstart", onThumbMouseDown);
|
|
13696
13999
|
};
|
|
13697
14000
|
}, []);
|
|
@@ -13702,8 +14005,10 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13702
14005
|
if (dragging) {
|
|
13703
14006
|
var moveRafId, onMouseMove = /* @__PURE__ */ __name(function(e2) {
|
|
13704
14007
|
var _stateRef$current = stateRef.current, stateDragging = _stateRef$current.dragging, statePageY = _stateRef$current.pageY, stateStartTop = _stateRef$current.startTop;
|
|
13705
|
-
|
|
13706
|
-
|
|
14008
|
+
wrapperRaf.cancel(moveRafId);
|
|
14009
|
+
var rect = scrollbarRef.current.getBoundingClientRect(), scale = containerSize / (horizontal ? rect.width : rect.height);
|
|
14010
|
+
if (stateDragging) {
|
|
14011
|
+
var offset2 = (getPageXY(e2, horizontal) - statePageY) * scale, newTop = stateStartTop;
|
|
13707
14012
|
!isLTR && horizontal ? newTop -= offset2 : newTop += offset2;
|
|
13708
14013
|
var tmpEnableScrollRange = enableScrollRangeRef.current, tmpEnableOffsetRange = enableOffsetRangeRef.current, ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0, newScrollTop = Math.ceil(ptg * tmpEnableScrollRange);
|
|
13709
14014
|
newScrollTop = Math.max(newScrollTop, 0), newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange), moveRafId = wrapperRaf(function() {
|
|
@@ -13713,12 +14018,22 @@ var ScrollBar = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
13713
14018
|
}, "onMouseMove2"), onMouseUp = /* @__PURE__ */ __name(function() {
|
|
13714
14019
|
setDragging(!1), onStopMove();
|
|
13715
14020
|
}, "onMouseUp2");
|
|
13716
|
-
return window.addEventListener("mousemove", onMouseMove
|
|
14021
|
+
return window.addEventListener("mousemove", onMouseMove, {
|
|
14022
|
+
passive: !0
|
|
14023
|
+
}), window.addEventListener("touchmove", onMouseMove, {
|
|
14024
|
+
passive: !0
|
|
14025
|
+
}), window.addEventListener("mouseup", onMouseUp, {
|
|
14026
|
+
passive: !0
|
|
14027
|
+
}), window.addEventListener("touchend", onMouseUp, {
|
|
14028
|
+
passive: !0
|
|
14029
|
+
}), function() {
|
|
13717
14030
|
window.removeEventListener("mousemove", onMouseMove), window.removeEventListener("touchmove", onMouseMove), window.removeEventListener("mouseup", onMouseUp), window.removeEventListener("touchend", onMouseUp), wrapperRaf.cancel(moveRafId);
|
|
13718
14031
|
};
|
|
13719
14032
|
}
|
|
13720
14033
|
}, [dragging]), React$6.useEffect(function() {
|
|
13721
|
-
delayHidden()
|
|
14034
|
+
return delayHidden(), function() {
|
|
14035
|
+
clearTimeout(visibleTimeoutRef.current);
|
|
14036
|
+
};
|
|
13722
14037
|
}, [scrollOffset]), React$6.useImperativeHandle(ref, function() {
|
|
13723
14038
|
return {
|
|
13724
14039
|
delayHidden
|
|
@@ -13818,8 +14133,8 @@ function RawList(props, ref) {
|
|
|
13818
14133
|
height: height2
|
|
13819
14134
|
}), _React$useState2 = _slicedToArray$1(_React$useState, 2), size = _React$useState2[0], setSize = _React$useState2[1], onHolderResize = /* @__PURE__ */ __name(function(sizeInfo) {
|
|
13820
14135
|
setSize({
|
|
13821
|
-
width: sizeInfo.
|
|
13822
|
-
height: sizeInfo.
|
|
14136
|
+
width: sizeInfo.offsetWidth,
|
|
14137
|
+
height: sizeInfo.offsetHeight
|
|
13823
14138
|
});
|
|
13824
14139
|
}, "onHolderResize"), verticalScrollBarRef = useRef(), horizontalScrollBarRef = useRef(), horizontalScrollBarSpinSize = React$6.useMemo(function() {
|
|
13825
14140
|
return getSpinSize(size.width, scrollWidth);
|
|
@@ -13882,7 +14197,13 @@ function RawList(props, ref) {
|
|
|
13882
14197
|
}
|
|
13883
14198
|
__name(onMozMousePixelScroll, "onMozMousePixelScroll");
|
|
13884
14199
|
var componentEle = componentRef.current;
|
|
13885
|
-
return componentEle.addEventListener("wheel", onRawWheel
|
|
14200
|
+
return componentEle.addEventListener("wheel", onRawWheel, {
|
|
14201
|
+
passive: !1
|
|
14202
|
+
}), componentEle.addEventListener("DOMMouseScroll", onFireFoxScroll, {
|
|
14203
|
+
passive: !0
|
|
14204
|
+
}), componentEle.addEventListener("MozMousePixelScroll", onMozMousePixelScroll, {
|
|
14205
|
+
passive: !1
|
|
14206
|
+
}), function() {
|
|
13886
14207
|
componentEle.removeEventListener("wheel", onRawWheel), componentEle.removeEventListener("DOMMouseScroll", onFireFoxScroll), componentEle.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
|
|
13887
14208
|
};
|
|
13888
14209
|
}, [useVirtual]), useLayoutEffect$1(function() {
|
|
@@ -14033,7 +14354,7 @@ var OptionList = /* @__PURE__ */ __name(function(_, ref) {
|
|
|
14033
14354
|
}, [memoFlattenOptions.length, searchValue]);
|
|
14034
14355
|
var isSelected = React$6.useCallback(function(value) {
|
|
14035
14356
|
return rawValues.has(value) && mode !== "combobox";
|
|
14036
|
-
}, [mode, _toConsumableArray$
|
|
14357
|
+
}, [mode, _toConsumableArray$4(rawValues).toString(), rawValues.size]);
|
|
14037
14358
|
useEffect(function() {
|
|
14038
14359
|
var timeoutId = setTimeout(function() {
|
|
14039
14360
|
if (!multiple && open && rawValues.size === 1) {
|
|
@@ -14383,10 +14704,10 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14383
14704
|
}), filledTagOptions = React$6.useMemo(function() {
|
|
14384
14705
|
if (mode !== "tags")
|
|
14385
14706
|
return mergedOptions;
|
|
14386
|
-
var cloneOptions = _toConsumableArray$
|
|
14707
|
+
var cloneOptions = _toConsumableArray$4(mergedOptions), existOptions = /* @__PURE__ */ __name(function(val) {
|
|
14387
14708
|
return valueOptions.has(val);
|
|
14388
14709
|
}, "existOptions2");
|
|
14389
|
-
return _toConsumableArray$
|
|
14710
|
+
return _toConsumableArray$4(mergedValues).sort(function(a, b2) {
|
|
14390
14711
|
return a.value < b2.value ? -1 : 1;
|
|
14391
14712
|
}).forEach(function(item) {
|
|
14392
14713
|
var val = item.value;
|
|
@@ -14397,9 +14718,9 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14397
14718
|
return item[optionFilterProp || "value"] === mergedSearchValue;
|
|
14398
14719
|
}) || filteredOptions.some(function(item) {
|
|
14399
14720
|
return item[mergedFieldNames.value] === mergedSearchValue;
|
|
14400
|
-
}) ? filteredOptions : [createTagOption(mergedSearchValue)].concat(_toConsumableArray$
|
|
14721
|
+
}) ? filteredOptions : [createTagOption(mergedSearchValue)].concat(_toConsumableArray$4(filteredOptions));
|
|
14401
14722
|
}, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]), orderedFilteredOptions = React$6.useMemo(function() {
|
|
14402
|
-
return filterSort ? _toConsumableArray$
|
|
14723
|
+
return filterSort ? _toConsumableArray$4(filledSearchOptions).sort(function(a, b2) {
|
|
14403
14724
|
return filterSort(a, b2, {
|
|
14404
14725
|
searchValue: mergedSearchValue
|
|
14405
14726
|
});
|
|
@@ -14449,7 +14770,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14449
14770
|
}
|
|
14450
14771
|
}, "triggerSelect2"), onInternalSelect = useRefFunc(function(val, info) {
|
|
14451
14772
|
var cloneValues, mergedSelect = multiple ? info.selected : !0;
|
|
14452
|
-
mergedSelect ? cloneValues = multiple ? [].concat(_toConsumableArray$
|
|
14773
|
+
mergedSelect ? cloneValues = multiple ? [].concat(_toConsumableArray$4(mergedValues), [val]) : [val] : cloneValues = mergedValues.filter(function(v2) {
|
|
14453
14774
|
return v2.value !== val;
|
|
14454
14775
|
}), triggerChange(cloneValues), triggerSelect(val, mergedSelect), mode === "combobox" ? setActiveValue("") : (!isMultiple || autoClearSearchValue) && (setSearchValue(""), setActiveValue(""));
|
|
14455
14776
|
}), onDisplayValuesChange = /* @__PURE__ */ __name(function(nextValues, info) {
|
|
@@ -14462,7 +14783,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14462
14783
|
if (setSearchValue(searchText), setActiveValue(null), info.source === "submit") {
|
|
14463
14784
|
var formatted = (searchText || "").trim();
|
|
14464
14785
|
if (formatted) {
|
|
14465
|
-
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$
|
|
14786
|
+
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$4(rawValues), [formatted])));
|
|
14466
14787
|
triggerChange(newRawValues), triggerSelect(formatted, !0), setSearchValue("");
|
|
14467
14788
|
}
|
|
14468
14789
|
return;
|
|
@@ -14476,7 +14797,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14476
14797
|
}).filter(function(val) {
|
|
14477
14798
|
return val !== void 0;
|
|
14478
14799
|
}));
|
|
14479
|
-
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$
|
|
14800
|
+
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$4(rawValues), _toConsumableArray$4(patchValues))));
|
|
14480
14801
|
triggerChange(newRawValues), newRawValues.forEach(function(newRawValue) {
|
|
14481
14802
|
triggerSelect(newRawValue, !0);
|
|
14482
14803
|
});
|
|
@@ -14653,10 +14974,10 @@ var calcThumbStyle = /* @__PURE__ */ __name(function(targetElement) {
|
|
|
14653
14974
|
return value !== void 0 ? "".concat(value, "px") : void 0;
|
|
14654
14975
|
}, "toPX2");
|
|
14655
14976
|
function MotionThumb(props) {
|
|
14656
|
-
var prefixCls = props.prefixCls, containerRef = props.containerRef, value = props.value, getValueIndex = props.getValueIndex, motionName = props.motionName, onMotionStart = props.onMotionStart, onMotionEnd = props.onMotionEnd, direction = props.direction, thumbRef = React$6.useRef(null), _React$useState = React$6.useState(value), _React$useState2 = _slicedToArray$
|
|
14977
|
+
var prefixCls = props.prefixCls, containerRef = props.containerRef, value = props.value, getValueIndex = props.getValueIndex, motionName = props.motionName, onMotionStart = props.onMotionStart, onMotionEnd = props.onMotionEnd, direction = props.direction, thumbRef = React$6.useRef(null), _React$useState = React$6.useState(value), _React$useState2 = _slicedToArray$2(_React$useState, 2), prevValue = _React$useState2[0], setPrevValue = _React$useState2[1], findValueElement = /* @__PURE__ */ __name(function(val) {
|
|
14657
14978
|
var _containerRef$current, index2 = getValueIndex(val), ele = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelectorAll(".".concat(prefixCls, "-item"))[index2];
|
|
14658
14979
|
return (ele == null ? void 0 : ele.offsetParent) && ele;
|
|
14659
|
-
}, "findValueElement2"), _React$useState3 = React$6.useState(null), _React$useState4 = _slicedToArray$
|
|
14980
|
+
}, "findValueElement2"), _React$useState3 = React$6.useState(null), _React$useState4 = _slicedToArray$2(_React$useState3, 2), prevStyle = _React$useState4[0], setPrevStyle = _React$useState4[1], _React$useState5 = React$6.useState(null), _React$useState6 = _slicedToArray$2(_React$useState5, 2), nextStyle = _React$useState6[0], setNextStyle = _React$useState6[1];
|
|
14660
14981
|
useLayoutEffect$1(function() {
|
|
14661
14982
|
if (prevValue !== value) {
|
|
14662
14983
|
var prev = findValueElement(prevValue), next = findValueElement(value), calcPrevStyle = calcThumbStyle(prev), calcNextStyle = calcThumbStyle(next);
|
|
@@ -14688,7 +15009,7 @@ function MotionThumb(props) {
|
|
|
14688
15009
|
onAppearActive,
|
|
14689
15010
|
onVisibleChanged
|
|
14690
15011
|
}, function(_ref, ref) {
|
|
14691
|
-
var motionClassName = _ref.className, motionStyle = _ref.style, mergedStyle = _objectSpread2$
|
|
15012
|
+
var motionClassName = _ref.className, motionStyle = _ref.style, mergedStyle = _objectSpread2$2(_objectSpread2$2({}, motionStyle), {}, {
|
|
14692
15013
|
"--thumb-start-left": thumbStart,
|
|
14693
15014
|
"--thumb-start-width": toPX(prevStyle == null ? void 0 : prevStyle.width),
|
|
14694
15015
|
"--thumb-active-left": thumbActive,
|
|
@@ -14706,7 +15027,7 @@ var _excluded$6 = ["prefixCls", "direction", "options", "disabled", "defaultValu
|
|
|
14706
15027
|
function getValidTitle(option) {
|
|
14707
15028
|
if (typeof option.title < "u")
|
|
14708
15029
|
return option.title;
|
|
14709
|
-
if (_typeof$
|
|
15030
|
+
if (_typeof$3(option.label) !== "object") {
|
|
14710
15031
|
var _option$label;
|
|
14711
15032
|
return (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toString();
|
|
14712
15033
|
}
|
|
@@ -14714,9 +15035,9 @@ function getValidTitle(option) {
|
|
|
14714
15035
|
__name(getValidTitle, "getValidTitle");
|
|
14715
15036
|
function normalizeOptions(options) {
|
|
14716
15037
|
return options.map(function(option) {
|
|
14717
|
-
if (_typeof$
|
|
15038
|
+
if (_typeof$3(option) === "object" && option !== null) {
|
|
14718
15039
|
var validTitle = getValidTitle(option);
|
|
14719
|
-
return _objectSpread2$
|
|
15040
|
+
return _objectSpread2$2(_objectSpread2$2({}, option), {}, {
|
|
14720
15041
|
title: validTitle
|
|
14721
15042
|
});
|
|
14722
15043
|
}
|
|
@@ -14733,7 +15054,7 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14733
15054
|
disabled || onChange(event, value);
|
|
14734
15055
|
}, "handleChange2");
|
|
14735
15056
|
return /* @__PURE__ */ React$6.createElement("label", {
|
|
14736
|
-
className: clsx(className, _defineProperty$
|
|
15057
|
+
className: clsx(className, _defineProperty$c({}, "".concat(prefixCls, "-item-disabled"), disabled))
|
|
14737
15058
|
}, /* @__PURE__ */ React$6.createElement("input", {
|
|
14738
15059
|
className: "".concat(prefixCls, "-item-input"),
|
|
14739
15060
|
type: "radio",
|
|
@@ -14742,21 +15063,26 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14742
15063
|
onChange: handleChange
|
|
14743
15064
|
}), /* @__PURE__ */ React$6.createElement("div", {
|
|
14744
15065
|
className: "".concat(prefixCls, "-item-label"),
|
|
14745
|
-
title
|
|
15066
|
+
title,
|
|
15067
|
+
role: "option",
|
|
15068
|
+
"aria-selected": checked
|
|
14746
15069
|
}, label));
|
|
14747
15070
|
}, "InternalSegmentedOption2"), Segmented$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
14748
|
-
var _segmentedOptions$, _classNames2, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-segmented" : _props$prefixCls, direction = props.direction, _props$options = props.options, options = _props$options === void 0 ? [] : _props$options, disabled = props.disabled, defaultValue = props.defaultValue, value = props.value, onChange = props.onChange, _props$className = props.className, className = _props$className === void 0 ? "" : _props$className, _props$motionName = props.motionName, motionName = _props$motionName === void 0 ? "thumb-motion" : _props$motionName, restProps = _objectWithoutProperties$
|
|
15071
|
+
var _segmentedOptions$, _classNames2, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-segmented" : _props$prefixCls, direction = props.direction, _props$options = props.options, options = _props$options === void 0 ? [] : _props$options, disabled = props.disabled, defaultValue = props.defaultValue, value = props.value, onChange = props.onChange, _props$className = props.className, className = _props$className === void 0 ? "" : _props$className, _props$motionName = props.motionName, motionName = _props$motionName === void 0 ? "thumb-motion" : _props$motionName, restProps = _objectWithoutProperties$2(props, _excluded$6), containerRef = React$6.useRef(null), mergedRef = React$6.useMemo(function() {
|
|
14749
15072
|
return composeRef(containerRef, ref);
|
|
14750
15073
|
}, [containerRef, ref]), segmentedOptions = React$6.useMemo(function() {
|
|
14751
15074
|
return normalizeOptions(options);
|
|
14752
15075
|
}, [options]), _useMergedState = useMergedState((_segmentedOptions$ = segmentedOptions[0]) === null || _segmentedOptions$ === void 0 ? void 0 : _segmentedOptions$.value, {
|
|
14753
15076
|
value,
|
|
14754
15077
|
defaultValue
|
|
14755
|
-
}), _useMergedState2 = _slicedToArray$
|
|
15078
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), rawValue = _useMergedState2[0], setRawValue = _useMergedState2[1], _React$useState = React$6.useState(!1), _React$useState2 = _slicedToArray$2(_React$useState, 2), thumbShow = _React$useState2[0], setThumbShow = _React$useState2[1], handleChange = /* @__PURE__ */ __name(function(event, val) {
|
|
14756
15079
|
disabled || (setRawValue(val), onChange == null || onChange(val));
|
|
14757
15080
|
}, "handleChange2"), divProps = omit$2(restProps, ["children"]);
|
|
14758
|
-
return /* @__PURE__ */ React$6.createElement("div", _extends$
|
|
14759
|
-
|
|
15081
|
+
return /* @__PURE__ */ React$6.createElement("div", _extends$6({
|
|
15082
|
+
role: "listbox",
|
|
15083
|
+
"aria-label": "segmented control"
|
|
15084
|
+
}, divProps, {
|
|
15085
|
+
className: clsx(prefixCls, (_classNames2 = {}, _defineProperty$c(_classNames2, "".concat(prefixCls, "-rtl"), direction === "rtl"), _defineProperty$c(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), className),
|
|
14760
15086
|
ref: mergedRef
|
|
14761
15087
|
}), /* @__PURE__ */ React$6.createElement("div", {
|
|
14762
15088
|
className: "".concat(prefixCls, "-group")
|
|
@@ -14778,10 +15104,10 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14778
15104
|
setThumbShow(!1);
|
|
14779
15105
|
}, "onMotionEnd")
|
|
14780
15106
|
}), segmentedOptions.map(function(segmentedOption) {
|
|
14781
|
-
return /* @__PURE__ */ React$6.createElement(InternalSegmentedOption, _extends$
|
|
15107
|
+
return /* @__PURE__ */ React$6.createElement(InternalSegmentedOption, _extends$6({}, segmentedOption, {
|
|
14782
15108
|
key: segmentedOption.value,
|
|
14783
15109
|
prefixCls,
|
|
14784
|
-
className: clsx(segmentedOption.className, "".concat(prefixCls, "-item"), _defineProperty$
|
|
15110
|
+
className: clsx(segmentedOption.className, "".concat(prefixCls, "-item"), _defineProperty$c({}, "".concat(prefixCls, "-item-selected"), segmentedOption.value === rawValue && !thumbShow)),
|
|
14785
15111
|
checked: segmentedOption.value === rawValue,
|
|
14786
15112
|
onChange: handleChange,
|
|
14787
15113
|
disabled: !!disabled || !!segmentedOption.disabled
|
|
@@ -15341,7 +15667,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15341
15667
|
return useEffect(() => {
|
|
15342
15668
|
setChecked(defaultChecked);
|
|
15343
15669
|
}, [defaultChecked]), /* @__PURE__ */ React__default.createElement("div", { className: styles$3.switchWrapper }, /* @__PURE__ */ React__default.createElement("label", { className: styles$3.switch }, /* @__PURE__ */ React__default.createElement("input", { type: "checkbox", checked, onChange: handleChange }), /* @__PURE__ */ React__default.createElement("span", { className: styles$3.slider })));
|
|
15344
|
-
}, "Switch"), red50$1 = "#fee7e7", red100$1 = "#fdcece", red200$1 = "#fb9d9d", red300$1 = "#fa7979", red400$1 = "#fe4b4b", red500$1 = "#f30b0b", red600$1 = "#e30909", red700$1 = "#cd0f0f", red800$1 = "#b20000", red900$1 = "#9d0000", orange50$1 = "#fef0e6", orange100$1 = "#fee1cd", orange200$1 = "#fdc49b", orange300$1 = "#fca669", orange400$1 = "#ff8c51", orange500$1 = "#fb8937", orange600$1 = "#f96800", orange700$1 = "#df5d00", orange800$1 = "#cc4f10", orange900$1 = "#b24000", gold50$1 = "#fef6e6", gold100$1 = "#feeecd", gold200$1 = "#fddc9b", gold300$1 = "#fccb69", gold400$1 = "#ffbd37", gold500$1 = "#faad14", gold600$1 = "#e59b07", gold700$1 = "#c68400", gold800$1 = "#a97100", gold900$1 = "#8f5f00", yellow50$1 = "#fefbe6", yellow100$1 = "#fef7cd", yellow200$1 = "#fdf09b", yellow300$1 = "#fce869", yellow400$1 = "#fbe137", yellow500$1 = "#f9d700", yellow600$1 = "#ebc301", yellow700$1 = "#d8b300", yellow800$1 = "#c5a300", yellow900$1 = "#b19401", verdancy50$1 = "#f7fde8", verdancy100$1 = "#effbd0", verdancy200$1 = "#def6a2", verdancy300$1 = "#cef273", verdancy400$1 = "#beee44", verdancy500$1 = "#a4dc16", verdancy600$1 = "#8bbb11", verdancy700$1 = "#7aa017", verdancy800$1 = "#688c0d", verdancy900$1 = "#58770a", green50$1 = "#effce8", green100$1 = "#dff9d2", green200$1 = "#bff3a5", green300$1 = "#9fed78", green400$1 = "#7fe74b", green500$1 = "#59d01e", green600$1 = "#49b811", green700$1 = "#409f11", green800$1 = "#398712", green900$1 = "#317310", jiqing50$1 = "#e5fffb", jiqing100$1 = "#ccfff7", jiqing200$1 = "#a9fff2", jiqing300$1 = "#78fce8", jiqing400$1 = "#2afede", jiqing500$1 = "#10e8c7", jiqing600$1 = "#00d2b2", jiqing700$1 = "#00b298", jiqing800$1 = "#009e87", jiqing900$1 = "#008b76", blue50$1 = "#e4f4fe", blue100$1 = "#d0edff", blue200$1 = "#9fdaff", blue300$1 = "#62c2ff", blue400$1 = "#2daeff", blue500$1 = "#0b9efb", blue600$1 = "#0493ee", blue700$1 = "#0080d2", blue800$1 = "#006cae", blue900$1 = "#005f9a", hyacinth50$1 = "#e8ecfd", hyacinth100$1 = "#d0d9fb", hyacinth200$1 = "#a2b3f6", hyacinth300$1 = "#738df2", hyacinth400$1 = "#3a60f7", hyacinth500$1 = "#274fee", hyacinth600$1 = "#143ee3", hyacinth700$1 = "#012bd2", hyacinth800$1 = "#0025b7", hyacinth900$1 = "#001f9c", purple50$1 = "#f1eafa", purple100$1 = "#e3d5f6", purple200$1 = "#c7abed", purple300$1 = "#aa82e3", purple400$1 = "#9e6de3", purple500$1 = "#894ede", purple600$1 = "#7735d4", purple700$1 = "#6721cb", purple800$1 = "#510eb0", purple900$1 = "#3f0198", magenta50$1 = "#fde8f3", magenta100$1 = "#fbd0e8", magenta200$1 = "#f6a2d0", magenta300$1 = "#f273b9", magenta400$1 = "#f248a6", magenta500$1 = "#e7258f", magenta600$1 = "#d4157e", magenta700$1 = "#c1026b", magenta800$1 = "#a1095c", magenta900$1 = "#8f0550", grey50$1 = "#f5f5f5", grey100$1 = "#ececec", grey200$1 = "#e5e5e5", grey300$1 = "#d8d8d8", grey400$1 = "#bcbcbc", grey500$1 = "#999999", grey600$1 = "#7a7a7a", grey700$1 = "#656565", grey800$1 = "#565656", grey900$1 = "#4b4b4b", colorBlack$1 = "#1e222b", colorWhite$1 = "#ffffff", boxShadowBase$1 = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg$1 = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor$1 = "#ececec", bgColorHover$1 = "#d8d8d8", bgColorSecondary$1 = "#ffffff", textColor$1 = "#1e222b", textColorSecondary$1 = "#7a7a7a", textColorSecondaryDarker$1 = "#4b4b4b", textColorTertiary$1 = "#bcbcbc", borderColor$1 = "#e5e5e5", scrollbarColor$1 = "#bcbcbc", scrollbarColorHover$1 = "#999999", scrollbarColorActive$1 = "#7a7a7a", borderRadiusBase$1 = "4px", borderRadiusLg$1 = "8px", borderRadiusXl$1 = "12px", marginXl$1 = "24px", marginLg$1 = "20px", marginBase$1 = "16px", marginSm$1 = "12px", marginXs$1 = "8px", marginXxs$1 = "4px", paddingXl$1 = "20px", paddingLg$1 = "16px", paddingBase$1 = "12px", paddingSm$1 = "8px", paddingXs$1 = "4px", fontSizeXxl$1 = "20px", fontSizeXl$1 = "18px", fontSizeLg$1 = "16px", fontSizeBase$1 = "15px", fontSizeSm$1 = "14px", fontSizeXs$1 = "13px", fontSizeXxs$1 = "12px", breakpointXs$1 = "768px", breakpointSm$1 = "1024px", breakpointBase$1 = "1280px", breakpointLg$1 = "1536px", infoColor$1 = "#2daeff", successColor$1 = "#59d01e", warningColor$1 = "#ffbd37", errorColor$1 = "#fe4b4b", primaryColor$1 = "#274fee", primaryColorHover$1 = "#3a60f7", linkColor$1 = "#0b9efb", loopColor1$1 = "#9e6de3", loopColor2$1 = "#49b811", loopColor3$1 = "#0b9efb", loopColor4$1 = "#ffbd37", loopColor5$1 = "#f273b9", loopColor6$1 = "#00d2b2", loopColor7$1 = "#ff8c51", loopColor8$1 = "#565656", loopColor9$1 = "#274fee", loopColor10$1 = "#fa7979", loopColor11$1 = "#8bbb11", loopColor12$1 = "#d8b300", default_module = {
|
|
15670
|
+
}, "Switch"), red50$1 = "#fee7e7", red100$1 = "#fdcece", red200$1 = "#fb9d9d", red300$1 = "#fa7979", red400$1 = "#fe4b4b", red500$1 = "#f30b0b", red600$1 = "#e30909", red700$1 = "#cd0f0f", red800$1 = "#b20000", red900$1 = "#9d0000", orange50$1 = "#fef0e6", orange100$1 = "#fee1cd", orange200$1 = "#fdc49b", orange300$1 = "#fca669", orange400$1 = "#ff8c51", orange500$1 = "#fb8937", orange600$1 = "#f96800", orange700$1 = "#df5d00", orange800$1 = "#cc4f10", orange900$1 = "#b24000", gold50$1 = "#fef6e6", gold100$1 = "#feeecd", gold200$1 = "#fddc9b", gold300$1 = "#fccb69", gold400$1 = "#ffbd37", gold500$1 = "#faad14", gold600$1 = "#e59b07", gold700$1 = "#c68400", gold800$1 = "#a97100", gold900$1 = "#8f5f00", yellow50$1 = "#fefbe6", yellow100$1 = "#fef7cd", yellow200$1 = "#fdf09b", yellow300$1 = "#fce869", yellow400$1 = "#fbe137", yellow500$1 = "#f9d700", yellow600$1 = "#ebc301", yellow700$1 = "#d8b300", yellow800$1 = "#c5a300", yellow900$1 = "#b19401", verdancy50$1 = "#f7fde8", verdancy100$1 = "#effbd0", verdancy200$1 = "#def6a2", verdancy300$1 = "#cef273", verdancy400$1 = "#beee44", verdancy500$1 = "#a4dc16", verdancy600$1 = "#8bbb11", verdancy700$1 = "#7aa017", verdancy800$1 = "#688c0d", verdancy900$1 = "#58770a", green50$1 = "#effce8", green100$1 = "#dff9d2", green200$1 = "#bff3a5", green300$1 = "#9fed78", green400$1 = "#7fe74b", green500$1 = "#59d01e", green600$1 = "#49b811", green700$1 = "#409f11", green800$1 = "#398712", green900$1 = "#317310", jiqing50$1 = "#e5fffb", jiqing100$1 = "#ccfff7", jiqing200$1 = "#a9fff2", jiqing300$1 = "#78fce8", jiqing400$1 = "#2afede", jiqing500$1 = "#10e8c7", jiqing600$1 = "#00d2b2", jiqing700$1 = "#00b298", jiqing800$1 = "#009e87", jiqing900$1 = "#008b76", blue50$1 = "#e4f4fe", blue100$1 = "#d0edff", blue200$1 = "#9fdaff", blue300$1 = "#62c2ff", blue400$1 = "#2daeff", blue500$1 = "#0b9efb", blue600$1 = "#0493ee", blue700$1 = "#0080d2", blue800$1 = "#006cae", blue900$1 = "#005f9a", hyacinth50$1 = "#e8ecfd", hyacinth100$1 = "#d0d9fb", hyacinth200$1 = "#a2b3f6", hyacinth300$1 = "#738df2", hyacinth400$1 = "#3a60f7", hyacinth500$1 = "#274fee", hyacinth600$1 = "#143ee3", hyacinth700$1 = "#012bd2", hyacinth800$1 = "#0025b7", hyacinth900$1 = "#001f9c", purple50$1 = "#f1eafa", purple100$1 = "#e3d5f6", purple200$1 = "#c7abed", purple300$1 = "#aa82e3", purple400$1 = "#9e6de3", purple500$1 = "#894ede", purple600$1 = "#7735d4", purple700$1 = "#6721cb", purple800$1 = "#510eb0", purple900$1 = "#3f0198", magenta50$1 = "#fde8f3", magenta100$1 = "#fbd0e8", magenta200$1 = "#f6a2d0", magenta300$1 = "#f273b9", magenta400$1 = "#f248a6", magenta500$1 = "#e7258f", magenta600$1 = "#d4157e", magenta700$1 = "#c1026b", magenta800$1 = "#a1095c", magenta900$1 = "#8f0550", grey50$1 = "#f5f5f5", grey100$1 = "#ececec", grey200$1 = "#e5e5e5", grey300$1 = "#d8d8d8", grey400$1 = "#bcbcbc", grey500$1 = "#999999", grey600$1 = "#7a7a7a", grey700$1 = "#656565", grey800$1 = "#565656", grey900$1 = "#4b4b4b", colorBlack$1 = "#1e222b", colorWhite$1 = "#ffffff", boxShadowBase$1 = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg$1 = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor$1 = "#ececec", bgColorHover$1 = "#d8d8d8", bgColorSecondary$1 = "#ffffff", bgColorOverlay$1 = "#ffffff", textColor$1 = "#1e222b", textColorSecondary$1 = "#7a7a7a", textColorSecondaryDarker$1 = "#4b4b4b", textColorTertiary$1 = "#bcbcbc", borderColor$1 = "#e5e5e5", scrollbarColor$1 = "#bcbcbc", scrollbarColorHover$1 = "#999999", scrollbarColorActive$1 = "#7a7a7a", borderRadiusBase$1 = "4px", borderRadiusLg$1 = "8px", borderRadiusXl$1 = "12px", marginXl$1 = "24px", marginLg$1 = "20px", marginBase$1 = "16px", marginSm$1 = "12px", marginXs$1 = "8px", marginXxs$1 = "4px", paddingXl$1 = "20px", paddingLg$1 = "16px", paddingBase$1 = "12px", paddingSm$1 = "8px", paddingXs$1 = "4px", fontSizeXxl$1 = "20px", fontSizeXl$1 = "18px", fontSizeLg$1 = "16px", fontSizeBase$1 = "15px", fontSizeSm$1 = "14px", fontSizeXs$1 = "13px", fontSizeXxs$1 = "12px", breakpointXs$1 = "768px", breakpointSm$1 = "1024px", breakpointBase$1 = "1280px", breakpointLg$1 = "1536px", infoColor$1 = "#2daeff", successColor$1 = "#59d01e", warningColor$1 = "#ffbd37", errorColor$1 = "#fe4b4b", primaryColor$1 = "#274fee", primaryColorHover$1 = "#3a60f7", linkColor$1 = "#0b9efb", loopColor1$1 = "#9e6de3", loopColor2$1 = "#49b811", loopColor3$1 = "#0b9efb", loopColor4$1 = "#ffbd37", loopColor5$1 = "#f273b9", loopColor6$1 = "#00d2b2", loopColor7$1 = "#ff8c51", loopColor8$1 = "#565656", loopColor9$1 = "#274fee", loopColor10$1 = "#fa7979", loopColor11$1 = "#8bbb11", loopColor12$1 = "#d8b300", default_module = {
|
|
15345
15671
|
red50: red50$1,
|
|
15346
15672
|
red100: red100$1,
|
|
15347
15673
|
red200: red200$1,
|
|
@@ -15469,6 +15795,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15469
15795
|
bgColor: bgColor$1,
|
|
15470
15796
|
bgColorHover: bgColorHover$1,
|
|
15471
15797
|
bgColorSecondary: bgColorSecondary$1,
|
|
15798
|
+
bgColorOverlay: bgColorOverlay$1,
|
|
15472
15799
|
textColor: textColor$1,
|
|
15473
15800
|
textColorSecondary: textColorSecondary$1,
|
|
15474
15801
|
textColorSecondaryDarker: textColorSecondaryDarker$1,
|
|
@@ -15521,7 +15848,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15521
15848
|
loopColor10: loopColor10$1,
|
|
15522
15849
|
loopColor11: loopColor11$1,
|
|
15523
15850
|
loopColor12: loopColor12$1
|
|
15524
|
-
}, red50 = "#fee7e7", red100 = "#fdcece", red200 = "#fb9d9d", red300 = "#fa7979", red400 = "#fe4b4b", red500 = "#f30b0b", red600 = "#e30909", red700 = "#cd0f0f", red800 = "#b20000", red900 = "#9d0000", orange50 = "#fef0e6", orange100 = "#fee1cd", orange200 = "#fdc49b", orange300 = "#fca669", orange400 = "#ff8c51", orange500 = "#fb8937", orange600 = "#f96800", orange700 = "#df5d00", orange800 = "#cc4f10", orange900 = "#b24000", gold50 = "#fef6e6", gold100 = "#feeecd", gold200 = "#fddc9b", gold300 = "#fccb69", gold400 = "#ffbd37", gold500 = "#faad14", gold600 = "#e59b07", gold700 = "#c68400", gold800 = "#a97100", gold900 = "#8f5f00", yellow50 = "#fefbe6", yellow100 = "#fef7cd", yellow200 = "#fdf09b", yellow300 = "#fce869", yellow400 = "#fbe137", yellow500 = "#f9d700", yellow600 = "#ebc301", yellow700 = "#d8b300", yellow800 = "#c5a300", yellow900 = "#b19401", verdancy50 = "#f7fde8", verdancy100 = "#effbd0", verdancy200 = "#def6a2", verdancy300 = "#cef273", verdancy400 = "#beee44", verdancy500 = "#a4dc16", verdancy600 = "#8bbb11", verdancy700 = "#7aa017", verdancy800 = "#688c0d", verdancy900 = "#58770a", green50 = "#effce8", green100 = "#dff9d2", green200 = "#bff3a5", green300 = "#9fed78", green400 = "#7fe74b", green500 = "#59d01e", green600 = "#49b811", green700 = "#409f11", green800 = "#398712", green900 = "#317310", jiqing50 = "#e5fffb", jiqing100 = "#ccfff7", jiqing200 = "#a9fff2", jiqing300 = "#78fce8", jiqing400 = "#2afede", jiqing500 = "#10e8c7", jiqing600 = "#00d2b2", jiqing700 = "#00b298", jiqing800 = "#009e87", jiqing900 = "#008b76", blue50 = "#e4f4fe", blue100 = "#d0edff", blue200 = "#9fdaff", blue300 = "#62c2ff", blue400 = "#2daeff", blue500 = "#0b9efb", blue600 = "#0493ee", blue700 = "#0080d2", blue800 = "#006cae", blue900 = "#005f9a", hyacinth50 = "#e8ecfd", hyacinth100 = "#d0d9fb", hyacinth200 = "#a2b3f6", hyacinth300 = "#738df2", hyacinth400 = "#3a60f7", hyacinth500 = "#274fee", hyacinth600 = "#143ee3", hyacinth700 = "#012bd2", hyacinth800 = "#0025b7", hyacinth900 = "#001f9c", purple50 = "#f1eafa", purple100 = "#e3d5f6", purple200 = "#c7abed", purple300 = "#aa82e3", purple400 = "#9e6de3", purple500 = "#894ede", purple600 = "#7735d4", purple700 = "#6721cb", purple800 = "#510eb0", purple900 = "#3f0198", magenta50 = "#fde8f3", magenta100 = "#fbd0e8", magenta200 = "#f6a2d0", magenta300 = "#f273b9", magenta400 = "#f248a6", magenta500 = "#e7258f", magenta600 = "#d4157e", magenta700 = "#c1026b", magenta800 = "#a1095c", magenta900 = "#8f0550", grey50 = "#f5f5f5", grey100 = "#ececec", grey200 = "#e5e5e5", grey300 = "#d8d8d8", grey400 = "#bcbcbc", grey500 = "#999999", grey600 = "#7a7a7a", grey700 = "#656565", grey800 = "#565656", grey900 = "#4b4b4b", colorBlack = "#1e222b", colorWhite = "#ffffff", boxShadowBase = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor = "#ececec", bgColorHover = "#d8d8d8", bgColorSecondary = "#ffffff", textColor = "#1e222b", textColorSecondary = "#7a7a7a", textColorSecondaryDarker = "#4b4b4b", textColorTertiary = "#bcbcbc", borderColor = "#e5e5e5", scrollbarColor = "#bcbcbc", scrollbarColorHover = "#999999", scrollbarColorActive = "#7a7a7a", borderRadiusBase = "4px", borderRadiusLg = "8px", borderRadiusXl = "12px", marginXl = "24px", marginLg = "20px", marginBase = "16px", marginSm = "12px", marginXs = "8px", marginXxs = "4px", paddingXl = "20px", paddingLg = "16px", paddingBase = "12px", paddingSm = "8px", paddingXs = "4px", fontSizeXxl = "20px", fontSizeXl = "18px", fontSizeLg = "16px", fontSizeBase = "15px", fontSizeSm = "14px", fontSizeXs = "13px", fontSizeXxs = "12px", breakpointXs = "768px", breakpointSm = "1024px", breakpointBase = "1280px", breakpointLg = "1536px", infoColor = "#2daeff", successColor = "#59d01e", warningColor = "#ffbd37", errorColor = "#fe4b4b", primaryColor = "#409f11", primaryColorHover = "#49b811", linkColor = "#0b9efb", loopColor1 = "#9e6de3", loopColor2 = "#49b811", loopColor3 = "#0b9efb", loopColor4 = "#ffbd37", loopColor5 = "#f273b9", loopColor6 = "#00d2b2", loopColor7 = "#ff8c51", loopColor8 = "#565656", loopColor9 = "#274fee", loopColor10 = "#fa7979", loopColor11 = "#8bbb11", loopColor12 = "#d8b300", green_module = {
|
|
15851
|
+
}, red50 = "#fee7e7", red100 = "#fdcece", red200 = "#fb9d9d", red300 = "#fa7979", red400 = "#fe4b4b", red500 = "#f30b0b", red600 = "#e30909", red700 = "#cd0f0f", red800 = "#b20000", red900 = "#9d0000", orange50 = "#fef0e6", orange100 = "#fee1cd", orange200 = "#fdc49b", orange300 = "#fca669", orange400 = "#ff8c51", orange500 = "#fb8937", orange600 = "#f96800", orange700 = "#df5d00", orange800 = "#cc4f10", orange900 = "#b24000", gold50 = "#fef6e6", gold100 = "#feeecd", gold200 = "#fddc9b", gold300 = "#fccb69", gold400 = "#ffbd37", gold500 = "#faad14", gold600 = "#e59b07", gold700 = "#c68400", gold800 = "#a97100", gold900 = "#8f5f00", yellow50 = "#fefbe6", yellow100 = "#fef7cd", yellow200 = "#fdf09b", yellow300 = "#fce869", yellow400 = "#fbe137", yellow500 = "#f9d700", yellow600 = "#ebc301", yellow700 = "#d8b300", yellow800 = "#c5a300", yellow900 = "#b19401", verdancy50 = "#f7fde8", verdancy100 = "#effbd0", verdancy200 = "#def6a2", verdancy300 = "#cef273", verdancy400 = "#beee44", verdancy500 = "#a4dc16", verdancy600 = "#8bbb11", verdancy700 = "#7aa017", verdancy800 = "#688c0d", verdancy900 = "#58770a", green50 = "#effce8", green100 = "#dff9d2", green200 = "#bff3a5", green300 = "#9fed78", green400 = "#7fe74b", green500 = "#59d01e", green600 = "#49b811", green700 = "#409f11", green800 = "#398712", green900 = "#317310", jiqing50 = "#e5fffb", jiqing100 = "#ccfff7", jiqing200 = "#a9fff2", jiqing300 = "#78fce8", jiqing400 = "#2afede", jiqing500 = "#10e8c7", jiqing600 = "#00d2b2", jiqing700 = "#00b298", jiqing800 = "#009e87", jiqing900 = "#008b76", blue50 = "#e4f4fe", blue100 = "#d0edff", blue200 = "#9fdaff", blue300 = "#62c2ff", blue400 = "#2daeff", blue500 = "#0b9efb", blue600 = "#0493ee", blue700 = "#0080d2", blue800 = "#006cae", blue900 = "#005f9a", hyacinth50 = "#e8ecfd", hyacinth100 = "#d0d9fb", hyacinth200 = "#a2b3f6", hyacinth300 = "#738df2", hyacinth400 = "#3a60f7", hyacinth500 = "#274fee", hyacinth600 = "#143ee3", hyacinth700 = "#012bd2", hyacinth800 = "#0025b7", hyacinth900 = "#001f9c", purple50 = "#f1eafa", purple100 = "#e3d5f6", purple200 = "#c7abed", purple300 = "#aa82e3", purple400 = "#9e6de3", purple500 = "#894ede", purple600 = "#7735d4", purple700 = "#6721cb", purple800 = "#510eb0", purple900 = "#3f0198", magenta50 = "#fde8f3", magenta100 = "#fbd0e8", magenta200 = "#f6a2d0", magenta300 = "#f273b9", magenta400 = "#f248a6", magenta500 = "#e7258f", magenta600 = "#d4157e", magenta700 = "#c1026b", magenta800 = "#a1095c", magenta900 = "#8f0550", grey50 = "#f5f5f5", grey100 = "#ececec", grey200 = "#e5e5e5", grey300 = "#d8d8d8", grey400 = "#bcbcbc", grey500 = "#999999", grey600 = "#7a7a7a", grey700 = "#656565", grey800 = "#565656", grey900 = "#4b4b4b", colorBlack = "#1e222b", colorWhite = "#ffffff", boxShadowBase = "0 4px 12px rgba(30, 34, 43, 0.08)", boxShadowLg = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", bgColor = "#ececec", bgColorHover = "#d8d8d8", bgColorSecondary = "#ffffff", bgColorOverlay = "#ffffff", textColor = "#1e222b", textColorSecondary = "#7a7a7a", textColorSecondaryDarker = "#4b4b4b", textColorTertiary = "#bcbcbc", borderColor = "#e5e5e5", scrollbarColor = "#bcbcbc", scrollbarColorHover = "#999999", scrollbarColorActive = "#7a7a7a", borderRadiusBase = "4px", borderRadiusLg = "8px", borderRadiusXl = "12px", marginXl = "24px", marginLg = "20px", marginBase = "16px", marginSm = "12px", marginXs = "8px", marginXxs = "4px", paddingXl = "20px", paddingLg = "16px", paddingBase = "12px", paddingSm = "8px", paddingXs = "4px", fontSizeXxl = "20px", fontSizeXl = "18px", fontSizeLg = "16px", fontSizeBase = "15px", fontSizeSm = "14px", fontSizeXs = "13px", fontSizeXxs = "12px", breakpointXs = "768px", breakpointSm = "1024px", breakpointBase = "1280px", breakpointLg = "1536px", infoColor = "#2daeff", successColor = "#59d01e", warningColor = "#ffbd37", errorColor = "#fe4b4b", primaryColor = "#409f11", primaryColorHover = "#49b811", linkColor = "#0b9efb", loopColor1 = "#9e6de3", loopColor2 = "#49b811", loopColor3 = "#0b9efb", loopColor4 = "#ffbd37", loopColor5 = "#f273b9", loopColor6 = "#00d2b2", loopColor7 = "#ff8c51", loopColor8 = "#565656", loopColor9 = "#274fee", loopColor10 = "#fa7979", loopColor11 = "#8bbb11", loopColor12 = "#d8b300", green_module = {
|
|
15525
15852
|
red50,
|
|
15526
15853
|
red100,
|
|
15527
15854
|
red200,
|
|
@@ -15649,6 +15976,7 @@ const switchWrapper = "univer-switch-wrapper", slider = "univer-slider", styles$
|
|
|
15649
15976
|
bgColor,
|
|
15650
15977
|
bgColorHover,
|
|
15651
15978
|
bgColorSecondary,
|
|
15979
|
+
bgColorOverlay,
|
|
15652
15980
|
textColor,
|
|
15653
15981
|
textColorSecondary,
|
|
15654
15982
|
textColorSecondaryDarker,
|
|
@@ -18579,7 +18907,7 @@ var _excluded$2 = ["prefixCls", "defaultValue", "value", "autoSize", "onResize",
|
|
|
18579
18907
|
React__default.useEffect(function() {
|
|
18580
18908
|
if (selection) {
|
|
18581
18909
|
var _getTextArea;
|
|
18582
|
-
(_getTextArea = getTextArea()).setSelectionRange.apply(_getTextArea, _toConsumableArray$
|
|
18910
|
+
(_getTextArea = getTextArea()).setSelectionRange.apply(_getTextArea, _toConsumableArray$4(selection));
|
|
18583
18911
|
}
|
|
18584
18912
|
}, [selection]);
|
|
18585
18913
|
var countConfig = useCount(count, showCount), mergedMax = (_countConfig$max = countConfig.max) !== null && _countConfig$max !== void 0 ? _countConfig$max : maxLength, hasMaxLength = Number(mergedMax) > 0, valueLength = countConfig.strategy(formatValue2), isOutOfRange = !!mergedMax && valueLength > mergedMax, triggerChange = /* @__PURE__ */ __name(function(e2, currentValue) {
|