@itwin/components-react 3.0.0-extension.1 → 3.0.2
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 +148 -5
- package/LICENSE.md +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js +3 -3
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.d.ts +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js +5 -5
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts +2 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js +20 -10
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.js +1 -2
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.js +1 -0
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +3 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +0 -3
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
- package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js +11 -8
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.scss +2 -1
- package/lib/cjs/components-react/table/component/Table.d.ts +3 -3
- package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/cjs/components-react/table/component/Table.js +11 -12
- package/lib/cjs/components-react/table/component/Table.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.js +3 -1
- package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.scss +7 -0
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts +4 -0
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js +4 -2
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.scss +13 -2
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +16 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +24 -5
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react.d.ts +0 -8
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +0 -8
- package/lib/cjs/components-react.js.map +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/DateField.js +1 -1
- package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.d.ts +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js +5 -5
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts +2 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js +21 -11
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.js +1 -2
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.js +1 -0
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js +1 -1
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +3 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +0 -3
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
- package/lib/esm/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js +11 -8
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.scss +2 -1
- package/lib/esm/components-react/table/component/Table.d.ts +3 -3
- package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/esm/components-react/table/component/Table.js +12 -13
- package/lib/esm/components-react/table/component/Table.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.js +4 -2
- package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.scss +7 -0
- package/lib/esm/components-react/toolbar/PopupItem.d.ts +4 -0
- package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js +5 -3
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.scss +13 -2
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +16 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +22 -4
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react.d.ts +0 -8
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +0 -8
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +20 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAEhE,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAAC;AACrE,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CA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GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
|
@@ -175,10 +175,6 @@ __exportStar(require("./components-react/tree/controlled/internal/SparseTree"),
|
|
|
175
175
|
* @docs-group-description Date
|
|
176
176
|
* Classes, interfaces, and components for showing and setting date and time.
|
|
177
177
|
*/
|
|
178
|
-
/**
|
|
179
|
-
* @docs-group-description DateTimeTypeConverter
|
|
180
|
-
* Convert Date to string and string to Date.
|
|
181
|
-
*/
|
|
182
178
|
/**
|
|
183
179
|
* @docs-group-description DragDrop
|
|
184
180
|
* Classes and Higher Order Components for working with the DragDrop API.
|
|
@@ -195,10 +191,6 @@ __exportStar(require("./components-react/tree/controlled/internal/SparseTree"),
|
|
|
195
191
|
* @docs-group-description Inputs
|
|
196
192
|
* Input Components that format and parse input.
|
|
197
193
|
*/
|
|
198
|
-
/**
|
|
199
|
-
* @docs-group-description OIDC
|
|
200
|
-
* Components for working with OIDC and Sign-in.
|
|
201
|
-
*/
|
|
202
194
|
/**
|
|
203
195
|
* @docs-group-description SelectableContent
|
|
204
196
|
* Classes and components for working with SelectableContent component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,2EAAyD;AACzD,+EAA6D;AAC7D,oFAAkE;AAClE,kFAAgE;AAEhE,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,oFAAkE;AAClE,kFAAgE;AAChE,kFAAgE;AAChE,0EAAwD;AACxD,mFAAiE;AACjE,sEAAoD;AAEpD,8EAA4D;AAC5D,qFAAmE;AACnE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,yFAAuE;A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;AAClG,mHAAiG;AAEjG,0FAAwE;AAExE,6EAA2D;AAC3D,mFAAiE;AACjE,2FAAyE;AACzE,2GAAyF;AACzF,2EAAyD;AACzD,+EAA6D;AAC7D,iFAA+D;AAC/D,gGAA8E;AAE9E,qEAAmD;AACnD,iFAA+D;AAC/D,uEAAqD;AACrD,+EAA6D;AAC7D,kEAAgD;AAChD,iFAA+D;AAE/D,2EAAyD;AACzD,iFAA+D;AAC/D,6EAA2D;AAC3D,sEAAoD;AACpD,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\r\n\r\nexport { UiComponents } from \"./components-react/UiComponents\";\r\n\r\nexport * from \"./components-react/breadcrumb/Breadcrumb\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbPath\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbTreeUtils\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbDetails\";\r\n\r\nexport * from \"./components-react/common/Links\";\r\nexport * from \"./components-react/common/PageOptions\";\r\nexport * from \"./components-react/common/selection/SelectionModes\";\r\nexport * from \"./components-react/common/HighlightingComponentProps\";\r\nexport * from \"./components-react/common/HighlightedText\";\r\nexport * from \"./components-react/common/IImageLoader\";\r\nexport * from \"./components-react/common/selection/SelectionHandler\";\r\nexport * from \"./components-react/common/showhide/ShowHideDialog\";\r\nexport * from \"./components-react/common/showhide/ShowHideItem\";\r\nexport * from \"./components-react/common/showhide/ShowHideMenu\";\r\nexport * from \"./components-react/common/UseAsyncValue\";\r\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\r\nexport * from \"./components-react/common/DateUtils\";\r\n\r\nexport * from \"./components-react/converters/TypeConverter\";\r\nexport * from \"./components-react/converters/TypeConverterManager\";\r\nexport * from \"./components-react/converters/BooleanTypeConverter\";\r\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\r\nexport * from \"./components-react/converters/EnumTypeConverter\";\r\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\r\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\r\nexport * from \"./components-react/converters/NumericTypeConverter\";\r\nexport * from \"./components-react/converters/PointTypeConverter\";\r\nexport * from \"./components-react/converters/StringTypeConverter\";\r\nexport * from \"./components-react/converters/CompositeTypeConverter\";\r\n\r\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\r\n\r\nexport * from \"./components-react/datepicker/DateField\";\r\nexport * from \"./components-react/datepicker/DatePicker\";\r\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\r\nexport * from \"./components-react/datepicker/IntlFormatter\";\r\nexport * from \"./components-react/datepicker/TimeField\";\r\n\r\nexport * from \"./components-react/editors/BooleanEditor\";\r\nexport * from \"./components-react/editors/CustomNumberEditor\";\r\nexport * from \"./components-react/editors/DateTimeEditor\";\r\nexport * from \"./components-react/editors/EditorContainer\";\r\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\r\nexport * from \"./components-react/editors/EnumEditor\";\r\nexport * from \"./components-react/editors/IconEditor\";\r\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\r\nexport * from \"./components-react/editors/NumericInputEditor\";\r\nexport * from \"./components-react/editors/PropertyEditorManager\";\r\nexport * from \"./components-react/editors/SliderEditor\";\r\nexport * from \"./components-react/editors/TextEditor\";\r\nexport * from \"./components-react/editors/TextareaEditor\";\r\nexport * from \"./components-react/editors/ThemedEnumEditor\";\r\nexport * from \"./components-react/editors/ToggleEditor\";\r\n\r\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\r\nexport * from \"./components-react/favorite/FavoritePropertyList\";\r\n\r\nexport * from \"./components-react/filtering/FilteringInput\";\r\nexport * from \"./components-react/filtering/ResultSelector\";\r\n\r\nexport * from \"./components-react/iconpicker/IconPickerButton\";\r\n\r\nexport * from \"./components-react/inputs/ParsedInput\";\r\n\r\nexport * from \"./components-react/properties/LinkHandler\";\r\nexport * from \"./components-react/properties/ValueRendererManager\";\r\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyView\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\r\n\r\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\r\n\r\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\r\nexport * from \"./components-react/properties/ItemStyle\";\r\n\r\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\r\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\r\nexport * from \"./components-react/propertygrid/component/PropertyList\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\r\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\r\n\r\nexport * from \"./components-react/selectable-content/SelectableContent\";\r\n\r\nexport * from \"./components-react/table/TableDataProvider\";\r\nexport * from \"./components-react/table/SimpleTableDataProvider\";\r\nexport * from \"./components-react/table/columnfiltering/ColumnFiltering\";\r\nexport * from \"./components-react/table/columnfiltering/TableFilterDescriptorCollection\";\r\nexport * from \"./components-react/table/component/Table\";\r\nexport * from \"./components-react/table/component/TableCell\";\r\nexport * from \"./components-react/table/component/TableColumn\";\r\nexport * from \"./components-react/table/component/dragdrop/BeDragDropContext\";\r\n\r\nexport * from \"./components-react/toolbar/Toolbar\";\r\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\r\nexport * from \"./components-react/toolbar/PopupItem\";\r\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\r\nexport * from \"./components-react/toolbar/Item\";\r\nexport * from \"./components-react/toolbar/utilities/Direction\";\r\n\r\nexport * from \"./components-react/tree/TreeDataProvider\";\r\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\r\nexport * from \"./components-react/tree/HighlightingEngine\";\r\nexport * from \"./components-react/tree/ImageLoader\";\r\nexport * from \"./components-react/tree/controlled/TreeActions\";\r\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\r\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\r\nexport * from \"./components-react/tree/controlled/TreeEvents\";\r\nexport * from \"./components-react/tree/controlled/TreeModel\";\r\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\r\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\r\nexport * from \"./components-react/tree/controlled/Observable\";\r\nexport * from \"./components-react/tree/controlled/TreeHooks\";\r\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\r\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\r\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\r\n\r\n/** @docs-package-description\r\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\r\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description Breadcrumb\r\n * Classes and components for working with a Breadcrumb.\r\n * As of version 3.0, the Breadcrumb is deprecated.\r\n */\r\n/**\r\n * @docs-group-description Date\r\n * Classes, interfaces, and components for showing and setting date and time.\r\n */\r\n/**\r\n * @docs-group-description DateTimeTypeConverter\r\n * Convert Date to string and string to Date.\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes and Higher Order Components for working with the DragDrop API.\r\n */\r\n/**\r\n * @docs-group-description Favorite\r\n * Classes and components for displaying favorite properties.\r\n */\r\n/**\r\n * @docs-group-description Filtering\r\n * Classes and components for working with filtering.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Input Components that format and parse input.\r\n */\r\n/**\r\n * @docs-group-description OIDC\r\n * Components for working with OIDC and Sign-in.\r\n */\r\n/**\r\n * @docs-group-description SelectableContent\r\n * Classes and components for working with SelectableContent component.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes and components for working with Properties.\r\n */\r\n/**\r\n * @docs-group-description PropertyEditors\r\n * Classes and components for working with Property Editors.\r\n */\r\n/**\r\n * @docs-group-description PropertyGrid\r\n * Classes and components for working with a PropertyGrid.\r\n */\r\n/**\r\n * @docs-group-description Table\r\n * Classes and components for working with a Table.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Functions and components that provide a Toolbar.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Classes and components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description TypeConverters\r\n * Classes for working with Type Converters.\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,2EAAyD;AACzD,+EAA6D;AAC7D,oFAAkE;AAClE,kFAAgE;AAEhE,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,oFAAkE;AAClE,kFAAgE;AAChE,kFAAgE;AAChE,0EAAwD;AACxD,mFAAiE;AACjE,sEAAoD;AAEpD,8EAA4D;AAC5D,qFAAmE;AACnE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,yFAAuE;AACvE,gGAA8E;AAC9E,qFAAmE;AACnE,mFAAiE;AACjE,oFAAkE;AAClE,uFAAqE;AAErE,0FAAwE;AAExE,0EAAwD;AACxD,2EAAyD;AACzD,sFAAoE;AACpE,8EAA4D;AAC5D,0EAAwD;AAExD,2EAAyD;AACzD,gFAA8D;AAC9D,4EAA0D;AAC1D,6EAA2D;AAC3D,mFAAiE;AACjE,wEAAsD;AACtD,wEAAsD;AACtD,iFAA+D;AAC/D,gFAA8D;AAC9D,mFAAiE;AACjE,0EAAwD;AACxD,wEAAsD;AACtD,4EAA0D;AAC1D,8EAA4D;AAC5D,0EAAwD;AAExD,yFAAuE;AACvE,mFAAiE;AAEjE,8EAA4D;AAC5D,8EAA4D;A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AA4E;AAC5E,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\r\n\r\nexport { UiComponents } from \"./components-react/UiComponents\";\r\n\r\nexport * from \"./components-react/breadcrumb/Breadcrumb\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbPath\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbTreeUtils\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbDetails\";\r\n\r\nexport * from \"./components-react/common/Links\";\r\nexport * from \"./components-react/common/PageOptions\";\r\nexport * from \"./components-react/common/selection/SelectionModes\";\r\nexport * from \"./components-react/common/HighlightingComponentProps\";\r\nexport * from \"./components-react/common/HighlightedText\";\r\nexport * from \"./components-react/common/IImageLoader\";\r\nexport * from \"./components-react/common/selection/SelectionHandler\";\r\nexport * from \"./components-react/common/showhide/ShowHideDialog\";\r\nexport * from \"./components-react/common/showhide/ShowHideItem\";\r\nexport * from \"./components-react/common/showhide/ShowHideMenu\";\r\nexport * from \"./components-react/common/UseAsyncValue\";\r\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\r\nexport * from \"./components-react/common/DateUtils\";\r\n\r\nexport * from \"./components-react/converters/TypeConverter\";\r\nexport * from \"./components-react/converters/TypeConverterManager\";\r\nexport * from \"./components-react/converters/BooleanTypeConverter\";\r\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\r\nexport * from \"./components-react/converters/EnumTypeConverter\";\r\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\r\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\r\nexport * from \"./components-react/converters/NumericTypeConverter\";\r\nexport * from \"./components-react/converters/PointTypeConverter\";\r\nexport * from \"./components-react/converters/StringTypeConverter\";\r\nexport * from \"./components-react/converters/CompositeTypeConverter\";\r\n\r\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\r\n\r\nexport * from \"./components-react/datepicker/DateField\";\r\nexport * from \"./components-react/datepicker/DatePicker\";\r\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\r\nexport * from \"./components-react/datepicker/IntlFormatter\";\r\nexport * from \"./components-react/datepicker/TimeField\";\r\n\r\nexport * from \"./components-react/editors/BooleanEditor\";\r\nexport * from \"./components-react/editors/CustomNumberEditor\";\r\nexport * from \"./components-react/editors/DateTimeEditor\";\r\nexport * from \"./components-react/editors/EditorContainer\";\r\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\r\nexport * from \"./components-react/editors/EnumEditor\";\r\nexport * from \"./components-react/editors/IconEditor\";\r\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\r\nexport * from \"./components-react/editors/NumericInputEditor\";\r\nexport * from \"./components-react/editors/PropertyEditorManager\";\r\nexport * from \"./components-react/editors/SliderEditor\";\r\nexport * from \"./components-react/editors/TextEditor\";\r\nexport * from \"./components-react/editors/TextareaEditor\";\r\nexport * from \"./components-react/editors/ThemedEnumEditor\";\r\nexport * from \"./components-react/editors/ToggleEditor\";\r\n\r\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\r\nexport * from \"./components-react/favorite/FavoritePropertyList\";\r\n\r\nexport * from \"./components-react/filtering/FilteringInput\";\r\nexport * from \"./components-react/filtering/ResultSelector\";\r\n\r\nexport * from \"./components-react/iconpicker/IconPickerButton\";\r\n\r\nexport * from \"./components-react/inputs/ParsedInput\";\r\n\r\nexport * from \"./components-react/properties/LinkHandler\";\r\nexport * from \"./components-react/properties/ValueRendererManager\";\r\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyView\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\r\n\r\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\r\n\r\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\r\nexport * from \"./components-react/properties/ItemStyle\";\r\n\r\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\r\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\r\nexport * from \"./components-react/propertygrid/component/PropertyList\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\r\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\r\n\r\nexport * from \"./components-react/selectable-content/SelectableContent\";\r\n\r\nexport * from \"./components-react/table/TableDataProvider\";\r\nexport * from \"./components-react/table/SimpleTableDataProvider\";\r\nexport * from \"./components-react/table/columnfiltering/ColumnFiltering\";\r\nexport * from \"./components-react/table/columnfiltering/TableFilterDescriptorCollection\";\r\nexport * from \"./components-react/table/component/Table\";\r\nexport * from \"./components-react/table/component/TableCell\";\r\nexport * from \"./components-react/table/component/TableColumn\";\r\nexport * from \"./components-react/table/component/dragdrop/BeDragDropContext\";\r\n\r\nexport * from \"./components-react/toolbar/Toolbar\";\r\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\r\nexport * from \"./components-react/toolbar/PopupItem\";\r\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\r\nexport * from \"./components-react/toolbar/Item\";\r\nexport * from \"./components-react/toolbar/utilities/Direction\";\r\n\r\nexport * from \"./components-react/tree/TreeDataProvider\";\r\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\r\nexport * from \"./components-react/tree/HighlightingEngine\";\r\nexport * from \"./components-react/tree/ImageLoader\";\r\nexport * from \"./components-react/tree/controlled/TreeActions\";\r\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\r\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\r\nexport * from \"./components-react/tree/controlled/TreeEvents\";\r\nexport * from \"./components-react/tree/controlled/TreeModel\";\r\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\r\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\r\nexport * from \"./components-react/tree/controlled/Observable\";\r\nexport * from \"./components-react/tree/controlled/TreeHooks\";\r\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\r\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\r\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\r\n\r\n/** @docs-package-description\r\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\r\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description Breadcrumb\r\n * Classes and components for working with a Breadcrumb.\r\n * As of version 3.0, the Breadcrumb is deprecated.\r\n */\r\n/**\r\n * @docs-group-description Date\r\n * Classes, interfaces, and components for showing and setting date and time.\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes and Higher Order Components for working with the DragDrop API.\r\n */\r\n/**\r\n * @docs-group-description Favorite\r\n * Classes and components for displaying favorite properties.\r\n */\r\n/**\r\n * @docs-group-description Filtering\r\n * Classes and components for working with filtering.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Input Components that format and parse input.\r\n */\r\n/**\r\n * @docs-group-description SelectableContent\r\n * Classes and components for working with SelectableContent component.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes and components for working with Properties.\r\n */\r\n/**\r\n * @docs-group-description PropertyEditors\r\n * Classes and components for working with Property Editors.\r\n */\r\n/**\r\n * @docs-group-description PropertyGrid\r\n * Classes and components for working with a PropertyGrid.\r\n */\r\n/**\r\n * @docs-group-description Table\r\n * Classes and components for working with a Table.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Functions and components that provide a Toolbar.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Classes and components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description TypeConverters\r\n * Classes for working with Type Converters.\r\n */\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeConverter.d.ts","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimeTypeConverter.d.ts","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAqB,WAAW,EAAE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AO;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;CACtC;AAGD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,yBAAyB;IAClE,SAAS,CAAC,aAAa,IAAI,UAAU;CACtC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from "@itwin/core-bentley";
|
|
2
1
|
/*---------------------------------------------------------------------------------------------
|
|
3
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -6,6 +5,7 @@ import { Logger } from "@itwin/core-bentley";
|
|
|
6
5
|
/** @packageDocumentation
|
|
7
6
|
* @module TypeConverters
|
|
8
7
|
*/
|
|
8
|
+
import { Logger } from "@itwin/core-bentley";
|
|
9
9
|
import { AlternateDateFormats, StandardTypeNames, TimeDisplay } from "@itwin/appui-abstract";
|
|
10
10
|
import { TimeFormat } from "@itwin/core-react";
|
|
11
11
|
import { formatInputDate } from "../datepicker/DateField";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAc,iBAAiB,EAAE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AAC,MAAY,EAAE,MAAY;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;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IACzD,aAAa,KAAiB,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CACnE;AACD,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,yBAAyB;IACxD,aAAa,KAAiB,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;CAClE;AACD,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { Logger } from \"@itwin/core-bentley\";\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module TypeConverters\r\n */\r\n\r\nimport { AlternateDateFormats, Primitives, StandardTypeNames, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { TimeFormat } from \"@itwin/core-react\";\r\nimport { formatInputDate } from \"../datepicker/DateField\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport { LessGreaterOperatorProcessor, TypeConverter } from \"./TypeConverter\";\r\nimport { TypeConverterManager } from \"./TypeConverterManager\";\r\nimport { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\r\n\r\n// cSpell:ignore datepicker valuetypes\r\n\r\n/**\r\n * DateTime Type Converter.\r\n * @public\r\n */\r\nexport abstract class DateTimeTypeConverterBase extends TypeConverter implements LessGreaterOperatorProcessor {\r\n public override convertToString(value?: Primitives.Value) {\r\n if (value === undefined)\r\n return \"\";\r\n\r\n if (typeof value === \"string\")\r\n value = new Date(value);\r\n\r\n // istanbul ignore else\r\n if (value instanceof Date) {\r\n switch (this.getTimeFormat()) {\r\n case TimeFormat.Short: return value.toLocaleDateString();\r\n case TimeFormat.Long: return value.toLocaleString();\r\n }\r\n return value.toISOString();\r\n }\r\n\r\n // istanbul ignore next\r\n return value.toString();\r\n }\r\n\r\n public static isValidTimeDisplay(type: TimeDisplay): boolean {\r\n return Object.keys(TimeDisplay).some((key) => (TimeDisplay as any)[key] === type);\r\n }\r\n\r\n public static isAlternateDateFormats(type: AlternateDateFormats): boolean {\r\n return Object.keys(AlternateDateFormats).some((key) => (AlternateDateFormats as any)[key] === type);\r\n }\r\n\r\n // supported options:\r\n // timeDisplay?: TimeDisplay\r\n // alternateDateFormat?: AlternateDateFormats\r\n public override convertToStringWithOptions(value?: Primitives.Value, options?: { [key: string]: any }): string | Promise<string> {\r\n if (value === undefined)\r\n return \"\";\r\n\r\n if (options) {\r\n let timeDisplay: TimeDisplay | undefined = (this.getTimeFormat() === TimeFormat.Long) ? TimeDisplay.H12MC : undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options && DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n\r\n if (this.getTimeFormat() === TimeFormat.Long) {\r\n // istanbul ignore else\r\n if (\"timeDisplay\" in options) {\r\n // istanbul ignore if\r\n if (alternateDateFormat) {\r\n Logger.logInfo(UiComponents.loggerCategory(this), `Invalid specification of timeDisplay with alternateDateFormat specification`);\r\n } else {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isValidTimeDisplay(options.timeDisplay))\r\n timeDisplay = options.timeDisplay;\r\n }\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (typeof value === \"string\") {\r\n value = new Date(value); // this value will be based on local time zone\r\n // istanbul ignore else\r\n if (value instanceof Date && alternateDateFormat) {\r\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\r\n value = adjustDateToTimezone(value, value.getTimezoneOffset() * -1);\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (value instanceof Date) {\r\n // Ensure if alternateDateFormat is specified make sure it matches proper Long/Short format.\r\n if (this.getTimeFormat() === TimeFormat.Long) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort)\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort)\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n } else {\r\n // short time format\r\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\r\n alternateDateFormat = AlternateDateFormats.IsoShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\r\n alternateDateFormat = AlternateDateFormats.UtcShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\r\n }\r\n\r\n const formattedDateTime = formatInputDate(value, timeDisplay, undefined, alternateDateFormat);\r\n // istanbul ignore else\r\n if (formattedDateTime)\r\n return formattedDateTime;\r\n }\r\n }\r\n\r\n return this.convertToString(value);\r\n }\r\n\r\n /** Default implementation just calls convertFromString with no options */\r\n public override convertFromStringWithOptions(value: string, options?: { [key: string]: any }): ConvertedPrimitives.Value | undefined | Promise<ConvertedPrimitives.Value | undefined> {\r\n if (!value)\r\n return undefined;\r\n\r\n if (options) {\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options && DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n\r\n // istanbul ignore else\r\n let date = new Date(value); // this value will be based on local time zone\r\n // istanbul ignore else\r\n if (date instanceof Date && alternateDateFormat) {\r\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\r\n date = adjustDateToTimezone(date, date.getTimezoneOffset() * -1);\r\n }\r\n }\r\n\r\n return this.convertFromString(value);\r\n }\r\n\r\n private isDateValid(date: Date) {\r\n return date instanceof Date && !isNaN(+date);\r\n }\r\n\r\n public override convertFromString(value: string) {\r\n if (!value)\r\n return undefined;\r\n\r\n const dateValue = new Date(value);\r\n\r\n if (!this.isDateValid(dateValue))\r\n return undefined;\r\n\r\n return dateValue;\r\n }\r\n\r\n protected abstract getTimeFormat(): TimeFormat;\r\n\r\n public override get isLessGreaterType(): boolean { return true; }\r\n\r\n public sortCompare(valueA: Date, valueB: Date, _ignoreCase?: boolean): number {\r\n return valueA.valueOf() - valueB.valueOf();\r\n }\r\n\r\n public override isEqualTo(valueA: Date, valueB: Date): boolean {\r\n return valueA.valueOf() === valueB.valueOf();\r\n }\r\n\r\n public override isNotEqualTo(valueA: Date, valueB: Date): boolean {\r\n return valueA.valueOf() !== valueB.valueOf();\r\n }\r\n\r\n public isLessThan(a: Date, b: Date): boolean {\r\n return a.valueOf() < b.valueOf();\r\n }\r\n\r\n public isLessThanOrEqualTo(a: Date, b: Date): boolean {\r\n return a.valueOf() <= b.valueOf();\r\n }\r\n\r\n public isGreaterThan(a: Date, b: Date): boolean {\r\n return a.valueOf() > b.valueOf();\r\n }\r\n\r\n public isGreaterThanOrEqualTo(a: Date, b: Date): boolean {\r\n return a.valueOf() >= b.valueOf();\r\n }\r\n}\r\n\r\n/**\r\n * Short Date Type Converter.\r\n * @public\r\n */\r\nexport class ShortDateTypeConverter extends DateTimeTypeConverterBase {\r\n protected getTimeFormat(): TimeFormat { return TimeFormat.Short; }\r\n}\r\nTypeConverterManager.registerConverter(StandardTypeNames.ShortDate, ShortDateTypeConverter);\r\n\r\n/**\r\n * Date Time Type Converter.\r\n * @public\r\n */\r\nexport class DateTimeTypeConverter extends DateTimeTypeConverterBase {\r\n protected getTimeFormat(): TimeFormat { return TimeFormat.Long; }\r\n}\r\nTypeConverterManager.registerConverter(StandardTypeNames.DateTime, DateTimeTypeConverter);\r\n"]}
|
|
1
|
+
{"version":3,"file":"DateTimeTypeConverter.js","sourceRoot":"","sources":["../../../../src/components-react/converters/DateTimeTypeConverter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAc,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAgC,a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O;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;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IACzD,aAAa,KAAiB,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CACnE;AACD,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,yBAAyB;IACxD,aAAa,KAAiB,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;CAClE;AACD,oBAAoB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module TypeConverters\r\n */\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { AlternateDateFormats, Primitives, StandardTypeNames, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { TimeFormat } from \"@itwin/core-react\";\r\nimport { formatInputDate } from \"../datepicker/DateField\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport { LessGreaterOperatorProcessor, TypeConverter } from \"./TypeConverter\";\r\nimport { TypeConverterManager } from \"./TypeConverterManager\";\r\nimport { ConvertedPrimitives } from \"./valuetypes/ConvertedTypes\";\r\n\r\n// cSpell:ignore datepicker valuetypes\r\n\r\n/**\r\n * DateTime Type Converter.\r\n * @public\r\n */\r\nexport abstract class DateTimeTypeConverterBase extends TypeConverter implements LessGreaterOperatorProcessor {\r\n public override convertToString(value?: Primitives.Value) {\r\n if (value === undefined)\r\n return \"\";\r\n\r\n if (typeof value === \"string\")\r\n value = new Date(value);\r\n\r\n // istanbul ignore else\r\n if (value instanceof Date) {\r\n switch (this.getTimeFormat()) {\r\n case TimeFormat.Short: return value.toLocaleDateString();\r\n case TimeFormat.Long: return value.toLocaleString();\r\n }\r\n return value.toISOString();\r\n }\r\n\r\n // istanbul ignore next\r\n return value.toString();\r\n }\r\n\r\n public static isValidTimeDisplay(type: TimeDisplay): boolean {\r\n return Object.keys(TimeDisplay).some((key) => (TimeDisplay as any)[key] === type);\r\n }\r\n\r\n public static isAlternateDateFormats(type: AlternateDateFormats): boolean {\r\n return Object.keys(AlternateDateFormats).some((key) => (AlternateDateFormats as any)[key] === type);\r\n }\r\n\r\n // supported options:\r\n // timeDisplay?: TimeDisplay\r\n // alternateDateFormat?: AlternateDateFormats\r\n public override convertToStringWithOptions(value?: Primitives.Value, options?: { [key: string]: any }): string | Promise<string> {\r\n if (value === undefined)\r\n return \"\";\r\n\r\n if (options) {\r\n let timeDisplay: TimeDisplay | undefined = (this.getTimeFormat() === TimeFormat.Long) ? TimeDisplay.H12MC : undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options && DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n\r\n if (this.getTimeFormat() === TimeFormat.Long) {\r\n // istanbul ignore else\r\n if (\"timeDisplay\" in options) {\r\n // istanbul ignore if\r\n if (alternateDateFormat) {\r\n Logger.logInfo(UiComponents.loggerCategory(this), `Invalid specification of timeDisplay with alternateDateFormat specification`);\r\n } else {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isValidTimeDisplay(options.timeDisplay))\r\n timeDisplay = options.timeDisplay;\r\n }\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (typeof value === \"string\") {\r\n value = new Date(value); // this value will be based on local time zone\r\n // istanbul ignore else\r\n if (value instanceof Date && alternateDateFormat) {\r\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\r\n value = adjustDateToTimezone(value, value.getTimezoneOffset() * -1);\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (value instanceof Date) {\r\n // Ensure if alternateDateFormat is specified make sure it matches proper Long/Short format.\r\n if (this.getTimeFormat() === TimeFormat.Long) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort)\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort)\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n } else {\r\n // short time format\r\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\r\n alternateDateFormat = AlternateDateFormats.IsoShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\r\n alternateDateFormat = AlternateDateFormats.UtcShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\r\n }\r\n\r\n const formattedDateTime = formatInputDate(value, timeDisplay, undefined, alternateDateFormat);\r\n // istanbul ignore else\r\n if (formattedDateTime)\r\n return formattedDateTime;\r\n }\r\n }\r\n\r\n return this.convertToString(value);\r\n }\r\n\r\n /** Default implementation just calls convertFromString with no options */\r\n public override convertFromStringWithOptions(value: string, options?: { [key: string]: any }): ConvertedPrimitives.Value | undefined | Promise<ConvertedPrimitives.Value | undefined> {\r\n if (!value)\r\n return undefined;\r\n\r\n if (options) {\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options && DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n\r\n // istanbul ignore else\r\n let date = new Date(value); // this value will be based on local time zone\r\n // istanbul ignore else\r\n if (date instanceof Date && alternateDateFormat) {\r\n // alternateDateFormat displays UTC time, so assume string is specifying UTC Date and Time\r\n date = adjustDateToTimezone(date, date.getTimezoneOffset() * -1);\r\n }\r\n }\r\n\r\n return this.convertFromString(value);\r\n }\r\n\r\n private isDateValid(date: Date) {\r\n return date instanceof Date && !isNaN(+date);\r\n }\r\n\r\n public override convertFromString(value: string) {\r\n if (!value)\r\n return undefined;\r\n\r\n const dateValue = new Date(value);\r\n\r\n if (!this.isDateValid(dateValue))\r\n return undefined;\r\n\r\n return dateValue;\r\n }\r\n\r\n protected abstract getTimeFormat(): TimeFormat;\r\n\r\n public override get isLessGreaterType(): boolean { return true; }\r\n\r\n public sortCompare(valueA: Date, valueB: Date, _ignoreCase?: boolean): number {\r\n return valueA.valueOf() - valueB.valueOf();\r\n }\r\n\r\n public override isEqualTo(valueA: Date, valueB: Date): boolean {\r\n return valueA.valueOf() === valueB.valueOf();\r\n }\r\n\r\n public override isNotEqualTo(valueA: Date, valueB: Date): boolean {\r\n return valueA.valueOf() !== valueB.valueOf();\r\n }\r\n\r\n public isLessThan(a: Date, b: Date): boolean {\r\n return a.valueOf() < b.valueOf();\r\n }\r\n\r\n public isLessThanOrEqualTo(a: Date, b: Date): boolean {\r\n return a.valueOf() <= b.valueOf();\r\n }\r\n\r\n public isGreaterThan(a: Date, b: Date): boolean {\r\n return a.valueOf() > b.valueOf();\r\n }\r\n\r\n public isGreaterThanOrEqualTo(a: Date, b: Date): boolean {\r\n return a.valueOf() >= b.valueOf();\r\n }\r\n}\r\n\r\n/**\r\n * Short Date Type Converter.\r\n * @public\r\n */\r\nexport class ShortDateTypeConverter extends DateTimeTypeConverterBase {\r\n protected getTimeFormat(): TimeFormat { return TimeFormat.Short; }\r\n}\r\nTypeConverterManager.registerConverter(StandardTypeNames.ShortDate, ShortDateTypeConverter);\r\n\r\n/**\r\n * Date Time Type Converter.\r\n * @public\r\n */\r\nexport class DateTimeTypeConverter extends DateTimeTypeConverterBase {\r\n protected getTimeFormat(): TimeFormat { return TimeFormat.Long; }\r\n}\r\nTypeConverterManager.registerConverter(StandardTypeNames.DateTime, DateTimeTypeConverter);\r\n"]}
|
|
@@ -125,6 +125,6 @@ export function DateField({ initialDate, onDateChange, readOnly, dateFormatter,
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
const classNames = classnames(className, "components-date-input", hasBadInput && "components-date-has-error");
|
|
128
|
-
return React.createElement(Input, { "data-testid": "components-date-input", style: style, className: classNames, onKeyDown: onInputKeyDown, onBlur: handleOnBlur, onChange: handleInputChange, value: inputValue, disabled: readOnly || (dateFormatter && !(dateFormatter.parseDate)) });
|
|
128
|
+
return React.createElement(Input, { "data-testid": "components-date-input", style: style, className: classNames, onKeyDown: onInputKeyDown, onBlur: handleOnBlur, onChange: handleInputChange, value: inputValue, disabled: readOnly || (dateFormatter && !(dateFormatter.parseDate)), size: "small" });
|
|
129
129
|
}
|
|
130
130
|
//# sourceMappingURL=DateField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DateField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,O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,CAAC,CAAC;IAC9G,OAAO,oBAAC,KAAK,mBAAa,uBAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EACpI,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,GAAI,CAAC;AAC5H,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport \"./DateField.scss\";\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { AlternateDateFormats, DateFormatter, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\n\r\n/** Props for [[DateField]] Component.\r\n * @internal\r\n */\r\nexport interface DateFieldProps extends CommonProps {\r\n /** Defines initial date and time for component. */\r\n initialDate: Date;\r\n /** Function to call when the date or time is changed. */\r\n onDateChange?: (day: Date) => void;\r\n /** Optional value to define if edit field allows editing. If a DateFormatter is provided\r\n * it must provide a parseData function or the field will be read only no matter the setting of this value. */\r\n readOnly?: boolean;\r\n /** Optional date formatter that produces an explicit date display */\r\n dateFormatter?: DateFormatter;\r\n /** This property has two purposes, the first is specify that the display of time is desired and the second is to define the format of the time display. */\r\n timeDisplay?: TimeDisplay;\r\n}\r\n\r\n/** Function to format a Date object that is used in control, type editor, and type converter\r\n * to produce a consistent formatted Date string.\r\n * @internal\r\n */\r\nexport function formatInputDate(inputDate: Date, timeDisplay?: TimeDisplay, customFormatter?: DateFormatter, alternateDateFormat?: AlternateDateFormats): string | undefined {\r\n if (customFormatter) {\r\n return customFormatter.formateDate(inputDate);\r\n }\r\n\r\n if (alternateDateFormat) {\r\n switch (alternateDateFormat) {\r\n case AlternateDateFormats.IsoDateTime:\r\n return inputDate.toISOString();\r\n case AlternateDateFormats.IsoShort:\r\n return inputDate.toISOString().slice(0, 10);\r\n case AlternateDateFormats.UtcDateTime:\r\n return inputDate.toUTCString().slice(5);\r\n case AlternateDateFormats.UtcShort:\r\n return inputDate.toUTCString().slice(5, 16);\r\n case AlternateDateFormats.UtcDateTimeWithDay:\r\n return inputDate.toUTCString();\r\n case AlternateDateFormats.UtcShortWithDay:\r\n return inputDate.toUTCString().slice(0, 16);\r\n }\r\n } else {\r\n const dateString = inputDate.toLocaleDateString(undefined, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\r\n let timeString: string = \"\";\r\n\r\n if (timeDisplay) {\r\n switch (timeDisplay) {\r\n case TimeDisplay.H12MC:\r\n timeString = inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\" });\r\n break;\r\n case TimeDisplay.H12MSC:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n break;\r\n case TimeDisplay.H24M:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00\")\r\n timeString = \"00:00\";\r\n break;\r\n case TimeDisplay.H24MS:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00:00\")\r\n timeString = \"00:00:00\";\r\n break;\r\n }\r\n }\r\n return timeString.length ? `${dateString}, ${timeString}` : dateString;\r\n }\r\n}\r\n\r\n/** Date input component. This component is typically used by the [[DatePickerPopupButton]] to display and edit date and time.\r\n * @internal\r\n */\r\nexport function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className }: DateFieldProps) {\r\n const initialDateRef = React.useRef(initialDate);\r\n const [hasBadInput, setHasBadInput] = React.useState(false);\r\n const [inputValue, setInputValue] = React.useState(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n\r\n // See if new initialDate props have changed since component mounted\r\n React.useEffect(() => {\r\n // istanbul ignore else\r\n if (initialDate.getTime() !== initialDateRef.current.getTime()) {\r\n initialDateRef.current = initialDate;\r\n }\r\n setInputValue(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n }, [initialDate, dateFormatter, timeDisplay]);\r\n\r\n const handleInputChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setInputValue(event.currentTarget.value);\r\n }, []);\r\n\r\n const parseDate = React.useCallback((dateString: string) => {\r\n try {\r\n if (dateFormatter && dateFormatter.parseDate)\r\n return dateFormatter.parseDate(dateString);\r\n\r\n const newDateValue = Date.parse(dateString);\r\n // istanbul ignore else\r\n if (newDateValue)\r\n return new Date(newDateValue);\r\n } catch (_error) /* istanbul ignore next */ {\r\n Logger.logInfo(\"DateField\", `Encountered error parsing input value '${dateString}' as a date.`);\r\n return undefined;\r\n }\r\n // istanbul ignore next\r\n return undefined;\r\n }, [dateFormatter]);\r\n\r\n const updateInputDate = React.useCallback((dateString: string) => {\r\n try {\r\n const newDateValue = parseDate(dateString);\r\n if (newDateValue) {\r\n const newDate = new Date(newDateValue);\r\n onDateChange && onDateChange(newDate);\r\n setHasBadInput(false);\r\n } else {\r\n setHasBadInput(true);\r\n }\r\n } catch (_error) {\r\n // istanbul ignore next\r\n setHasBadInput(true);\r\n }\r\n }, [onDateChange, parseDate]);\r\n\r\n const handleOnBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n updateInputDate(event.target.value);\r\n }, [updateInputDate]);\r\n\r\n function onInputKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\r\n // istanbul ignore else\r\n if (event.key === \"Enter\") {\r\n updateInputDate(event.currentTarget.value);\r\n event.preventDefault();\r\n }\r\n }\r\n const classNames = classnames(className, \"components-date-input\", hasBadInput && \"components-date-has-error\");\r\n return <Input data-testid=\"components-date-input\" style={style} className={classNames} onKeyDown={onInputKeyDown} onBlur={handleOnBlur}\r\n onChange={handleInputChange} value={inputValue} disabled={readOnly || (dateFormatter && !(dateFormatter.parseDate))} />;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DateField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/DateField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAiB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAmB7C;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAe,EAAE,WAAyB,EAAE,eAA+B,EAAE,mBAA0C;IACrJ,IAAI,eAAe,EAAE;QACnB,OAAO,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/C;IAED,IAAI,mBAAmB,EAAE;QACvB,QAAQ,mBAAmB,EAAE;YAC3B,KAAK,oBAAoB,CAAC,WAAW;gBACnC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,oBAAoB,CAAC,QAAQ;gBAChC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,KAAK,oBAAoB,CAAC,WAAW;gBACnC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC1C,KAAK,oBAAoB,CA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,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAyC,EAAE,EAAE;QACnF,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,SAAS,cAAc,CAAC,KAA4C;QAClE,uBAAuB;QACvB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACzB,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC3C,KAAK,CAAC,cAAc,EAAE,CAAC;SACxB;IACH,CAAC;IACD,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE,uBAAuB,EAAE,WAAW,IAAI,2BAA2B,CAAC,CAAC;IAC9G,OAAO,oBAAC,KAAK,mBAAa,uBAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EACpI,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC;AACzI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport \"./DateField.scss\";\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { AlternateDateFormats, DateFormatter, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\n\r\n/** Props for [[DateField]] Component.\r\n * @internal\r\n */\r\nexport interface DateFieldProps extends CommonProps {\r\n /** Defines initial date and time for component. */\r\n initialDate: Date;\r\n /** Function to call when the date or time is changed. */\r\n onDateChange?: (day: Date) => void;\r\n /** Optional value to define if edit field allows editing. If a DateFormatter is provided\r\n * it must provide a parseData function or the field will be read only no matter the setting of this value. */\r\n readOnly?: boolean;\r\n /** Optional date formatter that produces an explicit date display */\r\n dateFormatter?: DateFormatter;\r\n /** This property has two purposes, the first is specify that the display of time is desired and the second is to define the format of the time display. */\r\n timeDisplay?: TimeDisplay;\r\n}\r\n\r\n/** Function to format a Date object that is used in control, type editor, and type converter\r\n * to produce a consistent formatted Date string.\r\n * @internal\r\n */\r\nexport function formatInputDate(inputDate: Date, timeDisplay?: TimeDisplay, customFormatter?: DateFormatter, alternateDateFormat?: AlternateDateFormats): string | undefined {\r\n if (customFormatter) {\r\n return customFormatter.formateDate(inputDate);\r\n }\r\n\r\n if (alternateDateFormat) {\r\n switch (alternateDateFormat) {\r\n case AlternateDateFormats.IsoDateTime:\r\n return inputDate.toISOString();\r\n case AlternateDateFormats.IsoShort:\r\n return inputDate.toISOString().slice(0, 10);\r\n case AlternateDateFormats.UtcDateTime:\r\n return inputDate.toUTCString().slice(5);\r\n case AlternateDateFormats.UtcShort:\r\n return inputDate.toUTCString().slice(5, 16);\r\n case AlternateDateFormats.UtcDateTimeWithDay:\r\n return inputDate.toUTCString();\r\n case AlternateDateFormats.UtcShortWithDay:\r\n return inputDate.toUTCString().slice(0, 16);\r\n }\r\n } else {\r\n const dateString = inputDate.toLocaleDateString(undefined, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\r\n let timeString: string = \"\";\r\n\r\n if (timeDisplay) {\r\n switch (timeDisplay) {\r\n case TimeDisplay.H12MC:\r\n timeString = inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\" });\r\n break;\r\n case TimeDisplay.H12MSC:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: true, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n break;\r\n case TimeDisplay.H24M:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00\")\r\n timeString = \"00:00\";\r\n break;\r\n case TimeDisplay.H24MS:\r\n timeString = (inputDate.toLocaleTimeString(undefined, { hour12: false, hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" }));\r\n // istanbul ignore next\r\n if (timeString === \"24:00:00\")\r\n timeString = \"00:00:00\";\r\n break;\r\n }\r\n }\r\n return timeString.length ? `${dateString}, ${timeString}` : dateString;\r\n }\r\n}\r\n\r\n/** Date input component. This component is typically used by the [[DatePickerPopupButton]] to display and edit date and time.\r\n * @internal\r\n */\r\nexport function DateField({ initialDate, onDateChange, readOnly, dateFormatter, timeDisplay, style, className }: DateFieldProps) {\r\n const initialDateRef = React.useRef(initialDate);\r\n const [hasBadInput, setHasBadInput] = React.useState(false);\r\n const [inputValue, setInputValue] = React.useState(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n\r\n // See if new initialDate props have changed since component mounted\r\n React.useEffect(() => {\r\n // istanbul ignore else\r\n if (initialDate.getTime() !== initialDateRef.current.getTime()) {\r\n initialDateRef.current = initialDate;\r\n }\r\n setInputValue(formatInputDate(initialDate, timeDisplay, dateFormatter));\r\n }, [initialDate, dateFormatter, timeDisplay]);\r\n\r\n const handleInputChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setInputValue(event.currentTarget.value);\r\n }, []);\r\n\r\n const parseDate = React.useCallback((dateString: string) => {\r\n try {\r\n if (dateFormatter && dateFormatter.parseDate)\r\n return dateFormatter.parseDate(dateString);\r\n\r\n const newDateValue = Date.parse(dateString);\r\n // istanbul ignore else\r\n if (newDateValue)\r\n return new Date(newDateValue);\r\n } catch (_error) /* istanbul ignore next */ {\r\n Logger.logInfo(\"DateField\", `Encountered error parsing input value '${dateString}' as a date.`);\r\n return undefined;\r\n }\r\n // istanbul ignore next\r\n return undefined;\r\n }, [dateFormatter]);\r\n\r\n const updateInputDate = React.useCallback((dateString: string) => {\r\n try {\r\n const newDateValue = parseDate(dateString);\r\n if (newDateValue) {\r\n const newDate = new Date(newDateValue);\r\n onDateChange && onDateChange(newDate);\r\n setHasBadInput(false);\r\n } else {\r\n setHasBadInput(true);\r\n }\r\n } catch (_error) {\r\n // istanbul ignore next\r\n setHasBadInput(true);\r\n }\r\n }, [onDateChange, parseDate]);\r\n\r\n const handleOnBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n updateInputDate(event.target.value);\r\n }, [updateInputDate]);\r\n\r\n function onInputKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\r\n // istanbul ignore else\r\n if (event.key === \"Enter\") {\r\n updateInputDate(event.currentTarget.value);\r\n event.preventDefault();\r\n }\r\n }\r\n const classNames = classnames(className, \"components-date-input\", hasBadInput && \"components-date-has-error\");\r\n return <Input data-testid=\"components-date-input\" style={style} className={classNames} onKeyDown={onInputKeyDown} onBlur={handleOnBlur}\r\n onChange={handleInputChange} value={inputValue} disabled={readOnly || (dateFormatter && !(dateFormatter.parseDate))} size=\"small\" />;\r\n}\r\n"]}
|
|
@@ -22,7 +22,7 @@ export interface TimeFieldProps {
|
|
|
22
22
|
onTimeChange?: (time: TimeSpec) => void;
|
|
23
23
|
readOnly?: boolean;
|
|
24
24
|
}
|
|
25
|
-
/** Field used to set the Hour:Minutes:Seconds in the [[
|
|
25
|
+
/** Field used to set the Hour:Minutes:Seconds in the [[DatePicker]] Popup panel. The user may key-in the value or use up/down keys to
|
|
26
26
|
* change the time.
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
@@ -25,7 +25,7 @@ function getValidInt(intText, min, max, defaultValue) {
|
|
|
25
25
|
function isSameTime(a, b) {
|
|
26
26
|
return a.hours === b.hours && a.minutes === b.minutes && a.seconds === b.seconds;
|
|
27
27
|
}
|
|
28
|
-
/** Field used to set the Hour:Minutes:Seconds in the [[
|
|
28
|
+
/** Field used to set the Hour:Minutes:Seconds in the [[DatePicker]] Popup panel. The user may key-in the value or use up/down keys to
|
|
29
29
|
* change the time.
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
@@ -213,14 +213,14 @@ export function TimeField({ time, timeDisplay, readOnly, onTimeChange }) {
|
|
|
213
213
|
}, [dayPeriodText, hours, timeSpec, updateTimeSpec]);
|
|
214
214
|
const showSeconds = -1 !== timeDisplay.search(":ss");
|
|
215
215
|
return React.createElement("div", { "data-testid": "components-time-input", className: "components-time" },
|
|
216
|
-
React.createElement(Input, { className: "components-time-input", onKeyDown: handleHoursOnKeyDown, onBlur: handleHoursOnBlur, onChange: handleHoursChange, value: hoursText, disabled: readOnly }),
|
|
216
|
+
React.createElement(Input, { className: "components-time-input", onKeyDown: handleHoursOnKeyDown, onBlur: handleHoursOnBlur, onChange: handleHoursChange, value: hoursText, disabled: readOnly, size: "small" }),
|
|
217
217
|
React.createElement("span", { className: "component-time-separator" }, ":"),
|
|
218
|
-
React.createElement(Input, { className: "components-time-input", onKeyDown: handleMinutesOnKeyDown, onBlur: handleMinutesOnBlur, onChange: handleMinutesChange, value: minutesText, disabled: readOnly }),
|
|
218
|
+
React.createElement(Input, { className: "components-time-input", onKeyDown: handleMinutesOnKeyDown, onBlur: handleMinutesOnBlur, onChange: handleMinutesChange, value: minutesText, disabled: readOnly, size: "small" }),
|
|
219
219
|
showSeconds &&
|
|
220
220
|
React.createElement(React.Fragment, null,
|
|
221
221
|
React.createElement("span", { className: "component-time-separator" }, ":"),
|
|
222
|
-
React.createElement(Input, { className: "components-time-input", onKeyDown: handleSecondsOnKeyDown, onBlur: handleSecondsOnBlur, onChange: handleSecondsChange, value: secondsText, disabled: readOnly })),
|
|
222
|
+
React.createElement(Input, { className: "components-time-input", onKeyDown: handleSecondsOnKeyDown, onBlur: handleSecondsOnBlur, onChange: handleSecondsChange, value: secondsText, disabled: readOnly, size: "small" })),
|
|
223
223
|
dayPeriodText &&
|
|
224
|
-
React.createElement(Input, { className: "components-time-period-input", onKeyDown: handleDayPeriodOnKeyDown, onBlur: handleDayPeriodOnBlur, onChange: handleDayPeriodChange, value: dayPeriodText, disabled: readOnly }));
|
|
224
|
+
React.createElement(Input, { className: "components-time-period-input", onKeyDown: handleDayPeriodOnKeyDown, onBlur: handleDayPeriodOnBlur, onChange: handleDayPeriodChange, value: dayPeriodText, disabled: readOnly, size: "small" }));
|
|
225
225
|
}
|
|
226
226
|
//# sourceMappingURL=TimeField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/TimeField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,kBAAkB,CAAC;AAsB1B,SAAS,WAAW,CAAC,OAAe,EAAE,GAAW,EAAE,GAAW,EAAE,YAAoB;IAClF,IAAI;QACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,QAAQ,IAAI,GAAG,IAAI,QAAQ,IAAI,GAAG;YACpC,OAAO,QAAQ,CAAC;KACnB;IAAC,OAAO,EAAE,EAAE;QACX,uBAAuB;QACvB,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,UAAU,CAAC,CAAW,EAAE,CAAW;IAC1C,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,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G,CAAC,CAAC,KAAM,WAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjE,OAAO,4CAAiB,uBAAuB,EAAC,SAAS,EAAC,iBAAiB;QACzE,oBAAC,KAAK,IAAC,SAAS,EAAC,uBAAuB,EAAC,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAI;QAC1K,8BAAM,SAAS,EAAC,0BAA0B,QAAS;QACnD,oBAAC,KAAK,IAAC,SAAS,EAAC,uBAAuB,EAAC,SAAS,EAAE,sBAAsB,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAI;QACjL,WAAW;YACV;gBACE,8BAAM,SAAS,EAAC,0BAA0B,QAAS;gBACnD,oBAAC,KAAK,IAAC,SAAS,EAAC,uBAAuB,EAAC,SAAS,EAAE,sBAAsB,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACjL;QAEJ,aAAa;YACZ,oBAAC,KAAK,IAAC,SAAS,EAAC,8BAA8B,EAAC,SAAS,EAAE,wBAAwB,EAAE,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAE/L,CAAC;AACT,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { SpecialKey, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport \"./TimeField.scss\";\r\n\r\n/** Interface used to hold 24 hour time in\r\n * hours, minutes, and seconds.\r\n * @internal\r\n */\r\nexport interface TimeSpec {\r\n hours: number;\r\n minutes: number;\r\n seconds: number;\r\n}\r\n\r\n/** Interface for props used by [[TimeField]] component.\r\n * @internal\r\n */\r\nexport interface TimeFieldProps {\r\n time: TimeSpec;\r\n timeDisplay: TimeDisplay;\r\n onTimeChange?: (time: TimeSpec) => void;\r\n readOnly?: boolean;\r\n}\r\n\r\nfunction getValidInt(intText: string, min: number, max: number, defaultValue: number) {\r\n try {\r\n const newValue = parseInt(intText, 10);\r\n if (newValue >= min && newValue <= max)\r\n return newValue;\r\n } catch (_e) {\r\n // istanbul ignore next\r\n return defaultValue;\r\n }\r\n return defaultValue;\r\n}\r\n\r\nfunction isSameTime(a: TimeSpec, b: TimeSpec) {\r\n return a.hours === b.hours && a.minutes === b.minutes && a.seconds === b.seconds;\r\n}\r\n\r\n/** Field used to set the Hour:Minutes:Seconds in the [[DataPicker]] Popup panel. The user may key-in the value or use up/down keys to\r\n * change the time.\r\n * @internal\r\n */\r\nexport function TimeField({ time, timeDisplay, readOnly, onTimeChange }: TimeFieldProps) {\r\n const initialDateRef = React.useRef(time);\r\n const amLabelRef = React.useRef(UiComponents.translate(\"timepicker.day-period-am\"));\r\n const pmLabelRef = React.useRef(UiComponents.translate(\"timepicker.day-period-pm\"));\r\n const [timeSpec, setTimeSpec] = React.useState(time);\r\n const { hours, minutes, seconds } = timeSpec;\r\n const showDayPeriod = -1 !== (timeDisplay as string).search(\"aa\");\r\n\r\n const getDisplayHours = React.useCallback((timeHours: number) => {\r\n if (!showDayPeriod) {\r\n return timeHours;\r\n }\r\n const outHours = (0 === timeHours) ? 12 : timeHours > 12 ? timeHours - 12 : timeHours;\r\n return outHours;\r\n }, [showDayPeriod]);\r\n\r\n // See if new initialDate props have changed since component mounted\r\n React.useEffect(() => {\r\n if (!isSameTime(time, initialDateRef.current)) {\r\n setTimeSpec(time);\r\n initialDateRef.current = time;\r\n }\r\n }, [time]);\r\n\r\n const displayHour = getDisplayHours(hours);\r\n const [dayPeriodText, setDayPeriodText] = React.useState(showDayPeriod ? (hours >= 12 ? pmLabelRef.current : amLabelRef.current) : undefined);\r\n const [hoursText, setHoursText] = React.useState(displayHour.toString().padStart(2, \"0\"));\r\n const [minutesText, setMinutesText] = React.useState(minutes.toString().padStart(2, \"0\"));\r\n const [secondsText, setSecondsText] = React.useState(seconds.toString().padStart(2, \"0\"));\r\n\r\n const updateTimeSpec = React.useCallback((newTime: TimeSpec) => {\r\n if (newTime.hours !== timeSpec.hours || newTime.minutes !== timeSpec.minutes || newTime.seconds !== timeSpec.seconds) {\r\n setTimeSpec(newTime);\r\n onTimeChange && onTimeChange(newTime);\r\n }\r\n }, [onTimeChange, timeSpec.hours, timeSpec.minutes, timeSpec.seconds]);\r\n\r\n const handleHoursChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setHoursText(event.currentTarget.value);\r\n }, []);\r\n\r\n const handleMinutesChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMinutesText(event.currentTarget.value);\r\n }, []);\r\n const handleSecondsChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSecondsText(event.currentTarget.value);\r\n }, []);\r\n const handleDayPeriodChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setDayPeriodText(event.currentTarget.value);\r\n }, []);\r\n\r\n const handleHoursOnBlur = React.useCallback(() => {\r\n const newHours = getValidInt(hoursText, 0, 24, hours);\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n }, [getDisplayHours, hours, hoursText, showDayPeriod, timeSpec, updateTimeSpec]);\r\n const handleMinutesOnBlur = React.useCallback(() => {\r\n const newMinutes = getValidInt(minutesText, 0, 59, minutes);\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n }, [minutes, minutesText, timeSpec, updateTimeSpec]);\r\n const handleSecondsOnBlur = React.useCallback(() => {\r\n const newSeconds = getValidInt(secondsText, 0, 59, seconds);\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n }, [seconds, secondsText, timeSpec, updateTimeSpec]);\r\n const handleDayPeriodOnBlur = React.useCallback(() => {\r\n let newPeriodText: string | undefined;\r\n // istanbul ignore else\r\n if (dayPeriodText === \"AM\" || dayPeriodText === \"am\" || dayPeriodText === amLabelRef.current)\r\n newPeriodText = amLabelRef.current;\r\n else if (dayPeriodText === \"PM\" || dayPeriodText === \"pm\" || dayPeriodText === pmLabelRef.current)\r\n newPeriodText = pmLabelRef.current;\r\n\r\n // istanbul ignore else\r\n if (undefined !== newPeriodText) {\r\n setDayPeriodText(newPeriodText);\r\n if (newPeriodText === amLabelRef.current && hours > 12) {\r\n updateTimeSpec({ ...timeSpec, hours: hours - 12 });\r\n } else if (newPeriodText === pmLabelRef.current && hours <= 11) {\r\n updateTimeSpec({ ...timeSpec, hours: hours + 12 });\r\n }\r\n }\r\n\r\n }, [dayPeriodText, hours, timeSpec, updateTimeSpec]);\r\n\r\n const handleHoursOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown || event.key === SpecialKey.ArrowUp) {\r\n let newHours = hours + (event.key === SpecialKey.ArrowDown ? -1 : 1);\r\n if (newHours < 0) newHours = 24;\r\n if (newHours > 24 || (newHours > 23 && ((minutes + seconds) > 0))) newHours = 0;\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n const newHours = getValidInt(hoursText, 0, 24, hours);\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n event.preventDefault();\r\n }\r\n }, [getDisplayHours, hours, hoursText, minutes, seconds, showDayPeriod, timeSpec, updateTimeSpec]);\r\n\r\n const handleMinutesOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.ArrowDown) {\r\n const newMinutes = minutes === 0 ? 59 : minutes - 1;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp) {\r\n const newMinutes = minutes === 59 ? 0 : minutes + 1;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Home || event.key === SpecialKey.End) {\r\n const newMinutes = event.key === SpecialKey.Home ? 0 : 59;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else /* istanbul ignore next */ if (event.key === SpecialKey.Enter) {\r\n const newMinutes = getValidInt(minutesText, 0, 59, minutes);\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n }\r\n }, [minutesText, minutes, timeSpec, updateTimeSpec]);\r\n\r\n const handleSecondsOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown) {\r\n const newSeconds = seconds === 0 ? 59 : seconds - 1;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp) {\r\n const newSeconds = seconds === 59 ? 0 : seconds + 1;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Home || event.key === SpecialKey.End) {\r\n const newSeconds = event.key === SpecialKey.Home ? 0 : 59;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n const newSeconds = getValidInt(secondsText, 0, 59, seconds);\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n }\r\n }, [seconds, secondsText, timeSpec, updateTimeSpec]);\r\n\r\n const handleDayPeriodOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n let newPeriodText: string | undefined;\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown || event.key === SpecialKey.Home || event.key === \"a\" || event.key === \"A\") {\r\n newPeriodText = amLabelRef.current;\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp || event.key === SpecialKey.End || event.key === \"p\" || event.key === \"P\") {\r\n newPeriodText = pmLabelRef.current;\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n if (dayPeriodText === \"AM\" || dayPeriodText === \"am\" || dayPeriodText === amLabelRef.current)\r\n newPeriodText = amLabelRef.current;\r\n else if (dayPeriodText === \"PM\" || dayPeriodText === \"pm\" || dayPeriodText === pmLabelRef.current)\r\n newPeriodText = pmLabelRef.current;\r\n event.preventDefault();\r\n }\r\n // istanbul ignore else\r\n if (undefined !== newPeriodText) {\r\n setDayPeriodText(newPeriodText);\r\n /* istanbul ignore else */\r\n if (newPeriodText === amLabelRef.current && hours > 12) {\r\n updateTimeSpec({ ...timeSpec, hours: hours - 12 });\r\n } else if (newPeriodText === pmLabelRef.current && hours <= 11) {\r\n updateTimeSpec({ ...timeSpec, hours: hours + 12 });\r\n }\r\n }\r\n }, [dayPeriodText, hours, timeSpec, updateTimeSpec]);\r\n\r\n const showSeconds = -1 !== (timeDisplay as string).search(\":ss\");\r\n\r\n return <div data-testid=\"components-time-input\" className=\"components-time\">\r\n <Input className=\"components-time-input\" onKeyDown={handleHoursOnKeyDown} onBlur={handleHoursOnBlur} onChange={handleHoursChange} value={hoursText} disabled={readOnly} />\r\n <span className=\"component-time-separator\">:</span>\r\n <Input className=\"components-time-input\" onKeyDown={handleMinutesOnKeyDown} onBlur={handleMinutesOnBlur} onChange={handleMinutesChange} value={minutesText} disabled={readOnly} />\r\n {showSeconds &&\r\n <>\r\n <span className=\"component-time-separator\">:</span>\r\n <Input className=\"components-time-input\" onKeyDown={handleSecondsOnKeyDown} onBlur={handleSecondsOnBlur} onChange={handleSecondsChange} value={secondsText} disabled={readOnly} />\r\n </>\r\n }\r\n {dayPeriodText &&\r\n <Input className=\"components-time-period-input\" onKeyDown={handleDayPeriodOnKeyDown} onBlur={handleDayPeriodOnBlur} onChange={handleDayPeriodChange} value={dayPeriodText} disabled={readOnly} />\r\n }\r\n </div>;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../../../../src/components-react/datepicker/TimeField.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,YAAY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AAsB,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,CAC9L;QAEJ,aAAa;YACZ,oBAAC,KAAK,IAAC,SAAS,EAAC,8BAA8B,EAAC,SAAS,EAAE,wBAAwB,EAAE,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,CAE5M,CAAC;AACT,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Date\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { SpecialKey, TimeDisplay } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"../UiComponents\";\r\nimport \"./TimeField.scss\";\r\n\r\n/** Interface used to hold 24 hour time in\r\n * hours, minutes, and seconds.\r\n * @internal\r\n */\r\nexport interface TimeSpec {\r\n hours: number;\r\n minutes: number;\r\n seconds: number;\r\n}\r\n\r\n/** Interface for props used by [[TimeField]] component.\r\n * @internal\r\n */\r\nexport interface TimeFieldProps {\r\n time: TimeSpec;\r\n timeDisplay: TimeDisplay;\r\n onTimeChange?: (time: TimeSpec) => void;\r\n readOnly?: boolean;\r\n}\r\n\r\nfunction getValidInt(intText: string, min: number, max: number, defaultValue: number) {\r\n try {\r\n const newValue = parseInt(intText, 10);\r\n if (newValue >= min && newValue <= max)\r\n return newValue;\r\n } catch (_e) {\r\n // istanbul ignore next\r\n return defaultValue;\r\n }\r\n return defaultValue;\r\n}\r\n\r\nfunction isSameTime(a: TimeSpec, b: TimeSpec) {\r\n return a.hours === b.hours && a.minutes === b.minutes && a.seconds === b.seconds;\r\n}\r\n\r\n/** Field used to set the Hour:Minutes:Seconds in the [[DatePicker]] Popup panel. The user may key-in the value or use up/down keys to\r\n * change the time.\r\n * @internal\r\n */\r\nexport function TimeField({ time, timeDisplay, readOnly, onTimeChange }: TimeFieldProps) {\r\n const initialDateRef = React.useRef(time);\r\n const amLabelRef = React.useRef(UiComponents.translate(\"timepicker.day-period-am\"));\r\n const pmLabelRef = React.useRef(UiComponents.translate(\"timepicker.day-period-pm\"));\r\n const [timeSpec, setTimeSpec] = React.useState(time);\r\n const { hours, minutes, seconds } = timeSpec;\r\n const showDayPeriod = -1 !== (timeDisplay as string).search(\"aa\");\r\n\r\n const getDisplayHours = React.useCallback((timeHours: number) => {\r\n if (!showDayPeriod) {\r\n return timeHours;\r\n }\r\n const outHours = (0 === timeHours) ? 12 : timeHours > 12 ? timeHours - 12 : timeHours;\r\n return outHours;\r\n }, [showDayPeriod]);\r\n\r\n // See if new initialDate props have changed since component mounted\r\n React.useEffect(() => {\r\n if (!isSameTime(time, initialDateRef.current)) {\r\n setTimeSpec(time);\r\n initialDateRef.current = time;\r\n }\r\n }, [time]);\r\n\r\n const displayHour = getDisplayHours(hours);\r\n const [dayPeriodText, setDayPeriodText] = React.useState(showDayPeriod ? (hours >= 12 ? pmLabelRef.current : amLabelRef.current) : undefined);\r\n const [hoursText, setHoursText] = React.useState(displayHour.toString().padStart(2, \"0\"));\r\n const [minutesText, setMinutesText] = React.useState(minutes.toString().padStart(2, \"0\"));\r\n const [secondsText, setSecondsText] = React.useState(seconds.toString().padStart(2, \"0\"));\r\n\r\n const updateTimeSpec = React.useCallback((newTime: TimeSpec) => {\r\n if (newTime.hours !== timeSpec.hours || newTime.minutes !== timeSpec.minutes || newTime.seconds !== timeSpec.seconds) {\r\n setTimeSpec(newTime);\r\n onTimeChange && onTimeChange(newTime);\r\n }\r\n }, [onTimeChange, timeSpec.hours, timeSpec.minutes, timeSpec.seconds]);\r\n\r\n const handleHoursChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setHoursText(event.currentTarget.value);\r\n }, []);\r\n\r\n const handleMinutesChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMinutesText(event.currentTarget.value);\r\n }, []);\r\n const handleSecondsChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSecondsText(event.currentTarget.value);\r\n }, []);\r\n const handleDayPeriodChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setDayPeriodText(event.currentTarget.value);\r\n }, []);\r\n\r\n const handleHoursOnBlur = React.useCallback(() => {\r\n const newHours = getValidInt(hoursText, 0, 24, hours);\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n }, [getDisplayHours, hours, hoursText, showDayPeriod, timeSpec, updateTimeSpec]);\r\n const handleMinutesOnBlur = React.useCallback(() => {\r\n const newMinutes = getValidInt(minutesText, 0, 59, minutes);\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n }, [minutes, minutesText, timeSpec, updateTimeSpec]);\r\n const handleSecondsOnBlur = React.useCallback(() => {\r\n const newSeconds = getValidInt(secondsText, 0, 59, seconds);\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n }, [seconds, secondsText, timeSpec, updateTimeSpec]);\r\n const handleDayPeriodOnBlur = React.useCallback(() => {\r\n let newPeriodText: string | undefined;\r\n // istanbul ignore else\r\n if (dayPeriodText === \"AM\" || dayPeriodText === \"am\" || dayPeriodText === amLabelRef.current)\r\n newPeriodText = amLabelRef.current;\r\n else if (dayPeriodText === \"PM\" || dayPeriodText === \"pm\" || dayPeriodText === pmLabelRef.current)\r\n newPeriodText = pmLabelRef.current;\r\n\r\n // istanbul ignore else\r\n if (undefined !== newPeriodText) {\r\n setDayPeriodText(newPeriodText);\r\n if (newPeriodText === amLabelRef.current && hours > 12) {\r\n updateTimeSpec({ ...timeSpec, hours: hours - 12 });\r\n } else if (newPeriodText === pmLabelRef.current && hours <= 11) {\r\n updateTimeSpec({ ...timeSpec, hours: hours + 12 });\r\n }\r\n }\r\n\r\n }, [dayPeriodText, hours, timeSpec, updateTimeSpec]);\r\n\r\n const handleHoursOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown || event.key === SpecialKey.ArrowUp) {\r\n let newHours = hours + (event.key === SpecialKey.ArrowDown ? -1 : 1);\r\n if (newHours < 0) newHours = 24;\r\n if (newHours > 24 || (newHours > 23 && ((minutes + seconds) > 0))) newHours = 0;\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n const newHours = getValidInt(hoursText, 0, 24, hours);\r\n setHoursText(getDisplayHours(newHours).toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, hours: newHours });\r\n showDayPeriod && setDayPeriodText(newHours >= 12 ? pmLabelRef.current : amLabelRef.current);\r\n event.preventDefault();\r\n }\r\n }, [getDisplayHours, hours, hoursText, minutes, seconds, showDayPeriod, timeSpec, updateTimeSpec]);\r\n\r\n const handleMinutesOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.ArrowDown) {\r\n const newMinutes = minutes === 0 ? 59 : minutes - 1;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp) {\r\n const newMinutes = minutes === 59 ? 0 : minutes + 1;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Home || event.key === SpecialKey.End) {\r\n const newMinutes = event.key === SpecialKey.Home ? 0 : 59;\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n } else /* istanbul ignore next */ if (event.key === SpecialKey.Enter) {\r\n const newMinutes = getValidInt(minutesText, 0, 59, minutes);\r\n setMinutesText(newMinutes.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, minutes: newMinutes });\r\n event.preventDefault();\r\n }\r\n }, [minutesText, minutes, timeSpec, updateTimeSpec]);\r\n\r\n const handleSecondsOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown) {\r\n const newSeconds = seconds === 0 ? 59 : seconds - 1;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp) {\r\n const newSeconds = seconds === 59 ? 0 : seconds + 1;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Home || event.key === SpecialKey.End) {\r\n const newSeconds = event.key === SpecialKey.Home ? 0 : 59;\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n const newSeconds = getValidInt(secondsText, 0, 59, seconds);\r\n setSecondsText(newSeconds.toString().padStart(2, \"0\"));\r\n updateTimeSpec({ ...timeSpec, seconds: newSeconds });\r\n event.preventDefault();\r\n }\r\n }, [seconds, secondsText, timeSpec, updateTimeSpec]);\r\n\r\n const handleDayPeriodOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n let newPeriodText: string | undefined;\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.ArrowDown || event.key === SpecialKey.Home || event.key === \"a\" || event.key === \"A\") {\r\n newPeriodText = amLabelRef.current;\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowUp || event.key === SpecialKey.End || event.key === \"p\" || event.key === \"P\") {\r\n newPeriodText = pmLabelRef.current;\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.Enter) {\r\n if (dayPeriodText === \"AM\" || dayPeriodText === \"am\" || dayPeriodText === amLabelRef.current)\r\n newPeriodText = amLabelRef.current;\r\n else if (dayPeriodText === \"PM\" || dayPeriodText === \"pm\" || dayPeriodText === pmLabelRef.current)\r\n newPeriodText = pmLabelRef.current;\r\n event.preventDefault();\r\n }\r\n // istanbul ignore else\r\n if (undefined !== newPeriodText) {\r\n setDayPeriodText(newPeriodText);\r\n /* istanbul ignore else */\r\n if (newPeriodText === amLabelRef.current && hours > 12) {\r\n updateTimeSpec({ ...timeSpec, hours: hours - 12 });\r\n } else if (newPeriodText === pmLabelRef.current && hours <= 11) {\r\n updateTimeSpec({ ...timeSpec, hours: hours + 12 });\r\n }\r\n }\r\n }, [dayPeriodText, hours, timeSpec, updateTimeSpec]);\r\n\r\n const showSeconds = -1 !== (timeDisplay as string).search(\":ss\");\r\n\r\n return <div data-testid=\"components-time-input\" className=\"components-time\">\r\n <Input className=\"components-time-input\" onKeyDown={handleHoursOnKeyDown} onBlur={handleHoursOnBlur} onChange={handleHoursChange} value={hoursText} disabled={readOnly} size=\"small\" />\r\n <span className=\"component-time-separator\">:</span>\r\n <Input className=\"components-time-input\" onKeyDown={handleMinutesOnKeyDown} onBlur={handleMinutesOnBlur} onChange={handleMinutesChange} value={minutesText} disabled={readOnly} size=\"small\" />\r\n {showSeconds &&\r\n <>\r\n <span className=\"component-time-separator\">:</span>\r\n <Input className=\"components-time-input\" onKeyDown={handleSecondsOnKeyDown} onBlur={handleSecondsOnBlur} onChange={handleSecondsChange} value={secondsText} disabled={readOnly} size=\"small\" />\r\n </>\r\n }\r\n {dayPeriodText &&\r\n <Input className=\"components-time-period-input\" onKeyDown={handleDayPeriodOnKeyDown} onBlur={handleDayPeriodOnBlur} onChange={handleDayPeriodChange} value={dayPeriodText} disabled={readOnly} size=\"small\" />\r\n }\r\n </div>;\r\n}\r\n"]}
|
|
@@ -20,6 +20,7 @@ export declare class CustomNumberEditor extends React.PureComponent<PropertyEdit
|
|
|
20
20
|
private _isMounted;
|
|
21
21
|
private _formatParams;
|
|
22
22
|
private _inputElement;
|
|
23
|
+
private _lastValidValue;
|
|
23
24
|
/** @internal */
|
|
24
25
|
readonly state: Readonly<CustomNumberEditorState>;
|
|
25
26
|
getPropertyValue(): Promise<PropertyValue | undefined>;
|
|
@@ -36,7 +37,7 @@ export declare class CustomNumberEditor extends React.PureComponent<PropertyEdit
|
|
|
36
37
|
componentDidUpdate(prevProps: PropertyEditorProps): void;
|
|
37
38
|
private _getInitialDisplayValue;
|
|
38
39
|
private setStateFromProps;
|
|
39
|
-
private
|
|
40
|
+
private _resetToLastValidDisplayValue;
|
|
40
41
|
private _onKeyPress;
|
|
41
42
|
private _onFocus;
|
|
42
43
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomNumberEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/CustomNumberEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEW,aAAa,EAC9B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomNumberEditor.d.ts","sourceRoot":"","sources":["../../../../src/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BjB;IAGF,OAAO,CAAC,QAAQ,CAEd;IAEF,gBAAgB;IACA,MAAM,IAAI,KAAK,CAAC,SAAS;CAqD1C;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,kBAAkB;IAChE,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;IACD,IAAoB,sBAAsB,IAAI,OAAO,CAEpD;CACF"}
|
|
@@ -11,7 +11,8 @@ import classnames from "classnames";
|
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { Logger } from "@itwin/core-bentley";
|
|
13
13
|
import { MessageSeverity, PropertyEditorParamTypes, PropertyValueFormat, SpecialKey, StandardEditorNames, StandardTypeNames, UiAdmin, } from "@itwin/appui-abstract";
|
|
14
|
-
import { Icon, IconInput
|
|
14
|
+
import { Icon, IconInput } from "@itwin/core-react";
|
|
15
|
+
import { Input } from "@itwin/itwinui-react";
|
|
15
16
|
import { UiComponents } from "../UiComponents";
|
|
16
17
|
import { PropertyEditorBase, PropertyEditorManager } from "./PropertyEditorManager";
|
|
17
18
|
/** CustomNumberEditor is a React component that is a property editor for numbers that specify custom formatting and parsing functions.
|
|
@@ -30,13 +31,14 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
30
31
|
this._applyUpdatedValue(e.target.value);
|
|
31
32
|
};
|
|
32
33
|
this._onKeyPress = (e) => {
|
|
34
|
+
var _a;
|
|
33
35
|
// istanbul ignore else
|
|
34
36
|
if (e.key === SpecialKey.Escape) {
|
|
35
|
-
const initialDisplayValue = this._getInitialDisplayValue();
|
|
37
|
+
const initialDisplayValue = (_a = (this._lastValidValue && this._lastValidValue.displayValue)) !== null && _a !== void 0 ? _a : this._getInitialDisplayValue();
|
|
36
38
|
if (initialDisplayValue !== this.state.inputValue) {
|
|
37
39
|
e.preventDefault();
|
|
38
40
|
e.stopPropagation();
|
|
39
|
-
this.
|
|
41
|
+
this._resetToLastValidDisplayValue();
|
|
40
42
|
}
|
|
41
43
|
else {
|
|
42
44
|
// istanbul ignore else
|
|
@@ -74,6 +76,7 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
74
76
|
value: parseResults.value,
|
|
75
77
|
displayValue: newDisplayValue,
|
|
76
78
|
};
|
|
79
|
+
this._lastValidValue = { ...propertyValue };
|
|
77
80
|
// make sure the text in the input item matches the latest formatted text... this could get out if the input string say 1.5 === the display string of 1'-6"
|
|
78
81
|
// istanbul ignore else
|
|
79
82
|
if (newDisplayValue !== this.state.inputValue) {
|
|
@@ -82,12 +85,15 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
82
85
|
}
|
|
83
86
|
else {
|
|
84
87
|
// istanbul ignore else
|
|
85
|
-
if (this.htmlElement)
|
|
88
|
+
if (this.htmlElement) {
|
|
86
89
|
UiAdmin.messagePresenter.displayInputFieldMessage(this.htmlElement, MessageSeverity.Error, parseResults.parseError ? parseResults.parseError : /* istanbul ignore next */ UiComponents.translate("errors.unable-to-parse-quantity"));
|
|
87
|
-
|
|
90
|
+
this.htmlElement.focus();
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
88
93
|
UiAdmin.messagePresenter.displayMessage(MessageSeverity.Error, parseResults.parseError ? parseResults.parseError : /* istanbul ignore next */ UiComponents.translate("errors.unable-to-parse-quantity"));
|
|
94
|
+
}
|
|
89
95
|
const displayValue = (record.value.displayValue && record.value.displayValue.length > 0) ? record.value.displayValue : /* istanbul ignore next */ this._formatParams.formatFunction(record.value.value);
|
|
90
|
-
propertyValue = {
|
|
96
|
+
propertyValue = this._lastValidValue ? { ...this._lastValidValue } : {
|
|
91
97
|
valueFormat: PropertyValueFormat.Primitive,
|
|
92
98
|
value: record.value.value,
|
|
93
99
|
displayValue,
|
|
@@ -176,6 +182,11 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
176
182
|
return;
|
|
177
183
|
}
|
|
178
184
|
const initialDisplayValue = this._getInitialDisplayValue();
|
|
185
|
+
this._lastValidValue = {
|
|
186
|
+
valueFormat: PropertyValueFormat.Primitive,
|
|
187
|
+
value: record.value.value,
|
|
188
|
+
displayValue: initialDisplayValue,
|
|
189
|
+
};
|
|
179
190
|
let size;
|
|
180
191
|
let maxLength;
|
|
181
192
|
let iconSpec;
|
|
@@ -200,8 +211,9 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
200
211
|
if (this._isMounted)
|
|
201
212
|
this.setState({ inputValue: initialDisplayValue, size, maxLength, iconSpec });
|
|
202
213
|
}
|
|
203
|
-
|
|
204
|
-
|
|
214
|
+
_resetToLastValidDisplayValue() {
|
|
215
|
+
var _a;
|
|
216
|
+
const initialDisplayValue = (_a = (this._lastValidValue && this._lastValidValue.displayValue)) !== null && _a !== void 0 ? _a : this._getInitialDisplayValue();
|
|
205
217
|
this.setState({ inputValue: initialDisplayValue });
|
|
206
218
|
}
|
|
207
219
|
/** @internal */
|
|
@@ -236,9 +248,7 @@ export class CustomNumberEditor extends React.PureComponent {
|
|
|
236
248
|
}
|
|
237
249
|
else {
|
|
238
250
|
// NEEDSWORK: still using core-react Input component because of `nativeKeyHandler` prop
|
|
239
|
-
reactNode = (
|
|
240
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
241
|
-
React.createElement(Input, { ...inputProps, ref: this._inputElement, "data-testid": "components-customnumber-editor" }));
|
|
251
|
+
reactNode = (React.createElement(Input, { ...inputProps, ref: this._inputElement, "data-testid": "components-customnumber-editor", size: "small" }));
|
|
242
252
|
}
|
|
243
253
|
return reactNode;
|
|
244
254
|
}
|