├── .github ├── pull_request_template.md └── workflows │ └── dotnet.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── 20210427112456.png ├── BlazorComponent32_32.png ├── empty.md └── logo-v.png └── src ├── BlazorComponent.sln ├── Component ├── BlazorComponent.Web │ ├── build-js.ps1 │ ├── package.json │ ├── rollup.config.activatable.ts │ ├── rollup.config.drawflow.ts │ ├── rollup.config.echarts.ts │ ├── rollup.config.gridstack.ts │ ├── rollup.config.input.ts │ ├── rollup.config.intersect.ts │ ├── rollup.config.maps.ts │ ├── rollup.config.markdownit.ts │ ├── rollup.config.monaco-editor.ts │ ├── rollup.config.outsideclick.ts │ ├── rollup.config.pageStack.ts │ ├── rollup.config.resize.ts │ ├── rollup.config.scrollStrategies.ts │ ├── rollup.config.scrollToTargetJSInterop.ts │ ├── rollup.config.sortable.ts │ ├── rollup.config.swiper.ts │ ├── rollup.config.transition.ts │ ├── rollup.config.ts │ ├── rollup.config.xgplayer.ts │ ├── src │ │ ├── components │ │ │ ├── overlay │ │ │ │ └── scrollStrategies.ts │ │ │ ├── page-stack │ │ │ │ └── index.ts │ │ │ ├── scroll-to-target │ │ │ │ └── index.ts │ │ │ └── slider │ │ │ │ └── index.ts │ │ ├── events │ │ │ ├── EventType.ts │ │ │ ├── extra.ts │ │ │ └── index.ts │ │ ├── globals.d.ts │ │ ├── interop.ts │ │ ├── main.ts │ │ ├── mixins │ │ │ ├── activatable │ │ │ │ └── index.ts │ │ │ ├── delayable │ │ │ │ └── index.ts │ │ │ ├── input │ │ │ │ └── index.ts │ │ │ ├── intersect │ │ │ │ └── index.ts │ │ │ ├── outside-click │ │ │ │ └── index.ts │ │ │ └── resize │ │ │ │ └── index.ts │ │ ├── proxies │ │ │ ├── drawflow │ │ │ │ └── index.ts │ │ │ ├── echarts │ │ │ │ └── index.ts │ │ │ ├── gridstack │ │ │ │ └── index.ts │ │ │ ├── maps │ │ │ │ └── baidumap │ │ │ │ │ └── index.js │ │ │ ├── markdown-it │ │ │ │ ├── highlighter.ts │ │ │ │ └── index.ts │ │ │ ├── monaco-editor │ │ │ │ └── index.ts │ │ │ ├── sortable │ │ │ │ └── index.ts │ │ │ ├── swiper │ │ │ │ └── index.ts │ │ │ └── xgplayer │ │ │ │ └── index.ts │ │ ├── ripple │ │ │ ├── index.ts │ │ │ └── ripple.ts │ │ ├── transition │ │ │ └── index.ts │ │ └── utils │ │ │ ├── blazor.ts │ │ │ ├── getScrollParent.ts │ │ │ └── helper.ts │ ├── tsconfig.json │ ├── types │ │ ├── highlightjs │ │ │ └── index.d.ts │ │ ├── markdown-it │ │ │ └── index.d.ts │ │ └── prism │ │ │ └── index.d.ts │ └── yarn.lock └── BlazorComponent │ ├── Abstracts │ ├── AbstractComponentActivator.cs │ ├── AbstractMetadata.cs │ ├── BlockOrElement.cs │ ├── Builder │ │ ├── AttributesBuilder.cs │ │ ├── AttributesDictionary.cs │ │ ├── BemCssBuilder.cs │ │ ├── BuilderBase.cs │ │ ├── BuilderContext.cs │ │ ├── CssBuilder.cs │ │ ├── StyleBuilder.cs │ │ └── ThemeCssBuilder.cs │ ├── ComponentAbstractProvider.cs │ ├── ComponentBemCssProvider.cs │ ├── ComponentCssProvider.cs │ ├── ComponentKey.cs │ ├── Components │ │ ├── AbstractComponent.cs │ │ ├── BComponentBase.cs │ │ ├── BDomComponentBase.cs │ │ ├── ComponentPartBase.cs │ │ ├── CssProviderComponentBase.cs │ │ ├── EmptyComponent.cs │ │ ├── IComponentPart.cs │ │ ├── IHasProviderComponent.cs │ │ └── NextTickComponentBase.cs │ ├── IAbstractComponentTypeMapper.cs │ └── Watcher │ │ ├── IObservableProperty.cs │ │ ├── MemberAccessVisitor.cs │ │ ├── ObservableObject.cs │ │ ├── ObservableProperty.cs │ │ ├── ObservableProperty`.cs │ │ └── PropertyWatcher.cs │ ├── Attributes │ ├── MasaApiParameterAttribute.cs │ └── MasaApiPublicMethodAttribute.cs │ ├── BlazorComponent.csproj │ ├── BlazorComponent.xml │ ├── Components │ ├── Autocomplete │ │ ├── AutocompleteAbstractProvider.cs │ │ ├── IAutocomplete.cs │ │ └── Selections │ │ │ ├── BAutocompleteSelections.razor │ │ │ └── BAutocompleteSelections.razor.cs │ ├── Breadcrumbs │ │ └── BreadcrumbItem.cs │ ├── Button │ │ ├── BButton.razor │ │ ├── BButton.razor.cs │ │ └── IButton.cs │ ├── Carousel │ │ ├── BCarouselItemDefaultSlot.razor │ │ ├── BCarouselItemDefaultSlot.razor.cs │ │ ├── Controls │ │ │ ├── BCarouselDelimiters.razor │ │ │ └── BCarouselDelimiters.razor.cs │ │ ├── ICarousel.cs │ │ └── Progress │ │ │ ├── BCarouselProgress.razor │ │ │ └── BCarouselProgress.razor.cs │ ├── Cascader │ │ ├── CascaderAbstractProviderExtensions.cs │ │ ├── CascaderColumn │ │ │ ├── BCascaderColumn.razor │ │ │ └── BCascaderColumn.razor.cs │ │ ├── ICascader.cs │ │ └── Menu │ │ │ └── List │ │ │ ├── BCascaderList.razor │ │ │ └── BCascaderList.razor.cs │ ├── CascadingValue │ │ └── BCascadingValue.cs │ ├── Checkbox │ │ ├── BCheckboxCheckbox.razor │ │ ├── BCheckboxCheckbox.razor.cs │ │ ├── BCheckboxDefaultSlot.razor │ │ ├── BCheckboxDefaultSlot.razor.cs │ │ ├── BSimpleCheckbox.razor │ │ ├── BSimpleCheckbox.razor.cs │ │ └── ICheckbox.cs │ ├── Chip │ │ ├── BChip.razor │ │ ├── BChip.razor.cs │ │ ├── BChipAbstractProviderExtensions.cs │ │ ├── Content │ │ │ ├── BChipContent.razor │ │ │ ├── BChipContent.razor.cs │ │ │ ├── Close │ │ │ │ ├── BChipClose.razor │ │ │ │ └── BChipClose.razor.cs │ │ │ └── Filter │ │ │ │ ├── BChipFilter.razor │ │ │ │ └── BChipFilter.razor.cs │ │ └── IChip.cs │ ├── Counter │ │ ├── BCounter.razor │ │ └── BCounter.razor.cs │ ├── DatePicker │ │ └── DatePickerType.cs │ ├── DefaultsProvider │ │ ├── BDefaultsProvider.cs │ │ └── IDefaultsProvider.cs │ ├── Divider │ │ ├── BDivider.razor │ │ └── BDivider.razor.cs │ ├── DragZone │ │ ├── BDragDropService.cs │ │ ├── BDragItem.razor │ │ ├── BDragItem.razor.cs │ │ ├── BDragZone.razor │ │ └── BDragZone.razor.cs │ ├── Element │ │ └── Element.cs │ ├── ErrorHandler │ │ └── IErrorHandler.cs │ ├── ExpansionPanels │ │ ├── BExpansionPanel.razor │ │ ├── BExpansionPanel.razor.cs │ │ ├── BExpansionPanelContent.razor │ │ ├── BExpansionPanelContent.razor.cs │ │ ├── BExpansionPanelHeader.razor │ │ ├── BExpansionPanelHeader.razor.cs │ │ ├── BExpansionPanels.razor │ │ └── BExpansionPanels.razor.cs │ ├── FileInput │ │ ├── BFileInputInput.razor │ │ ├── BFileInputInput.razor.cs │ │ ├── IFileInput.cs │ │ └── Selections │ │ │ ├── BFileInputSelections.razor │ │ │ ├── BFileInputSelections.razor.cs │ │ │ ├── Chips │ │ │ ├── BFileInputChips.razor │ │ │ └── BFileInputChips.razor.cs │ │ │ └── SelectionText │ │ │ ├── BFileInputSelectionText.razor │ │ │ └── BFileInputSelectionText.razor.cs │ ├── Form │ │ ├── BForm.razor │ │ ├── BForm.razor.cs │ │ ├── EditContext │ │ │ ├── EditContextExtensions.cs │ │ │ ├── FormContext.cs │ │ │ └── ValidationEventSubscriptions.cs │ │ ├── EnumerableValidationAttribute.cs │ │ ├── EnumerableValidationResult.cs │ │ ├── ValidationResult.cs │ │ └── ValidationResultTypes.cs │ ├── Grid │ │ ├── AlignContentTypes.cs │ │ ├── AlignTypes.cs │ │ └── JustifyTypes.cs │ ├── Hover │ │ ├── BHover.razor │ │ ├── BHover.razor.cs │ │ └── HoverProps.cs │ ├── Icon │ │ ├── BIcon.razor │ │ ├── BIcon.razor.cs │ │ ├── IIcon.cs │ │ ├── Icon.cs │ │ ├── IconType.cs │ │ └── SvgPath.cs │ ├── Image │ │ ├── BImage.razor.cs │ │ ├── BImageBody.razor │ │ ├── BImageBody.razor.cs │ │ ├── Content │ │ │ ├── BImageContent.razor │ │ │ └── BImageContent.razor.cs │ │ ├── IImage.cs │ │ └── PlaceholderSlot │ │ │ ├── BPlaceholderSlot.razor │ │ │ └── BPlaceholderSlot.razor.cs │ ├── Input │ │ ├── BInput.razor │ │ ├── BInput.razor.Validatable.cs │ │ ├── BInput.razor.cs │ │ ├── Content │ │ │ ├── AppendSlot │ │ │ │ ├── BInputAppendSlot.razor │ │ │ │ ├── BInputAppendSlot.razor.cs │ │ │ │ ├── Icon │ │ │ │ │ ├── BInputIcon.razor │ │ │ │ │ └── BInputIcon.razor.cs │ │ │ │ └── Slot │ │ │ │ │ ├── BInputSlot.razor │ │ │ │ │ └── BInputSlot.razor.cs │ │ │ ├── BInputContent.razor │ │ │ ├── BInputContent.razor.cs │ │ │ ├── Control │ │ │ │ ├── BInputControl.razor │ │ │ │ ├── BInputControl.razor.cs │ │ │ │ ├── InputSlot │ │ │ │ │ ├── BInputInputSlot.razor │ │ │ │ │ ├── BInputInputSlot.razor.cs │ │ │ │ │ └── DefaultSlot │ │ │ │ │ │ ├── BInputDefaultSlot.razor │ │ │ │ │ │ ├── BInputDefaultSlot.razor.cs │ │ │ │ │ │ └── Label │ │ │ │ │ │ ├── BInputLabel.razor │ │ │ │ │ │ └── BInputLabel.razor.cs │ │ │ │ └── Messages │ │ │ │ │ ├── BInputMessages.razor │ │ │ │ │ └── BInputMessages.razor.cs │ │ │ └── PrependSlot │ │ │ │ ├── BInputPrependSlot.razor │ │ │ │ └── BInputPrependSlot.razor.cs │ │ ├── IInput.cs │ │ ├── IInputJsCallbacks.cs │ │ ├── IValidatable.cs │ │ ├── InputAbstractProviderExtensions.cs │ │ ├── InputJSModule.cs │ │ └── InternalValueChangeType.cs │ ├── ItemGroup │ │ ├── BButtonGroup.razor.cs │ │ ├── BGroupItem.razor.cs │ │ ├── BItem.razor │ │ ├── BItem.razor.cs │ │ ├── BItemGroup.razor │ │ ├── BItemGroup.razor.cs │ │ ├── BRoutableGroupItem.razor.cs │ │ ├── IItem.cs │ │ ├── ItemContext.cs │ │ └── ItemGroupBase.cs │ ├── Label │ │ ├── BLabel.razor │ │ └── BLabel.razor.cs │ ├── List │ │ ├── BList.razor │ │ ├── BList.razor.cs │ │ ├── BListGroup.razor │ │ ├── BListGroup.razor.cs │ │ ├── BListItem.razor │ │ ├── BListItem.razor.cs │ │ ├── BListItemAction.razor │ │ ├── BListItemAction.razor.cs │ │ ├── BListItemActionText.razor │ │ ├── BListItemActionText.razor.cs │ │ ├── BListItemContent.razor │ │ ├── BListItemContent.razor.cs │ │ ├── BListItemIcon.razor │ │ ├── BListItemIcon.razor.cs │ │ ├── BListItemSubtitle.razor │ │ ├── BListItemSubtitle.razor.cs │ │ ├── BListItemTitle.razor │ │ └── BListItemTitle.razor.cs │ ├── Menu │ │ ├── BMenu.razor │ │ ├── BMenu.razor.cs │ │ └── BMenuProps.cs │ ├── Messages │ │ ├── BMessages.razor │ │ ├── BMessages.razor.cs │ │ ├── Children │ │ │ ├── BMessagesChildren.razor │ │ │ ├── BMessagesChildren.razor.cs │ │ │ └── Message │ │ │ │ ├── BMessagesMessage.razor │ │ │ │ └── BMessagesMessage.razor.cs │ │ └── IMessages.cs │ ├── MobilePicker │ │ ├── BMobilePickerColumn.razor │ │ ├── BMobilePickerColumn.razor.cs │ │ ├── BMobilePickerView.razor │ │ ├── BMobilePickerView.razor.cs │ │ └── MobilePickerColumn.cs │ ├── OtpInput │ │ ├── BOtpInput.razor │ │ ├── BOtpInput.razor.cs │ │ ├── BOtpInputEventArgs.cs │ │ ├── IOtpInput.cs │ │ ├── OtpInputType.cs │ │ ├── OtpJsResult.cs │ │ └── slot │ │ │ ├── BOtpInputSlot.razor │ │ │ ├── BOtpInputSlot.razor.cs │ │ │ └── BOtpInputSlotItem.cs │ ├── ProgressCircular │ │ ├── BProgressCircular.razor │ │ ├── BProgressCircular.razor.cs │ │ ├── IProgressCircular.cs │ │ ├── Info │ │ │ ├── BProgressCircularInfo.razor │ │ │ └── BProgressCircularInfo.razor.cs │ │ ├── ProgressCircularAbstractProviderExtensions.cs │ │ └── Svg │ │ │ ├── BProgressCircularSvg.razor │ │ │ ├── BProgressCircularSvg.razor.cs │ │ │ └── Circle │ │ │ ├── BProgressCircularCircle.razor │ │ │ └── BProgressCircularCircle.razor.cs │ ├── ProgressLinear │ │ ├── BProgressLinear.razor │ │ ├── BProgressLinear.razor.cs │ │ ├── Background │ │ │ ├── BProgressLinearBackground.razor │ │ │ └── BProgressLinearBackground.razor.cs │ │ ├── Buffer │ │ │ ├── BProgressLinearBuffer.razor │ │ │ └── BProgressLinearBuffer.razor.cs │ │ ├── Content │ │ │ ├── BProgressLinearContent.razor │ │ │ └── BProgressLinearContent.razor.cs │ │ ├── Determinate │ │ │ ├── BProgressLinearDeterminate.razor │ │ │ └── BProgressLinearDeterminate.razor.cs │ │ ├── IProgressLinear.cs │ │ ├── Indeterminate │ │ │ ├── BProgressLinearIndeterminate.razor │ │ │ └── BProgressLinearIndeterminate.razor.cs │ │ ├── Long │ │ │ ├── BProgressLinearLong.razor │ │ │ └── BProgressLinearLong.razor.cs │ │ ├── ProgressLinearAbstractProviderExtensions.cs │ │ ├── Short │ │ │ ├── BProgressLinearShort.razor │ │ │ └── BProgressLinearShort.razor.cs │ │ └── Stream │ │ │ ├── BProgressLinearStream.razor │ │ │ └── BProgressLinearStream.razor.cs │ ├── Radio │ │ ├── BRadio.razor │ │ ├── BRadio.razor.cs │ │ ├── BRadioGroupDefaultSlot.razor │ │ ├── BRadioGroupDefaultSlot.razor.cs │ │ ├── IRadio.cs │ │ └── IRadioGroup.cs │ ├── RangeSlider │ │ ├── Children │ │ │ ├── Input │ │ │ │ ├── BRangeSliderInput.razor │ │ │ │ └── BRangeSliderInput.razor.cs │ │ │ ├── ThumbContainer │ │ │ │ ├── BRangeSliderThumbContainer.razor │ │ │ │ └── BRangeSliderThumbContainer.razor.cs │ │ │ └── TrackContainer │ │ │ │ ├── BRangeSliderTrackContainer.razor │ │ │ │ └── BRangeSliderTrackContainer.razor.cs │ │ ├── IRangeSlider.cs │ │ └── RangeSliderAbstractProviderExtensions.cs │ ├── Responsive │ │ ├── BResponsive.razor │ │ ├── BResponsive.razor.cs │ │ ├── Body │ │ │ ├── BResponsiveBody.razor │ │ │ ├── BResponsiveBody.razor.cs │ │ │ ├── Content │ │ │ │ ├── BResponsiveContent.razor │ │ │ │ └── BResponsiveContent.razor.cs │ │ │ └── Sizer │ │ │ │ ├── BResponsiveSizer.razor │ │ │ │ └── BResponsiveSizer.razor.cs │ │ └── IResponsive.cs │ ├── Select │ │ ├── BSelectDefaultSlot.razor │ │ ├── BSelectDefaultSlot.razor.cs │ │ ├── HiddenInput │ │ │ ├── BSelectHiddenInput.razor │ │ │ └── BSelectHiddenInput.razor.cs │ │ ├── ISelect.cs │ │ ├── Menu │ │ │ ├── BSelectMenu.razor │ │ │ ├── BSelectMenu.razor.cs │ │ │ └── List │ │ │ │ ├── BSelectList.razor │ │ │ │ ├── BSelectList.razor.cs │ │ │ │ └── ListWithSlot │ │ │ │ ├── BSelectListWithSlot.razor │ │ │ │ └── BSelectListWithSlot.razor.cs │ │ ├── SelectAbstractProviderExtensions.cs │ │ ├── SelectList │ │ │ ├── BSelectList.razor │ │ │ ├── BSelectList.razor.cs │ │ │ ├── Divider │ │ │ │ ├── BSelectListDivider.razor │ │ │ │ └── BSelectListDivider.razor.cs │ │ │ ├── Header │ │ │ │ ├── BSelectListHeader.razor │ │ │ │ └── BSelectListHeader.razor.cs │ │ │ ├── ISelectList.cs │ │ │ ├── SelectListAbstractProviderExtensitions.cs │ │ │ ├── StaticNoDataTile │ │ │ │ ├── BSelectListStaticNoDataTile.razor │ │ │ │ └── BSelectListStaticNoDataTile.razor.cs │ │ │ └── Tile │ │ │ │ ├── Action │ │ │ │ ├── BSelectListAction.razor │ │ │ │ └── BSelectListAction.razor.cs │ │ │ │ ├── BSelectListTile.razor │ │ │ │ ├── BSelectListTile.razor.cs │ │ │ │ └── TileContent │ │ │ │ ├── BSelectListTileContent.razor │ │ │ │ └── BSelectListTileContent.razor.cs │ │ ├── SelectListItemProps.cs │ │ ├── SelectSelectionProps.cs │ │ └── Selections │ │ │ ├── BSelectSelections.razor │ │ │ ├── BSelectSelections.razor.cs │ │ │ ├── ChipSelection │ │ │ ├── BSelectChipSelection.razor │ │ │ └── BSelectChipSelection.razor.cs │ │ │ ├── CommaSelection │ │ │ ├── BSelectCommaSelection.razor │ │ │ └── BSelectCommaSelection.razor.cs │ │ │ └── SlotSelection │ │ │ ├── BSelectSlotSelection.razor │ │ │ └── BSelectSlotSelection.razor.cs │ ├── SlideGroup │ │ ├── BSlideGroup.razor │ │ ├── BSlideGroup.razor.cs │ │ ├── BSlideGroupNext.razor │ │ ├── BSlideGroupNext.razor.cs │ │ ├── BSlideGroupPrev.razor │ │ ├── BSlideGroupPrev.razor.cs │ │ └── ISlideGroup.cs │ ├── Slider │ │ ├── DefaultSlot │ │ │ ├── BSliderDefaultSlot.razor │ │ │ ├── BSliderDefaultSlot.razor.cs │ │ │ └── Slider │ │ │ │ ├── BSliderSlider.razor │ │ │ │ ├── BSliderSlider.razor.cs │ │ │ │ └── Children │ │ │ │ ├── BSliderChildren.razor │ │ │ │ ├── BSliderChildren.razor.cs │ │ │ │ ├── Input │ │ │ │ ├── BSliderInput.razor │ │ │ │ └── BSliderInput.razor.cs │ │ │ │ ├── Steps │ │ │ │ ├── BSliderSteps.razor │ │ │ │ └── BSliderSteps.razor.cs │ │ │ │ ├── ThumbContainer │ │ │ │ ├── BSliderThumbContainer.razor │ │ │ │ ├── BSliderThumbContainer.razor.cs │ │ │ │ ├── Thumb │ │ │ │ │ ├── BSliderThumb.razor │ │ │ │ │ └── BSliderThumb.razor.cs │ │ │ │ └── ThumbLabel │ │ │ │ │ ├── BSliderThumbLabel.razor │ │ │ │ │ └── BSliderThumbLabel.razor.cs │ │ │ │ └── TrackContainer │ │ │ │ ├── BSliderTrackContainer.razor │ │ │ │ └── BSliderTrackContainer.razor.cs │ │ ├── ISlider.cs │ │ └── SliderAbstractProviderExtensions.cs │ ├── SpeedDial │ │ ├── BSpeedDial.razor │ │ └── BSpeedDial.razor.cs │ ├── Subheader │ │ ├── BSubheader.razor │ │ └── BSubheader.razor.cs │ ├── Switch │ │ ├── BSwitchDefaultSlot.razor │ │ ├── BSwitchDefaultSlot.razor.cs │ │ ├── IRippleable.cs │ │ ├── ISwitch.cs │ │ └── Switch │ │ │ ├── BSwitchSwitch.razor │ │ │ ├── BSwitchSwitch.razor.cs │ │ │ ├── Input │ │ │ ├── BSelectableInput.razor │ │ │ └── BSelectableInput.razor.cs │ │ │ ├── Progress │ │ │ ├── BSwitchProgress.razor │ │ │ └── BSwitchProgress.razor.cs │ │ │ └── Ripple │ │ │ ├── BRippleableRipple.razor │ │ │ └── BRippleableRipple.razor.cs │ ├── Tabs │ │ ├── BTab.razor │ │ ├── BTab.razor.cs │ │ ├── BTabs.razor │ │ ├── BTabs.razor.cs │ │ ├── BTabsSlider.razor │ │ ├── BTabsSlider.razor.cs │ │ ├── Body │ │ │ ├── BTabsBody.razor │ │ │ └── BTabsBody.razor.cs │ │ ├── ITabItem.cs │ │ ├── ITabs.cs │ │ ├── ITabsBar.cs │ │ ├── ITabsItems.cs │ │ ├── Tab │ │ │ ├── BTabsTab.razor │ │ │ └── BTabsTab.razor.cs │ │ └── TabsAbstractProviderExtensions.cs │ ├── TextField │ │ ├── Content │ │ │ ├── AppendSlot │ │ │ │ ├── BTextFieldAppendSlot.razor │ │ │ │ └── BTextFieldAppendSlot.razor.cs │ │ │ └── Control │ │ │ │ ├── InputSlot │ │ │ │ ├── BTextFieldInputSlot.razor │ │ │ │ ├── BTextFieldInputSlot.razor.cs │ │ │ │ ├── DefaultSlot │ │ │ │ │ ├── BTextFieldDefaultSlot.razor │ │ │ │ │ ├── BTextFieldDefaultSlot.razor.cs │ │ │ │ │ ├── ClearIcon │ │ │ │ │ │ ├── BTextFieldClearIcon.razor │ │ │ │ │ │ └── BTextFieldClearIcon.razor.cs │ │ │ │ │ ├── Fieldset │ │ │ │ │ │ ├── BTextFieldFieldset.razor │ │ │ │ │ │ ├── BTextFieldFieldset.razor.cs │ │ │ │ │ │ └── Legend │ │ │ │ │ │ │ ├── BTextFieldLegend.razor │ │ │ │ │ │ │ └── BTextFieldLegend.razor.cs │ │ │ │ │ ├── IconSlot │ │ │ │ │ │ ├── BTextFieldIconSlot.razor │ │ │ │ │ │ └── BTextFieldIconSlot.razor.cs │ │ │ │ │ ├── NumberIconSlot │ │ │ │ │ │ ├── BTextFieldNumberIconSlot.razor │ │ │ │ │ │ └── BTextFieldNumberIconSlot.razor.cs │ │ │ │ │ └── TextFieldSlot │ │ │ │ │ │ ├── Affix │ │ │ │ │ │ ├── BTextFieldAffix.razor │ │ │ │ │ │ └── BTextFieldAffix.razor.cs │ │ │ │ │ │ ├── BTextFieldTextFieldSlot.razor │ │ │ │ │ │ ├── BTextFieldTextFieldSlot.razor.cs │ │ │ │ │ │ ├── Input │ │ │ │ │ │ ├── BTextFieldInput.razor │ │ │ │ │ │ └── BTextFieldInput.razor.cs │ │ │ │ │ │ └── Label │ │ │ │ │ │ ├── BTextFieldLabel.razor │ │ │ │ │ │ └── BTextFieldLabel.razor.cs │ │ │ │ └── PrependInnerSlot │ │ │ │ │ ├── BTextFieldPrependInnerSlot.razor │ │ │ │ │ └── BTextFieldPrependInnerSlot.razor.cs │ │ │ │ └── Messages │ │ │ │ ├── BTextFieldMessages.razor │ │ │ │ ├── BTextFieldMessages.razor.cs │ │ │ │ └── Counter │ │ │ │ ├── BTextFieldCounter.razor │ │ │ │ └── BTextFieldCounter.razor.cs │ │ ├── ITextField.cs │ │ ├── TextFieldAbstractProviderExtensions.cs │ │ └── TextFieldNumberProperty.cs │ ├── TimePicker │ │ ├── SelectingTimes.cs │ │ ├── TimeFormat.cs │ │ └── TimePeriod.cs │ ├── Tooltip │ │ ├── Activator │ │ │ ├── BTooltipActivator.razor │ │ │ └── BTooltipActivator.razor.cs │ │ ├── ActivatorProps.cs │ │ ├── BTooltip.razor │ │ ├── BTooltip.razor.cs │ │ ├── Content │ │ │ ├── BTooltipContent.razor │ │ │ └── BTooltipContent.razor.cs │ │ ├── ITooltip.cs │ │ └── TooltipAbstractProviderExtensions.cs │ ├── Transition │ │ ├── Elements │ │ │ ├── BShouldRender.cs │ │ │ ├── IfTransitionElement.cs │ │ │ ├── KeyTransitionElement.cs │ │ │ ├── KeyTransitionElementState.cs │ │ │ ├── ShowTransitionElement.cs │ │ │ ├── ToggleableTransitionElement.cs │ │ │ └── TransitionElementBase.cs │ │ ├── ITransitionElement.cs │ │ ├── ITransitionIf.cs │ │ ├── JSInterops │ │ │ ├── TransitionJSModule.cs │ │ │ └── TransitionJsInteropHandle.cs │ │ ├── LeaveEnter.cs │ │ ├── Transition.cs │ │ ├── TransitionMode.cs │ │ ├── TransitionState.cs │ │ └── Transitions │ │ │ ├── CarouselReverseTransition.cs │ │ │ ├── CarouselTransition.cs │ │ │ ├── DialogBottomTransition.cs │ │ │ ├── DialogTopTransition.cs │ │ │ ├── DialogTransition.cs │ │ │ ├── ExpandTransition.cs │ │ │ ├── ExpandXTransition.cs │ │ │ ├── FabTransition.cs │ │ │ ├── FadeTransition.cs │ │ │ ├── MenuTransition.cs │ │ │ ├── ScaleTransition.cs │ │ │ ├── ScrollXTransition.cs │ │ │ ├── ScrollYReverseTransition.cs │ │ │ ├── ScrollYTransition.cs │ │ │ ├── SlideXReverseTransition.cs │ │ │ ├── SlideXTransition.cs │ │ │ ├── SlideYReverseTransition.cs │ │ │ ├── SlideYTransition.cs │ │ │ ├── TabReverseTransition.cs │ │ │ ├── TabTransition.cs │ │ │ └── VScrollXReverseTransition.cs │ ├── Treeview │ │ ├── SelectionType.cs │ │ └── TreeviewItem.cs │ └── Window │ │ ├── BWindow.razor │ │ ├── BWindow.razor.cs │ │ ├── BWindowItem.razor │ │ ├── BWindowItem.razor.cs │ │ ├── BWindowItemDefaultSlot.razor │ │ ├── BWindowItemDefaultSlot.razor.cs │ │ └── IWindowItem.cs │ ├── Extensions │ ├── Abstracts │ │ └── BuilderBaseExtensions.cs │ ├── BemExtensions.cs │ ├── ComponentExtensions.cs │ ├── DeepClonerExtensions.cs │ ├── DependencyInjection │ │ ├── BlazorComponentBuilder.cs │ │ ├── IBlazorComponentBuilder.cs │ │ └── ServiceCollectionExtensions.cs │ ├── EnumerableExtensions.cs │ ├── IJSObjectReferenceExtensions.cs │ ├── InvalidOperationExceptionExtensions.cs │ ├── JSInterop │ │ ├── DocumentExtensions.cs │ │ ├── ElementReferenceExtensions.cs │ │ ├── HtmlElementExtensions.cs │ │ └── JSObjectExtensions.cs │ ├── NavigationManagerExtensions.cs │ ├── OneOf │ │ └── StringNumberExtensions.cs │ ├── RenderFragmentExtensions.cs │ └── StringExtensions.cs │ ├── Helpers │ ├── NumberHelper.cs │ └── RegexHelper.cs │ ├── I18n │ ├── EmbeddedLocales.cs │ ├── I18n.cs │ ├── I18nCache.cs │ ├── I18nReader.cs │ ├── I18nServiceCollectionExtensions.cs │ └── Locales │ │ ├── af-AZ.json │ │ ├── ar-EG.json │ │ ├── az.json │ │ ├── bg-BG.json │ │ ├── ca-ES.json │ │ ├── ckb.json │ │ ├── cs-CZ.json │ │ ├── de-DE.json │ │ ├── el-GR.json │ │ ├── en-GB.json │ │ ├── en-US.json │ │ ├── es-ES.json │ │ ├── et-EE.json │ │ ├── fa-IR.json │ │ ├── fi-FI.json │ │ ├── fr-BE.json │ │ ├── fr-FR.json │ │ ├── he-IL.json │ │ ├── hr-HR.json │ │ ├── hu-HU.json │ │ ├── id-ID.json │ │ ├── it-IT.json │ │ ├── ja-JP.json │ │ ├── ko-KR.json │ │ ├── lt.json │ │ ├── lv-LV.json │ │ ├── nb-NO.json │ │ ├── nl-BE.json │ │ ├── nl-NL.json │ │ ├── pl-PL.json │ │ ├── pt-BR.json │ │ ├── pt-PT.json │ │ ├── ro-RO.json │ │ ├── ru-RU.json │ │ ├── sk-SK.json │ │ ├── sl-SI.json │ │ ├── sr-Cyrl-CS.json │ │ ├── sr-Latn-CS.json │ │ ├── sv-SE.json │ │ ├── th-TH.json │ │ ├── tr-TR.json │ │ ├── uk-UA.json │ │ ├── vi-VN.json │ │ ├── zh-CN.json │ │ └── zh-TW.json │ ├── JSInterop │ ├── BoundingClientRect.cs │ ├── ClickOutsideArgs.cs │ ├── Converters │ │ └── JsonCamelStringEnumConverter.cs │ ├── Document.cs │ ├── DocumentElement.cs │ ├── DomEventSub.cs │ ├── Element.cs │ ├── Event.cs │ ├── EventListenerOptions.cs │ ├── EventTarget.cs │ ├── HtmlElement.cs │ ├── Invoker.cs │ ├── JSExceptionExtensions.cs │ ├── JSModule.cs │ ├── JSObject.cs │ ├── JSObjectReferenceProxy.cs │ ├── JsInteropConstants.cs │ ├── JsRuntimeExtensions.cs │ ├── KeyCodes.cs │ ├── LocalStorage.cs │ ├── Models │ │ ├── ScrollBehavior.cs │ │ ├── ScrollIntoViewOptions.cs │ │ ├── ScrollLogicalPosition.cs │ │ └── ScrollToOptions.cs │ ├── MouseEvent.cs │ ├── Window.cs │ └── WindowAndDocument.cs │ ├── JSModules │ └── ResizeObserver │ │ └── IResizeJSModule.cs │ ├── Mixins │ ├── Activatable │ │ ├── ActivatableJsModule.cs │ │ ├── BActivatable.cs │ │ ├── BActivatableBase.cs │ │ ├── IActivatable.cs │ │ └── IActivatableJsCallbacks.cs │ ├── Bootable │ │ └── BBootable.cs │ ├── Delayable │ │ ├── BDelayable.cs │ │ └── IDelayable.cs │ ├── Dependent │ │ └── IDependent.cs │ ├── Groupable │ │ ├── BGroupable.cs │ │ ├── GroupType.cs │ │ └── IGroupable.cs │ ├── IColorable.cs │ ├── IThemeable.cs │ ├── Loadable │ │ ├── BLoadableProgress.razor │ │ ├── BLoadableProgress.razor.cs │ │ └── ILoadable.cs │ ├── Menuable │ │ ├── BMenuable.cs │ │ ├── IMenuable.cs │ │ ├── MenuableDimensions.cs │ │ ├── MenuablePosition.cs │ │ └── MultipleResult.cs │ ├── OutsideClick │ │ ├── IOutsideClickJsCallback.cs │ │ └── OutsideClickJSModule.cs │ ├── Routable │ │ ├── IAncestorRoutable.cs │ │ ├── IRoutable.cs │ │ └── Router.cs │ ├── ScrollStrategy │ │ ├── ScrollStrategyJSModule.cs │ │ └── ScrollStrategyOptions.cs │ ├── Scrollable │ │ ├── IScrollable.cs │ │ └── Scroller.cs │ ├── Selectable │ │ └── ISelectable.cs │ └── Toggleable │ │ └── BToggleable.cs │ ├── Popup │ ├── IPopupProvider.cs │ ├── PopupProvider.cs │ └── ProviderItem.cs │ ├── Services │ ├── BlazorComponentOptions.cs │ ├── Borders.cs │ ├── ForwardRef.cs │ ├── Generator │ │ └── ComponentId │ │ │ ├── GuidComponentIdGenerator.cs │ │ │ └── Interface │ │ │ └── IComponentIdGenerator.cs │ ├── ListComparer.cs │ ├── Locale.cs │ ├── OneOf │ │ ├── StringBoolean.cs │ │ ├── StringEnum.cs │ │ ├── StringNumber.cs │ │ ├── StringNumberBoolean.cs │ │ └── StringNumberDate.cs │ └── ThemeOptions.cs │ ├── Web │ ├── EventHandlers.cs │ ├── ExMouseEventArgs.cs │ ├── ExTouchEventArgs.cs │ ├── MouseEventWithRefArgs.cs │ ├── PasteWithDataEventArgs.cs │ └── TransitionEventArgs.cs │ ├── _Imports.cs │ ├── _Imports.razor │ └── wwwroot │ └── js │ ├── activatable.js │ ├── activatable.js.map │ ├── blazor-component.js │ ├── blazor-component.js.map │ ├── input.js │ ├── input.js.map │ ├── intersect.js │ ├── intersect.js.map │ ├── outside-click.js │ ├── outside-click.js.map │ ├── scrollStrategies.js │ ├── scrollStrategies.js.map │ ├── transition.js │ └── transition.js.map └── Test ├── BlazorComponent.Test.ServerHost ├── App.razor ├── BlazorComponent.Test.ServerHost.csproj ├── Pages │ └── _Host.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── _Imports.razor ├── appsettings.Development.json └── appsettings.json ├── BlazorComponent.Test.Wasm ├── App.razor ├── BlazorComponent.Test.Wasm.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── _Imports.razor ├── gh-pages │ ├── .nojekyll │ ├── .spa │ ├── 404.html │ └── index.html └── wwwroot │ ├── decode.js │ ├── index.html │ ├── logo.png │ ├── manifest.json │ ├── service-worker.js │ └── service-worker.published.js ├── BlazorComponent.Test ├── BlazorComponent.Test.csproj ├── Core │ └── Abstract │ │ └── AbstractComponentTests.cs ├── HelloComponent.razor ├── Input │ ├── BInputContentTests.cs │ ├── BInputIconTests.cs │ ├── BInputInputSlotTests.cs │ ├── BInputLabelTests.cs │ ├── BInputPrependSlotTests.cs │ ├── BInputTests.cs │ └── TestInput.cs └── TestBase.cs ├── README.md └── cover.png /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | _Please explain the changes you've made_ 4 | 5 | ## Issue reference 6 | 7 | We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation. 8 | 9 | Please reference the issue this PR will close: #_[issue number]_ 10 | 11 | ## Checklist 12 | 13 | Please make sure you've completed the relevant tasks for this PR, out of the following list: 14 | 15 | * [ ] Code compiles correctly 16 | * [ ] Created/updated tests 17 | * [ ] Extended the documentation 18 | -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | - feature/* 8 | pull_request: 9 | branches: 10 | - develop 11 | - feature/* 12 | 13 | jobs: 14 | build: 15 | 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: git pull 20 | uses: actions/checkout@v2 21 | - name: setting dotnet 22 | uses: actions/setup-dotnet@v1 23 | with: 24 | dotnet-version: | 25 | 6.0.x 26 | 7.0.x 27 | 8.0.x 28 | include-prerelease: true 29 | - name: build 30 | run: dotnet build ./src/Component/BlazorComponent/ 31 | -------------------------------------------------------------------------------- /docs/20210427112456.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/docs/20210427112456.png -------------------------------------------------------------------------------- /docs/BlazorComponent32_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/docs/BlazorComponent32_32.png -------------------------------------------------------------------------------- /docs/empty.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/docs/empty.md -------------------------------------------------------------------------------- /docs/logo-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/docs/logo-v.png -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.activatable.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/mixins/activatable/index.ts", 8 | output: [ 9 | { 10 | file: "../BlazorComponent/wwwroot/js/activatable.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.drawflow.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import commonjs from "@rollup/plugin-commonjs"; 5 | import resolve from "@rollup/plugin-node-resolve"; 6 | import typescript from "@rollup/plugin-typescript"; 7 | 8 | export default defineConfig({ 9 | input: "./src/proxies/drawflow/index.ts", 10 | output: [ 11 | { 12 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/drawflow-proxy.js", 13 | format: "esm", 14 | sourcemap: true, 15 | }, 16 | ], 17 | plugins: [typescript(), terser()], 18 | }); 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.echarts.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/proxies/echarts/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/echarts-proxy.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | }); 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.gridstack.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import commonjs from "@rollup/plugin-commonjs"; 5 | import resolve from "@rollup/plugin-node-resolve"; 6 | import typescript from "@rollup/plugin-typescript"; 7 | 8 | export default defineConfig({ 9 | input: "./src/proxies/gridstack/index.ts", 10 | output: [ 11 | { 12 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/gridstack-proxy.js", 13 | format: "esm", 14 | sourcemap: true, 15 | }, 16 | ], 17 | plugins: [typescript(), resolve(), commonjs(), terser()], 18 | }); 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.input.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/mixins/input/index.ts", 8 | output: [ 9 | { 10 | file: "../BlazorComponent/wwwroot/js/input.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.intersect.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/mixins/intersect/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/wwwroot/js/intersect.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.maps.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | export default defineConfig({ 5 | input: "./src/proxies/maps/baidumap/index.js", 6 | output: [ 7 | { 8 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/baidumap-proxy.js", 9 | format: "esm", 10 | sourcemap: true, 11 | }, 12 | ], 13 | plugins: [terser()], 14 | }); 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.markdownit.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import commonjs from "@rollup/plugin-commonjs"; 5 | import json from "@rollup/plugin-json"; 6 | import resolve from "@rollup/plugin-node-resolve"; 7 | import typescript from "@rollup/plugin-typescript"; 8 | 9 | export default defineConfig({ 10 | input: "./src/proxies/markdown-it/index.ts", 11 | output: [ 12 | { 13 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/markdown-it-proxy.js", 14 | format: "esm", 15 | sourcemap: true, 16 | }, 17 | ], 18 | plugins: [typescript(), json(), resolve(), commonjs(), terser()], 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.monaco-editor.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/proxies/monaco-editor/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/monaco-editor-proxy.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | }); 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.outsideclick.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/mixins/outside-click/index.ts", 8 | output: [ 9 | { 10 | file: "../BlazorComponent/wwwroot/js/outside-click.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.pageStack.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/components/page-stack/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/Presets/PageStack/PPageStack.razor.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.resize.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import resolve from "@rollup/plugin-node-resolve"; 5 | import typescript from "@rollup/plugin-typescript"; 6 | 7 | export default defineConfig({ 8 | input: "./src/mixins/resize/index.ts", 9 | output: [ 10 | { 11 | file: "../../../../MASA.Blazor/wwwroot/js/resize.js", 12 | format: "esm", 13 | sourcemap: true, 14 | }, 15 | ], 16 | plugins: [typescript(), resolve(), terser()], 17 | }); 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.scrollStrategies.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/components/overlay/scrollStrategies.ts", 8 | output: [ 9 | { 10 | file: "../BlazorComponent/wwwroot/js/scrollStrategies.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.scrollToTargetJSInterop.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/components/scroll-to-target/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/wwwroot/js/components/scroll-to-target.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.sortable.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import commonjs from "@rollup/plugin-commonjs"; 5 | import json from "@rollup/plugin-json"; 6 | import resolve from "@rollup/plugin-node-resolve"; 7 | import typescript from "@rollup/plugin-typescript"; 8 | 9 | export default defineConfig([ 10 | { 11 | input: "./src/proxies/sortable/index.ts", 12 | output: [ 13 | { 14 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/sortable-proxy.js", 15 | format: "esm", 16 | sourcemap: true, 17 | }, 18 | ], 19 | plugins: [typescript(), json(), resolve(), commonjs(), terser()], 20 | }, 21 | ]); 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.swiper.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/proxies/swiper/index.ts", 8 | output: [ 9 | { 10 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/swiper-proxy.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | watch: { 17 | exclude: "node_modules/**", 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.transition.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import typescript from "@rollup/plugin-typescript"; 5 | 6 | export default defineConfig({ 7 | input: "./src/transition/index.ts", 8 | output: [ 9 | { 10 | file: "../BlazorComponent/wwwroot/js/transition.js", 11 | format: "esm", 12 | sourcemap: true, 13 | }, 14 | ], 15 | plugins: [typescript(), terser()], 16 | }); 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import resolve from "@rollup/plugin-node-resolve"; 5 | import typescript from "@rollup/plugin-typescript"; 6 | 7 | export default defineConfig({ 8 | input: "./src/main.ts", 9 | output: [ 10 | { 11 | file: "../BlazorComponent/wwwroot/js/blazor-component.js", 12 | format: "iife", 13 | sourcemap: true, 14 | }, 15 | ], 16 | plugins: [typescript(), resolve(), terser()], 17 | }); 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/rollup.config.xgplayer.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | 4 | import commonjs from "@rollup/plugin-commonjs"; 5 | import json from "@rollup/plugin-json"; 6 | import resolve from "@rollup/plugin-node-resolve"; 7 | import typescript from "@rollup/plugin-typescript"; 8 | 9 | export default defineConfig([ 10 | { 11 | input: "./src/proxies/xgplayer/index.ts", 12 | output: [ 13 | { 14 | file: "../../../../MASA.Blazor/wwwroot/js/proxies/xgplayer-proxy.js", 15 | format: "esm", 16 | sourcemap: true, 17 | }, 18 | ], 19 | plugins: [typescript(), json(), resolve(), commonjs(), terser()], 20 | }, 21 | ]); 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/src/main.ts: -------------------------------------------------------------------------------- 1 | import * as slider from "./components/slider"; 2 | import * as interop from "./interop"; 3 | import { MarkdownParser } from "./proxies/markdown-it"; 4 | 5 | declare global { 6 | interface Window { 7 | BlazorComponent: any; 8 | MasaBlazor: { 9 | extendMarkdownIt?: (parser: MarkdownParser) => void; 10 | xgplayerPlugins: any[]; 11 | xgplayerPluginOptions?: { [prop: string]: any }; 12 | }; 13 | } 14 | } 15 | 16 | window.BlazorComponent = { 17 | interop: { 18 | ...interop, 19 | ...slider, 20 | }, 21 | }; 22 | 23 | window.MasaBlazor = { 24 | xgplayerPlugins: [], 25 | }; 26 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": false, 4 | "noEmitOnError": true, 5 | "moduleResolution": "node", 6 | "allowSyntheticDefaultImports": true, 7 | "target":"ES2016", 8 | "paths": { 9 | "utils/*": ["./src/utils/*"], 10 | "events/*": ["./src/events/*"], 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/types/highlightjs/index.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace hljs { 2 | export interface HighlightOptions { 3 | language: string; 4 | ignoreIllegals?: boolean; 5 | } 6 | 7 | export interface HighlightResult { 8 | code?: string; 9 | relevance: number; 10 | value: string; 11 | language?: string; 12 | illegal: boolean; 13 | errorRaised?: Error; 14 | // * for auto-highlight 15 | secondBest?: Omit; 16 | } 17 | } 18 | 19 | declare interface hljs { 20 | getLanguage: (languageName: string) => any; 21 | highlight(code: string, options: hljs.HighlightOptions): hljs.HighlightResult; 22 | } 23 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent.Web/types/prism/index.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace Prism { 2 | export interface LanguageMap { 3 | [language: string]: any; 4 | } 5 | } 6 | 7 | declare interface Prism { 8 | languages: Prism.LanguageMap; 9 | highlight(text: string, grammar: any, language: string): string; 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/AbstractMetadata.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class AbstractMetadata 4 | { 5 | public AbstractMetadata(Type type, Dictionary? attributes = null) 6 | { 7 | Type = type; 8 | Attributes = attributes ?? new(); 9 | } 10 | 11 | public Type Type { get; } 12 | 13 | public Dictionary Attributes { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/BlockOrElement.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Abstracts; 2 | 3 | public enum BlockOrElement 4 | { 5 | Default, 6 | Block, 7 | Element 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Builder/AttributesDictionary.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class AttributesDictionary : Dictionary 4 | { 5 | public AttributesDictionary() 6 | { 7 | } 8 | 9 | public AttributesDictionary(int index) 10 | { 11 | Index = index; 12 | } 13 | 14 | public AttributesDictionary(object? data) 15 | { 16 | Data = data; 17 | } 18 | 19 | public int Index { get; } 20 | 21 | public object? Data { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Builder/BuilderBase.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BuilderBase 4 | { 5 | internal readonly Dictionary, Func> Mapper = new(); 6 | 7 | internal string? Prefix { get; private set; } 8 | 9 | public object? Data { get; internal set; } 10 | 11 | public void SetPrefix(string prefix) 12 | { 13 | Prefix = prefix; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Builder/BuilderContext.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BuilderContext 4 | { 5 | public BuilderContext(int index, object data) 6 | { 7 | Index = index; 8 | Data = data; 9 | } 10 | 11 | public int Index { get; } 12 | 13 | public object Data { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Components/EmptyComponent.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class EmptyComponent : ComponentBase 4 | { 5 | //Avoid exception 6 | [Parameter(CaptureUnmatchedValues = true)] 7 | public Dictionary? Attrs { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Components/IComponentPart.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IComponentPart 4 | { 5 | RenderFragment Content { get; } 6 | 7 | void Attach(IHasProviderComponent component); 8 | 9 | void SetParameters(ParameterView parameterView); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Components/IHasProviderComponent.cs: -------------------------------------------------------------------------------- 1 | using BlazorComponent.Abstracts; 2 | 3 | namespace BlazorComponent 4 | { 5 | public interface IHasProviderComponent : IComponent, IHandleAfterRender 6 | { 7 | ComponentCssProvider CssProvider { get; } 8 | 9 | ComponentAbstractProvider AbstractProvider { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/IAbstractComponentTypeMapper.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IAbstractComponentTypeMapper 4 | { 5 | Type Map(Type keyType); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Watcher/IObservableProperty.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IObservableProperty 4 | { 5 | string Name { get; } 6 | 7 | event Action OnChange; 8 | 9 | void NotifyChange(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Abstracts/Watcher/ObservableProperty.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ObservableProperty : IObservableProperty 4 | { 5 | public ObservableProperty(string name) 6 | { 7 | Name = name; 8 | } 9 | 10 | public string Name { get; } 11 | 12 | public event Action? OnChange; 13 | 14 | void IObservableProperty.NotifyChange() 15 | { 16 | OnChange?.Invoke(Name); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Attributes/MasaApiParameterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Attributes; 2 | 3 | public class MasaApiParameterAttribute : Attribute 4 | { 5 | public object? DefaultValue { get; } 6 | 7 | public bool Ignored { get; set; } 8 | 9 | public string? ReleasedOn { get; set; } 10 | 11 | public MasaApiParameterAttribute(object defaultValue) 12 | { 13 | DefaultValue = defaultValue; 14 | } 15 | 16 | public MasaApiParameterAttribute(object defaultValue, string releasedOn) 17 | { 18 | DefaultValue = defaultValue; 19 | ReleasedOn = releasedOn; 20 | } 21 | 22 | public MasaApiParameterAttribute() 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Attributes/MasaApiPublicMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Attributes; 2 | 3 | public class MasaApiPublicMethodAttribute : Attribute 4 | { 5 | } 6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Autocomplete/AutocompleteAbstractProvider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class AutocompleteAbstractProvider 4 | { 5 | public static ComponentAbstractProvider ApplyAutocompleteDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Merge(typeof(BSelectSelections<,,,>), typeof(BAutocompleteSelections>)) 9 | .Apply(typeof(BSelectSelections<,,,>), typeof(BSelectSelections>), name: "base"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Autocomplete/IAutocomplete.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IAutocomplete : ISelect 4 | { 5 | bool HasSlot { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Autocomplete/Selections/BAutocompleteSelections.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | @if (HasSlot || Multiple) 9 | { 10 | @RenderPart(typeof(BSelectSelections<,,,>),name:"base") 11 | } 12 | else 13 | { 14 | @RenderPart(typeof(BTextFieldInput<,>)) 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Autocomplete/Selections/BAutocompleteSelections.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BAutocompleteSelections where TInput : IAutocomplete 4 | { 5 | protected bool Multiple => Component.Multiple; 6 | 7 | protected bool HasSlot => Component.HasSlot; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Breadcrumbs/BreadcrumbItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BreadcrumbItem 4 | { 5 | public bool Disabled { get; set; } 6 | 7 | public bool Exact { get; set; } 8 | 9 | public string? Href { get; set; } 10 | 11 | public string? Text { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Button/IButton.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IButton : IHasProviderComponent 4 | { 5 | bool Block { get; } 6 | 7 | RenderFragment? ChildContent { get; } 8 | 9 | string? Color { get; } 10 | 11 | bool Disabled { get; } 12 | 13 | StringNumber? Height { get; } 14 | 15 | RenderFragment? LoaderContent { get; } 16 | 17 | bool Loading { get; } 18 | 19 | StringNumber? MaxHeight { get; } 20 | 21 | StringNumber? MaxWidth { get; } 22 | 23 | StringNumber? MinHeight { get; } 24 | 25 | StringNumber? MinWidth { get; } 26 | 27 | bool Outlined { get; } 28 | 29 | StringNumber? Width { get; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/BCarouselItemDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TWindowItem 3 | @inherits BWindowItemDefaultSlot 4 | 5 | 6 | @ChildContent 7 | 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/BCarouselItemDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BCarouselItemDefaultSlot where TWindowItem : IWindowItem 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/Controls/BCarouselDelimiters.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BCarouselDelimiters : ComponentPartBase where TCarousel : ICarousel 4 | { 5 | public bool HideDelimiters => Component.HideDelimiters; 6 | 7 | public string Icon => Component.DelimiterIcon ?? "$delimiter"; 8 | 9 | public StringNumber? InternalValue => Component.Value; 10 | 11 | public bool Mandatory => Component.Mandatory; 12 | 13 | public List Items => Component.Items; 14 | 15 | public EventCallback InternalValueChanged => EventCallback.Factory.Create(Component, Component.InternalValueChanged); 16 | } 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/ICarousel.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface ICarousel : IHasProviderComponent 4 | { 5 | string? DelimiterIcon { get; } 6 | 7 | bool HideDelimiters { get; } 8 | 9 | bool Progress { get; } 10 | 11 | string? ProgressColor { get; } 12 | 13 | double ProgressValue { get; } 14 | 15 | bool Mandatory { get; } 16 | 17 | StringNumber? Value { get; } 18 | 19 | List Items { get; } 20 | 21 | Task InternalValueChanged(StringNumber? val); 22 | } 23 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/Progress/BCarouselProgress.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TCarousel 3 | @inherits ComponentPartBase 4 | 5 | @if (Progress || !string.IsNullOrWhiteSpace(ProgressColor)) 6 | { 7 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Carousel/Progress/BCarouselProgress.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BCarouselProgress : ComponentPartBase where TCarousel : ICarousel 4 | { 5 | public bool Progress => Component.Progress; 6 | 7 | public string? ProgressColor => Component.ProgressColor; 8 | 9 | public double Value => Component.ProgressValue; 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Cascader/CascaderAbstractProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class CascaderAbstractProviderExtensions 4 | { 5 | public static ComponentAbstractProvider ApplyCascaderDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Merge(typeof(BSelectList<,,,>), typeof(BCascaderList>)); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Cascader/ICascader.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ICascader : ISelect 4 | { 5 | bool ChangeOnSelect { get; } 6 | 7 | void Register(BCascaderColumn cascaderColumn); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Cascader/Menu/List/BCascaderList.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TValue 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 |
8 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Cascader/Menu/List/BCascaderList.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BCascaderList where TInput : ICascader 4 | { 5 | protected IList ComputedItems => Component.ComputedItems; 6 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Checkbox/BCheckboxCheckbox.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TInput 3 | @typeparam TValue 4 | @inherits ComponentPartBase 5 | 6 |
7 | 8 | @ComputedIcon 9 | 10 | @RenderPart(typeof(BSelectableInput<,>), "checkbox", arg0Name: "Type") 11 | @RenderPart(typeof(BRippleableRipple<>)) 12 |
13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Checkbox/BCheckboxCheckbox.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BCheckboxCheckbox where TInput: ICheckbox 4 | { 5 | public string ComputedIcon => Component.ComputedIcon; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Checkbox/BCheckboxDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputDefaultSlot> 4 | 5 | @RenderPart(typeof(BCheckboxCheckbox<,>)) 6 | @RenderPart(typeof(BInputLabel<,>)) 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Checkbox/BCheckboxDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BCheckboxDefaultSlot : BInputDefaultSlot> 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Checkbox/ICheckbox.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ICheckbox : ISelectable 4 | { 5 | string ComputedIcon { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/BChip.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BGroupItem 3 | 4 | 5 | 13 | @RenderPart(typeof(BChipContent<>)) 14 | 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/BChipAbstractProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class BChipAbstractProviderExtensions 4 | { 5 | public static ComponentAbstractProvider ApplyChipDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Apply(typeof(BChipContent<>), typeof(BChipContent)) 9 | .Apply(typeof(BChipClose<>), typeof(BChipClose)) 10 | .Apply(typeof(BChipFilter<>), typeof(BChipFilter)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/BChipContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TChip 3 | @inherits ComponentPartBase 4 | 5 | 6 | @RenderPart(typeof(BChipFilter<>)) 7 | @ComponentChildContent 8 | @RenderPart(typeof(BChipClose<>)) 9 | 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/BChipContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BChipContent where TChip : IChip 4 | { 5 | public RenderFragment? ComponentChildContent => Component.ChildContent; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/Close/BChipClose.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TChip 3 | @inherits ComponentPartBase 4 | 5 | @if (Close) 6 | { 7 | 10 | @CloseIcon 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/Close/BChipClose.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BChipClose where TChip : IChip 4 | { 5 | private bool Close => Component.Close; 6 | 7 | private string? CloseIcon => Component.CloseIcon; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/Filter/BChipFilter.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TChip 3 | @inherits ComponentPartBase 4 | 5 | @if (Filter) 6 | { 7 | 8 | 9 | @* TODO: may need an AbstractComponentElement? *@ 10 | 11 | @FilterIcon 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/Content/Filter/BChipFilter.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BChipFilter where TChip : IChip 4 | { 5 | public bool Filter => Component.Filter; 6 | 7 | string? FilterIcon => Component.FilterIcon; 8 | 9 | public bool IsActive => Component.InternalIsActive; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Chip/IChip.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IChip : IHasProviderComponent 4 | { 5 | RenderFragment? ChildContent { get; } 6 | 7 | bool Filter => default; 8 | 9 | string? FilterIcon => default; 10 | 11 | bool InternalIsActive => default; 12 | 13 | bool Close => default; 14 | 15 | string? CloseIcon => default; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Counter/BCounter.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 |
6 | @if (Max != null) 7 | { 8 | @($"{Value}/{Max}") 9 | } 10 | else 11 | { 12 | @Value 13 | } 14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/DatePicker/DatePickerType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum DatePickerType 4 | { 5 | None, 6 | Date, 7 | Month, 8 | Year 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/DefaultsProvider/IDefaultsProvider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IDefaultsProvider 4 | { 5 | IDictionary?>? Defaults { get; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Divider/BDivider.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 |
6 | @if (ChildContent is not null) 7 | { 8 | @ChildContent 9 | } 10 |
11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/DragZone/BDragDropService.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BDragDropService 4 | { 5 | public BDragItem? DragItem { get; set; } 6 | 7 | public void Reset() 8 | { 9 | DragItem = default; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/DragZone/BDragItem.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 |
4 | @ChildContent 5 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/DragZone/BDragItem.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BDragItem : BDomComponentBase 4 | { 5 | [CascadingParameter] 6 | public BDragZone? DragZone { get; set; } 7 | 8 | [Parameter] 9 | public RenderFragment? ChildContent { get; set; } 10 | 11 | protected override void OnInitialized() 12 | { 13 | base.OnInitialized(); 14 | DragZone?.Register(this); 15 | } 16 | 17 | public BDragItem Clone() 18 | { 19 | var item = MemberwiseClone() as BDragItem; 20 | item!.Id = Guid.NewGuid().ToString(); 21 | return item; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ErrorHandler/IErrorHandler.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IErrorHandler 4 | { 5 | Task HandleExceptionAsync(Exception exception); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ExpansionPanels/BExpansionPanel.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BGroupItem 3 | 4 | 5 |
6 | @ChildContent 7 |
8 |
9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ExpansionPanels/BExpansionPanelContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | @if (_isBooted || Eager) 5 | { 6 | 7 | 8 |
9 | @ChildContent 10 |
11 |
12 |
13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ExpansionPanels/BExpansionPanels.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BItemGroup 3 | 4 | 5 |
6 | @ChildContent 7 |
8 |
9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/BFileInputInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @typeparam TValue 4 | @typeparam TInput 5 | @inherits BTextFieldInput 6 | 7 | @RenderPart(typeof(BFileInputSelections<,>)) 8 | 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/BFileInputInput.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Forms; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BFileInputInput where TInput : IFileInput 6 | { 7 | public InputFile InputFile 8 | { 9 | set 10 | { 11 | Component.InputFile = value; 12 | } 13 | } 14 | 15 | public EventCallback HandleOnFileChange => EventCallback.Factory.Create(Component, Component.HandleOnFileChange); 16 | 17 | public bool Multiple => Component.Multiple; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/IFileInput.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Forms; 2 | 3 | namespace BlazorComponent 4 | { 5 | public interface IFileInput : ITextField 6 | { 7 | RenderFragment<(int index, string text)>? SelectionContent { get; } 8 | 9 | IList Text { get; } 10 | 11 | bool HasChips { get; } 12 | 13 | InputFile? InputFile { get; set; } 14 | 15 | bool Multiple { get; } 16 | 17 | bool ShowSize { get; } 18 | 19 | StringNumber? ComputedCounterValue { get; } 20 | 21 | IList Files { get; } 22 | 23 | Task HandleOnFileChange(InputFileChangeEventArgs args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/BFileInputSelections.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 |
7 | @if (IsDirty && SelectionContent != null) 8 | { 9 | for (var i = 0; i < Files.Count; i++) 10 | { 11 | @SelectionContent((i, Files[i].Name)) 12 | } 13 | } 14 | else 15 | { 16 | if (HasChips && IsDirty) 17 | { 18 | @RenderPart(typeof(BFileInputChips<,>)) 19 | } 20 | else 21 | { 22 | @RenderPart(typeof(BFileInputSelectionText<,>)) 23 | } 24 | } 25 |
26 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/BFileInputSelections.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Forms; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BFileInputSelections where TInput : IFileInput 6 | { 7 | public RenderFragment<(int index, string text)>? SelectionContent => Component.SelectionContent; 8 | 9 | public IList Files => Component.Files; 10 | 11 | public IList Text => Component.Text; 12 | 13 | public bool IsDirty => Component.IsDirty; 14 | 15 | public bool HasChips => Component.HasChips; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/Chips/BFileInputChips.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (IsDirty) 7 | { 8 | for (var i = 0; i < Text.Count; i++) 9 | { 10 | //TODO:Close 11 | var text = Text[i]; 12 | 13 | @text 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/Chips/BFileInputChips.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BFileInputChips where TInput : IFileInput 4 | { 5 | public bool IsDirty => Component.IsDirty; 6 | 7 | public IList Text => Component.Text; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/SelectionText/BFileInputSelectionText.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (Text.Count < 2) 7 | { 8 | foreach (var text in Text) 9 | { 10 | @text 11 | } 12 | } 13 | else if (ShowSize && (Counter == null || Counter == false)) 14 | { 15 | @ComputedCounterValue 16 | } 17 | else 18 | { 19 | @($"{Text.Count} files") 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/FileInput/Selections/SelectionText/BFileInputSelectionText.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BFileInputSelectionText where TInput : IFileInput 4 | { 5 | public IList Text => Component.Text; 6 | 7 | public bool ShowSize => Component.ShowSize; 8 | 9 | public StringNumberBoolean? Counter => Component.Counter; 10 | 11 | public StringNumber? ComputedCounterValue => Component.ComputedCounterValue; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Form/BForm.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 | 6 |
7 | @ChildContent?.Invoke(FormContext) 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Form/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Form; 2 | 3 | public class ValidationResult 4 | { 5 | public ValidationResult(string field, string message, ValidationResultTypes validationResultType) 6 | { 7 | Field = field; 8 | Message = message; 9 | ValidationResultType = validationResultType; 10 | } 11 | 12 | public string Field { get; init; } 13 | 14 | public string Message { get; init; } 15 | 16 | public ValidationResultTypes ValidationResultType { get; init; } 17 | } 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Form/ValidationResultTypes.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Form; 2 | 3 | public enum ValidationResultTypes 4 | { 5 | Error = 1, 6 | Warning 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Grid/AlignContentTypes.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum AlignContentTypes 4 | { 5 | None = 0, 6 | Start, 7 | Center, 8 | End, 9 | SpaceBetween, 10 | SpaceAround, 11 | Stretch 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Grid/AlignTypes.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum AlignTypes 4 | { 5 | None = 0, 6 | Auto, 7 | Start, 8 | Center, 9 | End, 10 | Baseline, 11 | Stretch 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Grid/JustifyTypes.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | // TODO: change to JustifyType 4 | public enum JustifyTypes 5 | { 6 | None = 0, 7 | Start, 8 | Center, 9 | End, 10 | SpaceBetween, 11 | SpaceAround 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Hover/BHover.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BActivatableBase 3 | 4 | @ChildContent?.Invoke(new HoverProps(IsActive, ActivatorAttributes)) 5 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Hover/BHover.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BHover : BActivatableBase 4 | { 5 | [Parameter] 6 | public RenderFragment? ChildContent { get; set; } 7 | 8 | public override Dictionary ActivatorAttributes => new() 9 | { 10 | { ActivatorId, true } 11 | }; 12 | 13 | protected override void OnInitialized() 14 | { 15 | base.OnInitialized(); 16 | 17 | OpenOnHover = true; 18 | OpenOnClick = false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Hover/HoverProps.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class HoverProps : ActivatorProps 4 | { 5 | public HoverProps(bool hover, Dictionary attrs) : base(attrs) 6 | { 7 | Hover = hover; 8 | } 9 | 10 | public bool Hover { get; internal set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Icon/IIcon.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IIcon : IHasProviderComponent, ITransitionIf 4 | { 5 | bool Dense { get; set; } 6 | 7 | bool Disabled { get; set; } 8 | 9 | bool Left { get; set; } 10 | 11 | ElementReference Ref { get; set; } 12 | 13 | bool Right { get; set; } 14 | 15 | StringNumber? Size { get; set; } 16 | 17 | string? Tag { get; set; } 18 | 19 | EventCallback OnClick { get; set; } 20 | 21 | Task HandleOnClick(MouseEventArgs args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Icon/Icon.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | [GenerateOneOf] 4 | public partial class Icon : OneOfBase 5 | { 6 | public bool IsAlias => IsT0 && AsT0.StartsWith("$"); 7 | 8 | public bool IsCssFont => IsT0 && !AsT0.StartsWith("$"); 9 | 10 | public bool IsSvg => IsT1 || IsT2; 11 | 12 | public SvgPath[] GetSvgPaths() 13 | { 14 | if (IsT0) 15 | { 16 | return Array.Empty(); 17 | } 18 | 19 | return IsT2 ? AsT2 : new[] { AsT1 }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Icon/IconType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public enum IconType 4 | { 5 | /// 6 | /// Webfont 7 | /// 8 | Webfont, 9 | 10 | /// 11 | /// Webfont without pseudo element 12 | /// 13 | WebfontNoPseudo, 14 | 15 | Svg 16 | } 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Icon/SvgPath.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class SvgPath 4 | { 5 | public string D { get; } 6 | 7 | public Dictionary? Attributes { get; } 8 | 9 | public SvgPath(string d, Dictionary? attributes = null) 10 | { 11 | D = d; 12 | Attributes = attributes; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/BImage.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BImage : BResponsive 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/BImageBody.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TImage 3 | @inherits ComponentPartBase 4 | 5 | @RenderPart(typeof(BResponsiveSizer<>)) 6 | @RenderPart(typeof(BImageContent<>)) 7 | @RenderPart(typeof(BPlaceholderSlot<>)) 8 | @RenderPart(typeof(BResponsiveContent<>)) 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/BImageBody.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BImageBody : ComponentPartBase 4 | where TImage : IImage 5 | { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/Content/BImageContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TImage 3 | @inherits ComponentPartBase 4 | 5 | @if (!string.IsNullOrEmpty(Src) || !string.IsNullOrEmpty(LazySrc) || !string.IsNullOrEmpty(Gradient)) 6 | { 7 | @* TODO: Wait for the "in-out" mode of the transition to be implemented *@ 8 |
10 |
11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/Content/BImageContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BImageContent : ComponentPartBase where TImage : IImage 4 | { 5 | public string? Src => Component.Src; 6 | 7 | public string? LazySrc => Component.LazySrc; 8 | 9 | public string? Gradient => Component.Gradient; 10 | 11 | public bool IsLoading => Component.IsLoading; 12 | 13 | public string? Transition => Component.Transition; 14 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/IImage.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IImage : IResponsive 4 | { 5 | RenderFragment? PlaceholderContent { get; } 6 | 7 | bool IsLoading { get; } 8 | 9 | bool Contain { get; } 10 | 11 | string? LazySrc { get; } 12 | 13 | string? Src { get; } 14 | 15 | string? Gradient { get; } 16 | 17 | string? Transition { get; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/PlaceholderSlot/BPlaceholderSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TImage 3 | @inherits ComponentPartBase 4 | @if (PlaceholderContent != null) 5 | { 6 | 7 | 9 | @PlaceholderContent 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Image/PlaceholderSlot/BPlaceholderSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BPlaceholderSlot : ComponentPartBase where TImage : IImage 4 | { 5 | public string? Transition => Component.Transition; 6 | 7 | public bool IsLoading => Component.IsLoading; 8 | 9 | public RenderFragment? PlaceholderContent => Component.PlaceholderContent; 10 | } 11 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/BInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | @attribute [CascadingTypeParameter(nameof(TValue))] 4 | @typeparam TValue 5 | @implements IInput 6 | 7 | 8 | 9 | 10 |
11 | @RenderPart(typeof(BInputContent<,>)) 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/AppendSlot/BInputAppendSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (AppendContent != null || !string.IsNullOrWhiteSpace(AppendIcon)) 7 | { 8 | var childContent = (RenderFragment?)null; 9 | 10 | if (AppendContent != null) 11 | { 12 | childContent = AppendContent; 13 | } 14 | else if (AppendIcon != null) 15 | { 16 | childContent = RenderPart(typeof(BInputIcon<,>), "append-icon", AppendIcon, HandleOnAppendClickAsync, arg0Name: "Type", arg1Name: "Icon", arg2Name: "OnClick"); 17 | } 18 | 19 | @RenderPart(typeof(BInputSlot<,>), "append", "outer", childContent, arg0Name: "Type", "Location") 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/AppendSlot/BInputAppendSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BInputAppendSlot where TInput : IInput 4 | { 5 | public string? AppendIcon => Component.AppendIcon; 6 | 7 | public RenderFragment? AppendContent => Component.AppendContent; 8 | 9 | public EventCallback HandleOnAppendClickAsync => 10 | Component.HasAppendClick 11 | ? EventCallback.Factory.Create(Component, Component.HandleOnAppendClickAsync) 12 | : default; 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/AppendSlot/Icon/BInputIcon.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BInputIcon : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | [Parameter] 7 | public string? Icon { get; set; } 8 | 9 | [Parameter, EditorRequired] 10 | public string Type { get; set; } = null!; 11 | 12 | [Parameter] 13 | public EventCallback OnClick { get; set; } 14 | 15 | [Parameter] 16 | public Action? ReferenceCapture { get; set; } 17 | 18 | private ElementReference Element 19 | { 20 | set => ReferenceCapture?.Invoke(value); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/AppendSlot/Slot/BInputSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (ChildContent != null) 7 | { 8 | var name = $"{Type}-{Location}"; 9 |
10 | @ChildContent 11 |
12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/AppendSlot/Slot/BInputSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BInputSlot : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | [Parameter, EditorRequired] 7 | public string Type { get; set; } = null!; 8 | 9 | [Parameter, EditorRequired] 10 | public string Location { get; set; } = null!; 11 | 12 | [Parameter] 13 | public RenderFragment? ChildContent { get; set; } 14 | 15 | [Parameter] 16 | public Action? ReferenceCapture { get; set; } 17 | 18 | public ElementReference Element 19 | { 20 | set => ReferenceCapture?.Invoke(value); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/BInputContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @RenderPart(typeof(BInputPrependSlot<,>)) 7 | @RenderPart(typeof(BInputControl<,>)) 8 | @RenderPart(typeof(BInputAppendSlot<,>)) 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/BInputContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputContent : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/BInputControl.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 |
8 | @RenderPart(typeof(BInputInputSlot<,>)) 9 | @RenderPart(typeof(BInputMessages<,>)) 10 |
11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/BInputControl.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputControl : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/BInputInputSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 |
10 | @RenderPart(typeof(BInputDefaultSlot<,>)) 11 |
12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/BInputInputSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputInputSlot : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | public ElementReference InputSlotRef 7 | { 8 | get 9 | { 10 | return Component.InputSlotElement; 11 | } 12 | set 13 | { 14 | Component.InputSlotElement = value; 15 | } 16 | } 17 | 18 | public EventCallback HandleOnMouseDownAsync => EventCallback.Factory.Create(Component, Component.HandleOnMouseDownAsync); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/DefaultSlot/BInputDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @RenderPart(typeof(BInputLabel<,>)) 7 | @ComponentChildContent 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/DefaultSlot/BInputDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputDefaultSlot : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | public bool HasLabel => Component.HasLabel; 7 | 8 | public RenderFragment? ComponentChildContent => Component.ChildContent; 9 | 10 | public string? Label => Component.Label; 11 | 12 | public RenderFragment? LabelContent => Component.LabelContent; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/DefaultSlot/Label/BInputLabel.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (HasLabel) 7 | { 8 | 9 | @if (LabelContent != null) 10 | { 11 | @LabelContent 12 | } 13 | else 14 | { 15 | @Label 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/InputSlot/DefaultSlot/Label/BInputLabel.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputLabel : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | public bool HasLabel => Component.HasLabel; 7 | 8 | public string? Label => Component.Label; 9 | 10 | public RenderFragment? LabelContent => Component.LabelContent; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/Messages/BInputMessages.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (ShowDetails) 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/Control/Messages/BInputMessages.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BInputMessages : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | public bool ShowDetails => Component.ShowDetails; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/Content/PrependSlot/BInputPrependSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BInputPrependSlot : ComponentPartBase 4 | where TInput : IInput 5 | { 6 | public RenderFragment? PrependContent => Component.PrependContent; 7 | 8 | public string? PrependIcon => Component.PrependIcon; 9 | 10 | public EventCallback HandleOnPrependClickAsync => 11 | Component.HasPrependClick 12 | ? EventCallback.Factory.Create(Component, Component.HandleOnPrependClickAsync) 13 | : default; 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/IInputJsCallbacks.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IInputJsCallbacks 4 | { 5 | ElementReference InputElement { get; } 6 | 7 | ElementReference InputSlotElement { get; } 8 | 9 | int InternalDebounceInterval { get; } 10 | 11 | Task HandleOnInputAsync(ChangeEventArgs args); 12 | 13 | Task HandleOnChangeAsync(ChangeEventArgs args); 14 | 15 | Task HandleOnClickAsync(ExMouseEventArgs args); 16 | 17 | Task HandleOnMouseUpAsync(ExMouseEventArgs args); 18 | 19 | void StateHasChangedForJsInvokable(); 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/IValidatable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Forms; 2 | 3 | namespace BlazorComponent 4 | { 5 | public interface IValidatable 6 | { 7 | FieldIdentifier ValueIdentifier { get; set; } 8 | 9 | bool Validate(); 10 | 11 | void Reset(); 12 | 13 | void ResetValidation(); 14 | 15 | bool HasError { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Input/InternalValueChangeType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Components.Input; 2 | 3 | public enum InternalValueChangeType 4 | { 5 | /// 6 | /// Triggered by button click or something else 7 | /// 8 | InternalOperation, 9 | 10 | /// 11 | /// Triggered by original input or change event 12 | /// 13 | Input, 14 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/BButtonGroup.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BButtonGroup : BItemGroup 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/BGroupItem.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public abstract class BGroupItem : BGroupable 4 | where TGroup : ItemGroupBase 5 | { 6 | protected BGroupItem(GroupType groupType) : base(groupType) 7 | { 8 | } 9 | 10 | protected BGroupItem(GroupType groupType, bool bootable) : base(groupType, bootable) 11 | { 12 | } 13 | 14 | [Parameter] 15 | public RenderFragment? ChildContent { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/BItem.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BGroupable 3 | 4 | @ComputedChildContent -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/BItemGroup.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits ItemGroupBase 3 | 4 | 5 | 6 |
7 | @ChildContent 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/IItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IItem : IGroupable 4 | { 5 | RenderFragment? ChildContent { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ItemGroup/ItemContext.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ItemContext 4 | { 5 | public bool Active { get; init; } 6 | 7 | public string? ActiveClass { get; set; } 8 | 9 | public Func Toggle { get; init; } 10 | 11 | public ForwardRef Ref { get; set; } 12 | 13 | public StringNumber? Value { get; set; } 14 | 15 | public ItemContext(bool active, string? activeClass, Func toggle, ForwardRef @ref, StringNumber? value) 16 | { 17 | Active = active; 18 | ActiveClass = activeClass; 19 | Toggle = toggle; 20 | Ref = @ref; 21 | Value = value; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Label/BLabel.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 | 12 | @ChildContent 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemAction.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @ChildContent 6 |
7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemAction.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BListItemAction : BDomComponentBase 6 | { 7 | [Parameter] 8 | public RenderFragment? ChildContent { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemActionText.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 | @ChildContent 6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemActionText.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BListItemActionText : BDomComponentBase 4 | { 5 | [Parameter] 6 | public RenderFragment? ChildContent { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @ChildContent 6 |
7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemContent.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BListItemContent : BDomComponentBase 6 | { 7 | [Parameter] 8 | public RenderFragment? ChildContent { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemIcon.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @ChildContent 6 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemIcon.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BListItemIcon : BDomComponentBase 6 | { 7 | [Parameter] 8 | public RenderFragment? ChildContent { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemSubtitle.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @ChildContent 6 |
7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemSubtitle.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BListItemSubtitle : BDomComponentBase 4 | { 5 | [Parameter] 6 | public RenderFragment? ChildContent { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemTitle.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @ChildContent 6 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/List/BListItemTitle.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorComponent 4 | { 5 | public partial class BListItemTitle : BDomComponentBase 6 | { 7 | [Parameter] 8 | public RenderFragment? ChildContent { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/BMessages.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 |
6 | @RenderPart(typeof(BMessagesChildren<>)) 7 |
8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/Children/BMessagesChildren.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TMessages 3 | @inherits ComponentPartBase 4 | 5 |
6 | @if (Value != null) 7 | { 8 | foreach (var message in Value) 9 | { 10 | @RenderPart(typeof(BMessagesMessage<>),arg0: message) 11 | } 12 | } 13 |
14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/Children/BMessagesChildren.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BMessagesChildren where TMessages : IMessages 4 | { 5 | public List? Value => Component.Value; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/Children/Message/BMessagesMessage.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TMessages 3 | @inherits ComponentPartBase 4 | 5 |
6 | @if (ComponentChildContent != null) 7 | { 8 | @ComponentChildContent(Message) 9 | } 10 | else 11 | { 12 | @Message 13 | } 14 |
15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/Children/Message/BMessagesMessage.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BMessagesMessage where TMessages : IMessages 4 | { 5 | [Parameter] 6 | public string Message { get; set; } = null!; 7 | 8 | public RenderFragment? ComponentChildContent => Component.ChildContent; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Messages/IMessages.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IMessages : IHasProviderComponent 4 | { 5 | List? Value { get; } 6 | 7 | RenderFragment? ChildContent { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/MobilePicker/MobilePickerColumn.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class MobilePickerColumn 4 | { 5 | public List Values { get; set; } 6 | 7 | public int Index { get; set; } 8 | 9 | public string? ClassName { get; set; } 10 | 11 | public MobilePickerColumn(List values) 12 | { 13 | Values = values; 14 | } 15 | 16 | public MobilePickerColumn(List values, int index): this(values) 17 | { 18 | Index = index; 19 | } 20 | 21 | public MobilePickerColumn(List values, int index, string className): this(values, index) 22 | { 23 | ClassName = className; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/BOtpInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @for (var i = 0; i < @Length; i++) 6 | { 7 | var index = i; 8 | @RenderPart(typeof(BOtpInputSlot<>), builder => { 9 | builder.Add("Index", index); 10 | builder.Add("Value", Values[index]); 11 | }) 12 | } 13 |
14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/BOtpInputEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BOtpInputEventArgs where T : EventArgs 4 | { 5 | public T Args { get; set; } 6 | 7 | public int Index { get; set; } 8 | 9 | public BOtpInputEventArgs(T args) 10 | { 11 | Args = args; 12 | } 13 | 14 | public BOtpInputEventArgs(T args, int index) 15 | { 16 | Args = args; 17 | Index = index; 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/IOtpInput.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IOtpInput : IHasProviderComponent 4 | { 5 | OtpInputType Type { get; set; } 6 | 7 | bool Readonly { get; set; } 8 | 9 | bool Disabled { get; set; } 10 | 11 | Task OnPasteAsync(BOtpInputEventArgs args); 12 | 13 | List InputRefs { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/OtpInputType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum OtpInputType 4 | { 5 | Text, 6 | Number, 7 | Password 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/OtpJsResult.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class OtpJsResult 4 | { 5 | public string? type { get; set; } 6 | public string? value { get; set; } 7 | public int index { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/OtpInput/slot/BOtpInputSlotItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class BOtpInputSlotItem 4 | { 5 | public ElementReference Element; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/BProgressCircular.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 |
5 | @RenderPart(typeof(BProgressCircularSvg<>)) 6 | @RenderPart(typeof(BProgressCircularInfo<>)) 7 |
8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/IProgressCircular.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IProgressCircular : IHasProviderComponent 4 | { 5 | Dictionary SvgAttrs => new(); 6 | 7 | Dictionary CircleAttrs => new(); 8 | 9 | RenderFragment? ChildContent { get; } 10 | 11 | bool Indeterminate => default; 12 | 13 | string StrokeDashOffset => null!; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Info/BProgressCircularInfo.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressCircular 3 | @inherits ComponentPartBase 4 | 5 |
6 | @ComponentChildContent 7 |
8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Info/BProgressCircularInfo.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressCircularInfo where TProgressCircular : IProgressCircular 4 | { 5 | public RenderFragment? ComponentChildContent => Component.ChildContent; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/ProgressCircularAbstractProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class ProgressCircularAbstractProviderExtensions 4 | { 5 | public static ComponentAbstractProvider ApplyProgressCircularDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Apply(typeof(BProgressCircularSvg<>), typeof(BProgressCircularSvg)) 9 | .Apply(typeof(BProgressCircularInfo<>), typeof(BProgressCircularInfo)) 10 | .Apply(typeof(BProgressCircularCircle<>), typeof(BProgressCircularCircle)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Svg/BProgressCircularSvg.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressCircular 3 | @inherits ComponentPartBase 4 | 5 | 6 | @if (!Indeterminate) 7 | { 8 | @RenderPart(typeof(BProgressCircularCircle<>), "underlay", "0", arg0Name: "Name", arg1Name: "Offset") 9 | } 10 | @RenderPart(typeof(BProgressCircularCircle<>), "overlay", StrokeDashOffset, arg0Name: "Name", arg1Name: "Offset") 11 | 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Svg/BProgressCircularSvg.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressCircularSvg where TProgressCircular : IProgressCircular 4 | { 5 | public Dictionary SvgAttrs => Component.SvgAttrs; 6 | 7 | public bool Indeterminate => Component.Indeterminate; 8 | 9 | public string StrokeDashOffset => Component.StrokeDashOffset; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Svg/Circle/BProgressCircularCircle.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressCircular 3 | @inherits ComponentPartBase 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressCircular/Svg/Circle/BProgressCircularCircle.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressCircularCircle where TProgressCircular : IProgressCircular 4 | { 5 | [Parameter] 6 | public string Name { get; set; } = null!; 7 | 8 | [Parameter] 9 | public string Offset { get; set; } = null!; 10 | 11 | public Dictionary CircleAttrs => Component.CircleAttrs; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Background/BProgressLinearBackground.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Background/BProgressLinearBackground.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearBackground where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Buffer/BProgressLinearBuffer.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Buffer/BProgressLinearBuffer.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearBuffer where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Content/BProgressLinearContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 | @if (ComponentChildContent != null) 6 | { 7 |
8 | @ComponentChildContent(Value) 9 |
10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Content/BProgressLinearContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearContent where TProgressLinear : IProgressLinear 4 | { 5 | public double Value => Component.Value; 6 | 7 | public RenderFragment? ComponentChildContent => Component.ChildContent; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Determinate/BProgressLinearDeterminate.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Determinate/BProgressLinearDeterminate.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearDeterminate where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/IProgressLinear.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IProgressLinear : IHasProviderComponent 4 | { 5 | bool Stream { get; } 6 | 7 | double Value { get; } 8 | 9 | RenderFragment? ChildContent { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Indeterminate/BProgressLinearIndeterminate.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | @RenderPart(typeof(BProgressLinearLong<>)) 7 | @RenderPart(typeof(BProgressLinearShort<>)) 8 |
9 | 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Indeterminate/BProgressLinearIndeterminate.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearIndeterminate where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Long/BProgressLinearLong.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Long/BProgressLinearLong.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearLong where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Short/BProgressLinearShort.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Short/BProgressLinearShort.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearShort where TProgressLinear : IProgressLinear 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Stream/BProgressLinearStream.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TProgressLinear 3 | @inherits ComponentPartBase 4 | 5 | @if (Stream) 6 | { 7 |
8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/ProgressLinear/Stream/BProgressLinearStream.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BProgressLinearStream where TProgressLinear : IProgressLinear 4 | { 5 | public bool Stream => Component.Stream; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Radio/BRadioGroupDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputDefaultSlot> 4 | 5 |
6 | @if (HasLabel) 7 | { 8 | 9 | @if (LabelContent != null) 10 | { 11 | @LabelContent 12 | } 13 | else 14 | { 15 | @Label 16 | } 17 | 18 | } 19 | @ComponentChildContent 20 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Radio/BRadioGroupDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BRadioGroupDefaultSlot 4 | { 5 | //TODO:可以进一步完善 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Radio/IRadio.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IRadio 4 | { 5 | TValue Value { get; } 6 | 7 | void RefreshState(); 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Radio/IRadioGroup.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IRadioGroup 4 | { 5 | TValue Value { get; } 6 | 7 | string? ValidationState { get; } 8 | 9 | bool IsDisabled { get; } 10 | 11 | bool IsReadonly { get; } 12 | 13 | bool Dense { get; } 14 | 15 | Task Toggle(TValue value); 16 | 17 | void AddRadio(IRadio radio); 18 | } 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/RangeSlider/Children/Input/BRangeSliderInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TRangeSlider 4 | @inherits ComponentPartBase 5 | 6 | @for (var i = 0; i < 2; i++) 7 | { 8 | var index = i; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/RangeSlider/Children/Input/BRangeSliderInput.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BRangeSliderInput where TRangeSlider : IRangeSlider 4 | { 5 | public IList InternalValue => Component.InternalValue ?? new List(); 6 | 7 | public Dictionary InputAttrs => Component.InputAttrs; 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/RangeSlider/Children/TrackContainer/BRangeSliderTrackContainer.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TRangeSlider 4 | @inherits BSliderTrackContainer, TValue, TRangeSlider> 5 | 6 |
7 | @for (var i = 0; i < 3; i++) 8 | { 9 | var index = i; 10 |
11 | } 12 |
13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/RangeSlider/Children/TrackContainer/BRangeSliderTrackContainer.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BRangeSliderTrackContainer where TRangeSlider : IRangeSlider 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/RangeSlider/IRangeSlider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IRangeSlider : ISlider, TValue> 4 | { 5 | ElementReference SecondThumbElement { set; } 6 | 7 | Task HandleOnSecondFocusAsync(FocusEventArgs args); 8 | 9 | Task HandleOnSecondBlurAsync(FocusEventArgs args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/BResponsive.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 | 10 | @RenderPart(typeof(BResponsiveBody<>)) 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/BResponsiveBody.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TResponsive 3 | @inherits ComponentPartBase 4 | 5 | @RenderPart(typeof(BResponsiveSizer<>)) 6 | @RenderPart(typeof(BResponsiveContent<>)) 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/BResponsiveBody.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BResponsiveBody : ComponentPartBase 4 | where TResponsive : IResponsive 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/Content/BResponsiveContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TResponsive 3 | @inherits ComponentPartBase 4 | 5 |
6 | @ComponentChildContent 7 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/Content/BResponsiveContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BResponsiveContent : ComponentPartBase 4 | where TResponsive : IResponsive 5 | { 6 | public RenderFragment? ComponentChildContent => Component.ChildContent; 7 | } 8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/Sizer/BResponsiveSizer.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TResponsive 3 | @inherits ComponentPartBase 4 | 5 | @if (AspectRatio != null) 6 | { 7 |
8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/Body/Sizer/BResponsiveSizer.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BResponsiveSizer 4 | where TResponsive : IResponsive 5 | { 6 | public StringNumber? AspectRatio => Component.ComputedAspectRatio; 7 | } 8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Responsive/IResponsive.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IResponsive : IHasProviderComponent 4 | { 5 | StringNumber? AspectRatio { get; } 6 | 7 | string? ContentClass { get; } 8 | 9 | StringNumber? Height { get; } 10 | 11 | StringNumber? MaxHeight { get; } 12 | 13 | StringNumber? MinHeight { get; } 14 | 15 | StringNumber? Width { get; } 16 | 17 | StringNumber? MaxWidth { get; } 18 | 19 | StringNumber? MinWidth { get; } 20 | 21 | RenderFragment? ChildContent { get; } 22 | 23 | StringNumber? ComputedAspectRatio { get; } 24 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/BSelectDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectDefaultSlot 4 | { 5 | public string? Prefix => Component.Prefix; 6 | 7 | public string? Suffix => Component.Prefix; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/HiddenInput/BSelectHiddenInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/HiddenInput/BSelectHiddenInput.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectHiddenInput where TInput : ISelect 4 | { 5 | public bool Multiple => Component.Multiple; 6 | 7 | public IList InternalValues => Component.InternalValues; 8 | 9 | public TValue InternalValue => Component.InternalValue; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/BSelectMenu.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | 9 | @RenderPart(typeof(BSelectList<,,,>)) 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/BSelectMenu.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectMenu where TInput : ISelect 4 | { 5 | public IList ComputedItems => Component.ComputedItems; 6 | 7 | public object Menu 8 | { 9 | set 10 | { 11 | Component.Menu = value; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/List/BSelectList.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/List/BSelectList.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectList where TInput : ISelect 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/List/ListWithSlot/BSelectListWithSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Menu/List/ListWithSlot/BSelectListWithSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListWithSlot where TInput : ISelect 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Divider/BSelectListDivider.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @inherits ComponentPartBase> 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Divider/BSelectListDivider.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListDivider 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Header/BSelectListHeader.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @inherits ComponentPartBase> 6 | 7 | 8 | @Header 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Header/BSelectListHeader.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListHeader 4 | { 5 | [Parameter] 6 | public string? Header { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/ISelectList.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ISelectList : IHasProviderComponent 4 | { 5 | bool Action { get; } 6 | bool HideSelected { get; } 7 | IList Items { get; } 8 | string? NoDataText { get; } 9 | RenderFragment>? ItemContent { get; } 10 | string GetFilteredText(TItem item); 11 | bool HasItem(TItem item); 12 | bool GetDisabled(TItem item); 13 | EventCallback OnSelect { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/StaticNoDataTile/BSelectListStaticNoDataTile.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @inherits ComponentPartBase> 6 | 7 | 10 | @RenderPart(typeof(BSelectListTileContent<,,>),RenderText(NoDataText),arg0Name:"ChildContent") 11 | 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/StaticNoDataTile/BSelectListStaticNoDataTile.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListStaticNoDataTile 4 | { 5 | protected string NoDataText => Component.NoDataText; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Tile/Action/BSelectListAction.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @inherits ComponentPartBase> 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Tile/Action/BSelectListAction.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListAction 4 | { 5 | [Parameter] 6 | public TItem Item { get; set; } = default!; 7 | 8 | [Parameter] 9 | public bool Value { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Tile/TileContent/BSelectListTileContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @inherits ComponentPartBase> 6 | 7 | 8 | 9 | @if (ChildContent != null) 10 | { 11 | @ChildContent 12 | } 13 | else if (Item != null) 14 | { 15 | @((MarkupString)GetFilteredText(Item)) 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectList/Tile/TileContent/BSelectListTileContent.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectListTileContent 4 | { 5 | [Parameter] 6 | public TItem? Item { get; set; } 7 | 8 | [Parameter] 9 | public bool Value { get; set; } 10 | 11 | [Parameter] 12 | public RenderFragment? ChildContent { get; set; } 13 | 14 | protected string GetFilteredText(TItem item) => Component.GetFilteredText(item); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectListItemProps.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class SelectListItemProps 4 | { 5 | public SelectListItemProps(TItem item, Func onClick) 6 | { 7 | Item = item; 8 | OnClick = onClick; 9 | } 10 | 11 | public TItem Item { get; } 12 | 13 | public Func OnClick { get; } 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/SelectSelectionProps.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class SelectSelectionProps 4 | { 5 | public SelectSelectionProps(TItem item, int index, bool selected, bool disabled) 6 | { 7 | Item = item; 8 | Index = index; 9 | Selected = selected; 10 | Disabled = disabled; 11 | } 12 | 13 | public TItem Item { get; } 14 | 15 | public int Index { get; } 16 | 17 | public bool Selected { get; } 18 | 19 | public bool Disabled { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Selections/BSelectSelections.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectSelections where TInput : ISelect 4 | { 5 | protected bool HasChips => Component.HasChips; 6 | 7 | protected RenderFragment>? SelectionContent => Component.SelectionContent; 8 | 9 | protected IList SelectedItems => Component.SelectedItems; 10 | 11 | protected int SelectedIndex => Component.SelectedIndex; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Selections/ChipSelection/BSelectChipSelection.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | 9 | @GetText(Item) 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Selections/ChipSelection/BSelectChipSelection.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSelectChipSelection where TInput : ISelect 4 | { 5 | [Parameter, EditorRequired] 6 | public TItem Item { get; set; } = default!; 7 | 8 | [Parameter] 9 | public int Index { get; set; } 10 | 11 | [Parameter] 12 | public bool Selected { get; set; } 13 | 14 | [Parameter] 15 | public bool Last { get; set; } 16 | 17 | protected string? GetText(TItem item) => Component.GetText(item); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Selections/CommaSelection/BSelectCommaSelection.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 |
9 | @($"{GetText(Item)}{(Last?"":", ")}") 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Select/Selections/SlotSelection/BSelectSlotSelection.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TItem 3 | @typeparam TItemValue 4 | @typeparam TValue 5 | @typeparam TInput 6 | @inherits ComponentPartBase 7 | 8 | @{ 9 | var props = new SelectSelectionProps(Item, Index, Selected, Disabled); 10 | @SelectionContent?.Invoke(props) 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/SlideGroup/BSlideGroup.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BItemGroup 3 | 4 | 5 |
6 | @RenderPart(typeof(BSlideGroupPrev<>)) 7 |
8 |
9 | @ChildContent 10 |
11 |
12 | @RenderPart(typeof(BSlideGroupNext<>)) 13 |
14 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/SlideGroup/BSlideGroupNext.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TSlideGroup 3 | @inherits ComponentPartBase 4 | 5 |
6 | @if (Visible) 7 | { 8 | @if (IconContent != null) 9 | { 10 | @IconContent 11 | } 12 | else 13 | { 14 | 15 | @Icon 16 | 17 | } 18 | } 19 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/SlideGroup/BSlideGroupNext.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSlideGroupNext : ComponentPartBase 4 | where TSlideGroup : ISlideGroup 5 | { 6 | protected bool Active => Component.HasNext; 7 | 8 | protected string? Icon => Component.NextIcon; 9 | 10 | protected RenderFragment? IconContent => Component.NextContent; 11 | 12 | protected bool Visible => !(Component.ShowArrows == null && !Active); 13 | 14 | protected Task HandleOnClick(MouseEventArgs args) 15 | { 16 | return Component.OnAffixClick("next"); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/SlideGroup/BSlideGroupPrev.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TSlideGroup 3 | @inherits ComponentPartBase 4 | 5 |
6 | @if (Visible) 7 | { 8 | @if (IconContent != null) 9 | { 10 | @IconContent 11 | } 12 | else 13 | { 14 | 15 | @Icon 16 | 17 | } 18 | } 19 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/SlideGroup/BSlideGroupPrev.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSlideGroupPrev : ComponentPartBase 4 | where TSlideGroup : ISlideGroup 5 | { 6 | protected bool Active => Component.HasPrev; 7 | 8 | protected string? Icon => Component.PrevIcon; 9 | 10 | protected RenderFragment? IconContent => Component.PrevContent; 11 | 12 | protected bool Visible => !(Component.ShowArrows == null && !Active); 13 | 14 | protected Task HandleOnClick(MouseEventArgs args) 15 | { 16 | return Component.OnAffixClick("prev"); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/BSliderDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits BInputDefaultSlot 6 | 7 | @if (!InverseLabel) 8 | { 9 | @RenderPart(typeof(BInputLabel<,>)) 10 | } 11 | @RenderPart(typeof(BSliderSlider<,,>)) 12 | @if (InverseLabel) 13 | { 14 | @RenderPart(typeof(BInputLabel<,>)) 15 | } 16 | @RenderPart(typeof(BLoadableProgress<>)) 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/BSliderDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderDefaultSlot where TInput : ISlider 4 | { 5 | public bool InverseLabel => Component.InverseLabel; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/BSliderSlider.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 |
10 | @RenderPart(typeof(BSliderChildren<,,>)) 11 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/BSliderSlider.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderSlider where TInput : ISlider 4 | { 5 | public ElementReference SliderElement 6 | { 7 | set { Component.SliderElement = value; } 8 | } 9 | 10 | public EventCallback HandleOnSliderClickAsync => EventCallback.Factory.Create(Component, Component.HandleOnSliderClickAsync); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/BSliderChildren.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 | @RenderPart(typeof(BSliderInput<,,>)) 8 | @RenderPart(typeof(BSliderTrackContainer<,,>)) 9 | @RenderPart(typeof(BSliderSteps<,,>)) 10 | @RenderPart(typeof(BSliderThumbContainer<,,>)) 11 | 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/BSliderChildren.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderChildren where TInput : ISlider 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Input/BSliderInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Input/BSliderInput.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderInput where TInput : ISlider 4 | { 5 | public TValue InternalValue => Component.InternalValue; 6 | 7 | public Dictionary InputAttrs => Component.InputAttrs; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Steps/BSliderSteps.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderSteps where TInput : ISlider 4 | { 5 | public double Step => (double)(dynamic)Component.Step!; 6 | 7 | public bool ShowTicks => Component.ShowTicks; 8 | 9 | public double NumTicks => Component.NumTicks; 10 | 11 | public bool Vertical => Component.Vertical; 12 | 13 | public List TickLabels => Component.TickLabels; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/BSliderThumbContainer.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 |
15 | @RenderPart(typeof(BSliderThumb<,,>)) 16 | @if (ShowThumbLabel) 17 | { 18 | @RenderPart(typeof(BSliderThumbLabel<,,>)) 19 | } 20 |
21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/Thumb/BSliderThumb.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 |
8 |
9 | 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/Thumb/BSliderThumb.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderThumb where TInput : ISlider 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/ThumbLabel/BSliderThumbLabel.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 | 8 | 9 |
10 |
@ComputedThumbLabelContent
11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/ThumbLabel/BSliderThumbLabel.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderThumbLabel where TInput : ISlider 4 | { 5 | [Parameter] 6 | public int Index { get; set; } 7 | 8 | public RenderFragment? ComputedThumbLabelContent => Component.ComputedThumbLabelContent(Index); 9 | 10 | public bool ShowThumbLabelContainer => Component.ShowThumbLabelContainer; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/TrackContainer/BSliderTrackContainer.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TNumeric 4 | @typeparam TInput 5 | @inherits ComponentPartBase 6 | 7 |
8 |
9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/TrackContainer/BSliderTrackContainer.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSliderTrackContainer where TInput : ISlider 4 | { 5 | public ElementReference TrackElement 6 | { 7 | set { Component.TrackElement = value; } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Subheader/BSubheader.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BDomComponentBase 3 | 4 | 5 |
6 | @ChildContent 7 |
8 |
-------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/BSwitchDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputDefaultSlot> 4 | 5 | @RenderPart(typeof(BSwitchSwitch<,>)) 6 | @RenderPart(typeof(BInputLabel<,>)) 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/BSwitchDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSwitchDefaultSlot : BInputDefaultSlot> 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/IRippleable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IRippleable : IHasProviderComponent 4 | { 5 | bool? Ripple { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/ISwitch.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ISwitch : ISelectable 4 | { 5 | bool IsLoading { get; } 6 | 7 | string? LeftText { get; } 8 | 9 | string? RightText { get; } 10 | 11 | string? LeftIcon { get; } 12 | 13 | string? RightIcon { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/BSwitchSwitch.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSwitchSwitch where TInput : ISwitch 4 | { 5 | string? LeftText => Component.LeftText; 6 | 7 | string? RightText => Component.RightText; 8 | 9 | string? LeftIcon => Component.LeftIcon; 10 | 11 | string? RightIcon => Component.RightIcon; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/Input/BSelectableInput.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TInput 3 | @typeparam TValue 4 | @inherits ComponentPartBase 5 | 6 | 18 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/Progress/BSwitchProgress.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TInput 3 | @typeparam TValue 4 | @inherits ComponentPartBase 5 | 6 | @if (Visible) 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/Progress/BSwitchProgress.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BSwitchProgress where TInput : ISwitch 4 | { 5 | private bool Visible => Component.IsLoading; 6 | } 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/Ripple/BRippleableRipple.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TComponent 3 | @inherits ComponentPartBase 4 | 5 | @if (Ripple) 6 | { 7 |
8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Switch/Switch/Ripple/BRippleableRipple.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BRippleableRipple where TComponent : IRippleable 4 | { 5 | public bool Ripple => Component.Ripple ?? true; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/BTab.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BRoutableGroupItem 3 | 4 | 10 | @ChildContent 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/BTabsSlider.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TTabs 3 | @inherits ComponentPartBase 4 | 5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/BTabsSlider.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTabsSlider : ComponentPartBase 4 | where TTabs : ITabs 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/Body/BTabsBody.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TTabs 3 | @inherits ComponentPartBase 4 | 5 | @if (TabItems.Any()) 6 | { 7 | 8 | @foreach (var tabItem in TabItems) 9 | { 10 | 16 | @tabItem.ChildContent 17 | 18 | } 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/Body/BTabsBody.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTabsBody : ComponentPartBase 4 | where TTabs : ITabs 5 | { 6 | List TabItems => Component.TabItems; 7 | 8 | StringNumber? Value => Component.Value; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/ITabItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ITabItem : IItem 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/ITabs.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ITabs : IHasProviderComponent 4 | { 5 | bool HideSlider { get; } 6 | 7 | string? SliderColor { get; } 8 | 9 | StringNumber SliderSize { get; } 10 | 11 | RenderFragment? ChildContent { get; } 12 | 13 | List TabItems { get; } 14 | 15 | StringNumber? Value { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/ITabsBar.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ITabsBar 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/ITabsItems.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ITabsItems 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/Tab/BTabsTab.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TTabs 3 | @inherits ComponentPartBase 4 | 5 | @ComponentChildContent 6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/Tab/BTabsTab.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTabsTab : ComponentPartBase 4 | where TTabs : ITabs 5 | { 6 | protected RenderFragment? ComponentChildContent => Component.ChildContent; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tabs/TabsAbstractProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class TabsAbstractProviderExtensions 4 | { 5 | public static ComponentAbstractProvider ApplyTabsDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Apply(typeof(BTabsSlider<>), typeof(BTabsSlider)) 9 | .Apply(typeof(BTabsTab<>), typeof(BTabsTab)) 10 | .Apply(typeof(BTabsBody<>), typeof(BTabsBody)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/AppendSlot/BTextFieldAppendSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BTextFieldAppendSlot 4 | { 5 | public string? AppendOuterIcon => Component.AppendOuterIcon; 6 | 7 | public RenderFragment? AppendOuterContent => Component.AppendOuterContent; 8 | 9 | public EventCallback HandleOnAppendOuterClickAsync => 10 | Component.OnAppendOuterClick.HasDelegate 11 | ? EventCallback.Factory.Create(Component, Component.HandleOnAppendOuterClickAsync) 12 | : default; 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/BTextFieldInputSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputInputSlot> 4 | 5 |
9 | @RenderPart(typeof(BTextFieldPrependInnerSlot<,>)) 10 | @RenderPart(typeof(BInputDefaultSlot<,>)) 11 |
12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/BTextFieldInputSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldInputSlot 4 | { 5 | protected Dictionary InputSlotAttrs => Component.InputSlotAttrs; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/BTextFieldDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits BInputDefaultSlot 5 | 6 | @RenderPart(typeof(BTextFieldFieldset<,>)) 7 | @RenderPart(typeof(BTextFieldTextFieldSlot<,>)) 8 | @RenderPart(typeof(BTextFieldNumberIconSlot<,>)) 9 | @RenderPart(typeof(BTextFieldClearIcon<,>)) 10 | @RenderPart(typeof(BTextFieldIconSlot<,>)) 11 | @RenderPart(typeof(BLoadableProgress<>)) 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/BTextFieldDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldDefaultSlot where TInput : ITextField 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/ClearIcon/BTextFieldClearIcon.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (Clearable) 7 | { 8 | RenderFragment? childContent; 9 | 10 | if (!IsDirty) 11 | { 12 | childContent = @
; 13 | } 14 | else 15 | { 16 | childContent = RenderPart(typeof(BInputIcon<,>), "clear-icon", ClearIcon, HandleOnClearClickAsync, arg0Name: "Type", arg1Name: "Icon", arg2Name: "OnClick"); 17 | } 18 | 19 | @RenderPart(typeof(BInputSlot<,>), "append", "inner", childContent, arg0Name: "Type", "Location") 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/ClearIcon/BTextFieldClearIcon.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldClearIcon where TInput : ITextField 4 | { 5 | public bool Clearable => Component.Clearable; 6 | 7 | public bool IsDirty => Component.IsDirty; 8 | 9 | public virtual string? ClearIcon => Component.ClearIcon; 10 | 11 | public EventCallback HandleOnClearClickAsync => EventCallback.Factory.Create(Component, Component.HandleOnClearClickAsync); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/Fieldset/BTextFieldFieldset.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (Outlined) 7 | { 8 |
9 | @RenderPart(typeof(BTextFieldLegend<,>)) 10 |
11 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/Fieldset/BTextFieldFieldset.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldFieldset where TInput : ITextField 4 | { 5 | public bool Outlined => Component.Outlined; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/Fieldset/Legend/BTextFieldLegend.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | 7 | 8 | @((MarkupString)InnerHTML) 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/Fieldset/Legend/BTextFieldLegend.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldLegend where TInput : ITextField 4 | { 5 | protected string InnerHTML => Component.LegendInnerHTML; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/IconSlot/BTextFieldIconSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BTextFieldIconSlot where TInput : ITextField 4 | { 5 | public string? AppendIcon => Component.AppendIcon; 6 | 7 | public RenderFragment? AppendContent => Component.AppendContent; 8 | 9 | public EventCallback HandleOnAppendClickAsync => Component.HasAppendClick 10 | ? EventCallback.Factory.Create(Component, Component.HandleOnAppendClickAsync) 11 | : default; 12 | 13 | public Action AppendInnerReferenceCapture => element => Component.AppendInnerElement = element; 14 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/TextFieldSlot/Affix/BTextFieldAffix.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 |
7 | @ChildContent 8 |
9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/TextFieldSlot/Affix/BTextFieldAffix.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldAffix where TInput : ITextField 4 | { 5 | [Parameter] 6 | public string? Type { get; set; } 7 | 8 | [Parameter] 9 | public RenderFragment? ChildContent { get; set; } 10 | 11 | [Parameter] 12 | public Action? ReferenceCapture { get; set; } 13 | 14 | public virtual string ComputedType => $"text-field-{Type}"; 15 | 16 | public ElementReference Element 17 | { 18 | set => ReferenceCapture?.Invoke(value); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/TextFieldSlot/BTextFieldTextFieldSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldTextFieldSlot where TInput : ITextField 4 | { 5 | public string? Prefix => Component.Prefix; 6 | 7 | public string? Suffix => Component.Suffix; 8 | 9 | public Action PrefixReferenceCapture => element => Component.PrefixElement = element; 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/TextFieldSlot/Label/BTextFieldLabel.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputLabel> 4 | 5 | @if (ShowLabel) 6 | { 7 | 8 | @if (LabelContent != null) 9 | { 10 | @LabelContent 11 | } 12 | else 13 | { 14 | @Label 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/InputSlot/DefaultSlot/TextFieldSlot/Label/BTextFieldLabel.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldLabel 4 | { 5 | public bool ShowLabel => Component.ShowLabel; 6 | 7 | public BLabel LabelReference 8 | { 9 | set 10 | { 11 | Component.LabelReference = value; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/Messages/BTextFieldMessages.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @inherits BInputMessages> 4 | 5 | @if (ShowDetails) 6 | { 7 |
8 | 9 | @RenderPart(typeof(BTextFieldCounter<,>)) 10 |
11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/Messages/BTextFieldMessages.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldMessages 4 | { 5 | public bool HasCounter => Component.HasCounter; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/Messages/Counter/BTextFieldCounter.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TValue 3 | @typeparam TInput 4 | @inherits ComponentPartBase 5 | 6 | @if (HasCounter) 7 | { 8 | if (CounterContent != null) 9 | { 10 | @CounterContent 11 | } 12 | else 13 | { 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/Content/Control/Messages/Counter/BTextFieldCounter.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTextFieldCounter where TInput : ITextField 4 | { 5 | public bool HasCounter => Component.HasCounter; 6 | 7 | public RenderFragment? CounterContent => Component.CounterContent; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TextField/TextFieldNumberProperty.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class TextFieldNumberProperty 4 | { 5 | public decimal? Min { get; set; } 6 | 7 | public decimal? Max { get; set; } 8 | 9 | public decimal Step { get; set; } = 1; 10 | 11 | public bool HideControl { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TimePicker/SelectingTimes.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum SelectingTimes 4 | { 5 | Hour = 1, 6 | Minute = 2, 7 | Second = 3 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TimePicker/TimeFormat.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum TimeFormat 4 | { 5 | AmPm, 6 | Hr24 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/TimePicker/TimePeriod.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum TimePeriod 4 | { 5 | Am, 6 | Pm 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/Activator/BTooltipActivator.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TTooltip 3 | @inherits ComponentPartBase 4 | 5 | @ComputedActivatorContent 6 | 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/Activator/BTooltipActivator.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BTooltipActivator 4 | where TTooltip : ITooltip 5 | { 6 | protected RenderFragment? ComputedActivatorContent => Component.ComputedActivatorContent; 7 | } 8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/ActivatorProps.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ActivatorProps 4 | { 5 | public ActivatorProps(Dictionary attrs) 6 | { 7 | Attrs = attrs; 8 | } 9 | 10 | public Dictionary Attrs { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/BTooltip.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @inherits BMenuable 3 | 4 | @RenderPart(typeof(BTooltipActivator<>)) 5 | 6 | 11 | @RenderPart(typeof(BTooltipContent<>)) 12 | 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/Content/BTooltipContent.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TTooltip 3 | @inherits ComponentPartBase 4 | 5 | @if (IsBooted) 6 | { 7 | 8 | 12 | @ComponentChildContent 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/ITooltip.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ITooltip : IHasProviderComponent, IActivatable, IMenuable 4 | { 5 | ElementReference ContentElement { set; } 6 | 7 | string? Transition { get; } 8 | 9 | RenderFragment? ChildContent { get; } 10 | 11 | RenderFragment? ActivatorContent { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Tooltip/TooltipAbstractProviderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public static class TooltipAbstractProviderExtensions 4 | { 5 | public static ComponentAbstractProvider ApplyTooltipDefault(this ComponentAbstractProvider abstractProvider) 6 | { 7 | return abstractProvider 8 | .Apply(typeof(BTooltipContent<>), typeof(BTooltipContent)) 9 | .Apply(typeof(BTooltipActivator<>), typeof(BTooltipActivator)); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Elements/BShouldRender.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Rendering; 2 | 3 | namespace BlazorComponent; 4 | 5 | public class BShouldRender : ComponentBase 6 | { 7 | [Parameter] public bool Value { get; set; } 8 | 9 | [Parameter] public RenderFragment? ChildContent { get; set; } 10 | 11 | protected override bool ShouldRender() 12 | { 13 | return Value; 14 | } 15 | 16 | protected override void BuildRenderTree(RenderTreeBuilder builder) 17 | { 18 | builder.AddContent(0, ChildContent); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Elements/IfTransitionElement.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Rendering; 2 | 3 | namespace BlazorComponent; 4 | 5 | public class IfTransitionElement : ToggleableTransitionElement 6 | { 7 | protected override void BuildRenderTree(RenderTreeBuilder builder) 8 | { 9 | if (LazyValue) 10 | { 11 | base.BuildRenderTree(builder); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Elements/ShowTransitionElement.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace BlazorComponent; 4 | 5 | public class ShowTransitionElement : ToggleableTransitionElement 6 | { 7 | protected override string ComputedStyle 8 | { 9 | get 10 | { 11 | if (LazyValue) return base.ComputedStyle; 12 | 13 | var stringBuilder = new StringBuilder(); 14 | stringBuilder.Append(base.ComputedStyle); 15 | stringBuilder.Append(" display:none;"); 16 | return stringBuilder.ToString().Trim(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/ITransitionElement.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Components.Transition; 2 | 3 | public interface ITransitionElement 4 | { 5 | Task OnTransitionEnd(string referenceId, LeaveEnter transition); 6 | 7 | Task OnTransitionCancel(string referenceId, LeaveEnter transition); 8 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/ITransitionIf.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface ITransitionIf 4 | { 5 | bool If { get; set; } 6 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/LeaveEnter.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public enum LeaveEnter 4 | { 5 | Leave, 6 | Enter 7 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/TransitionMode.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public enum TransitionMode 4 | { 5 | OutIn, 6 | 7 | /// 8 | /// TODO: not implemented 9 | /// 10 | InOut 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/TransitionState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum TransitionState 4 | { 5 | None = 0, 6 | Enter, 7 | EnterTo, 8 | EnterCancelled, 9 | Leave, 10 | LeaveTo, 11 | LeaveCancelled 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/CarouselReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class CarouselReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "carousel-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/CarouselTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class CarouselTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "carousel-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/DialogBottomTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class DialogBottomTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "dialog-bottom-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/DialogTopTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class DialogTopTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "dialog-top-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/DialogTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class DialogTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "dialog-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/ExpandXTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class ExpandXTransition : ExpandTransition 4 | { 5 | protected override string SizeProp => "width"; 6 | 7 | protected override void OnParametersSet() 8 | { 9 | Name = "expand-x-transition"; 10 | } 11 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/FabTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class FabTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "fab-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/FadeTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class FadeTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "fade-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/MenuTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class MenuTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "menu-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/ScaleTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ScaleTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "scale-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/ScrollXTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ScrollXTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "scroll-x-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/ScrollYReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ScrollYReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "scroll-y-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/ScrollYTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ScrollYTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "scroll-y-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/SlideXReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class SlideXReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "slide-x-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/SlideXTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class SlideXTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "slide-x-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/SlideYReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class SlideYReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "slide-y-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/SlideYTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class SlideYTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "slide-y-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/TabReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class TabReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "tab-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/TabTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class TabTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "tab-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Transition/Transitions/VScrollXReverseTransition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class VScrollXReverseTransition : Transition 4 | { 5 | protected override void OnParametersSet() 6 | { 7 | Name = "scroll-x-reverse-transition"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Treeview/SelectionType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | // TODO(v2): rename or add namespace to avoid conflict 4 | public enum SelectionType 5 | { 6 | Leaf, 7 | Independent, 8 | LeafButIndependentParent 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Treeview/TreeviewItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class TreeviewItem 4 | { 5 | public TreeviewItem(TItem item, bool leaf, bool selected, bool indeterminate, bool active, bool open) 6 | { 7 | Item = item; 8 | Leaf = leaf; 9 | Selected = selected; 10 | Indeterminate = indeterminate; 11 | Active = active; 12 | Open = open; 13 | } 14 | 15 | public TItem Item { get; } 16 | 17 | public bool Leaf { get; } 18 | 19 | public bool Selected { get; } 20 | 21 | public bool Indeterminate { get; } 22 | 23 | public bool Active { get; } 24 | 25 | public bool Open { get; } 26 | } 27 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Window/BWindowItemDefaultSlot.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TWindowItem 3 | @inherits ComponentPartBase 4 | 5 | @ChildContent 6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Window/BWindowItemDefaultSlot.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public partial class BWindowItemDefaultSlot : ComponentPartBase where TWindowItem : IWindowItem 4 | { 5 | public RenderFragment? ChildContent => Component.ChildContent; 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Components/Window/IWindowItem.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IWindowItem : IHasProviderComponent 4 | { 5 | RenderFragment? ChildContent { get; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/DeepClonerExtensions.cs: -------------------------------------------------------------------------------- 1 | using Force.DeepCloner; 2 | using Microsoft.AspNetCore.Components.Forms; 3 | 4 | namespace BlazorComponent; 5 | 6 | public static class DeepClonerExtensions 7 | { 8 | public static T TryDeepClone(this T obj) 9 | { 10 | try 11 | { 12 | if (obj is IBrowserFile or List) 13 | { 14 | return obj; 15 | } 16 | 17 | return obj.DeepClone(); 18 | } 19 | catch (InvalidCastException) 20 | { 21 | return obj; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/DependencyInjection/BlazorComponentBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Extensions.DependencyInjection; 2 | 3 | public class BlazorComponentBuilder : IBlazorComponentBuilder 4 | { 5 | public BlazorComponentBuilder(IServiceCollection services) 6 | { 7 | Services = services; 8 | } 9 | 10 | public IServiceCollection Services { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/DependencyInjection/IBlazorComponentBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Extensions.DependencyInjection; 2 | 3 | public interface IBlazorComponentBuilder 4 | { 5 | IServiceCollection Services { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/InvalidOperationExceptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace BlazorComponent; 4 | 5 | public static class InvalidOperationExceptionExtensions 6 | { 7 | public static void ThrowIfNull([NotNull]this object? parameter, string component, [CallerArgumentExpression("parameter")] string? parameterName = null) 8 | { 9 | _ = parameter ?? throw new InvalidOperationException($"The {component} component requires a non-null value for the '{parameterName}' parameter."); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/JSInterop/DocumentExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Web 2 | { 3 | public static class DocumentExtensions 4 | { 5 | public static HtmlElement? GetElementByReference(this Document document, ElementReference elementReference) 6 | { 7 | if (elementReference.Id == null) 8 | { 9 | return null; 10 | } 11 | 12 | return new HtmlElement(document.JS, $"[_bl_{elementReference.Id}]"); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public static class StringExtensions 4 | { 5 | public static string ReplaceFirst(this string str, string oldValue, string newValue) 6 | { 7 | if (string.IsNullOrEmpty(oldValue)) 8 | { 9 | return str; 10 | } 11 | 12 | var index = str.IndexOf(oldValue, StringComparison.Ordinal); 13 | if (index == -1) 14 | { 15 | return str; 16 | } 17 | 18 | str = str.Remove(index, oldValue.Length); 19 | return str.Insert(index, newValue); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/ClickOutsideArgs.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class ClickOutsideArgs 4 | { 5 | public string? PointerSelector { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/Converters/JsonCamelStringEnumConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace BlazorComponent.JSInterop; 5 | 6 | public class JsonCamelStringEnumConverter : JsonStringEnumConverter 7 | { 8 | public JsonCamelStringEnumConverter() : base(new ToLowerNamingPolicy()) 9 | { 10 | } 11 | 12 | private class ToLowerNamingPolicy : JsonNamingPolicy 13 | { 14 | public override string ConvertName(string name) => name[..1].ToLower() + name[1..]; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/DocumentElement.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.JSInterop 2 | { 3 | public class DocumentElement 4 | { 5 | public double ScrollTop { get; set; } 6 | public double ScrollLeft { get; set; } 7 | public double ClientHeight { get; set; } 8 | public double ClientWidth { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/DomEventSub.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class DomEventSub 4 | { 5 | public Delegate Delegate { get; set; } 6 | public Type Type { get; set; } 7 | 8 | public DomEventSub(Delegate @delegate, Type type) 9 | { 10 | Delegate = @delegate; 11 | Type = type; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/Event.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Web 2 | { 3 | public class Event 4 | { 5 | public Event(string type, string name) 6 | { 7 | Type = type; 8 | Name = name; 9 | } 10 | 11 | public string Type { get; } 12 | 13 | public string Name { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/EventTarget.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace Microsoft.AspNetCore.Components.Web; 4 | 5 | public class EventTarget 6 | { 7 | public string? Selector { get; set; } 8 | 9 | public string? ElementReferenceId { get; set; } 10 | 11 | public string? Class { get; set; } 12 | 13 | [JsonIgnore] 14 | public ElementReference ElementReference => ElementReferenceId is not null 15 | ? new ElementReference(ElementReferenceId[4..]) 16 | : default; 17 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/JSExceptionExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.JSInterop; 2 | 3 | public static class JSExceptionExtensions 4 | { 5 | // TODO: after https://github.com/dotnet/aspnetcore/issues/52070 is fixed, remove this 6 | /// 7 | /// Check if the exception is thrown by trying to create a JSObjectReference from null or undefined 8 | /// 9 | /// 10 | /// 11 | public static bool ForCannotCreateFromNullOrUndefined(this JSException e) 12 | { 13 | return e.Message.StartsWith("Cannot create a JSObjectReference from the"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/JSObject.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Web 2 | { 3 | public abstract class JSObject 4 | { 5 | public JSObject() 6 | { 7 | } 8 | 9 | public JSObject(IJSRuntime js) 10 | { 11 | JS = js; 12 | } 13 | 14 | public IJSRuntime JS { get; } 15 | 16 | public string? Selector { get; protected set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/Models/ScrollBehavior.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.JSInterop; 2 | 3 | public enum ScrollBehavior 4 | { 5 | Auto, 6 | Smooth 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/Models/ScrollLogicalPosition.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.JSInterop; 2 | 3 | public enum ScrollLogicalPosition 4 | { 5 | Center, 6 | End, 7 | Nearest, 8 | Start 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/MouseEvent.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Web 2 | { 3 | public class MouseEvent : Event 4 | { 5 | public MouseEvent(string name) 6 | : base("MouseEvents", name) 7 | { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSInterop/WindowAndDocument.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class WindowAndDocument 4 | { 5 | public double InnerHeight { get; set; } 6 | public double InnerWidth { get; set; } 7 | public double PageXOffset { get; set; } 8 | public double PageYOffset { get; set; } 9 | 10 | public double ClientHeight { get; set; } 11 | public double ClientWidth { get; set; } 12 | public double ScrollLeft { get; set; } 13 | public double ScrollTop { get; set; } 14 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/JSModules/ResizeObserver/IResizeJSModule.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IResizeJSModule 4 | { 5 | ValueTask ObserverAsync(ElementReference el, Func handle); 6 | 7 | ValueTask UnobserveAsync(ElementReference el); 8 | 9 | ValueTask ObserverAsync(string selector, Func handle); 10 | 11 | ValueTask UnobserveAsync(string selector); 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Activatable/IActivatable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IActivatable 4 | { 5 | Dictionary ActivatorAttributes { get; } 6 | 7 | bool IsActive { get; } 8 | 9 | RenderFragment? ComputedActivatorContent { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Activatable/IActivatableJsCallbacks.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IActivatableJsCallbacks : IDelayable, IOutsideClickJsCallback 4 | { 5 | string ActivatorSelector { get; } 6 | 7 | bool Disabled { get; } 8 | 9 | bool OpenOnHover { get; } 10 | 11 | bool OpenOnClick { get; } 12 | 13 | bool OpenOnFocus { get; } 14 | 15 | Task SetActive(bool val); 16 | 17 | Task HandleOnClickAsync(MouseEventArgs args); 18 | } 19 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Bootable/BBootable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class BBootable : BActivatable 4 | { 5 | protected override async Task ShowLazyContent() 6 | { 7 | if (!IsBooted) 8 | { 9 | //Set IsBooted to true and show content 10 | IsBooted = true; 11 | await Task.Delay(16); 12 | StateHasChanged(); 13 | 14 | return true; 15 | } 16 | 17 | return false; 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Delayable/IDelayable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IDelayable 4 | { 5 | int OpenDelay { get; } 6 | 7 | int CloseDelay { get; } 8 | } 9 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Dependent/IDependent.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent.Mixins; 2 | 3 | public interface IDependent 4 | { 5 | void RegisterChild(IDependent dependent); 6 | 7 | IDependent? CascadingDependent { get; } 8 | 9 | public List CascadingDependents => CascadingDependent is not null 10 | ? CascadingDependent.CascadingDependents.Concat(new[] { CascadingDependent }).ToList() 11 | : new List(); 12 | 13 | IEnumerable DependentSelectors { get; } 14 | } 15 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Groupable/GroupType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public enum GroupType 4 | { 5 | ItemGroup = 1, 6 | 7 | ButtonGroup, 8 | 9 | ChipGroup, 10 | 11 | ExpansionPanels, 12 | 13 | ListItemGroup, 14 | 15 | SlideGroup, 16 | 17 | Window 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Groupable/IGroupable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IGroupable 4 | { 5 | string? ActiveClass { get; set; } 6 | 7 | bool Disabled { get; set; } 8 | 9 | StringNumber? Value { get; set; } 10 | 11 | ElementReference Ref { get; set; } 12 | 13 | string? Class { get; set; } 14 | 15 | string? Style { get; set; } 16 | 17 | Task RefreshState(); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/IColorable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IColorable 4 | { 5 | string? Color { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Loadable/BLoadableProgress.razor: -------------------------------------------------------------------------------- 1 | @namespace BlazorComponent 2 | @typeparam TComponent 3 | @inherits ComponentPartBase 4 | 5 | @if (Loading is not null && Loading != false) 6 | { 7 | if (ProgressContent != null) 8 | { 9 | @ProgressContent 10 | } 11 | else 12 | { 13 | 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Loadable/BLoadableProgress.razor.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public partial class BLoadableProgress where TComponent : ILoadable 4 | { 5 | public StringBoolean? Loading => Component.Loading; 6 | 7 | public RenderFragment? ProgressContent => Component.ProgressContent; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Loadable/ILoadable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ILoadable : IHasProviderComponent 4 | { 5 | public StringBoolean? Loading { get; } 6 | 7 | public RenderFragment? ProgressContent { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Menuable/IMenuable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IMenuable 4 | { 5 | bool IsBooted { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Menuable/MenuableDimensions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class MenuableDimensions 4 | { 5 | public MenuablePosition Activator { get; set; } = new(); 6 | public MenuablePosition Content { get; set; } = new(); 7 | public double RelativeYOffset { get; set; } 8 | public double OffsetParentLeft { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Menuable/MultipleResult.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class MultipleResult 4 | { 5 | public WindowAndDocument WindowAndDocument { get; set; } = new(); 6 | 7 | public MenuableDimensions Dimensions { get; set; } = new(); 8 | 9 | public int ZIndex { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/OutsideClick/IOutsideClickJsCallback.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IOutsideClickJsCallback 4 | { 5 | Task HandleOnOutsideClickAsync(); 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Routable/IAncestorRoutable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IAncestorRoutable 4 | { 5 | bool Routable { get; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/ScrollStrategy/ScrollStrategyOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace BlazorComponent.JSInterop.ScrollStrategy; 4 | 5 | public class ScrollStrategyOptions 6 | { 7 | public ScrollStrategyOptions(ScrollStrategy strategy, bool contained) 8 | { 9 | Strategy = strategy; 10 | Contained = contained; 11 | } 12 | 13 | [JsonConverter(typeof(JsonCamelStringEnumConverter))] 14 | public ScrollStrategy Strategy { get; set; } 15 | 16 | public bool Contained { get; set; } 17 | } 18 | 19 | public enum ScrollStrategy 20 | { 21 | Block 22 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Scrollable/IScrollable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IScrollable 4 | { 5 | bool CanScroll { get; } 6 | 7 | string? ScrollTarget { get; } 8 | 9 | double ScrollThreshold { get; } 10 | 11 | IJSRuntime Js { get; } 12 | } -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Mixins/Selectable/ISelectable.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface ISelectable : IInput, IRippleable 4 | { 5 | bool IsDisabled { get; } 6 | 7 | Dictionary InputAttrs { get; } 8 | 9 | bool IsActive { get; } 10 | 11 | Task HandleOnBlur(FocusEventArgs args); 12 | 13 | Task HandleOnChange(); 14 | 15 | Task HandleOnFocus(FocusEventArgs args); 16 | 17 | Task HandleOnKeyDown(KeyboardEventArgs args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Popup/IPopupProvider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public interface IPopupProvider 4 | { 5 | event EventHandler StateChanged; 6 | 7 | ProviderItem Add(Type componentType, IDictionary? attributes, object service, string serviceName); 8 | 9 | void Remove(ProviderItem item); 10 | 11 | IEnumerable GetItems(); 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/BlazorComponentOptions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class BlazorComponentOptions 4 | { 5 | public Locale? Locale { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/Borders.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | // TODO: rename to Border 4 | public enum Borders 5 | { 6 | None = 0, 7 | Left, 8 | Right, 9 | Top, 10 | Bottom 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/ForwardRef.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class ForwardRef 4 | { 5 | public ElementReference Current { get; private set; } 6 | 7 | public void Set(ElementReference value) 8 | { 9 | Current = value; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/Generator/ComponentId/GuidComponentIdGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class GuidComponentIdGenerator : IComponentIdGenerator 4 | { 5 | public string? Prefix { get; set; } 6 | 7 | public string Generate(BDomComponentBase component) => $"{Prefix ?? "B-" }{Guid.NewGuid()}"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/Generator/ComponentId/Interface/IComponentIdGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public interface IComponentIdGenerator 4 | { 5 | string Generate(BDomComponentBase component); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/ListComparer.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent 2 | { 3 | public class ListComparer 4 | { 5 | public static bool Equals(IList? left, IList? right) 6 | { 7 | if (ReferenceEquals(left, right)) 8 | { 9 | return true; 10 | } 11 | 12 | if (left == null || right == null) 13 | { 14 | return false; 15 | } 16 | 17 | return left.All(right.Contains) && left.Count == right.Count; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Services/Locale.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorComponent; 2 | 3 | public class Locale 4 | { 5 | public string? Current { get; } 6 | 7 | public string? Fallback { get; } 8 | 9 | public string? UICurrent { get; set; } 10 | 11 | public string? UIFallback { get; set; } 12 | 13 | public Locale(string current, string fallback) 14 | { 15 | Current = current; 16 | Fallback = fallback; 17 | } 18 | 19 | public Locale(string current, string uiCurrent, string fallback, string uiFallback) : this(current, fallback: fallback) 20 | { 21 | UICurrent = uiCurrent; 22 | UIFallback = uiFallback; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Web/ExMouseEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.AspNetCore.Components.Web 2 | { 3 | /// 4 | /// The extra . 5 | /// 6 | public class ExMouseEventArgs : MouseEventArgs 7 | { 8 | public EventTarget? Target { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Web/ExTouchEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.AspNetCore.Components.Web 2 | { 3 | public class ExTouchEventArgs : TouchEventArgs 4 | { 5 | public EventTarget? Target { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Web/PasteWithDataEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.AspNetCore.Components.Web 2 | { 3 | public class PasteWithDataEventArgs : ClipboardEventArgs 4 | { 5 | public string? PastedData { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/Web/TransitionEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.AspNetCore.Components.Web; 2 | 3 | public class TransitionEventArgs : EventArgs 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/_Imports.cs: -------------------------------------------------------------------------------- 1 | global using Microsoft.AspNetCore.Components; 2 | global using System.Diagnostics.CodeAnalysis; 3 | global using BlazorComponent.Attributes; 4 | global using BlazorComponent.Web; 5 | global using BlazorComponent.Components.Input; 6 | global using Microsoft.AspNetCore.Components.Web; 7 | global using Microsoft.Extensions.Logging; 8 | global using OneOf; 9 | global using Microsoft.JSInterop; 10 | global using BemIt; 11 | global using BlazorComponent.Components.Transition; 12 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components 2 | @using Microsoft.AspNetCore.Components.Web 3 | -------------------------------------------------------------------------------- /src/Component/BlazorComponent/wwwroot/js/intersect.js: -------------------------------------------------------------------------------- 1 | class e{constructor(e,s,t){this.el=e,this.dotnetHelper=s,this.observer=new IntersectionObserver(((e=[],t)=>{e.some((e=>e.isIntersecting))&&s.invokeMethodAsync("invoke")}),null!=t?t:{}),this.observer.observe(e)}dispose(){this.dotnetHelper.dispose&&(this.observer.unobserve(this.el),this.dotnetHelper.dispose())}}function s(s,t,o){return new e(s,t,o)}export{s as init}; 2 | //# sourceMappingURL=intersect.js.map 3 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.ServerHost/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.ServerHost/BlazorComponent.Test.ServerHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.ServerHost/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop 7 | @using BlazorComponent.Doc 8 | @using BlazorComponent.Doc.Pages 9 | @using BlazorComponent.Doc.Shared 10 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.ServerHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.ServerHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "BlazorComponent.Test.Wasm": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 7 | "applicationUrl": "http://localhost:5000", 8 | "environmentVariables": { 9 | "ASPNETCORE_ENVIRONMENT": "Development" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @using Microsoft.AspNetCore.Components.Routing 4 | @using Microsoft.AspNetCore.Components.Web 5 | @using Microsoft.JSInterop 6 | @using BlazorComponent.Test.Wasm 7 | @using BlazorComponent.Doc.Shared 8 | @using AntDesign -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/gh-pages/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/src/Test/BlazorComponent.Test.Wasm/gh-pages/.nojekyll -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/gh-pages/.spa: -------------------------------------------------------------------------------- 1 | This file is used to enable gitee pages' spa mode. 2 | https://gitee.com/help/articles/4237 -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/wwwroot/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/src/Test/BlazorComponent.Test.Wasm/wwwroot/logo.png -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/wwwroot/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ant Design of Blazor", 3 | "short_name": "AntDesign", 4 | "start_url": "/", 5 | "display": "standalone", 6 | "background_color": "#ffffff", 7 | "theme_color": "#03173d", 8 | "icons": [ 9 | { 10 | "src": "logo.png", 11 | "type": "image/png", 12 | "sizes": "512x512" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test.Wasm/wwwroot/service-worker.js: -------------------------------------------------------------------------------- 1 | // In development, always fetch from the network and do not enable offline support. 2 | // This is because caching would make development more difficult (changes would not 3 | // be reflected on the first load after each change). 4 | self.addEventListener('fetch', () => { }); 5 | -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test/HelloComponent.razor: -------------------------------------------------------------------------------- 1 | 
@Message
2 | 3 | @code { 4 | [Parameter] 5 | public string Message { get; set; } 6 | } -------------------------------------------------------------------------------- /src/Test/BlazorComponent.Test/TestBase.cs: -------------------------------------------------------------------------------- 1 | using Bunit; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace BlazorComponent.Test 11 | { 12 | public abstract class TestBase : TestContextWrapper 13 | { 14 | [TestInitialize] 15 | public void Setup() 16 | { 17 | TestContext = new Bunit.TestContext(); 18 | TestContext.Services.AddBlazorComponent(); 19 | } 20 | 21 | [TestCleanup] 22 | public void TearDown() => TestContext?.Dispose(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Test/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masastack/BlazorComponent/7bd0b02630773d526e345fdba4f6a1d80e083504/src/Test/cover.png --------------------------------------------------------------------------------