@sunggang/ui-lib 0.1.59 → 0.1.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.js
CHANGED
|
@@ -64163,33 +64163,6 @@ var CkEditor = function(param) {
|
|
|
64163
64163
|
});
|
|
64164
64164
|
};
|
|
64165
64165
|
|
|
64166
|
-
var styles = {};
|
|
64167
|
-
|
|
64168
|
-
function UiLibrary(props) {
|
|
64169
|
-
return /*#__PURE__*/ jsx("div", {
|
|
64170
|
-
className: styles["container"],
|
|
64171
|
-
children: /*#__PURE__*/ jsx("h1", {
|
|
64172
|
-
children: "Welcome to UiLibrary!"
|
|
64173
|
-
})
|
|
64174
|
-
});
|
|
64175
|
-
}
|
|
64176
|
-
|
|
64177
|
-
function Spin(props) {
|
|
64178
|
-
var show = props.show, _props_overlayBackground = props.overlayBackground, overlayBackground = _props_overlayBackground === void 0 ? "bg-[#00000055]" : _props_overlayBackground;
|
|
64179
|
-
return show ? /*#__PURE__*/ jsx("div", {
|
|
64180
|
-
className: [
|
|
64181
|
-
"fixed flex justify-center items-center w-full h-full left-0 top-0 z-[9999] overflow-hidden",
|
|
64182
|
-
overlayBackground
|
|
64183
|
-
].join(" "),
|
|
64184
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
64185
|
-
className: "top-2/4 left-2/4",
|
|
64186
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
64187
|
-
className: "w-10 h-10 rounded-full border-4 border-solid border-[#ffffff33] border-t-[#dbdbdb] animate-spin"
|
|
64188
|
-
})
|
|
64189
|
-
})
|
|
64190
|
-
}) : null;
|
|
64191
|
-
}
|
|
64192
|
-
|
|
64193
64166
|
var propTypes = {
|
|
64194
64167
|
exports: {}
|
|
64195
64168
|
};
|
|
@@ -66091,7 +66064,7 @@ function _iterableToArray$1(iter) {
|
|
|
66091
66064
|
function _arrayWithoutHoles$1(arr) {
|
|
66092
66065
|
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
66093
66066
|
}
|
|
66094
|
-
function ownKeys$
|
|
66067
|
+
function ownKeys$6(object, enumerableOnly) {
|
|
66095
66068
|
var keys = Object.keys(object);
|
|
66096
66069
|
if (Object.getOwnPropertySymbols) {
|
|
66097
66070
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -66104,9 +66077,9 @@ function ownKeys$5(object, enumerableOnly) {
|
|
|
66104
66077
|
function _objectSpread$1(target) {
|
|
66105
66078
|
for(var i = 1; i < arguments.length; i++){
|
|
66106
66079
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
66107
|
-
i % 2 ? ownKeys$
|
|
66080
|
+
i % 2 ? ownKeys$6(Object(source), !0).forEach(function(key) {
|
|
66108
66081
|
_defineProperty$1(target, key, source[key]);
|
|
66109
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
66082
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function(key) {
|
|
66110
66083
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
66111
66084
|
});
|
|
66112
66085
|
}
|
|
@@ -66500,7 +66473,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
66500
66473
|
function _arrayWithHoles(arr) {
|
|
66501
66474
|
if (Array.isArray(arr)) return arr;
|
|
66502
66475
|
}
|
|
66503
|
-
function ownKeys$
|
|
66476
|
+
function ownKeys$5(object, enumerableOnly) {
|
|
66504
66477
|
var keys = Object.keys(object);
|
|
66505
66478
|
if (Object.getOwnPropertySymbols) {
|
|
66506
66479
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -66513,9 +66486,9 @@ function ownKeys$4(object, enumerableOnly) {
|
|
|
66513
66486
|
function _objectSpread(target) {
|
|
66514
66487
|
for(var i = 1; i < arguments.length; i++){
|
|
66515
66488
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
66516
|
-
i % 2 ? ownKeys$
|
|
66489
|
+
i % 2 ? ownKeys$5(Object(source), !0).forEach(function(key) {
|
|
66517
66490
|
_defineProperty(target, key, source[key]);
|
|
66518
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
66491
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
|
|
66519
66492
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
66520
66493
|
});
|
|
66521
66494
|
}
|
|
@@ -67452,6 +67425,410 @@ function v4(options, buf, offset) {
|
|
|
67452
67425
|
return stringify(rnds);
|
|
67453
67426
|
}
|
|
67454
67427
|
|
|
67428
|
+
function _array_like_to_array$4(arr, len) {
|
|
67429
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67430
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67431
|
+
return arr2;
|
|
67432
|
+
}
|
|
67433
|
+
function _array_with_holes$4(arr) {
|
|
67434
|
+
if (Array.isArray(arr)) return arr;
|
|
67435
|
+
}
|
|
67436
|
+
function _array_without_holes$1(arr) {
|
|
67437
|
+
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
67438
|
+
}
|
|
67439
|
+
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
67440
|
+
try {
|
|
67441
|
+
var info = gen[key](arg);
|
|
67442
|
+
var value = info.value;
|
|
67443
|
+
} catch (error) {
|
|
67444
|
+
reject(error);
|
|
67445
|
+
return;
|
|
67446
|
+
}
|
|
67447
|
+
if (info.done) {
|
|
67448
|
+
resolve(value);
|
|
67449
|
+
} else {
|
|
67450
|
+
Promise.resolve(value).then(_next, _throw);
|
|
67451
|
+
}
|
|
67452
|
+
}
|
|
67453
|
+
function _async_to_generator$1(fn) {
|
|
67454
|
+
return function() {
|
|
67455
|
+
var self = this, args = arguments;
|
|
67456
|
+
return new Promise(function(resolve, reject) {
|
|
67457
|
+
var gen = fn.apply(self, args);
|
|
67458
|
+
function _next(value) {
|
|
67459
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
67460
|
+
}
|
|
67461
|
+
function _throw(err) {
|
|
67462
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
67463
|
+
}
|
|
67464
|
+
_next(undefined);
|
|
67465
|
+
});
|
|
67466
|
+
};
|
|
67467
|
+
}
|
|
67468
|
+
function _define_property$8(obj, key, value) {
|
|
67469
|
+
if (key in obj) {
|
|
67470
|
+
Object.defineProperty(obj, key, {
|
|
67471
|
+
value: value,
|
|
67472
|
+
enumerable: true,
|
|
67473
|
+
configurable: true,
|
|
67474
|
+
writable: true
|
|
67475
|
+
});
|
|
67476
|
+
} else {
|
|
67477
|
+
obj[key] = value;
|
|
67478
|
+
}
|
|
67479
|
+
return obj;
|
|
67480
|
+
}
|
|
67481
|
+
function _iterable_to_array$1(iter) {
|
|
67482
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
67483
|
+
}
|
|
67484
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
67485
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
67486
|
+
if (_i == null) return;
|
|
67487
|
+
var _arr = [];
|
|
67488
|
+
var _n = true;
|
|
67489
|
+
var _d = false;
|
|
67490
|
+
var _s, _e;
|
|
67491
|
+
try {
|
|
67492
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
67493
|
+
_arr.push(_s.value);
|
|
67494
|
+
if (i && _arr.length === i) break;
|
|
67495
|
+
}
|
|
67496
|
+
} catch (err) {
|
|
67497
|
+
_d = true;
|
|
67498
|
+
_e = err;
|
|
67499
|
+
} finally{
|
|
67500
|
+
try {
|
|
67501
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
67502
|
+
} finally{
|
|
67503
|
+
if (_d) throw _e;
|
|
67504
|
+
}
|
|
67505
|
+
}
|
|
67506
|
+
return _arr;
|
|
67507
|
+
}
|
|
67508
|
+
function _non_iterable_rest$4() {
|
|
67509
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67510
|
+
}
|
|
67511
|
+
function _non_iterable_spread$1() {
|
|
67512
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67513
|
+
}
|
|
67514
|
+
function _object_spread$8(target) {
|
|
67515
|
+
for(var i = 1; i < arguments.length; i++){
|
|
67516
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
67517
|
+
var ownKeys = Object.keys(source);
|
|
67518
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
67519
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
67520
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
67521
|
+
}));
|
|
67522
|
+
}
|
|
67523
|
+
ownKeys.forEach(function(key) {
|
|
67524
|
+
_define_property$8(target, key, source[key]);
|
|
67525
|
+
});
|
|
67526
|
+
}
|
|
67527
|
+
return target;
|
|
67528
|
+
}
|
|
67529
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
67530
|
+
var keys = Object.keys(object);
|
|
67531
|
+
if (Object.getOwnPropertySymbols) {
|
|
67532
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
67533
|
+
if (enumerableOnly) {
|
|
67534
|
+
symbols = symbols.filter(function(sym) {
|
|
67535
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
67536
|
+
});
|
|
67537
|
+
}
|
|
67538
|
+
keys.push.apply(keys, symbols);
|
|
67539
|
+
}
|
|
67540
|
+
return keys;
|
|
67541
|
+
}
|
|
67542
|
+
function _object_spread_props$4(target, source) {
|
|
67543
|
+
source = source != null ? source : {};
|
|
67544
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
67545
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67546
|
+
} else {
|
|
67547
|
+
ownKeys$4(Object(source)).forEach(function(key) {
|
|
67548
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67549
|
+
});
|
|
67550
|
+
}
|
|
67551
|
+
return target;
|
|
67552
|
+
}
|
|
67553
|
+
function _sliced_to_array$4(arr, i) {
|
|
67554
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
67555
|
+
}
|
|
67556
|
+
function _to_consumable_array$1(arr) {
|
|
67557
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$1();
|
|
67558
|
+
}
|
|
67559
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
67560
|
+
if (!o) return;
|
|
67561
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
67562
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
67563
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
67564
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67565
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
67566
|
+
}
|
|
67567
|
+
function _ts_generator$1(thisArg, body) {
|
|
67568
|
+
var f, y, t, g, _ = {
|
|
67569
|
+
label: 0,
|
|
67570
|
+
sent: function() {
|
|
67571
|
+
if (t[0] & 1) throw t[1];
|
|
67572
|
+
return t[1];
|
|
67573
|
+
},
|
|
67574
|
+
trys: [],
|
|
67575
|
+
ops: []
|
|
67576
|
+
};
|
|
67577
|
+
return g = {
|
|
67578
|
+
next: verb(0),
|
|
67579
|
+
"throw": verb(1),
|
|
67580
|
+
"return": verb(2)
|
|
67581
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
67582
|
+
return this;
|
|
67583
|
+
}), g;
|
|
67584
|
+
function verb(n) {
|
|
67585
|
+
return function(v) {
|
|
67586
|
+
return step([
|
|
67587
|
+
n,
|
|
67588
|
+
v
|
|
67589
|
+
]);
|
|
67590
|
+
};
|
|
67591
|
+
}
|
|
67592
|
+
function step(op) {
|
|
67593
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
67594
|
+
while(_)try {
|
|
67595
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
67596
|
+
if (y = 0, t) op = [
|
|
67597
|
+
op[0] & 2,
|
|
67598
|
+
t.value
|
|
67599
|
+
];
|
|
67600
|
+
switch(op[0]){
|
|
67601
|
+
case 0:
|
|
67602
|
+
case 1:
|
|
67603
|
+
t = op;
|
|
67604
|
+
break;
|
|
67605
|
+
case 4:
|
|
67606
|
+
_.label++;
|
|
67607
|
+
return {
|
|
67608
|
+
value: op[1],
|
|
67609
|
+
done: false
|
|
67610
|
+
};
|
|
67611
|
+
case 5:
|
|
67612
|
+
_.label++;
|
|
67613
|
+
y = op[1];
|
|
67614
|
+
op = [
|
|
67615
|
+
0
|
|
67616
|
+
];
|
|
67617
|
+
continue;
|
|
67618
|
+
case 7:
|
|
67619
|
+
op = _.ops.pop();
|
|
67620
|
+
_.trys.pop();
|
|
67621
|
+
continue;
|
|
67622
|
+
default:
|
|
67623
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
67624
|
+
_ = 0;
|
|
67625
|
+
continue;
|
|
67626
|
+
}
|
|
67627
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
67628
|
+
_.label = op[1];
|
|
67629
|
+
break;
|
|
67630
|
+
}
|
|
67631
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
67632
|
+
_.label = t[1];
|
|
67633
|
+
t = op;
|
|
67634
|
+
break;
|
|
67635
|
+
}
|
|
67636
|
+
if (t && _.label < t[2]) {
|
|
67637
|
+
_.label = t[2];
|
|
67638
|
+
_.ops.push(op);
|
|
67639
|
+
break;
|
|
67640
|
+
}
|
|
67641
|
+
if (t[2]) _.ops.pop();
|
|
67642
|
+
_.trys.pop();
|
|
67643
|
+
continue;
|
|
67644
|
+
}
|
|
67645
|
+
op = body.call(thisArg, _);
|
|
67646
|
+
} catch (e) {
|
|
67647
|
+
op = [
|
|
67648
|
+
6,
|
|
67649
|
+
e
|
|
67650
|
+
];
|
|
67651
|
+
y = 0;
|
|
67652
|
+
} finally{
|
|
67653
|
+
f = t = 0;
|
|
67654
|
+
}
|
|
67655
|
+
if (op[0] & 5) throw op[1];
|
|
67656
|
+
return {
|
|
67657
|
+
value: op[0] ? op[1] : void 0,
|
|
67658
|
+
done: true
|
|
67659
|
+
};
|
|
67660
|
+
}
|
|
67661
|
+
}
|
|
67662
|
+
var DropImage_S = function() {
|
|
67663
|
+
var _ref = _async_to_generator$1(function(param) {
|
|
67664
|
+
var _param_preview, preview, setFiles, imageUrls, setImageUrls, _useState, previewFiles, setPreviewFiles, _useDropzone, getRootProps, getInputProps, removePreviewFile, removeImageUrls;
|
|
67665
|
+
return _ts_generator$1(this, function(_state) {
|
|
67666
|
+
_param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
|
|
67667
|
+
_useState = _sliced_to_array$4(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
67668
|
+
_useDropzone = useDropzone({
|
|
67669
|
+
accept: {
|
|
67670
|
+
"image/png": [
|
|
67671
|
+
".png"
|
|
67672
|
+
],
|
|
67673
|
+
"image/jpeg": [
|
|
67674
|
+
".jpg",
|
|
67675
|
+
".jpeg"
|
|
67676
|
+
]
|
|
67677
|
+
},
|
|
67678
|
+
maxFiles: 10,
|
|
67679
|
+
maxSize: 5000000,
|
|
67680
|
+
onDrop: function(dropFiles) {
|
|
67681
|
+
var newFiles = [];
|
|
67682
|
+
setFiles(dropFiles);
|
|
67683
|
+
dropFiles.forEach(function(dropFile) {
|
|
67684
|
+
Object.assign(dropFile, {
|
|
67685
|
+
preview: URL.createObjectURL(dropFile),
|
|
67686
|
+
uuid: v4()
|
|
67687
|
+
});
|
|
67688
|
+
newFiles.push(dropFile);
|
|
67689
|
+
setPreviewFiles(newFiles);
|
|
67690
|
+
});
|
|
67691
|
+
}
|
|
67692
|
+
}), getRootProps = _useDropzone.getRootProps, getInputProps = _useDropzone.getInputProps, _useDropzone.isDragActive, _useDropzone.isDragAccept, _useDropzone.isDragReject;
|
|
67693
|
+
removePreviewFile = function(file) {
|
|
67694
|
+
var currentItem = previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.indexOf(file);
|
|
67695
|
+
previewFiles.splice(currentItem, 1);
|
|
67696
|
+
setPreviewFiles(_to_consumable_array$1(previewFiles));
|
|
67697
|
+
};
|
|
67698
|
+
removeImageUrls = function(item) {
|
|
67699
|
+
var currentItem = imageUrls === null || imageUrls === void 0 ? void 0 : imageUrls.indexOf(item);
|
|
67700
|
+
imageUrls.splice(currentItem, 1);
|
|
67701
|
+
setImageUrls(_to_consumable_array$1(imageUrls));
|
|
67702
|
+
};
|
|
67703
|
+
return [
|
|
67704
|
+
2,
|
|
67705
|
+
/*#__PURE__*/ jsxs("section", {
|
|
67706
|
+
className: "w-full",
|
|
67707
|
+
children: [
|
|
67708
|
+
/*#__PURE__*/ jsxs("div", _object_spread_props$4(_object_spread$8({}, getRootProps({
|
|
67709
|
+
className: "dropzone"
|
|
67710
|
+
})), {
|
|
67711
|
+
children: [
|
|
67712
|
+
/*#__PURE__*/ jsx("input", _object_spread$8({}, getInputProps())),
|
|
67713
|
+
/*#__PURE__*/ jsx("div", {
|
|
67714
|
+
className: "flex justify-between",
|
|
67715
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67716
|
+
className: "w-full bg-gray-light rounded-lg",
|
|
67717
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
67718
|
+
className: "border-2 border-dashed border-gray-400 rounded-lg bg-gray-100",
|
|
67719
|
+
children: [
|
|
67720
|
+
/*#__PURE__*/ jsx("div", {
|
|
67721
|
+
className: "flex justify-center py-8",
|
|
67722
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67723
|
+
icon: "material-symbols:upload",
|
|
67724
|
+
width: "2.5rem",
|
|
67725
|
+
height: "2.5rem"
|
|
67726
|
+
})
|
|
67727
|
+
}),
|
|
67728
|
+
/*#__PURE__*/ jsxs("div", {
|
|
67729
|
+
className: "flex items-center flex-col justify-center",
|
|
67730
|
+
children: [
|
|
67731
|
+
/*#__PURE__*/ jsx("p", {
|
|
67732
|
+
className: "font-normal text-sm text-gray-400 pb-4",
|
|
67733
|
+
children: "圖片僅支援 png、jpg、jpeg"
|
|
67734
|
+
}),
|
|
67735
|
+
/*#__PURE__*/ jsx("h5", {
|
|
67736
|
+
className: "mb-2 text-xl font-bold tracking-tight text-gray-700 pb-4",
|
|
67737
|
+
children: "拖曳圖片至此"
|
|
67738
|
+
})
|
|
67739
|
+
]
|
|
67740
|
+
})
|
|
67741
|
+
]
|
|
67742
|
+
})
|
|
67743
|
+
})
|
|
67744
|
+
})
|
|
67745
|
+
]
|
|
67746
|
+
})),
|
|
67747
|
+
preview && /*#__PURE__*/ jsx("div", {
|
|
67748
|
+
className: "flex pt-2 gap-2",
|
|
67749
|
+
children: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) ? previewFiles.length > 0 ? previewFiles.map(function(item) {
|
|
67750
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67751
|
+
className: "relative",
|
|
67752
|
+
children: [
|
|
67753
|
+
/*#__PURE__*/ jsx("button", {
|
|
67754
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67755
|
+
onClick: function() {
|
|
67756
|
+
return removePreviewFile(item);
|
|
67757
|
+
},
|
|
67758
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67759
|
+
icon: "mingcute:delete-2-line",
|
|
67760
|
+
width: "1.5rem",
|
|
67761
|
+
height: "1.5rem"
|
|
67762
|
+
})
|
|
67763
|
+
}),
|
|
67764
|
+
/*#__PURE__*/ jsx("img", {
|
|
67765
|
+
className: "w-24 h-24 object-cover",
|
|
67766
|
+
src: item === null || item === void 0 ? void 0 : item.preview,
|
|
67767
|
+
alt: ""
|
|
67768
|
+
})
|
|
67769
|
+
]
|
|
67770
|
+
}, item === null || item === void 0 ? void 0 : item.uuid);
|
|
67771
|
+
}) : null : imageUrls && imageUrls.length ? imageUrls.map(function(item) {
|
|
67772
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67773
|
+
className: "relative",
|
|
67774
|
+
children: [
|
|
67775
|
+
/*#__PURE__*/ jsx("button", {
|
|
67776
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67777
|
+
onClick: function() {
|
|
67778
|
+
return removeImageUrls(item);
|
|
67779
|
+
},
|
|
67780
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67781
|
+
icon: "mingcute:delete-2-line",
|
|
67782
|
+
width: "1.5rem",
|
|
67783
|
+
height: "1.5rem"
|
|
67784
|
+
})
|
|
67785
|
+
}),
|
|
67786
|
+
/*#__PURE__*/ jsx("img", {
|
|
67787
|
+
className: "w-24 h-24 object-cover",
|
|
67788
|
+
src: item === null || item === void 0 ? void 0 : item.url,
|
|
67789
|
+
alt: ""
|
|
67790
|
+
})
|
|
67791
|
+
]
|
|
67792
|
+
}, item === null || item === void 0 ? void 0 : item.url);
|
|
67793
|
+
}) : null
|
|
67794
|
+
})
|
|
67795
|
+
]
|
|
67796
|
+
})
|
|
67797
|
+
];
|
|
67798
|
+
});
|
|
67799
|
+
});
|
|
67800
|
+
return function DropImage_S(_) {
|
|
67801
|
+
return _ref.apply(this, arguments);
|
|
67802
|
+
};
|
|
67803
|
+
}();
|
|
67804
|
+
|
|
67805
|
+
var styles = {};
|
|
67806
|
+
|
|
67807
|
+
function UiLibrary(props) {
|
|
67808
|
+
return /*#__PURE__*/ jsx("div", {
|
|
67809
|
+
className: styles["container"],
|
|
67810
|
+
children: /*#__PURE__*/ jsx("h1", {
|
|
67811
|
+
children: "Welcome to UiLibrary!"
|
|
67812
|
+
})
|
|
67813
|
+
});
|
|
67814
|
+
}
|
|
67815
|
+
|
|
67816
|
+
function Spin(props) {
|
|
67817
|
+
var show = props.show, _props_overlayBackground = props.overlayBackground, overlayBackground = _props_overlayBackground === void 0 ? "bg-[#00000055]" : _props_overlayBackground;
|
|
67818
|
+
return show ? /*#__PURE__*/ jsx("div", {
|
|
67819
|
+
className: [
|
|
67820
|
+
"fixed flex justify-center items-center w-full h-full left-0 top-0 z-[9999] overflow-hidden",
|
|
67821
|
+
overlayBackground
|
|
67822
|
+
].join(" "),
|
|
67823
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67824
|
+
className: "top-2/4 left-2/4",
|
|
67825
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67826
|
+
className: "w-10 h-10 rounded-full border-4 border-solid border-[#ffffff33] border-t-[#dbdbdb] animate-spin"
|
|
67827
|
+
})
|
|
67828
|
+
})
|
|
67829
|
+
}) : null;
|
|
67830
|
+
}
|
|
67831
|
+
|
|
67455
67832
|
function _array_like_to_array$3(arr, len) {
|
|
67456
67833
|
if (len == null || len > arr.length) len = arr.length;
|
|
67457
67834
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -69209,4 +69586,146 @@ var verifyTaxId = function(idStr) {
|
|
|
69209
69586
|
return isLegal;
|
|
69210
69587
|
};
|
|
69211
69588
|
|
|
69212
|
-
|
|
69589
|
+
// React server components are async so you make database or API calls.
|
|
69590
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
69591
|
+
try {
|
|
69592
|
+
var info = gen[key](arg);
|
|
69593
|
+
var value = info.value;
|
|
69594
|
+
} catch (error) {
|
|
69595
|
+
reject(error);
|
|
69596
|
+
return;
|
|
69597
|
+
}
|
|
69598
|
+
if (info.done) {
|
|
69599
|
+
resolve(value);
|
|
69600
|
+
} else {
|
|
69601
|
+
Promise.resolve(value).then(_next, _throw);
|
|
69602
|
+
}
|
|
69603
|
+
}
|
|
69604
|
+
function _async_to_generator(fn) {
|
|
69605
|
+
return function() {
|
|
69606
|
+
var self = this, args = arguments;
|
|
69607
|
+
return new Promise(function(resolve, reject) {
|
|
69608
|
+
var gen = fn.apply(self, args);
|
|
69609
|
+
function _next(value) {
|
|
69610
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
69611
|
+
}
|
|
69612
|
+
function _throw(err) {
|
|
69613
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
69614
|
+
}
|
|
69615
|
+
_next(undefined);
|
|
69616
|
+
});
|
|
69617
|
+
};
|
|
69618
|
+
}
|
|
69619
|
+
function _ts_generator(thisArg, body) {
|
|
69620
|
+
var f, y, t, g, _ = {
|
|
69621
|
+
label: 0,
|
|
69622
|
+
sent: function() {
|
|
69623
|
+
if (t[0] & 1) throw t[1];
|
|
69624
|
+
return t[1];
|
|
69625
|
+
},
|
|
69626
|
+
trys: [],
|
|
69627
|
+
ops: []
|
|
69628
|
+
};
|
|
69629
|
+
return g = {
|
|
69630
|
+
next: verb(0),
|
|
69631
|
+
"throw": verb(1),
|
|
69632
|
+
"return": verb(2)
|
|
69633
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
69634
|
+
return this;
|
|
69635
|
+
}), g;
|
|
69636
|
+
function verb(n) {
|
|
69637
|
+
return function(v) {
|
|
69638
|
+
return step([
|
|
69639
|
+
n,
|
|
69640
|
+
v
|
|
69641
|
+
]);
|
|
69642
|
+
};
|
|
69643
|
+
}
|
|
69644
|
+
function step(op) {
|
|
69645
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
69646
|
+
while(_)try {
|
|
69647
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
69648
|
+
if (y = 0, t) op = [
|
|
69649
|
+
op[0] & 2,
|
|
69650
|
+
t.value
|
|
69651
|
+
];
|
|
69652
|
+
switch(op[0]){
|
|
69653
|
+
case 0:
|
|
69654
|
+
case 1:
|
|
69655
|
+
t = op;
|
|
69656
|
+
break;
|
|
69657
|
+
case 4:
|
|
69658
|
+
_.label++;
|
|
69659
|
+
return {
|
|
69660
|
+
value: op[1],
|
|
69661
|
+
done: false
|
|
69662
|
+
};
|
|
69663
|
+
case 5:
|
|
69664
|
+
_.label++;
|
|
69665
|
+
y = op[1];
|
|
69666
|
+
op = [
|
|
69667
|
+
0
|
|
69668
|
+
];
|
|
69669
|
+
continue;
|
|
69670
|
+
case 7:
|
|
69671
|
+
op = _.ops.pop();
|
|
69672
|
+
_.trys.pop();
|
|
69673
|
+
continue;
|
|
69674
|
+
default:
|
|
69675
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
69676
|
+
_ = 0;
|
|
69677
|
+
continue;
|
|
69678
|
+
}
|
|
69679
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
69680
|
+
_.label = op[1];
|
|
69681
|
+
break;
|
|
69682
|
+
}
|
|
69683
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
69684
|
+
_.label = t[1];
|
|
69685
|
+
t = op;
|
|
69686
|
+
break;
|
|
69687
|
+
}
|
|
69688
|
+
if (t && _.label < t[2]) {
|
|
69689
|
+
_.label = t[2];
|
|
69690
|
+
_.ops.push(op);
|
|
69691
|
+
break;
|
|
69692
|
+
}
|
|
69693
|
+
if (t[2]) _.ops.pop();
|
|
69694
|
+
_.trys.pop();
|
|
69695
|
+
continue;
|
|
69696
|
+
}
|
|
69697
|
+
op = body.call(thisArg, _);
|
|
69698
|
+
} catch (e) {
|
|
69699
|
+
op = [
|
|
69700
|
+
6,
|
|
69701
|
+
e
|
|
69702
|
+
];
|
|
69703
|
+
y = 0;
|
|
69704
|
+
} finally{
|
|
69705
|
+
f = t = 0;
|
|
69706
|
+
}
|
|
69707
|
+
if (op[0] & 5) throw op[1];
|
|
69708
|
+
return {
|
|
69709
|
+
value: op[0] ? op[1] : void 0,
|
|
69710
|
+
done: true
|
|
69711
|
+
};
|
|
69712
|
+
}
|
|
69713
|
+
}
|
|
69714
|
+
function HelloServer() {
|
|
69715
|
+
return _HelloServer.apply(this, arguments);
|
|
69716
|
+
}
|
|
69717
|
+
function _HelloServer() {
|
|
69718
|
+
_HelloServer = _async_to_generator(function() {
|
|
69719
|
+
return _ts_generator(this, function(_state) {
|
|
69720
|
+
return [
|
|
69721
|
+
2,
|
|
69722
|
+
/*#__PURE__*/ jsx("h1", {
|
|
69723
|
+
children: "Hello Server"
|
|
69724
|
+
})
|
|
69725
|
+
];
|
|
69726
|
+
});
|
|
69727
|
+
});
|
|
69728
|
+
return _HelloServer.apply(this, arguments);
|
|
69729
|
+
}
|
|
69730
|
+
|
|
69731
|
+
export { CkEditor, CustomUpload, DateRangePicker, DropImage, DropImage_S, HelloServer, ReactDateRange, Spin, Switch, UiLibrary, verifyId, verifyTaxId };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import CkEditor from './lib/Ckeditor';
|
|
2
|
+
import { DropImage_S } from './components/serverComponents/DropImage';
|
|
2
3
|
import './style.css';
|
|
3
4
|
export { CkEditor };
|
|
5
|
+
export { DropImage_S };
|
|
4
6
|
export * from './lib/uiLibrary';
|
|
5
7
|
export * from './lib/Spin';
|
|
6
8
|
export * from './lib/DropImage';
|
|
@@ -10,3 +12,4 @@ export * from './components/ui/dateRangePicker';
|
|
|
10
12
|
export * from './components/ui/reactDateRange';
|
|
11
13
|
export * from './lib/DataTable';
|
|
12
14
|
export * from './lib/Function';
|
|
15
|
+
export * from './lib/hello-server';
|