@dynamic-framework/ui-react 1.2.1 → 1.3.0
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 -1
- package/dist/css/dynamic-ui-react.css +1 -1
- package/dist/css/dynamic-ui.css +1 -1
- package/dist/index.esm.js +180 -172
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +226 -216
- package/dist/index.js.map +1 -1
- package/dist/types/components/{MBoxFile.d.ts → DBoxFile.d.ts} +1 -1
- package/dist/types/components/{MCard.d.ts → DCard.d.ts} +1 -1
- package/dist/types/components/DCardAccount.d.ts +13 -0
- package/dist/types/components/{MCardBody.d.ts → DCardBody.d.ts} +1 -1
- package/dist/types/components/{MCardFooter.d.ts → DCardFooter.d.ts} +1 -1
- package/dist/types/components/{MCardHeader.d.ts → DCardHeader.d.ts} +1 -1
- package/dist/types/components/{MCarousel.d.ts → DCarousel.d.ts} +1 -1
- package/dist/types/components/{MCarouselSlide.d.ts → DCarouselSlide.d.ts} +1 -1
- package/dist/types/components/DCollapse.d.ts +11 -0
- package/dist/types/components/{banking/MCollapseIconText.d.ts → DCollapseIconText.d.ts} +1 -1
- package/dist/types/components/{MCurrencyText.d.ts → DCurrencyText.d.ts} +1 -1
- package/dist/types/components/{MDatePicker.d.ts → DDatePicker.d.ts} +3 -3
- package/dist/types/components/{MDatePickerHeader.d.ts → DDatePickerHeader.d.ts} +5 -4
- package/dist/types/components/DDatePickerInput.d.ts +8 -0
- package/dist/types/components/DDatePickerTime.d.ts +8 -0
- package/dist/types/components/DFormikInput.d.ts +7 -0
- package/dist/types/components/DFormikInputCurrency.d.ts +7 -0
- package/dist/types/components/{MFormikInputSelect.d.ts → DFormikInputSelect.d.ts} +3 -3
- package/dist/types/components/DInputCurrency.d.ts +9 -0
- package/dist/types/components/{MList.d.ts → DList.d.ts} +1 -1
- package/dist/types/components/{MListItem.d.ts → DListItem.d.ts} +2 -2
- package/dist/types/components/{MListItemMovement.d.ts → DListItemMovement.d.ts} +3 -3
- package/dist/types/components/DMonthPicker.d.ts +7 -0
- package/dist/types/components/{MPaginator.d.ts → DPaginator.d.ts} +4 -4
- package/dist/types/components/DPopover.d.ts +8 -0
- package/dist/types/components/{MSkeleton.d.ts → DSkeleton.d.ts} +1 -1
- package/dist/types/components/{MStepper.d.ts → DStepper.d.ts} +1 -1
- package/dist/types/components/{MTabContent.d.ts → DTabContent.d.ts} +1 -1
- package/dist/types/components/{MTabs.d.ts → DTabs.d.ts} +5 -5
- package/dist/types/components/{MToastContainer.d.ts → DToastContainer.d.ts} +2 -2
- package/dist/types/components/{MTooltip.d.ts → DTooltip.d.ts} +2 -2
- package/dist/types/components/banking/{MPermissionItem.d.ts → DPermissionItem.d.ts} +1 -1
- package/dist/types/components/banking/index.d.ts +1 -2
- package/dist/types/components/index.d.ts +27 -26
- package/dist/types/components/proxies.d.ts +21 -21
- package/dist/types/stories/components/{MBadge.stories.d.ts → DBadge.stories.d.ts} +3 -3
- package/dist/types/stories/components/DBoxFile.stories.d.ts +6 -0
- package/dist/types/stories/components/{MButton.stories.d.ts → DButton.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MCard.stories.d.ts → DCard.stories.d.ts} +3 -3
- package/dist/types/stories/components/DCardAccount.stories.d.ts +6 -0
- package/dist/types/stories/components/{MChip.stories.d.ts → DChip.stories.d.ts} +3 -3
- package/dist/types/stories/components/DCurrencyText.stories.d.ts +6 -0
- package/dist/types/stories/components/{MDatePicker.stories.d.ts → DDatePicker.stories.d.ts} +3 -3
- package/dist/types/stories/components/DFormikInput.stories.d.ts +7 -0
- package/dist/types/stories/components/{MFormikInputCurrency.stories.d.ts → DFormikInputCurrency.stories.d.ts} +3 -3
- package/dist/types/stories/components/DFormikInputSelect.stories.d.ts +7 -0
- package/dist/types/stories/components/{MIcon.stories.d.ts → DIcon.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInput.stories.d.ts → DInput.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCheck.stories.d.ts → DInputCheck.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCounter.stories.d.ts → DInputCounter.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCurrency.stories.d.ts → DInputCurrency.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCurrencyBase.stories.d.ts → DInputCurrencyBase.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputPassword.stories.d.ts → DInputPassword.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputPin.stories.d.ts → DInputPin.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSearch.stories.d.ts → DInputSearch.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSelect.stories.d.ts → DInputSelect.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSwitch.stories.d.ts → DInputSwitch.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MList.stories.d.ts → DList.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MListItem.stories.d.ts → DListItem.stories.d.ts} +3 -3
- package/dist/types/stories/components/DListItemMovement.stories.d.ts +7 -0
- package/dist/types/stories/components/{MPaginator.stories.d.ts → DPaginator.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MProgressBar.stories.d.ts → DProgress.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionButton.stories.d.ts → DQuickActionButton.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionCheck.stories.d.ts → DQuickActionCheck.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionSelect.stories.d.ts → DQuickActionSelect.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionSwitch.stories.d.ts → DQuickActionSwitch.stories.d.ts} +3 -3
- package/dist/types/stories/components/DSkeleton.stories.d.ts +6 -0
- package/dist/types/stories/components/{MStepper.stories.d.ts → DStepper.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MTooltip.stories.d.ts → DTooltip.stories.d.ts} +3 -3
- package/dist/types/stories/constants.d.ts +1 -2
- package/dist/types/stories/hooks/useOffcanvasContext.stories.d.ts +2 -2
- package/dist/types/stories/patterns/{MAlert.stories.d.ts → DAlert.stories.d.ts} +3 -3
- package/dist/types/stories/{components/MCarousel.stories.d.ts → patterns/DCarousel.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MCollapse.stories.d.ts → DCollapse.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/DCollapseIconText.stories.d.ts +6 -0
- package/dist/types/stories/patterns/{MModal.stories.d.ts → DModal.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MOffcanvas.stories.d.ts → DOffcanvas.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MPopover.stories.d.ts → DPopover.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MTabs.stories.d.ts → DTabs.stories.d.ts} +3 -3
- package/package.json +3 -3
- package/src/style/components/_+import.scss +15 -12
- package/src/style/components/_d-box-file.scss +66 -0
- package/src/style/components/{_m-card-account.scss → _d-card-account.scss} +1 -1
- package/src/style/components/_d-carousel.scss +44 -0
- package/src/style/components/_d-collapse-icon-text.scss +16 -0
- package/src/style/components/_d-collapse.scss +54 -0
- package/src/style/components/_d-datepicker.scss +224 -0
- package/src/style/components/_d-monthpicker.scss +90 -0
- package/src/style/components/_d-paginator.scss +98 -0
- package/src/style/components/_d-permission-group.scss +39 -0
- package/src/style/components/{_m-popover.scss → _d-popover.scss} +2 -2
- package/src/style/components/_d-stepper.scss +156 -0
- package/src/style/components/_d-tabs.scss +56 -0
- package/src/style/components/_d-timepicker.scss +37 -0
- package/dist/types/components/MCardAccount.d.ts +0 -13
- package/dist/types/components/MCollapse.d.ts +0 -11
- package/dist/types/components/MDatePickerInput.d.ts +0 -9
- package/dist/types/components/MDatePickerTime.d.ts +0 -9
- package/dist/types/components/MFormikInput.d.ts +0 -7
- package/dist/types/components/MFormikInputCurrency.d.ts +0 -7
- package/dist/types/components/MInputCurrency.d.ts +0 -9
- package/dist/types/components/MMonthPicker.d.ts +0 -7
- package/dist/types/components/MPopover.d.ts +0 -8
- package/dist/types/stories/components/MBoxFile.stories.d.ts +0 -6
- package/dist/types/stories/components/MCardAccount.stories.d.ts +0 -6
- package/dist/types/stories/components/MFormikInput.stories.d.ts +0 -7
- package/dist/types/stories/components/MFormikInputSelect.stories.d.ts +0 -7
- package/dist/types/stories/components/MListItemMovement.stories.d.ts +0 -7
- package/dist/types/stories/components/MSkeleton.stories.d.ts +0 -6
- package/dist/types/stories/patterns/MCollapseIconText.stories.d.ts +0 -6
- package/src/style/components/_m-box-file.scss +0 -66
- package/src/style/components/_m-carousel.scss +0 -44
- package/src/style/components/_m-collapse-icon-text.scss +0 -16
- package/src/style/components/_m-collapse.scss +0 -56
- package/src/style/components/_m-datepicker.scss +0 -224
- package/src/style/components/_m-monthpicker.scss +0 -90
- package/src/style/components/_m-paginator.scss +0 -98
- package/src/style/components/_m-stepper.scss +0 -156
- package/src/style/components/_m-tabs.scss +0 -56
- package/src/style/components/_m-timepicker.scss +0 -37
package/dist/index.esm.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
3
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
4
|
+
import { __rest } from 'tslib';
|
|
3
5
|
import DatePicker from 'react-datepicker';
|
|
4
6
|
import { DateTime } from 'luxon';
|
|
5
|
-
import React, { createElement,
|
|
6
|
-
import { defineCustomElement } from '@dynamic-framework/ui/components/
|
|
7
|
-
import { defineCustomElement as defineCustomElement$1 } from '@dynamic-framework/ui/components/
|
|
8
|
-
import { defineCustomElement as defineCustomElement$2 } from '@dynamic-framework/ui/components/
|
|
9
|
-
import { defineCustomElement as defineCustomElement$3 } from '@dynamic-framework/ui/components/
|
|
10
|
-
import { defineCustomElement as defineCustomElement$4 } from '@dynamic-framework/ui/components/
|
|
11
|
-
import { defineCustomElement as defineCustomElement$5 } from '@dynamic-framework/ui/components/
|
|
12
|
-
import { defineCustomElement as defineCustomElement$6 } from '@dynamic-framework/ui/components/
|
|
13
|
-
import { defineCustomElement as defineCustomElement$7 } from '@dynamic-framework/ui/components/
|
|
14
|
-
import { defineCustomElement as defineCustomElement$8 } from '@dynamic-framework/ui/components/
|
|
15
|
-
import { defineCustomElement as defineCustomElement$9 } from '@dynamic-framework/ui/components/
|
|
16
|
-
import { defineCustomElement as defineCustomElement$a } from '@dynamic-framework/ui/components/
|
|
17
|
-
import { defineCustomElement as defineCustomElement$b } from '@dynamic-framework/ui/components/
|
|
18
|
-
import { defineCustomElement as defineCustomElement$c } from '@dynamic-framework/ui/components/
|
|
19
|
-
import { defineCustomElement as defineCustomElement$d } from '@dynamic-framework/ui/components/
|
|
20
|
-
import { defineCustomElement as defineCustomElement$e } from '@dynamic-framework/ui/components/
|
|
21
|
-
import { defineCustomElement as defineCustomElement$f } from '@dynamic-framework/ui/components/
|
|
22
|
-
import { defineCustomElement as defineCustomElement$g } from '@dynamic-framework/ui/components/
|
|
23
|
-
import { defineCustomElement as defineCustomElement$h } from '@dynamic-framework/ui/components/
|
|
24
|
-
import { defineCustomElement as defineCustomElement$i } from '@dynamic-framework/ui/components/
|
|
25
|
-
import { defineCustomElement as defineCustomElement$j } from '@dynamic-framework/ui/components/
|
|
26
|
-
import { defineCustomElement as defineCustomElement$k } from '@dynamic-framework/ui/components/
|
|
27
|
-
import {
|
|
7
|
+
import React, { createElement, createContext, useMemo, useContext, useState, useCallback, useEffect, forwardRef, useImperativeHandle, useRef } from 'react';
|
|
8
|
+
import { defineCustomElement } from '@dynamic-framework/ui/components/d-alert.js';
|
|
9
|
+
import { defineCustomElement as defineCustomElement$1 } from '@dynamic-framework/ui/components/d-badge.js';
|
|
10
|
+
import { defineCustomElement as defineCustomElement$2 } from '@dynamic-framework/ui/components/d-button.js';
|
|
11
|
+
import { defineCustomElement as defineCustomElement$3 } from '@dynamic-framework/ui/components/d-chip.js';
|
|
12
|
+
import { defineCustomElement as defineCustomElement$4 } from '@dynamic-framework/ui/components/d-icon.js';
|
|
13
|
+
import { defineCustomElement as defineCustomElement$5 } from '@dynamic-framework/ui/components/d-input.js';
|
|
14
|
+
import { defineCustomElement as defineCustomElement$6 } from '@dynamic-framework/ui/components/d-input-check.js';
|
|
15
|
+
import { defineCustomElement as defineCustomElement$7 } from '@dynamic-framework/ui/components/d-input-counter.js';
|
|
16
|
+
import { defineCustomElement as defineCustomElement$8 } from '@dynamic-framework/ui/components/d-input-currency-base.js';
|
|
17
|
+
import { defineCustomElement as defineCustomElement$9 } from '@dynamic-framework/ui/components/d-input-password.js';
|
|
18
|
+
import { defineCustomElement as defineCustomElement$a } from '@dynamic-framework/ui/components/d-input-pin.js';
|
|
19
|
+
import { defineCustomElement as defineCustomElement$b } from '@dynamic-framework/ui/components/d-input-search.js';
|
|
20
|
+
import { defineCustomElement as defineCustomElement$c } from '@dynamic-framework/ui/components/d-input-select.js';
|
|
21
|
+
import { defineCustomElement as defineCustomElement$d } from '@dynamic-framework/ui/components/d-input-switch.js';
|
|
22
|
+
import { defineCustomElement as defineCustomElement$e } from '@dynamic-framework/ui/components/d-modal.js';
|
|
23
|
+
import { defineCustomElement as defineCustomElement$f } from '@dynamic-framework/ui/components/d-offcanvas.js';
|
|
24
|
+
import { defineCustomElement as defineCustomElement$g } from '@dynamic-framework/ui/components/d-progress.js';
|
|
25
|
+
import { defineCustomElement as defineCustomElement$h } from '@dynamic-framework/ui/components/d-quick-action-button.js';
|
|
26
|
+
import { defineCustomElement as defineCustomElement$i } from '@dynamic-framework/ui/components/d-quick-action-check.js';
|
|
27
|
+
import { defineCustomElement as defineCustomElement$j } from '@dynamic-framework/ui/components/d-quick-action-select.js';
|
|
28
|
+
import { defineCustomElement as defineCustomElement$k } from '@dynamic-framework/ui/components/d-quick-action-switch.js';
|
|
29
|
+
import { liquidParser, PREFIX_BS, formatCurrency } from '@dynamic-framework/ui';
|
|
28
30
|
export { liquidParser } from '@dynamic-framework/ui';
|
|
29
31
|
import ContentLoader from 'react-content-loader';
|
|
30
32
|
import classNames from 'classnames';
|
|
31
|
-
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
32
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
33
33
|
import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
34
34
|
import { useField } from 'formik';
|
|
35
35
|
import { useDropzone } from 'react-dropzone';
|
|
36
36
|
import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
37
|
+
import ResponsivePagination from 'react-responsive-pagination';
|
|
37
38
|
import i18n from 'i18next';
|
|
38
39
|
import { initReactI18next } from 'react-i18next';
|
|
39
40
|
import html2canvas from 'html2canvas';
|
|
@@ -242,60 +243,42 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
242
243
|
};
|
|
243
244
|
|
|
244
245
|
/* eslint-disable */
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
270
|
-
useEffect(() => {
|
|
271
|
-
if (onChange) {
|
|
272
|
-
onChange(toggle);
|
|
273
|
-
}
|
|
274
|
-
}, [toggle, onChange]);
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
setToggle(defaultCollapsed);
|
|
277
|
-
}, [defaultCollapsed]);
|
|
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({
|
|
279
|
-
'collapse-body': true,
|
|
280
|
-
}), style: {
|
|
281
|
-
[`--${PREFIX_BS}m-collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
282
|
-
} }, { children: children })))] })));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function MCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, }) {
|
|
286
|
-
return (jsx(MCollapse, Object.assign({ defaultCollapsed: true, className: "m-collapse-icon-text", Component: (jsxs("div", Object.assign({ className: "m-collapse-icon-text-header" }, { children: [jsx(MIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", Object.assign({ className: "m-collapse-icon-text-title" }, { children: title }))] }))) }, { children: children })));
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function MPermissionItem({ permission, permissionState, onChange, onAction = () => { }, }) {
|
|
290
|
-
return (jsxs("div", Object.assign({ role: "button", tabIndex: 0, onKeyDown: () => { }, className: "d-flex permission-item align-items-center", onClick: onAction }, { children: [jsx("span", Object.assign({ className: "flex-grow-1 label" }, { children: permission.label })), permission.type === 'custom' && (jsx(MBadge, { theme: "tertiary", text: permissionState })), jsx(MInputSwitch, { mId: permission.id, isChecked: !!permission.value, isDisabled: !permission.enabled, onMChange: ({ detail: checked }) => onChange(checked) })] })));
|
|
246
|
+
const DAlert = /*@__PURE__*/ createReactComponent('d-alert', undefined, undefined, defineCustomElement);
|
|
247
|
+
const DBadge = /*@__PURE__*/ createReactComponent('d-badge', undefined, undefined, defineCustomElement$1);
|
|
248
|
+
const DButton = /*@__PURE__*/ createReactComponent('d-button', undefined, undefined, defineCustomElement$2);
|
|
249
|
+
const DChip = /*@__PURE__*/ createReactComponent('d-chip', undefined, undefined, defineCustomElement$3);
|
|
250
|
+
const DIcon = /*@__PURE__*/ createReactComponent('d-icon', undefined, undefined, defineCustomElement$4);
|
|
251
|
+
const DInput = /*@__PURE__*/ createReactComponent('d-input', undefined, undefined, defineCustomElement$5);
|
|
252
|
+
const DInputCheck = /*@__PURE__*/ createReactComponent('d-input-check', undefined, undefined, defineCustomElement$6);
|
|
253
|
+
const DInputCounter = /*@__PURE__*/ createReactComponent('d-input-counter', undefined, undefined, defineCustomElement$7);
|
|
254
|
+
const DInputCurrencyBase = /*@__PURE__*/ createReactComponent('d-input-currency-base', undefined, undefined, defineCustomElement$8);
|
|
255
|
+
const DInputPassword = /*@__PURE__*/ createReactComponent('d-input-password', undefined, undefined, defineCustomElement$9);
|
|
256
|
+
const DInputPin = /*@__PURE__*/ createReactComponent('d-input-pin', undefined, undefined, defineCustomElement$a);
|
|
257
|
+
const DInputSearch = /*@__PURE__*/ createReactComponent('d-input-search', undefined, undefined, defineCustomElement$b);
|
|
258
|
+
const DInputSelect = /*@__PURE__*/ createReactComponent('d-input-select', undefined, undefined, defineCustomElement$c);
|
|
259
|
+
const DInputSwitch = /*@__PURE__*/ createReactComponent('d-input-switch', undefined, undefined, defineCustomElement$d);
|
|
260
|
+
const DModal = /*@__PURE__*/ createReactComponent('d-modal', undefined, undefined, defineCustomElement$e);
|
|
261
|
+
const DOffcanvas = /*@__PURE__*/ createReactComponent('d-offcanvas', undefined, undefined, defineCustomElement$f);
|
|
262
|
+
const DProgress = /*@__PURE__*/ createReactComponent('d-progress', undefined, undefined, defineCustomElement$g);
|
|
263
|
+
const DQuickActionButton = /*@__PURE__*/ createReactComponent('d-quick-action-button', undefined, undefined, defineCustomElement$h);
|
|
264
|
+
const DQuickActionCheck = /*@__PURE__*/ createReactComponent('d-quick-action-check', undefined, undefined, defineCustomElement$i);
|
|
265
|
+
const DQuickActionSelect = /*@__PURE__*/ createReactComponent('d-quick-action-select', undefined, undefined, defineCustomElement$j);
|
|
266
|
+
const DQuickActionSwitch = /*@__PURE__*/ createReactComponent('d-quick-action-switch', undefined, undefined, defineCustomElement$k);
|
|
267
|
+
|
|
268
|
+
function DPermissionItem({ permission, permissionState, onChange, onAction = () => { }, }) {
|
|
269
|
+
return (jsxs("div", Object.assign({ role: "button", tabIndex: 0, onKeyDown: () => { }, className: "d-flex permission-item align-items-center", onClick: onAction }, { children: [jsx("span", Object.assign({ className: "flex-grow-1 label" }, { children: permission.label })), permission.type === 'custom' && (jsx(DBadge, { theme: "tertiary", text: permissionState })), jsx(DInputSwitch, { innerId: permission.id, isChecked: !!permission.value, isDisabled: !permission.enabled, onEventChange: ({ detail: checked }) => onChange(checked) })] })));
|
|
291
270
|
}
|
|
292
271
|
|
|
293
272
|
function MPermissionGroup({ title, description, permissionState, permissionList, onChangePermission, onCustomAction = () => { }, }) {
|
|
294
|
-
return (jsxs("div", Object.assign({ className: "row operation-group g-0 mb-3 mb-lg-0" }, { children: [jsxs("div", Object.assign({ className: "col-12 col-lg-4 d-flex flex-column justify-content-center" }, { children: [jsx("h6", Object.assign({ className: "fw-bold mb-3 mb-lg-2" }, { children: title })), jsx("p", Object.assign({ className: "fs-8 d-none d-lg-block m-0" }, { children: description }))] })), jsx("div", Object.assign({ className: "col-12 offset-lg-1 col-lg-7" }, { children: permissionList.map((permission) => (jsx(
|
|
273
|
+
return (jsxs("div", Object.assign({ className: "row operation-group g-0 mb-3 mb-lg-0" }, { children: [jsxs("div", Object.assign({ className: "col-12 col-lg-4 d-flex flex-column justify-content-center" }, { children: [jsx("h6", Object.assign({ className: "fw-bold mb-3 mb-lg-2" }, { children: title })), jsx("p", Object.assign({ className: "fs-8 d-none d-lg-block m-0" }, { children: description }))] })), jsx("div", Object.assign({ className: "col-12 offset-lg-1 col-lg-7" }, { children: permissionList.map((permission) => (jsx(DPermissionItem, { permission: permission, permissionState: permissionState, onChange: (isChecked) => onChangePermission(permission, isChecked), onAction: () => onCustomAction(permission) }, permission.id))) }))] })));
|
|
295
274
|
}
|
|
296
275
|
|
|
297
276
|
function MSummaryCard({ title, description, icon, iconSize, iconTheme, Summary, }) {
|
|
298
|
-
return (jsxs("div", { children: [jsx("h6", Object.assign({ className: "fw-bold fs-6" }, { children: title })), jsx("p", Object.assign({ className: "fs-8" }, { children: description })), jsxs("div", Object.assign({ className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8" }, { children: [jsx(
|
|
277
|
+
return (jsxs("div", { children: [jsx("h6", Object.assign({ className: "fw-bold fs-6" }, { children: title })), jsx("p", Object.assign({ className: "fs-8" }, { children: description })), jsxs("div", Object.assign({ className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8" }, { children: [jsx(DIcon, { icon: icon, theme: iconTheme, size: iconSize }), Summary] }))] }));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function DToastContainer({ style, position = 'top-right', }) {
|
|
281
|
+
return (jsx(ToastContainer, { toastClassName: () => 'shadow-none p-0 cursor-default', position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: Slide, style: style }));
|
|
299
282
|
}
|
|
300
283
|
|
|
301
284
|
const LiquidContext = createContext({
|
|
@@ -547,50 +530,50 @@ function useOffcanvasContext() {
|
|
|
547
530
|
return context;
|
|
548
531
|
}
|
|
549
532
|
|
|
550
|
-
function
|
|
551
|
-
var { value,
|
|
552
|
-
return (jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column
|
|
553
|
-
|
|
554
|
-
}, { type: "time",
|
|
533
|
+
function DDatePickerTime(_a) {
|
|
534
|
+
var { value, onEventChange, innerId, label } = _a, props = __rest(_a, ["value", "onEventChange", "innerId", "label"]);
|
|
535
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column d-datepicker-time" }, { children: [label && (jsx("p", Object.assign({ className: "d-datepicker-time-label" }, { children: label }))), jsx(DInput, Object.assign({}, onEventChange && {
|
|
536
|
+
onEventChange: (time) => onEventChange(time),
|
|
537
|
+
}, { type: "time", innerId: innerId, value: value }, props))] })));
|
|
555
538
|
}
|
|
556
539
|
|
|
557
|
-
function
|
|
558
|
-
var { value,
|
|
540
|
+
function DDatePickerInput(_a, ref) {
|
|
541
|
+
var { value, onEventClick, innerId, iconEnd } = _a, props = __rest(_a, ["value", "onEventClick", "innerId", "iconEnd"]);
|
|
559
542
|
useImperativeHandle(ref, () => ({}), []);
|
|
560
|
-
return (jsx("div", Object.assign({ role: "button", onClick:
|
|
543
|
+
return (jsx("div", Object.assign({ role: "button", onClick: onEventClick, onKeyDown: () => { }, tabIndex: -1 }, { children: jsx(DInput, Object.assign({ isReadOnly: true, type: "text", innerId: innerId, value: value, onEventIconEndClick: onEventClick, iconEnd: iconEnd }, props)) })));
|
|
561
544
|
}
|
|
562
|
-
var
|
|
545
|
+
var DDatePickerInput$1 = forwardRef(DDatePickerInput);
|
|
563
546
|
|
|
564
|
-
function
|
|
565
|
-
var {
|
|
547
|
+
function DMonthPicker(_a) {
|
|
548
|
+
var { onEventChangeDate, date } = _a, props = __rest(_a, ["onEventChangeDate", "date"]);
|
|
566
549
|
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
567
550
|
const { language } = useLiquidContext();
|
|
568
551
|
const lang = language || 'en';
|
|
569
|
-
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "
|
|
570
|
-
|
|
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(
|
|
552
|
+
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "d-month-picker", onChange: (value) => {
|
|
553
|
+
onEventChangeDate(value);
|
|
554
|
+
}, 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(DButton, { iconStart: "chevron-left", size: "sm", variant: "link", theme: "light", onEventClick: decreaseYear, isDisabled: prevYearButtonDisabled }), jsx("p", Object.assign({ className: "fs-6 fw-bold" }, { children: monthDate.getFullYear() })), jsx(DButton, { iconStart: "chevron-right", size: "sm", variant: "link", theme: "light", onEventClick: increaseYear, isDisabled: nextYearButtonDisabled })] }))) }, props)));
|
|
572
555
|
}
|
|
573
556
|
|
|
574
|
-
function
|
|
557
|
+
function DDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, decreaseMonthIcon, increaseMonthIcon, iconSize, buttonVariant, buttonTheme, }) {
|
|
575
558
|
const { language } = useLiquidContext();
|
|
576
559
|
const lang = language || 'en';
|
|
577
|
-
return (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between
|
|
560
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between d-datepicker-header" }, { children: [jsx(DButton, { iconStart: decreaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onEventClick: decreaseMonth, isDisabled: prevMonthButtonDisabled }), jsx(DMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, { date: monthDate.toISOString(), onEventChangeDate: (value) => {
|
|
578
561
|
if (value) {
|
|
579
562
|
changeMonth(DateTime.fromJSDate(value).month - 1);
|
|
580
563
|
changeYear(DateTime.fromJSDate(value).year);
|
|
581
564
|
}
|
|
582
|
-
} }, lang && { locale: lang })), jsx(
|
|
565
|
+
} }, lang && { locale: lang })), jsx(DButton, { iconStart: increaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onEventClick: increaseMonth, isDisabled: nextMonthButtonDisabled })] })));
|
|
583
566
|
}
|
|
584
567
|
|
|
585
|
-
function
|
|
586
|
-
var {
|
|
568
|
+
function DDatePicker(_a) {
|
|
569
|
+
var { onEventChangeDate, 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, ["onEventChangeDate", "date", "selectsRange", "withMonthSelector", "inputLabel", "inputIcon", "inputId", "timeId", "timeLabel", "headerDecreaseMonthIcon", "headerIncreaseMonthIcon", "headerIconSize", "headerButtonVariant", "headerButtonTheme"]);
|
|
587
570
|
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
588
571
|
const { language } = useLiquidContext();
|
|
589
572
|
const lang = language || 'en';
|
|
590
573
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
591
|
-
const InputPicker = forwardRef(({ value, onClick }, ref) => (jsx(
|
|
592
|
-
const TimeInputPicker = useCallback(({ value, onChange }) => (jsx(
|
|
593
|
-
const DatePickerHeader = useCallback((headerProps) => (jsx(
|
|
574
|
+
const InputPicker = forwardRef(({ value, onClick }, ref) => (jsx(DDatePickerInput$1, { label: inputLabel, innerId: inputId, iconEnd: inputIcon, value: value, onEventClick: onClick, ref: ref })));
|
|
575
|
+
const TimeInputPicker = useCallback(({ value, onChange }) => (jsx(DDatePickerTime, { onEventChange: onChange, value: value, label: timeLabel, innerId: timeId })), [timeLabel, timeId]);
|
|
576
|
+
const DatePickerHeader = useCallback((headerProps) => (jsx(DDatePickerHeader, Object.assign({}, headerProps, { decreaseMonthIcon: headerDecreaseMonthIcon, increaseMonthIcon: headerIncreaseMonthIcon, iconSize: headerIconSize, buttonVariant: headerButtonVariant, buttonTheme: headerButtonTheme, withMonthSelector: !!withMonthSelector }))), [headerButtonTheme,
|
|
594
577
|
headerButtonVariant,
|
|
595
578
|
headerDecreaseMonthIcon,
|
|
596
579
|
headerIconSize,
|
|
@@ -598,11 +581,11 @@ function MDatePicker(_a) {
|
|
|
598
581
|
withMonthSelector,
|
|
599
582
|
]);
|
|
600
583
|
return (jsx(DatePicker, Object.assign({ selected: dateJS(date), calendarClassName: "m-date-picker", onChange: (value) => {
|
|
601
|
-
|
|
584
|
+
onEventChangeDate(value);
|
|
602
585
|
}, renderCustomHeader: (headerProps) => jsx(DatePickerHeader, Object.assign({}, headerProps)), customInput: jsx(InputPicker, {}), customTimeInput: jsx(TimeInputPicker, {}), selectsRange: selectsRange }, lang && { locale: lang }, props)));
|
|
603
586
|
}
|
|
604
587
|
|
|
605
|
-
function
|
|
588
|
+
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
606
589
|
const innerBackgroundColor = useMemo(() => {
|
|
607
590
|
if (backgroundColor) {
|
|
608
591
|
return backgroundColor;
|
|
@@ -621,14 +604,14 @@ function MSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, child
|
|
|
621
604
|
}
|
|
622
605
|
|
|
623
606
|
const TabContext = createContext(undefined);
|
|
624
|
-
function
|
|
607
|
+
function DTabs({ children, defaultSelected, onEventChange, options, className, isVertical, }) {
|
|
625
608
|
const [selected, setSelected] = useState(defaultSelected);
|
|
626
609
|
const onSelect = useCallback((option) => {
|
|
627
610
|
if (option.tab) {
|
|
628
611
|
setSelected(option.tab);
|
|
629
612
|
}
|
|
630
|
-
|
|
631
|
-
}, [
|
|
613
|
+
onEventChange(option);
|
|
614
|
+
}, [onEventChange]);
|
|
632
615
|
useEffect(() => {
|
|
633
616
|
setSelected(defaultSelected);
|
|
634
617
|
}, [defaultSelected]);
|
|
@@ -637,8 +620,8 @@ function MTabs({ children, defaultSelected, onChange, options, className, isVert
|
|
|
637
620
|
isSelected,
|
|
638
621
|
}), [isSelected]);
|
|
639
622
|
return (jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxs("div", Object.assign({ className: classNames({
|
|
640
|
-
'
|
|
641
|
-
'
|
|
623
|
+
'd-tabs': true,
|
|
624
|
+
'd-tabs-vertical': isVertical,
|
|
642
625
|
}) }, { children: [jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsx("button", Object.assign({ id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
643
626
|
active: option.tab === selected,
|
|
644
627
|
}, 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 }))] })) })));
|
|
@@ -651,7 +634,7 @@ function useTabContext() {
|
|
|
651
634
|
return context;
|
|
652
635
|
}
|
|
653
636
|
|
|
654
|
-
function
|
|
637
|
+
function DTabContent({ tab, children }) {
|
|
655
638
|
const { isSelected } = useTabContext();
|
|
656
639
|
if (!isSelected(tab)) {
|
|
657
640
|
return null;
|
|
@@ -659,19 +642,17 @@ function MTabContent({ tab, children }) {
|
|
|
659
642
|
return (jsx("div", Object.assign({ className: "tab-pane fade show active", id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab` }, { children: children })));
|
|
660
643
|
}
|
|
661
644
|
|
|
662
|
-
function
|
|
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 }));
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
function MPopover({ children, renderComponent, isOpen, setIsOpen = () => { }, }) {
|
|
645
|
+
function DPopover({ children, renderComponent, isOpen, setEventIsOpen, }) {
|
|
667
646
|
const [innerIsOpen, setInnerIsOpen] = useState(false);
|
|
668
647
|
useEffect(() => {
|
|
669
648
|
setInnerIsOpen(isOpen);
|
|
670
649
|
}, [isOpen]);
|
|
671
650
|
const onOpenChange = useCallback((value) => {
|
|
672
651
|
setInnerIsOpen(value);
|
|
673
|
-
|
|
674
|
-
|
|
652
|
+
if (setEventIsOpen) {
|
|
653
|
+
setEventIsOpen(value);
|
|
654
|
+
}
|
|
655
|
+
}, [setEventIsOpen]);
|
|
675
656
|
const { refs, floatingStyles, context } = useFloating({
|
|
676
657
|
open: innerIsOpen,
|
|
677
658
|
onOpenChange,
|
|
@@ -691,7 +672,7 @@ function MPopover({ children, renderComponent, isOpen, setIsOpen = () => { }, })
|
|
|
691
672
|
role,
|
|
692
673
|
]);
|
|
693
674
|
const headingId = useId();
|
|
694
|
-
return (jsxs("div", Object.assign({ className: "
|
|
675
|
+
return (jsxs("div", Object.assign({ className: "d-popover" }, { children: [jsx("div", Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: renderComponent(innerIsOpen) })), innerIsOpen && (jsx(FloatingFocusManager, Object.assign({ context: context, modal: false }, { children: jsx("div", Object.assign({ className: "d-popover-content", ref: refs.setFloating, style: floatingStyles, "aria-labelledby": headingId }, getFloatingProps(), { children: children })) })))] })));
|
|
695
676
|
}
|
|
696
677
|
|
|
697
678
|
function useFormatCurrency(...args) {
|
|
@@ -704,45 +685,45 @@ function useFormatCurrency(...args) {
|
|
|
704
685
|
};
|
|
705
686
|
}
|
|
706
687
|
|
|
707
|
-
function
|
|
688
|
+
function DCurrencyText({ value, className, }) {
|
|
708
689
|
const { values: [valueFormatted] } = useFormatCurrency(value);
|
|
709
690
|
return (jsx("span", Object.assign({ className: className }, { children: valueFormatted })));
|
|
710
691
|
}
|
|
711
692
|
|
|
712
|
-
function
|
|
693
|
+
function DFormikInput(_a) {
|
|
713
694
|
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
714
695
|
const [field, meta, helpers] = useField(name);
|
|
715
|
-
return (jsx(
|
|
696
|
+
return (jsx(DInput, Object.assign({}, props, { name: field.name, value: field.value, onEventChange: ({ detail }) => helpers.setValue(detail), onEventBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error, hint: meta.error || hint })));
|
|
716
697
|
}
|
|
717
698
|
|
|
718
|
-
function
|
|
699
|
+
function DFormikInputSelect(_a) {
|
|
719
700
|
var { name, labelExtractor = (item) => item === null || item === void 0 ? void 0 : item.label, valueExtractor = (item) => item === null || item === void 0 ? void 0 : item.value } = _a, props = __rest(_a, ["name", "labelExtractor", "valueExtractor"]);
|
|
720
701
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
721
702
|
const [field, , helpers] = useField(name);
|
|
722
|
-
return (jsx(
|
|
703
|
+
return (jsx(DInputSelect, Object.assign({}, props, { name: field.name, selectedOption: field.value, labelExtractor: labelExtractor, valueExtractor: valueExtractor, onEventChange: ({ detail }) => helpers.setValue(detail), onEventBlur: ({ detail }) => field.onBlur(detail) })));
|
|
723
704
|
}
|
|
724
705
|
|
|
725
706
|
const TOOLTIP_FONT_SIZE_BY_SIZE = {
|
|
726
|
-
sm: `var(--${PREFIX_BS}ref-fs-
|
|
707
|
+
sm: `var(--${PREFIX_BS}ref-fs-small)`,
|
|
727
708
|
default: `var(--${PREFIX_BS}body-font-size)`,
|
|
728
709
|
lg: `var(--${PREFIX_BS}ref-fs-6)`,
|
|
729
710
|
};
|
|
730
711
|
const ARROW_WIDTH = 8;
|
|
731
712
|
const ARROW_HEIGHT = 4;
|
|
732
713
|
const GAP = 2;
|
|
733
|
-
function
|
|
714
|
+
function DTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP, padding, withFocus = false, withClick = false, withHover = true, isOpen = false, placement = 'top', size, Component, children, }) {
|
|
734
715
|
const [open, setOpen] = useState(isOpen);
|
|
735
716
|
const styleVariables = useMemo(() => {
|
|
736
717
|
const defaultFontSize = size
|
|
737
718
|
? TOOLTIP_FONT_SIZE_BY_SIZE[size]
|
|
738
719
|
: TOOLTIP_FONT_SIZE_BY_SIZE.default;
|
|
739
720
|
return {
|
|
740
|
-
background: `var(--${PREFIX_BS}
|
|
741
|
-
borderRadius: `var(--${PREFIX_BS}
|
|
742
|
-
color: `var(--${PREFIX_BS}
|
|
743
|
-
fontSize: `var(--${PREFIX_BS}
|
|
744
|
-
padding: `var(--${PREFIX_BS}
|
|
745
|
-
maxWidth: `var(--${PREFIX_BS}
|
|
721
|
+
background: `var(--${PREFIX_BS}tooltip-bg, var(--${PREFIX_BS}tooltip-component-bg, var(--${PREFIX_BS}secondary)))`,
|
|
722
|
+
borderRadius: `var(--${PREFIX_BS}tooltip-border-radius, var(--${PREFIX_BS}tooltip-component-border-radius, var(--${PREFIX_BS}border-radius)))`,
|
|
723
|
+
color: `var(--${PREFIX_BS}tooltip-color, var(--${PREFIX_BS}tooltip-component-color, var(--${PREFIX_BS}white)))`,
|
|
724
|
+
fontSize: `var(--${PREFIX_BS}tooltip-font-size, var(--${PREFIX_BS}tooltip-component-font-size, ${defaultFontSize}))`,
|
|
725
|
+
padding: `var(--${PREFIX_BS}tooltip-padding, var(--${PREFIX_BS}tooltip-component-padding, var(--${PREFIX_BS}ref-spacer-2)))`,
|
|
726
|
+
maxWidth: `var(--${PREFIX_BS}tooltip-max-width, var(--${PREFIX_BS}tooltip-component-max-width, 300px))`,
|
|
746
727
|
};
|
|
747
728
|
}, [size]);
|
|
748
729
|
const arrowRef = useRef(null);
|
|
@@ -779,64 +760,82 @@ function MTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP,
|
|
|
779
760
|
}, width: ARROW_WIDTH, height: ARROW_HEIGHT }), children] }))) })] }));
|
|
780
761
|
}
|
|
781
762
|
|
|
782
|
-
function
|
|
783
|
-
|
|
763
|
+
function DCollapse({ id, className, Component, hasSeparator = false, defaultCollapsed = false, onEventChange, children, }) {
|
|
764
|
+
const [toggle, setToggle] = useState(defaultCollapsed);
|
|
765
|
+
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
766
|
+
useEffect(() => {
|
|
767
|
+
if (onEventChange) {
|
|
768
|
+
onEventChange(toggle);
|
|
769
|
+
}
|
|
770
|
+
}, [toggle, onEventChange]);
|
|
771
|
+
useEffect(() => {
|
|
772
|
+
setToggle(defaultCollapsed);
|
|
773
|
+
}, [defaultCollapsed]);
|
|
774
|
+
return (jsxs("div", Object.assign({ id: id, className: classNames('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(DIcon, { 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({
|
|
775
|
+
'collapse-body': true,
|
|
776
|
+
}), style: {
|
|
777
|
+
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
778
|
+
} }, { children: children })))] })));
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function DInputCurrency(_a) {
|
|
782
|
+
var { onEventChange, onEventBlur, onEventFocus } = _a, otherProps = __rest(_a, ["onEventChange", "onEventBlur", "onEventFocus"]);
|
|
784
783
|
const { currency } = useLiquidContext();
|
|
785
|
-
return (jsx(
|
|
786
|
-
|
|
787
|
-
},
|
|
788
|
-
|
|
784
|
+
return (jsx(DInputCurrencyBase, Object.assign({ currencyOptions: currency, onEventChange: ({ detail }) => onEventChange(detail) }, onEventBlur && {
|
|
785
|
+
onEventBlur: ({ detail }) => onEventBlur(detail),
|
|
786
|
+
}, onEventFocus && {
|
|
787
|
+
onEventFocus: ({ detail }) => onEventFocus(detail),
|
|
789
788
|
}, otherProps)));
|
|
790
789
|
}
|
|
791
790
|
|
|
792
|
-
function
|
|
791
|
+
function DBoxFile(_a) {
|
|
793
792
|
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, isDisabled = false, children } = _a, dropzoneOptions = __rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "isDisabled", "children"]);
|
|
794
793
|
const { acceptedFiles, getRootProps, getInputProps, } = useDropzone(Object.assign({ disabled: isDisabled }, dropzoneOptions));
|
|
795
|
-
return (jsxs("section", Object.assign({ className: classNames('
|
|
796
|
-
'
|
|
794
|
+
return (jsxs("section", Object.assign({ className: classNames('d-box-file', {
|
|
795
|
+
'd-box-file-selected': !!acceptedFiles.length,
|
|
797
796
|
}) }, { children: [jsxs("div", Object.assign({}, getRootProps({
|
|
798
|
-
className: classNames('
|
|
797
|
+
className: classNames('d-box-file-dropzone', {
|
|
799
798
|
disabled: isDisabled,
|
|
800
799
|
}),
|
|
801
|
-
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(
|
|
800
|
+
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsx("div", Object.assign({ className: "d-box-content" }, { children: children }))] })), !!acceptedFiles.length && (jsx("aside", Object.assign({ className: "d-box-files" }, { children: acceptedFiles.map((file) => (jsx("div", Object.assign({ className: "d-box-files-text" }, { children: `${file.name} - ${file.size} bytes` }), file.name))) })))] })));
|
|
802
801
|
}
|
|
803
802
|
|
|
804
|
-
function
|
|
803
|
+
function DCarousel(_a) {
|
|
805
804
|
var { children, className, options } = _a, props = __rest(_a, ["children", "className", "options"]);
|
|
806
|
-
return (jsx(Splide, Object.assign({ className: classNames('
|
|
805
|
+
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), options: Object.assign(Object.assign({}, options), { classes: {
|
|
807
806
|
// Arrows
|
|
808
|
-
arrows: 'splide__arrows
|
|
809
|
-
arrow: 'splide__arrow
|
|
810
|
-
prev: 'splide__arrow--prev
|
|
811
|
-
next: 'splide__arrow--next
|
|
807
|
+
arrows: 'splide__arrows d-carousel-arrows',
|
|
808
|
+
arrow: 'splide__arrow d-carousel-arrow',
|
|
809
|
+
prev: 'splide__arrow--prev d-carousel-arrow-prev',
|
|
810
|
+
next: 'splide__arrow--next d-carousel-arrow-next',
|
|
812
811
|
// Paginator
|
|
813
|
-
pagination: 'splide__pagination
|
|
814
|
-
page: 'splide__pagination__page
|
|
812
|
+
pagination: 'splide__pagination d-carousel-pagination',
|
|
813
|
+
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
815
814
|
} }) }, props, { children: children })));
|
|
816
815
|
}
|
|
817
816
|
|
|
818
|
-
function
|
|
817
|
+
function DCarouselSlide(_a) {
|
|
819
818
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
820
|
-
return (jsx(SplideSlide, Object.assign({ className: classNames('
|
|
819
|
+
return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
821
820
|
}
|
|
822
821
|
|
|
823
|
-
function
|
|
822
|
+
function DList({ children, className, isFlush = false, isNumbered = false, isHorizontal = false, horizontalBreakpoint, }) {
|
|
824
823
|
if (isFlush && isHorizontal) {
|
|
825
824
|
throw new Error("Horizontal and Flush props don't work together");
|
|
826
825
|
}
|
|
827
|
-
return (jsx("div", Object.assign({ className: classNames('
|
|
826
|
+
return (jsx("div", Object.assign({ className: classNames('list-group', {
|
|
828
827
|
'list-group-flush': isFlush && !isHorizontal,
|
|
829
828
|
'list-group-numbered': isNumbered,
|
|
830
829
|
'list-group-horizontal': isHorizontal && !horizontalBreakpoint,
|
|
831
830
|
}, (isHorizontal && horizontalBreakpoint) && `list-group-horizontal-${horizontalBreakpoint}`, className) }, { children: children })));
|
|
832
831
|
}
|
|
833
832
|
|
|
834
|
-
function
|
|
835
|
-
const Tag = useMemo(() => (
|
|
833
|
+
function DListItem({ children, className, isActive = false, isDisabled = false, theme, onEventClick, }) {
|
|
834
|
+
const Tag = useMemo(() => (onEventClick ? 'button' : 'div'), [onEventClick]);
|
|
836
835
|
return (jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
837
|
-
onClick:
|
|
836
|
+
onClick: onEventClick,
|
|
838
837
|
type: 'button',
|
|
839
|
-
}, { className: classNames('
|
|
838
|
+
}, { className: classNames('list-group-item list-group-item-action', theme ? `list-group-item-${theme}` : undefined, className, {
|
|
840
839
|
active: isActive,
|
|
841
840
|
disabled: isDisabled,
|
|
842
841
|
}) }, isActive && { 'aria-current': true }, { children: children })));
|
|
@@ -844,7 +843,7 @@ function MListItem({ children, className, isActive = false, isDisabled = false,
|
|
|
844
843
|
|
|
845
844
|
function useToast() {
|
|
846
845
|
const toast$1 = useCallback((message, { position = 'top-right', type = 'info', showClose = true, autoClose = false, } = {}) => {
|
|
847
|
-
toast(({ closeToast }) => (jsx(
|
|
846
|
+
toast(({ closeToast }) => (jsx(DAlert, Object.assign({ type: type, showClose: showClose, onEventClose: closeToast }, { children: message }))), {
|
|
848
847
|
transition: Slide,
|
|
849
848
|
position,
|
|
850
849
|
autoClose,
|
|
@@ -918,7 +917,7 @@ function useScreenshotWebShare() {
|
|
|
918
917
|
};
|
|
919
918
|
}
|
|
920
919
|
|
|
921
|
-
function
|
|
920
|
+
function DListItemMovement(_a) {
|
|
922
921
|
var { description, date, amount, classNameMovement } = _a, props = __rest(_a, ["description", "date", "amount", "classNameMovement"]);
|
|
923
922
|
const { format } = useFormatCurrency();
|
|
924
923
|
const value = useMemo(() => {
|
|
@@ -934,48 +933,57 @@ function MListItemMovement(_a) {
|
|
|
934
933
|
valueFormatted,
|
|
935
934
|
};
|
|
936
935
|
}, [format, amount]);
|
|
937
|
-
return (jsx(
|
|
936
|
+
return (jsx(DListItem, Object.assign({}, props, { children: jsxs("div", Object.assign({ className: classNames('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
937
|
}
|
|
939
938
|
|
|
940
|
-
function
|
|
939
|
+
function DStepper({ options, currentStep, successIcon = 'check', isVertical = false, }) {
|
|
941
940
|
return (jsx("div", Object.assign({ className: classNames({
|
|
942
|
-
'
|
|
941
|
+
'd-stepper': true,
|
|
943
942
|
'is-vertical': isVertical,
|
|
944
|
-
}) }, { children: options.map(({ label, value }) => (jsxs("div", Object.assign({ className: "
|
|
945
|
-
'
|
|
946
|
-
'
|
|
947
|
-
'
|
|
943
|
+
}) }, { children: options.map(({ label, value }) => (jsxs("div", Object.assign({ className: "d-step" }, { children: [jsx("div", Object.assign({ className: "d-step-value" }, { children: jsx("div", Object.assign({ className: classNames({
|
|
944
|
+
'd-step-icon-container': true,
|
|
945
|
+
'd-step-check': value < currentStep,
|
|
946
|
+
'd-step-current': value === currentStep,
|
|
948
947
|
}) }, { children: value < currentStep
|
|
949
|
-
? (jsx(
|
|
950
|
-
: value })) })), jsx("div", Object.assign({ className: "
|
|
948
|
+
? (jsx(DIcon, { icon: successIcon, innerClass: "d-step-icon" }))
|
|
949
|
+
: value })) })), jsx("div", Object.assign({ className: "d-step-label" }, { children: label }))] }), label))) })));
|
|
951
950
|
}
|
|
952
951
|
|
|
953
|
-
function
|
|
952
|
+
function DFormikInputCurrency(_a) {
|
|
954
953
|
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
955
954
|
const [field, meta, helpers] = useField(name);
|
|
956
|
-
return (jsx(
|
|
955
|
+
return (jsx(DInputCurrency, Object.assign({}, props, { name: field.name, value: field.value, onEventChange: (value) => helpers.setValue(value), onEventBlur: (value) => field.onBlur(value), isInvalid: !!meta.error, hint: (meta === null || meta === void 0 ? void 0 : meta.error) || hint })));
|
|
957
956
|
}
|
|
958
957
|
|
|
959
|
-
function
|
|
958
|
+
function DCard({ className, style, children, }) {
|
|
960
959
|
return (jsx("div", Object.assign({ style: style, className: classNames('card', className) }, { children: children })));
|
|
961
960
|
}
|
|
962
961
|
|
|
963
|
-
function
|
|
962
|
+
function DCardBody({ className, children, }) {
|
|
964
963
|
return (jsx("div", Object.assign({ className: classNames('card-body', className) }, { children: children })));
|
|
965
964
|
}
|
|
966
965
|
|
|
967
|
-
function
|
|
968
|
-
return (jsx(
|
|
966
|
+
function DCardAccount({ className, icon, theme, name, number, balance, balanceText, onEventClick, actionText, }) {
|
|
967
|
+
return (jsx(DCard, Object.assign({ className: classNames('d-card-account', className) }, { children: jsxs(DCardBody, { children: [jsxs("div", Object.assign({ className: "d-flex gap-3 align-items-center" }, { children: [jsx(DIcon, { 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(DButton, { text: actionText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onEventClick: onEventClick }) }))] }) })));
|
|
969
968
|
}
|
|
970
969
|
|
|
971
|
-
function
|
|
970
|
+
function DCardHeader({ className, children, }) {
|
|
972
971
|
return (jsx("div", Object.assign({ className: classNames('card-header', className) }, { children: children })));
|
|
973
972
|
}
|
|
974
973
|
|
|
975
|
-
function
|
|
974
|
+
function DCardFooter({ className, children, }) {
|
|
976
975
|
return (jsx("div", Object.assign({ className: classNames('card-footer', className) }, { children: children })));
|
|
977
976
|
}
|
|
978
977
|
|
|
978
|
+
function DCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, }) {
|
|
979
|
+
return (jsx(DCollapse, Object.assign({ defaultCollapsed: true, className: "d-collapse-icon-text", Component: (jsxs("div", Object.assign({ className: "d-collapse-icon-text-header" }, { children: [jsx(DIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", Object.assign({ className: "d-collapse-icon-text-title" }, { children: title }))] }))) }, { children: children })));
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function DPaginator(_a) {
|
|
983
|
+
var { className, nextLabel, previousLabel, showArrows = true, page, onEventPageChange } = _a, props = __rest(_a, ["className", "nextLabel", "previousLabel", "showArrows", "page", "onEventPageChange"]);
|
|
984
|
+
return (jsx(ResponsivePagination, Object.assign({ extraClassName: classNames('pagination', className), nextClassName: classNames('arrow arrow-next', !nextLabel && 'no-label'), nextLabel: nextLabel, previousClassName: classNames('arrow arrow-prev', !previousLabel && 'no-label'), previousLabel: previousLabel, renderNav: showArrows, current: page, onPageChange: onEventPageChange }, props)));
|
|
985
|
+
}
|
|
986
|
+
|
|
979
987
|
const LANG = liquidParser.parse('{{site.language}}');
|
|
980
988
|
async function configureI8n(resources, _a = {}) {
|
|
981
989
|
var { lng = LANG, fallbackLng = 'es' } = _a, config = __rest(_a, ["lng", "fallbackLng"]);
|
|
@@ -991,5 +999,5 @@ async function configureI8n(resources, _a = {}) {
|
|
|
991
999
|
.then((t) => t);
|
|
992
1000
|
}
|
|
993
1001
|
|
|
994
|
-
export {
|
|
1002
|
+
export { DAlert, DBadge, DBoxFile, DButton, DCard, DCardAccount, DCardBody, DCardFooter, DCardHeader, DCarousel, DCarouselSlide, DChip, DCollapse, DCollapseIconText, DCurrencyText, DDatePicker, DFormikInput, DFormikInputCurrency, DFormikInputSelect, DIcon, DInput, DInputCheck, DInputCounter, DInputCurrency, DInputCurrencyBase, DInputPassword, DInputPin, DInputSearch, DInputSelect, DInputSwitch, DList, DListItem, DListItemMovement, DModal, DOffcanvas, DPaginator, DPermissionItem, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSkeleton, DStepper, DTabContent, DTabs, DToastContainer, DTooltip, LiquidContext$1 as LiquidContext, LiquidContextProvider, MPermissionGroup, MSummaryCard, ModalContext, ModalContextProvider, OffcanvasContext, OffcanvasContextProvider, configureI8n as configureI18n, useFormatCurrency, useLiquidContext, useModalContext, useOffcanvasContext, useScreenshot, useScreenshotDownload, useScreenshotWebShare, useTabContext, useToast };
|
|
995
1003
|
//# sourceMappingURL=index.esm.js.map
|