@genesislcap/g2plot-chart 14.424.1 → 14.425.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.
@@ -1 +1 @@
1
- {"version":3,"file":"chart-datasource.d.ts","sourceRoot":"","sources":["../../../src/chart-datasource/chart-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAIrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAQhD,cAAM,kBAAmB,SAAQ,cAAc;IAC7C,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAC7B,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAChE,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,iBAAiB,UAAS;IACpC,SAAS,CAAC,OAAO,UAAQ;IAEzB,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAID,SAAS;IAMT,iBAAiB,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE;IAuCtC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE;IAQvC,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE;IAQtC,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE;CAUvC;;;;;;;kBAtCM,CAAC;;;;;;;;8BAgEL,CAAA,cAAc,CAAC;;;;;;;;;;;;;;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;IACH,WAAW,CAAC,MAAM,EAAE,kCAAkC,GAAG,IAAI;IAY7D;;OAEG;IACM,oBAAoB,IAAI,IAAI;IAQrC;;OAEG;IACa,gBAAgB,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvE,OAAO,CAAC,kBAAkB;IAuC1B,OAAO,CAAC,gCAAgC;IAiBxC;;OAEG;IACH,IAAI,oBAAoB,IAAI,OAAO,CAElC;IAED;;OAEG;IACH,IAAI,mBAAmB,IAAI,OAAO,CAEjC;IAED,OAAO,CAAC,uBAAuB;CAOhC"}
@@ -3,7 +3,7 @@ import { DatasourceDefaults } from '@genesislcap/foundation-comms';
3
3
  import { createLogger } from '@genesislcap/foundation-logger';
4
4
  import { BaseDatasource } from '@genesislcap/foundation-ui';
5
5
  import { LifecycleMixin } from '@genesislcap/foundation-utils';
6
- import { DOM, attr, customElement, observable } from '@microsoft/fast-element';
6
+ import { attr, customElement, observable } from '@microsoft/fast-element';
7
7
  import { chartDatasourceEventNames } from './chart-datasource.config';
8
8
  import { extractFields, getFormattedDateGroupBy, getReduced } from './chart-datasource.utils';
9
9
  const logger = createLogger('chart-datasource');
@@ -167,11 +167,9 @@ let ChartDatasource = class ChartDatasource extends LifecycleMixin(ConcreteDatas
167
167
  connectedCallback() {
168
168
  super.connectedCallback();
169
169
  const shouldRunConnect = this.shouldRunConnect;
170
- DOM.queueUpdate(() => {
171
- if (!shouldRunConnect)
172
- return;
173
- void this.initAndFetch();
174
- });
170
+ if (!shouldRunConnect)
171
+ return;
172
+ void this.initAndFetch();
175
173
  }
176
174
  initAndFetch() {
177
175
  return __awaiter(this, void 0, void 0, function* () {
package/dist/react.cjs CHANGED
@@ -5,23 +5,51 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const { provideReactWrapper } = require('@microsoft/fast-react-wrapper');
9
8
  const React = require('react');
10
9
  const { ChartDatasource: ChartDatasourceWC } = require('./esm/chart-datasource/chart-datasource.js');
11
10
  const { G2PlotChart: G2PlotChartWC } = require('./esm/chart.js');
12
11
 
13
- const { wrap } = provideReactWrapper(React);
12
+ function _mergeRefs(...refs) {
13
+ return (value) => {
14
+ for (const ref of refs) {
15
+ if (typeof ref === 'function') ref(value);
16
+ else if (ref != null) ref.current = value;
17
+ }
18
+ };
19
+ }
14
20
 
15
- const G2PlotChart = wrap(G2PlotChartWC, {
16
- events: {
17
- onChangeTitle: 'change-title',
18
- },
21
+ const G2PlotChart = React.forwardRef(function G2PlotChart(props, ref) {
22
+ const { onChangeTitle, children, ...rest } = props;
23
+ const _innerRef = React.useRef(null);
24
+ const _onChangeTitleRef = React.useRef(onChangeTitle);
25
+ _onChangeTitleRef.current = onChangeTitle;
26
+ React.useLayoutEffect(() => {
27
+ const el = _innerRef.current;
28
+ if (!el) return;
29
+ const _onChangeTitleFn = (e) => _onChangeTitleRef.current?.(e);
30
+ el.addEventListener('change-title', _onChangeTitleFn);
31
+ return () => {
32
+ el.removeEventListener('change-title', _onChangeTitleFn);
33
+ };
34
+ }, []);
35
+ return React.createElement(customElements.getName(G2PlotChartWC) ?? '%%prefix%%-g2plot-chart', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
19
36
  });
20
37
 
21
- const ChartDatasource = wrap(ChartDatasourceWC, {
22
- events: {
23
- onDatasourceError: 'datasource-error',
24
- },
38
+ const ChartDatasource = React.forwardRef(function ChartDatasource(props, ref) {
39
+ const { onDatasourceError, children, ...rest } = props;
40
+ const _innerRef = React.useRef(null);
41
+ const _onDatasourceErrorRef = React.useRef(onDatasourceError);
42
+ _onDatasourceErrorRef.current = onDatasourceError;
43
+ React.useLayoutEffect(() => {
44
+ const el = _innerRef.current;
45
+ if (!el) return;
46
+ const _onDatasourceErrorFn = (e) => _onDatasourceErrorRef.current?.(e);
47
+ el.addEventListener('datasource-error', _onDatasourceErrorFn);
48
+ return () => {
49
+ el.removeEventListener('datasource-error', _onDatasourceErrorFn);
50
+ };
51
+ }, []);
52
+ return React.createElement(customElements.getName(ChartDatasourceWC) ?? 'chart-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
25
53
  });
26
54
 
27
55
  module.exports = {
package/dist/react.mjs CHANGED
@@ -3,21 +3,49 @@
3
3
  * Generated from custom-elements manifest.
4
4
  */
5
5
 
6
- import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
7
6
  import React from 'react';
8
7
  import { ChartDatasource as ChartDatasourceWC } from './esm/chart-datasource/chart-datasource.js';
9
8
  import { G2PlotChart as G2PlotChartWC } from './esm/chart.js';
10
9
 
11
- const { wrap } = provideReactWrapper(React);
10
+ function _mergeRefs(...refs) {
11
+ return (value) => {
12
+ for (const ref of refs) {
13
+ if (typeof ref === 'function') ref(value);
14
+ else if (ref != null) ref.current = value;
15
+ }
16
+ };
17
+ }
12
18
 
13
- export const G2PlotChart = wrap(G2PlotChartWC, {
14
- events: {
15
- onChangeTitle: 'change-title',
16
- },
19
+ export const G2PlotChart = React.forwardRef(function G2PlotChart(props, ref) {
20
+ const { onChangeTitle, children, ...rest } = props;
21
+ const _innerRef = React.useRef(null);
22
+ const _onChangeTitleRef = React.useRef(onChangeTitle);
23
+ _onChangeTitleRef.current = onChangeTitle;
24
+ React.useLayoutEffect(() => {
25
+ const el = _innerRef.current;
26
+ if (!el) return;
27
+ const _onChangeTitleFn = (e) => _onChangeTitleRef.current?.(e);
28
+ el.addEventListener('change-title', _onChangeTitleFn);
29
+ return () => {
30
+ el.removeEventListener('change-title', _onChangeTitleFn);
31
+ };
32
+ }, []);
33
+ return React.createElement(customElements.getName(G2PlotChartWC) ?? '%%prefix%%-g2plot-chart', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
17
34
  });
18
35
 
19
- export const ChartDatasource = wrap(ChartDatasourceWC, {
20
- events: {
21
- onDatasourceError: 'datasource-error',
22
- },
36
+ export const ChartDatasource = React.forwardRef(function ChartDatasource(props, ref) {
37
+ const { onDatasourceError, children, ...rest } = props;
38
+ const _innerRef = React.useRef(null);
39
+ const _onDatasourceErrorRef = React.useRef(onDatasourceError);
40
+ _onDatasourceErrorRef.current = onDatasourceError;
41
+ React.useLayoutEffect(() => {
42
+ const el = _innerRef.current;
43
+ if (!el) return;
44
+ const _onDatasourceErrorFn = (e) => _onDatasourceErrorRef.current?.(e);
45
+ el.addEventListener('datasource-error', _onDatasourceErrorFn);
46
+ return () => {
47
+ el.removeEventListener('datasource-error', _onDatasourceErrorFn);
48
+ };
49
+ }, []);
50
+ return React.createElement(customElements.getName(ChartDatasourceWC) ?? 'chart-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
23
51
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/g2plot-chart",
3
3
  "description": "Genesis G2plot Chart",
4
- "version": "14.424.1",
4
+ "version": "14.425.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -53,21 +53,21 @@
53
53
  }
54
54
  },
55
55
  "devDependencies": {
56
- "@genesislcap/foundation-testing": "14.424.1",
57
- "@genesislcap/genx": "14.424.1",
58
- "@genesislcap/rollup-builder": "14.424.1",
59
- "@genesislcap/ts-builder": "14.424.1",
60
- "@genesislcap/uvu-playwright-builder": "14.424.1",
61
- "@genesislcap/vite-builder": "14.424.1",
62
- "@genesislcap/webpack-builder": "14.424.1"
56
+ "@genesislcap/foundation-testing": "14.425.0",
57
+ "@genesislcap/genx": "14.425.0",
58
+ "@genesislcap/rollup-builder": "14.425.0",
59
+ "@genesislcap/ts-builder": "14.425.0",
60
+ "@genesislcap/uvu-playwright-builder": "14.425.0",
61
+ "@genesislcap/vite-builder": "14.425.0",
62
+ "@genesislcap/webpack-builder": "14.425.0"
63
63
  },
64
64
  "dependencies": {
65
65
  "@antv/g2plot": "^2.4.32",
66
- "@genesislcap/foundation-comms": "14.424.1",
67
- "@genesislcap/foundation-logger": "14.424.1",
68
- "@genesislcap/foundation-ui": "14.424.1",
69
- "@genesislcap/foundation-utils": "14.424.1",
70
- "@genesislcap/foundation-zero": "14.424.1",
66
+ "@genesislcap/foundation-comms": "14.425.0",
67
+ "@genesislcap/foundation-logger": "14.425.0",
68
+ "@genesislcap/foundation-ui": "14.425.0",
69
+ "@genesislcap/foundation-utils": "14.425.0",
70
+ "@genesislcap/foundation-zero": "14.425.0",
71
71
  "@microsoft/fast-element": "1.14.0",
72
72
  "@microsoft/fast-foundation": "2.50.0"
73
73
  },
@@ -91,8 +91,5 @@
91
91
  "require": "./dist/react.cjs"
92
92
  }
93
93
  },
94
- "peerDependencies": {
95
- "@microsoft/fast-react-wrapper": ">=0.3.0"
96
- },
97
- "gitHead": "04bb18a6f0b26506a9d87ab252ce9e2329219a5e"
94
+ "gitHead": "c49bb94fbc3a74e84f18c7445398af116e1a58bb"
98
95
  }