impact-ui 4.0.15 → 4.0.16
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/README.md +3 -1
- package/dist/_virtual/index3.js +2 -4
- package/dist/_virtual/index4.js +2 -4
- package/dist/_virtual/index5.js +4 -2
- package/dist/_virtual/index6.js +4 -2
- package/dist/components/CreateItemFlow/CreateItemFlow.types.d.ts +39 -16
- package/dist/components/CreateItemFlow/CreateItemFlow.types.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/index.d.ts +2 -1
- package/dist/components/CreateItemFlow/index.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/index.js +116 -66
- package/dist/components/DatePicker/datePickerDropdown.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerDropdown.js +3 -0
- package/dist/components/DatePicker/datePickerFooter.d.ts +3 -1
- package/dist/components/DatePicker/datePickerFooter.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerFooter.js +24 -2
- package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts +1 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +35 -12
- package/dist/components/DateRangePicker/dateRangePickerFooter.d.ts +1 -1
- package/dist/components/DateRangePicker/dateRangePickerFooter.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerFooter.js +5 -3
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.js +2 -0
- package/dist/components/DynamicLayout/index.d.ts +9 -12
- package/dist/components/DynamicLayout/index.d.ts.map +1 -1
- package/dist/components/DynamicLayout/index.js +37 -34
- package/dist/components/Header/index.js +2 -2
- package/dist/components/NewCreateItemFlow/NewCreateItemFlow.types.d.ts +21 -0
- package/dist/components/NewCreateItemFlow/NewCreateItemFlow.types.d.ts.map +1 -0
- package/dist/components/NewCreateItemFlow/index.d.ts +5 -0
- package/dist/components/NewCreateItemFlow/index.d.ts.map +1 -0
- package/dist/components/NewCreateItemFlow/index.js +93 -0
- package/dist/components/NewDynamicLayout/NewDynamicLayout.types.d.ts +26 -0
- package/dist/components/NewDynamicLayout/NewDynamicLayout.types.d.ts.map +1 -0
- package/dist/components/NewDynamicLayout/index.d.ts +15 -0
- package/dist/components/NewDynamicLayout/index.d.ts.map +1 -0
- package/dist/components/NewDynamicLayout/index.js +45 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +6 -31
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.js +2 -2
- package/dist/components/Notification/NotificationBody/NotificationTaskList.js +1 -2
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/Table/AgGridHeader.d.ts.map +1 -1
- package/dist/components/Table/AgGridHeader.js +3 -1
- package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +1 -1
- package/dist/components/Table/Table.types.d.ts +4 -0
- package/dist/components/Table/Table.types.d.ts.map +1 -1
- package/dist/components/Table/filterUtils.d.ts +13 -0
- package/dist/components/Table/filterUtils.d.ts.map +1 -1
- package/dist/components/Table/filterUtils.js +18 -9
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +11 -4
- package/dist/components/Table/tableFunctions.d.ts +1 -0
- package/dist/components/Table/tableFunctions.d.ts.map +1 -1
- package/dist/components/Table/tableHeader.d.ts +2 -1
- package/dist/components/Table/tableHeader.d.ts.map +1 -1
- package/dist/components/Table/tableHeader.js +2 -0
- package/dist/components/Table/tableMoreOptions.d.ts +2 -1
- package/dist/components/Table/tableMoreOptions.d.ts.map +1 -1
- package/dist/components/Table/tableMoreOptions.js +58 -14
- package/dist/components/Table/tableSettings.d.ts.map +1 -1
- package/dist/components/Table/tableSettings.js +3 -2
- package/dist/components/TableOld/index.d.ts.map +1 -1
- package/dist/components/TableOld/index.js +23 -9
- package/dist/components/TableOld/tableFunctions.d.ts +1 -0
- package/dist/components/TableOld/tableFunctions.d.ts.map +1 -1
- package/dist/components/TableOld/tableHeader.d.ts +2 -1
- package/dist/components/TableOld/tableHeader.d.ts.map +1 -1
- package/dist/components/TableOld/tableHeader.js +2 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.d.ts +17 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.js +52 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.d.ts +12 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.js +262 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts +39 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.js +294 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.d.ts +4 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.js +1523 -0
- package/dist/components/shared/tableColumnSettings/index.d.ts +4 -0
- package/dist/components/shared/tableColumnSettings/index.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts +41 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.js +327 -0
- package/dist/i18n/I18nContext.d.ts.map +1 -1
- package/dist/i18n/I18nContext.js +1 -0
- package/dist/locales/en-US.json.d.ts +1 -1
- package/dist/locales/en-US.json.js +1 -1
- package/dist/locales/es-ES.json.d.ts +666 -0
- package/dist/locales/es-ES.json.js +599 -0
- package/dist/locales/index.d.ts.map +1 -1
- package/dist/locales/index.js +11 -3
- package/dist/mcp-component-registry.json +101 -59
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +128 -75
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/moment/dist/locale/es.js +98 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/stories/LocaleDictionaryCollapse.d.ts.map +1 -1
- package/dist/stories/tableStoryDefaults.d.ts +18 -0
- package/dist/stories/tableStoryDefaults.d.ts.map +1 -0
- package/dist/stories/tableStoryManyColumns.d.ts +44 -0
- package/dist/stories/tableStoryManyColumns.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,7 @@ Live names from the **impact-ui MCP** `list_components` tool, plus source-only p
|
|
|
130
130
|
| `Stepper` | Wizard progress | `StepperStep[]` |
|
|
131
131
|
| `Accordion` / `AccordionModern` | Collapsible | Modern supports sortable items |
|
|
132
132
|
| `DynamicLayout` | Layout slots | Injected layout props |
|
|
133
|
+
| `NewDynamicLayout` | Layout slots | Injected layout props |
|
|
133
134
|
| `AGLocaleMap` | Grid locales | From i18n exports |
|
|
134
135
|
|
|
135
136
|
### 💬 Feedback & overlays
|
|
@@ -163,6 +164,7 @@ Live names from the **impact-ui MCP** `list_components` tool, plus source-only p
|
|
|
163
164
|
| `FilterPanelHeader` / `PanelSidebar` / `PanelFooter` | Filter chrome | Companion exports |
|
|
164
165
|
| `Notification` | Inbox drawer | List, tasks, tabs |
|
|
165
166
|
| `CreateItemFlow` | Create wizard | Multi-step |
|
|
167
|
+
| `NewCreateItemFlow` | Create wizard | Multi-step |
|
|
166
168
|
| `CommentsPanel` | Threads | `CommentsProvider`, `useComments` |
|
|
167
169
|
|
|
168
170
|
### 🤖 Chat, i18n & shortcuts
|
|
@@ -175,7 +177,7 @@ Live names from the **impact-ui MCP** `list_components` tool, plus source-only p
|
|
|
175
177
|
| `ShortcutsProvider` / `ShortcutScope` / `ShortcutHint` / `ShortcutManager` | Hotkeys | Config + display helpers |
|
|
176
178
|
| `KeyboardShortcuts` / `ShortcutModal` | Shortcut UI | List & capture |
|
|
177
179
|
|
|
178
|
-
**MCP names (components):** AGLocaleMap, Accordion, AccordionModern, Alert, AppliedFilters, Avatar, Badge, BottomSheet, Breadcrumbs, Button, ButtonGroup, Card, Chart, ChatBotComponent, Checkbox, Chips, CommentsContext, CommentsProvider, CreateItemFlow, DatePicker, DateRangePicker, DynamicLayout, EmptyState, FileUpload, FilterDropDown, FilterPanel, FilterPanelHeader, FilterSlider, HelperText, I18nContext, I18nProvider, Input, KeyboardShortcuts, Loader, Menu, MenuHeaderInfo, Modal, MonthPicker, MonthRangePicker, OldTable, Panel, PanelFooter, PanelSidebar, Popover, Portal, ProgressBar, Prompt, RadioButtonGroup, Select, ShortcutHint, ShortcutManager, ShortcutModal, ShortcutScope, ShortcutsConfigContext, ShortcutsProvider, Slider, Stepper, Switch, Table, Tabs, Tag, TagGroup, TextArea, Toast, Tooltip
|
|
180
|
+
**MCP names (components):** AGLocaleMap, Accordion, AccordionModern, Alert, AppliedFilters, Avatar, Badge, BottomSheet, Breadcrumbs, Button, ButtonGroup, Card, Chart, ChatBotComponent, Checkbox, Chips, CommentsContext, CommentsProvider, CreateItemFlow, NewCreateItemFlow, DatePicker, DateRangePicker, DynamicLayout, NewDynamicLayout, EmptyState, FileUpload, FilterDropDown, FilterPanel, FilterPanelHeader, FilterSlider, HelperText, I18nContext, I18nProvider, Input, KeyboardShortcuts, Loader, Menu, MenuHeaderInfo, Modal, MonthPicker, MonthRangePicker, OldTable, Panel, PanelFooter, PanelSidebar, Popover, Portal, ProgressBar, Prompt, RadioButtonGroup, Select, ShortcutHint, ShortcutManager, ShortcutModal, ShortcutScope, ShortcutsConfigContext, ShortcutsProvider, Slider, Stepper, Switch, Table, Tabs, Tag, TagGroup, TextArea, Toast, Tooltip
|
|
179
181
|
|
|
180
182
|
**MCP names (patterns):** FiltersStrip, Header, HomePage, Notification, Sidebar
|
|
181
183
|
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as index from "../node_modules/@mui/system/node_modules/@mui/utils/esm/formatMuiErrorMessage/index.js";
|
|
3
|
-
const require$$1 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
1
|
+
var reactIs = { exports: {} };
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
reactIs as __module
|
|
6
4
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as index from "../node_modules/@mui/system/node_modules/@mui/utils/esm/clamp/index.js";
|
|
3
|
-
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
1
|
+
var reactIs = { exports: {} };
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
reactIs as __module
|
|
6
4
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace } from "./_commonjsHelpers.js";
|
|
2
|
+
import * as index from "../node_modules/@mui/system/node_modules/@mui/utils/esm/formatMuiErrorMessage/index.js";
|
|
3
|
+
const require$$1 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
require$$1 as default
|
|
4
6
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace } from "./_commonjsHelpers.js";
|
|
2
|
+
import * as index from "../node_modules/@mui/system/node_modules/@mui/utils/esm/clamp/index.js";
|
|
3
|
+
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
require$$2 as default
|
|
4
6
|
};
|
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
import { ReactNode
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
import { InjectedLayoutProps } from '../DynamicLayout';
|
|
4
|
+
import { StepperStep } from '../Stepper/Stepper.types';
|
|
3
5
|
|
|
4
|
-
export interface CreateItemFlowProps {
|
|
6
|
+
export interface CreateItemFlowProps extends BaseComponentProps {
|
|
7
|
+
/** Current step (1-based) */
|
|
8
|
+
step?: number;
|
|
9
|
+
totalSteps?: number;
|
|
10
|
+
/** Width of the left panel (e.g. "375px") */
|
|
5
11
|
leftPanelWidth?: string | number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/** Headings for each step section in the right content */
|
|
13
|
+
headings?: string[];
|
|
14
|
+
/** One React node per step (matched with headings by index) */
|
|
15
|
+
children?: ReactNode | ReactNode[];
|
|
16
|
+
onCancel?: () => void;
|
|
17
|
+
onNext?: () => void;
|
|
18
|
+
onPrev?: () => void;
|
|
19
|
+
onStepClick?: (step: number) => void;
|
|
20
|
+
/** Stepper variant: default (MUI) or progress */
|
|
21
|
+
stepperVariant?: 'default' | 'progress' | 'mui';
|
|
22
|
+
leftPanelTitle?: string;
|
|
23
|
+
leftPanelDescription?: string;
|
|
24
|
+
/** Custom left panel image (overrides default) */
|
|
25
|
+
leftPanelImage?: ReactNode | null;
|
|
26
|
+
/** Custom actions (overrides default Prev/Next buttons) */
|
|
27
|
+
actionsChildren?: ReactNode | null;
|
|
28
|
+
showStepper?: boolean;
|
|
16
29
|
}
|
|
17
|
-
export interface RightContentPanelProps {
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
export interface RightContentPanelProps extends Partial<InjectedLayoutProps> {
|
|
31
|
+
showStepper: boolean;
|
|
32
|
+
steps: StepperStep[];
|
|
33
|
+
step: number;
|
|
34
|
+
stepperVariant: 'default' | 'progress' | 'mui';
|
|
35
|
+
onStepClick?: (step: number) => void;
|
|
36
|
+
headings: string[];
|
|
37
|
+
children?: ReactNode | ReactNode[];
|
|
38
|
+
actionsChildren?: ReactNode | null;
|
|
39
|
+
onCancel?: () => void;
|
|
40
|
+
onPrev?: () => void;
|
|
41
|
+
onNext?: () => void;
|
|
42
|
+
totalSteps: number;
|
|
20
43
|
}
|
|
21
44
|
//# sourceMappingURL=CreateItemFlow.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateItemFlow.types.d.ts","sourceRoot":"","sources":["../../../src/components/CreateItemFlow/CreateItemFlow.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"CreateItemFlow.types.d.ts","sourceRoot":"","sources":["../../../src/components/CreateItemFlow/CreateItemFlow.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iDAAiD;IACjD,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kDAAkD;IAClD,cAAc,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAuB,SAAQ,OAAO,CAAC,mBAAmB,CAAC;IAC1E,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IACnC,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CreateItemFlowProps } from './CreateItemFlow.types';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type { CreateItemFlowProps } from './CreateItemFlow.types';
|
|
5
|
+
export declare const CreateItemFlow: React.NamedExoticComponent<CreateItemFlowProps>;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CreateItemFlow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CreateItemFlow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,mBAAmB,EAA0B,MAAM,wBAAwB,CAAC;AAC1F,OAAO,8BAA8B,CAAC;AAItC,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAuFlE,eAAO,MAAM,cAAc,iDA+DzB,CAAC"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React__default, { memo } from "react";
|
|
4
|
-
import default_1 from "../../node_modules/@mui/icons-material/ChevronLeft.js";
|
|
5
|
-
import default_1$1 from "../../node_modules/@mui/icons-material/ChevronRight.js";
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".field .field-label{color:#666;font-size:14px;margin-bottom:8px}.form-section .field{margin-bottom:24px}.form-section .field:last-child{margin-bottom:0}.left-panel-content{display:flex;flex-direction:column;height:100%;justify-content:space-between}.left-panel-content .left-panel-title h1{margin-bottom:16px}.right-content .ia-stepper.progress .progress-steps{margin-bottom:32px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React__default, { memo, useMemo } from "react";
|
|
6
4
|
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
7
5
|
import { Button } from "../Button/index.js";
|
|
8
6
|
import { DynamicLayout } from "../DynamicLayout/index.js";
|
|
7
|
+
import { Stepper } from "../Stepper/index.js";
|
|
9
8
|
|
|
10
9
|
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
11
|
-
const createFlowImage = getAssetUrl("icons/
|
|
12
|
-
|
|
10
|
+
const createFlowImage = getAssetUrl("icons/createFlowImage.svg");
|
|
11
|
+
function LeftPanelContent({
|
|
12
|
+
leftPanelTitle,
|
|
13
|
+
leftPanelDescription,
|
|
14
|
+
leftPanelImage
|
|
15
|
+
}) {
|
|
13
16
|
const { t } = useTranslation();
|
|
14
17
|
return /* @__PURE__ */ jsxs("div", { className: "left-panel-content", children: [
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: "left-panel-title", children: [
|
|
19
|
+
/* @__PURE__ */ jsx("h1", { children: leftPanelTitle }),
|
|
20
|
+
/* @__PURE__ */ jsx("p", { children: leftPanelDescription })
|
|
21
|
+
] }),
|
|
22
|
+
leftPanelImage ?? /* @__PURE__ */ jsx(
|
|
17
23
|
"img",
|
|
18
24
|
{
|
|
19
25
|
alt: t("createItemFlow.imageAlt"),
|
|
@@ -22,72 +28,116 @@ const LeftPanelContent = ({ leftPanelContent, leftPanelImage }) => {
|
|
|
22
28
|
}
|
|
23
29
|
)
|
|
24
30
|
] });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
}
|
|
32
|
+
function RightContentPanel({
|
|
33
|
+
showStepper,
|
|
34
|
+
steps,
|
|
35
|
+
step,
|
|
36
|
+
stepperVariant,
|
|
37
|
+
onStepClick,
|
|
38
|
+
headings,
|
|
39
|
+
children,
|
|
40
|
+
contentRef,
|
|
41
|
+
hasScroll,
|
|
42
|
+
actionsChildren,
|
|
43
|
+
onCancel,
|
|
44
|
+
onPrev,
|
|
45
|
+
onNext,
|
|
46
|
+
totalSteps
|
|
47
|
+
}) {
|
|
48
|
+
const { t } = useTranslation();
|
|
49
|
+
const childArray = React__default.Children.toArray(children ?? []);
|
|
50
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
showStepper && /* @__PURE__ */ jsx(
|
|
52
|
+
Stepper,
|
|
53
|
+
{
|
|
54
|
+
activeStep: step - 1,
|
|
55
|
+
handleStep: (index) => onStepClick == null ? void 0 : onStepClick(index + 1),
|
|
56
|
+
orientation: "horizontal",
|
|
57
|
+
steps,
|
|
58
|
+
variant: stepperVariant
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
ref: contentRef,
|
|
65
|
+
className: `content-wrapper ${hasScroll === false ? "no-scroll" : ""}`,
|
|
66
|
+
children: headings.map((heading, index) => /* @__PURE__ */ jsxs("div", { className: "heading", children: [
|
|
67
|
+
/* @__PURE__ */ jsx("h2", { children: heading }),
|
|
68
|
+
childArray[index]
|
|
69
|
+
] }, index))
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
actionsChildren != null ? /* @__PURE__ */ jsx("div", { className: "actions", children: actionsChildren }) : /* @__PURE__ */ jsxs("div", { className: "actions", children: [
|
|
73
|
+
step === 1 ? /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onCancel, children: t("common.cancel") }) : /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onPrev, children: t("common.previous") }),
|
|
74
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: onNext, children: step === totalSteps ? t("common.submit") : t("common.next") })
|
|
75
|
+
] })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
const CreateItemFlow = memo(function CreateItemFlow2({
|
|
79
|
+
step = 1,
|
|
80
|
+
totalSteps = 3,
|
|
28
81
|
leftPanelWidth,
|
|
29
|
-
|
|
82
|
+
headings = [],
|
|
83
|
+
children,
|
|
84
|
+
onCancel,
|
|
85
|
+
onNext,
|
|
86
|
+
onPrev,
|
|
87
|
+
onStepClick,
|
|
88
|
+
stepperVariant = "progress",
|
|
89
|
+
leftPanelTitle,
|
|
90
|
+
leftPanelDescription = "",
|
|
30
91
|
leftPanelImage = null,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
prevButtonProps = {},
|
|
35
|
-
extraButtonProp,
|
|
36
|
-
nextButtonProps = {},
|
|
37
|
-
customCSS,
|
|
38
|
-
className
|
|
39
|
-
}) => {
|
|
92
|
+
actionsChildren = null,
|
|
93
|
+
showStepper = true
|
|
94
|
+
}) {
|
|
40
95
|
const { t } = useTranslation();
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
96
|
+
const resolvedLeftPanelTitle = leftPanelTitle ?? t("createItemFlow.defaultTitle");
|
|
97
|
+
const steps = useMemo(
|
|
98
|
+
() => Array.from({ length: totalSteps }, (_, idx) => ({
|
|
99
|
+
label: t("createItemFlow.stepLabel", { number: idx + 1 }),
|
|
100
|
+
description: t("createItemFlow.stepDescription", {
|
|
101
|
+
number: idx + 1,
|
|
102
|
+
total: totalSteps
|
|
103
|
+
})
|
|
104
|
+
})),
|
|
105
|
+
[totalSteps, t]
|
|
106
|
+
);
|
|
107
|
+
const rightContent = /* @__PURE__ */ jsx(
|
|
108
|
+
RightContentPanel,
|
|
109
|
+
{
|
|
110
|
+
actionsChildren,
|
|
111
|
+
headings,
|
|
112
|
+
showStepper,
|
|
113
|
+
step,
|
|
114
|
+
stepperVariant,
|
|
115
|
+
steps,
|
|
116
|
+
totalSteps,
|
|
117
|
+
onCancel,
|
|
118
|
+
onNext,
|
|
119
|
+
onPrev,
|
|
120
|
+
onStepClick,
|
|
121
|
+
children
|
|
122
|
+
}
|
|
123
|
+
);
|
|
52
124
|
return /* @__PURE__ */ jsx(
|
|
53
125
|
DynamicLayout,
|
|
54
126
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
...restPrevProps,
|
|
64
|
-
children: prevLabel
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ jsxs("div", { className: "footer-right-group", children: [
|
|
68
|
-
extraButtonProp,
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
70
|
-
Button,
|
|
71
|
-
{
|
|
72
|
-
icon: "icon" in nextButtonProps ? nextIcon : /* @__PURE__ */ jsx(default_1$1, {}),
|
|
73
|
-
iconPlacement: nextButtonProps.iconPlacement ?? "right",
|
|
74
|
-
variant: restNextProps.variant ?? "primary",
|
|
75
|
-
...restNextProps,
|
|
76
|
-
children: nextLabel
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
] })
|
|
80
|
-
] }),
|
|
81
|
-
leftPanel: /* @__PURE__ */ jsx(LeftPanelContent, { leftPanelContent, leftPanelImage }),
|
|
127
|
+
leftPanel: /* @__PURE__ */ jsx(
|
|
128
|
+
LeftPanelContent,
|
|
129
|
+
{
|
|
130
|
+
leftPanelDescription,
|
|
131
|
+
leftPanelImage,
|
|
132
|
+
leftPanelTitle: resolvedLeftPanelTitle
|
|
133
|
+
}
|
|
134
|
+
),
|
|
82
135
|
leftPanelWidth,
|
|
83
|
-
rightContent
|
|
84
|
-
|
|
85
|
-
title: resolvedTitle
|
|
136
|
+
rightContent,
|
|
137
|
+
showStepper
|
|
86
138
|
}
|
|
87
139
|
);
|
|
88
|
-
};
|
|
89
|
-
const CreateItemFlow = memo(CreateItemFlowComponent);
|
|
90
|
-
CreateItemFlow.displayName = "CreateItemFlow";
|
|
140
|
+
});
|
|
91
141
|
export {
|
|
92
142
|
CreateItemFlow
|
|
93
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/datePickerDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,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AC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,OAAO,EACP,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,eAA6E,EAC7E,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,OAAO,EACP,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,SAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,GAAG,aAAa,EACjB,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"datePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/datePickerDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,wBAAwB,CAAC;AAIhC,OAAO,qCAAqC,CAAC;AAE7C,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,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,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,OAAO,EACP,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,eAA6E,EAC7E,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,OAAO,EACP,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,SAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,GAAG,aAAa,EACjB,EAAE,uBAAuB,2CA8QzB"}
|
|
@@ -147,6 +147,7 @@ function DatePickerDropdown({
|
|
|
147
147
|
[showWeekNumbers]
|
|
148
148
|
);
|
|
149
149
|
const currentDate = selectedDate ? moment(selectedDate) : null;
|
|
150
|
+
const isPrimaryButtonDisabled = currentDate === null || !currentDate.isValid() || minDate != null && currentDate.isBefore(minDate, "day") || maxDate != null && currentDate.isAfter(maxDate, "day") || Boolean(isOutsideRange == null ? void 0 : isOutsideRange(currentDate));
|
|
150
151
|
const renderCalendar = () => /* @__PURE__ */ jsx(
|
|
151
152
|
DayPickerSingleDateController,
|
|
152
153
|
{
|
|
@@ -189,6 +190,8 @@ function DatePickerDropdown({
|
|
|
189
190
|
hidePrimaryButton,
|
|
190
191
|
hideSecondaryButton,
|
|
191
192
|
hideTertiaryButton,
|
|
193
|
+
isPrimaryButtonDisabled,
|
|
194
|
+
isTertiaryButtonDisabled: currentDate === null,
|
|
192
195
|
primaryButtonProps,
|
|
193
196
|
secondaryButtonProps,
|
|
194
197
|
setFocused,
|
|
@@ -4,6 +4,8 @@ export interface DatePickerFooterProps {
|
|
|
4
4
|
tertiaryButtonProps?: Record<string, unknown>;
|
|
5
5
|
secondaryButtonProps?: Record<string, unknown>;
|
|
6
6
|
primaryButtonProps?: Record<string, unknown>;
|
|
7
|
+
isPrimaryButtonDisabled?: boolean;
|
|
8
|
+
isTertiaryButtonDisabled?: boolean;
|
|
7
9
|
setSelectedDate?: (date: Moment | null) => void;
|
|
8
10
|
setFocused: (focused: boolean) => void;
|
|
9
11
|
onTertiaryButtonClick?: () => void;
|
|
@@ -14,5 +16,5 @@ export interface DatePickerFooterProps {
|
|
|
14
16
|
hideSecondaryButton?: boolean;
|
|
15
17
|
hidePrimaryButton?: boolean;
|
|
16
18
|
}
|
|
17
|
-
export declare function DatePickerFooter({ tertiaryButtonProps, secondaryButtonProps, primaryButtonProps, setSelectedDate, setFocused, onTertiaryButtonClick, onSecondaryButtonClick, onPrimaryButtonClick, setIsOpen, hideTertiaryButton, hideSecondaryButton, hidePrimaryButton, }: DatePickerFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function DatePickerFooter({ tertiaryButtonProps, secondaryButtonProps, primaryButtonProps, isPrimaryButtonDisabled, isTertiaryButtonDisabled, setSelectedDate, setFocused, onTertiaryButtonClick, onSecondaryButtonClick, onPrimaryButtonClick, setIsOpen, hideTertiaryButton, hideSecondaryButton, hidePrimaryButton, }: DatePickerFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
//# sourceMappingURL=datePickerFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePickerFooter.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/datePickerFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,C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AE,OAAO,CAAC,CAAC;IAC7C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,uBAA8B,EAC9B,wBAA+B,EAC/B,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,qBAAqB,2CAwDvB"}
|
|
@@ -5,6 +5,8 @@ function DatePickerFooter({
|
|
|
5
5
|
tertiaryButtonProps,
|
|
6
6
|
secondaryButtonProps,
|
|
7
7
|
primaryButtonProps,
|
|
8
|
+
isPrimaryButtonDisabled = true,
|
|
9
|
+
isTertiaryButtonDisabled = true,
|
|
8
10
|
setSelectedDate,
|
|
9
11
|
setFocused,
|
|
10
12
|
onTertiaryButtonClick,
|
|
@@ -36,9 +38,29 @@ function DatePickerFooter({
|
|
|
36
38
|
{
|
|
37
39
|
className: `datePicker-buttons-container ${allButtonsHidden ? "datePicker-buttons-container--hidden" : ""}`,
|
|
38
40
|
children: [
|
|
39
|
-
!hideTertiaryButton && /* @__PURE__ */ jsx(
|
|
41
|
+
!hideTertiaryButton && /* @__PURE__ */ jsx(
|
|
42
|
+
Button,
|
|
43
|
+
{
|
|
44
|
+
size: "small",
|
|
45
|
+
variant: "url",
|
|
46
|
+
onClick: handleClear,
|
|
47
|
+
...tertiaryButtonProps,
|
|
48
|
+
disabled: isTertiaryButtonDisabled || (tertiaryButtonProps == null ? void 0 : tertiaryButtonProps.disabled) === true,
|
|
49
|
+
children: t("common.clear")
|
|
50
|
+
}
|
|
51
|
+
),
|
|
40
52
|
!hideSecondaryButton && /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onClick: handleCancel, ...secondaryButtonProps, children: t("common.cancel") }),
|
|
41
|
-
!hidePrimaryButton && /* @__PURE__ */ jsx(
|
|
53
|
+
!hidePrimaryButton && /* @__PURE__ */ jsx(
|
|
54
|
+
Button,
|
|
55
|
+
{
|
|
56
|
+
size: "small",
|
|
57
|
+
variant: "primary",
|
|
58
|
+
onClick: handleApply,
|
|
59
|
+
...primaryButtonProps,
|
|
60
|
+
disabled: isPrimaryButtonDisabled || (primaryButtonProps == null ? void 0 : primaryButtonProps.disabled) === true,
|
|
61
|
+
children: t("common.apply")
|
|
62
|
+
}
|
|
63
|
+
)
|
|
42
64
|
]
|
|
43
65
|
}
|
|
44
66
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function DateRangePickerDropdown({ dropDownContainerRef, withPortal, portalContainer, containerRef, onDatesChange, onFocusChange, focusedInput, startDate, endDate, showWeekNumbers, selectedRange, setStartDateOffset, setEndDateOffset, selectedDaysNumber, handleResetDates, handleCancelDates, onSecondaryButtonClick, tertiaryButtonProps, handleApplyDates, primaryButtonProps, showRangeSelector, handleRangeSelectorChange, showMonthYearSelect, customYears, customWeekNumberData, suppressClickOnWeekNumber, setIsOpen, startDateOffset, endDateOffset, hasInputErrors, portalClassName, ...args }: any): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function DateRangePickerDropdown({ dropDownContainerRef, withPortal, portalContainer, containerRef, onDatesChange, onFocusChange, focusedInput, startDate, endDate, showWeekNumbers, selectedRange, setStartDateOffset, setEndDateOffset, selectedDaysNumber, handleResetDates, handleCancelDates, onSecondaryButtonClick, tertiaryButtonProps, handleApplyDates, primaryButtonProps, showRangeSelector, handleRangeSelectorChange, showMonthYearSelect, customYears, customWeekNumberData, suppressClickOnWeekNumber, setIsOpen, startDateOffset, endDateOffset, hasInputErrors, isOutsideRange, minDate, maxDate, portalClassName, ...args }: any): import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
//# sourceMappingURL=dateRangePickerDropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerDropdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dateRangePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerDropdown.tsx"],"names":[],"mappings":"AASA,wBAAgB,uBAAuB,CAAC,EACtC,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,OAAO,EACP,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EACzB,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,EACP,eAAe,EACf,GAAG,IAAI,EACR,EAAE,GAAG,kDAiUL"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useState, useLayoutEffect } from "react";
|
|
3
|
-
import moment from "moment";
|
|
2
|
+
import React__default, { useState, useEffect, useLayoutEffect } from "react";
|
|
4
3
|
import { DayPickerRangeController } from "react-dates";
|
|
5
4
|
import { DateRangePickerCustom } from "./dateRangePickerCustom.js";
|
|
6
5
|
import { DateRangePickerFooter } from "./dateRangePickerFooter.js";
|
|
@@ -38,9 +37,13 @@ function DateRangePickerDropdown({
|
|
|
38
37
|
startDateOffset,
|
|
39
38
|
endDateOffset,
|
|
40
39
|
hasInputErrors,
|
|
40
|
+
isOutsideRange,
|
|
41
|
+
minDate,
|
|
42
|
+
maxDate,
|
|
41
43
|
portalClassName,
|
|
42
44
|
...args
|
|
43
45
|
}) {
|
|
46
|
+
const [moment, setMoment] = useState(null);
|
|
44
47
|
const [position, setPosition] = useState({
|
|
45
48
|
x: 0,
|
|
46
49
|
y: 0,
|
|
@@ -51,6 +54,20 @@ function DateRangePickerDropdown({
|
|
|
51
54
|
left: 0,
|
|
52
55
|
right: "auto"
|
|
53
56
|
});
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
let cancelled = false;
|
|
59
|
+
import("moment").then((mod) => {
|
|
60
|
+
if (!cancelled) {
|
|
61
|
+
setMoment(() => mod.default);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return () => {
|
|
65
|
+
cancelled = true;
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
const isValidDate = (date) => Boolean(date == null ? void 0 : date._isAMomentObject) && date.isValid() && (!minDate || !date.isBefore(minDate, "day")) && (!maxDate || !date.isAfter(maxDate, "day")) && !(isOutsideRange == null ? void 0 : isOutsideRange(date));
|
|
69
|
+
const hasValidRange = isValidDate(startDate) && isValidDate(endDate) && !endDate.isBefore(startDate, "day");
|
|
70
|
+
const isClearDisabled = startDate == null && endDate == null && !hasInputErrors;
|
|
54
71
|
useLayoutEffect(() => {
|
|
55
72
|
if (withPortal && containerRef.current) {
|
|
56
73
|
const scrollY = window.scrollY || document.documentElement.scrollTop;
|
|
@@ -140,6 +157,14 @@ function DateRangePickerDropdown({
|
|
|
140
157
|
}
|
|
141
158
|
(_b = args.onNextMonthClick) == null ? void 0 : _b.call(args, params);
|
|
142
159
|
};
|
|
160
|
+
const getInitialVisibleMonth = () => {
|
|
161
|
+
if (startDate) return startDate;
|
|
162
|
+
if (endDate) return endDate;
|
|
163
|
+
return moment();
|
|
164
|
+
};
|
|
165
|
+
if (!moment) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
143
168
|
if (withPortal) {
|
|
144
169
|
return /* @__PURE__ */ jsxs(Portal, { container: portalContainer, children: [
|
|
145
170
|
/* @__PURE__ */ jsx(
|
|
@@ -177,11 +202,8 @@ function DateRangePickerDropdown({
|
|
|
177
202
|
focusedInput,
|
|
178
203
|
hideKeyboardShortcutsPanel: true,
|
|
179
204
|
horizontalMonthPadding: showWeekNumbers ? 16 : 12,
|
|
180
|
-
initialVisibleMonth:
|
|
181
|
-
|
|
182
|
-
if (endDate) return endDate;
|
|
183
|
-
return moment();
|
|
184
|
-
},
|
|
205
|
+
initialVisibleMonth: getInitialVisibleMonth,
|
|
206
|
+
isOutsideRange,
|
|
185
207
|
numberOfMonths: 2,
|
|
186
208
|
renderDayContents: showWeekNumbers ? renderDayContents : null,
|
|
187
209
|
renderMonthElement: showMonthYearSelect ? ({ month, onMonthSelect, onYearSelect }) => /* @__PURE__ */ jsx(
|
|
@@ -208,6 +230,8 @@ function DateRangePickerDropdown({
|
|
|
208
230
|
handleCancelDates,
|
|
209
231
|
handleResetDates,
|
|
210
232
|
hasInputErrors,
|
|
233
|
+
isApplyDisabled: !hasValidRange,
|
|
234
|
+
isClearDisabled,
|
|
211
235
|
primaryButtonProps,
|
|
212
236
|
selectedDaysNumber,
|
|
213
237
|
tertiaryButtonProps,
|
|
@@ -252,11 +276,8 @@ function DateRangePickerDropdown({
|
|
|
252
276
|
focusedInput,
|
|
253
277
|
hideKeyboardShortcutsPanel: true,
|
|
254
278
|
horizontalMonthPadding: showWeekNumbers ? 16 : 12,
|
|
255
|
-
initialVisibleMonth:
|
|
256
|
-
|
|
257
|
-
if (endDate) return endDate;
|
|
258
|
-
return moment();
|
|
259
|
-
},
|
|
279
|
+
initialVisibleMonth: getInitialVisibleMonth,
|
|
280
|
+
isOutsideRange,
|
|
260
281
|
numberOfMonths: 2,
|
|
261
282
|
renderDayContents: showWeekNumbers ? renderDayContents : null,
|
|
262
283
|
renderMonthElement: showMonthYearSelect ? ({ month, onMonthSelect, onYearSelect }) => /* @__PURE__ */ jsx(
|
|
@@ -283,6 +304,8 @@ function DateRangePickerDropdown({
|
|
|
283
304
|
handleCancelDates,
|
|
284
305
|
handleResetDates,
|
|
285
306
|
hasInputErrors,
|
|
307
|
+
isApplyDisabled: !hasValidRange,
|
|
308
|
+
isClearDisabled,
|
|
286
309
|
primaryButtonProps,
|
|
287
310
|
selectedDaysNumber,
|
|
288
311
|
tertiaryButtonProps,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function DateRangePickerFooter({ selectedDaysNumber, handleResetDates, handleCancelDates, onSecondaryButtonClick, tertiaryButtonProps, handleApplyDates, primaryButtonProps, hasInputErrors, }: any): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function DateRangePickerFooter({ selectedDaysNumber, handleResetDates, handleCancelDates, onSecondaryButtonClick, tertiaryButtonProps, handleApplyDates, primaryButtonProps, hasInputErrors, isApplyDisabled, isClearDisabled, }: any): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=dateRangePickerFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangePickerFooter.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerFooter.tsx"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,EACpC,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,
|
|
1
|
+
{"version":3,"file":"dateRangePickerFooter.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerFooter.tsx"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,EACpC,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAyC,EACzC,eAAyC,GAC1C,EAAE,GAAG,2CAsCL"}
|
|
@@ -9,7 +9,9 @@ function DateRangePickerFooter({
|
|
|
9
9
|
tertiaryButtonProps,
|
|
10
10
|
handleApplyDates,
|
|
11
11
|
primaryButtonProps,
|
|
12
|
-
hasInputErrors
|
|
12
|
+
hasInputErrors,
|
|
13
|
+
isApplyDisabled = selectedDaysNumber <= 0,
|
|
14
|
+
isClearDisabled = selectedDaysNumber <= 0
|
|
13
15
|
}) {
|
|
14
16
|
const { t } = useTranslation();
|
|
15
17
|
return /* @__PURE__ */ jsxs("div", { className: "dateRangePicker-footer-container", children: [
|
|
@@ -19,7 +21,7 @@ function DateRangePickerFooter({
|
|
|
19
21
|
/* @__PURE__ */ jsx("span", { className: "dateRangePicker-footer-value", children: t("dateRangePicker.daysCount", { count: selectedDaysNumber }) })
|
|
20
22
|
] }) }),
|
|
21
23
|
/* @__PURE__ */ jsxs("div", { className: "dateRangePicker-buttons-right-container", children: [
|
|
22
|
-
/* @__PURE__ */ jsx(Button, { size: "small", variant: "url", onClick: handleResetDates, children: t("common.clear") }),
|
|
24
|
+
/* @__PURE__ */ jsx(Button, { disabled: isClearDisabled, size: "small", variant: "url", onClick: handleResetDates, children: t("common.clear") }),
|
|
23
25
|
onSecondaryButtonClick && /* @__PURE__ */ jsx(
|
|
24
26
|
Button,
|
|
25
27
|
{
|
|
@@ -33,11 +35,11 @@ function DateRangePickerFooter({
|
|
|
33
35
|
/* @__PURE__ */ jsx(
|
|
34
36
|
Button,
|
|
35
37
|
{
|
|
36
|
-
disabled: hasInputErrors,
|
|
37
38
|
size: "small",
|
|
38
39
|
variant: "primary",
|
|
39
40
|
onClick: handleApplyDates,
|
|
40
41
|
...primaryButtonProps,
|
|
42
|
+
disabled: hasInputErrors || isApplyDisabled || (primaryButtonProps == null ? void 0 : primaryButtonProps.disabled) === true,
|
|
41
43
|
children: t("common.apply")
|
|
42
44
|
}
|
|
43
45
|
)
|