@sunggang/ui-lib 0.3.50 → 0.3.52
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 +67 -0
- package/index.esm2.js +69 -29
- package/package.json +1 -1
- package/src/lib/Form/index.d.ts +2 -1
- package/src/lib/Form/types.d.ts +2 -0
- package/src/lib/Pagination/index.d.ts +12 -0
package/index.esm.css
CHANGED
|
@@ -719,9 +719,15 @@ video {
|
|
|
719
719
|
.right-2 {
|
|
720
720
|
right: 0.5rem;
|
|
721
721
|
}
|
|
722
|
+
.right-3 {
|
|
723
|
+
right: 0.75rem;
|
|
724
|
+
}
|
|
722
725
|
.top-0 {
|
|
723
726
|
top: 0px;
|
|
724
727
|
}
|
|
728
|
+
.top-1\/2 {
|
|
729
|
+
top: 50%;
|
|
730
|
+
}
|
|
725
731
|
.top-2\/4 {
|
|
726
732
|
top: 50%;
|
|
727
733
|
}
|
|
@@ -988,6 +994,9 @@ video {
|
|
|
988
994
|
.max-h-\[90vh\] {
|
|
989
995
|
max-height: 90vh;
|
|
990
996
|
}
|
|
997
|
+
.min-h-96 {
|
|
998
|
+
min-height: 24rem;
|
|
999
|
+
}
|
|
991
1000
|
.min-h-\[6rem\] {
|
|
992
1001
|
min-height: 6rem;
|
|
993
1002
|
}
|
|
@@ -1000,6 +1009,9 @@ video {
|
|
|
1000
1009
|
.w-12 {
|
|
1001
1010
|
width: 3rem;
|
|
1002
1011
|
}
|
|
1012
|
+
.w-16 {
|
|
1013
|
+
width: 4rem;
|
|
1014
|
+
}
|
|
1003
1015
|
.w-24 {
|
|
1004
1016
|
width: 6rem;
|
|
1005
1017
|
}
|
|
@@ -1137,6 +1149,10 @@ video {
|
|
|
1137
1149
|
--tw-translate-x: -100%;
|
|
1138
1150
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1139
1151
|
}
|
|
1152
|
+
.-translate-y-1\/2 {
|
|
1153
|
+
--tw-translate-y: -50%;
|
|
1154
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1155
|
+
}
|
|
1140
1156
|
.-translate-y-full {
|
|
1141
1157
|
--tw-translate-y: -100%;
|
|
1142
1158
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
@@ -1937,6 +1953,10 @@ video {
|
|
|
1937
1953
|
--tw-text-opacity: 1;
|
|
1938
1954
|
color: rgb(15 23 42 / var(--tw-text-opacity, 1));
|
|
1939
1955
|
}
|
|
1956
|
+
.text-\[\#121417\] {
|
|
1957
|
+
--tw-text-opacity: 1;
|
|
1958
|
+
color: rgb(18 20 23 / var(--tw-text-opacity, 1));
|
|
1959
|
+
}
|
|
1940
1960
|
.text-\[\#171A1F\] {
|
|
1941
1961
|
--tw-text-opacity: 1;
|
|
1942
1962
|
color: rgb(23 26 31 / var(--tw-text-opacity, 1));
|
|
@@ -1953,6 +1973,10 @@ video {
|
|
|
1953
1973
|
--tw-text-opacity: 1;
|
|
1954
1974
|
color: rgb(51 51 51 / var(--tw-text-opacity, 1));
|
|
1955
1975
|
}
|
|
1976
|
+
.text-\[\#4788FF\] {
|
|
1977
|
+
--tw-text-opacity: 1;
|
|
1978
|
+
color: rgb(71 136 255 / var(--tw-text-opacity, 1));
|
|
1979
|
+
}
|
|
1956
1980
|
.text-\[\#5A5A5A\] {
|
|
1957
1981
|
--tw-text-opacity: 1;
|
|
1958
1982
|
color: rgb(90 90 90 / var(--tw-text-opacity, 1));
|
|
@@ -1977,6 +2001,10 @@ video {
|
|
|
1977
2001
|
--tw-text-opacity: 1;
|
|
1978
2002
|
color: rgb(176 176 176 / var(--tw-text-opacity, 1));
|
|
1979
2003
|
}
|
|
2004
|
+
.text-\[\#B4B4B4\] {
|
|
2005
|
+
--tw-text-opacity: 1;
|
|
2006
|
+
color: rgb(180 180 180 / var(--tw-text-opacity, 1));
|
|
2007
|
+
}
|
|
1980
2008
|
.text-\[\#E73700\] {
|
|
1981
2009
|
--tw-text-opacity: 1;
|
|
1982
2010
|
color: rgb(231 55 0 / var(--tw-text-opacity, 1));
|
|
@@ -2528,6 +2556,11 @@ video {
|
|
|
2528
2556
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
|
2529
2557
|
}
|
|
2530
2558
|
|
|
2559
|
+
.hover\:bg-gray-200:hover {
|
|
2560
|
+
--tw-bg-opacity: 1;
|
|
2561
|
+
background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2531
2564
|
.hover\:bg-green-100:hover {
|
|
2532
2565
|
--tw-bg-opacity: 1;
|
|
2533
2566
|
background-color: rgb(220 252 231 / var(--tw-bg-opacity, 1));
|
|
@@ -2975,6 +3008,10 @@ video {
|
|
|
2975
3008
|
cursor: not-allowed;
|
|
2976
3009
|
}
|
|
2977
3010
|
|
|
3011
|
+
.disabled\:opacity-30:disabled {
|
|
3012
|
+
opacity: 0.3;
|
|
3013
|
+
}
|
|
3014
|
+
|
|
2978
3015
|
.disabled\:opacity-50:disabled {
|
|
2979
3016
|
opacity: 0.5;
|
|
2980
3017
|
}
|
|
@@ -3046,11 +3083,21 @@ video {
|
|
|
3046
3083
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
3047
3084
|
}
|
|
3048
3085
|
|
|
3086
|
+
.data-\[state\=checked\]\:translate-x-7[data-state="checked"] {
|
|
3087
|
+
--tw-translate-x: 1.75rem;
|
|
3088
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3049
3091
|
.data-\[state\=unchecked\]\:translate-x-0[data-state="unchecked"] {
|
|
3050
3092
|
--tw-translate-x: 0px;
|
|
3051
3093
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
3052
3094
|
}
|
|
3053
3095
|
|
|
3096
|
+
.data-\[state\=unchecked\]\:translate-x-1[data-state="unchecked"] {
|
|
3097
|
+
--tw-translate-x: 0.25rem;
|
|
3098
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3054
3101
|
.data-\[state\=checked\]\:bg-\[\#169796BF\][data-state="checked"] {
|
|
3055
3102
|
background-color: #169796BF;
|
|
3056
3103
|
}
|
|
@@ -3251,6 +3298,26 @@ video {
|
|
|
3251
3298
|
}
|
|
3252
3299
|
}
|
|
3253
3300
|
|
|
3301
|
+
.\[\&\:\:-webkit-calendar-picker-indicator\]\:absolute::-webkit-calendar-picker-indicator {
|
|
3302
|
+
position: absolute;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
.\[\&\:\:-webkit-calendar-picker-indicator\]\:h-full::-webkit-calendar-picker-indicator {
|
|
3306
|
+
height: 100%;
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
.\[\&\:\:-webkit-calendar-picker-indicator\]\:w-full::-webkit-calendar-picker-indicator {
|
|
3310
|
+
width: 100%;
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
.\[\&\:\:-webkit-calendar-picker-indicator\]\:cursor-pointer::-webkit-calendar-picker-indicator {
|
|
3314
|
+
cursor: pointer;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
.\[\&\:\:-webkit-calendar-picker-indicator\]\:opacity-0::-webkit-calendar-picker-indicator {
|
|
3318
|
+
opacity: 0;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3254
3321
|
.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end) {
|
|
3255
3322
|
border-top-right-radius: calc(var(--radius) - 2px);
|
|
3256
3323
|
border-bottom-right-radius: calc(var(--radius) - 2px);
|
package/index.esm2.js
CHANGED
|
@@ -48660,6 +48660,14 @@ var Time = function(param) {
|
|
|
48660
48660
|
input.value = "".concat(date, "T").concat(hour, ":00");
|
|
48661
48661
|
}
|
|
48662
48662
|
};
|
|
48663
|
+
var handleContainerClick = function() {
|
|
48664
|
+
// 觸發 input 的 focus 和 click 事件來打開 datepicker
|
|
48665
|
+
var input = document.getElementById((item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.name));
|
|
48666
|
+
if (input) {
|
|
48667
|
+
input.focus();
|
|
48668
|
+
input.click();
|
|
48669
|
+
}
|
|
48670
|
+
};
|
|
48663
48671
|
var step = (item === null || item === void 0 ? void 0 : item.step) ? {
|
|
48664
48672
|
step: item === null || item === void 0 ? void 0 : item.step
|
|
48665
48673
|
} : {};
|
|
@@ -48677,19 +48685,34 @@ var Time = function(param) {
|
|
|
48677
48685
|
/*#__PURE__*/ jsxs("div", {
|
|
48678
48686
|
className: "relative",
|
|
48679
48687
|
children: [
|
|
48680
|
-
/*#__PURE__*/
|
|
48681
|
-
className:
|
|
48682
|
-
|
|
48683
|
-
|
|
48684
|
-
|
|
48685
|
-
|
|
48686
|
-
|
|
48687
|
-
|
|
48688
|
-
|
|
48689
|
-
|
|
48690
|
-
|
|
48691
|
-
|
|
48692
|
-
|
|
48688
|
+
/*#__PURE__*/ jsxs("div", {
|
|
48689
|
+
className: "relative cursor-pointer",
|
|
48690
|
+
onClick: handleContainerClick,
|
|
48691
|
+
children: [
|
|
48692
|
+
/*#__PURE__*/ jsx("input", _object_spread$c(_object_spread_props$8(_object_spread$c({
|
|
48693
|
+
className: [
|
|
48694
|
+
(item === null || item === void 0 ? void 0 : item.disable) || (item === null || item === void 0 ? void 0 : item.disabled) ? "text-[#B0B0B0] bg-[#e5e7eb] cursor-not-allowed" : "bg-white text-[#0f172a]",
|
|
48695
|
+
"customTime border border-solid border-[#B4B4B4] px-3 py-2 rounded-2xl w-full text-[16px] cursor-pointer",
|
|
48696
|
+
// 隱藏原生的 datepicker icon
|
|
48697
|
+
"[&::-webkit-calendar-picker-indicator]:opacity-0 [&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:w-full [&::-webkit-calendar-picker-indicator]:h-full [&::-webkit-calendar-picker-indicator]:cursor-pointer"
|
|
48698
|
+
].join(" "),
|
|
48699
|
+
type: (item === null || item === void 0 ? void 0 : item.type) || "time",
|
|
48700
|
+
placeholder: "ex: 16:00"
|
|
48701
|
+
}, register(item === null || item === void 0 ? void 0 : item.name, _object_spread$c({}, item === null || item === void 0 ? void 0 : item.validateOption))), {
|
|
48702
|
+
style: item === null || item === void 0 ? void 0 : item.style,
|
|
48703
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
48704
|
+
id: (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.name),
|
|
48705
|
+
max: "2037-12-31T23:59"
|
|
48706
|
+
}), step, onInput)),
|
|
48707
|
+
(item === null || item === void 0 ? void 0 : item.icon) && /*#__PURE__*/ jsx("div", {
|
|
48708
|
+
className: "absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none",
|
|
48709
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
48710
|
+
icon: item.icon,
|
|
48711
|
+
className: "w-5 h-5 text-[#B4B4B4]"
|
|
48712
|
+
})
|
|
48713
|
+
})
|
|
48714
|
+
]
|
|
48715
|
+
}),
|
|
48693
48716
|
validateMsg(errors, item) && /*#__PURE__*/ jsxs("div", {
|
|
48694
48717
|
className: "pt-1 text-xs text-[#EF5533]",
|
|
48695
48718
|
children: [
|
|
@@ -48964,12 +48987,12 @@ var FieldLabel = function(param) {
|
|
|
48964
48987
|
});
|
|
48965
48988
|
};
|
|
48966
48989
|
var Fields = function(param) {
|
|
48967
|
-
var formConfig = param.formConfig;
|
|
48990
|
+
var formConfig = param.formConfig, _param_fieldsClass = param.fieldsClass, fieldsClass = _param_fieldsClass === void 0 ? "gap-2" : _param_fieldsClass;
|
|
48968
48991
|
return !!(formConfig === null || formConfig === void 0 ? void 0 : formConfig.length) && (formConfig === null || formConfig === void 0 ? void 0 : formConfig.map(function(item, index) {
|
|
48969
48992
|
return /*#__PURE__*/ jsx(StyleField, {
|
|
48970
48993
|
children: /*#__PURE__*/ jsx("div", {
|
|
48971
48994
|
className: [
|
|
48972
|
-
item[0].type === "ckEditor" ? "" : "flex
|
|
48995
|
+
item[0].type === "ckEditor" ? "" : "flex items-start flex-wrap lg:flex-nowrap ".concat(fieldsClass),
|
|
48973
48996
|
"justify-start"
|
|
48974
48997
|
].join(" "),
|
|
48975
48998
|
children: /*#__PURE__*/ jsx(Row, {
|
|
@@ -49191,15 +49214,23 @@ var BaseSwitch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
49191
49214
|
var sizeClass = {
|
|
49192
49215
|
small: {
|
|
49193
49216
|
root: "h-4 w-7",
|
|
49194
|
-
thumb: "h-3 w-3 data-[state=checked]:translate-x-3"
|
|
49217
|
+
thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0"
|
|
49195
49218
|
},
|
|
49196
49219
|
medium: {
|
|
49197
49220
|
root: "h-5 w-9",
|
|
49198
|
-
thumb: "h-4 w-4 data-[state=checked]:translate-x-4"
|
|
49221
|
+
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
49199
49222
|
},
|
|
49200
49223
|
large: {
|
|
49201
49224
|
root: "h-6 w-11",
|
|
49225
|
+
thumb: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
49226
|
+
},
|
|
49227
|
+
xl: {
|
|
49228
|
+
root: "h-7 w-12",
|
|
49202
49229
|
thumb: "h-5 w-5 data-[state=checked]:translate-x-5"
|
|
49230
|
+
},
|
|
49231
|
+
xxl: {
|
|
49232
|
+
root: "h-9 w-16",
|
|
49233
|
+
thumb: "h-7 w-7 data-[state=checked]:translate-x-7"
|
|
49203
49234
|
}
|
|
49204
49235
|
};
|
|
49205
49236
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -49215,18 +49246,27 @@ var BaseSwitch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
49215
49246
|
control: control,
|
|
49216
49247
|
render: function(param) {
|
|
49217
49248
|
var field = param.field;
|
|
49218
|
-
return /*#__PURE__*/
|
|
49219
|
-
className:
|
|
49220
|
-
|
|
49221
|
-
|
|
49222
|
-
|
|
49223
|
-
|
|
49224
|
-
|
|
49225
|
-
|
|
49226
|
-
|
|
49227
|
-
|
|
49228
|
-
|
|
49229
|
-
|
|
49249
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
49250
|
+
className: "inline-flex items-center gap-2",
|
|
49251
|
+
children: [
|
|
49252
|
+
/*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$7(_object_spread$b({
|
|
49253
|
+
className: cn("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", bgColor, sizeClass[size].root, "data-[state=unchecked]:bg-input")
|
|
49254
|
+
}, props), {
|
|
49255
|
+
ref: ref,
|
|
49256
|
+
checked: field.value,
|
|
49257
|
+
onCheckedChange: field.onChange,
|
|
49258
|
+
id: item === null || item === void 0 ? void 0 : item.id,
|
|
49259
|
+
disabled: item === null || item === void 0 ? void 0 : item.disable,
|
|
49260
|
+
children: /*#__PURE__*/ jsx(SwitchPrimitives.Thumb, {
|
|
49261
|
+
className: cn("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-1", sizeClass[size].thumb)
|
|
49262
|
+
})
|
|
49263
|
+
})),
|
|
49264
|
+
(item === null || item === void 0 ? void 0 : item.labelRight) && /*#__PURE__*/ jsx("span", {
|
|
49265
|
+
className: cn("text-sm text-gray-700", item === null || item === void 0 ? void 0 : item.labelRightClassName),
|
|
49266
|
+
children: item === null || item === void 0 ? void 0 : item.labelRight
|
|
49267
|
+
})
|
|
49268
|
+
]
|
|
49269
|
+
});
|
|
49230
49270
|
}
|
|
49231
49271
|
})
|
|
49232
49272
|
]
|
package/package.json
CHANGED
package/src/lib/Form/index.d.ts
CHANGED
|
@@ -54,8 +54,9 @@ export declare const Textarea: React.FC<FormType>;
|
|
|
54
54
|
export declare const FieldLabel: ({ item }: {
|
|
55
55
|
item: any;
|
|
56
56
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
57
|
-
export declare const Fields: ({ formConfig }: {
|
|
57
|
+
export declare const Fields: ({ formConfig, fieldsClass }: {
|
|
58
58
|
formConfig: any;
|
|
59
|
+
fieldsClass?: string | undefined;
|
|
59
60
|
}) => any;
|
|
60
61
|
export declare const CustomUploadField: ({ item }: {
|
|
61
62
|
item: any;
|
package/src/lib/Form/types.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type PaginationProps = {
|
|
3
|
+
page: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
total: number;
|
|
6
|
+
onChange: (page: number) => void;
|
|
7
|
+
siblingCount?: number;
|
|
8
|
+
color?: 'blue' | 'green' | 'purple' | 'red' | 'orange' | 'gray' | 'black';
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
};
|
|
11
|
+
export declare const Pagination: React.FC<PaginationProps>;
|
|
12
|
+
export default Pagination;
|