@sawport/react-sdk 1.2.5-beta.4 → 1.2.5-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +206 -175
- package/dist/index.standalone.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/react-sdk.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28393,11 +28393,11 @@ function pickProps(props, keys2) {
|
|
|
28393
28393
|
});
|
|
28394
28394
|
return clone2;
|
|
28395
28395
|
}
|
|
28396
|
-
function getRowFormat(
|
|
28396
|
+
function getRowFormat(picker, locale2, format3) {
|
|
28397
28397
|
if (format3) {
|
|
28398
28398
|
return format3;
|
|
28399
28399
|
}
|
|
28400
|
-
switch (
|
|
28400
|
+
switch (picker) {
|
|
28401
28401
|
// All from the `locale.fieldXXXFormat` first
|
|
28402
28402
|
case "time":
|
|
28403
28403
|
return locale2.fieldTimeFormat;
|
|
@@ -28551,7 +28551,7 @@ var showTimeKeys = [
|
|
|
28551
28551
|
];
|
|
28552
28552
|
function pickTimeProps(props) {
|
|
28553
28553
|
var timeProps = pickProps(props, showTimeKeys);
|
|
28554
|
-
var format3 = props.format,
|
|
28554
|
+
var format3 = props.format, picker = props.picker;
|
|
28555
28555
|
var propFormat = null;
|
|
28556
28556
|
if (format3) {
|
|
28557
28557
|
propFormat = format3;
|
|
@@ -28560,7 +28560,7 @@ function pickTimeProps(props) {
|
|
|
28560
28560
|
}
|
|
28561
28561
|
propFormat = _typeof(propFormat) === "object" ? propFormat.format : propFormat;
|
|
28562
28562
|
}
|
|
28563
|
-
if (
|
|
28563
|
+
if (picker === "time") {
|
|
28564
28564
|
timeProps.format = propFormat;
|
|
28565
28565
|
}
|
|
28566
28566
|
return [timeProps, propFormat];
|
|
@@ -28618,11 +28618,11 @@ function getTimeProps(componentProps) {
|
|
|
28618
28618
|
showMillisecond
|
|
28619
28619
|
}), timeConfig.format, propFormat];
|
|
28620
28620
|
}
|
|
28621
|
-
function fillShowTimeConfig(
|
|
28622
|
-
var isTimePicker =
|
|
28623
|
-
if (
|
|
28621
|
+
function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, locale2) {
|
|
28622
|
+
var isTimePicker = picker === "time";
|
|
28623
|
+
if (picker === "datetime" || isTimePicker) {
|
|
28624
28624
|
var pickedProps = timeConfig;
|
|
28625
|
-
var defaultLocaleFormat = getRowFormat(
|
|
28625
|
+
var defaultLocaleFormat = getRowFormat(picker, locale2, null);
|
|
28626
28626
|
var baselineFormat = defaultLocaleFormat;
|
|
28627
28627
|
var formatList = [showTimeFormat, propFormat];
|
|
28628
28628
|
for (var i2 = 0; i2 < formatList.length; i2 += 1) {
|
|
@@ -28805,9 +28805,9 @@ function useDisabledBoundary(generateConfig2, locale2, disabledDate, minDate, ma
|
|
|
28805
28805
|
});
|
|
28806
28806
|
return mergedDisabledDate;
|
|
28807
28807
|
}
|
|
28808
|
-
function useFieldFormat(
|
|
28808
|
+
function useFieldFormat(picker, locale2, format3) {
|
|
28809
28809
|
return React.useMemo(function() {
|
|
28810
|
-
var rawFormat = getRowFormat(
|
|
28810
|
+
var rawFormat = getRowFormat(picker, locale2, format3);
|
|
28811
28811
|
var formatList = toArray$5(rawFormat);
|
|
28812
28812
|
var firstFormat = formatList[0];
|
|
28813
28813
|
var maskFormat = _typeof(firstFormat) === "object" && firstFormat.type === "mask" ? firstFormat.format : null;
|
|
@@ -28819,7 +28819,7 @@ function useFieldFormat(picker2, locale2, format3) {
|
|
|
28819
28819
|
// Mask Format
|
|
28820
28820
|
maskFormat
|
|
28821
28821
|
];
|
|
28822
|
-
}, [
|
|
28822
|
+
}, [picker, locale2, format3]);
|
|
28823
28823
|
}
|
|
28824
28824
|
function useInputReadOnly(formatList, inputReadOnly, multiple) {
|
|
28825
28825
|
if (typeof formatList[0] === "function" || multiple) {
|
|
@@ -28827,10 +28827,10 @@ function useInputReadOnly(formatList, inputReadOnly, multiple) {
|
|
|
28827
28827
|
}
|
|
28828
28828
|
return inputReadOnly;
|
|
28829
28829
|
}
|
|
28830
|
-
function useInvalidate(generateConfig2,
|
|
28830
|
+
function useInvalidate(generateConfig2, picker, disabledDate, showTime) {
|
|
28831
28831
|
var isInvalidate = useEvent(function(date4, info) {
|
|
28832
28832
|
var outsideInfo = _objectSpread2({
|
|
28833
|
-
type:
|
|
28833
|
+
type: picker
|
|
28834
28834
|
}, info);
|
|
28835
28835
|
delete outsideInfo.activeIndex;
|
|
28836
28836
|
if (
|
|
@@ -28840,7 +28840,7 @@ function useInvalidate(generateConfig2, picker2, disabledDate, showTime) {
|
|
|
28840
28840
|
) {
|
|
28841
28841
|
return true;
|
|
28842
28842
|
}
|
|
28843
|
-
if ((
|
|
28843
|
+
if ((picker === "date" || picker === "time") && showTime) {
|
|
28844
28844
|
var _showTime$disabledTim;
|
|
28845
28845
|
var range3 = info && info.activeIndex === 1 ? "end" : "start";
|
|
28846
28846
|
var _ref = ((_showTime$disabledTim = showTime.disabledTime) === null || _showTime$disabledTim === void 0 ? void 0 : _showTime$disabledTim.call(showTime, date4, range3, {
|
|
@@ -28883,12 +28883,12 @@ function useList(value2) {
|
|
|
28883
28883
|
return values;
|
|
28884
28884
|
}
|
|
28885
28885
|
function useFilledProps(props, updater) {
|
|
28886
|
-
var generateConfig2 = props.generateConfig, locale2 = props.locale, _props$picker = props.picker,
|
|
28886
|
+
var generateConfig2 = props.generateConfig, locale2 = props.locale, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, _props$styles = props.styles, styles2 = _props$styles === void 0 ? {} : _props$styles, _props$classNames = props.classNames, classNames2 = _props$classNames === void 0 ? {} : _props$classNames, _props$order = props.order, order = _props$order === void 0 ? true : _props$order, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, inputRender = props.inputRender, allowClear = props.allowClear, clearIcon = props.clearIcon, needConfirm = props.needConfirm, multiple = props.multiple, format3 = props.format, inputReadOnly = props.inputReadOnly, disabledDate = props.disabledDate, minDate = props.minDate, maxDate = props.maxDate, showTime = props.showTime, value2 = props.value, defaultValue = props.defaultValue, pickerValue = props.pickerValue, defaultPickerValue = props.defaultPickerValue;
|
|
28887
28887
|
var values = useList(value2);
|
|
28888
28888
|
var defaultValues = useList(defaultValue);
|
|
28889
28889
|
var pickerValues = useList(pickerValue);
|
|
28890
28890
|
var defaultPickerValues = useList(defaultPickerValue);
|
|
28891
|
-
var internalPicker =
|
|
28891
|
+
var internalPicker = picker === "date" && showTime ? "datetime" : picker;
|
|
28892
28892
|
var multipleInteractivePicker = internalPicker === "time" || internalPicker === "datetime";
|
|
28893
28893
|
var complexPicker = multipleInteractivePicker || multiple;
|
|
28894
28894
|
var mergedNeedConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : multipleInteractivePicker;
|
|
@@ -28901,7 +28901,7 @@ function useFilledProps(props, updater) {
|
|
|
28901
28901
|
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
28902
28902
|
prefixCls,
|
|
28903
28903
|
locale: mergedLocale,
|
|
28904
|
-
picker
|
|
28904
|
+
picker,
|
|
28905
28905
|
styles: styles2,
|
|
28906
28906
|
classNames: classNames2,
|
|
28907
28907
|
order,
|
|
@@ -28919,7 +28919,7 @@ function useFilledProps(props, updater) {
|
|
|
28919
28919
|
var _useFieldFormat = useFieldFormat(internalPicker, mergedLocale, format3), _useFieldFormat2 = _slicedToArray(_useFieldFormat, 2), formatList = _useFieldFormat2[0], maskFormat = _useFieldFormat2[1];
|
|
28920
28920
|
var mergedInputReadOnly = useInputReadOnly(formatList, inputReadOnly, multiple);
|
|
28921
28921
|
var disabledBoundaryDate = useDisabledBoundary(generateConfig2, locale2, disabledDate, minDate, maxDate);
|
|
28922
|
-
var isInvalidateDate = useInvalidate(generateConfig2,
|
|
28922
|
+
var isInvalidateDate = useInvalidate(generateConfig2, picker, disabledBoundaryDate, mergedShowTime);
|
|
28923
28923
|
var mergedProps = React.useMemo(function() {
|
|
28924
28924
|
return _objectSpread2(_objectSpread2({}, filledProps), {}, {
|
|
28925
28925
|
needConfirm: mergedNeedConfirm,
|
|
@@ -29094,8 +29094,8 @@ function useRangeDisabledDate(values, disabled, activeIndexList, generateConfig2
|
|
|
29094
29094
|
};
|
|
29095
29095
|
return rangeDisabledDate;
|
|
29096
29096
|
}
|
|
29097
|
-
function offsetPanelDate(generateConfig2,
|
|
29098
|
-
switch (
|
|
29097
|
+
function offsetPanelDate(generateConfig2, picker, date4, offset2) {
|
|
29098
|
+
switch (picker) {
|
|
29099
29099
|
case "date":
|
|
29100
29100
|
case "week":
|
|
29101
29101
|
return generateConfig2.addMonth(date4, offset2);
|
|
@@ -29309,7 +29309,7 @@ function useInnerValue(generateConfig2, locale2, formatList, rangeValue, order,
|
|
|
29309
29309
|
return [mergedValue, setInnerValue, calendarValue, triggerCalendarChange, triggerOk];
|
|
29310
29310
|
}
|
|
29311
29311
|
function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, open2, isInvalidateDate) {
|
|
29312
|
-
var generateConfig2 = info.generateConfig, locale2 = info.locale,
|
|
29312
|
+
var generateConfig2 = info.generateConfig, locale2 = info.locale, picker = info.picker, onChange = info.onChange, allowEmpty = info.allowEmpty, order = info.order;
|
|
29313
29313
|
var orderOnChange = disabled.some(function(d2) {
|
|
29314
29314
|
return d2;
|
|
29315
29315
|
}) ? false : order;
|
|
@@ -29344,7 +29344,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
29344
29344
|
(!startEmpty || allowEmpty[0]) && // Validate empty end
|
|
29345
29345
|
(!endEmpty || allowEmpty[1])
|
|
29346
29346
|
) : true;
|
|
29347
|
-
var validateOrder = !order || startEmpty || endEmpty || isSame$1(generateConfig2, locale2, start, end,
|
|
29347
|
+
var validateOrder = !order || startEmpty || endEmpty || isSame$1(generateConfig2, locale2, start, end, picker) || generateConfig2.isAfter(end, start);
|
|
29348
29348
|
var validateDates = (
|
|
29349
29349
|
// Validate start
|
|
29350
29350
|
(disabled[0] || !start || !isInvalidateDate(start, {
|
|
@@ -29392,7 +29392,7 @@ function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, trigg
|
|
|
29392
29392
|
}, 2);
|
|
29393
29393
|
return [flushSubmit, triggerSubmit];
|
|
29394
29394
|
}
|
|
29395
|
-
function useShowNow(
|
|
29395
|
+
function useShowNow(picker, mode, showNow, showToday, rangePicker) {
|
|
29396
29396
|
if (mode !== "date" && mode !== "time") {
|
|
29397
29397
|
return false;
|
|
29398
29398
|
}
|
|
@@ -29402,7 +29402,7 @@ function useShowNow(picker2, mode, showNow, showToday, rangePicker) {
|
|
|
29402
29402
|
if (showToday !== void 0) {
|
|
29403
29403
|
return showToday;
|
|
29404
29404
|
}
|
|
29405
|
-
return !rangePicker && (
|
|
29405
|
+
return !rangePicker && (picker === "date" || picker === "time");
|
|
29406
29406
|
}
|
|
29407
29407
|
function findValidateTime(date4, getHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits, generateConfig2) {
|
|
29408
29408
|
var nextDate = date4;
|
|
@@ -30650,7 +30650,7 @@ var DefaultComponents = {
|
|
|
30650
30650
|
};
|
|
30651
30651
|
function PickerPanel(props, ref2) {
|
|
30652
30652
|
var _React$useContext;
|
|
30653
|
-
var locale2 = props.locale, generateConfig2 = props.generateConfig, direction = props.direction, prefixCls = props.prefixCls, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, multiple = props.multiple, defaultValue = props.defaultValue, value2 = props.value, onChange = props.onChange, onSelect = props.onSelect, defaultPickerValue = props.defaultPickerValue, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, mode = props.mode, onPanelChange = props.onPanelChange, _props$picker = props.picker,
|
|
30653
|
+
var locale2 = props.locale, generateConfig2 = props.generateConfig, direction = props.direction, prefixCls = props.prefixCls, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, multiple = props.multiple, defaultValue = props.defaultValue, value2 = props.value, onChange = props.onChange, onSelect = props.onSelect, defaultPickerValue = props.defaultPickerValue, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, mode = props.mode, onPanelChange = props.onPanelChange, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, showTime = props.showTime, hoverValue = props.hoverValue, hoverRangeValue = props.hoverRangeValue, cellRender = props.cellRender, dateRender = props.dateRender, monthCellRender = props.monthCellRender, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, hideHeader = props.hideHeader;
|
|
30654
30654
|
var mergedPrefixCls = ((_React$useContext = React.useContext(PickerContext)) === null || _React$useContext === void 0 ? void 0 : _React$useContext.prefixCls) || prefixCls || "rc-picker";
|
|
30655
30655
|
var rootRef = React.useRef();
|
|
30656
30656
|
React.useImperativeHandle(ref2, function() {
|
|
@@ -30660,12 +30660,12 @@ function PickerPanel(props, ref2) {
|
|
|
30660
30660
|
});
|
|
30661
30661
|
var _getTimeProps = getTimeProps(props), _getTimeProps2 = _slicedToArray(_getTimeProps, 4), timeProps = _getTimeProps2[0], localeTimeProps = _getTimeProps2[1], showTimeFormat = _getTimeProps2[2], propFormat = _getTimeProps2[3];
|
|
30662
30662
|
var filledLocale = useLocale(locale2, localeTimeProps);
|
|
30663
|
-
var internalPicker =
|
|
30663
|
+
var internalPicker = picker === "date" && showTime ? "datetime" : picker;
|
|
30664
30664
|
var mergedShowTime = React.useMemo(function() {
|
|
30665
30665
|
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, filledLocale);
|
|
30666
30666
|
}, [internalPicker, showTimeFormat, propFormat, timeProps, filledLocale]);
|
|
30667
30667
|
var now2 = generateConfig2.getNow();
|
|
30668
|
-
var _useMergedState = useMergedState(
|
|
30668
|
+
var _useMergedState = useMergedState(picker, {
|
|
30669
30669
|
value: mode,
|
|
30670
30670
|
postState: function postState(val) {
|
|
30671
30671
|
return val || "date";
|
|
@@ -30692,7 +30692,7 @@ function PickerPanel(props, ref2) {
|
|
|
30692
30692
|
});
|
|
30693
30693
|
var onInternalSelect = useEvent(function(newDate) {
|
|
30694
30694
|
onSelect === null || onSelect === void 0 || onSelect(newDate);
|
|
30695
|
-
if (mergedMode ===
|
|
30695
|
+
if (mergedMode === picker) {
|
|
30696
30696
|
var nextValues = multiple ? toggleDates(mergedValue, newDate) : [newDate];
|
|
30697
30697
|
triggerChange(nextValues);
|
|
30698
30698
|
}
|
|
@@ -30726,7 +30726,7 @@ function PickerPanel(props, ref2) {
|
|
|
30726
30726
|
var onPanelValueSelect = function onPanelValueSelect2(nextValue) {
|
|
30727
30727
|
onInternalSelect(nextValue);
|
|
30728
30728
|
setPickerValue(nextValue);
|
|
30729
|
-
if (mergedMode !==
|
|
30729
|
+
if (mergedMode !== picker) {
|
|
30730
30730
|
var decadeYearQueue = ["decade", "year"];
|
|
30731
30731
|
var decadeYearMonthQueue = [].concat(decadeYearQueue, ["month"]);
|
|
30732
30732
|
var pickerQueue = {
|
|
@@ -30734,7 +30734,7 @@ function PickerPanel(props, ref2) {
|
|
|
30734
30734
|
week: [].concat(_toConsumableArray(decadeYearMonthQueue), ["week"]),
|
|
30735
30735
|
date: [].concat(_toConsumableArray(decadeYearMonthQueue), ["date"])
|
|
30736
30736
|
};
|
|
30737
|
-
var queue = pickerQueue[
|
|
30737
|
+
var queue = pickerQueue[picker] || decadeYearMonthQueue;
|
|
30738
30738
|
var index2 = queue.indexOf(mergedMode);
|
|
30739
30739
|
var nextMode = queue[index2 + 1];
|
|
30740
30740
|
if (nextMode) {
|
|
@@ -30810,11 +30810,11 @@ function PickerPanel(props, ref2) {
|
|
|
30810
30810
|
}
|
|
30811
30811
|
var RefPanelPicker = /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(PickerPanel));
|
|
30812
30812
|
function PopupPanel(props) {
|
|
30813
|
-
var
|
|
30813
|
+
var picker = props.picker, multiplePanel = props.multiplePanel, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, needConfirm = props.needConfirm, onSubmit = props.onSubmit, range3 = props.range, hoverValue = props.hoverValue;
|
|
30814
30814
|
var _React$useContext = React.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, generateConfig2 = _React$useContext.generateConfig;
|
|
30815
30815
|
var internalOffsetDate = React.useCallback(function(date4, offset2) {
|
|
30816
|
-
return offsetPanelDate(generateConfig2,
|
|
30817
|
-
}, [generateConfig2,
|
|
30816
|
+
return offsetPanelDate(generateConfig2, picker, date4, offset2);
|
|
30817
|
+
}, [generateConfig2, picker]);
|
|
30818
30818
|
var nextPickerValue = React.useMemo(function() {
|
|
30819
30819
|
return internalOffsetDate(pickerValue, 1);
|
|
30820
30820
|
}, [pickerValue, internalOffsetDate]);
|
|
@@ -30828,7 +30828,7 @@ function PopupPanel(props) {
|
|
|
30828
30828
|
}
|
|
30829
30829
|
}
|
|
30830
30830
|
};
|
|
30831
|
-
var hideHeader =
|
|
30831
|
+
var hideHeader = picker === "time";
|
|
30832
30832
|
var pickerProps = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30833
30833
|
hoverValue: null,
|
|
30834
30834
|
hoverRangeValue: null,
|
|
@@ -30886,7 +30886,7 @@ function PresetPanel(props) {
|
|
|
30886
30886
|
})));
|
|
30887
30887
|
}
|
|
30888
30888
|
function Popup(props) {
|
|
30889
|
-
var panelRender = props.panelRender, internalMode = props.internalMode,
|
|
30889
|
+
var panelRender = props.panelRender, internalMode = props.internalMode, picker = props.picker, showNow = props.showNow, range3 = props.range, multiple = props.multiple, _props$activeInfo = props.activeInfo, activeInfo = _props$activeInfo === void 0 ? [0, 0, 0] : _props$activeInfo, presets = props.presets, onPresetHover = props.onPresetHover, onPresetSubmit = props.onPresetSubmit, onFocus = props.onFocus, onBlur = props.onBlur, onPanelMouseDown = props.onPanelMouseDown, direction = props.direction, value2 = props.value, onSelect = props.onSelect, isInvalid = props.isInvalid, defaultOpenValue = props.defaultOpenValue, onOk = props.onOk, onSubmit = props.onSubmit;
|
|
30890
30890
|
var _React$useContext = React.useContext(PickerContext), prefixCls = _React$useContext.prefixCls;
|
|
30891
30891
|
var panelPrefixCls = "".concat(prefixCls, "-panel");
|
|
30892
30892
|
var rtl = direction === "rtl";
|
|
@@ -30935,7 +30935,7 @@ function Popup(props) {
|
|
|
30935
30935
|
var valueList = React.useMemo(function() {
|
|
30936
30936
|
return filterEmpty(toArray$5(value2));
|
|
30937
30937
|
}, [value2]);
|
|
30938
|
-
var isTimePickerEmptyValue =
|
|
30938
|
+
var isTimePickerEmptyValue = picker === "time" && !valueList.length;
|
|
30939
30939
|
var footerSubmitValue = React.useMemo(function() {
|
|
30940
30940
|
if (isTimePickerEmptyValue) {
|
|
30941
30941
|
return filterEmpty([defaultOpenValue]);
|
|
@@ -30994,7 +30994,7 @@ function Popup(props) {
|
|
|
30994
30994
|
renderNode = /* @__PURE__ */ React.createElement("div", {
|
|
30995
30995
|
onMouseDown: onPanelMouseDown,
|
|
30996
30996
|
ref: wrapperRef,
|
|
30997
|
-
className: classNames("".concat(prefixCls, "-range-wrapper"), "".concat(prefixCls, "-").concat(
|
|
30997
|
+
className: classNames("".concat(prefixCls, "-range-wrapper"), "".concat(prefixCls, "-").concat(picker, "-range-wrapper"))
|
|
30998
30998
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
30999
30999
|
ref: arrowRef,
|
|
31000
31000
|
className: "".concat(prefixCls, "-range-arrow"),
|
|
@@ -31008,7 +31008,7 @@ function Popup(props) {
|
|
|
31008
31008
|
return renderNode;
|
|
31009
31009
|
}
|
|
31010
31010
|
function useInputProps(props, postProps) {
|
|
31011
|
-
var format3 = props.format, maskFormat = props.maskFormat, generateConfig2 = props.generateConfig, locale2 = props.locale, preserveInvalidOnBlur = props.preserveInvalidOnBlur, inputReadOnly = props.inputReadOnly, required4 = props.required, ariaRequired = props["aria-required"], onSubmit = props.onSubmit, _onFocus = props.onFocus, _onBlur = props.onBlur, onInputChange = props.onInputChange, onInvalid = props.onInvalid, open2 = props.open, onOpenChange = props.onOpenChange, _onKeyDown = props.onKeyDown, _onChange = props.onChange, activeHelp = props.activeHelp, name = props.name, autoComplete = props.autoComplete, id2 = props.id, value2 = props.value, invalid = props.invalid, placeholder = props.placeholder, disabled = props.disabled, activeIndex = props.activeIndex, allHelp = props.allHelp,
|
|
31011
|
+
var format3 = props.format, maskFormat = props.maskFormat, generateConfig2 = props.generateConfig, locale2 = props.locale, preserveInvalidOnBlur = props.preserveInvalidOnBlur, inputReadOnly = props.inputReadOnly, required4 = props.required, ariaRequired = props["aria-required"], onSubmit = props.onSubmit, _onFocus = props.onFocus, _onBlur = props.onBlur, onInputChange = props.onInputChange, onInvalid = props.onInvalid, open2 = props.open, onOpenChange = props.onOpenChange, _onKeyDown = props.onKeyDown, _onChange = props.onChange, activeHelp = props.activeHelp, name = props.name, autoComplete = props.autoComplete, id2 = props.id, value2 = props.value, invalid = props.invalid, placeholder = props.placeholder, disabled = props.disabled, activeIndex = props.activeIndex, allHelp = props.allHelp, picker = props.picker;
|
|
31012
31012
|
var parseDate = function parseDate2(str, formatStr) {
|
|
31013
31013
|
var parsed = generateConfig2.locale.parse(locale2.locale, str, [formatStr]);
|
|
31014
31014
|
return parsed && generateConfig2.isValidate(parsed) ? parsed : null;
|
|
@@ -31025,10 +31025,10 @@ function useInputProps(props, postProps) {
|
|
|
31025
31025
|
return value2.map(getText);
|
|
31026
31026
|
}, [value2, getText]);
|
|
31027
31027
|
var size = React.useMemo(function() {
|
|
31028
|
-
var defaultSize =
|
|
31028
|
+
var defaultSize = picker === "time" ? 8 : 10;
|
|
31029
31029
|
var length2 = typeof firstFormat === "function" ? firstFormat(generateConfig2.getNow()).length : firstFormat.length;
|
|
31030
31030
|
return Math.max(defaultSize, length2) + 2;
|
|
31031
|
-
}, [firstFormat,
|
|
31031
|
+
}, [firstFormat, picker, generateConfig2]);
|
|
31032
31032
|
var _validateFormat = function validateFormat(text) {
|
|
31033
31033
|
for (var i2 = 0; i2 < format3.length; i2 += 1) {
|
|
31034
31034
|
var singleFormat = format3[i2];
|
|
@@ -31644,7 +31644,7 @@ function RangePicker$1(props, ref2) {
|
|
|
31644
31644
|
allowEmpty: mergedAllowEmpty
|
|
31645
31645
|
};
|
|
31646
31646
|
}), _useFilledProps2 = _slicedToArray(_useFilledProps, 6), filledProps = _useFilledProps2[0], internalPicker = _useFilledProps2[1], complexPicker = _useFilledProps2[2], formatList = _useFilledProps2[3], maskFormat = _useFilledProps2[4], isInvalidateDate = _useFilledProps2[5];
|
|
31647
|
-
var prefixCls = filledProps.prefixCls, styles2 = filledProps.styles, classNames2 = filledProps.classNames, defaultValue = filledProps.defaultValue, value2 = filledProps.value, needConfirm = filledProps.needConfirm, onKeyDown = filledProps.onKeyDown, disabled = filledProps.disabled, allowEmpty = filledProps.allowEmpty, disabledDate = filledProps.disabledDate, minDate = filledProps.minDate, maxDate = filledProps.maxDate, defaultOpen = filledProps.defaultOpen, open2 = filledProps.open, onOpenChange = filledProps.onOpenChange, locale2 = filledProps.locale, generateConfig2 = filledProps.generateConfig,
|
|
31647
|
+
var prefixCls = filledProps.prefixCls, styles2 = filledProps.styles, classNames2 = filledProps.classNames, defaultValue = filledProps.defaultValue, value2 = filledProps.value, needConfirm = filledProps.needConfirm, onKeyDown = filledProps.onKeyDown, disabled = filledProps.disabled, allowEmpty = filledProps.allowEmpty, disabledDate = filledProps.disabledDate, minDate = filledProps.minDate, maxDate = filledProps.maxDate, defaultOpen = filledProps.defaultOpen, open2 = filledProps.open, onOpenChange = filledProps.onOpenChange, locale2 = filledProps.locale, generateConfig2 = filledProps.generateConfig, picker = filledProps.picker, showNow = filledProps.showNow, showToday = filledProps.showToday, showTime = filledProps.showTime, mode = filledProps.mode, onPanelChange = filledProps.onPanelChange, onCalendarChange = filledProps.onCalendarChange, onOk = filledProps.onOk, defaultPickerValue = filledProps.defaultPickerValue, pickerValue = filledProps.pickerValue, onPickerValueChange = filledProps.onPickerValueChange, inputReadOnly = filledProps.inputReadOnly, suffixIcon = filledProps.suffixIcon, onFocus = filledProps.onFocus, onBlur = filledProps.onBlur, presets = filledProps.presets, ranges = filledProps.ranges, components = filledProps.components, cellRender = filledProps.cellRender, dateRender = filledProps.dateRender, monthCellRender = filledProps.monthCellRender, onClick = filledProps.onClick;
|
|
31648
31648
|
var selectorRef = usePickerRef(ref2);
|
|
31649
31649
|
var _useOpen = useOpen(open2, defaultOpen, disabled, onOpenChange), _useOpen2 = _slicedToArray(_useOpen, 2), mergedOpen = _useOpen2[0], setMergeOpen = _useOpen2[1];
|
|
31650
31650
|
var triggerOpen = function triggerOpen2(nextOpen, config) {
|
|
@@ -31685,13 +31685,13 @@ function RangePicker$1(props, ref2) {
|
|
|
31685
31685
|
disabledTime: proxyDisabledTime
|
|
31686
31686
|
});
|
|
31687
31687
|
}, [showTime, activeIndex, calendarValue, activeIndexList]);
|
|
31688
|
-
var _useMergedState = useMergedState([
|
|
31688
|
+
var _useMergedState = useMergedState([picker, picker], {
|
|
31689
31689
|
value: mode
|
|
31690
31690
|
}), _useMergedState2 = _slicedToArray(_useMergedState, 2), modes = _useMergedState2[0], setModes = _useMergedState2[1];
|
|
31691
|
-
var mergedMode = modes[activeIndex] ||
|
|
31691
|
+
var mergedMode = modes[activeIndex] || picker;
|
|
31692
31692
|
var internalMode = mergedMode === "date" && mergedShowTime ? "datetime" : mergedMode;
|
|
31693
|
-
var multiplePanel = internalMode ===
|
|
31694
|
-
var mergedShowNow = useShowNow(
|
|
31693
|
+
var multiplePanel = internalMode === picker && internalMode !== "time";
|
|
31694
|
+
var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday, true);
|
|
31695
31695
|
var _useRangeValue = useRangeValue(filledProps, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, mergedOpen, isInvalidateDate), _useRangeValue2 = _slicedToArray(_useRangeValue, 2), flushSubmit = _useRangeValue2[0], triggerSubmitChange = _useRangeValue2[1];
|
|
31696
31696
|
var mergedDisabledDate = useRangeDisabledDate(calendarValue, disabled, activeIndexList, generateConfig2, locale2, disabledDate);
|
|
31697
31697
|
var _useFieldsInvalidate = useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty), _useFieldsInvalidate2 = _slicedToArray(_useFieldsInvalidate, 2), submitInvalidates = _useFieldsInvalidate2[0], onSelectorInvalid = _useFieldsInvalidate2[1];
|
|
@@ -31826,7 +31826,7 @@ function RangePicker$1(props, ref2) {
|
|
|
31826
31826
|
onFocus: onPanelFocus,
|
|
31827
31827
|
onBlur: onSharedBlur,
|
|
31828
31828
|
onPanelMouseDown,
|
|
31829
|
-
picker
|
|
31829
|
+
picker,
|
|
31830
31830
|
mode: mergedMode,
|
|
31831
31831
|
internalMode,
|
|
31832
31832
|
onPanelChange: triggerModeChange,
|
|
@@ -31901,9 +31901,9 @@ function RangePicker$1(props, ref2) {
|
|
|
31901
31901
|
}, [prefixCls, locale2, generateConfig2, components.button, components.input]);
|
|
31902
31902
|
useLayoutEffect$1(function() {
|
|
31903
31903
|
if (mergedOpen && activeIndex !== void 0) {
|
|
31904
|
-
triggerModeChange(null,
|
|
31904
|
+
triggerModeChange(null, picker, false);
|
|
31905
31905
|
}
|
|
31906
|
-
}, [mergedOpen, activeIndex,
|
|
31906
|
+
}, [mergedOpen, activeIndex, picker]);
|
|
31907
31907
|
useLayoutEffect$1(function() {
|
|
31908
31908
|
var lastOp = lastOperation();
|
|
31909
31909
|
if (!mergedOpen && lastOp === "input") {
|
|
@@ -32121,7 +32121,7 @@ function SingleSelector2(props, ref2) {
|
|
|
32121
32121
|
var RefSingleSelector = /* @__PURE__ */ React.forwardRef(SingleSelector2);
|
|
32122
32122
|
function Picker(props, ref2) {
|
|
32123
32123
|
var _useFilledProps = useFilledProps(props), _useFilledProps2 = _slicedToArray(_useFilledProps, 6), filledProps = _useFilledProps2[0], internalPicker = _useFilledProps2[1], complexPicker = _useFilledProps2[2], formatList = _useFilledProps2[3], maskFormat = _useFilledProps2[4], isInvalidateDate = _useFilledProps2[5];
|
|
32124
|
-
var _ref = filledProps, prefixCls = _ref.prefixCls, styles2 = _ref.styles, classNames2 = _ref.classNames, order = _ref.order, defaultValue = _ref.defaultValue, value2 = _ref.value, needConfirm = _ref.needConfirm, onChange = _ref.onChange, onKeyDown = _ref.onKeyDown, disabled = _ref.disabled, disabledDate = _ref.disabledDate, minDate = _ref.minDate, maxDate = _ref.maxDate, defaultOpen = _ref.defaultOpen, open2 = _ref.open, onOpenChange = _ref.onOpenChange, locale2 = _ref.locale, generateConfig2 = _ref.generateConfig,
|
|
32124
|
+
var _ref = filledProps, prefixCls = _ref.prefixCls, styles2 = _ref.styles, classNames2 = _ref.classNames, order = _ref.order, defaultValue = _ref.defaultValue, value2 = _ref.value, needConfirm = _ref.needConfirm, onChange = _ref.onChange, onKeyDown = _ref.onKeyDown, disabled = _ref.disabled, disabledDate = _ref.disabledDate, minDate = _ref.minDate, maxDate = _ref.maxDate, defaultOpen = _ref.defaultOpen, open2 = _ref.open, onOpenChange = _ref.onOpenChange, locale2 = _ref.locale, generateConfig2 = _ref.generateConfig, picker = _ref.picker, showNow = _ref.showNow, showToday = _ref.showToday, showTime = _ref.showTime, mode = _ref.mode, onPanelChange = _ref.onPanelChange, onCalendarChange = _ref.onCalendarChange, onOk = _ref.onOk, multiple = _ref.multiple, defaultPickerValue = _ref.defaultPickerValue, pickerValue = _ref.pickerValue, onPickerValueChange = _ref.onPickerValueChange, inputReadOnly = _ref.inputReadOnly, suffixIcon = _ref.suffixIcon, removeIcon = _ref.removeIcon, onFocus = _ref.onFocus, onBlur = _ref.onBlur, presets = _ref.presets, components = _ref.components, cellRender = _ref.cellRender, dateRender = _ref.dateRender, monthCellRender = _ref.monthCellRender, onClick = _ref.onClick;
|
|
32125
32125
|
var selectorRef = usePickerRef(ref2);
|
|
32126
32126
|
function pickerParam(values) {
|
|
32127
32127
|
if (values === null) {
|
|
@@ -32152,11 +32152,11 @@ function Picker(props, ref2) {
|
|
|
32152
32152
|
triggerFocus2(false);
|
|
32153
32153
|
onBlur === null || onBlur === void 0 || onBlur(event, {});
|
|
32154
32154
|
};
|
|
32155
|
-
var _useMergedState = useMergedState(
|
|
32155
|
+
var _useMergedState = useMergedState(picker, {
|
|
32156
32156
|
value: mode
|
|
32157
32157
|
}), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedMode = _useMergedState2[0], setMode = _useMergedState2[1];
|
|
32158
32158
|
var internalMode = mergedMode === "date" && showTime ? "datetime" : mergedMode;
|
|
32159
|
-
var mergedShowNow = useShowNow(
|
|
32159
|
+
var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday);
|
|
32160
32160
|
var onInternalChange = onChange && function(dates, dateStrings) {
|
|
32161
32161
|
onChange(pickerParam(dates), pickerParam(dateStrings));
|
|
32162
32162
|
};
|
|
@@ -32281,7 +32281,7 @@ function Picker(props, ref2) {
|
|
|
32281
32281
|
};
|
|
32282
32282
|
var onPanelSelect = function onPanelSelect2(date4) {
|
|
32283
32283
|
lastOperation("panel");
|
|
32284
|
-
if (multiple && internalMode !==
|
|
32284
|
+
if (multiple && internalMode !== picker) {
|
|
32285
32285
|
return;
|
|
32286
32286
|
}
|
|
32287
32287
|
var nextValues = multiple ? toggleDates(getCalendarValue(), date4) : [date4];
|
|
@@ -32307,7 +32307,7 @@ function Picker(props, ref2) {
|
|
|
32307
32307
|
disabledDate,
|
|
32308
32308
|
onFocus: onPanelFocus,
|
|
32309
32309
|
onBlur: onSharedBlur,
|
|
32310
|
-
picker
|
|
32310
|
+
picker,
|
|
32311
32311
|
mode: mergedMode,
|
|
32312
32312
|
internalMode,
|
|
32313
32313
|
onPanelChange: triggerModeChange,
|
|
@@ -32364,9 +32364,9 @@ function Picker(props, ref2) {
|
|
|
32364
32364
|
}, [prefixCls, locale2, generateConfig2, components.button, components.input]);
|
|
32365
32365
|
useLayoutEffect$1(function() {
|
|
32366
32366
|
if (mergedOpen && activeIndex !== void 0) {
|
|
32367
|
-
triggerModeChange(null,
|
|
32367
|
+
triggerModeChange(null, picker, false);
|
|
32368
32368
|
}
|
|
32369
|
-
}, [mergedOpen, activeIndex,
|
|
32369
|
+
}, [mergedOpen, activeIndex, picker]);
|
|
32370
32370
|
useLayoutEffect$1(function() {
|
|
32371
32371
|
var lastOp = lastOperation();
|
|
32372
32372
|
if (!mergedOpen && lastOp === "input") {
|
|
@@ -35531,44 +35531,44 @@ const useMergedPickerSemantic = (pickerType, classNames$1, styles2, popupClassNa
|
|
|
35531
35531
|
return [filledClassNames, filledStyles];
|
|
35532
35532
|
}, [mergedClassNames, mergedStyles, popupClassName, popupStyle]);
|
|
35533
35533
|
};
|
|
35534
|
-
function getPlaceholder(locale2,
|
|
35534
|
+
function getPlaceholder(locale2, picker, customizePlaceholder) {
|
|
35535
35535
|
if (customizePlaceholder !== void 0) {
|
|
35536
35536
|
return customizePlaceholder;
|
|
35537
35537
|
}
|
|
35538
|
-
if (
|
|
35538
|
+
if (picker === "year" && locale2.lang.yearPlaceholder) {
|
|
35539
35539
|
return locale2.lang.yearPlaceholder;
|
|
35540
35540
|
}
|
|
35541
|
-
if (
|
|
35541
|
+
if (picker === "quarter" && locale2.lang.quarterPlaceholder) {
|
|
35542
35542
|
return locale2.lang.quarterPlaceholder;
|
|
35543
35543
|
}
|
|
35544
|
-
if (
|
|
35544
|
+
if (picker === "month" && locale2.lang.monthPlaceholder) {
|
|
35545
35545
|
return locale2.lang.monthPlaceholder;
|
|
35546
35546
|
}
|
|
35547
|
-
if (
|
|
35547
|
+
if (picker === "week" && locale2.lang.weekPlaceholder) {
|
|
35548
35548
|
return locale2.lang.weekPlaceholder;
|
|
35549
35549
|
}
|
|
35550
|
-
if (
|
|
35550
|
+
if (picker === "time" && locale2.timePickerLocale.placeholder) {
|
|
35551
35551
|
return locale2.timePickerLocale.placeholder;
|
|
35552
35552
|
}
|
|
35553
35553
|
return locale2.lang.placeholder;
|
|
35554
35554
|
}
|
|
35555
|
-
function getRangePlaceholder(locale2,
|
|
35555
|
+
function getRangePlaceholder(locale2, picker, customizePlaceholder) {
|
|
35556
35556
|
if (customizePlaceholder !== void 0) {
|
|
35557
35557
|
return customizePlaceholder;
|
|
35558
35558
|
}
|
|
35559
|
-
if (
|
|
35559
|
+
if (picker === "year" && locale2.lang.yearPlaceholder) {
|
|
35560
35560
|
return locale2.lang.rangeYearPlaceholder;
|
|
35561
35561
|
}
|
|
35562
|
-
if (
|
|
35562
|
+
if (picker === "quarter" && locale2.lang.quarterPlaceholder) {
|
|
35563
35563
|
return locale2.lang.rangeQuarterPlaceholder;
|
|
35564
35564
|
}
|
|
35565
|
-
if (
|
|
35565
|
+
if (picker === "month" && locale2.lang.monthPlaceholder) {
|
|
35566
35566
|
return locale2.lang.rangeMonthPlaceholder;
|
|
35567
35567
|
}
|
|
35568
|
-
if (
|
|
35568
|
+
if (picker === "week" && locale2.lang.weekPlaceholder) {
|
|
35569
35569
|
return locale2.lang.rangeWeekPlaceholder;
|
|
35570
35570
|
}
|
|
35571
|
-
if (
|
|
35571
|
+
if (picker === "time" && locale2.timePickerLocale.placeholder) {
|
|
35572
35572
|
return locale2.timePickerLocale.rangePlaceholder;
|
|
35573
35573
|
}
|
|
35574
35574
|
return locale2.lang.rangePlaceholder;
|
|
@@ -35617,7 +35617,7 @@ var ClockCircleOutlined = function ClockCircleOutlined2(props, ref2) {
|
|
|
35617
35617
|
};
|
|
35618
35618
|
var RefIcon$l = /* @__PURE__ */ React.forwardRef(ClockCircleOutlined);
|
|
35619
35619
|
const SuffixIcon = ({
|
|
35620
|
-
picker
|
|
35620
|
+
picker,
|
|
35621
35621
|
hasFeedback,
|
|
35622
35622
|
feedbackIcon,
|
|
35623
35623
|
suffixIcon
|
|
@@ -35626,7 +35626,7 @@ const SuffixIcon = ({
|
|
|
35626
35626
|
return null;
|
|
35627
35627
|
}
|
|
35628
35628
|
if (suffixIcon === true || suffixIcon === void 0) {
|
|
35629
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null,
|
|
35629
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, picker === TIME ? /* @__PURE__ */ React__default.createElement(RefIcon$l, null) : /* @__PURE__ */ React__default.createElement(RefIcon$m, null), hasFeedback && feedbackIcon);
|
|
35630
35630
|
}
|
|
35631
35631
|
return suffixIcon;
|
|
35632
35632
|
};
|
|
@@ -35667,12 +35667,12 @@ const generateRangePicker = (generateConfig2) => {
|
|
|
35667
35667
|
status: customStatus,
|
|
35668
35668
|
rootClassName,
|
|
35669
35669
|
variant: customVariant,
|
|
35670
|
-
picker
|
|
35670
|
+
picker,
|
|
35671
35671
|
styles: styles2,
|
|
35672
35672
|
classNames: classNames$1,
|
|
35673
35673
|
suffixIcon
|
|
35674
35674
|
} = props, restProps = __rest$l(props, ["prefixCls", "getPopupContainer", "components", "className", "style", "placement", "size", "disabled", "bordered", "placeholder", "popupStyle", "popupClassName", "dropdownClassName", "status", "rootClassName", "variant", "picker", "styles", "classNames", "suffixIcon"]);
|
|
35675
|
-
const pickerType =
|
|
35675
|
+
const pickerType = picker === TIME ? "timePicker" : "datePicker";
|
|
35676
35676
|
const innerRef = React.useRef(null);
|
|
35677
35677
|
const {
|
|
35678
35678
|
getPrefixCls,
|
|
@@ -35705,7 +35705,7 @@ const generateRangePicker = (generateConfig2) => {
|
|
|
35705
35705
|
feedbackIcon
|
|
35706
35706
|
} = formItemContext;
|
|
35707
35707
|
const mergedSuffixIcon = /* @__PURE__ */ React.createElement(SuffixIcon, {
|
|
35708
|
-
picker
|
|
35708
|
+
picker,
|
|
35709
35709
|
hasFeedback,
|
|
35710
35710
|
feedbackIcon,
|
|
35711
35711
|
suffixIcon
|
|
@@ -35724,7 +35724,7 @@ const generateRangePicker = (generateConfig2) => {
|
|
|
35724
35724
|
disabled: mergedDisabled,
|
|
35725
35725
|
ref: innerRef,
|
|
35726
35726
|
placement,
|
|
35727
|
-
placeholder: getRangePlaceholder(locale2,
|
|
35727
|
+
placeholder: getRangePlaceholder(locale2, picker, placeholder),
|
|
35728
35728
|
suffixIcon: mergedSuffixIcon,
|
|
35729
35729
|
prevIcon: /* @__PURE__ */ React.createElement("span", {
|
|
35730
35730
|
className: `${prefixCls}-prev-icon`
|
|
@@ -35739,7 +35739,7 @@ const generateRangePicker = (generateConfig2) => {
|
|
|
35739
35739
|
className: `${prefixCls}-super-next-icon`
|
|
35740
35740
|
}),
|
|
35741
35741
|
transitionName: `${rootPrefixCls}-slide-up`,
|
|
35742
|
-
picker
|
|
35742
|
+
picker
|
|
35743
35743
|
}, restProps, {
|
|
35744
35744
|
className: classNames({
|
|
35745
35745
|
[`${prefixCls}-${mergedSize}`]: mergedSize,
|
|
@@ -35774,7 +35774,7 @@ var __rest$k = function(s2, e2) {
|
|
|
35774
35774
|
return t2;
|
|
35775
35775
|
};
|
|
35776
35776
|
const generatePicker$1 = (generateConfig2) => {
|
|
35777
|
-
const getPicker = (
|
|
35777
|
+
const getPicker = (picker, displayName) => {
|
|
35778
35778
|
const consumerName = displayName === TIMEPICKER ? "timePicker" : "datePicker";
|
|
35779
35779
|
const Picker2 = /* @__PURE__ */ forwardRef((props, ref2) => {
|
|
35780
35780
|
var _a2;
|
|
@@ -35820,13 +35820,13 @@ const generatePicker$1 = (generateConfig2) => {
|
|
|
35820
35820
|
const additionalProps = {
|
|
35821
35821
|
showToday: true
|
|
35822
35822
|
};
|
|
35823
|
-
const mergedPicker =
|
|
35823
|
+
const mergedPicker = picker || props.picker;
|
|
35824
35824
|
const rootPrefixCls = getPrefixCls();
|
|
35825
35825
|
const {
|
|
35826
35826
|
onSelect,
|
|
35827
35827
|
multiple
|
|
35828
35828
|
} = restProps;
|
|
35829
|
-
const hasLegacyOnSelect = onSelect &&
|
|
35829
|
+
const hasLegacyOnSelect = onSelect && picker === "time" && !multiple;
|
|
35830
35830
|
const onInternalCalendarChange = (date4, dateStr, info) => {
|
|
35831
35831
|
onCalendarChange === null || onCalendarChange === void 0 ? void 0 : onCalendarChange(date4, dateStr, info);
|
|
35832
35832
|
if (hasLegacyOnSelect) {
|
|
@@ -35877,7 +35877,7 @@ const generatePicker$1 = (generateConfig2) => {
|
|
|
35877
35877
|
className: `${prefixCls}-super-next-icon`
|
|
35878
35878
|
}),
|
|
35879
35879
|
transitionName: `${rootPrefixCls}-slide-up`,
|
|
35880
|
-
picker
|
|
35880
|
+
picker,
|
|
35881
35881
|
onCalendarChange: onInternalCalendarChange
|
|
35882
35882
|
}, additionalProps, restProps, {
|
|
35883
35883
|
locale: locale2.lang,
|
|
@@ -90405,7 +90405,6 @@ const schTime = "_schTime_cw2ke_60";
|
|
|
90405
90405
|
const schActionBtn = "_schActionBtn_cw2ke_64";
|
|
90406
90406
|
const schActionBtnJoin = "_schActionBtnJoin_cw2ke_64";
|
|
90407
90407
|
const schActionBtnPending = "_schActionBtnPending_cw2ke_64";
|
|
90408
|
-
const picker = "_picker_cw2ke_79";
|
|
90409
90408
|
const inputError = "_inputError_cw2ke_84";
|
|
90410
90409
|
const styles$1 = {
|
|
90411
90410
|
offline_input,
|
|
@@ -90420,7 +90419,6 @@ const styles$1 = {
|
|
|
90420
90419
|
schActionBtn,
|
|
90421
90420
|
schActionBtnJoin,
|
|
90422
90421
|
schActionBtnPending,
|
|
90423
|
-
picker,
|
|
90424
90422
|
inputError
|
|
90425
90423
|
};
|
|
90426
90424
|
var lodash$1 = { exports: {} };
|
|
@@ -104483,7 +104481,7 @@ const EmptySchedule = ({ brandColor = "#1A4C9D" }) => {
|
|
|
104483
104481
|
return /* @__PURE__ */ jsxs(Col, { className: `${styles$1.emptyState} mt-4`, children: [
|
|
104484
104482
|
/* @__PURE__ */ jsx("div", { className: styles$1.schIconCon, children: /* @__PURE__ */ jsx(RefIcon$h, { style: { color: brandColor, fontSize: 18 } }) }),
|
|
104485
104483
|
/* @__PURE__ */ jsx("p", { className: styles$1.schTitle, children: "No Scheduled Meetings" }),
|
|
104486
|
-
/* @__PURE__ */ jsx("p", { className: styles$1.schSubtitle, children: "You have no upcoming virtual meetings
|
|
104484
|
+
/* @__PURE__ */ jsx("p", { className: styles$1.schSubtitle, children: "You have no upcoming virtual meetings." })
|
|
104487
104485
|
] });
|
|
104488
104486
|
};
|
|
104489
104487
|
const EmptySchedule$1 = memo(EmptySchedule);
|
|
@@ -104524,13 +104522,13 @@ const SlotPicker = memo(
|
|
|
104524
104522
|
},
|
|
104525
104523
|
[workHours]
|
|
104526
104524
|
);
|
|
104527
|
-
return /* @__PURE__ */ jsxs(Row, { className: "justify-between mb-2", children: [
|
|
104525
|
+
return /* @__PURE__ */ jsxs(Row, { gutter: 10, className: "justify-between mb-2", children: [
|
|
104528
104526
|
/* @__PURE__ */ jsxs(Col, { md: 12, children: [
|
|
104529
104527
|
/* @__PURE__ */ jsx(Col, { className: "pr-0", style: { paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", { htmlFor: "date", children: /* @__PURE__ */ jsx("span", { className: "bg-white font-bold text-gray-900 pt-1 pl-2 pr-2", children: "Date" }) }) }),
|
|
104530
104528
|
/* @__PURE__ */ jsx(
|
|
104531
104529
|
DatePicker,
|
|
104532
104530
|
{
|
|
104533
|
-
className:
|
|
104531
|
+
className: "rounded-md w-full",
|
|
104534
104532
|
format: "YYYY-MM-DD",
|
|
104535
104533
|
disabledDate,
|
|
104536
104534
|
name: "date",
|
|
@@ -104541,12 +104539,12 @@ const SlotPicker = memo(
|
|
|
104541
104539
|
}
|
|
104542
104540
|
)
|
|
104543
104541
|
] }),
|
|
104544
|
-
/* @__PURE__ */ jsxs(Col, { md:
|
|
104542
|
+
/* @__PURE__ */ jsxs(Col, { md: 12, children: [
|
|
104545
104543
|
/* @__PURE__ */ jsx(Col, { className: "pr-0", style: { paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", { htmlFor: "time", children: /* @__PURE__ */ jsx("span", { className: "bg-white font-bold text-gray-900 pt-1 pl-2 pr-2", children: "Time" }) }) }),
|
|
104546
104544
|
/* @__PURE__ */ jsx(
|
|
104547
104545
|
TimePicker,
|
|
104548
104546
|
{
|
|
104549
|
-
className:
|
|
104547
|
+
className: "rounded-md w-full",
|
|
104550
104548
|
format: "HH:mm A",
|
|
104551
104549
|
minuteStep: callRequestDuration,
|
|
104552
104550
|
disabledTime,
|
|
@@ -104851,8 +104849,7 @@ const Offline = memo(
|
|
|
104851
104849
|
customer,
|
|
104852
104850
|
fields,
|
|
104853
104851
|
offlineMode,
|
|
104854
|
-
timezone: companyTimezone
|
|
104855
|
-
inviteLink
|
|
104852
|
+
timezone: companyTimezone
|
|
104856
104853
|
}) => {
|
|
104857
104854
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i2, _j, _k, _l, _m;
|
|
104858
104855
|
const callRequestOptions = [
|
|
@@ -105039,7 +105036,6 @@ const Offline = memo(
|
|
|
105039
105036
|
(i2) => sendConversationInvite({
|
|
105040
105037
|
customer_id: customer == null ? void 0 : customer.id,
|
|
105041
105038
|
conversation_id,
|
|
105042
|
-
invite_link: computedInviteLink,
|
|
105043
105039
|
email: i2.email,
|
|
105044
105040
|
name: i2.name
|
|
105045
105041
|
})
|
|
@@ -105147,10 +105143,6 @@ const Offline = memo(
|
|
|
105147
105143
|
const removeInvitee = (email2) => {
|
|
105148
105144
|
setInvitees((prev2) => prev2.filter((i2) => i2.email !== email2));
|
|
105149
105145
|
};
|
|
105150
|
-
const computedInviteLink = useMemo$2(
|
|
105151
|
-
() => inviteLink || (typeof window !== "undefined" ? window.location.href : ""),
|
|
105152
|
-
[inviteLink]
|
|
105153
|
-
);
|
|
105154
105146
|
return /* @__PURE__ */ jsxs("div", { className: "offline py-2 px-1 m-auto", children: [
|
|
105155
105147
|
scheduled ? /* @__PURE__ */ jsx(
|
|
105156
105148
|
Done$1,
|
|
@@ -105169,7 +105161,7 @@ const Offline = memo(
|
|
|
105169
105161
|
label: "Full Name",
|
|
105170
105162
|
name: "full_name",
|
|
105171
105163
|
placeholder: "Full Name",
|
|
105172
|
-
style: { borderRadius:
|
|
105164
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105173
105165
|
...{ handleChange, handleBlur, values, touched, errors }
|
|
105174
105166
|
}
|
|
105175
105167
|
),
|
|
@@ -105180,17 +105172,16 @@ const Offline = memo(
|
|
|
105180
105172
|
name: "email",
|
|
105181
105173
|
disabled: !!(user2 == null ? void 0 : user2.email),
|
|
105182
105174
|
placeholder: "Example@gmail.com",
|
|
105183
|
-
style: { borderRadius:
|
|
105175
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105184
105176
|
...{ handleChange, handleBlur, values, touched, errors }
|
|
105185
105177
|
}
|
|
105186
105178
|
),
|
|
105187
|
-
/* @__PURE__ */ jsxs("div", {
|
|
105188
|
-
/* @__PURE__ */ jsx(Col, { style: { paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", {
|
|
105189
|
-
/* @__PURE__ */ jsx(
|
|
105179
|
+
/* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
|
|
105180
|
+
/* @__PURE__ */ jsx(Col, { style: { marginBottom: "6px", paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", { htmlFor: "mobile", style: { display: "block" }, children: /* @__PURE__ */ jsx("span", { className: "bg-white font-bold text-gray-900", style: { padding: "2px 8px" }, children: "Phone No" }) }) }),
|
|
105181
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
105190
105182
|
PhoneInput,
|
|
105191
105183
|
{
|
|
105192
105184
|
id: "phone-input",
|
|
105193
|
-
className: "mt-n3",
|
|
105194
105185
|
placeholder: "Enter Phone No",
|
|
105195
105186
|
value: {
|
|
105196
105187
|
phoneNumber: values.mobile,
|
|
@@ -105200,18 +105191,20 @@ const Offline = memo(
|
|
|
105200
105191
|
onBlur: handleBlur,
|
|
105201
105192
|
required: true,
|
|
105202
105193
|
name: "mobile",
|
|
105194
|
+
size: "large",
|
|
105195
|
+
style: { width: "100%", fontSize: 16 },
|
|
105203
105196
|
onChange: (value2) => {
|
|
105204
105197
|
handleChange("calling_code")(`${value2 == null ? void 0 : value2.countryCode}`);
|
|
105205
105198
|
handleChange("mobile")((value2 == null ? void 0 : value2.areaCode) + ((value2 == null ? void 0 : value2.phoneNumber) ?? ""));
|
|
105206
105199
|
}
|
|
105207
105200
|
}
|
|
105208
|
-
),
|
|
105201
|
+
) }),
|
|
105209
105202
|
errors.mobile ? /* @__PURE__ */ jsx("div", { className: styles$1.inputError, children: errors.mobile }) : null
|
|
105210
105203
|
] }),
|
|
105211
105204
|
/* @__PURE__ */ jsx(
|
|
105212
105205
|
FInput,
|
|
105213
105206
|
{
|
|
105214
|
-
style: { borderRadius:
|
|
105207
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105215
105208
|
label: "Account Number",
|
|
105216
105209
|
name: "account",
|
|
105217
105210
|
type: "number",
|
|
@@ -105293,31 +105286,45 @@ const Offline = memo(
|
|
|
105293
105286
|
url: url3
|
|
105294
105287
|
}
|
|
105295
105288
|
),
|
|
105296
|
-
/* @__PURE__ */ jsxs(
|
|
105297
|
-
|
|
105298
|
-
|
|
105299
|
-
{
|
|
105300
|
-
|
|
105301
|
-
|
|
105302
|
-
|
|
105303
|
-
|
|
105304
|
-
|
|
105305
|
-
|
|
105306
|
-
|
|
105307
|
-
|
|
105308
|
-
|
|
105309
|
-
|
|
105310
|
-
|
|
105311
|
-
|
|
105312
|
-
|
|
105313
|
-
|
|
105314
|
-
|
|
105315
|
-
|
|
105316
|
-
|
|
105317
|
-
|
|
105318
|
-
|
|
105319
|
-
|
|
105320
|
-
|
|
105289
|
+
/* @__PURE__ */ jsxs(
|
|
105290
|
+
"div",
|
|
105291
|
+
{
|
|
105292
|
+
style: {
|
|
105293
|
+
display: "flex",
|
|
105294
|
+
flexDirection: "column",
|
|
105295
|
+
gap: "12px",
|
|
105296
|
+
paddingTop: "8px"
|
|
105297
|
+
},
|
|
105298
|
+
children: [
|
|
105299
|
+
/* @__PURE__ */ jsxs(
|
|
105300
|
+
Button,
|
|
105301
|
+
{
|
|
105302
|
+
type: "primary",
|
|
105303
|
+
htmlType: "submit",
|
|
105304
|
+
disabled: isLoading || isRecording || values.reason === "Leave a voice note" && !recordingTime,
|
|
105305
|
+
size: "large",
|
|
105306
|
+
className: " flex justify-center w-full ",
|
|
105307
|
+
style: { height: "48px", fontWeight: 600 },
|
|
105308
|
+
children: [
|
|
105309
|
+
isLoading ? /* @__PURE__ */ jsx(Spin, { className: "mr-2" }) : "",
|
|
105310
|
+
calendar2 ? "Update Call" : "Request Call"
|
|
105311
|
+
]
|
|
105312
|
+
}
|
|
105313
|
+
),
|
|
105314
|
+
/* @__PURE__ */ jsx(
|
|
105315
|
+
Button,
|
|
105316
|
+
{
|
|
105317
|
+
disabled: isRecording,
|
|
105318
|
+
style: { borderColor: hexcode, height: "48px", fontWeight: 500 },
|
|
105319
|
+
onClick: () => setIsScheduling(true),
|
|
105320
|
+
size: "large",
|
|
105321
|
+
className: "flex justify-center w-full",
|
|
105322
|
+
children: "Upcoming Meetings"
|
|
105323
|
+
}
|
|
105324
|
+
)
|
|
105325
|
+
]
|
|
105326
|
+
}
|
|
105327
|
+
)
|
|
105321
105328
|
] }),
|
|
105322
105329
|
/* @__PURE__ */ jsx(
|
|
105323
105330
|
Modal,
|
|
@@ -105584,14 +105591,14 @@ const FInput = memo(
|
|
|
105584
105591
|
() => options == null ? void 0 : options.map((value2) => ({ value: value2, label: lodashExports.capitalize(value2) })),
|
|
105585
105592
|
[options]
|
|
105586
105593
|
);
|
|
105587
|
-
return /* @__PURE__ */ jsxs("div", { ref: ref2,
|
|
105588
|
-
/* @__PURE__ */ jsx(Col, { className: "pr-0", style: { paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", {
|
|
105589
|
-
/* @__PURE__ */ jsxs("div", {
|
|
105594
|
+
return /* @__PURE__ */ jsxs("div", { ref: ref2, style: { marginBottom: "12px" }, children: [
|
|
105595
|
+
/* @__PURE__ */ jsx(Col, { className: "pr-0", style: { paddingLeft: "0px", marginBottom: "6px" }, children: /* @__PURE__ */ jsx("label", { htmlFor: name, style: { display: "block" }, children: /* @__PURE__ */ jsx("span", { className: "bg-white font-bold text-gray-900", style: { padding: "2px 8px" }, children: label }) }) }),
|
|
105596
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
105590
105597
|
type4 === "select" ? /* @__PURE__ */ jsx(
|
|
105591
105598
|
Select,
|
|
105592
105599
|
{
|
|
105593
105600
|
...p2,
|
|
105594
|
-
style: style2,
|
|
105601
|
+
style: { ...style2, width: "100%" },
|
|
105595
105602
|
className: styles$1.offline_input,
|
|
105596
105603
|
disabled,
|
|
105597
105604
|
onChange: (value2) => ["full_name", "name"].includes(name) ? onNameChange({ target: { value: value2, name } }) : (handleChange || onChange) && // @ts-expect-error ignore
|
|
@@ -105604,13 +105611,14 @@ const FInput = memo(
|
|
|
105604
105611
|
value: values[name],
|
|
105605
105612
|
status: errors[name] && "error",
|
|
105606
105613
|
popupMatchSelectWidth: false,
|
|
105607
|
-
getPopupContainer: () => ref2.current
|
|
105614
|
+
getPopupContainer: () => ref2.current,
|
|
105615
|
+
size: "large"
|
|
105608
105616
|
}
|
|
105609
105617
|
) : /* @__PURE__ */ jsx(
|
|
105610
105618
|
Input,
|
|
105611
105619
|
{
|
|
105612
105620
|
...p2,
|
|
105613
|
-
style: style2,
|
|
105621
|
+
style: { ...style2, width: "100%" },
|
|
105614
105622
|
className: styles$1.offline_input,
|
|
105615
105623
|
name,
|
|
105616
105624
|
disabled,
|
|
@@ -105622,7 +105630,8 @@ const FInput = memo(
|
|
|
105622
105630
|
value: values[name],
|
|
105623
105631
|
placeholder,
|
|
105624
105632
|
type: type4,
|
|
105625
|
-
status: errors[name] && "error"
|
|
105633
|
+
status: errors[name] && "error",
|
|
105634
|
+
size: "large"
|
|
105626
105635
|
}
|
|
105627
105636
|
),
|
|
105628
105637
|
errors[name] ? /* @__PURE__ */ jsx("div", { className: styles$1.inputError, children: errors[name] }) : null
|
|
@@ -105835,7 +105844,7 @@ function WidgetInitForm({
|
|
|
105835
105844
|
name: "name",
|
|
105836
105845
|
placeholder: "Enter Full Name",
|
|
105837
105846
|
onChange: formik.handleChange,
|
|
105838
|
-
style: { borderRadius:
|
|
105847
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105839
105848
|
onBlur: formik.handleBlur,
|
|
105840
105849
|
values: formik.values,
|
|
105841
105850
|
touched: formik.touched,
|
|
@@ -105849,7 +105858,7 @@ function WidgetInitForm({
|
|
|
105849
105858
|
name: "email",
|
|
105850
105859
|
placeholder: "",
|
|
105851
105860
|
onChange: formik.handleChange,
|
|
105852
|
-
style: { borderRadius:
|
|
105861
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105853
105862
|
onBlur: formik.handleBlur,
|
|
105854
105863
|
values: formik.values,
|
|
105855
105864
|
touched: formik.touched,
|
|
@@ -105860,9 +105869,16 @@ function WidgetInitForm({
|
|
|
105860
105869
|
Object.keys(fields || {}).map((key) => {
|
|
105861
105870
|
if (fields[key].show === true || fields[key].show === void 0) {
|
|
105862
105871
|
if (key === "mobile") {
|
|
105863
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
105864
|
-
/* @__PURE__ */ jsx(Col, { style: { marginBottom: "
|
|
105865
|
-
|
|
105872
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
|
|
105873
|
+
/* @__PURE__ */ jsx(Col, { style: { marginBottom: "6px", paddingLeft: "0px" }, children: /* @__PURE__ */ jsx("label", { htmlFor: key, style: { display: "block" }, children: /* @__PURE__ */ jsx(
|
|
105874
|
+
"span",
|
|
105875
|
+
{
|
|
105876
|
+
className: "bg-white font-bold text-gray-900",
|
|
105877
|
+
style: { padding: "2px 8px" },
|
|
105878
|
+
children: String(key) === "bvn" ? "ID No" : fields[key].label || capitalizeFirstLetters(key)
|
|
105879
|
+
}
|
|
105880
|
+
) }) }),
|
|
105881
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
105866
105882
|
PhoneInput,
|
|
105867
105883
|
{
|
|
105868
105884
|
id: "phone-input",
|
|
@@ -105876,6 +105892,8 @@ function WidgetInitForm({
|
|
|
105876
105892
|
required: true,
|
|
105877
105893
|
name: key,
|
|
105878
105894
|
enableSearch: true,
|
|
105895
|
+
size: "large",
|
|
105896
|
+
style: { width: "100%", fontSize: 16 },
|
|
105879
105897
|
onChange: (value2) => {
|
|
105880
105898
|
formik.handleChange("calling_code")(`${value2 == null ? void 0 : value2.countryCode}`);
|
|
105881
105899
|
formik.handleChange(key)(
|
|
@@ -105896,7 +105914,7 @@ function WidgetInitForm({
|
|
|
105896
105914
|
type: fields[key].type,
|
|
105897
105915
|
placeholder: fields[key].placeholder || `Enter ${key}`,
|
|
105898
105916
|
onChange: formik.handleChange,
|
|
105899
|
-
style: { borderRadius:
|
|
105917
|
+
style: { borderRadius: 8, fontSize: 16 },
|
|
105900
105918
|
onBlur: formik.handleBlur,
|
|
105901
105919
|
values: formik.values,
|
|
105902
105920
|
touched: formik.touched,
|
|
@@ -105941,8 +105959,10 @@ function WidgetInitForm({
|
|
|
105941
105959
|
{
|
|
105942
105960
|
className: "mt-auto",
|
|
105943
105961
|
style: {
|
|
105944
|
-
|
|
105945
|
-
|
|
105962
|
+
display: "flex",
|
|
105963
|
+
flexDirection: "column",
|
|
105964
|
+
gap: "12px",
|
|
105965
|
+
paddingTop: "8px"
|
|
105946
105966
|
},
|
|
105947
105967
|
children: [
|
|
105948
105968
|
/* @__PURE__ */ jsxs(
|
|
@@ -105951,7 +105971,9 @@ function WidgetInitForm({
|
|
|
105951
105971
|
type: "primary",
|
|
105952
105972
|
htmlType: "submit",
|
|
105953
105973
|
disabled: state.isLoading || formik.values.reason === "Leave a voice note" && !recordingTime,
|
|
105954
|
-
|
|
105974
|
+
size: "large",
|
|
105975
|
+
className: "flex justify-center border-0 items-center w-full",
|
|
105976
|
+
style: { height: "48px", fontWeight: 600 },
|
|
105955
105977
|
children: [
|
|
105956
105978
|
state.isLoading ? /* @__PURE__ */ jsx(Spin, { className: "mr-2" }) : "",
|
|
105957
105979
|
/* @__PURE__ */ jsx("span", { children: "Start Banking" })
|
|
@@ -105961,9 +105983,10 @@ function WidgetInitForm({
|
|
|
105961
105983
|
/* @__PURE__ */ jsx(
|
|
105962
105984
|
Button,
|
|
105963
105985
|
{
|
|
105964
|
-
style: { borderColor: widgetColor },
|
|
105986
|
+
style: { borderColor: widgetColor, height: "48px", fontWeight: 500 },
|
|
105965
105987
|
onClick: () => setIsScheduling(true),
|
|
105966
|
-
|
|
105988
|
+
size: "large",
|
|
105989
|
+
className: "flex justify-center w-full",
|
|
105967
105990
|
children: "Upcoming Meetings"
|
|
105968
105991
|
}
|
|
105969
105992
|
)
|
|
@@ -107075,7 +107098,7 @@ function WidgetOnlineHeader({ company }) {
|
|
|
107075
107098
|
/* @__PURE__ */ jsxs("p", { className: "my-1", style: { fontSize: 13 }, children: [
|
|
107076
107099
|
"Please fill out the form below to start virtual ",
|
|
107077
107100
|
/* @__PURE__ */ jsx("br", {}),
|
|
107078
|
-
" engagement with the next available agent"
|
|
107101
|
+
" engagement with the next available agent."
|
|
107079
107102
|
] })
|
|
107080
107103
|
]
|
|
107081
107104
|
}
|
|
@@ -119928,7 +119951,6 @@ const CallInviteModal = ({
|
|
|
119928
119951
|
onCancel,
|
|
119929
119952
|
conversationId,
|
|
119930
119953
|
customerId,
|
|
119931
|
-
inviteLink,
|
|
119932
119954
|
brandColor = "#034ea2",
|
|
119933
119955
|
initialForm,
|
|
119934
119956
|
onSuccess,
|
|
@@ -119953,20 +119975,22 @@ const CallInviteModal = ({
|
|
|
119953
119975
|
const onSend = async () => {
|
|
119954
119976
|
try {
|
|
119955
119977
|
setLoading(true);
|
|
119956
|
-
|
|
119978
|
+
const payload = {
|
|
119957
119979
|
customer_id: customerId,
|
|
119958
119980
|
conversation_id: conversationId,
|
|
119959
|
-
invite_link: inviteLink || "https://meet.com",
|
|
119960
119981
|
email: form.email,
|
|
119961
119982
|
name: form.fullName
|
|
119962
|
-
}
|
|
119983
|
+
};
|
|
119984
|
+
await sendConversationInvite(payload);
|
|
119963
119985
|
setLoading(false);
|
|
119986
|
+
y.success("Invitation sent successfully!");
|
|
119964
119987
|
onSuccess == null ? void 0 : onSuccess({ email: form.email, name: form.fullName });
|
|
119965
119988
|
setForm({ fullName: "", email: "" });
|
|
119966
119989
|
onCancel();
|
|
119967
119990
|
} catch (error) {
|
|
119968
119991
|
setLoading(false);
|
|
119969
119992
|
onError == null ? void 0 : onError(error);
|
|
119993
|
+
y.error("Failed to send invitation.");
|
|
119970
119994
|
}
|
|
119971
119995
|
};
|
|
119972
119996
|
return /* @__PURE__ */ jsx(
|
|
@@ -120050,11 +120074,23 @@ const CallInviteModal = ({
|
|
|
120050
120074
|
}
|
|
120051
120075
|
),
|
|
120052
120076
|
/* @__PURE__ */ jsxs("div", { style: { padding: "20px 32px 28px 32px", textAlign: "left" }, children: [
|
|
120053
|
-
/* @__PURE__ */ jsxs(
|
|
120054
|
-
"
|
|
120055
|
-
|
|
120056
|
-
|
|
120057
|
-
|
|
120077
|
+
/* @__PURE__ */ jsxs(
|
|
120078
|
+
"div",
|
|
120079
|
+
{
|
|
120080
|
+
style: {
|
|
120081
|
+
fontSize: 17,
|
|
120082
|
+
color: "#222",
|
|
120083
|
+
marginBottom: 16,
|
|
120084
|
+
fontWeight: 500,
|
|
120085
|
+
lineHeight: 1.4
|
|
120086
|
+
},
|
|
120087
|
+
children: [
|
|
120088
|
+
"Invite someone to join this call session",
|
|
120089
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
120090
|
+
"by sending them an invitation link."
|
|
120091
|
+
]
|
|
120092
|
+
}
|
|
120093
|
+
),
|
|
120058
120094
|
/* @__PURE__ */ jsx(
|
|
120059
120095
|
FInput,
|
|
120060
120096
|
{
|
|
@@ -120131,16 +120167,11 @@ const Controls = ({
|
|
|
120131
120167
|
stopScreenSharing,
|
|
120132
120168
|
screenShared,
|
|
120133
120169
|
conversationId,
|
|
120134
|
-
inviteLink,
|
|
120135
120170
|
brandColor,
|
|
120136
120171
|
localParticipant,
|
|
120137
120172
|
isMobile: isMobile2
|
|
120138
120173
|
}) => {
|
|
120139
120174
|
const [inviteModalOpen, setInviteModalOpen] = React__default.useState(false);
|
|
120140
|
-
const computedInviteLink = useMemo$2(
|
|
120141
|
-
() => inviteLink || (typeof window !== "undefined" ? window.location.href : ""),
|
|
120142
|
-
[inviteLink]
|
|
120143
|
-
);
|
|
120144
120175
|
const audioOn = (localParticipant == null ? void 0 : localParticipant.audioOn) ?? true;
|
|
120145
120176
|
const videoOn = (localParticipant == null ? void 0 : localParticipant.videoOn) ?? true;
|
|
120146
120177
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -120205,7 +120236,6 @@ const Controls = ({
|
|
|
120205
120236
|
onCancel: () => setInviteModalOpen(false),
|
|
120206
120237
|
conversationId,
|
|
120207
120238
|
customerId: useUserStore.getState().user.id,
|
|
120208
|
-
inviteLink: computedInviteLink,
|
|
120209
120239
|
brandColor
|
|
120210
120240
|
}
|
|
120211
120241
|
)
|
|
@@ -120227,9 +120257,7 @@ const VideoChat = ({
|
|
|
120227
120257
|
remoteParticipants = [],
|
|
120228
120258
|
allParticipants = [],
|
|
120229
120259
|
conversationId,
|
|
120230
|
-
inviteLink,
|
|
120231
120260
|
brandColor,
|
|
120232
|
-
error,
|
|
120233
120261
|
isConnecting = false
|
|
120234
120262
|
}) => {
|
|
120235
120263
|
const isMobile2 = useMemo$2(() => detectMobile(), []);
|
|
@@ -120312,13 +120340,11 @@ const VideoChat = ({
|
|
|
120312
120340
|
screenShared,
|
|
120313
120341
|
isRecording,
|
|
120314
120342
|
conversationId,
|
|
120315
|
-
inviteLink,
|
|
120316
120343
|
brandColor,
|
|
120317
120344
|
localParticipant,
|
|
120318
120345
|
isMobile: isMobile2
|
|
120319
120346
|
}
|
|
120320
|
-
) }) })
|
|
120321
|
-
error && /* @__PURE__ */ jsx("div", { className: "text-red-500 text-xs p-2 absolute bottom-2 left-2 bg-white/70 rounded", children: String(error) })
|
|
120347
|
+
) }) })
|
|
120322
120348
|
]
|
|
120323
120349
|
}
|
|
120324
120350
|
);
|
|
@@ -120479,6 +120505,7 @@ const IncomingVideoCallModal = memo(
|
|
|
120479
120505
|
rejectCall,
|
|
120480
120506
|
callerName = "Caller",
|
|
120481
120507
|
callerImage,
|
|
120508
|
+
callerTitle = "Agent",
|
|
120482
120509
|
brandColor = "#ffffff"
|
|
120483
120510
|
}) => {
|
|
120484
120511
|
return /* @__PURE__ */ jsx(
|
|
@@ -120520,10 +120547,11 @@ const IncomingVideoCallModal = memo(
|
|
|
120520
120547
|
"h3",
|
|
120521
120548
|
{
|
|
120522
120549
|
className: "text-center mt-4",
|
|
120523
|
-
style: { fontSize: 20, fontWeight:
|
|
120550
|
+
style: { fontSize: 20, fontWeight: 500, color: "#1F2937", letterSpacing: -0.3 },
|
|
120524
120551
|
children: callerName
|
|
120525
120552
|
}
|
|
120526
|
-
)
|
|
120553
|
+
),
|
|
120554
|
+
/* @__PURE__ */ jsx("p", { className: "text-black text-center", style: { fontSize: 13 }, children: callerTitle || "Agent" })
|
|
120527
120555
|
] }),
|
|
120528
120556
|
/* @__PURE__ */ jsxs("div", { style: incomingModalStyles.buttonContainer, children: [
|
|
120529
120557
|
/* @__PURE__ */ jsx(
|
|
@@ -120658,10 +120686,7 @@ const incomingModalStyles = {
|
|
|
120658
120686
|
const VideoChat$1 = memo(VideoChat);
|
|
120659
120687
|
const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
120660
120688
|
const sessionToken = useUserStore((state) => state.sessionToken) || "";
|
|
120661
|
-
const socketUrl = useMemo$2(
|
|
120662
|
-
() => "https://api.dev.sawport.com",
|
|
120663
|
-
[]
|
|
120664
|
-
);
|
|
120689
|
+
const socketUrl = useMemo$2(() => sawportConfig.baseURL, []);
|
|
120665
120690
|
const [isIncomingCall, setIsIncomingCall] = useState$1(false);
|
|
120666
120691
|
const [incomingCallerInfo, setIncomingCallerInfo] = useState$1({});
|
|
120667
120692
|
const [isAnswering, setIsAnswering] = useState$1(false);
|
|
@@ -120835,7 +120860,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
120835
120860
|
const fullName = `${firstName} ${lastName}`.trim();
|
|
120836
120861
|
return {
|
|
120837
120862
|
name: fullName || "Agent",
|
|
120838
|
-
image: agent.profile_picture || agent.image
|
|
120863
|
+
image: agent.profile_picture || agent.image,
|
|
120864
|
+
title: agent.title || "Agent"
|
|
120839
120865
|
};
|
|
120840
120866
|
}
|
|
120841
120867
|
}
|
|
@@ -120843,7 +120869,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
120843
120869
|
if (agentParticipant) {
|
|
120844
120870
|
return {
|
|
120845
120871
|
name: agentParticipant.displayName || "Agent",
|
|
120846
|
-
image: void 0
|
|
120872
|
+
image: void 0,
|
|
120873
|
+
title: void 0
|
|
120847
120874
|
};
|
|
120848
120875
|
}
|
|
120849
120876
|
return null;
|
|
@@ -120919,7 +120946,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
120919
120946
|
}
|
|
120920
120947
|
const callerInfo = {
|
|
120921
120948
|
name: (agentInfo == null ? void 0 : agentInfo.name) || "Agent",
|
|
120922
|
-
image: agentInfo == null ? void 0 : agentInfo.image
|
|
120949
|
+
image: agentInfo == null ? void 0 : agentInfo.image,
|
|
120950
|
+
title: (agentInfo == null ? void 0 : agentInfo.title) || "Agent"
|
|
120923
120951
|
};
|
|
120924
120952
|
setIsIncomingCall(true);
|
|
120925
120953
|
setIncomingCallerInfo(callerInfo);
|
|
@@ -121089,7 +121117,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
121089
121117
|
try {
|
|
121090
121118
|
await startScreenShare();
|
|
121091
121119
|
} catch (error2) {
|
|
121092
|
-
|
|
121120
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
121121
|
+
y.error(`Failed to start screen share: ${message}`, { autoClose: 3e3 });
|
|
121093
121122
|
}
|
|
121094
121123
|
},
|
|
121095
121124
|
stopScreenSharing: async () => {
|
|
@@ -121100,7 +121129,8 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
121100
121129
|
try {
|
|
121101
121130
|
await stopScreenShare();
|
|
121102
121131
|
} catch (error2) {
|
|
121103
|
-
|
|
121132
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
121133
|
+
y.error(`Failed to stop screen share: ${message}`, { autoClose: 3e3 });
|
|
121104
121134
|
}
|
|
121105
121135
|
},
|
|
121106
121136
|
screenShared: (transformedLocalParticipant == null ? void 0 : transformedLocalParticipant.screenShared) || false,
|
|
@@ -121126,6 +121156,7 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
121126
121156
|
},
|
|
121127
121157
|
callerName: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.name) || (agentInfo == null ? void 0 : agentInfo.name),
|
|
121128
121158
|
callerImage: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.image) || (agentInfo == null ? void 0 : agentInfo.image),
|
|
121159
|
+
callerTitle: (incomingCallerInfo == null ? void 0 : incomingCallerInfo.title) || (agentInfo == null ? void 0 : agentInfo.title),
|
|
121129
121160
|
brandColor
|
|
121130
121161
|
}
|
|
121131
121162
|
)
|