@xfe-repo/web-components 1.7.2 → 1.7.4
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.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +160 -89
- package/dist/index.mjs +126 -55
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1125,12 +1125,28 @@ interface EffectMerchantSelectProps {
|
|
|
1125
1125
|
declare const EffectMerchantSelect: FunctionComponent<EffectMerchantSelectProps>;
|
|
1126
1126
|
|
|
1127
1127
|
type ScopeSelectValueType = {
|
|
1128
|
+
/** 各层级分类Ids */
|
|
1128
1129
|
categoryIds?: number[];
|
|
1130
|
+
/** 多层级的分类名称数组 */
|
|
1131
|
+
categoryName?: string[];
|
|
1132
|
+
/** 品牌Id */
|
|
1129
1133
|
brandId?: number;
|
|
1134
|
+
/** 品牌名称 */
|
|
1135
|
+
brandName?: string;
|
|
1136
|
+
/** 系列id */
|
|
1130
1137
|
seriesId?: number;
|
|
1138
|
+
/** 系列名称 */
|
|
1139
|
+
seriesName?: string;
|
|
1140
|
+
/** spuId */
|
|
1131
1141
|
spuId?: number;
|
|
1142
|
+
/** spu名称 */
|
|
1143
|
+
spuName?: string;
|
|
1144
|
+
/** skuId */
|
|
1132
1145
|
skuId?: number;
|
|
1146
|
+
/** sku名称 */
|
|
1147
|
+
skuName?: string;
|
|
1133
1148
|
};
|
|
1149
|
+
|
|
1134
1150
|
declare enum ScopeLevelEnum {
|
|
1135
1151
|
CATEGORY = 1,
|
|
1136
1152
|
BRAND = 2,
|
|
@@ -1145,6 +1161,8 @@ type ScopeSelectProps = {
|
|
|
1145
1161
|
requireLevel?: ScopeLevelEnum;
|
|
1146
1162
|
categoryChangeOnSelect?: boolean;
|
|
1147
1163
|
onChange?: (value?: ScopeSelectValueType) => void;
|
|
1164
|
+
/** 组件模式,edit-编辑态,view-查看态,默认为编辑态,查看态下只展示文本不展示选择组件 */
|
|
1165
|
+
mode?: 'edit' | 'view';
|
|
1148
1166
|
};
|
|
1149
1167
|
declare const EffectScopeSelect: React__default.MemoExoticComponent<(props: ScopeSelectProps) => react_jsx_runtime.JSX.Element>;
|
|
1150
1168
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1125,12 +1125,28 @@ interface EffectMerchantSelectProps {
|
|
|
1125
1125
|
declare const EffectMerchantSelect: FunctionComponent<EffectMerchantSelectProps>;
|
|
1126
1126
|
|
|
1127
1127
|
type ScopeSelectValueType = {
|
|
1128
|
+
/** 各层级分类Ids */
|
|
1128
1129
|
categoryIds?: number[];
|
|
1130
|
+
/** 多层级的分类名称数组 */
|
|
1131
|
+
categoryName?: string[];
|
|
1132
|
+
/** 品牌Id */
|
|
1129
1133
|
brandId?: number;
|
|
1134
|
+
/** 品牌名称 */
|
|
1135
|
+
brandName?: string;
|
|
1136
|
+
/** 系列id */
|
|
1130
1137
|
seriesId?: number;
|
|
1138
|
+
/** 系列名称 */
|
|
1139
|
+
seriesName?: string;
|
|
1140
|
+
/** spuId */
|
|
1131
1141
|
spuId?: number;
|
|
1142
|
+
/** spu名称 */
|
|
1143
|
+
spuName?: string;
|
|
1144
|
+
/** skuId */
|
|
1132
1145
|
skuId?: number;
|
|
1146
|
+
/** sku名称 */
|
|
1147
|
+
skuName?: string;
|
|
1133
1148
|
};
|
|
1149
|
+
|
|
1134
1150
|
declare enum ScopeLevelEnum {
|
|
1135
1151
|
CATEGORY = 1,
|
|
1136
1152
|
BRAND = 2,
|
|
@@ -1145,6 +1161,8 @@ type ScopeSelectProps = {
|
|
|
1145
1161
|
requireLevel?: ScopeLevelEnum;
|
|
1146
1162
|
categoryChangeOnSelect?: boolean;
|
|
1147
1163
|
onChange?: (value?: ScopeSelectValueType) => void;
|
|
1164
|
+
/** 组件模式,edit-编辑态,view-查看态,默认为编辑态,查看态下只展示文本不展示选择组件 */
|
|
1165
|
+
mode?: 'edit' | 'view';
|
|
1148
1166
|
};
|
|
1149
1167
|
declare const EffectScopeSelect: React__default.MemoExoticComponent<(props: ScopeSelectProps) => react_jsx_runtime.JSX.Element>;
|
|
1150
1168
|
|
package/dist/index.js
CHANGED
|
@@ -4971,7 +4971,7 @@ var EffectSkuSelect = (0, import_react38.memo)(function(props) {
|
|
|
4971
4971
|
state,
|
|
4972
4972
|
options
|
|
4973
4973
|
]);
|
|
4974
|
-
var
|
|
4974
|
+
var popupRender = (0, import_react38.useCallback)(function(_menu) {
|
|
4975
4975
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectDropdown, {
|
|
4976
4976
|
value: value,
|
|
4977
4977
|
options: options,
|
|
@@ -5003,8 +5003,8 @@ var EffectSkuSelect = (0, import_react38.memo)(function(props) {
|
|
|
5003
5003
|
onSearch: handleOnSearch,
|
|
5004
5004
|
onClear: handleOnClear,
|
|
5005
5005
|
open: openDropDown,
|
|
5006
|
-
|
|
5007
|
-
|
|
5006
|
+
popupRender: popupRender,
|
|
5007
|
+
onOpenChange: setOpenDropDown,
|
|
5008
5008
|
getPopupContainer: function getPopupContainer() {
|
|
5009
5009
|
return document.body;
|
|
5010
5010
|
}
|
|
@@ -5461,7 +5461,7 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5461
5461
|
options,
|
|
5462
5462
|
brandId
|
|
5463
5463
|
]);
|
|
5464
|
-
var
|
|
5464
|
+
var popupRender = (0, import_react40.useCallback)(function(_menu) {
|
|
5465
5465
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectDropdown, {
|
|
5466
5466
|
value: value,
|
|
5467
5467
|
options: options,
|
|
@@ -5494,8 +5494,8 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5494
5494
|
onSearch: handleOnSearch,
|
|
5495
5495
|
onClear: handleOnClear,
|
|
5496
5496
|
open: openDropDown,
|
|
5497
|
-
|
|
5498
|
-
|
|
5497
|
+
popupRender: popupRender,
|
|
5498
|
+
onOpenChange: setOpenDropDown,
|
|
5499
5499
|
getPopupContainer: function getPopupContainer() {
|
|
5500
5500
|
return document.body;
|
|
5501
5501
|
}
|
|
@@ -5727,7 +5727,7 @@ var EffectSpuSelect = (0, import_react41.memo)(function(props) {
|
|
|
5727
5727
|
state,
|
|
5728
5728
|
options
|
|
5729
5729
|
]);
|
|
5730
|
-
var
|
|
5730
|
+
var popupRender = (0, import_react41.useCallback)(function(_menu) {
|
|
5731
5731
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectDropdown, {
|
|
5732
5732
|
value: value,
|
|
5733
5733
|
options: options,
|
|
@@ -5759,8 +5759,8 @@ var EffectSpuSelect = (0, import_react41.memo)(function(props) {
|
|
|
5759
5759
|
onSearch: handleOnSearch,
|
|
5760
5760
|
onClear: handleOnClear,
|
|
5761
5761
|
open: openDropDown,
|
|
5762
|
-
|
|
5763
|
-
|
|
5762
|
+
popupRender: popupRender,
|
|
5763
|
+
onOpenChange: setOpenDropDown,
|
|
5764
5764
|
getPopupContainer: function getPopupContainer() {
|
|
5765
5765
|
return document.body;
|
|
5766
5766
|
}
|
|
@@ -6546,10 +6546,78 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6546
6546
|
});
|
|
6547
6547
|
});
|
|
6548
6548
|
// src/EffectScopeSelect/index.tsx
|
|
6549
|
+
var import_react47 = require("react");
|
|
6550
|
+
var import_antd35 = require("antd");
|
|
6551
|
+
var import_react_use16 = require("react-use");
|
|
6552
|
+
// src/EffectScopeSelect/ScopeViewMode.tsx
|
|
6549
6553
|
var import_react46 = require("react");
|
|
6550
6554
|
var import_antd34 = require("antd");
|
|
6551
|
-
var import_react_use16 = require("react-use");
|
|
6552
6555
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6556
|
+
var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
6557
|
+
var _ref = props || {}, categoryIds = _ref.categoryIds, categoryName = _ref.categoryName, brandId = _ref.brandId, brandName = _ref.brandName, seriesId = _ref.seriesId, seriesName = _ref.seriesName, spuId = _ref.spuId, spuName = _ref.spuName, skuId = _ref.skuId, skuName = _ref.skuName;
|
|
6558
|
+
var items = [];
|
|
6559
|
+
if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
|
|
6560
|
+
label: "\u5206\u7C7B",
|
|
6561
|
+
value: (categoryName === null || categoryName === void 0 ? void 0 : categoryName.join("/")) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.join(","))
|
|
6562
|
+
});
|
|
6563
|
+
if (brandName || brandId) items.push({
|
|
6564
|
+
label: "\u54C1\u724C",
|
|
6565
|
+
value: brandName || String(brandId)
|
|
6566
|
+
});
|
|
6567
|
+
if (seriesName || seriesId) items.push({
|
|
6568
|
+
label: "\u7CFB\u5217",
|
|
6569
|
+
value: seriesName || String(seriesId)
|
|
6570
|
+
});
|
|
6571
|
+
if (spuName || spuId) items.push({
|
|
6572
|
+
label: "SPU",
|
|
6573
|
+
value: spuName || String(spuId)
|
|
6574
|
+
});
|
|
6575
|
+
if (skuName || skuId) items.push({
|
|
6576
|
+
label: "SKU",
|
|
6577
|
+
value: skuName || String(skuId)
|
|
6578
|
+
});
|
|
6579
|
+
if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd34.Typography.Text, {
|
|
6580
|
+
style: {
|
|
6581
|
+
fontSize: 14
|
|
6582
|
+
},
|
|
6583
|
+
type: "danger",
|
|
6584
|
+
children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
|
|
6585
|
+
});
|
|
6586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd34.Space, {
|
|
6587
|
+
size: 4,
|
|
6588
|
+
children: items.map(function(param) {
|
|
6589
|
+
var label = param.label, value = param.value;
|
|
6590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd34.Space, {
|
|
6591
|
+
size: 4,
|
|
6592
|
+
style: {
|
|
6593
|
+
height: 32,
|
|
6594
|
+
padding: "0 36px 0 14px",
|
|
6595
|
+
borderRadius: 6
|
|
6596
|
+
},
|
|
6597
|
+
children: [
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd34.Typography.Text, {
|
|
6599
|
+
style: {
|
|
6600
|
+
fontSize: 14,
|
|
6601
|
+
paddingRight: 16
|
|
6602
|
+
},
|
|
6603
|
+
children: [
|
|
6604
|
+
label,
|
|
6605
|
+
":"
|
|
6606
|
+
]
|
|
6607
|
+
}),
|
|
6608
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd34.Typography.Text, {
|
|
6609
|
+
style: {
|
|
6610
|
+
fontSize: 14
|
|
6611
|
+
},
|
|
6612
|
+
children: value
|
|
6613
|
+
})
|
|
6614
|
+
]
|
|
6615
|
+
}, label);
|
|
6616
|
+
})
|
|
6617
|
+
});
|
|
6618
|
+
});
|
|
6619
|
+
// src/EffectScopeSelect/index.tsx
|
|
6620
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6553
6621
|
var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
6554
6622
|
ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
|
|
6555
6623
|
ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
|
|
@@ -6558,10 +6626,10 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
|
6558
6626
|
ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
|
|
6559
6627
|
return ScopeLevelEnum2;
|
|
6560
6628
|
}(ScopeLevelEnum || {});
|
|
6561
|
-
var EffectScopeSelect = (0,
|
|
6562
|
-
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange;
|
|
6563
|
-
var _ref = _sliced_to_array((0,
|
|
6564
|
-
var lastLevelCategoryId = (0,
|
|
6629
|
+
var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
6630
|
+
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange, _props_mode = props.mode, mode = _props_mode === void 0 ? "edit" : _props_mode;
|
|
6631
|
+
var _ref = _sliced_to_array((0, import_react47.useState)(_object_spread({}, controlledValue, defaultValue)), 2), value = _ref[0], setValue = _ref[1];
|
|
6632
|
+
var lastLevelCategoryId = (0, import_react47.useMemo)(function() {
|
|
6565
6633
|
var _value_categoryIds;
|
|
6566
6634
|
return (_value_categoryIds = value.categoryIds) === null || _value_categoryIds === void 0 ? void 0 : _value_categoryIds[value.categoryIds.length - 1];
|
|
6567
6635
|
}, [
|
|
@@ -6572,14 +6640,14 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6572
6640
|
}, [
|
|
6573
6641
|
controlledValue
|
|
6574
6642
|
]);
|
|
6575
|
-
var handleChange = (0,
|
|
6643
|
+
var handleChange = (0, import_react47.useCallback)(function(newValue) {
|
|
6576
6644
|
setTimeout(function() {
|
|
6577
6645
|
return onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
6578
6646
|
}, 0);
|
|
6579
6647
|
}, [
|
|
6580
6648
|
onChange
|
|
6581
6649
|
]);
|
|
6582
|
-
var handleCategoryChange = (0,
|
|
6650
|
+
var handleCategoryChange = (0, import_react47.useCallback)(function(_values, selectedList) {
|
|
6583
6651
|
if (!selectedList || !isSingleTreeSelected(selectedList)) {
|
|
6584
6652
|
handleChange === null || handleChange === void 0 ? void 0 : handleChange();
|
|
6585
6653
|
return;
|
|
@@ -6598,7 +6666,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6598
6666
|
handleChange,
|
|
6599
6667
|
requireLevel
|
|
6600
6668
|
]);
|
|
6601
|
-
var handleBrandChange = (0,
|
|
6669
|
+
var handleBrandChange = (0, import_react47.useCallback)(function(brandValue) {
|
|
6602
6670
|
var brandId = brandValue === void 0 ? void 0 : Number(brandValue);
|
|
6603
6671
|
setValue(function(prev) {
|
|
6604
6672
|
var newScope = {
|
|
@@ -6614,7 +6682,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6614
6682
|
handleChange,
|
|
6615
6683
|
requireLevel
|
|
6616
6684
|
]);
|
|
6617
|
-
var handleSeriesChange = (0,
|
|
6685
|
+
var handleSeriesChange = (0, import_react47.useCallback)(function(seriesValue) {
|
|
6618
6686
|
var seriesId = seriesValue === void 0 ? void 0 : Number(seriesValue);
|
|
6619
6687
|
setValue(function(prev) {
|
|
6620
6688
|
var newScope = {
|
|
@@ -6631,7 +6699,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6631
6699
|
handleChange,
|
|
6632
6700
|
requireLevel
|
|
6633
6701
|
]);
|
|
6634
|
-
var handleSpuChange = (0,
|
|
6702
|
+
var handleSpuChange = (0, import_react47.useCallback)(function(spuValue) {
|
|
6635
6703
|
var spuId = spuValue === void 0 ? void 0 : Number(spuValue);
|
|
6636
6704
|
setValue(function(prev) {
|
|
6637
6705
|
var newScope = {
|
|
@@ -6649,7 +6717,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6649
6717
|
handleChange,
|
|
6650
6718
|
requireLevel
|
|
6651
6719
|
]);
|
|
6652
|
-
var handleSkuChange = (0,
|
|
6720
|
+
var handleSkuChange = (0, import_react47.useCallback)(function(skuValue) {
|
|
6653
6721
|
var skuId = skuValue === void 0 ? void 0 : Number(skuValue);
|
|
6654
6722
|
setValue(function(prev) {
|
|
6655
6723
|
var newScope = _object_spread_props(_object_spread({}, prev), {
|
|
@@ -6664,18 +6732,18 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6664
6732
|
handleChange,
|
|
6665
6733
|
requireLevel
|
|
6666
6734
|
]);
|
|
6667
|
-
var renderLabel = (0,
|
|
6668
|
-
return /* @__PURE__ */ (0,
|
|
6735
|
+
var renderLabel = (0, import_react47.useCallback)(function(label, required) {
|
|
6736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd35.Flex, {
|
|
6669
6737
|
flex: "0 0 auto",
|
|
6670
|
-
children: /* @__PURE__ */ (0,
|
|
6738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Space, {
|
|
6671
6739
|
children: [
|
|
6672
|
-
required && /* @__PURE__ */ (0,
|
|
6740
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", {
|
|
6673
6741
|
style: {
|
|
6674
6742
|
color: "var(--ant-color-error)"
|
|
6675
6743
|
},
|
|
6676
6744
|
children: "*"
|
|
6677
6745
|
}),
|
|
6678
|
-
/* @__PURE__ */ (0,
|
|
6746
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", {
|
|
6679
6747
|
children: [
|
|
6680
6748
|
label,
|
|
6681
6749
|
":"
|
|
@@ -6685,32 +6753,35 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6685
6753
|
})
|
|
6686
6754
|
});
|
|
6687
6755
|
}, []);
|
|
6688
|
-
|
|
6756
|
+
if (mode === "view") {
|
|
6757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScopeViewMode, _object_spread({}, value));
|
|
6758
|
+
}
|
|
6759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6689
6760
|
justify: "flex-start",
|
|
6690
6761
|
align: "center",
|
|
6691
6762
|
wrap: "nowrap",
|
|
6692
6763
|
gap: "15px",
|
|
6693
6764
|
children: [
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6765
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6695
6766
|
align: "center",
|
|
6696
6767
|
gap: "5px",
|
|
6697
6768
|
flex: "0 0 auto",
|
|
6698
6769
|
children: [
|
|
6699
6770
|
renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
|
|
6700
|
-
/* @__PURE__ */ (0,
|
|
6771
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectCategoryCascade, {
|
|
6701
6772
|
onChange: handleCategoryChange,
|
|
6702
6773
|
changeOnSelect: categoryChangeOnSelect,
|
|
6703
6774
|
value: value.categoryIds
|
|
6704
6775
|
})
|
|
6705
6776
|
]
|
|
6706
6777
|
}),
|
|
6707
|
-
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0,
|
|
6778
|
+
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6708
6779
|
align: "center",
|
|
6709
6780
|
gap: "5px",
|
|
6710
6781
|
flex: "0 0 auto",
|
|
6711
6782
|
children: [
|
|
6712
6783
|
renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
|
|
6713
|
-
/* @__PURE__ */ (0,
|
|
6784
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectBrandSelect, _object_spread_props(_object_spread({
|
|
6714
6785
|
categoryId: lastLevelCategoryId
|
|
6715
6786
|
}, value), {
|
|
6716
6787
|
onChange: handleBrandChange,
|
|
@@ -6718,13 +6789,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6718
6789
|
}))
|
|
6719
6790
|
]
|
|
6720
6791
|
}),
|
|
6721
|
-
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0,
|
|
6792
|
+
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6722
6793
|
align: "center",
|
|
6723
6794
|
gap: "5px",
|
|
6724
6795
|
flex: "0 0 auto",
|
|
6725
6796
|
children: [
|
|
6726
6797
|
renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
|
|
6727
|
-
/* @__PURE__ */ (0,
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSeriesSelect, _object_spread_props(_object_spread({
|
|
6728
6799
|
categoryId: lastLevelCategoryId
|
|
6729
6800
|
}, value), {
|
|
6730
6801
|
onChange: handleSeriesChange,
|
|
@@ -6732,13 +6803,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6732
6803
|
}))
|
|
6733
6804
|
]
|
|
6734
6805
|
}),
|
|
6735
|
-
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0,
|
|
6806
|
+
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6736
6807
|
align: "center",
|
|
6737
6808
|
gap: "5px",
|
|
6738
6809
|
flex: "0 0 auto",
|
|
6739
6810
|
children: [
|
|
6740
6811
|
renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6812
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSpuSelect, _object_spread_props(_object_spread({
|
|
6742
6813
|
categoryId: lastLevelCategoryId
|
|
6743
6814
|
}, value), {
|
|
6744
6815
|
onChange: handleSpuChange,
|
|
@@ -6746,13 +6817,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6746
6817
|
}))
|
|
6747
6818
|
]
|
|
6748
6819
|
}),
|
|
6749
|
-
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0,
|
|
6820
|
+
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd35.Flex, {
|
|
6750
6821
|
align: "center",
|
|
6751
6822
|
gap: "5px",
|
|
6752
6823
|
flex: "0 0 auto",
|
|
6753
6824
|
children: [
|
|
6754
6825
|
renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
|
|
6755
|
-
/* @__PURE__ */ (0,
|
|
6826
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSkuSelect, _object_spread_props(_object_spread({
|
|
6756
6827
|
categoryId: lastLevelCategoryId
|
|
6757
6828
|
}, value), {
|
|
6758
6829
|
onChange: handleSkuChange,
|
|
@@ -6764,22 +6835,22 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6764
6835
|
});
|
|
6765
6836
|
});
|
|
6766
6837
|
// src/EffectStaffSelect/index.tsx
|
|
6767
|
-
var
|
|
6838
|
+
var import_react48 = require("react");
|
|
6768
6839
|
var import_react_use17 = require("react-use");
|
|
6769
6840
|
var import_classnames13 = __toESM(require("classnames"));
|
|
6770
|
-
var
|
|
6841
|
+
var import_antd36 = require("antd");
|
|
6771
6842
|
var import_tools11 = require("@xfe-repo/web-utils/tools");
|
|
6772
6843
|
// src/EffectStaffSelect/index.module.less
|
|
6773
6844
|
var index_module_default18 = {
|
|
6774
6845
|
select: "index_module_select4"
|
|
6775
6846
|
};
|
|
6776
6847
|
// src/EffectStaffSelect/index.tsx
|
|
6777
|
-
var
|
|
6778
|
-
var EffectStaffSelect = (0,
|
|
6848
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6849
|
+
var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
6779
6850
|
var _state_value_data, _state_value;
|
|
6780
6851
|
var onChange = props.onChange, deptId = props.deptId, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, placeholder = props.placeholder, style = props.style;
|
|
6781
|
-
var _ref = _sliced_to_array((0,
|
|
6782
|
-
var _ref1 = _sliced_to_array((0,
|
|
6852
|
+
var _ref = _sliced_to_array((0, import_react48.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
6853
|
+
var _ref1 = _sliced_to_array((0, import_react48.useState)(controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6783
6854
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6784
6855
|
var getBusinessOptions = function getBusinessOptions(businessName, currentDeptId) {
|
|
6785
6856
|
return _async_to_generator(function() {
|
|
@@ -6813,10 +6884,10 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6813
6884
|
deptId,
|
|
6814
6885
|
config
|
|
6815
6886
|
]), 2), state = _ref2[0], searchFetch = _ref2[1];
|
|
6816
|
-
var debounceSearchFetch = (0,
|
|
6887
|
+
var debounceSearchFetch = (0, import_react48.useCallback)((0, import_tools11.debounce)(600, searchFetch), [
|
|
6817
6888
|
searchFetch
|
|
6818
6889
|
]);
|
|
6819
|
-
(0,
|
|
6890
|
+
(0, import_react48.useEffect)(function() {
|
|
6820
6891
|
var _state_value_data, _state_value;
|
|
6821
6892
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : (_state_value_data = _state_value.data) === null || _state_value_data === void 0 ? void 0 : _state_value_data.list)) {
|
|
6822
6893
|
return;
|
|
@@ -6871,7 +6942,7 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6871
6942
|
}
|
|
6872
6943
|
};
|
|
6873
6944
|
var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
6945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_antd36.Select, {
|
|
6875
6946
|
className: (0, import_classnames13.default)(index_module_default18.select, className),
|
|
6876
6947
|
style: style,
|
|
6877
6948
|
notFoundContent: state.loading ? "\u641C\u7D22\u4E2D" : ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : (_state_value_data = _state_value.data) === null || _state_value_data === void 0 ? void 0 : _state_value_data.total) === 0 ? "\u6682\u65E0\u6570\u636E" : defaultPlaceholder,
|
|
@@ -6890,14 +6961,14 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6890
6961
|
});
|
|
6891
6962
|
});
|
|
6892
6963
|
// src/EffectReservoirSelect/EffectReservoirSelect.tsx
|
|
6893
|
-
var
|
|
6964
|
+
var import_react49 = require("react");
|
|
6894
6965
|
var import_react_use18 = require("react-use");
|
|
6895
|
-
var
|
|
6896
|
-
var
|
|
6897
|
-
var EffectReservoirSelect = (0,
|
|
6966
|
+
var import_antd37 = require("antd");
|
|
6967
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6968
|
+
var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
6898
6969
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, _props_reservoirType = props.reservoirType, reservoirType = _props_reservoirType === void 0 ? "normal" : _props_reservoirType;
|
|
6899
|
-
var _ref = _sliced_to_array((0,
|
|
6900
|
-
var _ref1 = _sliced_to_array((0,
|
|
6970
|
+
var _ref = _sliced_to_array((0, import_react49.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
6971
|
+
var _ref1 = _sliced_to_array((0, import_react49.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6901
6972
|
var prevControlValue = (0, import_react_use18.usePrevious)(controlValue);
|
|
6902
6973
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6903
6974
|
var get_reservoir_options = function get_reservoir_options() {
|
|
@@ -6930,7 +7001,7 @@ var EffectReservoirSelect = (0, import_react48.memo)(function(props) {
|
|
|
6930
7001
|
var _ref2 = _sliced_to_array((0, import_react_use18.useAsyncFn)(get_reservoir_options, [
|
|
6931
7002
|
warehouseId
|
|
6932
7003
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
6933
|
-
(0,
|
|
7004
|
+
(0, import_react49.useEffect)(function() {
|
|
6934
7005
|
var _state_value;
|
|
6935
7006
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
6936
7007
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -6981,20 +7052,20 @@ var EffectReservoirSelect = (0, import_react48.memo)(function(props) {
|
|
|
6981
7052
|
onChange: handleOnChange,
|
|
6982
7053
|
loading: state.loading
|
|
6983
7054
|
};
|
|
6984
|
-
return /* @__PURE__ */ (0,
|
|
7055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_antd37.Select, _object_spread({
|
|
6985
7056
|
className: className
|
|
6986
7057
|
}, selectBrandProps));
|
|
6987
7058
|
});
|
|
6988
7059
|
// src/EffectReservoirSelect/EffectShelveSelect.tsx
|
|
6989
|
-
var
|
|
7060
|
+
var import_react50 = require("react");
|
|
6990
7061
|
var import_react_use19 = require("react-use");
|
|
6991
|
-
var
|
|
6992
|
-
var
|
|
6993
|
-
var EffectShelveSelect = (0,
|
|
7062
|
+
var import_antd38 = require("antd");
|
|
7063
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7064
|
+
var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
6994
7065
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
|
|
6995
7066
|
var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
|
|
6996
|
-
var _ref = _sliced_to_array((0,
|
|
6997
|
-
var _ref1 = _sliced_to_array((0,
|
|
7067
|
+
var _ref = _sliced_to_array((0, import_react50.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
7068
|
+
var _ref1 = _sliced_to_array((0, import_react50.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6998
7069
|
var prevControlValue = (0, import_react_use19.usePrevious)(controlValue);
|
|
6999
7070
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7000
7071
|
var get_shelve_options = function get_shelve_options() {
|
|
@@ -7028,7 +7099,7 @@ var EffectShelveSelect = (0, import_react49.memo)(function(props) {
|
|
|
7028
7099
|
reservoirId,
|
|
7029
7100
|
warehouseId
|
|
7030
7101
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
7031
|
-
(0,
|
|
7102
|
+
(0, import_react50.useEffect)(function() {
|
|
7032
7103
|
var _state_value;
|
|
7033
7104
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7034
7105
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -7081,14 +7152,14 @@ var EffectShelveSelect = (0, import_react49.memo)(function(props) {
|
|
|
7081
7152
|
onChange: handleOnChange,
|
|
7082
7153
|
loading: state.loading
|
|
7083
7154
|
};
|
|
7084
|
-
return /* @__PURE__ */ (0,
|
|
7155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd38.Select, _object_spread({
|
|
7085
7156
|
className: className
|
|
7086
7157
|
}, selectBrandProps));
|
|
7087
7158
|
});
|
|
7088
7159
|
// src/EffectWarehouseSelect/index.tsx
|
|
7089
|
-
var
|
|
7160
|
+
var import_antd39 = require("antd");
|
|
7090
7161
|
var import_classnames14 = __toESM(require("classnames"));
|
|
7091
|
-
var
|
|
7162
|
+
var import_react51 = require("react");
|
|
7092
7163
|
// src/EffectWarehouseSelect/useStoreOptions.ts
|
|
7093
7164
|
var import_immutable7 = __toESM(require("swr/immutable"));
|
|
7094
7165
|
var transformStoreData = function transformStoreData() {
|
|
@@ -7151,8 +7222,8 @@ var index_module_default19 = {
|
|
|
7151
7222
|
select: "index_module_select5"
|
|
7152
7223
|
};
|
|
7153
7224
|
// src/EffectWarehouseSelect/index.tsx
|
|
7154
|
-
var
|
|
7155
|
-
var EffectWarehouseSelect = (0,
|
|
7225
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7226
|
+
var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
|
|
7156
7227
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, _props_currentMerchantOnly = props.currentMerchantOnly, currentMerchantOnly = _props_currentMerchantOnly === void 0 ? true : _props_currentMerchantOnly, warehouseType = props.warehouseType;
|
|
7157
7228
|
var state = useStoreOptions(currentMerchantOnly, warehouseType);
|
|
7158
7229
|
var handleChange = function handleChange(selectedValue, option) {
|
|
@@ -7162,7 +7233,7 @@ var EffectWarehouseSelect = (0, import_react50.memo)(function(props) {
|
|
|
7162
7233
|
var handleClear = function handleClear() {
|
|
7163
7234
|
onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
|
|
7164
7235
|
};
|
|
7165
|
-
return /* @__PURE__ */ (0,
|
|
7236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd39.Select, {
|
|
7166
7237
|
className: (0, import_classnames14.default)(index_module_default19.select, className),
|
|
7167
7238
|
placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
|
|
7168
7239
|
notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
|
|
@@ -7175,7 +7246,7 @@ var EffectWarehouseSelect = (0, import_react50.memo)(function(props) {
|
|
|
7175
7246
|
});
|
|
7176
7247
|
});
|
|
7177
7248
|
// src/EffectAddressCascade/index.tsx
|
|
7178
|
-
var
|
|
7249
|
+
var import_react52 = require("react");
|
|
7179
7250
|
var import_react_use20 = require("react-use");
|
|
7180
7251
|
var import_classnames15 = __toESM(require("classnames"));
|
|
7181
7252
|
// src/EffectAddressCascade/index.module.less
|
|
@@ -7184,13 +7255,13 @@ var index_module_default20 = {
|
|
|
7184
7255
|
select: "index_module_select6"
|
|
7185
7256
|
};
|
|
7186
7257
|
// src/EffectAddressCascade/index.tsx
|
|
7187
|
-
var
|
|
7188
|
-
var
|
|
7189
|
-
var EffectAddressCascade = (0,
|
|
7258
|
+
var import_antd40 = require("antd");
|
|
7259
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7260
|
+
var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
7190
7261
|
var _selectedList_;
|
|
7191
7262
|
var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
|
|
7192
|
-
var _ref = _sliced_to_array((0,
|
|
7193
|
-
var _ref1 = _sliced_to_array((0,
|
|
7263
|
+
var _ref = _sliced_to_array((0, import_react52.useState)(), 2), selectedList = _ref[0], setSelectedList = _ref[1];
|
|
7264
|
+
var _ref1 = _sliced_to_array((0, import_react52.useState)(), 2), customTree = _ref1[0], setCustomTree = _ref1[1];
|
|
7194
7265
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7195
7266
|
var params = {
|
|
7196
7267
|
pid: (selectedList === null || selectedList === void 0 ? void 0 : (_selectedList_ = selectedList[(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length) - 1]) === null || _selectedList_ === void 0 ? void 0 : _selectedList_.value) || ""
|
|
@@ -7216,7 +7287,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7216
7287
|
var _ref2 = _sliced_to_array((0, import_react_use20.useAsyncFn)(getAddress, [
|
|
7217
7288
|
selectedList
|
|
7218
7289
|
]), 2), state = _ref2[0], getAddressFetch = _ref2[1];
|
|
7219
|
-
(0,
|
|
7290
|
+
(0, import_react52.useEffect)(function() {
|
|
7220
7291
|
var _state_value;
|
|
7221
7292
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7222
7293
|
var list = state.value.data.list;
|
|
@@ -7254,7 +7325,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7254
7325
|
}, [
|
|
7255
7326
|
state
|
|
7256
7327
|
]);
|
|
7257
|
-
(0,
|
|
7328
|
+
(0, import_react52.useEffect)(function() {
|
|
7258
7329
|
if (!state.loading || !customTree || !selectedList) return;
|
|
7259
7330
|
var target = findTargetLeaf(selectedList, customTree);
|
|
7260
7331
|
if (!target) return;
|
|
@@ -7266,7 +7337,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7266
7337
|
(0, import_react_use20.useMount)(function() {
|
|
7267
7338
|
void getAddressFetch();
|
|
7268
7339
|
});
|
|
7269
|
-
(0,
|
|
7340
|
+
(0, import_react52.useEffect)(function() {
|
|
7270
7341
|
var target = findTargetLeaf(selectedList || [], customTree || []);
|
|
7271
7342
|
if ((target === null || target === void 0 ? void 0 : target.isLeaf) || !(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length)) return;
|
|
7272
7343
|
void getAddressFetch();
|
|
@@ -7282,7 +7353,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7282
7353
|
setSelectedList(_selectedList);
|
|
7283
7354
|
if (onChange) onChange(_selectedList);
|
|
7284
7355
|
};
|
|
7285
|
-
return /* @__PURE__ */ (0,
|
|
7356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd40.Cascader, {
|
|
7286
7357
|
className: (0, import_classnames15.default)(index_module_default20.input, className),
|
|
7287
7358
|
disabled: disabled,
|
|
7288
7359
|
defaultValue: defaultValue,
|
|
@@ -7317,7 +7388,7 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
|
|
|
7317
7388
|
});
|
|
7318
7389
|
};
|
|
7319
7390
|
// src/EffectLabelSelect/index.tsx
|
|
7320
|
-
var
|
|
7391
|
+
var import_react53 = require("react");
|
|
7321
7392
|
var import_react_use22 = require("react-use");
|
|
7322
7393
|
var import_classnames16 = __toESM(require("classnames"));
|
|
7323
7394
|
// src/EffectLabelSelect/hooks.ts
|
|
@@ -7366,28 +7437,28 @@ var index_module_default21 = {
|
|
|
7366
7437
|
select: "index_module_select7"
|
|
7367
7438
|
};
|
|
7368
7439
|
// src/EffectLabelSelect/index.tsx
|
|
7369
|
-
var
|
|
7370
|
-
var
|
|
7371
|
-
var EffectLabelSelect = (0,
|
|
7440
|
+
var import_antd41 = require("antd");
|
|
7441
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7442
|
+
var EffectLabelSelect = (0, import_react53.memo)(function(props) {
|
|
7372
7443
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, defaultLabel = props.defaultLabel, _props_labelDic = props.labelDic, labelDic = _props_labelDic === void 0 ? defaultLabelDic : _props_labelDic, onFetchData = props.onFetchData, _props_onTransformData = props.onTransformData, onTransformData = _props_onTransformData === void 0 ? defaultTransformDataFn : _props_onTransformData, _props_fetchParams = props.fetchParams, fetchParams = _props_fetchParams === void 0 ? {} : _props_fetchParams, _props_customLabelInValue = props.customLabelInValue, customLabelInValue = _props_customLabelInValue === void 0 ? false : _props_customLabelInValue, optionsDisplayType = props.optionsDisplayType, style = props.style;
|
|
7373
7444
|
var apiService = useRequestConfig().apiService;
|
|
7374
|
-
var _ref = _sliced_to_array((0,
|
|
7445
|
+
var _ref = _sliced_to_array((0, import_react53.useState)(function() {
|
|
7375
7446
|
var _transformObj2Options_, _transformObj2Options;
|
|
7376
7447
|
var defaultLabelFromValue = customLabelInValue ? getSelectValue(value, "labelDicKey") : "";
|
|
7377
7448
|
var defaultLabelFromLabelDic = transformObj2Options === null || transformObj2Options === void 0 ? void 0 : (_transformObj2Options = transformObj2Options(labelDic)) === null || _transformObj2Options === void 0 ? void 0 : (_transformObj2Options_ = _transformObj2Options[0]) === null || _transformObj2Options_ === void 0 ? void 0 : _transformObj2Options_.value;
|
|
7378
7449
|
return defaultLabel || defaultLabelFromValue || defaultLabelFromLabelDic || "";
|
|
7379
7450
|
}), 2), curSelectLabel = _ref[0], setCurSelectLabel = _ref[1];
|
|
7380
|
-
var _ref1 = _sliced_to_array((0,
|
|
7381
|
-
var _ref2 = _sliced_to_array((0,
|
|
7382
|
-
var _ref3 = _sliced_to_array((0,
|
|
7383
|
-
var _ref4 = _sliced_to_array((0,
|
|
7451
|
+
var _ref1 = _sliced_to_array((0, import_react53.useState)(value !== null && value !== void 0 ? value : void 0), 2), curSelectValue = _ref1[0], setCurSelectValue = _ref1[1];
|
|
7452
|
+
var _ref2 = _sliced_to_array((0, import_react53.useState)(), 2), curSelectItem = _ref2[0], setCurSelectItem = _ref2[1];
|
|
7453
|
+
var _ref3 = _sliced_to_array((0, import_react53.useState)(), 2), curSearchValue = _ref3[0], setCurSearchValue = _ref3[1];
|
|
7454
|
+
var _ref4 = _sliced_to_array((0, import_react53.useState)([]), 2), optionsData = _ref4[0], setOptionsData = _ref4[1];
|
|
7384
7455
|
var fetchDataFn = onFetchData || apiService.merchantList;
|
|
7385
7456
|
var fetchDataDeps = _object_spread_props(_object_spread({}, fetchParams), _define_property({}, curSelectLabel, curSearchValue || void 0));
|
|
7386
7457
|
var _useReqData = _sliced_to_array(useReqData(fetchDataFn, _object_spread({
|
|
7387
7458
|
page: 1,
|
|
7388
7459
|
pageSize: 20
|
|
7389
7460
|
}, fetchDataDeps), JSON.stringify(fetchDataDeps)), 1), resState = _useReqData[0];
|
|
7390
|
-
(0,
|
|
7461
|
+
(0, import_react53.useEffect)(function() {
|
|
7391
7462
|
var _resState_value;
|
|
7392
7463
|
if (resState.loading || !((_resState_value = resState.value) === null || _resState_value === void 0 ? void 0 : _resState_value.data.list)) return;
|
|
7393
7464
|
var optionsData2 = resState.value.data.list.map(onTransformData);
|
|
@@ -7457,12 +7528,12 @@ var EffectLabelSelect = (0, import_react52.memo)(function(props) {
|
|
|
7457
7528
|
filterOption: false,
|
|
7458
7529
|
popupMatchSelectWidth: false
|
|
7459
7530
|
};
|
|
7460
|
-
return /* @__PURE__ */ (0,
|
|
7531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_antd41.Space.Compact, {
|
|
7461
7532
|
className: index_module_default21.select_wrap,
|
|
7462
7533
|
style: style,
|
|
7463
7534
|
children: [
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7465
|
-
/* @__PURE__ */ (0,
|
|
7535
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd41.Select, _object_spread({}, selectLabelProps)),
|
|
7536
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd41.Select, _object_spread({}, selectValueProps))
|
|
7466
7537
|
]
|
|
7467
7538
|
});
|
|
7468
7539
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -4677,7 +4677,7 @@ var EffectSkuSelect = memo24(function(props) {
|
|
|
4677
4677
|
state,
|
|
4678
4678
|
options
|
|
4679
4679
|
]);
|
|
4680
|
-
var
|
|
4680
|
+
var popupRender = useCallback17(function(_menu) {
|
|
4681
4681
|
return /* @__PURE__ */ jsx34(SelectDropdown, {
|
|
4682
4682
|
value: value,
|
|
4683
4683
|
options: options,
|
|
@@ -4709,8 +4709,8 @@ var EffectSkuSelect = memo24(function(props) {
|
|
|
4709
4709
|
onSearch: handleOnSearch,
|
|
4710
4710
|
onClear: handleOnClear,
|
|
4711
4711
|
open: openDropDown,
|
|
4712
|
-
|
|
4713
|
-
|
|
4712
|
+
popupRender: popupRender,
|
|
4713
|
+
onOpenChange: setOpenDropDown,
|
|
4714
4714
|
getPopupContainer: function getPopupContainer() {
|
|
4715
4715
|
return document.body;
|
|
4716
4716
|
}
|
|
@@ -5167,7 +5167,7 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5167
5167
|
options,
|
|
5168
5168
|
brandId
|
|
5169
5169
|
]);
|
|
5170
|
-
var
|
|
5170
|
+
var popupRender = useCallback19(function(_menu) {
|
|
5171
5171
|
return /* @__PURE__ */ jsx36(SelectDropdown, {
|
|
5172
5172
|
value: value,
|
|
5173
5173
|
options: options,
|
|
@@ -5200,8 +5200,8 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5200
5200
|
onSearch: handleOnSearch,
|
|
5201
5201
|
onClear: handleOnClear,
|
|
5202
5202
|
open: openDropDown,
|
|
5203
|
-
|
|
5204
|
-
|
|
5203
|
+
popupRender: popupRender,
|
|
5204
|
+
onOpenChange: setOpenDropDown,
|
|
5205
5205
|
getPopupContainer: function getPopupContainer() {
|
|
5206
5206
|
return document.body;
|
|
5207
5207
|
}
|
|
@@ -5433,7 +5433,7 @@ var EffectSpuSelect = memo27(function(props) {
|
|
|
5433
5433
|
state,
|
|
5434
5434
|
options
|
|
5435
5435
|
]);
|
|
5436
|
-
var
|
|
5436
|
+
var popupRender = useCallback20(function(_menu) {
|
|
5437
5437
|
return /* @__PURE__ */ jsx37(SelectDropdown, {
|
|
5438
5438
|
value: value,
|
|
5439
5439
|
options: options,
|
|
@@ -5465,8 +5465,8 @@ var EffectSpuSelect = memo27(function(props) {
|
|
|
5465
5465
|
onSearch: handleOnSearch,
|
|
5466
5466
|
onClear: handleOnClear,
|
|
5467
5467
|
open: openDropDown,
|
|
5468
|
-
|
|
5469
|
-
|
|
5468
|
+
popupRender: popupRender,
|
|
5469
|
+
onOpenChange: setOpenDropDown,
|
|
5470
5470
|
getPopupContainer: function getPopupContainer() {
|
|
5471
5471
|
return document.body;
|
|
5472
5472
|
}
|
|
@@ -6252,10 +6252,78 @@ var EffectMerchantSelect = memo31(function(props) {
|
|
|
6252
6252
|
});
|
|
6253
6253
|
});
|
|
6254
6254
|
// src/EffectScopeSelect/index.tsx
|
|
6255
|
-
import { memo as
|
|
6256
|
-
import { Flex as Flex3, Space as
|
|
6255
|
+
import { memo as memo33, useCallback as useCallback23, useMemo as useMemo18, useState as useState26 } from "react";
|
|
6256
|
+
import { Flex as Flex3, Space as Space4 } from "antd";
|
|
6257
6257
|
import { useUpdateEffect as useUpdateEffect14 } from "react-use";
|
|
6258
|
+
// src/EffectScopeSelect/ScopeViewMode.tsx
|
|
6259
|
+
import { memo as memo32 } from "react";
|
|
6260
|
+
import { Space as Space3, Typography as Typography6 } from "antd";
|
|
6258
6261
|
import { jsx as jsx42, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6262
|
+
var ScopeViewMode = memo32(function(props) {
|
|
6263
|
+
var _ref = props || {}, categoryIds = _ref.categoryIds, categoryName = _ref.categoryName, brandId = _ref.brandId, brandName = _ref.brandName, seriesId = _ref.seriesId, seriesName = _ref.seriesName, spuId = _ref.spuId, spuName = _ref.spuName, skuId = _ref.skuId, skuName = _ref.skuName;
|
|
6264
|
+
var items = [];
|
|
6265
|
+
if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
|
|
6266
|
+
label: "\u5206\u7C7B",
|
|
6267
|
+
value: (categoryName === null || categoryName === void 0 ? void 0 : categoryName.join("/")) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.join(","))
|
|
6268
|
+
});
|
|
6269
|
+
if (brandName || brandId) items.push({
|
|
6270
|
+
label: "\u54C1\u724C",
|
|
6271
|
+
value: brandName || String(brandId)
|
|
6272
|
+
});
|
|
6273
|
+
if (seriesName || seriesId) items.push({
|
|
6274
|
+
label: "\u7CFB\u5217",
|
|
6275
|
+
value: seriesName || String(seriesId)
|
|
6276
|
+
});
|
|
6277
|
+
if (spuName || spuId) items.push({
|
|
6278
|
+
label: "SPU",
|
|
6279
|
+
value: spuName || String(spuId)
|
|
6280
|
+
});
|
|
6281
|
+
if (skuName || skuId) items.push({
|
|
6282
|
+
label: "SKU",
|
|
6283
|
+
value: skuName || String(skuId)
|
|
6284
|
+
});
|
|
6285
|
+
if (items.length === 0) return /* @__PURE__ */ jsx42(Typography6.Text, {
|
|
6286
|
+
style: {
|
|
6287
|
+
fontSize: 14
|
|
6288
|
+
},
|
|
6289
|
+
type: "danger",
|
|
6290
|
+
children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
|
|
6291
|
+
});
|
|
6292
|
+
return /* @__PURE__ */ jsx42(Space3, {
|
|
6293
|
+
size: 4,
|
|
6294
|
+
children: items.map(function(param) {
|
|
6295
|
+
var label = param.label, value = param.value;
|
|
6296
|
+
return /* @__PURE__ */ jsxs19(Space3, {
|
|
6297
|
+
size: 4,
|
|
6298
|
+
style: {
|
|
6299
|
+
height: 32,
|
|
6300
|
+
padding: "0 36px 0 14px",
|
|
6301
|
+
borderRadius: 6
|
|
6302
|
+
},
|
|
6303
|
+
children: [
|
|
6304
|
+
/* @__PURE__ */ jsxs19(Typography6.Text, {
|
|
6305
|
+
style: {
|
|
6306
|
+
fontSize: 14,
|
|
6307
|
+
paddingRight: 16
|
|
6308
|
+
},
|
|
6309
|
+
children: [
|
|
6310
|
+
label,
|
|
6311
|
+
":"
|
|
6312
|
+
]
|
|
6313
|
+
}),
|
|
6314
|
+
/* @__PURE__ */ jsx42(Typography6.Text, {
|
|
6315
|
+
style: {
|
|
6316
|
+
fontSize: 14
|
|
6317
|
+
},
|
|
6318
|
+
children: value
|
|
6319
|
+
})
|
|
6320
|
+
]
|
|
6321
|
+
}, label);
|
|
6322
|
+
})
|
|
6323
|
+
});
|
|
6324
|
+
});
|
|
6325
|
+
// src/EffectScopeSelect/index.tsx
|
|
6326
|
+
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6259
6327
|
var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
6260
6328
|
ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
|
|
6261
6329
|
ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
|
|
@@ -6264,8 +6332,8 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
|
6264
6332
|
ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
|
|
6265
6333
|
return ScopeLevelEnum2;
|
|
6266
6334
|
}(ScopeLevelEnum || {});
|
|
6267
|
-
var EffectScopeSelect =
|
|
6268
|
-
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange;
|
|
6335
|
+
var EffectScopeSelect = memo33(function(props) {
|
|
6336
|
+
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange, _props_mode = props.mode, mode = _props_mode === void 0 ? "edit" : _props_mode;
|
|
6269
6337
|
var _useState26 = _sliced_to_array(useState26(_object_spread({}, controlledValue, defaultValue)), 2), value = _useState26[0], setValue = _useState26[1];
|
|
6270
6338
|
var lastLevelCategoryId = useMemo18(function() {
|
|
6271
6339
|
var _value_categoryIds;
|
|
@@ -6371,17 +6439,17 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6371
6439
|
requireLevel
|
|
6372
6440
|
]);
|
|
6373
6441
|
var renderLabel = useCallback23(function(label, required) {
|
|
6374
|
-
return /* @__PURE__ */
|
|
6442
|
+
return /* @__PURE__ */ jsx43(Flex3, {
|
|
6375
6443
|
flex: "0 0 auto",
|
|
6376
|
-
children: /* @__PURE__ */
|
|
6444
|
+
children: /* @__PURE__ */ jsxs20(Space4, {
|
|
6377
6445
|
children: [
|
|
6378
|
-
required && /* @__PURE__ */
|
|
6446
|
+
required && /* @__PURE__ */ jsx43("span", {
|
|
6379
6447
|
style: {
|
|
6380
6448
|
color: "var(--ant-color-error)"
|
|
6381
6449
|
},
|
|
6382
6450
|
children: "*"
|
|
6383
6451
|
}),
|
|
6384
|
-
/* @__PURE__ */
|
|
6452
|
+
/* @__PURE__ */ jsxs20("span", {
|
|
6385
6453
|
children: [
|
|
6386
6454
|
label,
|
|
6387
6455
|
":"
|
|
@@ -6391,32 +6459,35 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6391
6459
|
})
|
|
6392
6460
|
});
|
|
6393
6461
|
}, []);
|
|
6394
|
-
|
|
6462
|
+
if (mode === "view") {
|
|
6463
|
+
return /* @__PURE__ */ jsx43(ScopeViewMode, _object_spread({}, value));
|
|
6464
|
+
}
|
|
6465
|
+
return /* @__PURE__ */ jsxs20(Flex3, {
|
|
6395
6466
|
justify: "flex-start",
|
|
6396
6467
|
align: "center",
|
|
6397
6468
|
wrap: "nowrap",
|
|
6398
6469
|
gap: "15px",
|
|
6399
6470
|
children: [
|
|
6400
|
-
/* @__PURE__ */
|
|
6471
|
+
/* @__PURE__ */ jsxs20(Flex3, {
|
|
6401
6472
|
align: "center",
|
|
6402
6473
|
gap: "5px",
|
|
6403
6474
|
flex: "0 0 auto",
|
|
6404
6475
|
children: [
|
|
6405
6476
|
renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
|
|
6406
|
-
/* @__PURE__ */
|
|
6477
|
+
/* @__PURE__ */ jsx43(EffectCategoryCascade, {
|
|
6407
6478
|
onChange: handleCategoryChange,
|
|
6408
6479
|
changeOnSelect: categoryChangeOnSelect,
|
|
6409
6480
|
value: value.categoryIds
|
|
6410
6481
|
})
|
|
6411
6482
|
]
|
|
6412
6483
|
}),
|
|
6413
|
-
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */
|
|
6484
|
+
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6414
6485
|
align: "center",
|
|
6415
6486
|
gap: "5px",
|
|
6416
6487
|
flex: "0 0 auto",
|
|
6417
6488
|
children: [
|
|
6418
6489
|
renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
|
|
6419
|
-
/* @__PURE__ */
|
|
6490
|
+
/* @__PURE__ */ jsx43(EffectBrandSelect, _object_spread_props(_object_spread({
|
|
6420
6491
|
categoryId: lastLevelCategoryId
|
|
6421
6492
|
}, value), {
|
|
6422
6493
|
onChange: handleBrandChange,
|
|
@@ -6424,13 +6495,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6424
6495
|
}))
|
|
6425
6496
|
]
|
|
6426
6497
|
}),
|
|
6427
|
-
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */
|
|
6498
|
+
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6428
6499
|
align: "center",
|
|
6429
6500
|
gap: "5px",
|
|
6430
6501
|
flex: "0 0 auto",
|
|
6431
6502
|
children: [
|
|
6432
6503
|
renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
|
|
6433
|
-
/* @__PURE__ */
|
|
6504
|
+
/* @__PURE__ */ jsx43(EffectSeriesSelect, _object_spread_props(_object_spread({
|
|
6434
6505
|
categoryId: lastLevelCategoryId
|
|
6435
6506
|
}, value), {
|
|
6436
6507
|
onChange: handleSeriesChange,
|
|
@@ -6438,13 +6509,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6438
6509
|
}))
|
|
6439
6510
|
]
|
|
6440
6511
|
}),
|
|
6441
|
-
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */
|
|
6512
|
+
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6442
6513
|
align: "center",
|
|
6443
6514
|
gap: "5px",
|
|
6444
6515
|
flex: "0 0 auto",
|
|
6445
6516
|
children: [
|
|
6446
6517
|
renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
|
|
6447
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx43(EffectSpuSelect, _object_spread_props(_object_spread({
|
|
6448
6519
|
categoryId: lastLevelCategoryId
|
|
6449
6520
|
}, value), {
|
|
6450
6521
|
onChange: handleSpuChange,
|
|
@@ -6452,13 +6523,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6452
6523
|
}))
|
|
6453
6524
|
]
|
|
6454
6525
|
}),
|
|
6455
|
-
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */
|
|
6526
|
+
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6456
6527
|
align: "center",
|
|
6457
6528
|
gap: "5px",
|
|
6458
6529
|
flex: "0 0 auto",
|
|
6459
6530
|
children: [
|
|
6460
6531
|
renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
|
|
6461
|
-
/* @__PURE__ */
|
|
6532
|
+
/* @__PURE__ */ jsx43(EffectSkuSelect, _object_spread_props(_object_spread({
|
|
6462
6533
|
categoryId: lastLevelCategoryId
|
|
6463
6534
|
}, value), {
|
|
6464
6535
|
onChange: handleSkuChange,
|
|
@@ -6470,7 +6541,7 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6470
6541
|
});
|
|
6471
6542
|
});
|
|
6472
6543
|
// src/EffectStaffSelect/index.tsx
|
|
6473
|
-
import { memo as
|
|
6544
|
+
import { memo as memo34, useCallback as useCallback24, useEffect as useEffect22, useState as useState27 } from "react";
|
|
6474
6545
|
import { useAsyncFn as useAsyncFn4, useMount as useMount5, useUpdateEffect as useUpdateEffect15 } from "react-use";
|
|
6475
6546
|
import classnames12 from "classnames";
|
|
6476
6547
|
import { Select as Select8 } from "antd";
|
|
@@ -6480,8 +6551,8 @@ var index_module_default18 = {
|
|
|
6480
6551
|
select: "index_module_select4"
|
|
6481
6552
|
};
|
|
6482
6553
|
// src/EffectStaffSelect/index.tsx
|
|
6483
|
-
import { jsx as
|
|
6484
|
-
var EffectStaffSelect =
|
|
6554
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
6555
|
+
var EffectStaffSelect = memo34(function(props) {
|
|
6485
6556
|
var _state_value_data, _state_value;
|
|
6486
6557
|
var onChange = props.onChange, deptId = props.deptId, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, placeholder = props.placeholder, style = props.style;
|
|
6487
6558
|
var _useState27 = _sliced_to_array(useState27([]), 2), options = _useState27[0], setOptions = _useState27[1];
|
|
@@ -6577,7 +6648,7 @@ var EffectStaffSelect = memo33(function(props) {
|
|
|
6577
6648
|
}
|
|
6578
6649
|
};
|
|
6579
6650
|
var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
|
|
6580
|
-
return /* @__PURE__ */
|
|
6651
|
+
return /* @__PURE__ */ jsx44(Select8, {
|
|
6581
6652
|
className: classnames12(index_module_default18.select, className),
|
|
6582
6653
|
style: style,
|
|
6583
6654
|
notFoundContent: state.loading ? "\u641C\u7D22\u4E2D" : ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : (_state_value_data = _state_value.data) === null || _state_value_data === void 0 ? void 0 : _state_value_data.total) === 0 ? "\u6682\u65E0\u6570\u636E" : defaultPlaceholder,
|
|
@@ -6596,11 +6667,11 @@ var EffectStaffSelect = memo33(function(props) {
|
|
|
6596
6667
|
});
|
|
6597
6668
|
});
|
|
6598
6669
|
// src/EffectReservoirSelect/EffectReservoirSelect.tsx
|
|
6599
|
-
import { memo as
|
|
6670
|
+
import { memo as memo35, useEffect as useEffect23, useState as useState28 } from "react";
|
|
6600
6671
|
import { useAsyncFn as useAsyncFn5, useMount as useMount6, usePrevious as usePrevious7, useUpdateEffect as useUpdateEffect16 } from "react-use";
|
|
6601
6672
|
import { Select as Select9 } from "antd";
|
|
6602
|
-
import { jsx as
|
|
6603
|
-
var EffectReservoirSelect =
|
|
6673
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6674
|
+
var EffectReservoirSelect = memo35(function(props) {
|
|
6604
6675
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, _props_reservoirType = props.reservoirType, reservoirType = _props_reservoirType === void 0 ? "normal" : _props_reservoirType;
|
|
6605
6676
|
var _useState28 = _sliced_to_array(useState28([]), 2), options = _useState28[0], setOptions = _useState28[1];
|
|
6606
6677
|
var _useState281 = _sliced_to_array(useState28(controlValue || defaultValue), 2), value = _useState281[0], setValue = _useState281[1];
|
|
@@ -6687,16 +6758,16 @@ var EffectReservoirSelect = memo34(function(props) {
|
|
|
6687
6758
|
onChange: handleOnChange,
|
|
6688
6759
|
loading: state.loading
|
|
6689
6760
|
};
|
|
6690
|
-
return /* @__PURE__ */
|
|
6761
|
+
return /* @__PURE__ */ jsx45(Select9, _object_spread({
|
|
6691
6762
|
className: className
|
|
6692
6763
|
}, selectBrandProps));
|
|
6693
6764
|
});
|
|
6694
6765
|
// src/EffectReservoirSelect/EffectShelveSelect.tsx
|
|
6695
|
-
import { memo as
|
|
6766
|
+
import { memo as memo36, useEffect as useEffect24, useState as useState29 } from "react";
|
|
6696
6767
|
import { useAsyncFn as useAsyncFn6, useMount as useMount7, usePrevious as usePrevious8, useUpdateEffect as useUpdateEffect17 } from "react-use";
|
|
6697
6768
|
import { Select as Select10 } from "antd";
|
|
6698
|
-
import { jsx as
|
|
6699
|
-
var EffectShelveSelect =
|
|
6769
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
6770
|
+
var EffectShelveSelect = memo36(function(props) {
|
|
6700
6771
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
|
|
6701
6772
|
var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
|
|
6702
6773
|
var _useState29 = _sliced_to_array(useState29([]), 2), options = _useState29[0], setOptions = _useState29[1];
|
|
@@ -6787,14 +6858,14 @@ var EffectShelveSelect = memo35(function(props) {
|
|
|
6787
6858
|
onChange: handleOnChange,
|
|
6788
6859
|
loading: state.loading
|
|
6789
6860
|
};
|
|
6790
|
-
return /* @__PURE__ */
|
|
6861
|
+
return /* @__PURE__ */ jsx46(Select10, _object_spread({
|
|
6791
6862
|
className: className
|
|
6792
6863
|
}, selectBrandProps));
|
|
6793
6864
|
});
|
|
6794
6865
|
// src/EffectWarehouseSelect/index.tsx
|
|
6795
6866
|
import { Select as Select11 } from "antd";
|
|
6796
6867
|
import classnames13 from "classnames";
|
|
6797
|
-
import { memo as
|
|
6868
|
+
import { memo as memo37 } from "react";
|
|
6798
6869
|
// src/EffectWarehouseSelect/useStoreOptions.ts
|
|
6799
6870
|
import useSWRImmutable7 from "swr/immutable";
|
|
6800
6871
|
var transformStoreData = function transformStoreData() {
|
|
@@ -6857,8 +6928,8 @@ var index_module_default19 = {
|
|
|
6857
6928
|
select: "index_module_select5"
|
|
6858
6929
|
};
|
|
6859
6930
|
// src/EffectWarehouseSelect/index.tsx
|
|
6860
|
-
import { jsx as
|
|
6861
|
-
var EffectWarehouseSelect =
|
|
6931
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
6932
|
+
var EffectWarehouseSelect = memo37(function(props) {
|
|
6862
6933
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, _props_currentMerchantOnly = props.currentMerchantOnly, currentMerchantOnly = _props_currentMerchantOnly === void 0 ? true : _props_currentMerchantOnly, warehouseType = props.warehouseType;
|
|
6863
6934
|
var state = useStoreOptions(currentMerchantOnly, warehouseType);
|
|
6864
6935
|
var handleChange = function handleChange(selectedValue, option) {
|
|
@@ -6868,7 +6939,7 @@ var EffectWarehouseSelect = memo36(function(props) {
|
|
|
6868
6939
|
var handleClear = function handleClear() {
|
|
6869
6940
|
onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
|
|
6870
6941
|
};
|
|
6871
|
-
return /* @__PURE__ */
|
|
6942
|
+
return /* @__PURE__ */ jsx47(Select11, {
|
|
6872
6943
|
className: classnames13(index_module_default19.select, className),
|
|
6873
6944
|
placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
|
|
6874
6945
|
notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
|
|
@@ -6881,7 +6952,7 @@ var EffectWarehouseSelect = memo36(function(props) {
|
|
|
6881
6952
|
});
|
|
6882
6953
|
});
|
|
6883
6954
|
// src/EffectAddressCascade/index.tsx
|
|
6884
|
-
import { memo as
|
|
6955
|
+
import { memo as memo38, useEffect as useEffect25, useState as useState30 } from "react";
|
|
6885
6956
|
import { useAsyncFn as useAsyncFn7, useMount as useMount8 } from "react-use";
|
|
6886
6957
|
import classnames14 from "classnames";
|
|
6887
6958
|
// src/EffectAddressCascade/index.module.less
|
|
@@ -6891,8 +6962,8 @@ var index_module_default20 = {
|
|
|
6891
6962
|
};
|
|
6892
6963
|
// src/EffectAddressCascade/index.tsx
|
|
6893
6964
|
import { Cascader as Cascader2 } from "antd";
|
|
6894
|
-
import { jsx as
|
|
6895
|
-
var EffectAddressCascade =
|
|
6965
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
6966
|
+
var EffectAddressCascade = memo38(function(props) {
|
|
6896
6967
|
var _selectedList_;
|
|
6897
6968
|
var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
|
|
6898
6969
|
var _useState30 = _sliced_to_array(useState30(), 2), selectedList = _useState30[0], setSelectedList = _useState30[1];
|
|
@@ -6988,7 +7059,7 @@ var EffectAddressCascade = memo37(function(props) {
|
|
|
6988
7059
|
setSelectedList(_selectedList);
|
|
6989
7060
|
if (onChange) onChange(_selectedList);
|
|
6990
7061
|
};
|
|
6991
|
-
return /* @__PURE__ */
|
|
7062
|
+
return /* @__PURE__ */ jsx48(Cascader2, {
|
|
6992
7063
|
className: classnames14(index_module_default20.input, className),
|
|
6993
7064
|
disabled: disabled,
|
|
6994
7065
|
defaultValue: defaultValue,
|
|
@@ -7023,7 +7094,7 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
|
|
|
7023
7094
|
});
|
|
7024
7095
|
};
|
|
7025
7096
|
// src/EffectLabelSelect/index.tsx
|
|
7026
|
-
import { memo as
|
|
7097
|
+
import { memo as memo39, useEffect as useEffect26, useState as useState31 } from "react";
|
|
7027
7098
|
import { useUpdateEffect as useUpdateEffect18 } from "react-use";
|
|
7028
7099
|
import classnames15 from "classnames";
|
|
7029
7100
|
// src/EffectLabelSelect/hooks.ts
|
|
@@ -7072,9 +7143,9 @@ var index_module_default21 = {
|
|
|
7072
7143
|
select: "index_module_select7"
|
|
7073
7144
|
};
|
|
7074
7145
|
// src/EffectLabelSelect/index.tsx
|
|
7075
|
-
import { Select as Select12, Space as
|
|
7076
|
-
import { jsx as
|
|
7077
|
-
var EffectLabelSelect =
|
|
7146
|
+
import { Select as Select12, Space as Space5 } from "antd";
|
|
7147
|
+
import { jsx as jsx49, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7148
|
+
var EffectLabelSelect = memo39(function(props) {
|
|
7078
7149
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, defaultLabel = props.defaultLabel, _props_labelDic = props.labelDic, labelDic = _props_labelDic === void 0 ? defaultLabelDic : _props_labelDic, onFetchData = props.onFetchData, _props_onTransformData = props.onTransformData, onTransformData = _props_onTransformData === void 0 ? defaultTransformDataFn : _props_onTransformData, _props_fetchParams = props.fetchParams, fetchParams = _props_fetchParams === void 0 ? {} : _props_fetchParams, _props_customLabelInValue = props.customLabelInValue, customLabelInValue = _props_customLabelInValue === void 0 ? false : _props_customLabelInValue, optionsDisplayType = props.optionsDisplayType, style = props.style;
|
|
7079
7150
|
var apiService = useRequestConfig().apiService;
|
|
7080
7151
|
var _useState31 = _sliced_to_array(useState31(function() {
|
|
@@ -7163,12 +7234,12 @@ var EffectLabelSelect = memo38(function(props) {
|
|
|
7163
7234
|
filterOption: false,
|
|
7164
7235
|
popupMatchSelectWidth: false
|
|
7165
7236
|
};
|
|
7166
|
-
return /* @__PURE__ */
|
|
7237
|
+
return /* @__PURE__ */ jsxs21(Space5.Compact, {
|
|
7167
7238
|
className: index_module_default21.select_wrap,
|
|
7168
7239
|
style: style,
|
|
7169
7240
|
children: [
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
/* @__PURE__ */
|
|
7241
|
+
/* @__PURE__ */ jsx49(Select12, _object_spread({}, selectLabelProps)),
|
|
7242
|
+
/* @__PURE__ */ jsx49(Select12, _object_spread({}, selectValueProps))
|
|
7172
7243
|
]
|
|
7173
7244
|
});
|
|
7174
7245
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfe-repo/web-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.4",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"esbuild-plugin-less": "^1.3.9",
|
|
53
53
|
"eslint": "8.57.1",
|
|
54
54
|
"@xfe-repo/eslint-config": "1.6.0",
|
|
55
|
-
"@xfe-repo/typescript-config": "1.6.
|
|
55
|
+
"@xfe-repo/typescript-config": "1.6.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@ant-design/icons": "^5.0.0",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"react-dom": "18.2.0",
|
|
63
63
|
"react-use": "^17.5.1",
|
|
64
64
|
"swr": "^2.2.5",
|
|
65
|
-
"@xfe-repo/web-micro": "1.
|
|
66
|
-
"@xfe-repo/web-router": "1.6.
|
|
65
|
+
"@xfe-repo/web-micro": "1.7.0",
|
|
66
|
+
"@xfe-repo/web-router": "1.6.1",
|
|
67
67
|
"@xfe-repo/web-service": "1.6.0",
|
|
68
68
|
"@xfe-repo/web-utils": "1.6.0"
|
|
69
69
|
},
|