@majoo-ui/react 1.60.37 → 1.61.0-rc.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/components/datePicker/components/CalendarTimePicker.d.ts +2 -1
- package/components/form/components/InputSignature/InputSignature.d.ts +12 -0
- package/components/form/components/InputSignature/SignatureModal.d.ts +11 -0
- package/components/form/components/InputSignature/index.d.ts +2 -0
- package/components/form/components/index.d.ts +2 -0
- package/index.esm.js +329 -130
- package/index.umd.js +338 -144
- package/package.json +2 -1
|
@@ -4,6 +4,7 @@ interface CalendarProps {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
language?: string;
|
|
6
6
|
onSetDateValue?: Dispatch<SetStateAction<Date[]>>;
|
|
7
|
+
isSingle?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const CalendarTimePicker: ({ selected, disabled, language, onSetDateValue }: CalendarProps) => JSX.Element;
|
|
9
|
+
declare const CalendarTimePicker: ({ selected, disabled, language, onSetDateValue, isSingle }: CalendarProps) => JSX.Element;
|
|
9
10
|
export default CalendarTimePicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CSS } from '@stitches/react';
|
|
3
|
+
interface InputSignatureProps {
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
css?: CSS;
|
|
9
|
+
isMobile?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function InputSignature({ title, onChange, defaultValue, disabled, css, isMobile, }: InputSignatureProps): JSX.Element;
|
|
12
|
+
export default InputSignature;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SignatureModalProps {
|
|
3
|
+
t: any;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
onSave?: (signature: string) => void;
|
|
7
|
+
title?: any;
|
|
8
|
+
isMobile?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const SignatureModal: React.FC<SignatureModalProps>;
|
|
11
|
+
export default SignatureModal;
|
package/index.esm.js
CHANGED
|
@@ -30,7 +30,7 @@ import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
|
30
30
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
31
31
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
32
32
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
33
|
-
import { useTable, useSortBy, useExpanded, usePagination, useRowSelect, useColumnOrder
|
|
33
|
+
import { useMountedLayoutEffect, useTable, useSortBy, useExpanded, usePagination, useRowSelect, useColumnOrder } from 'react-table';
|
|
34
34
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
35
35
|
import * as ADialog from '@radix-ui/react-alert-dialog';
|
|
36
36
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
@@ -53,6 +53,7 @@ import ScrollSpy from 'react-ui-scrollspy';
|
|
|
53
53
|
import ReactCrop, { centerCrop, makeAspectCrop } from 'react-image-crop';
|
|
54
54
|
import imageCompressionComponent from 'browser-image-compression';
|
|
55
55
|
import { useSticky } from 'react-table-sticky';
|
|
56
|
+
import SignaturePad from 'react-signature-pad-wrapper';
|
|
56
57
|
|
|
57
58
|
var _jsxFileName$12 = "/home/alfiantryp/Project/majoo-ui/packages/react/src/majoo-provider/ThemeProvider.js";
|
|
58
59
|
function ThemeProvider({
|
|
@@ -8451,7 +8452,7 @@ const InputText = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
8451
8452
|
}));
|
|
8452
8453
|
});
|
|
8453
8454
|
InputText.propTypes = {
|
|
8454
|
-
|
|
8455
|
+
placeholder: PropTypes.string,
|
|
8455
8456
|
value: PropTypes.string,
|
|
8456
8457
|
onChange: PropTypes.func,
|
|
8457
8458
|
disabled: PropTypes.bool,
|
|
@@ -8525,7 +8526,7 @@ const InputTextArea = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
8525
8526
|
}));
|
|
8526
8527
|
});
|
|
8527
8528
|
InputTextArea.propTypes = {
|
|
8528
|
-
|
|
8529
|
+
placeholder: PropTypes.string,
|
|
8529
8530
|
value: PropTypes.string,
|
|
8530
8531
|
onChange: PropTypes.func,
|
|
8531
8532
|
disabled: PropTypes.bool,
|
|
@@ -18023,14 +18024,18 @@ const CalendarTimePicker = ({
|
|
|
18023
18024
|
selected,
|
|
18024
18025
|
disabled,
|
|
18025
18026
|
language,
|
|
18026
|
-
onSetDateValue
|
|
18027
|
+
onSetDateValue,
|
|
18028
|
+
isSingle
|
|
18027
18029
|
}) => {
|
|
18028
18030
|
const {
|
|
18029
18031
|
t
|
|
18030
18032
|
} = useTranslation('MajooUI/datePicker');
|
|
18031
18033
|
let startTime = moment('00:00', 'HH:mm').toDate();
|
|
18032
18034
|
let endTime = moment('00:00', 'HH:mm').toDate();
|
|
18033
|
-
if (selected && selected.length
|
|
18035
|
+
if (isSingle && selected && selected.length) {
|
|
18036
|
+
startTime = selected[0];
|
|
18037
|
+
}
|
|
18038
|
+
if (!isSingle && selected && selected.length > 1) {
|
|
18034
18039
|
startTime = selected[0];
|
|
18035
18040
|
endTime = selected[1];
|
|
18036
18041
|
}
|
|
@@ -18051,7 +18056,7 @@ const CalendarTimePicker = ({
|
|
|
18051
18056
|
variant: "label",
|
|
18052
18057
|
color: "primary"
|
|
18053
18058
|
}, {
|
|
18054
|
-
children: t('dateFromLabel', 'Dari Tanggal')
|
|
18059
|
+
children: isSingle ? t('label.date', 'Tanggal') : t('dateFromLabel', 'Dari Tanggal')
|
|
18055
18060
|
}), void 0), jsx(Text$1, Object.assign({
|
|
18056
18061
|
variant: "label",
|
|
18057
18062
|
color: "disable"
|
|
@@ -18066,53 +18071,55 @@ const CalendarTimePicker = ({
|
|
|
18066
18071
|
variant: "label",
|
|
18067
18072
|
color: "primary"
|
|
18068
18073
|
}, {
|
|
18069
|
-
children: t('timeFromLabel', 'Dari Pukul')
|
|
18074
|
+
children: isSingle ? t('time', 'Waktu') : t('timeFromLabel', 'Dari Pukul')
|
|
18070
18075
|
}), void 0), jsx(InputTimePicker, {
|
|
18071
18076
|
onChange: val => {
|
|
18072
|
-
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([val.toDate(), selected[1]]);
|
|
18077
|
+
if (isSingle && selected && selected.length && !!onSetDateValue) onSetDateValue(val.toDate());else if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([val.toDate(), selected[1]]);
|
|
18073
18078
|
},
|
|
18074
18079
|
size: "sm",
|
|
18075
18080
|
value: startTime,
|
|
18076
|
-
disabled: !(selected && selected.length > 1)
|
|
18081
|
+
disabled: isSingle ? !(selected && selected.length) : !(selected && selected.length > 1)
|
|
18077
18082
|
}, void 0)]
|
|
18078
|
-
}), void 0),
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
18084
|
-
children: [jsx(Text$1, Object.assign({
|
|
18085
|
-
variant: "label",
|
|
18086
|
-
color: "primary"
|
|
18083
|
+
}), void 0), isSingle ? null : jsxs(React__default.Fragment, {
|
|
18084
|
+
children: [jsx(Separator$2, {
|
|
18085
|
+
orientation: "horizontal"
|
|
18086
|
+
}, void 0), jsxs(Flex$1, Object.assign({
|
|
18087
|
+
direction: "column",
|
|
18088
|
+
gap: 3
|
|
18087
18089
|
}, {
|
|
18088
|
-
children:
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18090
|
+
children: [jsx(Text$1, Object.assign({
|
|
18091
|
+
variant: "label",
|
|
18092
|
+
color: "primary"
|
|
18093
|
+
}, {
|
|
18094
|
+
children: t('dateUntilLabel', 'Hingga Tanggal')
|
|
18095
|
+
}), void 0), jsx(Text$1, Object.assign({
|
|
18096
|
+
variant: "label",
|
|
18097
|
+
color: "disable"
|
|
18098
|
+
}, {
|
|
18099
|
+
children: formattedEndDate
|
|
18100
|
+
}), void 0)]
|
|
18101
|
+
}), void 0), jsxs(Flex$1, Object.assign({
|
|
18102
|
+
direction: "column",
|
|
18103
|
+
gap: 3
|
|
18092
18104
|
}, {
|
|
18093
|
-
children:
|
|
18105
|
+
children: [jsx(Text$1, Object.assign({
|
|
18106
|
+
variant: "label",
|
|
18107
|
+
color: "primary"
|
|
18108
|
+
}, {
|
|
18109
|
+
children: t('timeUntilLabel', 'Hingga Pukul')
|
|
18110
|
+
}), void 0), jsx(InputTimePicker, {
|
|
18111
|
+
onChange: val => {
|
|
18112
|
+
const endDate = moment(endTime).format('YYYY-MM-DD');
|
|
18113
|
+
const newTime = val.format('HH:mm');
|
|
18114
|
+
const newValue = moment(`${endDate} ${newTime}`, 'YYYY-MM-DD HH:mm').toDate();
|
|
18115
|
+
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
18116
|
+
},
|
|
18117
|
+
size: "sm",
|
|
18118
|
+
value: endTime,
|
|
18119
|
+
disabled: !(selected && selected.length > 1)
|
|
18120
|
+
}, void 0)]
|
|
18094
18121
|
}), void 0)]
|
|
18095
|
-
}
|
|
18096
|
-
direction: "column",
|
|
18097
|
-
gap: 3
|
|
18098
|
-
}, {
|
|
18099
|
-
children: [jsx(Text$1, Object.assign({
|
|
18100
|
-
variant: "label",
|
|
18101
|
-
color: "primary"
|
|
18102
|
-
}, {
|
|
18103
|
-
children: t('timeUntilLabel', 'Hingga Pukul')
|
|
18104
|
-
}), void 0), jsx(InputTimePicker, {
|
|
18105
|
-
onChange: val => {
|
|
18106
|
-
const endDate = moment(endTime).format('YYYY-MM-DD');
|
|
18107
|
-
const newTime = val.format('HH:mm');
|
|
18108
|
-
const newValue = moment(`${endDate} ${newTime}`, 'YYYY-MM-DD HH:mm').toDate();
|
|
18109
|
-
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
18110
|
-
},
|
|
18111
|
-
size: "sm",
|
|
18112
|
-
value: endTime,
|
|
18113
|
-
disabled: !(selected && selected.length > 1)
|
|
18114
|
-
}, void 0)]
|
|
18115
|
-
}), void 0)]
|
|
18122
|
+
}, void 0)]
|
|
18116
18123
|
}), void 0);
|
|
18117
18124
|
};
|
|
18118
18125
|
|
|
@@ -18175,17 +18182,22 @@ const WeekdayBox$1 = styled(Box, {
|
|
|
18175
18182
|
});
|
|
18176
18183
|
const CalendarsContainer$1 = styled(Box, {
|
|
18177
18184
|
width: '100%',
|
|
18178
|
-
padding: '$spacing-03',
|
|
18179
18185
|
display: 'inline-flex',
|
|
18180
18186
|
borderRadius: '$lg',
|
|
18181
|
-
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.12)',
|
|
18182
|
-
backgroundColor: '$white',
|
|
18183
18187
|
justifyContent: 'center',
|
|
18184
18188
|
gap: '$spacing-03',
|
|
18185
18189
|
'@md': {
|
|
18186
18190
|
width: 'unset'
|
|
18187
18191
|
}
|
|
18188
18192
|
});
|
|
18193
|
+
const CalenderBoxContainer = styled(Box, {
|
|
18194
|
+
display: 'flex',
|
|
18195
|
+
flexDirection: 'column',
|
|
18196
|
+
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.12)',
|
|
18197
|
+
borderRadius: '$lg',
|
|
18198
|
+
backgroundColor: '$white',
|
|
18199
|
+
padding: '$spacing-03'
|
|
18200
|
+
});
|
|
18189
18201
|
const CalendarItemContainer$1 = styled(Flex$1, {});
|
|
18190
18202
|
const DateContainer$1 = styled(Box, {
|
|
18191
18203
|
width: '100%',
|
|
@@ -18258,7 +18270,7 @@ const MonthButton$1 = styled(Text$1, {
|
|
|
18258
18270
|
}
|
|
18259
18271
|
}
|
|
18260
18272
|
});
|
|
18261
|
-
|
|
18273
|
+
styled('button', {
|
|
18262
18274
|
fontWeight: 600,
|
|
18263
18275
|
fontStyle: 'normal',
|
|
18264
18276
|
fontSize: 14,
|
|
@@ -18654,84 +18666,110 @@ const CalendarBox = ({
|
|
|
18654
18666
|
}, void 0);
|
|
18655
18667
|
};
|
|
18656
18668
|
const renderTime = () => {
|
|
18657
|
-
return jsxs(
|
|
18658
|
-
css: {
|
|
18659
|
-
padding: 4
|
|
18660
|
-
}
|
|
18661
|
-
}, {
|
|
18669
|
+
return jsxs(Fragment$1, {
|
|
18662
18670
|
children: [jsx(Separator$2, {
|
|
18663
|
-
|
|
18664
|
-
|
|
18665
|
-
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
type: TIME_PICKER
|
|
18670
|
-
})),
|
|
18671
|
-
type: "button"
|
|
18671
|
+
orientation: "vertical"
|
|
18672
|
+
}, void 0), jsx(CalendarTimePicker, Object.assign({}, {
|
|
18673
|
+
selected,
|
|
18674
|
+
disabled,
|
|
18675
|
+
language,
|
|
18676
|
+
onSetDateValue
|
|
18672
18677
|
}, {
|
|
18673
|
-
|
|
18678
|
+
isSingle: !multiDatePicker
|
|
18674
18679
|
}), void 0)]
|
|
18675
|
-
}
|
|
18680
|
+
}, void 0);
|
|
18676
18681
|
};
|
|
18677
|
-
const
|
|
18682
|
+
const renderFooterSingleTimePicker = () => {
|
|
18678
18683
|
return jsxs(Box, Object.assign({
|
|
18679
18684
|
css: {
|
|
18680
|
-
|
|
18685
|
+
width: '$full'
|
|
18681
18686
|
}
|
|
18682
18687
|
}, {
|
|
18683
18688
|
children: [jsx(Separator$2, {
|
|
18684
18689
|
css: {
|
|
18685
|
-
my: '$spacing-
|
|
18690
|
+
my: '$spacing-03'
|
|
18691
|
+
}
|
|
18692
|
+
}, void 0), jsx(Flex$1, Object.assign({
|
|
18693
|
+
justify: "end",
|
|
18694
|
+
align: "center",
|
|
18695
|
+
css: {
|
|
18696
|
+
padding: 8
|
|
18686
18697
|
}
|
|
18687
|
-
}, void 0), jsx(ButtonTime, Object.assign({
|
|
18688
|
-
disabled: disabled,
|
|
18689
|
-
onClick: () => onCancel === null || onCancel === void 0 ? void 0 : onCancel(),
|
|
18690
|
-
type: "button"
|
|
18691
18698
|
}, {
|
|
18692
|
-
children:
|
|
18699
|
+
children: jsxs(Flex$1, Object.assign({
|
|
18700
|
+
gap: 3
|
|
18701
|
+
}, {
|
|
18702
|
+
children: [jsx(Button$4, Object.assign({
|
|
18703
|
+
buttonType: "ghost",
|
|
18704
|
+
css: {
|
|
18705
|
+
fontWeight: 600
|
|
18706
|
+
},
|
|
18707
|
+
onClick: onCancel,
|
|
18708
|
+
disabled: disabled,
|
|
18709
|
+
size: "sm",
|
|
18710
|
+
type: "button"
|
|
18711
|
+
}, {
|
|
18712
|
+
children: t('label.cancel', 'Batal', {
|
|
18713
|
+
ns: 'translation'
|
|
18714
|
+
})
|
|
18715
|
+
}), void 0), jsx(Button$4, Object.assign({
|
|
18716
|
+
css: {
|
|
18717
|
+
fontWeight: 600
|
|
18718
|
+
},
|
|
18719
|
+
onClick: onUpdate,
|
|
18720
|
+
disabled: disabled || !(selected && selected.length),
|
|
18721
|
+
size: "sm",
|
|
18722
|
+
type: "button"
|
|
18723
|
+
}, {
|
|
18724
|
+
children: t('label.save', 'Simpan', {
|
|
18725
|
+
ns: 'translation'
|
|
18726
|
+
})
|
|
18727
|
+
}), void 0)]
|
|
18728
|
+
}), void 0)
|
|
18693
18729
|
}), void 0)]
|
|
18694
18730
|
}), void 0);
|
|
18695
18731
|
};
|
|
18696
18732
|
if (calendars.length) {
|
|
18697
|
-
return jsxs(
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
children:
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
height: 'auto'
|
|
18711
|
-
}
|
|
18712
|
-
}, void 0), jsxs(DateContainer$1, {
|
|
18713
|
-
children: [jsx(Separator$2, {
|
|
18733
|
+
return jsxs(CalenderBoxContainer, {
|
|
18734
|
+
children: [jsxs(CalendarsContainer$1, Object.assign({
|
|
18735
|
+
css: containerStyle
|
|
18736
|
+
}, {
|
|
18737
|
+
children: [advanceView, advanceView && jsx(Separator$2, {
|
|
18738
|
+
orientation: "vertical"
|
|
18739
|
+
}, void 0), jsxs(Box, {
|
|
18740
|
+
children: [renderHeader(), jsx(CalendarItemContainer$1, Object.assign({
|
|
18741
|
+
gap: 5
|
|
18742
|
+
}, {
|
|
18743
|
+
children: calendars.map((calendar, index) => jsxs(React__default.Fragment, {
|
|
18744
|
+
children: [index > 0 && jsx(Separator$2, {
|
|
18745
|
+
orientation: "vertical",
|
|
18714
18746
|
css: {
|
|
18715
|
-
|
|
18716
|
-
mt: '$spacing-02'
|
|
18747
|
+
height: 'auto'
|
|
18717
18748
|
}
|
|
18718
|
-
}, void 0),
|
|
18719
|
-
children: [
|
|
18720
|
-
|
|
18721
|
-
|
|
18722
|
-
|
|
18723
|
-
|
|
18724
|
-
|
|
18725
|
-
|
|
18726
|
-
|
|
18727
|
-
|
|
18728
|
-
|
|
18729
|
-
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18749
|
+
}, void 0), jsxs(DateContainer$1, {
|
|
18750
|
+
children: [jsx(Separator$2, {
|
|
18751
|
+
css: {
|
|
18752
|
+
mb: '$spacing-04',
|
|
18753
|
+
mt: '$spacing-02'
|
|
18754
|
+
}
|
|
18755
|
+
}, void 0), pickerState.type === DATE_PICKER && jsxs(Fragment, {
|
|
18756
|
+
children: [renderWeekLabel(calendar), renderDateNumber(calendar)]
|
|
18757
|
+
}, void 0), pickerState.type === MONTH_PICKER && renderMonthsList(), pickerState.type === YEAR_PICKER && renderYearsList(), pickerState.type === YEAR_RANGE_PICKER && renderYearRangesList()]
|
|
18758
|
+
}, void 0)]
|
|
18759
|
+
}, `${calendar.month}${calendar.year}`))
|
|
18760
|
+
}), void 0)]
|
|
18761
|
+
}, void 0), !advanceView && showTimePicker && renderTime(), showTimePicker && pickerState.type === DATE_PICKER && !!advanceView && jsxs(Fragment$1, {
|
|
18762
|
+
children: [jsx(Separator$2, {
|
|
18763
|
+
orientation: "vertical"
|
|
18764
|
+
}, void 0), jsx(CalendarTimePicker, Object.assign({}, {
|
|
18765
|
+
selected,
|
|
18766
|
+
disabled,
|
|
18767
|
+
language,
|
|
18768
|
+
onSetDateValue
|
|
18769
|
+
}), void 0)]
|
|
18770
|
+
}, void 0)]
|
|
18771
|
+
}), void 0), !multiDatePicker && showTimePicker && renderFooterSingleTimePicker(), multiDatePicker && renderFooter()]
|
|
18772
|
+
}, void 0);
|
|
18735
18773
|
}
|
|
18736
18774
|
return null;
|
|
18737
18775
|
};
|
|
@@ -19299,6 +19337,7 @@ const CalendarPicker = _a => {
|
|
|
19299
19337
|
if (dateValue && onChange) {
|
|
19300
19338
|
onChange(dateValue);
|
|
19301
19339
|
}
|
|
19340
|
+
onClose();
|
|
19302
19341
|
};
|
|
19303
19342
|
const dayzedData = useDayzed(Object.assign(Object.assign({}, props), {
|
|
19304
19343
|
date: calendarDate,
|
|
@@ -19315,39 +19354,22 @@ const CalendarPicker = _a => {
|
|
|
19315
19354
|
}
|
|
19316
19355
|
}, [selected]);
|
|
19317
19356
|
useEffect(() => {
|
|
19318
|
-
if (dateValue && !isMultiDatePicker && onChange) {
|
|
19357
|
+
if (dateValue && !(isMultiDatePicker || showTimePicker) && onChange) {
|
|
19319
19358
|
onChange(dateValue);
|
|
19320
19359
|
}
|
|
19321
19360
|
}, [dateValue]);
|
|
19322
|
-
const renderTimePicker = props => {
|
|
19323
|
-
return jsx(Box, Object.assign({
|
|
19324
|
-
css: {
|
|
19325
|
-
padding: '40px 60px'
|
|
19326
|
-
}
|
|
19327
|
-
}, {
|
|
19328
|
-
children: jsx(NativeTimePicker, Object.assign({
|
|
19329
|
-
size: "lg",
|
|
19330
|
-
value: dateValue ? moment(dateValue) : moment(),
|
|
19331
|
-
minDate: minDate,
|
|
19332
|
-
maxDate: maxDate,
|
|
19333
|
-
disabled: disabled,
|
|
19334
|
-
onChange: date => {
|
|
19335
|
-
setDateValue(new Date(date));
|
|
19336
|
-
}
|
|
19337
|
-
}, props), void 0)
|
|
19338
|
-
}), void 0);
|
|
19339
|
-
};
|
|
19340
19361
|
return jsx(CalendarBox, Object.assign({
|
|
19341
|
-
onUpdate: isMultiDatePicker ? updateHandler : undefined,
|
|
19362
|
+
onUpdate: isMultiDatePicker || showTimePicker ? updateHandler : undefined,
|
|
19342
19363
|
onCancel: onClose,
|
|
19343
19364
|
selected: dateValue ? [dateValue] : undefined,
|
|
19344
19365
|
advanceView: advanceView,
|
|
19345
19366
|
disabled: disabled,
|
|
19346
19367
|
onCalendarDateChange: setCalendarDate,
|
|
19347
19368
|
showTimePicker: showTimePicker,
|
|
19348
|
-
renderTimePicker: () => renderTimePicker(timePickerProps),
|
|
19349
19369
|
minDate: minDate,
|
|
19350
19370
|
maxDate: maxDate
|
|
19371
|
+
}, showTimePicker && {
|
|
19372
|
+
onSetDateValue: setDateValue
|
|
19351
19373
|
}, dayzedData), void 0);
|
|
19352
19374
|
};
|
|
19353
19375
|
const CalendarRangePicker = _a => {
|
|
@@ -20318,6 +20340,183 @@ const InputDateRange = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
20318
20340
|
}), void 0);
|
|
20319
20341
|
});
|
|
20320
20342
|
|
|
20343
|
+
const SignatureModal = ({
|
|
20344
|
+
t,
|
|
20345
|
+
open,
|
|
20346
|
+
onOpenChange,
|
|
20347
|
+
onSave,
|
|
20348
|
+
title,
|
|
20349
|
+
isMobile
|
|
20350
|
+
}) => {
|
|
20351
|
+
const signaturePadRef = useRef(null);
|
|
20352
|
+
const handleSave = () => {
|
|
20353
|
+
if (signaturePadRef.current) {
|
|
20354
|
+
const signature = signaturePadRef.current.toDataURL();
|
|
20355
|
+
onSave === null || onSave === void 0 ? void 0 : onSave(signature);
|
|
20356
|
+
}
|
|
20357
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
20358
|
+
};
|
|
20359
|
+
return jsxs(ModalDialog, Object.assign({
|
|
20360
|
+
open: open,
|
|
20361
|
+
onOpenChange: onOpenChange,
|
|
20362
|
+
isMobile: isMobile
|
|
20363
|
+
}, {
|
|
20364
|
+
children: [jsx(ModalDialogTitle, {
|
|
20365
|
+
children: title
|
|
20366
|
+
}, void 0), jsx(ModalDialogContent, {
|
|
20367
|
+
children: jsx(SignaturePad, {
|
|
20368
|
+
ref: signaturePadRef,
|
|
20369
|
+
height: 256,
|
|
20370
|
+
canvasProps: {
|
|
20371
|
+
style: {
|
|
20372
|
+
border: '2px dashed #C0C4C4',
|
|
20373
|
+
borderRadius: '8px'
|
|
20374
|
+
}
|
|
20375
|
+
},
|
|
20376
|
+
options: {
|
|
20377
|
+
penColor: 'black',
|
|
20378
|
+
backgroundColor: foundations.colors.bgGray
|
|
20379
|
+
}
|
|
20380
|
+
}, void 0)
|
|
20381
|
+
}, void 0), jsxs(ModalDialogFooter, Object.assign({
|
|
20382
|
+
css: {
|
|
20383
|
+
display: 'flex',
|
|
20384
|
+
gap: '$compact'
|
|
20385
|
+
}
|
|
20386
|
+
}, {
|
|
20387
|
+
children: [jsx(DialogClose, Object.assign({
|
|
20388
|
+
asChild: true
|
|
20389
|
+
}, {
|
|
20390
|
+
children: jsx(Button$4, Object.assign({
|
|
20391
|
+
buttonType: "ghost",
|
|
20392
|
+
size: "sm"
|
|
20393
|
+
}, {
|
|
20394
|
+
children: t('label.cancel', 'Batal')
|
|
20395
|
+
}), void 0)
|
|
20396
|
+
}), void 0), jsx(Button$4, Object.assign({
|
|
20397
|
+
size: "sm",
|
|
20398
|
+
onClick: handleSave
|
|
20399
|
+
}, {
|
|
20400
|
+
children: t('label.save', 'Simpan')
|
|
20401
|
+
}), void 0)]
|
|
20402
|
+
}), void 0)]
|
|
20403
|
+
}), void 0);
|
|
20404
|
+
};
|
|
20405
|
+
|
|
20406
|
+
const SignatureContainer = styled$1(Flex$1, {
|
|
20407
|
+
position: 'relative',
|
|
20408
|
+
border: '2px dashed $gray300',
|
|
20409
|
+
borderRadius: 8,
|
|
20410
|
+
height: '88px',
|
|
20411
|
+
width: '100%',
|
|
20412
|
+
cursor: 'pointer',
|
|
20413
|
+
transition: '0.2s',
|
|
20414
|
+
transitionDuration: '0.5s',
|
|
20415
|
+
justifyContent: 'center',
|
|
20416
|
+
alignItems: 'center',
|
|
20417
|
+
background: '$bgGray',
|
|
20418
|
+
'&:hover': {
|
|
20419
|
+
border: '2px dashed $primary400',
|
|
20420
|
+
background: '$bgSuccess'
|
|
20421
|
+
},
|
|
20422
|
+
variants: {
|
|
20423
|
+
hasContent: {
|
|
20424
|
+
true: {
|
|
20425
|
+
'&:hover': {
|
|
20426
|
+
background: '$bgGray'
|
|
20427
|
+
}
|
|
20428
|
+
}
|
|
20429
|
+
},
|
|
20430
|
+
showError: {
|
|
20431
|
+
true: {
|
|
20432
|
+
border: '2px dashed $red400',
|
|
20433
|
+
'&:hover': {
|
|
20434
|
+
border: '2px dashed $red300',
|
|
20435
|
+
background: '$bgFailed'
|
|
20436
|
+
}
|
|
20437
|
+
}
|
|
20438
|
+
},
|
|
20439
|
+
disabled: {
|
|
20440
|
+
true: {
|
|
20441
|
+
border: 'none',
|
|
20442
|
+
cursor: 'not-allowed',
|
|
20443
|
+
'&:hover': {
|
|
20444
|
+
border: 'none',
|
|
20445
|
+
background: '$bgGray'
|
|
20446
|
+
}
|
|
20447
|
+
}
|
|
20448
|
+
}
|
|
20449
|
+
}
|
|
20450
|
+
});
|
|
20451
|
+
function InputSignature({
|
|
20452
|
+
title,
|
|
20453
|
+
onChange,
|
|
20454
|
+
defaultValue = '',
|
|
20455
|
+
disabled = false,
|
|
20456
|
+
css,
|
|
20457
|
+
isMobile
|
|
20458
|
+
}) {
|
|
20459
|
+
const {
|
|
20460
|
+
t
|
|
20461
|
+
} = useTranslation(['MajooUI/inputSignature', 'translation']);
|
|
20462
|
+
const [signatureImage, setSignatureImage] = useState(defaultValue);
|
|
20463
|
+
const [open, setOpen] = useState(false);
|
|
20464
|
+
const handleSave = signature => {
|
|
20465
|
+
setSignatureImage(signature);
|
|
20466
|
+
};
|
|
20467
|
+
useMountedLayoutEffect(() => {
|
|
20468
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(signatureImage);
|
|
20469
|
+
}, [signatureImage]);
|
|
20470
|
+
return jsxs(React__default.Fragment, {
|
|
20471
|
+
children: [jsx(SignatureContainer, Object.assign({
|
|
20472
|
+
hasContent: !!signatureImage,
|
|
20473
|
+
onClick: () => {
|
|
20474
|
+
if (!disabled) {
|
|
20475
|
+
setOpen(true);
|
|
20476
|
+
}
|
|
20477
|
+
},
|
|
20478
|
+
disabled: disabled,
|
|
20479
|
+
css: css
|
|
20480
|
+
}, {
|
|
20481
|
+
children: signatureImage ? jsxs(React__default.Fragment, {
|
|
20482
|
+
children: [!disabled ? jsx(Box, Object.assign({
|
|
20483
|
+
css: {
|
|
20484
|
+
position: 'absolute',
|
|
20485
|
+
top: '8px',
|
|
20486
|
+
right: '8px'
|
|
20487
|
+
},
|
|
20488
|
+
onClick: e => {
|
|
20489
|
+
e.stopPropagation();
|
|
20490
|
+
setSignatureImage('');
|
|
20491
|
+
}
|
|
20492
|
+
}, {
|
|
20493
|
+
children: jsx(CloseFilled, {
|
|
20494
|
+
color: foundations.colors.iconRed
|
|
20495
|
+
}, void 0)
|
|
20496
|
+
}), void 0) : null, jsx("img", {
|
|
20497
|
+
src: signatureImage,
|
|
20498
|
+
alt: "signature",
|
|
20499
|
+
style: {
|
|
20500
|
+
height: '100%'
|
|
20501
|
+
}
|
|
20502
|
+
}, void 0)]
|
|
20503
|
+
}, void 0) : jsx(Text$1, Object.assign({
|
|
20504
|
+
variant: "label",
|
|
20505
|
+
color: "disable"
|
|
20506
|
+
}, {
|
|
20507
|
+
children: t('placeholder', 'Tanda tangan disini')
|
|
20508
|
+
}), void 0)
|
|
20509
|
+
}), void 0), jsx(SignatureModal, {
|
|
20510
|
+
t: t,
|
|
20511
|
+
open: open,
|
|
20512
|
+
onOpenChange: setOpen,
|
|
20513
|
+
onSave: handleSave,
|
|
20514
|
+
isMobile: isMobile,
|
|
20515
|
+
title: title || t('modalTitle', 'Tambah Tanda Tangan')
|
|
20516
|
+
}, void 0)]
|
|
20517
|
+
}, void 0);
|
|
20518
|
+
}
|
|
20519
|
+
|
|
20321
20520
|
const _excluded$9 = ["className", "defaultValue", "value", "name", "disabled", "orientation", "dir", "min", "max", "step", "onValueChange", "minStepsBetweenThumbs", "color", "size", "width", "height"];
|
|
20322
20521
|
var _jsxFileName$p = "/home/alfiantryp/Project/majoo-ui/packages/react/src/components/slider/Slider.js";
|
|
20323
20522
|
const StyledSlider = styled$1(SliderPrimitive.Root, {
|
|
@@ -56815,4 +57014,4 @@ const useToggle = initialValue => {
|
|
|
56815
57014
|
return useReducer(toggleReducer, initialValue);
|
|
56816
57015
|
};
|
|
56817
57016
|
|
|
56818
|
-
export { ADVANCE_PICKER, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvancedOption, AlertDialog, AlertDialogCancel, AlertDialogConfirm, AlertDialogContent, AlertDialogDescription, AlertDialogFunction, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger, Avatar, BOTTOM_LEFT_POSITION, BOTTOM_RIGHT_POSITION, Badge, Banner, BannerClose, BannerDescription, BannerLink, BannerTitle, BarChartComponent as BarChart, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button$4 as Button, ButtonDropdown, ButtonGroup$1 as ButtonGroup, ButtonGroupItem, ButtonPrimitive, Card, CardComponent, CardLineColor, CheckboxGroup, CheckboxTable, ColorPicker$1 as ColorPicker, Colors, ContentEditor, ContextMenu, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, CustomDatePicker, DATE_RANGE_PICKER, DEFAULT, DateColumn, DatePicker, DecimalColumn, Device as DevicePreview, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, EditableTable, Flex$1 as Flex, FormGroup, FormHelper, FormLabel, Grid, GridItem, Heading, IconButton, IconContainer, Image, ImageDevicePreview, Input$7 as Input, InputCheckbox, InputColorPicker, InputCombobox, InputCounter, InputCreatable, InputDatePicker, InputDateRange, InputGroup, InputLeftAddon, InputLeftElement, InputMapPicker, InputNumber, InputOTP, InputPrefix, InputRadio, InputRadioGroup, ResourceList as InputResourceList, InputRightAddon, InputRightElement, InputSearchbox, InputSelect, InputSelectCheck, InputSelectTag, InputSuffix, InputSwitch, TagsInput as InputTags, InputText, InputTextArea, InputTimePicker, LAST_7_DAYS, LAST_MONTH, LAST_TWO_MONTHS, LAST_WEEK, LineChart, Link, LoadingBar, MONTHLY, MajooProvider, MapPicker, MemoizedEditableTable, MobileTable, ModalDialog, ModalDialogContent, ModalDialogFooter, ModalDialogTitle, ModalDialogTrigger, NEXT_MONTH, NEXT_WEEK, NativeTimePicker, NotificationBadge, OptionWrapper$2 as OptionWrapper, PREV_MONTH, PREV_WEEK, PageContainer, PageDialog, PageDialogContent, PageDialogFooter, PageDialogTitle, PageDialogTrigger, Pagination, Paper, PaperComponent, Paragraph, PieChartComponent as PieChart, Popover, PopoverClose, PopoverContent, PopoverTrigger, PriceColumn, Progress$1 as Progress, ProgressIndicator, RANGE_CONTROL, RANGE_MONTH, RANGE_PICKER, RANGE_WEEK, ResendOTP, RightSlot, rowExpanderColumn as RowExpanderColumn, rowExpanderMultipleColumn as RowExpanderMultipleColumn, rowMenuColumn as RowMenuColumn, rowSelectionColumn as RowSelectionColumn, rowSelectionWithCallbackColumn as RowSelectionWithCallbackColumn, SINGLE_PICKER, ScrollSync, ScrollSyncNode, SelectBox, SelectContainer, SelectItem, SelectOption, Separator$2 as Separator, Skeleton, Slider, StepWizard, StepWizardContext, StyledBox, StyledDropdown, StyledInput$1 as StyledInput, StyledSpan, StyledTitle$2 as StyledTitle, THIS_MONTH, THIS_WEEK, TODAY, TOP_LEFT_POSITION, TOP_RIGHT_POSITION, Table, TableBody$3 as TableBody, TableCell$3 as TableCell, TableColumn, TableContent$3 as TableContent, TableFoot$2 as TableFoot, TableFootCell$2 as TableFootCell, TableFootRow$2 as TableFootRow, TableHead$3 as TableHead, TableHeadCellContent, TableHeaderCellContainer, TableOfContent, TableOfContentPage, TableRow$3 as TableRow, Tabs$1 as Tabs, TabsContent$1 as TabsContent, TabsList$1 as TabsList, TabsTrigger$1 as TabsTrigger, Tag, TagList, TagStatus, Text$1 as Text, TextVariantsEnum, TimePicker, ToastContext, ToastProvider, Tooltip$1 as Tooltip, UPDATE_PICKER, Upload, WEEKLY, YESTERDAY, addOnCellStyle, advancePickerDate, advancePickerOptionsEn, advancePickerOptionsId, defaultEmptyDataProps, defaultFetchDataParams, pickerReducer, useListOption, useToggle };
|
|
57017
|
+
export { ADVANCE_PICKER, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvancedOption, AlertDialog, AlertDialogCancel, AlertDialogConfirm, AlertDialogContent, AlertDialogDescription, AlertDialogFunction, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger, Avatar, BOTTOM_LEFT_POSITION, BOTTOM_RIGHT_POSITION, Badge, Banner, BannerClose, BannerDescription, BannerLink, BannerTitle, BarChartComponent as BarChart, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button$4 as Button, ButtonDropdown, ButtonGroup$1 as ButtonGroup, ButtonGroupItem, ButtonPrimitive, Card, CardComponent, CardLineColor, CheckboxGroup, CheckboxTable, ColorPicker$1 as ColorPicker, Colors, ContentEditor, ContextMenu, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, CustomDatePicker, DATE_RANGE_PICKER, DEFAULT, DateColumn, DatePicker, DecimalColumn, Device as DevicePreview, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, EditableTable, Flex$1 as Flex, FormGroup, FormHelper, FormLabel, Grid, GridItem, Heading, IconButton, IconContainer, Image, ImageDevicePreview, Input$7 as Input, InputCheckbox, InputColorPicker, InputCombobox, InputCounter, InputCreatable, InputDatePicker, InputDateRange, InputGroup, InputLeftAddon, InputLeftElement, InputMapPicker, InputNumber, InputOTP, InputPrefix, InputRadio, InputRadioGroup, ResourceList as InputResourceList, InputRightAddon, InputRightElement, InputSearchbox, InputSelect, InputSelectCheck, InputSelectTag, InputSignature, InputSuffix, InputSwitch, TagsInput as InputTags, InputText, InputTextArea, InputTimePicker, LAST_7_DAYS, LAST_MONTH, LAST_TWO_MONTHS, LAST_WEEK, LineChart, Link, LoadingBar, MONTHLY, MajooProvider, MapPicker, MemoizedEditableTable, MobileTable, ModalDialog, ModalDialogContent, ModalDialogFooter, ModalDialogTitle, ModalDialogTrigger, NEXT_MONTH, NEXT_WEEK, NativeTimePicker, NotificationBadge, OptionWrapper$2 as OptionWrapper, PREV_MONTH, PREV_WEEK, PageContainer, PageDialog, PageDialogContent, PageDialogFooter, PageDialogTitle, PageDialogTrigger, Pagination, Paper, PaperComponent, Paragraph, PieChartComponent as PieChart, Popover, PopoverClose, PopoverContent, PopoverTrigger, PriceColumn, Progress$1 as Progress, ProgressIndicator, RANGE_CONTROL, RANGE_MONTH, RANGE_PICKER, RANGE_WEEK, ResendOTP, RightSlot, rowExpanderColumn as RowExpanderColumn, rowExpanderMultipleColumn as RowExpanderMultipleColumn, rowMenuColumn as RowMenuColumn, rowSelectionColumn as RowSelectionColumn, rowSelectionWithCallbackColumn as RowSelectionWithCallbackColumn, SINGLE_PICKER, ScrollSync, ScrollSyncNode, SelectBox, SelectContainer, SelectItem, SelectOption, Separator$2 as Separator, Skeleton, Slider, StepWizard, StepWizardContext, StyledBox, StyledDropdown, StyledInput$1 as StyledInput, StyledSpan, StyledTitle$2 as StyledTitle, THIS_MONTH, THIS_WEEK, TODAY, TOP_LEFT_POSITION, TOP_RIGHT_POSITION, Table, TableBody$3 as TableBody, TableCell$3 as TableCell, TableColumn, TableContent$3 as TableContent, TableFoot$2 as TableFoot, TableFootCell$2 as TableFootCell, TableFootRow$2 as TableFootRow, TableHead$3 as TableHead, TableHeadCellContent, TableHeaderCellContainer, TableOfContent, TableOfContentPage, TableRow$3 as TableRow, Tabs$1 as Tabs, TabsContent$1 as TabsContent, TabsList$1 as TabsList, TabsTrigger$1 as TabsTrigger, Tag, TagList, TagStatus, Text$1 as Text, TextVariantsEnum, TimePicker, ToastContext, ToastProvider, Tooltip$1 as Tooltip, UPDATE_PICKER, Upload, WEEKLY, YESTERDAY, addOnCellStyle, advancePickerDate, advancePickerOptionsEn, advancePickerOptionsId, defaultEmptyDataProps, defaultFetchDataParams, pickerReducer, useListOption, useToggle };
|
package/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('react-i18next'), require('moment'), require('@majoo-ui/icons'), require('react/jsx-runtime'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('react-transition-group'), require('@majoo-ui/helpers'), require('superagent'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-hook-form'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('@floating-ui/react'), require('otp-input-react'), require('@radix-ui/react-dialog'), require('@radix-ui/react-toggle-group'), require('dayzed'), require('@radix-ui/react-separator'), require('@radix-ui/react-slider'), require('@radix-ui/react-tabs'), require('@radix-ui/react-accordion'), require('react-table'), require('react-dom'), require('@radix-ui/react-alert-dialog'), require('@radix-ui/react-dropdown-menu'), require('@radix-ui/react-aspect-ratio'), require('react-color/lib/components/common'), require('react-color/lib/helpers/color'), require('react-step-wizard'), require('@monsonjeremy/react-leaflet'), require('leaflet/dist/leaflet.css'), require('leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css'), require('leaflet-defaulticon-compatibility'), require('recharts'), require('draft-js'), require('react-draft-wysiwyg'), require('react-contextmenu'), require('react-loading-skeleton'), require('react-loading-skeleton/dist/skeleton.css'), require('react-virtual'), require('react-ui-scrollspy'), require('react-image-crop'), require('browser-image-compression'), require('react-table-sticky')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', 'react-i18next', 'moment', '@majoo-ui/icons', 'react/jsx-runtime', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', 'react-transition-group', '@majoo-ui/helpers', 'superagent', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-hook-form', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '@floating-ui/react', 'otp-input-react', '@radix-ui/react-dialog', '@radix-ui/react-toggle-group', 'dayzed', '@radix-ui/react-separator', '@radix-ui/react-slider', '@radix-ui/react-tabs', '@radix-ui/react-accordion', 'react-table', 'react-dom', '@radix-ui/react-alert-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-aspect-ratio', 'react-color/lib/components/common', 'react-color/lib/helpers/color', 'react-step-wizard', '@monsonjeremy/react-leaflet', 'leaflet/dist/leaflet.css', 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css', 'leaflet-defaulticon-compatibility', 'recharts', 'draft-js', 'react-draft-wysiwyg', 'react-contextmenu', 'react-loading-skeleton', 'react-loading-skeleton/dist/skeleton.css', 'react-virtual', 'react-ui-scrollspy', 'react-image-crop', 'browser-image-compression', 'react-table-sticky'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.reactI18next, global.moment, global.icons, global.jsxRuntime, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.reactTransitionGroup, global.helpers, global.request, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.reactHookForm, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.react$1, global.OTPInput, global.DialogPrimitive, global.ToggleGroupPrimitive, global.dayzed, global.SeparatorPrimitive, global.SliderPrimitive, global.TabsPrimitive, global.AccordionPrimitive, global.reactTable, global.ReactDOM, global.ADialog, global.DropdownMenuPrimitive, global.AspectRatioPrimitive, global.common, global.color, global.StepWizard$1, global.reactLeaflet, null, null, null, global.recharts, global.draftJs, global.reactDraftWysiwyg, global.reactContextmenu, global.ReactSkeleton, null, global.reactVirtual, global.ScrollSpy, global.ReactCrop, global.imageCompressionComponent, global.reactTableSticky));
|
|
5
|
-
})(this, (function (exports, React, PropTypes, react, core, reactI18next, moment, icons, jsxRuntime, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, reactTransitionGroup, helpers, request, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, reactHookForm, SwitchPrimitive, Downshift, InfiniteScroll, debounce, react$1, OTPInput, DialogPrimitive, ToggleGroupPrimitive, dayzed, SeparatorPrimitive, SliderPrimitive, TabsPrimitive, AccordionPrimitive, reactTable, ReactDOM, ADialog, DropdownMenuPrimitive, AspectRatioPrimitive, common, color, StepWizard$1, reactLeaflet, leaflet_css, leafletDefaulticonCompatibility_css, leafletDefaulticonCompatibility, recharts, draftJs, reactDraftWysiwyg, reactContextmenu, ReactSkeleton, skeleton_css, reactVirtual, ScrollSpy, ReactCrop, imageCompressionComponent, reactTableSticky) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('react-i18next'), require('moment'), require('@majoo-ui/icons'), require('react/jsx-runtime'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('react-transition-group'), require('@majoo-ui/helpers'), require('superagent'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-hook-form'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('@floating-ui/react'), require('otp-input-react'), require('@radix-ui/react-dialog'), require('@radix-ui/react-toggle-group'), require('dayzed'), require('@radix-ui/react-separator'), require('@radix-ui/react-slider'), require('@radix-ui/react-tabs'), require('@radix-ui/react-accordion'), require('react-table'), require('react-dom'), require('@radix-ui/react-alert-dialog'), require('@radix-ui/react-dropdown-menu'), require('@radix-ui/react-aspect-ratio'), require('react-color/lib/components/common'), require('react-color/lib/helpers/color'), require('react-step-wizard'), require('@monsonjeremy/react-leaflet'), require('leaflet/dist/leaflet.css'), require('leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css'), require('leaflet-defaulticon-compatibility'), require('recharts'), require('draft-js'), require('react-draft-wysiwyg'), require('react-contextmenu'), require('react-loading-skeleton'), require('react-loading-skeleton/dist/skeleton.css'), require('react-virtual'), require('react-ui-scrollspy'), require('react-image-crop'), require('browser-image-compression'), require('react-table-sticky'), require('react-signature-pad-wrapper')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', 'react-i18next', 'moment', '@majoo-ui/icons', 'react/jsx-runtime', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', 'react-transition-group', '@majoo-ui/helpers', 'superagent', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-hook-form', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '@floating-ui/react', 'otp-input-react', '@radix-ui/react-dialog', '@radix-ui/react-toggle-group', 'dayzed', '@radix-ui/react-separator', '@radix-ui/react-slider', '@radix-ui/react-tabs', '@radix-ui/react-accordion', 'react-table', 'react-dom', '@radix-ui/react-alert-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-aspect-ratio', 'react-color/lib/components/common', 'react-color/lib/helpers/color', 'react-step-wizard', '@monsonjeremy/react-leaflet', 'leaflet/dist/leaflet.css', 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css', 'leaflet-defaulticon-compatibility', 'recharts', 'draft-js', 'react-draft-wysiwyg', 'react-contextmenu', 'react-loading-skeleton', 'react-loading-skeleton/dist/skeleton.css', 'react-virtual', 'react-ui-scrollspy', 'react-image-crop', 'browser-image-compression', 'react-table-sticky', 'react-signature-pad-wrapper'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.reactI18next, global.moment, global.icons, global.jsxRuntime, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.reactTransitionGroup, global.helpers, global.request, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.reactHookForm, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.react$1, global.OTPInput, global.DialogPrimitive, global.ToggleGroupPrimitive, global.dayzed, global.SeparatorPrimitive, global.SliderPrimitive, global.TabsPrimitive, global.AccordionPrimitive, global.reactTable, global.ReactDOM, global.ADialog, global.DropdownMenuPrimitive, global.AspectRatioPrimitive, global.common, global.color, global.StepWizard$1, global.reactLeaflet, null, null, null, global.recharts, global.draftJs, global.reactDraftWysiwyg, global.reactContextmenu, global.ReactSkeleton, null, global.reactVirtual, global.ScrollSpy, global.ReactCrop, global.imageCompressionComponent, global.reactTableSticky, global.SignaturePad));
|
|
5
|
+
})(this, (function (exports, React, PropTypes, react, core, reactI18next, moment, icons, jsxRuntime, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, reactTransitionGroup, helpers, request, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, reactHookForm, SwitchPrimitive, Downshift, InfiniteScroll, debounce, react$1, OTPInput, DialogPrimitive, ToggleGroupPrimitive, dayzed, SeparatorPrimitive, SliderPrimitive, TabsPrimitive, AccordionPrimitive, reactTable, ReactDOM, ADialog, DropdownMenuPrimitive, AspectRatioPrimitive, common, color, StepWizard$1, reactLeaflet, leaflet_css, leafletDefaulticonCompatibility_css, leafletDefaulticonCompatibility, recharts, draftJs, reactDraftWysiwyg, reactContextmenu, ReactSkeleton, skeleton_css, reactVirtual, ScrollSpy, ReactCrop, imageCompressionComponent, reactTableSticky, SignaturePad) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
var ScrollSpy__default = /*#__PURE__*/_interopDefaultLegacy(ScrollSpy);
|
|
57
57
|
var ReactCrop__default = /*#__PURE__*/_interopDefaultLegacy(ReactCrop);
|
|
58
58
|
var imageCompressionComponent__default = /*#__PURE__*/_interopDefaultLegacy(imageCompressionComponent);
|
|
59
|
+
var SignaturePad__default = /*#__PURE__*/_interopDefaultLegacy(SignaturePad);
|
|
59
60
|
|
|
60
61
|
var _jsxFileName$12 = "/home/alfiantryp/Project/majoo-ui/packages/react/src/majoo-provider/ThemeProvider.js";
|
|
61
62
|
function ThemeProvider({
|
|
@@ -8521,7 +8522,7 @@
|
|
|
8521
8522
|
}));
|
|
8522
8523
|
});
|
|
8523
8524
|
InputText.propTypes = {
|
|
8524
|
-
|
|
8525
|
+
placeholder: PropTypes__default["default"].string,
|
|
8525
8526
|
value: PropTypes__default["default"].string,
|
|
8526
8527
|
onChange: PropTypes__default["default"].func,
|
|
8527
8528
|
disabled: PropTypes__default["default"].bool,
|
|
@@ -8595,7 +8596,7 @@
|
|
|
8595
8596
|
}));
|
|
8596
8597
|
});
|
|
8597
8598
|
InputTextArea.propTypes = {
|
|
8598
|
-
|
|
8599
|
+
placeholder: PropTypes__default["default"].string,
|
|
8599
8600
|
value: PropTypes__default["default"].string,
|
|
8600
8601
|
onChange: PropTypes__default["default"].func,
|
|
8601
8602
|
disabled: PropTypes__default["default"].bool,
|
|
@@ -18228,11 +18229,15 @@
|
|
|
18228
18229
|
var selected = _a.selected,
|
|
18229
18230
|
disabled = _a.disabled,
|
|
18230
18231
|
language = _a.language,
|
|
18231
|
-
onSetDateValue = _a.onSetDateValue
|
|
18232
|
+
onSetDateValue = _a.onSetDateValue,
|
|
18233
|
+
isSingle = _a.isSingle;
|
|
18232
18234
|
var t = reactI18next.useTranslation('MajooUI/datePicker').t;
|
|
18233
18235
|
var startTime = moment__default["default"]('00:00', 'HH:mm').toDate();
|
|
18234
18236
|
var endTime = moment__default["default"]('00:00', 'HH:mm').toDate();
|
|
18235
|
-
if (selected && selected.length
|
|
18237
|
+
if (isSingle && selected && selected.length) {
|
|
18238
|
+
startTime = selected[0];
|
|
18239
|
+
}
|
|
18240
|
+
if (!isSingle && selected && selected.length > 1) {
|
|
18236
18241
|
startTime = selected[0];
|
|
18237
18242
|
endTime = selected[1];
|
|
18238
18243
|
}
|
|
@@ -18253,7 +18258,7 @@
|
|
|
18253
18258
|
variant: "label",
|
|
18254
18259
|
color: "primary"
|
|
18255
18260
|
}, {
|
|
18256
|
-
children: t('dateFromLabel', 'Dari Tanggal')
|
|
18261
|
+
children: isSingle ? t('label.date', 'Tanggal') : t('dateFromLabel', 'Dari Tanggal')
|
|
18257
18262
|
}), void 0), jsxRuntime.jsx(Text$1, __assign({
|
|
18258
18263
|
variant: "label",
|
|
18259
18264
|
color: "disable"
|
|
@@ -18268,53 +18273,55 @@
|
|
|
18268
18273
|
variant: "label",
|
|
18269
18274
|
color: "primary"
|
|
18270
18275
|
}, {
|
|
18271
|
-
children: t('timeFromLabel', 'Dari Pukul')
|
|
18276
|
+
children: isSingle ? t('time', 'Waktu') : t('timeFromLabel', 'Dari Pukul')
|
|
18272
18277
|
}), void 0), jsxRuntime.jsx(InputTimePicker, {
|
|
18273
18278
|
onChange: function (val) {
|
|
18274
|
-
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([val.toDate(), selected[1]]);
|
|
18279
|
+
if (isSingle && selected && selected.length && !!onSetDateValue) onSetDateValue(val.toDate());else if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([val.toDate(), selected[1]]);
|
|
18275
18280
|
},
|
|
18276
18281
|
size: "sm",
|
|
18277
18282
|
value: startTime,
|
|
18278
|
-
disabled: !(selected && selected.length > 1)
|
|
18283
|
+
disabled: isSingle ? !(selected && selected.length) : !(selected && selected.length > 1)
|
|
18279
18284
|
}, void 0)]
|
|
18280
|
-
}), void 0), jsxRuntime.
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
children: [jsxRuntime.jsx(Text$1, __assign({
|
|
18287
|
-
variant: "label",
|
|
18288
|
-
color: "primary"
|
|
18285
|
+
}), void 0), isSingle ? null : jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
18286
|
+
children: [jsxRuntime.jsx(Separator$2, {
|
|
18287
|
+
orientation: "horizontal"
|
|
18288
|
+
}, void 0), jsxRuntime.jsxs(Flex$1, __assign({
|
|
18289
|
+
direction: "column",
|
|
18290
|
+
gap: 3
|
|
18289
18291
|
}, {
|
|
18290
|
-
children:
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18292
|
+
children: [jsxRuntime.jsx(Text$1, __assign({
|
|
18293
|
+
variant: "label",
|
|
18294
|
+
color: "primary"
|
|
18295
|
+
}, {
|
|
18296
|
+
children: t('dateUntilLabel', 'Hingga Tanggal')
|
|
18297
|
+
}), void 0), jsxRuntime.jsx(Text$1, __assign({
|
|
18298
|
+
variant: "label",
|
|
18299
|
+
color: "disable"
|
|
18300
|
+
}, {
|
|
18301
|
+
children: formattedEndDate
|
|
18302
|
+
}), void 0)]
|
|
18303
|
+
}), void 0), jsxRuntime.jsxs(Flex$1, __assign({
|
|
18304
|
+
direction: "column",
|
|
18305
|
+
gap: 3
|
|
18294
18306
|
}, {
|
|
18295
|
-
children:
|
|
18307
|
+
children: [jsxRuntime.jsx(Text$1, __assign({
|
|
18308
|
+
variant: "label",
|
|
18309
|
+
color: "primary"
|
|
18310
|
+
}, {
|
|
18311
|
+
children: t('timeUntilLabel', 'Hingga Pukul')
|
|
18312
|
+
}), void 0), jsxRuntime.jsx(InputTimePicker, {
|
|
18313
|
+
onChange: function (val) {
|
|
18314
|
+
var endDate = moment__default["default"](endTime).format('YYYY-MM-DD');
|
|
18315
|
+
var newTime = val.format('HH:mm');
|
|
18316
|
+
var newValue = moment__default["default"]("".concat(endDate, " ").concat(newTime), 'YYYY-MM-DD HH:mm').toDate();
|
|
18317
|
+
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
18318
|
+
},
|
|
18319
|
+
size: "sm",
|
|
18320
|
+
value: endTime,
|
|
18321
|
+
disabled: !(selected && selected.length > 1)
|
|
18322
|
+
}, void 0)]
|
|
18296
18323
|
}), void 0)]
|
|
18297
|
-
}
|
|
18298
|
-
direction: "column",
|
|
18299
|
-
gap: 3
|
|
18300
|
-
}, {
|
|
18301
|
-
children: [jsxRuntime.jsx(Text$1, __assign({
|
|
18302
|
-
variant: "label",
|
|
18303
|
-
color: "primary"
|
|
18304
|
-
}, {
|
|
18305
|
-
children: t('timeUntilLabel', 'Hingga Pukul')
|
|
18306
|
-
}), void 0), jsxRuntime.jsx(InputTimePicker, {
|
|
18307
|
-
onChange: function (val) {
|
|
18308
|
-
var endDate = moment__default["default"](endTime).format('YYYY-MM-DD');
|
|
18309
|
-
var newTime = val.format('HH:mm');
|
|
18310
|
-
var newValue = moment__default["default"]("".concat(endDate, " ").concat(newTime), 'YYYY-MM-DD HH:mm').toDate();
|
|
18311
|
-
if (selected && selected.length > 1 && !!onSetDateValue) onSetDateValue([selected[0], newValue]);
|
|
18312
|
-
},
|
|
18313
|
-
size: "sm",
|
|
18314
|
-
value: endTime,
|
|
18315
|
-
disabled: !(selected && selected.length > 1)
|
|
18316
|
-
}, void 0)]
|
|
18317
|
-
}), void 0)]
|
|
18324
|
+
}, void 0)]
|
|
18318
18325
|
}), void 0);
|
|
18319
18326
|
};
|
|
18320
18327
|
|
|
@@ -18376,17 +18383,22 @@
|
|
|
18376
18383
|
});
|
|
18377
18384
|
var CalendarsContainer$1 = styled(Box, {
|
|
18378
18385
|
width: '100%',
|
|
18379
|
-
padding: '$spacing-03',
|
|
18380
18386
|
display: 'inline-flex',
|
|
18381
18387
|
borderRadius: '$lg',
|
|
18382
|
-
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.12)',
|
|
18383
|
-
backgroundColor: '$white',
|
|
18384
18388
|
justifyContent: 'center',
|
|
18385
18389
|
gap: '$spacing-03',
|
|
18386
18390
|
'@md': {
|
|
18387
18391
|
width: 'unset'
|
|
18388
18392
|
}
|
|
18389
18393
|
});
|
|
18394
|
+
var CalenderBoxContainer = styled(Box, {
|
|
18395
|
+
display: 'flex',
|
|
18396
|
+
flexDirection: 'column',
|
|
18397
|
+
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.12)',
|
|
18398
|
+
borderRadius: '$lg',
|
|
18399
|
+
backgroundColor: '$white',
|
|
18400
|
+
padding: '$spacing-03'
|
|
18401
|
+
});
|
|
18390
18402
|
var CalendarItemContainer$1 = styled(Flex$1, {});
|
|
18391
18403
|
var DateContainer$1 = styled(Box, {
|
|
18392
18404
|
width: '100%',
|
|
@@ -18459,7 +18471,7 @@
|
|
|
18459
18471
|
}
|
|
18460
18472
|
}
|
|
18461
18473
|
});
|
|
18462
|
-
|
|
18474
|
+
styled('button', {
|
|
18463
18475
|
fontWeight: 600,
|
|
18464
18476
|
fontStyle: 'normal',
|
|
18465
18477
|
fontSize: 14,
|
|
@@ -18505,9 +18517,9 @@
|
|
|
18505
18517
|
selected = _a.selected,
|
|
18506
18518
|
containerStyle = _a.containerStyle,
|
|
18507
18519
|
disabled = _a.disabled,
|
|
18508
|
-
showTimePicker = _a.showTimePicker
|
|
18509
|
-
|
|
18510
|
-
minDate = _a.minDate,
|
|
18520
|
+
showTimePicker = _a.showTimePicker;
|
|
18521
|
+
_a.renderTimePicker;
|
|
18522
|
+
var minDate = _a.minDate,
|
|
18511
18523
|
maxDate = _a.maxDate,
|
|
18512
18524
|
allowReset = _a.allowReset,
|
|
18513
18525
|
onSetDateValue = _a.onSetDateValue;
|
|
@@ -18886,92 +18898,112 @@
|
|
|
18886
18898
|
}, void 0);
|
|
18887
18899
|
};
|
|
18888
18900
|
var renderTime = function renderTime() {
|
|
18889
|
-
return jsxRuntime.jsxs(
|
|
18890
|
-
css: {
|
|
18891
|
-
padding: 4
|
|
18892
|
-
}
|
|
18893
|
-
}, {
|
|
18901
|
+
return jsxRuntime.jsxs(React.Fragment, {
|
|
18894
18902
|
children: [jsxRuntime.jsx(Separator$2, {
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
}, void 0), jsxRuntime.jsx(ButtonTime, __assign({
|
|
18903
|
+
orientation: "vertical"
|
|
18904
|
+
}, void 0), jsxRuntime.jsx(CalendarTimePicker, __assign({}, {
|
|
18905
|
+
selected: selected,
|
|
18899
18906
|
disabled: disabled,
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
return __assign(__assign({}, current), {
|
|
18903
|
-
type: TIME_PICKER
|
|
18904
|
-
});
|
|
18905
|
-
});
|
|
18906
|
-
},
|
|
18907
|
-
type: "button"
|
|
18907
|
+
language: language,
|
|
18908
|
+
onSetDateValue: onSetDateValue
|
|
18908
18909
|
}, {
|
|
18909
|
-
|
|
18910
|
+
isSingle: !multiDatePicker
|
|
18910
18911
|
}), void 0)]
|
|
18911
|
-
}
|
|
18912
|
+
}, void 0);
|
|
18912
18913
|
};
|
|
18913
|
-
var
|
|
18914
|
+
var renderFooterSingleTimePicker = function renderFooterSingleTimePicker() {
|
|
18914
18915
|
return jsxRuntime.jsxs(Box, __assign({
|
|
18915
18916
|
css: {
|
|
18916
|
-
|
|
18917
|
+
width: '$full'
|
|
18917
18918
|
}
|
|
18918
18919
|
}, {
|
|
18919
18920
|
children: [jsxRuntime.jsx(Separator$2, {
|
|
18920
18921
|
css: {
|
|
18921
|
-
my: '$spacing-
|
|
18922
|
+
my: '$spacing-03'
|
|
18923
|
+
}
|
|
18924
|
+
}, void 0), jsxRuntime.jsx(Flex$1, __assign({
|
|
18925
|
+
justify: "end",
|
|
18926
|
+
align: "center",
|
|
18927
|
+
css: {
|
|
18928
|
+
padding: 8
|
|
18922
18929
|
}
|
|
18923
|
-
}, void 0), jsxRuntime.jsx(ButtonTime, __assign({
|
|
18924
|
-
disabled: disabled,
|
|
18925
|
-
onClick: function () {
|
|
18926
|
-
return onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
18927
|
-
},
|
|
18928
|
-
type: "button"
|
|
18929
18930
|
}, {
|
|
18930
|
-
children:
|
|
18931
|
+
children: jsxRuntime.jsxs(Flex$1, __assign({
|
|
18932
|
+
gap: 3
|
|
18933
|
+
}, {
|
|
18934
|
+
children: [jsxRuntime.jsx(Button$4, __assign({
|
|
18935
|
+
buttonType: "ghost",
|
|
18936
|
+
css: {
|
|
18937
|
+
fontWeight: 600
|
|
18938
|
+
},
|
|
18939
|
+
onClick: onCancel,
|
|
18940
|
+
disabled: disabled,
|
|
18941
|
+
size: "sm",
|
|
18942
|
+
type: "button"
|
|
18943
|
+
}, {
|
|
18944
|
+
children: t('label.cancel', 'Batal', {
|
|
18945
|
+
ns: 'translation'
|
|
18946
|
+
})
|
|
18947
|
+
}), void 0), jsxRuntime.jsx(Button$4, __assign({
|
|
18948
|
+
css: {
|
|
18949
|
+
fontWeight: 600
|
|
18950
|
+
},
|
|
18951
|
+
onClick: onUpdate,
|
|
18952
|
+
disabled: disabled || !(selected && selected.length),
|
|
18953
|
+
size: "sm",
|
|
18954
|
+
type: "button"
|
|
18955
|
+
}, {
|
|
18956
|
+
children: t('label.save', 'Simpan', {
|
|
18957
|
+
ns: 'translation'
|
|
18958
|
+
})
|
|
18959
|
+
}), void 0)]
|
|
18960
|
+
}), void 0)
|
|
18931
18961
|
}), void 0)]
|
|
18932
18962
|
}), void 0);
|
|
18933
18963
|
};
|
|
18934
18964
|
if (calendars.length) {
|
|
18935
|
-
return jsxRuntime.jsxs(
|
|
18936
|
-
|
|
18937
|
-
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
height: 'auto'
|
|
18950
|
-
}
|
|
18951
|
-
}, void 0), jsxRuntime.jsxs(DateContainer$1, {
|
|
18952
|
-
children: [jsxRuntime.jsx(Separator$2, {
|
|
18965
|
+
return jsxRuntime.jsxs(CalenderBoxContainer, {
|
|
18966
|
+
children: [jsxRuntime.jsxs(CalendarsContainer$1, __assign({
|
|
18967
|
+
css: containerStyle
|
|
18968
|
+
}, {
|
|
18969
|
+
children: [advanceView, advanceView && jsxRuntime.jsx(Separator$2, {
|
|
18970
|
+
orientation: "vertical"
|
|
18971
|
+
}, void 0), jsxRuntime.jsxs(Box, {
|
|
18972
|
+
children: [renderHeader(), jsxRuntime.jsx(CalendarItemContainer$1, __assign({
|
|
18973
|
+
gap: 5
|
|
18974
|
+
}, {
|
|
18975
|
+
children: calendars.map(function (calendar, index) {
|
|
18976
|
+
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
18977
|
+
children: [index > 0 && jsxRuntime.jsx(Separator$2, {
|
|
18978
|
+
orientation: "vertical",
|
|
18953
18979
|
css: {
|
|
18954
|
-
|
|
18955
|
-
mt: '$spacing-02'
|
|
18980
|
+
height: 'auto'
|
|
18956
18981
|
}
|
|
18957
|
-
}, void 0),
|
|
18958
|
-
children: [
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18962
|
-
|
|
18963
|
-
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18973
|
-
|
|
18974
|
-
|
|
18982
|
+
}, void 0), jsxRuntime.jsxs(DateContainer$1, {
|
|
18983
|
+
children: [jsxRuntime.jsx(Separator$2, {
|
|
18984
|
+
css: {
|
|
18985
|
+
mb: '$spacing-04',
|
|
18986
|
+
mt: '$spacing-02'
|
|
18987
|
+
}
|
|
18988
|
+
}, void 0), pickerState.type === DATE_PICKER && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
18989
|
+
children: [renderWeekLabel(calendar), renderDateNumber(calendar)]
|
|
18990
|
+
}, void 0), pickerState.type === MONTH_PICKER && renderMonthsList(), pickerState.type === YEAR_PICKER && renderYearsList(), pickerState.type === YEAR_RANGE_PICKER && renderYearRangesList()]
|
|
18991
|
+
}, void 0)]
|
|
18992
|
+
}, "".concat(calendar.month).concat(calendar.year));
|
|
18993
|
+
})
|
|
18994
|
+
}), void 0)]
|
|
18995
|
+
}, void 0), !advanceView && showTimePicker && renderTime(), showTimePicker && pickerState.type === DATE_PICKER && !!advanceView && jsxRuntime.jsxs(React.Fragment, {
|
|
18996
|
+
children: [jsxRuntime.jsx(Separator$2, {
|
|
18997
|
+
orientation: "vertical"
|
|
18998
|
+
}, void 0), jsxRuntime.jsx(CalendarTimePicker, __assign({}, {
|
|
18999
|
+
selected: selected,
|
|
19000
|
+
disabled: disabled,
|
|
19001
|
+
language: language,
|
|
19002
|
+
onSetDateValue: onSetDateValue
|
|
19003
|
+
}), void 0)]
|
|
19004
|
+
}, void 0)]
|
|
19005
|
+
}), void 0), !multiDatePicker && showTimePicker && renderFooterSingleTimePicker(), multiDatePicker && renderFooter()]
|
|
19006
|
+
}, void 0);
|
|
18975
19007
|
}
|
|
18976
19008
|
return null;
|
|
18977
19009
|
};
|
|
@@ -19572,6 +19604,7 @@
|
|
|
19572
19604
|
if (dateValue && onChange) {
|
|
19573
19605
|
onChange(dateValue);
|
|
19574
19606
|
}
|
|
19607
|
+
onClose();
|
|
19575
19608
|
};
|
|
19576
19609
|
var dayzedData = dayzed.useDayzed(__assign(__assign({}, props), {
|
|
19577
19610
|
date: calendarDate,
|
|
@@ -19588,41 +19621,22 @@
|
|
|
19588
19621
|
}
|
|
19589
19622
|
}, [selected]);
|
|
19590
19623
|
React.useEffect(function () {
|
|
19591
|
-
if (dateValue && !isMultiDatePicker && onChange) {
|
|
19624
|
+
if (dateValue && !(isMultiDatePicker || showTimePicker) && onChange) {
|
|
19592
19625
|
onChange(dateValue);
|
|
19593
19626
|
}
|
|
19594
19627
|
}, [dateValue]);
|
|
19595
|
-
var renderTimePicker = function renderTimePicker(props) {
|
|
19596
|
-
return jsxRuntime.jsx(Box, __assign({
|
|
19597
|
-
css: {
|
|
19598
|
-
padding: '40px 60px'
|
|
19599
|
-
}
|
|
19600
|
-
}, {
|
|
19601
|
-
children: jsxRuntime.jsx(NativeTimePicker, __assign({
|
|
19602
|
-
size: "lg",
|
|
19603
|
-
value: dateValue ? moment__default["default"](dateValue) : moment__default["default"](),
|
|
19604
|
-
minDate: minDate,
|
|
19605
|
-
maxDate: maxDate,
|
|
19606
|
-
disabled: disabled,
|
|
19607
|
-
onChange: function (date) {
|
|
19608
|
-
setDateValue(new Date(date));
|
|
19609
|
-
}
|
|
19610
|
-
}, props), void 0)
|
|
19611
|
-
}), void 0);
|
|
19612
|
-
};
|
|
19613
19628
|
return jsxRuntime.jsx(CalendarBox, __assign({
|
|
19614
|
-
onUpdate: isMultiDatePicker ? updateHandler : undefined,
|
|
19629
|
+
onUpdate: isMultiDatePicker || showTimePicker ? updateHandler : undefined,
|
|
19615
19630
|
onCancel: onClose,
|
|
19616
19631
|
selected: dateValue ? [dateValue] : undefined,
|
|
19617
19632
|
advanceView: advanceView,
|
|
19618
19633
|
disabled: disabled,
|
|
19619
19634
|
onCalendarDateChange: setCalendarDate,
|
|
19620
19635
|
showTimePicker: showTimePicker,
|
|
19621
|
-
renderTimePicker: function () {
|
|
19622
|
-
return renderTimePicker(timePickerProps);
|
|
19623
|
-
},
|
|
19624
19636
|
minDate: minDate,
|
|
19625
19637
|
maxDate: maxDate
|
|
19638
|
+
}, showTimePicker && {
|
|
19639
|
+
onSetDateValue: setDateValue
|
|
19626
19640
|
}, dayzedData), void 0);
|
|
19627
19641
|
};
|
|
19628
19642
|
var CalendarRangePicker = function CalendarRangePicker(_a) {
|
|
@@ -20630,6 +20644,185 @@
|
|
|
20630
20644
|
}), void 0);
|
|
20631
20645
|
});
|
|
20632
20646
|
|
|
20647
|
+
var SignatureModal = function SignatureModal(_a) {
|
|
20648
|
+
var t = _a.t,
|
|
20649
|
+
open = _a.open,
|
|
20650
|
+
onOpenChange = _a.onOpenChange,
|
|
20651
|
+
onSave = _a.onSave,
|
|
20652
|
+
title = _a.title,
|
|
20653
|
+
isMobile = _a.isMobile;
|
|
20654
|
+
var signaturePadRef = React.useRef(null);
|
|
20655
|
+
var handleSave = function handleSave() {
|
|
20656
|
+
if (signaturePadRef.current) {
|
|
20657
|
+
var signature = signaturePadRef.current.toDataURL();
|
|
20658
|
+
onSave === null || onSave === void 0 ? void 0 : onSave(signature);
|
|
20659
|
+
}
|
|
20660
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
20661
|
+
};
|
|
20662
|
+
return jsxRuntime.jsxs(ModalDialog, __assign({
|
|
20663
|
+
open: open,
|
|
20664
|
+
onOpenChange: onOpenChange,
|
|
20665
|
+
isMobile: isMobile
|
|
20666
|
+
}, {
|
|
20667
|
+
children: [jsxRuntime.jsx(ModalDialogTitle, {
|
|
20668
|
+
children: title
|
|
20669
|
+
}, void 0), jsxRuntime.jsx(ModalDialogContent, {
|
|
20670
|
+
children: jsxRuntime.jsx(SignaturePad__default["default"], {
|
|
20671
|
+
ref: signaturePadRef,
|
|
20672
|
+
height: 256,
|
|
20673
|
+
canvasProps: {
|
|
20674
|
+
style: {
|
|
20675
|
+
border: '2px dashed #C0C4C4',
|
|
20676
|
+
borderRadius: '8px'
|
|
20677
|
+
}
|
|
20678
|
+
},
|
|
20679
|
+
options: {
|
|
20680
|
+
penColor: 'black',
|
|
20681
|
+
backgroundColor: core.foundations.colors.bgGray
|
|
20682
|
+
}
|
|
20683
|
+
}, void 0)
|
|
20684
|
+
}, void 0), jsxRuntime.jsxs(ModalDialogFooter, __assign({
|
|
20685
|
+
css: {
|
|
20686
|
+
display: 'flex',
|
|
20687
|
+
gap: '$compact'
|
|
20688
|
+
}
|
|
20689
|
+
}, {
|
|
20690
|
+
children: [jsxRuntime.jsx(DialogClose, __assign({
|
|
20691
|
+
asChild: true
|
|
20692
|
+
}, {
|
|
20693
|
+
children: jsxRuntime.jsx(Button$4, __assign({
|
|
20694
|
+
buttonType: "ghost",
|
|
20695
|
+
size: "sm"
|
|
20696
|
+
}, {
|
|
20697
|
+
children: t('label.cancel', 'Batal')
|
|
20698
|
+
}), void 0)
|
|
20699
|
+
}), void 0), jsxRuntime.jsx(Button$4, __assign({
|
|
20700
|
+
size: "sm",
|
|
20701
|
+
onClick: handleSave
|
|
20702
|
+
}, {
|
|
20703
|
+
children: t('label.save', 'Simpan')
|
|
20704
|
+
}), void 0)]
|
|
20705
|
+
}), void 0)]
|
|
20706
|
+
}), void 0);
|
|
20707
|
+
};
|
|
20708
|
+
|
|
20709
|
+
var SignatureContainer = react.styled(Flex$1, {
|
|
20710
|
+
position: 'relative',
|
|
20711
|
+
border: '2px dashed $gray300',
|
|
20712
|
+
borderRadius: 8,
|
|
20713
|
+
height: '88px',
|
|
20714
|
+
width: '100%',
|
|
20715
|
+
cursor: 'pointer',
|
|
20716
|
+
transition: '0.2s',
|
|
20717
|
+
transitionDuration: '0.5s',
|
|
20718
|
+
justifyContent: 'center',
|
|
20719
|
+
alignItems: 'center',
|
|
20720
|
+
background: '$bgGray',
|
|
20721
|
+
'&:hover': {
|
|
20722
|
+
border: '2px dashed $primary400',
|
|
20723
|
+
background: '$bgSuccess'
|
|
20724
|
+
},
|
|
20725
|
+
variants: {
|
|
20726
|
+
hasContent: {
|
|
20727
|
+
true: {
|
|
20728
|
+
'&:hover': {
|
|
20729
|
+
background: '$bgGray'
|
|
20730
|
+
}
|
|
20731
|
+
}
|
|
20732
|
+
},
|
|
20733
|
+
showError: {
|
|
20734
|
+
true: {
|
|
20735
|
+
border: '2px dashed $red400',
|
|
20736
|
+
'&:hover': {
|
|
20737
|
+
border: '2px dashed $red300',
|
|
20738
|
+
background: '$bgFailed'
|
|
20739
|
+
}
|
|
20740
|
+
}
|
|
20741
|
+
},
|
|
20742
|
+
disabled: {
|
|
20743
|
+
true: {
|
|
20744
|
+
border: 'none',
|
|
20745
|
+
cursor: 'not-allowed',
|
|
20746
|
+
'&:hover': {
|
|
20747
|
+
border: 'none',
|
|
20748
|
+
background: '$bgGray'
|
|
20749
|
+
}
|
|
20750
|
+
}
|
|
20751
|
+
}
|
|
20752
|
+
}
|
|
20753
|
+
});
|
|
20754
|
+
function InputSignature(_a) {
|
|
20755
|
+
var title = _a.title,
|
|
20756
|
+
onChange = _a.onChange,
|
|
20757
|
+
_b = _a.defaultValue,
|
|
20758
|
+
defaultValue = _b === void 0 ? '' : _b,
|
|
20759
|
+
_c = _a.disabled,
|
|
20760
|
+
disabled = _c === void 0 ? false : _c,
|
|
20761
|
+
css = _a.css,
|
|
20762
|
+
isMobile = _a.isMobile;
|
|
20763
|
+
var t = reactI18next.useTranslation(['MajooUI/inputSignature', 'translation']).t;
|
|
20764
|
+
var _d = React.useState(defaultValue),
|
|
20765
|
+
signatureImage = _d[0],
|
|
20766
|
+
setSignatureImage = _d[1];
|
|
20767
|
+
var _e = React.useState(false),
|
|
20768
|
+
open = _e[0],
|
|
20769
|
+
setOpen = _e[1];
|
|
20770
|
+
var handleSave = function handleSave(signature) {
|
|
20771
|
+
setSignatureImage(signature);
|
|
20772
|
+
};
|
|
20773
|
+
reactTable.useMountedLayoutEffect(function () {
|
|
20774
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(signatureImage);
|
|
20775
|
+
}, [signatureImage]);
|
|
20776
|
+
return jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
20777
|
+
children: [jsxRuntime.jsx(SignatureContainer, __assign({
|
|
20778
|
+
hasContent: !!signatureImage,
|
|
20779
|
+
onClick: function () {
|
|
20780
|
+
if (!disabled) {
|
|
20781
|
+
setOpen(true);
|
|
20782
|
+
}
|
|
20783
|
+
},
|
|
20784
|
+
disabled: disabled,
|
|
20785
|
+
css: css
|
|
20786
|
+
}, {
|
|
20787
|
+
children: signatureImage ? jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
20788
|
+
children: [!disabled ? jsxRuntime.jsx(Box, __assign({
|
|
20789
|
+
css: {
|
|
20790
|
+
position: 'absolute',
|
|
20791
|
+
top: '8px',
|
|
20792
|
+
right: '8px'
|
|
20793
|
+
},
|
|
20794
|
+
onClick: function (e) {
|
|
20795
|
+
e.stopPropagation();
|
|
20796
|
+
setSignatureImage('');
|
|
20797
|
+
}
|
|
20798
|
+
}, {
|
|
20799
|
+
children: jsxRuntime.jsx(icons.CloseFilled, {
|
|
20800
|
+
color: core.foundations.colors.iconRed
|
|
20801
|
+
}, void 0)
|
|
20802
|
+
}), void 0) : null, jsxRuntime.jsx("img", {
|
|
20803
|
+
src: signatureImage,
|
|
20804
|
+
alt: "signature",
|
|
20805
|
+
style: {
|
|
20806
|
+
height: '100%'
|
|
20807
|
+
}
|
|
20808
|
+
}, void 0)]
|
|
20809
|
+
}, void 0) : jsxRuntime.jsx(Text$1, __assign({
|
|
20810
|
+
variant: "label",
|
|
20811
|
+
color: "disable"
|
|
20812
|
+
}, {
|
|
20813
|
+
children: t('placeholder', 'Tanda tangan disini')
|
|
20814
|
+
}), void 0)
|
|
20815
|
+
}), void 0), jsxRuntime.jsx(SignatureModal, {
|
|
20816
|
+
t: t,
|
|
20817
|
+
open: open,
|
|
20818
|
+
onOpenChange: setOpen,
|
|
20819
|
+
onSave: handleSave,
|
|
20820
|
+
isMobile: isMobile,
|
|
20821
|
+
title: title || t('modalTitle', 'Tambah Tanda Tangan')
|
|
20822
|
+
}, void 0)]
|
|
20823
|
+
}, void 0);
|
|
20824
|
+
}
|
|
20825
|
+
|
|
20633
20826
|
const _excluded$9 = ["className", "defaultValue", "value", "name", "disabled", "orientation", "dir", "min", "max", "step", "onValueChange", "minStepsBetweenThumbs", "color", "size", "width", "height"];
|
|
20634
20827
|
var _jsxFileName$p = "/home/alfiantryp/Project/majoo-ui/packages/react/src/components/slider/Slider.js";
|
|
20635
20828
|
const StyledSlider = react.styled(SliderPrimitive__namespace.Root, {
|
|
@@ -57645,6 +57838,7 @@
|
|
|
57645
57838
|
exports.InputSelect = InputSelect;
|
|
57646
57839
|
exports.InputSelectCheck = InputSelectCheck;
|
|
57647
57840
|
exports.InputSelectTag = InputSelectTag;
|
|
57841
|
+
exports.InputSignature = InputSignature;
|
|
57648
57842
|
exports.InputSuffix = InputSuffix;
|
|
57649
57843
|
exports.InputSwitch = InputSwitch;
|
|
57650
57844
|
exports.InputTags = TagsInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@majoo-ui/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.61.0-rc.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@majoo-ui/core": "^1.31.3",
|
|
6
6
|
"@majoo-ui/helpers": "^1.30.5",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"react-hook-form": "^7.31.3",
|
|
72
72
|
"yup": "^0.32.11",
|
|
73
73
|
"@radix-ui/react-dialog": "^1.0.0",
|
|
74
|
+
"react-signature-pad-wrapper": "^4.0.4",
|
|
74
75
|
"@radix-ui/react-dismissable-layer": "^1.0.3"
|
|
75
76
|
}
|
|
76
77
|
}
|