@univerjs/design 0.2.7 → 0.2.9
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 +613 -361
- 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 +0 -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 +8 -2
- 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 +0 -1
- 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 +0 -1
- 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 +10 -10
package/lib/es/index.js
CHANGED
|
@@ -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,69 @@ 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
913
|
const round = Math.round;
|
|
914
914
|
function splitColorStr(str, parseNum) {
|
|
915
915
|
const match2 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], numList = match2.map((item) => parseFloat(item));
|
|
@@ -926,35 +926,7 @@ function limitRange(value, max) {
|
|
|
926
926
|
__name(limitRange, "limitRange");
|
|
927
927
|
const _FastColor = class _FastColor {
|
|
928
928
|
constructor(input2) {
|
|
929
|
-
|
|
930
|
-
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
|
|
931
|
-
*/
|
|
932
|
-
__publicField(this, "isValid");
|
|
933
|
-
/**
|
|
934
|
-
* Red, R in RGB
|
|
935
|
-
*/
|
|
936
|
-
__publicField(this, "r", 0);
|
|
937
|
-
/**
|
|
938
|
-
* Green, G in RGB
|
|
939
|
-
*/
|
|
940
|
-
__publicField(this, "g", 0);
|
|
941
|
-
/**
|
|
942
|
-
* Blue, B in RGB
|
|
943
|
-
*/
|
|
944
|
-
__publicField(this, "b", 0);
|
|
945
|
-
/**
|
|
946
|
-
* Alpha/Opacity, A in RGBA/HSLA
|
|
947
|
-
*/
|
|
948
|
-
__publicField(this, "a", 1);
|
|
949
|
-
// HSV privates
|
|
950
|
-
__publicField(this, "_h");
|
|
951
|
-
__publicField(this, "_s");
|
|
952
|
-
__publicField(this, "_l");
|
|
953
|
-
__publicField(this, "_v");
|
|
954
|
-
// intermediate variables to calculate HSL/HSV
|
|
955
|
-
__publicField(this, "_max");
|
|
956
|
-
__publicField(this, "_min");
|
|
957
|
-
__publicField(this, "_brightness");
|
|
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);
|
|
958
930
|
function matchFormat(str) {
|
|
959
931
|
return str[0] in input2 && str[1] in input2 && str[2] in input2;
|
|
960
932
|
}
|
|
@@ -1271,20 +1243,20 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1271
1243
|
}, "getRoundNumber"), convertHsb2Hsv = /* @__PURE__ */ __name(function(color) {
|
|
1272
1244
|
if (color instanceof FastColor)
|
|
1273
1245
|
return color;
|
|
1274
|
-
if (color && _typeof$
|
|
1275
|
-
var _ref = color, b2 = _ref.b, resets = _objectWithoutProperties$
|
|
1276
|
-
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), {}, {
|
|
1277
1249
|
v: b2
|
|
1278
1250
|
});
|
|
1279
1251
|
}
|
|
1280
1252
|
return typeof color == "string" && /hsb/.test(color) ? color.replace(/hsb/, "hsv") : color;
|
|
1281
1253
|
}, "convertHsb2Hsv"), Color = /* @__PURE__ */ function(_FastColor2) {
|
|
1282
|
-
_inherits$
|
|
1283
|
-
var _super = _createSuper$
|
|
1254
|
+
_inherits$2(Color2, _FastColor2);
|
|
1255
|
+
var _super = _createSuper$2(Color2);
|
|
1284
1256
|
function Color2(color) {
|
|
1285
|
-
return _classCallCheck$
|
|
1257
|
+
return _classCallCheck$2(this, Color2), _super.call(this, convertHsb2Hsv(color));
|
|
1286
1258
|
}
|
|
1287
|
-
return __name(Color2, "Color"), _createClass$
|
|
1259
|
+
return __name(Color2, "Color"), _createClass$2(Color2, [{
|
|
1288
1260
|
key: "toHsbString",
|
|
1289
1261
|
value: /* @__PURE__ */ __name(function() {
|
|
1290
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), ")");
|
|
@@ -1293,8 +1265,8 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1293
1265
|
}, {
|
|
1294
1266
|
key: "toHsb",
|
|
1295
1267
|
value: /* @__PURE__ */ __name(function() {
|
|
1296
|
-
var _this$toHsv = this.toHsv(), v2 = _this$toHsv.v, resets = _objectWithoutProperties$
|
|
1297
|
-
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), {}, {
|
|
1298
1270
|
b: v2,
|
|
1299
1271
|
a: this.a
|
|
1300
1272
|
});
|
|
@@ -1307,11 +1279,11 @@ var _excluded$x = ["b"], _excluded2$7 = ["v"], getRoundNumber = /* @__PURE__ */
|
|
|
1307
1279
|
if (type2)
|
|
1308
1280
|
switch (type2) {
|
|
1309
1281
|
case "hue":
|
|
1310
|
-
return generateColor(_objectSpread2$
|
|
1282
|
+
return generateColor(_objectSpread2$2(_objectSpread2$2({}, hsb), {}, {
|
|
1311
1283
|
h: hueOffset <= 0 ? 0 : hueOffset
|
|
1312
1284
|
}));
|
|
1313
1285
|
case "alpha":
|
|
1314
|
-
return generateColor(_objectSpread2$
|
|
1286
|
+
return generateColor(_objectSpread2$2(_objectSpread2$2({}, hsb), {}, {
|
|
1315
1287
|
a: alphaOffset <= 0 ? 0 : alphaOffset
|
|
1316
1288
|
}));
|
|
1317
1289
|
}
|
|
@@ -1405,7 +1377,7 @@ function useColorDrag(props) {
|
|
|
1405
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({
|
|
1406
1378
|
x: 0,
|
|
1407
1379
|
y: 0
|
|
1408
|
-
}), _useState2 = _slicedToArray$
|
|
1380
|
+
}), _useState2 = _slicedToArray$2(_useState, 2), offsetValue = _useState2[0], setOffsetValue = _useState2[1], mouseMoveRef = useRef(null), mouseUpRef = useRef(null);
|
|
1409
1381
|
useEffect(function() {
|
|
1410
1382
|
setOffsetValue(calculate());
|
|
1411
1383
|
}, [color]), useEffect(function() {
|
|
@@ -1442,6 +1414,55 @@ function useEvent(callback) {
|
|
|
1442
1414
|
return memoFn;
|
|
1443
1415
|
}
|
|
1444
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");
|
|
1445
1466
|
function canUseDom() {
|
|
1446
1467
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
1447
1468
|
}
|
|
@@ -1494,6 +1515,15 @@ function useMergedState(defaultStateValue, option) {
|
|
|
1494
1515
|
return [postMergedValue, triggerChange];
|
|
1495
1516
|
}
|
|
1496
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");
|
|
1497
1527
|
var reactIs = { exports: {} }, reactIs_production_min = {};
|
|
1498
1528
|
/**
|
|
1499
1529
|
* @license React
|
|
@@ -1632,25 +1662,73 @@ function isReactElement(node) {
|
|
|
1632
1662
|
}
|
|
1633
1663
|
__name(isReactElement, "isReactElement");
|
|
1634
1664
|
Number(version$1.split(".")[0]) >= 19;
|
|
1635
|
-
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) {
|
|
1636
1714
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
1637
1715
|
}
|
|
1638
|
-
__name(_arrayWithoutHoles$
|
|
1639
|
-
function _iterableToArray$
|
|
1716
|
+
__name(_arrayWithoutHoles$3, "_arrayWithoutHoles$3");
|
|
1717
|
+
function _iterableToArray$3(r) {
|
|
1640
1718
|
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
1641
1719
|
}
|
|
1642
|
-
__name(_iterableToArray$
|
|
1643
|
-
function _nonIterableSpread$
|
|
1720
|
+
__name(_iterableToArray$3, "_iterableToArray$3");
|
|
1721
|
+
function _nonIterableSpread$3() {
|
|
1644
1722
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1645
1723
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1646
1724
|
}
|
|
1647
|
-
__name(_nonIterableSpread$
|
|
1648
|
-
function _toConsumableArray$
|
|
1649
|
-
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();
|
|
1650
1728
|
}
|
|
1651
|
-
__name(_toConsumableArray$
|
|
1729
|
+
__name(_toConsumableArray$4, "_toConsumableArray$4");
|
|
1652
1730
|
function _toArray(r) {
|
|
1653
|
-
return _arrayWithHoles$1(r) || _iterableToArray$
|
|
1731
|
+
return _arrayWithHoles$1(r) || _iterableToArray$3(r) || _unsupportedIterableToArray(r) || _nonIterableRest$1();
|
|
1654
1732
|
}
|
|
1655
1733
|
__name(_toArray, "_toArray");
|
|
1656
1734
|
var warned$1 = {}, preMessage$1 = /* @__PURE__ */ __name(function(fn) {
|
|
@@ -1683,7 +1761,7 @@ warningOnce$1.noteOnce = noteOnce$1;
|
|
|
1683
1761
|
var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
1684
1762
|
var _ref$size = _ref.size, size = _ref$size === void 0 ? "default" : _ref$size, color = _ref.color, prefixCls = _ref.prefixCls;
|
|
1685
1763
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1686
|
-
className: clsx("".concat(prefixCls, "-handler"), _defineProperty$
|
|
1764
|
+
className: clsx("".concat(prefixCls, "-handler"), _defineProperty$c({}, "".concat(prefixCls, "-handler-sm"), size === "small")),
|
|
1687
1765
|
style: {
|
|
1688
1766
|
backgroundColor: color
|
|
1689
1767
|
}
|
|
@@ -1692,7 +1770,7 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1692
1770
|
var children = _ref.children, style2 = _ref.style, prefixCls = _ref.prefixCls;
|
|
1693
1771
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1694
1772
|
className: "".concat(prefixCls, "-palette"),
|
|
1695
|
-
style: _objectSpread2$
|
|
1773
|
+
style: _objectSpread2$2({
|
|
1696
1774
|
position: "relative"
|
|
1697
1775
|
}, style2)
|
|
1698
1776
|
}, children);
|
|
@@ -1729,7 +1807,7 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1729
1807
|
return onChangeComplete == null ? void 0 : onChangeComplete(colorRef.current);
|
|
1730
1808
|
}, "onDragChangeComplete"),
|
|
1731
1809
|
disabledDrag: disabled
|
|
1732
|
-
}), _useColorDrag2 = _slicedToArray$
|
|
1810
|
+
}), _useColorDrag2 = _slicedToArray$2(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1];
|
|
1733
1811
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1734
1812
|
ref: pickerRef,
|
|
1735
1813
|
className: "".concat(prefixCls, "-select"),
|
|
@@ -1754,7 +1832,7 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1754
1832
|
}, "Picker"), useColorState = /* @__PURE__ */ __name(function(defaultValue, value) {
|
|
1755
1833
|
var _useMergedState = useMergedState(defaultValue, {
|
|
1756
1834
|
value
|
|
1757
|
-
}), _useMergedState2 = _slicedToArray$
|
|
1835
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedValue = _useMergedState2[0], setValue = _useMergedState2[1], color = useMemo$1(function() {
|
|
1758
1836
|
return generateColor(mergedValue);
|
|
1759
1837
|
}, [mergedValue]);
|
|
1760
1838
|
return [color, setValue];
|
|
@@ -1798,7 +1876,7 @@ var Handler = /* @__PURE__ */ __name(function(_ref) {
|
|
|
1798
1876
|
}, "onDragChangeComplete"),
|
|
1799
1877
|
direction: "x",
|
|
1800
1878
|
disabledDrag: disabled
|
|
1801
|
-
}), _useColorDrag2 = _slicedToArray$
|
|
1879
|
+
}), _useColorDrag2 = _slicedToArray$2(_useColorDrag, 2), offset2 = _useColorDrag2[0], dragStartHandle = _useColorDrag2[1], handleColor = React__default.useMemo(function() {
|
|
1802
1880
|
if (type2 === "hue") {
|
|
1803
1881
|
var hsb = color.toHsb();
|
|
1804
1882
|
hsb.s = 1, hsb.b = 1, hsb.a = 1;
|
|
@@ -1861,7 +1939,7 @@ var HUE_COLORS = [{
|
|
|
1861
1939
|
color: "rgb(255, 0, 0)",
|
|
1862
1940
|
percent: 100
|
|
1863
1941
|
}], ColorPicker$1 = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
1864
|
-
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$
|
|
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() {
|
|
1865
1943
|
return colorValue.setA(1).toRgbString();
|
|
1866
1944
|
}, [colorValue]), handleChange = /* @__PURE__ */ __name(function(data, type2) {
|
|
1867
1945
|
value || setColorValue(data), onChange == null || onChange(data, type2);
|
|
@@ -1883,19 +1961,19 @@ var HUE_COLORS = [{
|
|
|
1883
1961
|
onChangeComplete && onChangeComplete(getHueColor(hue));
|
|
1884
1962
|
}, "onHueChangeComplete2"), onAlphaChangeComplete = /* @__PURE__ */ __name(function(alpha) {
|
|
1885
1963
|
onChangeComplete && onChangeComplete(getAlphaColor(alpha));
|
|
1886
|
-
}, "onAlphaChangeComplete2"), mergeCls = clsx("".concat(prefixCls, "-panel"), className, _defineProperty$
|
|
1964
|
+
}, "onAlphaChangeComplete2"), mergeCls = clsx("".concat(prefixCls, "-panel"), className, _defineProperty$c({}, "".concat(prefixCls, "-panel-disabled"), disabled)), sharedSliderProps = {
|
|
1887
1965
|
prefixCls,
|
|
1888
1966
|
disabled,
|
|
1889
1967
|
color: colorValue
|
|
1890
|
-
}, 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({
|
|
1891
1969
|
onChange: handleChange
|
|
1892
1970
|
}, sharedSliderProps, {
|
|
1893
1971
|
onChangeComplete
|
|
1894
1972
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
1895
1973
|
className: "".concat(prefixCls, "-slider-container")
|
|
1896
1974
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
1897
|
-
className: clsx("".concat(prefixCls, "-slider-group"), _defineProperty$
|
|
1898
|
-
}, /* @__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, {
|
|
1899
1977
|
type: "hue",
|
|
1900
1978
|
colors: HUE_COLORS,
|
|
1901
1979
|
min: 0,
|
|
@@ -1903,7 +1981,7 @@ var HUE_COLORS = [{
|
|
|
1903
1981
|
value: colorValue.getHue(),
|
|
1904
1982
|
onChange: onHueChange,
|
|
1905
1983
|
onChangeComplete: onHueChangeComplete
|
|
1906
|
-
})), !disabledAlpha && /* @__PURE__ */ React__default.createElement(Slider3, _extends$
|
|
1984
|
+
})), !disabledAlpha && /* @__PURE__ */ React__default.createElement(Slider3, _extends$6({}, sharedSliderProps, {
|
|
1907
1985
|
type: "alpha",
|
|
1908
1986
|
colors: [{
|
|
1909
1987
|
percent: 0,
|
|
@@ -2058,6 +2136,16 @@ function ColorPicker(props) {
|
|
|
2058
2136
|
)))), /* @__PURE__ */ React__default.createElement("section", { onClick: handleStopPropagation }, /* @__PURE__ */ React__default.createElement(ColorPicker$1, { prefixCls: styles$o.colorPicker, disabledAlpha: !0, onChangeComplete: handleChange })));
|
|
2059
2137
|
}
|
|
2060
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");
|
|
2061
2149
|
var OrderContext = /* @__PURE__ */ React$6.createContext(null), EMPTY_LIST$2 = [];
|
|
2062
2150
|
function useDom(render2, debug) {
|
|
2063
2151
|
var _React$useState = React$6.useState(function() {
|
|
@@ -2067,7 +2155,7 @@ function useDom(render2, debug) {
|
|
|
2067
2155
|
return defaultEle;
|
|
2068
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) {
|
|
2069
2157
|
setQueue(function(origin) {
|
|
2070
|
-
var newQueue = [appendFn].concat(_toConsumableArray$
|
|
2158
|
+
var newQueue = [appendFn].concat(_toConsumableArray$4(origin));
|
|
2071
2159
|
return newQueue;
|
|
2072
2160
|
});
|
|
2073
2161
|
});
|
|
@@ -2904,7 +2992,104 @@ function findDOMNode$1(node) {
|
|
|
2904
2992
|
return null;
|
|
2905
2993
|
}
|
|
2906
2994
|
__name(findDOMNode$1, "findDOMNode$1");
|
|
2907
|
-
|
|
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) {
|
|
2908
3093
|
_inherits$1(DomWrapper2, _React$Component);
|
|
2909
3094
|
var _super = _createSuper$1(DomWrapper2);
|
|
2910
3095
|
function DomWrapper2() {
|
|
@@ -4687,7 +4872,8 @@ function Dialog(props) {
|
|
|
4687
4872
|
onClose,
|
|
4688
4873
|
mask,
|
|
4689
4874
|
dialogStyles,
|
|
4690
|
-
closable
|
|
4875
|
+
closable,
|
|
4876
|
+
maskClosable
|
|
4691
4877
|
} = props, [dragDisabled, setDragDisabled] = useState(!1), [positionOffset, setPositionOffset] = useState(null), { mountContainer } = useContext(ConfigContext), TitleIfDraggable = draggable ? /* @__PURE__ */ React__default.createElement(
|
|
4692
4878
|
"div",
|
|
4693
4879
|
{
|
|
@@ -4756,7 +4942,8 @@ function Dialog(props) {
|
|
|
4756
4942
|
style: style2,
|
|
4757
4943
|
onClose,
|
|
4758
4944
|
styles: dialogStyles,
|
|
4759
|
-
closable
|
|
4945
|
+
closable,
|
|
4946
|
+
maskClosable
|
|
4760
4947
|
},
|
|
4761
4948
|
children
|
|
4762
4949
|
);
|
|
@@ -4794,6 +4981,23 @@ function Confirm(props) {
|
|
|
4794
4981
|
);
|
|
4795
4982
|
}
|
|
4796
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");
|
|
4797
5001
|
function omit$2(obj, fields) {
|
|
4798
5002
|
var clone = Object.assign({}, obj);
|
|
4799
5003
|
return Array.isArray(fields) && fields.forEach(function(key) {
|
|
@@ -5259,7 +5463,7 @@ function Arrow(props) {
|
|
|
5259
5463
|
__name(Arrow, "Arrow");
|
|
5260
5464
|
function Mask2(props) {
|
|
5261
5465
|
var prefixCls = props.prefixCls, open = props.open, zIndex = props.zIndex, mask = props.mask, motion = props.motion;
|
|
5262
|
-
return mask ? /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$
|
|
5466
|
+
return mask ? /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$6({}, motion, {
|
|
5263
5467
|
motionAppear: !0,
|
|
5264
5468
|
visible: open,
|
|
5265
5469
|
removeOnLeave: !0
|
|
@@ -5280,7 +5484,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5280
5484
|
}, function(_, next) {
|
|
5281
5485
|
return next.cache;
|
|
5282
5486
|
}), Popup$3 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
5283
|
-
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];
|
|
5284
5488
|
if (useLayoutEffect$1(function() {
|
|
5285
5489
|
!show && getPopupContainerNeedParams && target && setShow(!0);
|
|
5286
5490
|
}, [show, getPopupContainerNeedParams, target]), !show)
|
|
@@ -5312,7 +5516,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5312
5516
|
onResize: onAlign,
|
|
5313
5517
|
disabled: !open
|
|
5314
5518
|
}, function(resizeObserverRef) {
|
|
5315
|
-
return /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$
|
|
5519
|
+
return /* @__PURE__ */ React$6.createElement(CSSMotion, _extends$6({
|
|
5316
5520
|
motionAppear: !0,
|
|
5317
5521
|
motionEnter: !0,
|
|
5318
5522
|
motionLeave: !0,
|
|
@@ -5332,7 +5536,7 @@ var PopupContent = /* @__PURE__ */ React$6.memo(function(_ref) {
|
|
|
5332
5536
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
5333
5537
|
ref: composeRef(resizeObserverRef, ref, motionRef),
|
|
5334
5538
|
className: cls,
|
|
5335
|
-
style: _objectSpread2$
|
|
5539
|
+
style: _objectSpread2$2(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({
|
|
5336
5540
|
"--arrow-x": "".concat(arrowPos.x || 0, "px"),
|
|
5337
5541
|
"--arrow-y": "".concat(arrowPos.y || 0, "px")
|
|
5338
5542
|
}, offsetStyle), miscStyle), motionStyle), {}, {
|
|
@@ -5437,7 +5641,7 @@ function getPxValue(val) {
|
|
|
5437
5641
|
}
|
|
5438
5642
|
__name(getPxValue, "getPxValue");
|
|
5439
5643
|
function getVisibleArea(initArea, scrollerList) {
|
|
5440
|
-
var visibleArea = _objectSpread2$
|
|
5644
|
+
var visibleArea = _objectSpread2$2({}, initArea);
|
|
5441
5645
|
return (scrollerList || []).forEach(function(ele) {
|
|
5442
5646
|
if (!(ele instanceof HTMLBodyElement || ele instanceof HTMLHtmlElement)) {
|
|
5443
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;
|
|
@@ -5457,7 +5661,7 @@ function getUnitOffset(size) {
|
|
|
5457
5661
|
}
|
|
5458
5662
|
__name(getUnitOffset, "getUnitOffset");
|
|
5459
5663
|
function getNumberOffset(rect, offset2) {
|
|
5460
|
-
var _ref = offset2 || [], _ref2 = _slicedToArray$
|
|
5664
|
+
var _ref = offset2 || [], _ref2 = _slicedToArray$2(_ref, 2), offsetX = _ref2[0], offsetY = _ref2[1];
|
|
5461
5665
|
return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
|
|
5462
5666
|
}
|
|
5463
5667
|
__name(getNumberOffset, "getNumberOffset");
|
|
@@ -5498,7 +5702,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5498
5702
|
scaleX: 1,
|
|
5499
5703
|
scaleY: 1,
|
|
5500
5704
|
align: builtinPlacements[placement] || {}
|
|
5501
|
-
}), _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() {
|
|
5502
5706
|
return popupEle ? collectScroller(popupEle) : [];
|
|
5503
5707
|
}, [popupEle]), prevFlipRef = React$6.useRef({}), resetFlipCache = /* @__PURE__ */ __name(function() {
|
|
5504
5708
|
prevFlipRef.current = {};
|
|
@@ -5513,7 +5717,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5513
5717
|
nextPopupY = popupRect.y + nextOffsetY, nextPopupBottom = nextPopupY + popupHeight, nextPopupX = popupRect.x + nextOffsetX, nextPopupRight = nextPopupX + popupWidth;
|
|
5514
5718
|
};
|
|
5515
5719
|
__name(getIntersectionVisibleArea, "getIntersectionVisibleArea"), __name(syncNextPopupPosition, "syncNextPopupPosition");
|
|
5516
|
-
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");
|
|
5517
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";
|
|
5518
5722
|
var targetRect;
|
|
5519
5723
|
if (Array.isArray(target))
|
|
@@ -5551,9 +5755,9 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5551
5755
|
var _scaleX = toNum(Math.round(popupWidth / parseFloat(width2) * 1e3) / 1e3), _scaleY = toNum(Math.round(popupHeight / parseFloat(height2) * 1e3) / 1e3);
|
|
5552
5756
|
if (_scaleX === 0 || _scaleY === 0 || isDOM(target) && !isVisible(target))
|
|
5553
5757
|
return;
|
|
5554
|
-
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];
|
|
5555
5759
|
targetRect.x -= targetOffsetX, targetRect.y -= targetOffsetY;
|
|
5556
|
-
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) {
|
|
5557
5761
|
return typeof val == "boolean" ? val : val >= 0;
|
|
5558
5762
|
}, "supportAdjust"), nextPopupY, nextPopupBottom, nextPopupX, nextPopupRight;
|
|
5559
5763
|
syncNextPopupPosition();
|
|
@@ -5622,7 +5826,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
5622
5826
|
});
|
|
5623
5827
|
}, "triggerAlign"), resetReady = /* @__PURE__ */ __name(function() {
|
|
5624
5828
|
setOffsetInfo(function(ori) {
|
|
5625
|
-
return _objectSpread2$
|
|
5829
|
+
return _objectSpread2$2(_objectSpread2$2({}, ori), {}, {
|
|
5626
5830
|
ready: !1
|
|
5627
5831
|
});
|
|
5628
5832
|
});
|
|
@@ -5659,9 +5863,9 @@ function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable,
|
|
|
5659
5863
|
var openRef = React$6.useRef(open);
|
|
5660
5864
|
openRef.current = open, React$6.useEffect(function() {
|
|
5661
5865
|
if (clickToHide && popupEle && (!mask || maskClosable)) {
|
|
5662
|
-
var onTriggerClose = /* @__PURE__ */ __name(function(
|
|
5663
|
-
var
|
|
5664
|
-
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);
|
|
5665
5869
|
}, "onTriggerClose2"), win = getWin(popupEle);
|
|
5666
5870
|
win.addEventListener("mousedown", onTriggerClose, !0), win.addEventListener("contextmenu", onTriggerClose, !0);
|
|
5667
5871
|
var targetShadowRoot = getShadowRoot(targetEle);
|
|
@@ -5675,7 +5879,7 @@ __name(useWinClick, "useWinClick");
|
|
|
5675
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"];
|
|
5676
5880
|
function generateTrigger() {
|
|
5677
5881
|
var PortalComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Portal, Trigger2 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
5678
|
-
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];
|
|
5679
5883
|
useLayoutEffect$1(function() {
|
|
5680
5884
|
setMobile(isMobile());
|
|
5681
5885
|
}, []);
|
|
@@ -5685,16 +5889,16 @@ function generateTrigger() {
|
|
|
5685
5889
|
subPopupElements.current[id2] = subPopupEle, parentContext == null || parentContext.registerSubPopup(id2, subPopupEle);
|
|
5686
5890
|
}, "registerSubPopup")
|
|
5687
5891
|
};
|
|
5688
|
-
}, [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) {
|
|
5689
5893
|
externalPopupRef.current = node, isDOM(node) && popupEle !== node && setPopupEle(node), parentContext == null || parentContext.registerSubPopup(id, node);
|
|
5690
|
-
}), _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) {
|
|
5691
5895
|
isDOM(node) && targetEle !== node && (setTargetEle(node), externalForwardRef.current = node);
|
|
5692
5896
|
}), child = React$6.Children.only(children), originChildProps = (child == null ? void 0 : child.props) || {}, cloneProps = {}, inPopupOrChild = useEvent(function(ele) {
|
|
5693
5897
|
var _getShadowRoot, _getShadowRoot2, childDOM = targetEle;
|
|
5694
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) {
|
|
5695
5899
|
return (subPopupEle == null ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;
|
|
5696
5900
|
});
|
|
5697
|
-
}), 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) {
|
|
5698
5902
|
popupVisible === void 0 && setInternalOpen(nextOpen);
|
|
5699
5903
|
});
|
|
5700
5904
|
useLayoutEffect$1(function() {
|
|
@@ -5718,13 +5922,13 @@ function generateTrigger() {
|
|
|
5718
5922
|
React$6.useEffect(function() {
|
|
5719
5923
|
return clearDelay;
|
|
5720
5924
|
}, []);
|
|
5721
|
-
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];
|
|
5722
5926
|
useLayoutEffect$1(function(firstMount) {
|
|
5723
5927
|
(!firstMount || mergedOpen) && setInMotion(!0);
|
|
5724
5928
|
}, [mergedOpen]);
|
|
5725
|
-
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) {
|
|
5726
5930
|
setMousePos([event.clientX, event.clientY]);
|
|
5727
|
-
}, "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() {
|
|
5728
5932
|
inMotion || onAlign();
|
|
5729
5933
|
}), onScroll = /* @__PURE__ */ __name(function() {
|
|
5730
5934
|
openRef.current && alignPoint && clickToHide && triggerOpen(!1);
|
|
@@ -5745,7 +5949,7 @@ function generateTrigger() {
|
|
|
5745
5949
|
forceAlign: triggerAlign
|
|
5746
5950
|
};
|
|
5747
5951
|
});
|
|
5748
|
-
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() {
|
|
5749
5953
|
if (stretch && targetEle) {
|
|
5750
5954
|
var rect = targetEle.getBoundingClientRect();
|
|
5751
5955
|
setTargetWidth(rect.width), setTargetHeight(rect.height);
|
|
@@ -5799,7 +6003,7 @@ function generateTrigger() {
|
|
|
5799
6003
|
args[_key3 - 1] = arguments[_key3];
|
|
5800
6004
|
(_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 || _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));
|
|
5801
6005
|
}), className && (cloneProps.className = clsx(originChildProps.className, className));
|
|
5802
|
-
var mergedChildrenProps = _objectSpread2$
|
|
6006
|
+
var mergedChildrenProps = _objectSpread2$2(_objectSpread2$2({}, originChildProps), cloneProps), passedProps = {}, passedEventList = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
|
|
5803
6007
|
passedEventList.forEach(function(eventName) {
|
|
5804
6008
|
restProps[eventName] && (passedProps[eventName] = function() {
|
|
5805
6009
|
for (var _mergedChildrenProps$, _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++)
|
|
@@ -5807,10 +6011,10 @@ function generateTrigger() {
|
|
|
5807
6011
|
(_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 || _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args)), restProps[eventName].apply(restProps, args);
|
|
5808
6012
|
});
|
|
5809
6013
|
});
|
|
5810
|
-
var triggerNode = /* @__PURE__ */ React$6.cloneElement(child, _objectSpread2$
|
|
6014
|
+
var triggerNode = /* @__PURE__ */ React$6.cloneElement(child, _objectSpread2$2(_objectSpread2$2({}, mergedChildrenProps), passedProps)), arrowPos = {
|
|
5811
6015
|
x: arrowX,
|
|
5812
6016
|
y: arrowY
|
|
5813
|
-
}, innerArrow = arrow ? _objectSpread2$
|
|
6017
|
+
}, innerArrow = arrow ? _objectSpread2$2({}, arrow !== !0 ? arrow : {}) : null;
|
|
5814
6018
|
return /* @__PURE__ */ React$6.createElement(React$6.Fragment, null, /* @__PURE__ */ React$6.createElement(RefResizeObserver, {
|
|
5815
6019
|
disabled: !mergedOpen,
|
|
5816
6020
|
ref: setTargetRef,
|
|
@@ -5918,7 +6122,7 @@ function PickerTrigger(_ref) {
|
|
|
5918
6122
|
popup: popupElement,
|
|
5919
6123
|
popupAlign,
|
|
5920
6124
|
popupVisible: visible,
|
|
5921
|
-
popupClassName: clsx(popupClassName, _defineProperty$
|
|
6125
|
+
popupClassName: clsx(popupClassName, _defineProperty$c(_defineProperty$c({}, "".concat(dropdownPrefixCls, "-range"), range), "".concat(dropdownPrefixCls, "-rtl"), direction === "rtl")),
|
|
5922
6126
|
popupStyle,
|
|
5923
6127
|
stretch: "minWidth",
|
|
5924
6128
|
getPopupContainer,
|
|
@@ -5982,7 +6186,7 @@ function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
|
5982
6186
|
return dateRender && info.type === "date" ? dateRender(date, info.today) : monthCellRender && info.type === "month" ? monthCellRender(date, info.locale) : info.originNode;
|
|
5983
6187
|
};
|
|
5984
6188
|
}, [cellRender, monthCellRender, dateRender]), onInternalCellRender = React$6.useCallback(function(date, info) {
|
|
5985
|
-
return mergedCellRender(date, _objectSpread2$
|
|
6189
|
+
return mergedCellRender(date, _objectSpread2$2(_objectSpread2$2({}, info), {}, {
|
|
5986
6190
|
range
|
|
5987
6191
|
}));
|
|
5988
6192
|
}, [mergedCellRender, range]);
|
|
@@ -5990,7 +6194,7 @@ function useCellRender(cellRender, dateRender, monthCellRender, range) {
|
|
|
5990
6194
|
}
|
|
5991
6195
|
__name(useCellRender, "useCellRender");
|
|
5992
6196
|
function useFieldsInvalidate(calendarValue, isInvalidateDate) {
|
|
5993
|
-
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) {
|
|
5994
6198
|
setFieldsInvalidates(function(ori) {
|
|
5995
6199
|
return fillIndex(ori, index2, invalid);
|
|
5996
6200
|
});
|
|
@@ -6014,7 +6218,7 @@ function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showM
|
|
|
6014
6218
|
__name(fillTimeFormat, "fillTimeFormat");
|
|
6015
6219
|
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
|
|
6016
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);
|
|
6017
|
-
return _objectSpread2$
|
|
6221
|
+
return _objectSpread2$2(_objectSpread2$2({}, locale), {}, {
|
|
6018
6222
|
fieldDateTimeFormat: fieldDateTimeFormat || "YYYY-MM-DD ".concat(timeFormat),
|
|
6019
6223
|
fieldDateFormat: fieldDateFormat || "YYYY-MM-DD",
|
|
6020
6224
|
fieldTimeFormat: fieldTimeFormat || timeFormat,
|
|
@@ -6066,7 +6270,7 @@ var showTimeKeys = [
|
|
|
6066
6270
|
];
|
|
6067
6271
|
function pickTimeProps(props) {
|
|
6068
6272
|
var timeProps = pickProps(props, showTimeKeys), format2 = props.format, picker = props.picker, propFormat = null;
|
|
6069
|
-
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];
|
|
6070
6274
|
}
|
|
6071
6275
|
__name(pickTimeProps, "pickTimeProps");
|
|
6072
6276
|
function isStringFormat(format2) {
|
|
@@ -6095,10 +6299,10 @@ function fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMil
|
|
|
6095
6299
|
}
|
|
6096
6300
|
__name(fillShowConfig, "fillShowConfig");
|
|
6097
6301
|
function getTimeProps(componentProps) {
|
|
6098
|
-
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({
|
|
6099
6303
|
defaultOpenValue: showTimeConfig.defaultOpenValue || showTimeConfig.defaultValue
|
|
6100
|
-
}, 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$
|
|
6101
|
-
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), {}, {
|
|
6102
6306
|
showHour,
|
|
6103
6307
|
showMinute,
|
|
6104
6308
|
showSecond,
|
|
@@ -6118,10 +6322,10 @@ function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, loca
|
|
|
6118
6322
|
}
|
|
6119
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);
|
|
6120
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"]));
|
|
6121
|
-
var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig4 = _slicedToArray$
|
|
6325
|
+
var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), _fillShowConfig4 = _slicedToArray$2(_fillShowConfig3, 3);
|
|
6122
6326
|
showHour = _fillShowConfig4[0], showMinute = _fillShowConfig4[1], showSecond = _fillShowConfig4[2];
|
|
6123
6327
|
var timeFormat = showTimeFormat || fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem);
|
|
6124
|
-
return _objectSpread2$
|
|
6328
|
+
return _objectSpread2$2(_objectSpread2$2({}, pickedProps), {}, {
|
|
6125
6329
|
// Format
|
|
6126
6330
|
format: timeFormat,
|
|
6127
6331
|
// Show Config
|
|
@@ -6138,7 +6342,7 @@ __name(fillShowTimeConfig, "fillShowTimeConfig");
|
|
|
6138
6342
|
function fillClearIcon(prefixCls, allowClear, clearIcon) {
|
|
6139
6343
|
if (allowClear === !1)
|
|
6140
6344
|
return null;
|
|
6141
|
-
var config2 = allowClear && _typeof$
|
|
6345
|
+
var config2 = allowClear && _typeof$3(allowClear) === "object" ? allowClear : {};
|
|
6142
6346
|
return config2.clearIcon || clearIcon || /* @__PURE__ */ React$6.createElement("span", {
|
|
6143
6347
|
className: "".concat(prefixCls, "-clear-btn")
|
|
6144
6348
|
});
|
|
@@ -6259,7 +6463,7 @@ function useDisabledBoundary(generateConfig2, locale, disabledDate, minDate, max
|
|
|
6259
6463
|
__name(useDisabledBoundary, "useDisabledBoundary");
|
|
6260
6464
|
function useFieldFormat(picker, locale, format2) {
|
|
6261
6465
|
return React$6.useMemo(function() {
|
|
6262
|
-
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;
|
|
6263
6467
|
return [
|
|
6264
6468
|
// Format list
|
|
6265
6469
|
formatList.map(function(config2) {
|
|
@@ -6277,7 +6481,7 @@ function useInputReadOnly(formatList, inputReadOnly, multiple) {
|
|
|
6277
6481
|
__name(useInputReadOnly, "useInputReadOnly");
|
|
6278
6482
|
function useInvalidate(generateConfig2, picker, disabledDate, showTime) {
|
|
6279
6483
|
var isInvalidate = useEvent(function(date, info) {
|
|
6280
|
-
var outsideInfo = _objectSpread2$
|
|
6484
|
+
var outsideInfo = _objectSpread2$2({
|
|
6281
6485
|
type: picker
|
|
6282
6486
|
}, info);
|
|
6283
6487
|
if (delete outsideInfo.activeIndex, // Date object is invalid
|
|
@@ -6305,17 +6509,17 @@ function useList(value) {
|
|
|
6305
6509
|
}
|
|
6306
6510
|
__name(useList, "useList");
|
|
6307
6511
|
function useFilledProps(props, updater) {
|
|
6308
|
-
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() {
|
|
6309
6513
|
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale);
|
|
6310
6514
|
}, [internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale]), filledProps = React$6.useMemo(function() {
|
|
6311
|
-
return _objectSpread2$
|
|
6515
|
+
return _objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
6312
6516
|
prefixCls,
|
|
6313
6517
|
locale: mergedLocale,
|
|
6314
6518
|
picker,
|
|
6315
6519
|
styles: styles2,
|
|
6316
6520
|
classNames,
|
|
6317
6521
|
order,
|
|
6318
|
-
components: _objectSpread2$
|
|
6522
|
+
components: _objectSpread2$2({
|
|
6319
6523
|
input: inputRender
|
|
6320
6524
|
}, components),
|
|
6321
6525
|
clearIcon: fillClearIcon(prefixCls, allowClear, clearIcon),
|
|
@@ -6325,8 +6529,8 @@ function useFilledProps(props, updater) {
|
|
|
6325
6529
|
pickerValue: pickerValues,
|
|
6326
6530
|
defaultPickerValue: defaultPickerValues
|
|
6327
6531
|
}, void 0);
|
|
6328
|
-
}, [props]), _useFieldFormat = useFieldFormat(internalPicker, mergedLocale, format2), _useFieldFormat2 = _slicedToArray$
|
|
6329
|
-
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), {}, {
|
|
6330
6534
|
needConfirm: mergedNeedConfirm,
|
|
6331
6535
|
inputReadOnly: mergedInputReadOnly,
|
|
6332
6536
|
disabledDate: disabledBoundaryDate
|
|
@@ -6338,7 +6542,7 @@ __name(useFilledProps, "useFilledProps");
|
|
|
6338
6542
|
function useDelayState(value, defaultValue, onChange) {
|
|
6339
6543
|
var _useMergedState = useMergedState(defaultValue, {
|
|
6340
6544
|
value
|
|
6341
|
-
}), _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() {
|
|
6342
6546
|
wrapperRaf.cancel(rafRef.current);
|
|
6343
6547
|
}, "cancelRaf"), doUpdate = useEvent(function() {
|
|
6344
6548
|
setState(nextValueRef.current), onChange && state !== nextValueRef.current && onChange(nextValueRef.current);
|
|
@@ -6353,7 +6557,7 @@ __name(useDelayState, "useDelayState");
|
|
|
6353
6557
|
function useOpen(open, defaultOpen) {
|
|
6354
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) {
|
|
6355
6559
|
return disabled;
|
|
6356
|
-
}) ? !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];
|
|
6357
6561
|
function setOpen(next) {
|
|
6358
6562
|
var config2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6359
6563
|
(!config2.inherit || rafOpen) && setRafOpen(next, config2.force);
|
|
@@ -6402,7 +6606,7 @@ function useLockEffect(condition, callback) {
|
|
|
6402
6606
|
}
|
|
6403
6607
|
__name(useLockEffect, "useLockEffect");
|
|
6404
6608
|
function useRangeActive(disabled) {
|
|
6405
|
-
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) {
|
|
6406
6610
|
setFocused(nextFocus);
|
|
6407
6611
|
}, "triggerFocus"), lastOperation = /* @__PURE__ */ __name(function(type2) {
|
|
6408
6612
|
return type2 && (lastOperationRef.current = type2), lastOperationRef.current;
|
|
@@ -6441,15 +6645,15 @@ function useRangePickerValue(generateConfig2, locale, calendarValue, modes, open
|
|
|
6441
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) {
|
|
6442
6646
|
var now = generateConfig2.getNow();
|
|
6443
6647
|
return isTimePicker && (now = fillTime(generateConfig2, now)), defaultPickerValue[index2] || calendarValue[index2] || now;
|
|
6444
|
-
}, "getDefaultPickerValue"), _pickerValue = _slicedToArray$
|
|
6648
|
+
}, "getDefaultPickerValue"), _pickerValue = _slicedToArray$2(pickerValue, 2), startPickerValue = _pickerValue[0], endPickerValue = _pickerValue[1], _useMergedState = useMergedState(function() {
|
|
6445
6649
|
return getDefaultPickerValue(0);
|
|
6446
6650
|
}, {
|
|
6447
6651
|
value: startPickerValue
|
|
6448
|
-
}), _useMergedState2 = _slicedToArray$
|
|
6652
|
+
}), _useMergedState2 = _slicedToArray$2(_useMergedState, 2), mergedStartPickerValue = _useMergedState2[0], setStartPickerValue = _useMergedState2[1], _useMergedState3 = useMergedState(function() {
|
|
6449
6653
|
return getDefaultPickerValue(1);
|
|
6450
6654
|
}, {
|
|
6451
6655
|
value: endPickerValue
|
|
6452
|
-
}), _useMergedState4 = _slicedToArray$
|
|
6656
|
+
}), _useMergedState4 = _slicedToArray$2(_useMergedState3, 2), mergedEndPickerValue = _useMergedState4[0], setEndPickerValue = _useMergedState4[1], currentPickerValue = React$6.useMemo(function() {
|
|
6453
6657
|
var current = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex];
|
|
6454
6658
|
return isTimePicker ? current : fillTime(generateConfig2, current, timeDefaultValue[mergedActiveIndex]);
|
|
6455
6659
|
}, [isTimePicker, mergedStartPickerValue, mergedEndPickerValue, mergedActiveIndex, generateConfig2, timeDefaultValue]), setCurrentPickerValue = /* @__PURE__ */ __name(function(nextPickerValue) {
|
|
@@ -6481,7 +6685,7 @@ function useRangePickerValue(generateConfig2, locale, calendarValue, modes, open
|
|
|
6481
6685
|
}
|
|
6482
6686
|
__name(useRangePickerValue, "useRangePickerValue");
|
|
6483
6687
|
function useSyncState(defaultValue, controlledValue) {
|
|
6484
|
-
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) {
|
|
6485
6689
|
return useControlledValueFirst && controlledValue !== void 0 ? controlledValue : valueRef.current;
|
|
6486
6690
|
}, "getter"), setter = /* @__PURE__ */ __name(function(nextValue) {
|
|
6487
6691
|
valueRef.current = nextValue, forceUpdate({});
|
|
@@ -6519,7 +6723,7 @@ function orderDates(dates, generateConfig2) {
|
|
|
6519
6723
|
}
|
|
6520
6724
|
__name(orderDates, "orderDates");
|
|
6521
6725
|
function useCalendarValue(mergedValue) {
|
|
6522
|
-
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() {
|
|
6523
6727
|
setCalendarValue(mergedValue);
|
|
6524
6728
|
});
|
|
6525
6729
|
return React$6.useEffect(function() {
|
|
@@ -6530,12 +6734,12 @@ __name(useCalendarValue, "useCalendarValue");
|
|
|
6530
6734
|
function useInnerValue(generateConfig2, locale, formatList, rangeValue, order, defaultValue, value, onCalendarChange, onOk) {
|
|
6531
6735
|
var _useMergedState = useMergedState(defaultValue, {
|
|
6532
6736
|
value
|
|
6533
|
-
}), _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) {
|
|
6534
6738
|
var clone = _toConsumableArray$3(nextCalendarValues);
|
|
6535
6739
|
order && (clone = orderDates(clone.filter(function(date) {
|
|
6536
6740
|
return date;
|
|
6537
6741
|
}), generateConfig2));
|
|
6538
|
-
var _isSameDates = isSameDates(calendarValue(), clone), _isSameDates2 = _slicedToArray$
|
|
6742
|
+
var _isSameDates = isSameDates(calendarValue(), clone), _isSameDates2 = _slicedToArray$2(_isSameDates, 2), isSameMergedDates = _isSameDates2[0], isSameStart = _isSameDates2[1];
|
|
6539
6743
|
if (!isSameMergedDates && (setCalendarValue(clone), onCalendarChange)) {
|
|
6540
6744
|
var cellTexts = getDateTexts(clone);
|
|
6541
6745
|
onCalendarChange(clone, cellTexts, {
|
|
@@ -6551,7 +6755,7 @@ __name(useInnerValue, "useInnerValue");
|
|
|
6551
6755
|
function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, open, isInvalidateDate) {
|
|
6552
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) {
|
|
6553
6757
|
return d2;
|
|
6554
|
-
}) ? !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() {
|
|
6555
6759
|
setSubmitValue(mergedValue);
|
|
6556
6760
|
});
|
|
6557
6761
|
React$6.useEffect(function() {
|
|
@@ -6563,7 +6767,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
6563
6767
|
for (var maxLen = Math.max(disabled.length, clone.length), i = 0; i < maxLen; i += 1)
|
|
6564
6768
|
disabled[i] || (clone[i] = null);
|
|
6565
6769
|
orderOnChange && clone[0] && clone[1] && (clone = orderDates(clone, generateConfig2)), triggerCalendarChange(clone);
|
|
6566
|
-
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 ? (
|
|
6567
6771
|
// Validate empty start
|
|
6568
6772
|
(!startEmpty || allowEmpty[0]) && // Validate empty end
|
|
6569
6773
|
(!endEmpty || allowEmpty[1])
|
|
@@ -6583,7 +6787,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
6583
6787
|
);
|
|
6584
6788
|
if (allPassed) {
|
|
6585
6789
|
setInnerValue(clone);
|
|
6586
|
-
var _isSameDates3 = isSameDates(clone, mergedValue), _isSameDates4 = _slicedToArray$
|
|
6790
|
+
var _isSameDates3 = isSameDates(clone, mergedValue), _isSameDates4 = _slicedToArray$2(_isSameDates3, 1), isSameMergedDates = _isSameDates4[0];
|
|
6587
6791
|
onChange && !isSameMergedDates && onChange(
|
|
6588
6792
|
// Return null directly if all date are empty
|
|
6589
6793
|
isNullValue && clone.every(function(val) {
|
|
@@ -6651,9 +6855,9 @@ function useTimeInfo(generateConfig2) {
|
|
|
6651
6855
|
return [disabledConfig.disabledHours || disabledHours || emptyDisabled, disabledConfig.disabledMinutes || disabledMinutes || emptyDisabled, disabledConfig.disabledSeconds || disabledSeconds || emptyDisabled, disabledConfig.disabledMilliseconds || emptyDisabled];
|
|
6652
6856
|
}, [disabledTime, disabledHours, disabledMinutes, disabledSeconds]), _React$useMemo = React$6.useMemo(function() {
|
|
6653
6857
|
return getDisabledTimes(mergedDate);
|
|
6654
|
-
}, [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) {
|
|
6655
6859
|
var hours = generateUnits(0, 23, hourStep, hideDisabledOptions, getDisabledHours()), rowHourUnits2 = use12Hours ? hours.map(function(unit) {
|
|
6656
|
-
return _objectSpread2$
|
|
6860
|
+
return _objectSpread2$2(_objectSpread2$2({}, unit), {}, {
|
|
6657
6861
|
label: leftPad(unit.value % 12 || 12, 2)
|
|
6658
6862
|
});
|
|
6659
6863
|
}) : hours, getMinuteUnits2 = /* @__PURE__ */ __name(function(nextHour) {
|
|
@@ -6666,12 +6870,12 @@ function useTimeInfo(generateConfig2) {
|
|
|
6666
6870
|
return [rowHourUnits2, getMinuteUnits2, getSecondUnits2, getMillisecondUnits2];
|
|
6667
6871
|
}, [hideDisabledOptions, hourStep, use12Hours, millisecondStep, minuteStep, secondStep]), _React$useMemo3 = React$6.useMemo(function() {
|
|
6668
6872
|
return getAllUnits(mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds);
|
|
6669
|
-
}, [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) {
|
|
6670
6874
|
var getCheckHourUnits = /* @__PURE__ */ __name(function() {
|
|
6671
6875
|
return rowHourUnits;
|
|
6672
6876
|
}, "getCheckHourUnits2"), getCheckMinuteUnits = getMinuteUnits, getCheckSecondUnits = getSecondUnits, getCheckMillisecondUnits = getMillisecondUnits;
|
|
6673
6877
|
if (certainDate) {
|
|
6674
|
-
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];
|
|
6675
6879
|
getCheckHourUnits = /* @__PURE__ */ __name(function() {
|
|
6676
6880
|
return targetRowHourUnits;
|
|
6677
6881
|
}, "getCheckHourUnits2"), getCheckMinuteUnits = targetGetMinuteUnits, getCheckSecondUnits = targetGetSecondUnits, getCheckMillisecondUnits = targetGetMillisecondUnits;
|
|
@@ -6691,7 +6895,7 @@ function useTimeInfo(generateConfig2) {
|
|
|
6691
6895
|
}
|
|
6692
6896
|
__name(useTimeInfo, "useTimeInfo");
|
|
6693
6897
|
function Footer(props) {
|
|
6694
|
-
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, {
|
|
6695
6899
|
type: mode
|
|
6696
6900
|
}), onInternalNow = /* @__PURE__ */ __name(function() {
|
|
6697
6901
|
if (!nowDisabled) {
|
|
@@ -6777,7 +6981,7 @@ function PanelBody(props) {
|
|
|
6777
6981
|
col === 0 && (rowStartDate = currentDate, prefixColumn && rowNode.push(prefixColumn(rowStartDate)));
|
|
6778
6982
|
var inRange = !1, rangeStart = !1, rangeEnd = !1;
|
|
6779
6983
|
if (cellSelection && hoverRangeValue) {
|
|
6780
|
-
var _hoverRangeValue = _slicedToArray$
|
|
6984
|
+
var _hoverRangeValue = _slicedToArray$2(hoverRangeValue, 2), hoverStart = _hoverRangeValue[0], hoverEnd = _hoverRangeValue[1];
|
|
6781
6985
|
inRange = isInRange(generateConfig2, hoverStart, hoverEnd, currentDate), rangeStart = isSame(generateConfig2, locale, currentDate, hoverStart, type2), rangeEnd = isSame(generateConfig2, locale, currentDate, hoverEnd, type2);
|
|
6782
6986
|
}
|
|
6783
6987
|
var title = titleFormat ? formatValue(currentDate, {
|
|
@@ -6790,7 +6994,7 @@ function PanelBody(props) {
|
|
|
6790
6994
|
rowNode.push(/* @__PURE__ */ React$6.createElement("td", {
|
|
6791
6995
|
key: col,
|
|
6792
6996
|
title,
|
|
6793
|
-
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) {
|
|
6794
6998
|
return isSame(generateConfig2, locale, currentDate, date, type2);
|
|
6795
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
|
|
6796
7000
|
type2 !== "week" && matchValues(currentDate)), getCellClassName(currentDate))),
|
|
@@ -6907,13 +7111,13 @@ function PanelHeader(props) {
|
|
|
6907
7111
|
}
|
|
6908
7112
|
__name(PanelHeader, "PanelHeader");
|
|
6909
7113
|
function DatePanel$1(props) {
|
|
6910
|
-
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) {
|
|
6911
7115
|
var disabled = disabledDate == null ? void 0 : disabledDate(date, {
|
|
6912
7116
|
type: "week"
|
|
6913
7117
|
});
|
|
6914
7118
|
return /* @__PURE__ */ React$6.createElement("td", {
|
|
6915
7119
|
key: "week",
|
|
6916
|
-
className: clsx(cellPrefixCls, "".concat(cellPrefixCls, "-week"), _defineProperty$
|
|
7120
|
+
className: clsx(cellPrefixCls, "".concat(cellPrefixCls, "-week"), _defineProperty$c({}, "".concat(cellPrefixCls, "-disabled"), disabled)),
|
|
6917
7121
|
onClick: /* @__PURE__ */ __name(function() {
|
|
6918
7122
|
disabled || onSelect2(date);
|
|
6919
7123
|
}, "onClick"),
|
|
@@ -6944,7 +7148,7 @@ function DatePanel$1(props) {
|
|
|
6944
7148
|
generateConfig: generateConfig2
|
|
6945
7149
|
});
|
|
6946
7150
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
6947
|
-
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));
|
|
6948
7152
|
return classObj;
|
|
6949
7153
|
}, "getCellClassName"), monthsLocale = locale.shortMonths || (generateConfig2.locale.getShortMonths ? generateConfig2.locale.getShortMonths(locale.locale) : []), yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
6950
7154
|
type: "button",
|
|
@@ -6992,7 +7196,7 @@ function DatePanel$1(props) {
|
|
|
6992
7196
|
var clone = generateConfig2.setDate(date, 1);
|
|
6993
7197
|
return clone = generateConfig2.addMonth(clone, 1), generateConfig2.addDate(clone, -1);
|
|
6994
7198
|
}, "getEnd")
|
|
6995
|
-
}, monthYearNodes), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7199
|
+
}, monthYearNodes), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({
|
|
6996
7200
|
titleFormat: locale.fieldDateFormat
|
|
6997
7201
|
}, props, {
|
|
6998
7202
|
colNum: WEEK_DAY_COUNT,
|
|
@@ -7042,9 +7246,9 @@ function useScrollTo$1(ulRef, value) {
|
|
|
7042
7246
|
__name(useScrollTo$1, "useScrollTo$1");
|
|
7043
7247
|
var SCROLL_DELAY = 300;
|
|
7044
7248
|
function TimeColumn(props) {
|
|
7045
|
-
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() {
|
|
7046
7250
|
clearTimeout(checkDelayRef.current);
|
|
7047
|
-
}, "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];
|
|
7048
7252
|
useLayoutEffect$1(function() {
|
|
7049
7253
|
return syncScroll(), clearDelayCheck(), function() {
|
|
7050
7254
|
stopScroll(), clearDelayCheck();
|
|
@@ -7075,13 +7279,19 @@ function TimeColumn(props) {
|
|
|
7075
7279
|
}, label);
|
|
7076
7280
|
return /* @__PURE__ */ React$6.createElement("li", {
|
|
7077
7281
|
key: unitValue,
|
|
7078
|
-
className: clsx(cellPrefixCls, _defineProperty$
|
|
7282
|
+
className: clsx(cellPrefixCls, _defineProperty$c(_defineProperty$c({}, "".concat(cellPrefixCls, "-selected"), value === unitValue), "".concat(cellPrefixCls, "-disabled"), disabled)),
|
|
7079
7283
|
onClick: /* @__PURE__ */ __name(function() {
|
|
7080
7284
|
disabled || onChange(unitValue);
|
|
7081
7285
|
}, "onClick"),
|
|
7082
7286
|
onDoubleClick: /* @__PURE__ */ __name(function() {
|
|
7083
7287
|
!disabled && onDblClick && onDblClick();
|
|
7084
7288
|
}, "onDoubleClick"),
|
|
7289
|
+
onMouseEnter: /* @__PURE__ */ __name(function() {
|
|
7290
|
+
onHover(unitValue);
|
|
7291
|
+
}, "onMouseEnter"),
|
|
7292
|
+
onMouseLeave: /* @__PURE__ */ __name(function() {
|
|
7293
|
+
onHover(null);
|
|
7294
|
+
}, "onMouseLeave"),
|
|
7085
7295
|
"data-value": unitValue
|
|
7086
7296
|
}, cellRender ? cellRender(unitValue, {
|
|
7087
7297
|
prefixCls,
|
|
@@ -7099,10 +7309,10 @@ function isAM(hour) {
|
|
|
7099
7309
|
}
|
|
7100
7310
|
__name(isAM, "isAM");
|
|
7101
7311
|
function TimePanelBody(props) {
|
|
7102
|
-
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) {
|
|
7103
7313
|
var valueUnitVal = value && generateConfig2[func](value), pickerUnitValue = pickerValue && generateConfig2[func](pickerValue);
|
|
7104
7314
|
return [valueUnitVal, pickerUnitValue];
|
|
7105
|
-
}, "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() {
|
|
7106
7316
|
return showMeridiem ? isAM(hour) ? rowHourUnits.filter(function(h2) {
|
|
7107
7317
|
return isAM(h2.value);
|
|
7108
7318
|
}) : rowHourUnits.filter(function(h2) {
|
|
@@ -7154,56 +7364,83 @@ function TimePanelBody(props) {
|
|
|
7154
7364
|
return num != null;
|
|
7155
7365
|
}, "isNotNull");
|
|
7156
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;
|
|
7157
|
-
}, [value, pickerValue, hour, minute, second, millisecond, validHour, validMinute, validSecond, validMillisecond, pickerHour, pickerMinute, pickerSecond, pickerMillisecond, generateConfig2]),
|
|
7158
|
-
|
|
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));
|
|
7159
7381
|
}, "onHourChange"), onMinuteChange = /* @__PURE__ */ __name(function(val) {
|
|
7160
|
-
triggerChange(
|
|
7382
|
+
triggerChange(getNextMinuteTime(val));
|
|
7161
7383
|
}, "onMinuteChange"), onSecondChange = /* @__PURE__ */ __name(function(val) {
|
|
7162
|
-
triggerChange(
|
|
7384
|
+
triggerChange(getNextSecondTime(val));
|
|
7163
7385
|
}, "onSecondChange"), onMillisecondChange = /* @__PURE__ */ __name(function(val) {
|
|
7164
|
-
triggerChange(
|
|
7386
|
+
triggerChange(getNextMillisecondTime(val));
|
|
7165
7387
|
}, "onMillisecondChange"), onMeridiemChange = /* @__PURE__ */ __name(function(val) {
|
|
7166
|
-
|
|
7167
|
-
}, "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 = {
|
|
7168
7400
|
onDblClick: onCellDblClick,
|
|
7169
7401
|
changeOnScroll
|
|
7170
7402
|
};
|
|
7171
7403
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
7172
7404
|
className: "".concat(prefixCls, "-content")
|
|
7173
|
-
}, showHour && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$
|
|
7405
|
+
}, showHour && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7174
7406
|
units: hourUnits,
|
|
7175
7407
|
value: hour,
|
|
7176
7408
|
optionalValue: pickerHour,
|
|
7177
7409
|
type: "hour",
|
|
7178
|
-
onChange: onHourChange
|
|
7179
|
-
|
|
7410
|
+
onChange: onHourChange,
|
|
7411
|
+
onHover: onHourHover
|
|
7412
|
+
}, sharedColumnProps)), showMinute && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7180
7413
|
units: minuteUnits,
|
|
7181
7414
|
value: minute,
|
|
7182
7415
|
optionalValue: pickerMinute,
|
|
7183
7416
|
type: "minute",
|
|
7184
|
-
onChange: onMinuteChange
|
|
7185
|
-
|
|
7417
|
+
onChange: onMinuteChange,
|
|
7418
|
+
onHover: onMinuteHover
|
|
7419
|
+
}, sharedColumnProps)), showSecond && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7186
7420
|
units: secondUnits,
|
|
7187
7421
|
value: second,
|
|
7188
7422
|
optionalValue: pickerSecond,
|
|
7189
7423
|
type: "second",
|
|
7190
|
-
onChange: onSecondChange
|
|
7191
|
-
|
|
7424
|
+
onChange: onSecondChange,
|
|
7425
|
+
onHover: onSecondHover
|
|
7426
|
+
}, sharedColumnProps)), showMillisecond && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7192
7427
|
units: millisecondUnits,
|
|
7193
7428
|
value: millisecond,
|
|
7194
7429
|
optionalValue: pickerMillisecond,
|
|
7195
7430
|
type: "millisecond",
|
|
7196
|
-
onChange: onMillisecondChange
|
|
7197
|
-
|
|
7431
|
+
onChange: onMillisecondChange,
|
|
7432
|
+
onHover: onMillisecondHover
|
|
7433
|
+
}, sharedColumnProps)), showMeridiem && /* @__PURE__ */ React$6.createElement(TimeColumn, _extends$6({
|
|
7198
7434
|
units: meridiemUnits,
|
|
7199
7435
|
value: meridiem,
|
|
7200
7436
|
type: "meridiem",
|
|
7201
|
-
onChange: onMeridiemChange
|
|
7437
|
+
onChange: onMeridiemChange,
|
|
7438
|
+
onHover: onMeridiemHover
|
|
7202
7439
|
}, sharedColumnProps)));
|
|
7203
7440
|
}
|
|
7204
7441
|
__name(TimePanelBody, "TimePanelBody");
|
|
7205
7442
|
function TimePanel(props) {
|
|
7206
|
-
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];
|
|
7207
7444
|
return /* @__PURE__ */ React$6.createElement(PanelContext.Provider, {
|
|
7208
7445
|
value: info
|
|
7209
7446
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
@@ -7216,7 +7453,7 @@ function TimePanel(props) {
|
|
|
7216
7453
|
}
|
|
7217
7454
|
__name(TimePanel, "TimePanel");
|
|
7218
7455
|
function DateTimePanel(props) {
|
|
7219
|
-
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) {
|
|
7220
7457
|
return value ? fillTime(generateConfig2, date, value) : fillTime(generateConfig2, date, pickerValue);
|
|
7221
7458
|
}, "mergeTime"), onDateHover = /* @__PURE__ */ __name(function(date) {
|
|
7222
7459
|
onHover == null || onHover(date && mergeTime(date));
|
|
@@ -7226,14 +7463,14 @@ function DateTimePanel(props) {
|
|
|
7226
7463
|
}, "onDateSelect");
|
|
7227
7464
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
7228
7465
|
className: panelPrefixCls
|
|
7229
|
-
}, /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$
|
|
7466
|
+
}, /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$6({}, props, {
|
|
7230
7467
|
onSelect: onDateSelect,
|
|
7231
7468
|
onHover: onDateHover
|
|
7232
7469
|
})), /* @__PURE__ */ React$6.createElement(TimePanel, props));
|
|
7233
7470
|
}
|
|
7234
7471
|
__name(DateTimePanel, "DateTimePanel");
|
|
7235
7472
|
function DecadePanel(props) {
|
|
7236
|
-
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) {
|
|
7237
7474
|
var startYear = Math.floor(generateConfig2.getYear(pickerValue) / 100) * 100;
|
|
7238
7475
|
return generateConfig2.setYear(date, startYear);
|
|
7239
7476
|
}, "getStartYear"), getEndYear = /* @__PURE__ */ __name(function(date) {
|
|
@@ -7253,7 +7490,7 @@ function DecadePanel(props) {
|
|
|
7253
7490
|
});
|
|
7254
7491
|
return "".concat(startYearStr, "-").concat(endYearStr);
|
|
7255
7492
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
7256
|
-
return _defineProperty$
|
|
7493
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), isSameDecade(generateConfig2, date, startYearDate) || isSameDecade(generateConfig2, date, endYearDate) || isInRange(generateConfig2, startYearDate, endYearDate, date));
|
|
7257
7494
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7258
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);
|
|
7259
7496
|
return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
|
|
@@ -7277,7 +7514,7 @@ function DecadePanel(props) {
|
|
|
7277
7514
|
onChange: onPickerValueChange,
|
|
7278
7515
|
getStart: getStartYear,
|
|
7279
7516
|
getEnd: getEndYear
|
|
7280
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7517
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7281
7518
|
disabledDate: mergedDisabledDate,
|
|
7282
7519
|
colNum: 3,
|
|
7283
7520
|
rowNum: 4,
|
|
@@ -7289,7 +7526,7 @@ function DecadePanel(props) {
|
|
|
7289
7526
|
}
|
|
7290
7527
|
__name(DecadePanel, "DecadePanel");
|
|
7291
7528
|
function MonthPanel(props) {
|
|
7292
|
-
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) {
|
|
7293
7530
|
return generateConfig2.addMonth(date, offset2);
|
|
7294
7531
|
}, "getCellDate"), getCellText = /* @__PURE__ */ __name(function(date) {
|
|
7295
7532
|
var month = generateConfig2.getMonth(date);
|
|
@@ -7299,7 +7536,7 @@ function MonthPanel(props) {
|
|
|
7299
7536
|
generateConfig: generateConfig2
|
|
7300
7537
|
}) : monthsLocale[month];
|
|
7301
7538
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function() {
|
|
7302
|
-
return _defineProperty$
|
|
7539
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), !0);
|
|
7303
7540
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7304
7541
|
var startDate = generateConfig2.setDate(currentDate, 1), nextMonthStartDate = generateConfig2.setMonth(startDate, generateConfig2.getMonth(startDate) + 1), endDate = generateConfig2.addDate(nextMonthStartDate, -1);
|
|
7305
7542
|
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
|
|
@@ -7332,7 +7569,7 @@ function MonthPanel(props) {
|
|
|
7332
7569
|
getEnd: /* @__PURE__ */ __name(function(date) {
|
|
7333
7570
|
return generateConfig2.setMonth(date, 11);
|
|
7334
7571
|
}, "getEnd")
|
|
7335
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7572
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7336
7573
|
disabledDate: mergedDisabledDate,
|
|
7337
7574
|
titleFormat: locale.fieldMonthFormat,
|
|
7338
7575
|
colNum: 3,
|
|
@@ -7345,7 +7582,7 @@ function MonthPanel(props) {
|
|
|
7345
7582
|
}
|
|
7346
7583
|
__name(MonthPanel, "MonthPanel");
|
|
7347
7584
|
function QuarterPanel(props) {
|
|
7348
|
-
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) {
|
|
7349
7586
|
return generateConfig2.addMonth(date, offset2 * 3);
|
|
7350
7587
|
}, "getCellDate"), getCellText = /* @__PURE__ */ __name(function(date) {
|
|
7351
7588
|
return formatValue(date, {
|
|
@@ -7354,7 +7591,7 @@ function QuarterPanel(props) {
|
|
|
7354
7591
|
generateConfig: generateConfig2
|
|
7355
7592
|
});
|
|
7356
7593
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function() {
|
|
7357
|
-
return _defineProperty$
|
|
7594
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), !0);
|
|
7358
7595
|
}, "getCellClassName"), yearNode = /* @__PURE__ */ React$6.createElement("button", {
|
|
7359
7596
|
type: "button",
|
|
7360
7597
|
key: "year",
|
|
@@ -7384,7 +7621,7 @@ function QuarterPanel(props) {
|
|
|
7384
7621
|
getEnd: /* @__PURE__ */ __name(function(date) {
|
|
7385
7622
|
return generateConfig2.setMonth(date, 11);
|
|
7386
7623
|
}, "getEnd")
|
|
7387
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7624
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7388
7625
|
titleFormat: locale.fieldQuarterFormat,
|
|
7389
7626
|
colNum: 4,
|
|
7390
7627
|
rowNum: 1,
|
|
@@ -7399,19 +7636,19 @@ function WeekPanel(props) {
|
|
|
7399
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) {
|
|
7400
7637
|
var rangeCls = {};
|
|
7401
7638
|
if (hoverRangeValue) {
|
|
7402
|
-
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);
|
|
7403
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);
|
|
7404
7641
|
}
|
|
7405
7642
|
return hoverValue && (rangeCls["".concat(rowPrefixCls, "-hover")] = hoverValue.some(function(date) {
|
|
7406
7643
|
return isSameWeek(generateConfig2, localeName, currentDate, date);
|
|
7407
7644
|
})), clsx(
|
|
7408
7645
|
rowPrefixCls,
|
|
7409
|
-
_defineProperty$
|
|
7646
|
+
_defineProperty$c({}, "".concat(rowPrefixCls, "-selected"), !hoverRangeValue && isSameWeek(generateConfig2, localeName, value, currentDate)),
|
|
7410
7647
|
// Patch for hover range
|
|
7411
7648
|
rangeCls
|
|
7412
7649
|
);
|
|
7413
7650
|
}, "rowClassName");
|
|
7414
|
-
return /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$
|
|
7651
|
+
return /* @__PURE__ */ React$6.createElement(DatePanel$1, _extends$6({}, props, {
|
|
7415
7652
|
mode: "week",
|
|
7416
7653
|
panelName: "week",
|
|
7417
7654
|
rowClassName
|
|
@@ -7419,7 +7656,7 @@ function WeekPanel(props) {
|
|
|
7419
7656
|
}
|
|
7420
7657
|
__name(WeekPanel, "WeekPanel");
|
|
7421
7658
|
function YearPanel(props) {
|
|
7422
|
-
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) {
|
|
7423
7660
|
var startYear = Math.floor(generateConfig2.getYear(pickerValue) / 10) * 10;
|
|
7424
7661
|
return generateConfig2.setYear(date, startYear);
|
|
7425
7662
|
}, "getStartYear"), getEndYear = /* @__PURE__ */ __name(function(date) {
|
|
@@ -7434,7 +7671,7 @@ function YearPanel(props) {
|
|
|
7434
7671
|
generateConfig: generateConfig2
|
|
7435
7672
|
});
|
|
7436
7673
|
}, "getCellText"), getCellClassName = /* @__PURE__ */ __name(function(date) {
|
|
7437
|
-
return _defineProperty$
|
|
7674
|
+
return _defineProperty$c({}, "".concat(prefixCls, "-cell-in-view"), isSameYear(generateConfig2, date, startYearDate) || isSameYear(generateConfig2, date, endYearDate) || isInRange(generateConfig2, startYearDate, endYearDate, date));
|
|
7438
7675
|
}, "getCellClassName"), mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
|
|
7439
7676
|
var startMonth = generateConfig2.setMonth(currentDate, 0), startDate = generateConfig2.setDate(startMonth, 1), endMonth = generateConfig2.addYear(startDate, 1), endDate = generateConfig2.addDate(endMonth, -1);
|
|
7440
7677
|
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
|
|
@@ -7467,7 +7704,7 @@ function YearPanel(props) {
|
|
|
7467
7704
|
onChange: onPickerValueChange,
|
|
7468
7705
|
getStart: getStartYear,
|
|
7469
7706
|
getEnd: getEndYear
|
|
7470
|
-
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$
|
|
7707
|
+
}, yearNode), /* @__PURE__ */ React$6.createElement(PanelBody, _extends$6({}, props, {
|
|
7471
7708
|
disabledDate: mergedDisabledDate,
|
|
7472
7709
|
titleFormat: locale.fieldYearFormat,
|
|
7473
7710
|
colNum: 3,
|
|
@@ -7496,16 +7733,16 @@ function PickerPanel(props, ref) {
|
|
|
7496
7733
|
nativeElement: rootRef.current
|
|
7497
7734
|
};
|
|
7498
7735
|
});
|
|
7499
|
-
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() {
|
|
7500
7737
|
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, filledLocale);
|
|
7501
7738
|
}, [internalPicker, showTimeFormat, propFormat, timeProps, filledLocale]), now = generateConfig2.getNow(), _useMergedState = useMergedState(picker, {
|
|
7502
7739
|
value: mode,
|
|
7503
7740
|
postState: /* @__PURE__ */ __name(function(val) {
|
|
7504
7741
|
return val || "date";
|
|
7505
7742
|
}, "postState")
|
|
7506
|
-
}), _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, {
|
|
7507
7744
|
value
|
|
7508
|
-
}), _useMergedState4 = _slicedToArray$
|
|
7745
|
+
}), _useMergedState4 = _slicedToArray$2(_useMergedState3, 2), innerValue = _useMergedState4[0], setMergedValue = _useMergedState4[1], mergedValue = React$6.useMemo(function() {
|
|
7509
7746
|
var values3 = toArray$1(innerValue).filter(function(val) {
|
|
7510
7747
|
return val;
|
|
7511
7748
|
});
|
|
@@ -7521,7 +7758,7 @@ function PickerPanel(props, ref) {
|
|
|
7521
7758
|
}
|
|
7522
7759
|
}), _useMergedState5 = useMergedState(defaultPickerValue || mergedValue[0] || now, {
|
|
7523
7760
|
value: pickerValue
|
|
7524
|
-
}), _useMergedState6 = _slicedToArray$
|
|
7761
|
+
}), _useMergedState6 = _slicedToArray$2(_useMergedState5, 2), mergedPickerValue = _useMergedState6[0], setInternalPickerValue = _useMergedState6[1];
|
|
7525
7762
|
React$6.useEffect(function() {
|
|
7526
7763
|
mergedValue[0] && !pickerValue && setInternalPickerValue(mergedValue[0]);
|
|
7527
7764
|
}, [mergedValue[0]]);
|
|
@@ -7544,13 +7781,13 @@ function PickerPanel(props, ref) {
|
|
|
7544
7781
|
}, "onPanelValueSelect2"), hoverRangeDate = React$6.useMemo(function() {
|
|
7545
7782
|
var start, end;
|
|
7546
7783
|
if (Array.isArray(hoverRangeValue)) {
|
|
7547
|
-
var _hoverRangeValue = _slicedToArray$
|
|
7784
|
+
var _hoverRangeValue = _slicedToArray$2(hoverRangeValue, 2);
|
|
7548
7785
|
start = _hoverRangeValue[0], end = _hoverRangeValue[1];
|
|
7549
7786
|
} else
|
|
7550
7787
|
start = hoverRangeValue;
|
|
7551
7788
|
return !start && !end ? null : (start = start || end, end = end || start, generateConfig2.isAfter(start, end) ? [end, start] : [start, end]);
|
|
7552
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() {
|
|
7553
|
-
return _objectSpread2$
|
|
7790
|
+
return _objectSpread2$2(_objectSpread2$2({}, parentHackContext), {}, {
|
|
7554
7791
|
hideHeader
|
|
7555
7792
|
});
|
|
7556
7793
|
}, [parentHackContext, hideHeader]), panelCls = "".concat(mergedPrefixCls, "-panel"), panelProps = pickProps(props, [
|
|
@@ -7573,8 +7810,8 @@ function PickerPanel(props, ref) {
|
|
|
7573
7810
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
7574
7811
|
ref: rootRef,
|
|
7575
7812
|
tabIndex,
|
|
7576
|
-
className: clsx(panelCls, _defineProperty$
|
|
7577
|
-
}, /* @__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, {
|
|
7578
7815
|
// Time
|
|
7579
7816
|
showTime: mergedShowTime,
|
|
7580
7817
|
prefixCls: mergedPrefixCls,
|
|
@@ -7606,7 +7843,7 @@ function PopupPanel(props) {
|
|
|
7606
7843
|
onCellDblClick: /* @__PURE__ */ __name(function() {
|
|
7607
7844
|
needConfirm && onSubmit();
|
|
7608
7845
|
}, "onCellDblClick")
|
|
7609
|
-
}, hideHeader = picker === "time", pickerProps = _objectSpread2$
|
|
7846
|
+
}, hideHeader = picker === "time", pickerProps = _objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
7610
7847
|
hoverValue: null,
|
|
7611
7848
|
hoverRangeValue: null,
|
|
7612
7849
|
hideHeader
|
|
@@ -7614,18 +7851,18 @@ function PopupPanel(props) {
|
|
|
7614
7851
|
return range ? pickerProps.hoverRangeValue = hoverValue : pickerProps.hoverValue = hoverValue, multiplePanel ? /* @__PURE__ */ React$6.createElement("div", {
|
|
7615
7852
|
className: "".concat(prefixCls, "-panels")
|
|
7616
7853
|
}, /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7617
|
-
value: _objectSpread2$
|
|
7854
|
+
value: _objectSpread2$2(_objectSpread2$2({}, sharedContext), {}, {
|
|
7618
7855
|
hideNext: !0
|
|
7619
7856
|
})
|
|
7620
7857
|
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, pickerProps)), /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7621
|
-
value: _objectSpread2$
|
|
7858
|
+
value: _objectSpread2$2(_objectSpread2$2({}, sharedContext), {}, {
|
|
7622
7859
|
hidePrev: !0
|
|
7623
7860
|
})
|
|
7624
|
-
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, _extends$
|
|
7861
|
+
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, _extends$6({}, pickerProps, {
|
|
7625
7862
|
pickerValue: nextPickerValue,
|
|
7626
7863
|
onPickerValueChange: onSecondPickerValueChange
|
|
7627
7864
|
})))) : /* @__PURE__ */ React$6.createElement(PickerHackContext.Provider, {
|
|
7628
|
-
value: _objectSpread2$
|
|
7865
|
+
value: _objectSpread2$2({}, sharedContext)
|
|
7629
7866
|
}, /* @__PURE__ */ React$6.createElement(RefPanelPicker, pickerProps));
|
|
7630
7867
|
}
|
|
7631
7868
|
__name(PopupPanel, "PopupPanel");
|
|
@@ -7655,7 +7892,7 @@ function PresetPanel(props) {
|
|
|
7655
7892
|
}
|
|
7656
7893
|
__name(PresetPanel, "PresetPanel");
|
|
7657
7894
|
function Popup$2(props) {
|
|
7658
|
-
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) {
|
|
7659
7896
|
info.offsetWidth && setContainerWidth(info.offsetWidth);
|
|
7660
7897
|
}, "onResize");
|
|
7661
7898
|
React$6.useEffect(function() {
|
|
@@ -7687,9 +7924,9 @@ function Popup$2(props) {
|
|
|
7687
7924
|
presets,
|
|
7688
7925
|
onClick: onPresetSubmit,
|
|
7689
7926
|
onHover: onPresetHover
|
|
7690
|
-
}), /* @__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, {
|
|
7691
7928
|
value: popupPanelValue
|
|
7692
|
-
})), /* @__PURE__ */ React$6.createElement(Footer, _extends$
|
|
7929
|
+
})), /* @__PURE__ */ React$6.createElement(Footer, _extends$6({}, props, {
|
|
7693
7930
|
showNow: multiple ? !1 : showNow,
|
|
7694
7931
|
invalid: disableSubmit,
|
|
7695
7932
|
onSubmit: onFooterSubmit
|
|
@@ -7703,7 +7940,7 @@ function Popup$2(props) {
|
|
|
7703
7940
|
// Used for Today Button style, safe to remove if no need
|
|
7704
7941
|
"".concat(prefixCls, "-").concat(internalMode, "-panel-container")
|
|
7705
7942
|
),
|
|
7706
|
-
style: _defineProperty$
|
|
7943
|
+
style: _defineProperty$c(_defineProperty$c({}, rtl ? marginRight : marginLeft, containerOffset), rtl ? marginLeft : marginRight, "auto"),
|
|
7707
7944
|
onFocus,
|
|
7708
7945
|
onBlur: onBlur2
|
|
7709
7946
|
}, mergedNodes);
|
|
@@ -7716,7 +7953,7 @@ function Popup$2(props) {
|
|
|
7716
7953
|
}, /* @__PURE__ */ React$6.createElement("div", {
|
|
7717
7954
|
ref: arrowRef,
|
|
7718
7955
|
className: "".concat(prefixCls, "-range-arrow"),
|
|
7719
|
-
style: _defineProperty$
|
|
7956
|
+
style: _defineProperty$c({}, offsetUnit, activeOffset)
|
|
7720
7957
|
}), /* @__PURE__ */ React$6.createElement(RefResizeObserver, {
|
|
7721
7958
|
onResize: onResize2
|
|
7722
7959
|
}, renderNode));
|
|
@@ -7757,7 +7994,7 @@ function useInputProps(props, postProps) {
|
|
|
7757
7994
|
var pickedAttrs = pickAttrs(props, {
|
|
7758
7995
|
aria: !0,
|
|
7759
7996
|
data: !0
|
|
7760
|
-
}), inputProps = _objectSpread2$
|
|
7997
|
+
}), inputProps = _objectSpread2$2(_objectSpread2$2({}, pickedAttrs), {}, {
|
|
7761
7998
|
// ============== Shared ==============
|
|
7762
7999
|
format: maskFormat,
|
|
7763
8000
|
validateFormat: /* @__PURE__ */ __name(function(text) {
|
|
@@ -7835,15 +8072,15 @@ function useRootProps(props) {
|
|
|
7835
8072
|
__name(useRootProps, "useRootProps");
|
|
7836
8073
|
var _excluded$u = ["icon", "type"], _excluded2$5 = ["onClear"];
|
|
7837
8074
|
function Icon$1(props) {
|
|
7838
|
-
var icon = props.icon, type2 = props.type, restProps = _objectWithoutProperties$
|
|
7839
|
-
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({
|
|
7840
8077
|
className: "".concat(prefixCls, "-").concat(type2)
|
|
7841
8078
|
}, restProps), icon) : null;
|
|
7842
8079
|
}
|
|
7843
8080
|
__name(Icon$1, "Icon$1");
|
|
7844
8081
|
function ClearIcon(_ref) {
|
|
7845
|
-
var onClear = _ref.onClear, restProps = _objectWithoutProperties$
|
|
7846
|
-
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, {
|
|
7847
8084
|
type: "clear",
|
|
7848
8085
|
role: "button",
|
|
7849
8086
|
onMouseDown: /* @__PURE__ */ __name(function(e2) {
|
|
@@ -7857,7 +8094,7 @@ function ClearIcon(_ref) {
|
|
|
7857
8094
|
__name(ClearIcon, "ClearIcon");
|
|
7858
8095
|
var FORMAT_KEYS = ["YYYY", "MM", "DD", "HH", "mm", "ss", "SSS"], REPLACE_KEY = "顧", MaskFormat = /* @__PURE__ */ function() {
|
|
7859
8096
|
function MaskFormat2(format2) {
|
|
7860
|
-
_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;
|
|
7861
8098
|
var replaceKeys = FORMAT_KEYS.map(function(key) {
|
|
7862
8099
|
return "(".concat(key, ")");
|
|
7863
8100
|
}).join("|"), replaceReg = new RegExp(replaceKeys, "g");
|
|
@@ -7883,7 +8120,7 @@ var FORMAT_KEYS = ["YYYY", "MM", "DD", "HH", "mm", "ss", "SSS"], REPLACE_KEY = "
|
|
|
7883
8120
|
return cell.mask;
|
|
7884
8121
|
});
|
|
7885
8122
|
}
|
|
7886
|
-
return __name(MaskFormat2, "MaskFormat"), _createClass$
|
|
8123
|
+
return __name(MaskFormat2, "MaskFormat"), _createClass$2(MaskFormat2, [{
|
|
7887
8124
|
key: "getSelection",
|
|
7888
8125
|
value: /* @__PURE__ */ __name(function(maskCellIndex) {
|
|
7889
8126
|
var _ref = this.maskCells[maskCellIndex] || {}, start = _ref.start, end = _ref.end;
|
|
@@ -7936,7 +8173,7 @@ __name(getMaskRange, "getMaskRange");
|
|
|
7936
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) {
|
|
7937
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;
|
|
7938
8175
|
props.onInput;
|
|
7939
|
-
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 || "";
|
|
7940
8177
|
React$6.useEffect(function() {
|
|
7941
8178
|
setInputValue(value);
|
|
7942
8179
|
}, [value]);
|
|
@@ -7957,7 +8194,7 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
7957
8194
|
return new MaskFormat(format2 || "");
|
|
7958
8195
|
}, [format2]), _React$useMemo = React$6.useMemo(function() {
|
|
7959
8196
|
return helped ? [0, 0] : maskFormat.getSelection(focusCellIndex);
|
|
7960
|
-
}, [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) {
|
|
7961
8198
|
text && text !== format2 && text !== value && onHelp();
|
|
7962
8199
|
}, "onModify2"), triggerInputChange = useEvent(function(text) {
|
|
7963
8200
|
validateFormat(text) && onChange(text), setInputValue(text), onModify(text);
|
|
@@ -7994,7 +8231,7 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
7994
8231
|
return nextIndex = Math.max(nextIndex, 0), nextIndex = Math.min(nextIndex, maskFormat.size() - 1), nextIndex;
|
|
7995
8232
|
});
|
|
7996
8233
|
}, "offsetCellIndex2"), offsetCellValue = /* @__PURE__ */ __name(function(offset2) {
|
|
7997
|
-
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);
|
|
7998
8235
|
if (isNaN(currentTextNum))
|
|
7999
8236
|
return String(rangeDefault || (offset2 > 0 ? rangeStart : rangeEnd));
|
|
8000
8237
|
var num = currentTextNum + offset2, range = rangeEnd - rangeStart + 1;
|
|
@@ -8055,8 +8292,8 @@ var _excluded$t = ["active", "showActiveCls", "suffixIcon", "format", "validateF
|
|
|
8055
8292
|
} : {};
|
|
8056
8293
|
return /* @__PURE__ */ React$6.createElement("div", {
|
|
8057
8294
|
ref: holderRef,
|
|
8058
|
-
className: clsx(inputPrefixCls, _defineProperty$
|
|
8059
|
-
}, /* @__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({
|
|
8060
8297
|
ref: inputRef,
|
|
8061
8298
|
"aria-invalid": invalid,
|
|
8062
8299
|
autoComplete: "off"
|
|
@@ -8365,7 +8602,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8365
8602
|
props.onOpenChange;
|
|
8366
8603
|
var _onMouseDown = props.onMouseDown;
|
|
8367
8604
|
props.required, props["aria-required"];
|
|
8368
|
-
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();
|
|
8369
8606
|
React$6.useImperativeHandle(ref, function() {
|
|
8370
8607
|
return {
|
|
8371
8608
|
nativeElement: rootRef.current,
|
|
@@ -8386,7 +8623,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8386
8623
|
return oriDate && !isSame(generateConfig2, locale, oriDate, date, internalPicker);
|
|
8387
8624
|
});
|
|
8388
8625
|
onChange(nextValues), open || onSubmit();
|
|
8389
|
-
}, "onMultipleRemove2"), _useInputProps = useInputProps(_objectSpread2$
|
|
8626
|
+
}, "onMultipleRemove2"), _useInputProps = useInputProps(_objectSpread2$2(_objectSpread2$2({}, props), {}, {
|
|
8390
8627
|
onChange: onSingleChange
|
|
8391
8628
|
}), function(_ref) {
|
|
8392
8629
|
var valueTexts = _ref.valueTexts;
|
|
@@ -8394,7 +8631,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8394
8631
|
value: valueTexts[0] || "",
|
|
8395
8632
|
active: focused
|
|
8396
8633
|
};
|
|
8397
|
-
}), _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, {
|
|
8398
8635
|
prefixCls,
|
|
8399
8636
|
value,
|
|
8400
8637
|
onRemove: onMultipleRemove,
|
|
@@ -8415,7 +8652,7 @@ function SingleSelector$1(props, ref) {
|
|
|
8415
8652
|
}), showClear && /* @__PURE__ */ React$6.createElement(ClearIcon, {
|
|
8416
8653
|
icon: clearIcon,
|
|
8417
8654
|
onClear
|
|
8418
|
-
})) : /* @__PURE__ */ React$6.createElement(Input$3, _extends$
|
|
8655
|
+
})) : /* @__PURE__ */ React$6.createElement(Input$3, _extends$6({
|
|
8419
8656
|
ref: inputRef
|
|
8420
8657
|
}, getInputProps(), {
|
|
8421
8658
|
autoFocus,
|
|
@@ -8426,8 +8663,8 @@ function SingleSelector$1(props, ref) {
|
|
|
8426
8663
|
}),
|
|
8427
8664
|
showActiveCls: !1
|
|
8428
8665
|
}));
|
|
8429
|
-
return /* @__PURE__ */ React$6.createElement("div", _extends$
|
|
8430
|
-
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),
|
|
8431
8668
|
style: style2,
|
|
8432
8669
|
ref: rootRef,
|
|
8433
8670
|
onClick,
|
|
@@ -8440,28 +8677,28 @@ function SingleSelector$1(props, ref) {
|
|
|
8440
8677
|
__name(SingleSelector$1, "SingleSelector$1");
|
|
8441
8678
|
var RefSingleSelector = /* @__PURE__ */ React$6.forwardRef(SingleSelector$1);
|
|
8442
8679
|
function Picker2(props, ref) {
|
|
8443
|
-
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);
|
|
8444
8681
|
function pickerParam(values3) {
|
|
8445
8682
|
return values3 === null ? null : multiple ? values3 : values3[0];
|
|
8446
8683
|
}
|
|
8447
8684
|
__name(pickerParam, "pickerParam");
|
|
8448
|
-
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) {
|
|
8449
8686
|
if (onCalendarChange) {
|
|
8450
|
-
var filteredInfo = _objectSpread2$
|
|
8687
|
+
var filteredInfo = _objectSpread2$2({}, info);
|
|
8451
8688
|
delete filteredInfo.range, onCalendarChange(pickerParam(dates), pickerParam(dateStrings), filteredInfo);
|
|
8452
8689
|
}
|
|
8453
8690
|
}, "onInternalCalendarChange2"), onInternalOk = /* @__PURE__ */ __name(function(dates) {
|
|
8454
8691
|
onOk == null || onOk(pickerParam(dates));
|
|
8455
|
-
}, "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) {
|
|
8456
8693
|
triggerFocus2(!0), onFocus == null || onFocus(event, {});
|
|
8457
8694
|
}, "onSharedFocus2"), onSharedBlur = /* @__PURE__ */ __name(function(event) {
|
|
8458
8695
|
triggerFocus2(!1), onBlur2 == null || onBlur2(event, {});
|
|
8459
8696
|
}, "onSharedBlur2"), _useMergedState = useMergedState(picker, {
|
|
8460
8697
|
value: mode
|
|
8461
|
-
}), _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) {
|
|
8462
8699
|
onChange(pickerParam(dates), pickerParam(dateStrings));
|
|
8463
8700
|
}, _useRangeValue = useRangeValue(
|
|
8464
|
-
_objectSpread2$
|
|
8701
|
+
_objectSpread2$2(_objectSpread2$2({}, filledProps), {}, {
|
|
8465
8702
|
onChange: onInternalChange
|
|
8466
8703
|
}),
|
|
8467
8704
|
mergedValue,
|
|
@@ -8474,13 +8711,13 @@ function Picker2(props, ref) {
|
|
|
8474
8711
|
focused,
|
|
8475
8712
|
mergedOpen,
|
|
8476
8713
|
isInvalidateDate
|
|
8477
|
-
), _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() {
|
|
8478
8715
|
return submitInvalidates.some(function(invalidated) {
|
|
8479
8716
|
return invalidated;
|
|
8480
8717
|
});
|
|
8481
8718
|
}, [submitInvalidates]), onInternalPickerValueChange = /* @__PURE__ */ __name(function(dates, info) {
|
|
8482
8719
|
if (onPickerValueChange) {
|
|
8483
|
-
var cleanInfo = _objectSpread2$
|
|
8720
|
+
var cleanInfo = _objectSpread2$2(_objectSpread2$2({}, info), {}, {
|
|
8484
8721
|
mode: info.mode[0]
|
|
8485
8722
|
});
|
|
8486
8723
|
delete cleanInfo.range, onPickerValueChange(dates[0], cleanInfo);
|
|
@@ -8501,7 +8738,7 @@ function Picker2(props, ref) {
|
|
|
8501
8738
|
onInternalPickerValueChange,
|
|
8502
8739
|
minDate,
|
|
8503
8740
|
maxDate
|
|
8504
|
-
), _useRangePickerValue2 = _slicedToArray$
|
|
8741
|
+
), _useRangePickerValue2 = _slicedToArray$2(_useRangePickerValue, 2), currentPickerValue = _useRangePickerValue2[0], setCurrentPickerValue = _useRangePickerValue2[1], triggerModeChange = useEvent(function(nextPickerValue, nextMode, triggerEvent) {
|
|
8505
8742
|
if (setMode(nextMode), onPanelChange && triggerEvent !== !1) {
|
|
8506
8743
|
var lastPickerValue = nextPickerValue || calendarValue[calendarValue.length - 1];
|
|
8507
8744
|
onPanelChange(lastPickerValue, nextMode);
|
|
@@ -8516,7 +8753,7 @@ function Picker2(props, ref) {
|
|
|
8516
8753
|
triggerSubmitChange(null), triggerOpen(!1, {
|
|
8517
8754
|
force: !0
|
|
8518
8755
|
});
|
|
8519
|
-
}, "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() {
|
|
8520
8757
|
var values3 = [internalHoverValue].concat(_toConsumableArray$3(calendarValue)).filter(function(date) {
|
|
8521
8758
|
return date;
|
|
8522
8759
|
});
|
|
@@ -8550,10 +8787,10 @@ function Picker2(props, ref) {
|
|
|
8550
8787
|
triggerOpen(!1);
|
|
8551
8788
|
}, "onPopupClose2"), onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender), panelProps = React$6.useMemo(function() {
|
|
8552
8789
|
var domProps = pickAttrs(filledProps, !1), restProps = omit$2(filledProps, [].concat(_toConsumableArray$3(Object.keys(domProps)), ["onChange", "onCalendarChange", "style", "className", "onPanelChange"]));
|
|
8553
|
-
return _objectSpread2$
|
|
8790
|
+
return _objectSpread2$2(_objectSpread2$2({}, restProps), {}, {
|
|
8554
8791
|
multiple: filledProps.multiple
|
|
8555
8792
|
});
|
|
8556
|
-
}, [filledProps]), panel = /* @__PURE__ */ React$6.createElement(Popup$2, _extends$
|
|
8793
|
+
}, [filledProps]), panel = /* @__PURE__ */ React$6.createElement(Popup$2, _extends$6({}, panelProps, {
|
|
8557
8794
|
showNow: mergedShowNow,
|
|
8558
8795
|
showTime,
|
|
8559
8796
|
disabledDate,
|
|
@@ -8609,7 +8846,7 @@ function Picker2(props, ref) {
|
|
|
8609
8846
|
!mergedOpen && lastOp === "input" && (triggerOpen(!1), triggerConfirm()), !mergedOpen && complexPicker && !needConfirm && lastOp === "panel" && (triggerOpen(!0), triggerConfirm());
|
|
8610
8847
|
}, [mergedOpen]), /* @__PURE__ */ React$6.createElement(PickerContext.Provider, {
|
|
8611
8848
|
value: context
|
|
8612
|
-
}, /* @__PURE__ */ React$6.createElement(PickerTrigger, _extends$
|
|
8849
|
+
}, /* @__PURE__ */ React$6.createElement(PickerTrigger, _extends$6({}, pickTriggerProps(filledProps), {
|
|
8613
8850
|
popupElement: panel,
|
|
8614
8851
|
popupStyle: styles2.popup,
|
|
8615
8852
|
popupClassName: classNames.popup,
|
|
@@ -8617,7 +8854,7 @@ function Picker2(props, ref) {
|
|
|
8617
8854
|
onClose: onPopupClose
|
|
8618
8855
|
}), /* @__PURE__ */ React$6.createElement(
|
|
8619
8856
|
RefSingleSelector,
|
|
8620
|
-
_extends$
|
|
8857
|
+
_extends$6({}, filledProps, {
|
|
8621
8858
|
// Ref
|
|
8622
8859
|
ref: selectorRef,
|
|
8623
8860
|
suffixIcon,
|
|
@@ -8649,7 +8886,7 @@ function Picker2(props, ref) {
|
|
|
8649
8886
|
)));
|
|
8650
8887
|
}
|
|
8651
8888
|
__name(Picker2, "Picker");
|
|
8652
|
-
var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interopRequireDefault = { exports: {} };
|
|
8889
|
+
var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interopRequireDefault$1 = { exports: {} };
|
|
8653
8890
|
(function(module) {
|
|
8654
8891
|
function _interopRequireDefault2(e2) {
|
|
8655
8892
|
return e2 && e2.__esModule ? e2 : {
|
|
@@ -8657,8 +8894,8 @@ var RefPicker = /* @__PURE__ */ React$6.forwardRef(Picker2), dayjs = {}, interop
|
|
|
8657
8894
|
};
|
|
8658
8895
|
}
|
|
8659
8896
|
__name(_interopRequireDefault2, "_interopRequireDefault"), module.exports = _interopRequireDefault2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
8660
|
-
})(interopRequireDefault);
|
|
8661
|
-
var interopRequireDefaultExports = interopRequireDefault.exports, warning$1 = {};
|
|
8897
|
+
})(interopRequireDefault$1);
|
|
8898
|
+
var interopRequireDefaultExports$1 = interopRequireDefault$1.exports, warning$1 = {};
|
|
8662
8899
|
Object.defineProperty(warning$1, "__esModule", {
|
|
8663
8900
|
value: !0
|
|
8664
8901
|
});
|
|
@@ -8698,7 +8935,7 @@ warningOnce.preMessage = preMessage;
|
|
|
8698
8935
|
warningOnce.resetWarned = resetWarned;
|
|
8699
8936
|
warningOnce.noteOnce = noteOnce;
|
|
8700
8937
|
warning$1.default = warningOnce;
|
|
8701
|
-
var _interopRequireDefault$a = interopRequireDefaultExports.default;
|
|
8938
|
+
var _interopRequireDefault$a = interopRequireDefaultExports$1.default;
|
|
8702
8939
|
Object.defineProperty(dayjs, "__esModule", {
|
|
8703
8940
|
value: !0
|
|
8704
8941
|
});
|
|
@@ -9295,9 +9532,9 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9295
9532
|
nativeElement: groupRef.current || containerRef.current
|
|
9296
9533
|
};
|
|
9297
9534
|
}), hasAffix) {
|
|
9298
|
-
var
|
|
9535
|
+
var clearIcon = null;
|
|
9299
9536
|
if (allowClear) {
|
|
9300
|
-
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 : "✖";
|
|
9301
9538
|
clearIcon = /* @__PURE__ */ React__default.createElement("span", {
|
|
9302
9539
|
onClick: /* @__PURE__ */ __name(function(event) {
|
|
9303
9540
|
handleReset == null || handleReset(event), onClear == null || onClear();
|
|
@@ -9305,16 +9542,16 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9305
9542
|
onMouseDown: /* @__PURE__ */ __name(function(e2) {
|
|
9306
9543
|
return e2.preventDefault();
|
|
9307
9544
|
}, "onMouseDown"),
|
|
9308
|
-
className: clsx(clearIconCls, (
|
|
9545
|
+
className: clsx(clearIconCls, _defineProperty$c(_defineProperty$c({}, "".concat(clearIconCls, "-hidden"), !needClear), "".concat(clearIconCls, "-has-suffix"), !!suffix)),
|
|
9309
9546
|
role: "button",
|
|
9310
9547
|
tabIndex: -1
|
|
9311
9548
|
}, iconNode);
|
|
9312
9549
|
}
|
|
9313
|
-
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", {
|
|
9314
9551
|
className: clsx("".concat(prefixCls, "-suffix"), classNames == null ? void 0 : classNames.suffix),
|
|
9315
9552
|
style: styles2 == null ? void 0 : styles2.suffix
|
|
9316
9553
|
}, clearIcon, suffix);
|
|
9317
|
-
element2 = /* @__PURE__ */ React__default.createElement(AffixWrapperComponent, _extends$
|
|
9554
|
+
element2 = /* @__PURE__ */ React__default.createElement(AffixWrapperComponent, _extends$6({
|
|
9318
9555
|
className: affixWrapperCls,
|
|
9319
9556
|
style: styles2 == null ? void 0 : styles2.affixWrapper,
|
|
9320
9557
|
onClick: onInputClick
|
|
@@ -9326,7 +9563,7 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9326
9563
|
}, prefix), element2, suffixNode);
|
|
9327
9564
|
}
|
|
9328
9565
|
if (hasAddon(props)) {
|
|
9329
|
-
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);
|
|
9330
9567
|
element2 = /* @__PURE__ */ React__default.createElement(GroupWrapperComponent, {
|
|
9331
9568
|
className: mergedGroupClassName,
|
|
9332
9569
|
ref: groupRef
|
|
@@ -9340,16 +9577,16 @@ var BaseInput = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
|
|
|
9340
9577
|
}
|
|
9341
9578
|
return /* @__PURE__ */ React__default.cloneElement(element2, {
|
|
9342
9579
|
className: clsx((_element$props = element2.props) === null || _element$props === void 0 ? void 0 : _element$props.className, className) || null,
|
|
9343
|
-
style: _objectSpread2$
|
|
9580
|
+
style: _objectSpread2$2(_objectSpread2$2({}, (_element$props2 = element2.props) === null || _element$props2 === void 0 ? void 0 : _element$props2.style), style2),
|
|
9344
9581
|
hidden
|
|
9345
9582
|
});
|
|
9346
9583
|
}), _excluded$n = ["show"];
|
|
9347
9584
|
function useCount(count, showCount) {
|
|
9348
9585
|
return React$6.useMemo(function() {
|
|
9349
9586
|
var mergedConfig = {};
|
|
9350
|
-
showCount && (mergedConfig.show = _typeof$
|
|
9351
|
-
var _ref = mergedConfig, show = _ref.show, rest = _objectWithoutProperties$
|
|
9352
|
-
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), {}, {
|
|
9353
9590
|
show: !!show,
|
|
9354
9591
|
showFormatter: typeof show == "function" ? show : void 0,
|
|
9355
9592
|
strategy: rest.strategy || function(value) {
|
|
@@ -9360,11 +9597,11 @@ function useCount(count, showCount) {
|
|
|
9360
9597
|
}
|
|
9361
9598
|
__name(useCount, "useCount");
|
|
9362
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) {
|
|
9363
|
-
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) {
|
|
9364
9601
|
inputRef.current && triggerFocus(inputRef.current, option);
|
|
9365
9602
|
}, "focus"), _useMergedState = useMergedState(props.defaultValue, {
|
|
9366
9603
|
value: props.value
|
|
9367
|
-
}), _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;
|
|
9368
9605
|
useImperativeHandle(ref, function() {
|
|
9369
9606
|
var _holderRef$current;
|
|
9370
9607
|
return {
|
|
@@ -9443,9 +9680,10 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9443
9680
|
"classes",
|
|
9444
9681
|
"htmlSize",
|
|
9445
9682
|
"styles",
|
|
9446
|
-
"classNames"
|
|
9683
|
+
"classNames",
|
|
9684
|
+
"onClear"
|
|
9447
9685
|
]);
|
|
9448
|
-
return /* @__PURE__ */ React__default.createElement("input", _extends$
|
|
9686
|
+
return /* @__PURE__ */ React__default.createElement("input", _extends$6({
|
|
9449
9687
|
autoComplete
|
|
9450
9688
|
}, otherProps, {
|
|
9451
9689
|
onChange: onInternalChange,
|
|
@@ -9453,7 +9691,7 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9453
9691
|
onBlur: handleBlur,
|
|
9454
9692
|
onKeyDown: handleKeyDown,
|
|
9455
9693
|
onKeyUp: handleKeyUp,
|
|
9456
|
-
className: clsx(prefixCls, _defineProperty$
|
|
9694
|
+
className: clsx(prefixCls, _defineProperty$c({}, "".concat(prefixCls, "-disabled"), disabled), classNames == null ? void 0 : classNames.input),
|
|
9457
9695
|
style: styles2 == null ? void 0 : styles2.input,
|
|
9458
9696
|
ref: inputRef,
|
|
9459
9697
|
size: htmlSize,
|
|
@@ -9472,13 +9710,13 @@ var _excluded$m = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnte
|
|
|
9472
9710
|
maxLength: mergedMax
|
|
9473
9711
|
}) : "".concat(valueLength).concat(hasMaxLength ? " / ".concat(mergedMax) : "");
|
|
9474
9712
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, countConfig.show && /* @__PURE__ */ React__default.createElement("span", {
|
|
9475
|
-
className: clsx("".concat(prefixCls, "-show-count-suffix"), _defineProperty$
|
|
9476
|
-
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)
|
|
9477
9715
|
}, dataCount), suffix);
|
|
9478
9716
|
}
|
|
9479
9717
|
return null;
|
|
9480
9718
|
}, "getSuffix");
|
|
9481
|
-
return /* @__PURE__ */ React__default.createElement(BaseInput, _extends$
|
|
9719
|
+
return /* @__PURE__ */ React__default.createElement(BaseInput, _extends$6({}, rest, {
|
|
9482
9720
|
prefixCls,
|
|
9483
9721
|
className: clsx(className, outOfRangeCls),
|
|
9484
9722
|
handleReset,
|
|
@@ -10312,7 +10550,7 @@ var PathTrackerContext = /* @__PURE__ */ React$6.createContext(EmptyList);
|
|
|
10312
10550
|
function useFullPath(eventKey) {
|
|
10313
10551
|
var parentKeyPath = React$6.useContext(PathTrackerContext);
|
|
10314
10552
|
return React$6.useMemo(function() {
|
|
10315
|
-
return eventKey !== void 0 ? [].concat(_toConsumableArray$
|
|
10553
|
+
return eventKey !== void 0 ? [].concat(_toConsumableArray$4(parentKeyPath), [eventKey]) : parentKeyPath;
|
|
10316
10554
|
}, [parentKeyPath, eventKey]);
|
|
10317
10555
|
}
|
|
10318
10556
|
__name(useFullPath, "useFullPath");
|
|
@@ -10332,7 +10570,7 @@ function focusable(node) {
|
|
|
10332
10570
|
}
|
|
10333
10571
|
__name(focusable, "focusable");
|
|
10334
10572
|
function getFocusNodeList(node) {
|
|
10335
|
-
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) {
|
|
10336
10574
|
return focusable(child, includePositive);
|
|
10337
10575
|
});
|
|
10338
10576
|
return focusable(node, includePositive) && res.unshift(node), res;
|
|
@@ -10509,11 +10747,11 @@ function useKeyRecords() {
|
|
|
10509
10747
|
return pathKeyList.includes(eventKey);
|
|
10510
10748
|
});
|
|
10511
10749
|
}, [getKeyPath]), getKeys = /* @__PURE__ */ __name(function() {
|
|
10512
|
-
var keys4 = _toConsumableArray$
|
|
10750
|
+
var keys4 = _toConsumableArray$4(key2pathRef.current.keys());
|
|
10513
10751
|
return overflowKeys.length && keys4.push(OVERFLOW_KEY), keys4;
|
|
10514
10752
|
}, "getKeys2"), getSubPathKeys = useCallback(function(key) {
|
|
10515
10753
|
var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT), pathKeys = /* @__PURE__ */ new Set();
|
|
10516
|
-
return _toConsumableArray$
|
|
10754
|
+
return _toConsumableArray$4(path2keyRef.current.keys()).forEach(function(pathKey) {
|
|
10517
10755
|
pathKey.startsWith(connectedPath) && pathKeys.add(path2keyRef.current.get(pathKey));
|
|
10518
10756
|
}), pathKeys;
|
|
10519
10757
|
}, []);
|
|
@@ -10625,7 +10863,7 @@ var _excluded$i = ["title", "attribute", "elementRef"], _excluded2$2 = ["style",
|
|
|
10625
10863
|
return {
|
|
10626
10864
|
key: eventKey,
|
|
10627
10865
|
// Note: For legacy code is reversed which not like other antd component
|
|
10628
|
-
keyPath: _toConsumableArray$
|
|
10866
|
+
keyPath: _toConsumableArray$4(connectedKeys).reverse(),
|
|
10629
10867
|
item: legacyMenuItemRef.current,
|
|
10630
10868
|
domEvent: e2
|
|
10631
10869
|
};
|
|
@@ -10695,7 +10933,7 @@ function parseChildren(children, keyPath) {
|
|
|
10695
10933
|
return toArray$3(children).map(function(child, index2) {
|
|
10696
10934
|
if (/* @__PURE__ */ React$6.isValidElement(child)) {
|
|
10697
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;
|
|
10698
|
-
emptyKey && (eventKey = "tmp_key-".concat([].concat(_toConsumableArray$
|
|
10936
|
+
emptyKey && (eventKey = "tmp_key-".concat([].concat(_toConsumableArray$4(keyPath), [index2]).join("-")));
|
|
10699
10937
|
var cloneProps = {
|
|
10700
10938
|
key: eventKey,
|
|
10701
10939
|
eventKey
|
|
@@ -11119,7 +11357,7 @@ var _excluded$d = ["prefixCls", "rootClassName", "style", "className", "tabIndex
|
|
|
11119
11357
|
var targetKey = info.key, exist = mergedSelectKeys.includes(targetKey), newSelectKeys;
|
|
11120
11358
|
multiple ? exist ? newSelectKeys = mergedSelectKeys.filter(function(key) {
|
|
11121
11359
|
return key !== targetKey;
|
|
11122
|
-
}) : newSelectKeys = [].concat(_toConsumableArray$
|
|
11360
|
+
}) : newSelectKeys = [].concat(_toConsumableArray$4(mergedSelectKeys), [targetKey]) : newSelectKeys = [targetKey], setMergedSelectKeys(newSelectKeys);
|
|
11123
11361
|
var selectInfo = _objectSpread2$1(_objectSpread2$1({}, info), {}, {
|
|
11124
11362
|
selectedKeys: newSelectKeys
|
|
11125
11363
|
});
|
|
@@ -11342,7 +11580,16 @@ var _typeofExports = _typeof$1.exports;
|
|
|
11342
11580
|
}
|
|
11343
11581
|
__name(_interopRequireWildcard2, "_interopRequireWildcard"), module.exports = _interopRequireWildcard2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
11344
11582
|
})(interopRequireWildcard);
|
|
11345
|
-
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: {} };
|
|
11346
11593
|
(function(module) {
|
|
11347
11594
|
var _typeof3 = _typeofExports.default;
|
|
11348
11595
|
function _regeneratorRuntime() {
|
|
@@ -13112,7 +13359,7 @@ var getSeparatedContent = /* @__PURE__ */ __name(function(text, tokens, end) {
|
|
|
13112
13359
|
return [str];
|
|
13113
13360
|
var list2 = str.split(token);
|
|
13114
13361
|
return match2 = match2 || list2.length > 1, list2.reduce(function(prevList, unitStr) {
|
|
13115
|
-
return [].concat(_toConsumableArray$
|
|
13362
|
+
return [].concat(_toConsumableArray$4(prevList), _toConsumableArray$4(separate2(unitStr, restTokens)));
|
|
13116
13363
|
}, []).filter(Boolean);
|
|
13117
13364
|
}, "separate"), list = separate(text, tokens);
|
|
13118
13365
|
return match2 ? typeof end < "u" ? list.slice(0, end) : list : null;
|
|
@@ -13209,7 +13456,7 @@ var _excluded$b = ["id", "prefixCls", "className", "showSearch", "tagRender", "d
|
|
|
13209
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) {
|
|
13210
13457
|
var clearLock = getClearLock(), key = event.key, isEnterKey = key === "Enter";
|
|
13211
13458
|
if (isEnterKey && (mode !== "combobox" && event.preventDefault(), mergedOpen || onToggleOpen(!0)), setClearLock(!!mergedSearchValue), key === "Backspace" && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
|
|
13212
|
-
for (var cloneDisplayValues = _toConsumableArray$
|
|
13459
|
+
for (var cloneDisplayValues = _toConsumableArray$4(displayValues), removedDisplayValue = null, i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
|
|
13213
13460
|
var current = cloneDisplayValues[i];
|
|
13214
13461
|
if (!current.disabled) {
|
|
13215
13462
|
cloneDisplayValues.splice(i, 1), removedDisplayValue = current;
|
|
@@ -14107,7 +14354,7 @@ var OptionList = /* @__PURE__ */ __name(function(_, ref) {
|
|
|
14107
14354
|
}, [memoFlattenOptions.length, searchValue]);
|
|
14108
14355
|
var isSelected = React$6.useCallback(function(value) {
|
|
14109
14356
|
return rawValues.has(value) && mode !== "combobox";
|
|
14110
|
-
}, [mode, _toConsumableArray$
|
|
14357
|
+
}, [mode, _toConsumableArray$4(rawValues).toString(), rawValues.size]);
|
|
14111
14358
|
useEffect(function() {
|
|
14112
14359
|
var timeoutId = setTimeout(function() {
|
|
14113
14360
|
if (!multiple && open && rawValues.size === 1) {
|
|
@@ -14457,10 +14704,10 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14457
14704
|
}), filledTagOptions = React$6.useMemo(function() {
|
|
14458
14705
|
if (mode !== "tags")
|
|
14459
14706
|
return mergedOptions;
|
|
14460
|
-
var cloneOptions = _toConsumableArray$
|
|
14707
|
+
var cloneOptions = _toConsumableArray$4(mergedOptions), existOptions = /* @__PURE__ */ __name(function(val) {
|
|
14461
14708
|
return valueOptions.has(val);
|
|
14462
14709
|
}, "existOptions2");
|
|
14463
|
-
return _toConsumableArray$
|
|
14710
|
+
return _toConsumableArray$4(mergedValues).sort(function(a, b2) {
|
|
14464
14711
|
return a.value < b2.value ? -1 : 1;
|
|
14465
14712
|
}).forEach(function(item) {
|
|
14466
14713
|
var val = item.value;
|
|
@@ -14471,9 +14718,9 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14471
14718
|
return item[optionFilterProp || "value"] === mergedSearchValue;
|
|
14472
14719
|
}) || filteredOptions.some(function(item) {
|
|
14473
14720
|
return item[mergedFieldNames.value] === mergedSearchValue;
|
|
14474
|
-
}) ? filteredOptions : [createTagOption(mergedSearchValue)].concat(_toConsumableArray$
|
|
14721
|
+
}) ? filteredOptions : [createTagOption(mergedSearchValue)].concat(_toConsumableArray$4(filteredOptions));
|
|
14475
14722
|
}, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]), orderedFilteredOptions = React$6.useMemo(function() {
|
|
14476
|
-
return filterSort ? _toConsumableArray$
|
|
14723
|
+
return filterSort ? _toConsumableArray$4(filledSearchOptions).sort(function(a, b2) {
|
|
14477
14724
|
return filterSort(a, b2, {
|
|
14478
14725
|
searchValue: mergedSearchValue
|
|
14479
14726
|
});
|
|
@@ -14523,7 +14770,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14523
14770
|
}
|
|
14524
14771
|
}, "triggerSelect2"), onInternalSelect = useRefFunc(function(val, info) {
|
|
14525
14772
|
var cloneValues, mergedSelect = multiple ? info.selected : !0;
|
|
14526
|
-
mergedSelect ? cloneValues = multiple ? [].concat(_toConsumableArray$
|
|
14773
|
+
mergedSelect ? cloneValues = multiple ? [].concat(_toConsumableArray$4(mergedValues), [val]) : [val] : cloneValues = mergedValues.filter(function(v2) {
|
|
14527
14774
|
return v2.value !== val;
|
|
14528
14775
|
}), triggerChange(cloneValues), triggerSelect(val, mergedSelect), mode === "combobox" ? setActiveValue("") : (!isMultiple || autoClearSearchValue) && (setSearchValue(""), setActiveValue(""));
|
|
14529
14776
|
}), onDisplayValuesChange = /* @__PURE__ */ __name(function(nextValues, info) {
|
|
@@ -14536,7 +14783,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14536
14783
|
if (setSearchValue(searchText), setActiveValue(null), info.source === "submit") {
|
|
14537
14784
|
var formatted = (searchText || "").trim();
|
|
14538
14785
|
if (formatted) {
|
|
14539
|
-
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$
|
|
14786
|
+
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$4(rawValues), [formatted])));
|
|
14540
14787
|
triggerChange(newRawValues), triggerSelect(formatted, !0), setSearchValue("");
|
|
14541
14788
|
}
|
|
14542
14789
|
return;
|
|
@@ -14550,7 +14797,7 @@ var Select$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
|
14550
14797
|
}).filter(function(val) {
|
|
14551
14798
|
return val !== void 0;
|
|
14552
14799
|
}));
|
|
14553
|
-
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$
|
|
14800
|
+
var newRawValues = Array.from(new Set([].concat(_toConsumableArray$4(rawValues), _toConsumableArray$4(patchValues))));
|
|
14554
14801
|
triggerChange(newRawValues), newRawValues.forEach(function(newRawValue) {
|
|
14555
14802
|
triggerSelect(newRawValue, !0);
|
|
14556
14803
|
});
|
|
@@ -14727,10 +14974,10 @@ var calcThumbStyle = /* @__PURE__ */ __name(function(targetElement) {
|
|
|
14727
14974
|
return value !== void 0 ? "".concat(value, "px") : void 0;
|
|
14728
14975
|
}, "toPX2");
|
|
14729
14976
|
function MotionThumb(props) {
|
|
14730
|
-
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) {
|
|
14731
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];
|
|
14732
14979
|
return (ele == null ? void 0 : ele.offsetParent) && ele;
|
|
14733
|
-
}, "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];
|
|
14734
14981
|
useLayoutEffect$1(function() {
|
|
14735
14982
|
if (prevValue !== value) {
|
|
14736
14983
|
var prev = findValueElement(prevValue), next = findValueElement(value), calcPrevStyle = calcThumbStyle(prev), calcNextStyle = calcThumbStyle(next);
|
|
@@ -14762,7 +15009,7 @@ function MotionThumb(props) {
|
|
|
14762
15009
|
onAppearActive,
|
|
14763
15010
|
onVisibleChanged
|
|
14764
15011
|
}, function(_ref, ref) {
|
|
14765
|
-
var motionClassName = _ref.className, motionStyle = _ref.style, mergedStyle = _objectSpread2$
|
|
15012
|
+
var motionClassName = _ref.className, motionStyle = _ref.style, mergedStyle = _objectSpread2$2(_objectSpread2$2({}, motionStyle), {}, {
|
|
14766
15013
|
"--thumb-start-left": thumbStart,
|
|
14767
15014
|
"--thumb-start-width": toPX(prevStyle == null ? void 0 : prevStyle.width),
|
|
14768
15015
|
"--thumb-active-left": thumbActive,
|
|
@@ -14780,7 +15027,7 @@ var _excluded$6 = ["prefixCls", "direction", "options", "disabled", "defaultValu
|
|
|
14780
15027
|
function getValidTitle(option) {
|
|
14781
15028
|
if (typeof option.title < "u")
|
|
14782
15029
|
return option.title;
|
|
14783
|
-
if (_typeof$
|
|
15030
|
+
if (_typeof$3(option.label) !== "object") {
|
|
14784
15031
|
var _option$label;
|
|
14785
15032
|
return (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toString();
|
|
14786
15033
|
}
|
|
@@ -14788,9 +15035,9 @@ function getValidTitle(option) {
|
|
|
14788
15035
|
__name(getValidTitle, "getValidTitle");
|
|
14789
15036
|
function normalizeOptions(options) {
|
|
14790
15037
|
return options.map(function(option) {
|
|
14791
|
-
if (_typeof$
|
|
15038
|
+
if (_typeof$3(option) === "object" && option !== null) {
|
|
14792
15039
|
var validTitle = getValidTitle(option);
|
|
14793
|
-
return _objectSpread2$
|
|
15040
|
+
return _objectSpread2$2(_objectSpread2$2({}, option), {}, {
|
|
14794
15041
|
title: validTitle
|
|
14795
15042
|
});
|
|
14796
15043
|
}
|
|
@@ -14807,7 +15054,7 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14807
15054
|
disabled || onChange(event, value);
|
|
14808
15055
|
}, "handleChange2");
|
|
14809
15056
|
return /* @__PURE__ */ React$6.createElement("label", {
|
|
14810
|
-
className: clsx(className, _defineProperty$
|
|
15057
|
+
className: clsx(className, _defineProperty$c({}, "".concat(prefixCls, "-item-disabled"), disabled))
|
|
14811
15058
|
}, /* @__PURE__ */ React$6.createElement("input", {
|
|
14812
15059
|
className: "".concat(prefixCls, "-item-input"),
|
|
14813
15060
|
type: "radio",
|
|
@@ -14816,21 +15063,26 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14816
15063
|
onChange: handleChange
|
|
14817
15064
|
}), /* @__PURE__ */ React$6.createElement("div", {
|
|
14818
15065
|
className: "".concat(prefixCls, "-item-label"),
|
|
14819
|
-
title
|
|
15066
|
+
title,
|
|
15067
|
+
role: "option",
|
|
15068
|
+
"aria-selected": checked
|
|
14820
15069
|
}, label));
|
|
14821
15070
|
}, "InternalSegmentedOption2"), Segmented$1 = /* @__PURE__ */ React$6.forwardRef(function(props, ref) {
|
|
14822
|
-
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() {
|
|
14823
15072
|
return composeRef(containerRef, ref);
|
|
14824
15073
|
}, [containerRef, ref]), segmentedOptions = React$6.useMemo(function() {
|
|
14825
15074
|
return normalizeOptions(options);
|
|
14826
15075
|
}, [options]), _useMergedState = useMergedState((_segmentedOptions$ = segmentedOptions[0]) === null || _segmentedOptions$ === void 0 ? void 0 : _segmentedOptions$.value, {
|
|
14827
15076
|
value,
|
|
14828
15077
|
defaultValue
|
|
14829
|
-
}), _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) {
|
|
14830
15079
|
disabled || (setRawValue(val), onChange == null || onChange(val));
|
|
14831
15080
|
}, "handleChange2"), divProps = omit$2(restProps, ["children"]);
|
|
14832
|
-
return /* @__PURE__ */ React$6.createElement("div", _extends$
|
|
14833
|
-
|
|
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),
|
|
14834
15086
|
ref: mergedRef
|
|
14835
15087
|
}), /* @__PURE__ */ React$6.createElement("div", {
|
|
14836
15088
|
className: "".concat(prefixCls, "-group")
|
|
@@ -14852,10 +15104,10 @@ var InternalSegmentedOption = /* @__PURE__ */ __name(function(_ref) {
|
|
|
14852
15104
|
setThumbShow(!1);
|
|
14853
15105
|
}, "onMotionEnd")
|
|
14854
15106
|
}), segmentedOptions.map(function(segmentedOption) {
|
|
14855
|
-
return /* @__PURE__ */ React$6.createElement(InternalSegmentedOption, _extends$
|
|
15107
|
+
return /* @__PURE__ */ React$6.createElement(InternalSegmentedOption, _extends$6({}, segmentedOption, {
|
|
14856
15108
|
key: segmentedOption.value,
|
|
14857
15109
|
prefixCls,
|
|
14858
|
-
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)),
|
|
14859
15111
|
checked: segmentedOption.value === rawValue,
|
|
14860
15112
|
onChange: handleChange,
|
|
14861
15113
|
disabled: !!disabled || !!segmentedOption.disabled
|
|
@@ -18655,7 +18907,7 @@ var _excluded$2 = ["prefixCls", "defaultValue", "value", "autoSize", "onResize",
|
|
|
18655
18907
|
React__default.useEffect(function() {
|
|
18656
18908
|
if (selection) {
|
|
18657
18909
|
var _getTextArea;
|
|
18658
|
-
(_getTextArea = getTextArea()).setSelectionRange.apply(_getTextArea, _toConsumableArray$
|
|
18910
|
+
(_getTextArea = getTextArea()).setSelectionRange.apply(_getTextArea, _toConsumableArray$4(selection));
|
|
18659
18911
|
}
|
|
18660
18912
|
}, [selection]);
|
|
18661
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) {
|