@spscommerce/ds-react 5.10.5-ie → 5.11.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/lib/_template/SpsComponent.d.ts +15 -0
- package/lib/_template/SpsComponent.examples.d.ts +2 -0
- package/lib/_template/index.d.ts +2 -0
- package/lib/advanced-search/SpsAdvancedSearch.d.ts +22 -0
- package/lib/advanced-search/SpsAdvancedSearch.examples.d.ts +2 -0
- package/lib/advanced-search/index.d.ts +2 -0
- package/lib/autocomplete/SpsAutocomplete.d.ts +27 -0
- package/lib/autocomplete/SpsAutocomplete.examples.d.ts +2 -0
- package/lib/autocomplete/index.d.ts +2 -0
- package/lib/button/SpsButton.d.ts +18 -0
- package/lib/button/SpsButton.examples.d.ts +2 -0
- package/lib/button/SpsButtonGroup.d.ts +10 -0
- package/lib/button/SpsIconButtonPanel.d.ts +10 -0
- package/lib/button/index.d.ts +4 -0
- package/lib/card/SpsCard.d.ts +16 -0
- package/lib/card/SpsCard.examples.d.ts +2 -0
- package/lib/card/SpsCardHeader.d.ts +14 -0
- package/lib/card/SpsCardTabbedPane.d.ts +19 -0
- package/lib/card/index.d.ts +3 -0
- package/lib/card/useTab.d.ts +18 -0
- package/lib/card-v2/SpsCardV2.d.ts +2 -0
- package/lib/card-v2/SpsCardV2Footer.d.ts +2 -0
- package/lib/card-v2/SpsCardV2Header.d.ts +2 -0
- package/lib/card-v2/SpsCardV2Title.d.ts +2 -0
- package/lib/card-v2/index.d.ts +5 -0
- package/lib/checkbox/SpsCheckbox.d.ts +21 -0
- package/lib/checkbox/SpsCheckbox.examples.d.ts +2 -0
- package/lib/checkbox/index.d.ts +2 -0
- package/lib/checkbox-dropdown/SpsCheckboxDropdown.d.ts +17 -0
- package/lib/checkbox-dropdown/index.d.ts +1 -0
- package/lib/clickable-tag/SpsClickableTag.d.ts +16 -0
- package/lib/clickable-tag/SpsClickableTag.examples.d.ts +2 -0
- package/lib/clickable-tag/index.d.ts +2 -0
- package/lib/column-chooser/SpsColumnChooser.d.ts +19 -0
- package/lib/column-chooser/SpsColumnChooser.examples.d.ts +2 -0
- package/lib/column-chooser/SpsColumnChooserColumn.d.ts +17 -0
- package/lib/column-chooser/index.d.ts +3 -0
- package/lib/conditional-field/SpsConditionalField.d.ts +11 -0
- package/lib/conditional-field/SpsConditionalField.examples.d.ts +2 -0
- package/lib/conditional-field/index.d.ts +2 -0
- package/lib/content-row/SpsContentRow.d.ts +22 -0
- package/lib/content-row/SpsContentRow.examples.d.ts +2 -0
- package/lib/content-row/SpsContentRowCol.d.ts +15 -0
- package/lib/content-row/SpsContentRowExpansion.d.ts +10 -0
- package/lib/content-row/index.d.ts +4 -0
- package/lib/currency-input/SpsCurrencyInput.d.ts +18 -0
- package/lib/currency-input/SpsCurrencyInput.examples.d.ts +2 -0
- package/lib/currency-input/index.d.ts +2 -0
- package/lib/dateRangePicker/SpsDateRangePicker.d.ts +23 -0
- package/lib/dateRangePicker/SpsDateRangePicker.examples.d.ts +2 -0
- package/lib/dateRangePicker/index.d.ts +2 -0
- package/lib/datepicker/SpsDatepicker.d.ts +19 -0
- package/lib/datepicker/SpsDatepicker.examples.d.ts +2 -0
- package/lib/datepicker/index.d.ts +2 -0
- package/lib/datepicker-v2/SpsDateRangePickerV2.d.ts +21 -0
- package/lib/datepicker-v2/SpsDatepickerCalendar.d.ts +18 -0
- package/lib/datepicker-v2/SpsDatepickerPopup.d.ts +13 -0
- package/lib/datepicker-v2/SpsDatepickerV2.d.ts +18 -0
- package/lib/datepicker-v2/index.d.ts +4 -0
- package/lib/datepicker-v2/useCalendar.d.ts +2 -0
- package/lib/datepicker-v2/useMoment.d.ts +3 -0
- package/lib/datepicker-v2/utils.d.ts +23 -0
- package/lib/datepicker-v2/validation.d.ts +10 -0
- package/lib/datetime/SpsDateTime.d.ts +26 -0
- package/lib/datetime/SpsDateTime.examples.d.ts +2 -0
- package/lib/datetime/index.d.ts +2 -0
- package/lib/description-list/SpsDescriptionList.d.ts +14 -0
- package/lib/description-list/SpsDescriptionList.examples.d.ts +2 -0
- package/lib/description-list/SpsDescriptionListDefinition.d.ts +11 -0
- package/lib/description-list/SpsDescriptionListTerm.d.ts +18 -0
- package/lib/description-list/index.d.ts +4 -0
- package/lib/dropdown/SpsDropdown.d.ts +24 -0
- package/lib/dropdown/SpsDropdown.examples.d.ts +2 -0
- package/lib/dropdown/index.d.ts +2 -0
- package/lib/feedback-block/SpsFeedbackBlock.d.ts +12 -0
- package/lib/feedback-block/SpsFeedbackBlock.examples.d.ts +2 -0
- package/lib/feedback-block/index.d.ts +2 -0
- package/lib/fieldset/SpsFieldset.d.ts +22 -0
- package/lib/fieldset/SpsFieldset.examples.d.ts +2 -0
- package/lib/fieldset/index.d.ts +2 -0
- package/lib/filter-panel/SpsFilterPanel.d.ts +10 -0
- package/lib/filter-panel/SpsFilterPanel.examples.d.ts +2 -0
- package/lib/filter-panel/SpsFilterPanelCap.d.ts +11 -0
- package/lib/filter-panel/SpsFilterPanelFilterBox.d.ts +16 -0
- package/lib/filter-panel/SpsFilterPanelSection.d.ts +16 -0
- package/lib/filter-panel/index.d.ts +5 -0
- package/lib/filter-tile-list/SpsFilterTile.d.ts +15 -0
- package/lib/filter-tile-list/SpsFilterTileList.d.ts +10 -0
- package/lib/filter-tile-list/SpsFilterTileList.examples.d.ts +2 -0
- package/lib/filter-tile-list/index.d.ts +3 -0
- package/lib/focused-task/SpsFocusedTask.d.ts +13 -0
- package/lib/focused-task/SpsFocusedTask.examples.d.ts +2 -0
- package/lib/focused-task/SpsFocusedTaskActions.d.ts +10 -0
- package/lib/focused-task/index.d.ts +3 -0
- package/lib/form/AddRemoveFormRows.examples.d.ts +18 -0
- package/lib/form/SpsForm.d.ts +24 -0
- package/lib/form/SpsForm.examples.d.ts +41 -0
- package/lib/form/SpsFormComponentWrapper.d.ts +19 -0
- package/lib/form/hooks/SpsAbstractControl.interface.d.ts +24 -0
- package/lib/form/hooks/SpsControlSet.interface.d.ts +7 -0
- package/lib/form/hooks/formArray.d.ts +12 -0
- package/lib/form/hooks/formControl.d.ts +9 -0
- package/lib/form/hooks/formGroup.d.ts +10 -0
- package/lib/form/hooks/useForm.d.ts +2 -0
- package/lib/form/hooks/useFormControlId.d.ts +4 -0
- package/lib/form/hooks/useServerSideValidation.d.ts +3 -0
- package/lib/form/hooks/useSpsForm.d.ts +79 -0
- package/lib/form/index.d.ts +15 -0
- package/lib/form/validation/SpsValidators.d.ts +16 -0
- package/lib/form/validation/types.d.ts +7 -0
- package/lib/form/validation/validate.d.ts +2 -0
- package/lib/growler/SpsGrowler.d.ts +17 -0
- package/lib/growler/SpsGrowler.examples.d.ts +2 -0
- package/lib/growler/index.d.ts +3 -0
- package/lib/growler/useGrowlers.d.ts +12 -0
- package/lib/i18n.d.ts +3 -0
- package/lib/icon/SpsIcon.d.ts +13 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/incrementor/SpsIncrementor.d.ts +15 -0
- package/lib/incrementor/SpsIncrementor.examples.d.ts +2 -0
- package/lib/incrementor/index.d.ts +2 -0
- package/lib/index.cjs.js +8473 -0
- package/lib/index.d.ts +71 -0
- package/lib/index.es.js +38099 -0
- package/lib/input-group/SpsInputGroup.d.ts +17 -0
- package/lib/input-group/index.d.ts +1 -0
- package/lib/insight-tile/SpsInsightTile.d.ts +18 -0
- package/lib/insight-tile/SpsInsightTile.examples.d.ts +2 -0
- package/lib/insight-tile/SpsInsights.d.ts +10 -0
- package/lib/insight-tile/index.d.ts +2 -0
- package/lib/key-value-list/SpsKeyValueList.d.ts +11 -0
- package/lib/key-value-list/SpsKeyValueList.examples.d.ts +2 -0
- package/lib/key-value-list/SpsKeyValueListItem.d.ts +13 -0
- package/lib/key-value-list/index.d.ts +3 -0
- package/lib/key-value-tag/SpsKeyValueTag.d.ts +16 -0
- package/lib/key-value-tag/SpsKeyValueTag.examples.d.ts +2 -0
- package/lib/key-value-tag/index.d.ts +2 -0
- package/lib/label/SpsLabel.d.ts +20 -0
- package/lib/label/SpsLabel.examples.d.ts +2 -0
- package/lib/label/index.d.ts +2 -0
- package/lib/list-action-bar/SpsListActionBar.d.ts +12 -0
- package/lib/list-action-bar/SpsListActionBar.examples.d.ts +2 -0
- package/lib/list-action-bar/index.d.ts +2 -0
- package/lib/list-toolbar/SpsListToolbar.d.ts +25 -0
- package/lib/list-toolbar/SpsListToolbar.examples.d.ts +3 -0
- package/lib/list-toolbar/SpsListToolbarSearch.d.ts +12 -0
- package/lib/list-toolbar/SpsListToolbarSearchInfo.d.ts +10 -0
- package/lib/list-toolbar/index.d.ts +4 -0
- package/lib/manifest.d.ts +2 -0
- package/lib/micro-block/SpsMicroBlock.d.ts +13 -0
- package/lib/micro-block/SpsMicroBlock.examples.d.ts +2 -0
- package/lib/micro-block/index.d.ts +2 -0
- package/lib/modal/SpsModal.d.ts +25 -0
- package/lib/modal/SpsModal.examples.d.ts +2 -0
- package/lib/modal/SpsModalAction.d.ts +18 -0
- package/lib/modal/SpsModalBody.d.ts +10 -0
- package/lib/modal/SpsModalFooter.d.ts +16 -0
- package/lib/modal/SpsModalHeader.d.ts +11 -0
- package/lib/modal/SpsModalOverlay.d.ts +12 -0
- package/lib/modal/index.d.ts +2 -0
- package/lib/modal-v2/SpsModalV2.d.ts +18 -0
- package/lib/modal-v2/index.d.ts +1 -0
- package/lib/multi-select/SpsMultiSelect.d.ts +34 -0
- package/lib/multi-select/SpsMultiSelect.examples.d.ts +2 -0
- package/lib/multi-select/index.d.ts +2 -0
- package/lib/option-list/SpsOptionList.d.ts +3 -0
- package/lib/option-list/SpsOptionListProps.d.ts +75 -0
- package/lib/option-list/index.d.ts +1 -0
- package/lib/option-list/useOptionListOptions.d.ts +8 -0
- package/lib/option-list/useOptionListSearch.d.ts +13 -0
- package/lib/option-list/useSpsAction.d.ts +2 -0
- package/lib/page-title/SpsPageSubtitle.d.ts +10 -0
- package/lib/page-title/SpsPageTitle.d.ts +10 -0
- package/lib/page-title/SpsPageTitle.examples.d.ts +2 -0
- package/lib/page-title/index.d.ts +3 -0
- package/lib/pagination/SpsPageSelector.d.ts +14 -0
- package/lib/pagination/SpsPagination.d.ts +16 -0
- package/lib/pagination/SpsPagination.examples.d.ts +2 -0
- package/lib/pagination/index.d.ts +3 -0
- package/lib/product-bar/SpsProductBar.d.ts +19 -0
- package/lib/product-bar/SpsProductBar.examples.d.ts +2 -0
- package/lib/product-bar/SpsProductBarTab.d.ts +6 -0
- package/lib/product-bar/index.d.ts +3 -0
- package/lib/progress-bar/SpsProgressBar.d.ts +15 -0
- package/lib/progress-bar/SpsProgressBar.examples.d.ts +27 -0
- package/lib/progress-bar/index.d.ts +2 -0
- package/lib/progress-ring/SpsProgressRing.d.ts +13 -0
- package/lib/progress-ring/index.d.ts +1 -0
- package/lib/prop-types.d.ts +23 -0
- package/lib/radio-button/SpsRadioButton.d.ts +23 -0
- package/lib/radio-button/SpsRadioButton.examples.d.ts +2 -0
- package/lib/radio-button/index.d.ts +2 -0
- package/lib/scrollable-container/SpsScrollableContainer.d.ts +11 -0
- package/lib/scrollable-container/SpsScrollableContainer.examples.d.ts +14 -0
- package/lib/scrollable-container/index.d.ts +2 -0
- package/lib/search-results-bar/SpsSearchResultsBar.d.ts +13 -0
- package/lib/search-results-bar/SpsSearchResultsBar.examples.d.ts +2 -0
- package/lib/search-results-bar/index.d.ts +2 -0
- package/lib/select/SpsSelect.d.ts +37 -0
- package/lib/select/SpsSelect.examples.d.ts +2 -0
- package/lib/select/index.d.ts +2 -0
- package/lib/side-nav/SpsSideNav.d.ts +38 -0
- package/lib/side-nav/SpsSideNav.examples.d.ts +2 -0
- package/lib/side-nav/SpsSideNavBranch.d.ts +9 -0
- package/lib/side-nav/index.d.ts +2 -0
- package/lib/slack-link/SpsSlackLink.d.ts +11 -0
- package/lib/slack-link/SpsSlackLink.examples.d.ts +2 -0
- package/lib/slack-link/index.d.ts +2 -0
- package/lib/sorting-header/SpsSortingHeader.d.ts +13 -0
- package/lib/sorting-header/SpsSortingHeader.examples.d.ts +2 -0
- package/lib/sorting-header/SpsSortingHeaderCell.d.ts +17 -0
- package/lib/sorting-header/index.d.ts +3 -0
- package/lib/spinner/SpsSpinner.d.ts +14 -0
- package/lib/spinner/SpsSpinner.examples.d.ts +2 -0
- package/lib/spinner/index.d.ts +2 -0
- package/lib/split-button/SpsSplitButton.d.ts +18 -0
- package/lib/split-button/SpsSplitButton.examples.d.ts +2 -0
- package/lib/split-button/index.d.ts +2 -0
- package/lib/stepped-progress-bar/SpsSteppedProgressBar.d.ts +25 -0
- package/lib/stepped-progress-bar/SpsSteppedProgressBar.examples.d.ts +24 -0
- package/lib/stepped-progress-bar/index.d.ts +2 -0
- package/lib/summary-list/SpsSummaryList.examples.d.ts +2 -0
- package/lib/summary-list/SpsSummaryListColumn.d.ts +14 -0
- package/lib/summary-list/SpsSummaryListExpansion.d.ts +10 -0
- package/lib/summary-list/SpsSummaryListRow.d.ts +13 -0
- package/lib/summary-list/index.d.ts +4 -0
- package/lib/table/SpsTable.d.ts +14 -0
- package/lib/table/SpsTable.examples.d.ts +2 -0
- package/lib/table/SpsTableBody.d.ts +11 -0
- package/lib/table/SpsTableCell.d.ts +15 -0
- package/lib/table/SpsTableHead.d.ts +15 -0
- package/lib/table/SpsTableHeader.d.ts +17 -0
- package/lib/table/SpsTableRow.d.ts +14 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/usePinnedStyles.d.ts +4 -0
- package/lib/tabs/SpsTabs.d.ts +14 -0
- package/lib/tabs-v2/SpsTab.d.ts +6 -0
- package/lib/tabs-v2/SpsTabPanel.d.ts +5 -0
- package/lib/tabs-v2/SpsTabsV2.d.ts +2 -0
- package/lib/tabs-v2/index.d.ts +4 -0
- package/lib/tag/SpsTag.d.ts +13 -0
- package/lib/tag/SpsTag.examples.d.ts +2 -0
- package/lib/tag/index.d.ts +2 -0
- package/lib/task-queue/SpsTaskQueue.d.ts +36 -0
- package/lib/task-queue/SpsTaskQueue.examples.d.ts +2 -0
- package/lib/task-queue/index.d.ts +2 -0
- package/lib/test-util.d.ts +2 -0
- package/lib/text-input/SpsTextInput.d.ts +22 -0
- package/lib/text-input/SpsTextInput.examples.d.ts +2 -0
- package/lib/text-input/index.d.ts +2 -0
- package/lib/textarea/SpsTextarea.d.ts +22 -0
- package/lib/textarea/SpsTextarea.examples.d.ts +2 -0
- package/lib/textarea/index.d.ts +2 -0
- package/lib/tile-list/SpsTile.d.ts +16 -0
- package/lib/tile-list/SpsTileList.d.ts +10 -0
- package/lib/tile-list/SpsTileList.examples.d.ts +2 -0
- package/lib/tile-list/index.d.ts +3 -0
- package/lib/toggle/SpsToggle.d.ts +27 -0
- package/lib/toggle/SpsToggle.examples.d.ts +2 -0
- package/lib/toggle/index.d.ts +2 -0
- package/lib/tooltip/SpsTooltip.d.ts +29 -0
- package/lib/tooltip/SpsTooltip.examples.d.ts +2 -0
- package/lib/tooltip/SpsTooltipTitle.d.ts +13 -0
- package/lib/tooltip/index.d.ts +3 -0
- package/lib/utils/FauxChangeEvent.d.ts +20 -0
- package/lib/utils/contentOf.d.ts +2 -0
- package/lib/utils/getPosition.d.ts +11 -0
- package/lib/utils/getScrollParent.d.ts +1 -0
- package/lib/utils/index.d.ts +11 -0
- package/lib/utils/selectChildren.d.ts +5 -0
- package/lib/utils/useCheckDeprecatedProps.d.ts +2 -0
- package/lib/utils/useDidUpdateEffect.d.ts +2 -0
- package/lib/utils/useDocumentEventListener.d.ts +1 -0
- package/lib/utils/useElementId.d.ts +2 -0
- package/lib/utils/useInputPopup.d.ts +6 -0
- package/lib/utils/usePatchReducer.d.ts +2 -0
- package/lib/utils/usePortal.d.ts +6 -0
- package/lib/vertical-rule/SpsVerticalRule.d.ts +11 -0
- package/lib/vertical-rule/index.d.ts +1 -0
- package/lib/wizard/SpsWizard.examples.d.ts +2 -0
- package/lib/wizard/SpsWizardSidebar.d.ts +23 -0
- package/lib/wizard/SpsWizardSubstep.d.ts +14 -0
- package/lib/wizard/index.d.ts +3 -0
- package/lib/workflow/SpsWorkflow.d.ts +14 -0
- package/lib/workflow/SpsWorkflow.examples.d.ts +2 -0
- package/lib/workflow/SpsWorkflowDocument.d.ts +11 -0
- package/lib/workflow/SpsWorkflowDocumentStatus.d.ts +13 -0
- package/lib/workflow/SpsWorkflowStep.d.ts +14 -0
- package/lib/workflow/index.d.ts +5 -0
- package/lib/zero-state/SpsMicroZeroState.d.ts +14 -0
- package/lib/zero-state/SpsZeroState.d.ts +13 -0
- package/lib/zero-state/SpsZeroState.examples.d.ts +2 -0
- package/lib/zero-state/index.d.ts +3 -0
- package/package.json +19 -13
- package/vite.config.js +1 -1
- package/rollup.config.js +0 -22
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SpsValidationStatus } from "../validation/types";
|
|
2
|
+
import type { SpsAbstractControl } from "./SpsAbstractControl.interface";
|
|
3
|
+
export declare function useServerSideValidation(formControl: SpsAbstractControl<any>, initialState?: SpsValidationStatus): (import("../validation/types").SpsValidationErrors | import("react").Dispatch<import("react").SetStateAction<import("../validation/types").SpsValidationErrors>>)[];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { SpsValidator, SpsValidationErrors } from "../validation/types";
|
|
2
|
+
declare type PathComponent = string | number;
|
|
3
|
+
declare type Path = PathComponent[];
|
|
4
|
+
declare type UpdateFn = (path?: Path, newValue?: any, markAsBlurred?: boolean) => void;
|
|
5
|
+
export declare abstract class SpsFormMetaBase<T> {
|
|
6
|
+
path: Path;
|
|
7
|
+
update: UpdateFn;
|
|
8
|
+
validators: Array<SpsValidator<T>>;
|
|
9
|
+
errors: SpsValidationErrors | null;
|
|
10
|
+
revealAllErrors: boolean;
|
|
11
|
+
preventativeErrors: any[];
|
|
12
|
+
constructor(path: Path, update: UpdateFn);
|
|
13
|
+
abstract isPristine(): boolean;
|
|
14
|
+
abstract markAsPristine(): SpsFormMetaBase<T>;
|
|
15
|
+
abstract markAsDirty(): SpsFormMetaBase<T>;
|
|
16
|
+
abstract isFocused(): boolean;
|
|
17
|
+
setValidators(newValidators: Array<SpsValidator<T>>): SpsFormMetaBase<T>;
|
|
18
|
+
validate(newValue: T): SpsFormMetaBase<T>;
|
|
19
|
+
isValid(): boolean;
|
|
20
|
+
hasErrors(): boolean;
|
|
21
|
+
isVisibilyInvalid(): boolean;
|
|
22
|
+
hasError(errorKey: string): any;
|
|
23
|
+
hasPreventativeError(errorKey: string): boolean;
|
|
24
|
+
hasPreventativeErrors(): boolean;
|
|
25
|
+
isRequired(): boolean;
|
|
26
|
+
onFocus(): void;
|
|
27
|
+
onBlur(): void;
|
|
28
|
+
}
|
|
29
|
+
export declare class SpsFormFieldMeta<T> extends SpsFormMetaBase<T> {
|
|
30
|
+
id: string;
|
|
31
|
+
focused: boolean;
|
|
32
|
+
pristine: boolean;
|
|
33
|
+
setValue(newValue: T): void;
|
|
34
|
+
isPristine(): boolean;
|
|
35
|
+
markAsPristine(): SpsFormFieldMeta<T>;
|
|
36
|
+
markAsDirty(): SpsFormFieldMeta<T>;
|
|
37
|
+
isFocused(): boolean;
|
|
38
|
+
markAsFocused(): SpsFormFieldMeta<T>;
|
|
39
|
+
markAsBlurred(): SpsFormFieldMeta<T>;
|
|
40
|
+
}
|
|
41
|
+
export declare type InferredSpsFormMeta<T> = SpsFormMetaBase<T> & (T extends any[] ? SpsFormArrayMeta<T> : T extends (Array<infer U> | undefined) ? SpsFormArrayMeta<U[]> | undefined : T extends object ? SpsFormGroupMeta<T> : T extends (object | undefined) ? SpsFormGroupMeta<object & T> | undefined : T extends boolean ? SpsFormFieldMeta<boolean> : T extends (infer V | undefined) ? SpsFormFieldMeta<V> | undefined : SpsFormFieldMeta<T>);
|
|
42
|
+
export declare type SpsFormSetMembers<T> = {
|
|
43
|
+
[K in keyof T]?: SpsFormMetaBase<any>;
|
|
44
|
+
};
|
|
45
|
+
export declare type InferredSpsFormMetaSetMembers<T> = SpsFormSetMembers<T> & {
|
|
46
|
+
[K in keyof T]: InferredSpsFormMeta<T[K]>;
|
|
47
|
+
};
|
|
48
|
+
export declare type SpsFormSetValue = any[] | object;
|
|
49
|
+
export declare abstract class SpsFormSetMeta<T extends SpsFormSetValue, U extends SpsFormSetMembers<T> = InferredSpsFormMetaSetMembers<T>> extends SpsFormFieldMeta<T> {
|
|
50
|
+
fields: U;
|
|
51
|
+
constructor(path: Path, update: UpdateFn);
|
|
52
|
+
constructor(inferMembersFromValue: T, path: Path, update: UpdateFn);
|
|
53
|
+
protected abstract inferMembers(inferFromValue: T): any;
|
|
54
|
+
protected inferSpsControl(valueOrControl: any, key: PathComponent): SpsFormMetaBase<any>;
|
|
55
|
+
private rollup;
|
|
56
|
+
isFocused(): boolean;
|
|
57
|
+
isValid(): boolean;
|
|
58
|
+
hasErrors(): boolean;
|
|
59
|
+
contentsAreValid(): boolean;
|
|
60
|
+
isPristine(): boolean;
|
|
61
|
+
markAsPristine(): this;
|
|
62
|
+
markAsDirty(): this;
|
|
63
|
+
markAsBlurred(): this;
|
|
64
|
+
}
|
|
65
|
+
export declare class SpsFormGroupMeta<T extends object> extends SpsFormSetMeta<T> {
|
|
66
|
+
protected inferMembers(inferFromValue: T): void;
|
|
67
|
+
}
|
|
68
|
+
export declare class SpsFormArrayMeta<T extends any[]> extends SpsFormSetMeta<T> {
|
|
69
|
+
protected inferMembers(inferFromValue: T): void;
|
|
70
|
+
}
|
|
71
|
+
export interface SpsFormState<T extends SpsFormSetValue> {
|
|
72
|
+
formValue: T;
|
|
73
|
+
formMeta: SpsFormSetMeta<T>;
|
|
74
|
+
updateForm: (newValue?: T) => void;
|
|
75
|
+
}
|
|
76
|
+
export declare type SpsValidatorMapValue = Array<SpsValidator<any>> | ((value: any) => Array<SpsValidator<any>>);
|
|
77
|
+
export declare type SpsValidatorMap = Record<string, SpsValidatorMapValue>;
|
|
78
|
+
export declare function useSpsForm<T extends SpsFormSetValue>(value: T, validatorMap?: SpsValidatorMap): SpsFormState<T>;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./hooks/useSpsForm";
|
|
2
|
+
export * from "./hooks/formArray";
|
|
3
|
+
export * from "./hooks/formControl";
|
|
4
|
+
export * from "./hooks/formGroup";
|
|
5
|
+
export * from "./hooks/SpsAbstractControl.interface";
|
|
6
|
+
export * from "./hooks/SpsControlSet.interface";
|
|
7
|
+
export * from "./hooks/useForm";
|
|
8
|
+
export * from "./hooks/useServerSideValidation";
|
|
9
|
+
export * from "./validation/SpsValidators";
|
|
10
|
+
export * from "./validation/types";
|
|
11
|
+
export * from "./validation/validate";
|
|
12
|
+
export { SpsForm } from "./SpsForm";
|
|
13
|
+
export * from "./SpsForm.examples";
|
|
14
|
+
export * from "./AddRemoveFormRows.examples";
|
|
15
|
+
export { SpsFormComponentWrapper } from "./SpsFormComponentWrapper";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SpsValidator, SpsValidatorFactory } from "./types";
|
|
2
|
+
export declare const SpsValidators: Readonly<{
|
|
3
|
+
min: SpsValidatorFactory<string | number>;
|
|
4
|
+
max: SpsValidatorFactory<string | number>;
|
|
5
|
+
required: SpsValidator<any>;
|
|
6
|
+
minLength: SpsValidatorFactory<string>;
|
|
7
|
+
maxLength: SpsValidatorFactory<string>;
|
|
8
|
+
pattern: SpsValidatorFactory<string>;
|
|
9
|
+
alpha: SpsValidator<string>;
|
|
10
|
+
numeric: SpsValidator<string>;
|
|
11
|
+
nonNumeric: SpsValidator<string>;
|
|
12
|
+
OnBlurErrorKeys: Set<string>;
|
|
13
|
+
date: SpsValidator<import("@spscommerce/ds-shared").SimpleDate | import("@spscommerce/ds-shared").SimpleDateRange>;
|
|
14
|
+
dateRange: SpsValidator<import("@spscommerce/ds-shared").SimpleDateRange | import("moment").Duration>;
|
|
15
|
+
dateConstraint: SpsValidatorFactory<import("@spscommerce/ds-shared").SimpleDate | import("@spscommerce/ds-shared").SimpleDateRange>;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type SpsValidationErrors = Record<string, boolean | number | string | Record<string, any>>;
|
|
2
|
+
export declare type SpsValidationStatus = SpsValidationErrors | null;
|
|
3
|
+
export declare type SpsValidator<T> = (value: T) => SpsValidationStatus;
|
|
4
|
+
export declare type SpsValidatorFactory<T> = (...args: any[]) => SpsValidator<T>;
|
|
5
|
+
export declare const OnBlurErrorKeys: Set<string>;
|
|
6
|
+
export declare const AsTypingErrorKeys: Set<string>;
|
|
7
|
+
export declare const PreventativeErrorKeys: Set<string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GrowlerKind } from "@spscommerce/ds-shared";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as PropTypes from "../prop-types";
|
|
4
|
+
declare const propTypes: {
|
|
5
|
+
imgSrc: PropTypes.Requireable<string>;
|
|
6
|
+
kind: PropTypes.Requireable<GrowlerKind>;
|
|
7
|
+
onClose: PropTypes.Requireable<() => void>;
|
|
8
|
+
persist: PropTypes.Requireable<boolean>;
|
|
9
|
+
title: PropTypes.Requireable<string>;
|
|
10
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
11
|
+
className: PropTypes.Requireable<string>;
|
|
12
|
+
"data-testid": PropTypes.Requireable<string>;
|
|
13
|
+
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
14
|
+
};
|
|
15
|
+
export declare type SpsGrowlerProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
|
|
16
|
+
export declare function SpsGrowler(props: SpsGrowlerProps): React.ReactPortal;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GrowlerKind } from "@spscommerce/ds-shared";
|
|
2
|
+
import type { ReactNodeOrRenderFn } from "../prop-types";
|
|
3
|
+
export interface GrowlerConfig {
|
|
4
|
+
title?: string;
|
|
5
|
+
content: ReactNodeOrRenderFn;
|
|
6
|
+
kind?: GrowlerKind;
|
|
7
|
+
imgSrc?: string;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
closed?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function useGrowlers(): [() => JSX.Element[], (config: GrowlerConfig) => void];
|
package/lib/i18n.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpsIcon as SpsIconEnum, SpsIconSize } from "@spscommerce/ds-shared";
|
|
2
|
+
import * as PropTypes from "../prop-types";
|
|
3
|
+
declare const propTypes: {
|
|
4
|
+
icon: PropTypes.Validator<SpsIconEnum>;
|
|
5
|
+
size: PropTypes.Requireable<SpsIconSize>;
|
|
6
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
7
|
+
className: PropTypes.Requireable<string>;
|
|
8
|
+
"data-testid": PropTypes.Requireable<string>;
|
|
9
|
+
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
10
|
+
};
|
|
11
|
+
export declare type SpsIconProps = PropTypes.InferTS<typeof propTypes, HTMLElement>;
|
|
12
|
+
export declare function SpsI(props: SpsIconProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SpsIcon";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as PropTypes from "../prop-types";
|
|
2
|
+
declare const propTypes: {
|
|
3
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
4
|
+
className: PropTypes.Requireable<string>;
|
|
5
|
+
"data-testid": PropTypes.Requireable<string>;
|
|
6
|
+
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
7
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
8
|
+
min: PropTypes.Requireable<number>;
|
|
9
|
+
max: PropTypes.Requireable<number>;
|
|
10
|
+
step: PropTypes.Requireable<number>;
|
|
11
|
+
onValueChange: PropTypes.Requireable<(newValue: number) => void>;
|
|
12
|
+
};
|
|
13
|
+
export declare type SpsIncrementorProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
|
|
14
|
+
export declare function SpsIncrementor(props: SpsIncrementorProps): JSX.Element;
|
|
15
|
+
export {};
|