@majoo-ui/react 1.60.37 → 1.61.0-rc.2
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 +3 -2
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;
|