@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.esm.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
1
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import DatePicker
|
|
3
|
+
import DatePicker from 'react-datepicker';
|
|
3
4
|
import { DateTime } from 'luxon';
|
|
4
|
-
import
|
|
5
|
-
import React, { createElement, useState, useEffect, createContext, useMemo, useContext, useCallback, useRef } from 'react';
|
|
6
|
-
import { PREFIX_BS, liquidParser, formatCurrency } from '@dynamic-framework/ui';
|
|
7
|
-
import ContentLoader from 'react-content-loader';
|
|
8
|
-
import classnames from 'classnames';
|
|
9
|
-
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
10
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
11
|
-
import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
12
|
-
import { __rest } from 'tslib';
|
|
13
|
-
import { useField } from 'formik';
|
|
5
|
+
import React, { createElement, useState, useEffect, createContext, useMemo, useContext, useCallback, forwardRef, useImperativeHandle, useRef } from 'react';
|
|
14
6
|
import { defineCustomElement } from '@dynamic-framework/ui/components/m-alert.js';
|
|
15
7
|
import { defineCustomElement as defineCustomElement$1 } from '@dynamic-framework/ui/components/m-badge.js';
|
|
16
8
|
import { defineCustomElement as defineCustomElement$2 } from '@dynamic-framework/ui/components/m-button.js';
|
|
@@ -32,7 +24,16 @@ import { defineCustomElement as defineCustomElement$h } from '@dynamic-framework
|
|
|
32
24
|
import { defineCustomElement as defineCustomElement$i } from '@dynamic-framework/ui/components/m-quick-action-check.js';
|
|
33
25
|
import { defineCustomElement as defineCustomElement$j } from '@dynamic-framework/ui/components/m-quick-action-select.js';
|
|
34
26
|
import { defineCustomElement as defineCustomElement$k } from '@dynamic-framework/ui/components/m-quick-action-switch.js';
|
|
27
|
+
import { PREFIX_BS, liquidParser, formatCurrency } from '@dynamic-framework/ui';
|
|
28
|
+
export { liquidParser } from '@dynamic-framework/ui';
|
|
29
|
+
import ContentLoader from 'react-content-loader';
|
|
30
|
+
import classNames from 'classnames';
|
|
31
|
+
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
32
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
33
|
+
import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
34
|
+
import { useField } from 'formik';
|
|
35
35
|
import { useDropzone } from 'react-dropzone';
|
|
36
|
+
import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
36
37
|
import i18n from 'i18next';
|
|
37
38
|
import { initReactI18next } from 'react-i18next';
|
|
38
39
|
import html2canvas from 'html2canvas';
|
|
@@ -274,7 +275,7 @@ function MCollapse({ id, className, Component, hasSeparator = false, defaultColl
|
|
|
274
275
|
useEffect(() => {
|
|
275
276
|
setToggle(defaultCollapsed);
|
|
276
277
|
}, [defaultCollapsed]);
|
|
277
|
-
return (jsxs("div", Object.assign({ id: id, className:
|
|
278
|
+
return (jsxs("div", Object.assign({ id: id, className: classNames('m-collapse collapse-container', className) }, { children: [jsxs("button", Object.assign({ className: "collapse-button", type: "button", onClick: onChangeCollapse }, { children: [jsx("div", Object.assign({ className: "flex-grow-1" }, { children: Component })), jsx(MIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] })), toggle && (jsx("div", Object.assign({ className: classNames({
|
|
278
279
|
'collapse-body': true,
|
|
279
280
|
}), style: {
|
|
280
281
|
[`--${PREFIX_BS}m-collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
@@ -298,7 +299,7 @@ function MSummaryCard({ title, description, icon, iconSize, iconTheme, Summary,
|
|
|
298
299
|
}
|
|
299
300
|
|
|
300
301
|
const LiquidContext = createContext({
|
|
301
|
-
language: 'en
|
|
302
|
+
language: 'en',
|
|
302
303
|
currency: {
|
|
303
304
|
symbol: '$',
|
|
304
305
|
precision: 2,
|
|
@@ -546,25 +547,59 @@ function useOffcanvasContext() {
|
|
|
546
547
|
return context;
|
|
547
548
|
}
|
|
548
549
|
|
|
549
|
-
|
|
550
|
-
|
|
550
|
+
function MDatePickerTime(_a) {
|
|
551
|
+
var { value, onChange, mId, label } = _a, props = __rest(_a, ["value", "onChange", "mId", "label"]);
|
|
552
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column m-datepicker-time" }, { children: [label && (jsx("p", Object.assign({ className: "m-datepicker-time-label" }, { children: label }))), jsx(MInput, Object.assign({}, onChange && {
|
|
553
|
+
onMChange: (time) => onChange(time),
|
|
554
|
+
}, { type: "time", mId: mId, value: value }, props))] })));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function MDatePickerInput(_a, ref) {
|
|
558
|
+
var { value, onClick, mId, iconEnd } = _a, props = __rest(_a, ["value", "onClick", "mId", "iconEnd"]);
|
|
559
|
+
useImperativeHandle(ref, () => ({}), []);
|
|
560
|
+
return (jsx("div", Object.assign({ role: "button", onClick: onClick, onKeyDown: () => { }, tabIndex: -1 }, { children: jsx(MInput, Object.assign({ isReadOnly: true, type: "text", mId: mId, value: value, onMIconEndClick: onClick, iconEnd: iconEnd }, props)) })));
|
|
561
|
+
}
|
|
562
|
+
var MDatePickerInput$1 = forwardRef(MDatePickerInput);
|
|
563
|
+
|
|
564
|
+
function MMonthPicker(_a) {
|
|
565
|
+
var { setDate, date } = _a, props = __rest(_a, ["setDate", "date"]);
|
|
551
566
|
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
552
567
|
const { language } = useLiquidContext();
|
|
553
|
-
const lang = language
|
|
554
|
-
return (jsx(DatePicker, Object.assign({ selected: dateJS(date), onChange: (value) => {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
+
const lang = language || 'en';
|
|
569
|
+
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "m-month-picker", onChange: (value) => {
|
|
570
|
+
setDate(value);
|
|
571
|
+
}, customInput: (jsx("p", Object.assign({ className: "fw-bold text-capitalize" }, { children: DateTime.fromISO(date).setLocale(lang).toFormat('MMMM yyyy') }))), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between gap-4 fs-6 bg-dark" }, { children: [jsx(MButton, { iconStart: "chevron-left", size: "sm", variant: "link", theme: "light", onMClick: decreaseYear, isDisabled: prevYearButtonDisabled }), jsx("p", Object.assign({ className: "fs-6 fw-bold" }, { children: monthDate.getFullYear() })), jsx(MButton, { iconStart: "chevron-right", size: "sm", variant: "link", theme: "light", onMClick: increaseYear, isDisabled: nextYearButtonDisabled })] }))) }, props)));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function MDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, decreaseMonthIcon, increaseMonthIcon, iconSize, buttonVariant, buttonTheme, }) {
|
|
575
|
+
const { language } = useLiquidContext();
|
|
576
|
+
const lang = language || 'en';
|
|
577
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between m-datepicker-header" }, { children: [jsx(MButton, { iconStart: decreaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onMClick: decreaseMonth, isDisabled: prevMonthButtonDisabled }), jsx(MMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, { date: monthDate.toISOString(), setDate: (value) => {
|
|
578
|
+
if (value) {
|
|
579
|
+
changeMonth(DateTime.fromJSDate(value).month - 1);
|
|
580
|
+
changeYear(DateTime.fromJSDate(value).year);
|
|
581
|
+
}
|
|
582
|
+
} }, lang && { locale: lang })), jsx(MButton, { iconStart: increaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onMClick: increaseMonth, isDisabled: nextMonthButtonDisabled })] })));
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function MDatePicker(_a) {
|
|
586
|
+
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 = __rest(_a, ["setDate", "date", "selectsRange", "withMonthSelector", "inputLabel", "inputIcon", "inputId", "timeId", "timeLabel", "headerDecreaseMonthIcon", "headerIncreaseMonthIcon", "headerIconSize", "headerButtonVariant", "headerButtonTheme"]);
|
|
587
|
+
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
588
|
+
const { language } = useLiquidContext();
|
|
589
|
+
const lang = language || 'en';
|
|
590
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
591
|
+
const InputPicker = forwardRef(({ value, onClick }, ref) => (jsx(MDatePickerInput$1, { label: inputLabel, mId: inputId, iconEnd: inputIcon, value: value, onClick: onClick, ref: ref })));
|
|
592
|
+
const TimeInputPicker = useCallback(({ value, onChange }) => (jsx(MDatePickerTime, { onChange: onChange, value: value, label: timeLabel, mId: timeId })), [timeLabel, timeId]);
|
|
593
|
+
const DatePickerHeader = useCallback((headerProps) => (jsx(MDatePickerHeader, Object.assign({}, headerProps, { decreaseMonthIcon: headerDecreaseMonthIcon, increaseMonthIcon: headerIncreaseMonthIcon, iconSize: headerIconSize, buttonVariant: headerButtonVariant, buttonTheme: headerButtonTheme, withMonthSelector: !!withMonthSelector }))), [headerButtonTheme,
|
|
594
|
+
headerButtonVariant,
|
|
595
|
+
headerDecreaseMonthIcon,
|
|
596
|
+
headerIconSize,
|
|
597
|
+
headerIncreaseMonthIcon,
|
|
598
|
+
withMonthSelector,
|
|
599
|
+
]);
|
|
600
|
+
return (jsx(DatePicker, Object.assign({ selected: dateJS(date), calendarClassName: "m-date-picker", onChange: (value) => {
|
|
601
|
+
setDate(value);
|
|
602
|
+
}, renderCustomHeader: (headerProps) => jsx(DatePickerHeader, Object.assign({}, headerProps)), customInput: jsx(InputPicker, {}), customTimeInput: jsx(TimeInputPicker, {}), selectsRange: selectsRange }, lang && { locale: lang }, props)));
|
|
568
603
|
}
|
|
569
604
|
|
|
570
605
|
function MSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
@@ -601,10 +636,10 @@ function MTabs({ children, defaultSelected, onChange, options, className, isVert
|
|
|
601
636
|
const value = useMemo(() => ({
|
|
602
637
|
isSelected,
|
|
603
638
|
}), [isSelected]);
|
|
604
|
-
return (jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxs("div", Object.assign({ className:
|
|
639
|
+
return (jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxs("div", Object.assign({ className: classNames({
|
|
605
640
|
'm-tabs': true,
|
|
606
641
|
'm-tabs-vertical': isVertical,
|
|
607
|
-
}) }, { children: [jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsx("button", Object.assign({ id: `${option.tab}Tab`, className:
|
|
642
|
+
}) }, { children: [jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsx("button", Object.assign({ id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
608
643
|
active: option.tab === selected,
|
|
609
644
|
}, 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))) })), jsx("div", Object.assign({ className: "tab-content" }, { children: children }))] })) })));
|
|
610
645
|
}
|
|
@@ -624,7 +659,7 @@ function MTabContent({ tab, children }) {
|
|
|
624
659
|
return (jsx("div", Object.assign({ className: "tab-pane fade show active", id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab` }, { children: children })));
|
|
625
660
|
}
|
|
626
661
|
|
|
627
|
-
function MToastContainer({ style, position = '
|
|
662
|
+
function MToastContainer({ style, position = 'top-right', }) {
|
|
628
663
|
return (jsx(ToastContainer, { toastClassName: () => 'shadow-none p-0 cursor-default', position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: Slide, style: style }));
|
|
629
664
|
}
|
|
630
665
|
|
|
@@ -675,9 +710,9 @@ function MCurrencyText({ value, className, }) {
|
|
|
675
710
|
}
|
|
676
711
|
|
|
677
712
|
function MFormikInput(_a) {
|
|
678
|
-
var { name } = _a, props = __rest(_a, ["name"]);
|
|
713
|
+
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
679
714
|
const [field, meta, helpers] = useField(name);
|
|
680
|
-
return (jsx(MInput, Object.assign({}, props, { name: field.name, value: field.value, onMChange: ({ detail }) => helpers.setValue(detail), onMBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error })));
|
|
715
|
+
return (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 })));
|
|
681
716
|
}
|
|
682
717
|
|
|
683
718
|
function MFormikInputSelect(_a) {
|
|
@@ -745,40 +780,70 @@ function MTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP,
|
|
|
745
780
|
}
|
|
746
781
|
|
|
747
782
|
function MInputCurrency(_a) {
|
|
748
|
-
var { onChange } = _a, otherProps = __rest(_a, ["onChange"]);
|
|
783
|
+
var { onChange, onBlur, onFocus } = _a, otherProps = __rest(_a, ["onChange", "onBlur", "onFocus"]);
|
|
749
784
|
const { currency } = useLiquidContext();
|
|
750
|
-
return (jsx(MInputCurrencyBase, Object.assign({ currencyOptions: currency, onMChange: ({ detail }) => onChange(detail) },
|
|
785
|
+
return (jsx(MInputCurrencyBase, Object.assign({ currencyOptions: currency, onMChange: ({ detail }) => onChange(detail) }, onBlur && {
|
|
786
|
+
onMBlur: ({ detail }) => onBlur(detail),
|
|
787
|
+
}, onFocus && {
|
|
788
|
+
onMFocus: ({ detail }) => onFocus(detail),
|
|
789
|
+
}, otherProps)));
|
|
751
790
|
}
|
|
752
791
|
|
|
753
792
|
function MBoxFile(_a) {
|
|
754
793
|
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, isDisabled = false, children } = _a, dropzoneOptions = __rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "isDisabled", "children"]);
|
|
755
794
|
const { acceptedFiles, getRootProps, getInputProps, } = useDropzone(Object.assign({ disabled: isDisabled }, dropzoneOptions));
|
|
756
|
-
return (jsxs("section", Object.assign({ className:
|
|
795
|
+
return (jsxs("section", Object.assign({ className: classNames('m-box-file', {
|
|
757
796
|
'm-box-file-selected': !!acceptedFiles.length,
|
|
758
797
|
}) }, { children: [jsxs("div", Object.assign({}, getRootProps({
|
|
759
|
-
className:
|
|
798
|
+
className: classNames('m-box-file-dropzone', {
|
|
760
799
|
disabled: isDisabled,
|
|
761
800
|
}),
|
|
762
801
|
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(MIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsx("div", Object.assign({ className: "m-box-content" }, { children: children }))] })), !!acceptedFiles.length && (jsx("aside", Object.assign({ className: "m-box-files" }, { children: acceptedFiles.map((file) => (jsx("div", Object.assign({ className: "m-box-files-text" }, { children: `${file.name} - ${file.size} bytes` }), file.name))) })))] })));
|
|
763
802
|
}
|
|
764
803
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
804
|
+
function MCarousel(_a) {
|
|
805
|
+
var { children, className, options } = _a, props = __rest(_a, ["children", "className", "options"]);
|
|
806
|
+
return (jsx(Splide, Object.assign({ className: classNames('m-carousel', className), options: Object.assign(Object.assign({}, options), { classes: {
|
|
807
|
+
// Arrows
|
|
808
|
+
arrows: 'splide__arrows m-carousel-arrows',
|
|
809
|
+
arrow: 'splide__arrow m-carousel-arrow',
|
|
810
|
+
prev: 'splide__arrow--prev m-carousel-arrow-prev',
|
|
811
|
+
next: 'splide__arrow--next m-carousel-arrow-next',
|
|
812
|
+
// Paginator
|
|
813
|
+
pagination: 'splide__pagination m-carousel-pagination',
|
|
814
|
+
page: 'splide__pagination__page m-carousel-pagination-page',
|
|
815
|
+
} }) }, props, { children: children })));
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
function MCarouselSlide(_a) {
|
|
819
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
820
|
+
return (jsx(SplideSlide, Object.assign({ className: classNames('m-carousel-slide', className) }, props)));
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
function MList({ children, className, isFlush = false, isNumbered = false, isHorizontal = false, horizontalBreakpoint, }) {
|
|
824
|
+
if (isFlush && isHorizontal) {
|
|
825
|
+
throw new Error("Horizontal and Flush props don't work together");
|
|
826
|
+
}
|
|
827
|
+
return (jsx("div", Object.assign({ className: classNames('m-list list-group', {
|
|
828
|
+
'list-group-flush': isFlush && !isHorizontal,
|
|
829
|
+
'list-group-numbered': isNumbered,
|
|
830
|
+
'list-group-horizontal': isHorizontal && !horizontalBreakpoint,
|
|
831
|
+
}, (isHorizontal && horizontalBreakpoint) && `list-group-horizontal-${horizontalBreakpoint}`, className) }, { children: children })));
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
function MListItem({ children, className, isActive = false, isDisabled = false, theme, onMClick, }) {
|
|
835
|
+
const Tag = useMemo(() => (onMClick ? 'button' : 'div'), [onMClick]);
|
|
836
|
+
return (jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
837
|
+
onClick: onMClick,
|
|
838
|
+
type: 'button',
|
|
839
|
+
}, { className: classNames('m-list-item list-group-item list-group-item-action', theme ? `list-group-item-${theme}` : undefined, className, {
|
|
840
|
+
active: isActive,
|
|
841
|
+
disabled: isDisabled,
|
|
842
|
+
}) }, isActive && { 'aria-current': true }, { children: children })));
|
|
778
843
|
}
|
|
779
844
|
|
|
780
845
|
function useToast() {
|
|
781
|
-
const toast$1 = useCallback((message, { position = '
|
|
846
|
+
const toast$1 = useCallback((message, { position = 'top-right', type = 'info', showClose = true, autoClose = false, } = {}) => {
|
|
782
847
|
toast(({ closeToast }) => (jsx(MAlert, Object.assign({ type: type, showClose: showClose, onMClose: closeToast }, { children: message }))), {
|
|
783
848
|
transition: Slide,
|
|
784
849
|
position,
|
|
@@ -853,5 +918,78 @@ function useScreenshotWebShare() {
|
|
|
853
918
|
};
|
|
854
919
|
}
|
|
855
920
|
|
|
856
|
-
|
|
921
|
+
function MListItemMovement(_a) {
|
|
922
|
+
var { description, date, amount, classNameMovement } = _a, props = __rest(_a, ["description", "date", "amount", "classNameMovement"]);
|
|
923
|
+
const { format } = useFormatCurrency();
|
|
924
|
+
const value = useMemo(() => {
|
|
925
|
+
const valueFormatted = format(amount);
|
|
926
|
+
if (amount > 0) {
|
|
927
|
+
return {
|
|
928
|
+
theme: 'text-success',
|
|
929
|
+
valueFormatted,
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
return {
|
|
933
|
+
theme: 'text-danger',
|
|
934
|
+
valueFormatted,
|
|
935
|
+
};
|
|
936
|
+
}, [format, amount]);
|
|
937
|
+
return (jsx(MListItem, Object.assign({}, props, { children: jsxs("div", Object.assign({ className: classNames('m-list-item-movement', 'd-flex justify-content-between align-items-center p-3 gap-3', classNameMovement) }, { children: [jsxs("div", Object.assign({ className: "d-flex flex-column gap-1" }, { children: [jsx("span", Object.assign({ className: "fs-6" }, { children: description })), jsx("span", Object.assign({ className: "sp text-gray-700" }, { children: date }))] })), jsx("span", Object.assign({ className: classNames('fs-6', value.theme) }, { children: value.valueFormatted }))] })) })));
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function MStepper({ options, currentStep, successIcon = 'check', isVertical = false, }) {
|
|
941
|
+
return (jsx("div", Object.assign({ className: classNames({
|
|
942
|
+
'm-stepper': true,
|
|
943
|
+
'is-vertical': isVertical,
|
|
944
|
+
}) }, { children: options.map(({ label, value }) => (jsxs("div", Object.assign({ className: "m-step" }, { children: [jsx("div", Object.assign({ className: "m-step-value" }, { children: jsx("div", Object.assign({ className: classNames({
|
|
945
|
+
'm-step-icon-container': true,
|
|
946
|
+
'm-step-check': value < currentStep,
|
|
947
|
+
'm-step-current': value === currentStep,
|
|
948
|
+
}) }, { children: value < currentStep
|
|
949
|
+
? (jsx(MIcon, { icon: successIcon, innerClass: "m-step-icon" }))
|
|
950
|
+
: value })) })), jsx("div", Object.assign({ className: "m-step-label" }, { children: label }))] }), label))) })));
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function MFormikInputCurrency(_a) {
|
|
954
|
+
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
955
|
+
const [field, meta, helpers] = useField(name);
|
|
956
|
+
return (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 })));
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function MCard({ className, style, children, }) {
|
|
960
|
+
return (jsx("div", Object.assign({ style: style, className: classNames('card', className) }, { children: children })));
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function MCardBody({ className, children, }) {
|
|
964
|
+
return (jsx("div", Object.assign({ className: classNames('card-body', className) }, { children: children })));
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
function MCardAccount({ className, icon, theme, name, number, balance, balanceText, onClick, onClickText, }) {
|
|
968
|
+
return (jsx(MCard, Object.assign({ className: classNames('m-card-account', className) }, { children: jsxs(MCardBody, { children: [jsxs("div", Object.assign({ className: "d-flex gap-3 align-items-center" }, { children: [jsx(MIcon, { icon: icon, hasCircle: true, theme: theme, size: "1.5rem" }), jsxs("div", Object.assign({ className: "d-block flex-grow-1" }, { children: [jsx("p", Object.assign({ className: "text-gray-700" }, { children: name })), jsx("small", Object.assign({ className: "text-gray" }, { children: number }))] }))] })), jsxs("div", Object.assign({ className: "d-block" }, { children: [jsx("p", Object.assign({ className: "fw-bold fs-6 text-body" }, { children: balance })), jsx("small", Object.assign({ className: "text-gray-700" }, { children: balanceText }))] })), jsx("div", Object.assign({ className: "d-flex justify-content-end" }, { children: jsx(MButton, { text: onClickText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onMClick: onClick }) }))] }) })));
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function MCardHeader({ className, children, }) {
|
|
972
|
+
return (jsx("div", Object.assign({ className: classNames('card-header', className) }, { children: children })));
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
function MCardFooter({ className, children, }) {
|
|
976
|
+
return (jsx("div", Object.assign({ className: classNames('card-footer', className) }, { children: children })));
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
const LANG = liquidParser.parse('{{site.language}}');
|
|
980
|
+
async function configureI8n(resources, _a = {}) {
|
|
981
|
+
var { lng = LANG, fallbackLng = 'es' } = _a, config = __rest(_a, ["lng", "fallbackLng"]);
|
|
982
|
+
return i18n
|
|
983
|
+
.use(initReactI18next)
|
|
984
|
+
.init(Object.assign({ resources,
|
|
985
|
+
lng, initImmediate: true, fallbackLng, interpolation: {
|
|
986
|
+
escapeValue: false,
|
|
987
|
+
prefix: '{',
|
|
988
|
+
suffix: '}',
|
|
989
|
+
// skipOnVariables: false,
|
|
990
|
+
} }, config))
|
|
991
|
+
.then((t) => t);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export { LiquidContext$1 as LiquidContext, LiquidContextProvider, MAlert, MBadge, MBoxFile, MButton, MCard, MCardAccount, MCardBody, MCardFooter, MCardHeader, MCarousel, MCarouselSlide, MChip, MCollapse, MCollapseIconText, MCurrencyText, MDatePicker, MFormikInput, MFormikInputCurrency, MFormikInputSelect, MIcon, MInput, MInputCheck, MInputCounter, MInputCurrency, MInputCurrencyBase, MInputPassword, MInputPin, MInputSearch, MInputSelect, MInputSwitch, MList, MListItem, MListItemMovement, MModal, MOffcanvas, MPermissionGroup, MPermissionItem, MPopover, MProgressBar, MQuickActionButton, MQuickActionCheck, MQuickActionSelect, MQuickActionSwitch, MSkeleton, MStepper, MSummaryCard, MTabContent, MTabs, MToastContainer, MTooltip, ModalContext, ModalContextProvider, OffcanvasContext, OffcanvasContextProvider, configureI8n as configureI18n, useFormatCurrency, useLiquidContext, useModalContext, useOffcanvasContext, useScreenshot, useScreenshotDownload, useScreenshotWebShare, useTabContext, useToast };
|
|
857
995
|
//# sourceMappingURL=index.esm.js.map
|