antd-mobile 5.37.0 → 5.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +923 -873
  2. package/2x/bundle/antd-mobile.cjs.js +7 -7
  3. package/2x/bundle/antd-mobile.es.development.js +923 -873
  4. package/2x/bundle/antd-mobile.es.js +4924 -4897
  5. package/2x/bundle/antd-mobile.umd.development.js +923 -873
  6. package/2x/bundle/antd-mobile.umd.js +7 -7
  7. package/2x/bundle/style.css +45 -45
  8. package/2x/cjs/components/calendar-picker/calendar-picker.js +12 -6
  9. package/2x/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
  10. package/2x/cjs/components/calendar-picker-view/calendar-picker-view.js +41 -19
  11. package/2x/cjs/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
  12. package/2x/cjs/components/calendar-picker-view/useSyncScroll.js +39 -0
  13. package/2x/cjs/components/nav-bar/nav-bar.js +6 -6
  14. package/2x/es/components/calendar-picker/calendar-picker.js +11 -5
  15. package/2x/es/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
  16. package/2x/es/components/calendar-picker-view/calendar-picker-view.js +40 -19
  17. package/2x/es/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
  18. package/2x/es/components/calendar-picker-view/useSyncScroll.js +33 -0
  19. package/2x/es/components/nav-bar/nav-bar.js +7 -7
  20. package/2x/package.json +1 -1
  21. package/bundle/antd-mobile.cjs.development.js +923 -873
  22. package/bundle/antd-mobile.cjs.js +7 -7
  23. package/bundle/antd-mobile.compatible.umd.js +1 -1
  24. package/bundle/antd-mobile.es.development.js +923 -873
  25. package/bundle/antd-mobile.es.js +4924 -4897
  26. package/bundle/antd-mobile.umd.development.js +923 -873
  27. package/bundle/antd-mobile.umd.js +7 -7
  28. package/bundle/style.css +1 -1
  29. package/cjs/components/calendar-picker/calendar-picker.js +12 -6
  30. package/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
  31. package/cjs/components/calendar-picker-view/calendar-picker-view.js +41 -19
  32. package/cjs/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
  33. package/cjs/components/calendar-picker-view/useSyncScroll.js +39 -0
  34. package/cjs/components/nav-bar/nav-bar.js +6 -6
  35. package/es/components/calendar-picker/calendar-picker.js +11 -5
  36. package/es/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
  37. package/es/components/calendar-picker-view/calendar-picker-view.js +40 -19
  38. package/es/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
  39. package/es/components/calendar-picker-view/useSyncScroll.js +33 -0
  40. package/es/components/nav-bar/nav-bar.js +7 -7
  41. package/package.json +1 -1
  42. package/umd/antd-mobile.js +1 -1
@@ -5830,7 +5830,7 @@ const colorRecord$4 = {
5830
5830
  black: "0, 0, 0",
5831
5831
  white: "255, 255, 255"
5832
5832
  };
