@xh/hoist 56.5.0 → 56.6.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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 56.6.0 - 2023-06-01
4
+
5
+ ### 🎁 New Features
6
+ * New global property `AgGrid.DEFAULT_PROPS` to provide application wide defaults for any instances
7
+ of the `AgGrid` Component.
8
+
9
+ ### ⚙️ Technical
10
+ * The workaround of defaulting the AgGrid prop `suppressBrowserResizeObserver` to `true`, added in
11
+ v56.3.0, has been removed. This workaround can cause problems and should not be needed for upcoming
12
+ `AgGrid` versions. If you do need this setting for your application, please set it with the new
13
+ `DEFAULT_PROPS` property described above.
14
+
15
+ ### 🐞 Bug Fixes
16
+
17
+ * Fixed broken change handler for mobile inputs that wrap around Onsen UI inputs, including
18
+ `NumberInput`, `SearchInput`, and `TextInput`.
19
+
20
+ ### 📚 Libraries
21
+
22
+ * @blueprintjs/core `^4.14 -> ^4.20` (apps might have already updated to a newer minor version)
23
+ * dompurify `2.4 -> 3.0`
24
+
3
25
  ## 56.5.0 - 2023-05-26
4
26
 
5
27
  ### 🎁 New Features
@@ -82,9 +82,9 @@ export const [AgGrid, agGrid] = hoistCmp.withFactory<AgGridProps>({
82
82
  ),
83
83
  ...layoutProps,
84
84
  item: createElement(AgGridReact, {
85
+ ...AgGrid['DEFAULT_PROPS'],
85
86
  // Default some ag-grid props, but allow overriding.
86
87
  getRowHeight: impl.getRowHeight,
87
- suppressBrowserResizeObserver: true,
88
88
  // Pass others on directly.
89
89
  ...agGridProps,
90
90
 
@@ -123,6 +123,14 @@ export const [AgGrid, agGrid] = hoistCmp.withFactory<AgGridProps>({
123
123
  AgGrid.HEADER_HEIGHTS_MOBILE = {large: 42, standard: 38, compact: 34, tiny: 30};
124
124
  AgGrid.getHeaderHeightForSizingMode = mode =>
125
125
  (XH.isMobileApp ? AgGrid.HEADER_HEIGHTS_MOBILE : AgGrid.HEADER_HEIGHTS)[mode];
126
+
127
+ /**
128
+ * Default props to apply to all instances of the AgGrid Component in this application.
129
+ *
130
+ * Note that these settings will be overridden by any values provided by the application
131
+ * to any particular grid instance.
132
+ */
133
+ AgGrid.DEFAULT_PROPS = {};
126
134
  })(AgGrid);
127
135
 
128
136
  class AgGridLocalModel extends HoistModel {
@@ -8,7 +8,7 @@ import {ToastModel} from '@xh/hoist/appcontainer/ToastModel';
8
8
  import {ToastSourceModel} from '@xh/hoist/appcontainer/ToastSourceModel';
9
9
  import {div} from '@xh/hoist/cmp/layout';
10
10
  import {hoistCmp, HoistModel, useLocalModel, uses, lookup} from '@xh/hoist/core';
11
- import {Toaster, ToasterPosition} from '@xh/hoist/kit/blueprint';
11
+ import {OverlayToaster, ToasterPosition} from '@xh/hoist/kit/blueprint';
12
12
  import classNames from 'classnames';
13
13
  import {isElement, map} from 'lodash';
14
14
  import {wait} from '../../promise';
@@ -94,7 +94,7 @@ class ToastSourceLocalModel extends HoistModel {
94
94
  // We want to just memoize this by two args (one object)? Is there a library for this?
95
95
  const toasters = toasterMap.get(container) || {};
96
96
  if (!toasters[position])
97
- toasters[position] = Toaster.create({position, className}, container);
97
+ toasters[position] = OverlayToaster.create({position, className}, container);
98
98
  toasterMap.set(container, toasters);
99
99
  return toasters[position];
100
100
  }
@@ -4,24 +4,24 @@
4
4
  *
5
5
  * Copyright © 2023 Extremely Heavy Industries Inc.
6
6
  */
7
- import {elementFactory} from '@xh/hoist/core';
8
7
  import {
9
8
  Classes,
10
9
  ContextMenu,
11
10
  Dialog,
12
11
  FocusStyleManager,
13
- HotkeysProvider,
14
12
  type HotkeyConfig,
13
+ HotkeysProvider,
15
14
  Overlay,
15
+ OverlayToaster,
16
16
  Popover,
17
17
  PopoverInteractionKind,
18
18
  Position,
19
- Toaster,
20
19
  type ToasterPosition,
21
20
  useHotkeys
22
21
  } from '@blueprintjs/core';
23
22
  import '@blueprintjs/core/lib/css/blueprint.css';
24
23
  import '@blueprintjs/datetime/lib/css/blueprint-datetime.css';
24
+ import {elementFactory} from '@xh/hoist/core';
25
25
  import './styles.scss';
26
26
 
27
27
  // Only show focus indicators when tabbing through components - avoids drawing focus outlines
@@ -46,7 +46,7 @@ export {
46
46
  Classes,
47
47
  PopoverInteractionKind,
48
48
  Position,
49
- Toaster,
49
+ OverlayToaster,
50
50
  ToasterPosition
51
51
  };
52
52
  export * from './Wrappers';
@@ -254,7 +254,7 @@ const cmp = hoistCmp.factory<NumberInputModel>(
254
254
  },
255
255
  spellCheck: false,
256
256
 
257
- onChange: model.onValueChange,
257
+ onInput: model.onValueChange,
258
258
  onKeyDown: model.onKeyDown,
259
259
  onBlur: model.onBlur,
260
260
  onFocus: model.onFocus,
@@ -93,7 +93,7 @@ const cmp = hoistCmp.factory<SearchInputModel>(({model, className, ...props}, re
93
93
  textAlign: withDefault(props.textAlign, 'left')
94
94
  },
95
95
 
96
- onChange: model.onChange,
96
+ onInput: model.onChange,
97
97
  onKeyDown: model.onKeyDown,
98
98
  onBlur: model.onBlur,
99
99
  onFocus: model.onFocus,
@@ -130,7 +130,7 @@ const cmp = hoistCmp.factory<TextInputModel>(({model, className, ...props}, ref)
130
130
  className: 'xh-text-input__input',
131
131
  style: {textAlign: withDefault(props.textAlign, 'left')},
132
132
 
133
- onChange: model.onChange,
133
+ onInput: model.onChange,
134
134
  onKeyDown: model.onKeyDown,
135
135
  onBlur: model.onBlur,
136
136
  onFocus: model.onFocus
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "56.5.0",
3
+ "version": "56.6.0",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -30,8 +30,8 @@
30
30
  ]
31
31
  },
32
32
  "dependencies": {
33
- "@blueprintjs/core": "^4.14.1",
34
- "@blueprintjs/datetime": "^4.4.10",
33
+ "@blueprintjs/core": "^4.20.0",
34
+ "@blueprintjs/datetime": "^4.4.35",
35
35
  "@fortawesome/fontawesome-pro": "^6.2.1",
36
36
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
37
37
  "@fortawesome/pro-light-svg-icons": "^6.2.1",
@@ -87,7 +87,7 @@
87
87
  "@ag-grid-community/client-side-row-model": "29.x",
88
88
  "@ag-grid-community/core": "29.x",
89
89
  "@ag-grid-community/react": "29.x",
90
- "@xh/hoist-dev-utils": "^6.1.2",
90
+ "@xh/hoist-dev-utils": "^6.2.0",
91
91
  "eslint-config-prettier": "8.x",
92
92
  "eslint-plugin-tsdoc": "^0.2.17",
93
93
  "husky": "^8.0.3",
package/static/README.md CHANGED
@@ -19,9 +19,6 @@ within its `configureWebpack()` build script factory.
19
19
  * `preflight.js` - included by later HDU versions (see above) before any other Hoist or application
20
20
  code runs on the page. Used to start page load timing and run a low-level filter for browser
21
21
  compatibility.
22
- * `requiredBlueprintIcons.js` - included by HDU >= v5.2 as a (very) streamlined replacement for the
23
- full set of Blueprint JS icons otherwise required by that library. See the comment at the top of
24
- the file for additional details and links.
25
22
  * `spinner.png` - included by HDU >= 5.11 and embedded within static `index-no-inline.html` entry
26
23
  page to provide visual indicator that something is happening when JS app has yet to d/l and start.
27
24
 
@@ -1,28 +0,0 @@
1
- /**
2
- * This file replaces the MUCH larger versions included within the blueprintjs/icons dependency,
3
- * which itself is required by Blueprint core. This file is swapped in at build-time by the
4
- * `@xh/hoist-dev-utils` webpack config to only bundle the icons required by BP-based Hoist React
5
- * components, nicely reducing overall app bundle size.
6
- *
7
- * See https://github.com/xh/hoist-react/issues/1963 for further details, see the dev-utils
8
- * `configureWebpack()` method for the implementation referencing this file.
9
- */
10
- export const IconSvgPaths16 = {
11
- // used on context menu menuItem when a menu has submenus
12
- 'caret-right': ['M11 8c0-.15-.07-.28-.17-.37l-4-3.5A.495.495 0 006 4.5v7a.495.495 0 00.83.37l4-3.5c.1-.09.17-.22.17-.37z'],
13
- // used in datepicker's calendar scroll
14
- 'chevron-left': ['M7.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71l-4 4C5.11 7.47 5 7.72 5 8c0 .28.11.53.29.71l4 4a1.003 1.003 0 001.42-1.42L7.41 8z'],
15
- 'chevron-right': ['M10.71 7.29l-4-4a1.003 1.003 0 00-1.42 1.42L8.59 8 5.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71l4-4c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z'],
16
- // used on toast close buttons
17
- 'cross': ['M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z'],
18
- // used on dialog close buttons
19
- 'small-cross': ['M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 00-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z']
20
-
21
- };
22
- export const IconSvgPaths20 = {
23
- 'caret-right': ['M14 10c0-.31-.15-.57-.37-.76l.01-.01-6-5-.01.01C7.46 4.1 7.24 4 7 4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1 .24 0 .46-.1.63-.24l.01.01 6-5-.01-.01c.22-.19.37-.45.37-.76z'],
24
- 'chevron-left': ['M8.41 10l5.29-5.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71l-6 6c-.18.18-.29.43-.29.71 0 .28.11.53.29.71l6 6a1.003 1.003 0 001.42-1.42L8.41 10z'],
25
- 'chevron-right': ['M13.71 9.29l-6-6a1.003 1.003 0 00-1.42 1.42l5.3 5.29-5.29 5.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71l6-6c.18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z'],
26
- 'cross': ['M11.41 10l4.29-4.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L10 8.59l-4.29-4.3a1.003 1.003 0 00-1.42 1.42L8.59 10 4.3 14.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71l4.29-4.3 4.29 4.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L11.41 10z'],
27
- 'small-cross': ['M11.41 10l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L10 8.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L8.59 10 5.3 13.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71l3.29-3.3 3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L11.41 10z']
28
- };