sea-react-components 1.0.3 → 1.1.1
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/components/accordion/index.d.ts +19 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +30 -0
- package/dist/components/alert/index.js +1 -1
- package/dist/components/calendar/index.d.ts +12 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +116 -0
- package/dist/components/color-picker/index.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +4 -3
- package/dist/components/day-calendar/index.d.ts +19 -0
- package/dist/components/day-calendar/index.d.ts.map +1 -0
- package/dist/components/day-calendar/index.js +60 -0
- package/dist/components/drawer/index.js +5 -5
- package/dist/components/file-input/components/file-item/index.d.ts +3 -3
- package/dist/components/file-input/components/file-item/index.d.ts.map +1 -1
- package/dist/components/file-input/components/file-item/index.js +29 -4
- package/dist/components/file-input/index.d.ts +24 -7
- package/dist/components/file-input/index.d.ts.map +1 -1
- package/dist/components/file-input/index.js +53 -31
- package/dist/components/file-input-v2/file-input/index.d.ts +14 -0
- package/dist/components/file-input-v2/file-input/index.d.ts.map +1 -0
- package/dist/components/file-input-v2/file-input/index.js +6 -0
- package/dist/components/file-input-v2/file-input-container/index.d.ts +59 -0
- package/dist/components/file-input-v2/file-input-container/index.d.ts.map +1 -0
- package/dist/components/file-input-v2/file-input-container/index.js +99 -0
- package/dist/components/file-input-v2/index.d.ts +3 -0
- package/dist/components/file-input-v2/index.d.ts.map +1 -0
- package/dist/components/file-input-v2/index.js +2 -0
- package/dist/components/modal/index.d.ts +2 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +7 -7
- package/dist/components/month-calendar/index.d.ts +14 -0
- package/dist/components/month-calendar/index.d.ts.map +1 -0
- package/dist/components/month-calendar/index.js +55 -0
- package/dist/components/select/index.d.ts +5 -4
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +37 -26
- package/dist/components/skeleton/index.d.ts +1 -1
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +14 -2
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/text-editor/components/toolbar/index.d.ts.map +1 -1
- package/dist/components/text-editor/components/toolbar/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tree-checkbox/components/tree-checkbox-item/index.js +1 -1
- package/dist/components/tree-checkbox/index.d.ts +2 -1
- package/dist/components/tree-checkbox/index.d.ts.map +1 -1
- package/dist/components/week-calendar/index.d.ts +20 -0
- package/dist/components/week-calendar/index.d.ts.map +1 -0
- package/dist/components/week-calendar/index.js +78 -0
- package/dist/hooks/list-items-hook/usePagination.js +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/color/index.d.ts.map +1 -1
- package/dist/utils/color/index.js +3 -14
- package/dist/utils/validation/index.d.ts.map +1 -1
- package/dist/utils/validation/index.js +5 -2
- package/package.json +2 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useEffect } from "react";
|
|
4
|
+
import { Utils } from "sea-platform-helpers";
|
|
5
|
+
import Skeleton from "../skeleton";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
const moment = Utils.Moment.default;
|
|
8
|
+
const HOURS = Array.from({ length: 24 }, (_, i) => `${i}:00`);
|
|
9
|
+
export default function WeekCalendar({ week = new Date(), events, EventItem, loading, onVisibleDaysChange, setDay, }) {
|
|
10
|
+
const today = moment().format("YYYY-MM-DD");
|
|
11
|
+
const selectedDay = moment(week).format("YYYY-MM-DD");
|
|
12
|
+
const currentWeek = useMemo(() => moment(week).startOf("week"), [week]);
|
|
13
|
+
const visibleDays = useMemo(() => Array.from({ length: 7 }, (_, i) => currentWeek.clone().add(i, "days").format("YYYY-MM-DD")), [currentWeek]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
onVisibleDaysChange === null || onVisibleDaysChange === void 0 ? void 0 : onVisibleDaysChange(visibleDays);
|
|
16
|
+
}, [visibleDays, onVisibleDaysChange]);
|
|
17
|
+
const getPositionedEvents = (dayEvents) => {
|
|
18
|
+
const positioned = [];
|
|
19
|
+
const sorted = [...dayEvents].sort((a, b) => moment(a.start).diff(moment(b.start)));
|
|
20
|
+
const columns = [];
|
|
21
|
+
sorted.forEach((event) => {
|
|
22
|
+
const start = moment(event.start);
|
|
23
|
+
let placed = false;
|
|
24
|
+
for (const col of columns) {
|
|
25
|
+
if (!col.some((e) => moment(e.end).isAfter(start))) {
|
|
26
|
+
col.push(event);
|
|
27
|
+
placed = true;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!placed) {
|
|
32
|
+
columns.push([event]);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
columns.forEach((col, colIndex) => {
|
|
36
|
+
col.forEach((event) => {
|
|
37
|
+
const start = moment(event.start);
|
|
38
|
+
const end = moment(event.end);
|
|
39
|
+
const duration = end.diff(start, "minutes");
|
|
40
|
+
const startMinutes = start.hours() * 60 + start.minutes();
|
|
41
|
+
positioned.push({
|
|
42
|
+
event,
|
|
43
|
+
top: (startMinutes / 60) * 64,
|
|
44
|
+
height: (duration / 60) * 64,
|
|
45
|
+
leftPercent: (colIndex / columns.length) * 100,
|
|
46
|
+
widthPercent: 100 / columns.length,
|
|
47
|
+
zIndex: colIndex,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return positioned;
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs("div", { className: "flex overflow-x-auto", children: [_jsxs("div", { className: "w-14 shrink-0", children: [_jsx("div", { className: "h-20 border-b border-gray-200" }), _jsx("div", { className: "h-[74px] text-sm text-text border-b border-gray-200 flex items-center justify-center", children: "All-Day" }), HOURS.map((hour) => (_jsx("div", { className: "h-16 text-xs text-text text-right pr-1 border-b border-gray-200", children: moment(`${today} ${hour}`).format("hh:mm a") }, hour)))] }), _jsx("div", { className: "flex-1 grid grid-cols-7 border-l border-t border-gray-200", children: visibleDays.map((day) => {
|
|
54
|
+
const dayMoment = moment(day);
|
|
55
|
+
const dayEvents = events[day] || [];
|
|
56
|
+
const allDayEvents = dayEvents.filter((e) => e.isAllDay);
|
|
57
|
+
const timedEvents = dayEvents.filter((e) => !e.isAllDay);
|
|
58
|
+
const positionedEvents = getPositionedEvents(timedEvents);
|
|
59
|
+
const isToday = day === today;
|
|
60
|
+
const isSelected = day === selectedDay;
|
|
61
|
+
return (_jsxs("div", { className: "relative border-r border-gray-200", children: [_jsx("div", { className: "h-20 flex items-center justify-center border-b border-gray-200 sticky top-0 z-10", children: _jsx("button", { className: clsx("px-6 py-2 rounded-xl", {
|
|
62
|
+
"bg-black": isSelected,
|
|
63
|
+
}), onClick: () => setDay === null || setDay === void 0 ? void 0 : setDay(dayMoment.toDate()), children: _jsxs("div", { className: "flex flex-col gap-1 items-center", children: [_jsx("p", { className: clsx("font-semibold text-sm uppercase text-text", {
|
|
64
|
+
"text-white text-opacity-80": isSelected,
|
|
65
|
+
}), children: dayMoment.format("ddd") }), _jsx("p", { className: clsx("text-xl font-bold", {
|
|
66
|
+
"text-white": isSelected,
|
|
67
|
+
"text-blue-700": isToday && !isSelected,
|
|
68
|
+
}), children: dayMoment.date() })] }) }) }), _jsx("div", { className: "h-[74px] border-b border-gray-200 px-1 py-1", children: allDayEvents.map((event, idx) => (_jsx("div", { className: "mb-1", children: _jsx(EventItem, { event: event }) }, idx))) }), _jsxs("div", { className: "relative h-[1536px] pt-0", children: [HOURS.map((_, j) => (_jsx("div", { className: "absolute left-0 right-0 h-16 border-t border-dashed border-gray-200", style: { top: j * 64 } }, j))), !loading
|
|
69
|
+
? positionedEvents.map(({ event, top, height, leftPercent, widthPercent, zIndex, }, j) => (_jsx("div", { className: "absolute px-1", style: {
|
|
70
|
+
top,
|
|
71
|
+
height,
|
|
72
|
+
left: `${leftPercent}%`,
|
|
73
|
+
width: `${widthPercent}%`,
|
|
74
|
+
zIndex,
|
|
75
|
+
}, children: _jsx(EventItem, { event: event }) }, j)))
|
|
76
|
+
: Array.from({ length: Utils.Number.getRandomInt(0, 5) }).map((_, j) => (_jsx(Skeleton, { className: "absolute left-1 right-1 top-[100px] h-16", style: { top: Utils.Number.getRandomInt(60, 1200) } }, j)))] })] }, day));
|
|
77
|
+
}) })] }));
|
|
78
|
+
}
|
|
@@ -22,7 +22,7 @@ export function usePagination(name, page, setPage, rowsPerPage, setRowsPerPage,
|
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (getParam && !initializedRef.current) {
|
|
24
24
|
const defaultPage = Number(getParam(pageParam)) || 1;
|
|
25
|
-
const defaultRows = Number(getParam(rowsParam)) ||
|
|
25
|
+
const defaultRows = Number(getParam(rowsParam)) || 10;
|
|
26
26
|
setPage(defaultPage);
|
|
27
27
|
setRowsPerPage(defaultRows);
|
|
28
28
|
initializedRef.current = true;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,13 @@ export { default as RadioButton, Props as RadioButtonProps, } from "./components
|
|
|
34
34
|
export { default as TreeCheckbox, Props as TreeCheckboxProps, TreeNode as TreeCheckboxNode, CheckedValues as TreeCheckboxCheckedValues, Utils as TreeCheckboxUtils, } from "./components/tree-checkbox";
|
|
35
35
|
export { default as ColorPicker, Props as ColorPickerProps, } from "./components/color-picker";
|
|
36
36
|
export { default as FileInput, Props as FileInputProps, AcceptedTypes as FileInputAcceptedTypes, FileState as FileInputFileState, UploadStatuses as FileInputUploadStatuses, } from "./components/file-input";
|
|
37
|
+
export { default as FileItem, Props as FileItemProps, } from "./components/file-input/components/file-item";
|
|
37
38
|
export { default as TextEditor, Props as TextEditorProps, } from "./components/text-editor";
|
|
39
|
+
export { default as Calendar, Props as CalendarProps, } from "./components/calendar";
|
|
40
|
+
export { default as MonthCalendar, Props as MonthCalendarProps, } from "./components/month-calendar";
|
|
41
|
+
export { default as WeekCalendar, Props as WeekCalendarProps, } from "./components/week-calendar";
|
|
42
|
+
export { default as DayCalendar, Props as DayCalendarProps, } from "./components/day-calendar";
|
|
43
|
+
export * from "./components/accordion";
|
|
38
44
|
export { default as WithAuthorization, Props as WithAuthorizationProps, } from "./HOC/with-authorization";
|
|
39
45
|
export { default as CanAccessApplication, Props as CanAccessApplicationProps, } from "./HOC/can-access-application";
|
|
40
46
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,OAAO,IAAI,KAAK,EAChB,KAAK,IAAI,UAAU,EACnB,KAAK,IAAI,UAAU,EACnB,MAAM,IAAI,WAAW,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,OAAO,IAAI,KAAK,EAChB,KAAK,IAAI,UAAU,EACnB,KAAK,IAAI,UAAU,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,OAAO,IAAI,KAAK,EAChB,aAAa,EACb,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8CAA8C,CAAC;AAEtD,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,KAAK,IAAI,eAAe,GACzB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,KAAK,IAAI,aAAa,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,KAAK,IAAI,kBAAkB,GAC5B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,KAAK,IAAI,iBAAiB,GAC3B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,gBAAgB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,KAAK,IAAI,sBAAsB,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,KAAK,IAAI,yBAAyB,GACnC,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,12 @@ export { default as RadioButton, } from "./components/radio-button";
|
|
|
37
37
|
export { default as TreeCheckbox, Utils as TreeCheckboxUtils, } from "./components/tree-checkbox";
|
|
38
38
|
export { default as ColorPicker, } from "./components/color-picker";
|
|
39
39
|
export { default as FileInput, AcceptedTypes as FileInputAcceptedTypes, UploadStatuses as FileInputUploadStatuses, } from "./components/file-input";
|
|
40
|
+
export { default as FileItem, } from "./components/file-input/components/file-item";
|
|
40
41
|
export { default as TextEditor, } from "./components/text-editor";
|
|
42
|
+
export { default as Calendar, } from "./components/calendar";
|
|
43
|
+
export { default as MonthCalendar, } from "./components/month-calendar";
|
|
44
|
+
export { default as WeekCalendar, } from "./components/week-calendar";
|
|
45
|
+
export { default as DayCalendar, } from "./components/day-calendar";
|
|
46
|
+
export * from "./components/accordion";
|
|
41
47
|
export { default as WithAuthorization, } from "./HOC/with-authorization";
|
|
42
48
|
export { default as CanAccessApplication, } from "./HOC/can-access-application";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/hoc/can-access-application/index.tsx","../src/hoc/with-authorization/index.tsx","../src/components/alert/index.tsx","../src/components/avatar/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button/index.tsx","../src/components/carousel/index.tsx","../src/components/checkbox/index.tsx","../src/components/color-picker/index.tsx","../src/components/count-down/index.tsx","../src/components/drawer/index.tsx","../src/components/file-input/index.tsx","../src/components/file-input/components/file-item/index.tsx","../src/components/icon/index.tsx","../src/components/input/index.tsx","../src/components/list-item/index.tsx","../src/components/list-item/components/page-button/index.tsx","../src/components/list-item/components/pagination/index.tsx","../src/components/list-item/components/search-input/index.tsx","../src/components/loader/index.tsx","../src/components/menu/index.tsx","../src/components/menu/menu-item/index.tsx","../src/components/modal/index.tsx","../src/components/not-authorized/index.tsx","../src/components/otp-input/index.tsx","../src/components/paper/index.tsx","../src/components/progress-bar/index.tsx","../src/components/radio-button/index.tsx","../src/components/select/index.tsx","../src/components/skeleton/index.tsx","../src/components/stacked-avatars/index.tsx","../src/components/tab/index.tsx","../src/components/table/index.tsx","../src/components/text-editor/index.tsx","../src/components/text-editor/components/toolbar/index.tsx","../src/components/text-editor/utils/index.ts","../src/components/textarea/index.tsx","../src/components/toggle/index.tsx","../src/components/tooltip/index.tsx","../src/components/tree-checkbox/index.tsx","../src/components/tree-checkbox/components/tree-checkbox-item/index.tsx","../src/components/tree-checkbox/utils/index.ts","../src/constants/index.ts","../src/hooks/list-items-hook/types.ts","../src/hooks/list-items-hook/usebulkactions.ts","../src/hooks/list-items-hook/usefilters.ts","../src/hooks/list-items-hook/usepagination.ts","../src/utils/axios/index.ts","../src/utils/color/index.ts","../src/utils/file/index.ts","../src/utils/jwt/index.ts","../src/utils/validation/index.ts"],"version":"5.6.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/hoc/can-access-application/index.tsx","../src/hoc/with-authorization/index.tsx","../src/components/accordion/index.tsx","../src/components/alert/index.tsx","../src/components/avatar/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button/index.tsx","../src/components/calendar/index.tsx","../src/components/carousel/index.tsx","../src/components/checkbox/index.tsx","../src/components/color-picker/index.tsx","../src/components/count-down/index.tsx","../src/components/day-calendar/index.tsx","../src/components/drawer/index.tsx","../src/components/file-input/index.tsx","../src/components/file-input/components/file-item/index.tsx","../src/components/icon/index.tsx","../src/components/input/index.tsx","../src/components/list-item/index.tsx","../src/components/list-item/components/page-button/index.tsx","../src/components/list-item/components/pagination/index.tsx","../src/components/list-item/components/search-input/index.tsx","../src/components/loader/index.tsx","../src/components/menu/index.tsx","../src/components/menu/menu-item/index.tsx","../src/components/modal/index.tsx","../src/components/month-calendar/index.tsx","../src/components/not-authorized/index.tsx","../src/components/otp-input/index.tsx","../src/components/paper/index.tsx","../src/components/progress-bar/index.tsx","../src/components/radio-button/index.tsx","../src/components/select/index.tsx","../src/components/skeleton/index.tsx","../src/components/stacked-avatars/index.tsx","../src/components/tab/index.tsx","../src/components/table/index.tsx","../src/components/text-editor/index.tsx","../src/components/text-editor/components/toolbar/index.tsx","../src/components/text-editor/utils/index.ts","../src/components/textarea/index.tsx","../src/components/toggle/index.tsx","../src/components/tooltip/index.tsx","../src/components/tree-checkbox/index.tsx","../src/components/tree-checkbox/components/tree-checkbox-item/index.tsx","../src/components/tree-checkbox/utils/index.ts","../src/components/week-calendar/index.tsx","../src/constants/index.ts","../src/hooks/list-items-hook/types.ts","../src/hooks/list-items-hook/usebulkactions.ts","../src/hooks/list-items-hook/usefilters.ts","../src/hooks/list-items-hook/usepagination.ts","../src/utils/axios/index.ts","../src/utils/color/index.ts","../src/utils/file/index.ts","../src/utils/jwt/index.ts","../src/utils/validation/index.ts"],"version":"5.6.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAS,MAAM;;;;CAMvC,CAAC;AAEF,eAAO,MAAM,YAAY,QAAS,MAAM,YAMvC,CAAC"}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
export const convertToRGP = (hex) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let B = parseInt(hex.substring(4, 6), 16);
|
|
6
|
-
// Convert to sRGB
|
|
7
|
-
const normalize = (value) => {
|
|
8
|
-
const channel = value / 255;
|
|
9
|
-
return channel <= 0.03928
|
|
10
|
-
? channel / 12.92
|
|
11
|
-
: Math.pow((channel + 0.055) / 1.055, 2.4);
|
|
12
|
-
};
|
|
13
|
-
R = normalize(R);
|
|
14
|
-
G = normalize(G);
|
|
15
|
-
B = normalize(B);
|
|
2
|
+
const R = parseInt(hex.slice(1, 3), 16);
|
|
3
|
+
const G = parseInt(hex.slice(3, 5), 16);
|
|
4
|
+
const B = parseInt(hex.slice(5, 7), 16);
|
|
16
5
|
return { R, G, B };
|
|
17
6
|
};
|
|
18
7
|
export const isColorLight = (hex) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,eAAO,MAAM,IAAI,wDAAmD,CAAC;AACrE,eAAO,MAAM,SAAS,wDAAoC,CAAC;AAC3D,eAAO,MAAM,KAAK,wDAA4C,CAAC;AAC/D,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,eAAO,MAAM,IAAI,wDAAmD,CAAC;AACrE,eAAO,MAAM,SAAS,wDAAoC,CAAC;AAC3D,eAAO,MAAM,KAAK,wDAA4C,CAAC;AAC/D,eAAO,MAAM,WAAW,wDAKpB,CAAC;AACL,eAAO,MAAM,QAAQ,wDAA2C,CAAC;AACjE,eAAO,MAAM,eAAe,wDAEe,CAAC;AAE5C,eAAO,MAAM,UAAU,wDASpB,CAAC;AAEJ,eAAO,MAAM,OAAO,WAAY,MAAM,2DAGb,CAAC"}
|
|
@@ -4,8 +4,11 @@ export const name = Yup.string().min(3).max(50).required("Required");
|
|
|
4
4
|
export const birthDate = Yup.string().required("Required");
|
|
5
5
|
export const email = Yup.string().email().required("Required");
|
|
6
6
|
export const phoneNumber = Yup.string()
|
|
7
|
-
.
|
|
8
|
-
.
|
|
7
|
+
.optional()
|
|
8
|
+
.matches(Utils.String.phoneRegExp, {
|
|
9
|
+
excludeEmptyString: true,
|
|
10
|
+
message: "Phone number is not valid!!!",
|
|
11
|
+
});
|
|
9
12
|
export const password = Yup.string().min(8).required("Required");
|
|
10
13
|
export const confirmPassword = Yup.string()
|
|
11
14
|
.oneOf([Yup.ref("password"), undefined], "Passwords must match")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-react-components",
|
|
3
3
|
"description": "SEA react components library",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc --build && npx postcss src/styles.css -o dist/styles.css && npx postcss src/components/text-editor/style.css -o dist/components/text-editor/style.css",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"lowlight": "^3.3.0",
|
|
47
47
|
"react-dom": "^18.3.1",
|
|
48
48
|
"sea-backend-helpers": "^1.0.0",
|
|
49
|
-
"sea-platform-helpers": "^1.
|
|
49
|
+
"sea-platform-helpers": "^1.3.1",
|
|
50
50
|
"sea-react-components": "file:",
|
|
51
51
|
"yup": "^1.5.0"
|
|
52
52
|
},
|