5833
- const defaultProps$15 = {
5833
+ const defaultProps$14 = {
5834
5834
  visible: true,
5835
5835
  destroyOnClose: false,
5836
5836
  forceRender: false,
@@ -5841,7 +5841,7 @@ const defaultProps$15 = {
5841
5841
  stopPropagation: ["click"]
5842
5842
  };
5843
5843
  const Mask = (p) => {
5844
- const props = mergeProps(defaultProps$15, p);
5844
+ const props = mergeProps(defaultProps$14, p);
5845
5845
  const {
5846
5846
  locale
5847
5847
  } = useConfig();
@@ -8356,7 +8356,7 @@ function createUseGesture(actions) {
8356
8356
  };
8357
8357
  }
8358
8358
  const classPrefix$1o = `adm-popup`;
8359
- const defaultProps$14 = Object.assign(Object.assign({}, defaultPopupBaseProps), {
8359
+ const defaultProps$13 = Object.assign(Object.assign({}, defaultPopupBaseProps), {
8360
8360
  closeOnSwipe: false,
8361
8361
  position: "bottom"
8362
8362
  });
@@ -8365,7 +8365,7 @@ const Popup = (p) => {
8365
8365
  locale,
8366
8366
  popup: componentConfig = {}
8367
8367
  } = useConfig();
8368
- const props = mergeProps(defaultProps$14, componentConfig, p);
8368
+ const props = mergeProps(defaultProps$13, componentConfig, p);
8369
8369
  const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
8370
8370
  const [active, setActive] = useState(props.visible);
8371
8371
  const ref = useRef(null);
@@ -8606,7 +8606,7 @@ function renderImperatively(element) {
8606
8606
  };
8607
8607
  }
8608
8608
  const classPrefix$1m = `adm-action-sheet`;
8609
- const defaultProps$13 = {
8609
+ const defaultProps$12 = {
8610
8610
  visible: false,
8611
8611
  actions: [],
8612
8612
  cancelText: "",
@@ -8617,7 +8617,7 @@ const defaultProps$13 = {
8617
8617
  forceRender: false
8618
8618
  };
8619
8619
  const ActionSheet = (p) => {
8620
- const props = mergeProps(defaultProps$13, p);
8620
+ const props = mergeProps(defaultProps$12, p);
8621
8621
  const {
8622
8622
  styles
8623
8623
  } = props;
@@ -8790,7 +8790,7 @@ const BrokenImageIcon = () => React__default.createElement("svg", {
8790
8790
  fillRule: "nonzero"
8791
8791
  }));
8792
8792
  const classPrefix$1k = `adm-image`;
8793
- const defaultProps$12 = {
8793
+ const defaultProps$11 = {
8794
8794
  fit: "fill",
8795
8795
  placeholder: React__default.createElement("div", {
8796
8796
  className: `${classPrefix$1k}-tip`
@@ -8802,7 +8802,7 @@ const defaultProps$12 = {
8802
8802
  draggable: false
8803
8803
  };
8804
8804
  const Image$1 = staged_1((p) => {
8805
- const props = mergeProps(defaultProps$12, p);
8805
+ const props = mergeProps(defaultProps$11, p);
8806
8806
  const [loaded, setLoaded] = useState(false);
8807
8807
  const [failed, setFailed] = useState(false);
8808
8808
  const ref = useRef(null);
@@ -8879,12 +8879,12 @@ const Image$1 = staged_1((p) => {
8879
8879
  }), renderInner()));
8880
8880
  });
8881
8881
  const classPrefix$1j = "adm-avatar";
8882
- const defaultProps$11 = {
8882
+ const defaultProps$10 = {
8883
8883
  fallback: React__default.createElement(Fallback, null),
8884
8884
  fit: "cover"
8885
8885
  };
8886
8886
  const Avatar = (p) => {
8887
- const props = mergeProps(defaultProps$11, p);
8887
+ const props = mergeProps(defaultProps$10, p);
8888
8888
  return withNativeProps(props, React__default.createElement(Image$1, {
8889
8889
  className: classPrefix$1j,
8890
8890
  src: props.src,
@@ -8934,12 +8934,12 @@ const colorRecord$3 = {
8934
8934
  primary: "var(--adm-color-primary)",
8935
8935
  white: "var(--adm-color-white)"
8936
8936
  };
8937
- const defaultProps$10 = {
8937
+ const defaultProps$$ = {
8938
8938
  color: "default"
8939
8939
  };
8940
8940
  const DotLoading = memo((p) => {
8941
8941
  var _a;
8942
- const props = mergeProps(defaultProps$10, p);
8942
+ const props = mergeProps(defaultProps$$, p);
8943
8943
  return withNativeProps(props, React__default.createElement("div", {
8944
8944
  style: {
8945
8945
  color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
@@ -8988,7 +8988,7 @@ function isIOS() {
8988
8988
  return canUseDom$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
8989
8989
  }
8990
8990
  const classPrefix$1g = `adm-button`;
8991
- const defaultProps$$ = {
8991
+ const defaultProps$_ = {
8992
8992
  color: "default",
8993
8993
  fill: "solid",
8994
8994
  block: false,
@@ -9001,7 +9001,7 @@ const defaultProps$$ = {
9001
9001
  size: "middle"
9002
9002
  };
9003
9003
  const Button = forwardRef((p, ref) => {
9004
- const props = mergeProps(defaultProps$$, p);
9004
+ const props = mergeProps(defaultProps$_, p);
9005
9005
  const [innerLoading, setInnerLoading] = useState(false);
9006
9006
  const nativeButtonRef = useRef(null);
9007
9007
  const loading = props.loading === "auto" ? innerLoading : props.loading;
@@ -9184,7 +9184,7 @@ function convertPageToDayjs$1(page) {
9184
9184
  }
9185
9185
  dayjs.extend(isoWeek);
9186
9186
  const classPrefix$1f = "adm-calendar";
9187
- const defaultProps$_ = {
9187
+ const defaultProps$Z = {
9188
9188
  weekStartsOn: "Sunday",
9189
9189
  defaultValue: null,
9190
9190
  allowClear: true,
@@ -9195,7 +9195,7 @@ const defaultProps$_ = {
9195
9195
  };
9196
9196
  const Calendar = forwardRef((p, ref) => {
9197
9197
  const today = dayjs();
9198
- const props = mergeProps(defaultProps$_, p);
9198
+ const props = mergeProps(defaultProps$Z, p);
9199
9199
  const {
9200
9200
  locale
9201
9201
  } = useConfig();
@@ -9393,19 +9393,6 @@ const Calendar = forwardRef((p, ref) => {
9393
9393
  className: classPrefix$1f
9394
9394
  }, header, mark, body));
9395
9395
  });
9396
- const classPrefix$1e = `adm-divider`;
9397
- const defaultProps$Z = {
9398
- contentPosition: "center",
9399
- direction: "horizontal"
9400
- };
9401
- const Divider = (p) => {
9402
- const props = mergeProps(defaultProps$Z, p);
9403
- return withNativeProps(props, React__default.createElement("div", {
9404
- className: classNames(classPrefix$1e, `${classPrefix$1e}-${props.direction}`, `${classPrefix$1e}-${props.contentPosition}`)
9405
- }, props.children && React__default.createElement("div", {
9406
- className: `${classPrefix$1e}-content`
9407
- }, props.children)));
9408
- };
9409
9396
  var isSameOrBefore$1 = { exports: {} };
9410
9397
  (function(module, exports) {
9411
9398
  !function(e2, i2) {
@@ -9431,224 +9418,770 @@ function convertValueToRange(selectionMode, value) {
9431
9418
  function convertPageToDayjs(page) {
9432
9419
  return dayjs().year(page.year).month(page.month - 1).date(1);
9433
9420
  }
9434
- dayjs.extend(isoWeek);
9435
- dayjs.extend(isSameOrBefore);
9436
- const classPrefix$1d = "adm-calendar-picker-view";
9437
- const defaultProps$Y = {
9438
- weekStartsOn: "Sunday",
9439
- defaultValue: null,
9440
- allowClear: true,
9441
- usePopup: true,
9442
- selectionMode: "single"
9443
- };
9444
- const CalendarPickerView = forwardRef((p, ref) => {
9445
- var _a;
9446
- const today = dayjs();
9447
- const props = mergeProps(defaultProps$Y, p);
9448
- const {
9449
- locale
9450
- } = useConfig();
9451
- const markItems = [...locale.Calendar.markItems];
9452
- if (props.weekStartsOn === "Sunday") {
9453
- const item = markItems.pop();
9454
- if (item)
9455
- markItems.unshift(item);
9456
- }
9457
- const [dateRange, setDateRange] = usePropsValue({
9458
- value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
9459
- defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
9460
- onChange: (v) => {
9461
- var _a2, _b;
9462
- if (props.selectionMode === "single") {
9463
- (_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
9464
- } else if (props.selectionMode === "range") {
9465
- (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
9466
- }
9421
+ function useEvent(callback) {
9422
+ var fnRef = React$1.useRef();
9423
+ fnRef.current = callback;
9424
+ var memoFn = React$1.useCallback(function() {
9425
+ var _fnRef$current;
9426
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9427
+ args[_key] = arguments[_key];
9467
9428
  }
9468
- });
9469
- const [intermediate, setIntermediate] = useState(false);
9470
- const [current, setCurrent] = useState(() => dayjs(dateRange ? dateRange[0] : today).date(1));
9471
- useImperativeHandle(ref, () => ({
9472
- jumpTo: (pageOrPageGenerator) => {
9473
- let page;
9474
- if (typeof pageOrPageGenerator === "function") {
9475
- page = pageOrPageGenerator({
9476
- year: current.year(),
9477
- month: current.month() + 1
9478
- });
9479
- } else {
9480
- page = pageOrPageGenerator;
9429
+ return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
9430
+ }, []);
9431
+ return memoFn;
9432
+ }
9433
+ function _arrayWithHoles(arr) {
9434
+ if (Array.isArray(arr))
9435
+ return arr;
9436
+ }
9437
+ function _iterableToArrayLimit(r, l) {
9438
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9439
+ if (null != t) {
9440
+ var e2, n2, i2, u, a = [], f = true, o = false;
9441
+ try {
9442
+ if (i2 = (t = t.call(r)).next, 0 === l) {
9443
+ if (Object(t) !== t)
9444
+ return;
9445
+ f = false;
9446
+ } else
9447
+ for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
9448
+ ;
9449
+ } catch (r2) {
9450
+ o = true, n2 = r2;
9451
+ } finally {
9452
+ try {
9453
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
9454
+ return;
9455
+ } finally {
9456
+ if (o)
9457
+ throw n2;
9481
9458
  }
9482
- setCurrent(convertPageToDayjs(page));
9483
- },
9484
- jumpToToday: () => {
9485
- setCurrent(dayjs().date(1));
9486
- },
9487
- getDateRange: () => dateRange
9488
- }));
9489
- const header = React__default.createElement("div", {
9490
- className: `${classPrefix$1d}-header`
9491
- }, React__default.createElement("div", {
9492
- className: `${classPrefix$1d}-title`
9493
- }, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
9494
- const maxDay = useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
9495
- const minDay = useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
9496
- function renderBody() {
9497
- var _a2;
9498
- const cells = [];
9499
- let monthIterator = minDay;
9500
- while (monthIterator.isSameOrBefore(maxDay, "month")) {
9501
- const year = monthIterator.year();
9502
- const month = monthIterator.month();
9503
- const renderMap = {
9504
- year,
9505
- month: month + 1
9506
- };
9507
- cells.push(React__default.createElement("div", {
9508
- key: `${year}-${month}`
9509
- }, React__default.createElement("div", {
9510
- className: `${classPrefix$1d}-title`
9511
- }, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
9512
- var _a3;
9513
- return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
9514
- })), React__default.createElement("div", {
9515
- className: `${classPrefix$1d}-cells`
9516
- }, Array(props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday()).fill(null).map((_, index2) => React__default.createElement("div", {
9517
- key: index2,
9518
- className: `${classPrefix$1d}-cell`
9519
- })), Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
9520
- var _a3;
9521
- const d = monthIterator.date(index2 + 1);
9522
- let isSelect = false;
9523
- let isBegin = false;
9524
- let isEnd = false;
9525
- let isSelectRowBegin = false;
9526
- let isSelectRowEnd = false;
9527
- if (dateRange) {
9528
- const [begin, end] = dateRange;
9529
- isBegin = d.isSame(begin, "day");
9530
- isEnd = d.isSame(end, "day");
9531
- isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
9532
- if (isSelect) {
9533
- isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
9534
- isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
9535
- }
9536
- }
9537
- const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
9538
- const renderTop = () => {
9539
- var _a4;
9540
- const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
9541
- if (top) {
9542
- return top;
9543
- }
9544
- if (props.selectionMode === "range") {
9545
- if (isBegin) {
9546
- return locale.Calendar.start;
9547
- }
9548
- if (isEnd) {
9549
- return locale.Calendar.end;
9550
- }
9551
- }
9552
- if (d.isSame(today, "day") && !isSelect) {
9553
- return locale.Calendar.today;
9554
- }
9555
- };
9556
- return React__default.createElement("div", {
9557
- key: d.valueOf(),
9558
- className: classNames(`${classPrefix$1d}-cell`, {
9559
- [`${classPrefix$1d}-cell-today`]: d.isSame(today, "day"),
9560
- [`${classPrefix$1d}-cell-selected`]: isSelect,
9561
- [`${classPrefix$1d}-cell-selected-begin`]: isBegin,
9562
- [`${classPrefix$1d}-cell-selected-end`]: isEnd,
9563
- [`${classPrefix$1d}-cell-selected-row-begin`]: isSelectRowBegin,
9564
- [`${classPrefix$1d}-cell-selected-row-end`]: isSelectRowEnd,
9565
- [`${classPrefix$1d}-cell-disabled`]: !!disabled
9566
- }),
9567
- onClick: () => {
9568
- if (!props.selectionMode)
9569
- return;
9570
- if (disabled)
9571
- return;
9572
- const date4 = d.toDate();
9573
- function shouldClear() {
9574
- if (!props.allowClear)
9575
- return false;
9576
- if (!dateRange)
9577
- return false;
9578
- const [begin, end] = dateRange;
9579
- return d.isSame(begin, "date") && d.isSame(end, "day");
9580
- }
9581
- if (props.selectionMode === "single") {
9582
- if (props.allowClear && shouldClear()) {
9583
- setDateRange(null);
9584
- return;
9585
- }
9586
- setDateRange([date4, date4]);
9587
- } else if (props.selectionMode === "range") {
9588
- if (!dateRange) {
9589
- setDateRange([date4, date4]);
9590
- setIntermediate(true);
9591
- return;
9592
- }
9593
- if (shouldClear()) {
9594
- setDateRange(null);
9595
- setIntermediate(false);
9596
- return;
9597
- }
9598
- if (intermediate) {
9599
- const another = dateRange[0];
9600
- setDateRange(another > date4 ? [date4, another] : [another, date4]);
9601
- setIntermediate(false);
9602
- } else {
9603
- setDateRange([date4, date4]);
9604
- setIntermediate(true);
9605
- }
9606
- }
9607
- }
9608
- }, React__default.createElement("div", {
9609
- className: `${classPrefix$1d}-cell-top`
9610
- }, renderTop()), React__default.createElement("div", {
9611
- className: `${classPrefix$1d}-cell-date`
9612
- }, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React__default.createElement("div", {
9613
- className: `${classPrefix$1d}-cell-bottom`
9614
- }, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
9615
- }))));
9616
- monthIterator = monthIterator.add(1, "month");
9617
9459
  }
9618
- return cells;
9460
+ return a;
9619
9461
  }
9620
- const body = React__default.createElement("div", {
9621
- className: `${classPrefix$1d}-body`
9622
- }, renderBody());
9623
- const mark = React__default.createElement("div", {
9624
- className: `${classPrefix$1d}-mark`
9625
- }, markItems.map((item, index2) => React__default.createElement("div", {
9626
- key: index2,
9627
- className: `${classPrefix$1d}-mark-cell`
9628
- }, item)));
9629
- return withNativeProps(props, React__default.createElement("div", {
9630
- className: classPrefix$1d
9631
- }, header, mark, body));
9632
- });
9633
- const classPrefix$1c = "adm-calendar-picker";
9634
- const defaultProps$X = {
9635
- weekStartsOn: "Sunday",
9636
- defaultValue: null,
9637
- allowClear: true,
9638
- usePopup: true,
9639
- selectionMode: "single"
9640
- };
9641
- const CalendarPicker = forwardRef((p, ref) => {
9642
- const props = mergeProps(defaultProps$X, p);
9643
- const {
9644
- locale
9645
- } = useConfig();
9646
- const calendarRef = ref !== null && ref !== void 0 ? ref : useRef(null);
9647
- const {
9648
- visible,
9649
- confirmText,
9650
- popupClassName,
9651
- popupStyle,
9462
+ }
9463
+ function _arrayLikeToArray(arr, len) {
9464
+ if (len == null || len > arr.length)
9465
+ len = arr.length;
9466
+ for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
9467
+ arr2[i2] = arr[i2];
9468
+ return arr2;
9469
+ }
9470
+ function _unsupportedIterableToArray(o, minLen) {
9471
+ if (!o)
9472
+ return;
9473
+ if (typeof o === "string")
9474
+ return _arrayLikeToArray(o, minLen);
9475
+ var n2 = Object.prototype.toString.call(o).slice(8, -1);
9476
+ if (n2 === "Object" && o.constructor)
9477
+ n2 = o.constructor.name;
9478
+ if (n2 === "Map" || n2 === "Set")
9479
+ return Array.from(o);
9480
+ if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
9481
+ return _arrayLikeToArray(o, minLen);
9482
+ }
9483
+ function _nonIterableRest() {
9484
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9485
+ }
9486
+ function _slicedToArray(arr, i2) {
9487
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
9488
+ }
9489
+ function canUseDom() {
9490
+ return !!(typeof window !== "undefined" && window.document && window.document.createElement);
9491
+ }
9492
+ var useInternalLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
9493
+ var useLayoutEffect = function useLayoutEffect2(callback, deps) {
9494
+ var firstMountRef = React$1.useRef(true);
9495
+ useInternalLayoutEffect(function() {
9496
+ return callback(firstMountRef.current);
9497
+ }, deps);
9498
+ useInternalLayoutEffect(function() {
9499
+ firstMountRef.current = false;
9500
+ return function() {
9501
+ firstMountRef.current = true;
9502
+ };
9503
+ }, []);
9504
+ };
9505
+ var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
9506
+ useLayoutEffect(function(firstMount) {
9507
+ if (!firstMount) {
9508
+ return callback();
9509
+ }
9510
+ }, deps);
9511
+ };
9512
+ function useSafeState(defaultValue) {
9513
+ var destroyRef = React$1.useRef(false);
9514
+ var _React$useState = React$1.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
9515
+ React$1.useEffect(function() {
9516
+ destroyRef.current = false;
9517
+ return function() {
9518
+ destroyRef.current = true;
9519
+ };
9520
+ }, []);
9521
+ function safeSetState(updater, ignoreDestroy) {
9522
+ if (ignoreDestroy && destroyRef.current) {
9523
+ return;
9524
+ }
9525
+ setValue2(updater);
9526
+ }
9527
+ return [value, safeSetState];
9528
+ }
9529
+ function hasValue(value) {
9530
+ return value !== void 0;
9531
+ }
9532
+ function useMergedState(defaultStateValue, option) {
9533
+ var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
9534
+ var _useState = useSafeState(function() {
9535
+ if (hasValue(value)) {
9536
+ return value;
9537
+ } else if (hasValue(defaultValue)) {
9538
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
9539
+ } else {
9540
+ return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
9541
+ }
9542
+ }), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
9543
+ var mergedValue = value !== void 0 ? value : innerValue;
9544
+ var postMergedValue = postState ? postState(mergedValue) : mergedValue;
9545
+ var onChangeFn = useEvent(onChange);
9546
+ var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
9547
+ useLayoutUpdateEffect(function() {
9548
+ var prev = prevValue[0];
9549
+ if (innerValue !== prev) {
9550
+ onChangeFn(innerValue, prev);
9551
+ }
9552
+ }, [prevValue]);
9553
+ useLayoutUpdateEffect(function() {
9554
+ if (!hasValue(value)) {
9555
+ setInnerValue(value);
9556
+ }
9557
+ }, [value]);
9558
+ var triggerChange = useEvent(function(updater, ignoreDestroy) {
9559
+ setInnerValue(updater, ignoreDestroy);
9560
+ setPrevValue([mergedValue], ignoreDestroy);
9561
+ });
9562
+ return [postMergedValue, triggerChange];
9563
+ }
9564
+ function _typeof$1(o) {
9565
+ "@babel/helpers - typeof";
9566
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
9567
+ return typeof o2;
9568
+ } : function(o2) {
9569
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
9570
+ }, _typeof$1(o);
9571
+ }
9572
+ var reactIs = { exports: {} };
9573
+ var reactIs_development = {};
9574
+ /**
9575
+ * @license React
9576
+ * react-is.development.js
9577
+ *
9578
+ * Copyright (c) Facebook, Inc. and its affiliates.
9579
+ *
9580
+ * This source code is licensed under the MIT license found in the
9581
+ * LICENSE file in the root directory of this source tree.
9582
+ */
9583
+ {
9584
+ (function() {
9585
+ var REACT_ELEMENT_TYPE2 = Symbol.for("react.element");
9586
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
9587
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
9588
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
9589
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
9590
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
9591
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
9592
+ var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
9593
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
9594
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
9595
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
9596
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
9597
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
9598
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
9599
+ var enableScopeAPI = false;
9600
+ var enableCacheElement = false;
9601
+ var enableTransitionTracing = false;
9602
+ var enableLegacyHidden = false;
9603
+ var enableDebugTracing = false;
9604
+ var REACT_MODULE_REFERENCE;
9605
+ {
9606
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
9607
+ }
9608
+ function isValidElementType(type4) {
9609
+ if (typeof type4 === "string" || typeof type4 === "function") {
9610
+ return true;
9611
+ }
9612
+ if (type4 === REACT_FRAGMENT_TYPE || type4 === REACT_PROFILER_TYPE || enableDebugTracing || type4 === REACT_STRICT_MODE_TYPE || type4 === REACT_SUSPENSE_TYPE || type4 === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type4 === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
9613
+ return true;
9614
+ }
9615
+ if (typeof type4 === "object" && type4 !== null) {
9616
+ if (type4.$$typeof === REACT_LAZY_TYPE || type4.$$typeof === REACT_MEMO_TYPE || type4.$$typeof === REACT_PROVIDER_TYPE || type4.$$typeof === REACT_CONTEXT_TYPE || type4.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
9617
+ // types supported by any Flight configuration anywhere since
9618
+ // we don't know which Flight build this will end up being used
9619
+ // with.
9620
+ type4.$$typeof === REACT_MODULE_REFERENCE || type4.getModuleId !== void 0) {
9621
+ return true;
9622
+ }
9623
+ }
9624
+ return false;
9625
+ }
9626
+ function typeOf(object4) {
9627
+ if (typeof object4 === "object" && object4 !== null) {
9628
+ var $$typeof = object4.$$typeof;
9629
+ switch ($$typeof) {
9630
+ case REACT_ELEMENT_TYPE2:
9631
+ var type4 = object4.type;
9632
+ switch (type4) {
9633
+ case REACT_FRAGMENT_TYPE:
9634
+ case REACT_PROFILER_TYPE:
9635
+ case REACT_STRICT_MODE_TYPE:
9636
+ case REACT_SUSPENSE_TYPE:
9637
+ case REACT_SUSPENSE_LIST_TYPE:
9638
+ return type4;
9639
+ default:
9640
+ var $$typeofType = type4 && type4.$$typeof;
9641
+ switch ($$typeofType) {
9642
+ case REACT_SERVER_CONTEXT_TYPE:
9643
+ case REACT_CONTEXT_TYPE:
9644
+ case REACT_FORWARD_REF_TYPE:
9645
+ case REACT_LAZY_TYPE:
9646
+ case REACT_MEMO_TYPE:
9647
+ case REACT_PROVIDER_TYPE:
9648
+ return $$typeofType;
9649
+ default:
9650
+ return $$typeof;
9651
+ }
9652
+ }
9653
+ case REACT_PORTAL_TYPE:
9654
+ return $$typeof;
9655
+ }
9656
+ }
9657
+ return void 0;
9658
+ }
9659
+ var ContextConsumer = REACT_CONTEXT_TYPE;
9660
+ var ContextProvider = REACT_PROVIDER_TYPE;
9661
+ var Element2 = REACT_ELEMENT_TYPE2;
9662
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
9663
+ var Fragment = REACT_FRAGMENT_TYPE;
9664
+ var Lazy = REACT_LAZY_TYPE;
9665
+ var Memo = REACT_MEMO_TYPE;
9666
+ var Portal = REACT_PORTAL_TYPE;
9667
+ var Profiler = REACT_PROFILER_TYPE;
9668
+ var StrictMode = REACT_STRICT_MODE_TYPE;
9669
+ var Suspense = REACT_SUSPENSE_TYPE;
9670
+ var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
9671
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
9672
+ var hasWarnedAboutDeprecatedIsConcurrentMode = false;
9673
+ function isAsyncMode(object4) {
9674
+ {
9675
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
9676
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
9677
+ console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
9678
+ }
9679
+ }
9680
+ return false;
9681
+ }
9682
+ function isConcurrentMode(object4) {
9683
+ {
9684
+ if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
9685
+ hasWarnedAboutDeprecatedIsConcurrentMode = true;
9686
+ console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
9687
+ }
9688
+ }
9689
+ return false;
9690
+ }
9691
+ function isContextConsumer(object4) {
9692
+ return typeOf(object4) === REACT_CONTEXT_TYPE;
9693
+ }
9694
+ function isContextProvider(object4) {
9695
+ return typeOf(object4) === REACT_PROVIDER_TYPE;
9696
+ }
9697
+ function isElement2(object4) {
9698
+ return typeof object4 === "object" && object4 !== null && object4.$$typeof === REACT_ELEMENT_TYPE2;
9699
+ }
9700
+ function isForwardRef(object4) {
9701
+ return typeOf(object4) === REACT_FORWARD_REF_TYPE;
9702
+ }
9703
+ function isFragment(object4) {
9704
+ return typeOf(object4) === REACT_FRAGMENT_TYPE;
9705
+ }
9706
+ function isLazy(object4) {
9707
+ return typeOf(object4) === REACT_LAZY_TYPE;
9708
+ }
9709
+ function isMemo(object4) {
9710
+ return typeOf(object4) === REACT_MEMO_TYPE;
9711
+ }
9712
+ function isPortal(object4) {
9713
+ return typeOf(object4) === REACT_PORTAL_TYPE;
9714
+ }
9715
+ function isProfiler(object4) {
9716
+ return typeOf(object4) === REACT_PROFILER_TYPE;
9717
+ }
9718
+ function isStrictMode(object4) {
9719
+ return typeOf(object4) === REACT_STRICT_MODE_TYPE;
9720
+ }
9721
+ function isSuspense(object4) {
9722
+ return typeOf(object4) === REACT_SUSPENSE_TYPE;
9723
+ }
9724
+ function isSuspenseList(object4) {
9725
+ return typeOf(object4) === REACT_SUSPENSE_LIST_TYPE;
9726
+ }
9727
+ reactIs_development.ContextConsumer = ContextConsumer;
9728
+ reactIs_development.ContextProvider = ContextProvider;
9729
+ reactIs_development.Element = Element2;
9730
+ reactIs_development.ForwardRef = ForwardRef;
9731
+ reactIs_development.Fragment = Fragment;
9732
+ reactIs_development.Lazy = Lazy;
9733
+ reactIs_development.Memo = Memo;
9734
+ reactIs_development.Portal = Portal;
9735
+ reactIs_development.Profiler = Profiler;
9736
+ reactIs_development.StrictMode = StrictMode;
9737
+ reactIs_development.Suspense = Suspense;
9738
+ reactIs_development.SuspenseList = SuspenseList;
9739
+ reactIs_development.isAsyncMode = isAsyncMode;
9740
+ reactIs_development.isConcurrentMode = isConcurrentMode;
9741
+ reactIs_development.isContextConsumer = isContextConsumer;
9742
+ reactIs_development.isContextProvider = isContextProvider;
9743
+ reactIs_development.isElement = isElement2;
9744
+ reactIs_development.isForwardRef = isForwardRef;
9745
+ reactIs_development.isFragment = isFragment;
9746
+ reactIs_development.isLazy = isLazy;
9747
+ reactIs_development.isMemo = isMemo;
9748
+ reactIs_development.isPortal = isPortal;
9749
+ reactIs_development.isProfiler = isProfiler;
9750
+ reactIs_development.isStrictMode = isStrictMode;
9751
+ reactIs_development.isSuspense = isSuspense;
9752
+ reactIs_development.isSuspenseList = isSuspenseList;
9753
+ reactIs_development.isValidElementType = isValidElementType;
9754
+ reactIs_development.typeOf = typeOf;
9755
+ })();
9756
+ }
9757
+ {
9758
+ reactIs.exports = reactIs_development;
9759
+ }
9760
+ var reactIsExports = reactIs.exports;
9761
+ function get(entity, path) {
9762
+ var current = entity;
9763
+ for (var i2 = 0; i2 < path.length; i2 += 1) {
9764
+ if (current === null || current === void 0) {
9765
+ return void 0;
9766
+ }
9767
+ current = current[path[i2]];
9768
+ }
9769
+ return current;
9770
+ }
9771
+ function _toPrimitive(input, hint) {
9772
+ if (_typeof$1(input) !== "object" || input === null)
9773
+ return input;
9774
+ var prim = input[Symbol.toPrimitive];
9775
+ if (prim !== void 0) {
9776
+ var res = prim.call(input, hint || "default");
9777
+ if (_typeof$1(res) !== "object")
9778
+ return res;
9779
+ throw new TypeError("@@toPrimitive must return a primitive value.");
9780
+ }
9781
+ return (hint === "string" ? String : Number)(input);
9782
+ }
9783
+ function _toPropertyKey(arg) {
9784
+ var key = _toPrimitive(arg, "string");
9785
+ return _typeof$1(key) === "symbol" ? key : String(key);
9786
+ }
9787
+ function _defineProperty(obj, key, value) {
9788
+ key = _toPropertyKey(key);
9789
+ if (key in obj) {
9790
+ Object.defineProperty(obj, key, {
9791
+ value,
9792
+ enumerable: true,
9793
+ configurable: true,
9794
+ writable: true
9795
+ });
9796
+ } else {
9797
+ obj[key] = value;
9798
+ }
9799
+ return obj;
9800
+ }
9801
+ function ownKeys(e2, r) {
9802
+ var t = Object.keys(e2);
9803
+ if (Object.getOwnPropertySymbols) {
9804
+ var o = Object.getOwnPropertySymbols(e2);
9805
+ r && (o = o.filter(function(r2) {
9806
+ return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
9807
+ })), t.push.apply(t, o);
9808
+ }
9809
+ return t;
9810
+ }
9811
+ function _objectSpread2(e2) {
9812
+ for (var r = 1; r < arguments.length; r++) {
9813
+ var t = null != arguments[r] ? arguments[r] : {};
9814
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
9815
+ _defineProperty(e2, r2, t[r2]);
9816
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
9817
+ Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
9818
+ });
9819
+ }
9820
+ return e2;
9821
+ }
9822
+ function _arrayWithoutHoles(arr) {
9823
+ if (Array.isArray(arr))
9824
+ return _arrayLikeToArray(arr);
9825
+ }
9826
+ function _iterableToArray(iter) {
9827
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
9828
+ return Array.from(iter);
9829
+ }
9830
+ function _nonIterableSpread() {
9831
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9832
+ }
9833
+ function _toConsumableArray(arr) {
9834
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
9835
+ }
9836
+ function _toArray(arr) {
9837
+ return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
9838
+ }
9839
+ function internalSet(entity, paths, value, removeIfUndefined) {
9840
+ if (!paths.length) {
9841
+ return value;
9842
+ }
9843
+ var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
9844
+ var clone;
9845
+ if (!entity && typeof path === "number") {
9846
+ clone = [];
9847
+ } else if (Array.isArray(entity)) {
9848
+ clone = _toConsumableArray(entity);
9849
+ } else {
9850
+ clone = _objectSpread2({}, entity);
9851
+ }
9852
+ if (removeIfUndefined && value === void 0 && restPath.length === 1) {
9853
+ delete clone[path][restPath[0]];
9854
+ } else {
9855
+ clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
9856
+ }
9857
+ return clone;
9858
+ }
9859
+ function set(entity, paths, value) {
9860
+ var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
9861
+ if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
9862
+ return entity;
9863
+ }
9864
+ return internalSet(entity, paths, value, removeIfUndefined);
9865
+ }
9866
+ var warned$1 = {};
9867
+ var preWarningFns$1 = [];
9868
+ var preMessage$1 = function preMessage2(fn) {
9869
+ preWarningFns$1.push(fn);
9870
+ };
9871
+ function warning$3(valid, message) {
9872
+ if (!valid && console !== void 0) {
9873
+ var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
9874
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
9875
+ }, message);
9876
+ if (finalMessage) {
9877
+ console.error("Warning: ".concat(finalMessage));
9878
+ }
9879
+ }
9880
+ }
9881
+ function note$1(valid, message) {
9882
+ if (!valid && console !== void 0) {
9883
+ var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
9884
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
9885
+ }, message);
9886
+ if (finalMessage) {
9887
+ console.warn("Note: ".concat(finalMessage));
9888
+ }
9889
+ }
9890
+ }
9891
+ function resetWarned$1() {
9892
+ warned$1 = {};
9893
+ }
9894
+ function call$1(method4, valid, message) {
9895
+ if (!valid && !warned$1[message]) {
9896
+ method4(false, message);
9897
+ warned$1[message] = true;
9898
+ }
9899
+ }
9900
+ function warningOnce$1(valid, message) {
9901
+ call$1(warning$3, valid, message);
9902
+ }
9903
+ function noteOnce$1(valid, message) {
9904
+ call$1(note$1, valid, message);
9905
+ }
9906
+ warningOnce$1.preMessage = preMessage$1;
9907
+ warningOnce$1.resetWarned = resetWarned$1;
9908
+ warningOnce$1.noteOnce = noteOnce$1;
9909
+ function useSyncScroll(current, visible, bodyRef) {
9910
+ const rafRef = useRef();
9911
+ const clean = () => {
9912
+ if (rafRef.current) {
9913
+ cancelAnimationFrame(rafRef.current);
9914
+ }
9915
+ };
9916
+ const scrollTo = useEvent((date4) => {
9917
+ clean();
9918
+ rafRef.current = requestAnimationFrame(() => {
9919
+ if (bodyRef.current) {
9920
+ const yearMonth = date4.format("YYYY-M");
9921
+ const target = bodyRef.current.querySelector(`[data-year-month="${yearMonth}"]`);
9922
+ if (target) {
9923
+ target.scrollIntoView({
9924
+ block: "start",
9925
+ inline: "nearest"
9926
+ });
9927
+ }
9928
+ }
9929
+ });
9930
+ });
9931
+ useEffect(() => {
9932
+ if (visible && current) {
9933
+ scrollTo(current);
9934
+ return clean;
9935
+ }
9936
+ }, [current, visible]);
9937
+ return scrollTo;
9938
+ }
9939
+ dayjs.extend(isoWeek);
9940
+ dayjs.extend(isSameOrBefore);
9941
+ const classPrefix$1e = "adm-calendar-picker-view";
9942
+ const Context$2 = React__default.createContext({
9943
+ visible: false
9944
+ });
9945
+ const defaultProps$Y = {
9946
+ weekStartsOn: "Sunday",
9947
+ defaultValue: null,
9948
+ allowClear: true,
9949
+ usePopup: true,
9950
+ selectionMode: "single"
9951
+ };
9952
+ const CalendarPickerView = forwardRef((p, ref) => {
9953
+ var _a;
9954
+ const bodyRef = useRef(null);
9955
+ const today = dayjs();
9956
+ const props = mergeProps(defaultProps$Y, p);
9957
+ const {
9958
+ locale
9959
+ } = useConfig();
9960
+ const markItems = [...locale.Calendar.markItems];
9961
+ if (props.weekStartsOn === "Sunday") {
9962
+ const item = markItems.pop();
9963
+ if (item)
9964
+ markItems.unshift(item);
9965
+ }
9966
+ const [dateRange, setDateRange] = usePropsValue({
9967
+ value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
9968
+ defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
9969
+ onChange: (v) => {
9970
+ var _a2, _b;
9971
+ if (props.selectionMode === "single") {
9972
+ (_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
9973
+ } else if (props.selectionMode === "range") {
9974
+ (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
9975
+ }
9976
+ }
9977
+ });
9978
+ const [intermediate, setIntermediate] = useState(false);
9979
+ const [current, setCurrent] = useState(() => dayjs(dateRange ? dateRange[0] : today).date(1));
9980
+ const context = useContext(Context$2);
9981
+ const scrollTo = useSyncScroll(current, context.visible, bodyRef);
9982
+ const maxDay = useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
9983
+ const minDay = useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
9984
+ useImperativeHandle(ref, () => ({
9985
+ jumpTo: (pageOrPageGenerator) => {
9986
+ let page;
9987
+ if (typeof pageOrPageGenerator === "function") {
9988
+ page = pageOrPageGenerator({
9989
+ year: current.year(),
9990
+ month: current.month() + 1
9991
+ });
9992
+ } else {
9993
+ page = pageOrPageGenerator;
9994
+ }
9995
+ const next = convertPageToDayjs(page);
9996
+ setCurrent(next);
9997
+ scrollTo(next);
9998
+ },
9999
+ jumpToToday: () => {
10000
+ const next = dayjs().date(1);
10001
+ setCurrent(next);
10002
+ scrollTo(next);
10003
+ },
10004
+ getDateRange: () => dateRange
10005
+ }));
10006
+ const header = React__default.createElement("div", {
10007
+ className: `${classPrefix$1e}-header`
10008
+ }, React__default.createElement("div", {
10009
+ className: `${classPrefix$1e}-title`
10010
+ }, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
10011
+ function renderBody() {
10012
+ var _a2;
10013
+ const cells = [];
10014
+ let monthIterator = minDay;
10015
+ while (monthIterator.isSameOrBefore(maxDay, "month")) {
10016
+ const year = monthIterator.year();
10017
+ const month = monthIterator.month() + 1;
10018
+ const renderMap = {
10019
+ year,
10020
+ month
10021
+ };
10022
+ const yearMonth = `${year}-${month}`;
10023
+ const presetEmptyCellCount = props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday();
10024
+ const presetEmptyCells = presetEmptyCellCount == 7 ? null : Array(presetEmptyCellCount).fill(null).map((_, index2) => React__default.createElement("div", {
10025
+ key: index2,
10026
+ className: `${classPrefix$1e}-cell`
10027
+ }));
10028
+ cells.push(React__default.createElement("div", {
10029
+ key: yearMonth,
10030
+ "data-year-month": yearMonth
10031
+ }, React__default.createElement("div", {
10032
+ className: `${classPrefix$1e}-title`
10033
+ }, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
10034
+ var _a3;
10035
+ return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
10036
+ })), React__default.createElement("div", {
10037
+ className: `${classPrefix$1e}-cells`
10038
+ }, presetEmptyCells, Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
10039
+ var _a3;
10040
+ const d = monthIterator.date(index2 + 1);
10041
+ let isSelect = false;
10042
+ let isBegin = false;
10043
+ let isEnd = false;
10044
+ let isSelectRowBegin = false;
10045
+ let isSelectRowEnd = false;
10046
+ if (dateRange) {
10047
+ const [begin, end] = dateRange;
10048
+ isBegin = d.isSame(begin, "day");
10049
+ isEnd = d.isSame(end, "day");
10050
+ isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
10051
+ if (isSelect) {
10052
+ isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
10053
+ isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
10054
+ }
10055
+ }
10056
+ const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
10057
+ const renderTop = () => {
10058
+ var _a4;
10059
+ const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
10060
+ if (top) {
10061
+ return top;
10062
+ }
10063
+ if (props.selectionMode === "range") {
10064
+ if (isBegin) {
10065
+ return locale.Calendar.start;
10066
+ }
10067
+ if (isEnd) {
10068
+ return locale.Calendar.end;
10069
+ }
10070
+ }
10071
+ if (d.isSame(today, "day") && !isSelect) {
10072
+ return locale.Calendar.today;
10073
+ }
10074
+ };
10075
+ return React__default.createElement("div", {
10076
+ key: d.valueOf(),
10077
+ className: classNames(`${classPrefix$1e}-cell`, {
10078
+ [`${classPrefix$1e}-cell-today`]: d.isSame(today, "day"),
10079
+ [`${classPrefix$1e}-cell-selected`]: isSelect,
10080
+ [`${classPrefix$1e}-cell-selected-begin`]: isBegin,
10081
+ [`${classPrefix$1e}-cell-selected-end`]: isEnd,
10082
+ [`${classPrefix$1e}-cell-selected-row-begin`]: isSelectRowBegin,
10083
+ [`${classPrefix$1e}-cell-selected-row-end`]: isSelectRowEnd,
10084
+ [`${classPrefix$1e}-cell-disabled`]: !!disabled
10085
+ }),
10086
+ onClick: () => {
10087
+ if (!props.selectionMode)
10088
+ return;
10089
+ if (disabled)
10090
+ return;
10091
+ const date4 = d.toDate();
10092
+ function shouldClear() {
10093
+ if (!props.allowClear)
10094
+ return false;
10095
+ if (!dateRange)
10096
+ return false;
10097
+ const [begin, end] = dateRange;
10098
+ return d.isSame(begin, "date") && d.isSame(end, "day");
10099
+ }
10100
+ if (props.selectionMode === "single") {
10101
+ if (props.allowClear && shouldClear()) {
10102
+ setDateRange(null);
10103
+ return;
10104
+ }
10105
+ setDateRange([date4, date4]);
10106
+ } else if (props.selectionMode === "range") {
10107
+ if (!dateRange) {
10108
+ setDateRange([date4, date4]);
10109
+ setIntermediate(true);
10110
+ return;
10111
+ }
10112
+ if (shouldClear()) {
10113
+ setDateRange(null);
10114
+ setIntermediate(false);
10115
+ return;
10116
+ }
10117
+ if (intermediate) {
10118
+ const another = dateRange[0];
10119
+ setDateRange(another > date4 ? [date4, another] : [another, date4]);
10120
+ setIntermediate(false);
10121
+ } else {
10122
+ setDateRange([date4, date4]);
10123
+ setIntermediate(true);
10124
+ }
10125
+ }
10126
+ }
10127
+ }, React__default.createElement("div", {
10128
+ className: `${classPrefix$1e}-cell-top`
10129
+ }, renderTop()), React__default.createElement("div", {
10130
+ className: `${classPrefix$1e}-cell-date`
10131
+ }, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React__default.createElement("div", {
10132
+ className: `${classPrefix$1e}-cell-bottom`
10133
+ }, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
10134
+ }))));
10135
+ monthIterator = monthIterator.add(1, "month");
10136
+ }
10137
+ return cells;
10138
+ }
10139
+ const body = React__default.createElement("div", {
10140
+ className: `${classPrefix$1e}-body`,
10141
+ ref: bodyRef
10142
+ }, renderBody());
10143
+ const mark = React__default.createElement("div", {
10144
+ className: `${classPrefix$1e}-mark`
10145
+ }, markItems.map((item, index2) => React__default.createElement("div", {
10146
+ key: index2,
10147
+ className: `${classPrefix$1e}-mark-cell`
10148
+ }, item)));
10149
+ return withNativeProps(props, React__default.createElement("div", {
10150
+ className: classPrefix$1e
10151
+ }, header, mark, body));
10152
+ });
10153
+ const classPrefix$1d = `adm-divider`;
10154
+ const defaultProps$X = {
10155
+ contentPosition: "center",
10156
+ direction: "horizontal"
10157
+ };
10158
+ const Divider = (p) => {
10159
+ const props = mergeProps(defaultProps$X, p);
10160
+ return withNativeProps(props, React__default.createElement("div", {
10161
+ className: classNames(classPrefix$1d, `${classPrefix$1d}-${props.direction}`, `${classPrefix$1d}-${props.contentPosition}`)
10162
+ }, props.children && React__default.createElement("div", {
10163
+ className: `${classPrefix$1d}-content`
10164
+ }, props.children)));
10165
+ };
10166
+ const classPrefix$1c = "adm-calendar-picker";
10167
+ const defaultProps$W = {
10168
+ weekStartsOn: "Sunday",
10169
+ defaultValue: null,
10170
+ allowClear: true,
10171
+ usePopup: true,
10172
+ selectionMode: "single"
10173
+ };
10174
+ const CalendarPicker = forwardRef((p, ref) => {
10175
+ const props = mergeProps(defaultProps$W, p);
10176
+ const {
10177
+ locale
10178
+ } = useConfig();
10179
+ const calendarRef = ref !== null && ref !== void 0 ? ref : useRef(null);
10180
+ const {
10181
+ visible,
10182
+ confirmText,
10183
+ popupClassName,
10184
+ popupStyle,
9652
10185
  popupBodyStyle,
9653
10186
  forceRender,
9654
10187
  closeOnMaskClick,
@@ -9657,6 +10190,9 @@ const CalendarPicker = forwardRef((p, ref) => {
9657
10190
  onMaskClick,
9658
10191
  getContainer
9659
10192
  } = props, calendarViewProps = __rest(props, ["visible", "confirmText", "popupClassName", "popupStyle", "popupBodyStyle", "forceRender", "closeOnMaskClick", "onClose", "onConfirm", "onMaskClick", "getContainer"]);
10193
+ const viewContext = React__default.useMemo(() => ({
10194
+ visible: !!visible
10195
+ }), [visible]);
9660
10196
  const footer = React__default.createElement("div", {
9661
10197
  className: `${classPrefix$1c}-footer`
9662
10198
  }, React__default.createElement(Divider, null), React__default.createElement("div", {
@@ -9696,9 +10232,11 @@ const CalendarPicker = forwardRef((p, ref) => {
9696
10232
  }
9697
10233
  },
9698
10234
  getContainer
10235
+ }, React__default.createElement(Context$2.Provider, {
10236
+ value: viewContext
9699
10237
  }, React__default.createElement(CalendarPickerView, Object.assign({
9700
10238
  ref: calendarRef
9701
- }, calendarViewProps)), footer)));
10239
+ }, calendarViewProps))), footer)));
9702
10240
  });
9703
10241
  function useResizeEffect(effect, targetRef) {
9704
10242
  const fn = useMemoizedFn(effect);
@@ -9805,255 +10343,66 @@ const useTabListScroll = (targetRef, activeIndex) => {
9805
10343
  return {
9806
10344
  scrollLeft,
9807
10345
  animate
9808
- };
9809
- };
9810
- const classPrefix$1b = `adm-scroll-mask`;
9811
- const ScrollMask = (props) => {
9812
- const maskRef = useRef(null);
9813
- const [{
9814
- leftMaskOpacity,
9815
- rightMaskOpacity
9816
- }, api] = useSpring(() => ({
9817
- leftMaskOpacity: 0,
9818
- rightMaskOpacity: 0,
9819
- config: {
9820
- clamp: true
9821
- }
9822
- }));
9823
- const {
9824
- run: updateMask
9825
- } = useThrottleFn((immediate = false) => {
9826
- const mask = maskRef.current;
9827
- if (!mask)
9828
- return;
9829
- const scrollEl = props.scrollTrackRef.current;
9830
- if (!scrollEl)
9831
- return;
9832
- const scrollLeft = scrollEl.scrollLeft;
9833
- const showLeftMask = scrollLeft > 0;
9834
- const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
9835
- api.start({
9836
- leftMaskOpacity: showLeftMask ? 1 : 0,
9837
- rightMaskOpacity: showRightMask ? 1 : 0,
9838
- immediate
9839
- });
9840
- }, {
9841
- wait: 100,
9842
- trailing: true,
9843
- leading: true
9844
- });
9845
- useEffect(() => {
9846
- updateMask(true);
9847
- }, []);
9848
- useEffect(() => {
9849
- const scrollEl = props.scrollTrackRef.current;
9850
- if (!scrollEl)
9851
- return;
9852
- scrollEl.addEventListener("scroll", updateMask);
9853
- return () => scrollEl.removeEventListener("scroll", updateMask);
9854
- }, []);
9855
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(animated.div, {
9856
- ref: maskRef,
9857
- className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
9858
- style: {
9859
- opacity: leftMaskOpacity
9860
- }
9861
- }), React__default.createElement(animated.div, {
9862
- className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
9863
- style: {
9864
- opacity: rightMaskOpacity
9865
- }
9866
- }));
9867
- };
9868
- var reactIs = { exports: {} };
9869
- var reactIs_development = {};
9870
- /**
9871
- * @license React
9872
- * react-is.development.js
9873
- *
9874
- * Copyright (c) Facebook, Inc. and its affiliates.
9875
- *
9876
- * This source code is licensed under the MIT license found in the
9877
- * LICENSE file in the root directory of this source tree.
9878
- */
9879
- {
9880
- (function() {
9881
- var REACT_ELEMENT_TYPE2 = Symbol.for("react.element");
9882
- var REACT_PORTAL_TYPE = Symbol.for("react.portal");
9883
- var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
9884
- var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
9885
- var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
9886
- var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
9887
- var REACT_CONTEXT_TYPE = Symbol.for("react.context");
9888
- var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
9889
- var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
9890
- var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
9891
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
9892
- var REACT_MEMO_TYPE = Symbol.for("react.memo");
9893
- var REACT_LAZY_TYPE = Symbol.for("react.lazy");
9894
- var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
9895
- var enableScopeAPI = false;
9896
- var enableCacheElement = false;
9897
- var enableTransitionTracing = false;
9898
- var enableLegacyHidden = false;
9899
- var enableDebugTracing = false;
9900
- var REACT_MODULE_REFERENCE;
9901
- {
9902
- REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
9903
- }
9904
- function isValidElementType(type4) {
9905
- if (typeof type4 === "string" || typeof type4 === "function") {
9906
- return true;
9907
- }
9908
- if (type4 === REACT_FRAGMENT_TYPE || type4 === REACT_PROFILER_TYPE || enableDebugTracing || type4 === REACT_STRICT_MODE_TYPE || type4 === REACT_SUSPENSE_TYPE || type4 === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type4 === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
9909
- return true;
9910
- }
9911
- if (typeof type4 === "object" && type4 !== null) {
9912
- if (type4.$$typeof === REACT_LAZY_TYPE || type4.$$typeof === REACT_MEMO_TYPE || type4.$$typeof === REACT_PROVIDER_TYPE || type4.$$typeof === REACT_CONTEXT_TYPE || type4.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
9913
- // types supported by any Flight configuration anywhere since
9914
- // we don't know which Flight build this will end up being used
9915
- // with.
9916
- type4.$$typeof === REACT_MODULE_REFERENCE || type4.getModuleId !== void 0) {
9917
- return true;
9918
- }
9919
- }
9920
- return false;
9921
- }
9922
- function typeOf(object4) {
9923
- if (typeof object4 === "object" && object4 !== null) {
9924
- var $$typeof = object4.$$typeof;
9925
- switch ($$typeof) {
9926
- case REACT_ELEMENT_TYPE2:
9927
- var type4 = object4.type;
9928
- switch (type4) {
9929
- case REACT_FRAGMENT_TYPE:
9930
- case REACT_PROFILER_TYPE:
9931
- case REACT_STRICT_MODE_TYPE:
9932
- case REACT_SUSPENSE_TYPE:
9933
- case REACT_SUSPENSE_LIST_TYPE:
9934
- return type4;
9935
- default:
9936
- var $$typeofType = type4 && type4.$$typeof;
9937
- switch ($$typeofType) {
9938
- case REACT_SERVER_CONTEXT_TYPE:
9939
- case REACT_CONTEXT_TYPE:
9940
- case REACT_FORWARD_REF_TYPE:
9941
- case REACT_LAZY_TYPE:
9942
- case REACT_MEMO_TYPE:
9943
- case REACT_PROVIDER_TYPE:
9944
- return $$typeofType;
9945
- default:
9946
- return $$typeof;
9947
- }
9948
- }
9949
- case REACT_PORTAL_TYPE:
9950
- return $$typeof;
9951
- }
9952
- }
9953
- return void 0;
9954
- }
9955
- var ContextConsumer = REACT_CONTEXT_TYPE;
9956
- var ContextProvider = REACT_PROVIDER_TYPE;
9957
- var Element2 = REACT_ELEMENT_TYPE2;
9958
- var ForwardRef = REACT_FORWARD_REF_TYPE;
9959
- var Fragment = REACT_FRAGMENT_TYPE;
9960
- var Lazy = REACT_LAZY_TYPE;
9961
- var Memo = REACT_MEMO_TYPE;
9962
- var Portal = REACT_PORTAL_TYPE;
9963
- var Profiler = REACT_PROFILER_TYPE;
9964
- var StrictMode = REACT_STRICT_MODE_TYPE;
9965
- var Suspense = REACT_SUSPENSE_TYPE;
9966
- var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
9967
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
9968
- var hasWarnedAboutDeprecatedIsConcurrentMode = false;
9969
- function isAsyncMode(object4) {
9970
- {
9971
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
9972
- hasWarnedAboutDeprecatedIsAsyncMode = true;
9973
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
9974
- }
9975
- }
9976
- return false;
9977
- }
9978
- function isConcurrentMode(object4) {
9979
- {
9980
- if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
9981
- hasWarnedAboutDeprecatedIsConcurrentMode = true;
9982
- console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
9983
- }
9984
- }
9985
- return false;
9986
- }
9987
- function isContextConsumer(object4) {
9988
- return typeOf(object4) === REACT_CONTEXT_TYPE;
9989
- }
9990
- function isContextProvider(object4) {
9991
- return typeOf(object4) === REACT_PROVIDER_TYPE;
9992
- }
9993
- function isElement2(object4) {
9994
- return typeof object4 === "object" && object4 !== null && object4.$$typeof === REACT_ELEMENT_TYPE2;
9995
- }
9996
- function isForwardRef(object4) {
9997
- return typeOf(object4) === REACT_FORWARD_REF_TYPE;
9998
- }
9999
- function isFragment(object4) {
10000
- return typeOf(object4) === REACT_FRAGMENT_TYPE;
10001
- }
10002
- function isLazy(object4) {
10003
- return typeOf(object4) === REACT_LAZY_TYPE;
10004
- }
10005
- function isMemo(object4) {
10006
- return typeOf(object4) === REACT_MEMO_TYPE;
10007
- }
10008
- function isPortal(object4) {
10009
- return typeOf(object4) === REACT_PORTAL_TYPE;
10010
- }
10011
- function isProfiler(object4) {
10012
- return typeOf(object4) === REACT_PROFILER_TYPE;
10013
- }
10014
- function isStrictMode(object4) {
10015
- return typeOf(object4) === REACT_STRICT_MODE_TYPE;
10346
+ };
10347
+ };
10348
+ const classPrefix$1b = `adm-scroll-mask`;
10349
+ const ScrollMask = (props) => {
10350
+ const maskRef = useRef(null);
10351
+ const [{
10352
+ leftMaskOpacity,
10353
+ rightMaskOpacity
10354
+ }, api] = useSpring(() => ({
10355
+ leftMaskOpacity: 0,
10356
+ rightMaskOpacity: 0,
10357
+ config: {
10358
+ clamp: true
10016
10359
  }
10017
- function isSuspense(object4) {
10018
- return typeOf(object4) === REACT_SUSPENSE_TYPE;
10360
+ }));
10361
+ const {
10362
+ run: updateMask
10363
+ } = useThrottleFn((immediate = false) => {
10364
+ const mask = maskRef.current;
10365
+ if (!mask)
10366
+ return;
10367
+ const scrollEl = props.scrollTrackRef.current;
10368
+ if (!scrollEl)
10369
+ return;
10370
+ const scrollLeft = scrollEl.scrollLeft;
10371
+ const showLeftMask = scrollLeft > 0;
10372
+ const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
10373
+ api.start({
10374
+ leftMaskOpacity: showLeftMask ? 1 : 0,
10375
+ rightMaskOpacity: showRightMask ? 1 : 0,
10376
+ immediate
10377
+ });
10378
+ }, {
10379
+ wait: 100,
10380
+ trailing: true,
10381
+ leading: true
10382
+ });
10383
+ useEffect(() => {
10384
+ updateMask(true);
10385
+ }, []);
10386
+ useEffect(() => {
10387
+ const scrollEl = props.scrollTrackRef.current;
10388
+ if (!scrollEl)
10389
+ return;
10390
+ scrollEl.addEventListener("scroll", updateMask);
10391
+ return () => scrollEl.removeEventListener("scroll", updateMask);
10392
+ }, []);
10393
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(animated.div, {
10394
+ ref: maskRef,
10395
+ className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
10396
+ style: {
10397
+ opacity: leftMaskOpacity
10019
10398
  }
10020
- function isSuspenseList(object4) {
10021
- return typeOf(object4) === REACT_SUSPENSE_LIST_TYPE;
10399
+ }), React__default.createElement(animated.div, {
10400
+ className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
10401
+ style: {
10402
+ opacity: rightMaskOpacity
10022
10403
  }
10023
- reactIs_development.ContextConsumer = ContextConsumer;
10024
- reactIs_development.ContextProvider = ContextProvider;
10025
- reactIs_development.Element = Element2;
10026
- reactIs_development.ForwardRef = ForwardRef;
10027
- reactIs_development.Fragment = Fragment;
10028
- reactIs_development.Lazy = Lazy;
10029
- reactIs_development.Memo = Memo;
10030
- reactIs_development.Portal = Portal;
10031
- reactIs_development.Profiler = Profiler;
10032
- reactIs_development.StrictMode = StrictMode;
10033
- reactIs_development.Suspense = Suspense;
10034
- reactIs_development.SuspenseList = SuspenseList;
10035
- reactIs_development.isAsyncMode = isAsyncMode;
10036
- reactIs_development.isConcurrentMode = isConcurrentMode;
10037
- reactIs_development.isContextConsumer = isContextConsumer;
10038
- reactIs_development.isContextProvider = isContextProvider;
10039
- reactIs_development.isElement = isElement2;
10040
- reactIs_development.isForwardRef = isForwardRef;
10041
- reactIs_development.isFragment = isFragment;
10042
- reactIs_development.isLazy = isLazy;
10043
- reactIs_development.isMemo = isMemo;
10044
- reactIs_development.isPortal = isPortal;
10045
- reactIs_development.isProfiler = isProfiler;
10046
- reactIs_development.isStrictMode = isStrictMode;
10047
- reactIs_development.isSuspense = isSuspense;
10048
- reactIs_development.isSuspenseList = isSuspenseList;
10049
- reactIs_development.isValidElementType = isValidElementType;
10050
- reactIs_development.typeOf = typeOf;
10051
- })();
10052
- }
10053
- {
10054
- reactIs.exports = reactIs_development;
10055
- }
10056
- var reactIsExports = reactIs.exports;
10404
+ }));
10405
+ };
10057
10406
  function traverseReactNode(children, fn) {
10058
10407
  let i2 = 0;
10059
10408
  function handle(target) {
@@ -10759,13 +11108,13 @@ const colorRecord$2 = {
10759
11108
  primary: "var(--adm-color-primary)",
10760
11109
  white: "var(--adm-color-white)"
10761
11110
  };
10762
- const defaultProps$W = {
11111
+ const defaultProps$V = {
10763
11112
  color: "default"
10764
11113
  };
10765
11114
  const circumference = 15 * 3.14159265358979 * 2;
10766
11115
  const SpinLoading = memo((p) => {
10767
11116
  var _a;
10768
- const props = mergeProps(defaultProps$W, p);
11117
+ const props = mergeProps(defaultProps$V, p);
10769
11118
  const motionReduced = useMotionReduced();
10770
11119
  const {
10771
11120
  percent
@@ -10806,7 +11155,7 @@ const SpinLoading = memo((p) => {
10806
11155
  }))));
10807
11156
  });
10808
11157
  const classPrefix$16 = `adm-picker-view`;
10809
- const defaultProps$V = {
11158
+ const defaultProps$U = {
10810
11159
  defaultValue: [],
10811
11160
  renderLabel: defaultRenderLabel,
10812
11161
  mouseWheel: false,
@@ -10815,7 +11164,7 @@ const defaultProps$V = {
10815
11164
  }, React__default.createElement(SpinLoading, null))
10816
11165
  };
10817
11166
  const PickerView = memo((p) => {
10818
- const props = mergeProps(defaultProps$V, p);
11167
+ const props = mergeProps(defaultProps$U, p);
10819
11168
  const [innerValue, setInnerValue] = useState(props.value === void 0 ? props.defaultValue : props.value);
10820
11169
  useEffect(() => {
10821
11170
  if (props.value === void 0)
@@ -10877,7 +11226,7 @@ const PickerView = memo((p) => {
10877
11226
  });
10878
11227
  PickerView.displayName = "PickerView";
10879
11228
  const classPrefix$15 = `adm-picker`;
10880
- const defaultProps$U = {
11229
+ const defaultProps$T = {
10881
11230
  defaultValue: [],
10882
11231
  closeOnMaskClick: true,
10883
11232
  renderLabel: defaultRenderLabel,
@@ -10889,7 +11238,7 @@ const Picker$1 = memo(forwardRef((p, ref) => {
10889
11238
  const {
10890
11239
  locale
10891
11240
  } = useConfig();
10892
- const props = mergeProps(defaultProps$U, {
11241
+ const props = mergeProps(defaultProps$T, {
10893
11242
  confirmText: locale.common.confirm,
10894
11243
  cancelText: locale.common.cancel
10895
11244
  }, p);
@@ -11129,14 +11478,14 @@ const classPrefix$14 = `adm-tabs`;
11129
11478
  const Tab = () => {
11130
11479
  return null;
11131
11480
  };
11132
- const defaultProps$T = {
11481
+ const defaultProps$S = {
11133
11482
  activeLineMode: "auto",
11134
11483
  stretch: true,
11135
11484
  direction: "ltr"
11136
11485
  };
11137
11486
  const Tabs$1 = (p) => {
11138
11487
  var _a;
11139
- const props = mergeProps(defaultProps$T, p);
11488
+ const props = mergeProps(defaultProps$S, p);
11140
11489
  const tabListContainerRef = useRef(null);
11141
11490
  const activeLineRef = useRef(null);
11142
11491
  const keyToIndexRecord = {};
@@ -11380,11 +11729,11 @@ const Tabs = attachPropertiesToComponent(Tabs$1, {
11380
11729
  Tab
11381
11730
  });
11382
11731
  const classPrefix$13 = `adm-list`;
11383
- const defaultProps$S = {
11732
+ const defaultProps$R = {
11384
11733
  mode: "default"
11385
11734
  };
11386
11735
  const List$2 = forwardRef((p, ref) => {
11387
- const props = mergeProps(defaultProps$S, p);
11736
+ const props = mergeProps(defaultProps$R, p);
11388
11737
  const nativeElementRef = useRef(null);
11389
11738
  useImperativeHandle(ref, () => ({
11390
11739
  get nativeElement() {
@@ -11443,7 +11792,7 @@ const List$1 = attachPropertiesToComponent(List$2, {
11443
11792
  });
11444
11793
  const CheckListContext = createContext(null);
11445
11794
  const classPrefix$11 = "adm-check-list";
11446
- const defaultProps$R = {
11795
+ const defaultProps$Q = {
11447
11796
  multiple: false,
11448
11797
  defaultValue: [],
11449
11798
  activeIcon: React__default.createElement(CheckOutline, null)
@@ -11452,7 +11801,7 @@ const CheckList$1 = (props) => {
11452
11801
  const {
11453
11802
  checkList: componentConfig = {}
11454
11803
  } = useConfig();
11455
- const mergedProps = mergeProps(defaultProps$R, componentConfig, props);
11804
+ const mergedProps = mergeProps(defaultProps$Q, componentConfig, props);
11456
11805
  const [value, setValue2] = usePropsValue(mergedProps);
11457
11806
  function check(val) {
11458
11807
  if (mergedProps.multiple) {
@@ -11694,11 +12043,11 @@ const useFieldNames = (fieldNames = {}) => {
11694
12043
  return fields;
11695
12044
  };
11696
12045
  const classPrefix$_ = `adm-cascader-view`;
11697
- const defaultProps$Q = {
12046
+ const defaultProps$P = {
11698
12047
  defaultValue: []
11699
12048
  };
11700
12049
  const CascaderView$1 = (p) => {
11701
- const props = mergeProps(defaultProps$Q, p);
12050
+ const props = mergeProps(defaultProps$P, p);
11702
12051
  const {
11703
12052
  locale
11704
12053
  } = useConfig();
@@ -11815,7 +12164,7 @@ const CascaderView = attachPropertiesToComponent(CascaderView$1, {
11815
12164
  optionSkeleton
11816
12165
  });
11817
12166
  const classPrefix$Z = `adm-cascader`;
11818
- const defaultProps$P = {
12167
+ const defaultProps$O = {
11819
12168
  defaultValue: [],
11820
12169
  destroyOnClose: true,
11821
12170
  forceRender: false
@@ -11825,7 +12174,7 @@ const Cascader = forwardRef((p, ref) => {
11825
12174
  const {
11826
12175
  locale
11827
12176
  } = useConfig();
11828
- const props = mergeProps(defaultProps$P, {
12177
+ const props = mergeProps(defaultProps$O, {
11829
12178
  confirmText: locale.common.confirm,
11830
12179
  cancelText: locale.common.cancel,
11831
12180
  placeholder: locale.Cascader.placeholder
@@ -11953,14 +12302,14 @@ const index$f = attachPropertiesToComponent(Cascader, {
11953
12302
  optionSkeleton
11954
12303
  });
11955
12304
  const classPrefix$Y = "adm-center-popup";
11956
- const defaultProps$O = Object.assign(Object.assign({}, defaultPopupBaseProps), {
12305
+ const defaultProps$N = Object.assign(Object.assign({}, defaultPopupBaseProps), {
11957
12306
  getContainer: null
11958
12307
  });
11959
12308
  const CenterPopup = (props) => {
11960
12309
  const {
11961
12310
  popup: componentConfig = {}
11962
12311
  } = useConfig();
11963
- const mergedProps = mergeProps(defaultProps$O, componentConfig, props);
12312
+ const mergedProps = mergeProps(defaultProps$N, componentConfig, props);
11964
12313
  const unmountedRef = useUnmountedRef$1();
11965
12314
  const style = useSpring({
11966
12315
  scale: mergedProps.visible ? 1 : 0.8,
@@ -12040,12 +12389,12 @@ const CenterPopup = (props) => {
12040
12389
  }, renderToContainer(mergedProps.getContainer, node));
12041
12390
  };
12042
12391
  const CheckboxGroupContext = createContext(null);
12043
- const defaultProps$N = {
12392
+ const defaultProps$M = {
12044
12393
  disabled: false,
12045
12394
  defaultValue: []
12046
12395
  };
12047
12396
  const Group$1 = (p) => {
12048
- const props = mergeProps(defaultProps$N, p);
12397
+ const props = mergeProps(defaultProps$M, p);
12049
12398
  const [value, setValue2] = usePropsValue(props);
12050
12399
  return React__default.createElement(
12051
12400
  CheckboxGroupContext.Provider,
@@ -12113,13 +12462,13 @@ const NativeInput = (props) => {
12113
12462
  });
12114
12463
  };
12115
12464
  const classPrefix$X = `adm-checkbox`;
12116
- const defaultProps$M = {
12465
+ const defaultProps$L = {
12117
12466
  defaultChecked: false,
12118
12467
  indeterminate: false
12119
12468
  };
12120
12469
  const Checkbox$1 = forwardRef((p, ref) => {
12121
12470
  const groupContext = useContext(CheckboxGroupContext);
12122
- const props = mergeProps(defaultProps$M, p);
12471
+ const props = mergeProps(defaultProps$L, p);
12123
12472
  let [checked, setChecked] = usePropsValue({
12124
12473
  value: props.checked,
12125
12474
  defaultValue: props.defaultChecked,
@@ -12682,14 +13031,14 @@ function useRenderLabel(renderLabel) {
12682
13031
  }, [renderLabel]);
12683
13032
  }
12684
13033
  const thisYear$1 = (/* @__PURE__ */ new Date()).getFullYear();
12685
- const defaultProps$L = {
13034
+ const defaultProps$K = {
12686
13035
  min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 - 10)),
12687
13036
  max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 + 10)),
12688
13037
  precision: "day",
12689
13038
  defaultValue: null
12690
13039
  };
12691
13040
  const DatePicker = forwardRef((p, ref) => {
12692
- const props = mergeProps(defaultProps$L, p);
13041
+ const props = mergeProps(defaultProps$K, p);
12693
13042
  const {
12694
13043
  renderLabel
12695
13044
  } = props;
@@ -12786,14 +13135,14 @@ const index$d = attachPropertiesToComponent(DatePicker, {
12786
13135
  DATE_NOW: TILL_NOW
12787
13136
  });
12788
13137
  const thisYear = (/* @__PURE__ */ new Date()).getFullYear();
12789
- const defaultProps$K = {
13138
+ const defaultProps$J = {
12790
13139
  min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear - 10)),
12791
13140
  max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear + 10)),
12792
13141
  precision: "day"
12793
13142
  };
12794
13143
  const DatePickerView = (p) => {
12795
13144
  var _a;
12796
- const props = mergeProps(defaultProps$K, p);
13145
+ const props = mergeProps(defaultProps$J, p);
12797
13146
  const {
12798
13147
  renderLabel
12799
13148
  } = props;
@@ -12843,14 +13192,14 @@ const DialogActionButton = (props) => {
12843
13192
  disabled: action.disabled
12844
13193
  }, action.text));
12845
13194
  };
12846
- const defaultProps$J = {
13195
+ const defaultProps$I = {
12847
13196
  actions: [],
12848
13197
  closeOnAction: false,
12849
13198
  closeOnMaskClick: false,
12850
13199
  getContainer: null
12851
13200
  };
12852
13201
  const Dialog = (p) => {
12853
- const props = mergeProps(defaultProps$J, p);
13202
+ const props = mergeProps(defaultProps$I, p);
12854
13203
  const element = React__default.createElement(React__default.Fragment, null, !!props.image && React__default.createElement("div", {
12855
13204
  className: cls$1("image-container")
12856
13205
  }, React__default.createElement(Image$1, {
@@ -12941,7 +13290,7 @@ function alert$1(p) {
12941
13290
  }));
12942
13291
  });
12943
13292
  }
12944
- const defaultProps$I = {
13293
+ const defaultProps$H = {
12945
13294
  confirmText: "确认",
12946
13295
  cancelText: "取消"
12947
13296
  };
@@ -12949,7 +13298,7 @@ function confirm$1(p) {
12949
13298
  const {
12950
13299
  locale
12951
13300
  } = getDefaultConfig();
12952
- const props = mergeProps(defaultProps$I, {
13301
+ const props = mergeProps(defaultProps$H, {
12953
13302
  confirmText: locale.common.confirm,
12954
13303
  cancelText: locale.common.cancel
12955
13304
  }, p);
@@ -13040,7 +13389,7 @@ const ItemChildrenWrap = (props) => {
13040
13389
  }, props.children) : null;
13041
13390
  };
13042
13391
  const classPrefix$U = `adm-dropdown`;
13043
- const defaultProps$H = {
13392
+ const defaultProps$G = {
13044
13393
  defaultActiveKey: null,
13045
13394
  closeOnMaskClick: true,
13046
13395
  closeOnClickAway: false,
@@ -13050,7 +13399,7 @@ const Dropdown = forwardRef((props, ref) => {
13050
13399
  const {
13051
13400
  dropdown: componentConfig = {}
13052
13401
  } = useConfig();
13053
- const mergedProps = mergeProps(defaultProps$H, componentConfig, props);
13402
+ const mergedProps = mergeProps(defaultProps$G, componentConfig, props);
13054
13403
  const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
13055
13404
  const [value, setValue2] = usePropsValue({
13056
13405
  value: mergedProps.activeKey,
@@ -13208,7 +13557,7 @@ function betweenInclusive(i2, e2, n2) {
13208
13557
  i2[i2.unit_1 = 1] = "unit_1", i2[i2.unit_2 = 2] = "unit_2", i2[i2.unit_4 = 4] = "unit_4";
13209
13558
  }(n || (n = {}));
13210
13559
  const classPrefix$T = `adm-ellipsis`;
13211
- const defaultProps$G = {
13560
+ const defaultProps$F = {
13212
13561
  direction: "end",
13213
13562
  rows: 1,
13214
13563
  expandText: "",
@@ -13220,7 +13569,7 @@ const defaultProps$G = {
13220
13569
  defaultExpanded: false
13221
13570
  };
13222
13571
  const Ellipsis = (p) => {
13223
- const props = mergeProps(defaultProps$G, p);
13572
+ const props = mergeProps(defaultProps$F, p);
13224
13573
  const rootRef = useRef(null);
13225
13574
  const expandElRef = useRef(null);
13226
13575
  const collapseElRef = useRef(null);
@@ -13408,13 +13757,13 @@ const Empty = (props) => {
13408
13757
  }, props.description)));
13409
13758
  };
13410
13759
  const classPrefix$R = `adm-error-block`;
13411
- const defaultProps$F = {
13760
+ const defaultProps$E = {
13412
13761
  status: "default"
13413
13762
  };
13414
13763
  function createErrorBlock(imageRecord2) {
13415
13764
  const ErrorBlock2 = (p) => {
13416
13765
  var _a;
13417
- const props = mergeProps(defaultProps$F, p);
13766
+ const props = mergeProps(defaultProps$E, p);
13418
13767
  const {
13419
13768
  locale
13420
13769
  } = useConfig();
@@ -13946,7 +14295,7 @@ const imageRecord = {
13946
14295
  };
13947
14296
  const ErrorBlock = createErrorBlock(imageRecord);
13948
14297
  const classPrefix$Q = `adm-floating-bubble`;
13949
- const defaultProps$E = {
14298
+ const defaultProps$D = {
13950
14299
  axis: "y",
13951
14300
  defaultOffset: {
13952
14301
  x: 0,
@@ -13954,7 +14303,7 @@ const defaultProps$E = {
13954
14303
  }
13955
14304
  };
13956
14305
  const FloatingBubble = (p) => {
13957
- const props = mergeProps(defaultProps$E, p);
14306
+ const props = mergeProps(defaultProps$D, p);
13958
14307
  const boundaryRef = useRef(null);
13959
14308
  const buttonRef = useRef(null);
13960
14309
  const [innerValue, setInnerValue] = useState(props.offset === void 0 ? props.defaultOffset : props.offset);
@@ -14053,12 +14402,12 @@ function nearest(arr, target) {
14053
14402
  });
14054
14403
  }
14055
14404
  const classPrefix$P = "adm-floating-panel";
14056
- const defaultProps$D = {
14405
+ const defaultProps$C = {
14057
14406
  handleDraggingOfContent: true
14058
14407
  };
14059
14408
  const FloatingPanel = forwardRef((p, ref) => {
14060
14409
  var _a, _b;
14061
- const props = mergeProps(defaultProps$D, p);
14410
+ const props = mergeProps(defaultProps$C, p);
14062
14411
  const {
14063
14412
  anchors
14064
14413
  } = props;
@@ -14200,116 +14549,23 @@ function _objectWithoutPropertiesLoose(source, excluded) {
14200
14549
  }
14201
14550
  return target;
14202
14551
  }
14203
- function _objectWithoutProperties(source, excluded) {
14204
- if (source == null)
14205
- return {};
14206
- var target = _objectWithoutPropertiesLoose(source, excluded);
14207
- var key, i2;
14208
- if (Object.getOwnPropertySymbols) {
14209
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
14210
- for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
14211
- key = sourceSymbolKeys[i2];
14212
- if (excluded.indexOf(key) >= 0)
14213
- continue;
14214
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
14215
- continue;
14216
- target[key] = source[key];
14217
- }
14218
- }
14219
- return target;
14220
- }
14221
- function _typeof$1(o) {
14222
- "@babel/helpers - typeof";
14223
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
14224
- return typeof o2;
14225
- } : function(o2) {
14226
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
14227
- }, _typeof$1(o);
14228
- }
14229
- function _toPrimitive(input, hint) {
14230
- if (_typeof$1(input) !== "object" || input === null)
14231
- return input;
14232
- var prim = input[Symbol.toPrimitive];
14233
- if (prim !== void 0) {
14234
- var res = prim.call(input, hint || "default");
14235
- if (_typeof$1(res) !== "object")
14236
- return res;
14237
- throw new TypeError("@@toPrimitive must return a primitive value.");
14238
- }
14239
- return (hint === "string" ? String : Number)(input);
14240
- }
14241
- function _toPropertyKey(arg) {
14242
- var key = _toPrimitive(arg, "string");
14243
- return _typeof$1(key) === "symbol" ? key : String(key);
14244
- }
14245
- function _defineProperty(obj, key, value) {
14246
- key = _toPropertyKey(key);
14247
- if (key in obj) {
14248
- Object.defineProperty(obj, key, {
14249
- value,
14250
- enumerable: true,
14251
- configurable: true,
14252
- writable: true
14253
- });
14254
- } else {
14255
- obj[key] = value;
14256
- }
14257
- return obj;
14258
- }
14259
- function ownKeys(e2, r) {
14260
- var t = Object.keys(e2);
14261
- if (Object.getOwnPropertySymbols) {
14262
- var o = Object.getOwnPropertySymbols(e2);
14263
- r && (o = o.filter(function(r2) {
14264
- return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
14265
- })), t.push.apply(t, o);
14266
- }
14267
- return t;
14268
- }
14269
- function _objectSpread2(e2) {
14270
- for (var r = 1; r < arguments.length; r++) {
14271
- var t = null != arguments[r] ? arguments[r] : {};
14272
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
14273
- _defineProperty(e2, r2, t[r2]);
14274
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
14275
- Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
14276
- });
14277
- }
14278
- return e2;
14279
- }
14280
- function _arrayLikeToArray(arr, len) {
14281
- if (len == null || len > arr.length)
14282
- len = arr.length;
14283
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
14284
- arr2[i2] = arr[i2];
14285
- return arr2;
14286
- }
14287
- function _arrayWithoutHoles(arr) {
14288
- if (Array.isArray(arr))
14289
- return _arrayLikeToArray(arr);
14290
- }
14291
- function _iterableToArray(iter) {
14292
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
14293
- return Array.from(iter);
14294
- }
14295
- function _unsupportedIterableToArray(o, minLen) {
14296
- if (!o)
14297
- return;
14298
- if (typeof o === "string")
14299
- return _arrayLikeToArray(o, minLen);
14300
- var n2 = Object.prototype.toString.call(o).slice(8, -1);
14301
- if (n2 === "Object" && o.constructor)
14302
- n2 = o.constructor.name;
14303
- if (n2 === "Map" || n2 === "Set")
14304
- return Array.from(o);
14305
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
14306
- return _arrayLikeToArray(o, minLen);
14307
- }
14308
- function _nonIterableSpread() {
14309
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14310
- }
14311
- function _toConsumableArray(arr) {
14312
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
14552
+ function _objectWithoutProperties(source, excluded) {
14553
+ if (source == null)
14554
+ return {};
14555
+ var target = _objectWithoutPropertiesLoose(source, excluded);
14556
+ var key, i2;
14557
+ if (Object.getOwnPropertySymbols) {
14558
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
14559
+ for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
14560
+ key = sourceSymbolKeys[i2];
14561
+ if (excluded.indexOf(key) >= 0)
14562
+ continue;
14563
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
14564
+ continue;
14565
+ target[key] = source[key];
14566
+ }
14567
+ }
14568
+ return target;
14313
14569
  }
14314
14570
  function _classCallCheck(instance, Constructor) {
14315
14571
  if (!(instance instanceof Constructor)) {
@@ -14425,49 +14681,6 @@ function toArray$2(children) {
14425
14681
  });
14426
14682
  return ret;
14427
14683
  }
14428
- var warned$1 = {};
14429
- var preWarningFns$1 = [];
14430
- var preMessage$1 = function preMessage2(fn) {
14431
- preWarningFns$1.push(fn);
14432
- };
14433
- function warning$3(valid, message) {
14434
- if (!valid && console !== void 0) {
14435
- var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
14436
- return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
14437
- }, message);
14438
- if (finalMessage) {
14439
- console.error("Warning: ".concat(finalMessage));
14440
- }
14441
- }
14442
- }
14443
- function note$1(valid, message) {
14444
- if (!valid && console !== void 0) {
14445
- var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
14446
- return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
14447
- }, message);
14448
- if (finalMessage) {
14449
- console.warn("Note: ".concat(finalMessage));
14450
- }
14451
- }
14452
- }
14453
- function resetWarned$1() {
14454
- warned$1 = {};
14455
- }
14456
- function call$1(method4, valid, message) {
14457
- if (!valid && !warned$1[message]) {
14458
- method4(false, message);
14459
- warned$1[message] = true;
14460
- }
14461
- }
14462
- function warningOnce$1(valid, message) {
14463
- call$1(warning$3, valid, message);
14464
- }
14465
- function noteOnce$1(valid, message) {
14466
- call$1(note$1, valid, message);
14467
- }
14468
- warningOnce$1.preMessage = preMessage$1;
14469
- warningOnce$1.resetWarned = resetWarned$1;
14470
- warningOnce$1.noteOnce = noteOnce$1;
14471
14684
  var HOOK_MARK$1 = "RC_FORM_INTERNAL_HOOKS";
14472
14685
  var warningFunc$1 = function warningFunc() {
14473
14686
  warningOnce$1(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
@@ -15953,53 +16166,6 @@ var defaultValidateMessages = {
15953
16166
  mismatch: "'${name}' does not match pattern ${pattern}"
15954
16167
  }
15955
16168
  };
15956
- function get(entity, path) {
15957
- var current = entity;
15958
- for (var i2 = 0; i2 < path.length; i2 += 1) {
15959
- if (current === null || current === void 0) {
15960
- return void 0;
15961
- }
15962
- current = current[path[i2]];
15963
- }
15964
- return current;
15965
- }
15966
- function _arrayWithHoles(arr) {
15967
- if (Array.isArray(arr))
15968
- return arr;
15969
- }
15970
- function _nonIterableRest() {
15971
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
15972
- }
15973
- function _toArray(arr) {
15974
- return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
15975
- }
15976
- function internalSet(entity, paths, value, removeIfUndefined) {
15977
- if (!paths.length) {
15978
- return value;
15979
- }
15980
- var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
15981
- var clone;
15982
- if (!entity && typeof path === "number") {
15983
- clone = [];
15984
- } else if (Array.isArray(entity)) {
15985
- clone = _toConsumableArray(entity);
15986
- } else {
15987
- clone = _objectSpread2({}, entity);
15988
- }
15989
- if (removeIfUndefined && value === void 0 && restPath.length === 1) {
15990
- delete clone[path][restPath[0]];
15991
- } else {
15992
- clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
15993
- }
15994
- return clone;
15995
- }
15996
- function set(entity, paths, value) {
15997
- var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
15998
- if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
15999
- return entity;
16000
- }
16001
- return internalSet(entity, paths, value, removeIfUndefined);
16002
- }
16003
16169
  function cloneDeep(val) {
16004
16170
  if (Array.isArray(val)) {
16005
16171
  return cloneArrayDeep(val);
@@ -16907,35 +17073,6 @@ var List = function List2(_ref) {
16907
17073
  }), operations, meta);
16908
17074
  })));
16909
17075
  };
16910
- function _iterableToArrayLimit(r, l) {
16911
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
16912
- if (null != t) {
16913
- var e2, n2, i2, u, a = [], f = true, o = false;
16914
- try {
16915
- if (i2 = (t = t.call(r)).next, 0 === l) {
16916
- if (Object(t) !== t)
16917
- return;
16918
- f = false;
16919
- } else
16920
- for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
16921
- ;
16922
- } catch (r2) {
16923
- o = true, n2 = r2;
16924
- } finally {
16925
- try {
16926
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
16927
- return;
16928
- } finally {
16929
- if (o)
16930
- throw n2;
16931
- }
16932
- }
16933
- return a;
16934
- }
16935
- }
16936
- function _slicedToArray(arr, i2) {
16937
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
16938
- }
16939
17076
  function allPromiseFinish(promiseList) {
16940
17077
  var hasError = false;
16941
17078
  var count = promiseList.length;
@@ -18099,9 +18236,9 @@ const FormArray = (props) => {
18099
18236
  });
18100
18237
  };
18101
18238
  const classPrefix$O = "adm-form";
18102
- const defaultProps$C = defaultFormContext;
18239
+ const defaultProps$B = defaultFormContext;
18103
18240
  const Form2 = forwardRef((p, ref) => {
18104
- const props = mergeProps(defaultProps$C, p);
18241
+ const props = mergeProps(defaultProps$B, p);
18105
18242
  const {
18106
18243
  className,
18107
18244
  style,
@@ -19786,7 +19923,7 @@ function convertPx(px) {
19786
19923
  return tester.getBoundingClientRect().height;
19787
19924
  }
19788
19925
  const classPrefix$N = `adm-popover`;
19789
- const defaultProps$B = {
19926
+ const defaultProps$A = {
19790
19927
  placement: "top",
19791
19928
  defaultVisible: false,
19792
19929
  stopPropagation: ["click"],
@@ -19794,7 +19931,7 @@ const defaultProps$B = {
19794
19931
  mode: "light"
19795
19932
  };
19796
19933
  const Popover$1 = forwardRef((p, ref) => {
19797
- const props = mergeProps(defaultProps$B, p);
19934
+ const props = mergeProps(defaultProps$A, p);
19798
19935
  const placement = normalizePlacement(props.placement);
19799
19936
  const [visible, setVisible] = usePropsValue({
19800
19937
  value: props.visible,
@@ -20675,14 +20812,14 @@ const Slides = forwardRef((props, ref) => {
20675
20812
  }))));
20676
20813
  });
20677
20814
  const classPrefix$H = `adm-image-viewer`;
20678
- const defaultProps$A = {
20815
+ const defaultProps$z = {
20679
20816
  maxZoom: 3,
20680
20817
  getContainer: null,
20681
20818
  visible: false
20682
20819
  };
20683
20820
  const ImageViewer$1 = (p) => {
20684
20821
  var _a, _b, _c;
20685
- const props = mergeProps(defaultProps$A, p);
20822
+ const props = mergeProps(defaultProps$z, p);
20686
20823
  const node = React__default.createElement(Mask, {
20687
20824
  visible: props.visible,
20688
20825
  disableBodyScroll: false,
@@ -20703,7 +20840,7 @@ const ImageViewer$1 = (p) => {
20703
20840
  })));
20704
20841
  return renderToContainer(props.getContainer, node);
20705
20842
  };
20706
- const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$A), {
20843
+ const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
20707
20844
  defaultIndex: 0
20708
20845
  });
20709
20846
  const MultiImageViewer = forwardRef((p, ref) => {
@@ -20843,11 +20980,11 @@ const PreviewItem = (props) => {
20843
20980
  };
20844
20981
  const PreviewItem$1 = PreviewItem;
20845
20982
  const classPrefix$F = `adm-space`;
20846
- const defaultProps$z = {
20983
+ const defaultProps$y = {
20847
20984
  direction: "horizontal"
20848
20985
  };
20849
20986
  const Space = (p) => {
20850
- const props = mergeProps(defaultProps$z, p);
20987
+ const props = mergeProps(defaultProps$y, p);
20851
20988
  const {
20852
20989
  direction,
20853
20990
  onClick
@@ -20868,7 +21005,7 @@ const Space = (p) => {
20868
21005
  })));
20869
21006
  };
20870
21007
  const classPrefix$E = `adm-image-uploader`;
20871
- const defaultProps$y = {
21008
+ const defaultProps$x = {
20872
21009
  disableUpload: false,
20873
21010
  deletable: true,
20874
21011
  deleteIcon: React__default.createElement(CloseOutline, {
@@ -20887,7 +21024,7 @@ const ImageUploader = forwardRef((p, ref) => {
20887
21024
  const {
20888
21025
  locale
20889
21026
  } = useConfig();
20890
- const props = mergeProps(defaultProps$y, p);
21027
+ const props = mergeProps(defaultProps$x, p);
20891
21028
  const {
20892
21029
  columns
20893
21030
  } = props;
@@ -21173,11 +21310,11 @@ const Sidebar = (props) => {
21173
21310
  }));
21174
21311
  };
21175
21312
  const classPrefix$C = `adm-index-bar`;
21176
- const defaultProps$x = {
21313
+ const defaultProps$w = {
21177
21314
  sticky: true
21178
21315
  };
21179
21316
  const IndexBar = forwardRef((p, ref) => {
21180
- const props = mergeProps(defaultProps$x, p);
21317
+ const props = mergeProps(defaultProps$w, p);
21181
21318
  const titleHeight = convertPx(35);
21182
21319
  const bodyRef = useRef(null);
21183
21320
  const indexItems = [];
@@ -21278,7 +21415,7 @@ function isWindow(element) {
21278
21415
  return element === window;
21279
21416
  }
21280
21417
  const classPrefix$B = `adm-infinite-scroll`;
21281
- const defaultProps$w = {
21418
+ const defaultProps$v = {
21282
21419
  threshold: 250,
21283
21420
  children: (hasMore, failed, retry) => React__default.createElement(InfiniteScrollContent, {
21284
21421
  hasMore,
@@ -21287,7 +21424,7 @@ const defaultProps$w = {
21287
21424
  })
21288
21425
  };
21289
21426
  const InfiniteScroll = (p) => {
21290
- const props = mergeProps(defaultProps$w, p);
21427
+ const props = mergeProps(defaultProps$v, p);
21291
21428
  const [failed, setFailed] = useState(false);
21292
21429
  const doLoadMore = useLockFn((isRetry) => __awaiter(void 0, void 0, void 0, function* () {
21293
21430
  try {
@@ -21408,7 +21545,7 @@ function useInputHandleKeyDown({
21408
21545
  return handleKeydown;
21409
21546
  }
21410
21547
  const classPrefix$A = `adm-input`;
21411
- const defaultProps$v = {
21548
+ const defaultProps$u = {
21412
21549
  defaultValue: "",
21413
21550
  clearIcon: React__default.createElement(CloseCircleFill, null),
21414
21551
  onlyShowClearWhenFocus: true
@@ -21418,7 +21555,7 @@ const Input = forwardRef((props, ref) => {
21418
21555
  locale,
21419
21556
  input: componentConfig = {}
21420
21557
  } = useConfig();
21421
- const mergedProps = mergeProps(defaultProps$v, componentConfig, props);
21558
+ const mergedProps = mergeProps(defaultProps$u, componentConfig, props);
21422
21559
  const [value, setValue2] = usePropsValue(mergedProps);
21423
21560
  const [hasFocus, setHasFocus] = useState(false);
21424
21561
  const compositionStartRef = useRef(false);
@@ -21652,14 +21789,14 @@ const ModalActionButton = (props) => {
21652
21789
  disabled: action.disabled
21653
21790
  }, action.text));
21654
21791
  };
21655
- const defaultProps$u = {
21792
+ const defaultProps$t = {
21656
21793
  actions: [],
21657
21794
  closeOnAction: false,
21658
21795
  closeOnMaskClick: false,
21659
21796
  getContainer: null
21660
21797
  };
21661
21798
  const Modal = (p) => {
21662
- const props = mergeProps(defaultProps$u, p);
21799
+ const props = mergeProps(defaultProps$t, p);
21663
21800
  const element = React__default.createElement(React__default.Fragment, null, !!props.image && React__default.createElement("div", {
21664
21801
  className: cls("image-container")
21665
21802
  }, React__default.createElement(Image$1, {
@@ -21744,7 +21881,7 @@ function alert(p) {
21744
21881
  }));
21745
21882
  });
21746
21883
  }
21747
- const defaultProps$t = {
21884
+ const defaultProps$s = {
21748
21885
  confirmText: "确认",
21749
21886
  cancelText: "取消"
21750
21887
  };
@@ -21752,7 +21889,7 @@ function confirm(p) {
21752
21889
  const {
21753
21890
  locale
21754
21891
  } = getDefaultConfig();
21755
- const props = mergeProps(defaultProps$t, {
21892
+ const props = mergeProps(defaultProps$s, {
21756
21893
  confirmText: locale.common.confirm,
21757
21894
  cancelText: locale.common.cancel
21758
21895
  }, p);
@@ -21797,19 +21934,19 @@ const index$7 = attachPropertiesToComponent(Modal, {
21797
21934
  clear: clear$1
21798
21935
  });
21799
21936
  const classPrefix$y = `adm-nav-bar`;
21800
- const defaultProps$s = {
21801
- backIcon: true
21802
- };
21937
+ const defaultBackIcon = React__default.createElement(LeftOutline, null);
21803
21938
  const NavBar = (props) => {
21804
21939
  const {
21805
21940
  navBar: componentConfig = {}
21806
21941
  } = useConfig();
21807
- const mergedProps = mergeProps(defaultProps$s, componentConfig, props);
21942
+ const mergedProps = mergeProps(componentConfig, props);
21808
21943
  const {
21809
21944
  back,
21810
21945
  backIcon,
21811
21946
  backArrow
21812
21947
  } = mergedProps;
21948
+ const mergedDefaultBackIcon = componentConfig.backIcon || defaultBackIcon;
21949
+ const mergedBackIcon = mergeProp(defaultBackIcon, componentConfig.backIcon, backArrow === true ? mergedDefaultBackIcon : backArrow, backIcon === true ? mergedDefaultBackIcon : backIcon);
21813
21950
  return withNativeProps(mergedProps, React__default.createElement("div", {
21814
21951
  className: classNames(classPrefix$y)
21815
21952
  }, React__default.createElement("div", {
@@ -21818,9 +21955,9 @@ const NavBar = (props) => {
21818
21955
  }, back !== null && React__default.createElement("div", {
21819
21956
  className: `${classPrefix$y}-back`,
21820
21957
  onClick: mergedProps.onBack
21821
- }, (backIcon || backArrow) && React__default.createElement("span", {
21958
+ }, mergedBackIcon && React__default.createElement("span", {
21822
21959
  className: `${classPrefix$y}-back-arrow`
21823
- }, backIcon === true || backArrow === true ? componentConfig.backIcon || React__default.createElement(LeftOutline, null) : backIcon || backArrow), React__default.createElement("span", {
21960
+ }, mergedBackIcon), React__default.createElement("span", {
21824
21961
  "aria-hidden": "true"
21825
21962
  }, back)), mergedProps.left), React__default.createElement("div", {
21826
21963
  className: `${classPrefix$y}-title`
@@ -23784,93 +23921,6 @@ const Slider = (p) => {
23784
23921
  upperBound: sliderValue[1]
23785
23922
  })));
23786
23923
  };
23787
- function useEvent(callback) {
23788
- var fnRef = React$1.useRef();
23789
- fnRef.current = callback;
23790
- var memoFn = React$1.useCallback(function() {
23791
- var _fnRef$current;
23792
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23793
- args[_key] = arguments[_key];
23794
- }
23795
- return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
23796
- }, []);
23797
- return memoFn;
23798
- }
23799
- function canUseDom() {
23800
- return !!(typeof window !== "undefined" && window.document && window.document.createElement);
23801
- }
23802
- var useInternalLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
23803
- var useLayoutEffect = function useLayoutEffect2(callback, deps) {
23804
- var firstMountRef = React$1.useRef(true);
23805
- useInternalLayoutEffect(function() {
23806
- return callback(firstMountRef.current);
23807
- }, deps);
23808
- useInternalLayoutEffect(function() {
23809
- firstMountRef.current = false;
23810
- return function() {
23811
- firstMountRef.current = true;
23812
- };
23813
- }, []);
23814
- };
23815
- var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
23816
- useLayoutEffect(function(firstMount) {
23817
- if (!firstMount) {
23818
- return callback();
23819
- }
23820
- }, deps);
23821
- };
23822
- function useSafeState(defaultValue) {
23823
- var destroyRef = React$1.useRef(false);
23824
- var _React$useState = React$1.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
23825
- React$1.useEffect(function() {
23826
- destroyRef.current = false;
23827
- return function() {
23828
- destroyRef.current = true;
23829
- };
23830
- }, []);
23831
- function safeSetState(updater, ignoreDestroy) {
23832
- if (ignoreDestroy && destroyRef.current) {
23833
- return;
23834
- }
23835
- setValue2(updater);
23836
- }
23837
- return [value, safeSetState];
23838
- }
23839
- function hasValue(value) {
23840
- return value !== void 0;
23841
- }
23842
- function useMergedState(defaultStateValue, option) {
23843
- var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
23844
- var _useState = useSafeState(function() {
23845
- if (hasValue(value)) {
23846
- return value;
23847
- } else if (hasValue(defaultValue)) {
23848
- return typeof defaultValue === "function" ? defaultValue() : defaultValue;
23849
- } else {
23850
- return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
23851
- }
23852
- }), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
23853
- var mergedValue = value !== void 0 ? value : innerValue;
23854
- var postMergedValue = postState ? postState(mergedValue) : mergedValue;
23855
- var onChangeFn = useEvent(onChange);
23856
- var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
23857
- useLayoutUpdateEffect(function() {
23858
- var prev = prevValue[0];
23859
- if (innerValue !== prev) {
23860
- onChangeFn(innerValue, prev);
23861
- }
23862
- }, [prevValue]);
23863
- useLayoutUpdateEffect(function() {
23864
- if (!hasValue(value)) {
23865
- setInnerValue(value);
23866
- }
23867
- }, [value]);
23868
- var triggerChange = useEvent(function(updater, ignoreDestroy) {
23869
- setInnerValue(updater, ignoreDestroy);
23870
- setPrevValue([mergedValue], ignoreDestroy);
23871
- });
23872
- return [postMergedValue, triggerChange];
23873
- }
23874
23924
  const classPrefix$e = `adm-stepper`;
23875
23925
  const defaultProps$d = {
23876
23926
  step: 1,