@itwin/components-react 4.0.0-dev.19 → 4.0.0-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/_target.scss +9 -9
- package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
- package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
- package/lib/cjs/components-react/common/HighlightingComponentProps.js.map +1 -1
- package/lib/cjs/components-react/common/IImageLoader.js.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/cjs/components-react/common/Links.js.map +1 -1
- package/lib/cjs/components-react/common/PageOptions.js.map +1 -1
- package/lib/cjs/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/cjs/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseRerender.js.map +1 -1
- package/lib/cjs/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionModes.js.map +1 -1
- package/lib/cjs/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/StringTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/cjs/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.scss +22 -22
- package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.scss +176 -176
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.scss +57 -57
- package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.scss +76 -76
- package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.scss +22 -22
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.scss +20 -20
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.scss +9 -9
- package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.scss +6 -6
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.scss +141 -141
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.scss +22 -22
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.scss +16 -16
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.scss +24 -24
- package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.scss +16 -16
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.scss +116 -116
- package/lib/cjs/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.scss +13 -13
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.scss +20 -20
- package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.scss +14 -14
- package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.scss +23 -23
- package/lib/cjs/components-react/editors/variables.scss +7 -7
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +38 -38
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +68 -68
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Types.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.scss +58 -58
- package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.scss +68 -68
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.scss +75 -75
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.scss +23 -23
- package/lib/cjs/components-react/properties/ItemStyle.js.map +1 -1
- package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.scss +25 -25
- package/lib/cjs/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +17 -17
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.scss +106 -106
- package/lib/cjs/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +88 -88
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +73 -73
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +101 -101
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.scss +20 -20
- package/lib/cjs/components-react/toolbar/Item.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Item.scss +91 -91
- package/lib/cjs/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ItemWrapper.scss +10 -10
- package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Items.scss +96 -96
- package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.scss +57 -57
- package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/OverflowPanel.scss +37 -37
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.scss +88 -88
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.scss +18 -18
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/_variables.scss +34 -34
- package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
- package/lib/cjs/components-react/toolbar/groupPanel/Column.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Column.scss +9 -9
- package/lib/cjs/components-react/toolbar/groupPanel/Columns.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Columns.scss +10 -10
- package/lib/cjs/components-react/toolbar/groupPanel/Panel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Panel.scss +15 -15
- package/lib/cjs/components-react/toolbar/groupPanel/Title.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Title.scss +33 -33
- package/lib/cjs/components-react/toolbar/groupPanel/_variables.scss +16 -16
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.scss +117 -117
- package/lib/cjs/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
- package/lib/cjs/components-react/toolbar/useDragInteraction.js.map +1 -1
- package/lib/cjs/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.scss +7 -7
- package/lib/cjs/components-react/tree/ImageLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeComponentTestId.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/Observable.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.scss +102 -102
- package/lib/cjs/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/NodeContent.scss +27 -27
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/_target.scss +9 -9
- package/lib/esm/components-react/common/DateUtils.js.map +1 -1
- package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
- package/lib/esm/components-react/common/HighlightingComponentProps.js.map +1 -1
- package/lib/esm/components-react/common/IImageLoader.js.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/esm/components-react/common/Links.js.map +1 -1
- package/lib/esm/components-react/common/PageOptions.js.map +1 -1
- package/lib/esm/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/esm/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseRerender.js.map +1 -1
- package/lib/esm/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/esm/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/components-react/common/selection/SelectionModes.js.map +1 -1
- package/lib/esm/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/StringTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/esm/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.scss +22 -22
- package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.scss +176 -176
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.scss +57 -57
- package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.scss +76 -76
- package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.scss +22 -22
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.scss +20 -20
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.scss +9 -9
- package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.scss +6 -6
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.scss +141 -141
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.scss +22 -22
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.scss +16 -16
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.scss +24 -24
- package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.scss +16 -16
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.scss +116 -116
- package/lib/esm/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.scss +13 -13
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.scss +20 -20
- package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.scss +14 -14
- package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.scss +23 -23
- package/lib/esm/components-react/editors/variables.scss +7 -7
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +38 -38
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +68 -68
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Types.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.scss +58 -58
- package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.scss +68 -68
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.scss +75 -75
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.scss +23 -23
- package/lib/esm/components-react/properties/ItemStyle.js.map +1 -1
- package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.scss +25 -25
- package/lib/esm/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +17 -17
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.scss +106 -106
- package/lib/esm/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +88 -88
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +73 -73
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +101 -101
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.scss +20 -20
- package/lib/esm/components-react/toolbar/Item.js.map +1 -1
- package/lib/esm/components-react/toolbar/Item.scss +91 -91
- package/lib/esm/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/esm/components-react/toolbar/ItemWrapper.scss +10 -10
- package/lib/esm/components-react/toolbar/Items.js.map +1 -1
- package/lib/esm/components-react/toolbar/Items.scss +96 -96
- package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.scss +57 -57
- package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/OverflowPanel.scss +37 -37
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.scss +88 -88
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.scss +18 -18
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/_variables.scss +34 -34
- package/lib/esm/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
- package/lib/esm/components-react/toolbar/groupPanel/Column.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Column.scss +9 -9
- package/lib/esm/components-react/toolbar/groupPanel/Columns.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Columns.scss +10 -10
- package/lib/esm/components-react/toolbar/groupPanel/Panel.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Panel.scss +15 -15
- package/lib/esm/components-react/toolbar/groupPanel/Title.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Title.scss +33 -33
- package/lib/esm/components-react/toolbar/groupPanel/_variables.scss +16 -16
- package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.scss +117 -117
- package/lib/esm/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
- package/lib/esm/components-react/toolbar/useDragInteraction.js.map +1 -1
- package/lib/esm/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/esm/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/esm/components-react/tree/HighlightingEngine.scss +7 -7
- package/lib/esm/components-react/tree/ImageLoader.js.map +1 -1
- package/lib/esm/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/TreeComponentTestId.js.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/Observable.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.scss +102 -102
- package/lib/esm/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/NodeContent.scss +27 -27
- package/lib/esm/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react.js.map +1 -1
- package/lib/public/locales/en/UiComponents.json +139 -139
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qCAAqC;AAErC,OAAO,EAAkF,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA6C5I;;;GAGG;AACH,MAAM,OAAgB,aAAa;IACjC,6CAA6C;IACtC,eAAe,CAAC,KAAwB;QAC7C,IAAI,KAAK,KAAK,SAAS;YACrB,OAAO,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAED,wEAAwE;IACjE,0BAA0B,CAAC,KAAwB,EAAE,QAAiC;QAC3F,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,6CAA6C;IACtC,iBAAiB,CAAC,MAAc;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0EAA0E;IACnE,4BAA4B,CAAC,KAAa,EAAE,QAAiC;QAClF,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IACnE,uBAAuB,CAAC,mBAAwC,EAAE,KAAwB;QAC/F,OAAO,IAAI,CAAC,0BA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cAAc,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;CACtD","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"TypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qCAAqC;AAErC,OAAO,EAAkF,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA6C5I;;;GAGG;AACH,MAAM,OAAgB,aAAa;IACjC,6CAA6C;IACtC,eAAe,CAAC,KAAwB;QAC7C,IAAI,KAAK,KAAK,SAAS;YACrB,OAAO,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAED,wEAAwE;IACjE,0BAA0B,CAAC,KAAwB,EAAE,QAAiC;QAC3F,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,6CAA6C;IACtC,iBAAiB,CAAC,MAAc;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0EAA0E;IACnE,4BAA4B,CAAC,KAAa,EAAE,QAAiC;QAClF,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IACnE,uBAAuB,CAAC,mBAAwC,EAAE,KAAwB;QAC/F,OAAO,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED,mEAAmE;IAC5D,KAAK,CAAC,gCAAgC,CAAC,KAAa,EAAE,cAA+B;QAC1F,MAAM,gBAAgB,GAAG,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QACvI,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACrF,MAAM,aAAa,GAAmB;YACpC,WAAW,EAAE,mBAAmB,CAAC,SAAS;YAC1C,KAAK,EAAE,WAAW;YAClB,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;IAKD,mDAAmD;IAC5C,SAAS,CAAC,MAAwB,EAAE,MAAwB;QACjE,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,uDAAuD;IAChD,YAAY,CAAC,MAAwB,EAAE,MAAwB;QACpE,OAAO,MAAM,KAAK,MAAM,CAAC;IAC3B,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAuB;QACnC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,mEAAmE;IAC5D,SAAS,CAAC,KAAuB;QACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;IAC/C,CAAC;IAED,uDAAuD;IACvD,IAAW,YAAY,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACpD,wDAAwD;IACxD,IAAW,iBAAiB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACzD,wDAAwD;IACxD,IAAW,aAAa,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACrD,yDAAyD;IACzD,IAAW,cAAc,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;CACtD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\n// cSpell:ignore valuetypes shortdate\n\nimport { Primitives, PrimitiveValue, PropertyDescription, PropertyRecord, PropertyValue, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\n\n/** Sort compare method for types that support sorting\n * @public\n */\nexport interface SortComparer {\n /** Sort function for two primitive values */\n sortCompare(valueA: Primitives.Value, valueB: Primitives.Value, ignoreCase?: boolean): number;\n}\n\n/** Operators for all filterable types\n * @public\n */\nexport interface OperatorProcessor {\n /** Determines if two primitive values are equal */\n isEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if two primitive values are not equal */\n isNotEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for Numeric types, DateTime, TimeSpan, or any type that supports these comparisons\n * @public\n */\nexport interface LessGreaterOperatorProcessor {\n /** Determines if a primitive values is less than another primitive value */\n isLessThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is less than or equal to another primitive value */\n isLessThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than another primitive value */\n isGreaterThan(a: Primitives.Value, b: Primitives.Value): boolean;\n /** Determines if a primitive values is greater than or equal to another primitive value */\n isGreaterThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean;\n}\n\n/** Operators for all filterable null-able types\n * @public\n */\nexport interface NullableOperatorProcessor {\n /** Determines if a primitive value is null or undefined */\n isNull(value: Primitives.Value): boolean;\n /** Determines if a primitive value is not null or not undefined */\n isNotNull(value: Primitives.Value): boolean;\n}\n\n/**\n * Type Converter base class.\n * @public\n */\nexport abstract class TypeConverter implements SortComparer, OperatorProcessor, NullableOperatorProcessor {\n /** Converts a primitive value to a string */\n public convertToString(value?: Primitives.Value): string | Promise<string> {\n if (value === undefined)\n return \"\";\n return value.toString();\n }\n\n /** Default implementation just calls convertToString with no options */\n public convertToStringWithOptions(value?: Primitives.Value, _options?: { [key: string]: any }): string | Promise<string> {\n return this.convertToString(value);\n }\n\n /** Converts a string to a primitive value */\n public convertFromString(_value: string): ConvertedPrimitives.Value | undefined | Promise<ConvertedPrimitives.Value | undefined> {\n return undefined;\n }\n\n /** Default implementation just calls convertFromString with no options */\n public convertFromStringWithOptions(value: string, _options?: { [key: string]: any }): ConvertedPrimitives.Value | undefined | Promise<ConvertedPrimitives.Value | undefined> {\n return this.convertFromString(value);\n }\n\n /** Converts a value associated with a property description to a string */\n public convertPropertyToString(propertyDescription: PropertyDescription, value?: Primitives.Value): string | Promise<string> {\n return this.convertToStringWithOptions(value, propertyDescription.converter?.options);\n }\n\n /** Converts a string with a property record to a property value */\n public async convertFromStringToPropertyValue(value: string, propertyRecord?: PropertyRecord): Promise<PropertyValue> {\n const converterOptions = (propertyRecord && propertyRecord.property.converter) ? propertyRecord.property.converter.options : undefined;\n const stringValue = await this.convertFromStringWithOptions(value, converterOptions);\n const propertyValue: PrimitiveValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: stringValue,\n displayValue: \"\",\n };\n return propertyValue;\n }\n\n /** Sort function for two primitive values */\n public abstract sortCompare(valueA: Primitives.Value, valueB: Primitives.Value, _ignoreCase?: boolean): number;\n\n /** Determines if two primitive values are equal */\n public isEqualTo(valueA: Primitives.Value, valueB: Primitives.Value): boolean {\n return valueA === valueB;\n }\n\n /** Determines if two primitive values are not equal */\n public isNotEqualTo(valueA: Primitives.Value, valueB: Primitives.Value): boolean {\n return valueA !== valueB;\n }\n\n /** Determines if a primitive value is null or undefined */\n public isNull(value: Primitives.Value): boolean {\n return value === null || value === undefined;\n }\n\n /** Determines if a primitive value is not null or not undefined */\n public isNotNull(value: Primitives.Value): boolean {\n return value !== null && value !== undefined;\n }\n\n /** Determines if the converter is for a string type */\n public get isStringType(): boolean { return false; }\n /** Determines if the converter is for a numeric type */\n public get isLessGreaterType(): boolean { return false; }\n /** Determines if the converter is for a boolean type */\n public get isBooleanType(): boolean { return false; }\n /** Determines if the converter is for a nullable type */\n public get isNullableType(): boolean { return true; }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeConverterManager.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverterManager.ts"],"names":[],"mappings":"AAAA;;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AAI,oBAAoB,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC;YACpE,OAAO,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAE7D,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,EAAE;YAC/C,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC,CAAC,yDAAyD;YACvI,oBAAoB,CAAC,qBAAqB,GAAG,IAAI,mBAAmB,EAAE,CAAC;SACxE;QACD,OAAO,oBAAoB,CAAC,qBAAqB,CAAC;IACpD,CAAC;;AA1Cc,gCAAW,GAAyC,EAAE,CAAC;SAD3D,oBAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"TypeConverterManager.js","sourceRoot":"","sources":["../../../../src/components-react/converters/TypeConverterManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;GAGG;AACH,MAAa,oBAAoB;IAIvB,MAAM,CAAC,oBAAoB,CAAC,QAAgB,EAAE,aAAsB;QAC1E,IAAI,iBAAiB,GAAG,QAAQ,CAAC;QACjC,IAAI,aAAa;YACf,iBAAiB,IAAI,IAAI,aAAa,EAAE,CAAC;QAC3C,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,QAAgB,EAAE,SAAkC,EAAE,aAAsB;QAC1G,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAE7F,IAAI,oBAAoB,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE;YACtE,MAAM,eAAe,GAAG,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;YAC7F,MAAM,KAAK,CAAC,uDAAuD,QAAQ,4BAA4B,eAAe,GAAG,CAAC,CAAC;SAC5H;QAED,MAAM,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;QACjC,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,mBAAmB,CAAC,QAAgB,EAAE,aAAsB;QACxE,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAE7F,uBAAuB;QACvB,IAAI,oBAAoB,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE;YACtE,OAAO,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;SAC5D;IACH,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,QAAgB,EAAE,aAAsB;QACjE,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAE7F,IAAI,oBAAoB,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC;YACpE,OAAO,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAE7D,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,EAAE;YAC/C,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC,CAAC,yDAAyD;YACvI,oBAAoB,CAAC,qBAAqB,GAAG,IAAI,mBAAmB,EAAE,CAAC;SACxE;QACD,OAAO,oBAAoB,CAAC,qBAAqB,CAAC;IACpD,CAAC;;AA1Cc,gCAAW,GAAyC,EAAE,CAAC;SAD3D,oBAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\nimport { TypeConverter } from \"./TypeConverter\";\n\n/**\n * Manages Type Converters. Type Converters are registered with and obtained from the manager.\n * @public\n */\nexport class TypeConverterManager {\n private static _converters: { [index: string]: (TypeConverter) } = {};\n private static _defaultTypeConverter: TypeConverter;\n\n private static getFullConverterName(typename: string, converterName?: string): string {\n let fullConverterName = typename;\n if (converterName)\n fullConverterName += `:${converterName}`;\n return fullConverterName;\n }\n\n public static registerConverter(typename: string, converter: new () => TypeConverter, converterName?: string): void {\n const fullConverterName = TypeConverterManager.getFullConverterName(typename, converterName);\n\n if (TypeConverterManager._converters.hasOwnProperty(fullConverterName)) {\n const nameOfConverter = TypeConverterManager._converters[fullConverterName].constructor.name;\n throw Error(`TypeConverterManager.registerConverter error: type '${typename}' already registered to '${nameOfConverter}'`);\n }\n\n const instance = new converter();\n TypeConverterManager._converters[fullConverterName] = instance;\n }\n\n public static unregisterConverter(typename: string, converterName?: string): void {\n const fullConverterName = TypeConverterManager.getFullConverterName(typename, converterName);\n\n // istanbul ignore else\n if (TypeConverterManager._converters.hasOwnProperty(fullConverterName)) {\n delete TypeConverterManager._converters[fullConverterName];\n }\n }\n\n public static getConverter(typename: string, converterName?: string): TypeConverter {\n const fullConverterName = TypeConverterManager.getFullConverterName(typename, converterName);\n\n if (TypeConverterManager._converters.hasOwnProperty(fullConverterName))\n return TypeConverterManager._converters[fullConverterName];\n\n if (!TypeConverterManager._defaultTypeConverter) {\n const { StringTypeConverter } = require(\"../converters/StringTypeConverter\"); // eslint-disable-line @typescript-eslint/no-var-requires\n TypeConverterManager._defaultTypeConverter = new StringTypeConverter();\n }\n return TypeConverterManager._defaultTypeConverter;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConvertedTypes.js","sourceRoot":"","sources":["../../../../../src/components-react/converters/valuetypes/ConvertedTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ConvertedTypes.js","sourceRoot":"","sources":["../../../../../src/components-react/converters/valuetypes/ConvertedTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module TypeConverters\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\n\n/** Converted Primitives namespace\n * @public\n */\nexport namespace ConvertedPrimitives {\n\n /** Interface for 2d Point\n * @public\n */\n export interface Point2d {\n x: number;\n y: number;\n }\n\n /** Interface for 3d Point\n * @public\n */\n export interface Point3d extends Point2d {\n z: number;\n }\n\n /** Type definition for 2d or 3d Point\n * @public\n */\n export type Point = Point2d | Point3d;\n\n /** Type definition for Value\n * @public\n */\n export type Value = boolean | number | string | Date | Point | Id64String;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DateField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAiB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAmB7C;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAe,EAAE,WAAyB,EAAE,eAA+B,EAAE,mBAA0C;IACrJ,IAAI,eAAe,EAAE;QACnB,OAAO,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/C;IAED,IAAI,mBAAmB,EAAE;QACvB,QAAQ,mBAAmB,EAAE;YAC3B,KAAK,oBAAoB,CAAC,WAAW;gBACnC,OAAO,SAAS,CAAC,WAAW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AY,CAAC,CAAC;gBACvC,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtC,cAAc,CAAC,KAAK,CAAC,CAAC;aACvB;iBAAM;gBACL,cAAc,CAAC,IAAI,CAAC,CAAC;aACtB;SACF;QAAC,OAAO,MAAM,EAAE;YACf,uBAAuB;YACvB,cAAc,CAAC,IAAI,CAAC,CAAC;SACtB;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAyC,EAAE,EAAE;QACnF,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,SAAS,cAAc,CAAC,KAA4C;QAClE,uBAAuB;QACvB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACzB,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC3C,KAAK,CAAC,cAAc,EAAE,CAAC;SACxB;IACH,CAAC;IACD,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE,uBAAuB,EAAE,WAAW,IAAI,2BAA2B,CAAC,CAAC;IAC9G,OAAO,oBAAC,KAAK,mBAAa,uBAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EACpI,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC;AACzI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport \"./DateField.scss\";\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { AlternateDateFormats, DateFormatter, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\n\r\n/** Props for [[DateField]] Component.\r\n * @internal\r\n */\r\nexport interface DateFieldProps extends CommonProps {\r\n /** Defines initial date and time for component. */\r\n initialDate: Date;\r\n /** Function to call when the date or time is changed. */\r\n onDateChange?: (day: Date) => void;\r\n /** Optional value to define if edit field allows editing. If a DateFormatter is provided\r\n * it must provide a parseData function or the field will be read only no matter the setting of this value. */\r\n readOnly?: boolean;\r\n /** Optional date formatter that produces an explicit date display */\r\n dateFormatter?: DateFormatter;\r\n /** This property has two purposes, the first is specify that the display of time is desired and the second is to define the format of the time display. */\r\n timeDisplay?: TimeDisplay;\r\n}\r\n\r\n/** Function to format a Date object that is used in control, type editor, and type converter\r\n * to produce a consistent formatted Date string.\r\n * @internal\r\n */\r\nexport function formatInputDate(inputDate: Date, timeDisplay?: TimeDisplay, customFormatter?: DateFormatter, alternateDateFormat?: AlternateDateFormats): string | undefined {\r\n if (customFormatter) {\r\n return customFormatter.formateDate(inputDate);\r\n }\r\n\r\n if (alternateDateFormat) {\r\n switch (alternateDateFormat) {\r\n case AlternateDateFormats.IsoDateTime:\r\n return inputDate.toISOString();\r\n case AlternateDateFormats.IsoShort:\r\n return inputDate.toISOString().slice(0, 10);\r\n case AlternateDateFormats.UtcDateTime:\r\n return inputDate.toUTCString().slice(5);\r\n case AlternateDateFormats.UtcShort:\r\n return inputDate.toUTCString().slice(5, 16);\r\n case AlternateDateFormats.UtcDateTimeWithDay:\r\n return inputDate.toUTCString();\r\n case AlternateDateFormats.UtcShortWithDay:\r\n return inputDate.toUTCString().slice(0, 16);\r\n }\r\n } else {\r\n const dateString = inputDate.toLocaleDateString(undefined, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\r\n let timeString: string = \"\";\r\n\r\n if (timeDisplay) {\r\n switch (timeDisplay) {\r\n case TimeDisplay.H12MC:\r\n timeString = inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\" });\r\n break;\r\n case TimeDisplay.H12MSC:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n break;\r\n case TimeDisplay.H24M:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00\")\r\n timeString = \"00:00\";\r\n break;\r\n case TimeDisplay.H24MS:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00:00\")\r\n timeString = \"00:00:00\";\r\n break;\r\n }\r\n }\r\n return timeString.length ? `${dateString}, ${timeString}` : dateString;\r\n }\r\n}\r\n\r\n/** Date input component. This component is typically used by the [[DatePickerPopupButton]] to display and edit date and time.\r\n * @internal\r\n */\r\nexport function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className }: DateFieldProps) {\r\n const initialDateRef = React.useRef(initialDate);\r\n const [hasBadInput, setHasBadInput] = React.useState(false);\r\n const [inputValue, setInputValue] = React.useState(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n\r\n // See if new initialDate props have changed since component mounted\r\n React.useEffect(() => {\r\n // istanbul ignore else\r\n if (initialDate.getTime() !== initialDateRef.current.getTime()) {\r\n initialDateRef.current = initialDate;\r\n }\r\n setInputValue(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n }, [initialDate, dateFormatter, timeDisplay]);\r\n\r\n const handleInputChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setInputValue(event.currentTarget.value);\r\n }, []);\r\n\r\n const parseDate = React.useCallback((dateString: string) => {\r\n try {\r\n if (dateFormatter && dateFormatter.parseDate)\r\n return dateFormatter.parseDate(dateString);\r\n\r\n const newDateValue = Date.parse(dateString);\r\n // istanbul ignore else\r\n if (newDateValue)\r\n return new Date(newDateValue);\r\n } catch (_error) /* istanbul ignore next */ {\r\n Logger.logInfo(\"DateField\", `Encountered error parsing input value '${dateString}' as a date.`);\r\n return undefined;\r\n }\r\n // istanbul ignore next\r\n return undefined;\r\n }, [dateFormatter]);\r\n\r\n const updateInputDate = React.useCallback((dateString: string) => {\r\n try {\r\n const newDateValue = parseDate(dateString);\r\n if (newDateValue) {\r\n const newDate = new Date(newDateValue);\r\n onDateChange && onDateChange(newDate);\r\n setHasBadInput(false);\r\n } else {\r\n setHasBadInput(true);\r\n }\r\n } catch (_error) {\r\n // istanbul ignore next\r\n setHasBadInput(true);\r\n }\r\n }, [onDateChange, parseDate]);\r\n\r\n const handleOnBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n updateInputDate(event.target.value);\r\n }, [updateInputDate]);\r\n\r\n function onInputKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\r\n // istanbul ignore else\r\n if (event.key === \"Enter\") {\r\n updateInputDate(event.currentTarget.value);\r\n event.preventDefault();\r\n }\r\n }\r\n const classNames = classnames(className, \"components-date-input\", hasBadInput && \"components-date-has-error\");\r\n return <Input data-testid=\"components-date-input\" style={style} className={classNames} onKeyDown={onInputKeyDown} onBlur={handleOnBlur}\r\n onChange={handleInputChange} value={inputValue} disabled={readOnly || (dateFormatter && !(dateFormatter.parseDate))} size=\"small\" />;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DateField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DateField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1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C;IACD,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE,uBAAuB,EAAE,WAAW,IAAI,2BAA2B,CAAC,CAAC;IAC9G,OAAO,oBAAC,KAAK,mBAAa,uBAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EACpI,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC;AACzI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Date\n */\n\nimport \"./DateField.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { AlternateDateFormats, DateFormatter, TimeDisplay } from \"@itwin/appui-abstract\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Logger } from \"@itwin/core-bentley\";\n\n/** Props for [[DateField]] Component.\n * @internal\n */\nexport interface DateFieldProps extends CommonProps {\n /** Defines initial date and time for component. */\n initialDate: Date;\n /** Function to call when the date or time is changed. */\n onDateChange?: (day: Date) => void;\n /** Optional value to define if edit field allows editing. If a DateFormatter is provided\n * it must provide a parseData function or the field will be read only no matter the setting of this value. */\n readOnly?: boolean;\n /** Optional date formatter that produces an explicit date display */\n dateFormatter?: DateFormatter;\n /** This property has two purposes, the first is specify that the display of time is desired and the second is to define the format of the time display. */\n timeDisplay?: TimeDisplay;\n}\n\n/** Function to format a Date object that is used in control, type editor, and type converter\n * to produce a consistent formatted Date string.\n * @internal\n */\nexport function formatInputDate(inputDate: Date, timeDisplay?: TimeDisplay, customFormatter?: DateFormatter, alternateDateFormat?: AlternateDateFormats): string | undefined {\n if (customFormatter) {\n return customFormatter.formateDate(inputDate);\n }\n\n if (alternateDateFormat) {\n switch (alternateDateFormat) {\n case AlternateDateFormats.IsoDateTime:\n return inputDate.toISOString();\n case AlternateDateFormats.IsoShort:\n return inputDate.toISOString().slice(0, 10);\n case AlternateDateFormats.UtcDateTime:\n return inputDate.toUTCString().slice(5);\n case AlternateDateFormats.UtcShort:\n return inputDate.toUTCString().slice(5, 16);\n case AlternateDateFormats.UtcDateTimeWithDay:\n return inputDate.toUTCString();\n case AlternateDateFormats.UtcShortWithDay:\n return inputDate.toUTCString().slice(0, 16);\n }\n } else {\n const dateString = inputDate.toLocaleDateString(undefined, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\n let timeString: string = \"\";\n\n if (timeDisplay) {\n switch (timeDisplay) {\n case TimeDisplay.H12MC:\n timeString = inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\" });\n break;\n case TimeDisplay.H12MSC:\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\n break;\n case TimeDisplay.H24M:\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" }));\n // istanbul ignore next\n if (timeString === \"24:00\")\n timeString = \"00:00\";\n break;\n case TimeDisplay.H24MS:\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\n // istanbul ignore next\n if (timeString === \"24:00:00\")\n timeString = \"00:00:00\";\n break;\n }\n }\n return timeString.length ? `${dateString}, ${timeString}` : dateString;\n }\n}\n\n/** Date input component. This component is typically used by the [[DatePickerPopupButton]] to display and edit date and time.\n * @internal\n */\nexport function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className }: DateFieldProps) {\n const initialDateRef = React.useRef(initialDate);\n const [hasBadInput, setHasBadInput] = React.useState(false);\n const [inputValue, setInputValue] = React.useState(formatInputDate(initialDate, timeDisplay, dateFormatter));\n\n // See if new initialDate props have changed since component mounted\n React.useEffect(() => {\n // istanbul ignore else\n if (initialDate.getTime() !== initialDateRef.current.getTime()) {\n initialDateRef.current = initialDate;\n }\n setInputValue(formatInputDate(initialDate, timeDisplay, dateFormatter));\n }, [initialDate, dateFormatter, timeDisplay]);\n\n const handleInputChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setInputValue(event.currentTarget.value);\n }, []);\n\n const parseDate = React.useCallback((dateString: string) => {\n try {\n if (dateFormatter && dateFormatter.parseDate)\n return dateFormatter.parseDate(dateString);\n\n const newDateValue = Date.parse(dateString);\n // istanbul ignore else\n if (newDateValue)\n return new Date(newDateValue);\n } catch (_error) /* istanbul ignore next */ {\n Logger.logInfo(\"DateField\", `Encountered error parsing input value '${dateString}' as a date.`);\n return undefined;\n }\n // istanbul ignore next\n return undefined;\n }, [dateFormatter]);\n\n const updateInputDate = React.useCallback((dateString: string) => {\n try {\n const newDateValue = parseDate(dateString);\n if (newDateValue) {\n const newDate = new Date(newDateValue);\n onDateChange && onDateChange(newDate);\n setHasBadInput(false);\n } else {\n setHasBadInput(true);\n }\n } catch (_error) {\n // istanbul ignore next\n setHasBadInput(true);\n }\n }, [onDateChange, parseDate]);\n\n const handleOnBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\n updateInputDate(event.target.value);\n }, [updateInputDate]);\n\n function onInputKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n // istanbul ignore else\n if (event.key === \"Enter\") {\n updateInputDate(event.currentTarget.value);\n event.preventDefault();\n }\n }\n const classNames = classnames(className, \"components-date-input\", hasBadInput && \"components-date-has-error\");\n return <Input data-testid=\"components-date-input\" style={style} className={classNames} onKeyDown={onInputKeyDown} onBlur={handleOnBlur}\n onChange={handleInputChange} value={inputValue} disabled={readOnly || (dateFormatter && !(dateFormatter.parseDate))} size=\"small\" />;\n}\n"]}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
|
|
6
|
-
@import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
|
|
7
|
-
|
|
8
|
-
.components-date-input {
|
|
9
|
-
width: auto;
|
|
10
|
-
|
|
11
|
-
&.components-date-has-error {
|
|
12
|
-
color: var(--iui-color-text-negative);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.iui-input {
|
|
16
|
-
padding: $uicore-iui-input-padding;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.iui-input[disabled] {
|
|
20
|
-
color: var(--buic-foreground-body);
|
|
21
|
-
opacity: 0.65;
|
|
22
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
|
|
6
|
+
@import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
|
|
7
|
+
|
|
8
|
+
.components-date-input {
|
|
9
|
+
width: auto;
|
|
10
|
+
|
|
11
|
+
&.components-date-has-error {
|
|
12
|
+
color: var(--iui-color-text-negative);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.iui-input {
|
|
16
|
+
padding: $uicore-iui-input-padding;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.iui-input[disabled] {
|
|
20
|
+
color: var(--buic-foreground-body);
|
|
21
|
+
opacity: 0.65;
|
|
22
|
+
}
|
|
23
23
|
}
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AI,EAAC,SAAS,IAC3I,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,CAClC,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,QAAQ,SAAS,EAAE,IACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAS,EAAE,QAAgB,EAAE,EAAE;YAC5C,MAAM,QAAQ,GAAG,WAAW,IAAI,GAAG,IAAI,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YACnE,MAAM,SAAS,GAAG,UAAU,IAAI,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC;YAC5F,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC;YAC9D,MAAM,UAAU,GAAG,UAAU,CAAC,qCAAqC,EAAE,QAAQ,IAAI,UAAU,EAAE,CAAC,cAAc,IAAI,iBAAiB,EAAE,SAAS,IAAI,SAAS,CAAC,CAAC;YAC3J,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;YAChC,OAAO;YACL,oEAAoE;YACpE,4BAAI,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,aAAa,IAAI,mBAAmB,QAAQ,QAAQ,EAAE,EACvF,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAC,QAAQ,mBAAgB,QAAQ,gBAAc,GAAG,CAAC,OAAO,EAAE;gBACjG,kCAAO,SAAS,CAAQ,CACrB,CACN,CAAC;QACJ,CAAC,CAAC,CACa,CAAC,CACnB,CACE,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { SvgChevronLeft, SvgChevronRight } from \"@itwin/itwinui-icons-react\";\r\n\r\nimport \"./DatePicker.scss\";\r\n\r\nfunction isSameDay(a: Date, b: Date) {\r\n return (\r\n a &&\r\n b &&\r\n a.getFullYear() === b.getFullYear() &&\r\n a.getMonth() === b.getMonth() &&\r\n a.getDate() === b.getDate()\r\n );\r\n}\r\n\r\n/**\r\n * Props for [[DatePicker]] component.\r\n * @alpha\r\n */\r\nexport interface DatePickerProps {\r\n /** defines both date and time */\r\n selected: Date;\r\n /** function to call when date or time has changed */\r\n onDateChange?: (day: Date) => void;\r\n /** show focus outlines, useful for keyboard navigation */\r\n showFocusOutline?: boolean;\r\n}\r\n\r\n/** DatePicker component. Show a month selector and a day calendar to select a specific date.\r\n * @alpha\r\n */\r\nexport function DatePicker(props: DatePickerProps) {\r\n const previousMonthLabel = React.useRef(UiComponents.localization.getLocalizedString(\"UiComponents:datepicker.previousMonth\"));\r\n const nextMonthLabel = React.useRef(UiComponents.localization.getLocalizedString(\"UiComponents:datepicker.nextMonth\"));\r\n const monthsLong = React.useRef([\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.january\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.february\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.march\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.april\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.may\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.june\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.july\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.august\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.september\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.october\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.november\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.december\"),\r\n ]);\r\n\r\n const daysLong = React.useRef([\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.sunday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.monday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.tuesday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.wednesday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.thursday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.friday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.saturday\"),\r\n ]);\r\n\r\n const daysShort = React.useRef([\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.sunday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.monday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.tuesday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.wednesday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.thursday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.friday\"),\r\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.saturday\"),\r\n ]);\r\n\r\n const [selectedDay, setSelectedDay] = React.useState(new Date(props.selected.getTime()));\r\n const [displayedMonthIndex, setDisplayedMonthIndex] = React.useState(selectedDay.getMonth());\r\n const [displayedYear, setDisplayedYear] = React.useState(selectedDay.getFullYear());\r\n const [focusedDay, setFocusedDay] = React.useState(selectedDay);\r\n React.useEffect(() => {\r\n const newSelectedDay = new Date(props.selected);\r\n setSelectedDay(new Date(props.selected));\r\n setDisplayedMonthIndex(newSelectedDay.getMonth());\r\n setDisplayedYear(newSelectedDay.getFullYear());\r\n setFocusedDay(newSelectedDay);\r\n }, [props.selected]);\r\n const days = React.useMemo(() => {\r\n const msFirstDayOfMonth = new Date(displayedYear, displayedMonthIndex, 1).getTime();\r\n let offsetToFirst = new Date(msFirstDayOfMonth).getDay();\r\n if (0 === offsetToFirst)\r\n offsetToFirst = 7;\r\n\r\n const daysInMonth: Date[] = [];\r\n // generate 6 weeks of dates\r\n for (let i = 0; i < 42; i++) {\r\n const adjustedDay = 1 + i - offsetToFirst;\r\n daysInMonth.push(new Date(displayedYear, displayedMonthIndex, adjustedDay));\r\n }\r\n return daysInMonth;\r\n }, [displayedMonthIndex, displayedYear]);\r\n\r\n const weeks = React.useMemo(() => {\r\n const weeksInMonth = [];\r\n const weekCount = Math.ceil(days.length / 7);\r\n for (let i = 0; i < weekCount; i++) {\r\n weeksInMonth.push(days.slice(i * 7, (i + 1) * 7));\r\n }\r\n return weeksInMonth;\r\n }, [days]);\r\n\r\n const setMonthAndYear = React.useCallback((newMonth: number, newYear: number) => {\r\n setDisplayedMonthIndex(newMonth);\r\n setDisplayedYear(newYear);\r\n if (selectedDay.getFullYear() === newYear && selectedDay.getMonth() === newMonth) {\r\n setFocusedDay(new Date(selectedDay.getTime()));\r\n } else {\r\n const newFocusDay = new Date(focusedDay.getTime());\r\n newFocusDay.setFullYear(newYear, newMonth, 1);\r\n setFocusedDay(newFocusDay);\r\n }\r\n }, [focusedDay, selectedDay]);\r\n\r\n const handleMoveToPreviousMonth = React.useCallback(() => {\r\n const newMonth = displayedMonthIndex !== 0 ? displayedMonthIndex - 1 : 11;\r\n const newYear = displayedMonthIndex !== 0 ? displayedYear : displayedYear - 1;\r\n setMonthAndYear(newMonth, newYear);\r\n }, [displayedMonthIndex, displayedYear, setMonthAndYear]);\r\n\r\n const handleMoveToNextMonth = React.useCallback(() => {\r\n const newMonth = displayedMonthIndex !== 11 ? displayedMonthIndex + 1 : 0;\r\n const newYear = displayedMonthIndex !== 11 ? displayedYear : displayedYear + 1;\r\n setMonthAndYear(newMonth, newYear);\r\n }, [displayedMonthIndex, displayedYear, setMonthAndYear]);\r\n\r\n // when invoked, it will return another function which can be used for the onClick React listener.\r\n const handleOnDayChange = React.useCallback((day: Date) => () => {\r\n setSelectedDay(day);\r\n setFocusedDay(day);\r\n props.onDateChange && props.onDateChange(day);\r\n }, [props]);\r\n\r\n const handleCalendarKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLUListElement>) => {\r\n if (event.key === SpecialKey.ArrowDown) {\r\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\r\n if ((focusedDayIndex + 7) > 41)\r\n setFocusedDay(days[focusedDayIndex % 7]);\r\n else\r\n setFocusedDay(days[focusedDayIndex + 7]);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.ArrowUp) {\r\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\r\n if ((focusedDayIndex - 7) < 0)\r\n setFocusedDay(days[(focusedDayIndex % 7) + 35]);\r\n else\r\n setFocusedDay(days[focusedDayIndex - 7]);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.ArrowLeft) {\r\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\r\n // istanbul ignore else\r\n if ((focusedDayIndex - 1) >= 0)\r\n setFocusedDay(days[focusedDayIndex - 1]);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.ArrowRight) {\r\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\r\n // istanbul ignore else\r\n if ((focusedDayIndex + 1) <= 41)\r\n setFocusedDay(days[focusedDayIndex + 1]);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.Enter || event.key === SpecialKey.Space) {\r\n handleOnDayChange(focusedDay)(); // NB: immediately call returned handler function\r\n event.preventDefault();\r\n }\r\n }, [days, focusedDay, handleOnDayChange]);\r\n\r\n const previousButtonClass = classnames(\"components-previous-month\", props.showFocusOutline && \"showFocusOutline\");\r\n const nextButtonClass = classnames(\"components-next-month\", props.showFocusOutline && \"showFocusOutline\");\r\n const calendarClass = classnames(\"components-date-picker-calendar-month\", props.showFocusOutline && \"showFocusOutline\");\r\n\r\n return (\r\n <div className=\"components-date-picker-calendar\">\r\n <div className=\"components-date-picker-calendar-header-months\">\r\n <button className={previousButtonClass} title={previousMonthLabel.current} onClick={handleMoveToPreviousMonth}>\r\n <Icon iconSpec={<SvgChevronLeft />} />\r\n </button>\r\n <span className=\"components-month-year\">{monthsLong.current[displayedMonthIndex]} {displayedYear}</span>\r\n <button className={nextButtonClass} title={nextMonthLabel.current} onClick={handleMoveToNextMonth}>\r\n <Icon iconSpec={<SvgChevronRight />} />\r\n </button>\r\n </div>\r\n <div className=\"components-date-picker-calendar-header-weekdays\">\r\n {[0, 1, 2, 3, 4, 5, 6].map((dayOfWeek) =>\r\n <div key={`day-${dayOfWeek}`} className=\"components-date-picker-calendar-header-day-short\"\r\n title={daysLong.current[dayOfWeek]}><span>{daysShort.current[dayOfWeek]}</span></div>)}\r\n </div>\r\n <ul tabIndex={0} onKeyDown={handleCalendarKeyDown} data-testid=\"components-date-picker-calendar-list\" className={calendarClass} role=\"listbox\">\r\n {weeks.map((weekdays, weekIndex) => (\r\n <React.Fragment key={`week-${weekIndex}`}>\r\n {weekdays.map((day: Date, dayIndex: number) => {\r\n const isActive = selectedDay && day && isSameDay(selectedDay, day);\r\n const isFocused = focusedDay && day && isSameDay(focusedDay, day) && props.showFocusOutline;\r\n const isCurrentMonth = day.getMonth() === displayedMonthIndex;\r\n const classNames = classnames(\"components-date-picker-calendar-day\", isActive && \"selected\", !isCurrentMonth && \"notCurrentMonth\", isFocused && \"focused\");\r\n const dateValue = day.getDate();\r\n return (\r\n /* eslint-disable-next-line jsx-a11y/click-events-have-key-events */\r\n <li className={classNames} key={`${displayedYear}.${displayedMonthIndex}.day.${dayIndex}`}\r\n onClick={handleOnDayChange(day)} role=\"option\" aria-selected={isActive} data-value={day.getTime()}>\r\n <span>{dateValue}</span>\r\n </li>\r\n );\r\n })}\r\n </React.Fragment>)\r\n )}\r\n </ul>\r\n </div>\r\n );\r\n}\r\n"]}
|
|
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K,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,CAClC,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,QAAQ,SAAS,EAAE,IACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAS,EAAE,QAAgB,EAAE,EAAE;YAC5C,MAAM,QAAQ,GAAG,WAAW,IAAI,GAAG,IAAI,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YACnE,MAAM,SAAS,GAAG,UAAU,IAAI,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC;YAC5F,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC;YAC9D,MAAM,UAAU,GAAG,UAAU,CAAC,qCAAqC,EAAE,QAAQ,IAAI,UAAU,EAAE,CAAC,cAAc,IAAI,iBAAiB,EAAE,SAAS,IAAI,SAAS,CAAC,CAAC;YAC3J,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;YAChC,OAAO;YACL,oEAAoE;YACpE,4BAAI,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,aAAa,IAAI,mBAAmB,QAAQ,QAAQ,EAAE,EACvF,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAC,QAAQ,mBAAgB,QAAQ,gBAAc,GAAG,CAAC,OAAO,EAAE;gBACjG,kCAAO,SAAS,CAAQ,CACrB,CACN,CAAC;QACJ,CAAC,CAAC,CACa,CAAC,CACnB,CACE,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Date\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { UiComponents } from \"../UiComponents\";\nimport { Icon } from \"@itwin/core-react\";\nimport { SvgChevronLeft, SvgChevronRight } from \"@itwin/itwinui-icons-react\";\n\nimport \"./DatePicker.scss\";\n\nfunction isSameDay(a: Date, b: Date) {\n return (\n a &&\n b &&\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\n\n/**\n * Props for [[DatePicker]] component.\n * @alpha\n */\nexport interface DatePickerProps {\n /** defines both date and time */\n selected: Date;\n /** function to call when date or time has changed */\n onDateChange?: (day: Date) => void;\n /** show focus outlines, useful for keyboard navigation */\n showFocusOutline?: boolean;\n}\n\n/** DatePicker component. Show a month selector and a day calendar to select a specific date.\n * @alpha\n */\nexport function DatePicker(props: DatePickerProps) {\n const previousMonthLabel = React.useRef(UiComponents.localization.getLocalizedString(\"UiComponents:datepicker.previousMonth\"));\n const nextMonthLabel = React.useRef(UiComponents.localization.getLocalizedString(\"UiComponents:datepicker.nextMonth\"));\n const monthsLong = React.useRef([\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.january\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.february\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.march\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.april\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.may\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.june\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.july\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.august\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.september\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.october\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.november\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:month.long.december\"),\n ]);\n\n const daysLong = React.useRef([\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.sunday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.monday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.tuesday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.wednesday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.thursday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.friday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.long.saturday\"),\n ]);\n\n const daysShort = React.useRef([\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.sunday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.monday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.tuesday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.wednesday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.thursday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.friday\"),\n UiComponents.localization.getLocalizedString(\"UiComponents:days.short.saturday\"),\n ]);\n\n const [selectedDay, setSelectedDay] = React.useState(new Date(props.selected.getTime()));\n const [displayedMonthIndex, setDisplayedMonthIndex] = React.useState(selectedDay.getMonth());\n const [displayedYear, setDisplayedYear] = React.useState(selectedDay.getFullYear());\n const [focusedDay, setFocusedDay] = React.useState(selectedDay);\n React.useEffect(() => {\n const newSelectedDay = new Date(props.selected);\n setSelectedDay(new Date(props.selected));\n setDisplayedMonthIndex(newSelectedDay.getMonth());\n setDisplayedYear(newSelectedDay.getFullYear());\n setFocusedDay(newSelectedDay);\n }, [props.selected]);\n const days = React.useMemo(() => {\n const msFirstDayOfMonth = new Date(displayedYear, displayedMonthIndex, 1).getTime();\n let offsetToFirst = new Date(msFirstDayOfMonth).getDay();\n if (0 === offsetToFirst)\n offsetToFirst = 7;\n\n const daysInMonth: Date[] = [];\n // generate 6 weeks of dates\n for (let i = 0; i < 42; i++) {\n const adjustedDay = 1 + i - offsetToFirst;\n daysInMonth.push(new Date(displayedYear, displayedMonthIndex, adjustedDay));\n }\n return daysInMonth;\n }, [displayedMonthIndex, displayedYear]);\n\n const weeks = React.useMemo(() => {\n const weeksInMonth = [];\n const weekCount = Math.ceil(days.length / 7);\n for (let i = 0; i < weekCount; i++) {\n weeksInMonth.push(days.slice(i * 7, (i + 1) * 7));\n }\n return weeksInMonth;\n }, [days]);\n\n const setMonthAndYear = React.useCallback((newMonth: number, newYear: number) => {\n setDisplayedMonthIndex(newMonth);\n setDisplayedYear(newYear);\n if (selectedDay.getFullYear() === newYear && selectedDay.getMonth() === newMonth) {\n setFocusedDay(new Date(selectedDay.getTime()));\n } else {\n const newFocusDay = new Date(focusedDay.getTime());\n newFocusDay.setFullYear(newYear, newMonth, 1);\n setFocusedDay(newFocusDay);\n }\n }, [focusedDay, selectedDay]);\n\n const handleMoveToPreviousMonth = React.useCallback(() => {\n const newMonth = displayedMonthIndex !== 0 ? displayedMonthIndex - 1 : 11;\n const newYear = displayedMonthIndex !== 0 ? displayedYear : displayedYear - 1;\n setMonthAndYear(newMonth, newYear);\n }, [displayedMonthIndex, displayedYear, setMonthAndYear]);\n\n const handleMoveToNextMonth = React.useCallback(() => {\n const newMonth = displayedMonthIndex !== 11 ? displayedMonthIndex + 1 : 0;\n const newYear = displayedMonthIndex !== 11 ? displayedYear : displayedYear + 1;\n setMonthAndYear(newMonth, newYear);\n }, [displayedMonthIndex, displayedYear, setMonthAndYear]);\n\n // when invoked, it will return another function which can be used for the onClick React listener.\n const handleOnDayChange = React.useCallback((day: Date) => () => {\n setSelectedDay(day);\n setFocusedDay(day);\n props.onDateChange && props.onDateChange(day);\n }, [props]);\n\n const handleCalendarKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLUListElement>) => {\n if (event.key === SpecialKey.ArrowDown) {\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\n if ((focusedDayIndex + 7) > 41)\n setFocusedDay(days[focusedDayIndex % 7]);\n else\n setFocusedDay(days[focusedDayIndex + 7]);\n event.preventDefault();\n }\n if (event.key === SpecialKey.ArrowUp) {\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\n if ((focusedDayIndex - 7) < 0)\n setFocusedDay(days[(focusedDayIndex % 7) + 35]);\n else\n setFocusedDay(days[focusedDayIndex - 7]);\n event.preventDefault();\n }\n if (event.key === SpecialKey.ArrowLeft) {\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\n // istanbul ignore else\n if ((focusedDayIndex - 1) >= 0)\n setFocusedDay(days[focusedDayIndex - 1]);\n event.preventDefault();\n }\n if (event.key === SpecialKey.ArrowRight) {\n const focusedDayIndex = days.findIndex((day) => isSameDay(day, focusedDay));\n // istanbul ignore else\n if ((focusedDayIndex + 1) <= 41)\n setFocusedDay(days[focusedDayIndex + 1]);\n event.preventDefault();\n }\n if (event.key === SpecialKey.Enter || event.key === SpecialKey.Space) {\n handleOnDayChange(focusedDay)(); // NB: immediately call returned handler function\n event.preventDefault();\n }\n }, [days, focusedDay, handleOnDayChange]);\n\n const previousButtonClass = classnames(\"components-previous-month\", props.showFocusOutline && \"showFocusOutline\");\n const nextButtonClass = classnames(\"components-next-month\", props.showFocusOutline && \"showFocusOutline\");\n const calendarClass = classnames(\"components-date-picker-calendar-month\", props.showFocusOutline && \"showFocusOutline\");\n\n return (\n <div className=\"components-date-picker-calendar\">\n <div className=\"components-date-picker-calendar-header-months\">\n <button className={previousButtonClass} title={previousMonthLabel.current} onClick={handleMoveToPreviousMonth}>\n <Icon iconSpec={<SvgChevronLeft />} />\n </button>\n <span className=\"components-month-year\">{monthsLong.current[displayedMonthIndex]} {displayedYear}</span>\n <button className={nextButtonClass} title={nextMonthLabel.current} onClick={handleMoveToNextMonth}>\n <Icon iconSpec={<SvgChevronRight />} />\n </button>\n </div>\n <div className=\"components-date-picker-calendar-header-weekdays\">\n {[0, 1, 2, 3, 4, 5, 6].map((dayOfWeek) =>\n <div key={`day-${dayOfWeek}`} className=\"components-date-picker-calendar-header-day-short\"\n title={daysLong.current[dayOfWeek]}><span>{daysShort.current[dayOfWeek]}</span></div>)}\n </div>\n <ul tabIndex={0} onKeyDown={handleCalendarKeyDown} data-testid=\"components-date-picker-calendar-list\" className={calendarClass} role=\"listbox\">\n {weeks.map((weekdays, weekIndex) => (\n <React.Fragment key={`week-${weekIndex}`}>\n {weekdays.map((day: Date, dayIndex: number) => {\n const isActive = selectedDay && day && isSameDay(selectedDay, day);\n const isFocused = focusedDay && day && isSameDay(focusedDay, day) && props.showFocusOutline;\n const isCurrentMonth = day.getMonth() === displayedMonthIndex;\n const classNames = classnames(\"components-date-picker-calendar-day\", isActive && \"selected\", !isCurrentMonth && \"notCurrentMonth\", isFocused && \"focused\");\n const dateValue = day.getDate();\n return (\n /* eslint-disable-next-line jsx-a11y/click-events-have-key-events */\n <li className={classNames} key={`${displayedYear}.${displayedMonthIndex}.day.${dayIndex}`}\n onClick={handleOnDayChange(day)} role=\"option\" aria-selected={isActive} data-value={day.getTime()}>\n <span>{dateValue}</span>\n </li>\n );\n })}\n </React.Fragment>)\n )}\n </ul>\n </div>\n );\n}\n"]}
|