@sunggang/ui-lib 0.3.58 → 0.3.60
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/index.esm.css
CHANGED
|
@@ -1264,6 +1264,9 @@ video {
|
|
|
1264
1264
|
.gap-5 {
|
|
1265
1265
|
gap: 1.25rem;
|
|
1266
1266
|
}
|
|
1267
|
+
.gap-6 {
|
|
1268
|
+
gap: 1.5rem;
|
|
1269
|
+
}
|
|
1267
1270
|
.gap-8 {
|
|
1268
1271
|
gap: 2rem;
|
|
1269
1272
|
}
|
|
@@ -1587,6 +1590,10 @@ video {
|
|
|
1587
1590
|
--tw-bg-opacity: 1;
|
|
1588
1591
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));
|
|
1589
1592
|
}
|
|
1593
|
+
.bg-gray-50 {
|
|
1594
|
+
--tw-bg-opacity: 1;
|
|
1595
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
|
|
1596
|
+
}
|
|
1590
1597
|
.bg-gray-500 {
|
|
1591
1598
|
--tw-bg-opacity: 1;
|
|
1592
1599
|
background-color: rgb(107 114 128 / var(--tw-bg-opacity, 1));
|
|
@@ -1717,6 +1724,9 @@ video {
|
|
|
1717
1724
|
.p-6 {
|
|
1718
1725
|
padding: 1.5rem;
|
|
1719
1726
|
}
|
|
1727
|
+
.p-8 {
|
|
1728
|
+
padding: 2rem;
|
|
1729
|
+
}
|
|
1720
1730
|
.p-\[30px\] {
|
|
1721
1731
|
padding: 30px;
|
|
1722
1732
|
}
|
|
@@ -1835,8 +1845,8 @@ video {
|
|
|
1835
1845
|
.pt-1 {
|
|
1836
1846
|
padding-top: 0.25rem;
|
|
1837
1847
|
}
|
|
1838
|
-
.pt-
|
|
1839
|
-
padding-top: 0.
|
|
1848
|
+
.pt-3 {
|
|
1849
|
+
padding-top: 0.75rem;
|
|
1840
1850
|
}
|
|
1841
1851
|
.pt-4 {
|
|
1842
1852
|
padding-top: 1rem;
|
|
@@ -1997,6 +2007,10 @@ video {
|
|
|
1997
2007
|
--tw-text-opacity: 1;
|
|
1998
2008
|
color: rgb(119 119 119 / var(--tw-text-opacity, 1));
|
|
1999
2009
|
}
|
|
2010
|
+
.text-\[\#999999\] {
|
|
2011
|
+
--tw-text-opacity: 1;
|
|
2012
|
+
color: rgb(153 153 153 / var(--tw-text-opacity, 1));
|
|
2013
|
+
}
|
|
2000
2014
|
.text-\[\#B0B0B0\] {
|
|
2001
2015
|
--tw-text-opacity: 1;
|
|
2002
2016
|
color: rgb(176 176 176 / var(--tw-text-opacity, 1));
|
|
@@ -2013,6 +2027,10 @@ video {
|
|
|
2013
2027
|
--tw-text-opacity: 1;
|
|
2014
2028
|
color: rgb(239 85 51 / var(--tw-text-opacity, 1));
|
|
2015
2029
|
}
|
|
2030
|
+
.text-\[\#F24822\] {
|
|
2031
|
+
--tw-text-opacity: 1;
|
|
2032
|
+
color: rgb(242 72 34 / var(--tw-text-opacity, 1));
|
|
2033
|
+
}
|
|
2016
2034
|
.text-\[\#fff\] {
|
|
2017
2035
|
--tw-text-opacity: 1;
|
|
2018
2036
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
package/index.esm2.js
CHANGED
|
@@ -17772,54 +17772,64 @@ function _object_spread_props$l(target, source) {
|
|
|
17772
17772
|
return target;
|
|
17773
17773
|
}
|
|
17774
17774
|
var PrimaryDragDropImage = function(param) {
|
|
17775
|
-
var imageUrls = param.imageUrls, handleRemove = param.handleRemove, isDropDisabled = param.isDropDisabled;
|
|
17775
|
+
var imageUrls = param.imageUrls, handleRemove = param.handleRemove, isDropDisabled = param.isDropDisabled, _param_maxTotalImages = param.maxTotalImages, maxTotalImages = _param_maxTotalImages === void 0 ? 1 : _param_maxTotalImages, _param_showLimitWarning = param.showLimitWarning, showLimitWarning = _param_showLimitWarning === void 0 ? false : _param_showLimitWarning;
|
|
17776
17776
|
return /*#__PURE__*/ jsx(ConnectedDroppable, {
|
|
17777
17777
|
droppableId: "droppable-imageUrls",
|
|
17778
17778
|
direction: "horizontal",
|
|
17779
17779
|
isDropDisabled: isDropDisabled || false,
|
|
17780
17780
|
children: function(provided) {
|
|
17781
|
-
return /*#__PURE__*/
|
|
17781
|
+
return /*#__PURE__*/ jsxs("div", _object_spread_props$l(_object_spread$q({
|
|
17782
17782
|
ref: provided.innerRef
|
|
17783
17783
|
}, provided.droppableProps), {
|
|
17784
|
-
children:
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17784
|
+
children: [
|
|
17785
|
+
/*#__PURE__*/ jsxs("div", {
|
|
17786
|
+
className: "flex gap-6",
|
|
17787
|
+
children: [
|
|
17788
|
+
imageUrls.map(function(item, index) {
|
|
17789
|
+
return /*#__PURE__*/ jsx(PublicDraggable, {
|
|
17790
|
+
draggableId: String(item === null || item === void 0 ? void 0 : item.id),
|
|
17791
|
+
index: index,
|
|
17792
|
+
children: function(provided) {
|
|
17793
|
+
return /*#__PURE__*/ jsxs("div", _object_spread_props$l(_object_spread$q({
|
|
17794
|
+
ref: provided.innerRef
|
|
17795
|
+
}, provided.draggableProps, provided.dragHandleProps), {
|
|
17796
|
+
className: "w-[172px] rounded-lg relative p-2 bg-[#F1F1F1] border border-[#B8B8B8] shadow-[2px_6px_8px_0px_rgba(0,0,0,0.12)]",
|
|
17797
|
+
children: [
|
|
17798
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
17799
|
+
className: "absolute -right-0 -top-0 rounded-full z-10 text-black",
|
|
17800
|
+
icon: "carbon:close-filled",
|
|
17801
|
+
width: "30",
|
|
17802
|
+
height: "30",
|
|
17803
|
+
onClick: function() {
|
|
17804
|
+
return handleRemove(item);
|
|
17805
|
+
},
|
|
17806
|
+
style: {
|
|
17807
|
+
color: "white",
|
|
17808
|
+
backgroundColor: "black"
|
|
17809
|
+
}
|
|
17810
|
+
}),
|
|
17811
|
+
/*#__PURE__*/ jsx("img", {
|
|
17812
|
+
className: "w-[156px] h-[100px] object-cover",
|
|
17813
|
+
src: (item === null || item === void 0 ? void 0 : item.url) || (item === null || item === void 0 ? void 0 : item.preview),
|
|
17814
|
+
alt: ""
|
|
17815
|
+
})
|
|
17816
|
+
]
|
|
17817
|
+
}));
|
|
17818
|
+
}
|
|
17819
|
+
}, item === null || item === void 0 ? void 0 : item.id);
|
|
17820
|
+
}),
|
|
17821
|
+
provided.placeholder
|
|
17822
|
+
]
|
|
17823
|
+
}),
|
|
17824
|
+
showLimitWarning && /*#__PURE__*/ jsxs("div", {
|
|
17825
|
+
className: "pt-1 text-[#F24822] font-medium",
|
|
17826
|
+
children: [
|
|
17827
|
+
"註:已到達最大上傳量",
|
|
17828
|
+
maxTotalImages,
|
|
17829
|
+
"張,請刪除部分照片再上傳。"
|
|
17830
|
+
]
|
|
17831
|
+
})
|
|
17832
|
+
]
|
|
17823
17833
|
}));
|
|
17824
17834
|
}
|
|
17825
17835
|
});
|
|
@@ -18033,7 +18043,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
|
|
|
18033
18043
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$o(o, minLen);
|
|
18034
18044
|
}
|
|
18035
18045
|
var DropImage = function(param) {
|
|
18036
|
-
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls, _param_imageStyleType = param.imageStyleType, imageStyleType = _param_imageStyleType === void 0 ? "base" : _param_imageStyleType, _param_limitSize = param.limitSize, limitSize = _param_limitSize === void 0 ? 0 : _param_limitSize;
|
|
18046
|
+
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls, _param_imageStyleType = param.imageStyleType, imageStyleType = _param_imageStyleType === void 0 ? "base" : _param_imageStyleType, _param_limitSize = param.limitSize, limitSize = _param_limitSize === void 0 ? 0 : _param_limitSize, _param_maxFiles = param.maxFiles, maxFiles = _param_maxFiles === void 0 ? 10 : _param_maxFiles, _param_maxTotalImages = param.maxTotalImages, maxTotalImages = _param_maxTotalImages === void 0 ? 10 : _param_maxTotalImages;
|
|
18037
18047
|
var _useState = _sliced_to_array$l(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
18038
18048
|
var _useState1 = _sliced_to_array$l(useState(null), 2), uploadError = _useState1[0], setUploadError = _useState1[1];
|
|
18039
18049
|
useEffect(function() {
|
|
@@ -18043,6 +18053,12 @@ var DropImage = function(param) {
|
|
|
18043
18053
|
]);
|
|
18044
18054
|
var MAX_SIZE_5MB = 5 * 1024 * 1024;
|
|
18045
18055
|
var DEFAULT_IMAGE_SIZE_LIMIT_IN_BYTES = limitSize || MAX_SIZE_5MB;
|
|
18056
|
+
// 計算目前還能上傳多少張圖片
|
|
18057
|
+
var currentImageCount = (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) || 0;
|
|
18058
|
+
var remainingSlots = maxTotalImages - currentImageCount;
|
|
18059
|
+
var canUploadMore = remainingSlots > 0;
|
|
18060
|
+
// 動態調整 maxFiles,不能超過剩餘空間
|
|
18061
|
+
var dynamicMaxFiles = Math.min(maxFiles, remainingSlots);
|
|
18046
18062
|
var _useDropzone = useDropzone({
|
|
18047
18063
|
accept: {
|
|
18048
18064
|
"image/png": [
|
|
@@ -18053,10 +18069,66 @@ var DropImage = function(param) {
|
|
|
18053
18069
|
".jpeg"
|
|
18054
18070
|
]
|
|
18055
18071
|
},
|
|
18056
|
-
maxFiles:
|
|
18072
|
+
maxFiles: dynamicMaxFiles,
|
|
18057
18073
|
maxSize: DEFAULT_IMAGE_SIZE_LIMIT_IN_BYTES,
|
|
18074
|
+
disabled: !canUploadMore,
|
|
18058
18075
|
onDrop: function(dropFiles) {
|
|
18059
|
-
|
|
18076
|
+
if (!canUploadMore) {
|
|
18077
|
+
setUploadError(/*#__PURE__*/ jsx(ErrorContent, {
|
|
18078
|
+
setModal: function() {
|
|
18079
|
+
return setUploadError(null);
|
|
18080
|
+
},
|
|
18081
|
+
errmsg: /*#__PURE__*/ jsxs("div", {
|
|
18082
|
+
className: "text-center text-lg text-gray-500",
|
|
18083
|
+
children: [
|
|
18084
|
+
"已達到最大圖片數量限制:",
|
|
18085
|
+
maxTotalImages,
|
|
18086
|
+
" 張"
|
|
18087
|
+
]
|
|
18088
|
+
})
|
|
18089
|
+
}));
|
|
18090
|
+
return;
|
|
18091
|
+
}
|
|
18092
|
+
// 檢查是否會超過總數限制
|
|
18093
|
+
var totalAfterUpload = currentImageCount + dropFiles.length;
|
|
18094
|
+
if (totalAfterUpload > maxTotalImages) {
|
|
18095
|
+
var allowedFiles = dropFiles.slice(0, remainingSlots);
|
|
18096
|
+
setUploadError(/*#__PURE__*/ jsx(ErrorContent, {
|
|
18097
|
+
setModal: function() {
|
|
18098
|
+
return setUploadError(null);
|
|
18099
|
+
},
|
|
18100
|
+
errmsg: /*#__PURE__*/ jsxs("div", {
|
|
18101
|
+
className: "text-center text-lg text-gray-500",
|
|
18102
|
+
children: [
|
|
18103
|
+
"最多只能上傳 ",
|
|
18104
|
+
remainingSlots,
|
|
18105
|
+
" 張圖片,已自動限制為前",
|
|
18106
|
+
" ",
|
|
18107
|
+
allowedFiles.length,
|
|
18108
|
+
" 張"
|
|
18109
|
+
]
|
|
18110
|
+
})
|
|
18111
|
+
}));
|
|
18112
|
+
// 只處理允許的檔案數量
|
|
18113
|
+
var newFiles = [];
|
|
18114
|
+
setFiles(function(prevFiles) {
|
|
18115
|
+
return _to_consumable_array$8(prevFiles).concat(_to_consumable_array$8(allowedFiles));
|
|
18116
|
+
});
|
|
18117
|
+
allowedFiles.forEach(function(dropFile, index) {
|
|
18118
|
+
Object.assign(dropFile, {
|
|
18119
|
+
preview: URL.createObjectURL(dropFile),
|
|
18120
|
+
id: v4(),
|
|
18121
|
+
index: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) + index + 1
|
|
18122
|
+
});
|
|
18123
|
+
newFiles.push(dropFile);
|
|
18124
|
+
});
|
|
18125
|
+
setPreviewFiles(function(prev) {
|
|
18126
|
+
return _to_consumable_array$8(prev).concat(_to_consumable_array$8(newFiles));
|
|
18127
|
+
});
|
|
18128
|
+
return;
|
|
18129
|
+
}
|
|
18130
|
+
// 正常處理
|
|
18131
|
+
var newFiles1 = [];
|
|
18060
18132
|
setFiles(function(prevFiles) {
|
|
18061
18133
|
return _to_consumable_array$8(prevFiles).concat(_to_consumable_array$8(dropFiles));
|
|
18062
18134
|
});
|
|
@@ -18066,10 +18138,10 @@ var DropImage = function(param) {
|
|
|
18066
18138
|
id: v4(),
|
|
18067
18139
|
index: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) + index + 1
|
|
18068
18140
|
});
|
|
18069
|
-
|
|
18141
|
+
newFiles1.push(dropFile);
|
|
18070
18142
|
});
|
|
18071
18143
|
setPreviewFiles(function(prev) {
|
|
18072
|
-
return _to_consumable_array$8(prev).concat(_to_consumable_array$8(
|
|
18144
|
+
return _to_consumable_array$8(prev).concat(_to_consumable_array$8(newFiles1));
|
|
18073
18145
|
});
|
|
18074
18146
|
},
|
|
18075
18147
|
onDropRejected: function(rejectedFiles) {
|
|
@@ -18133,7 +18205,32 @@ var DropImage = function(param) {
|
|
|
18133
18205
|
/*#__PURE__*/ jsxs(DragDropContext, {
|
|
18134
18206
|
onDragEnd: onDragEnd,
|
|
18135
18207
|
children: [
|
|
18136
|
-
/*#__PURE__*/
|
|
18208
|
+
!canUploadMore && (imageStyleType === "base" || imageStyleType === "custom") ? /*#__PURE__*/ jsx("div", {
|
|
18209
|
+
className: "w-full mb-4",
|
|
18210
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
18211
|
+
className: "border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 p-8 text-center",
|
|
18212
|
+
children: [
|
|
18213
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
18214
|
+
icon: "material-symbols:block",
|
|
18215
|
+
width: "2.5rem",
|
|
18216
|
+
height: "2.5rem",
|
|
18217
|
+
className: "mx-auto mb-2 text-gray-400"
|
|
18218
|
+
}),
|
|
18219
|
+
/*#__PURE__*/ jsxs("p", {
|
|
18220
|
+
className: "text-gray-500",
|
|
18221
|
+
children: [
|
|
18222
|
+
"已達到最大圖片數量限制:",
|
|
18223
|
+
maxTotalImages,
|
|
18224
|
+
" 張"
|
|
18225
|
+
]
|
|
18226
|
+
}),
|
|
18227
|
+
/*#__PURE__*/ jsx("p", {
|
|
18228
|
+
className: "text-sm text-gray-400",
|
|
18229
|
+
children: "請刪除部分圖片後再上傳新的圖片"
|
|
18230
|
+
})
|
|
18231
|
+
]
|
|
18232
|
+
})
|
|
18233
|
+
}) : !canUploadMore && imageStyleType === "primary" ? null : /*#__PURE__*/ jsxs("div", _object_spread_props$k(_object_spread$p({}, getRootProps({
|
|
18137
18234
|
className: "dropzone"
|
|
18138
18235
|
})), {
|
|
18139
18236
|
children: [
|
|
@@ -18156,6 +18253,19 @@ var DropImage = function(param) {
|
|
|
18156
18253
|
className: "font-normal text-[#777777] pb-2 text-center",
|
|
18157
18254
|
children: "或用上傳按鈕選擇檔案"
|
|
18158
18255
|
}),
|
|
18256
|
+
/*#__PURE__*/ jsxs("div", {
|
|
18257
|
+
className: "font-normal text-xs text-[#999999] pb-2 text-center",
|
|
18258
|
+
children: [
|
|
18259
|
+
"(已上傳 ",
|
|
18260
|
+
currentImageCount,
|
|
18261
|
+
"/",
|
|
18262
|
+
maxTotalImages,
|
|
18263
|
+
"張,還可上傳",
|
|
18264
|
+
" ",
|
|
18265
|
+
remainingSlots,
|
|
18266
|
+
" 張)"
|
|
18267
|
+
]
|
|
18268
|
+
}),
|
|
18159
18269
|
/*#__PURE__*/ jsx("div", {
|
|
18160
18270
|
className: "flex justify-center",
|
|
18161
18271
|
children: /*#__PURE__*/ jsx("div", {
|
|
@@ -18188,6 +18298,19 @@ var DropImage = function(param) {
|
|
|
18188
18298
|
/*#__PURE__*/ jsx("h5", {
|
|
18189
18299
|
className: "mb-2 text-xl font-bold tracking-tight text-gray-700 pb-4",
|
|
18190
18300
|
children: "拖曳圖片至此"
|
|
18301
|
+
}),
|
|
18302
|
+
/*#__PURE__*/ jsxs("p", {
|
|
18303
|
+
className: "font-normal text-xs text-[#999999] pb-4",
|
|
18304
|
+
children: [
|
|
18305
|
+
"(已上傳 ",
|
|
18306
|
+
currentImageCount,
|
|
18307
|
+
"/",
|
|
18308
|
+
maxTotalImages,
|
|
18309
|
+
"張,還可上傳",
|
|
18310
|
+
" ",
|
|
18311
|
+
remainingSlots,
|
|
18312
|
+
" 張)"
|
|
18313
|
+
]
|
|
18191
18314
|
})
|
|
18192
18315
|
]
|
|
18193
18316
|
})
|
|
@@ -18198,7 +18321,7 @@ var DropImage = function(param) {
|
|
|
18198
18321
|
]
|
|
18199
18322
|
})),
|
|
18200
18323
|
preview && /*#__PURE__*/ jsxs("div", {
|
|
18201
|
-
className: "flex pt-
|
|
18324
|
+
className: "flex pt-3 overflow-auto",
|
|
18202
18325
|
children: [
|
|
18203
18326
|
imageStyleType === "base" && /*#__PURE__*/ jsx(DragDropImages, {
|
|
18204
18327
|
imageUrls: previewFiles,
|
|
@@ -18210,7 +18333,9 @@ var DropImage = function(param) {
|
|
|
18210
18333
|
}),
|
|
18211
18334
|
imageStyleType === "primary" && /*#__PURE__*/ jsx(PrimaryDragDropImage, {
|
|
18212
18335
|
imageUrls: previewFiles,
|
|
18213
|
-
handleRemove: handleRemove
|
|
18336
|
+
handleRemove: handleRemove,
|
|
18337
|
+
maxTotalImages: maxTotalImages,
|
|
18338
|
+
showLimitWarning: !canUploadMore
|
|
18214
18339
|
})
|
|
18215
18340
|
]
|
|
18216
18341
|
})
|
|
@@ -47635,7 +47760,7 @@ var DropdownList = function(param) {
|
|
|
47635
47760
|
});
|
|
47636
47761
|
}
|
|
47637
47762
|
}),
|
|
47638
|
-
/*#__PURE__*/ jsx("div", {
|
|
47763
|
+
(item === null || item === void 0 ? void 0 : item.hiddenText) ? null : /*#__PURE__*/ jsx("div", {
|
|
47639
47764
|
className: "inviable h-5 pt-1",
|
|
47640
47765
|
children: errors.funeralLocation && /*#__PURE__*/ jsx("p", {
|
|
47641
47766
|
className: "text-left text-xs text-[#EF5533]",
|
|
@@ -50195,11 +50320,11 @@ var FlatpickrInput = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
|
50195
50320
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none",
|
|
50196
50321
|
children: /*#__PURE__*/ jsx("span", {
|
|
50197
50322
|
className: "w-5 h-5 text-[#B4B4B4]",
|
|
50198
|
-
children:
|
|
50199
|
-
|
|
50200
|
-
|
|
50201
|
-
|
|
50202
|
-
})
|
|
50323
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
50324
|
+
icon: item.icon || "solar:calendar-linear",
|
|
50325
|
+
width: "1.5rem",
|
|
50326
|
+
height: "1.5rem"
|
|
50327
|
+
})
|
|
50203
50328
|
})
|
|
50204
50329
|
})
|
|
50205
50330
|
]
|
package/package.json
CHANGED
|
@@ -8,6 +8,8 @@ interface PrimaryDragDropImagesProps {
|
|
|
8
8
|
imageUrls: ImageItem[];
|
|
9
9
|
handleRemove: (item: ImageItem) => void;
|
|
10
10
|
isDropDisabled?: boolean;
|
|
11
|
+
maxTotalImages?: number;
|
|
12
|
+
showLimitWarning?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare const PrimaryDragDropImage: React.FC<PrimaryDragDropImagesProps>;
|
|
13
15
|
export {};
|
|
@@ -8,6 +8,8 @@ export interface ImageItem {
|
|
|
8
8
|
export interface DropImageProps {
|
|
9
9
|
preview: boolean;
|
|
10
10
|
limitSize?: number;
|
|
11
|
+
maxFiles?: number;
|
|
12
|
+
maxTotalImages?: number;
|
|
11
13
|
imageUrls?: ImageItem[] | undefined;
|
|
12
14
|
setImageUrls?: any;
|
|
13
15
|
setFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
@@ -18,3 +20,4 @@ export default _default;
|
|
|
18
20
|
export declare const Base: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-bf5e6555").R, DropImageProps>;
|
|
19
21
|
export declare const Custom: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-bf5e6555").R, DropImageProps>;
|
|
20
22
|
export declare const Primary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-bf5e6555").R, DropImageProps>;
|
|
23
|
+
export declare const SingleImageOnly: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-bf5e6555").R, DropImageProps>;
|
package/src/lib/Form/demo.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const config: (getValues: (name: string) => unknown) => (FormItem
|
|
|
16
16
|
validateOption: {
|
|
17
17
|
required: string;
|
|
18
18
|
};
|
|
19
|
+
icon: string;
|
|
19
20
|
flatpickrOptions: {
|
|
20
21
|
mode: string;
|
|
21
22
|
time_24hr: boolean;
|
|
@@ -25,7 +26,9 @@ export declare const config: (getValues: (name: string) => unknown) => (FormItem
|
|
|
25
26
|
option?: undefined;
|
|
26
27
|
placeholder?: undefined;
|
|
27
28
|
noDataText?: undefined;
|
|
29
|
+
hiddenText?: undefined;
|
|
28
30
|
dropStyle?: undefined;
|
|
31
|
+
className?: undefined;
|
|
29
32
|
} | {
|
|
30
33
|
type: string;
|
|
31
34
|
name: string;
|
|
@@ -39,11 +42,14 @@ export declare const config: (getValues: (name: string) => unknown) => (FormItem
|
|
|
39
42
|
};
|
|
40
43
|
placeholder: string;
|
|
41
44
|
noDataText: string;
|
|
45
|
+
hiddenText: boolean;
|
|
42
46
|
dropStyle: {
|
|
43
47
|
bgClass: string;
|
|
44
48
|
hoverClass: string;
|
|
45
49
|
selectedClass: string;
|
|
46
50
|
};
|
|
51
|
+
className: string;
|
|
52
|
+
icon?: undefined;
|
|
47
53
|
flatpickrOptions?: undefined;
|
|
48
54
|
})[] | {
|
|
49
55
|
type: string;
|
package/src/lib/Form/types.d.ts
CHANGED
|
@@ -30,6 +30,37 @@ interface Checkbox {
|
|
|
30
30
|
color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default';
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
interface FlatpickrOptions {
|
|
34
|
+
mode?: 'single' | 'multiple' | 'range';
|
|
35
|
+
enableTime?: boolean;
|
|
36
|
+
time_24hr?: boolean;
|
|
37
|
+
dateFormat?: string;
|
|
38
|
+
defaultDate?: Date | Date[] | string;
|
|
39
|
+
inline?: boolean;
|
|
40
|
+
noCalendar?: boolean;
|
|
41
|
+
allowInput?: boolean;
|
|
42
|
+
clickOpens?: boolean;
|
|
43
|
+
weekNumbers?: boolean;
|
|
44
|
+
minDate?: Date | string;
|
|
45
|
+
maxDate?: Date | string;
|
|
46
|
+
disable?: Array<Date | string | {
|
|
47
|
+
from: Date | string;
|
|
48
|
+
to: Date | string;
|
|
49
|
+
}>;
|
|
50
|
+
enable?: Array<Date | string | {
|
|
51
|
+
from: Date | string;
|
|
52
|
+
to: Date | string;
|
|
53
|
+
}>;
|
|
54
|
+
locale?: string;
|
|
55
|
+
position?: 'auto' | 'above' | 'below';
|
|
56
|
+
static?: boolean;
|
|
57
|
+
monthSelectorType?: 'dropdown' | 'static';
|
|
58
|
+
onChange?: (selectedDates: Date[], dateStr: string, instance: any) => void;
|
|
59
|
+
onClose?: (selectedDates: Date[], dateStr: string, instance: any) => void;
|
|
60
|
+
onOpen?: (selectedDates: Date[], dateStr: string, instance: any) => void;
|
|
61
|
+
onReady?: (selectedDates: Date[], dateStr: string, instance: any) => void;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
33
64
|
export interface FormItem {
|
|
34
65
|
type: string;
|
|
35
66
|
name: string;
|
|
@@ -86,11 +117,13 @@ export interface FormItem {
|
|
|
86
117
|
limitSize?: number;
|
|
87
118
|
imageStyleType?: string;
|
|
88
119
|
noDataText?: string;
|
|
120
|
+
hiddenText?: boolean;
|
|
89
121
|
dropStyle?: {
|
|
90
122
|
bgClass?: string;
|
|
91
123
|
hoverClass?: string;
|
|
92
124
|
selectedClass?: string;
|
|
93
125
|
};
|
|
126
|
+
flatpickrOptions?: FlatpickrOptions;
|
|
94
127
|
}
|
|
95
128
|
export interface FormType {
|
|
96
129
|
item: FormItem;
|