@eztrak/shared 0.17.0 → 0.17.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/{chunk-KJWCRX6F.mjs → chunk-4ASJWHN3.mjs} +3 -6
- package/dist/chunk-4ASJWHN3.mjs.map +1 -0
- package/dist/{chunk-HAW3AKJP.mjs → chunk-LS7AI4ER.mjs} +2 -2
- package/dist/{chunk-A5BBQ7X5.mjs → chunk-QOYMQFOB.mjs} +16 -2
- package/dist/chunk-QOYMQFOB.mjs.map +1 -0
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +16 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/{handleApiError-SHMjCJHj.d.mts → handleApiError-BIAaN76q.d.mts} +7 -0
- package/dist/{handleApiError-SHMjCJHj.d.ts → handleApiError-BIAaN76q.d.ts} +7 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +15 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-A5BBQ7X5.mjs.map +0 -1
- package/dist/chunk-KJWCRX6F.mjs.map +0 -1
- /package/dist/{chunk-HAW3AKJP.mjs.map → chunk-LS7AI4ER.mjs.map} +0 -0
|
@@ -34,6 +34,8 @@ interface ConfirmationAlertOptions {
|
|
|
34
34
|
title?: string;
|
|
35
35
|
text?: string;
|
|
36
36
|
html?: string;
|
|
37
|
+
/** Body HTML when `html` is not set. String only (not React nodes). */
|
|
38
|
+
children?: string;
|
|
37
39
|
icon?: "warning" | "info" | "question" | "error" | "success";
|
|
38
40
|
/** Custom icon markup. When set, replaces SweetAlert's default icon content. */
|
|
39
41
|
iconHtml?: string;
|
|
@@ -59,6 +61,11 @@ interface ConfirmationAlertOptions {
|
|
|
59
61
|
borderRadius?: string | number;
|
|
60
62
|
/** Confirm/cancel button corner radius. Default `0.5rem`. Number = px. */
|
|
61
63
|
buttonBorderRadius?: string | number;
|
|
64
|
+
/** Typed-input margin. Number = px. Bottom default `1.25rem`; other sides default `0`. */
|
|
65
|
+
inputMarginTop?: string | number;
|
|
66
|
+
inputMarginRight?: string | number;
|
|
67
|
+
inputMarginBottom?: string | number;
|
|
68
|
+
inputMarginLeft?: string | number;
|
|
62
69
|
/** `danger` = delete look; `brand` = orange confirm. Explicit options win. */
|
|
63
70
|
variant?: ConfirmationAlertVariant;
|
|
64
71
|
customClass?: SweetAlertOptions["customClass"];
|
|
@@ -34,6 +34,8 @@ interface ConfirmationAlertOptions {
|
|
|
34
34
|
title?: string;
|
|
35
35
|
text?: string;
|
|
36
36
|
html?: string;
|
|
37
|
+
/** Body HTML when `html` is not set. String only (not React nodes). */
|
|
38
|
+
children?: string;
|
|
37
39
|
icon?: "warning" | "info" | "question" | "error" | "success";
|
|
38
40
|
/** Custom icon markup. When set, replaces SweetAlert's default icon content. */
|
|
39
41
|
iconHtml?: string;
|
|
@@ -59,6 +61,11 @@ interface ConfirmationAlertOptions {
|
|
|
59
61
|
borderRadius?: string | number;
|
|
60
62
|
/** Confirm/cancel button corner radius. Default `0.5rem`. Number = px. */
|
|
61
63
|
buttonBorderRadius?: string | number;
|
|
64
|
+
/** Typed-input margin. Number = px. Bottom default `1.25rem`; other sides default `0`. */
|
|
65
|
+
inputMarginTop?: string | number;
|
|
66
|
+
inputMarginRight?: string | number;
|
|
67
|
+
inputMarginBottom?: string | number;
|
|
68
|
+
inputMarginLeft?: string | number;
|
|
62
69
|
/** `danger` = delete look; `brand` = orange confirm. Explicit options win. */
|
|
63
70
|
variant?: ConfirmationAlertVariant;
|
|
64
71
|
customClass?: SweetAlertOptions["customClass"];
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CreateBaseQueryWithRetryOptions, PermissionRecord, TransformedPermissions, USER_STATE_STORAGE_KEY, capitalizeText, checkIfExistsInArray, cn, convertCommaDataToArray, createBaseQueryWithRetry, currencyFormatter, deserializeJson, flattenTableData, formatDate, formatDateTime, formatNumber, get, getApiError, getErrorMessages, getFieldsByCategory, getFieldsByInputType, getFieldsByName, getItem, getItemFromLocalStorage, isEmpty, loadUserState, normalizeApiListItems, parseCurrencyValueToNumber, removeByPropertyValues, removeItem, resetPageParam, saveItemLocalStorage, saveUserState, set, setItem, storeItemInLocalStorage, toDateInputValue, toLowerCaseText, transformPermissions, truncateFileName, truncateText } from './utils/index.mjs';
|
|
2
|
-
export { C as ConfirmationAlertOptions, a as ConfirmationAlertVariant, D as DEFAULT_CONFIRM_ICONS, E as ErrorClassification, b as ErrorSuggestedAction, H as HandleApiErrorOptions, R as RtkQueryError, c as classifyError, d as confirmationAlert, f as formatValidationErrorsHtml, h as handleApiError, i as isRetryableError } from './handleApiError-
|
|
2
|
+
export { C as ConfirmationAlertOptions, a as ConfirmationAlertVariant, D as DEFAULT_CONFIRM_ICONS, E as ErrorClassification, b as ErrorSuggestedAction, H as HandleApiErrorOptions, R as RtkQueryError, c as classifyError, d as confirmationAlert, f as formatValidationErrorsHtml, h as handleApiError, i as isRetryableError } from './handleApiError-BIAaN76q.mjs';
|
|
3
3
|
export { UseGridHeightOptions, useGridHeight, usePaginationUrlSync } from './hooks/index.mjs';
|
|
4
4
|
export { ActionMenuItem, ActionMenuItemProps, BreadcrumbRoute, Breadcrumbs, BreadcrumbsProps, Button, ButtonProps, Card, CardProps, CardSkeleton, CardSkeletonProps, CardSkeletonVariant, CellEditPayload, CellEditorInputType, CustomCellEditor, CustomCellEditorProps, CustomCellEditorRef, CustomPagination, CustomPaginationClassNames, CustomPaginationProps, DropdownFilter, DropdownFilterProps, DropdownOption, EztrakTab, EztrakTabs, EztrakTabsClassNames, EztrakTabsProps, Header, HeaderProps, LayoutStatus, Loader, LoaderProps, Modal, ModalProps, PaginationData, PopupActionHandler, PopupCellRenderer, PopupCellRendererParams, PopupCellRendererProps, PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_ITEM_TEXT_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, ResetColumnsButtonProps, ResetFiltersButton, ResetFiltersButtonProps, ResetFiltersButtonVariant, ResolvedRowAction, RowAction, RowActionConfirmFn, RowActionFlag, RowActionItemRenderContext, RowActionItemType, RowActionPreset, RowActionPresetName, RowActions, RowActionsList, RowActionsMode, RowActionsProps, RowActionsRenderContext, SearchInput, SearchInputProps, Sidebar, SidebarItem, SidebarProps, TableErrorBoundary, TableErrorBoundaryProps, TableLayoutToolbarControls, TableLayoutToolbarControlsProps, ToolTip, ToolTipProps, TooltipText, TooltipTextProps, dropdownStyles, resolveActions } from './components/index.mjs';
|
|
5
5
|
import 'clsx';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CreateBaseQueryWithRetryOptions, PermissionRecord, TransformedPermissions, USER_STATE_STORAGE_KEY, capitalizeText, checkIfExistsInArray, cn, convertCommaDataToArray, createBaseQueryWithRetry, currencyFormatter, deserializeJson, flattenTableData, formatDate, formatDateTime, formatNumber, get, getApiError, getErrorMessages, getFieldsByCategory, getFieldsByInputType, getFieldsByName, getItem, getItemFromLocalStorage, isEmpty, loadUserState, normalizeApiListItems, parseCurrencyValueToNumber, removeByPropertyValues, removeItem, resetPageParam, saveItemLocalStorage, saveUserState, set, setItem, storeItemInLocalStorage, toDateInputValue, toLowerCaseText, transformPermissions, truncateFileName, truncateText } from './utils/index.js';
|
|
2
|
-
export { C as ConfirmationAlertOptions, a as ConfirmationAlertVariant, D as DEFAULT_CONFIRM_ICONS, E as ErrorClassification, b as ErrorSuggestedAction, H as HandleApiErrorOptions, R as RtkQueryError, c as classifyError, d as confirmationAlert, f as formatValidationErrorsHtml, h as handleApiError, i as isRetryableError } from './handleApiError-
|
|
2
|
+
export { C as ConfirmationAlertOptions, a as ConfirmationAlertVariant, D as DEFAULT_CONFIRM_ICONS, E as ErrorClassification, b as ErrorSuggestedAction, H as HandleApiErrorOptions, R as RtkQueryError, c as classifyError, d as confirmationAlert, f as formatValidationErrorsHtml, h as handleApiError, i as isRetryableError } from './handleApiError-BIAaN76q.js';
|
|
3
3
|
export { UseGridHeightOptions, useGridHeight, usePaginationUrlSync } from './hooks/index.js';
|
|
4
4
|
export { ActionMenuItem, ActionMenuItemProps, BreadcrumbRoute, Breadcrumbs, BreadcrumbsProps, Button, ButtonProps, Card, CardProps, CardSkeleton, CardSkeletonProps, CardSkeletonVariant, CellEditPayload, CellEditorInputType, CustomCellEditor, CustomCellEditorProps, CustomCellEditorRef, CustomPagination, CustomPaginationClassNames, CustomPaginationProps, DropdownFilter, DropdownFilterProps, DropdownOption, EztrakTab, EztrakTabs, EztrakTabsClassNames, EztrakTabsProps, Header, HeaderProps, LayoutStatus, Loader, LoaderProps, Modal, ModalProps, PaginationData, PopupActionHandler, PopupCellRenderer, PopupCellRendererParams, PopupCellRendererProps, PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_ITEM_TEXT_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, ResetColumnsButtonProps, ResetFiltersButton, ResetFiltersButtonProps, ResetFiltersButtonVariant, ResolvedRowAction, RowAction, RowActionConfirmFn, RowActionFlag, RowActionItemRenderContext, RowActionItemType, RowActionPreset, RowActionPresetName, RowActions, RowActionsList, RowActionsMode, RowActionsProps, RowActionsRenderContext, SearchInput, SearchInputProps, Sidebar, SidebarItem, SidebarProps, TableErrorBoundary, TableErrorBoundaryProps, TableLayoutToolbarControls, TableLayoutToolbarControlsProps, ToolTip, ToolTipProps, TooltipText, TooltipTextProps, dropdownStyles, resolveActions } from './components/index.js';
|
|
5
5
|
import 'clsx';
|
package/dist/index.js
CHANGED
|
@@ -587,6 +587,12 @@ function ensureConfirmAlertStyles() {
|
|
|
587
587
|
.ez-confirm-cancel:hover {
|
|
588
588
|
background: #f9fafb !important;
|
|
589
589
|
}
|
|
590
|
+
.ez-confirm-popup .swal2-input {
|
|
591
|
+
margin-top: var(--ez-confirm-input-mt, 0) !important;
|
|
592
|
+
margin-right: var(--ez-confirm-input-mr, 0) !important;
|
|
593
|
+
margin-bottom: var(--ez-confirm-input-mb, 1.25rem) !important;
|
|
594
|
+
margin-left: var(--ez-confirm-input-ml, 0) !important;
|
|
595
|
+
}
|
|
590
596
|
`;
|
|
591
597
|
document.head.appendChild(style);
|
|
592
598
|
}
|
|
@@ -624,7 +630,7 @@ function confirmationAlert(onConfirm, options = {}) {
|
|
|
624
630
|
hasInput ? "Confirmation Required" : "Delete this item"
|
|
625
631
|
);
|
|
626
632
|
const text = options.text;
|
|
627
|
-
const html = options.html;
|
|
633
|
+
const html = options.html ?? options.children;
|
|
628
634
|
const icon = pick(options.icon, vd.icon, "warning");
|
|
629
635
|
const iconHtml = pick(options.iconHtml, vd.iconHtml, void 0);
|
|
630
636
|
const iconColor = pick(options.iconColor, vd.iconColor, BRAND_ORANGE);
|
|
@@ -665,6 +671,10 @@ function confirmationAlert(onConfirm, options = {}) {
|
|
|
665
671
|
const width = options.width;
|
|
666
672
|
const borderRadius = cssSize(options.borderRadius, "1rem");
|
|
667
673
|
const buttonBorderRadius = cssSize(options.buttonBorderRadius, "0.5rem");
|
|
674
|
+
const inputMarginTop = cssSize(options.inputMarginTop, "0");
|
|
675
|
+
const inputMarginRight = cssSize(options.inputMarginRight, "0");
|
|
676
|
+
const inputMarginBottom = cssSize(options.inputMarginBottom, "1.25rem");
|
|
677
|
+
const inputMarginLeft = cssSize(options.inputMarginLeft, "0");
|
|
668
678
|
const onCancel = options.onCancel;
|
|
669
679
|
const useLoader = showLoaderOnConfirm || hasInput;
|
|
670
680
|
const inputHtml = html ?? (hasInput ? `
|
|
@@ -705,6 +715,10 @@ function confirmationAlert(onConfirm, options = {}) {
|
|
|
705
715
|
popup.style.setProperty("--ez-confirm-icon-bg", iconBgColor);
|
|
706
716
|
popup.style.setProperty("--ez-confirm-radius", borderRadius);
|
|
707
717
|
popup.style.setProperty("--ez-confirm-btn-radius", buttonBorderRadius);
|
|
718
|
+
popup.style.setProperty("--ez-confirm-input-mt", inputMarginTop);
|
|
719
|
+
popup.style.setProperty("--ez-confirm-input-mr", inputMarginRight);
|
|
720
|
+
popup.style.setProperty("--ez-confirm-input-mb", inputMarginBottom);
|
|
721
|
+
popup.style.setProperty("--ez-confirm-input-ml", inputMarginLeft);
|
|
708
722
|
if (width != null) {
|
|
709
723
|
popup.style.setProperty(
|
|
710
724
|
"--ez-confirm-width",
|
|
@@ -2458,10 +2472,7 @@ function Sidebar({
|
|
|
2458
2472
|
"div",
|
|
2459
2473
|
{
|
|
2460
2474
|
"data-sidebar-item": item.name,
|
|
2461
|
-
className:
|
|
2462
|
-
"has-sub-items max-w-full min-w-0 flex flex-col",
|
|
2463
|
-
collapsed ? "my-1" : "my-2"
|
|
2464
|
-
),
|
|
2475
|
+
className: "has-sub-items max-w-full min-w-0 flex flex-col",
|
|
2465
2476
|
children: [
|
|
2466
2477
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2467
2478
|
ToolTip,
|