@spscommerce/ds-react 5.10.2 → 5.10.3
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/lib/datepicker-v2/SpsDateRangePickerV2.d.ts +2 -1
- package/lib/index.cjs.js +74 -74
- package/lib/index.es.js +20 -8
- package/package.json +9 -9
package/lib/index.es.js
CHANGED
|
@@ -1639,8 +1639,7 @@ function usePortal(id2, classes = []) {
|
|
|
1639
1639
|
target.classList.add(className);
|
|
1640
1640
|
}
|
|
1641
1641
|
parent.appendChild(target);
|
|
1642
|
-
} else if (target
|
|
1643
|
-
parent.removeChild(target);
|
|
1642
|
+
} else if (!parent.contains(target)) {
|
|
1644
1643
|
parent.appendChild(target);
|
|
1645
1644
|
}
|
|
1646
1645
|
return createPortal(jsx, target);
|
|
@@ -36825,7 +36824,8 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36825
36824
|
minDate,
|
|
36826
36825
|
onNewSelection,
|
|
36827
36826
|
selectedDate,
|
|
36828
|
-
selectedRange
|
|
36827
|
+
selectedRange,
|
|
36828
|
+
"data-testid": testId
|
|
36829
36829
|
} = _a, rest = __objRest(_a, [
|
|
36830
36830
|
"children",
|
|
36831
36831
|
"className",
|
|
@@ -36833,7 +36833,8 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36833
36833
|
"minDate",
|
|
36834
36834
|
"onNewSelection",
|
|
36835
36835
|
"selectedDate",
|
|
36836
|
-
"selectedRange"
|
|
36836
|
+
"selectedRange",
|
|
36837
|
+
"data-testid"
|
|
36837
36838
|
]);
|
|
36838
36839
|
const { t: t2 } = React.useContext(I18nContext);
|
|
36839
36840
|
const [viewMonth, setViewMonth] = React.useState(() => determineViewMonth(props2));
|
|
@@ -36874,12 +36875,14 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36874
36875
|
}
|
|
36875
36876
|
const classes = clsx(CSS_ELEMENT$1, className);
|
|
36876
36877
|
return viewMonth ? /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({
|
|
36878
|
+
"data-testid": `${testId}`,
|
|
36877
36879
|
className: classes
|
|
36878
36880
|
}, rest), {
|
|
36879
36881
|
onMouseOver: handleMouseEnter
|
|
36880
36882
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
36881
36883
|
className: `${CSS_ELEMENT$1}-head`
|
|
36882
36884
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
36885
|
+
"data-testid": `${testId}_prev_month`,
|
|
36883
36886
|
type: "button",
|
|
36884
36887
|
tabIndex: -1,
|
|
36885
36888
|
disabled: SimpleDateUtils.isSameMonth(viewMonth, minDate),
|
|
@@ -36896,6 +36899,7 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36896
36899
|
className: `${CSS_ELEMENT$1}-head-label-year`
|
|
36897
36900
|
}, viewMonth.year)), /* @__PURE__ */ React.createElement("button", {
|
|
36898
36901
|
type: "button",
|
|
36902
|
+
"data-testid": `${testId}_next_month`,
|
|
36899
36903
|
tabIndex: -1,
|
|
36900
36904
|
disabled: SimpleDateUtils.isSameMonth(viewMonth, maxDate),
|
|
36901
36905
|
title: t2("design-system:datepicker.calendar.nextMonth"),
|
|
@@ -36916,7 +36920,8 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36916
36920
|
}, week.map((date2, j) => /* @__PURE__ */ React.createElement("div", {
|
|
36917
36921
|
key: j,
|
|
36918
36922
|
className: calendarCellClasses(date2),
|
|
36919
|
-
onClick: () => handleCellClick(date2)
|
|
36923
|
+
onClick: () => handleCellClick(date2),
|
|
36924
|
+
"data-testid": `${testId}_${SimpleDateUtils.toString(date2)}`
|
|
36920
36925
|
}, date2 ? date2.date : "")))))) : /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
36921
36926
|
}
|
|
36922
36927
|
Object.assign(SpsDatepickerCalendar, {
|
|
@@ -37112,7 +37117,8 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37112
37117
|
minDate,
|
|
37113
37118
|
onChange,
|
|
37114
37119
|
presets = DEFAULT_PRESETS,
|
|
37115
|
-
value
|
|
37120
|
+
value,
|
|
37121
|
+
"data-testid": testId
|
|
37116
37122
|
} = _Z, rest = __objRest(_Z, [
|
|
37117
37123
|
"children",
|
|
37118
37124
|
"className",
|
|
@@ -37123,7 +37129,8 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37123
37129
|
"minDate",
|
|
37124
37130
|
"onChange",
|
|
37125
37131
|
"presets",
|
|
37126
|
-
"value"
|
|
37132
|
+
"value",
|
|
37133
|
+
"data-testid"
|
|
37127
37134
|
]);
|
|
37128
37135
|
const { t: t2 } = React.useContext(I18nContext);
|
|
37129
37136
|
const { wrapperId, controlId } = useFormControlId(id2, formMeta);
|
|
@@ -37238,6 +37245,7 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37238
37245
|
}, /* @__PURE__ */ React.createElement("i", {
|
|
37239
37246
|
className: clsx("sps-text-input__icon", "sps-icon", "sps-icon-calendar")
|
|
37240
37247
|
}), selectedPreset && /* @__PURE__ */ React.createElement("div", {
|
|
37248
|
+
"data-testid": `${testId}_selected_preset`,
|
|
37241
37249
|
className: "sps-datepicker__selected-preset"
|
|
37242
37250
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
37243
37251
|
className: "sps-tag sps-tag--info"
|
|
@@ -37245,6 +37253,7 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37245
37253
|
type: "text",
|
|
37246
37254
|
ref: textInput,
|
|
37247
37255
|
className: "sps-text-input__input",
|
|
37256
|
+
"data-testid": `${testId}_date_input`,
|
|
37248
37257
|
id: controlId,
|
|
37249
37258
|
placeholder: !stringValue && !selectedPreset ? FORMAT : void 0,
|
|
37250
37259
|
onChange: handleTextInputChange,
|
|
@@ -37267,6 +37276,7 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37267
37276
|
}, t2("design-system:datepicker.presetsLabel")), /* @__PURE__ */ React.createElement("div", {
|
|
37268
37277
|
className: "sps-custom-control sps-custom-radio sps-custom-control--no-error"
|
|
37269
37278
|
}, /* @__PURE__ */ React.createElement("input", {
|
|
37279
|
+
"data-testid": `${testId}_presets_custom_input`,
|
|
37270
37280
|
type: "radio",
|
|
37271
37281
|
id: `sps-date-range-picker-${wrapperId}__range-custom`,
|
|
37272
37282
|
className: "sps-custom-control__input",
|
|
@@ -37281,6 +37291,7 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37281
37291
|
className: "sps-custom-control sps-custom-radio sps-custom-control--no-error"
|
|
37282
37292
|
}, /* @__PURE__ */ React.createElement("input", {
|
|
37283
37293
|
type: "radio",
|
|
37294
|
+
"data-testid": `${testId}_preset_option_${preset2.label}`,
|
|
37284
37295
|
id: `sps-date-range-picker-${wrapperId}__range-${i2}`,
|
|
37285
37296
|
name: `sps-date-range-picker-${wrapperId}__range`,
|
|
37286
37297
|
onChange: () => selectPreset(preset2),
|
|
@@ -37290,6 +37301,7 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
37290
37301
|
className: "sps-custom-control__label",
|
|
37291
37302
|
htmlFor: `sps-date-range-picker-${wrapperId}__range-${i2}`
|
|
37292
37303
|
}, getPresetText(preset2)))))), /* @__PURE__ */ React.createElement(SpsDatepickerCalendar, {
|
|
37304
|
+
"data-testid": `${testId}_calendar`,
|
|
37293
37305
|
selectedRange: Array.isArray(value) ? value : displayRange,
|
|
37294
37306
|
onNewSelection: handleNewSelection,
|
|
37295
37307
|
minDate,
|
|
@@ -38059,4 +38071,4 @@ Object.assign(SpsVr, {
|
|
|
38059
38071
|
propTypes,
|
|
38060
38072
|
displayName: "SpsDescriptionListTerm / SpsDt"
|
|
38061
38073
|
});
|
|
38062
|
-
export { AsTypingErrorKeys, ContentOrderExample, FauxChangeEvent, I18nContext, MANIFEST, OnBlurErrorKeys, PortalContext, PreventativeErrorKeys, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateRangePickerV2, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatepickerV2, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalAction, SpsModalBody, SpsModalExamples, SpsModalFooter, SpsModalHeader, SpsModalOverlay, SpsModalV2, SpsModalV2Footer, SpsMultiSelect, SpsMultiSelectExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, validate, weekOfMonth };
|
|
38074
|
+
export { AsTypingErrorKeys, ContentOrderExample, DEFAULT_PRESETS, FauxChangeEvent, I18nContext, MANIFEST, OnBlurErrorKeys, PortalContext, PreventativeErrorKeys, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateRangePickerV2, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatepickerV2, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalAction, SpsModalBody, SpsModalExamples, SpsModalFooter, SpsModalHeader, SpsModalOverlay, SpsModalV2, SpsModalV2Footer, SpsMultiSelect, SpsMultiSelectExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, validate, weekOfMonth };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "5.10.
|
|
4
|
+
"version": "5.10.3",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "5.10.
|
|
32
|
-
"@spscommerce/ds-shared": "5.10.
|
|
33
|
-
"@spscommerce/positioning": "5.10.
|
|
34
|
-
"@spscommerce/utils": "5.10.
|
|
31
|
+
"@spscommerce/ds-colors": "5.10.3",
|
|
32
|
+
"@spscommerce/ds-shared": "5.10.3",
|
|
33
|
+
"@spscommerce/positioning": "5.10.3",
|
|
34
|
+
"@spscommerce/utils": "5.10.3",
|
|
35
35
|
"moment": "^2.25.3",
|
|
36
36
|
"moment-timezone": "^0.5.28",
|
|
37
37
|
"react": "^16.9.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@react-stately/collections": "^3.3.3",
|
|
42
|
-
"@spscommerce/ds-colors": "5.10.
|
|
43
|
-
"@spscommerce/ds-shared": "5.10.
|
|
44
|
-
"@spscommerce/positioning": "5.10.
|
|
45
|
-
"@spscommerce/utils": "5.10.
|
|
42
|
+
"@spscommerce/ds-colors": "5.10.3",
|
|
43
|
+
"@spscommerce/ds-shared": "5.10.3",
|
|
44
|
+
"@spscommerce/positioning": "5.10.3",
|
|
45
|
+
"@spscommerce/utils": "5.10.3",
|
|
46
46
|
"@testing-library/react": "^9.3.2",
|
|
47
47
|
"@types/prop-types": "^15.7.1",
|
|
48
48
|
"@types/react": "^16.9.0",
|