@dynamic-framework/ui-react 1.1.5 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dynamic-ui-all.css +1 -0
- package/dist/css/dynamic-ui-react.css +1 -1
- package/dist/css/dynamic-ui.css +1 -0
- package/dist/index.esm.js +192 -54
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +206 -54
- package/dist/index.js.map +1 -1
- package/dist/types/components/MBoxFile.d.ts +1 -1
- package/dist/types/components/MCard.d.ts +7 -0
- package/dist/types/components/MCardAccount.d.ts +13 -0
- package/dist/types/components/MCardBody.d.ts +6 -0
- package/dist/types/components/MCardFooter.d.ts +6 -0
- package/dist/types/components/MCardHeader.d.ts +6 -0
- package/dist/types/components/MCarousel.d.ts +7 -0
- package/dist/types/components/MCarouselSlide.d.ts +5 -0
- package/dist/types/components/MCollapse.d.ts +1 -1
- package/dist/types/components/MCurrencyText.d.ts +1 -2
- package/dist/types/components/MDatePicker.d.ts +20 -0
- package/dist/types/components/MDatePickerHeader.d.ts +19 -0
- package/dist/types/components/MDatePickerInput.d.ts +9 -0
- package/dist/types/components/MDatePickerTime.d.ts +9 -0
- package/dist/types/components/MFormikInput.d.ts +1 -1
- package/dist/types/components/MFormikInputCurrency.d.ts +7 -0
- package/dist/types/components/MFormikInputSelect.d.ts +1 -1
- package/dist/types/components/MInputCurrency.d.ts +3 -1
- package/dist/types/components/MList.d.ts +10 -0
- package/dist/types/components/MListItem.d.ts +10 -0
- package/dist/types/components/MListItemMovement.d.ts +10 -0
- package/dist/types/components/MMonthPicker.d.ts +7 -0
- package/dist/types/components/MPaginator.d.ts +12 -0
- package/dist/types/components/MPopover.d.ts +1 -1
- package/dist/types/components/MSkeleton.d.ts +1 -1
- package/dist/types/components/MStepper.d.ts +12 -0
- package/dist/types/components/MTabContent.d.ts +1 -1
- package/dist/types/components/MTabs.d.ts +1 -1
- package/dist/types/components/MToastContainer.d.ts +1 -1
- package/dist/types/components/MTooltip.d.ts +1 -1
- package/dist/types/components/banking/MCollapseIconText.d.ts +1 -1
- package/dist/types/components/banking/MPermissionGroup.d.ts +1 -2
- package/dist/types/components/banking/MPermissionItem.d.ts +1 -2
- package/dist/types/components/banking/MSummaryCard.d.ts +1 -1
- package/dist/types/components/index.d.ts +13 -1
- package/dist/types/contexts/LiquidContext.d.ts +1 -1
- package/dist/types/contexts/ModalContext.d.ts +1 -1
- package/dist/types/contexts/OffcanvasContext.d.ts +1 -1
- package/dist/types/stories/components/MCard.stories.d.ts +10 -0
- package/dist/types/stories/components/MCardAccount.stories.d.ts +6 -0
- package/dist/types/stories/components/MCarousel.stories.d.ts +9 -0
- package/dist/types/stories/components/MDatePicker.stories.d.ts +14 -0
- package/dist/types/stories/components/MFormikInputCurrency.stories.d.ts +8 -0
- package/dist/types/stories/components/MList.stories.d.ts +10 -0
- package/dist/types/stories/components/MListItem.stories.d.ts +9 -0
- package/dist/types/stories/components/MListItemMovement.stories.d.ts +7 -0
- package/dist/types/stories/components/MPaginator.stories.d.ts +10 -0
- package/dist/types/stories/components/MStepper.stories.d.ts +7 -0
- package/dist/types/stories/hooks/useFormatCurrency.stories.d.ts +1 -2
- package/dist/types/stories/hooks/useModalContext.stories.d.ts +1 -2
- package/dist/types/stories/hooks/useOffcanvasContext.stories.d.ts +1 -2
- package/dist/types/stories/hooks/useToast.stories.d.ts +1 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +16 -13
- package/src/style/components/_+import.scss +7 -1
- package/src/style/components/_m-card-account.scss +15 -0
- package/src/style/components/_m-carousel.scss +44 -0
- package/src/style/components/_m-datepicker.scss +224 -0
- package/src/style/components/_m-monthpicker.scss +90 -0
- package/src/style/components/_m-paginator.scss +98 -0
- package/src/style/components/_m-stepper.scss +156 -0
- package/src/style/components/_m-timepicker.scss +37 -0
- package/src/style/dynamic-ui-all.scss +3 -0
- package/src/style/dynamic-ui.scss +1 -0
- package/dist/types/components/MCalendar.d.ts +0 -25
- package/dist/types/stories/components/MCalendar.stories.d.ts +0 -6
- package/src/style/abstracts/variables/_calendar.scss +0 -19
- package/src/style/components/_m-calendar.scss +0 -205
- /package/dist/types/stories/{patterns → components}/MBadge.stories.d.ts +0 -0
- /package/dist/types/stories/{patterns → components}/MChip.stories.d.ts +0 -0
- /package/src/style/{main.scss → dynamic-ui-react.scss} +0 -0
package/dist/index.js
CHANGED
|
@@ -2,19 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
const tslib = require('tslib');
|
|
5
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
const DatePicker = require('react-datepicker');
|
|
7
8
|
const luxon = require('luxon');
|
|
8
|
-
const es = require('date-fns/locale/es');
|
|
9
9
|
const React = require('react');
|
|
10
|
-
const ui = require('@dynamic-framework/ui');
|
|
11
|
-
const ContentLoader = require('react-content-loader');
|
|
12
|
-
const classnames = require('classnames');
|
|
13
|
-
const reactToastify = require('react-toastify');
|
|
14
|
-
require('react-toastify/dist/ReactToastify.css');
|
|
15
|
-
const react = require('@floating-ui/react');
|
|
16
|
-
const tslib = require('tslib');
|
|
17
|
-
const formik = require('formik');
|
|
18
10
|
const mAlert_js = require('@dynamic-framework/ui/components/m-alert.js');
|
|
19
11
|
const mBadge_js = require('@dynamic-framework/ui/components/m-badge.js');
|
|
20
12
|
const mButton_js = require('@dynamic-framework/ui/components/m-button.js');
|
|
@@ -36,7 +28,15 @@ const mQuickActionButton_js = require('@dynamic-framework/ui/components/m-quick-
|
|
|
36
28
|
const mQuickActionCheck_js = require('@dynamic-framework/ui/components/m-quick-action-check.js');
|
|
37
29
|
const mQuickActionSelect_js = require('@dynamic-framework/ui/components/m-quick-action-select.js');
|
|
38
30
|
const mQuickActionSwitch_js = require('@dynamic-framework/ui/components/m-quick-action-switch.js');
|
|
31
|
+
const ui = require('@dynamic-framework/ui');
|
|
32
|
+
const ContentLoader = require('react-content-loader');
|
|
33
|
+
const classNames = require('classnames');
|
|
34
|
+
const reactToastify = require('react-toastify');
|
|
35
|
+
require('react-toastify/dist/ReactToastify.css');
|
|
36
|
+
const react = require('@floating-ui/react');
|
|
37
|
+
const formik = require('formik');
|
|
39
38
|
const reactDropzone = require('react-dropzone');
|
|
39
|
+
const reactSplide = require('@splidejs/react-splide');
|
|
40
40
|
const i18n = require('i18next');
|
|
41
41
|
const reactI18next = require('react-i18next');
|
|
42
42
|
const html2canvas = require('html2canvas');
|
|
@@ -45,10 +45,9 @@ const ReactDOM = require('react-dom');
|
|
|
45
45
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
46
46
|
|
|
47
47
|
const DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
|
|
48
|
-
const es__default = /*#__PURE__*/_interopDefaultLegacy(es);
|
|
49
48
|
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
50
49
|
const ContentLoader__default = /*#__PURE__*/_interopDefaultLegacy(ContentLoader);
|
|
51
|
-
const
|
|
50
|
+
const classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
52
51
|
const i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
53
52
|
const html2canvas__default = /*#__PURE__*/_interopDefaultLegacy(html2canvas);
|
|
54
53
|
|
|
@@ -288,7 +287,7 @@ function MCollapse({ id, className, Component, hasSeparator = false, defaultColl
|
|
|
288
287
|
React.useEffect(() => {
|
|
289
288
|
setToggle(defaultCollapsed);
|
|
290
289
|
}, [defaultCollapsed]);
|
|
291
|
-
return (jsxRuntime.jsxs("div", Object.assign({ id: id, className:
|
|
290
|
+
return (jsxRuntime.jsxs("div", Object.assign({ id: id, className: classNames__default["default"]('m-collapse collapse-container', className) }, { children: [jsxRuntime.jsxs("button", Object.assign({ className: "collapse-button", type: "button", onClick: onChangeCollapse }, { children: [jsxRuntime.jsx("div", Object.assign({ className: "flex-grow-1" }, { children: Component })), jsxRuntime.jsx(MIcon, { color: `var(--${ui.PREFIX_BS}gray)`, size: `var(--${ui.PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] })), toggle && (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]({
|
|
292
291
|
'collapse-body': true,
|
|
293
292
|
}), style: {
|
|
294
293
|
[`--${ui.PREFIX_BS}m-collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
@@ -312,7 +311,7 @@ function MSummaryCard({ title, description, icon, iconSize, iconTheme, Summary,
|
|
|
312
311
|
}
|
|
313
312
|
|
|
314
313
|
const LiquidContext = React.createContext({
|
|
315
|
-
language: 'en
|
|
314
|
+
language: 'en',
|
|
316
315
|
currency: {
|
|
317
316
|
symbol: '$',
|
|
318
317
|
precision: 2,
|
|
@@ -560,25 +559,59 @@ function useOffcanvasContext() {
|
|
|
560
559
|
return context;
|
|
561
560
|
}
|
|
562
561
|
|
|
563
|
-
|
|
564
|
-
|
|
562
|
+
function MDatePickerTime(_a) {
|
|
563
|
+
var { value, onChange, mId, label } = _a, props = tslib.__rest(_a, ["value", "onChange", "mId", "label"]);
|
|
564
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column m-datepicker-time" }, { children: [label && (jsxRuntime.jsx("p", Object.assign({ className: "m-datepicker-time-label" }, { children: label }))), jsxRuntime.jsx(MInput, Object.assign({}, onChange && {
|
|
565
|
+
onMChange: (time) => onChange(time),
|
|
566
|
+
}, { type: "time", mId: mId, value: value }, props))] })));
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function MDatePickerInput(_a, ref) {
|
|
570
|
+
var { value, onClick, mId, iconEnd } = _a, props = tslib.__rest(_a, ["value", "onClick", "mId", "iconEnd"]);
|
|
571
|
+
React.useImperativeHandle(ref, () => ({}), []);
|
|
572
|
+
return (jsxRuntime.jsx("div", Object.assign({ role: "button", onClick: onClick, onKeyDown: () => { }, tabIndex: -1 }, { children: jsxRuntime.jsx(MInput, Object.assign({ isReadOnly: true, type: "text", mId: mId, value: value, onMIconEndClick: onClick, iconEnd: iconEnd }, props)) })));
|
|
573
|
+
}
|
|
574
|
+
const MDatePickerInput$1 = React.forwardRef(MDatePickerInput);
|
|
575
|
+
|
|
576
|
+
function MMonthPicker(_a) {
|
|
577
|
+
var { setDate, date } = _a, props = tslib.__rest(_a, ["setDate", "date"]);
|
|
565
578
|
const dateJS = (value) => luxon.DateTime.fromISO(value).toJSDate();
|
|
566
579
|
const { language } = useLiquidContext();
|
|
567
|
-
const lang = language
|
|
568
|
-
return (jsxRuntime.jsx(DatePicker__default["default"], Object.assign({ selected: dateJS(date), onChange: (value) => {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
const lang = language || 'en';
|
|
581
|
+
return (jsxRuntime.jsx(DatePicker__default["default"], Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "m-month-picker", onChange: (value) => {
|
|
582
|
+
setDate(value);
|
|
583
|
+
}, customInput: (jsxRuntime.jsx("p", Object.assign({ className: "fw-bold text-capitalize" }, { children: luxon.DateTime.fromISO(date).setLocale(lang).toFormat('MMMM yyyy') }))), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxRuntime.jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between gap-4 fs-6 bg-dark" }, { children: [jsxRuntime.jsx(MButton, { iconStart: "chevron-left", size: "sm", variant: "link", theme: "light", onMClick: decreaseYear, isDisabled: prevYearButtonDisabled }), jsxRuntime.jsx("p", Object.assign({ className: "fs-6 fw-bold" }, { children: monthDate.getFullYear() })), jsxRuntime.jsx(MButton, { iconStart: "chevron-right", size: "sm", variant: "link", theme: "light", onMClick: increaseYear, isDisabled: nextYearButtonDisabled })] }))) }, props)));
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function MDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, decreaseMonthIcon, increaseMonthIcon, iconSize, buttonVariant, buttonTheme, }) {
|
|
587
|
+
const { language } = useLiquidContext();
|
|
588
|
+
const lang = language || 'en';
|
|
589
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between m-datepicker-header" }, { children: [jsxRuntime.jsx(MButton, { iconStart: decreaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onMClick: decreaseMonth, isDisabled: prevMonthButtonDisabled }), jsxRuntime.jsx(MMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, { date: monthDate.toISOString(), setDate: (value) => {
|
|
590
|
+
if (value) {
|
|
591
|
+
changeMonth(luxon.DateTime.fromJSDate(value).month - 1);
|
|
592
|
+
changeYear(luxon.DateTime.fromJSDate(value).year);
|
|
593
|
+
}
|
|
594
|
+
} }, lang && { locale: lang })), jsxRuntime.jsx(MButton, { iconStart: increaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onMClick: increaseMonth, isDisabled: nextMonthButtonDisabled })] })));
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function MDatePicker(_a) {
|
|
598
|
+
var { setDate, date, selectsRange, withMonthSelector, inputLabel, inputIcon = 'calendar', inputId = 'input-calendar', timeId = 'input-time', timeLabel, headerDecreaseMonthIcon = 'chevron-left', headerIncreaseMonthIcon = 'chevron-right', headerIconSize = 'sm', headerButtonVariant = 'link', headerButtonTheme = 'dark' } = _a, props = tslib.__rest(_a, ["setDate", "date", "selectsRange", "withMonthSelector", "inputLabel", "inputIcon", "inputId", "timeId", "timeLabel", "headerDecreaseMonthIcon", "headerIncreaseMonthIcon", "headerIconSize", "headerButtonVariant", "headerButtonTheme"]);
|
|
599
|
+
const dateJS = (value) => luxon.DateTime.fromISO(value).toJSDate();
|
|
600
|
+
const { language } = useLiquidContext();
|
|
601
|
+
const lang = language || 'en';
|
|
602
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
603
|
+
const InputPicker = React.forwardRef(({ value, onClick }, ref) => (jsxRuntime.jsx(MDatePickerInput$1, { label: inputLabel, mId: inputId, iconEnd: inputIcon, value: value, onClick: onClick, ref: ref })));
|
|
604
|
+
const TimeInputPicker = React.useCallback(({ value, onChange }) => (jsxRuntime.jsx(MDatePickerTime, { onChange: onChange, value: value, label: timeLabel, mId: timeId })), [timeLabel, timeId]);
|
|
605
|
+
const DatePickerHeader = React.useCallback((headerProps) => (jsxRuntime.jsx(MDatePickerHeader, Object.assign({}, headerProps, { decreaseMonthIcon: headerDecreaseMonthIcon, increaseMonthIcon: headerIncreaseMonthIcon, iconSize: headerIconSize, buttonVariant: headerButtonVariant, buttonTheme: headerButtonTheme, withMonthSelector: !!withMonthSelector }))), [headerButtonTheme,
|
|
606
|
+
headerButtonVariant,
|
|
607
|
+
headerDecreaseMonthIcon,
|
|
608
|
+
headerIconSize,
|
|
609
|
+
headerIncreaseMonthIcon,
|
|
610
|
+
withMonthSelector,
|
|
611
|
+
]);
|
|
612
|
+
return (jsxRuntime.jsx(DatePicker__default["default"], Object.assign({ selected: dateJS(date), calendarClassName: "m-date-picker", onChange: (value) => {
|
|
613
|
+
setDate(value);
|
|
614
|
+
}, renderCustomHeader: (headerProps) => jsxRuntime.jsx(DatePickerHeader, Object.assign({}, headerProps)), customInput: jsxRuntime.jsx(InputPicker, {}), customTimeInput: jsxRuntime.jsx(TimeInputPicker, {}), selectsRange: selectsRange }, lang && { locale: lang }, props)));
|
|
582
615
|
}
|
|
583
616
|
|
|
584
617
|
function MSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
@@ -615,10 +648,10 @@ function MTabs({ children, defaultSelected, onChange, options, className, isVert
|
|
|
615
648
|
const value = React.useMemo(() => ({
|
|
616
649
|
isSelected,
|
|
617
650
|
}), [isSelected]);
|
|
618
|
-
return (jsxRuntime.jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxRuntime.jsxs("div", Object.assign({ className:
|
|
651
|
+
return (jsxRuntime.jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxRuntime.jsxs("div", Object.assign({ className: classNames__default["default"]({
|
|
619
652
|
'm-tabs': true,
|
|
620
653
|
'm-tabs-vertical': isVertical,
|
|
621
|
-
}) }, { children: [jsxRuntime.jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsxRuntime.jsx("button", Object.assign({ id: `${option.tab}Tab`, className:
|
|
654
|
+
}) }, { children: [jsxRuntime.jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsxRuntime.jsx("button", Object.assign({ id: `${option.tab}Tab`, className: classNames__default["default"]('nav-link', {
|
|
622
655
|
active: option.tab === selected,
|
|
623
656
|
}, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.isDisabled, onClick: () => onSelect(option) }, { children: option.label }), option.label))) })), jsxRuntime.jsx("div", Object.assign({ className: "tab-content" }, { children: children }))] })) })));
|
|
624
657
|
}
|
|
@@ -638,7 +671,7 @@ function MTabContent({ tab, children }) {
|
|
|
638
671
|
return (jsxRuntime.jsx("div", Object.assign({ className: "tab-pane fade show active", id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab` }, { children: children })));
|
|
639
672
|
}
|
|
640
673
|
|
|
641
|
-
function MToastContainer({ style, position = '
|
|
674
|
+
function MToastContainer({ style, position = 'top-right', }) {
|
|
642
675
|
return (jsxRuntime.jsx(reactToastify.ToastContainer, { toastClassName: () => 'shadow-none p-0 cursor-default', position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: reactToastify.Slide, style: style }));
|
|
643
676
|
}
|
|
644
677
|
|
|
@@ -689,9 +722,9 @@ function MCurrencyText({ value, className, }) {
|
|
|
689
722
|
}
|
|
690
723
|
|
|
691
724
|
function MFormikInput(_a) {
|
|
692
|
-
var { name } = _a, props = tslib.__rest(_a, ["name"]);
|
|
725
|
+
var { name, hint } = _a, props = tslib.__rest(_a, ["name", "hint"]);
|
|
693
726
|
const [field, meta, helpers] = formik.useField(name);
|
|
694
|
-
return (jsxRuntime.jsx(MInput, Object.assign({}, props, { name: field.name, value: field.value, onMChange: ({ detail }) => helpers.setValue(detail), onMBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error })));
|
|
727
|
+
return (jsxRuntime.jsx(MInput, Object.assign({}, props, { name: field.name, value: field.value, onMChange: ({ detail }) => helpers.setValue(detail), onMBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error, hint: meta.error || hint })));
|
|
695
728
|
}
|
|
696
729
|
|
|
697
730
|
function MFormikInputSelect(_a) {
|
|
@@ -759,40 +792,70 @@ function MTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP,
|
|
|
759
792
|
}
|
|
760
793
|
|
|
761
794
|
function MInputCurrency(_a) {
|
|
762
|
-
var { onChange } = _a, otherProps = tslib.__rest(_a, ["onChange"]);
|
|
795
|
+
var { onChange, onBlur, onFocus } = _a, otherProps = tslib.__rest(_a, ["onChange", "onBlur", "onFocus"]);
|
|
763
796
|
const { currency } = useLiquidContext();
|
|
764
|
-
return (jsxRuntime.jsx(MInputCurrencyBase, Object.assign({ currencyOptions: currency, onMChange: ({ detail }) => onChange(detail) },
|
|
797
|
+
return (jsxRuntime.jsx(MInputCurrencyBase, Object.assign({ currencyOptions: currency, onMChange: ({ detail }) => onChange(detail) }, onBlur && {
|
|
798
|
+
onMBlur: ({ detail }) => onBlur(detail),
|
|
799
|
+
}, onFocus && {
|
|
800
|
+
onMFocus: ({ detail }) => onFocus(detail),
|
|
801
|
+
}, otherProps)));
|
|
765
802
|
}
|
|
766
803
|
|
|
767
804
|
function MBoxFile(_a) {
|
|
768
805
|
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, isDisabled = false, children } = _a, dropzoneOptions = tslib.__rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "isDisabled", "children"]);
|
|
769
806
|
const { acceptedFiles, getRootProps, getInputProps, } = reactDropzone.useDropzone(Object.assign({ disabled: isDisabled }, dropzoneOptions));
|
|
770
|
-
return (jsxRuntime.jsxs("section", Object.assign({ className:
|
|
807
|
+
return (jsxRuntime.jsxs("section", Object.assign({ className: classNames__default["default"]('m-box-file', {
|
|
771
808
|
'm-box-file-selected': !!acceptedFiles.length,
|
|
772
809
|
}) }, { children: [jsxRuntime.jsxs("div", Object.assign({}, getRootProps({
|
|
773
|
-
className:
|
|
810
|
+
className: classNames__default["default"]('m-box-file-dropzone', {
|
|
774
811
|
disabled: isDisabled,
|
|
775
812
|
}),
|
|
776
813
|
}), { children: [jsxRuntime.jsx("input", Object.assign({}, getInputProps())), jsxRuntime.jsx(MIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsxRuntime.jsx("div", Object.assign({ className: "m-box-content" }, { children: children }))] })), !!acceptedFiles.length && (jsxRuntime.jsx("aside", Object.assign({ className: "m-box-files" }, { children: acceptedFiles.map((file) => (jsxRuntime.jsx("div", Object.assign({ className: "m-box-files-text" }, { children: `${file.name} - ${file.size} bytes` }), file.name))) })))] })));
|
|
777
814
|
}
|
|
778
815
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
816
|
+
function MCarousel(_a) {
|
|
817
|
+
var { children, className, options } = _a, props = tslib.__rest(_a, ["children", "className", "options"]);
|
|
818
|
+
return (jsxRuntime.jsx(reactSplide.Splide, Object.assign({ className: classNames__default["default"]('m-carousel', className), options: Object.assign(Object.assign({}, options), { classes: {
|
|
819
|
+
// Arrows
|
|
820
|
+
arrows: 'splide__arrows m-carousel-arrows',
|
|
821
|
+
arrow: 'splide__arrow m-carousel-arrow',
|
|
822
|
+
prev: 'splide__arrow--prev m-carousel-arrow-prev',
|
|
823
|
+
next: 'splide__arrow--next m-carousel-arrow-next',
|
|
824
|
+
// Paginator
|
|
825
|
+
pagination: 'splide__pagination m-carousel-pagination',
|
|
826
|
+
page: 'splide__pagination__page m-carousel-pagination-page',
|
|
827
|
+
} }) }, props, { children: children })));
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
function MCarouselSlide(_a) {
|
|
831
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
832
|
+
return (jsxRuntime.jsx(reactSplide.SplideSlide, Object.assign({ className: classNames__default["default"]('m-carousel-slide', className) }, props)));
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function MList({ children, className, isFlush = false, isNumbered = false, isHorizontal = false, horizontalBreakpoint, }) {
|
|
836
|
+
if (isFlush && isHorizontal) {
|
|
837
|
+
throw new Error("Horizontal and Flush props don't work together");
|
|
838
|
+
}
|
|
839
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]('m-list list-group', {
|
|
840
|
+
'list-group-flush': isFlush && !isHorizontal,
|
|
841
|
+
'list-group-numbered': isNumbered,
|
|
842
|
+
'list-group-horizontal': isHorizontal && !horizontalBreakpoint,
|
|
843
|
+
}, (isHorizontal && horizontalBreakpoint) && `list-group-horizontal-${horizontalBreakpoint}`, className) }, { children: children })));
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
function MListItem({ children, className, isActive = false, isDisabled = false, theme, onMClick, }) {
|
|
847
|
+
const Tag = React.useMemo(() => (onMClick ? 'button' : 'div'), [onMClick]);
|
|
848
|
+
return (jsxRuntime.jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
849
|
+
onClick: onMClick,
|
|
850
|
+
type: 'button',
|
|
851
|
+
}, { className: classNames__default["default"]('m-list-item list-group-item list-group-item-action', theme ? `list-group-item-${theme}` : undefined, className, {
|
|
852
|
+
active: isActive,
|
|
853
|
+
disabled: isDisabled,
|
|
854
|
+
}) }, isActive && { 'aria-current': true }, { children: children })));
|
|
792
855
|
}
|
|
793
856
|
|
|
794
857
|
function useToast() {
|
|
795
|
-
const toast = React.useCallback((message, { position = '
|
|
858
|
+
const toast = React.useCallback((message, { position = 'top-right', type = 'info', showClose = true, autoClose = false, } = {}) => {
|
|
796
859
|
reactToastify.toast(({ closeToast }) => (jsxRuntime.jsx(MAlert, Object.assign({ type: type, showClose: showClose, onMClose: closeToast }, { children: message }))), {
|
|
797
860
|
transition: reactToastify.Slide,
|
|
798
861
|
position,
|
|
@@ -867,18 +930,103 @@ function useScreenshotWebShare() {
|
|
|
867
930
|
};
|
|
868
931
|
}
|
|
869
932
|
|
|
933
|
+
function MListItemMovement(_a) {
|
|
934
|
+
var { description, date, amount, classNameMovement } = _a, props = tslib.__rest(_a, ["description", "date", "amount", "classNameMovement"]);
|
|
935
|
+
const { format } = useFormatCurrency();
|
|
936
|
+
const value = React.useMemo(() => {
|
|
937
|
+
const valueFormatted = format(amount);
|
|
938
|
+
if (amount > 0) {
|
|
939
|
+
return {
|
|
940
|
+
theme: 'text-success',
|
|
941
|
+
valueFormatted,
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
return {
|
|
945
|
+
theme: 'text-danger',
|
|
946
|
+
valueFormatted,
|
|
947
|
+
};
|
|
948
|
+
}, [format, amount]);
|
|
949
|
+
return (jsxRuntime.jsx(MListItem, Object.assign({}, props, { children: jsxRuntime.jsxs("div", Object.assign({ className: classNames__default["default"]('m-list-item-movement', 'd-flex justify-content-between align-items-center p-3 gap-3', classNameMovement) }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "d-flex flex-column gap-1" }, { children: [jsxRuntime.jsx("span", Object.assign({ className: "fs-6" }, { children: description })), jsxRuntime.jsx("span", Object.assign({ className: "sp text-gray-700" }, { children: date }))] })), jsxRuntime.jsx("span", Object.assign({ className: classNames__default["default"]('fs-6', value.theme) }, { children: value.valueFormatted }))] })) })));
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
function MStepper({ options, currentStep, successIcon = 'check', isVertical = false, }) {
|
|
953
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]({
|
|
954
|
+
'm-stepper': true,
|
|
955
|
+
'is-vertical': isVertical,
|
|
956
|
+
}) }, { children: options.map(({ label, value }) => (jsxRuntime.jsxs("div", Object.assign({ className: "m-step" }, { children: [jsxRuntime.jsx("div", Object.assign({ className: "m-step-value" }, { children: jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]({
|
|
957
|
+
'm-step-icon-container': true,
|
|
958
|
+
'm-step-check': value < currentStep,
|
|
959
|
+
'm-step-current': value === currentStep,
|
|
960
|
+
}) }, { children: value < currentStep
|
|
961
|
+
? (jsxRuntime.jsx(MIcon, { icon: successIcon, innerClass: "m-step-icon" }))
|
|
962
|
+
: value })) })), jsxRuntime.jsx("div", Object.assign({ className: "m-step-label" }, { children: label }))] }), label))) })));
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
function MFormikInputCurrency(_a) {
|
|
966
|
+
var { name, hint } = _a, props = tslib.__rest(_a, ["name", "hint"]);
|
|
967
|
+
const [field, meta, helpers] = formik.useField(name);
|
|
968
|
+
return (jsxRuntime.jsx(MInputCurrency, Object.assign({}, props, { name: field.name, value: field.value, onChange: (value) => helpers.setValue(value), onMBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error, hint: meta.error || hint })));
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function MCard({ className, style, children, }) {
|
|
972
|
+
return (jsxRuntime.jsx("div", Object.assign({ style: style, className: classNames__default["default"]('card', className) }, { children: children })));
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
function MCardBody({ className, children, }) {
|
|
976
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]('card-body', className) }, { children: children })));
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
function MCardAccount({ className, icon, theme, name, number, balance, balanceText, onClick, onClickText, }) {
|
|
980
|
+
return (jsxRuntime.jsx(MCard, Object.assign({ className: classNames__default["default"]('m-card-account', className) }, { children: jsxRuntime.jsxs(MCardBody, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "d-flex gap-3 align-items-center" }, { children: [jsxRuntime.jsx(MIcon, { icon: icon, hasCircle: true, theme: theme, size: "1.5rem" }), jsxRuntime.jsxs("div", Object.assign({ className: "d-block flex-grow-1" }, { children: [jsxRuntime.jsx("p", Object.assign({ className: "text-gray-700" }, { children: name })), jsxRuntime.jsx("small", Object.assign({ className: "text-gray" }, { children: number }))] }))] })), jsxRuntime.jsxs("div", Object.assign({ className: "d-block" }, { children: [jsxRuntime.jsx("p", Object.assign({ className: "fw-bold fs-6 text-body" }, { children: balance })), jsxRuntime.jsx("small", Object.assign({ className: "text-gray-700" }, { children: balanceText }))] })), jsxRuntime.jsx("div", Object.assign({ className: "d-flex justify-content-end" }, { children: jsxRuntime.jsx(MButton, { text: onClickText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onMClick: onClick }) }))] }) })));
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
function MCardHeader({ className, children, }) {
|
|
984
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]('card-header', className) }, { children: children })));
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
function MCardFooter({ className, children, }) {
|
|
988
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames__default["default"]('card-footer', className) }, { children: children })));
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
const LANG = ui.liquidParser.parse('{{site.language}}');
|
|
992
|
+
async function configureI8n(resources, _a = {}) {
|
|
993
|
+
var { lng = LANG, fallbackLng = 'es' } = _a, config = tslib.__rest(_a, ["lng", "fallbackLng"]);
|
|
994
|
+
return i18n__default["default"]
|
|
995
|
+
.use(reactI18next.initReactI18next)
|
|
996
|
+
.init(Object.assign({ resources,
|
|
997
|
+
lng, initImmediate: true, fallbackLng, interpolation: {
|
|
998
|
+
escapeValue: false,
|
|
999
|
+
prefix: '{',
|
|
1000
|
+
suffix: '}',
|
|
1001
|
+
// skipOnVariables: false,
|
|
1002
|
+
} }, config))
|
|
1003
|
+
.then((t) => t);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
Object.defineProperty(exports, 'liquidParser', {
|
|
1007
|
+
enumerable: true,
|
|
1008
|
+
get: function () { return ui.liquidParser; }
|
|
1009
|
+
});
|
|
870
1010
|
exports.LiquidContext = LiquidContext$1;
|
|
871
1011
|
exports.LiquidContextProvider = LiquidContextProvider;
|
|
872
1012
|
exports.MAlert = MAlert;
|
|
873
1013
|
exports.MBadge = MBadge;
|
|
874
1014
|
exports.MBoxFile = MBoxFile;
|
|
875
1015
|
exports.MButton = MButton;
|
|
876
|
-
exports.
|
|
1016
|
+
exports.MCard = MCard;
|
|
1017
|
+
exports.MCardAccount = MCardAccount;
|
|
1018
|
+
exports.MCardBody = MCardBody;
|
|
1019
|
+
exports.MCardFooter = MCardFooter;
|
|
1020
|
+
exports.MCardHeader = MCardHeader;
|
|
1021
|
+
exports.MCarousel = MCarousel;
|
|
1022
|
+
exports.MCarouselSlide = MCarouselSlide;
|
|
877
1023
|
exports.MChip = MChip;
|
|
878
1024
|
exports.MCollapse = MCollapse;
|
|
879
1025
|
exports.MCollapseIconText = MCollapseIconText;
|
|
880
1026
|
exports.MCurrencyText = MCurrencyText;
|
|
1027
|
+
exports.MDatePicker = MDatePicker;
|
|
881
1028
|
exports.MFormikInput = MFormikInput;
|
|
1029
|
+
exports.MFormikInputCurrency = MFormikInputCurrency;
|
|
882
1030
|
exports.MFormikInputSelect = MFormikInputSelect;
|
|
883
1031
|
exports.MIcon = MIcon;
|
|
884
1032
|
exports.MInput = MInput;
|
|
@@ -891,6 +1039,9 @@ exports.MInputPin = MInputPin;
|
|
|
891
1039
|
exports.MInputSearch = MInputSearch;
|
|
892
1040
|
exports.MInputSelect = MInputSelect;
|
|
893
1041
|
exports.MInputSwitch = MInputSwitch;
|
|
1042
|
+
exports.MList = MList;
|
|
1043
|
+
exports.MListItem = MListItem;
|
|
1044
|
+
exports.MListItemMovement = MListItemMovement;
|
|
894
1045
|
exports.MModal = MModal;
|
|
895
1046
|
exports.MOffcanvas = MOffcanvas;
|
|
896
1047
|
exports.MPermissionGroup = MPermissionGroup;
|
|
@@ -902,6 +1053,7 @@ exports.MQuickActionCheck = MQuickActionCheck;
|
|
|
902
1053
|
exports.MQuickActionSelect = MQuickActionSelect;
|
|
903
1054
|
exports.MQuickActionSwitch = MQuickActionSwitch;
|
|
904
1055
|
exports.MSkeleton = MSkeleton;
|
|
1056
|
+
exports.MStepper = MStepper;
|
|
905
1057
|
exports.MSummaryCard = MSummaryCard;
|
|
906
1058
|
exports.MTabContent = MTabContent;
|
|
907
1059
|
exports.MTabs = MTabs;
|