@spscommerce/ds-react 5.0.0-rc1 → 5.0.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 -13
- package/lib/_template/SpsComponent.examples.d.ts +2 -2
- package/lib/_template/index.d.ts +2 -2
- package/lib/advanced-search/SpsAdvancedSearch.d.ts +22 -22
- package/lib/advanced-search/SpsAdvancedSearch.examples.d.ts +2 -2
- package/lib/advanced-search/index.d.ts +2 -2
- package/lib/autocomplete/SpsAutocomplete.d.ts +27 -26
- package/lib/autocomplete/SpsAutocomplete.examples.d.ts +2 -2
- package/lib/autocomplete/index.d.ts +2 -2
- package/lib/button/SpsButton.d.ts +18 -18
- package/lib/button/SpsButton.examples.d.ts +2 -2
- package/lib/button/SpsButtonGroup.d.ts +10 -10
- package/lib/button/SpsIconButtonPanel.d.ts +10 -10
- package/lib/button/index.d.ts +4 -4
- package/lib/card/SpsCard.d.ts +16 -16
- package/lib/card/SpsCard.examples.d.ts +2 -2
- package/lib/card/SpsCardHeader.d.ts +14 -14
- package/lib/card/SpsCardTabbedPane.d.ts +19 -19
- package/lib/card/index.d.ts +3 -3
- package/lib/card/useTab.d.ts +18 -18
- package/lib/card-v2/SpsCardV2.d.ts +2 -2
- package/lib/card-v2/SpsCardV2Footer.d.ts +2 -2
- package/lib/card-v2/SpsCardV2Header.d.ts +2 -2
- package/lib/card-v2/SpsCardV2Title.d.ts +2 -2
- package/lib/card-v2/index.d.ts +5 -5
- package/lib/checkbox/SpsCheckbox.d.ts +21 -21
- package/lib/checkbox/SpsCheckbox.examples.d.ts +2 -2
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox-dropdown/SpsCheckboxDropdown.d.ts +17 -17
- package/lib/checkbox-dropdown/index.d.ts +1 -1
- package/lib/clickable-tag/SpsClickableTag.d.ts +16 -16
- package/lib/clickable-tag/SpsClickableTag.examples.d.ts +2 -2
- package/lib/clickable-tag/index.d.ts +2 -2
- package/lib/column-chooser/SpsColumnChooser.d.ts +19 -19
- package/lib/column-chooser/SpsColumnChooser.examples.d.ts +2 -2
- package/lib/column-chooser/SpsColumnChooserColumn.d.ts +17 -17
- package/lib/column-chooser/index.d.ts +3 -3
- 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 -21
- package/lib/content-row/SpsContentRow.examples.d.ts +2 -2
- package/lib/content-row/SpsContentRowCol.d.ts +15 -15
- package/lib/content-row/SpsContentRowExpansion.d.ts +10 -10
- package/lib/content-row/index.d.ts +4 -4
- package/lib/currency-input/SpsCurrencyInput.d.ts +18 -18
- package/lib/currency-input/SpsCurrencyInput.examples.d.ts +2 -2
- package/lib/currency-input/index.d.ts +2 -2
- package/lib/dateRangePicker/SpsDateRangePicker.d.ts +23 -23
- package/lib/dateRangePicker/SpsDateRangePicker.examples.d.ts +2 -2
- package/lib/dateRangePicker/index.d.ts +2 -2
- package/lib/datepicker/SpsDatepicker.d.ts +19 -19
- package/lib/datepicker/SpsDatepicker.examples.d.ts +2 -2
- package/lib/datepicker/index.d.ts +2 -2
- package/lib/datepicker-v2/SpsDateRangePickerV2.d.ts +20 -20
- package/lib/datepicker-v2/SpsDatepickerCalendar.d.ts +18 -18
- package/lib/datepicker-v2/SpsDatepickerPopup.d.ts +13 -13
- package/lib/datepicker-v2/SpsDatepickerV2.d.ts +18 -18
- package/lib/datepicker-v2/index.d.ts +4 -4
- package/lib/datepicker-v2/useCalendar.d.ts +2 -2
- package/lib/datepicker-v2/useMoment.d.ts +3 -3
- package/lib/datepicker-v2/utils.d.ts +22 -22
- package/lib/datepicker-v2/validation.d.ts +10 -10
- package/lib/datetime/SpsDateTime.d.ts +26 -17
- package/lib/datetime/SpsDateTime.examples.d.ts +2 -2
- package/lib/datetime/index.d.ts +2 -2
- package/lib/description-list/SpsDescriptionList.d.ts +14 -14
- package/lib/description-list/SpsDescriptionList.examples.d.ts +2 -2
- package/lib/description-list/SpsDescriptionListDefinition.d.ts +11 -11
- package/lib/description-list/SpsDescriptionListTerm.d.ts +18 -18
- package/lib/description-list/index.d.ts +4 -4
- package/lib/dropdown/SpsDropdown.d.ts +24 -22
- package/lib/dropdown/SpsDropdown.examples.d.ts +2 -2
- package/lib/dropdown/index.d.ts +2 -2
- package/lib/feedback-block/SpsFeedbackBlock.d.ts +12 -12
- package/lib/feedback-block/SpsFeedbackBlock.examples.d.ts +2 -2
- package/lib/feedback-block/index.d.ts +2 -2
- package/lib/fieldset/SpsFieldset.d.ts +22 -22
- package/lib/fieldset/SpsFieldset.examples.d.ts +2 -2
- package/lib/fieldset/index.d.ts +2 -2
- package/lib/filter-panel/SpsFilterPanel.d.ts +10 -10
- package/lib/filter-panel/SpsFilterPanel.examples.d.ts +2 -2
- package/lib/filter-panel/SpsFilterPanelCap.d.ts +11 -11
- package/lib/filter-panel/SpsFilterPanelFilterBox.d.ts +16 -16
- package/lib/filter-panel/SpsFilterPanelSection.d.ts +16 -16
- package/lib/filter-panel/index.d.ts +5 -5
- 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 -13
- package/lib/focused-task/SpsFocusedTask.examples.d.ts +2 -2
- package/lib/focused-task/SpsFocusedTaskActions.d.ts +10 -10
- package/lib/focused-task/index.d.ts +3 -3
- package/lib/form/AddRemoveFormRows.examples.d.ts +18 -18
- package/lib/form/SpsForm.d.ts +24 -24
- package/lib/form/SpsForm.examples.d.ts +29 -29
- package/lib/form/SpsFormComponentWrapper.d.ts +19 -19
- package/lib/form/hooks/SpsAbstractControl.interface.d.ts +24 -24
- package/lib/form/hooks/SpsControlSet.interface.d.ts +7 -7
- package/lib/form/hooks/formArray.d.ts +12 -12
- package/lib/form/hooks/formControl.d.ts +9 -9
- package/lib/form/hooks/formGroup.d.ts +10 -14
- package/lib/form/hooks/useForm.d.ts +2 -2
- package/lib/form/hooks/useFormControlId.d.ts +4 -4
- package/lib/form/hooks/useServerSideValidation.d.ts +3 -3
- package/lib/form/hooks/useSpsForm.d.ts +74 -76
- package/lib/form/index.d.ts +15 -15
- package/lib/form/validation/SpsValidators.d.ts +16 -16
- package/lib/form/validation/types.d.ts +6 -9
- package/lib/form/validation/validate.d.ts +2 -2
- package/lib/growler/SpsGrowler.d.ts +17 -17
- package/lib/growler/SpsGrowler.examples.d.ts +2 -2
- package/lib/growler/index.d.ts +3 -3
- package/lib/growler/useGrowlers.d.ts +12 -11
- package/lib/i18n.d.ts +3 -3
- package/lib/icon/SpsIcon.d.ts +13 -13
- package/lib/icon/index.d.ts +1 -1
- package/lib/incrementor/SpsIncrementor.d.ts +15 -15
- package/lib/incrementor/SpsIncrementor.examples.d.ts +2 -2
- package/lib/incrementor/index.d.ts +2 -2
- package/lib/index.cjs.js +8252 -14878
- package/lib/index.d.ts +71 -67
- package/lib/index.es.js +37616 -0
- package/lib/input-group/SpsInputGroup.d.ts +17 -17
- package/lib/input-group/index.d.ts +1 -1
- 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 -11
- package/lib/key-value-list/SpsKeyValueList.examples.d.ts +2 -2
- package/lib/key-value-list/SpsKeyValueListItem.d.ts +13 -11
- package/lib/key-value-list/index.d.ts +3 -3
- package/lib/key-value-tag/SpsKeyValueTag.d.ts +16 -16
- package/lib/key-value-tag/SpsKeyValueTag.examples.d.ts +2 -2
- package/lib/key-value-tag/index.d.ts +2 -2
- package/lib/label/SpsLabel.d.ts +20 -20
- package/lib/label/SpsLabel.examples.d.ts +2 -2
- package/lib/label/index.d.ts +2 -2
- package/lib/list-action-bar/SpsListActionBar.d.ts +12 -12
- package/lib/list-action-bar/SpsListActionBar.examples.d.ts +2 -2
- package/lib/list-action-bar/index.d.ts +2 -2
- package/lib/list-toolbar/SpsListToolbar.d.ts +25 -25
- package/lib/list-toolbar/SpsListToolbar.examples.d.ts +3 -3
- package/lib/list-toolbar/SpsListToolbarSearch.d.ts +12 -12
- package/lib/list-toolbar/index.d.ts +3 -3
- package/lib/manifest.d.ts +2 -2
- package/lib/micro-block/SpsMicroBlock.d.ts +13 -13
- package/lib/micro-block/SpsMicroBlock.examples.d.ts +2 -2
- package/lib/micro-block/index.d.ts +2 -2
- package/lib/modal/SpsModal.d.ts +25 -25
- package/lib/modal/SpsModal.examples.d.ts +2 -2
- package/lib/modal/SpsModalAction.d.ts +18 -18
- package/lib/modal/SpsModalBody.d.ts +10 -10
- package/lib/modal/SpsModalFooter.d.ts +16 -16
- package/lib/modal/SpsModalHeader.d.ts +11 -11
- package/lib/modal/SpsModalOverlay.d.ts +12 -12
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal-v2/SpsModalV2.d.ts +18 -18
- package/lib/modal-v2/index.d.ts +1 -1
- package/lib/multi-select/SpsMultiSelect.d.ts +33 -31
- package/lib/multi-select/SpsMultiSelect.examples.d.ts +2 -2
- package/lib/multi-select/index.d.ts +2 -2
- package/lib/option-list/SpsOptionList.d.ts +3 -3
- package/lib/option-list/SpsOptionListProps.d.ts +74 -69
- package/lib/option-list/index.d.ts +1 -1
- package/lib/option-list/useOptionListOptions.d.ts +8 -8
- package/lib/option-list/useOptionListSearch.d.ts +13 -13
- package/lib/option-list/useSpsAction.d.ts +2 -2
- package/lib/page-title/SpsPageSubtitle.d.ts +10 -10
- package/lib/page-title/SpsPageTitle.d.ts +10 -10
- package/lib/page-title/SpsPageTitle.examples.d.ts +2 -2
- package/lib/page-title/index.d.ts +3 -3
- package/lib/pagination/SpsPageSelector.d.ts +14 -14
- package/lib/pagination/SpsPagination.d.ts +16 -16
- package/lib/pagination/SpsPagination.examples.d.ts +2 -2
- package/lib/pagination/index.d.ts +3 -3
- package/lib/product-bar/SpsProductBar.d.ts +19 -19
- package/lib/product-bar/SpsProductBar.examples.d.ts +2 -2
- package/lib/product-bar/SpsProductBarTab.d.ts +6 -11
- package/lib/product-bar/index.d.ts +3 -3
- package/lib/progress-bar/SpsProgressBar.d.ts +15 -15
- package/lib/progress-bar/SpsProgressBar.examples.d.ts +27 -27
- package/lib/progress-bar/index.d.ts +2 -2
- package/lib/progress-ring/SpsProgressRing.d.ts +13 -13
- package/lib/progress-ring/index.d.ts +1 -1
- package/lib/prop-types.d.ts +23 -25
- package/lib/radio-button/SpsRadioButton.d.ts +23 -23
- package/lib/radio-button/SpsRadioButton.examples.d.ts +2 -2
- package/lib/radio-button/index.d.ts +2 -2
- package/lib/scrollable-container/SpsScrollableContainer.d.ts +11 -11
- package/lib/scrollable-container/SpsScrollableContainer.examples.d.ts +14 -14
- package/lib/scrollable-container/index.d.ts +2 -2
- package/lib/search-results-bar/SpsSearchResultsBar.d.ts +13 -13
- package/lib/search-results-bar/SpsSearchResultsBar.examples.d.ts +2 -2
- package/lib/search-results-bar/index.d.ts +2 -2
- package/lib/select/SpsSelect.d.ts +36 -35
- package/lib/select/SpsSelect.examples.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/setup-jest.d.ts +1 -1
- package/lib/side-nav/SpsSideNav.d.ts +36 -36
- package/lib/side-nav/SpsSideNav.examples.d.ts +2 -2
- package/lib/side-nav/SpsSideNavBranch.d.ts +9 -9
- package/lib/side-nav/index.d.ts +2 -2
- package/lib/slack-link/SpsSlackLink.d.ts +11 -11
- package/lib/slack-link/SpsSlackLink.examples.d.ts +2 -2
- package/lib/slack-link/index.d.ts +2 -2
- package/lib/sorting-header/SpsSortingHeader.d.ts +13 -13
- package/lib/sorting-header/SpsSortingHeader.examples.d.ts +2 -2
- package/lib/sorting-header/SpsSortingHeaderCell.d.ts +17 -17
- package/lib/sorting-header/index.d.ts +3 -3
- package/lib/spinner/SpsSpinner.d.ts +14 -14
- package/lib/spinner/SpsSpinner.examples.d.ts +2 -2
- package/lib/spinner/index.d.ts +2 -2
- package/lib/split-button/SpsSplitButton.d.ts +18 -17
- package/lib/split-button/SpsSplitButton.examples.d.ts +2 -2
- package/lib/split-button/index.d.ts +2 -2
- package/lib/stepped-progress-bar/SpsStepepdProgressBar.examples.d.ts +20 -0
- package/lib/stepped-progress-bar/SpsSteppedProgressBar.d.ts +23 -0
- package/lib/stepped-progress-bar/index.d.ts +2 -0
- package/lib/summary-list/SpsSummaryList.examples.d.ts +2 -2
- package/lib/summary-list/SpsSummaryListColumn.d.ts +14 -14
- package/lib/summary-list/SpsSummaryListExpansion.d.ts +10 -10
- package/lib/summary-list/SpsSummaryListRow.d.ts +13 -13
- package/lib/summary-list/index.d.ts +4 -4
- package/lib/table/SpsTable.d.ts +14 -14
- package/lib/table/SpsTable.examples.d.ts +2 -2
- package/lib/table/SpsTableBody.d.ts +11 -11
- package/lib/table/SpsTableCell.d.ts +15 -15
- package/lib/table/SpsTableHead.d.ts +15 -15
- package/lib/table/SpsTableHeader.d.ts +17 -17
- package/lib/table/SpsTableRow.d.ts +14 -14
- package/lib/table/index.d.ts +7 -7
- package/lib/table/usePinnedStyles.d.ts +4 -4
- package/lib/tabs/SpsTabs.d.ts +14 -14
- package/lib/tabs-v2/SpsTab.d.ts +6 -6
- package/lib/tabs-v2/SpsTabPanel.d.ts +5 -5
- package/lib/tabs-v2/SpsTabsV2.d.ts +2 -2
- package/lib/tabs-v2/index.d.ts +4 -4
- package/lib/tag/SpsTag.d.ts +13 -13
- package/lib/tag/SpsTag.examples.d.ts +2 -2
- package/lib/tag/index.d.ts +2 -2
- package/lib/task-queue/SpsTaskQueue.d.ts +36 -35
- package/lib/task-queue/SpsTaskQueue.examples.d.ts +2 -2
- package/lib/task-queue/index.d.ts +2 -2
- package/lib/test-util.d.ts +1 -1
- package/lib/text-input/SpsTextInput.d.ts +22 -22
- package/lib/text-input/SpsTextInput.examples.d.ts +2 -2
- package/lib/text-input/index.d.ts +2 -2
- package/lib/textarea/SpsTextarea.d.ts +22 -22
- package/lib/textarea/SpsTextarea.examples.d.ts +2 -2
- package/lib/textarea/index.d.ts +2 -2
- package/lib/tile-list/SpsTile.d.ts +16 -16
- package/lib/tile-list/SpsTileList.d.ts +10 -10
- package/lib/tile-list/SpsTileList.examples.d.ts +2 -2
- package/lib/tile-list/index.d.ts +3 -3
- package/lib/toggle/SpsToggle.d.ts +27 -27
- package/lib/toggle/SpsToggle.examples.d.ts +2 -2
- package/lib/toggle/index.d.ts +2 -2
- package/lib/tooltip/SpsTooltip.d.ts +29 -29
- package/lib/tooltip/SpsTooltip.examples.d.ts +2 -2
- package/lib/tooltip/SpsTooltipTitle.d.ts +13 -0
- package/lib/tooltip/index.d.ts +3 -2
- package/lib/utils/FauxChangeEvent.d.ts +20 -20
- package/lib/utils/contentOf.d.ts +2 -2
- package/lib/utils/getPosition.d.ts +11 -10
- package/lib/utils/getScrollParent.d.ts +1 -1
- package/lib/utils/index.d.ts +11 -11
- package/lib/utils/selectChildren.d.ts +5 -7
- package/lib/utils/useCheckDeprecatedProps.d.ts +2 -2
- package/lib/utils/useDidUpdateEffect.d.ts +2 -2
- package/lib/utils/useDocumentEventListener.d.ts +1 -1
- package/lib/utils/useElementId.d.ts +2 -1
- package/lib/utils/useInputPopup.d.ts +6 -7
- package/lib/utils/usePatchReducer.d.ts +2 -1
- package/lib/utils/usePortal.d.ts +6 -6
- package/lib/vertical-rule/SpsVerticalRule.d.ts +11 -11
- package/lib/vertical-rule/index.d.ts +1 -1
- package/lib/wizard/SpsWizard.examples.d.ts +2 -2
- package/lib/wizard/SpsWizardSidebar.d.ts +23 -23
- package/lib/wizard/SpsWizardSubstep.d.ts +14 -14
- package/lib/wizard/index.d.ts +3 -3
- package/lib/workflow/SpsWorkflow.d.ts +14 -14
- package/lib/workflow/SpsWorkflow.examples.d.ts +2 -2
- package/lib/workflow/SpsWorkflowDocument.d.ts +11 -11
- package/lib/workflow/SpsWorkflowDocumentStatus.d.ts +13 -13
- package/lib/workflow/SpsWorkflowStep.d.ts +14 -14
- package/lib/workflow/index.d.ts +5 -5
- package/lib/zero-state/SpsMicroZeroState.d.ts +14 -14
- package/lib/zero-state/SpsZeroState.d.ts +13 -13
- package/lib/zero-state/SpsZeroState.examples.d.ts +2 -2
- package/lib/zero-state/index.d.ts +3 -3
- package/package.json +34 -40
- package/vite.config.js +20 -0
- package/lib/_template/SpsComponent.test-unit.d.ts +0 -1
- package/lib/advanced-search/SpsAdvancedSearch.test-unit.d.ts +0 -1
- package/lib/autocomplete/SpsAutocomplete.test-unit.d.ts +0 -1
- package/lib/autocomplete/SpsAutocomplete.test-visual.d.ts +0 -1
- package/lib/button/SpsButton.test-unit.d.ts +0 -1
- package/lib/button/SpsButton.test-visual.d.ts +0 -1
- package/lib/card/SpsCard.test-unit.d.ts +0 -1
- package/lib/card/SpsCard.test-visual.d.ts +0 -1
- package/lib/checkbox/SpsCheckbox.test-unit.d.ts +0 -1
- package/lib/column-chooser/SpsColumnChooser.test-unit.d.ts +0 -1
- package/lib/content-row/SpsContentRow.test-unit.d.ts +0 -1
- package/lib/currency-input/SpsCurrencyInput.test-unit.d.ts +0 -1
- package/lib/dateRangePicker/SpsDateRangePicker.test-unit.d.ts +0 -1
- package/lib/datepicker/SpsDatepicker.test-unit.d.ts +0 -1
- package/lib/description-list/SpsDescriptionList.test-unit.d.ts +0 -1
- package/lib/dropdown/SpsDropdown.test-unit.d.ts +0 -1
- package/lib/feedback-block/SpsFeedbackBlock.test-unit.d.ts +0 -1
- package/lib/fieldset/SpsFieldset.test-unit.d.ts +0 -1
- package/lib/filter-panel/SpsFilterPanel.test-unit.d.ts +0 -1
- package/lib/focused-task/SpsFocusedTask.test-unit.d.ts +0 -1
- package/lib/growler/SpsGrowler.test-unit.d.ts +0 -1
- package/lib/incrementor/SpsIncrementor.test-unit.d.ts +0 -1
- package/lib/index.esm.js +0 -14666
- package/lib/key-value-list/SpsKeyValueList.test-unit.d.ts +0 -1
- package/lib/label/SpsLabel.test-unit.d.ts +0 -1
- package/lib/list-action-bar/SpsListActionBar.test-unit.d.ts +0 -1
- package/lib/list-toolbar/SpsListToolbar.test-unit.d.ts +0 -1
- package/lib/micro-block/SpsMicroBlock.test-unit.d.ts +0 -1
- package/lib/modal/SpsModal.test-unit.d.ts +0 -1
- package/lib/multi-select/SpsMultiSelect.test-unit.d.ts +0 -1
- package/lib/page-title/SpsPageTitle.test-unit.d.ts +0 -1
- package/lib/pagination/SpsPagination.test-unit.d.ts +0 -1
- package/lib/product-bar/SpsProductBar.test-unit.d.ts +0 -1
- package/lib/progress-bar/SpsProgressBar.test-unit.d.ts +0 -1
- package/lib/radio-button/SpsRadioButton.test-unit.d.ts +0 -1
- package/lib/search-results-bar/SpsSearchResultsBar.test-unit.d.ts +0 -1
- package/lib/select/SpsSelect.test-unit.d.ts +0 -1
- package/lib/side-nav/SpsSideNav.test-unit.d.ts +0 -1
- package/lib/slack-link/SpsSlackLink.test-unit.d.ts +0 -1
- package/lib/sorting-header/SpsSortingHeader.test-unit.d.ts +0 -1
- package/lib/spinner/SpsSpinner.test-unit.d.ts +0 -1
- package/lib/split-button/SpsSplitButton.test-unit.d.ts +0 -1
- package/lib/summary-list/SummaryList.test-unit.d.ts +0 -1
- package/lib/table/SpsTable.test-unit.d.ts +0 -1
- package/lib/tag/SpsTag.test-unit.d.ts +0 -1
- package/lib/task-queue/SpsTaskQueue.test-unit.d.ts +0 -1
- package/lib/text-input/SpsTextInput.test-unit.d.ts +0 -1
- package/lib/textarea/SpsTextarea.test-unit.d.ts +0 -1
- package/lib/tile-list/SpsTileList.test-unit.d.ts +0 -1
- package/lib/toggle/SpsToggle.test-unit.d.ts +0 -1
- package/lib/tooltip/SpsTooltip.test-unit.d.ts +0 -1
- package/lib/wizard/SpsWizard.test-unit.d.ts +0 -1
- package/lib/workflow/SpsWorkflow.test-unit.d.ts +0 -1
- package/lib/zero-state/SpsZeroState.test-unit.d.ts +0 -1
- package/rollup.config.js +0 -24
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as PropTypes from
|
|
2
|
-
declare const propTypes: {
|
|
3
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
4
|
-
className: PropTypes.Requireable<string>;
|
|
5
|
-
|
|
6
|
-
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
7
|
-
};
|
|
8
|
-
export declare type SpsFocusedTaskActionsProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
|
|
9
|
-
export declare function SpsFocusedTaskActions(props: SpsFocusedTaskActionsProps): JSX.Element;
|
|
10
|
-
export {};
|
|
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
|
+
};
|
|
8
|
+
export declare type SpsFocusedTaskActionsProps = PropTypes.InferTS<typeof propTypes, HTMLDivElement>;
|
|
9
|
+
export declare function SpsFocusedTaskActions(props: SpsFocusedTaskActionsProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./SpsFocusedTask";
|
|
2
|
+
export * from "./SpsFocusedTaskActions";
|
|
3
|
+
export * from "./SpsFocusedTask.examples";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const SpsAddRemoveFormRowExamples: {
|
|
2
|
-
ideal: {
|
|
3
|
-
label: string;
|
|
4
|
-
examples: {
|
|
5
|
-
ideal: {
|
|
6
|
-
react: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
alternate: {
|
|
11
|
-
label: string;
|
|
12
|
-
examples: {
|
|
13
|
-
alternate: {
|
|
14
|
-
react: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
1
|
+
export declare const SpsAddRemoveFormRowExamples: {
|
|
2
|
+
ideal: {
|
|
3
|
+
label: string;
|
|
4
|
+
examples: {
|
|
5
|
+
ideal: {
|
|
6
|
+
react: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
alternate: {
|
|
11
|
+
label: string;
|
|
12
|
+
examples: {
|
|
13
|
+
alternate: {
|
|
14
|
+
react: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
package/lib/form/SpsForm.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as PropTypes from
|
|
3
|
-
import { SpsFormArray } from
|
|
4
|
-
import { SpsFormGroup } from
|
|
5
|
-
import { SpsFormSetMeta } from
|
|
6
|
-
export declare const spsFormProps: {
|
|
7
|
-
formMeta: string;
|
|
8
|
-
onSubmit: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const spsFormPropTypes: {
|
|
11
|
-
formArray: PropTypes.Requireable<SpsFormArray<any>>;
|
|
12
|
-
formGroup: PropTypes.Requireable<SpsFormGroup>;
|
|
13
|
-
formMeta: PropTypes.Requireable<SpsFormSetMeta<any, import("./hooks/useSpsForm").InferredSpsFormMetaSetMembers<any>>>;
|
|
14
|
-
onSubmit: PropTypes.Requireable<React.FormEventHandler<Element>>;
|
|
15
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
-
className: PropTypes.Requireable<string>;
|
|
17
|
-
|
|
18
|
-
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
19
|
-
};
|
|
20
|
-
export declare type SpsFormProps = PropTypes.InferTS<typeof spsFormPropTypes, HTMLFormElement>;
|
|
21
|
-
declare type SpsFormForwardRefType = SpsFormProps & React.RefAttributes<HTMLFormElement>;
|
|
22
|
-
declare type SpsFormForwardRefExoticComponent = React.ForwardRefExoticComponent<SpsFormForwardRefType>;
|
|
23
|
-
export declare const SpsForm: SpsFormForwardRefExoticComponent;
|
|
24
|
-
export {};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PropTypes from "../prop-types";
|
|
3
|
+
import type { SpsFormArray } from "./hooks/formArray";
|
|
4
|
+
import type { SpsFormGroup } from "./hooks/formGroup";
|
|
5
|
+
import type { SpsFormSetMeta } from "./hooks/useSpsForm";
|
|
6
|
+
export declare const spsFormProps: {
|
|
7
|
+
formMeta: string;
|
|
8
|
+
onSubmit: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const spsFormPropTypes: {
|
|
11
|
+
formArray: PropTypes.Requireable<SpsFormArray<any>>;
|
|
12
|
+
formGroup: PropTypes.Requireable<SpsFormGroup>;
|
|
13
|
+
formMeta: PropTypes.Requireable<SpsFormSetMeta<any, import("./hooks/useSpsForm").InferredSpsFormMetaSetMembers<any>>>;
|
|
14
|
+
onSubmit: PropTypes.Requireable<React.FormEventHandler<Element>>;
|
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
+
className: PropTypes.Requireable<string>;
|
|
17
|
+
"data-testid": PropTypes.Requireable<string>;
|
|
18
|
+
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
19
|
+
};
|
|
20
|
+
export declare type SpsFormProps = PropTypes.InferTS<typeof spsFormPropTypes, HTMLFormElement>;
|
|
21
|
+
declare type SpsFormForwardRefType = SpsFormProps & React.RefAttributes<HTMLFormElement>;
|
|
22
|
+
declare type SpsFormForwardRefExoticComponent = React.ForwardRefExoticComponent<SpsFormForwardRefType>;
|
|
23
|
+
export declare const SpsForm: SpsFormForwardRefExoticComponent;
|
|
24
|
+
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export declare const SpsFormExamples: {
|
|
2
|
-
a_basic: {
|
|
3
|
-
label: string;
|
|
4
|
-
description: string;
|
|
5
|
-
examples: {
|
|
6
|
-
basic: {
|
|
7
|
-
react: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
b_array: {
|
|
12
|
-
label: string;
|
|
13
|
-
description: string;
|
|
14
|
-
examples: {
|
|
15
|
-
array: {
|
|
16
|
-
react: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
c_dynamic_group: {
|
|
21
|
-
label: string;
|
|
22
|
-
description: string;
|
|
23
|
-
examples: {
|
|
24
|
-
basic: {
|
|
25
|
-
react: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
1
|
+
export declare const SpsFormExamples: {
|
|
2
|
+
a_basic: {
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
examples: {
|
|
6
|
+
basic: {
|
|
7
|
+
react: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
b_array: {
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
examples: {
|
|
15
|
+
array: {
|
|
16
|
+
react: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
c_dynamic_group: {
|
|
21
|
+
label: string;
|
|
22
|
+
description: string;
|
|
23
|
+
examples: {
|
|
24
|
+
basic: {
|
|
25
|
+
react: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as PropTypes from
|
|
3
|
-
import { SpsFormControl } from
|
|
4
|
-
import { SpsFormMetaBase } from
|
|
5
|
-
declare const spsFormComponentWrapperPropTypes: {
|
|
6
|
-
focusInputOnClick: PropTypes.Requireable<boolean>;
|
|
7
|
-
formMeta: PropTypes.Requireable<SpsFormMetaBase<any>>;
|
|
8
|
-
formControl: PropTypes.Requireable<SpsFormControl<any>>;
|
|
9
|
-
inputRef: PropTypes.Requireable<React.MutableRefObject<HTMLInputElement | HTMLTextAreaElement>>;
|
|
10
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
11
|
-
className: PropTypes.Requireable<string>;
|
|
12
|
-
|
|
13
|
-
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
14
|
-
};
|
|
15
|
-
export declare type SpsFormComponentWrapperProps = PropTypes.InferProps<typeof spsFormComponentWrapperPropTypes> & React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
-
declare type SpsFormComponentWrapperForwardRefType = SpsFormComponentWrapperProps & React.RefAttributes<HTMLDivElement>;
|
|
17
|
-
declare type SpsFormComponentWrapperForwardRefExoticComponent = React.ForwardRefExoticComponent<SpsFormComponentWrapperForwardRefType>;
|
|
18
|
-
export declare const SpsFormComponentWrapper: SpsFormComponentWrapperForwardRefExoticComponent;
|
|
19
|
-
export {};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PropTypes from "../prop-types";
|
|
3
|
+
import type { SpsFormControl } from "./hooks/formControl";
|
|
4
|
+
import type { SpsFormMetaBase } from "./hooks/useSpsForm";
|
|
5
|
+
declare const spsFormComponentWrapperPropTypes: {
|
|
6
|
+
focusInputOnClick: PropTypes.Requireable<boolean>;
|
|
7
|
+
formMeta: PropTypes.Requireable<SpsFormMetaBase<any>>;
|
|
8
|
+
formControl: PropTypes.Requireable<SpsFormControl<any>>;
|
|
9
|
+
inputRef: PropTypes.Requireable<React.MutableRefObject<HTMLInputElement | HTMLTextAreaElement>>;
|
|
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 SpsFormComponentWrapperProps = PropTypes.InferProps<typeof spsFormComponentWrapperPropTypes> & React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
declare type SpsFormComponentWrapperForwardRefType = SpsFormComponentWrapperProps & React.RefAttributes<HTMLDivElement>;
|
|
17
|
+
declare type SpsFormComponentWrapperForwardRefExoticComponent = React.ForwardRefExoticComponent<SpsFormComponentWrapperForwardRefType>;
|
|
18
|
+
export declare const SpsFormComponentWrapper: SpsFormComponentWrapperForwardRefExoticComponent;
|
|
19
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { SpsValidator, SpsValidationErrors } from
|
|
2
|
-
export interface SpsAbstractControlConfig<T> {
|
|
3
|
-
validators?: SpsValidator<T
|
|
4
|
-
}
|
|
5
|
-
export interface SpsAbstractControl<T> extends SpsAbstractControlConfig<T> {
|
|
6
|
-
_type: string;
|
|
7
|
-
errors: SpsValidationErrors | null;
|
|
8
|
-
invalid: boolean;
|
|
9
|
-
setInitValue(newValue: T)
|
|
10
|
-
getValue()
|
|
11
|
-
setValue(newValue: T)
|
|
12
|
-
isValid()
|
|
13
|
-
hasError(errorKey: string)
|
|
14
|
-
isFocused()
|
|
15
|
-
focus()
|
|
16
|
-
blur()
|
|
17
|
-
onFocus
|
|
18
|
-
onBlur
|
|
19
|
-
isPristine()
|
|
20
|
-
markAsPristine()
|
|
21
|
-
markAsDirty()
|
|
22
|
-
reset(value?: T)
|
|
23
|
-
update()
|
|
24
|
-
}
|
|
1
|
+
import type { SpsValidator, SpsValidationErrors } from "../validation/types";
|
|
2
|
+
export interface SpsAbstractControlConfig<T> {
|
|
3
|
+
validators?: Array<SpsValidator<T>>;
|
|
4
|
+
}
|
|
5
|
+
export interface SpsAbstractControl<T> extends SpsAbstractControlConfig<T> {
|
|
6
|
+
_type: string;
|
|
7
|
+
errors: SpsValidationErrors | null;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
setInitValue: (newValue: T) => any;
|
|
10
|
+
getValue: () => T;
|
|
11
|
+
setValue: (newValue: T) => any;
|
|
12
|
+
isValid: () => boolean;
|
|
13
|
+
hasError: (errorKey: string) => boolean;
|
|
14
|
+
isFocused: () => boolean;
|
|
15
|
+
focus: () => any;
|
|
16
|
+
blur: () => any;
|
|
17
|
+
onFocus?: () => any;
|
|
18
|
+
onBlur?: () => any;
|
|
19
|
+
isPristine: () => boolean;
|
|
20
|
+
markAsPristine: () => any;
|
|
21
|
+
markAsDirty: () => any;
|
|
22
|
+
reset: (value?: T) => any;
|
|
23
|
+
update: () => any;
|
|
24
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SpsAbstractControl } from
|
|
2
|
-
export interface SpsControlSet extends SpsAbstractControl<any> {
|
|
3
|
-
members: any;
|
|
4
|
-
get<T extends SpsAbstractControl<any>>(path: PropertyKey | PropertyKey[])
|
|
5
|
-
update()
|
|
6
|
-
}
|
|
7
|
-
export declare function getMember<T extends SpsAbstractControl<any>>(controlSet: SpsControlSet, path: PropertyKey | PropertyKey[]): T;
|
|
1
|
+
import type { SpsAbstractControl } from "./SpsAbstractControl.interface";
|
|
2
|
+
export interface SpsControlSet extends SpsAbstractControl<any> {
|
|
3
|
+
members: any;
|
|
4
|
+
get: <T extends SpsAbstractControl<any>>(path: PropertyKey | PropertyKey[]) => T;
|
|
5
|
+
update: () => any;
|
|
6
|
+
}
|
|
7
|
+
export declare function getMember<T extends SpsAbstractControl<any>>(controlSet: SpsControlSet, path: PropertyKey | PropertyKey[]): T;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SpsAbstractControl, SpsAbstractControlConfig } from
|
|
2
|
-
import { SpsControlSet } from
|
|
3
|
-
export interface SpsFormArray<T> extends SpsControlSet {
|
|
4
|
-
members: Array<SpsAbstractControl<T>>;
|
|
5
|
-
length: number;
|
|
6
|
-
at(index: number)
|
|
7
|
-
push(control: SpsAbstractControl<T>)
|
|
8
|
-
insert(index: number, control: SpsAbstractControl<T>)
|
|
9
|
-
removeAt(index: number)
|
|
10
|
-
setControl(index: number, control: SpsAbstractControl<T>)
|
|
11
|
-
}
|
|
12
|
-
export declare function formArray<T>(members?: Array<SpsAbstractControl<T>>, config?: SpsAbstractControlConfig<T>): SpsFormArray<T>;
|
|
1
|
+
import type { SpsAbstractControl, SpsAbstractControlConfig } from "./SpsAbstractControl.interface";
|
|
2
|
+
import type { SpsControlSet } from "./SpsControlSet.interface";
|
|
3
|
+
export interface SpsFormArray<T> extends SpsControlSet {
|
|
4
|
+
members: Array<SpsAbstractControl<T>>;
|
|
5
|
+
length: number;
|
|
6
|
+
at: (index: number) => SpsAbstractControl<T>;
|
|
7
|
+
push: (control: SpsAbstractControl<T>) => any;
|
|
8
|
+
insert: (index: number, control: SpsAbstractControl<T>) => any;
|
|
9
|
+
removeAt: (index: number) => any;
|
|
10
|
+
setControl: (index: number, control: SpsAbstractControl<T>) => any;
|
|
11
|
+
}
|
|
12
|
+
export declare function formArray<T>(members?: Array<SpsAbstractControl<T>>, config?: SpsAbstractControlConfig<T>): SpsFormArray<T>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SpsAbstractControl, SpsAbstractControlConfig } from
|
|
2
|
-
export interface SpsFormControl<T> extends SpsAbstractControl<T> {
|
|
3
|
-
id: string;
|
|
4
|
-
value: T;
|
|
5
|
-
focused: boolean;
|
|
6
|
-
pristine: boolean;
|
|
7
|
-
isRequired: () => boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function formControl<T>(initValue?: T, config?: SpsAbstractControlConfig<T>): SpsFormControl<T>;
|
|
1
|
+
import type { SpsAbstractControl, SpsAbstractControlConfig } from "./SpsAbstractControl.interface";
|
|
2
|
+
export interface SpsFormControl<T> extends SpsAbstractControl<T> {
|
|
3
|
+
id: string;
|
|
4
|
+
value: T;
|
|
5
|
+
focused: boolean;
|
|
6
|
+
pristine: boolean;
|
|
7
|
+
isRequired: () => boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function formControl<T>(initValue?: T, config?: SpsAbstractControlConfig<T>): SpsFormControl<T>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { SpsAbstractControl, SpsAbstractControlConfig } from
|
|
2
|
-
import { SpsControlSet } from
|
|
3
|
-
export interface SpsFormGroup extends SpsControlSet {
|
|
4
|
-
members:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export declare function formGroup(members?: {
|
|
13
|
-
[key: string]: SpsAbstractControl<any>;
|
|
14
|
-
}, config?: SpsAbstractControlConfig<any>): SpsFormGroup;
|
|
1
|
+
import type { SpsAbstractControl, SpsAbstractControlConfig } from "./SpsAbstractControl.interface";
|
|
2
|
+
import type { SpsControlSet } from "./SpsControlSet.interface";
|
|
3
|
+
export interface SpsFormGroup extends SpsControlSet {
|
|
4
|
+
members: Record<string, SpsAbstractControl<any>>;
|
|
5
|
+
addControl: (name: string, control: SpsAbstractControl<any>) => any;
|
|
6
|
+
removeControl: (name: string) => any;
|
|
7
|
+
setControl: (name: string, control: SpsAbstractControl<any>) => any;
|
|
8
|
+
contains: (name: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function formGroup(members?: Record<string, SpsAbstractControl<any>>, config?: SpsAbstractControlConfig<any>): SpsFormGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SpsControlSet } from
|
|
2
|
-
export declare function useForm<T extends SpsControlSet>(controls: T, initValue?: any): T;
|
|
1
|
+
import type { SpsControlSet } from "./SpsControlSet.interface";
|
|
2
|
+
export declare function useForm<T extends SpsControlSet>(controls: T, initValue?: any): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useFormControlId(id: string, formControl?: any): {
|
|
2
|
-
wrapperId: string;
|
|
3
|
-
controlId: string;
|
|
4
|
-
};
|
|
1
|
+
export declare function useFormControlId(id: string, formControl?: any): {
|
|
2
|
+
wrapperId: string;
|
|
3
|
+
controlId: string;
|
|
4
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare function useServerSideValidation(formControl: SpsAbstractControl<any>, initialState?: SpsValidationStatus): (import("../validation/types").SpsValidationErrors | import("react").Dispatch<import("react").SetStateAction<import("../validation/types").SpsValidationErrors>>)[];
|
|
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>>)[];
|
|
@@ -1,76 +1,74 @@
|
|
|
1
|
-
import { SpsValidator, SpsValidationErrors } from
|
|
2
|
-
declare type PathComponent = string | number;
|
|
3
|
-
declare type Path =
|
|
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
|
-
constructor(path: Path, update: UpdateFn);
|
|
12
|
-
abstract isPristine(): boolean;
|
|
13
|
-
abstract markAsPristine(): SpsFormMetaBase<T>;
|
|
14
|
-
abstract markAsDirty(): SpsFormMetaBase<T>;
|
|
15
|
-
abstract isFocused(): boolean;
|
|
16
|
-
setValidators(newValidators: Array<SpsValidator<T>>): SpsFormMetaBase<T>;
|
|
17
|
-
validate(newValue: T): SpsFormMetaBase<T>;
|
|
18
|
-
isValid(): boolean;
|
|
19
|
-
isVisibilyInvalid(): boolean;
|
|
20
|
-
hasError(errorKey: string): any;
|
|
21
|
-
isRequired(): boolean;
|
|
22
|
-
onFocus(): void;
|
|
23
|
-
onBlur(): void;
|
|
24
|
-
}
|
|
25
|
-
export declare class SpsFormFieldMeta<T> extends SpsFormMetaBase<T> {
|
|
26
|
-
id: string;
|
|
27
|
-
focused: boolean;
|
|
28
|
-
pristine: boolean;
|
|
29
|
-
setValue(newValue: T): void;
|
|
30
|
-
isPristine(): boolean;
|
|
31
|
-
markAsPristine(): SpsFormFieldMeta<T>;
|
|
32
|
-
markAsDirty(): SpsFormFieldMeta<T>;
|
|
33
|
-
isFocused(): boolean;
|
|
34
|
-
markAsFocused(): SpsFormFieldMeta<T>;
|
|
35
|
-
markAsBlurred(): SpsFormFieldMeta<T>;
|
|
36
|
-
}
|
|
37
|
-
export declare type InferredSpsFormMeta<T> = SpsFormMetaBase<T> & (T extends
|
|
38
|
-
export declare type SpsFormSetMembers<T> = {
|
|
39
|
-
[K in keyof T]?: SpsFormMetaBase<any>;
|
|
40
|
-
};
|
|
41
|
-
export declare type InferredSpsFormMetaSetMembers<T> = SpsFormSetMembers<T> & {
|
|
42
|
-
[K in keyof T]: InferredSpsFormMeta<T[K]>;
|
|
43
|
-
};
|
|
44
|
-
export declare type SpsFormSetValue =
|
|
45
|
-
export declare abstract class SpsFormSetMeta<T extends SpsFormSetValue, U extends SpsFormSetMembers<T> = InferredSpsFormMetaSetMembers<T>> extends SpsFormFieldMeta<T> {
|
|
46
|
-
fields: U;
|
|
47
|
-
constructor(path: Path, update: UpdateFn);
|
|
48
|
-
constructor(inferMembersFromValue: T, path: Path, update: UpdateFn);
|
|
49
|
-
protected abstract inferMembers(inferFromValue: T): any;
|
|
50
|
-
protected inferSpsControl(valueOrControl: any, key: PathComponent): SpsFormMetaBase<any>;
|
|
51
|
-
private rollup;
|
|
52
|
-
isFocused(): boolean;
|
|
53
|
-
isValid(): boolean;
|
|
54
|
-
contentsAreValid(): boolean;
|
|
55
|
-
isPristine(): boolean;
|
|
56
|
-
markAsPristine(): this;
|
|
57
|
-
markAsDirty(): this;
|
|
58
|
-
markAsBlurred(): this;
|
|
59
|
-
}
|
|
60
|
-
export declare class SpsFormGroupMeta<T extends object> extends SpsFormSetMeta<T> {
|
|
61
|
-
protected inferMembers(inferFromValue: T): void;
|
|
62
|
-
}
|
|
63
|
-
export declare class SpsFormArrayMeta<T extends
|
|
64
|
-
protected inferMembers(inferFromValue: T): void;
|
|
65
|
-
}
|
|
66
|
-
export interface SpsFormState<T extends SpsFormSetValue> {
|
|
67
|
-
formValue: T;
|
|
68
|
-
formMeta: SpsFormSetMeta<T>;
|
|
69
|
-
updateForm: (newValue?: T) => void;
|
|
70
|
-
}
|
|
71
|
-
export declare type SpsValidatorMapValue = Array<SpsValidator<any>> | ((value: any) => Array<SpsValidator<any>>);
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
export declare function useSpsForm<T extends SpsFormSetValue>(value: T, validatorMap?: SpsValidatorMap): SpsFormState<T>;
|
|
76
|
-
export {};
|
|
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
|
+
constructor(path: Path, update: UpdateFn);
|
|
12
|
+
abstract isPristine(): boolean;
|
|
13
|
+
abstract markAsPristine(): SpsFormMetaBase<T>;
|
|
14
|
+
abstract markAsDirty(): SpsFormMetaBase<T>;
|
|
15
|
+
abstract isFocused(): boolean;
|
|
16
|
+
setValidators(newValidators: Array<SpsValidator<T>>): SpsFormMetaBase<T>;
|
|
17
|
+
validate(newValue: T): SpsFormMetaBase<T>;
|
|
18
|
+
isValid(): boolean;
|
|
19
|
+
isVisibilyInvalid(): boolean;
|
|
20
|
+
hasError(errorKey: string): any;
|
|
21
|
+
isRequired(): boolean;
|
|
22
|
+
onFocus(): void;
|
|
23
|
+
onBlur(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare class SpsFormFieldMeta<T> extends SpsFormMetaBase<T> {
|
|
26
|
+
id: string;
|
|
27
|
+
focused: boolean;
|
|
28
|
+
pristine: boolean;
|
|
29
|
+
setValue(newValue: T): void;
|
|
30
|
+
isPristine(): boolean;
|
|
31
|
+
markAsPristine(): SpsFormFieldMeta<T>;
|
|
32
|
+
markAsDirty(): SpsFormFieldMeta<T>;
|
|
33
|
+
isFocused(): boolean;
|
|
34
|
+
markAsFocused(): SpsFormFieldMeta<T>;
|
|
35
|
+
markAsBlurred(): SpsFormFieldMeta<T>;
|
|
36
|
+
}
|
|
37
|
+
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 (infer V | undefined) ? SpsFormFieldMeta<V> | undefined : SpsFormFieldMeta<T>);
|
|
38
|
+
export declare type SpsFormSetMembers<T> = {
|
|
39
|
+
[K in keyof T]?: SpsFormMetaBase<any>;
|
|
40
|
+
};
|
|
41
|
+
export declare type InferredSpsFormMetaSetMembers<T> = SpsFormSetMembers<T> & {
|
|
42
|
+
[K in keyof T]: InferredSpsFormMeta<T[K]>;
|
|
43
|
+
};
|
|
44
|
+
export declare type SpsFormSetValue = any[] | object;
|
|
45
|
+
export declare abstract class SpsFormSetMeta<T extends SpsFormSetValue, U extends SpsFormSetMembers<T> = InferredSpsFormMetaSetMembers<T>> extends SpsFormFieldMeta<T> {
|
|
46
|
+
fields: U;
|
|
47
|
+
constructor(path: Path, update: UpdateFn);
|
|
48
|
+
constructor(inferMembersFromValue: T, path: Path, update: UpdateFn);
|
|
49
|
+
protected abstract inferMembers(inferFromValue: T): any;
|
|
50
|
+
protected inferSpsControl(valueOrControl: any, key: PathComponent): SpsFormMetaBase<any>;
|
|
51
|
+
private rollup;
|
|
52
|
+
isFocused(): boolean;
|
|
53
|
+
isValid(): boolean;
|
|
54
|
+
contentsAreValid(): boolean;
|
|
55
|
+
isPristine(): boolean;
|
|
56
|
+
markAsPristine(): this;
|
|
57
|
+
markAsDirty(): this;
|
|
58
|
+
markAsBlurred(): this;
|
|
59
|
+
}
|
|
60
|
+
export declare class SpsFormGroupMeta<T extends object> extends SpsFormSetMeta<T> {
|
|
61
|
+
protected inferMembers(inferFromValue: T): void;
|
|
62
|
+
}
|
|
63
|
+
export declare class SpsFormArrayMeta<T extends any[]> extends SpsFormSetMeta<T> {
|
|
64
|
+
protected inferMembers(inferFromValue: T): void;
|
|
65
|
+
}
|
|
66
|
+
export interface SpsFormState<T extends SpsFormSetValue> {
|
|
67
|
+
formValue: T;
|
|
68
|
+
formMeta: SpsFormSetMeta<T>;
|
|
69
|
+
updateForm: (newValue?: T) => void;
|
|
70
|
+
}
|
|
71
|
+
export declare type SpsValidatorMapValue = Array<SpsValidator<any>> | ((value: any) => Array<SpsValidator<any>>);
|
|
72
|
+
export declare type SpsValidatorMap = Record<string, SpsValidatorMapValue>;
|
|
73
|
+
export declare function useSpsForm<T extends SpsFormSetValue>(value: T, validatorMap?: SpsValidatorMap): SpsFormState<T>;
|
|
74
|
+
export {};
|
package/lib/form/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export { SpsForm } from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export { SpsFormComponentWrapper } from
|
|
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";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { SpsValidator, SpsValidatorFactory } from
|
|
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
|
-
}>;
|
|
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
|
+
}>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
export declare type SpsValidator<T> = (value: T) => SpsValidationStatus;
|
|
8
|
-
export declare type SpsValidatorFactory<T> = (...args: any[]) => SpsValidator<T>;
|
|
9
|
-
export declare const OnBlurErrorKeys: Set<string>;
|
|
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>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SpsValidationErrors, SpsValidator } from
|
|
2
|
-
export declare function validate<T>(value: T, validators?: SpsValidator<T
|
|
1
|
+
import type { SpsValidationErrors, SpsValidator } from "./types";
|
|
2
|
+
export declare function validate<T>(value: T, validators?: Array<SpsValidator<T>>): SpsValidationErrors | null;
|