@operato/data-grist 10.29.66 → 10.29.68
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 +34 -0
- package/dist/src/accumulator/accumulator.d.ts +3 -1
- package/dist/src/accumulator/accumulator.js +9 -0
- package/dist/src/accumulator/accumulator.js.map +1 -1
- package/dist/src/data-card/data-card-field.js +41 -4
- package/dist/src/data-card/data-card-field.js.map +1 -1
- package/dist/src/data-card/data-card-gutter.js +0 -4
- package/dist/src/data-card/data-card-gutter.js.map +1 -1
- package/dist/src/data-card/data-card.d.ts +1 -0
- package/dist/src/data-card/data-card.js +65 -0
- package/dist/src/data-card/data-card.js.map +1 -1
- package/dist/src/data-card/record-card.js +85 -13
- package/dist/src/data-card/record-card.js.map +1 -1
- package/dist/src/data-consumer.d.ts +2 -1
- package/dist/src/data-consumer.js.map +1 -1
- package/dist/src/data-grid/data-grid-body-style.js +14 -0
- package/dist/src/data-grid/data-grid-body-style.js.map +1 -1
- package/dist/src/data-grid/data-grid-body.js +16 -8
- package/dist/src/data-grid/data-grid-body.js.map +1 -1
- package/dist/src/data-grid/data-grid-field.d.ts +2 -0
- package/dist/src/data-grid/data-grid-field.js +35 -0
- package/dist/src/data-grid/data-grid-field.js.map +1 -1
- package/dist/src/data-grist.d.ts +11 -0
- package/dist/src/data-grist.js +38 -12
- package/dist/src/data-grist.js.map +1 -1
- package/dist/src/data-provider.js +1 -1
- package/dist/src/data-provider.js.map +1 -1
- package/dist/src/data-report.d.ts +1 -1
- package/dist/src/data-report.js +1 -1
- package/dist/src/data-report.js.map +1 -1
- package/dist/src/filters/filter-select-buttons.js +4 -1
- package/dist/src/filters/filter-select-buttons.js.map +1 -1
- package/dist/src/filters/filters-form.js +14 -5
- package/dist/src/filters/filters-form.js.map +1 -1
- package/dist/src/group-heading.d.ts +10 -0
- package/dist/src/group-heading.js +34 -0
- package/dist/src/group-heading.js.map +1 -0
- package/dist/src/renderers/ox-grist-renderer-text.js +2 -1
- package/dist/src/renderers/ox-grist-renderer-text.js.map +1 -1
- package/dist/test/card-selector.test.d.ts +1 -0
- package/dist/test/card-selector.test.js +58 -0
- package/dist/test/card-selector.test.js.map +1 -0
- package/dist/test/card-totals-narrow.test.d.ts +1 -0
- package/dist/test/card-totals-narrow.test.js +103 -0
- package/dist/test/card-totals-narrow.test.js.map +1 -0
- package/dist/test/filter-labels.test.js +22 -0
- package/dist/test/filter-labels.test.js.map +1 -1
- package/dist/test/filter-select-buttons-count.test.d.ts +1 -0
- package/dist/test/filter-select-buttons-count.test.js +35 -0
- package/dist/test/filter-select-buttons-count.test.js.map +1 -0
- package/dist/test/filters-phone-wrap.test.d.ts +1 -0
- package/dist/test/filters-phone-wrap.test.js +17 -0
- package/dist/test/filters-phone-wrap.test.js.map +1 -0
- package/dist/test/group-heading.test.d.ts +1 -0
- package/dist/test/group-heading.test.js +187 -0
- package/dist/test/group-heading.test.js.map +1 -0
- package/dist/test/request-generation.test.js +1 -1
- package/dist/test/request-generation.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/test/card-selector.test.ts +68 -0
- package/test/card-totals-narrow.test.ts +128 -0
- package/test/filter-labels.test.ts +23 -0
- package/test/filter-select-buttons-count.test.ts +37 -0
- package/test/filters-phone-wrap.test.ts +22 -0
- package/test/group-heading.test.ts +221 -0
- package/test/request-generation.test.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [10.29.68](https://github.com/hatiolab/operato/compare/v10.29.67...v10.29.68) (2026-11-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
* **data-grist:** a card holds the rows under it ([9e6024a](https://github.com/hatiolab/operato/commit/9e6024a3d5315a26794e2a79ba42285a9e73ee88))
|
|
12
|
+
* **data-grist:** a child row steps in at its first column; a child in a card takes two lines ([d0de21d](https://github.com/hatiolab/operato/commit/d0de21dc2d5ae4b78ff8a878aa81c20c20879941))
|
|
13
|
+
* **data-grist:** a totals card in card mode, and a narrow mode chosen by the grist's own width ([83df1da](https://github.com/hatiolab/operato/commit/83df1da292bd36c53825528032aa0dbc2105e980))
|
|
14
|
+
* **data-grist:** group headings in the grid and the card list ([b0e5097](https://github.com/hatiolab/operato/commit/b0e509701d4880b1463b8472e2033061d0be9434))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### :bug: Bug Fix
|
|
18
|
+
|
|
19
|
+
* **data-grist:** a card detail's label is as wide as its words ([9d6851f](https://github.com/hatiolab/operato/commit/9d6851f8501e2d5ff2715f3edd421b74f77459c9))
|
|
20
|
+
* **data-grist:** a card field with nothing to show takes no place ([68a8cc6](https://github.com/hatiolab/operato/commit/68a8cc69f0f62802697af5deee866f78efd366a0))
|
|
21
|
+
* **data-grist:** a card's checkbox stands beside its title ([832427d](https://github.com/hatiolab/operato/commit/832427d56f0b71d5ed5537037c4389883db06724))
|
|
22
|
+
* **data-grist:** a filter's name keeps its line when the form is narrow ([e664951](https://github.com/hatiolab/operato/commit/e66495167ecd8c4145903f44a0076c835566d692))
|
|
23
|
+
* **data-grist:** a link in a grid or card field reads as the text around it ([7e5eac5](https://github.com/hatiolab/operato/commit/7e5eac5794eb0e0eb7dadc9691dbdf3fd979aa4e))
|
|
24
|
+
* **data-grist:** a page button in a grid or card field takes the page's look ([36a53e0](https://github.com/hatiolab/operato/commit/36a53e067b0e443415c04bacf330c77d2859da8d))
|
|
25
|
+
* **data-grist:** an empty text renders nothing ([a461241](https://github.com/hatiolab/operato/commit/a4612411aef6a609b816fde4d4eca6cedee2cf89))
|
|
26
|
+
* **data-grist:** filters wrap in rows on a phone ([daa68e6](https://github.com/hatiolab/operato/commit/daa68e62ba66c25f76c6d33af6c498ef5ecb6469))
|
|
27
|
+
* **data-grist:** the children in a card stand apart ([5ccdf63](https://github.com/hatiolab/operato/commit/5ccdf637bba0510ab0ff4d47933b322800ec573c))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### [10.29.67](https://github.com/hatiolab/operato/compare/v10.29.66...v10.29.67) (2026-11-02)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### :rocket: New Features
|
|
35
|
+
|
|
36
|
+
* **data-grist:** a select-buttons filter passes each option's count and hint to its chip ([2dd8e4b](https://github.com/hatiolab/operato/commit/2dd8e4b0764dffeea7068e9414c8c3a6996c2bcd))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
6
40
|
### [10.29.66](https://github.com/hatiolab/operato/compare/v10.29.65...v10.29.66) (2026-11-01)
|
|
7
41
|
|
|
8
42
|
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { AccumulatorObject, ColumnConfig, GristData } from '../types.js';
|
|
1
|
+
import { AccumulatorObject, ColumnConfig, GristData, GristRecord } from '../types.js';
|
|
2
2
|
export declare function accumulate(data: GristData, column: ColumnConfig, accumulator: AccumulatorObject): string | number;
|
|
3
|
+
/** The totals of the shown records: a value for each column that names an accumulator. The grid's totals row and the card list's totals card both draw this record. */
|
|
4
|
+
export declare function accumulateRecord(data: GristData, columns: ColumnConfig[]): GristRecord;
|
|
@@ -39,4 +39,13 @@ export function accumulate(data, column, accumulator) {
|
|
|
39
39
|
}
|
|
40
40
|
return func.call(null, data, column);
|
|
41
41
|
}
|
|
42
|
+
/** The totals of the shown records: a value for each column that names an accumulator. The grid's totals row and the card list's totals card both draw this record. */
|
|
43
|
+
export function accumulateRecord(data, columns) {
|
|
44
|
+
return columns.reduce((record, column) => {
|
|
45
|
+
if (column.accumulator) {
|
|
46
|
+
record[column.name] = accumulate(data, column, column.accumulator);
|
|
47
|
+
}
|
|
48
|
+
return record;
|
|
49
|
+
}, {});
|
|
50
|
+
}
|
|
42
51
|
//# sourceMappingURL=accumulator.js.map
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../types.js'\n\nfunction sum(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return data.records\n .filter(record => !Number.isNaN(record[name]))\n .reduce((sum, record) => {\n return sum + Number(record[name] || 0)\n }, 0)\n}\n\nfunction avg(data: GristData, column: ColumnConfig): number {\n const name = column.name\n const effectiveRecords = data.records.filter(record => !Number.isNaN(record[name]))\n\n return (\n effectiveRecords.reduce((sum, record) => {\n return sum + Number(record[name] || 0)\n }, 0) / effectiveRecords.length\n )\n}\n\nfunction count(data: GristData, column: ColumnConfig): number {\n return data.records.length\n}\n\nfunction min(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return Math.min.apply(\n null,\n data.records.filter(record => !Number.isNaN(record[name])).map(record => Number(record[name] || 0))\n )\n}\n\nfunction max(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return Math.max.apply(\n null,\n data.records.filter(record => !Number.isNaN(record[name])).map(record => Number(record[name] || 0))\n )\n}\n\nconst Accumulators: { [name: string]: (data: GristData, column: ColumnConfig) => string | number } = {\n sum,\n avg,\n count,\n min,\n max\n}\n\nexport function accumulate(data: GristData, column: ColumnConfig, accumulator: AccumulatorObject) {\n accumulator = typeof accumulator === 'object' ? accumulator.type : accumulator\n var func = accumulator as (data: GristData, column: ColumnConfig) => string | number\n\n if (typeof accumulator == 'string') {\n func = Accumulators[accumulator]\n }\n\n return func.call(null, data, column)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"accumulator.js","sourceRoot":"","sources":["../../../src/accumulator/accumulator.ts"],"names":[],"mappings":"AAEA,SAAS,GAAG,CAAC,IAAe,EAAE,MAAoB;IAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;IAExB,OAAO,IAAI,CAAC,OAAO;SAChB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SAC7C,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;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n\nfunction sum(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return data.records\n .filter(record => !Number.isNaN(record[name]))\n .reduce((sum, record) => {\n return sum + Number(record[name] || 0)\n }, 0)\n}\n\nfunction avg(data: GristData, column: ColumnConfig): number {\n const name = column.name\n const effectiveRecords = data.records.filter(record => !Number.isNaN(record[name]))\n\n return (\n effectiveRecords.reduce((sum, record) => {\n return sum + Number(record[name] || 0)\n }, 0) / effectiveRecords.length\n )\n}\n\nfunction count(data: GristData, column: ColumnConfig): number {\n return data.records.length\n}\n\nfunction min(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return Math.min.apply(\n null,\n data.records.filter(record => !Number.isNaN(record[name])).map(record => Number(record[name] || 0))\n )\n}\n\nfunction max(data: GristData, column: ColumnConfig): number {\n const name = column.name\n\n return Math.max.apply(\n null,\n data.records.filter(record => !Number.isNaN(record[name])).map(record => Number(record[name] || 0))\n )\n}\n\nconst Accumulators: { [name: string]: (data: GristData, column: ColumnConfig) => string | number } = {\n sum,\n avg,\n count,\n min,\n max\n}\n\nexport function accumulate(data: GristData, column: ColumnConfig, accumulator: AccumulatorObject) {\n accumulator = typeof accumulator === 'object' ? accumulator.type : accumulator\n var func = accumulator as (data: GristData, column: ColumnConfig) => string | number\n\n if (typeof accumulator == 'string') {\n func = Accumulators[accumulator]\n }\n\n return func.call(null, data, column)\n}\n\n/** The totals of the shown records: a value for each column that names an accumulator. The grid's totals row and the card list's totals card both draw this record. */\nexport function accumulateRecord(data: GristData, columns: ColumnConfig[]): GristRecord {\n return columns.reduce((record, column) => {\n if (column.accumulator) {\n record[column.name] = accumulate(data, column, column.accumulator)\n }\n return record\n }, {} as GristRecord)\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { ButtonStyles } from '@operato/styles';
|
|
4
5
|
import { TooltipReactiveController } from '@operato/utils';
|
|
5
6
|
import { ZERO_COLUMN, ZERO_RECORD } from '../configure/zero-config.js';
|
|
6
7
|
let DataCardField = class DataCardField extends LitElement {
|
|
@@ -19,16 +20,28 @@ let DataCardField = class DataCardField extends LitElement {
|
|
|
19
20
|
render() {
|
|
20
21
|
var { value, column, record, rowIndex } = this;
|
|
21
22
|
var { label, record: { renderer: recordRenderer } } = column;
|
|
23
|
+
/*
|
|
24
|
+
* A field with nothing to show takes no place. A label stood alone with no value after it - 「건수」 on a record
|
|
25
|
+
* that has no count (Office management check, 2026-11-06).
|
|
26
|
+
*/
|
|
27
|
+
const shown = recordRenderer(value, column, record, rowIndex, this);
|
|
28
|
+
const empty = shown === '' || shown === null || shown === undefined;
|
|
29
|
+
this.toggleAttribute('empty', empty);
|
|
30
|
+
if (empty) {
|
|
31
|
+
return html ``;
|
|
32
|
+
}
|
|
22
33
|
if (typeof label == 'object') {
|
|
23
34
|
let { renderer: labelRenderer } = label;
|
|
24
|
-
return html `<label>${labelRenderer(column)}</label>${
|
|
35
|
+
return html `<label>${labelRenderer(column)}</label>${shown}`;
|
|
25
36
|
}
|
|
26
37
|
else {
|
|
27
|
-
return html `${
|
|
38
|
+
return html `${shown}`;
|
|
28
39
|
}
|
|
29
40
|
}
|
|
30
41
|
};
|
|
31
42
|
DataCardField.styles = [
|
|
43
|
+
/* A page button a renderer returns takes the page's look (zero specificity), as in a grid cell. */
|
|
44
|
+
ButtonStyles,
|
|
32
45
|
css `
|
|
33
46
|
:host {
|
|
34
47
|
display: flex;
|
|
@@ -44,6 +57,10 @@ DataCardField.styles = [
|
|
|
44
57
|
font: inherit;
|
|
45
58
|
}
|
|
46
59
|
|
|
60
|
+
:host([empty]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
47
64
|
:host([thumbnail]) {
|
|
48
65
|
flex-direction: column;
|
|
49
66
|
justify-content: center;
|
|
@@ -76,14 +93,34 @@ DataCardField.styles = [
|
|
|
76
93
|
display: none;
|
|
77
94
|
}
|
|
78
95
|
|
|
96
|
+
/*
|
|
97
|
+
The label is as wide as its words. It was a third of the field, but a detail field is only as wide as what it
|
|
98
|
+
holds (record-card [detail] does not stretch it), so the third was of a width the label itself made: it cut
|
|
99
|
+
the label to 「주…」 and the value to 「2020-01-…」 (Office shareholder register, 2026-11-06).
|
|
100
|
+
*/
|
|
79
101
|
label {
|
|
80
102
|
flex: none;
|
|
81
|
-
|
|
82
|
-
padding
|
|
103
|
+
/* the room before the value: :host > * takes every margin away, and a gap on the host is not counted in its width */
|
|
104
|
+
padding: 0 var(--spacing-small, 4px) 2px 0;
|
|
83
105
|
font: var(--data-card-item-etc-label-font);
|
|
84
106
|
text-transform: capitalize;
|
|
85
107
|
}
|
|
86
108
|
|
|
109
|
+
/*
|
|
110
|
+
A link a renderer returns reads as the text around it and underlines on hover - the ground the page frames
|
|
111
|
+
lay (@operato/styles page-frame-styles). Without it, a link in a field came up in the browser's blue,
|
|
112
|
+
underlined (Office management check, 2026-11-06). The link renderer sets the same inline.
|
|
113
|
+
*/
|
|
114
|
+
a {
|
|
115
|
+
color: inherit;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
a:hover,
|
|
120
|
+
a:focus-visible {
|
|
121
|
+
text-decoration: underline;
|
|
122
|
+
}
|
|
123
|
+
|
|
87
124
|
:host([name]) > span,
|
|
88
125
|
label + a {
|
|
89
126
|
display: block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-card-field.js","sourceRoot":"","sources":["../../../src/data-card/data-card-field.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,WAAW,EA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E,CAAC;YACV,OAAO,IAAI,CAAA,EAAE,CAAA;QACf,CAAC;QAED,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;YACvC,OAAO,IAAI,CAAA,UAAU,aAAa,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,CAAA;QAC9D,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAA,GAAG,KAAK,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;;AArJM,oBAAM,GAAG;IACd,mGAAmG;IACnG,YAAY;IACZ,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyGF;CACF,AA7GY,CA6GZ;AAS8B;IAA9B,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;4CAAe;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAkC;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAe;AA3H/B,aAAa;IADzB,aAAa,CAAC,eAAe,CAAC;GAClB,aAAa,CAuJzB","sourcesContent":["import { css, html, LitElement, TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ButtonStyles } from '@operato/styles'\nimport { TooltipReactiveController } from '@operato/utils'\n\nimport { ZERO_COLUMN, ZERO_RECORD } from '../configure/zero-config.js'\nimport { ColumnConfig, GristRecord } from '../types.js'\n\n@customElement('ox-card-field')\nexport class DataCardField extends LitElement {\n static styles = [\n /* A page button a renderer returns takes the page's look (zero specificity), as in a grid cell. */\n ButtonStyles,\n css`\n :host {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n\n /* 렌더러가 맨 글자를 돌려주면 :host > * 규칙이 닿지 않는다. 카드 밖으로 흐르지 않게 자른다. */\n overflow: hidden;\n min-width: 0;\n white-space: nowrap;\n\n font: inherit;\n }\n\n :host([empty]) {\n display: none;\n }\n\n :host([thumbnail]) {\n flex-direction: column;\n justify-content: center;\n }\n\n :host([thumbnail]) > * {\n object-fit: contain;\n max-width: 100%;\n max-height: 100%;\n /* 그림 본체 모서리도 둥글게 — wrapper 의 radius 와 동일 (record-card 의\n * [thumbnail] wrapper 와 같은 변수 / fallback). */\n border-radius: var(--data-card-thumbnail-radius, var(--md-sys-shape-corner-small));\n }\n\n :host > * {\n margin: var(--spacing-none);\n\n overflow: hidden;\n\n text-overflow: ellipsis;\n text-align: left;\n }\n\n :host > *[center] {\n flex: none;\n margin: var(--spacing-none) auto;\n }\n\n :host([name]) label {\n display: none;\n }\n\n /*\n The label is as wide as its words. It was a third of the field, but a detail field is only as wide as what it\n holds (record-card [detail] does not stretch it), so the third was of a width the label itself made: it cut\n the label to 「주…」 and the value to 「2020-01-…」 (Office shareholder register, 2026-11-06).\n */\n label {\n flex: none;\n /* the room before the value: :host > * takes every margin away, and a gap on the host is not counted in its width */\n padding: 0 var(--spacing-small, 4px) 2px 0;\n font: var(--data-card-item-etc-label-font);\n text-transform: capitalize;\n }\n\n /*\n A link a renderer returns reads as the text around it and underlines on hover - the ground the page frames\n lay (@operato/styles page-frame-styles). Without it, a link in a field came up in the browser's blue,\n underlined (Office management check, 2026-11-06). The link renderer sets the same inline.\n */\n a {\n color: inherit;\n text-decoration: none;\n }\n\n a:hover,\n a:focus-visible {\n text-decoration: underline;\n }\n\n :host([name]) > span,\n label + a {\n display: block;\n min-width: 100%;\n }\n\n /*\n * 카드의 제목은 두 줄까지 읽힌다.\n *\n * 한 줄로 자르면 「[처분 승인] D-1788231051788-B · …」 처럼 **구별되는 부분이 잘려 나간다.**\n * 카드는 표와 달리 세로로 여유가 있고, 그 여유를 제목에 주는 것이 맞다.\n */\n /* A list can ask for one line (--data-card-item-name-lines: 1) when its names all start alike. */\n :host([name]) > span {\n display: -webkit-box;\n -webkit-line-clamp: var(--data-card-item-name-lines, 2);\n -webkit-box-orient: vertical;\n white-space: normal;\n overflow: hidden;\n }\n\n @media only screen and (max-width: 460px) {\n *[center] {\n margin: initial;\n }\n }\n `\n ]\n\n /*\n * Cut text gets a tooltip here as it does in a grid cell. The grid's cells and headers had the\n * controller; the card's fields never did, so a card title clipped to its line count could not\n * be read in full anywhere.\n */\n private tooltipController?: TooltipReactiveController = new TooltipReactiveController(this)\n\n @property({ attribute: true }) align?: string\n @property({ type: Object }) record: GristRecord = ZERO_RECORD\n @property({ type: Object }) column: ColumnConfig = ZERO_COLUMN\n @property({ type: Number }) rowIndex: number = -1\n @property({ type: Object }) value?: object\n\n render(): TemplateResult {\n var { value, column, record, rowIndex } = this\n\n var {\n label,\n record: { renderer: recordRenderer }\n } = column\n\n /*\n * A field with nothing to show takes no place. A label stood alone with no value after it - 「건수」 on a record\n * that has no count (Office management check, 2026-11-06).\n */\n const shown = recordRenderer(value, column, record, rowIndex, this)\n const empty = shown === '' || shown === null || shown === undefined\n this.toggleAttribute('empty', empty)\n if (empty) {\n return html``\n }\n\n if (typeof label == 'object') {\n let { renderer: labelRenderer } = label\n return html`<label>${labelRenderer(column)}</label>${shown}`\n } else {\n return html`${shown}`\n }\n }\n}\n"]}
|
|
@@ -52,10 +52,6 @@ DataCardGutter.styles = [
|
|
|
52
52
|
text-overflow: ellipsis;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
:host([row-selector]) {
|
|
56
|
-
margin-right: auto;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
/*
|
|
60
56
|
* A worded gutter is an outlined button in the card's own ink - it is one of several equal
|
|
61
57
|
* actions on the card, not the card's primary action, so it takes no fill. The destructive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-card-gutter.js","sourceRoot":"","sources":["../../../src/data-card/data-card-gutter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAI/D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;
|
|
1
|
+
{"version":3,"file":"data-card-gutter.js","sourceRoot":"","sources":["../../../src/data-card/data-card-gutter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAI/D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QAkHuB,WAAM,GAAgB,WAAW,CAAA;QACjC,WAAM,GAAiB,WAAW,CAAA;QAClC,aAAQ,GAAW,CAAC,CAAC,CAAA;IAwCnD,CAAC;IArCC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,IAAI,CAAA,EAAE,CAAA;QACf,CAAC;QAED,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAC9C,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,CAAA;QAEhC,oEAAoE;QACpE,OAAO,IAAI,CAAA,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,CA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6CAAe;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkC;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AArH/B,cAAc;IAD1B,aAAa,CAAC,gBAAgB,CAAC;GACnB,cAAc,CA4J1B","sourcesContent":["import { css, html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ZERO_COLUMN, ZERO_RECORD } from '../configure/zero-config.js'\nimport { ColumnConfig, GristRecord } from '../types.js'\n\n@customElement('ox-card-gutter')\nexport class DataCardGutter extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n background-color: transparent;\n align-content: center;\n align-items: center;\n text-overflow: ellipsis;\n }\n\n /*\n * A worded gutter is an outlined button in the card's own ink - it is one of several equal\n * actions on the card, not the card's primary action, so it takes no fill. The destructive\n * one is filled, in the theme's danger pair (the scheme's error tokens unless a theme hands\n * in its own, as a dark theme does to avoid a pastel plate).\n */\n * {\n border: 1px solid var(--md-sys-color-outline-variant);\n font-size: var(--md-sys-typescale-label-medium-size, 0.8rem);\n line-height: var(--md-sys-typescale-label-medium-size, 0.8rem);\n\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n border-radius: var(--data-card-item-btn-border-radius, var(--md-sys-shape-corner-extra-small, 4px));\n\n padding: var(--spacing-small);\n }\n\n /*\n ── 아이콘만 있는 gutter 는 상자에 담지 않는다 ──────────────────────────\n 위의 별표 규칙은 글자 단추(iconOnly: false)를 위한 것이다. 그것이 아이콘 하나에도 걸리면\n 두 가지가 함께 잘못된다 — 아이콘이 label 글자 크기(0.8rem)로 줄어 13px 짜리 글리프가 되고,\n 그 작은 글리프가 색칠된 상자에 갇혀 답답해 보인다.\n\n 아이콘 단추는 아이콘 크기로 그리고, 바탕은 손이 갈 때만 든다.\n */\n md-icon {\n --md-icon-size: var(--data-card-gutter-icon-size, 20px);\n font-size: var(--data-card-gutter-icon-size, 20px);\n line-height: 1;\n border: 0;\n padding: var(--spacing-tiny);\n color: var(--data-card-gutter-icon-color, var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface)));\n background-color: transparent;\n border-radius: var(--md-sys-shape-corner-small);\n cursor: pointer;\n }\n\n md-icon:hover {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n /* 되돌릴 수 없는 것은 손이 갔을 때 색으로 말한다 — 늘 붉게 두면 목록이 시끄럽다 */\n :host([danger]) md-icon:hover {\n color: var(--md-sys-color-on-error, #fff);\n background-color: var(--md-sys-color-error);\n }\n\n /* button hover 효과는 button 자체에만 — *:hover 로 광범위 적용 시 자식\n * (span/md-icon) 의 individual hover 가 secondary background 작은 박스를\n * 그려서 부자연. 자식들은 button hover 의 효과를 상속받기만 한다. */\n button:hover {\n cursor: pointer;\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n border-color: transparent;\n }\n\n :host([danger]) button {\n color: var(--danger-button-color, var(--md-sys-color-on-error));\n background-color: var(--danger-button-background, var(--md-sys-color-error));\n border-color: transparent;\n }\n\n :host([danger]) button:hover {\n color: var(--danger-button-hover-color, var(--md-sys-color-error));\n background-color: var(--danger-button-hover-background, var(--md-sys-color-on-error));\n border-color: transparent;\n }\n\n button {\n display: flex;\n gap: var(--spacing-small);\n align-items: center;\n font: inherit;\n font-size: var(--md-sys-typescale-label-medium-size, 0.8rem);\n }\n\n /* 자식 (span / md-icon) 은 button 의 color 를 inherit — button hover / danger\n * 상태에서 color 가 변하면 자식 글자 / 아이콘 색도 함께 반전. 상위의 *{...}\n * 가 모든 자식에 color 박아서 inherit 안 되던 문제 보수. */\n button > * {\n color: inherit;\n }\n\n button md-icon {\n --md-icon-size: 16px;\n font-size: 16px;\n border: 0;\n padding: 0;\n background-color: unset;\n }\n\n button span {\n border: 0;\n padding: 0;\n background-color: transparent;\n }\n `\n ]\n\n @property({ attribute: true }) align?: string\n @property({ type: Object }) record: GristRecord = ZERO_RECORD\n @property({ type: Object }) column: ColumnConfig = ZERO_COLUMN\n @property({ type: Number }) rowIndex: number = -1\n @property({ type: Object }) value?: object\n\n render(): TemplateResult {\n if (!this.column) {\n return html``\n }\n\n var { value, column, record, rowIndex } = this\n var { renderer } = column.record\n\n /* renderer가 html template이 아니고 단순한 값인 경우가 있으므로, html 템플릿으로 감싸준다. */\n return html` ${renderer(value, column, record, rowIndex, this)} `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('column')) {\n const { gutterName, danger } = this.column\n\n if (gutterName == 'row-selector') {\n this.setAttribute('row-selector', '')\n } else {\n this.removeAttribute('row-selector')\n }\n\n if (danger) {\n this.setAttribute('danger', '')\n } else {\n this.removeAttribute('danger')\n }\n }\n\n /* `quiet` may depend on the record (a set favorite stays visible), so it follows both. */\n if (changes.has('column') || changes.has('record')) {\n const { quiet } = this.column\n const isQuiet = typeof quiet === 'function' ? !!quiet(this.record) : !!quiet\n\n this.toggleAttribute('quiet', isQuiet)\n }\n }\n}\n"]}
|
|
@@ -25,6 +25,7 @@ export declare class DataCard extends DataManipulator {
|
|
|
25
25
|
private _resetDragState;
|
|
26
26
|
updated(changes: PropertyValues<this>): void;
|
|
27
27
|
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
private renderTotals;
|
|
28
29
|
gotoTop(e: Event): void;
|
|
29
30
|
get pullToRefreshTarget(): this;
|
|
30
31
|
}
|
|
@@ -5,6 +5,8 @@ import '@operato/list-state/ox-empty-note.js';
|
|
|
5
5
|
import './record-card.js';
|
|
6
6
|
import { css, html, nothing } from 'lit';
|
|
7
7
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
8
|
+
import { accumulateRecord } from '../accumulator/accumulator.js';
|
|
9
|
+
import { groupColumn, groupHeading, opensGroup } from '../group-heading.js';
|
|
8
10
|
import { DataManipulator } from '../data-manipulator.js';
|
|
9
11
|
import { renderEmptyNote } from '../empty-note-render.js';
|
|
10
12
|
let DataCard = class DataCard extends DataManipulator {
|
|
@@ -224,12 +226,20 @@ let DataCard = class DataCard extends DataManipulator {
|
|
|
224
226
|
if (this.config && this.config.rows.appendable) {
|
|
225
227
|
records = [...records, this.appendRecord];
|
|
226
228
|
}
|
|
229
|
+
const grouping = groupColumn(this.config);
|
|
227
230
|
return html `
|
|
228
231
|
${records.map((record, rowIndex) => {
|
|
232
|
+
/* A child row (tree.childrenProperty) is drawn inside its parent's card, not as a card of its own. */
|
|
233
|
+
if (record.__depth__) {
|
|
234
|
+
return nothing;
|
|
235
|
+
}
|
|
229
236
|
var { emphasized } = classifier.call(null, record, rowIndex) || {};
|
|
230
237
|
/* Only a real record can be dragged - the trailing `appendable` placeholder has no id. */
|
|
231
238
|
var draggable = reorderable && record.id;
|
|
232
239
|
return html `
|
|
240
|
+
${grouping && record !== this.appendRecord && opensGroup(records, rowIndex, grouping)
|
|
241
|
+
? html `<div group-heading role="heading" aria-level="3">${groupHeading(records, rowIndex, grouping, this)}</div>`
|
|
242
|
+
: nothing}
|
|
233
243
|
<ox-record-card
|
|
234
244
|
.config=${this.config}
|
|
235
245
|
.data=${this.data}
|
|
@@ -244,12 +254,26 @@ let DataCard = class DataCard extends DataManipulator {
|
|
|
244
254
|
></ox-record-card>
|
|
245
255
|
`;
|
|
246
256
|
})}
|
|
257
|
+
${this.renderTotals(this._records || [])}
|
|
247
258
|
${this.empty ? renderEmptyNote(this.emptyNote) : html ``}
|
|
248
259
|
${this.isTop
|
|
249
260
|
? html ``
|
|
250
261
|
: html ` <md-icon id="upward" @click=${(e) => this.gotoTop(e)}>arrow_upward</md-icon> `}
|
|
251
262
|
`;
|
|
252
263
|
}
|
|
264
|
+
renderTotals(records) {
|
|
265
|
+
const columns = this.config.rows.accumulator ? this.config.columns.filter(column => !column.hidden && column.accumulator) : [];
|
|
266
|
+
if (columns.length == 0 || records.length == 0) {
|
|
267
|
+
return nothing;
|
|
268
|
+
}
|
|
269
|
+
const totals = accumulateRecord(this.data, columns);
|
|
270
|
+
return html `<div totals role="row">
|
|
271
|
+
<md-icon>functions</md-icon>
|
|
272
|
+
${columns.map(column => html `<span total=${column.name}
|
|
273
|
+
><label>${column.header.renderer(column)}</label>${column.record.renderer(totals[column.name], column, totals, records.length, this)}</span
|
|
274
|
+
>`)}
|
|
275
|
+
</div>`;
|
|
276
|
+
}
|
|
253
277
|
gotoTop(e) {
|
|
254
278
|
this.scrollTop = 0;
|
|
255
279
|
e.stopPropagation();
|
|
@@ -289,6 +313,47 @@ DataCard.styles = [
|
|
|
289
313
|
background-color: var(--grid-record-selected-background-color);
|
|
290
314
|
}
|
|
291
315
|
|
|
316
|
+
/* A group heading (rows.groups, group-heading.ts): across the whole row, above the cards it names. */
|
|
317
|
+
[group-heading] {
|
|
318
|
+
grid-column: 1 / -1;
|
|
319
|
+
margin-top: var(--spacing-medium);
|
|
320
|
+
padding: 0 var(--spacing-small);
|
|
321
|
+
color: var(--md-sys-color-on-surface);
|
|
322
|
+
font-weight: var(--md-sys-typescale-title-small-weight, 600);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
[group-heading]:first-child {
|
|
326
|
+
margin-top: 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/*
|
|
330
|
+
The totals card (rows.accumulator): what the grid's totals row says, after the cards and across the whole
|
|
331
|
+
row. A card has no column header above the value, so each total names its column.
|
|
332
|
+
*/
|
|
333
|
+
[totals] {
|
|
334
|
+
grid-column: 1 / -1;
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-wrap: wrap;
|
|
337
|
+
align-items: center;
|
|
338
|
+
gap: var(--spacing-small) var(--spacing-large);
|
|
339
|
+
padding: var(--spacing-medium) var(--spacing-large);
|
|
340
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
341
|
+
background-color: var(--md-sys-color-primary-container);
|
|
342
|
+
color: var(--md-sys-color-primary);
|
|
343
|
+
font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));
|
|
344
|
+
font-variant-numeric: tabular-nums;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
[totals] md-icon {
|
|
348
|
+
--md-icon-size: 20px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
[totals] label {
|
|
352
|
+
margin-right: var(--spacing-small);
|
|
353
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
354
|
+
font-weight: normal;
|
|
355
|
+
}
|
|
356
|
+
|
|
292
357
|
/*
|
|
293
358
|
── 맨 위로 가는 단추 ──────────────────────────────────────────────────
|
|
294
359
|
자리를 먹지 않는다(absolute). 기준 상자는 ox-grist 의 host 인데(그쪽이 position: relative),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-card.js","sourceRoot":"","sources":["../../../src/data-card/data-card.ts"],"names":[],"mappings":";AACA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAiB,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAGjE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,eAAe;IAAtC;;QAqJY,aAAQ,GAAkB,EAAE,CAAA;QAC5B,UAAK,GAAY,KAAK,CAAA;QAE/B,WAAM,GAAW,CAAC,CAAA;QAClB,WAAM,GAAW,EAAE,CAAA;QACnB,UAAK,GAAW,CAAC,CAAA;QAEzB,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;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAAgB;AAGhB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAA0B;AAEpC;IAAhB,KAAK,EAAE;0CAAqC;AAC5B;IAAhB,KAAK,EAAE;uCAA+B;AAtJ5B,QAAQ;IADpB,aAAa,CAAC,SAAS,CAAC;GACZ,QAAQ,CAgbpB","sourcesContent":["import i18next from 'i18next'\nimport '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@operato/list-state/ox-empty-note.js'\nimport './record-card.js'\n\nimport { PropertyValues, css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { DataManipulator } from '../data-manipulator.js'\nimport { GristRecord } from '../types.js'\nimport { GridEmptyNote, renderEmptyNote } from '../empty-note-render.js'\n\n@customElement('ox-card')\nexport class DataCard extends DataManipulator {\n static styles = [\n css`\n :host {\n overflow-y: auto;\n padding: var(--spacing-medium);\n\n display: grid;\n /*\n 카드 한 장의 최소 폭. 화면마다 실리는 것이 다르므로 값을 밖에서 정할 수 있어야 한다 —\n 그림이 주인공인 목록(자산 카탈로그)은 좁게 여러 장을, 글이 많은 목록은 넓게 몇 장을 놓는다.\n 기본값은 지금까지의 값 그대로다.\n */\n grid-template-columns: repeat(auto-fill, minmax(var(--data-card-min-width, 300px), 1fr));\n /*\n grid-template-rows: min-content only ever sizes the *first* row track - every row after\n it is implicit, and an implicit track with no grid-auto-rows falls back to the browser's\n default auto sizing, which is a looser (max-content-leaning) measurement than\n min-content. With enough records to wrap past one row, that mismatch showed up as a real\n gap: row 1 sized tight at ~201px, rows 2+ sized to ~319px while the cards inside still only\n filled ~201px of it (operato-board's board-list, 2026-09-23 - 17 boards, 7 per row).\n grid-auto-rows repeats the same rule for every implicit row, so all rows size alike.\n */\n grid-template-rows: min-content;\n grid-auto-rows: min-content;\n grid-gap: var(--spacing-large);\n }\n\n [selected-row] {\n background-color: var(--grid-record-selected-background-color);\n }\n\n /*\n ── 맨 위로 가는 단추 ──────────────────────────────────────────────────\n 자리를 먹지 않는다(absolute). 기준 상자는 ox-grist 의 host 인데(그쪽이 position: relative),\n 그래서 **목록과 함께 스크롤되지 않고** 상자에 붙어 있다.\n\n 고친 것 둘.\n\n 1. 위가 아니라 **아래**다. 오른쪽 위는 머리말·검색·필터가 있는 자리여서 단추가 그것들과\n 겹쳤다. 맨 위로 보내는 단추는 사람이 아래에 있을 때만 나오므로 손이 있는 쪽에 둔다.\n 2. rgba(255,255,255,0.7) 이 박혀 있었다 — 어두운 테마에서 흰 알약이 떠 있고, 아이콘은\n --icon-size-large 라 알약보다 커 보였다. 테마 토큰으로 그리고 크기를 정한다.\n */\n #upward {\n --md-icon-size: 20px;\n position: absolute;\n bottom: var(--data-card-fab-position-vertical, var(--spacing-large));\n right: var(--data-card-fab-position-horizontal, var(--spacing-large));\n display: grid;\n place-items: center;\n width: 36px;\n height: 36px;\n box-sizing: border-box;\n color: var(--data-card-fab-color, var(--md-sys-color-on-surface-variant));\n background-color: var(--data-card-fab-background-color, var(--md-sys-color-surface-container-high));\n /* 떠 있는 단추의 모서리는 알약이다 — 담는 면(6px)이 아니라 그 자신의 격을 따른다 */\n border-radius: var(--md-sys-shape-corner-full, 50%);\n border: 1px solid var(--md-sys-color-outline-variant);\n box-shadow: var(--data-card-fab-shadow, 0 1px 3px rgba(0, 0, 0, 0.18));\n cursor: pointer;\n z-index: 9;\n }\n\n #upward:hover {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n slot {\n width: 100%;\n }\n\n ox-empty-note {\n display: block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n [card][emphasized-row],\n [card][emphasized-row][focused] {\n background-color: var(--grid-record-emphasized-background-color);\n color: var(--grid-record-emphasized-color);\n }\n\n /*\n 드래그 순서 바꾸기 (rows.reorderable) — board-list 의 board-tile-list.ts 에서 검증된 모양을\n 그대로 가져온다. 자리(placement)만 이 파일이 정하고, 지속(persist)은 소비자가 한다 — 그\n 경계는 위 types.ts RowsConfig.reorderable 문서에 있다.\n */\n [card][draggable='true'] {\n cursor: grab;\n transition:\n opacity 0.2s ease,\n transform 0.2s ease;\n }\n\n [card].dragging {\n opacity: 0.3;\n transform: scale(0.95);\n }\n\n [card].drop-before {\n border-left: 3px solid var(--md-sys-color-primary);\n }\n\n [card].drop-after {\n border-right: 3px solid var(--md-sys-color-primary);\n }\n\n [card].flip-moving {\n transition: transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);\n }\n\n @keyframes ox-card-drop-land {\n 0% {\n opacity: 0;\n transform: scale(0.9);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n [card].flip-dropped-hidden {\n opacity: 0;\n }\n\n [card].flip-dropped {\n animation: ox-card-drop-land 0.5s cubic-bezier(0.22, 0.6, 0.36, 1);\n }\n\n @media screen and (max-width: 460px) {\n #setting {\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n }\n `\n ]\n\n @property({ type: Boolean }) empty?: boolean\n\n /** 비었을 때 무슨 말을 하나 — 판단은 data-grist 가 하고 여기서는 그리기만 한다. */\n @property({ type: Object }) emptyNote?: GridEmptyNote\n\n @state() private _records: GristRecord[] = []\n @state() private isTop: boolean = false\n\n private _total: number = 0\n private _limit: number = 20\n private _page: number = 1\n\n /* Drag-reorder state (`rows.reorderable`) - board-tile-list.ts's proven shape, generalized. */\n private _draggedId: string | null = null\n private _dropTargetId: string | null = null\n private _dropSide: 'before' | 'after' | null = null\n\n firstUpdated(changes: PropertyValues<this>) {\n this.isTop = true\n\n /* infinite scrolling */\n this.addEventListener('scroll', e => {\n const totalScrollHeight = this.scrollHeight\n const screenHeight = this.offsetHeight\n const currentScrollTop = this.scrollTop\n\n if (totalScrollHeight <= screenHeight + currentScrollTop + 1) {\n /* 마지막 페이지까지 계속 페이지를 증가시킨다. */\n var lastPage = Math.ceil(this._total / this._limit)\n\n if (this._page < lastPage) {\n this.dispatchEvent(new CustomEvent('attach-page', { bubbles: true, composed: true }))\n }\n }\n\n this.isTop = this.scrollTop == 0\n })\n\n this._wireReorder()\n }\n\n /*\n * `config.rows.reorderable` is read inside each handler, not at listener-registration time - the\n * listeners are cheap to hold and this sidesteps any question of whether `config` has already been\n * assigned by the time `firstUpdated` runs (it is a plain property set by the caller's template,\n * not guaranteed ordered against connection).\n */\n private _wireReorder() {\n this.renderRoot.addEventListener('dragstart', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (!target?.id) return\n\n this._draggedId = target.id\n target.classList.add('dragging')\n ;(e as DragEvent).dataTransfer!.effectAllowed = 'move'\n ;(e as DragEvent).dataTransfer?.setData('text/plain', target.id)\n })\n\n this.renderRoot.addEventListener('dragover', (e: Event) => {\n if (!this.config?.rows?.reorderable || !this._draggedId) return\n e.preventDefault()\n ;(e as DragEvent).dataTransfer!.dropEffect = 'move'\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (!target?.id || target.id === this._draggedId) return\n\n const targetRect = target.getBoundingClientRect()\n const mousePos = (e as DragEvent).clientX - targetRect.left\n const side = mousePos < targetRect.width / 2 ? 'before' : 'after'\n\n if (this._dropTargetId !== target.id || this._dropSide !== side) {\n this._clearDropIndicator()\n this._dropTargetId = target.id\n this._dropSide = side\n target.classList.add(side === 'before' ? 'drop-before' : 'drop-after')\n }\n })\n\n this.renderRoot.addEventListener('dragleave', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (target?.id === this._dropTargetId) {\n const related = (e as DragEvent).relatedTarget as HTMLElement | null\n if (!related || !target.contains(related)) {\n this._clearDropIndicator()\n }\n }\n })\n\n this.renderRoot.addEventListener('drop', (e: Event) => this._onDrop(e as DragEvent))\n\n this.renderRoot.addEventListener('dragend', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n this._clearDropIndicator()\n const target = (e.target as HTMLElement).closest('[card]')\n if (target) target.classList.remove('dragging')\n this._resetDragState()\n })\n }\n\n private _onDrop(e: DragEvent) {\n if (!this.config?.rows?.reorderable) return\n e.preventDefault()\n\n /* drop 이 먼저 계산한다 - dragleave 가 먼저 일어나 상태를 지울 수 있어서다. */\n const dropTarget = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n let dropTargetId = this._dropTargetId\n let dropSide = this._dropSide\n\n if (dropTarget?.id && dropTarget.id !== this._draggedId) {\n dropTargetId = dropTarget.id\n const rect = dropTarget.getBoundingClientRect()\n dropSide = e.clientX - rect.left < rect.width / 2 ? 'before' : 'after'\n }\n\n this._clearDropIndicator()\n\n const draggedEl = this._draggedId ? this.renderRoot.querySelector(`[card][id=\"${this._draggedId}\"]`) : null\n draggedEl?.classList.remove('dragging')\n\n if (!this._draggedId || !dropTargetId || this._draggedId === dropTargetId) {\n this._resetDragState()\n return\n }\n\n const records = [...this._records]\n const draggedIndex = records.findIndex(r => r.id === this._draggedId)\n if (draggedIndex === -1) {\n this._resetDragState()\n return\n }\n\n const draggedId = this._draggedId\n const [dragged] = records.splice(draggedIndex, 1)\n let targetIndex = records.findIndex(r => r.id === dropTargetId)\n if (dropSide === 'after') targetIndex++\n records.splice(targetIndex, 0, dragged)\n\n this._resetDragState()\n\n /* FLIP: 옮기기 전 자리를 먼저 잰다. */\n const cards = this.renderRoot.querySelectorAll('[card][id]')\n const firstPositions = new Map<string, DOMRect>()\n cards.forEach(card => firstPositions.set(card.id, card.getBoundingClientRect()))\n\n /* 낙관적 갱신 - 지속은 이 이벤트를 듣는 쪽의 몫이다(RowsConfig.reorderable 문서 참조). */\n this._records = records\n\n this.updateComplete.then(() => {\n const updatedCards = this.renderRoot.querySelectorAll('[card][id]')\n let droppedEl: HTMLElement | null = null\n\n updatedCards.forEach(card => {\n const first = firstPositions.get(card.id)\n if (!first) return\n\n const last = card.getBoundingClientRect()\n const dx = first.left - last.left\n const dy = first.top - last.top\n const el = card as HTMLElement\n\n if (card.id === draggedId) {\n /* 옮긴 카드는 다른 카드들이 밀리는 동안 숨겨 뒀다가 마지막에 착지시킨다. */\n el.classList.add('flip-dropped-hidden')\n droppedEl = el\n } else {\n if (dx === 0 && dy === 0) return\n\n el.style.transform = `translate(${dx}px, ${dy}px)`\n el.style.transition = 'none'\n\n requestAnimationFrame(() => {\n el.classList.add('flip-moving')\n el.style.transform = ''\n el.style.transition = ''\n\n el.addEventListener('transitionend', () => el.classList.remove('flip-moving'), { once: true })\n })\n }\n })\n\n const ids = records.map(r => r.id!)\n const dispatchReorder = () => {\n this.dispatchEvent(\n new CustomEvent('reorder', {\n bubbles: true,\n composed: true,\n detail: { ids, movedId: draggedId }\n })\n )\n }\n\n if (droppedEl) {\n setTimeout(() => {\n const el = droppedEl as HTMLElement\n el.classList.remove('flip-dropped-hidden')\n el.classList.add('flip-dropped')\n el.addEventListener(\n 'animationend',\n () => {\n el.classList.remove('flip-dropped')\n dispatchReorder()\n },\n { once: true }\n )\n }, 500)\n } else {\n dispatchReorder()\n }\n })\n }\n\n private _clearDropIndicator() {\n if (this._dropTargetId) {\n this.renderRoot.querySelector(`[card][id=\"${this._dropTargetId}\"]`)?.classList.remove('drop-before', 'drop-after')\n }\n this._dropTargetId = null\n this._dropSide = null\n }\n\n private _resetDragState() {\n this._draggedId = null\n this._dropTargetId = null\n this._dropSide = null\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * The records and their page come from the data alone. A config that arrives after the data (a personal\n * config loads later) used to empty them until the next fetch.\n */\n if (changes.has('data')) {\n this._records = this.data.records\n this._total = this.data.total || 0\n this._limit = this.data.limit || 20\n this._page = this.data.page || 0\n }\n }\n\n render() {\n var { classifier, reorderable } = this.config.rows\n var records = this._records || []\n\n if (this.config && this.config.rows.appendable) {\n records = [...records, this.appendRecord]\n }\n\n return html`\n ${records.map((record, rowIndex) => {\n var { emphasized } = classifier.call(null, record, rowIndex) || {}\n /* Only a real record can be dragged - the trailing `appendable` placeholder has no id. */\n var draggable = reorderable && record.id\n\n return html`\n <ox-record-card\n .config=${this.config}\n .data=${this.data}\n .record=${record}\n .rowIndex=${rowIndex}\n .emphasized=${emphasized}\n ?selected-row=${record['__selected__']}\n ?dirty=${record['__dirty__']}\n id=${record.id || nothing}\n draggable=${draggable ? 'true' : 'false'}\n card\n ></ox-record-card>\n `\n })}\n ${this.empty ? renderEmptyNote(this.emptyNote) : html``}\n ${this.isTop\n ? html``\n : html` <md-icon id=\"upward\" @click=${(e: Event) => this.gotoTop(e)}>arrow_upward</md-icon> `}\n `\n }\n\n gotoTop(e: Event) {\n this.scrollTop = 0\n\n e.stopPropagation()\n }\n\n get pullToRefreshTarget() {\n return this\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-card.js","sourceRoot":"","sources":["../../../src/data-card/data-card.ts"],"names":[],"mappings":";AACA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAiB,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAGjE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,eAAe;IAAtC;;QA8LY,aAAQ,GAAkB,EAAE,CAAA;QAC5B,UAAK,GAAY,KAAK,CAAA;QAE/B,WAAM,GAAW,CAAC,CAAA;QAClB,WA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoLF;CACF,AAtLY,CAsLZ;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAAgB;AAGhB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAA0B;AAEpC;IAAhB,KAAK,EAAE;0CAAqC;AAC5B;IAAhB,KAAK,EAAE;uCAA+B;AA/L5B,QAAQ;IADpB,aAAa,CAAC,SAAS,CAAC;GACZ,QAAQ,CAsfpB","sourcesContent":["import i18next from 'i18next'\nimport '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@operato/list-state/ox-empty-note.js'\nimport './record-card.js'\n\nimport { PropertyValues, css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { accumulateRecord } from '../accumulator/accumulator.js'\nimport { groupColumn, groupHeading, opensGroup } from '../group-heading.js'\nimport { DataManipulator } from '../data-manipulator.js'\nimport { GristRecord } from '../types.js'\nimport { GridEmptyNote, renderEmptyNote } from '../empty-note-render.js'\n\n@customElement('ox-card')\nexport class DataCard extends DataManipulator {\n static styles = [\n css`\n :host {\n overflow-y: auto;\n padding: var(--spacing-medium);\n\n display: grid;\n /*\n 카드 한 장의 최소 폭. 화면마다 실리는 것이 다르므로 값을 밖에서 정할 수 있어야 한다 —\n 그림이 주인공인 목록(자산 카탈로그)은 좁게 여러 장을, 글이 많은 목록은 넓게 몇 장을 놓는다.\n 기본값은 지금까지의 값 그대로다.\n */\n grid-template-columns: repeat(auto-fill, minmax(var(--data-card-min-width, 300px), 1fr));\n /*\n grid-template-rows: min-content only ever sizes the *first* row track - every row after\n it is implicit, and an implicit track with no grid-auto-rows falls back to the browser's\n default auto sizing, which is a looser (max-content-leaning) measurement than\n min-content. With enough records to wrap past one row, that mismatch showed up as a real\n gap: row 1 sized tight at ~201px, rows 2+ sized to ~319px while the cards inside still only\n filled ~201px of it (operato-board's board-list, 2026-09-23 - 17 boards, 7 per row).\n grid-auto-rows repeats the same rule for every implicit row, so all rows size alike.\n */\n grid-template-rows: min-content;\n grid-auto-rows: min-content;\n grid-gap: var(--spacing-large);\n }\n\n [selected-row] {\n background-color: var(--grid-record-selected-background-color);\n }\n\n /* A group heading (rows.groups, group-heading.ts): across the whole row, above the cards it names. */\n [group-heading] {\n grid-column: 1 / -1;\n margin-top: var(--spacing-medium);\n padding: 0 var(--spacing-small);\n color: var(--md-sys-color-on-surface);\n font-weight: var(--md-sys-typescale-title-small-weight, 600);\n }\n\n [group-heading]:first-child {\n margin-top: 0;\n }\n\n /*\n The totals card (rows.accumulator): what the grid's totals row says, after the cards and across the whole\n row. A card has no column header above the value, so each total names its column.\n */\n [totals] {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-small) var(--spacing-large);\n padding: var(--spacing-medium) var(--spacing-large);\n border-radius: var(--md-sys-shape-corner-small);\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-primary);\n font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));\n font-variant-numeric: tabular-nums;\n }\n\n [totals] md-icon {\n --md-icon-size: 20px;\n }\n\n [totals] label {\n margin-right: var(--spacing-small);\n color: var(--md-sys-color-on-surface-variant);\n font-weight: normal;\n }\n\n /*\n ── 맨 위로 가는 단추 ──────────────────────────────────────────────────\n 자리를 먹지 않는다(absolute). 기준 상자는 ox-grist 의 host 인데(그쪽이 position: relative),\n 그래서 **목록과 함께 스크롤되지 않고** 상자에 붙어 있다.\n\n 고친 것 둘.\n\n 1. 위가 아니라 **아래**다. 오른쪽 위는 머리말·검색·필터가 있는 자리여서 단추가 그것들과\n 겹쳤다. 맨 위로 보내는 단추는 사람이 아래에 있을 때만 나오므로 손이 있는 쪽에 둔다.\n 2. rgba(255,255,255,0.7) 이 박혀 있었다 — 어두운 테마에서 흰 알약이 떠 있고, 아이콘은\n --icon-size-large 라 알약보다 커 보였다. 테마 토큰으로 그리고 크기를 정한다.\n */\n #upward {\n --md-icon-size: 20px;\n position: absolute;\n bottom: var(--data-card-fab-position-vertical, var(--spacing-large));\n right: var(--data-card-fab-position-horizontal, var(--spacing-large));\n display: grid;\n place-items: center;\n width: 36px;\n height: 36px;\n box-sizing: border-box;\n color: var(--data-card-fab-color, var(--md-sys-color-on-surface-variant));\n background-color: var(--data-card-fab-background-color, var(--md-sys-color-surface-container-high));\n /* 떠 있는 단추의 모서리는 알약이다 — 담는 면(6px)이 아니라 그 자신의 격을 따른다 */\n border-radius: var(--md-sys-shape-corner-full, 50%);\n border: 1px solid var(--md-sys-color-outline-variant);\n box-shadow: var(--data-card-fab-shadow, 0 1px 3px rgba(0, 0, 0, 0.18));\n cursor: pointer;\n z-index: 9;\n }\n\n #upward:hover {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n slot {\n width: 100%;\n }\n\n ox-empty-note {\n display: block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n [card][emphasized-row],\n [card][emphasized-row][focused] {\n background-color: var(--grid-record-emphasized-background-color);\n color: var(--grid-record-emphasized-color);\n }\n\n /*\n 드래그 순서 바꾸기 (rows.reorderable) — board-list 의 board-tile-list.ts 에서 검증된 모양을\n 그대로 가져온다. 자리(placement)만 이 파일이 정하고, 지속(persist)은 소비자가 한다 — 그\n 경계는 위 types.ts RowsConfig.reorderable 문서에 있다.\n */\n [card][draggable='true'] {\n cursor: grab;\n transition:\n opacity 0.2s ease,\n transform 0.2s ease;\n }\n\n [card].dragging {\n opacity: 0.3;\n transform: scale(0.95);\n }\n\n [card].drop-before {\n border-left: 3px solid var(--md-sys-color-primary);\n }\n\n [card].drop-after {\n border-right: 3px solid var(--md-sys-color-primary);\n }\n\n [card].flip-moving {\n transition: transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);\n }\n\n @keyframes ox-card-drop-land {\n 0% {\n opacity: 0;\n transform: scale(0.9);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n [card].flip-dropped-hidden {\n opacity: 0;\n }\n\n [card].flip-dropped {\n animation: ox-card-drop-land 0.5s cubic-bezier(0.22, 0.6, 0.36, 1);\n }\n\n @media screen and (max-width: 460px) {\n #setting {\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n }\n `\n ]\n\n @property({ type: Boolean }) empty?: boolean\n\n /** 비었을 때 무슨 말을 하나 — 판단은 data-grist 가 하고 여기서는 그리기만 한다. */\n @property({ type: Object }) emptyNote?: GridEmptyNote\n\n @state() private _records: GristRecord[] = []\n @state() private isTop: boolean = false\n\n private _total: number = 0\n private _limit: number = 20\n private _page: number = 1\n\n /* Drag-reorder state (`rows.reorderable`) - board-tile-list.ts's proven shape, generalized. */\n private _draggedId: string | null = null\n private _dropTargetId: string | null = null\n private _dropSide: 'before' | 'after' | null = null\n\n firstUpdated(changes: PropertyValues<this>) {\n this.isTop = true\n\n /* infinite scrolling */\n this.addEventListener('scroll', e => {\n const totalScrollHeight = this.scrollHeight\n const screenHeight = this.offsetHeight\n const currentScrollTop = this.scrollTop\n\n if (totalScrollHeight <= screenHeight + currentScrollTop + 1) {\n /* 마지막 페이지까지 계속 페이지를 증가시킨다. */\n var lastPage = Math.ceil(this._total / this._limit)\n\n if (this._page < lastPage) {\n this.dispatchEvent(new CustomEvent('attach-page', { bubbles: true, composed: true }))\n }\n }\n\n this.isTop = this.scrollTop == 0\n })\n\n this._wireReorder()\n }\n\n /*\n * `config.rows.reorderable` is read inside each handler, not at listener-registration time - the\n * listeners are cheap to hold and this sidesteps any question of whether `config` has already been\n * assigned by the time `firstUpdated` runs (it is a plain property set by the caller's template,\n * not guaranteed ordered against connection).\n */\n private _wireReorder() {\n this.renderRoot.addEventListener('dragstart', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (!target?.id) return\n\n this._draggedId = target.id\n target.classList.add('dragging')\n ;(e as DragEvent).dataTransfer!.effectAllowed = 'move'\n ;(e as DragEvent).dataTransfer?.setData('text/plain', target.id)\n })\n\n this.renderRoot.addEventListener('dragover', (e: Event) => {\n if (!this.config?.rows?.reorderable || !this._draggedId) return\n e.preventDefault()\n ;(e as DragEvent).dataTransfer!.dropEffect = 'move'\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (!target?.id || target.id === this._draggedId) return\n\n const targetRect = target.getBoundingClientRect()\n const mousePos = (e as DragEvent).clientX - targetRect.left\n const side = mousePos < targetRect.width / 2 ? 'before' : 'after'\n\n if (this._dropTargetId !== target.id || this._dropSide !== side) {\n this._clearDropIndicator()\n this._dropTargetId = target.id\n this._dropSide = side\n target.classList.add(side === 'before' ? 'drop-before' : 'drop-after')\n }\n })\n\n this.renderRoot.addEventListener('dragleave', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n const target = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n if (target?.id === this._dropTargetId) {\n const related = (e as DragEvent).relatedTarget as HTMLElement | null\n if (!related || !target.contains(related)) {\n this._clearDropIndicator()\n }\n }\n })\n\n this.renderRoot.addEventListener('drop', (e: Event) => this._onDrop(e as DragEvent))\n\n this.renderRoot.addEventListener('dragend', (e: Event) => {\n if (!this.config?.rows?.reorderable) return\n\n this._clearDropIndicator()\n const target = (e.target as HTMLElement).closest('[card]')\n if (target) target.classList.remove('dragging')\n this._resetDragState()\n })\n }\n\n private _onDrop(e: DragEvent) {\n if (!this.config?.rows?.reorderable) return\n e.preventDefault()\n\n /* drop 이 먼저 계산한다 - dragleave 가 먼저 일어나 상태를 지울 수 있어서다. */\n const dropTarget = (e.target as HTMLElement).closest('[card][id]') as HTMLElement | null\n let dropTargetId = this._dropTargetId\n let dropSide = this._dropSide\n\n if (dropTarget?.id && dropTarget.id !== this._draggedId) {\n dropTargetId = dropTarget.id\n const rect = dropTarget.getBoundingClientRect()\n dropSide = e.clientX - rect.left < rect.width / 2 ? 'before' : 'after'\n }\n\n this._clearDropIndicator()\n\n const draggedEl = this._draggedId ? this.renderRoot.querySelector(`[card][id=\"${this._draggedId}\"]`) : null\n draggedEl?.classList.remove('dragging')\n\n if (!this._draggedId || !dropTargetId || this._draggedId === dropTargetId) {\n this._resetDragState()\n return\n }\n\n const records = [...this._records]\n const draggedIndex = records.findIndex(r => r.id === this._draggedId)\n if (draggedIndex === -1) {\n this._resetDragState()\n return\n }\n\n const draggedId = this._draggedId\n const [dragged] = records.splice(draggedIndex, 1)\n let targetIndex = records.findIndex(r => r.id === dropTargetId)\n if (dropSide === 'after') targetIndex++\n records.splice(targetIndex, 0, dragged)\n\n this._resetDragState()\n\n /* FLIP: 옮기기 전 자리를 먼저 잰다. */\n const cards = this.renderRoot.querySelectorAll('[card][id]')\n const firstPositions = new Map<string, DOMRect>()\n cards.forEach(card => firstPositions.set(card.id, card.getBoundingClientRect()))\n\n /* 낙관적 갱신 - 지속은 이 이벤트를 듣는 쪽의 몫이다(RowsConfig.reorderable 문서 참조). */\n this._records = records\n\n this.updateComplete.then(() => {\n const updatedCards = this.renderRoot.querySelectorAll('[card][id]')\n let droppedEl: HTMLElement | null = null\n\n updatedCards.forEach(card => {\n const first = firstPositions.get(card.id)\n if (!first) return\n\n const last = card.getBoundingClientRect()\n const dx = first.left - last.left\n const dy = first.top - last.top\n const el = card as HTMLElement\n\n if (card.id === draggedId) {\n /* 옮긴 카드는 다른 카드들이 밀리는 동안 숨겨 뒀다가 마지막에 착지시킨다. */\n el.classList.add('flip-dropped-hidden')\n droppedEl = el\n } else {\n if (dx === 0 && dy === 0) return\n\n el.style.transform = `translate(${dx}px, ${dy}px)`\n el.style.transition = 'none'\n\n requestAnimationFrame(() => {\n el.classList.add('flip-moving')\n el.style.transform = ''\n el.style.transition = ''\n\n el.addEventListener('transitionend', () => el.classList.remove('flip-moving'), { once: true })\n })\n }\n })\n\n const ids = records.map(r => r.id!)\n const dispatchReorder = () => {\n this.dispatchEvent(\n new CustomEvent('reorder', {\n bubbles: true,\n composed: true,\n detail: { ids, movedId: draggedId }\n })\n )\n }\n\n if (droppedEl) {\n setTimeout(() => {\n const el = droppedEl as HTMLElement\n el.classList.remove('flip-dropped-hidden')\n el.classList.add('flip-dropped')\n el.addEventListener(\n 'animationend',\n () => {\n el.classList.remove('flip-dropped')\n dispatchReorder()\n },\n { once: true }\n )\n }, 500)\n } else {\n dispatchReorder()\n }\n })\n }\n\n private _clearDropIndicator() {\n if (this._dropTargetId) {\n this.renderRoot.querySelector(`[card][id=\"${this._dropTargetId}\"]`)?.classList.remove('drop-before', 'drop-after')\n }\n this._dropTargetId = null\n this._dropSide = null\n }\n\n private _resetDragState() {\n this._draggedId = null\n this._dropTargetId = null\n this._dropSide = null\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * The records and their page come from the data alone. A config that arrives after the data (a personal\n * config loads later) used to empty them until the next fetch.\n */\n if (changes.has('data')) {\n this._records = this.data.records\n this._total = this.data.total || 0\n this._limit = this.data.limit || 20\n this._page = this.data.page || 0\n }\n }\n\n render() {\n var { classifier, reorderable } = this.config.rows\n var records = this._records || []\n\n if (this.config && this.config.rows.appendable) {\n records = [...records, this.appendRecord]\n }\n\n const grouping = groupColumn(this.config)\n\n return html`\n ${records.map((record, rowIndex) => {\n /* A child row (tree.childrenProperty) is drawn inside its parent's card, not as a card of its own. */\n if (record.__depth__) {\n return nothing\n }\n\n var { emphasized } = classifier.call(null, record, rowIndex) || {}\n /* Only a real record can be dragged - the trailing `appendable` placeholder has no id. */\n var draggable = reorderable && record.id\n\n return html`\n ${grouping && record !== this.appendRecord && opensGroup(records, rowIndex, grouping)\n ? html`<div group-heading role=\"heading\" aria-level=\"3\">${groupHeading(records, rowIndex, grouping, this)}</div>`\n : nothing}\n <ox-record-card\n .config=${this.config}\n .data=${this.data}\n .record=${record}\n .rowIndex=${rowIndex}\n .emphasized=${emphasized}\n ?selected-row=${record['__selected__']}\n ?dirty=${record['__dirty__']}\n id=${record.id || nothing}\n draggable=${draggable ? 'true' : 'false'}\n card\n ></ox-record-card>\n `\n })}\n ${this.renderTotals(this._records || [])}\n ${this.empty ? renderEmptyNote(this.emptyNote) : html``}\n ${this.isTop\n ? html``\n : html` <md-icon id=\"upward\" @click=${(e: Event) => this.gotoTop(e)}>arrow_upward</md-icon> `}\n `\n }\n\n private renderTotals(records: GristRecord[]) {\n const columns = this.config.rows.accumulator ? this.config.columns.filter(column => !column.hidden && column.accumulator) : []\n if (columns.length == 0 || records.length == 0) {\n return nothing\n }\n\n const totals = accumulateRecord(this.data, columns)\n return html`<div totals role=\"row\">\n <md-icon>functions</md-icon>\n ${columns.map(\n column =>\n html`<span total=${column.name}\n ><label>${column.header.renderer(column)}</label>${column.record.renderer(totals[column.name], column, totals, records.length, this)}</span\n >`\n )}\n </div>`\n }\n\n gotoTop(e: Event) {\n this.scrollTop = 0\n\n e.stopPropagation()\n }\n\n get pullToRefreshTarget() {\n return this\n }\n}\n"]}
|