@lablup/ui-common 0.1.0-alpha.8 → 0.2.0-alpha.15
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/NOTICE +62 -0
- package/README.md +490 -68
- package/astryx/components/AlertModal.doc.mjs +91 -0
- package/astryx/components/AlertModal.tsx +3 -0
- package/astryx/components/BoardItemTitle.doc.mjs +51 -0
- package/astryx/components/BoardItemTitle.tsx +3 -0
- package/astryx/components/BooleanToken.doc.mjs +57 -0
- package/astryx/components/BooleanToken.tsx +3 -0
- package/astryx/components/BulkEditFormItem.doc.mjs +68 -0
- package/astryx/components/BulkEditFormItem.tsx +3 -0
- package/astryx/components/BulkErrorModal.doc.mjs +75 -0
- package/astryx/components/BulkErrorModal.tsx +3 -0
- package/astryx/components/ColorPicker.doc.mjs +88 -0
- package/astryx/components/ColorPicker.tsx +3 -0
- package/astryx/components/ConfirmPopover.doc.mjs +99 -0
- package/astryx/components/ConfirmPopover.tsx +3 -0
- package/astryx/components/CountBadge.doc.mjs +93 -0
- package/astryx/components/CountBadge.tsx +3 -0
- package/astryx/components/CountdownBorder.doc.mjs +57 -0
- package/astryx/components/CountdownBorder.tsx +3 -0
- package/astryx/components/DataGrid.doc.mjs +166 -0
- package/astryx/components/DataGrid.tsx +3 -0
- package/astryx/components/DeleteConfirmModal.doc.mjs +163 -0
- package/astryx/components/DeleteConfirmModal.tsx +3 -0
- package/astryx/components/DividedRow.doc.mjs +85 -0
- package/astryx/components/DividedRow.tsx +3 -0
- package/astryx/components/DoubleBadge.doc.mjs +40 -0
- package/astryx/components/DoubleBadge.tsx +3 -0
- package/astryx/components/DoubleToken.doc.mjs +38 -0
- package/astryx/components/DoubleToken.tsx +3 -0
- package/astryx/components/Form.doc.mjs +113 -0
- package/astryx/components/Form.tsx +3 -0
- package/astryx/components/IconWithTooltip.doc.mjs +57 -0
- package/astryx/components/IconWithTooltip.tsx +3 -0
- package/astryx/components/ImageWithFallback.doc.mjs +47 -0
- package/astryx/components/ImageWithFallback.tsx +3 -0
- package/astryx/components/ListBanner.doc.mjs +50 -0
- package/astryx/components/ListBanner.tsx +3 -0
- package/astryx/components/Modal.doc.mjs +176 -0
- package/astryx/components/Modal.tsx +3 -0
- package/astryx/components/NotificationItem.doc.mjs +52 -0
- package/astryx/components/NotificationItem.tsx +3 -0
- package/astryx/components/NotificationStack.doc.mjs +66 -0
- package/astryx/components/NotificationStack.tsx +3 -0
- package/astryx/components/OverlayScrollbar.doc.mjs +49 -0
- package/astryx/components/OverlayScrollbar.tsx +3 -0
- package/astryx/components/PageHeader.doc.mjs +94 -0
- package/astryx/components/PageHeader.tsx +3 -0
- package/astryx/components/PagedSelector.doc.mjs +183 -0
- package/astryx/components/PagedSelector.tsx +3 -0
- package/astryx/components/ProgressWithLabel.doc.mjs +69 -0
- package/astryx/components/ProgressWithLabel.tsx +3 -0
- package/astryx/components/SelectionLabel.doc.mjs +55 -0
- package/astryx/components/SelectionLabel.tsx +3 -0
- package/astryx/components/Statistic.doc.mjs +84 -0
- package/astryx/components/Statistic.tsx +3 -0
- package/astryx/components/StepNumberInput.doc.mjs +102 -0
- package/astryx/components/StepNumberInput.tsx +3 -0
- package/astryx/components/TextHighlighter.doc.mjs +47 -0
- package/astryx/components/TextHighlighter.tsx +3 -0
- package/astryx/components/TokenList.doc.mjs +58 -0
- package/astryx/components/TokenList.tsx +3 -0
- package/astryx/components/TokenRow.doc.mjs +62 -0
- package/astryx/components/TokenRow.tsx +3 -0
- package/astryx/components/UncontrolledInput.doc.mjs +68 -0
- package/astryx/components/UncontrolledInput.tsx +3 -0
- package/astryx/components/UnitGrid.doc.mjs +107 -0
- package/astryx/components/UnitGrid.tsx +3 -0
- package/astryx/docs/ui-common.doc.mjs +112 -0
- package/astryx.integration.mjs +35 -0
- package/dist/assets/components/BoardItemTitle/BoardItemTitle.css +2 -0
- package/dist/assets/components/BulkErrorModal/BulkErrorModal.css +2 -0
- package/dist/assets/components/ColorPicker/ColorPicker.css +2 -0
- package/dist/assets/components/CountBadge/CountBadge.css +2 -0
- package/dist/assets/components/CountdownBorder/CountdownBorder.css +2 -0
- package/dist/assets/components/DataGrid/DataGrid.css +2 -0
- package/dist/assets/components/DeleteConfirmModal/DeleteConfirmModal.css +2 -0
- package/dist/assets/components/DigitPopIn/DigitPopIn.css +2 -0
- package/dist/assets/components/DividedRow/DividedRow.css +2 -0
- package/dist/assets/components/DoubleBadge/DoubleBadge.css +2 -0
- package/dist/assets/components/DoubleToken/DoubleToken.css +2 -0
- package/dist/assets/components/ErrorState/ErrorState.css +2 -1
- package/dist/assets/components/Form/FormItemVisual.css +2 -0
- package/dist/assets/components/IconWithTooltip/IconWithTooltip.css +2 -0
- package/dist/assets/components/ImageWithFallback/ImageWithFallback.css +2 -0
- package/dist/assets/components/ListBanner/ListBanner.css +2 -0
- package/dist/assets/components/Modal/Modal.css +2 -0
- package/dist/assets/components/NotificationItem/NotificationItem.css +2 -0
- package/dist/assets/components/NotificationStack/NotificationStack.css +2 -0
- package/dist/assets/components/OverlayScrollbar/OverlayScrollbar.css +2 -0
- package/dist/assets/components/PageHeader/PageHeader.css +2 -1
- package/dist/assets/components/PageLayout/PageLayout.css +2 -1
- package/dist/assets/components/PagedSelector/PagedSelector.css +2 -0
- package/dist/assets/components/ProgressWithLabel/ProgressWithLabel.css +2 -0
- package/dist/assets/components/Skeleton/SkeletonCard.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonChart.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonRow.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonShape.css +2 -0
- package/dist/assets/components/Skeleton/SkeletonText.css +2 -1
- package/dist/assets/components/SmoothHeight/SmoothHeight.css +2 -1
- package/dist/assets/components/StatCard/StatCard.css +2 -1
- package/dist/assets/components/Statistic/Statistic.css +2 -0
- package/dist/assets/components/StepNumberInput/NumberStepper.css +2 -0
- package/dist/assets/components/TextHighlighter/TextHighlighter.css +2 -0
- package/dist/assets/components/TokenList/TokenList.css +2 -0
- package/dist/assets/components/TokenRow/TokenRow.css +2 -0
- package/dist/assets/components/UnitGrid/UnitGrid.css +2 -0
- package/dist/astryx/AppShell.d.ts +1 -0
- package/dist/astryx/AppShell.js +1 -0
- package/dist/astryx/AspectRatio.d.ts +1 -0
- package/dist/astryx/AspectRatio.js +1 -0
- package/dist/astryx/Avatar.d.ts +1 -0
- package/dist/astryx/Avatar.js +1 -0
- package/dist/astryx/AvatarGroup.d.ts +1 -0
- package/dist/astryx/AvatarGroup.js +1 -0
- package/dist/astryx/Badge.d.ts +1 -0
- package/dist/astryx/Badge.js +1 -0
- package/dist/astryx/Banner.d.ts +1 -0
- package/dist/astryx/Banner.js +1 -0
- package/dist/astryx/BaseProps.d.ts +1 -0
- package/dist/astryx/BaseProps.js +1 -0
- package/dist/astryx/Blockquote.d.ts +1 -0
- package/dist/astryx/Blockquote.js +1 -0
- package/dist/astryx/BottomSheet.d.ts +1 -0
- package/dist/astryx/BottomSheet.js +1 -0
- package/dist/astryx/Breadcrumbs.d.ts +1 -0
- package/dist/astryx/Breadcrumbs.js +1 -0
- package/dist/astryx/Button.d.ts +1 -0
- package/dist/astryx/Button.js +1 -0
- package/dist/astryx/ButtonGroup.d.ts +1 -0
- package/dist/astryx/ButtonGroup.js +1 -0
- package/dist/astryx/Calendar/utils.d.ts +1 -0
- package/dist/astryx/Calendar/utils.js +1 -0
- package/dist/astryx/Calendar.d.ts +1 -0
- package/dist/astryx/Calendar.js +1 -0
- package/dist/astryx/Card.d.ts +1 -0
- package/dist/astryx/Card.js +1 -0
- package/dist/astryx/Carousel.d.ts +1 -0
- package/dist/astryx/Carousel.js +1 -0
- package/dist/astryx/Center.d.ts +1 -0
- package/dist/astryx/Center.js +1 -0
- package/dist/astryx/Chat.d.ts +1 -0
- package/dist/astryx/Chat.js +1 -0
- package/dist/astryx/CheckboxInput.d.ts +1 -0
- package/dist/astryx/CheckboxInput.js +1 -0
- package/dist/astryx/CheckboxList.d.ts +1 -0
- package/dist/astryx/CheckboxList.js +1 -0
- package/dist/astryx/Citation.d.ts +1 -0
- package/dist/astryx/Citation.js +1 -0
- package/dist/astryx/ClickableCard.d.ts +1 -0
- package/dist/astryx/ClickableCard.js +1 -0
- package/dist/astryx/Code.d.ts +1 -0
- package/dist/astryx/Code.js +1 -0
- package/dist/astryx/CodeBlock.d.ts +1 -0
- package/dist/astryx/CodeBlock.js +1 -0
- package/dist/astryx/Collapsible.d.ts +1 -0
- package/dist/astryx/Collapsible.js +1 -0
- package/dist/astryx/CommandPalette.d.ts +1 -0
- package/dist/astryx/CommandPalette.js +1 -0
- package/dist/astryx/ContextMenu.d.ts +1 -0
- package/dist/astryx/ContextMenu.js +1 -0
- package/dist/astryx/DateInput.d.ts +1 -0
- package/dist/astryx/DateInput.js +1 -0
- package/dist/astryx/DateRangeInput.d.ts +1 -0
- package/dist/astryx/DateRangeInput.js +1 -0
- package/dist/astryx/DateTimeInput.d.ts +1 -0
- package/dist/astryx/DateTimeInput.js +1 -0
- package/dist/astryx/Divider.d.ts +1 -0
- package/dist/astryx/Divider.js +1 -0
- package/dist/astryx/DropdownMenu.d.ts +1 -0
- package/dist/astryx/DropdownMenu.js +1 -0
- package/dist/astryx/EmptyState.d.ts +1 -0
- package/dist/astryx/EmptyState.js +1 -0
- package/dist/astryx/Field.d.ts +1 -0
- package/dist/astryx/Field.js +1 -0
- package/dist/astryx/FieldStatus.d.ts +1 -0
- package/dist/astryx/FieldStatus.js +1 -0
- package/dist/astryx/FileInput.d.ts +1 -0
- package/dist/astryx/FileInput.js +1 -0
- package/dist/astryx/FormLayout.d.ts +1 -0
- package/dist/astryx/FormLayout.js +1 -0
- package/dist/astryx/Grid.d.ts +1 -0
- package/dist/astryx/Grid.js +1 -0
- package/dist/astryx/HStack.d.ts +1 -0
- package/dist/astryx/HStack.js +1 -0
- package/dist/astryx/Heading.d.ts +1 -0
- package/dist/astryx/Heading.js +1 -0
- package/dist/astryx/HoverCard.d.ts +1 -0
- package/dist/astryx/HoverCard.js +1 -0
- package/dist/astryx/Icon.d.ts +1 -0
- package/dist/astryx/Icon.js +1 -0
- package/dist/astryx/IconButton.d.ts +1 -0
- package/dist/astryx/IconButton.js +1 -0
- package/dist/astryx/Indicator.d.ts +1 -0
- package/dist/astryx/Indicator.js +1 -0
- package/dist/astryx/InputGroup.d.ts +1 -0
- package/dist/astryx/InputGroup.js +1 -0
- package/dist/astryx/InteractiveRoleContext.d.ts +1 -0
- package/dist/astryx/InteractiveRoleContext.js +1 -0
- package/dist/astryx/Item.d.ts +1 -0
- package/dist/astryx/Item.js +1 -0
- package/dist/astryx/Kbd.d.ts +1 -0
- package/dist/astryx/Kbd.js +1 -0
- package/dist/astryx/Layer.d.ts +1 -0
- package/dist/astryx/Layer.js +1 -0
- package/dist/astryx/Layout.d.ts +1 -0
- package/dist/astryx/Layout.js +1 -0
- package/dist/astryx/Lightbox.d.ts +1 -0
- package/dist/astryx/Lightbox.js +1 -0
- package/dist/astryx/Link.d.ts +1 -0
- package/dist/astryx/Link.js +1 -0
- package/dist/astryx/List.d.ts +1 -0
- package/dist/astryx/List.js +1 -0
- package/dist/astryx/Markdown/utils.d.ts +1 -0
- package/dist/astryx/Markdown/utils.js +1 -0
- package/dist/astryx/Markdown.d.ts +1 -0
- package/dist/astryx/Markdown.js +1 -0
- package/dist/astryx/MetadataList.d.ts +1 -0
- package/dist/astryx/MetadataList.js +1 -0
- package/dist/astryx/MobileNav.d.ts +1 -0
- package/dist/astryx/MobileNav.js +1 -0
- package/dist/astryx/MoreMenu.d.ts +1 -0
- package/dist/astryx/MoreMenu.js +1 -0
- package/dist/astryx/MultiSelector.d.ts +1 -0
- package/dist/astryx/MultiSelector.js +1 -0
- package/dist/astryx/NavIcon.d.ts +1 -0
- package/dist/astryx/NavIcon.js +1 -0
- package/dist/astryx/NavMenu.d.ts +1 -0
- package/dist/astryx/NavMenu.js +1 -0
- package/dist/astryx/NumberInput.d.ts +1 -0
- package/dist/astryx/NumberInput.js +1 -0
- package/dist/astryx/Outline.d.ts +1 -0
- package/dist/astryx/Outline.js +1 -0
- package/dist/astryx/OverflowList.d.ts +1 -0
- package/dist/astryx/OverflowList.js +1 -0
- package/dist/astryx/Overlay.d.ts +1 -0
- package/dist/astryx/Overlay.js +1 -0
- package/dist/astryx/Pagination.d.ts +1 -0
- package/dist/astryx/Pagination.js +1 -0
- package/dist/astryx/Popover.d.ts +1 -0
- package/dist/astryx/Popover.js +1 -0
- package/dist/astryx/PowerSearch/utils.d.ts +1 -0
- package/dist/astryx/PowerSearch/utils.js +1 -0
- package/dist/astryx/PowerSearch.d.ts +1 -0
- package/dist/astryx/PowerSearch.js +1 -0
- package/dist/astryx/ProgressBar.d.ts +1 -0
- package/dist/astryx/ProgressBar.js +1 -0
- package/dist/astryx/RadioList.d.ts +1 -0
- package/dist/astryx/RadioList.js +1 -0
- package/dist/astryx/Resizable/utils.d.ts +1 -0
- package/dist/astryx/Resizable/utils.js +1 -0
- package/dist/astryx/Resizable.d.ts +1 -0
- package/dist/astryx/Resizable.js +1 -0
- package/dist/astryx/ScrollableArea.d.ts +1 -0
- package/dist/astryx/ScrollableArea.js +1 -0
- package/dist/astryx/Section.d.ts +1 -0
- package/dist/astryx/Section.js +1 -0
- package/dist/astryx/SegmentedControl.d.ts +1 -0
- package/dist/astryx/SegmentedControl.js +1 -0
- package/dist/astryx/SelectableCard.d.ts +1 -0
- package/dist/astryx/SelectableCard.js +1 -0
- package/dist/astryx/Selector/utils.d.ts +1 -0
- package/dist/astryx/Selector/utils.js +1 -0
- package/dist/astryx/Selector.d.ts +1 -0
- package/dist/astryx/Selector.js +1 -0
- package/dist/astryx/SideNav.d.ts +1 -0
- package/dist/astryx/SideNav.js +1 -0
- package/dist/astryx/SizeContext.d.ts +1 -0
- package/dist/astryx/SizeContext.js +1 -0
- package/dist/astryx/Skeleton.d.ts +1 -0
- package/dist/astryx/Skeleton.js +1 -0
- package/dist/astryx/Slider.d.ts +1 -0
- package/dist/astryx/Slider.js +1 -0
- package/dist/astryx/Spinner.d.ts +1 -0
- package/dist/astryx/Spinner.js +1 -0
- package/dist/astryx/Stack.d.ts +1 -0
- package/dist/astryx/Stack.js +1 -0
- package/dist/astryx/StatusDot.d.ts +1 -0
- package/dist/astryx/StatusDot.js +1 -0
- package/dist/astryx/Stepper.d.ts +1 -0
- package/dist/astryx/Stepper.js +1 -0
- package/dist/astryx/Switch.d.ts +1 -0
- package/dist/astryx/Switch.js +1 -0
- package/dist/astryx/TabList.d.ts +1 -0
- package/dist/astryx/TabList.js +1 -0
- package/dist/astryx/Table/utils.d.ts +1 -0
- package/dist/astryx/Table/utils.js +1 -0
- package/dist/astryx/Table.d.ts +1 -0
- package/dist/astryx/Table.js +1 -0
- package/dist/astryx/Text.d.ts +1 -0
- package/dist/astryx/Text.js +1 -0
- package/dist/astryx/TextArea.d.ts +1 -0
- package/dist/astryx/TextArea.js +1 -0
- package/dist/astryx/TextInput.d.ts +1 -0
- package/dist/astryx/TextInput.js +1 -0
- package/dist/astryx/Thumbnail.d.ts +1 -0
- package/dist/astryx/Thumbnail.js +1 -0
- package/dist/astryx/TimeInput.d.ts +1 -0
- package/dist/astryx/TimeInput.js +1 -0
- package/dist/astryx/Timestamp.d.ts +1 -0
- package/dist/astryx/Timestamp.js +1 -0
- package/dist/astryx/Toast.d.ts +1 -0
- package/dist/astryx/Toast.js +1 -0
- package/dist/astryx/ToggleButton.d.ts +1 -0
- package/dist/astryx/ToggleButton.js +1 -0
- package/dist/astryx/Token.d.ts +1 -0
- package/dist/astryx/Token.js +1 -0
- package/dist/astryx/Tokenizer.d.ts +1 -0
- package/dist/astryx/Tokenizer.js +1 -0
- package/dist/astryx/Toolbar.d.ts +1 -0
- package/dist/astryx/Toolbar.js +1 -0
- package/dist/astryx/Tooltip.d.ts +1 -0
- package/dist/astryx/Tooltip.js +1 -0
- package/dist/astryx/TopNav.d.ts +1 -0
- package/dist/astryx/TopNav.js +1 -0
- package/dist/astryx/TreeList.d.ts +1 -0
- package/dist/astryx/TreeList.js +1 -0
- package/dist/astryx/Typeahead/utils.d.ts +1 -0
- package/dist/astryx/Typeahead/utils.js +1 -0
- package/dist/astryx/Typeahead.d.ts +1 -0
- package/dist/astryx/Typeahead.js +1 -0
- package/dist/astryx/VStack.d.ts +1 -0
- package/dist/astryx/VStack.js +1 -0
- package/dist/astryx/VisuallyHidden.d.ts +1 -0
- package/dist/astryx/VisuallyHidden.js +1 -0
- package/dist/astryx/astryx.css +3 -0
- package/dist/astryx/hooks.d.ts +1 -0
- package/dist/astryx/hooks.js +1 -0
- package/dist/astryx/i18n.d.ts +1 -0
- package/dist/astryx/i18n.js +1 -0
- package/dist/astryx/lab/lab.css +3 -0
- package/dist/astryx/lab.d.ts +6 -0
- package/dist/astryx/lab.js +6 -0
- package/dist/astryx/naming.d.ts +1 -0
- package/dist/astryx/naming.js +1 -0
- package/dist/astryx/reset.css +3 -0
- package/dist/astryx/tailwind-theme.css +3 -0
- package/dist/astryx/theme/neutral/built.d.ts +1 -0
- package/dist/astryx/theme/neutral/built.js +1 -0
- package/dist/astryx/theme/neutral/theme.css +3 -0
- package/dist/astryx/theme/neutral.d.ts +1 -0
- package/dist/astryx/theme/neutral.js +1 -0
- package/dist/astryx/theme/syntax.d.ts +1 -0
- package/dist/astryx/theme/syntax.js +1 -0
- package/dist/astryx/theme/tokens.d.ts +1 -0
- package/dist/astryx/theme/tokens.js +1 -0
- package/dist/astryx/theme/tokens.stylex.d.ts +1 -0
- package/dist/astryx/theme/tokens.stylex.js +1 -0
- package/dist/astryx/theme.d.ts +1 -0
- package/dist/astryx/theme.js +1 -0
- package/dist/astryx/utils.d.ts +1 -0
- package/dist/astryx/utils.js +1 -0
- package/dist/components/AlertModal/AlertModal.d.ts +14 -0
- package/dist/components/AlertModal/AlertModal.js +56 -0
- package/dist/components/AlertModal/AlertModal.js.map +1 -0
- package/dist/components/AlertModal/index.d.ts +2 -0
- package/dist/components/AlertModal/index.js +2 -0
- package/dist/components/BoardItemTitle/BoardItemTitle.d.ts +15 -0
- package/dist/components/BoardItemTitle/BoardItemTitle2.js +42 -0
- package/dist/components/BoardItemTitle/BoardItemTitle2.js.map +1 -0
- package/dist/components/BoardItemTitle/index.d.ts +2 -0
- package/dist/components/BoardItemTitle/index.js +2 -0
- package/dist/components/BooleanToken/BooleanToken.d.ts +15 -0
- package/dist/components/BooleanToken/BooleanToken.js +19 -0
- package/dist/components/BooleanToken/BooleanToken.js.map +1 -0
- package/dist/components/BooleanToken/BooleanToken.messages.d.ts +10 -0
- package/dist/components/BooleanToken/BooleanToken.messages.js +16 -0
- package/dist/components/BooleanToken/BooleanToken.messages.js.map +1 -0
- package/dist/components/BooleanToken/index.d.ts +2 -0
- package/dist/components/BooleanToken/index.js +2 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.d.ts +24 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.js +93 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.js.map +1 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.d.ts +14 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js +20 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js.map +1 -0
- package/dist/components/BulkEditFormItem/index.d.ts +2 -0
- package/dist/components/BulkEditFormItem/index.js +2 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.d.ts +23 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.d.ts +10 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.js +16 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.js.map +1 -0
- package/dist/components/BulkErrorModal/BulkErrorModal2.js +55 -0
- package/dist/components/BulkErrorModal/BulkErrorModal2.js.map +1 -0
- package/dist/components/BulkErrorModal/index.d.ts +2 -0
- package/dist/components/BulkErrorModal/index.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +43 -0
- package/dist/components/ColorPicker/ColorPicker.messages.d.ts +18 -0
- package/dist/components/ColorPicker/ColorPicker.messages.js +24 -0
- package/dist/components/ColorPicker/ColorPicker.messages.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker2.js +117 -0
- package/dist/components/ColorPicker/ColorPicker2.js.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/ColorPicker/index.js +2 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.d.ts +35 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.js +75 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.js.map +1 -0
- package/dist/components/ConfirmPopover/index.d.ts +2 -0
- package/dist/components/ConfirmPopover/index.js +2 -0
- package/dist/components/CountBadge/CountBadge.d.ts +24 -0
- package/dist/components/CountBadge/CountBadge2.js +35 -0
- package/dist/components/CountBadge/CountBadge2.js.map +1 -0
- package/dist/components/CountBadge/index.d.ts +2 -0
- package/dist/components/CountBadge/index.js +2 -0
- package/dist/components/CountdownBorder/CountdownBorder.d.ts +22 -0
- package/dist/components/CountdownBorder/CountdownBorder2.js +63 -0
- package/dist/components/CountdownBorder/CountdownBorder2.js.map +1 -0
- package/dist/components/CountdownBorder/index.d.ts +2 -0
- package/dist/components/CountdownBorder/index.js +2 -0
- package/dist/components/DataGrid/DataGrid.d.ts +212 -0
- package/dist/components/DataGrid/DataGrid.messages.d.ts +70 -0
- package/dist/components/DataGrid/DataGrid.messages.js +76 -0
- package/dist/components/DataGrid/DataGrid.messages.js.map +1 -0
- package/dist/components/DataGrid/DataGrid2.js +447 -0
- package/dist/components/DataGrid/DataGrid2.js.map +1 -0
- package/dist/components/DataGrid/DataGridExportModal.d.ts +30 -0
- package/dist/components/DataGrid/DataGridExportModal.js +125 -0
- package/dist/components/DataGrid/DataGridExportModal.js.map +1 -0
- package/dist/components/DataGrid/DataGridSettingsModal.d.ts +36 -0
- package/dist/components/DataGrid/DataGridSettingsModal.js +177 -0
- package/dist/components/DataGrid/DataGridSettingsModal.js.map +1 -0
- package/dist/components/DataGrid/index.d.ts +6 -0
- package/dist/components/DataGrid/index.js +4 -0
- package/dist/components/DataGrid/nodeToPlainText.d.ts +6 -0
- package/dist/components/DataGrid/nodeToPlainText.js +9 -0
- package/dist/components/DataGrid/nodeToPlainText.js.map +1 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.d.ts +78 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.d.ts +30 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js +36 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js.map +1 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js +102 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js.map +1 -0
- package/dist/components/DeleteConfirmModal/index.d.ts +2 -0
- package/dist/components/DeleteConfirmModal/index.js +2 -0
- package/dist/components/DigitPopIn/DigitPopIn.d.ts +8 -0
- package/dist/components/DigitPopIn/DigitPopIn2.js +30 -0
- package/dist/components/DigitPopIn/DigitPopIn2.js.map +1 -0
- package/dist/components/DigitPopIn/index.d.ts +2 -0
- package/dist/components/DigitPopIn/index.js +2 -0
- package/dist/components/DividedRow/DividedRow.d.ts +27 -0
- package/dist/components/DividedRow/DividedRow2.js +63 -0
- package/dist/components/DividedRow/DividedRow2.js.map +1 -0
- package/dist/components/DividedRow/index.d.ts +2 -0
- package/dist/components/DividedRow/index.js +2 -0
- package/dist/components/DoubleBadge/DoubleBadge.d.ts +14 -0
- package/dist/components/DoubleBadge/DoubleBadge2.js +28 -0
- package/dist/components/DoubleBadge/DoubleBadge2.js.map +1 -0
- package/dist/components/DoubleBadge/index.d.ts +2 -0
- package/dist/components/DoubleBadge/index.js +2 -0
- package/dist/components/DoubleToken/DoubleToken.d.ts +24 -0
- package/dist/components/DoubleToken/DoubleToken2.js +38 -0
- package/dist/components/DoubleToken/DoubleToken2.js.map +1 -0
- package/dist/components/DoubleToken/index.d.ts +2 -0
- package/dist/components/DoubleToken/index.js +2 -0
- package/dist/components/ErrorState/ErrorState.d.ts +7 -16
- package/dist/components/ErrorState/ErrorState2.js +33 -33
- package/dist/components/ErrorState/ErrorState2.js.map +1 -1
- package/dist/components/Form/ErrorList.d.ts +13 -0
- package/dist/components/Form/ErrorList.js +21 -0
- package/dist/components/Form/ErrorList.js.map +1 -0
- package/dist/components/Form/Field.d.ts +88 -0
- package/dist/components/Form/Field.js +212 -0
- package/dist/components/Form/Field.js.map +1 -0
- package/dist/components/Form/Form.d.ts +70 -0
- package/dist/components/Form/Form.js +130 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/Form.messages.d.ts +96 -0
- package/dist/components/Form/Form.messages.js +96 -0
- package/dist/components/Form/Form.messages.js.map +1 -0
- package/dist/components/Form/FormConfigProvider.d.ts +20 -0
- package/dist/components/Form/FormConfigProvider.js +31 -0
- package/dist/components/Form/FormConfigProvider.js.map +1 -0
- package/dist/components/Form/FormItem.d.ts +56 -0
- package/dist/components/Form/FormItem.js +164 -0
- package/dist/components/Form/FormItem.js.map +1 -0
- package/dist/components/Form/FormItemVisual.d.ts +56 -0
- package/dist/components/Form/FormItemVisual2.js +117 -0
- package/dist/components/Form/FormItemVisual2.js.map +1 -0
- package/dist/components/Form/FormStore.d.ts +109 -0
- package/dist/components/Form/FormStore.js +494 -0
- package/dist/components/Form/FormStore.js.map +1 -0
- package/dist/components/Form/List.d.ts +22 -0
- package/dist/components/Form/List.js +65 -0
- package/dist/components/Form/List.js.map +1 -0
- package/dist/components/Form/context.d.ts +91 -0
- package/dist/components/Form/context.js +34 -0
- package/dist/components/Form/context.js.map +1 -0
- package/dist/components/Form/feedbackIcons.d.ts +13 -0
- package/dist/components/Form/feedbackIcons.js +45 -0
- package/dist/components/Form/feedbackIcons.js.map +1 -0
- package/dist/components/Form/index.d.ts +30 -0
- package/dist/components/Form/index.js +18 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Form/interface.d.ts +212 -0
- package/dist/components/Form/isEqual.d.ts +1 -0
- package/dist/components/Form/isEqual.js +61 -0
- package/dist/components/Form/isEqual.js.map +1 -0
- package/dist/components/Form/messages.d.ts +15 -0
- package/dist/components/Form/messages.js +52 -0
- package/dist/components/Form/messages.js.map +1 -0
- package/dist/components/Form/namePath.d.ts +78 -0
- package/dist/components/Form/namePath.js +120 -0
- package/dist/components/Form/namePath.js.map +1 -0
- package/dist/components/Form/useWatch.d.ts +11 -0
- package/dist/components/Form/useWatch.js +43 -0
- package/dist/components/Form/useWatch.js.map +1 -0
- package/dist/components/Form/validate.d.ts +16 -0
- package/dist/components/Form/validate.js +214 -0
- package/dist/components/Form/validate.js.map +1 -0
- package/dist/components/IconWithTooltip/IconWithTooltip.d.ts +19 -0
- package/dist/components/IconWithTooltip/IconWithTooltip2.js +38 -0
- package/dist/components/IconWithTooltip/IconWithTooltip2.js.map +1 -0
- package/dist/components/IconWithTooltip/accessibleLabel.d.ts +2 -0
- package/dist/components/IconWithTooltip/accessibleLabel.js +33 -0
- package/dist/components/IconWithTooltip/accessibleLabel.js.map +1 -0
- package/dist/components/IconWithTooltip/index.d.ts +2 -0
- package/dist/components/IconWithTooltip/index.js +2 -0
- package/dist/components/ImageWithFallback/ImageWithFallback.d.ts +11 -0
- package/dist/components/ImageWithFallback/ImageWithFallback2.js +28 -0
- package/dist/components/ImageWithFallback/ImageWithFallback2.js.map +1 -0
- package/dist/components/ImageWithFallback/index.d.ts +2 -0
- package/dist/components/ImageWithFallback/index.js +2 -0
- package/dist/components/ListBanner/ListBanner.d.ts +17 -0
- package/dist/components/ListBanner/ListBanner2.js +27 -0
- package/dist/components/ListBanner/ListBanner2.js.map +1 -0
- package/dist/components/ListBanner/index.d.ts +2 -0
- package/dist/components/ListBanner/index.js +2 -0
- package/dist/components/Modal/Modal.d.ts +65 -0
- package/dist/components/Modal/Modal2.js +226 -0
- package/dist/components/Modal/Modal2.js.map +1 -0
- package/dist/components/Modal/index.d.ts +15 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/Modal/modalStack.d.ts +64 -0
- package/dist/components/Modal/modalStack.js +81 -0
- package/dist/components/Modal/modalStack.js.map +1 -0
- package/dist/components/NotificationItem/NotificationItem.d.ts +14 -0
- package/dist/components/NotificationItem/NotificationItem2.js +40 -0
- package/dist/components/NotificationItem/NotificationItem2.js.map +1 -0
- package/dist/components/NotificationItem/index.d.ts +2 -0
- package/dist/components/NotificationItem/index.js +2 -0
- package/dist/components/NotificationStack/NotificationStack.d.ts +56 -0
- package/dist/components/NotificationStack/NotificationStack.messages.d.ts +6 -0
- package/dist/components/NotificationStack/NotificationStack.messages.js +10 -0
- package/dist/components/NotificationStack/NotificationStack.messages.js.map +1 -0
- package/dist/components/NotificationStack/NotificationStack2.js +154 -0
- package/dist/components/NotificationStack/NotificationStack2.js.map +1 -0
- package/dist/components/NotificationStack/index.d.ts +2 -0
- package/dist/components/NotificationStack/index.js +2 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar.d.ts +13 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar2.js +69 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar2.js.map +1 -0
- package/dist/components/OverlayScrollbar/index.d.ts +2 -0
- package/dist/components/OverlayScrollbar/index.js +2 -0
- package/dist/components/PageHeader/PageHeader.d.ts +24 -8
- package/dist/components/PageHeader/PageHeader.messages.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.messages.js +10 -0
- package/dist/components/PageHeader/PageHeader.messages.js.map +1 -0
- package/dist/components/PageHeader/PageHeader2.js +57 -30
- package/dist/components/PageHeader/PageHeader2.js.map +1 -1
- package/dist/components/PageLayout/PageLayout2.js +2 -2
- package/dist/components/PageLayout/PageLayout2.js.map +1 -1
- package/dist/components/PagedSelector/PagedSelector.d.ts +107 -0
- package/dist/components/PagedSelector/PagedSelector.messages.d.ts +30 -0
- package/dist/components/PagedSelector/PagedSelector.messages.js +36 -0
- package/dist/components/PagedSelector/PagedSelector.messages.js.map +1 -0
- package/dist/components/PagedSelector/PagedSelector2.js +220 -0
- package/dist/components/PagedSelector/PagedSelector2.js.map +1 -0
- package/dist/components/PagedSelector/PanelSearchInput.d.ts +22 -0
- package/dist/components/PagedSelector/PanelSearchInput.js +95 -0
- package/dist/components/PagedSelector/PanelSearchInput.js.map +1 -0
- package/dist/components/PagedSelector/index.d.ts +2 -0
- package/dist/components/PagedSelector/index.js +2 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel.d.ts +26 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel2.js +44 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel2.js.map +1 -0
- package/dist/components/ProgressWithLabel/index.d.ts +2 -0
- package/dist/components/ProgressWithLabel/index.js +2 -0
- package/dist/components/SelectionLabel/SelectionLabel.d.ts +23 -0
- package/dist/components/SelectionLabel/SelectionLabel.js +29 -0
- package/dist/components/SelectionLabel/SelectionLabel.js.map +1 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.d.ts +10 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.js +16 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.js.map +1 -0
- package/dist/components/SelectionLabel/index.d.ts +2 -0
- package/dist/components/SelectionLabel/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.messages.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.messages.js +24 -0
- package/dist/components/Skeleton/Skeleton.messages.js.map +1 -0
- package/dist/components/Skeleton/SkeletonCard.d.ts +4 -9
- package/dist/components/Skeleton/SkeletonCard2.js +53 -53
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonChart.d.ts +5 -11
- package/dist/components/Skeleton/SkeletonChart2.js +51 -45
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonRow.d.ts +5 -10
- package/dist/components/Skeleton/SkeletonRow2.js +35 -34
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonShape.d.ts +10 -0
- package/dist/components/Skeleton/SkeletonShape2.js +23 -0
- package/dist/components/Skeleton/SkeletonShape2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +4 -9
- package/dist/components/Skeleton/SkeletonText2.js +22 -17
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts +3 -5
- package/dist/components/Skeleton/index.js +4 -5
- package/dist/components/SmoothHeight/SmoothHeight2.js +2 -2
- package/dist/components/SmoothHeight/SmoothHeight2.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +28 -16
- package/dist/components/StatCard/StatCard2.js +96 -89
- package/dist/components/StatCard/StatCard2.js.map +1 -1
- package/dist/components/StatCard/index.d.ts +1 -1
- package/dist/components/Statistic/Statistic.d.ts +30 -0
- package/dist/components/Statistic/Statistic.messages.d.ts +6 -0
- package/dist/components/Statistic/Statistic.messages.js +10 -0
- package/dist/components/Statistic/Statistic.messages.js.map +1 -0
- package/dist/components/Statistic/Statistic2.js +75 -0
- package/dist/components/Statistic/Statistic2.js.map +1 -0
- package/dist/components/Statistic/index.d.ts +2 -0
- package/dist/components/Statistic/index.js +2 -0
- package/dist/components/StepNumberInput/NumberStepper.d.ts +29 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.d.ts +10 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.js +16 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.js.map +1 -0
- package/dist/components/StepNumberInput/NumberStepper2.js +50 -0
- package/dist/components/StepNumberInput/NumberStepper2.js.map +1 -0
- package/dist/components/StepNumberInput/StepNumberInput.d.ts +33 -0
- package/dist/components/StepNumberInput/StepNumberInput.js +48 -0
- package/dist/components/StepNumberInput/StepNumberInput.js.map +1 -0
- package/dist/components/StepNumberInput/index.d.ts +4 -0
- package/dist/components/StepNumberInput/index.js +3 -0
- package/dist/components/TextHighlighter/TextHighlighter.d.ts +14 -0
- package/dist/components/TextHighlighter/TextHighlighter2.js +29 -0
- package/dist/components/TextHighlighter/TextHighlighter2.js.map +1 -0
- package/dist/components/TextHighlighter/index.d.ts +2 -0
- package/dist/components/TextHighlighter/index.js +2 -0
- package/dist/components/TokenList/TokenList.d.ts +18 -0
- package/dist/components/TokenList/TokenList2.js +55 -0
- package/dist/components/TokenList/TokenList2.js.map +1 -0
- package/dist/components/TokenList/index.d.ts +2 -0
- package/dist/components/TokenList/index.js +2 -0
- package/dist/components/TokenRow/TokenRow.d.ts +27 -0
- package/dist/components/TokenRow/TokenRow.messages.d.ts +6 -0
- package/dist/components/TokenRow/TokenRow.messages.js +10 -0
- package/dist/components/TokenRow/TokenRow.messages.js.map +1 -0
- package/dist/components/TokenRow/TokenRow2.js +29 -0
- package/dist/components/TokenRow/TokenRow2.js.map +1 -0
- package/dist/components/TokenRow/index.d.ts +2 -0
- package/dist/components/TokenRow/index.js +2 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.d.ts +29 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.js +49 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.js.map +1 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.d.ts +6 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.js +10 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.js.map +1 -0
- package/dist/components/UncontrolledInput/index.d.ts +2 -0
- package/dist/components/UncontrolledInput/index.js +2 -0
- package/dist/components/UnitGrid/UnitGrid.d.ts +56 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.d.ts +102 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.js +172 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.js.map +1 -0
- package/dist/components/UnitGrid/UnitGrid.messages.d.ts +14 -0
- package/dist/components/UnitGrid/UnitGrid.messages.js +20 -0
- package/dist/components/UnitGrid/UnitGrid.messages.js.map +1 -0
- package/dist/components/UnitGrid/UnitGrid2.js +393 -0
- package/dist/components/UnitGrid/UnitGrid2.js.map +1 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.d.ts +9 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.js +73 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.js.map +1 -0
- package/dist/components/UnitGrid/index.d.ts +4 -0
- package/dist/components/UnitGrid/index.js +3 -0
- package/dist/forks/ComplexSelector/ComplexSelector.d.ts +144 -0
- package/dist/forks/ComplexSelector/ComplexSelector.js +157 -0
- package/dist/forks/ComplexSelector/ComplexSelector.js.map +1 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.d.ts +125 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js +129 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js.map +1 -0
- package/dist/forks/ComplexSelector/index.d.ts +7 -0
- package/dist/forks/ComplexSelector/index.js +2 -0
- package/dist/forks/Drawer/Drawer.d.ts +98 -0
- package/dist/forks/Drawer/Drawer.js +94 -0
- package/dist/forks/Drawer/Drawer.js.map +1 -0
- package/dist/forks/Drawer/Drawer.styles.d.ts +99 -0
- package/dist/forks/Drawer/Drawer.styles.js +94 -0
- package/dist/forks/Drawer/Drawer.styles.js.map +1 -0
- package/dist/forks/Drawer/index.d.ts +6 -0
- package/dist/forks/Drawer/index.js +2 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.d.ts +19 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.js +62 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -0
- package/dist/forks/Tour/Tour.d.ts +58 -0
- package/dist/forks/Tour/Tour.js +55 -0
- package/dist/forks/Tour/Tour.js.map +1 -0
- package/dist/forks/Tour/TourContext.d.ts +37 -0
- package/dist/forks/Tour/TourContext.js +8 -0
- package/dist/forks/Tour/TourContext.js.map +1 -0
- package/dist/forks/Tour/TourStep.d.ts +43 -0
- package/dist/forks/Tour/TourStep.js +134 -0
- package/dist/forks/Tour/TourStep.js.map +1 -0
- package/dist/forks/Tour/TourStep.styles.d.ts +23 -0
- package/dist/forks/Tour/TourStep.styles.js +28 -0
- package/dist/forks/Tour/TourStep.styles.js.map +1 -0
- package/dist/forks/Tour/index.d.ts +11 -0
- package/dist/forks/Tour/index.js +4 -0
- package/dist/forks/Tour/useTour.d.ts +26 -0
- package/dist/forks/Tour/useTour.js +20 -0
- package/dist/forks/Tour/useTour.js.map +1 -0
- package/dist/forks/compiled.d.ts +5 -0
- package/dist/forks/compiled.js +8 -0
- package/dist/forks/compiled.js.map +1 -0
- package/dist/i18n/catalog.d.ts +12 -0
- package/dist/i18n/catalog.js +46 -0
- package/dist/i18n/catalog.js.map +1 -0
- package/dist/i18n/common.messages.d.ts +31 -0
- package/dist/i18n/common.messages.js +32 -0
- package/dist/i18n/common.messages.js.map +1 -0
- package/dist/i18n/index.d.ts +21 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/locales/de-DE.js +331 -0
- package/dist/i18n/locales/de-DE.js.map +1 -0
- package/dist/i18n/locales/el-GR.js +331 -0
- package/dist/i18n/locales/el-GR.js.map +1 -0
- package/dist/i18n/locales/es-ES.js +331 -0
- package/dist/i18n/locales/es-ES.js.map +1 -0
- package/dist/i18n/locales/fi-FI.js +331 -0
- package/dist/i18n/locales/fi-FI.js.map +1 -0
- package/dist/i18n/locales/fr-FR.js +331 -0
- package/dist/i18n/locales/fr-FR.js.map +1 -0
- package/dist/i18n/locales/id-ID.js +331 -0
- package/dist/i18n/locales/id-ID.js.map +1 -0
- package/dist/i18n/locales/it-IT.js +331 -0
- package/dist/i18n/locales/it-IT.js.map +1 -0
- package/dist/i18n/locales/ja-JP.js +351 -0
- package/dist/i18n/locales/ja-JP.js.map +1 -0
- package/dist/i18n/locales/ko-KR.js +351 -0
- package/dist/i18n/locales/ko-KR.js.map +1 -0
- package/dist/i18n/locales/mn-MN.js +327 -0
- package/dist/i18n/locales/mn-MN.js.map +1 -0
- package/dist/i18n/locales/ms-MY.js +331 -0
- package/dist/i18n/locales/ms-MY.js.map +1 -0
- package/dist/i18n/locales/pl-PL.js +331 -0
- package/dist/i18n/locales/pl-PL.js.map +1 -0
- package/dist/i18n/locales/pt-BR.js +331 -0
- package/dist/i18n/locales/pt-BR.js.map +1 -0
- package/dist/i18n/locales/pt-PT.js +331 -0
- package/dist/i18n/locales/pt-PT.js.map +1 -0
- package/dist/i18n/locales/ru-RU.js +331 -0
- package/dist/i18n/locales/ru-RU.js.map +1 -0
- package/dist/i18n/locales/th-TH.js +331 -0
- package/dist/i18n/locales/th-TH.js.map +1 -0
- package/dist/i18n/locales/tr-TR.js +331 -0
- package/dist/i18n/locales/tr-TR.js.map +1 -0
- package/dist/i18n/locales/vi-VN.js +331 -0
- package/dist/i18n/locales/vi-VN.js.map +1 -0
- package/dist/i18n/locales/zh-CN.js +331 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -0
- package/dist/i18n/locales/zh-TW.js +331 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -0
- package/dist/i18n/messages.d.ts +13 -0
- package/dist/i18n/messages.js +63 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/i18n/translateWithNodes.d.ts +3 -0
- package/dist/i18n/translateWithNodes.js +14 -0
- package/dist/i18n/translateWithNodes.js.map +1 -0
- package/dist/i18n/useUicTranslator.d.ts +5 -0
- package/dist/i18n/useUicTranslator.js +38 -0
- package/dist/i18n/useUicTranslator.js.map +1 -0
- package/dist/index.d.ts +101 -27
- package/dist/index.js +63 -23
- package/dist/instance.d.ts +31 -0
- package/dist/instance.js +33 -0
- package/dist/instance.js.map +1 -0
- package/dist/legacy-tokens.css +177 -0
- package/dist/locales/af-ZA.json +954 -0
- package/dist/locales/ar-SA.json +994 -0
- package/dist/locales/ca-ES.json +970 -0
- package/dist/locales/cs-CZ.json +986 -0
- package/dist/locales/da-DK.json +962 -0
- package/dist/locales/de-DE.json +962 -0
- package/dist/locales/el-GR.json +986 -0
- package/dist/locales/en.json +1482 -0
- package/dist/locales/es-ES.json +974 -0
- package/dist/locales/fi-FI.json +986 -0
- package/dist/locales/fr-FR.json +950 -0
- package/dist/locales/he-IL.json +986 -0
- package/dist/locales/hu-HU.json +986 -0
- package/dist/locales/it-IT.json +974 -0
- package/dist/locales/ja-JP.json +994 -0
- package/dist/locales/ko-KR.json +986 -0
- package/dist/locales/nl-NL.json +950 -0
- package/dist/locales/no-NO.json +974 -0
- package/dist/locales/pl-PL.json +978 -0
- package/dist/locales/pseudo.json +1112 -0
- package/dist/locales/pt-BR.json +978 -0
- package/dist/locales/pt-PT.json +978 -0
- package/dist/locales/ro-RO.json +978 -0
- package/dist/locales/ru-RU.json +986 -0
- package/dist/locales/sr-SP.json +986 -0
- package/dist/locales/sv-SE.json +982 -0
- package/dist/locales/tr-TR.json +986 -0
- package/dist/locales/uk-UA.json +986 -0
- package/dist/locales/vi-VN.json +982 -0
- package/dist/locales/zh-CN.json +994 -0
- package/dist/locales/zh-TW.json +994 -0
- package/dist/styles/base.css +29 -2
- package/dist/styles/themes/orange-dark.css +4 -0
- package/dist/styles/themes/orange-light.css +4 -0
- package/dist/theme/lablup/built/lablup.d.ts +13 -0
- package/dist/theme/lablup/built/lablup.js +567 -0
- package/dist/theme/lablup/built/lablup.variants.d.ts +16 -0
- package/dist/theme/lablup/built/theme.css +716 -0
- package/dist/theme/lablup/index.d.ts +9 -0
- package/dist/theme/lablup/index.js +2 -0
- package/dist/theme/lablup/lablupTheme.d.ts +10 -0
- package/dist/theme/lablup/lablupTheme.js +21 -0
- package/dist/theme/lablup/lablupTheme.js.map +1 -0
- package/dist/ui-common-locales/de-DE.json +326 -0
- package/dist/ui-common-locales/el-GR.json +326 -0
- package/dist/ui-common-locales/en.json +346 -0
- package/dist/ui-common-locales/es-ES.json +326 -0
- package/dist/ui-common-locales/fi-FI.json +326 -0
- package/dist/ui-common-locales/fr-FR.json +326 -0
- package/dist/ui-common-locales/id-ID.json +326 -0
- package/dist/ui-common-locales/it-IT.json +326 -0
- package/dist/ui-common-locales/ja-JP.json +346 -0
- package/dist/ui-common-locales/ko-KR.json +346 -0
- package/dist/ui-common-locales/mn-MN.json +322 -0
- package/dist/ui-common-locales/ms-MY.json +326 -0
- package/dist/ui-common-locales/pl-PL.json +326 -0
- package/dist/ui-common-locales/pt-BR.json +326 -0
- package/dist/ui-common-locales/pt-PT.json +326 -0
- package/dist/ui-common-locales/ru-RU.json +326 -0
- package/dist/ui-common-locales/th-TH.json +326 -0
- package/dist/ui-common-locales/tr-TR.json +326 -0
- package/dist/ui-common-locales/vi-VN.json +326 -0
- package/dist/ui-common-locales/zh-CN.json +326 -0
- package/dist/ui-common-locales/zh-TW.json +326 -0
- package/dist/ui-common.css +51 -0
- package/exports.customs.json +62 -0
- package/exports.exclude.json +47 -0
- package/package.json +565 -21
- package/dist/assets/components/Badge/Badge.css +0 -1
- package/dist/assets/components/BaseCard/BaseCard.css +0 -1
- package/dist/assets/components/Button/Button.css +0 -1
- package/dist/assets/components/DataTable/DataTable.css +0 -1
- package/dist/assets/components/Drawer/Drawer.css +0 -1
- package/dist/assets/components/EmptyState/EmptyState.css +0 -1
- package/dist/assets/components/ProgressBar/ProgressBar.css +0 -1
- package/dist/assets/components/Skeleton/Skeleton.css +0 -1
- package/dist/assets/components/StatusTag/StatusTag.css +0 -1
- package/dist/assets/components/Tabs/Tabs.css +0 -1
- package/dist/assets/components/Tooltip/Tooltip.css +0 -1
- package/dist/components/Badge/Badge.d.ts +0 -7
- package/dist/components/Badge/Badge2.js +0 -20
- package/dist/components/Badge/Badge2.js.map +0 -1
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Badge/index.js +0 -2
- package/dist/components/BaseCard/BaseCard.d.ts +0 -57
- package/dist/components/BaseCard/BaseCard2.js +0 -37
- package/dist/components/BaseCard/BaseCard2.js.map +0 -1
- package/dist/components/BaseCard/index.d.ts +0 -2
- package/dist/components/BaseCard/index.js +0 -2
- package/dist/components/Button/Button.d.ts +0 -54
- package/dist/components/Button/Button2.js +0 -75
- package/dist/components/Button/Button2.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -5
- package/dist/components/Button/index.js +0 -2
- package/dist/components/DataTable/DataTable.d.ts +0 -144
- package/dist/components/DataTable/DataTable2.js +0 -244
- package/dist/components/DataTable/DataTable2.js.map +0 -1
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/components/DataTable/index.js +0 -2
- package/dist/components/Drawer/Drawer.d.ts +0 -25
- package/dist/components/Drawer/Drawer2.js +0 -107
- package/dist/components/Drawer/Drawer2.js.map +0 -1
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -2
- package/dist/components/EmptyState/EmptyState.d.ts +0 -52
- package/dist/components/EmptyState/EmptyState.example.d.ts +0 -8
- package/dist/components/EmptyState/EmptyState2.js +0 -62
- package/dist/components/EmptyState/EmptyState2.js.map +0 -1
- package/dist/components/EmptyState/index.d.ts +0 -10
- package/dist/components/EmptyState/index.js +0 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts +0 -22
- package/dist/components/ProgressBar/ProgressBar2.js +0 -37
- package/dist/components/ProgressBar/ProgressBar2.js.map +0 -1
- package/dist/components/ProgressBar/index.d.ts +0 -2
- package/dist/components/ProgressBar/index.js +0 -2
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton2.js +0 -27
- package/dist/components/Skeleton/Skeleton2.js.map +0 -1
- package/dist/components/StatusTag/StatusTag.d.ts +0 -38
- package/dist/components/StatusTag/StatusTag2.js +0 -45
- package/dist/components/StatusTag/StatusTag2.js.map +0 -1
- package/dist/components/StatusTag/index.d.ts +0 -2
- package/dist/components/StatusTag/index.js +0 -2
- package/dist/components/Tabs/Tabs.d.ts +0 -94
- package/dist/components/Tabs/Tabs2.js +0 -412
- package/dist/components/Tabs/Tabs2.js.map +0 -1
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Tabs/index.js +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -16
- package/dist/components/Tooltip/Tooltip2.js +0 -68
- package/dist/components/Tooltip/Tooltip2.js.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/Tooltip/index.js +0 -2
- package/dist/hooks/index.js +0 -2
- package/dist/icons/AlertCircleIcon.d.ts +0 -11
- package/dist/icons/AlertCircleIcon.js +0 -26
- package/dist/icons/AlertCircleIcon.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { formMessages } from './Form.messages';
|
|
2
|
+
import { ValidateMessages } from './interface';
|
|
3
|
+
/** Formats a catalog key with the given values, like `useUicTranslator`'s `t`. */
|
|
4
|
+
export type ValidateMessageTranslate = (key: keyof typeof formMessages, values: Record<string, string>) => string;
|
|
5
|
+
/** The engine's template table, in the language `translate` resolves. */
|
|
6
|
+
export declare function buildValidateMessages(translate: ValidateMessageTranslate): ValidateMessages;
|
|
7
|
+
/** The English templates: the fallback under every other table. */
|
|
8
|
+
export declare const defaultValidateMessages: ValidateMessages;
|
|
9
|
+
/**
|
|
10
|
+
* Shallow-per-section merge, matching async-validator's `deepMerge`: a
|
|
11
|
+
* provided `types` object is spread over the default `types` object rather
|
|
12
|
+
* than replacing it, so a table that only sets `required` keeps the other
|
|
13
|
+
* templates.
|
|
14
|
+
*/
|
|
15
|
+
export declare function mergeValidateMessages(...sources: (ValidateMessages | undefined | null)[]): ValidateMessages;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { formMessages as e } from "./Form.messages.js";
|
|
2
|
+
import t from "intl-messageformat";
|
|
3
|
+
//#region src/components/Form/messages.ts
|
|
4
|
+
var n = Object.fromEntries([
|
|
5
|
+
"label",
|
|
6
|
+
"type",
|
|
7
|
+
"len",
|
|
8
|
+
"min",
|
|
9
|
+
"max",
|
|
10
|
+
"pattern"
|
|
11
|
+
].map((e) => [e, `\${${e}}`]));
|
|
12
|
+
function r(e) {
|
|
13
|
+
let t = (t) => e(t, n), r = (e) => ({
|
|
14
|
+
len: t(`uic.Form.${e}Len`),
|
|
15
|
+
min: t(`uic.Form.${e}Min`),
|
|
16
|
+
max: t(`uic.Form.${e}Max`),
|
|
17
|
+
range: t(`uic.Form.${e}Range`)
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
default: t("uic.Form.default"),
|
|
21
|
+
required: t("uic.Form.required"),
|
|
22
|
+
whitespace: t("uic.Form.whitespace"),
|
|
23
|
+
types: {
|
|
24
|
+
string: t("uic.Form.typeString"),
|
|
25
|
+
number: t("uic.Form.typeNumber"),
|
|
26
|
+
object: t("uic.Form.typeObject"),
|
|
27
|
+
email: t("uic.Form.typeEmail"),
|
|
28
|
+
url: t("uic.Form.typeUrl")
|
|
29
|
+
},
|
|
30
|
+
string: r("string"),
|
|
31
|
+
number: r("number"),
|
|
32
|
+
array: r("array"),
|
|
33
|
+
pattern: { mismatch: t("uic.Form.patternMismatch") }
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var i = r((n, r) => String(new t(e[n].defaultMessage, "en").format(r)));
|
|
37
|
+
function a(...e) {
|
|
38
|
+
let t = { ...i };
|
|
39
|
+
return e.forEach((e) => {
|
|
40
|
+
e && Object.keys(e).forEach((n) => {
|
|
41
|
+
let r = e[n], i = t[n];
|
|
42
|
+
r && typeof r == "object" && i && typeof i == "object" ? t[n] = {
|
|
43
|
+
...i,
|
|
44
|
+
...r
|
|
45
|
+
} : t[n] = r;
|
|
46
|
+
});
|
|
47
|
+
}), t;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { r as buildValidateMessages, i as defaultValidateMessages, a as mergeValidateMessages };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","names":[],"sources":["../../../src/components/Form/messages.ts"],"sourcesContent":["/**\n * Validate-message templates.\n *\n * The strings live in ui-common's catalog (`./Form.messages.ts`) as ICU\n * messages. The engine interpolates rule values itself, with `${name}`-style\n * placeholders (see `validate.ts`), so a template is the catalog message\n * formatted with each placeholder standing for itself: `{label}` becomes\n * `${label}`.\n */\nimport IntlMessageFormat from \"intl-messageformat\";\n\nimport { formMessages } from \"./Form.messages\";\nimport type { ValidateMessages } from \"./interface\";\n\n/** Formats a catalog key with the given values, like `useUicTranslator`'s `t`. */\nexport type ValidateMessageTranslate = (\n key: keyof typeof formMessages,\n values: Record<string, string>,\n) => string;\n\nconst PLACEHOLDERS = [\"label\", \"type\", \"len\", \"min\", \"max\", \"pattern\"] as const;\nconst TEMPLATE_VALUES = Object.fromEntries(PLACEHOLDERS.map((p) => [p, `\\${${p}}`]));\n\n/** The engine's template table, in the language `translate` resolves. */\nexport function buildValidateMessages(\n translate: ValidateMessageTranslate,\n): ValidateMessages {\n const m = (key: keyof typeof formMessages) => translate(key, TEMPLATE_VALUES);\n const lengths = (group: \"string\" | \"number\" | \"array\") => ({\n len: m(`uic.Form.${group}Len`),\n min: m(`uic.Form.${group}Min`),\n max: m(`uic.Form.${group}Max`),\n range: m(`uic.Form.${group}Range`),\n });\n return {\n default: m(\"uic.Form.default\"),\n required: m(\"uic.Form.required\"),\n whitespace: m(\"uic.Form.whitespace\"),\n types: {\n string: m(\"uic.Form.typeString\"),\n number: m(\"uic.Form.typeNumber\"),\n object: m(\"uic.Form.typeObject\"),\n email: m(\"uic.Form.typeEmail\"),\n url: m(\"uic.Form.typeUrl\"),\n },\n string: lengths(\"string\"),\n number: lengths(\"number\"),\n array: lengths(\"array\"),\n pattern: { mismatch: m(\"uic.Form.patternMismatch\") },\n };\n}\n\n/** The English templates: the fallback under every other table. */\nexport const defaultValidateMessages: ValidateMessages = buildValidateMessages(\n (key, values) =>\n String(\n new IntlMessageFormat(formMessages[key].defaultMessage, \"en\").format(values),\n ),\n);\n\n/**\n * Shallow-per-section merge, matching async-validator's `deepMerge`: a\n * provided `types` object is spread over the default `types` object rather\n * than replacing it, so a table that only sets `required` keeps the other\n * templates.\n */\nexport function mergeValidateMessages(\n ...sources: (ValidateMessages | undefined | null)[]\n): ValidateMessages {\n const target: ValidateMessages = { ...defaultValidateMessages };\n sources.forEach((source) => {\n if (!source) return;\n Object.keys(source).forEach((key) => {\n const value = source[key];\n const existing = target[key];\n if (\n value &&\n typeof value === \"object\" &&\n existing &&\n typeof existing === \"object\"\n ) {\n target[key] = { ...existing, ...value };\n } else {\n target[key] = value;\n }\n });\n });\n return target;\n}\n"],"mappings":";;;AAqBA,IAAM,IAAkB,OAAO,YAAY;CADrB;CAAS;CAAQ;CAAO;CAAO;CAAO;AACjB,CAAA,CAAa,KAAK,MAAM,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;AAGnF,SAAgB,EACd,GACkB;CAClB,IAAM,KAAK,MAAmC,EAAU,GAAK,CAAe,GACtE,KAAW,OAA0C;EACzD,KAAK,EAAE,YAAY,EAAM,IAAI;EAC7B,KAAK,EAAE,YAAY,EAAM,IAAI;EAC7B,KAAK,EAAE,YAAY,EAAM,IAAI;EAC7B,OAAO,EAAE,YAAY,EAAM,MAAM;CACnC;CACA,OAAO;EACL,SAAS,EAAE,kBAAkB;EAC7B,UAAU,EAAE,mBAAmB;EAC/B,YAAY,EAAE,qBAAqB;EACnC,OAAO;GACL,QAAQ,EAAE,qBAAqB;GAC/B,QAAQ,EAAE,qBAAqB;GAC/B,QAAQ,EAAE,qBAAqB;GAC/B,OAAO,EAAE,oBAAoB;GAC7B,KAAK,EAAE,kBAAkB;EAC3B;EACA,QAAQ,EAAQ,QAAQ;EACxB,QAAQ,EAAQ,QAAQ;EACxB,OAAO,EAAQ,OAAO;EACtB,SAAS,EAAE,UAAU,EAAE,0BAA0B,EAAE;CACrD;AACF;AAGA,IAAa,IAA4C,GACtD,GAAK,MACJ,OACE,IAAI,EAAkB,EAAa,EAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC,OAAO,CAAM,CAC7E,CACJ;AAQA,SAAgB,EACd,GAAG,GACe;CAClB,IAAM,IAA2B,EAAE,GAAG,EAAwB;CAkB9D,OAjBA,EAAQ,SAAS,MAAW;EACrB,KACL,OAAO,KAAK,CAAM,CAAC,CAAC,SAAS,MAAQ;GACnC,IAAM,IAAQ,EAAO,IACf,IAAW,EAAO;GACxB,AACE,KACA,OAAO,KAAU,YACjB,KACA,OAAO,KAAa,WAEpB,EAAO,KAAO;IAAE,GAAG;IAAU,GAAG;GAAM,IAEtC,EAAO,KAAO;EAElB,CAAC;CACH,CAAC,GACM;AACT"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path and store primitives: a behavioural port of rc-field-form's
|
|
3
|
+
* `utils/valueUtil` and `utils/NameMap` and rc-util's `get` / `set` / `merge`.
|
|
4
|
+
* Pure and dependency-free.
|
|
5
|
+
*
|
|
6
|
+
* `set` must keep upstream's copy-on-write with numeric-segment array
|
|
7
|
+
* creation: `setValue({}, ['a', 0, 'b'], 1)` produces `{ a: [{ b: 1 }] }`,
|
|
8
|
+
* not `{ a: { '0': { b: 1 } } }`, or Form.List values are reshaped.
|
|
9
|
+
*/
|
|
10
|
+
/** A single addressable segment of a field path. */
|
|
11
|
+
export type NamePathSegment = string | number;
|
|
12
|
+
/** Normalised, always-array internal path — what `errorFields[].name` carries. */
|
|
13
|
+
export type InternalNamePath = NamePathSegment[];
|
|
14
|
+
export type BaseNamePath = string | number | boolean | (string | number | boolean)[];
|
|
15
|
+
/**
|
|
16
|
+
* antd's own deep path type, copied so `NamePath` behaves identically.
|
|
17
|
+
*
|
|
18
|
+
* For a typed store it walks up to three levels and produces the tuples that
|
|
19
|
+
* store admits; for an untyped `FormInstance` (`Store = any`) the conditional
|
|
20
|
+
* collapses to `any`, which is why `[listName, index, 'variable']` with a
|
|
21
|
+
* `NamePath`-typed `listName` type-checks. Tightening it rejects such code.
|
|
22
|
+
*/
|
|
23
|
+
export type DeepNamePath<Store = any, ParentNamePath extends any[] = []> = ParentNamePath["length"] extends 3 ? never : true extends (Store extends BaseNamePath ? true : false) ? ParentNamePath["length"] extends 0 ? Store | BaseNamePath : Store extends any[] ? [...ParentNamePath, number] : never : Store extends any[] ? [...ParentNamePath, number] | DeepNamePath<Store[number], [...ParentNamePath, number]> : keyof Store extends never ? Store : {
|
|
24
|
+
[FieldKey in keyof Store]: Store[FieldKey] extends (...args: any[]) => any ? never : (ParentNamePath["length"] extends 0 ? FieldKey : never) | [...ParentNamePath, FieldKey] | DeepNamePath<Required<Store>[FieldKey], [
|
|
25
|
+
...ParentNamePath,
|
|
26
|
+
FieldKey
|
|
27
|
+
]>;
|
|
28
|
+
}[keyof Store];
|
|
29
|
+
/** Public name path shape accepted by every engine API. */
|
|
30
|
+
export type NamePath<Store = any> = DeepNamePath<Store>;
|
|
31
|
+
/** Arbitrary form value store. Values are never coerced (Relay objects live here). */
|
|
32
|
+
export type Store = Record<string, any>;
|
|
33
|
+
export declare function toArray<T>(value: T | T[] | undefined | null): T[];
|
|
34
|
+
/**
|
|
35
|
+
* `'a'` -> `['a']`, `123` -> `[123]`, `['a', 123]` -> `['a', 123]`.
|
|
36
|
+
* Deliberately NOT dot-splitting: `'a.b'` stays a single segment, matching
|
|
37
|
+
* rc-field-form (its `getNamePath` is `toArray`, nothing more).
|
|
38
|
+
*/
|
|
39
|
+
export declare function getNamePath(path: NamePath | undefined | null): InternalNamePath;
|
|
40
|
+
export declare function getValue(entity: any, path: InternalNamePath): any;
|
|
41
|
+
export declare function setValue<T = Store>(entity: T, paths: InternalNamePath, value: any, removeIfUndefined?: boolean): T;
|
|
42
|
+
/**
|
|
43
|
+
* Deep merge with ARRAY REPLACEMENT (not concatenation / index merge).
|
|
44
|
+
* `setFieldsValue({ resource: {...} })` partially merges the `resource`
|
|
45
|
+
* object but replaces any array it contains wholesale. Non-plain objects
|
|
46
|
+
* (class instances, records from a data store) are assigned by reference.
|
|
47
|
+
*/
|
|
48
|
+
export declare function merge<T = Store>(...sources: any[]): T;
|
|
49
|
+
/** Build a store containing only the given paths (used by `validateFields`' resolve value). */
|
|
50
|
+
export declare function cloneByNamePathList(store: Store, namePathList: InternalNamePath[]): Store;
|
|
51
|
+
/**
|
|
52
|
+
* Is `namePath` equal to (or, with `partialMatch`, prefixed by) `subNamePath`?
|
|
53
|
+
* `partialMatch` is what makes `validateFields(['resource'], {recursive:true})`
|
|
54
|
+
* reach `['resource','cpu']`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function matchNamePath(namePath: InternalNamePath | undefined | null, subNamePath: InternalNamePath | undefined | null, partialMatch?: boolean): boolean;
|
|
57
|
+
export declare function containsNamePath(namePathList: InternalNamePath[] | undefined | null, namePath: InternalNamePath, partialMatch?: boolean): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Pull the next value out of a control's change payload. Mirrors
|
|
60
|
+
* rc-field-form: DOM-ish events expose the value under `event.target[
|
|
61
|
+
* valuePropName]` (so `valuePropName="checked"` reads `target.checked`),
|
|
62
|
+
* everything else is passed through as-is.
|
|
63
|
+
*/
|
|
64
|
+
export declare function defaultGetValueFromEvent(valuePropName: string, ...args: any[]): any;
|
|
65
|
+
/** `Map` keyed by name path. */
|
|
66
|
+
export default class NameMap<T> {
|
|
67
|
+
private kvs;
|
|
68
|
+
set(key: InternalNamePath, value: T): void;
|
|
69
|
+
get(key: InternalNamePath): T | undefined;
|
|
70
|
+
/** The entry at `key` plus every entry nested underneath it. */
|
|
71
|
+
getAsPrefix(key: InternalNamePath): T[];
|
|
72
|
+
update(key: InternalNamePath, updater: (origin: T | undefined) => T | null): void;
|
|
73
|
+
delete(key: InternalNamePath): void;
|
|
74
|
+
map<U>(callback: (entry: {
|
|
75
|
+
key: InternalNamePath;
|
|
76
|
+
value: T;
|
|
77
|
+
}) => U): U[];
|
|
78
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region src/components/Form/namePath.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
4
|
+
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
return e(t);
|
|
7
|
+
}
|
|
8
|
+
function n(e, t) {
|
|
9
|
+
let n = e;
|
|
10
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
11
|
+
if (n == null) return;
|
|
12
|
+
n = n[t[e]];
|
|
13
|
+
}
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
var r = (e) => e === "__proto__" || e === "constructor" || e === "prototype", i = (e, t, n) => {
|
|
17
|
+
if (r(t)) {
|
|
18
|
+
Object.defineProperty(e, t, {
|
|
19
|
+
value: n,
|
|
20
|
+
enumerable: !0,
|
|
21
|
+
writable: !0,
|
|
22
|
+
configurable: !0
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
e[t] = n;
|
|
27
|
+
}, a = (e, t) => {
|
|
28
|
+
if (e != null) return r(t) ? Object.prototype.hasOwnProperty.call(e, t) ? Object.getOwnPropertyDescriptor(e, t)?.value : void 0 : e[t];
|
|
29
|
+
};
|
|
30
|
+
function o(e, t, n, s) {
|
|
31
|
+
if (!t.length) return n;
|
|
32
|
+
let [c, ...l] = t, u;
|
|
33
|
+
if (u = !e && typeof c == "number" ? [] : Array.isArray(e) ? [...e] : { ...e }, s && n === void 0 && l.length === 1) {
|
|
34
|
+
let e = a(u, c), t = l[0];
|
|
35
|
+
e != null && !r(t) && delete e[t];
|
|
36
|
+
} else i(u, c, o(a(u, c), l, n, s));
|
|
37
|
+
return u;
|
|
38
|
+
}
|
|
39
|
+
function s(e, t, r, i = !1) {
|
|
40
|
+
return t.length && i && r === void 0 && !n(e, t.slice(0, -1)) ? e : o(e, t, r, i);
|
|
41
|
+
}
|
|
42
|
+
function c(e) {
|
|
43
|
+
return typeof e == "object" && !!e && Object.getPrototypeOf(e) === Object.prototype;
|
|
44
|
+
}
|
|
45
|
+
function l(e) {
|
|
46
|
+
return Array.isArray(e) ? [] : {};
|
|
47
|
+
}
|
|
48
|
+
function u(...e) {
|
|
49
|
+
let t = l(e[0]);
|
|
50
|
+
return e.forEach((e) => {
|
|
51
|
+
let r = (i, a) => {
|
|
52
|
+
let o = new Set(a), u = n(e, i), d = Array.isArray(u);
|
|
53
|
+
if (d || c(u)) {
|
|
54
|
+
if (o.has(u)) return;
|
|
55
|
+
o.add(u);
|
|
56
|
+
let e = n(t, i);
|
|
57
|
+
d ? t = s(t, i, []) : (!e || typeof e != "object") && (t = s(t, i, l(u))), Reflect.ownKeys(u).forEach((e) => {
|
|
58
|
+
Object.getOwnPropertyDescriptor(u, e)?.enumerable && r([...i, e], o);
|
|
59
|
+
});
|
|
60
|
+
} else t = s(t, i, u);
|
|
61
|
+
};
|
|
62
|
+
r([], /* @__PURE__ */ new Set());
|
|
63
|
+
}), t;
|
|
64
|
+
}
|
|
65
|
+
function d(e, t) {
|
|
66
|
+
let r = {};
|
|
67
|
+
return t.forEach((t) => {
|
|
68
|
+
let i = n(e, t);
|
|
69
|
+
r = s(r, t, i);
|
|
70
|
+
}), r;
|
|
71
|
+
}
|
|
72
|
+
function f(e, t, n = !1) {
|
|
73
|
+
return !e || !t || !n && e.length !== t.length ? !1 : t.every((t, n) => e[n] === t);
|
|
74
|
+
}
|
|
75
|
+
function p(e, t, n = !1) {
|
|
76
|
+
return !!e && e.some((e) => f(t, e, n));
|
|
77
|
+
}
|
|
78
|
+
function m(e, ...t) {
|
|
79
|
+
let n = t[0];
|
|
80
|
+
return n && n.target && typeof n.target == "object" && e in n.target ? n.target[e] : n;
|
|
81
|
+
}
|
|
82
|
+
var h = "__@field_split__";
|
|
83
|
+
function g(e) {
|
|
84
|
+
return e.map((e) => `${typeof e}:${e}`).join(h);
|
|
85
|
+
}
|
|
86
|
+
var _ = class {
|
|
87
|
+
kvs = /* @__PURE__ */ new Map();
|
|
88
|
+
set(e, t) {
|
|
89
|
+
this.kvs.set(g(e), t);
|
|
90
|
+
}
|
|
91
|
+
get(e) {
|
|
92
|
+
return this.kvs.get(g(e));
|
|
93
|
+
}
|
|
94
|
+
getAsPrefix(e) {
|
|
95
|
+
let t = g(e), n = t + h, r = [], i = this.kvs.get(t);
|
|
96
|
+
return i !== void 0 && r.push(i), this.kvs.forEach((e, t) => {
|
|
97
|
+
t.startsWith(n) && r.push(e);
|
|
98
|
+
}), r;
|
|
99
|
+
}
|
|
100
|
+
update(e, t) {
|
|
101
|
+
let n = t(this.get(e));
|
|
102
|
+
n ? this.set(e, n) : this.delete(e);
|
|
103
|
+
}
|
|
104
|
+
delete(e) {
|
|
105
|
+
this.kvs.delete(g(e));
|
|
106
|
+
}
|
|
107
|
+
map(e) {
|
|
108
|
+
return [...this.kvs.entries()].map(([t, n]) => e({
|
|
109
|
+
key: t.split(h).map((e) => {
|
|
110
|
+
let [, t, n] = /^([^:]*):(.*)$/.exec(e);
|
|
111
|
+
return t === "number" ? Number(n) : n;
|
|
112
|
+
}),
|
|
113
|
+
value: n
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { d as cloneByNamePathList, p as containsNamePath, _ as default, m as defaultGetValueFromEvent, t as getNamePath, n as getValue, f as matchNamePath, u as merge, s as setValue, e as toArray };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=namePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namePath.js","names":[],"sources":["../../../src/components/Form/namePath.ts"],"sourcesContent":["/**\n * Path and store primitives: a behavioural port of rc-field-form's\n * `utils/valueUtil` and `utils/NameMap` and rc-util's `get` / `set` / `merge`.\n * Pure and dependency-free.\n *\n * `set` must keep upstream's copy-on-write with numeric-segment array\n * creation: `setValue({}, ['a', 0, 'b'], 1)` produces `{ a: [{ b: 1 }] }`,\n * not `{ a: { '0': { b: 1 } } }`, or Form.List values are reshaped.\n */\n\n/** A single addressable segment of a field path. */\nexport type NamePathSegment = string | number;\n/** Normalised, always-array internal path — what `errorFields[].name` carries. */\nexport type InternalNamePath = NamePathSegment[];\n\nexport type BaseNamePath = string | number | boolean | (string | number | boolean)[];\n\n/**\n * antd's own deep path type, copied so `NamePath` behaves identically.\n *\n * For a typed store it walks up to three levels and produces the tuples that\n * store admits; for an untyped `FormInstance` (`Store = any`) the conditional\n * collapses to `any`, which is why `[listName, index, 'variable']` with a\n * `NamePath`-typed `listName` type-checks. Tightening it rejects such code.\n */\nexport type DeepNamePath<\n Store = any,\n ParentNamePath extends any[] = [],\n> = ParentNamePath[\"length\"] extends 3\n ? never\n : true extends (Store extends BaseNamePath ? true : false)\n ? ParentNamePath[\"length\"] extends 0\n ? Store | BaseNamePath\n : Store extends any[]\n ? [...ParentNamePath, number]\n : never\n : Store extends any[]\n ? | [...ParentNamePath, number]\n | DeepNamePath<Store[number], [...ParentNamePath, number]>\n : keyof Store extends never\n ? Store\n : {\n [FieldKey in keyof Store]: Store[FieldKey] extends (...args: any[]) => any\n ? never\n : | (ParentNamePath[\"length\"] extends 0 ? FieldKey : never)\n | [...ParentNamePath, FieldKey]\n | DeepNamePath<\n Required<Store>[FieldKey],\n [...ParentNamePath, FieldKey]\n >;\n }[keyof Store];\n\n/** Public name path shape accepted by every engine API. */\nexport type NamePath<Store = any> = DeepNamePath<Store>;\n\n/** Arbitrary form value store. Values are never coerced (Relay objects live here). */\nexport type Store = Record<string, any>;\n\nexport function toArray<T>(value: T | T[] | undefined | null): T[] {\n if (value === undefined || value === null) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * `'a'` -> `['a']`, `123` -> `[123]`, `['a', 123]` -> `['a', 123]`.\n * Deliberately NOT dot-splitting: `'a.b'` stays a single segment, matching\n * rc-field-form (its `getNamePath` is `toArray`, nothing more).\n */\nexport function getNamePath(path: NamePath | undefined | null): InternalNamePath {\n return toArray(path as NamePathSegment);\n}\n\nexport function getValue(entity: any, path: InternalNamePath): any {\n let current = entity;\n for (let i = 0; i < path.length; i += 1) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = current[path[i]!];\n }\n return current;\n}\n\n/**\n * Segments that must never reach a plain `obj[key] = v`.\n *\n * `clone.__proto__ = v` mutates the prototype CHAIN instead of storing a value,\n * and `constructor` / `prototype` are the adjacent reachable slots. A form\n * whose field is literally named one of these is pathological, but name paths\n * flow in from `Form.List` indices and caller-built arrays, so the engine\n * should not be the thing that trusts them (CodeQL `js/prototype-polluting-\n * assignment`).\n *\n * Written as explicit `===` comparisons rather than a `Set.has()` lookup on\n * purpose: CodeQL recognises the former as a barrier guard and does not track\n * through the latter, so the `Set` version left the alert standing even though\n * the runtime behaviour was identical.\n */\nconst isUnsafeSegment = (key: NamePathSegment): boolean =>\n key === \"__proto__\" || key === \"constructor\" || key === \"prototype\";\n\n/**\n * Store `value` at `key` WITHOUT ever walking the prototype chain.\n *\n * For an ordinary key this is a plain assignment — the hot path is unchanged.\n * For a dangerous one it defines an own, enumerable, writable data property,\n * which is what the caller meant: the value is kept and readable through the\n * same path, it simply stops being a prototype mutation. Nothing is silently\n * dropped, so a field genuinely named `constructor` still round-trips.\n */\nconst safeAssign = (target: any, key: NamePathSegment, value: any): void => {\n if (isUnsafeSegment(key)) {\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n return;\n }\n target[key] = value;\n};\n\n/** Read a segment without falling through to the prototype chain. */\nconst safeRead = (source: any, key: NamePathSegment): any => {\n if (source == null) return undefined;\n if (isUnsafeSegment(key)) {\n return Object.prototype.hasOwnProperty.call(source, key)\n ? (Object.getOwnPropertyDescriptor(source, key)?.value as unknown)\n : undefined;\n }\n return source[key];\n};\n\nfunction internalSet(\n entity: any,\n paths: InternalNamePath,\n value: any,\n removeIfUndefined: boolean,\n): any {\n if (!paths.length) {\n return value;\n }\n const [path, ...restPath] = paths as [InternalNamePath[number], ...InternalNamePath];\n let clone: any;\n if (!entity && typeof path === \"number\") {\n clone = [];\n } else if (Array.isArray(entity)) {\n clone = [...entity];\n } else {\n clone = { ...entity };\n }\n\n // `removeIfUndefined` deletes the key instead of writing `undefined` — this\n // is what makes `preserve={false}` drop the key from `getFieldsValue()`\n // rather than leaving `{ field: undefined }`.\n if (removeIfUndefined && value === undefined && restPath.length === 1) {\n const child = safeRead(clone, path);\n const leaf = restPath[0]!;\n // Guarded for the same reason as `safeAssign`: a computed `delete` on\n // `__proto__` / `constructor` / `prototype` reaches the prototype chain.\n // Nothing legitimate deletes those, so skipping is the whole behaviour.\n if (child != null && !isUnsafeSegment(leaf)) delete child[leaf];\n } else {\n safeAssign(\n clone,\n path,\n internalSet(safeRead(clone, path), restPath, value, removeIfUndefined),\n );\n }\n return clone;\n}\n\nexport function setValue<T = Store>(\n entity: T,\n paths: InternalNamePath,\n value: any,\n removeIfUndefined = false,\n): T {\n if (\n paths.length &&\n removeIfUndefined &&\n value === undefined &&\n !getValue(entity, paths.slice(0, -1))\n ) {\n return entity;\n }\n return internalSet(entity, paths, value, removeIfUndefined);\n}\n\nfunction isPlainObject(obj: any): boolean {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n}\n\nfunction createEmpty(source: any): any {\n return Array.isArray(source) ? [] : {};\n}\n\n/**\n * Deep merge with ARRAY REPLACEMENT (not concatenation / index merge).\n * `setFieldsValue({ resource: {...} })` partially merges the `resource`\n * object but replaces any array it contains wholesale. Non-plain objects\n * (class instances, records from a data store) are assigned by reference.\n */\nexport function merge<T = Store>(...sources: any[]): T {\n let clone: any = createEmpty(sources[0]);\n\n sources.forEach((src) => {\n const walk = (path: InternalNamePath, loop: Set<any>) => {\n const loopSet = new Set(loop);\n const value = getValue(src, path);\n const isArr = Array.isArray(value);\n if (isArr || isPlainObject(value)) {\n if (loopSet.has(value)) {\n return;\n }\n loopSet.add(value);\n const originValue = getValue(clone, path);\n if (isArr) {\n clone = setValue(clone, path, []);\n } else if (!originValue || typeof originValue !== \"object\") {\n clone = setValue(clone, path, createEmpty(value));\n }\n Reflect.ownKeys(value as object).forEach((key) => {\n if (Object.getOwnPropertyDescriptor(value, key)?.enumerable) {\n walk([...path, key as NamePathSegment], loopSet);\n }\n });\n } else {\n clone = setValue(clone, path, value);\n }\n };\n walk([], new Set());\n });\n\n return clone as T;\n}\n\n/** Build a store containing only the given paths (used by `validateFields`' resolve value). */\nexport function cloneByNamePathList(\n store: Store,\n namePathList: InternalNamePath[],\n): Store {\n let newStore: Store = {};\n namePathList.forEach((namePath) => {\n const value = getValue(store, namePath);\n newStore = setValue(newStore, namePath, value);\n });\n return newStore;\n}\n\n/**\n * Is `namePath` equal to (or, with `partialMatch`, prefixed by) `subNamePath`?\n * `partialMatch` is what makes `validateFields(['resource'], {recursive:true})`\n * reach `['resource','cpu']`.\n */\nexport function matchNamePath(\n namePath: InternalNamePath | undefined | null,\n subNamePath: InternalNamePath | undefined | null,\n partialMatch = false,\n): boolean {\n if (!namePath || !subNamePath) {\n return false;\n }\n if (!partialMatch && namePath.length !== subNamePath.length) {\n return false;\n }\n return subNamePath.every((nameUnit, i) => namePath[i] === nameUnit);\n}\n\nexport function containsNamePath(\n namePathList: InternalNamePath[] | undefined | null,\n namePath: InternalNamePath,\n partialMatch = false,\n): boolean {\n return (\n !!namePathList &&\n namePathList.some((path) => matchNamePath(namePath, path, partialMatch))\n );\n}\n\n/**\n * Pull the next value out of a control's change payload. Mirrors\n * rc-field-form: DOM-ish events expose the value under `event.target[\n * valuePropName]` (so `valuePropName=\"checked\"` reads `target.checked`),\n * everything else is passed through as-is.\n */\nexport function defaultGetValueFromEvent(valuePropName: string, ...args: any[]): any {\n const event = args[0];\n if (\n event &&\n event.target &&\n typeof event.target === \"object\" &&\n valuePropName in event.target\n ) {\n return (event.target as any)[valuePropName];\n }\n return event;\n}\n\nconst SPLIT = \"__@field_split__\";\n\nfunction normalizeKey(namePath: InternalNamePath): string {\n // The `typeof` prefix keeps `['a', 0]` and `['a', '0']` distinct keys —\n // Form.List indices are numbers and object keys are strings.\n return namePath.map((cell) => `${typeof cell}:${cell}`).join(SPLIT);\n}\n\n/** `Map` keyed by name path. */\nexport default class NameMap<T> {\n private kvs = new Map<string, T>();\n\n set(key: InternalNamePath, value: T) {\n this.kvs.set(normalizeKey(key), value);\n }\n\n get(key: InternalNamePath): T | undefined {\n return this.kvs.get(normalizeKey(key));\n }\n\n /** The entry at `key` plus every entry nested underneath it. */\n getAsPrefix(key: InternalNamePath): T[] {\n const normalizedKey = normalizeKey(key);\n const normalizedPrefix = normalizedKey + SPLIT;\n const results: T[] = [];\n const current = this.kvs.get(normalizedKey);\n if (current !== undefined) {\n results.push(current);\n }\n this.kvs.forEach((value, itemNormalizedKey) => {\n if (itemNormalizedKey.startsWith(normalizedPrefix)) {\n results.push(value);\n }\n });\n return results;\n }\n\n update(key: InternalNamePath, updater: (origin: T | undefined) => T | null) {\n const origin = this.get(key);\n const next = updater(origin);\n if (!next) {\n this.delete(key);\n } else {\n this.set(key, next);\n }\n }\n\n delete(key: InternalNamePath) {\n this.kvs.delete(normalizeKey(key));\n }\n\n map<U>(callback: (entry: { key: InternalNamePath; value: T }) => U): U[] {\n return [...this.kvs.entries()].map(([key, value]) => {\n const cells = key.split(SPLIT);\n return callback({\n key: cells.map((cell) => {\n const [, type, unit] = /^([^:]*):(.*)$/.exec(cell) as RegExpExecArray;\n return type === \"number\" ? Number(unit) : unit!;\n }),\n value,\n });\n });\n }\n}\n"],"mappings":";AA0DA,SAAgB,EAAW,GAAwC;CAIjE,OAHI,KAAiC,OAC5B,CAAC,IAEH,MAAM,QAAQ,CAAK,IAAI,IAAQ,CAAC,CAAK;AAC9C;AAOA,SAAgB,EAAY,GAAqD;CAC/E,OAAO,EAAQ,CAAuB;AACxC;AAEA,SAAgB,EAAS,GAAa,GAA6B;CACjE,IAAI,IAAU;CACd,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GAAG;EACvC,IAAI,KAAY,MACd;EAEF,IAAU,EAAQ,EAAK;CACzB;CACA,OAAO;AACT;AAiBA,IAAM,KAAmB,MACvB,MAAQ,eAAe,MAAQ,iBAAiB,MAAQ,aAWpD,KAAc,GAAa,GAAsB,MAAqB;CAC1E,IAAI,EAAgB,CAAG,GAAG;EACxB,OAAO,eAAe,GAAQ,GAAK;GACjC;GACA,YAAY;GACZ,UAAU;GACV,cAAc;EAChB,CAAC;EACD;CACF;CACA,EAAO,KAAO;AAChB,GAGM,KAAY,GAAa,MAA8B;CACvD,SAAU,MAMd,OALI,EAAgB,CAAG,IACd,OAAO,UAAU,eAAe,KAAK,GAAQ,CAAG,IAClD,OAAO,yBAAyB,GAAQ,CAAG,CAAC,EAAE,QAC/C,KAAA,IAEC,EAAO;AAChB;AAEA,SAAS,EACP,GACA,GACA,GACA,GACK;CACL,IAAI,CAAC,EAAM,QACT,OAAO;CAET,IAAM,CAAC,GAAM,GAAG,KAAY,GACxB;CAYJ,IAXA,AAKE,IALE,CAAC,KAAU,OAAO,KAAS,WACrB,CAAC,IACA,MAAM,QAAQ,CAAM,IACrB,CAAC,GAAG,CAAM,IAEV,EAAE,GAAG,EAAO,GAMlB,KAAqB,MAAU,KAAA,KAAa,EAAS,WAAW,GAAG;EACrE,IAAM,IAAQ,EAAS,GAAO,CAAI,GAC5B,IAAO,EAAS;EAItB,AAAI,KAAS,QAAQ,CAAC,EAAgB,CAAI,KAAG,OAAO,EAAM;CAC5D,OACE,EACE,GACA,GACA,EAAY,EAAS,GAAO,CAAI,GAAG,GAAU,GAAO,CAAiB,CACvE;CAEF,OAAO;AACT;AAEA,SAAgB,EACd,GACA,GACA,GACA,IAAoB,IACjB;CASH,OAPE,EAAM,UACN,KACA,MAAU,KAAA,KACV,CAAC,EAAS,GAAQ,EAAM,MAAM,GAAG,EAAE,CAAC,IAE7B,IAEF,EAAY,GAAQ,GAAO,GAAO,CAAiB;AAC5D;AAEA,SAAS,EAAc,GAAmB;CACxC,OACE,OAAO,KAAQ,cACf,KACA,OAAO,eAAe,CAAG,MAAM,OAAO;AAE1C;AAEA,SAAS,EAAY,GAAkB;CACrC,OAAO,MAAM,QAAQ,CAAM,IAAI,CAAC,IAAI,CAAC;AACvC;AAQA,SAAgB,EAAiB,GAAG,GAAmB;CACrD,IAAI,IAAa,EAAY,EAAQ,EAAE;CA8BvC,OA5BA,EAAQ,SAAS,MAAQ;EACvB,IAAM,KAAQ,GAAwB,MAAmB;GACvD,IAAM,IAAU,IAAI,IAAI,CAAI,GACtB,IAAQ,EAAS,GAAK,CAAI,GAC1B,IAAQ,MAAM,QAAQ,CAAK;GACjC,IAAI,KAAS,EAAc,CAAK,GAAG;IACjC,IAAI,EAAQ,IAAI,CAAK,GACnB;IAEF,EAAQ,IAAI,CAAK;IACjB,IAAM,IAAc,EAAS,GAAO,CAAI;IAMxC,AALI,IACF,IAAQ,EAAS,GAAO,GAAM,CAAC,CAAC,KACvB,CAAC,KAAe,OAAO,KAAgB,cAChD,IAAQ,EAAS,GAAO,GAAM,EAAY,CAAK,CAAC,IAElD,QAAQ,QAAQ,CAAe,CAAC,CAAC,SAAS,MAAQ;KAChD,AAAI,OAAO,yBAAyB,GAAO,CAAG,CAAC,EAAE,cAC/C,EAAK,CAAC,GAAG,GAAM,CAAsB,GAAG,CAAO;IAEnD,CAAC;GACH,OACE,IAAQ,EAAS,GAAO,GAAM,CAAK;EAEvC;EACA,EAAK,CAAC,mBAAG,IAAI,IAAI,CAAC;CACpB,CAAC,GAEM;AACT;AAGA,SAAgB,EACd,GACA,GACO;CACP,IAAI,IAAkB,CAAC;CAKvB,OAJA,EAAa,SAAS,MAAa;EACjC,IAAM,IAAQ,EAAS,GAAO,CAAQ;EACtC,IAAW,EAAS,GAAU,GAAU,CAAK;CAC/C,CAAC,GACM;AACT;AAOA,SAAgB,EACd,GACA,GACA,IAAe,IACN;CAOT,OANI,CAAC,KAAY,CAAC,KAGd,CAAC,KAAgB,EAAS,WAAW,EAAY,SAC5C,KAEF,EAAY,OAAO,GAAU,MAAM,EAAS,OAAO,CAAQ;AACpE;AAEA,SAAgB,EACd,GACA,GACA,IAAe,IACN;CACT,OACE,CAAC,CAAC,KACF,EAAa,MAAM,MAAS,EAAc,GAAU,GAAM,CAAY,CAAC;AAE3E;AAQA,SAAgB,EAAyB,GAAuB,GAAG,GAAkB;CACnF,IAAM,IAAQ,EAAK;CASnB,OAPE,KACA,EAAM,UACN,OAAO,EAAM,UAAW,YACxB,KAAiB,EAAM,SAEf,EAAM,OAAe,KAExB;AACT;AAEA,IAAM,IAAQ;AAEd,SAAS,EAAa,GAAoC;CAGxD,OAAO,EAAS,KAAK,MAAS,GAAG,OAAO,EAAK,GAAG,GAAM,CAAC,CAAC,KAAK,CAAK;AACpE;AAGA,IAAqB,IAArB,MAAgC;CAC9B,sBAAc,IAAI,IAAe;CAEjC,IAAI,GAAuB,GAAU;EACnC,KAAK,IAAI,IAAI,EAAa,CAAG,GAAG,CAAK;CACvC;CAEA,IAAI,GAAsC;EACxC,OAAO,KAAK,IAAI,IAAI,EAAa,CAAG,CAAC;CACvC;CAGA,YAAY,GAA4B;EACtC,IAAM,IAAgB,EAAa,CAAG,GAChC,IAAmB,IAAgB,GACnC,IAAe,CAAC,GAChB,IAAU,KAAK,IAAI,IAAI,CAAa;EAS1C,OARI,MAAY,KAAA,KACd,EAAQ,KAAK,CAAO,GAEtB,KAAK,IAAI,SAAS,GAAO,MAAsB;GAC7C,AAAI,EAAkB,WAAW,CAAgB,KAC/C,EAAQ,KAAK,CAAK;EAEtB,CAAC,GACM;CACT;CAEA,OAAO,GAAuB,GAA8C;EAE1E,IAAM,IAAO,EADE,KAAK,IAAI,CACH,CAAM;EAC3B,AAAK,IAGH,KAAK,IAAI,GAAK,CAAI,IAFlB,KAAK,OAAO,CAAG;CAInB;CAEA,OAAO,GAAuB;EAC5B,KAAK,IAAI,OAAO,EAAa,CAAG,CAAC;CACnC;CAEA,IAAO,GAAkE;EACvE,OAAO,CAAC,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAK,OAEjC,EAAS;GACd,KAFY,EAAI,MAAM,CAEjB,CAAA,CAAM,KAAK,MAAS;IACvB,IAAM,GAAG,GAAM,KAAQ,iBAAiB,KAAK,CAAI;IACjD,OAAO,MAAS,WAAW,OAAO,CAAI,IAAI;GAC5C,CAAC;GACD;EACF,CAAC,CACF;CACH;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormInstance, StoreValue } from './interface';
|
|
2
|
+
import { NamePath, Store } from './namePath';
|
|
3
|
+
export interface WatchOptions<Form = FormInstance> {
|
|
4
|
+
form?: Form;
|
|
5
|
+
/** Read the raw store, including values whose field is unmounted. */
|
|
6
|
+
preserve?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function useWatch<Values = StoreValue>(dependencies: NamePath | ((values: Store) => Values), formOrOptions?: FormInstance | WatchOptions): Values;
|
|
9
|
+
export default useWatch;
|
|
10
|
+
/** The nearest `<Form>`'s instance, or `undefined` outside one. */
|
|
11
|
+
export declare function useFormInstance<Values = any>(): FormInstance<Values>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FieldContext as e, FormItemLayoutContext as t, HOOK_MARK as n } from "./context.js";
|
|
2
|
+
import { getNamePath as r, getValue as i } from "./namePath.js";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
//#region src/components/Form/useWatch.ts
|
|
5
|
+
function o(e) {
|
|
6
|
+
try {
|
|
7
|
+
return JSON.stringify(e);
|
|
8
|
+
} catch {
|
|
9
|
+
return Math.random();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function s(e) {
|
|
13
|
+
return e && !!e._init;
|
|
14
|
+
}
|
|
15
|
+
function c(t, c) {
|
|
16
|
+
let l = s(c) ? { form: c } : c ?? {}, u = l.form, d = a.useContext(e), f = u || d, p = !!f && !!f._init, m = (e, n) => {
|
|
17
|
+
let a = l.preserve ? n ?? f.getFieldsValue(!0) : e ?? f.getFieldsValue();
|
|
18
|
+
return typeof t == "function" ? t(a) : i(a, r(t));
|
|
19
|
+
}, [h, g] = a.useState(() => p ? m() : typeof t == "function" ? t({}) : void 0), _ = a.useEffectEvent((e, t) => {
|
|
20
|
+
if (!p) return;
|
|
21
|
+
let n = m(e, t);
|
|
22
|
+
o(h) !== o(n) && g(n);
|
|
23
|
+
}), v = typeof t == "function" ? t : JSON.stringify(t);
|
|
24
|
+
return a.useEffect(() => {
|
|
25
|
+
if (!p) return;
|
|
26
|
+
let e = f.getInternalHooks(n)?.registerWatch, t = e?.((e, t) => {
|
|
27
|
+
_(e, t);
|
|
28
|
+
});
|
|
29
|
+
return _(), t;
|
|
30
|
+
}, [
|
|
31
|
+
p,
|
|
32
|
+
f,
|
|
33
|
+
v
|
|
34
|
+
]), h;
|
|
35
|
+
}
|
|
36
|
+
function l() {
|
|
37
|
+
let { form: e } = a.useContext(t);
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { c as default, l as useFormInstance };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=useWatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWatch.js","names":[],"sources":["../../../src/components/Form/useWatch.ts"],"sourcesContent":["/**\n * `Form.useWatch` and `Form.useFormInstance`.\n *\n * `{ preserve: true }` reads the raw store rather than the registered-field\n * projection, so a value whose field is unmounted is still observed. Paths are\n * absolute even inside a `Form.List`, because `useWatch` reads from the form\n * instance, never from `prefixName`.\n *\n * Change detection is by JSON stringification, matching upstream, so a watcher\n * on an object path settles instead of re-rendering on every new identity.\n */\nimport { FieldContext, FormItemLayoutContext, HOOK_MARK } from \"./context\";\nimport type { FormInstance, InternalFormInstance, StoreValue } from \"./interface\";\nimport { getNamePath, getValue, type NamePath, type Store } from \"./namePath\";\nimport * as React from \"react\";\n\nfunction stringify(value: any): string | number {\n try {\n return JSON.stringify(value);\n } catch {\n return Math.random();\n }\n}\n\nfunction isFormInstance(form: any): form is InternalFormInstance {\n return form && !!form._init;\n}\n\nexport interface WatchOptions<Form = FormInstance> {\n form?: Form;\n /** Read the raw store, including values whose field is unmounted. */\n preserve?: boolean;\n}\n\nfunction useWatch<Values = StoreValue>(\n dependencies: NamePath | ((values: Store) => Values),\n formOrOptions?: FormInstance | WatchOptions,\n): Values {\n const options: WatchOptions = isFormInstance(formOrOptions)\n ? { form: formOrOptions }\n : ((formOrOptions ?? {}) as WatchOptions);\n const form = options.form as InternalFormInstance | undefined;\n\n const fieldContext = React.useContext(FieldContext);\n const formInstance = (form || fieldContext) as InternalFormInstance;\n const isValidForm = !!formInstance && !!formInstance._init;\n\n const read = (values?: Store, allValues?: Store) => {\n const watchValue = options.preserve\n ? (allValues ?? formInstance.getFieldsValue(true))\n : (values ?? formInstance.getFieldsValue());\n return typeof dependencies === \"function\"\n ? (dependencies as any)(watchValue)\n : getValue(watchValue, getNamePath(dependencies as NamePath));\n };\n\n // Seed from the store rather than from `undefined`. Upstream starts empty\n // and syncs in a mount effect; reading here removes that extra render (and\n // the `undefined` flash a `useWatch`-gated subtree shows because of it).\n // Fields that register AFTER this hook still reach us: `registerField`\n // notifies every watcher, and that notification is batched onto a\n // macrotask, by which point the subscription below is in place.\n const [value, setValue] = React.useState<any>(() =>\n isValidForm\n ? read()\n : typeof dependencies === \"function\"\n ? (dependencies as any)({})\n : undefined,\n );\n\n /**\n * Stable across renders while always reading the latest `dependencies` /\n * `value` / `options`. That combination is the whole point: the watcher is\n * registered ONCE (re-registering on every render would churn the store's\n * subscriber set), yet a selector function redefined inline at the call\n * site must still be the one that runs.\n */\n const triggerUpdate = React.useEffectEvent((values?: Store, allValues?: Store) => {\n if (!isValidForm) return;\n const nextValue = read(values, allValues);\n // Compare by serialisation, not identity: the store hands back a fresh\n // object on every write, so identity comparison would never settle.\n if (stringify(value) !== stringify(nextValue)) {\n setValue(nextValue);\n }\n });\n\n // A selector function has no stable serialisation, so it identifies itself.\n const flattenDeps =\n typeof dependencies === \"function\" ? dependencies : JSON.stringify(dependencies);\n\n React.useEffect(() => {\n if (!isValidForm) return undefined;\n const registerWatch = formInstance.getInternalHooks(HOOK_MARK)?.registerWatch;\n const cancel = registerWatch?.((values, allValues) => {\n triggerUpdate(values, allValues);\n });\n // Re-read once the WATCHED PATH itself changes (not the value — the store\n // notifies us for that). This matters for dynamic paths such as\n // `useWatch(['rows', index, 'slot'])`, where removing a list row shifts\n // the index: without this the hook keeps reporting the OLD row's value\n // until some unrelated write happens to notify the watchers.\n // The `useState` seed above covers mount, so this only fires on a genuine\n // path change: a synchronisation against the form store.\n triggerUpdate();\n return cancel;\n // `triggerUpdate` is recreated every render; these are the real triggers.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isValidForm, formInstance, flattenDeps]);\n\n return value;\n}\n\nexport default useWatch;\n\n/** The nearest `<Form>`'s instance, or `undefined` outside one. */\nexport function useFormInstance<Values = any>(): FormInstance<Values> {\n const { form } = React.useContext(FormItemLayoutContext);\n return form as FormInstance<Values>;\n}\n"],"mappings":";;;;AAgBA,SAAS,EAAU,GAA6B;CAC9C,IAAI;EACF,OAAO,KAAK,UAAU,CAAK;CAC7B,QAAQ;EACN,OAAO,KAAK,OAAO;CACrB;AACF;AAEA,SAAS,EAAe,GAAyC;CAC/D,OAAO,KAAQ,CAAC,CAAC,EAAK;AACxB;AAQA,SAAS,EACP,GACA,GACQ;CACR,IAAM,IAAwB,EAAe,CAAa,IACtD,EAAE,MAAM,EAAc,IACpB,KAAiB,CAAC,GAClB,IAAO,EAAQ,MAEf,IAAe,EAAM,WAAW,CAAY,GAC5C,IAAgB,KAAQ,GACxB,IAAc,CAAC,CAAC,KAAgB,CAAC,CAAC,EAAa,OAE/C,KAAQ,GAAgB,MAAsB;EAClD,IAAM,IAAa,EAAQ,WACtB,KAAa,EAAa,eAAe,EAAI,IAC7C,KAAU,EAAa,eAAe;EAC3C,OAAO,OAAO,KAAiB,aAC1B,EAAqB,CAAU,IAChC,EAAS,GAAY,EAAY,CAAwB,CAAC;CAChE,GAQM,CAAC,GAAO,KAAY,EAAM,eAC9B,IACI,EAAK,IACL,OAAO,KAAiB,aACrB,EAAqB,CAAC,CAAC,IACxB,KAAA,CACR,GASM,IAAgB,EAAM,gBAAgB,GAAgB,MAAsB;EAChF,IAAI,CAAC,GAAa;EAClB,IAAM,IAAY,EAAK,GAAQ,CAAS;EAGxC,AAAI,EAAU,CAAK,MAAM,EAAU,CAAS,KAC1C,EAAS,CAAS;CAEtB,CAAC,GAGK,IACJ,OAAO,KAAiB,aAAa,IAAe,KAAK,UAAU,CAAY;CAqBjF,OAnBA,EAAM,gBAAgB;EACpB,IAAI,CAAC,GAAa;EAClB,IAAM,IAAgB,EAAa,iBAAiB,CAAS,CAAC,EAAE,eAC1D,IAAS,KAAiB,GAAQ,MAAc;GACpD,EAAc,GAAQ,CAAS;EACjC,CAAC;EASD,OADA,EAAc,GACP;CAGT,GAAG;EAAC;EAAa;EAAc;CAAW,CAAC,GAEpC;AACT;AAKA,SAAgB,IAAsD;CACpE,IAAM,EAAE,YAAS,EAAM,WAAW,CAAqB;CACvD,OAAO;AACT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RuleObject, StoreValue, ValidateMessages } from './interface';
|
|
2
|
+
import { InternalNamePath, toArray } from './namePath';
|
|
3
|
+
/**
|
|
4
|
+
* Validate one field's value against its rules.
|
|
5
|
+
*
|
|
6
|
+
* ALWAYS REJECTS in the default (parallel) mode — with a `RuleError[]` that
|
|
7
|
+
* may well be empty. This is upstream's contract and both `Field` and
|
|
8
|
+
* `FormStore` are written against it: the caller partitions the array into
|
|
9
|
+
* errors and warnings by each rule's `warningOnly`, and an empty array means
|
|
10
|
+
* "valid". `validateFirst === true` instead resolves `[]` on success.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateRules(namePath: InternalNamePath, value: StoreValue, rules: RuleObject[], messages: ValidateMessages, validateFirst?: boolean | "parallel", messageVariables?: Record<string, string>): Promise<{
|
|
13
|
+
errors: any[];
|
|
14
|
+
rule: RuleObject;
|
|
15
|
+
}[]>;
|
|
16
|
+
export { toArray };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import "./namePath.js";
|
|
2
|
+
import { cloneElement as e, isValidElement as t } from "react";
|
|
3
|
+
//#region src/components/Form/validate.ts
|
|
4
|
+
var n = "CODE_LOGIC_ERROR", r = /%[sdj%]/g;
|
|
5
|
+
function i(e, ...t) {
|
|
6
|
+
let n = 0, i = t.length;
|
|
7
|
+
return typeof e == "function" ? e(...t) : typeof e == "string" ? e.replace(r, (e) => {
|
|
8
|
+
if (e === "%%") return "%";
|
|
9
|
+
if (n >= i) return e;
|
|
10
|
+
switch (e) {
|
|
11
|
+
case "%s": return String(t[n++]);
|
|
12
|
+
case "%d": return String(Number(t[n++]));
|
|
13
|
+
case "%j": try {
|
|
14
|
+
return JSON.stringify(t[n++]);
|
|
15
|
+
} catch {
|
|
16
|
+
return "[Circular]";
|
|
17
|
+
}
|
|
18
|
+
default: return e;
|
|
19
|
+
}
|
|
20
|
+
}) : e;
|
|
21
|
+
}
|
|
22
|
+
function a(e, t) {
|
|
23
|
+
return e.replace(/\\?\$\{\w+\}/g, (e) => e.startsWith("\\") ? e.slice(1) : t[e.slice(2, -1)]);
|
|
24
|
+
}
|
|
25
|
+
var o = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/, s;
|
|
26
|
+
function c() {
|
|
27
|
+
if (s) return s;
|
|
28
|
+
let e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", t = "[a-fA-F\\d]{1,4}", n = `(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${e}|${`(?:${[
|
|
29
|
+
`(?:${t}:){7}(?:${t}|:)`,
|
|
30
|
+
`(?:${t}:){6}(?:${e}|:${t}|:)`,
|
|
31
|
+
`(?:${t}:){5}(?::${e}|(?::${t}){1,2}|:)`,
|
|
32
|
+
`(?:${t}:){4}(?:(?::${t}){0,1}:${e}|(?::${t}){1,3}|:)`,
|
|
33
|
+
`(?:${t}:){3}(?:(?::${t}){0,2}:${e}|(?::${t}){1,4}|:)`,
|
|
34
|
+
`(?:${t}:){2}(?:(?::${t}){0,3}:${e}|(?::${t}){1,5}|:)`,
|
|
35
|
+
`(?:${t}:){1}(?:(?::${t}){0,4}:${e}|(?::${t}){1,6}|:)`,
|
|
36
|
+
`(?::(?:(?::${t}){0,5}:${e}|(?::${t}){1,7}|:))`
|
|
37
|
+
].join("|")})(?:%[0-9a-zA-Z]{1,})?`}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;
|
|
38
|
+
return s = RegExp(`(?:^${n}$)`, "i"), s;
|
|
39
|
+
}
|
|
40
|
+
var l = {
|
|
41
|
+
number: (e) => !isNaN(e) && typeof e == "number",
|
|
42
|
+
object: (e) => typeof e == "object" && !Array.isArray(e),
|
|
43
|
+
email: (e) => typeof e == "string" && e.length <= 320 && o.test(e),
|
|
44
|
+
url: (e) => typeof e == "string" && e.length <= 2048 && c().test(e)
|
|
45
|
+
};
|
|
46
|
+
function u(e) {
|
|
47
|
+
return e === "string" || e === "url" || e === "email" || e === "pattern";
|
|
48
|
+
}
|
|
49
|
+
function d(e, t) {
|
|
50
|
+
return !!(e == null || t === "array" && Array.isArray(e) && !e.length || u(t) && typeof e == "string" && !e);
|
|
51
|
+
}
|
|
52
|
+
function f({ rule: e, value: t, name: n, messages: r, errors: a }, o) {
|
|
53
|
+
e.required && d(t, o || e.type) && a.push(i(r.required, n));
|
|
54
|
+
}
|
|
55
|
+
function p({ rule: e, value: t, name: n, messages: r, errors: a }) {
|
|
56
|
+
if (e.required && t === void 0) {
|
|
57
|
+
f({
|
|
58
|
+
rule: e,
|
|
59
|
+
value: t,
|
|
60
|
+
name: n,
|
|
61
|
+
messages: r,
|
|
62
|
+
errors: a
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let o = e.type, s = l[o];
|
|
67
|
+
s ? s(t) || a.push(i(r.types?.[o], n, o)) : o && typeof t !== o && a.push(i(r.types?.[o], n, o));
|
|
68
|
+
}
|
|
69
|
+
var m = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
70
|
+
function h({ rule: e, value: t, name: n, messages: r, errors: a }) {
|
|
71
|
+
let o = typeof e.min == "number", s = typeof e.max == "number", c, l;
|
|
72
|
+
if (typeof t == "number") l = "number", c = t;
|
|
73
|
+
else if (typeof t == "string") l = "string", c = t.replace(m, "_").length;
|
|
74
|
+
else if (Array.isArray(t)) l = "array", c = t.length;
|
|
75
|
+
else return;
|
|
76
|
+
let u = r[l];
|
|
77
|
+
o && !s && c < e.min ? a.push(i(u?.min, n, e.min)) : s && !o && c > e.max ? a.push(i(u?.max, n, e.max)) : o && s && (c < e.min || c > e.max) && a.push(i(u?.range, n, e.min, e.max));
|
|
78
|
+
}
|
|
79
|
+
function g({ rule: e, value: t, name: n, messages: r, errors: a }) {
|
|
80
|
+
e.pattern instanceof RegExp && (e.pattern.lastIndex = 0, e.pattern.test(t) || a.push(i(r.pattern?.mismatch, n, t, e.pattern)));
|
|
81
|
+
}
|
|
82
|
+
function _({ value: e, name: t, messages: n, errors: r }) {
|
|
83
|
+
(/^\s+$/.test(e) || e === "") && r.push(i(n.whitespace, t));
|
|
84
|
+
}
|
|
85
|
+
function v(e, t) {
|
|
86
|
+
let { rule: n, value: r } = t;
|
|
87
|
+
switch (e) {
|
|
88
|
+
case "required":
|
|
89
|
+
f(t, Array.isArray(r) ? "array" : typeof r);
|
|
90
|
+
return;
|
|
91
|
+
case "number": {
|
|
92
|
+
let e = {
|
|
93
|
+
...t,
|
|
94
|
+
value: r === "" ? void 0 : r
|
|
95
|
+
};
|
|
96
|
+
if (d(e.value) && !n.required) return;
|
|
97
|
+
f(e), e.value !== void 0 && (p(e), h(e));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
case "object":
|
|
101
|
+
if (d(r) && !n.required) return;
|
|
102
|
+
f(t), r !== void 0 && p(t);
|
|
103
|
+
return;
|
|
104
|
+
case "email":
|
|
105
|
+
case "url":
|
|
106
|
+
if (d(r, e) && !n.required) return;
|
|
107
|
+
f(t, e), d(r, e) || p(t);
|
|
108
|
+
return;
|
|
109
|
+
case "pattern":
|
|
110
|
+
if (d(r, "string") && !n.required) return;
|
|
111
|
+
f(t), d(r, "string") || g(t);
|
|
112
|
+
return;
|
|
113
|
+
default:
|
|
114
|
+
if (d(r, "string") && !n.required) return;
|
|
115
|
+
f(t, "string"), d(r, "string") || (p(t), h(t), g(t), n.whitespace === !0 && _(t));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function y(e, t) {
|
|
119
|
+
return new Promise((r) => {
|
|
120
|
+
let i = !1, a = !1, o = (e) => {
|
|
121
|
+
i || (i = !0, r(e));
|
|
122
|
+
}, s = (...e) => {
|
|
123
|
+
Promise.resolve().then(() => {
|
|
124
|
+
a || o(e.length ? e[0] : void 0);
|
|
125
|
+
});
|
|
126
|
+
}, c;
|
|
127
|
+
try {
|
|
128
|
+
c = e.validator(e, t, s);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.error(e), o(n);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
a = !!c && typeof c.then == "function" && typeof c.catch == "function", a && c.then(() => o(void 0), (e) => o(e || " "));
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function b(e) {
|
|
137
|
+
let t = Object.keys(e).filter((e) => e !== "message");
|
|
138
|
+
return t.length === 1 && t[0] === "required" ? "required" : e.type === void 0 && e.pattern instanceof RegExp ? "pattern" : e.type ?? "string";
|
|
139
|
+
}
|
|
140
|
+
async function x(r, i, o, s, c) {
|
|
141
|
+
let l = [], u = o;
|
|
142
|
+
if (o.validator) {
|
|
143
|
+
let e = await y(o, i);
|
|
144
|
+
l = e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
145
|
+
} else {
|
|
146
|
+
let e = b(o);
|
|
147
|
+
u = {
|
|
148
|
+
...o,
|
|
149
|
+
type: e === "required" ? o.type : e
|
|
150
|
+
};
|
|
151
|
+
let t = {
|
|
152
|
+
rule: u,
|
|
153
|
+
value: i,
|
|
154
|
+
name: r,
|
|
155
|
+
messages: s,
|
|
156
|
+
errors: []
|
|
157
|
+
};
|
|
158
|
+
v(e, t), l = t.errors;
|
|
159
|
+
}
|
|
160
|
+
l.length && o.message !== void 0 && o.message !== null && (l = [].concat(o.message));
|
|
161
|
+
let d = l.map((r, i) => {
|
|
162
|
+
let a = r && r.message !== void 0 ? r.message : typeof r == "function" ? r() : r, o = a === n ? s.default : a;
|
|
163
|
+
return t(o) ? e(o, { key: `error_${i}` }) : o;
|
|
164
|
+
}), f = {
|
|
165
|
+
...u,
|
|
166
|
+
name: r,
|
|
167
|
+
label: r,
|
|
168
|
+
...c
|
|
169
|
+
};
|
|
170
|
+
return d.map((e) => typeof e == "string" ? a(e, f) : e);
|
|
171
|
+
}
|
|
172
|
+
function S(e, t, n, r, i, a) {
|
|
173
|
+
let o = e.join("."), s = n.map((e, t) => ({
|
|
174
|
+
rule: e,
|
|
175
|
+
ruleIndex: t
|
|
176
|
+
})).sort((e, t) => !!e.rule.warningOnly == !!t.rule.warningOnly ? e.ruleIndex - t.ruleIndex : e.rule.warningOnly ? 1 : -1).map(({ rule: e }) => e), c;
|
|
177
|
+
if (i === !0) c = new Promise((e, n) => {
|
|
178
|
+
(async () => {
|
|
179
|
+
for (let e = 0; e < s.length; e += 1) {
|
|
180
|
+
let i = s[e], c = await x(o, t, i, r, a);
|
|
181
|
+
if (c.length) {
|
|
182
|
+
n([{
|
|
183
|
+
errors: c,
|
|
184
|
+
rule: i
|
|
185
|
+
}]);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
e([]);
|
|
190
|
+
})();
|
|
191
|
+
});
|
|
192
|
+
else {
|
|
193
|
+
let e = s.map((e) => x(o, t, e, r, a).then((t) => ({
|
|
194
|
+
errors: t,
|
|
195
|
+
rule: e
|
|
196
|
+
})));
|
|
197
|
+
c = (i ? C(e) : Promise.all(e)).then((e) => Promise.reject(e));
|
|
198
|
+
}
|
|
199
|
+
return c.catch((e) => e), c;
|
|
200
|
+
}
|
|
201
|
+
function C(e) {
|
|
202
|
+
let t = 0;
|
|
203
|
+
return new Promise((n) => {
|
|
204
|
+
e.forEach((r) => {
|
|
205
|
+
r.then((r) => {
|
|
206
|
+
r.errors.length && n([r]), t += 1, t === e.length && n([]);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
export { S as validateRules };
|
|
213
|
+
|
|
214
|
+
//# sourceMappingURL=validate.js.map
|