@itwin/components-react 4.15.4 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/lib/cjs/components-react/UiComponents.d.ts.map +1 -1
- package/lib/cjs/components-react/UiComponents.js +2 -0
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/common/CheckBoxState.d.ts +13 -0
- package/lib/cjs/components-react/common/CheckBoxState.d.ts.map +1 -0
- package/lib/cjs/components-react/common/CheckBoxState.js +17 -0
- package/lib/cjs/components-react/common/CheckBoxState.js.map +1 -0
- package/lib/cjs/components-react/common/HighlightedText.d.ts.map +1 -1
- package/lib/cjs/components-react/common/HighlightedText.js +78 -16
- package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/cjs/components-react/common/Orientation.d.ts +13 -0
- package/lib/cjs/components-react/common/Orientation.d.ts.map +1 -0
- package/lib/cjs/components-react/common/Orientation.js +17 -0
- package/lib/cjs/components-react/common/Orientation.js.map +1 -0
- package/lib/cjs/components-react/common/TimeFormat.d.ts +13 -0
- package/lib/cjs/components-react/common/TimeFormat.d.ts.map +1 -0
- package/lib/cjs/components-react/common/TimeFormat.js +17 -0
- package/lib/cjs/components-react/common/TimeFormat.js.map +1 -0
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js +8 -8
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.d.ts.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.js +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/BooleanEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.js +0 -5
- package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js +1 -5
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js +0 -5
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.js +73 -2
- package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js +0 -4
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.js +0 -5
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.js +0 -4
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.d.ts +0 -4
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js +0 -4
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/NumericInputEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.js +0 -5
- package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.d.ts +0 -3
- package/lib/cjs/components-react/editors/PopupButton.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.js +1 -4
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.scss +3 -4
- package/lib/cjs/components-react/editors/SliderEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/SliderEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.js +6 -7
- package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js +1 -5
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/TextareaEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.js +0 -5
- package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.d.ts +0 -5
- package/lib/cjs/components-react/editors/ToggleEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.js +0 -5
- package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js +2 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts +0 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +3 -7
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.d.ts +0 -4
- package/lib/cjs/components-react/filtering/ResultSelector.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.js +0 -4
- package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +0 -3
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +1 -7
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/l10n/LocalizationProvider.d.ts +10 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.js +46 -0
- package/lib/cjs/components-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/cjs/components-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/cjs/components-react/{useTranslation.js → l10n/useTranslation.js} +2 -2
- package/lib/cjs/components-react/l10n/useTranslation.js.map +1 -0
- package/lib/cjs/components-react/properties/ValueRendererManager.d.ts +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.d.ts +1 -2
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js +2 -3
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +3 -3
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -5
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +0 -2
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.d.ts +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js +3 -3
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.d.ts +1 -5
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js +0 -4
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.js +3 -3
- package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +2 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js +2 -2
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js +0 -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.d.ts +1 -2
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js +0 -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.d.ts +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js +0 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +0 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +0 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +3 -4
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +3 -3
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +0 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +0 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.d.ts +1 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyList.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js +2 -3
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -4
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +14 -8
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +9 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +0 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +0 -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.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +2 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts +15 -8
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +25 -17
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts +12 -8
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js +8 -9
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.scss +0 -7
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts +4 -2
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +4 -3
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts +14 -2
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js +3 -2
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +3 -0
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.d.ts +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js +2 -2
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +9 -2
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/cjs/components-react.d.ts +10 -6
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +10 -6
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/UiComponents.d.ts.map +1 -1
- package/lib/esm/components-react/UiComponents.js +2 -0
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/common/CheckBoxState.d.ts +13 -0
- package/lib/esm/components-react/common/CheckBoxState.d.ts.map +1 -0
- package/lib/esm/components-react/common/CheckBoxState.js +14 -0
- package/lib/esm/components-react/common/CheckBoxState.js.map +1 -0
- package/lib/esm/components-react/common/HighlightedText.d.ts.map +1 -1
- package/lib/esm/components-react/common/HighlightedText.js +56 -14
- package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/esm/components-react/common/Orientation.d.ts +13 -0
- package/lib/esm/components-react/common/Orientation.d.ts.map +1 -0
- package/lib/esm/components-react/common/Orientation.js +14 -0
- package/lib/esm/components-react/common/Orientation.js.map +1 -0
- package/lib/esm/components-react/common/TimeFormat.d.ts +13 -0
- package/lib/esm/components-react/common/TimeFormat.d.ts.map +1 -0
- package/lib/esm/components-react/common/TimeFormat.js +14 -0
- package/lib/esm/components-react/common/TimeFormat.js.map +1 -0
- package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.d.ts.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.js +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/BooleanEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.js +0 -5
- package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js +1 -5
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js +0 -5
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.js +74 -3
- package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js +0 -4
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.js +0 -5
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.js +0 -4
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.d.ts +0 -4
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js +0 -4
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/NumericInputEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.js +0 -5
- package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.d.ts +0 -3
- package/lib/esm/components-react/editors/PopupButton.d.ts.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.js +1 -4
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.scss +3 -4
- package/lib/esm/components-react/editors/SliderEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/SliderEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.js +6 -7
- package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js +1 -5
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/TextareaEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.js +0 -5
- package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.d.ts +0 -5
- package/lib/esm/components-react/editors/ToggleEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.js +0 -5
- package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.d.ts.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js +2 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderLogicalOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderToolbar.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts +0 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js +3 -7
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.d.ts +0 -4
- package/lib/esm/components-react/filtering/ResultSelector.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.js +0 -4
- package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +0 -3
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +1 -7
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/l10n/LocalizationProvider.d.ts +10 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.js +19 -0
- package/lib/esm/components-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/esm/components-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/esm/components-react/{useTranslation.js → l10n/useTranslation.js} +2 -2
- package/lib/esm/components-react/l10n/useTranslation.js.map +1 -0
- package/lib/esm/components-react/properties/ValueRendererManager.d.ts +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.d.ts.map +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.d.ts +1 -2
- package/lib/esm/components-react/properties/renderers/ActionButtonList.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js +1 -2
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/CustomizablePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts +1 -5
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +0 -2
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.d.ts +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.d.ts +1 -5
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js +0 -4
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.js +2 -2
- package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +2 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js +0 -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.d.ts +1 -2
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js +0 -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.d.ts +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js +0 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js +2 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +3 -4
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts +0 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js +0 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.d.ts +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyList.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.js +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -4
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +12 -6
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +9 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts +0 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +0 -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.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts +15 -8
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +25 -17
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.d.ts +12 -8
- package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js +9 -10
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.scss +0 -7
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts +4 -2
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +4 -3
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts +14 -2
- package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js +3 -2
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +3 -0
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.d.ts +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +9 -2
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react.d.ts +10 -6
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +10 -6
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +3 -5
- package/lib/cjs/components-react/useTranslation.d.ts.map +0 -1
- package/lib/cjs/components-react/useTranslation.js.map +0 -1
- package/lib/esm/components-react/useTranslation.d.ts.map +0 -1
- package/lib/esm/components-react/useTranslation.js.map +0 -1
- /package/lib/cjs/components-react/{useTranslation.d.ts → l10n/useTranslation.d.ts} +0 -0
- /package/lib/esm/components-react/{useTranslation.d.ts → l10n/useTranslation.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
# Change Log - @itwin/components-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 07 Aug 2024 12:38:32 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.16.0
|
|
6
|
+
Wed, 07 Aug 2024 12:38:32 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- React to `@itwin/core-react` deprecations.
|
|
11
|
+
- Added support for new BadgeKind type in components.
|
|
12
|
+
- Fix mixed-decls Sass warnings.
|
|
13
|
+
- Updated `EditorContainer` to not commit value when `Escape` is pressed or value was not changed.
|
|
14
|
+
- Property grid: Show array items' description next to the index when the items are non-primitive.
|
|
15
|
+
- Fixed `activeMatchIndex` not working correctly on adjacent matches in `HighlightedText`.
|
|
16
|
+
- Fixed `EditorContainer` trying to commit updated value twice when tab is pressed.
|
|
17
|
+
- Updated `VirtualizedPropertyGrid` to automatically close property editors when data changes.
|
|
18
|
+
|
|
19
|
+
## 4.15.5
|
|
20
|
+
Wed, 24 Jul 2024 16:09:26 GMT
|
|
21
|
+
|
|
22
|
+
_Version update only_
|
|
4
23
|
|
|
5
24
|
## 4.15.4
|
|
6
25
|
Mon, 22 Jul 2024 21:27:52 GMT
|
|
@@ -30,6 +49,11 @@ Fri, 28 Jun 2024 09:09:37 GMT
|
|
|
30
49
|
- `PropertyFilterBuilder`: Allow adding custom item for PropertyFilterBuilderActions
|
|
31
50
|
- Portal editors to the same container used to portal other components.
|
|
32
51
|
|
|
52
|
+
## 4.14.2
|
|
53
|
+
Mon, 22 Jul 2024 21:23:09 GMT
|
|
54
|
+
|
|
55
|
+
_Version update only_
|
|
56
|
+
|
|
33
57
|
## 4.14.1
|
|
34
58
|
Tue, 11 Jun 2024 15:58:29 GMT
|
|
35
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components-react/UiComponents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAe;IAE5C;;;OAGG;WACiB,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components-react/UiComponents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAe;IAE5C;;;OAGG;WACiB,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBzE,0DAA0D;WAC5C,SAAS;IAYvB,sDAAsD;IACtD,WAAkB,WAAW,IAAI,OAAO,CAEvC;IAED,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAavD,gBAAgB;WACF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;CAM/C"}
|
|
@@ -29,6 +29,7 @@ class UiComponents {
|
|
|
29
29
|
(0, immer_1.enablePatches)();
|
|
30
30
|
UiComponents._localization = localization;
|
|
31
31
|
await UiComponents._localization.registerNamespace(UiComponents.localizationNamespace);
|
|
32
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
32
33
|
await core_react_1.UiCore.initialize(UiComponents._localization);
|
|
33
34
|
UiComponents._initialized = true;
|
|
34
35
|
}
|
|
@@ -37,6 +38,7 @@ class UiComponents {
|
|
|
37
38
|
if (UiComponents._localization)
|
|
38
39
|
UiComponents._localization.unregisterNamespace(UiComponents.localizationNamespace);
|
|
39
40
|
UiComponents._localization = undefined;
|
|
41
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
40
42
|
core_react_1.UiCore.terminate();
|
|
41
43
|
UiComponents._initialized = false;
|
|
42
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponents.js","sourceRoot":"","sources":["../../../src/components-react/UiComponents.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,iCAAsC;AACtC,sDAA6C;AAE7C,kDAA2C;AAC3C,kDAAuD;AAEvD;;;GAGG;AACH,MAAa,YAAY;IAIvB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,YAAY,CAAC,YAAY,EAAE,CAAC;YAC9B,qBAAM,CAAC,OAAO,CACZ,YAAY,CAAC,cAAc,CAAC,YAAY,CAAC,EACzC,wCAAwC,CACzC,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAA,qBAAa,GAAE,CAAC;QAChB,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;QAC1C,MAAM,YAAY,CAAC,aAAa,CAAC,iBAAiB,CAChD,YAAY,CAAC,qBAAqB,CACnC,CAAC;QAEF,MAAM,mBAAM,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACpD,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,CAAC;IAED,0DAA0D;IACnD,MAAM,CAAC,SAAS;QACrB,IAAI,YAAY,CAAC,aAAa;YAC5B,YAAY,CAAC,aAAa,CAAC,mBAAmB,CAC5C,YAAY,CAAC,qBAAqB,CACnC,CAAC;QACJ,YAAY,CAAC,aAAa,GAAG,SAAS,CAAC;QAEvC,mBAAM,CAAC,SAAS,EAAE,CAAC;QACnB,YAAY,CAAC,YAAY,GAAG,KAAK,CAAC;I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AE,CAC/C,CAAC;IACJ,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,QAAQ,GACZ,YAAY,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA9EH,oCA+EC;AA9EgB,yBAAY,GAAG,KAAK,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 Common\n */\n\nimport { enablePatches } from \"immer\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\nimport { UiCore } from \"@itwin/core-react\";\nimport { getObjectClassName } from \"@itwin/core-react\";\n\n/**\n * Manages the localization service for the components-react package.\n * @public\n */\nexport class UiComponents {\n private static _initialized = false;\n private static _localization?: Localization;\n\n /**\n * Registers the localization service namespace for UiComponents. Also initializes UiCore.\n * @param localization The internationalization service created by the host application.\n */\n public static async initialize(localization: Localization): Promise<void> {\n if (UiComponents._initialized) {\n Logger.logInfo(\n UiComponents.loggerCategory(UiComponents),\n `UiComponents.initialize already called`\n );\n return;\n }\n\n enablePatches();\n UiComponents._localization = localization;\n await UiComponents._localization.registerNamespace(\n UiComponents.localizationNamespace\n );\n\n // eslint-disable-next-line deprecation/deprecation\n await UiCore.initialize(UiComponents._localization);\n UiComponents._initialized = true;\n }\n\n /** Unregisters the UiComponents localization namespace */\n public static terminate() {\n if (UiComponents._localization)\n UiComponents._localization.unregisterNamespace(\n UiComponents.localizationNamespace\n );\n UiComponents._localization = undefined;\n\n // eslint-disable-next-line deprecation/deprecation\n UiCore.terminate();\n UiComponents._initialized = false;\n }\n\n /** Determines if UiComponents has been initialized */\n public static get initialized(): boolean {\n return UiComponents._initialized;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"components-react\";\n }\n\n /** Calls localization.getLocalizedString with the \"UiComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiComponents._localization) {\n Logger.logError(\n UiComponents.loggerCategory(this),\n `translate: UiComponents.initialize has not been called. Returning blank string.`\n );\n return \"\";\n }\n return UiComponents._localization.getLocalizedString(\n `${UiComponents.localizationNamespace}:${key}`\n );\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getObjectClassName(obj);\n const category =\n UiComponents.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Common
|
|
3
|
+
*/
|
|
4
|
+
import { CheckBoxState as _CheckBoxState } from "@itwin/core-react";
|
|
5
|
+
/** State of a checkbox.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type CheckBoxState = _CheckBoxState;
|
|
9
|
+
/** State of a checkbox.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const CheckBoxState: typeof _CheckBoxState;
|
|
13
|
+
//# sourceMappingURL=CheckBoxState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckBoxState.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/CheckBoxState.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIpE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAC3C;;GAEG;AAEH,eAAO,MAAM,aAAa,uBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckBoxState = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Common
|
|
10
|
+
*/
|
|
11
|
+
const core_react_1 = require("@itwin/core-react");
|
|
12
|
+
/** State of a checkbox.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
16
|
+
exports.CheckBoxState = core_react_1.CheckBoxState;
|
|
17
|
+
//# sourceMappingURL=CheckBoxState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckBoxState.js","sourceRoot":"","sources":["../../../../src/components-react/common/CheckBoxState.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,kDAAoE;AAQpE;;GAEG;AACH,2DAA2D;AAC9C,QAAA,aAAa,GAAG,0BAAc,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 Common\n */\nimport { CheckBoxState as _CheckBoxState } from \"@itwin/core-react\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** State of a checkbox.\n * @public\n */\nexport type CheckBoxState = _CheckBoxState;\n/** State of a checkbox.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const CheckBoxState = _CheckBoxState;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAW1D"}
|
|
@@ -6,13 +6,32 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Common
|
|
8
8
|
*/
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
11
31
|
};
|
|
12
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
33
|
exports.HighlightedText = void 0;
|
|
14
|
-
const react_1 =
|
|
15
|
-
const react_highlight_words_1 = __importDefault(require("react-highlight-words"));
|
|
34
|
+
const react_1 = __importStar(require("react"));
|
|
16
35
|
const HighlightingEngine_1 = require("../tree/HighlightingEngine");
|
|
17
36
|
/**
|
|
18
37
|
* Highlighted text
|
|
@@ -22,22 +41,65 @@ const HighlightingEngine_1 = require("../tree/HighlightingEngine");
|
|
|
22
41
|
*/
|
|
23
42
|
function HighlightedText(props) {
|
|
24
43
|
const { searchText, activeMatchIndex, text, caseSensitive } = props;
|
|
25
|
-
|
|
44
|
+
const chunks = (0, react_1.useMemo)(() => findChunks(text, searchText, caseSensitive), [text, searchText, caseSensitive]);
|
|
45
|
+
const markedChunks = (0, react_1.useMemo)(() => markChunks(text, chunks, activeMatchIndex), [text, chunks, activeMatchIndex]);
|
|
46
|
+
return react_1.default.createElement(react_1.default.Fragment, null, markedChunks);
|
|
26
47
|
}
|
|
27
48
|
exports.HighlightedText = HighlightedText;
|
|
28
|
-
|
|
29
|
-
const text = args.caseSensitive
|
|
30
|
-
? args.textToHighlight
|
|
31
|
-
: args.textToHighlight.toUpperCase();
|
|
32
|
-
const term = args.caseSensitive
|
|
33
|
-
? args.searchWords[0]
|
|
34
|
-
: args.searchWords[0].toUpperCase();
|
|
49
|
+
function findChunks(text, searchText, caseSensitive) {
|
|
35
50
|
const chunks = [];
|
|
36
|
-
|
|
51
|
+
const contentText = caseSensitive ? text : text.toLowerCase();
|
|
52
|
+
const inputText = caseSensitive ? searchText : searchText.toLowerCase();
|
|
53
|
+
let index = contentText.indexOf(inputText);
|
|
37
54
|
while (index !== -1) {
|
|
38
|
-
chunks.push({ start: index, end: index +
|
|
39
|
-
index =
|
|
55
|
+
chunks.push({ start: index, end: index + inputText.length });
|
|
56
|
+
index = contentText.indexOf(inputText, index + 1);
|
|
40
57
|
}
|
|
41
58
|
return chunks;
|
|
42
|
-
}
|
|
59
|
+
}
|
|
60
|
+
function markChunks(text, chunks, activeChunk) {
|
|
61
|
+
const markedText = [];
|
|
62
|
+
let previousIndex = 0;
|
|
63
|
+
const { mergedChunks, newActiveIndex } = mergeChunks(chunks, activeChunk);
|
|
64
|
+
for (let i = 0; i < mergedChunks.length; i++) {
|
|
65
|
+
const { start, end } = mergedChunks[i];
|
|
66
|
+
// add unmarked text between previous chunk and current one
|
|
67
|
+
const nonMarkedText = text.substring(previousIndex, start);
|
|
68
|
+
if (nonMarkedText.length) {
|
|
69
|
+
markedText.push(react_1.default.createElement("span", { key: previousIndex }, nonMarkedText));
|
|
70
|
+
}
|
|
71
|
+
// add marked chunk text
|
|
72
|
+
markedText.push(react_1.default.createElement("mark", { key: start, className: i === newActiveIndex
|
|
73
|
+
? HighlightingEngine_1.HighlightingEngine.ACTIVE_CLASS_NAME
|
|
74
|
+
: undefined }, text.substring(start, end)));
|
|
75
|
+
previousIndex = end;
|
|
76
|
+
}
|
|
77
|
+
// add unmarked text after last chunk
|
|
78
|
+
const lastNonMarkedText = text.substring(previousIndex, text.length);
|
|
79
|
+
if (lastNonMarkedText.length) {
|
|
80
|
+
markedText.push(react_1.default.createElement("span", { key: previousIndex }, lastNonMarkedText));
|
|
81
|
+
}
|
|
82
|
+
return markedText;
|
|
83
|
+
}
|
|
84
|
+
function mergeChunks(chunks, activeChunk) {
|
|
85
|
+
const mergedChunks = [];
|
|
86
|
+
let lastChunk;
|
|
87
|
+
let newActiveIndex;
|
|
88
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
89
|
+
const chunk = chunks[i];
|
|
90
|
+
const isActive = i === activeChunk;
|
|
91
|
+
if (lastChunk &&
|
|
92
|
+
lastChunk.info.end === chunk.start &&
|
|
93
|
+
!isActive &&
|
|
94
|
+
!lastChunk.isActive) {
|
|
95
|
+
lastChunk.info.end = chunk.end;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
isActive && (newActiveIndex = mergedChunks.length);
|
|
99
|
+
const newChunk = { start: chunk.start, end: chunk.end };
|
|
100
|
+
lastChunk = { isActive, info: newChunk };
|
|
101
|
+
mergedChunks.push(newChunk);
|
|
102
|
+
}
|
|
103
|
+
return { mergedChunks, newActiveIndex };
|
|
104
|
+
}
|
|
43
105
|
//# sourceMappingURL=HighlightedText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedText.js","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG
|
|
1
|
+
{"version":3,"file":"HighlightedText.js","sourceRoot":"","sources":["../../../../src/components-react/common/HighlightedText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAuC;AACvC,mEAAgE;AAiBhE;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACpE,MAAM,MAAM,GAAG,IAAA,eAAO,EACpB,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EACjD,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAClC,CAAC;IACF,MAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAChD,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,CACjC,CAAC;IACF,OAAO,8DAAG,YAAY,CAAI,CAAC;AAC7B,CAAC;AAXD,0CAWC;A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AC,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QACxD,SAAS,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACzC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAC1C,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 Common\n */\n\nimport React, { useMemo } from \"react\";\nimport { HighlightingEngine } from \"../tree/HighlightingEngine\";\n\n/**\n * Properties of [[HighlightedText]]\n * @public\n */\nexport interface HighlightedTextProps {\n /* Filter text which we want to highlight */\n searchText: string;\n /* Index of actively highlighted part in a text */\n activeMatchIndex?: number;\n /* Full text */\n text: string;\n /** Should search be case sensitive */\n caseSensitive?: boolean;\n}\n\n/**\n * Highlighted text\n * Used for highlighting parts in the 'text' which match with 'searchText'\n * Also actively highlights one matched part which is selected with 'activeMatchIndex'\n * @public\n */\nexport function HighlightedText(props: HighlightedTextProps) {\n const { searchText, activeMatchIndex, text, caseSensitive } = props;\n const chunks = useMemo(\n () => findChunks(text, searchText, caseSensitive),\n [text, searchText, caseSensitive]\n );\n const markedChunks = useMemo(\n () => markChunks(text, chunks, activeMatchIndex),\n [text, chunks, activeMatchIndex]\n );\n return <>{markedChunks}</>;\n}\n\ninterface HighlightedChunk {\n start: number;\n end: number;\n}\n\nfunction findChunks(\n text: string,\n searchText: string,\n caseSensitive?: boolean\n): HighlightedChunk[] {\n const chunks: HighlightedChunk[] = [];\n const contentText = caseSensitive ? text : text.toLowerCase();\n const inputText = caseSensitive ? searchText : searchText.toLowerCase();\n let index = contentText.indexOf(inputText);\n\n while (index !== -1) {\n chunks.push({ start: index, end: index + inputText.length });\n index = contentText.indexOf(inputText, index + 1);\n }\n\n return chunks;\n}\n\nfunction markChunks(\n text: string,\n chunks: HighlightedChunk[],\n activeChunk?: number\n) {\n const markedText: React.ReactElement[] = [];\n let previousIndex = 0;\n\n const { mergedChunks, newActiveIndex } = mergeChunks(chunks, activeChunk);\n\n for (let i = 0; i < mergedChunks.length; i++) {\n const { start, end } = mergedChunks[i];\n\n // add unmarked text between previous chunk and current one\n const nonMarkedText = text.substring(previousIndex, start);\n if (nonMarkedText.length) {\n markedText.push(<span key={previousIndex}>{nonMarkedText}</span>);\n }\n\n // add marked chunk text\n markedText.push(\n <mark\n key={start}\n className={\n i === newActiveIndex\n ? HighlightingEngine.ACTIVE_CLASS_NAME\n : undefined\n }\n >\n {text.substring(start, end)}\n </mark>\n );\n previousIndex = end;\n }\n\n // add unmarked text after last chunk\n const lastNonMarkedText = text.substring(previousIndex, text.length);\n if (lastNonMarkedText.length) {\n markedText.push(<span key={previousIndex}>{lastNonMarkedText}</span>);\n }\n\n return markedText;\n}\n\nfunction mergeChunks(chunks: HighlightedChunk[], activeChunk?: number) {\n const mergedChunks: HighlightedChunk[] = [];\n let lastChunk: { isActive: boolean; info: HighlightedChunk } | undefined;\n let newActiveIndex: number | undefined;\n\n for (let i = 0; i < chunks.length; i++) {\n const chunk = chunks[i];\n const isActive = i === activeChunk;\n if (\n lastChunk &&\n lastChunk.info.end === chunk.start &&\n !isActive &&\n !lastChunk.isActive\n ) {\n lastChunk.info.end = chunk.end;\n continue;\n }\n isActive && (newActiveIndex = mergedChunks.length);\n const newChunk = { start: chunk.start, end: chunk.end };\n lastChunk = { isActive, info: newChunk };\n mergedChunks.push(newChunk);\n }\n return { mergedChunks, newActiveIndex };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/ImageRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,KAAK,EAIN,MAAM,gBAAgB,CAAC;AAGxB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkC;IAE1D,OAAO,CAAC,WAAW;IAanB,8BAA8B;IAC9B,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,mBAAmB;IAS3B,iCAAiC;IACjC,OAAO,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/ImageRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,KAAK,EAIN,MAAM,gBAAgB,CAAC;AAGxB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkC;IAE1D,OAAO,CAAC,WAAW;IAanB,8BAA8B;IAC9B,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,mBAAmB;IAS3B,iCAAiC;IACjC,OAAO,CAAC,SAAS;IAejB,+BAA+B;IAC/B,OAAO,CAAC,SAAS;IAIjB,sCAAsC;IACtC,OAAO,CAAC,cAAc;IAKtB,sDAAsD;IACtD,OAAO,CAAC,0BAA0B;IAIlC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAiB/B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB,yDAAyD;IAClD,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS;CA2BnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/common/ImageRenderer.tsx"],"names":[],"mappings":";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,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,6BAA6B,WAAW,EAAE,CAAC;IACpD,CAAC;IAED,iCAAiC;IACzB,SAAS,CAAC,GAAW;QAC3B,IAAI,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAC/B,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YACpD,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,CACL;
|
|
1
|
+
{"version":3,"file":"ImageRenderer.js","sourceRoot":"","sources":["../../../../src/components-react/common/ImageRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,kDAAsD;AACtD,kDAA+C;AAO/C,0DAAgD;AAEhD;;GAEG;AACH,MAAa,aAAa;IAGhB,WAAW,CAAC,SAAiB;QACnC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QAEtB,OAAO,MAAM,CAAC,IAAI,CAChB,KAAK;aACF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC;aACD,IAAI,CAAC,EAAE,CAAC,CACZ,CAAC;IACJ,CAAC;IAED,8BAA8B;IACtB,YAAY,CAAC,IAAY,EAAE,MAAuB;QACx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CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YAE1D,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,SAAS,CAAE,WAA2B,CAAC,KAAK,CAAC,CAAC;YAE5D,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,SAAS,CAAE,WAA2B,CAAC,KAAK,CAAC,CAAC;YAE5D,KAAK,WAAW;gBACd,OAAO,IAAI,CAAC,cAAc,CAAE,WAA2B,CAAC,KAAK,CAAC,CAAC;YAEjE,KAAK,cAAc;gBACjB,OAAO,IAAI,CAAC,iBAAiB,CAAE,WAA2B,CAAC,KAAK,CAAC,CAAC;YAEpE;gBACE,MAAM,mBAAmB,GAAU,WAAW,CAAC,UAAU,CAAC,CAAC,gDAAgD;gBAC3G,mDAAmD;gBACnD,MAAM,IAAI,wBAAO,CACf,2BAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACjC,6BAA6B,mBAAmB,GAAG,CACpD,CAAC;QACN,CAAC;IACH,CAAC;;AAvIH,sCAwIC;AAvIgB,uBAAS,GAAwB,IAAI,GAAG,EAAE,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 Common\n */\n\nimport * as React from \"react\";\nimport type { WebFontIconProps } from \"@itwin/core-react\";\nimport { Icon, WebFontIcon } from \"@itwin/core-react\";\nimport { UiComponents } from \"../UiComponents\";\nimport type {\n Image,\n ImageFileFormat,\n LoadedBinaryImage,\n LoadedImage,\n} from \"./IImageLoader\";\nimport { UiError } from \"@itwin/appui-abstract\";\n\n/** A class that renders images from data provided by an image loader\n * @internal\n */\nexport class ImageRenderer {\n private static _svgCache: Map<string, string> = new Map();\n\n private hexToBase64(hexstring: string) {\n const match = hexstring.match(/\\w{2}/g);\n if (!match) return \"\";\n\n return window.btoa(\n match\n .map((a) => {\n return String.fromCharCode(parseInt(a, 16));\n })\n .join(\"\")\n );\n }\n\n /** Render raw binary image */\n private renderBinary(data: string, format: ImageFileFormat) {\n // Convert binary to base64\n const dataAsBase64 = this.hexToBase64(data);\n return <img src={`data:image/${format};base64,${dataAsBase64}`} alt=\"\" />;\n }\n\n private isSvg(input: string): boolean {\n const parser = new DOMParser();\n const doc = parser.parseFromString(input, \"application/xml\");\n\n const errorNode = doc.querySelector(\"parsererror\");\n if (errorNode) {\n return false;\n }\n\n const rootNode = doc.documentElement.nodeName.toLowerCase();\n return \"svg\" === rootNode;\n }\n\n private convertSvgToDataUri(svg: string) {\n if (!this.isSvg(svg)) {\n return \"\";\n }\n\n const svgAsBase64 = window.btoa(svg);\n return `data:image/svg+xml;base64,${svgAsBase64}`;\n }\n\n /** Render svg string into JSX */\n private renderSvg(svg: string) {\n let svgAsDataUri = ImageRenderer._svgCache.get(svg);\n if (undefined === svgAsDataUri) {\n svgAsDataUri = this.convertSvgToDataUri(svg.trim());\n ImageRenderer._svgCache.set(svg, svgAsDataUri);\n }\n\n return (\n <div>\n {/* eslint-disable-next-line deprecation/deprecation */}\n <Icon iconSpec={svgAsDataUri} />\n </div>\n );\n }\n\n /** Render image from an url */\n private renderUrl(url: string) {\n return <img src={url} alt=\"\" />;\n }\n\n /** Render image as core-react icon */\n private renderCoreIcon(iconName: string) {\n // eslint-disable-next-line deprecation/deprecation\n return <WebFontIcon iconName={iconName} />;\n }\n\n /** Replaces the escaped instances of \"\\:\" with \":\" */\n private normalizeEscapedIconString(escapedIconString: string) {\n return escapedIconString.replace(/\\\\:/g, \":\");\n }\n\n /**\n * Extract class and name from icon name, if the name follows format \"{className}:{fontName}\".\n * className and fontName can be escaped using \\ if : is needed.\n */\n private extractIconClassAndName(\n iconName: string\n // eslint-disable-next-line deprecation/deprecation\n ): Pick<WebFontIconProps, \"iconClassName\" | \"iconName\"> {\n const matches = iconName.match(/(\\\\.|[^:])+/g);\n if (!matches || matches.length !== 2)\n return {\n iconClassName: undefined,\n iconName,\n };\n\n return {\n iconClassName: this.normalizeEscapedIconString(matches[0]),\n iconName: this.normalizeEscapedIconString(matches[1]),\n };\n }\n\n /**\n * Render image as provided webfont icon.\n * Defaults to core-react icon if iconName does not contain className.\n */\n private renderWebfontIcon(iconName: string) {\n const iconInfo = this.extractIconClassAndName(iconName);\n // eslint-disable-next-line deprecation/deprecation\n return <WebFontIcon {...iconInfo} />;\n }\n\n /** Render image from data provided by an image loader */\n public render(loadedImage: Image): React.ReactNode {\n switch (loadedImage.sourceType) {\n case \"binary\":\n const image = loadedImage as LoadedBinaryImage;\n return this.renderBinary(image.value, image.fileFormat);\n\n case \"url\":\n return this.renderUrl((loadedImage as LoadedImage).value);\n\n case \"svg\":\n return this.renderSvg((loadedImage as LoadedImage).value);\n\n case \"core-icon\":\n return this.renderCoreIcon((loadedImage as LoadedImage).value);\n\n case \"webfont-icon\":\n return this.renderWebfontIcon((loadedImage as LoadedImage).value);\n\n default:\n const unhandledSourceType: never = loadedImage.sourceType; // Compile time check that all cases are handled\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(\n UiComponents.loggerCategory(this),\n `Can't handle sourceType: \"${unhandledSourceType}\"`\n );\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Common
|
|
3
|
+
*/
|
|
4
|
+
import { Orientation as _Orientation } from "@itwin/core-react";
|
|
5
|
+
/** Enumeration of orientation.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type Orientation = _Orientation;
|
|
9
|
+
/** Enumeration of orientation.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const Orientation: typeof _Orientation;
|
|
13
|
+
//# sourceMappingURL=Orientation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Orientation.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/Orientation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIhE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AACvC;;GAEG;AAEH,eAAO,MAAM,WAAW,qBAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Common
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Orientation = void 0;
|
|
11
|
+
const core_react_1 = require("@itwin/core-react");
|
|
12
|
+
/** Enumeration of orientation.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
16
|
+
exports.Orientation = core_react_1.Orientation;
|
|
17
|
+
//# sourceMappingURL=Orientation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Orientation.js","sourceRoot":"","sources":["../../../../src/components-react/common/Orientation.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kDAAgE;AAQhE;;GAEG;AACH,2DAA2D;AAC9C,QAAA,WAAW,GAAG,wBAAY,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 Common\n */\n\nimport { Orientation as _Orientation } from \"@itwin/core-react\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Enumeration of orientation.\n * @public\n */\nexport type Orientation = _Orientation;\n/** Enumeration of orientation.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const Orientation = _Orientation;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Common
|
|
3
|
+
*/
|
|
4
|
+
import { TimeFormat as _TimeFormat } from "@itwin/core-react";
|
|
5
|
+
/** Enumeration of time formats.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type TimeFormat = _TimeFormat;
|
|
9
|
+
/** Enumeration of time formats.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const TimeFormat: typeof _TimeFormat;
|
|
13
|
+
//# sourceMappingURL=TimeFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeFormat.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/TimeFormat.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC;;GAEG;AAEH,eAAO,MAAM,UAAU,oBAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Common
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TimeFormat = void 0;
|
|
11
|
+
const core_react_1 = require("@itwin/core-react");
|
|
12
|
+
/** Enumeration of time formats.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare, deprecation/deprecation
|
|
16
|
+
exports.TimeFormat = core_react_1.TimeFormat;
|
|
17
|
+
//# sourceMappingURL=TimeFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeFormat.js","sourceRoot":"","sources":["../../../../src/components-react/common/TimeFormat.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kDAA8D;AAO9D;;GAEG;AACH,oFAAoF;AACvE,QAAA,UAAU,GAAG,uBAAW,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 Common\n */\n\nimport { TimeFormat as _TimeFormat } from \"@itwin/core-react\";\n\n/** Enumeration of time formats.\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nexport type TimeFormat = _TimeFormat;\n/** Enumeration of time formats.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare, deprecation/deprecation\nexport const TimeFormat = _TimeFormat;\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { Primitives } from "@itwin/appui-abstract";
|
|
5
5
|
import { AlternateDateFormats, TimeDisplay } from "@itwin/appui-abstract";
|
|
6
|
-
import { TimeFormat } from "@itwin/core-react";
|
|
7
6
|
import type { LessGreaterOperatorProcessor } from "./TypeConverter";
|
|
8
7
|
import { TypeConverter } from "./TypeConverter";
|
|
9
8
|
import type { ConvertedPrimitives } from "./valuetypes/ConvertedTypes";
|
|
9
|
+
import { TimeFormat } from "../common/TimeFormat";
|
|
10
10
|
/**
|
|
11
11
|
* DateTime Type Converter.
|
|
12
12
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeConverter.d.ts","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EAEpB,WAAW,EACZ,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeTypeConverter.d.ts","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EAEpB,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;GAGG;AACH,8BAAsB,yBACpB,SAAQ,aACR,YAAW,4BAA4B;IAEvB,eAAe,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK;WAkB1C,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;WAM9C,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO;IASzD,0BAA0B,CACxC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,EACxB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAC/B,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2E3B,0EAA0E;IAC1D,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAE9B,mBAAmB,CAAC,KAAK,GACzB,SAAS,GACT,OAAO,CAAC,mBAAmB,CAAC,KAAK,GAAG,SAAS,CAAC;IAyBlD,OAAO,CAAC,WAAW;IAIH,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAU/C,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,UAAU;IAE9C,IAAoB,iBAAiB,IAAI,OAAO,CAE/C;IAEM,WAAW,CAChB,MAAM,EAAE,IAAI,EACZ,MAAM,EAAE,IAAI,EACZ,WAAW,CAAC,EAAE,OAAO,GACpB,MAAM;IAIO,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;IAI9C,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO;IAI1D,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO;IAIrC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO;IAI9C,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO;IAIxC,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO;CAGzD;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,yBAAyB;IACnE,SAAS,CAAC,aAAa,IAAI,UAAU;CAGtC;AAMD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,yBAAyB;IAClE,SAAS,CAAC,aAAa,IAAI,UAAU;CAGtC"}
|
|
@@ -10,12 +10,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.DateTimeTypeConverter = exports.ShortDateTypeConverter = exports.DateTimeTypeConverterBase = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
13
|
-
const core_react_1 = require("@itwin/core-react");
|
|
14
13
|
const DateField_1 = require("../datepicker/DateField");
|
|
15
14
|
const DateUtils_1 = require("../common/DateUtils");
|
|
16
15
|
const UiComponents_1 = require("../UiComponents");
|
|
17
16
|
const TypeConverter_1 = require("./TypeConverter");
|
|
18
17
|
const TypeConverterManager_1 = require("./TypeConverterManager");
|
|
18
|
+
const TimeFormat_1 = require("../common/TimeFormat");
|
|
19
19
|
// cSpell:ignore datepicker valuetypes
|
|
20
20
|
/**
|
|
21
21
|
* DateTime Type Converter.
|
|
@@ -29,9 +29,9 @@ class DateTimeTypeConverterBase extends TypeConverter_1.TypeConverter {
|
|
|
29
29
|
value = new Date(value);
|
|
30
30
|
if (value instanceof Date) {
|
|
31
31
|
switch (this.getTimeFormat()) {
|
|
32
|
-
case
|
|
32
|
+
case TimeFormat_1.TimeFormat.Short:
|
|
33
33
|
return value.toLocaleDateString();
|
|
34
|
-
case
|
|
34
|
+
case TimeFormat_1.TimeFormat.Long:
|
|
35
35
|
return value.toLocaleString();
|
|
36
36
|
}
|
|
37
37
|
return value.toISOString();
|
|
@@ -51,7 +51,7 @@ class DateTimeTypeConverterBase extends TypeConverter_1.TypeConverter {
|
|
|
51
51
|
if (value === undefined)
|
|
52
52
|
return "";
|
|
53
53
|
if (options) {
|
|
54
|
-
let timeDisplay = this.getTimeFormat() ===
|
|
54
|
+
let timeDisplay = this.getTimeFormat() === TimeFormat_1.TimeFormat.Long
|
|
55
55
|
? appui_abstract_1.TimeDisplay.H12MC
|
|
56
56
|
: undefined;
|
|
57
57
|
let alternateDateFormat = appui_abstract_1.AlternateDateFormats.None;
|
|
@@ -59,7 +59,7 @@ class DateTimeTypeConverterBase extends TypeConverter_1.TypeConverter {
|
|
|
59
59
|
DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {
|
|
60
60
|
alternateDateFormat = options.alternateDateFormat;
|
|
61
61
|
}
|
|
62
|
-
if (this.getTimeFormat() ===
|
|
62
|
+
if (this.getTimeFormat() === TimeFormat_1.TimeFormat.Long) {
|
|
63
63
|
if ("timeDisplay" in options) {
|
|
64
64
|
if (alternateDateFormat) {
|
|
65
65
|
core_bentley_1.Logger.logInfo(UiComponents_1.UiComponents.loggerCategory(this), `Invalid specification of timeDisplay with alternateDateFormat specification`);
|
|
@@ -79,7 +79,7 @@ class DateTimeTypeConverterBase extends TypeConverter_1.TypeConverter {
|
|
|
79
79
|
}
|
|
80
80
|
if (value instanceof Date) {
|
|
81
81
|
// Ensure if alternateDateFormat is specified make sure it matches proper Long/Short format.
|
|
82
|
-
if (this.getTimeFormat() ===
|
|
82
|
+
if (this.getTimeFormat() === TimeFormat_1.TimeFormat.Long) {
|
|
83
83
|
if (alternateDateFormat === appui_abstract_1.AlternateDateFormats.IsoShort)
|
|
84
84
|
alternateDateFormat = appui_abstract_1.AlternateDateFormats.IsoDateTime;
|
|
85
85
|
if (alternateDateFormat === appui_abstract_1.AlternateDateFormats.UtcShort)
|
|
@@ -164,7 +164,7 @@ exports.DateTimeTypeConverterBase = DateTimeTypeConverterBase;
|
|
|
164
164
|
*/
|
|
165
165
|
class ShortDateTypeConverter extends DateTimeTypeConverterBase {
|
|
166
166
|
getTimeFormat() {
|
|
167
|
-
return
|
|
167
|
+
return TimeFormat_1.TimeFormat.Short;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
exports.ShortDateTypeConverter = ShortDateTypeConverter;
|
|
@@ -175,7 +175,7 @@ TypeConverterManager_1.TypeConverterManager.registerConverter(appui_abstract_1.S
|
|
|
175
175
|
*/
|
|
176
176
|
class DateTimeTypeConverter extends DateTimeTypeConverterBase {
|
|
177
177
|
getTimeFormat() {
|
|
178
|
-
return
|
|
178
|
+
return TimeFormat_1.TimeFormat.Long;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
exports.DateTimeTypeConverter = DateTimeTypeConverter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAE7C,0DAI+B;AAC/B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CAAO,EAAE,CAAO;QAChC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEM,mBAAmB,CAAC,CAAO,EAAE,CAAO;QACzC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IAEM,aAAa,CAAC,CAAO,EAAE,CAAO;QACnC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEM,sBAAsB,CAAC,CAAO,EAAE,CAAO;QAC5C,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;CACF;AAtMD,8DAsMC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,yBAAyB;IACzD,aAAa;QACrB,OAAO,uBAAU,CAAC,KAAK,CAAC;IAC1B,CAAC;CACF;AAJD,wDAIC;AACD,2CAAoB,CAAC,iBAAiB,CACpC,kCAAiB,CAAC,SAAS,EAC3B,sBAAsB,CACvB,CAAC;AAEF;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,yBAAyB;IACxD,aAAa;QACrB,OAAO,uBAAU,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAJD,sDAIC;AACD,2CAAoB,CAAC,iBAAiB,CACpC,kCAAiB,CAAC,QAAQ,EAC1B,qBAAqB,CACtB,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 TypeConverters\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Primitives } from \"@itwin/appui-abstract\";\nimport {\n AlternateDateFormats,\n StandardTypeNames,\n TimeDisplay,\n} from \"@itwin/appui-abstract\";\nimport { TimeFormat } from \"@itwin/core-react\";\nimport { formatInputDate } from \"../datepicker/DateField\";\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\nimport { UiComponents } from \"../UiComponents\";\nimport type { LessGreaterOperatorProcessor } from \"./TypeConverter\";\nimport { TypeConverter } from \"./TypeConverter\";\nimport { TypeConverterManager } from \"./TypeConverterManager\";\nimport type { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\n\n// cSpell:ignore datepicker valuetypes\n\n/**\n * DateTime Type Converter.\n * @public\n */\nexport abstract class DateTimeTypeConverterBase\n extends TypeConverter\n implements LessGreaterOperatorProcessor\n{\n public override convertToString(value?: Primitives.Value) {\n if (value === undefined) return \"\";\n\n if (typeof value === \"string\") value = new Date(value);\n\n if (value instanceof Date) {\n switch (this.getTimeFormat()) {\n case TimeFormat.Short:\n return value.toLocaleDateString();\n case TimeFormat.Long:\n return value.toLocaleString();\n }\n return value.toISOString();\n }\n\n return value.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string\n }\n\n public static isValidTimeDisplay(type: TimeDisplay): boolean {\n return Object.keys(TimeDisplay).some(\n (key) => (TimeDisplay as any)[key] === type\n );\n }\n\n public static isAlternateDateFormats(type: AlternateDateFormats): boolean {\n return Object.keys(AlternateDateFormats).some(\n (key) => (AlternateDateFormats as any)[key] === type\n );\n }\n\n // supported options:\n // timeDisplay?: TimeDisplay\n // alternateDateFormat?: AlternateDateFormats\n public override convertToStringWithOptions(\n value?: Primitives.Value,\n options?: { [key: string]: any }\n ): string | Promise<string> {\n if (value === undefined) return \"\";\n\n if (options) {\n let timeDisplay: TimeDisplay | undefined =\n this.getTimeFormat() === TimeFormat.Long\n ? TimeDisplay.H12MC\n : undefined;\n let alternateDateFormat = AlternateDateFormats.None;\n\n if (\n \"alternateDateFormat\" in options &&\n DateTimeTypeConverterBase.isAlternateDateFormats(\n options.alternateDateFormat\n )\n ) {\n alternateDateFormat = options.alternateDateFormat;\n }\n\n if (this.getTimeFormat() === TimeFormat.Long) {\n if (\"timeDisplay\" in options) {\n if (alternateDateFormat) {\n Logger.logInfo(\n UiComponents.loggerCategory(this),\n `Invalid specification of timeDisplay with alternateDateFormat specification`\n );\n } else {\n if (\n DateTimeTypeConverterBase.isValidTimeDisplay(options.timeDisplay)\n )\n timeDisplay = options.timeDisplay;\n }\n }\n }\n\n if (typeof value === \"string\") {\n value = new Date(value); // this value will be based on local time zone\n if (value instanceof Date && alternateDateFormat) {\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\n value = adjustDateToTimezone(value, value.getTimezoneOffset() * -1);\n }\n }\n\n if (value instanceof Date) {\n // Ensure if alternateDateFormat is specified make sure it matches proper Long/Short format.\n if (this.getTimeFormat() === TimeFormat.Long) {\n if (alternateDateFormat === AlternateDateFormats.IsoShort)\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\n if (alternateDateFormat === AlternateDateFormats.UtcShort)\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay)\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\n } else {\n // short time format\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\n alternateDateFormat = AlternateDateFormats.IsoShort;\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\n alternateDateFormat = AlternateDateFormats.UtcShort;\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\n }\n\n const formattedDateTime = formatInputDate(\n value,\n timeDisplay,\n undefined,\n alternateDateFormat\n );\n if (formattedDateTime) return formattedDateTime;\n }\n }\n\n return this.convertToString(value);\n }\n\n /** Default implementation just calls convertFromString with no options */\n public override convertFromStringWithOptions(\n value: string,\n options?: { [key: string]: any }\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n if (!value) return undefined;\n\n if (options) {\n let alternateDateFormat = AlternateDateFormats.None;\n\n if (\n \"alternateDateFormat\" in options &&\n DateTimeTypeConverterBase.isAlternateDateFormats(\n options.alternateDateFormat\n )\n ) {\n alternateDateFormat = options.alternateDateFormat;\n }\n\n let date = new Date(value); // this value will be based on local time zone\n if (date instanceof Date && alternateDateFormat) {\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\n date = adjustDateToTimezone(date, date.getTimezoneOffset() * -1);\n }\n }\n\n return this.convertFromString(value);\n }\n\n private isDateValid(date: Date) {\n return date instanceof Date && !isNaN(+date);\n }\n\n public override convertFromString(value: string) {\n if (!value) return undefined;\n\n const dateValue = new Date(value);\n\n if (!this.isDateValid(dateValue)) return undefined;\n\n return dateValue;\n }\n\n protected abstract getTimeFormat(): TimeFormat;\n\n public override get isLessGreaterType(): boolean {\n return true;\n }\n\n public sortCompare(\n valueA: Date,\n valueB: Date,\n _ignoreCase?: boolean\n ): number {\n return valueA.valueOf() - valueB.valueOf();\n }\n\n public override isEqualTo(valueA: Date, valueB: Date): boolean {\n return valueA.valueOf() === valueB.valueOf();\n }\n\n public override isNotEqualTo(valueA: Date, valueB: Date): boolean {\n return valueA.valueOf() !== valueB.valueOf();\n }\n\n public isLessThan(a: Date, b: Date): boolean {\n return a.valueOf() < b.valueOf();\n }\n\n public isLessThanOrEqualTo(a: Date, b: Date): boolean {\n return a.valueOf() <= b.valueOf();\n }\n\n public isGreaterThan(a: Date, b: Date): boolean {\n return a.valueOf() > b.valueOf();\n }\n\n public isGreaterThanOrEqualTo(a: Date, b: Date): boolean {\n return a.valueOf() >= b.valueOf();\n }\n}\n\n/**\n * Short Date Type Converter.\n * @public\n */\nexport class ShortDateTypeConverter extends DateTimeTypeConverterBase {\n protected getTimeFormat(): TimeFormat {\n return TimeFormat.Short;\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.ShortDate,\n ShortDateTypeConverter\n);\n\n/**\n * Date Time Type Converter.\n * @public\n */\nexport class DateTimeTypeConverter extends DateTimeTypeConverterBase {\n protected getTimeFormat(): TimeFormat {\n return TimeFormat.Long;\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.DateTime,\n DateTimeTypeConverter\n);\n"]}
|
|
1
|
+
{"version":3,"file":"DateTimeTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAE7C,0DAI+B;AAC/B,uDAA0D;AAC1D,mDAA2D;AAC3D,kDAA+C;AAE/C,mDAAgD;AAChD,iEAA8D;AAE9D,qDAAkD;AAElD,sCAAsC;AAEtC;;;GAGG;AACH,MAAsB,yBACpB,SAAQ,6BAAa;IAGL,eAAe,CAAC,KAAwB;QACtD,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;YAC1B,QAAQ,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;gBAC7B,KAAK,uBAAU,CAAC,KAAK;oBACnB,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC;gBACpC,KAAK,uBAAU,CAAC,IAAI;oBAClB,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC;YAClC,CAAC;YACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC;QAED,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,2DAA2D;IACtF,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,OAAO,MAAM,CAAC,IAAI,CAAC,4BAAW,CAAC,CAAC,IAAI,CAClC,CAAC,GAAG,EAAE,EAAE,CAAE,4BAAmB,CAAC,GAAG,CAAC,KAAK,IAAI,CAC5C,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,sBAAsB,CAAC,IAA0B;QAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,qCAAoB,CAAC,CAAC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Y;QAClD,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAEe,YAAY,CAAC,MAAY,EAAE,MAAY;QACrD,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAEM,UAAU,CAAC,CAAO,EAAE,CAAO;QAChC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEM,mBAAmB,CAAC,CAAO,EAAE,CAAO;QACzC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IAEM,aAAa,CAAC,CAAO,EAAE,CAAO;QACnC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEM,sBAAsB,CAAC,CAAO,EAAE,CAAO;QAC5C,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;CACF;AAtMD,8DAsMC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,yBAAyB;IACzD,aAAa;QACrB,OAAO,uBAAU,CAAC,KAAK,CAAC;IAC1B,CAAC;CACF;AAJD,wDAIC;AACD,2CAAoB,CAAC,iBAAiB,CACpC,kCAAiB,CAAC,SAAS,EAC3B,sBAAsB,CACvB,CAAC;AAEF;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,yBAAyB;IACxD,aAAa;QACrB,OAAO,uBAAU,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAJD,sDAIC;AACD,2CAAoB,CAAC,iBAAiB,CACpC,kCAAiB,CAAC,QAAQ,EAC1B,qBAAqB,CACtB,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 TypeConverters\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Primitives } from \"@itwin/appui-abstract\";\nimport {\n AlternateDateFormats,\n StandardTypeNames,\n TimeDisplay,\n} from \"@itwin/appui-abstract\";\nimport { formatInputDate } from \"../datepicker/DateField\";\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\nimport { UiComponents } from \"../UiComponents\";\nimport type { LessGreaterOperatorProcessor } from \"./TypeConverter\";\nimport { TypeConverter } from \"./TypeConverter\";\nimport { TypeConverterManager } from \"./TypeConverterManager\";\nimport type { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\nimport { TimeFormat } from \"../common/TimeFormat\";\n\n// cSpell:ignore datepicker valuetypes\n\n/**\n * DateTime Type Converter.\n * @public\n */\nexport abstract class DateTimeTypeConverterBase\n extends TypeConverter\n implements LessGreaterOperatorProcessor\n{\n public override convertToString(value?: Primitives.Value) {\n if (value === undefined) return \"\";\n\n if (typeof value === \"string\") value = new Date(value);\n\n if (value instanceof Date) {\n switch (this.getTimeFormat()) {\n case TimeFormat.Short:\n return value.toLocaleDateString();\n case TimeFormat.Long:\n return value.toLocaleString();\n }\n return value.toISOString();\n }\n\n return value.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string\n }\n\n public static isValidTimeDisplay(type: TimeDisplay): boolean {\n return Object.keys(TimeDisplay).some(\n (key) => (TimeDisplay as any)[key] === type\n );\n }\n\n public static isAlternateDateFormats(type: AlternateDateFormats): boolean {\n return Object.keys(AlternateDateFormats).some(\n (key) => (AlternateDateFormats as any)[key] === type\n );\n }\n\n // supported options:\n // timeDisplay?: TimeDisplay\n // alternateDateFormat?: AlternateDateFormats\n public override convertToStringWithOptions(\n value?: Primitives.Value,\n options?: { [key: string]: any }\n ): string | Promise<string> {\n if (value === undefined) return \"\";\n\n if (options) {\n let timeDisplay: TimeDisplay | undefined =\n this.getTimeFormat() === TimeFormat.Long\n ? TimeDisplay.H12MC\n : undefined;\n let alternateDateFormat = AlternateDateFormats.None;\n\n if (\n \"alternateDateFormat\" in options &&\n DateTimeTypeConverterBase.isAlternateDateFormats(\n options.alternateDateFormat\n )\n ) {\n alternateDateFormat = options.alternateDateFormat;\n }\n\n if (this.getTimeFormat() === TimeFormat.Long) {\n if (\"timeDisplay\" in options) {\n if (alternateDateFormat) {\n Logger.logInfo(\n UiComponents.loggerCategory(this),\n `Invalid specification of timeDisplay with alternateDateFormat specification`\n );\n } else {\n if (\n DateTimeTypeConverterBase.isValidTimeDisplay(options.timeDisplay)\n )\n timeDisplay = options.timeDisplay;\n }\n }\n }\n\n if (typeof value === \"string\") {\n value = new Date(value); // this value will be based on local time zone\n if (value instanceof Date && alternateDateFormat) {\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\n value = adjustDateToTimezone(value, value.getTimezoneOffset() * -1);\n }\n }\n\n if (value instanceof Date) {\n // Ensure if alternateDateFormat is specified make sure it matches proper Long/Short format.\n if (this.getTimeFormat() === TimeFormat.Long) {\n if (alternateDateFormat === AlternateDateFormats.IsoShort)\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\n if (alternateDateFormat === AlternateDateFormats.UtcShort)\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay)\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\n } else {\n // short time format\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\n alternateDateFormat = AlternateDateFormats.IsoShort;\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\n alternateDateFormat = AlternateDateFormats.UtcShort;\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\n }\n\n const formattedDateTime = formatInputDate(\n value,\n timeDisplay,\n undefined,\n alternateDateFormat\n );\n if (formattedDateTime) return formattedDateTime;\n }\n }\n\n return this.convertToString(value);\n }\n\n /** Default implementation just calls convertFromString with no options */\n public override convertFromStringWithOptions(\n value: string,\n options?: { [key: string]: any }\n ):\n | ConvertedPrimitives.Value\n | undefined\n | Promise<ConvertedPrimitives.Value | undefined> {\n if (!value) return undefined;\n\n if (options) {\n let alternateDateFormat = AlternateDateFormats.None;\n\n if (\n \"alternateDateFormat\" in options &&\n DateTimeTypeConverterBase.isAlternateDateFormats(\n options.alternateDateFormat\n )\n ) {\n alternateDateFormat = options.alternateDateFormat;\n }\n\n let date = new Date(value); // this value will be based on local time zone\n if (date instanceof Date && alternateDateFormat) {\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\n date = adjustDateToTimezone(date, date.getTimezoneOffset() * -1);\n }\n }\n\n return this.convertFromString(value);\n }\n\n private isDateValid(date: Date) {\n return date instanceof Date && !isNaN(+date);\n }\n\n public override convertFromString(value: string) {\n if (!value) return undefined;\n\n const dateValue = new Date(value);\n\n if (!this.isDateValid(dateValue)) return undefined;\n\n return dateValue;\n }\n\n protected abstract getTimeFormat(): TimeFormat;\n\n public override get isLessGreaterType(): boolean {\n return true;\n }\n\n public sortCompare(\n valueA: Date,\n valueB: Date,\n _ignoreCase?: boolean\n ): number {\n return valueA.valueOf() - valueB.valueOf();\n }\n\n public override isEqualTo(valueA: Date, valueB: Date): boolean {\n return valueA.valueOf() === valueB.valueOf();\n }\n\n public override isNotEqualTo(valueA: Date, valueB: Date): boolean {\n return valueA.valueOf() !== valueB.valueOf();\n }\n\n public isLessThan(a: Date, b: Date): boolean {\n return a.valueOf() < b.valueOf();\n }\n\n public isLessThanOrEqualTo(a: Date, b: Date): boolean {\n return a.valueOf() <= b.valueOf();\n }\n\n public isGreaterThan(a: Date, b: Date): boolean {\n return a.valueOf() > b.valueOf();\n }\n\n public isGreaterThanOrEqualTo(a: Date, b: Date): boolean {\n return a.valueOf() >= b.valueOf();\n }\n}\n\n/**\n * Short Date Type Converter.\n * @public\n */\nexport class ShortDateTypeConverter extends DateTimeTypeConverterBase {\n protected getTimeFormat(): TimeFormat {\n return TimeFormat.Short;\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.ShortDate,\n ShortDateTypeConverter\n);\n\n/**\n * Date Time Type Converter.\n * @public\n */\nexport class DateTimeTypeConverter extends DateTimeTypeConverterBase {\n protected getTimeFormat(): TimeFormat {\n return TimeFormat.Long;\n }\n}\nTypeConverterManager.registerConverter(\n StandardTypeNames.DateTime,\n DateTimeTypeConverter\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DatePicker.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,mBAAmB,CAAC;AAa3B;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,QAAQ,EAAE,IAAI,CAAC;IACf,qDAAqD;IACrD,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AAEH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DatePicker.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,mBAAmB,CAAC;AAa3B;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,QAAQ,EAAE,IAAI,CAAC;IACf,qDAAqD;IACrD,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AAEH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAmQhD"}
|
|
@@ -40,7 +40,7 @@ const ts_key_enum_1 = require("ts-key-enum");
|
|
|
40
40
|
const core_react_1 = require("@itwin/core-react");
|
|
41
41
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
42
42
|
require("./DatePicker.scss");
|
|
43
|
-
const useTranslation_1 = require("../useTranslation");
|
|
43
|
+
const useTranslation_1 = require("../l10n/useTranslation");
|
|
44
44
|
function isSameDay(a, b) {
|
|
45
45
|
return (a &&
|
|
46
46
|
b &&
|