@itwin/components-react 3.3.0-dev.9 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -1
- package/lib/cjs/components-react/common/DateUtils.d.ts +12 -2
- package/lib/cjs/components-react/common/DateUtils.d.ts.map +1 -1
- package/lib/cjs/components-react/common/DateUtils.js +14 -4
- package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
- package/lib/cjs/components-react/common/SubscriptionScheduler.d.ts +6 -8
- package/lib/cjs/components-react/common/SubscriptionScheduler.d.ts.map +1 -1
- package/lib/cjs/components-react/common/SubscriptionScheduler.js +18 -52
- package/lib/cjs/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js +2 -0
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +36 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js +118 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +76 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +41 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +29 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +79 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +73 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +12 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +47 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +52 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +43 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +43 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +152 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts +27 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.js +113 -0
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/Types.d.ts +18 -0
- package/lib/cjs/components-react/filter-builder/Types.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/Types.js +9 -0
- package/lib/cjs/components-react/filter-builder/Types.js.map +1 -0
- package/lib/cjs/components-react/toolbar/Overflow.scss +3 -2
- package/lib/cjs/components-react/toolbar/PopupItem.scss +4 -5
- package/lib/cjs/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeHooks.js +5 -8
- package/lib/cjs/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.d.ts +8 -4
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js +54 -45
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +2 -0
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components-react.d.ts +9 -0
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +9 -0
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/common/DateUtils.d.ts +12 -2
- package/lib/esm/components-react/common/DateUtils.d.ts.map +1 -1
- package/lib/esm/components-react/common/DateUtils.js +12 -2
- package/lib/esm/components-react/common/DateUtils.js.map +1 -1
- package/lib/esm/components-react/common/SubscriptionScheduler.d.ts +6 -8
- package/lib/esm/components-react/common/SubscriptionScheduler.d.ts.map +1 -1
- package/lib/esm/components-react/common/SubscriptionScheduler.js +18 -52
- package/lib/esm/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js +2 -0
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +36 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.js +94 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +53 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +41 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +29 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +55 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +73 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +12 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +24 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +29 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +20 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +43 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js +127 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts +27 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/Operators.js +107 -0
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -0
- package/lib/esm/components-react/filter-builder/Types.d.ts +18 -0
- package/lib/esm/components-react/filter-builder/Types.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/Types.js +5 -0
- package/lib/esm/components-react/filter-builder/Types.js.map +1 -0
- package/lib/esm/components-react/toolbar/Overflow.scss +3 -2
- package/lib/esm/components-react/toolbar/PopupItem.scss +4 -5
- package/lib/esm/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeHooks.js +6 -9
- package/lib/esm/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.d.ts +8 -4
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js +53 -44
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +2 -0
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components-react.d.ts +9 -0
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +9 -0
- package/lib/esm/components-react.js.map +1 -1
- package/lib/public/locales/en/UiComponents.json +16 -0
- package/package.json +19 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],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;AACvF,0GAAwF;AACxF,gHAA8F;AAC9F,0EAAwD;AAExD,kGAAgF;AAChF,uFAAqE;AACrE,6FAA2E;AAC3E,yFAAuE;AACvE,oGAAkF;AAClF,oHAAkG;AAClG,kGAAgF;AAChF,mHAAiG;AACjG,gGAA8E;AAC9E,yFAAuE;AACvE,mGAAiF;AACjF,sHAAoG;AACpG,0HAAwG;AACxG,uHAAqG;AACrG,0GAAwF;AACxF,0GAAwF;AACxF,6GAA2F;AAC3F,oGAAkF;AAClF,6FAA2E;AAC3E,6FAA2E;AAC3E,wGAAsF;AACtF,mGAAiF;AACjF,sGAAoF;AACpF,wHAAsG;AACtG,wHAAsG;AACtG,2HAAyG;AACzG,oHAAkG;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","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
|
+
{"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,0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jG,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","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/filter-builder/FilterBuilder\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRule\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleGroup\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleProperty\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\r\nexport * from \"./components-react/filter-builder/Operators\";\r\nexport * from \"./components-react/filter-builder/Types\";\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,6 +1,14 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Common
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Define formatting options for use when component are generating a formatted date string calling `Date.toLocaleTimeString()`.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface DateFormatOptions {
|
|
9
|
+
locales?: string | string[] | undefined;
|
|
10
|
+
options?: Intl.DateTimeFormatOptions | undefined;
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
13
|
* Adjust a Date object to show time in one time zone as if it is in the local time zone.
|
|
6
14
|
* This is useful when showing sunrise and sunset times for a project location in a different time zone
|
|
@@ -34,16 +42,18 @@ export declare function adjustDateToTimezone(inDateTime: Date, utcOffset: number
|
|
|
34
42
|
* Format a date in a display string, optionally converting to time zone, if specified by timeZoneOffset
|
|
35
43
|
* @param date Date object to format
|
|
36
44
|
* @param timeZoneOffset optional: offset from UTC to use for conversion
|
|
45
|
+
* @param formatOptions optional: allow locale and format for output Date string. If not defined current locale options are used.
|
|
37
46
|
* @returns formatted date string
|
|
38
47
|
* @public
|
|
39
48
|
*/
|
|
40
|
-
export declare const toDateString: (date: Date, timeZoneOffset?: number | undefined) => string;
|
|
49
|
+
export declare const toDateString: (date: Date, timeZoneOffset?: number | undefined, formatOptions?: DateFormatOptions | undefined) => string;
|
|
41
50
|
/**
|
|
42
51
|
* Format the time included in a date, optionally converting to time zone, if specified
|
|
43
52
|
* @param date Date object
|
|
44
53
|
* @param timeZoneOffset optional: offset from UTC to use for conversion
|
|
54
|
+
* @param formatOptions optional: allow locale and format for output Time string. If not defined current locale options are used.
|
|
45
55
|
* @returns formatted time string
|
|
46
56
|
* @public
|
|
47
57
|
*/
|
|
48
|
-
export declare const toTimeString: (date: Date, timeZoneOffset?: number | undefined) => string;
|
|
58
|
+
export declare const toTimeString: (date: Date, timeZoneOffset?: number | undefined, formatOptions?: DateFormatOptions | undefined) => string;
|
|
49
59
|
//# sourceMappingURL=DateUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateUtils.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/DateUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAEvE;AACD
|
|
1
|
+
{"version":3,"file":"DateUtils.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/DateUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAEvE;AACD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,SAAU,IAAI,+FAMtC,CAAC;AACF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,SAAU,IAAI,+FAMtC,CAAC"}
|
|
@@ -40,20 +40,30 @@ export function adjustDateToTimezone(inDateTime, utcOffset) {
|
|
|
40
40
|
* Format a date in a display string, optionally converting to time zone, if specified by timeZoneOffset
|
|
41
41
|
* @param date Date object to format
|
|
42
42
|
* @param timeZoneOffset optional: offset from UTC to use for conversion
|
|
43
|
+
* @param formatOptions optional: allow locale and format for output Date string. If not defined current locale options are used.
|
|
43
44
|
* @returns formatted date string
|
|
44
45
|
* @public
|
|
45
46
|
*/
|
|
46
|
-
export const toDateString = (date, timeZoneOffset) => {
|
|
47
|
+
export const toDateString = (date, timeZoneOffset, formatOptions) => {
|
|
48
|
+
if (formatOptions) {
|
|
49
|
+
return undefined === timeZoneOffset ? date.toLocaleDateString(formatOptions.locales, formatOptions.options) :
|
|
50
|
+
adjustDateToTimezone(date, timeZoneOffset).toLocaleDateString(formatOptions.locales, formatOptions.options);
|
|
51
|
+
}
|
|
47
52
|
return undefined === timeZoneOffset ? date.toLocaleDateString() : adjustDateToTimezone(date, timeZoneOffset).toLocaleDateString();
|
|
48
53
|
};
|
|
49
54
|
/**
|
|
50
55
|
* Format the time included in a date, optionally converting to time zone, if specified
|
|
51
56
|
* @param date Date object
|
|
52
57
|
* @param timeZoneOffset optional: offset from UTC to use for conversion
|
|
58
|
+
* @param formatOptions optional: allow locale and format for output Time string. If not defined current locale options are used.
|
|
53
59
|
* @returns formatted time string
|
|
54
60
|
* @public
|
|
55
61
|
*/
|
|
56
|
-
export const toTimeString = (date, timeZoneOffset) => {
|
|
62
|
+
export const toTimeString = (date, timeZoneOffset, formatOptions) => {
|
|
63
|
+
if (formatOptions) {
|
|
64
|
+
return undefined === timeZoneOffset ? date.toLocaleTimeString(formatOptions.locales, formatOptions.options) :
|
|
65
|
+
adjustDateToTimezone(date, timeZoneOffset).toLocaleTimeString(formatOptions.locales, formatOptions.options);
|
|
66
|
+
}
|
|
57
67
|
return undefined === timeZoneOffset ? date.toLocaleTimeString() : adjustDateToTimezone(date, timeZoneOffset).toLocaleTimeString();
|
|
58
68
|
};
|
|
59
69
|
//# sourceMappingURL=DateUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateUtils.js","sourceRoot":"","sources":["../../../../src/components-react/common/DateUtils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;
|
|
1
|
+
{"version":3,"file":"DateUtils.js","sourceRoot":"","sources":["../../../../src/components-react/common/DateUtils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAgB,EAAE,SAAiB;IACtE,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,iBAAiB,EAAE,GAAG,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC;AAC/F,CAAC;AACD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAU,EAAE,cAAuB,EAAE,aAAiC,EAAE,EAAE;IACrG,IAAI,aAAa,EAAE;QACjB,OAAO,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3G,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;KAC/G;IACD,OAAO,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACpI,CAAC,CAAC;AACF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAU,EAAE,cAAuB,EAAE,aAAiC,EAAE,EAAE;IACrG,IAAI,aAAa,EAAE;QACjB,OAAO,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3G,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;KAC/G;IACD,OAAO,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACpI,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 Common\r\n */\r\n\r\n/**\r\n * Define formatting options for use when component are generating a formatted date string calling `Date.toLocaleTimeString()`.\r\n * @public\r\n */\r\nexport interface DateFormatOptions {\r\n locales?: string | string[] | undefined;\r\n options?: Intl.DateTimeFormatOptions | undefined;\r\n}\r\n\r\n/**\r\n * Adjust a Date object to show time in one time zone as if it is in the local time zone.\r\n * This is useful when showing sunrise and sunset times for a project location in a different time zone\r\n * and the time displayed should appear as if the user is seeing clock in project location.\r\n * Example 1:\r\n * If you have a UTC time for London (UTC +0100) and you want to display it in Eastern-US (UTC -0400) as if you were in London.\r\n * ```ts\r\n * londonDate = new Date(\"July 22, 2018 07:22:13 +0100\");\r\n * in Eastern-US londonDate will show as '7/22/2018, 2:22:13 AM'\r\n * adjustedDate = adjustDateToTimezone(londonDate, 1*60);\r\n * in location Eastern-US adjustedDate will show as '7/22/2018, 7:22:13 AM'\r\n * ```\r\n * Example 2:\r\n * If you have a UTC time for your location (UTC -0400) and you want to display the time as if you are in Western-US (UTC -0700).\r\n * ```ts\r\n * easternDate = new Date(\"July 22, 2018 07:22:13 -0400\");\r\n * adjustedDate = adjustDateToTimezone(easternDate, -7*60);\r\n * in location Eastern-US adjustedDate will show as '7/22/2018, 7:22:13 AM'\r\n * ```\r\n *\r\n * The utcOffset must be the time in minutes between the UTC and the desired time zone at the date specified by inDateTime.\r\n * For example, if you want the time offset to New York, NY and the date is during Daylight Saving Time, utcOffset should be -240 (-4 * 60).\r\n * If the date falls during Standard Time in New York, utcOffset will be -300 (-5 * 60).\r\n *\r\n * @param inDateTime date/time at project location\r\n * @param utcOffset UTC offset in minutes\r\n * @public\r\n */\r\nexport function adjustDateToTimezone(inDateTime: Date, utcOffset: number) {\r\n return new Date(inDateTime.getTime() + (inDateTime.getTimezoneOffset() + utcOffset) * 60000);\r\n}\r\n/**\r\n * Format a date in a display string, optionally converting to time zone, if specified by timeZoneOffset\r\n * @param date Date object to format\r\n * @param timeZoneOffset optional: offset from UTC to use for conversion\r\n * @param formatOptions optional: allow locale and format for output Date string. If not defined current locale options are used.\r\n * @returns formatted date string\r\n * @public\r\n */\r\nexport const toDateString = (date: Date, timeZoneOffset?: number, formatOptions?: DateFormatOptions) => {\r\n if (formatOptions) {\r\n return undefined === timeZoneOffset ? date.toLocaleDateString(formatOptions.locales, formatOptions.options) :\r\n adjustDateToTimezone(date, timeZoneOffset).toLocaleDateString(formatOptions.locales, formatOptions.options);\r\n }\r\n return undefined === timeZoneOffset ? date.toLocaleDateString() : adjustDateToTimezone(date, timeZoneOffset).toLocaleDateString();\r\n};\r\n/**\r\n * Format the time included in a date, optionally converting to time zone, if specified\r\n * @param date Date object\r\n * @param timeZoneOffset optional: offset from UTC to use for conversion\r\n * @param formatOptions optional: allow locale and format for output Time string. If not defined current locale options are used.\r\n * @returns formatted time string\r\n * @public\r\n */\r\nexport const toTimeString = (date: Date, timeZoneOffset?: number, formatOptions?: DateFormatOptions) => {\r\n if (formatOptions) {\r\n return undefined === timeZoneOffset ? date.toLocaleTimeString(formatOptions.locales, formatOptions.options) :\r\n adjustDateToTimezone(date, timeZoneOffset).toLocaleTimeString(formatOptions.locales, formatOptions.options);\r\n }\r\n return undefined === timeZoneOffset ? date.toLocaleTimeString() : adjustDateToTimezone(date, timeZoneOffset).toLocaleTimeString();\r\n};\r\n\r\n"]}
|
|
@@ -3,27 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Observable } from "rxjs/internal/Observable";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Limits concurrent observable subscriptions to one.
|
|
7
7
|
*
|
|
8
|
-
* Scheduled observables are placed at the end of a queue.
|
|
9
|
-
*
|
|
10
|
-
* either complete or get unscheduled before removing them from the queue.
|
|
8
|
+
* Scheduled observables are placed at the end of a queue. Each queued observable is subscribed to and awaited until the
|
|
9
|
+
* completion.
|
|
11
10
|
*
|
|
12
11
|
* To schedule an observable, subscribe to the result of `scheduleSubscription()` call.
|
|
13
12
|
* @internal
|
|
14
13
|
*/
|
|
15
14
|
export declare class SubscriptionScheduler<T> {
|
|
16
|
-
private _scheduledObservables;
|
|
17
15
|
private _scheduler;
|
|
18
16
|
constructor();
|
|
19
17
|
/**
|
|
20
18
|
* Schedules `source` for subscription in the current scheduler.
|
|
21
19
|
*
|
|
22
|
-
* The actual scheduling is performed when the returned observable is subscribed to.
|
|
23
|
-
*
|
|
20
|
+
* The actual scheduling is performed when the returned observable is subscribed to. To cancel, remove all subscribers
|
|
21
|
+
* from the returned observable.
|
|
24
22
|
*
|
|
25
23
|
* @param source Input observable for which to schedule a subscription.
|
|
26
|
-
* @returns
|
|
24
|
+
* @returns Hot observable which starts emitting `source` values after subscription.
|
|
27
25
|
*/
|
|
28
26
|
scheduleSubscription(source: Observable<T>): Observable<T>;
|
|
29
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionScheduler.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/SubscriptionScheduler.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"SubscriptionScheduler.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/SubscriptionScheduler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAkBtD;;;;;;;;GAQG;AACH,qBAAa,qBAAqB,CAAC,CAAC;IAClC,OAAO,CAAC,UAAU,CAA2C;;IAwB7D;;;;;;;;OAQG;IACI,oBAAoB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;CASlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAErH"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Common
|
|
7
7
|
*/
|
|
8
|
-
import { BehaviorSubject } from "rxjs/internal/BehaviorSubject";
|
|
9
8
|
import { defer } from "rxjs/internal/observable/defer";
|
|
9
|
+
import { EMPTY } from "rxjs/internal/observable/empty";
|
|
10
|
+
import { iif } from "rxjs/internal/observable/iif";
|
|
10
11
|
import { finalize } from "rxjs/internal/operators/finalize";
|
|
11
12
|
import { mergeMap } from "rxjs/internal/operators/mergeMap";
|
|
12
13
|
import { observeOn } from "rxjs/internal/operators/observeOn";
|
|
@@ -14,87 +15,52 @@ import { onErrorResumeNext } from "rxjs/internal/operators/onErrorResumeNext";
|
|
|
14
15
|
import { publish } from "rxjs/internal/operators/publish";
|
|
15
16
|
import { refCount } from "rxjs/internal/operators/refCount";
|
|
16
17
|
import { subscribeOn } from "rxjs/internal/operators/subscribeOn";
|
|
17
|
-
import { switchAll } from "rxjs/internal/operators/switchAll";
|
|
18
18
|
import { asapScheduler } from "rxjs/internal/scheduler/asap";
|
|
19
19
|
import { queueScheduler } from "rxjs/internal/scheduler/queue";
|
|
20
20
|
import { Subject } from "rxjs/internal/Subject";
|
|
21
21
|
const MAX_CONCURRENT_SUBSCRIPTIONS = 1;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Limits concurrent observable subscriptions to one.
|
|
24
24
|
*
|
|
25
|
-
* Scheduled observables are placed at the end of a queue.
|
|
26
|
-
*
|
|
27
|
-
* either complete or get unscheduled before removing them from the queue.
|
|
25
|
+
* Scheduled observables are placed at the end of a queue. Each queued observable is subscribed to and awaited until the
|
|
26
|
+
* completion.
|
|
28
27
|
*
|
|
29
28
|
* To schedule an observable, subscribe to the result of `scheduleSubscription()` call.
|
|
30
29
|
* @internal
|
|
31
30
|
*/
|
|
32
31
|
export class SubscriptionScheduler {
|
|
33
32
|
constructor() {
|
|
34
|
-
// Maps source observables to scheduled observables.
|
|
35
|
-
this._scheduledObservables = new Map();
|
|
36
|
-
// Subject that does the actual subscription scheduling
|
|
37
33
|
this._scheduler = new Subject();
|
|
38
34
|
this._scheduler
|
|
39
|
-
.pipe(
|
|
40
|
-
// Process all observables one by one in sequence
|
|
41
|
-
mergeMap((sourceObservable) => sourceObservable.pipe(
|
|
35
|
+
.pipe(mergeMap((sourceObservable) => sourceObservable.pipe(
|
|
42
36
|
// Connect the observable
|
|
43
37
|
refCount(),
|
|
44
|
-
// Guard against stack overflow when a lot of observables are scheduled.
|
|
45
|
-
//
|
|
46
|
-
// that is present in the pipeline recursively.
|
|
38
|
+
// Guard against stack overflow when a lot of observables are scheduled. Without this operation `mergeMap`
|
|
39
|
+
// will process each observable that is present in the pipeline recursively.
|
|
47
40
|
observeOn(queueScheduler),
|
|
48
|
-
//
|
|
41
|
+
// Delay the connection until another event loop task
|
|
49
42
|
subscribeOn(asapScheduler),
|
|
50
|
-
//
|
|
43
|
+
// Ignore errors in this pipeline without suppressing them for other subscribers
|
|
51
44
|
onErrorResumeNext()), MAX_CONCURRENT_SUBSCRIPTIONS))
|
|
52
|
-
// Start
|
|
45
|
+
// Start consuming scheduled observables
|
|
53
46
|
.subscribe();
|
|
54
47
|
}
|
|
55
48
|
/**
|
|
56
49
|
* Schedules `source` for subscription in the current scheduler.
|
|
57
50
|
*
|
|
58
|
-
* The actual scheduling is performed when the returned observable is subscribed to.
|
|
59
|
-
*
|
|
51
|
+
* The actual scheduling is performed when the returned observable is subscribed to. To cancel, remove all subscribers
|
|
52
|
+
* from the returned observable.
|
|
60
53
|
*
|
|
61
54
|
* @param source Input observable for which to schedule a subscription.
|
|
62
|
-
* @returns
|
|
55
|
+
* @returns Hot observable which starts emitting `source` values after subscription.
|
|
63
56
|
*/
|
|
64
57
|
scheduleSubscription(source) {
|
|
65
|
-
// On subscription, determine which observable to return
|
|
66
58
|
return defer(() => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return scheduledObservable;
|
|
71
|
-
}
|
|
72
|
-
// Create a subject which emits observable sources
|
|
73
|
-
const sourceSubject = new BehaviorSubject(source.pipe(
|
|
74
|
-
// When source completes, allow scheduler to move on to the next observable
|
|
75
|
-
finalize(() => {
|
|
76
|
-
sourceSubject.complete();
|
|
77
|
-
})));
|
|
78
|
-
// Create an observable which will be passed to the scheduler
|
|
79
|
-
const connectableObservable = publish()(sourceSubject.pipe(
|
|
80
|
-
// Unsubscribe from previous observable before subscribing to the next one
|
|
81
|
-
switchAll()));
|
|
82
|
-
// Create an observable which will be cached and returned
|
|
83
|
-
scheduledObservable = connectableObservable.pipe(finalize(() => {
|
|
84
|
-
// Invalidate cached scheduled observable
|
|
85
|
-
this._scheduledObservables.delete(source);
|
|
86
|
-
// Allow scheduler to move on to the next observable
|
|
87
|
-
sourceSubject.complete();
|
|
88
|
-
}),
|
|
89
|
-
// Multicast values
|
|
90
|
-
publish(),
|
|
91
|
-
// Dispose the shared subscription when there are no subscribers left
|
|
92
|
-
refCount());
|
|
93
|
-
// Cache the scheduled observable
|
|
94
|
-
this._scheduledObservables.set(source, scheduledObservable);
|
|
95
|
-
// Schedule the subscription
|
|
59
|
+
let unsubscribed = false;
|
|
60
|
+
// Do not subscribe to source observable if it was unsubscribed from before being processed by the scheduler
|
|
61
|
+
const connectableObservable = iif(() => unsubscribed, EMPTY, source).pipe(publish());
|
|
96
62
|
this._scheduler.next(connectableObservable);
|
|
97
|
-
return
|
|
63
|
+
return connectableObservable.pipe(finalize(() => unsubscribed = true));
|
|
98
64
|
});
|
|
99
65
|
}
|
|
100
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionScheduler.js","sourceRoot":"","sources":["../../../../src/components-react/common/SubscriptionScheduler.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;
|
|
1
|
+
{"version":3,"file":"SubscriptionScheduler.js","sourceRoot":"","sources":["../../../../src/components-react/common/SubscriptionScheduler.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,M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------------\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 Common\r\n */\r\n\r\nimport { Observable } from \"rxjs/internal/Observable\";\r\nimport { ConnectableObservable } from \"rxjs/internal/observable/ConnectableObservable\";\r\nimport { defer } from \"rxjs/internal/observable/defer\";\r\nimport { EMPTY } from \"rxjs/internal/observable/empty\";\r\nimport { iif } from \"rxjs/internal/observable/iif\";\r\nimport { finalize } from \"rxjs/internal/operators/finalize\";\r\nimport { mergeMap } from \"rxjs/internal/operators/mergeMap\";\r\nimport { observeOn } from \"rxjs/internal/operators/observeOn\";\r\nimport { onErrorResumeNext } from \"rxjs/internal/operators/onErrorResumeNext\";\r\nimport { publish } from \"rxjs/internal/operators/publish\";\r\nimport { refCount } from \"rxjs/internal/operators/refCount\";\r\nimport { subscribeOn } from \"rxjs/internal/operators/subscribeOn\";\r\nimport { asapScheduler } from \"rxjs/internal/scheduler/asap\";\r\nimport { queueScheduler } from \"rxjs/internal/scheduler/queue\";\r\nimport { Subject } from \"rxjs/internal/Subject\";\r\n\r\nconst MAX_CONCURRENT_SUBSCRIPTIONS = 1;\r\n\r\n/**\r\n * Limits concurrent observable subscriptions to one.\r\n *\r\n * Scheduled observables are placed at the end of a queue. Each queued observable is subscribed to and awaited until the\r\n * completion.\r\n *\r\n * To schedule an observable, subscribe to the result of `scheduleSubscription()` call.\r\n * @internal\r\n */\r\nexport class SubscriptionScheduler<T> {\r\n private _scheduler = new Subject<ConnectableObservable<T>>();\r\n\r\n constructor() {\r\n this._scheduler\r\n .pipe(\r\n mergeMap(\r\n (sourceObservable) => sourceObservable.pipe(\r\n // Connect the observable\r\n refCount(),\r\n // Guard against stack overflow when a lot of observables are scheduled. Without this operation `mergeMap`\r\n // will process each observable that is present in the pipeline recursively.\r\n observeOn(queueScheduler),\r\n // Delay the connection until another event loop task\r\n subscribeOn(asapScheduler),\r\n // Ignore errors in this pipeline without suppressing them for other subscribers\r\n onErrorResumeNext(),\r\n ),\r\n MAX_CONCURRENT_SUBSCRIPTIONS,\r\n ),\r\n )\r\n // Start consuming scheduled observables\r\n .subscribe();\r\n }\r\n\r\n /**\r\n * Schedules `source` for subscription in the current scheduler.\r\n *\r\n * The actual scheduling is performed when the returned observable is subscribed to. To cancel, remove all subscribers\r\n * from the returned observable.\r\n *\r\n * @param source Input observable for which to schedule a subscription.\r\n * @returns Hot observable which starts emitting `source` values after subscription.\r\n */\r\n public scheduleSubscription(source: Observable<T>): Observable<T> {\r\n return defer(() => {\r\n let unsubscribed = false;\r\n // Do not subscribe to source observable if it was unsubscribed from before being processed by the scheduler\r\n const connectableObservable = iif(() => unsubscribed, EMPTY, source).pipe(publish()) as ConnectableObservable<T>;\r\n this._scheduler.next(connectableObservable);\r\n return connectableObservable.pipe(finalize(() => unsubscribed = true));\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Helper function for use as a `pipe()` argument with `rxjs` observables.\r\n * @internal\r\n */\r\nexport function scheduleSubscription<T>(scheduler: SubscriptionScheduler<T>): (source: Observable<T>) => Observable<T> {\r\n return (source) => scheduler.scheduleSubscription(source);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/DateTimeEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACiB,aAAa,EAA0C,WAAW,EACzF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAyB,MAAM,yBAAyB,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAS5D,gBAAgB;AAChB,UAAU,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,mBAAmB;YAMnD,iBAAiB;IA+F/B,OAAO,CAAC,YAAY,CAGlB;IAEF,OAAO,CAAC,YAAY,CAQlB;IAEF,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,aAAa,CASnB;IAEF,gBAAgB;IACA,MAAM,IAAI,KAAK,CAAC,SAAS;CAgC1C;AAED;;;IAGI;AACJ,qBAAa,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;IAED,IAAoB,mBAAmB,IAAI,OAAO,CAEjD;CACF;AAED;;;IAGI;AACJ,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;IAED,IAAoB,mBAAmB,IAAI,OAAO,CAEjD;CACF"}
|
|
@@ -155,6 +155,8 @@ export class DateTimeEditor extends React.PureComponent {
|
|
|
155
155
|
initialValue = new Date(record.value.value);
|
|
156
156
|
else if (typeof record.value.value === "string")
|
|
157
157
|
initialValue = new Date(record.value.value);
|
|
158
|
+
else if (record.value.value === undefined)
|
|
159
|
+
initialValue = new Date();
|
|
158
160
|
typeConverter = TypeConverterManager.getConverter(record.property.typename, (_a = record.property.converter) === null || _a === void 0 ? void 0 : _a.name);
|
|
159
161
|
const options = (_b = record.property.converter) === null || _b === void 0 ? void 0 : _b.options;
|
|
160
162
|
if (options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/DateTimeEditor.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,oBAAoB,EAAiB,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,GACzF,MAAM,uB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,GAAI,CACpG,CAEJ,CACL;oBACH,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,GAAI,CAC/D,CACH,CACV,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,OAAO,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK,GAAI,CAAC;IAC7C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,IAAI,GAAI,CAAC;IAC5C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC/F,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,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 PropertyEditors\r\n */\r\n\r\nimport \"./DateTimeEditor.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n AlternateDateFormats, PropertyValue, PropertyValueFormat, StandardTypeNames, TimeDisplay,\r\n} from \"@itwin/appui-abstract\";\r\nimport { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\r\nimport { PropertyEditorBase, PropertyEditorManager } from \"./PropertyEditorManager\";\r\nimport { PopupButton, PopupContent, PopupOkCancelButtons } from \"./PopupButton\";\r\nimport { TimeField, TimeSpec } from \"../datepicker/TimeField\";\r\nimport { TypeConverter } from \"../converters/TypeConverter\";\r\nimport { DatePicker } from \"../datepicker/DatePicker\";\r\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\r\nimport { DateTimeTypeConverterBase } from \"../converters/DateTimeTypeConverter\";\r\nimport { BodyText } from \"@itwin/core-react\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\n\r\n// cSpell:ignore datepicker\r\n\r\n/** @internal */\r\ninterface DateTimeEditorState {\r\n value: Date;\r\n displayValue?: string;\r\n timeDisplay?: TimeDisplay;\r\n isDisabled?: boolean;\r\n typeConverter?: TypeConverter;\r\n editInUtc: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface DateTimeEditorProps extends PropertyEditorProps {\r\n showTime?: boolean;\r\n}\r\n\r\n/** DateTimeEditor React component that is a property editor for selection of date and time.\r\n * @internal\r\n */\r\nexport class DateTimeEditor extends React.PureComponent<DateTimeEditorProps, DateTimeEditorState> implements TypeEditor {\r\n private _isMounted = false;\r\n private _enterKey = false;\r\n private _divElement = React.createRef<HTMLDivElement>();\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DateTimeEditorState> = {\r\n value: new Date(),\r\n editInUtc: false,\r\n };\r\n\r\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\r\n const record = this.props.propertyRecord;\r\n let propertyValue: PropertyValue | undefined;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n propertyValue = {\r\n valueFormat: PropertyValueFormat.Primitive,\r\n value: this.state.value,\r\n displayValue: this.state.displayValue,\r\n };\r\n }\r\n\r\n return propertyValue;\r\n }\r\n\r\n public get htmlElement(): HTMLElement | null {\r\n return this._divElement.current;\r\n }\r\n\r\n public get hasFocus(): boolean {\r\n let containsFocus = false;\r\n // istanbul ignore else\r\n if (this.htmlElement)\r\n containsFocus = this.htmlElement.contains(document.activeElement);\r\n return containsFocus;\r\n }\r\n\r\n public async processDateChange(typeConverter: TypeConverter, newValue: Date): Promise<void> {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord) {\r\n const displayValue = await typeConverter.convertPropertyToString(this.props.propertyRecord.property, newValue);\r\n this.setState({\r\n value: newValue,\r\n displayValue,\r\n });\r\n }\r\n }\r\n\r\n private _handleChange = (newValue: Date): void => {\r\n // istanbul ignore else\r\n if (this._isMounted && this.state.typeConverter) {\r\n // istanbul ignore else\r\n if (this.state.editInUtc) {\r\n newValue = adjustDateToTimezone(newValue, newValue.getTimezoneOffset() * -1);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.processDateChange(this.state.typeConverter, newValue);\r\n }\r\n };\r\n\r\n private _handleTimeChange = (time: TimeSpec): void => {\r\n // Combine new time into selected Date\r\n if (this.state.editInUtc) {\r\n const newWorkingDate = adjustDateToTimezone(this.state.value, 0);\r\n newWorkingDate.setUTCHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n } else {\r\n const newWorkingDate = new Date(this.state.value.getTime());\r\n newWorkingDate.setHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\r\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n }\r\n\r\n private async setStateFromProps() {\r\n const record = this.props.propertyRecord;\r\n let initialValue: Date | undefined;\r\n let typeConverter: TypeConverter | undefined;\r\n let timeDisplay: TimeDisplay | undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n let editInUtc = false;\r\n\r\n // istanbul ignore else\r\n if (this.props.showTime)\r\n timeDisplay = TimeDisplay.H12MC;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n // istanbul ignore else\r\n if (record.value.value instanceof Date)\r\n initialValue = new Date(record.value.value);\r\n else if (typeof record.value.value === \"string\")\r\n initialValue = new Date(record.value.value);\r\n\r\n typeConverter = TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name);\r\n\r\n const options = record.property.converter?.options;\r\n if (options) {\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options) {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n timeDisplay = TimeDisplay.H24MS;\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n }\r\n\r\n if (\"timeDisplay\" in options && this.props.showTime) {\r\n timeDisplay = options.timeDisplay;\r\n // use 24 hr time display if alternateDateFormat is defined\r\n // istanbul ignore next\r\n if (alternateDateFormat && timeDisplay !== TimeDisplay.H24MS && timeDisplay !== TimeDisplay.H24M)\r\n timeDisplay = TimeDisplay.H24MS;\r\n }\r\n\r\n // istanbul ignore else\r\n if (alternateDateFormat) {\r\n editInUtc = true;\r\n\r\n if (this.props.showTime) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort) {\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n }\r\n } else {\r\n timeDisplay = undefined;\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 }\r\n }\r\n\r\n // istanbul ignore next\r\n if (!initialValue) {\r\n throw new Error(\"Bad Value\");\r\n }\r\n\r\n // istanbul ignore next\r\n if (!typeConverter) {\r\n throw new Error(\"Unable to determine TypeConverter\");\r\n }\r\n\r\n const isDisabled = record && !!record.isDisabled;\r\n const displayValue = await typeConverter.convertPropertyToString(record!.property, initialValue);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({\r\n value: initialValue,\r\n isDisabled,\r\n timeDisplay,\r\n typeConverter,\r\n displayValue,\r\n editInUtc,\r\n });\r\n }\r\n\r\n private _handleEnter = async (): Promise<void> => {\r\n this._enterKey = true;\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleClose = async (): Promise<void> => {\r\n if (this._enterKey) {\r\n this._enterKey = false;\r\n } else {\r\n // istanbul ignore next\r\n if (this.props.onCancel)\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleCancel = (_event: React.MouseEvent): void => {\r\n // istanbul ignore else\r\n if (this.props.onCancel) {\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleCommit = async (): Promise<void> => {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord && this.props.onCommit) {\r\n const propertyValue = await this.getPropertyValue();\r\n // istanbul ignore else\r\n if (propertyValue !== undefined) {\r\n this.props.onCommit({ propertyRecord: this.props.propertyRecord, newValue: propertyValue });\r\n }\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override render(): React.ReactNode {\r\n const date = this.state.editInUtc ? adjustDateToTimezone(this.state.value, 0) : this.state.value;\r\n const timeSpec: TimeSpec = {\r\n hours: date.getHours(),\r\n minutes: date.getMinutes(),\r\n seconds: date.getSeconds(),\r\n };\r\n\r\n const className = classnames(\"components-cell-editor\", \"components-datetime-editor\", this.props.className);\r\n\r\n return (\r\n <div className={className} ref={this._divElement}>\r\n <PopupButton label={this.state.displayValue} onClose={this._handleClose} onEnter={this._handleEnter}\r\n setFocus={this.props.setFocus}>\r\n <PopupContent>\r\n <>\r\n <div className=\"components-date-picker-calendar-popup-panel\" data-testid=\"components-date-picker-calendar-popup-panel\">\r\n <DatePicker selected={date} onDateChange={this._handleChange} showFocusOutline={false} />\r\n {this.state.timeDisplay &&\r\n <div className=\"time-container\">\r\n <BodyText className=\"time-label\">{\"Time\"}</BodyText>\r\n <TimeField time={timeSpec} timeDisplay={this.state.timeDisplay} onTimeChange={this._handleTimeChange} />\r\n </div>\r\n }\r\n </div>\r\n </>\r\n <PopupOkCancelButtons onOk={this._handleOk} onCancel={this._handleCancel} />\r\n </PopupContent>\r\n </PopupButton>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class ShortDateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={false} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class DateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={true} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\nPropertyEditorManager.registerEditor(StandardTypeNames.ShortDate, ShortDateTimePropertyEditor);\r\nPropertyEditorManager.registerEditor(StandardTypeNames.DateTime, DateTimePropertyEditor);\r\n"]}
|
|
1
|
+
{"version":3,"file":"DateTimeE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6C;4BACpH,oBAAC,UAAU,IAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,GAAI;4BACxF,IAAI,CAAC,KAAK,CAAC,WAAW;gCACrB,6BAAK,SAAS,EAAC,gBAAgB;oCAC7B,oBAAC,QAAQ,IAAC,SAAS,EAAC,YAAY,IAAE,MAAM,CAAY;oCACpD,oBAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,IAAI,CAAC,iBAAiB,GAAI,CACpG,CAEJ,CACL;oBACH,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,GAAI,CAC/D,CACH,CACV,CACP,CAAC;IACJ,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,OAAO,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK,GAAI,CAAC;IAC7C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,IAAI,GAAI,CAAC;IAC5C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC/F,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,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 PropertyEditors\r\n */\r\n\r\nimport \"./DateTimeEditor.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n AlternateDateFormats, PropertyValue, PropertyValueFormat, StandardTypeNames, TimeDisplay,\r\n} from \"@itwin/appui-abstract\";\r\nimport { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\r\nimport { PropertyEditorBase, PropertyEditorManager } from \"./PropertyEditorManager\";\r\nimport { PopupButton, PopupContent, PopupOkCancelButtons } from \"./PopupButton\";\r\nimport { TimeField, TimeSpec } from \"../datepicker/TimeField\";\r\nimport { TypeConverter } from \"../converters/TypeConverter\";\r\nimport { DatePicker } from \"../datepicker/DatePicker\";\r\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\r\nimport { DateTimeTypeConverterBase } from \"../converters/DateTimeTypeConverter\";\r\nimport { BodyText } from \"@itwin/core-react\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\n\r\n// cSpell:ignore datepicker\r\n\r\n/** @internal */\r\ninterface DateTimeEditorState {\r\n value: Date;\r\n displayValue?: string;\r\n timeDisplay?: TimeDisplay;\r\n isDisabled?: boolean;\r\n typeConverter?: TypeConverter;\r\n editInUtc: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface DateTimeEditorProps extends PropertyEditorProps {\r\n showTime?: boolean;\r\n}\r\n\r\n/** DateTimeEditor React component that is a property editor for selection of date and time.\r\n * @internal\r\n */\r\nexport class DateTimeEditor extends React.PureComponent<DateTimeEditorProps, DateTimeEditorState> implements TypeEditor {\r\n private _isMounted = false;\r\n private _enterKey = false;\r\n private _divElement = React.createRef<HTMLDivElement>();\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DateTimeEditorState> = {\r\n value: new Date(),\r\n editInUtc: false,\r\n };\r\n\r\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\r\n const record = this.props.propertyRecord;\r\n let propertyValue: PropertyValue | undefined;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n propertyValue = {\r\n valueFormat: PropertyValueFormat.Primitive,\r\n value: this.state.value,\r\n displayValue: this.state.displayValue,\r\n };\r\n }\r\n\r\n return propertyValue;\r\n }\r\n\r\n public get htmlElement(): HTMLElement | null {\r\n return this._divElement.current;\r\n }\r\n\r\n public get hasFocus(): boolean {\r\n let containsFocus = false;\r\n // istanbul ignore else\r\n if (this.htmlElement)\r\n containsFocus = this.htmlElement.contains(document.activeElement);\r\n return containsFocus;\r\n }\r\n\r\n public async processDateChange(typeConverter: TypeConverter, newValue: Date): Promise<void> {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord) {\r\n const displayValue = await typeConverter.convertPropertyToString(this.props.propertyRecord.property, newValue);\r\n this.setState({\r\n value: newValue,\r\n displayValue,\r\n });\r\n }\r\n }\r\n\r\n private _handleChange = (newValue: Date): void => {\r\n // istanbul ignore else\r\n if (this._isMounted && this.state.typeConverter) {\r\n // istanbul ignore else\r\n if (this.state.editInUtc) {\r\n newValue = adjustDateToTimezone(newValue, newValue.getTimezoneOffset() * -1);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.processDateChange(this.state.typeConverter, newValue);\r\n }\r\n };\r\n\r\n private _handleTimeChange = (time: TimeSpec): void => {\r\n // Combine new time into selected Date\r\n if (this.state.editInUtc) {\r\n const newWorkingDate = adjustDateToTimezone(this.state.value, 0);\r\n newWorkingDate.setUTCHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n } else {\r\n const newWorkingDate = new Date(this.state.value.getTime());\r\n newWorkingDate.setHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\r\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n }\r\n\r\n private async setStateFromProps() {\r\n const record = this.props.propertyRecord;\r\n let initialValue: Date | undefined;\r\n let typeConverter: TypeConverter | undefined;\r\n let timeDisplay: TimeDisplay | undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n let editInUtc = false;\r\n\r\n // istanbul ignore else\r\n if (this.props.showTime)\r\n timeDisplay = TimeDisplay.H12MC;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n // istanbul ignore else\r\n if (record.value.value instanceof Date)\r\n initialValue = new Date(record.value.value);\r\n else if (typeof record.value.value === \"string\")\r\n initialValue = new Date(record.value.value);\r\n else if (record.value.value === undefined)\r\n initialValue = new Date();\r\n\r\n typeConverter = TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name);\r\n\r\n const options = record.property.converter?.options;\r\n if (options) {\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options) {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n timeDisplay = TimeDisplay.H24MS;\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n }\r\n\r\n if (\"timeDisplay\" in options && this.props.showTime) {\r\n timeDisplay = options.timeDisplay;\r\n // use 24 hr time display if alternateDateFormat is defined\r\n // istanbul ignore next\r\n if (alternateDateFormat && timeDisplay !== TimeDisplay.H24MS && timeDisplay !== TimeDisplay.H24M)\r\n timeDisplay = TimeDisplay.H24MS;\r\n }\r\n\r\n // istanbul ignore else\r\n if (alternateDateFormat) {\r\n editInUtc = true;\r\n\r\n if (this.props.showTime) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort) {\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n }\r\n } else {\r\n timeDisplay = undefined;\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 }\r\n }\r\n\r\n // istanbul ignore next\r\n if (!initialValue) {\r\n throw new Error(\"Bad Value\");\r\n }\r\n\r\n // istanbul ignore next\r\n if (!typeConverter) {\r\n throw new Error(\"Unable to determine TypeConverter\");\r\n }\r\n\r\n const isDisabled = record && !!record.isDisabled;\r\n const displayValue = await typeConverter.convertPropertyToString(record!.property, initialValue);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({\r\n value: initialValue,\r\n isDisabled,\r\n timeDisplay,\r\n typeConverter,\r\n displayValue,\r\n editInUtc,\r\n });\r\n }\r\n\r\n private _handleEnter = async (): Promise<void> => {\r\n this._enterKey = true;\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleClose = async (): Promise<void> => {\r\n if (this._enterKey) {\r\n this._enterKey = false;\r\n } else {\r\n // istanbul ignore next\r\n if (this.props.onCancel)\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleCancel = (_event: React.MouseEvent): void => {\r\n // istanbul ignore else\r\n if (this.props.onCancel) {\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleCommit = async (): Promise<void> => {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord && this.props.onCommit) {\r\n const propertyValue = await this.getPropertyValue();\r\n // istanbul ignore else\r\n if (propertyValue !== undefined) {\r\n this.props.onCommit({ propertyRecord: this.props.propertyRecord, newValue: propertyValue });\r\n }\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override render(): React.ReactNode {\r\n const date = this.state.editInUtc ? adjustDateToTimezone(this.state.value, 0) : this.state.value;\r\n const timeSpec: TimeSpec = {\r\n hours: date.getHours(),\r\n minutes: date.getMinutes(),\r\n seconds: date.getSeconds(),\r\n };\r\n\r\n const className = classnames(\"components-cell-editor\", \"components-datetime-editor\", this.props.className);\r\n\r\n return (\r\n <div className={className} ref={this._divElement}>\r\n <PopupButton label={this.state.displayValue} onClose={this._handleClose} onEnter={this._handleEnter}\r\n setFocus={this.props.setFocus}>\r\n <PopupContent>\r\n <>\r\n <div className=\"components-date-picker-calendar-popup-panel\" data-testid=\"components-date-picker-calendar-popup-panel\">\r\n <DatePicker selected={date} onDateChange={this._handleChange} showFocusOutline={false} />\r\n {this.state.timeDisplay &&\r\n <div className=\"time-container\">\r\n <BodyText className=\"time-label\">{\"Time\"}</BodyText>\r\n <TimeField time={timeSpec} timeDisplay={this.state.timeDisplay} onTimeChange={this._handleTimeChange} />\r\n </div>\r\n }\r\n </div>\r\n </>\r\n <PopupOkCancelButtons onOk={this._handleOk} onCancel={this._handleCancel} />\r\n </PopupContent>\r\n </PopupButton>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class ShortDateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={false} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class DateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={true} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\nPropertyEditorManager.registerEditor(StandardTypeNames.ShortDate, ShortDateTimePropertyEditor);\r\nPropertyEditorManager.registerEditor(StandardTypeNames.DateTime, DateTimePropertyEditor);\r\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropertyDescription } from "@itwin/appui-abstract";
|
|
3
|
+
import { PropertyFilterBuilderRuleOperatorProps } from "./FilterBuilderRuleOperator";
|
|
4
|
+
import { PropertyFilterBuilderRuleValueProps } from "./FilterBuilderRuleValue";
|
|
5
|
+
import { PropertyFilterBuilderActions, PropertyFilterBuilderRuleGroupItem } from "./FilterBuilderState";
|
|
6
|
+
import { PropertyFilter } from "./Types";
|
|
7
|
+
/** @alpha */
|
|
8
|
+
export interface PropertyFilterBuilderProps {
|
|
9
|
+
properties: PropertyDescription[];
|
|
10
|
+
onFilterChanged: (filter?: PropertyFilter) => void;
|
|
11
|
+
onRulePropertySelected?: (property: PropertyDescription) => void;
|
|
12
|
+
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
13
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueProps) => React.ReactNode;
|
|
14
|
+
ruleGroupDepthLimit?: number;
|
|
15
|
+
}
|
|
16
|
+
/** @alpha */
|
|
17
|
+
export interface PropertyFilterBuilderContextProps {
|
|
18
|
+
actions: PropertyFilterBuilderActions;
|
|
19
|
+
properties: PropertyDescription[];
|
|
20
|
+
onRulePropertySelected?: (property: PropertyDescription) => void;
|
|
21
|
+
ruleGroupDepthLimit?: number;
|
|
22
|
+
}
|
|
23
|
+
/** @alpha */
|
|
24
|
+
export declare const PropertyFilterBuilderContext: React.Context<PropertyFilterBuilderContextProps>;
|
|
25
|
+
/** @alpha */
|
|
26
|
+
export interface PropertyFilterBuilderRuleRenderingContextProps {
|
|
27
|
+
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
28
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueProps) => React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/** @alpha */
|
|
31
|
+
export declare const PropertyFilterBuilderRuleRenderingContext: React.Context<PropertyFilterBuilderRuleRenderingContextProps>;
|
|
32
|
+
/** @alpha */
|
|
33
|
+
export declare function PropertyFilterBuilder(props: PropertyFilterBuilderProps): JSX.Element;
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare function buildPropertyFilter(groupItem: PropertyFilterBuilderRuleGroupItem): PropertyFilter | undefined;
|
|
36
|
+
//# sourceMappingURL=FilterBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAC6B,4BAA4B,EAC9D,kCAAkC,EACnC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,aAAa;AACb,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,KAAK,IA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