@things-factory/grist-ui 4.3.122 → 4.3.123

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,13 +1,14 @@
1
1
  import './data-report/data-report-component'
2
2
 
3
- import { LitElement, css, html } from 'lit'
3
+ import { css, html, LitElement } from 'lit'
4
4
 
5
- import { DataProvider } from './data-provider'
6
- import { buildColumn } from './configure/column-builder'
7
- import { buildConfig } from './configure/config-builder'
8
5
  import { i18next } from '@things-factory/i18n-base'
9
6
  import { pulltorefresh } from '@things-factory/utils'
10
7
 
8
+ import { buildColumn } from './configure/column-builder'
9
+ import { buildConfig } from './configure/config-builder'
10
+ import { DataProvider } from './data-provider'
11
+
11
12
  const DEFAULT_DATA = {
12
13
  page: 1,
13
14
  limit: 20,
@@ -226,7 +227,7 @@ export class DataReport extends LitElement {
226
227
  /* 처음 만드는 total records */
227
228
  let record = sortedRecords[0]
228
229
  let totalBase = totals.reduce((base, field) => {
229
- base[field] = record[field]
230
+ base[field] = columns.find(col => col.name == field)?.rowCount ? 1 : record[field]
230
231
  return base
231
232
  }, {})
232
233
  let groupBase = {}
@@ -297,7 +298,7 @@ export class DataReport extends LitElement {
297
298
  (isSameGroupRecord && groupValues[group.column] === lastGroupValues[group.column])
298
299
  ) {
299
300
  for (let field of totals) {
300
- totalRecord[field] += record[field]
301
+ totalRecord[field] += columns.find(col => col.name == field)?.rowCount ? 1 : record[field]
301
302
  }
302
303
 
303
304
  totalRecord['*'].rowspan++
@@ -316,7 +317,7 @@ export class DataReport extends LitElement {
316
317
  idx,
317
318
  record: totals.reduce(
318
319
  (sum, field) => {
319
- sum[field] = record[field]
320
+ sum[field] = columns.find(col => col.name == field)?.rowCount ? 1 : record[field]
320
321
  return sum
321
322
  },
322
323
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/grist-ui",
3
- "version": "4.3.122",
3
+ "version": "4.3.123",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -34,5 +34,5 @@
34
34
  "lodash-es": "^4.17.15",
35
35
  "underscore": "^1.11.0"
36
36
  },
37
- "gitHead": "3edd80e6ca68480b22ee0e25eba34d13ab0e49f1"
37
+ "gitHead": "4b257504bfc8c0a626dd90dc0216abb7ca30d8d3"
38
38
  }