@sunggang/ui-lib 0.3.2 → 0.3.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/BaseCkeditor.esm.js +77 -32
- package/index.esm.js +2 -1
- package/index.esm2.js +8448 -968
- package/index.esm3.js +1 -0
- package/package.json +1 -1
- package/src/index.d.ts +4 -0
- package/src/lib/Drawer/Base.d.ts +1 -1
- package/src/lib/Form/demo.d.ts +14 -1
- package/src/lib/Form/index.d.ts +2 -1
- package/src/lib/Form/types.d.ts +16 -4
- package/src/lib/StackCards/index.d.ts +2 -2
package/BaseCkeditor.esm.js
CHANGED
|
@@ -19,6 +19,7 @@ import 'date-fns/addDays/index.js';
|
|
|
19
19
|
import 'date-fns/format/index.js';
|
|
20
20
|
import '@emotion/react';
|
|
21
21
|
import '@mui/material';
|
|
22
|
+
import 'input-otp';
|
|
22
23
|
import '@tanstack/react-table';
|
|
23
24
|
import '@radix-ui/react-dropdown-menu';
|
|
24
25
|
import '@radix-ui/react-icons';
|
|
@@ -13932,6 +13933,32 @@ function _ts_values(o) {
|
|
|
13932
13933
|
]);
|
|
13933
13934
|
var a = s;
|
|
13934
13935
|
},
|
|
13936
|
+
203: function(t, e, n) {
|
|
13937
|
+
n.d(e, {
|
|
13938
|
+
A: function() {
|
|
13939
|
+
return a;
|
|
13940
|
+
}
|
|
13941
|
+
});
|
|
13942
|
+
var o = n(4991), i = n.n(o), r = n(6314), s = n.n(r)()(i());
|
|
13943
|
+
s.push([
|
|
13944
|
+
t.id,
|
|
13945
|
+
".ckEditorModal{background:rgba(0,0,0,.5);height:100vh;left:0;position:absolute;position:fixed;top:0;width:100vw;z-index:100}.ckEditorModalContent{background:#fff;border-radius:.5rem;height:160px;left:50%;padding:1rem;position:absolute;top:50%;transform:translate(-50%,-50%);width:360px}.ckEditorModalTitle{font-size:1.5rem;font-weight:500}.ckEditorModalTextArea{padding:1rem}.ckEditorModalText{color:#565656;padding:.25rem}.ckEditorCloseButton{background-color:#d3d3d3;border-radius:.25rem;cursor:pointer;font-weight:700;line-height:1.5rem;margin-left:auto;text-align:center;width:1.5rem}.ckEditorCloseButton:hover{background-color:#a9a9a9}",
|
|
13946
|
+
"",
|
|
13947
|
+
{
|
|
13948
|
+
version: 3,
|
|
13949
|
+
sources: [
|
|
13950
|
+
"webpack://./src/style.css"
|
|
13951
|
+
],
|
|
13952
|
+
names: [],
|
|
13953
|
+
mappings: "AAAA,eAME,yBAA8B,CAF9B,YAAa,CAFb,MAAQ,CAGR,iBAAkB,CAGlB,cAAe,CAPf,KAAO,CAEP,WAAY,CAIZ,WAEF,CAEA,sBACE,eAAgB,CAQhB,mBAAqB,CAPrB,YAAa,CACb,QAAS,CAKT,YAAa,CAJb,iBAAkB,CAClB,OAAQ,CACR,8BAAgC,CAChC,WAGF,CAEA,oBACE,gBAAiB,CACjB,eACF,CAEA,uBACE,YACF,CAEA,mBACE,aAAc,CACd,cACF,CAEA,qBAME,wBAA2B,CAD3B,oBAAsB,CADtB,cAAe,CAIf,eAAgB,CANhB,kBAAmB,CAKnB,gBAAiB,CAJjB,iBAAkB,CAFlB,YAQF,CAEA,2BACE,wBACF",
|
|
13954
|
+
sourcesContent: [
|
|
13955
|
+
".ckEditorModal {\n top: 0%;\n left: 0%;\n width: 100vw;\n height: 100vh;\n position: absolute;\n background: rgba(0, 0, 0, 0.5);\n z-index: 100;\n position: fixed;\n}\n\n.ckEditorModalContent {\n background: #fff;\n height: 160px;\n left: 50%;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 360px;\n padding: 1rem;\n border-radius: 0.5rem;\n}\n\n.ckEditorModalTitle {\n font-size: 1.5rem;\n font-weight: 500;\n}\n\n.ckEditorModalTextArea {\n padding: 1rem;\n}\n\n.ckEditorModalText {\n color: #565656;\n padding: 0.25rem;\n}\n\n.ckEditorCloseButton {\n width: 1.5rem;\n line-height: 1.5rem;\n text-align: center;\n cursor: pointer;\n border-radius: 0.25rem;\n background-color: lightgray;\n margin-left: auto;\n font-weight: 700;\n}\n\n.ckEditorCloseButton:hover {\n background-color: darkgray;\n}\n"
|
|
13956
|
+
],
|
|
13957
|
+
sourceRoot: ""
|
|
13958
|
+
}
|
|
13959
|
+
]);
|
|
13960
|
+
var a = s;
|
|
13961
|
+
},
|
|
13935
13962
|
426: function(t, e, n) {
|
|
13936
13963
|
n.d(e, {
|
|
13937
13964
|
A: function() {
|
|
@@ -16063,7 +16090,7 @@ function _ts_values(o) {
|
|
|
16063
16090
|
var o = {};
|
|
16064
16091
|
n.d(o, {
|
|
16065
16092
|
default: function() {
|
|
16066
|
-
return
|
|
16093
|
+
return cD;
|
|
16067
16094
|
}
|
|
16068
16095
|
});
|
|
16069
16096
|
var i = function i() {
|
|
@@ -54035,7 +54062,7 @@ function _ts_values(o) {
|
|
|
54035
54062
|
];
|
|
54036
54063
|
var wC = {
|
|
54037
54064
|
normalizeStyles: function normalizeStyles(t) {
|
|
54038
|
-
|
|
54065
|
+
var e = (t.configuredStyles.options || []).map(function(t) {
|
|
54039
54066
|
return function(t) {
|
|
54040
54067
|
t = "string" == typeof t ? pC[t] ? _object_spread({}, pC[t]) : {
|
|
54041
54068
|
name: t
|
|
@@ -54071,6 +54098,7 @@ function _ts_values(o) {
|
|
|
54071
54098
|
return !0;
|
|
54072
54099
|
}(e, t);
|
|
54073
54100
|
});
|
|
54101
|
+
return e;
|
|
54074
54102
|
},
|
|
54075
54103
|
getDefaultStylesConfiguration: function getDefaultStylesConfiguration(t, e) {
|
|
54076
54104
|
return t && e ? {
|
|
@@ -63834,13 +63862,22 @@ function _ts_values(o) {
|
|
|
63834
63862
|
]);
|
|
63835
63863
|
return oD;
|
|
63836
63864
|
}(ge);
|
|
63837
|
-
var iD =
|
|
63838
|
-
|
|
63839
|
-
|
|
63840
|
-
|
|
63841
|
-
|
|
63865
|
+
var iD = n(203), rD = {
|
|
63866
|
+
injectType: "singletonStyleTag",
|
|
63867
|
+
attributes: {
|
|
63868
|
+
"data-cke": !0
|
|
63869
|
+
},
|
|
63870
|
+
insert: "head",
|
|
63871
|
+
singleton: !0
|
|
63872
|
+
};
|
|
63873
|
+
Xr()(iD.A, rD);
|
|
63874
|
+
iD.A.locals;
|
|
63875
|
+
var sD = /*#__PURE__*/ function() {
|
|
63876
|
+
function sD(t, e) {
|
|
63877
|
+
_class_call_check(this, sD);
|
|
63878
|
+
this.loader = t, this.uploadUrl = (e === null || e === void 0 ? void 0 : e.uploadUrl) || "https://dev-api-web.sunggang.com.tw/file_upload/upload_pic/event", this.fieldName = (e === null || e === void 0 ? void 0 : e.fieldName) || "pic_file", this.authToken = e === null || e === void 0 ? void 0 : e.authToken, this.imageSize = (e === null || e === void 0 ? void 0 : e.imageSize) || 512e3;
|
|
63842
63879
|
}
|
|
63843
|
-
_create_class(
|
|
63880
|
+
_create_class(sD, [
|
|
63844
63881
|
{
|
|
63845
63882
|
key: "upload",
|
|
63846
63883
|
value: function upload() {
|
|
@@ -63867,7 +63904,7 @@ function _ts_values(o) {
|
|
|
63867
63904
|
{
|
|
63868
63905
|
key: "_errorContent",
|
|
63869
63906
|
value: function _errorContent(t) {
|
|
63870
|
-
return '\n <div class="ckEditorModalTitle">選擇的檔案大小超過限制!</div>\n <hr />\n <div class="ckEditorModalTextArea">\n <div class="ckEditorModalText">\n 選擇的檔案大小:\n '.concat((t.size / 1024 / 1024).toFixed(3), 'MB\n </div>\n \n <div class="ckEditorModalText">\n 上限:\n ').concat((
|
|
63907
|
+
return '\n <div class="ckEditorModalTitle">選擇的檔案大小超過限制!</div>\n <hr />\n <div class="ckEditorModalTextArea">\n <div class="ckEditorModalText">\n 選擇的檔案大小:\n '.concat((t.size / 1024 / 1024).toFixed(3), 'MB\n </div>\n \n <div class="ckEditorModalText">\n 上限:\n ').concat((this.imageSize / 1024 / 1024).toFixed(3), "MB\n </div>\n </div>\n ");
|
|
63871
63908
|
}
|
|
63872
63909
|
},
|
|
63873
63910
|
{
|
|
@@ -63884,8 +63921,8 @@ function _ts_values(o) {
|
|
|
63884
63921
|
key: "_initRequest",
|
|
63885
63922
|
value: function _initRequest(t, e) {
|
|
63886
63923
|
var _$n = this.xhr = new XMLHttpRequest;
|
|
63887
|
-
if (e.size >
|
|
63888
|
-
_$n.open("POST",
|
|
63924
|
+
if (e.size > this.imageSize) return this._renderModal(this._errorContent(e)), void t();
|
|
63925
|
+
_$n.open("POST", this.uploadUrl), _$n.responseType = "json";
|
|
63889
63926
|
}
|
|
63890
63927
|
},
|
|
63891
63928
|
{
|
|
@@ -63910,17 +63947,24 @@ function _ts_values(o) {
|
|
|
63910
63947
|
{
|
|
63911
63948
|
key: "_sendRequest",
|
|
63912
63949
|
value: function _sendRequest(t) {
|
|
63913
|
-
var
|
|
63950
|
+
var _o_state;
|
|
63914
63951
|
var e = new FormData;
|
|
63915
|
-
e.append(this.fieldName, t, t.name), console.log(this.fieldName), console.log(this.uploadUrl);
|
|
63916
|
-
var _$n =
|
|
63917
|
-
|
|
63952
|
+
e.append(this.fieldName, t, t.name), console.log(this.fieldName), console.log(this.uploadUrl), console.log(this.imageSize);
|
|
63953
|
+
var _$n = localStorage.getItem("sg-auth-storage");
|
|
63954
|
+
var o = {};
|
|
63955
|
+
try {
|
|
63956
|
+
o = JSON.parse(_$n || "{}");
|
|
63957
|
+
} catch (t) {
|
|
63958
|
+
console.warn("Failed to parse auth storage:", t);
|
|
63959
|
+
}
|
|
63960
|
+
var i = (o === null || o === void 0 ? void 0 : (_o_state = o.state) === null || _o_state === void 0 ? void 0 : _o_state.access_token) || o, r = this.authToken || i;
|
|
63961
|
+
r && this.xhr.setRequestHeader("Authorization", r), this.xhr.send(e);
|
|
63918
63962
|
}
|
|
63919
63963
|
}
|
|
63920
63964
|
]);
|
|
63921
|
-
return
|
|
63965
|
+
return sD;
|
|
63922
63966
|
}();
|
|
63923
|
-
var
|
|
63967
|
+
var aD = {
|
|
63924
63968
|
columns: 9,
|
|
63925
63969
|
documentColors: 9,
|
|
63926
63970
|
colors: [
|
|
@@ -64394,16 +64438,16 @@ function _ts_values(o) {
|
|
|
64394
64438
|
}
|
|
64395
64439
|
]
|
|
64396
64440
|
};
|
|
64397
|
-
var
|
|
64398
|
-
_inherits(
|
|
64399
|
-
var _super = _create_super(
|
|
64400
|
-
function
|
|
64401
|
-
_class_call_check(this,
|
|
64441
|
+
var lD = /*#__PURE__*/ function(fg) {
|
|
64442
|
+
_inherits(lD, fg);
|
|
64443
|
+
var _super = _create_super(lD);
|
|
64444
|
+
function lD() {
|
|
64445
|
+
_class_call_check(this, lD);
|
|
64402
64446
|
return _super.apply(this, arguments);
|
|
64403
64447
|
}
|
|
64404
|
-
return
|
|
64448
|
+
return lD;
|
|
64405
64449
|
}(fg);
|
|
64406
|
-
|
|
64450
|
+
lD.builtinPlugins = [
|
|
64407
64451
|
/*#__PURE__*/ function(ge) {
|
|
64408
64452
|
_inherits(_class, ge);
|
|
64409
64453
|
var _super = _create_super(_class);
|
|
@@ -66642,15 +66686,16 @@ function _ts_values(o) {
|
|
|
66642
66686
|
]);
|
|
66643
66687
|
return _class;
|
|
66644
66688
|
}(ge)
|
|
66645
|
-
],
|
|
66689
|
+
], lD.defaultConfig = {
|
|
66646
66690
|
extraPlugins: [
|
|
66647
66691
|
function(t) {
|
|
66648
66692
|
t.plugins.get("FileRepository").createUploadAdapter = function(e) {
|
|
66649
|
-
var _ref = t.config.get("customUpload") || {}, _$n = _ref.uploadUrl, o = _ref.fieldName, i = _ref.authToken;
|
|
66650
|
-
return new
|
|
66693
|
+
var _ref = t.config.get("customUpload") || {}, _$n = _ref.uploadUrl, o = _ref.fieldName, i = _ref.authToken, r = _ref.imageSize;
|
|
66694
|
+
return new sD(e, {
|
|
66651
66695
|
uploadUrl: _$n,
|
|
66652
66696
|
fieldName: o,
|
|
66653
|
-
authToken: i
|
|
66697
|
+
authToken: i,
|
|
66698
|
+
imageSize: r
|
|
66654
66699
|
});
|
|
66655
66700
|
};
|
|
66656
66701
|
}
|
|
@@ -66691,8 +66736,8 @@ function _ts_values(o) {
|
|
|
66691
66736
|
],
|
|
66692
66737
|
shouldNotGroupWhenFull: !0
|
|
66693
66738
|
},
|
|
66694
|
-
fontColor: _object_spread({},
|
|
66695
|
-
fontBackgroundColor: _object_spread({},
|
|
66739
|
+
fontColor: _object_spread({}, aD),
|
|
66740
|
+
fontBackgroundColor: _object_spread({}, aD),
|
|
66696
66741
|
fontSize: {
|
|
66697
66742
|
options: [
|
|
66698
66743
|
9,
|
|
@@ -66736,7 +66781,7 @@ function _ts_values(o) {
|
|
|
66736
66781
|
]
|
|
66737
66782
|
}
|
|
66738
66783
|
};
|
|
66739
|
-
var
|
|
66784
|
+
var cD = lD;
|
|
66740
66785
|
return o = o.default;
|
|
66741
66786
|
}();
|
|
66742
66787
|
});
|
|
@@ -66769,7 +66814,7 @@ var BaseCkeditor = function(param) {
|
|
|
66769
66814
|
editor: Editor,
|
|
66770
66815
|
data: value,
|
|
66771
66816
|
config: {
|
|
66772
|
-
customUpload: config
|
|
66817
|
+
customUpload: config || (item === null || item === void 0 ? void 0 : item.config)
|
|
66773
66818
|
},
|
|
66774
66819
|
onChange: function(_, editor) {
|
|
66775
66820
|
var data = editor.getData();
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseSwitch,
|
|
1
|
+
export { B as BaseSwitch, w as BaseTable, G as BigCalender, q as Button, P as City, C as Controller, J as CustomSelect, l as CustomUpload, t as DataTable, n as DateRangePicker, H as DnDCalendar, x as Drawer, k as DropDown, D as DropImage, F as FieldLabel, V as Fields, X as Form, N as FormProvider, I as InputOTPs, L as LiffContext, K as LiffProvider, R as ReactDateRange, y as Regex, W as Row, o as SingleDatePicker, S as Spin, s as StackCards, m as Switch, T as TabsPanel, Q as Textarea, U as UiLibrary, r as buttonVariants, O as useForm, u as useFormContext, M as useLiffContext, v as validateMsg, A as verifyId, z as verifyTaiwanIdIntermediateString, E as verifyTaxId } from './index.esm2.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@iconify/react';
|
|
@@ -19,6 +19,7 @@ import 'date-fns/addDays/index.js';
|
|
|
19
19
|
import 'date-fns/format/index.js';
|
|
20
20
|
import '@emotion/react';
|
|
21
21
|
import '@mui/material';
|
|
22
|
+
import 'input-otp';
|
|
22
23
|
import '@tanstack/react-table';
|
|
23
24
|
import '@radix-ui/react-dropdown-menu';
|
|
24
25
|
import '@radix-ui/react-icons';
|