@operato/data-grist 10.3.4 → 10.4.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.
@@ -15,6 +15,16 @@ import { DataManipulator } from '../data-manipulator.js';
15
15
  let DataGrid = class DataGrid extends DataManipulator {
16
16
  constructor() {
17
17
  super(...arguments);
18
+ /**
19
+ * 이 표에 고칠 수 있는 열이 하나라도 있나 — **겉모습이 이것으로 갈린다.**
20
+ *
21
+ * 셀 하나를 가리키는 점선과 열 폭 조절 손잡이는 **고칠 셀을 겨누는 장치**다. 고치지 않는 목록에서는
22
+ * 셀 하나가 뜻을 갖지 않아, 줄을 고르려고 누른 자리에 점선이 남고 세로 선이 줄 읽기를 방해한다.
23
+ *
24
+ * 그래서 모드를 따로 두지 않는다. 화면이 고를 일이 아니라 **표가 스스로 아는 사실**이다 —
25
+ * 열에 `record.editable` 이 있으면 고치는 표다.
26
+ */
27
+ this.editableGrid = false;
18
28
  this.fixedLefts = [];
19
29
  }
20
30
  firstUpdated() {
@@ -114,13 +124,22 @@ let DataGrid = class DataGrid extends DataManipulator {
114
124
  calculateWidths(columns) {
115
125
  /*
116
126
  * 컬럼 모델 마지막에 'auto' cell을 추가하여, 자투리 영역을 꽉 채워서 표시한다.
127
+ *
128
+ * 숫자로 준 폭은 **그 폭 그대로** 쓴다. 합이 보이는 폭보다 크면 표는 가로로 넘치고, 나머지는
129
+ * 가로 스크롤로 본다 — 표의 정상 거동이다.
130
+ *
131
+ * 한때 minmax(0, Npx) 로 두어 넘칠 때 열들이 함께 줄게 했다가 되돌렸다. 그렇게 하면 어떤 표도
132
+ * 가로로 넘치지 않으므로 **가로 스크롤이 아예 사라진다.** 열 열다섯 개를 700px 에 밀어 넣으면
133
+ * 모든 열이 못 읽을 만큼 좁아지고, 화면은 그것을 알릴 방법이 없다.
134
+ *
135
+ * 열이 좁아 잘리는 것은 화면이 열 폭을 정해서 풀 일이다 — 부품이 대신 줄이면 화면의 뜻이 사라진다.
117
136
  */
118
137
  const widths = columns
119
138
  .filter(column => !column.hidden)
120
139
  .map(column => {
121
140
  switch (typeof column.width) {
122
141
  case 'number':
123
- return column.width + 'px';
142
+ return `${column.width}px`;
124
143
  case 'string':
125
144
  return column.width;
126
145
  case 'function':
@@ -131,7 +150,10 @@ let DataGrid = class DataGrid extends DataManipulator {
131
150
  })
132
151
  .concat(['auto'])
133
152
  .join(' ');
153
+ /* 겉모습이 이 사실로 갈린다(위 editableGrid 주석 참조). 열이 정해지는 이 시점이 그 자리다. */
154
+ this.editableGrid = columns.some(column => { var _a; return !column.hidden && !column.gutterName && !!((_a = column.record) === null || _a === void 0 ? void 0 : _a.editable); });
134
155
  this.style.setProperty('--grid-template-columns', widths);
156
+ /* 인쇄는 종이 폭에 맞춰 비율로 나눈다. `220px` → `220fr` 로 바뀐다. */
135
157
  this.style.setProperty('--grid-template-print-columns', widths.replace(/px/gi, 'fr'));
136
158
  }
137
159
  render() {
@@ -192,6 +214,19 @@ DataGrid.styles = [
192
214
  MDTypeScaleStyles,
193
215
  ScrollbarStyles,
194
216
  css `
217
+ /*
218
+ * ── 고치는 표만 셀을 겨눈다 ─────────────────────────────────────────
219
+ *
220
+ * 셀 하나를 가리키는 점선과 열 폭 조절 손잡이는 **고칠 셀을 겨누는 장치**다. 기본 겉모습에서는
221
+ * 둘을 두지 않는다(data-grist.ts 의 한 벌). 고칠 수 있는 열이 하나라도 있으면 여기서 되살린다.
222
+ *
223
+ * 화면이 고르는 모드가 아니다 — 표가 스스로 아는 사실이다(위 editableGrid 주석 참조).
224
+ */
225
+ :host([editable-grid]) {
226
+ --grid-record-focused-cell-border: 1px dashed var(--ui-faint, #8a959c);
227
+ --grid-header-splitter-display: flex;
228
+ }
229
+
195
230
  :host {
196
231
  display: flex;
197
232
  flex-direction: column;
@@ -242,6 +277,9 @@ __decorate([
242
277
  __decorate([
243
278
  property({ type: Boolean })
244
279
  ], DataGrid.prototype, "empty", void 0);
280
+ __decorate([
281
+ property({ type: Boolean, reflect: true, attribute: 'editable-grid' })
282
+ ], DataGrid.prototype, "editableGrid", void 0);
245
283
  __decorate([
246
284
  query('ox-grid-body', true)
247
285
  ], DataGrid.prototype, "body", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,kBAAkB,CAAA;AACzB,OAAO,uBAAuB,CAAA;AAC9B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,uBAAuB,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,IAAI,EAA8B,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKxD;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,eAAe;IAAtC;;QAyDI,eAAU,GAAa,EAAE,CAAA;IAuNpC,CAAC;IArNC,YAAY;QACV,4CAA4C;QAC5C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE;YACzC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpD,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAA;YAC/C,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE;YACvC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,K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AA;IACH,CAAC;IAED,KAAK;QACH,KAAK,CAAC,KAAK,EAAE,CAAA;QAEb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;IACnB,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;;AA9QM,eAAM,GAAG;IACd,iBAAiB;IACjB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2CF;CACF,AA/CY,CA+CZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAA0C;AACxC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAAgB;AAEf;IAA5B,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC;sCAAkB;AACf;IAA9B,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC;wCAAwB;AACvB;IAA9B,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC;wCAAoB;AAEzC;IAAR,KAAK,EAAE;4CAA0B;AAzDvB,QAAQ;IADpB,aAAa,CAAC,SAAS,CAAC;GACZ,QAAQ,CAgRpB","sourcesContent":["import i18next from 'i18next'\nimport '../empty-note.js'\nimport './data-grid-header.js'\nimport './data-grid-body.js'\nimport './data-grid-footer.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { DataManipulator } from '../data-manipulator.js'\nimport { ColumnConfig, GristRecord, PaginationConfig } from '../types.js'\n// import { supportsPassive } from '../utils/index.js'\nimport { DataGridHeader } from './data-grid-header.js'\n\n/**\n * DataGrid\n */\n@customElement('ox-grid')\nexport class DataGrid extends DataManipulator {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n\n border-width: var(--grid-container-border-width);\n }\n\n ox-grid-body {\n flex: 1;\n position: relative;\n\n font-variation-settings: 'FILL' 1;\n }\n\n ox-grid-header {\n font-variation-settings: 'FILL' 1;\n }\n\n ox-grid-footer {\n font-variation-settings: 'FILL' 1;\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 div[setting] {\n position: relative;\n z-index: 5;\n }\n\n @media print {\n :host {\n zoom: 80%;\n }\n }\n `\n ]\n\n @property({ type: Object }) focused?: { row: number; column: number }\n @property({ type: Boolean }) empty?: boolean\n\n @query('ox-grid-body', true) body!: LitElement\n @query('ox-grid-header', true) header!: DataGridHeader\n @query('ox-grid-footer', true) footer!: LitElement\n\n @state() fixedLefts: number[] = []\n\n firstUpdated() {\n /* header and body scroll synchronization */\n this.header.addEventListener('scroll', e => {\n if (this.body.scrollLeft !== this.header.scrollLeft) {\n this.body.scrollLeft = this.header.scrollLeft\n }\n })\n\n this.body.addEventListener('scroll', e => {\n if (this.body.scrollLeft !== this.header.scrollLeft) {\n this.header.scrollLeft = this.body.scrollLeft\n }\n })\n\n this.header.addEventListener('wheel', this.onWheelEvent.bind(this))\n this.footer && this.footer.addEventListener('wheel', this.onWheelEvent.bind(this))\n\n /* record selection processing */\n this.addEventListener('select-all-change', e => {\n if (this.data.records.length == 0) {\n return\n }\n\n var { selected } = (e as CustomEvent).detail\n var { records } = this.data\n\n records.forEach(record => (record['__selected__'] = selected))\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n })\n\n this.addEventListener('focus-change', e => {\n const { row, column } = (e as CustomEvent).detail || {}\n if (!this.focused || this.focused.row != row || this.focused.column != column) {\n this.focused = { row, column }\n this.focus()\n this.requestUpdate()\n }\n })\n }\n\n onWheelEvent(e: WheelEvent) {\n if (this.body.scrollWidth > this.body.clientWidth) {\n var delta = Math.max(-1, Math.min(1, e.deltaY || 0))\n this.body.scrollLeft = Math.max(0, this.body.scrollLeft - delta * 30)\n\n var maxScrollLeft = this.body.scrollWidth - this.body.clientWidth\n\n var atStart = this.body.scrollLeft === 0\n var atEnd = this.body.scrollLeft === maxScrollLeft\n\n // 스크롤이 맨 앞으로 와 있는 상태에서 휠을 올리는 경우 또는\n // 스크롤이 맨 끝으로 가 있는 상태에서 휠을 내리는 경우에만 디폴트 동작 허용\n if ((atStart && delta > 0) || (atEnd && delta < 0)) {\n return true\n }\n\n e.preventDefault()\n }\n }\n\n onSelectRecordChanged({\n selectedRecords,\n added,\n removed\n }: {\n selectedRecords: GristRecord[]\n added: GristRecord[]\n removed: GristRecord[]\n }): void {\n super.onSelectRecordChanged({ selectedRecords, added, removed })\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n }\n\n onRecordChanged(\n recordData: GristRecord,\n row: number,\n column: ColumnConfig | null /* TODO column should be removed */\n ) {\n /* record-viewer 등 grid 외에서 변경되는 경우에도 header와 body를 refresh 하도록 한다. */\n super.onRecordChanged(recordData, row, column)\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('data')) {\n /*\n * 데이타 내용에 따라 동적으로 컬럼의 폭이 달라지는 경우(예를 들면, sequence field)가 있으므로,\n * data의 변동에 대해서도 다시 계산되어야 한다.\n */\n this.calculateWidths(this.config.columns)\n\n if (this.focused && 'row' in this.focused) {\n var { row = 0, column = 0 } = this.focused\n var { records: oldrecords = [] } = changes.get('data') || {}\n var { records: newrecords } = this.data\n\n var oldrecord = oldrecords[row]\n\n if (oldrecord && oldrecord !== newrecords[row]) {\n var newrecord = newrecords.find(\n record =>\n /* TODO keyfields를 정의하고, keyfields의 동일성으로 확정해야 한다. */\n oldrecord === record ||\n ('id' in oldrecord\n ? record.id == oldrecord.id\n : 'name' in oldrecord\n ? record.name == oldrecord.name\n : false)\n )\n\n this.focused = {\n row: newrecord ? newrecords.indexOf(newrecord) : row,\n column\n }\n }\n }\n } else if (changes.has('config')) {\n this.calculateWidths(this.config.columns)\n }\n\n /* grid fetch 후에 grid로 focus를 주어야 하는 지 검토가 필요하다. */\n // this.focus()\n }\n\n calculateWidths(columns: ColumnConfig[]) {\n /*\n * 컬럼 모델 마지막에 'auto' cell을 추가하여, 자투리 영역을 꽉 채워서 표시한다.\n */\n const widths = columns\n .filter(column => !column.hidden)\n .map(column => {\n switch (typeof column.width) {\n case 'number':\n return column.width + 'px'\n case 'string':\n return column.width\n case 'function':\n return column.width.call(this, column)\n default:\n return 'auto'\n }\n })\n .concat(['auto'])\n .join(' ')\n\n this.style.setProperty('--grid-template-columns', widths)\n this.style.setProperty('--grid-template-print-columns', widths.replace(/px/gi, 'fr'))\n }\n\n render() {\n var { pagination = {} as PaginationConfig, columns = [], filters } = this.config\n\n var paginatable = !pagination.infinite\n var data = this.data\n\n return html`\n <div setting>\n <slot name=\"setting\"></slot>\n </div>\n\n <ox-grid-header\n class=\"md-typescale-label-medium-prominent\"\n .columns=${columns}\n .sorters=${this.sorters}\n .filters=${this.filters}\n .data=${data}\n ?filtering-feature=${filters?.header}\n @column-width-change=${(e: CustomEvent) => {\n let { idx, width } = e.detail\n columns[idx].width = width\n this.calculateWidths(columns)\n }}\n @fixed-lefts-change=${(e: CustomEvent) => (this.fixedLefts = e.detail)}\n >\n </ox-grid-header>\n\n <ox-grid-body\n class=\"md-typescale-body-medium\"\n .config=${this.config}\n .columns=${columns}\n .data=${data}\n .focused=${this.focused!}\n .fixedLefts=${this.fixedLefts}\n >\n ${this.empty ? html` <ox-empty-note title=${i18next.t('text.grid-no-records', { defaultValue: 'NO RECORDS' })}></ox-empty-note> ` : html``}\n </ox-grid-body>\n ${paginatable\n ? html`\n <ox-grid-footer\n class=\"md-typescale-body-medium\"\n .data=${data}\n .pagination=${this.pagination}\n ></ox-grid-footer>\n `\n : html``}\n `\n }\n\n focus() {\n super.focus()\n\n this.body.focus()\n }\n\n get pullToRefreshTarget() {\n return this.body\n }\n}\n"]}
1
+ {"version":3,"file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AC,CAAC,CAAC,IAAI,CAAA,EAAE;;QAE1I,WAAW;YACX,CAAC,CAAC,IAAI,CAAA;;;sBAGQ,IAAI;4BACE,IAAI,CAAC,UAAU;;WAEhC;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;KACX,CAAA;IACH,CAAC;IAED,KAAK;QACH,KAAK,CAAC,KAAK,EAAE,CAAA;QAEb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;IACnB,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;;AAnTM,eAAM,GAAG;IACd,iBAAiB;IACjB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;CACF,AA5DY,CA4DZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAA0C;AACxC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAAgB;AAW4B;IAAvE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;8CAA8B;AAExE;IAA5B,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC;sCAAkB;AACf;IAA9B,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC;wCAAwB;AACvB;IAA9B,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC;wCAAoB;AAEzC;IAAR,KAAK,EAAE;4CAA0B;AAjFvB,QAAQ;IADpB,aAAa,CAAC,SAAS,CAAC;GACZ,QAAQ,CAqTpB","sourcesContent":["import i18next from 'i18next'\nimport '../empty-note.js'\nimport './data-grid-header.js'\nimport './data-grid-body.js'\nimport './data-grid-footer.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { DataManipulator } from '../data-manipulator.js'\nimport { ColumnConfig, GristRecord, PaginationConfig } from '../types.js'\n// import { supportsPassive } from '../utils/index.js'\nimport { DataGridHeader } from './data-grid-header.js'\n\n/**\n * DataGrid\n */\n@customElement('ox-grid')\nexport class DataGrid extends DataManipulator {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n /*\n * ── 고치는 표만 셀을 겨눈다 ─────────────────────────────────────────\n *\n * 셀 하나를 가리키는 점선과 열 폭 조절 손잡이는 **고칠 셀을 겨누는 장치**다. 기본 겉모습에서는\n * 둘을 두지 않는다(data-grist.ts 의 한 벌). 고칠 수 있는 열이 하나라도 있으면 여기서 되살린다.\n *\n * 화면이 고르는 모드가 아니다 — 표가 스스로 아는 사실이다(위 editableGrid 주석 참조).\n */\n :host([editable-grid]) {\n --grid-record-focused-cell-border: 1px dashed var(--ui-faint, #8a959c);\n --grid-header-splitter-display: flex;\n }\n\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n\n border-width: var(--grid-container-border-width);\n }\n\n ox-grid-body {\n flex: 1;\n position: relative;\n\n font-variation-settings: 'FILL' 1;\n }\n\n ox-grid-header {\n font-variation-settings: 'FILL' 1;\n }\n\n ox-grid-footer {\n font-variation-settings: 'FILL' 1;\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 div[setting] {\n position: relative;\n z-index: 5;\n }\n\n @media print {\n :host {\n zoom: 80%;\n }\n }\n `\n ]\n\n @property({ type: Object }) focused?: { row: number; column: number }\n @property({ type: Boolean }) empty?: boolean\n\n /**\n * 이 표에 고칠 수 있는 열이 하나라도 있나 — **겉모습이 이것으로 갈린다.**\n *\n * 셀 하나를 가리키는 점선과 열 폭 조절 손잡이는 **고칠 셀을 겨누는 장치**다. 고치지 않는 목록에서는\n * 셀 하나가 뜻을 갖지 않아, 줄을 고르려고 누른 자리에 점선이 남고 세로 선이 줄 읽기를 방해한다.\n *\n * 그래서 모드를 따로 두지 않는다. 화면이 고를 일이 아니라 **표가 스스로 아는 사실**이다 —\n * 열에 `record.editable` 이 있으면 고치는 표다.\n */\n @property({ type: Boolean, reflect: true, attribute: 'editable-grid' }) editableGrid: boolean = false\n\n @query('ox-grid-body', true) body!: LitElement\n @query('ox-grid-header', true) header!: DataGridHeader\n @query('ox-grid-footer', true) footer!: LitElement\n\n @state() fixedLefts: number[] = []\n\n firstUpdated() {\n /* header and body scroll synchronization */\n this.header.addEventListener('scroll', e => {\n if (this.body.scrollLeft !== this.header.scrollLeft) {\n this.body.scrollLeft = this.header.scrollLeft\n }\n })\n\n this.body.addEventListener('scroll', e => {\n if (this.body.scrollLeft !== this.header.scrollLeft) {\n this.header.scrollLeft = this.body.scrollLeft\n }\n })\n\n this.header.addEventListener('wheel', this.onWheelEvent.bind(this))\n this.footer && this.footer.addEventListener('wheel', this.onWheelEvent.bind(this))\n\n /* record selection processing */\n this.addEventListener('select-all-change', e => {\n if (this.data.records.length == 0) {\n return\n }\n\n var { selected } = (e as CustomEvent).detail\n var { records } = this.data\n\n records.forEach(record => (record['__selected__'] = selected))\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n })\n\n this.addEventListener('focus-change', e => {\n const { row, column } = (e as CustomEvent).detail || {}\n if (!this.focused || this.focused.row != row || this.focused.column != column) {\n this.focused = { row, column }\n this.focus()\n this.requestUpdate()\n }\n })\n }\n\n onWheelEvent(e: WheelEvent) {\n if (this.body.scrollWidth > this.body.clientWidth) {\n var delta = Math.max(-1, Math.min(1, e.deltaY || 0))\n this.body.scrollLeft = Math.max(0, this.body.scrollLeft - delta * 30)\n\n var maxScrollLeft = this.body.scrollWidth - this.body.clientWidth\n\n var atStart = this.body.scrollLeft === 0\n var atEnd = this.body.scrollLeft === maxScrollLeft\n\n // 스크롤이 맨 앞으로 와 있는 상태에서 휠을 올리는 경우 또는\n // 스크롤이 맨 끝으로 가 있는 상태에서 휠을 내리는 경우에만 디폴트 동작 허용\n if ((atStart && delta > 0) || (atEnd && delta < 0)) {\n return true\n }\n\n e.preventDefault()\n }\n }\n\n onSelectRecordChanged({\n selectedRecords,\n added,\n removed\n }: {\n selectedRecords: GristRecord[]\n added: GristRecord[]\n removed: GristRecord[]\n }): void {\n super.onSelectRecordChanged({ selectedRecords, added, removed })\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n }\n\n onRecordChanged(\n recordData: GristRecord,\n row: number,\n column: ColumnConfig | null /* TODO column should be removed */\n ) {\n /* record-viewer 등 grid 외에서 변경되는 경우에도 header와 body를 refresh 하도록 한다. */\n super.onRecordChanged(recordData, row, column)\n\n this.header.requestUpdate()\n this.body.requestUpdate()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('data')) {\n /*\n * 데이타 내용에 따라 동적으로 컬럼의 폭이 달라지는 경우(예를 들면, sequence field)가 있으므로,\n * data의 변동에 대해서도 다시 계산되어야 한다.\n */\n this.calculateWidths(this.config.columns)\n\n if (this.focused && 'row' in this.focused) {\n var { row = 0, column = 0 } = this.focused\n var { records: oldrecords = [] } = changes.get('data') || {}\n var { records: newrecords } = this.data\n\n var oldrecord = oldrecords[row]\n\n if (oldrecord && oldrecord !== newrecords[row]) {\n var newrecord = newrecords.find(\n record =>\n /* TODO keyfields를 정의하고, keyfields의 동일성으로 확정해야 한다. */\n oldrecord === record ||\n ('id' in oldrecord\n ? record.id == oldrecord.id\n : 'name' in oldrecord\n ? record.name == oldrecord.name\n : false)\n )\n\n this.focused = {\n row: newrecord ? newrecords.indexOf(newrecord) : row,\n column\n }\n }\n }\n } else if (changes.has('config')) {\n this.calculateWidths(this.config.columns)\n }\n\n /* grid fetch 후에 grid로 focus를 주어야 하는 지 검토가 필요하다. */\n // this.focus()\n }\n\n calculateWidths(columns: ColumnConfig[]) {\n /*\n * 컬럼 모델 마지막에 'auto' cell을 추가하여, 자투리 영역을 꽉 채워서 표시한다.\n *\n * 숫자로 준 폭은 **그 폭 그대로** 쓴다. 합이 보이는 폭보다 크면 표는 가로로 넘치고, 나머지는\n * 가로 스크롤로 본다 — 표의 정상 거동이다.\n *\n * 한때 minmax(0, Npx) 로 두어 넘칠 때 열들이 함께 줄게 했다가 되돌렸다. 그렇게 하면 어떤 표도\n * 가로로 넘치지 않으므로 **가로 스크롤이 아예 사라진다.** 열 열다섯 개를 700px 에 밀어 넣으면\n * 모든 열이 못 읽을 만큼 좁아지고, 화면은 그것을 알릴 방법이 없다.\n *\n * 열이 좁아 잘리는 것은 화면이 열 폭을 정해서 풀 일이다 — 부품이 대신 줄이면 화면의 뜻이 사라진다.\n */\n const widths = columns\n .filter(column => !column.hidden)\n .map(column => {\n switch (typeof column.width) {\n case 'number':\n return `${column.width}px`\n case 'string':\n return column.width\n case 'function':\n return column.width.call(this, column)\n default:\n return 'auto'\n }\n })\n .concat(['auto'])\n .join(' ')\n\n /* 겉모습이 이 사실로 갈린다(위 editableGrid 주석 참조). 열이 정해지는 이 시점이 그 자리다. */\n this.editableGrid = columns.some(column => !column.hidden && !column.gutterName && !!column.record?.editable)\n\n this.style.setProperty('--grid-template-columns', widths)\n /* 인쇄는 종이 폭에 맞춰 비율로 나눈다. `220px` → `220fr` 로 바뀐다. */\n this.style.setProperty('--grid-template-print-columns', widths.replace(/px/gi, 'fr'))\n }\n\n render() {\n var { pagination = {} as PaginationConfig, columns = [], filters } = this.config\n\n var paginatable = !pagination.infinite\n var data = this.data\n\n return html`\n <div setting>\n <slot name=\"setting\"></slot>\n </div>\n\n <ox-grid-header\n class=\"md-typescale-label-medium-prominent\"\n .columns=${columns}\n .sorters=${this.sorters}\n .filters=${this.filters}\n .data=${data}\n ?filtering-feature=${filters?.header}\n @column-width-change=${(e: CustomEvent) => {\n let { idx, width } = e.detail\n columns[idx].width = width\n this.calculateWidths(columns)\n }}\n @fixed-lefts-change=${(e: CustomEvent) => (this.fixedLefts = e.detail)}\n >\n </ox-grid-header>\n\n <ox-grid-body\n class=\"md-typescale-body-medium\"\n .config=${this.config}\n .columns=${columns}\n .data=${data}\n .focused=${this.focused!}\n .fixedLefts=${this.fixedLefts}\n >\n ${this.empty ? html` <ox-empty-note title=${i18next.t('text.grid-no-records', { defaultValue: 'NO RECORDS' })}></ox-empty-note> ` : html``}\n </ox-grid-body>\n ${paginatable\n ? html`\n <ox-grid-footer\n class=\"md-typescale-body-medium\"\n .data=${data}\n .pagination=${this.pagination}\n ></ox-grid-footer>\n `\n : html``}\n `\n }\n\n focus() {\n super.focus()\n\n this.body.focus()\n }\n\n get pullToRefreshTarget() {\n return this.body\n }\n}\n"]}
@@ -1020,6 +1020,58 @@ DataGrist.styles = [
1020
1020
  HeadroomStyles,
1021
1021
  SpinnerStyles,
1022
1022
  css `
1023
+ /*
1024
+ * ── 표의 겉모습 — 한 벌로 여기서 정한다 ──────────────────────────────
1025
+ *
1026
+ * 화면마다 --grid-* 토큰을 하나씩 덮어 모양을 바꾸지 않는다. 그 방식은 두 가지로 깨졌다.
1027
+ *
1028
+ * · 한 토큰이 두 뜻을 겸한다. --grid-record-focused-cell-border 는 「초점 표식」이면서
1029
+ * 「줄을 나누는 선」이었다. 표식을 감추려고 none 을 주면 줄 선이 사라졌다
1030
+ * · 스무 개를 짝 맞춰 덮어야 한 벌이 되고, 하나 빠지면 그 자리만 옛 모양으로 남는다
1031
+ *
1032
+ * 토큰은 shadow DOM 을 넘어 상속되므로 여기서 정하면 머리·칸·바닥까지 그대로 닿는다.
1033
+ *
1034
+ * 무엇을 바꾸는가 — 표가 자기 틀을 값보다 앞세우지 않게 한다.
1035
+ *
1036
+ * 머리 회색 바탕 + 2px 파란 윗선 + 파란 글자 → 면 색 + 아랫선 하나 + 작은 대문자 라벨
1037
+ * 줄 홀짝 회색 번갈이(zebra) → 선으로만 구분
1038
+ * 세로선 열마다 있었다 → 없음
1039
+ * 폭 조절 끌 수 있었다 → 없음 (세로선을 그리던 것이 이 손잡이다)
1040
+ * 셀 초점 점선 네모 → 없음 (줄 단위로 고르는 표에서는 뜻이 없다)
1041
+ * 바닥 회색 바탕 + 파란 글자 → 면 색 + 흐린 글자
1042
+ * 값 흐린 색 → 가장 진하게
1043
+ *
1044
+ * 줄무늬를 없앤 것은 취향이 아니다. 홀짝 회색이 깔려 있으면 **골라 놓은 줄과 마우스 올린 줄이
1045
+ * 그 무늬에 묻힌다.** 색은 「지금 무엇을 하고 있나」에만 쓴다.
1046
+ */
1047
+ :host {
1048
+ --grid-header-background-color: var(--ui-bg, #f6f7f9);
1049
+ --grid-header-top-border: none;
1050
+ --grid-header-bottom-border: 1px solid var(--ui-line, #d5dce0);
1051
+ --grid-header-padding: 8px 10px;
1052
+ --grid-header-color: var(--ui-muted, #57676f);
1053
+ --grid-header-font: 600 var(--ui-t-micro, 11px) / 1 var(--ui-mono, ui-monospace, Menlo, monospace);
1054
+ --grid-header-text-transform: uppercase;
1055
+ --grid-header-letter-spacing: 0.07em;
1056
+ --grid-header-sorter-size: 14px;
1057
+ --grid-header-mark-size: 14px;
1058
+ /* 세로 선을 그리는 것이 폭 조절 손잡이다 — 감추면 둘이 함께 사라진다. */
1059
+ --grid-header-splitter-display: none;
1060
+
1061
+ --grid-record-background-color: var(--ui-panel, #ffffff);
1062
+ --grid-record-odd-background-color: var(--ui-panel, #ffffff);
1063
+ --grid-record-padding: 9px 10px;
1064
+ --grid-record-color: var(--ui-ink, #17242c);
1065
+ --grid-record-border-bottom: 1px solid var(--ui-line-soft, #e6eaed);
1066
+ /* 초점 표식을 없앤다. outline 으로 그리므로 줄 선은 그대로 남는다. */
1067
+ --grid-record-focused-cell-border: none;
1068
+ --grid-record-focused-box-shadow: none;
1069
+
1070
+ --grid-footer-background-color: var(--ui-bg, #f6f7f9);
1071
+ --grid-footer-color: var(--ui-muted, #57676f);
1072
+ --grid-footer-padding: 8px 12px;
1073
+ }
1074
+
1023
1075
  :host {
1024
1076
  display: flex;
1025
1077
  flex-direction: column;
@@ -1 +1 @@
1
- {"version":3,"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;IAA5B,UAAU,CAAC,OAAO,CAAC;uCAAoC;AAtJ7C,SAAS;IADrB,aAAa,CAAC,UAAU,CAAC;GACb,SAAS,CAoyCrB","sourcesContent":["import './data-grid/data-grid.js'\nimport './data-list/data-list.js'\nimport './data-card/data-card.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, queryAsync, state } from 'lit/decorators.js'\nimport isEmpty from 'lodash-es/isEmpty.js'\nimport isEqual from 'lodash-es/isEqual.js'\n\nimport Headroom from '@operato/headroom'\nimport { pulltorefresh } from '@operato/pull-to-refresh'\nimport { HeadroomStyles, ScrollbarStyles, SpinnerStyles } from '@operato/styles'\nimport { PagePreferenceProvider } from '@operato/p13n'\nimport { SnapshotTaker, TimeCapsule } from '@operato/utils'\n\nimport { buildConfig } from './configure/config-builder.js'\nimport { ZERO_CONFIG, ZERO_DATA, ZERO_PAGES, ZERO_PAGINATION } from './configure/zero-config.js'\nimport { DataCard } from './data-card/data-card.js'\nimport { DataConsumer } from './data-consumer.js'\nimport { DataGrid } from './data-grid/data-grid.js'\nimport { DataList } from './data-list/data-list.js'\nimport { DataProvider } from './data-provider.js'\nimport {\n ColumnConfig,\n FetchHandler,\n FilterConfigObject,\n FilterValue,\n GristConfig,\n GristData,\n GristRecord,\n GristSelectFunction,\n PaginationConfig,\n PersonalGristPreference,\n SortersConfig,\n ValidationReason\n} from './types.js'\nimport { convertListParamToSearchString, convertSearchStringToListParam } from './utils/index.js'\n\n/**\n * A custom element for rendering data in a grid, list, or card format.\n *\n * @element ox-grist\n */\n@customElement('ox-grist')\nexport class DataGrist extends LitElement implements DataConsumer {\n static styles = [\n ScrollbarStyles,\n HeadroomStyles,\n SpinnerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background-color: var(--grist-background-color);\n min-height: 120px;\n\n overflow: hidden;\n\n /* for pulltorefresh controller */\n position: relative;\n\n padding: var(--ox-grist-padding);\n\n --md-icon-size: var(--grid-record-wide-fontsize);\n }\n\n #wrap {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: auto;\n }\n\n ox-grid {\n flex: 1;\n border: var(--grid-wrap-container-border, 0px solid transparent);\n border-width: var(--grid-wrap-container-border-width, 0px);\n }\n\n slot[name='headroom'] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n box-sizing: border-box;\n background-color: var(--grist-background-color);\n\n z-index: 8;\n }\n `\n ]\n\n /**\n * The rendering mode of the component, which can be 'GRID', 'LIST', or 'CARD'.\n * Default is 'GRID'.\n *\n * @property {string}\n */\n @property() mode: 'GRID' | 'LIST' | 'CARD' = 'GRID'\n\n /**\n * The configuration object for the data grist.\n *\n * @property {Object}\n */\n @property() config: any\n\n /**\n * The data to be displayed in the data grist.\n *\n * @property {GristData}\n */\n @property({ type: Object }) data: GristData = ZERO_DATA\n\n /**\n * An array of selected records in the data grist.\n *\n * @property {GristRecord[]}\n */\n @property({ type: Array }) selectedRecords?: GristRecord[]\n\n /**\n * Indicates whether explicit fetching of data is enabled. If true, data will be fetched\n * only when `fetch` method is called. Default is false.\n *\n * @property {boolean}\n */\n @property({ type: Boolean, attribute: 'explicit-fetch' }) explicitFetch: boolean = false\n\n /**\n * The fetch handler function used to retrieve data from a remote source.\n *\n * @property {FetchHandler}\n */\n @property() fetchHandler?: FetchHandler\n\n /**\n * Additional fetch options to be passed to the fetch handler.\n *\n * @property {Object}\n */\n @property() fetchOptions: any\n\n /**\n * An array of filter values to be applied to the data grist.\n *\n * @property {FilterValue[]}\n */\n @property({ type: Array }) filters?: FilterValue[]\n\n /**\n * An array of sorters to determine the order of records in the data grist.\n *\n * @property {SortersConfig}\n */\n @property({ type: Array }) sorters?: SortersConfig\n\n /**\n * The pagination configuration for the data grist.\n *\n * @property {PaginationConfig}\n */\n @property({ type: Object }) pagination?: PaginationConfig\n\n /**\n * Indicates whether URL parameters are sensitive to changes. If true, changes in URL\n * parameters will trigger data fetching. Default is undefined.\n *\n * @property {boolean}\n */\n @property({ type: Boolean, attribute: 'url-params-sensitive' }) urlParamsSensitive?: boolean\n\n @property({ type: Object }) personalConfigProvider: PagePreferenceProvider = {\n load: () => {\n return {}\n },\n save: (preference: any) => preference,\n reset: () => {}\n }\n\n @state() personalConfig?: {\n columns?: Partial<ColumnConfig>[]\n [key: string]: any\n }\n\n @state() _data: GristData = ZERO_DATA // copy data, dirty data\n @state() _config: GristConfig = ZERO_CONFIG // compiled configuration\n @state() private _showSpinner: boolean = false\n\n @query('slot[name=headroom]') head!: HTMLElement\n @query('#grist') grist!: DataGrid | DataList | DataCard\n @queryAsync('#wrap') private wrap!: Promise<HTMLElement>\n\n private timeCapsule?: TimeCapsule\n private snapshotTaker?: SnapshotTaker\n\n private dataProvider?: DataProvider\n private pulltorefreshHandle?: any\n private headroom?: Headroom\n private orginPaddingTop?: string\n private originMarginTop?: string\n\n /*\n * 머리(headroom)의 높이는 **한 번만 재면 안 된다.**\n *\n * 머리는 position: absolute 라 본문이 그만큼 밀려 있어야 하는데, 그 값을 setHeadroom 시점의\n * clientHeight 로 한 번 정해 두었다. 그래서 머리 안의 내용이 나중에 커지면(글꼴이 늦게 오거나,\n * 버튼 높이가 바뀌거나, 제목이 두 줄이 되거나) 본문이 머리 아래로 파고들어 **글자가 겹친다.**\n *\n * 실제로 동작 버튼 높이를 32px 에서 36px 로 올렸을 때 제목 줄과 열 머리글이 겹쳤다.\n * 크기를 지켜보고 그때마다 다시 민다.\n */\n private headResizeObserver?: ResizeObserver\n private headroomAtTop: boolean = true\n private lastLocation: { origin?: string; pathname?: string; search?: string } = {}\n\n /* 그리드가 준비되기 전에 fetch 요청이 있었음을 나타내는 플래그임 */\n private pendingFetch?: boolean\n\n private popstateEventHandler: EventListener = ((e: Event) => {\n const { origin, pathname, search } = window.location\n if (\n this.lastLocation.origin &&\n (this.lastLocation.origin !== origin ||\n this.lastLocation.pathname !== pathname ||\n this.lastLocation.search === search)\n ) {\n return\n }\n\n this.lastLocation = {\n origin,\n pathname,\n search\n }\n\n var { filters = [], sorters = [] } = convertSearchStringToListParam(search)\n\n try {\n if (!isEqual(filters, this.filters) || !isEqual(sorters, this.sorters)) {\n this.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters,\n sorters,\n from: 'url-parameter'\n }\n })\n )\n }\n } catch (e) {\n console.error(`invalid fetch params on URL query string : ${e}`)\n }\n }).bind(this)\n\n private fetchParamsChangeEventHandler: EventListener = ((e: Event) => {\n const { sorters, filters, from } = (e as CustomEvent).detail\n\n sorters && (this.sorters = sorters)\n filters && (this.filters = filters)\n\n if (!this.urlParamsSensitive || from === 'url-parameter') {\n return\n }\n\n const queryString = convertListParamToSearchString({ filters, sorters, base: window.location.search })\n this.lastLocation.search = queryString ? `?${queryString}` : ''\n const url = `${window.location.pathname}${this.lastLocation.search}`\n\n history.pushState({}, document.title, url)\n }).bind(this)\n\n async firstUpdated() {\n // Mutation Observer를 사용하여 슬롯의 크기 변경을 감지하고 다시 그린다.\n const observer = new ResizeObserver(mutationsList => {\n this.setHeadroom()\n })\n\n observer.observe(this.head)\n }\n\n async connectedCallback() {\n super.connectedCallback()\n\n this.dataProvider = new DataProvider(this)\n\n this.timeCapsule = new TimeCapsule(10)\n this.snapshotTaker = new SnapshotTaker(this, this.timeCapsule!)\n\n this.addEventListener('fetch-params-change', this.fetchParamsChangeEventHandler)\n document.addEventListener('keydown', this._onDocumentKeydown)\n\n await this.updateComplete\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.removeEventListener('fetch-params-change', this.fetchParamsChangeEventHandler)\n document.removeEventListener('keydown', this._onDocumentKeydown)\n\n this.headResizeObserver?.disconnect()\n delete this.headResizeObserver\n\n this.timeCapsule && this.timeCapsule.dispose()\n this.snapshotTaker && this.snapshotTaker.dispose()\n\n delete this.timeCapsule\n delete this.snapshotTaker\n\n this.dataProvider?.dispose()\n this.resetPullToRefresh()\n }\n\n private resetPullToRefresh() {\n if (this.pulltorefreshHandle) {\n this.pulltorefreshHandle()\n delete this.pulltorefreshHandle\n }\n }\n\n private async setPullToRefresh() {\n this.resetPullToRefresh()\n if (this.mode !== 'GRID' && this.fetchHandler) {\n this.pulltorefreshHandle = pulltorefresh({\n container: await this.wrap,\n scrollable: this.grist.pullToRefreshTarget,\n refresh: () => {\n return this.fetch(true)\n }\n })\n }\n }\n\n public applyUpdatedConfiguration() {\n if (!this.personalConfig || !this.config) {\n return\n }\n\n const config = { ...this.config }\n const columns: Partial<ColumnConfig>[] = config.columns\n\n const { columns: personalColumns, sorters, pagination, mode } = this.personalConfig\n\n if (personalColumns) {\n const xcolumns = columns.map((column: Partial<ColumnConfig>) => {\n const personalColumn = personalColumns.find(pcolumn => pcolumn.name == column.name)\n return personalColumn ? { ...column, ...personalColumn } : column\n })\n\n function reorderList(a: { name: string }[], b: { name: string }[]): { name: string }[] {\n // 결과 배열 초기화, a 배열 길이만큼 undefined로 채움\n const result = new Array(a.length)\n\n // b 배열에 없는 아이템은 원래 위치로 채움\n a.forEach((item, index) => {\n if (!item.name || !b.find(bi => bi.name == item.name)) {\n result[index] = item\n }\n })\n\n b.forEach(item => {\n const ai = a.find(ai => ai.name == item.name)\n if (ai) {\n result[result.findIndex(slot => slot === undefined)] = ai\n }\n })\n\n return result\n }\n\n // 배열 재정렬 실행\n config.columns = reorderList(xcolumns as any, personalColumns as any)\n }\n\n if (pagination) {\n config.pagination = pagination\n }\n\n if (sorters) {\n config.sorters = sorters\n }\n\n if (mode) {\n this.mode = mode\n }\n\n this._config = buildConfig({\n ...config\n })\n\n this.dispatchEvent(\n new CustomEvent('config-change', {\n bubbles: true,\n composed: true,\n detail: this.compiledConfig\n })\n )\n\n this.pagination = this.compiledConfig.pagination || {}\n\n if (!this.urlParamsSensitive) {\n const sorters = this.compiledConfig?.sorters\n const filters = this.compiledConfig?.columns\n .filter(\n column =>\n column.filter &&\n 'value' in (column.filter as FilterConfigObject) &&\n (typeof (column.filter as FilterConfigObject).value === 'boolean' ||\n (column.filter as FilterConfigObject).value)\n )\n .map(column => {\n const filter = column.filter as FilterConfigObject\n return { name: column.name, operator: filter.operator, value: filter.value } as FilterValue\n })\n\n this.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters,\n sorters,\n from: 'config'\n }\n })\n )\n }\n\n if (this.dataProvider) {\n const { limit, pages = ZERO_PAGES } = this._config.pagination || ZERO_PAGINATION\n this.dataProvider.page = 1\n this.dataProvider.limit = limit || pages[0] || ZERO_PAGES[0]\n }\n\n if (this.pendingFetch || (!this.urlParamsSensitive && !this.explicitFetch)) {\n this.pendingFetch = false\n this.fetch()\n }\n }\n\n /** 머리 높이만큼 본문을 민다. 위에 있을 때는 margin, 스크롤 중일 때는 padding 이다. */\n private applyHeadOffset() {\n if (!this.grist || !this.head || this.head.style.display === 'none') {\n return\n }\n\n const offset = this.head.clientHeight + 'px'\n\n if (this.headroomAtTop) {\n this.grist.style.marginTop = offset\n } else {\n this.grist.style.paddingTop = offset\n }\n }\n\n private setHeadroom() {\n this.headroom?.destroy()\n\n if (this.grist && this.head && this.head.style.display !== 'none') {\n const style = getComputedStyle(this.grist)\n\n this.orginPaddingTop = style.paddingTop || '0'\n this.originMarginTop = style.marginTop || '0'\n\n this.headroom = new Headroom(this.head, {\n scroller: this.grist,\n onTop: () => {\n this.grist.style.paddingTop = this.orginPaddingTop!\n this.originMarginTop = this.grist.style.marginTop\n\n this.headroomAtTop = true\n this.applyHeadOffset()\n },\n onNotTop: () => {\n this.grist.style.marginTop = this.originMarginTop!\n this.orginPaddingTop = this.grist.style.paddingTop\n\n this.headroomAtTop = false\n this.applyHeadOffset()\n }\n })\n\n this.headroom.init()\n\n /* 머리가 커지거나 줄면 그때마다 다시 민다 — 한 번 잰 값으로 두면 내용이 겹친다. */\n this.headResizeObserver?.disconnect()\n this.headResizeObserver = new ResizeObserver(() => this.applyHeadOffset())\n this.headResizeObserver.observe(this.head)\n } else if (this.orginPaddingTop) {\n this.grist.style.paddingTop = this.orginPaddingTop\n this.grist.style.marginTop = this.originMarginTop!\n }\n }\n\n render() {\n const empty = !this._showSpinner && this._data.records.length == 0\n\n return html`\n <slot name=\"headroom\"> </slot>\n <div id=\"wrap\" @keydown=${(e: KeyboardEvent) => this.onKeydown(e)}>\n ${this.mode == 'GRID'\n ? html`\n <ox-grid\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n .pagination=${this.pagination || {}}\n ?empty=${empty}\n >\n <slot name=\"setting\" slot=\"setting\"> </slot>\n </ox-grid>\n `\n : this.mode == 'CARD'\n ? html`\n <ox-card\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n ?empty=${empty}\n >\n </ox-card>\n `\n : html`\n <ox-list\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n ?empty=${empty}\n >\n </ox-list>\n `}\n </div>\n\n <div id=\"spinner\" ?show=${this._showSpinner}></div>\n `\n }\n\n /* for timecapsule feature */\n private onKeydown(e: KeyboardEvent) {\n if (e.key === 'z' && (e.metaKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.redo()\n } else {\n this.undo()\n }\n }\n }\n\n /* 트리 그리드 단일 셀 복사 폴백: document 레벨에서 Ctrl+C를 수신.\n * 혼합 화면 등에서 행 클릭 후 scan input이 포커스를 빼앗아가므로\n * DataGrist 내부 이벤트 버블링에 의존할 수 없어 document 레벨에서 처리.\n * 이 DataGrist에 focused 셀이 있을 때만 동작한다. */\n private _onDocumentKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'c' || !(e.metaKey || e.ctrlKey) || this.mode !== 'GRID') return\n if (e.defaultPrevented) return // 내부 DataGridBody 핸들러가 이미 처리함\n const grist = this.grist as any\n const focused = grist?.focused\n if (focused?.row === undefined) return\n const selection = window.getSelection()\n if (selection?.type === 'Range') return\n /* DataGridBody.copy()에 위임: 컬럼 조회·클립보드 쓰기·flash 애니메이션을 일괄 처리 */\n e.preventDefault()\n ;(grist.body as any).copy()\n }\n\n /**\n * Gets the current state of the component. The state includes information about the\n * dirty records and their changes.\n *\n * @getter\n * @public\n * @type {string}\n */\n get state() {\n return JSON.stringify(this.dirtyData)\n }\n\n /**\n * Undoes the previous change in the component's data by restoring it to the previous state.\n * This method is part of the TimeCapsule feature, allowing users to revert changes.\n */\n undo() {\n if (!this.timeCapsule?.backwardable) {\n return\n }\n\n this._data = JSON.parse(this.timeCapsule?.backward())\n }\n\n /**\n * Redoes the previously undone change in the component's data by restoring it to the next state.\n * This method is part of the TimeCapsule feature, allowing users to reapply changes.\n */\n redo() {\n if (!this.timeCapsule?.forwardable) {\n return\n }\n\n this._data = JSON.parse(this.timeCapsule?.forward())\n }\n\n /**\n * Fetches data from a data source and updates the component's data. This method is used to retrieve\n * new data or refresh the existing data in the component.\n *\n * @method\n * @param {boolean} reset - If true, the method resets the scroll position to the top.\n */\n async fetch(reset = true) {\n if (this.compiledConfig === ZERO_CONFIG) {\n /* avoid to be here */\n console.warn('grist is not configured yet.')\n this.pendingFetch = true\n return\n }\n\n if (reset && this.grist) {\n /*\n * scroll 의 현재위치에 의해서 scroll 이벤트가 발생할 수 있으므로, 이를 방지하기 위해서 스크롤의 위치를 TOP으로 옮긴다.\n * (scroll 이 첫페이지 크기 이상으로 내려가 있는 경우, 첫페이지부터 다시 표시하는 경우에, scroll 이벤트가 발생한다.)\n */\n this.grist.scrollTop = 0\n }\n\n if (this.dataProvider) {\n let { limit: initLimit, page: initPage, infinite } = this.compiledConfig.pagination || {}\n let { limit = initLimit || ZERO_PAGINATION.limit, page = initPage || ZERO_PAGINATION.page } = this.dataProvider\n\n if (infinite || this.mode !== 'GRID') {\n await this.dataProvider.attach(reset)\n } else {\n await this.dataProvider.fetch({\n limit,\n page,\n sorters: this.sorters || this.compiledConfig?.sorters,\n sortings: this.sorters || this.compiledConfig?.sorters,\n filters: this.filters\n })\n\n this.pagination && (this.pagination!.limit = limit)\n }\n }\n }\n\n async updated(changes: PropertyValues<this>) {\n var needToSetPullToRefresh = false\n\n if (changes.has('filters')) {\n await this.requestUpdate()\n }\n\n if (changes.has('sorters')) {\n await this.requestUpdate()\n }\n\n if (changes.has('personalConfigProvider')) {\n this.personalConfig = await this.personalConfigProvider.load()\n } else if (changes.has('config') || changes.has('personalConfig')) {\n this.applyUpdatedConfiguration()\n }\n\n if (changes.has('fetchHandler')) {\n this.dataProvider && (this.dataProvider.fetchHandler = this.fetchHandler)\n needToSetPullToRefresh = true\n }\n\n if (changes.has('fetchOptions')) {\n this.dataProvider && (this.dataProvider.fetchOptions = this.fetchOptions)\n }\n\n if (changes.has('data')) {\n this.reset()\n }\n\n if (changes.has('mode')) {\n if (this.mode === 'GRID') {\n this.style.removeProperty('--ox-grist-padding')\n } else {\n this.style.setProperty('--ox-grist-padding', '0')\n }\n\n needToSetPullToRefresh = true\n this.setHeadroom()\n }\n\n if (changes.has('selectedRecords')) {\n var { records } = this.data || []\n var selectedRecords = this.selectedRecords || []\n\n var _records = this.dirtyData.records\n\n /* 원본데이타에서 index를 찾아서, 복사본 데이타의 selected를 설정한다. */\n selectedRecords.forEach(selected => {\n var index = records.indexOf(selected)\n var record = _records[index]\n if (record) {\n record['__selected__'] = true\n }\n })\n\n /* update _data property intentionally */\n this.refresh()\n }\n\n if (changes.has('urlParamsSensitive')) {\n if (this.urlParamsSensitive) {\n //@ts-ignore\n this.popstateEventHandler() // call for the first time\n\n window.addEventListener('popstate', this.popstateEventHandler)\n } else {\n window.removeEventListener('popstate', this.popstateEventHandler)\n }\n }\n\n if (needToSetPullToRefresh) {\n await this.setPullToRefresh()\n }\n }\n\n /**\n * Represents the compiled configuration of the component, which includes various settings and\n * column configurations. You can access this property to get information about how the component\n * is configured.\n *\n * @getter\n * @public\n * @type {GristConfig}\n */\n get compiledConfig(): GristConfig {\n return this._config\n }\n\n /**\n * Returns the dirty data in the component, which includes the records that have been added,\n * modified, or deleted but have not been committed to the main data yet.\n *\n * @getter\n * @public\n * @type {GristData} - An object representing the dirty data.\n */\n get dirtyData(): GristData {\n return (this.grist as any)?.data || {}\n }\n\n /**\n * Returns an array of GristRecord objects representing the records in the dirty state. These are\n * the records that have been added, modified, or deleted but have not been committed to the main\n * data yet.\n *\n * @getter\n * @public\n * @type {GristRecord[]} - An array of GristRecord objects representing the dirty records.\n */\n get dirtyRecords() {\n var { records = [] } = this.dirtyData\n return records\n .filter(record => record['__dirty__'])\n .filter(record => {\n // cuFlag 제외하고 키가 모두 빈값이면 필터함 (오브젝트일때는 키가 있어도 모든 값이 빈값이면 제외)\n const keys = Object.keys(record).filter(k => !k.startsWith('__') && k !== 'cuFlag')\n return keys.some(k => {\n const value = record[k]\n if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {\n return !Object.values(value).every(v => v === '' || v === null || v === undefined)\n }\n return typeof value === 'string' ? value.trim().length > 0 : !isEmpty(value)\n })\n })\n }\n\n /**\n * Exports a list of patches representing the changes in the dirty state of records. Each patch\n * contains information about whether a record was added, modified, or deleted, along with the\n * record's unique identifier and the changed field values.\n *\n * @param {Object} options - Export options that control the format of the patch list.\n * @param {string} options.flagName - The name of the flag field in the patch indicating the change type (default: 'patchFlag').\n * @param {string} options.addedFlag - The flag value for added records (default: '+').\n * @param {string} options.deletedFlag - The flag value for deleted records (default: '-').\n * @param {string} options.modifiedFlag - The flag value for modified records (default: 'M').\n * @param {string} options.idField - The name of the unique identifier field (default: 'id').\n * @returns {Object[]} - An array of objects representing the patches.\n */\n exportPatchList({ flagName = 'patchFlag', addedFlag = '+', deletedFlag = '-', modifiedFlag = 'M', idField = 'id' }) {\n let dirtyRecords = this.dirtyRecords\n if (!dirtyRecords || dirtyRecords.length == 0) {\n return []\n }\n\n return dirtyRecords.map(record => {\n let flag = record.__dirty__\n\n let patch: any = {\n [flagName]: flag == 'M' ? modifiedFlag : flag == '+' ? addedFlag : deletedFlag\n }\n\n if (idField in record && record[idField]) {\n patch[idField] = record[idField]\n }\n\n for (let key in record.__dirtyfields__) {\n const value = record[key]\n\n // id를 가진 object면 id, name만 남긴다 (ObjectRef 규격)\n if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date) && value.id) {\n patch[key] = { id: value.id, name: value.name }\n } else {\n // 그리드를 빈값으로 던지면\n patch[key] = value === '' || value === null || value === undefined ? null : value\n }\n }\n return patch\n })\n }\n\n /**\n * Exports the selected records or all records in the component, depending on the specified options.\n * You can use this method to export data from the component in various formats or for different purposes.\n *\n * @param {Object} options - Export options that control the behavior of the export.\n * @param {boolean} options.ifSelectedOnly - If true, exports only the selected records. If false, exports all records.\n * @param {boolean} options.includeHiddenField - If true, includes hidden fields in the exported data.\n * @returns {Object[]} - An array of objects representing the exported records.\n */\n exportRecords({ ifSelectedOnly = true, includeHiddenField = true } = {}) {\n let records = ifSelectedOnly ? this.selected : this.data.records\n\n if (ifSelectedOnly && (!records || records.length == 0)) {\n records = this.data.records\n }\n\n let columns = this.compiledConfig.columns.filter(column => column.type !== 'gutter')\n if (!includeHiddenField) {\n columns = columns.filter(column => !column.hidden)\n }\n let columnNames = columns.map(column => column.name)\n\n return records.map(item => {\n return columnNames.reduce((record, name) => {\n record[name] = item[name]\n return record\n }, {} as any)\n })\n }\n\n /**\n * Gets the currently selected records in the component. It returns an array of GristRecord objects\n * that are currently selected. You can access this getter to retrieve the selected records.\n *\n * @getter\n * @public\n * @type {GristRecord[]}\n */\n get selected() {\n var { records = [] } = this.grist?.data\n return records.filter(record => record['__selected__'])\n }\n\n /**\n * Sets the currently selected records in the component. You can use this setter to programmatically\n * select specific records by providing an array of GristRecord objects to be selected.\n *\n * @setter\n * @public\n * @type {GristRecord[]}\n */\n set selected(selected: GristRecord[]) {\n if (!this.grist) {\n console.warn('grist not ready')\n return\n }\n\n selected.forEach(record => (record.__selected__ = true))\n this.refresh()\n }\n\n /**\n * Selects records in the component based on the provided selector function. You can use this method\n * to programmatically select specific records in the component.\n *\n * @method\n * @param {GristSelectFunction} selector - A function that determines which records to select.\n * @param {boolean} reset - If true, clears the previous selection before applying the new one.\n * If false, adds to the existing selection.\n */\n select(selector: GristSelectFunction, reset: boolean = false) {\n var { records = [] } = this.grist?.data\n\n if (reset) {\n this.selected.forEach(record => (record.__selected__ = false))\n }\n\n records.filter(record => selector(record)).forEach(record => (record.__selected__ = true))\n this.refresh()\n }\n\n /**\n * Shows the loading spinner in the component's UI to indicate ongoing data loading or processing.\n * You can call this method to display the spinner when necessary.\n */\n showSpinner() {\n this._showSpinner = true\n }\n\n /**\n * Hides the loading spinner in the component's UI to indicate that data loading or processing has completed.\n * You can call this method to hide the spinner when loading or processing is finished.\n */\n hideSpinner() {\n this._showSpinner = false\n }\n\n /**\n * Focuses on the component, making it the active element in the document. This method is useful\n * when you want to programmatically set focus to the component.\n */\n focus() {\n super.focus()\n\n this.grist.focus()\n }\n\n /**\n * Commits the changes made in the dirty state to the component's data. This method updates the\n * component's data with the changes made in the dirty state and clears the dirty state.\n */\n commit() {\n var { page, total, limit, records } = this.grist.data\n\n this.data = {\n page,\n total,\n limit,\n records: records.map(record => {\n var copied = {\n ...record\n }\n\n delete copied.__seq__\n delete copied.__dirty__\n delete copied.__selected__\n delete copied.__changes__\n delete copied.__dirtyfields__\n delete copied.__origin__\n delete copied.__depth__\n delete copied.__expanded__\n delete copied.__check_in_tree__\n delete copied.__children__\n delete copied.__typename\n\n return copied\n })\n }\n }\n\n /**\n * Shows the headroom element in the component. The headroom element is typically used for\n * displaying additional information or controls at the top of the component.\n */\n showHeadroom() {\n if (this.head) {\n this.head.style.display = 'block'\n this.setHeadroom()\n }\n }\n\n /**\n * Hides the headroom element in the component. This method hides the additional information\n * or controls displayed at the top of the component.\n */\n hideHeadroom() {\n if (this.head) {\n this.head.style.display = 'none'\n this.setHeadroom()\n }\n }\n\n /**\n * Toggles the visibility of the headroom element in the component. If the headroom element is\n * currently visible, this method hides it. If it's hidden, this method shows it.\n */\n toggleHeadroom() {\n if (this.head) {\n const display = this.head.style.display\n this.head.style.display = display !== 'none' ? 'none' : 'block'\n\n this.setHeadroom()\n }\n }\n\n /**\n * Forced internal data to be reflected on the screen\n * Data changing through a normal method is automatically reflected on the screen, so it is a method that does not need to be used in general.\n * Therefore, it will be deprecated.\n * @method\n */\n refresh() {\n this.grist.refresh()\n }\n\n /**\n * Resets the component's data to its original state before any changes were made.\n * This method discards all unsaved changes and restores the data to its initial state.\n *\n * @method\n * @public\n */\n reset() {\n // TODO tree 형태의 데이타로 _data를 만들 때, children, collapsed 등을 감안한다.\n var {\n limit = ZERO_PAGINATION.limit,\n page = ZERO_PAGINATION.page,\n total = ZERO_PAGINATION.total,\n records = []\n } = this.data || ZERO_PAGINATION\n\n const { childrenProperty, expanded } = this.compiledConfig.tree\n\n /* 원본 데이타를 남기고, 복사본(_data)을 사용한다. */\n records = ([] as GristRecord[]).concat(\n ...records.map((record, idx) =>\n this.traverseReset(\n record,\n this.mode == 'GRID' ? (page - 1) * limit + idx + 1 : idx + 1,\n 0,\n childrenProperty,\n expanded as () => boolean\n )\n )\n )\n\n if (childrenProperty) {\n records = ([] as GristRecord[]).concat(...records.map(record => this.traverseExpanded(record)))\n }\n\n this._data = {\n limit,\n page,\n total,\n records\n }\n\n this.timeCapsule?.reset()\n this.snapshotTaker?.take(true)\n }\n\n private traverseReset(\n record: GristRecord,\n seq: number,\n __depth__: number,\n childrenProperty: string | undefined,\n expanded: () => boolean\n ): GristRecord {\n const copied = {\n ...record,\n __seq__: seq,\n __origin__: record\n }\n\n if (childrenProperty) {\n const children: GristRecord[] = record[childrenProperty!]\n\n const __expanded__ = (expanded as Function)(record)\n const __children__ = (children || []).map(child =>\n this.traverseReset(child, seq, __depth__ + 1, childrenProperty, expanded)\n )\n\n Object.assign(copied, { __depth__, __children__, __expanded__ })\n }\n\n return copied\n }\n\n private traverseExpanded(record: GristRecord): GristRecord[] {\n const { __expanded__, __children__ = [] } = record\n\n if (__expanded__ && __children__.length > 0) {\n return [record].concat(...__children__.map(child => this.traverseExpanded(child)))\n } else {\n return [record]\n }\n }\n\n /**\n * Checks for dirty records in the component's data and marks them as dirty.\n * Dirty records are those that have unsaved changes.\n */\n checkDirties() {\n const records = this.dirtyRecords\n const { columns = [] } = this.compiledConfig || {}\n\n for (var record of records || []) {\n var origin = record['__origin__'] || {}\n\n var dirtyFields = (record['__dirtyfields__'] = columns\n .filter(column => column.type !== 'gutter' && !isEqual(origin[column.name], record[column.name]))\n .reduce((sum, column) => {\n var name = column.name\n\n sum[name] = {\n before: origin[name],\n after: record[name]\n }\n\n return sum\n }, {} as any))\n\n if (record['__dirty__'] == 'M' && isEmpty(dirtyFields)) {\n delete record['__dirty__']\n }\n }\n\n this._data = { ...this.dirtyData }\n\n this.snapshotTaker?.touch()\n }\n\n /**\n * Clones the selected records in the component's data. It creates a copy of the selected records\n * and marks them as new (added) records.\n */\n cloneSelectedRecords() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n var cloned = {\n __dirty__: '+'\n } as GristRecord\n\n this.compiledConfig.columns\n .filter(column => column.record.editable)\n .forEach(column => {\n cloned[column.name] = record[column.name]\n })\n const rowIndex = this.dirtyData.records.findIndex(rec => rec === record)\n\n this.dirtyData.records.splice(rowIndex + 1, 0, cloned)\n })\n\n this.checkDirties()\n }\n\n /**\n * Adds child nodes to selected records in the component's tree data. It allows users to add child nodes\n * to the selected parent records.\n */\n addChildNodes() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n this.grist.addChildNode(record)\n })\n }\n\n /**\n * Adds sibling nodes to selected records in the component's tree data. It allows users to add sibling nodes\n * to the selected records.\n */\n addSiblingNodes() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n this.grist.addSiblingNode(record)\n })\n }\n\n /**\n * Deletes the selected records in the component's data. It removes the selected records from the data,\n * optionally marking them as deleted.\n *\n * @method\n * @param {boolean} dirty - If true, the method marks the records as deleted.\n */\n deleteSelectedRecords(dirty = true) {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n if (dirty) {\n record.__dirty__ = '-'\n }\n\n const rowIndex = this.dirtyData.records.findIndex(rec => rec === record)\n this.dirtyData.records.splice(rowIndex, 1)\n })\n\n this.checkDirties()\n }\n\n /**\n * Adds a new record to the data grid. The added record is marked as newly created\n * by setting the `__dirty__` flag to '+'. This flag indicates that the record\n * is in a \"new\" state and hasn't been committed to the main data yet.\n *\n * @param {GristRecord} [record] - An optional record to add. If no record is provided,\n * an empty record with the `__dirty__` flag set to '+' will be added.\n */\n addRecord(record?: GristRecord) {\n this._data = {\n ...this._data,\n records: [\n ...this.dirtyData.records,\n {\n ...record,\n __dirty__: '+'\n }\n ]\n }\n }\n\n /**\n * Adds a new record to the top of the data grid. The added record is marked as newly created\n * by setting the `__dirty__` flag to '+'. This flag indicates that the record\n * is in a \"new\" state and hasn't been committed to the main data yet.\n *\n * This method is useful when you need to add new records at the top of the grid\n * without changing the default behavior of the appendable row.\n *\n * @param {GristRecord} [record] - An optional record to add. If no record is provided,\n * an empty record with the `__dirty__` flag set to '+' will be added.\n */\n addRecordToTop(record?: GristRecord) {\n const newRecord = {\n ...record,\n __dirty__: '+'\n }\n\n this._data = {\n ...this._data,\n records: [newRecord, ...this.dirtyData.records]\n }\n\n // 새 레코드에 포커스 및 스크롤 처리\n setTimeout(() => {\n // 그리드가 있는 경우 첫 번째 행에 포커스 설정\n if (this.grist) {\n // 포커스를 첫 번째 행으로 설정 (첫 번째 편집 가능한 셀로)\n const focusableColumns = this.compiledConfig.columns.filter(\n column => column.type !== 'gutter' && !column.hidden && column.record.editable\n )\n\n if (focusableColumns.length > 0) {\n const columnIndex = this.compiledConfig.columns.indexOf(focusableColumns[0])\n this.grist.dispatchEvent(\n new CustomEvent('focus-change', {\n bubbles: true,\n composed: true,\n detail: {\n row: 0,\n column: columnIndex\n }\n })\n )\n }\n\n // 스크롤을 맨 위로 이동\n this.grist.scrollTop = 0\n }\n }, 0)\n }\n\n /**\n * Retrieves the search text used for filtering records.\n *\n * @property {string}\n */\n get searchText() {\n return (this.filters?.find(filter => filter.operator === 'search')?.value as string)?.match(/^\\%(.*)\\%$/)?.[1] || ''\n }\n\n /**\n * Sets the search text for filtering records.\n *\n * @property {string}\n */\n set searchText(searchText: string) {\n var filters = (this.filters || []).filter((filter: FilterValue) => filter.operator !== 'search')\n\n if (searchText) {\n const filtersConfig = this.compiledConfig.columns.filter(columnConfig => !!columnConfig.filter)\n const searchColumns = filtersConfig.filter(columnConfig => {\n const filter = columnConfig.filter as FilterConfigObject\n return filter!.operator === 'search'\n })\n\n filters = [\n ...searchColumns.map((column: ColumnConfig) => {\n const { name } = column\n\n return {\n name,\n operator: 'search',\n value: `%${searchText}%`\n } as FilterValue\n }),\n ...filters\n ]\n }\n\n this.grist.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters\n }\n })\n )\n }\n /**\n * Returns the current pagination limit.\n * @returns {number} The current pagination limit value\n */\n getCurrentLimit() {\n return this.dataProvider?.limit || ZERO_PAGINATION.limit\n }\n\n /**\n * Checks the validity of dirty records.\n * @returns {Array<{record: GristRecord, invalidFields: Array<{field: string, reason: ValidationReason}>}>} List of invalid records and their corresponding invalid fields\n */\n checkDirtyRecordsValidity(): { record: GristRecord; invalidFields: { field: string; reason: ValidationReason }[] }[] {\n const records = this.dirtyRecords\n const validationResults = []\n\n for (const record of records) {\n const invalidFields = []\n\n for (const column of this.compiledConfig.columns) {\n if (column.record?.mandatory && (record[column.name] === undefined || record[column.name] === null)) {\n invalidFields.push({\n field: column.name,\n reason: ValidationReason.MANDATORY\n })\n }\n // Additional validation rules can be implemented here.\n }\n\n if (invalidFields.length > 0) {\n validationResults.push({\n record,\n invalidFields\n })\n }\n }\n\n return validationResults\n }\n}\n"]}
1
+ {"version":3,"file":"data-grist.js","sourceRoot":"","sources":["../../src/data-grist.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,0BAA0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;AA1M7C,SAAS;IADrB,aAAa,CAAC,UAAU,CAAC;GACb,SAAS,CAw1CrB","sourcesContent":["import './data-grid/data-grid.js'\nimport './data-list/data-list.js'\nimport './data-card/data-card.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, queryAsync, state } from 'lit/decorators.js'\nimport isEmpty from 'lodash-es/isEmpty.js'\nimport isEqual from 'lodash-es/isEqual.js'\n\nimport Headroom from '@operato/headroom'\nimport { pulltorefresh } from '@operato/pull-to-refresh'\nimport { HeadroomStyles, ScrollbarStyles, SpinnerStyles } from '@operato/styles'\nimport { PagePreferenceProvider } from '@operato/p13n'\nimport { SnapshotTaker, TimeCapsule } from '@operato/utils'\n\nimport { buildConfig } from './configure/config-builder.js'\nimport { ZERO_CONFIG, ZERO_DATA, ZERO_PAGES, ZERO_PAGINATION } from './configure/zero-config.js'\nimport { DataCard } from './data-card/data-card.js'\nimport { DataConsumer } from './data-consumer.js'\nimport { DataGrid } from './data-grid/data-grid.js'\nimport { DataList } from './data-list/data-list.js'\nimport { DataProvider } from './data-provider.js'\nimport {\n ColumnConfig,\n FetchHandler,\n FilterConfigObject,\n FilterValue,\n GristConfig,\n GristData,\n GristRecord,\n GristSelectFunction,\n PaginationConfig,\n PersonalGristPreference,\n SortersConfig,\n ValidationReason\n} from './types.js'\nimport { convertListParamToSearchString, convertSearchStringToListParam } from './utils/index.js'\n\n/**\n * A custom element for rendering data in a grid, list, or card format.\n *\n * @element ox-grist\n */\n@customElement('ox-grist')\nexport class DataGrist extends LitElement implements DataConsumer {\n static styles = [\n ScrollbarStyles,\n HeadroomStyles,\n SpinnerStyles,\n css`\n /*\n * ── 표의 겉모습 — 한 벌로 여기서 정한다 ──────────────────────────────\n *\n * 화면마다 --grid-* 토큰을 하나씩 덮어 모양을 바꾸지 않는다. 그 방식은 두 가지로 깨졌다.\n *\n * · 한 토큰이 두 뜻을 겸한다. --grid-record-focused-cell-border 는 「초점 표식」이면서\n * 「줄을 나누는 선」이었다. 표식을 감추려고 none 을 주면 줄 선이 사라졌다\n * · 스무 개를 짝 맞춰 덮어야 한 벌이 되고, 하나 빠지면 그 자리만 옛 모양으로 남는다\n *\n * 토큰은 shadow DOM 을 넘어 상속되므로 여기서 정하면 머리·칸·바닥까지 그대로 닿는다.\n *\n * 무엇을 바꾸는가 — 표가 자기 틀을 값보다 앞세우지 않게 한다.\n *\n * 머리 회색 바탕 + 2px 파란 윗선 + 파란 글자 → 면 색 + 아랫선 하나 + 작은 대문자 라벨\n * 줄 홀짝 회색 번갈이(zebra) → 선으로만 구분\n * 세로선 열마다 있었다 → 없음\n * 폭 조절 끌 수 있었다 → 없음 (세로선을 그리던 것이 이 손잡이다)\n * 셀 초점 점선 네모 → 없음 (줄 단위로 고르는 표에서는 뜻이 없다)\n * 바닥 회색 바탕 + 파란 글자 → 면 색 + 흐린 글자\n * 값 흐린 색 → 가장 진하게\n *\n * 줄무늬를 없앤 것은 취향이 아니다. 홀짝 회색이 깔려 있으면 **골라 놓은 줄과 마우스 올린 줄이\n * 그 무늬에 묻힌다.** 색은 「지금 무엇을 하고 있나」에만 쓴다.\n */\n :host {\n --grid-header-background-color: var(--ui-bg, #f6f7f9);\n --grid-header-top-border: none;\n --grid-header-bottom-border: 1px solid var(--ui-line, #d5dce0);\n --grid-header-padding: 8px 10px;\n --grid-header-color: var(--ui-muted, #57676f);\n --grid-header-font: 600 var(--ui-t-micro, 11px) / 1 var(--ui-mono, ui-monospace, Menlo, monospace);\n --grid-header-text-transform: uppercase;\n --grid-header-letter-spacing: 0.07em;\n --grid-header-sorter-size: 14px;\n --grid-header-mark-size: 14px;\n /* 세로 선을 그리는 것이 폭 조절 손잡이다 — 감추면 둘이 함께 사라진다. */\n --grid-header-splitter-display: none;\n\n --grid-record-background-color: var(--ui-panel, #ffffff);\n --grid-record-odd-background-color: var(--ui-panel, #ffffff);\n --grid-record-padding: 9px 10px;\n --grid-record-color: var(--ui-ink, #17242c);\n --grid-record-border-bottom: 1px solid var(--ui-line-soft, #e6eaed);\n /* 초점 표식을 없앤다. outline 으로 그리므로 줄 선은 그대로 남는다. */\n --grid-record-focused-cell-border: none;\n --grid-record-focused-box-shadow: none;\n\n --grid-footer-background-color: var(--ui-bg, #f6f7f9);\n --grid-footer-color: var(--ui-muted, #57676f);\n --grid-footer-padding: 8px 12px;\n }\n\n :host {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background-color: var(--grist-background-color);\n min-height: 120px;\n\n overflow: hidden;\n\n /* for pulltorefresh controller */\n position: relative;\n\n padding: var(--ox-grist-padding);\n\n --md-icon-size: var(--grid-record-wide-fontsize);\n }\n\n #wrap {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: auto;\n }\n\n ox-grid {\n flex: 1;\n border: var(--grid-wrap-container-border, 0px solid transparent);\n border-width: var(--grid-wrap-container-border-width, 0px);\n }\n\n slot[name='headroom'] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n box-sizing: border-box;\n background-color: var(--grist-background-color);\n\n z-index: 8;\n }\n `\n ]\n\n /**\n * The rendering mode of the component, which can be 'GRID', 'LIST', or 'CARD'.\n * Default is 'GRID'.\n *\n * @property {string}\n */\n @property() mode: 'GRID' | 'LIST' | 'CARD' = 'GRID'\n\n /**\n * The configuration object for the data grist.\n *\n * @property {Object}\n */\n @property() config: any\n\n /**\n * The data to be displayed in the data grist.\n *\n * @property {GristData}\n */\n @property({ type: Object }) data: GristData = ZERO_DATA\n\n /**\n * An array of selected records in the data grist.\n *\n * @property {GristRecord[]}\n */\n @property({ type: Array }) selectedRecords?: GristRecord[]\n\n /**\n * Indicates whether explicit fetching of data is enabled. If true, data will be fetched\n * only when `fetch` method is called. Default is false.\n *\n * @property {boolean}\n */\n @property({ type: Boolean, attribute: 'explicit-fetch' }) explicitFetch: boolean = false\n\n /**\n * The fetch handler function used to retrieve data from a remote source.\n *\n * @property {FetchHandler}\n */\n @property() fetchHandler?: FetchHandler\n\n /**\n * Additional fetch options to be passed to the fetch handler.\n *\n * @property {Object}\n */\n @property() fetchOptions: any\n\n /**\n * An array of filter values to be applied to the data grist.\n *\n * @property {FilterValue[]}\n */\n @property({ type: Array }) filters?: FilterValue[]\n\n /**\n * An array of sorters to determine the order of records in the data grist.\n *\n * @property {SortersConfig}\n */\n @property({ type: Array }) sorters?: SortersConfig\n\n /**\n * The pagination configuration for the data grist.\n *\n * @property {PaginationConfig}\n */\n @property({ type: Object }) pagination?: PaginationConfig\n\n /**\n * Indicates whether URL parameters are sensitive to changes. If true, changes in URL\n * parameters will trigger data fetching. Default is undefined.\n *\n * @property {boolean}\n */\n @property({ type: Boolean, attribute: 'url-params-sensitive' }) urlParamsSensitive?: boolean\n\n @property({ type: Object }) personalConfigProvider: PagePreferenceProvider = {\n load: () => {\n return {}\n },\n save: (preference: any) => preference,\n reset: () => {}\n }\n\n @state() personalConfig?: {\n columns?: Partial<ColumnConfig>[]\n [key: string]: any\n }\n\n @state() _data: GristData = ZERO_DATA // copy data, dirty data\n @state() _config: GristConfig = ZERO_CONFIG // compiled configuration\n @state() private _showSpinner: boolean = false\n\n @query('slot[name=headroom]') head!: HTMLElement\n @query('#grist') grist!: DataGrid | DataList | DataCard\n @queryAsync('#wrap') private wrap!: Promise<HTMLElement>\n\n private timeCapsule?: TimeCapsule\n private snapshotTaker?: SnapshotTaker\n\n private dataProvider?: DataProvider\n private pulltorefreshHandle?: any\n private headroom?: Headroom\n private orginPaddingTop?: string\n private originMarginTop?: string\n\n /*\n * 머리(headroom)의 높이는 **한 번만 재면 안 된다.**\n *\n * 머리는 position: absolute 라 본문이 그만큼 밀려 있어야 하는데, 그 값을 setHeadroom 시점의\n * clientHeight 로 한 번 정해 두었다. 그래서 머리 안의 내용이 나중에 커지면(글꼴이 늦게 오거나,\n * 버튼 높이가 바뀌거나, 제목이 두 줄이 되거나) 본문이 머리 아래로 파고들어 **글자가 겹친다.**\n *\n * 실제로 동작 버튼 높이를 32px 에서 36px 로 올렸을 때 제목 줄과 열 머리글이 겹쳤다.\n * 크기를 지켜보고 그때마다 다시 민다.\n */\n private headResizeObserver?: ResizeObserver\n private headroomAtTop: boolean = true\n private lastLocation: { origin?: string; pathname?: string; search?: string } = {}\n\n /* 그리드가 준비되기 전에 fetch 요청이 있었음을 나타내는 플래그임 */\n private pendingFetch?: boolean\n\n private popstateEventHandler: EventListener = ((e: Event) => {\n const { origin, pathname, search } = window.location\n if (\n this.lastLocation.origin &&\n (this.lastLocation.origin !== origin ||\n this.lastLocation.pathname !== pathname ||\n this.lastLocation.search === search)\n ) {\n return\n }\n\n this.lastLocation = {\n origin,\n pathname,\n search\n }\n\n var { filters = [], sorters = [] } = convertSearchStringToListParam(search)\n\n try {\n if (!isEqual(filters, this.filters) || !isEqual(sorters, this.sorters)) {\n this.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters,\n sorters,\n from: 'url-parameter'\n }\n })\n )\n }\n } catch (e) {\n console.error(`invalid fetch params on URL query string : ${e}`)\n }\n }).bind(this)\n\n private fetchParamsChangeEventHandler: EventListener = ((e: Event) => {\n const { sorters, filters, from } = (e as CustomEvent).detail\n\n sorters && (this.sorters = sorters)\n filters && (this.filters = filters)\n\n if (!this.urlParamsSensitive || from === 'url-parameter') {\n return\n }\n\n const queryString = convertListParamToSearchString({ filters, sorters, base: window.location.search })\n this.lastLocation.search = queryString ? `?${queryString}` : ''\n const url = `${window.location.pathname}${this.lastLocation.search}`\n\n history.pushState({}, document.title, url)\n }).bind(this)\n\n async firstUpdated() {\n // Mutation Observer를 사용하여 슬롯의 크기 변경을 감지하고 다시 그린다.\n const observer = new ResizeObserver(mutationsList => {\n this.setHeadroom()\n })\n\n observer.observe(this.head)\n }\n\n async connectedCallback() {\n super.connectedCallback()\n\n this.dataProvider = new DataProvider(this)\n\n this.timeCapsule = new TimeCapsule(10)\n this.snapshotTaker = new SnapshotTaker(this, this.timeCapsule!)\n\n this.addEventListener('fetch-params-change', this.fetchParamsChangeEventHandler)\n document.addEventListener('keydown', this._onDocumentKeydown)\n\n await this.updateComplete\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.removeEventListener('fetch-params-change', this.fetchParamsChangeEventHandler)\n document.removeEventListener('keydown', this._onDocumentKeydown)\n\n this.headResizeObserver?.disconnect()\n delete this.headResizeObserver\n\n this.timeCapsule && this.timeCapsule.dispose()\n this.snapshotTaker && this.snapshotTaker.dispose()\n\n delete this.timeCapsule\n delete this.snapshotTaker\n\n this.dataProvider?.dispose()\n this.resetPullToRefresh()\n }\n\n private resetPullToRefresh() {\n if (this.pulltorefreshHandle) {\n this.pulltorefreshHandle()\n delete this.pulltorefreshHandle\n }\n }\n\n private async setPullToRefresh() {\n this.resetPullToRefresh()\n if (this.mode !== 'GRID' && this.fetchHandler) {\n this.pulltorefreshHandle = pulltorefresh({\n container: await this.wrap,\n scrollable: this.grist.pullToRefreshTarget,\n refresh: () => {\n return this.fetch(true)\n }\n })\n }\n }\n\n public applyUpdatedConfiguration() {\n if (!this.personalConfig || !this.config) {\n return\n }\n\n const config = { ...this.config }\n const columns: Partial<ColumnConfig>[] = config.columns\n\n const { columns: personalColumns, sorters, pagination, mode } = this.personalConfig\n\n if (personalColumns) {\n const xcolumns = columns.map((column: Partial<ColumnConfig>) => {\n const personalColumn = personalColumns.find(pcolumn => pcolumn.name == column.name)\n return personalColumn ? { ...column, ...personalColumn } : column\n })\n\n function reorderList(a: { name: string }[], b: { name: string }[]): { name: string }[] {\n // 결과 배열 초기화, a 배열 길이만큼 undefined로 채움\n const result = new Array(a.length)\n\n // b 배열에 없는 아이템은 원래 위치로 채움\n a.forEach((item, index) => {\n if (!item.name || !b.find(bi => bi.name == item.name)) {\n result[index] = item\n }\n })\n\n b.forEach(item => {\n const ai = a.find(ai => ai.name == item.name)\n if (ai) {\n result[result.findIndex(slot => slot === undefined)] = ai\n }\n })\n\n return result\n }\n\n // 배열 재정렬 실행\n config.columns = reorderList(xcolumns as any, personalColumns as any)\n }\n\n if (pagination) {\n config.pagination = pagination\n }\n\n if (sorters) {\n config.sorters = sorters\n }\n\n if (mode) {\n this.mode = mode\n }\n\n this._config = buildConfig({\n ...config\n })\n\n this.dispatchEvent(\n new CustomEvent('config-change', {\n bubbles: true,\n composed: true,\n detail: this.compiledConfig\n })\n )\n\n this.pagination = this.compiledConfig.pagination || {}\n\n if (!this.urlParamsSensitive) {\n const sorters = this.compiledConfig?.sorters\n const filters = this.compiledConfig?.columns\n .filter(\n column =>\n column.filter &&\n 'value' in (column.filter as FilterConfigObject) &&\n (typeof (column.filter as FilterConfigObject).value === 'boolean' ||\n (column.filter as FilterConfigObject).value)\n )\n .map(column => {\n const filter = column.filter as FilterConfigObject\n return { name: column.name, operator: filter.operator, value: filter.value } as FilterValue\n })\n\n this.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters,\n sorters,\n from: 'config'\n }\n })\n )\n }\n\n if (this.dataProvider) {\n const { limit, pages = ZERO_PAGES } = this._config.pagination || ZERO_PAGINATION\n this.dataProvider.page = 1\n this.dataProvider.limit = limit || pages[0] || ZERO_PAGES[0]\n }\n\n if (this.pendingFetch || (!this.urlParamsSensitive && !this.explicitFetch)) {\n this.pendingFetch = false\n this.fetch()\n }\n }\n\n /** 머리 높이만큼 본문을 민다. 위에 있을 때는 margin, 스크롤 중일 때는 padding 이다. */\n private applyHeadOffset() {\n if (!this.grist || !this.head || this.head.style.display === 'none') {\n return\n }\n\n const offset = this.head.clientHeight + 'px'\n\n if (this.headroomAtTop) {\n this.grist.style.marginTop = offset\n } else {\n this.grist.style.paddingTop = offset\n }\n }\n\n private setHeadroom() {\n this.headroom?.destroy()\n\n if (this.grist && this.head && this.head.style.display !== 'none') {\n const style = getComputedStyle(this.grist)\n\n this.orginPaddingTop = style.paddingTop || '0'\n this.originMarginTop = style.marginTop || '0'\n\n this.headroom = new Headroom(this.head, {\n scroller: this.grist,\n onTop: () => {\n this.grist.style.paddingTop = this.orginPaddingTop!\n this.originMarginTop = this.grist.style.marginTop\n\n this.headroomAtTop = true\n this.applyHeadOffset()\n },\n onNotTop: () => {\n this.grist.style.marginTop = this.originMarginTop!\n this.orginPaddingTop = this.grist.style.paddingTop\n\n this.headroomAtTop = false\n this.applyHeadOffset()\n }\n })\n\n this.headroom.init()\n\n /* 머리가 커지거나 줄면 그때마다 다시 민다 — 한 번 잰 값으로 두면 내용이 겹친다. */\n this.headResizeObserver?.disconnect()\n this.headResizeObserver = new ResizeObserver(() => this.applyHeadOffset())\n this.headResizeObserver.observe(this.head)\n } else if (this.orginPaddingTop) {\n this.grist.style.paddingTop = this.orginPaddingTop\n this.grist.style.marginTop = this.originMarginTop!\n }\n }\n\n render() {\n const empty = !this._showSpinner && this._data.records.length == 0\n\n return html`\n <slot name=\"headroom\"> </slot>\n <div id=\"wrap\" @keydown=${(e: KeyboardEvent) => this.onKeydown(e)}>\n ${this.mode == 'GRID'\n ? html`\n <ox-grid\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n .pagination=${this.pagination || {}}\n ?empty=${empty}\n >\n <slot name=\"setting\" slot=\"setting\"> </slot>\n </ox-grid>\n `\n : this.mode == 'CARD'\n ? html`\n <ox-card\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n ?empty=${empty}\n >\n </ox-card>\n `\n : html`\n <ox-list\n id=\"grist\"\n .config=${this.compiledConfig}\n .data=${this._data}\n .sorters=${this.sorters || []}\n .filters=${this.filters || []}\n ?empty=${empty}\n >\n </ox-list>\n `}\n </div>\n\n <div id=\"spinner\" ?show=${this._showSpinner}></div>\n `\n }\n\n /* for timecapsule feature */\n private onKeydown(e: KeyboardEvent) {\n if (e.key === 'z' && (e.metaKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.redo()\n } else {\n this.undo()\n }\n }\n }\n\n /* 트리 그리드 단일 셀 복사 폴백: document 레벨에서 Ctrl+C를 수신.\n * 혼합 화면 등에서 행 클릭 후 scan input이 포커스를 빼앗아가므로\n * DataGrist 내부 이벤트 버블링에 의존할 수 없어 document 레벨에서 처리.\n * 이 DataGrist에 focused 셀이 있을 때만 동작한다. */\n private _onDocumentKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'c' || !(e.metaKey || e.ctrlKey) || this.mode !== 'GRID') return\n if (e.defaultPrevented) return // 내부 DataGridBody 핸들러가 이미 처리함\n const grist = this.grist as any\n const focused = grist?.focused\n if (focused?.row === undefined) return\n const selection = window.getSelection()\n if (selection?.type === 'Range') return\n /* DataGridBody.copy()에 위임: 컬럼 조회·클립보드 쓰기·flash 애니메이션을 일괄 처리 */\n e.preventDefault()\n ;(grist.body as any).copy()\n }\n\n /**\n * Gets the current state of the component. The state includes information about the\n * dirty records and their changes.\n *\n * @getter\n * @public\n * @type {string}\n */\n get state() {\n return JSON.stringify(this.dirtyData)\n }\n\n /**\n * Undoes the previous change in the component's data by restoring it to the previous state.\n * This method is part of the TimeCapsule feature, allowing users to revert changes.\n */\n undo() {\n if (!this.timeCapsule?.backwardable) {\n return\n }\n\n this._data = JSON.parse(this.timeCapsule?.backward())\n }\n\n /**\n * Redoes the previously undone change in the component's data by restoring it to the next state.\n * This method is part of the TimeCapsule feature, allowing users to reapply changes.\n */\n redo() {\n if (!this.timeCapsule?.forwardable) {\n return\n }\n\n this._data = JSON.parse(this.timeCapsule?.forward())\n }\n\n /**\n * Fetches data from a data source and updates the component's data. This method is used to retrieve\n * new data or refresh the existing data in the component.\n *\n * @method\n * @param {boolean} reset - If true, the method resets the scroll position to the top.\n */\n async fetch(reset = true) {\n if (this.compiledConfig === ZERO_CONFIG) {\n /* avoid to be here */\n console.warn('grist is not configured yet.')\n this.pendingFetch = true\n return\n }\n\n if (reset && this.grist) {\n /*\n * scroll 의 현재위치에 의해서 scroll 이벤트가 발생할 수 있으므로, 이를 방지하기 위해서 스크롤의 위치를 TOP으로 옮긴다.\n * (scroll 이 첫페이지 크기 이상으로 내려가 있는 경우, 첫페이지부터 다시 표시하는 경우에, scroll 이벤트가 발생한다.)\n */\n this.grist.scrollTop = 0\n }\n\n if (this.dataProvider) {\n let { limit: initLimit, page: initPage, infinite } = this.compiledConfig.pagination || {}\n let { limit = initLimit || ZERO_PAGINATION.limit, page = initPage || ZERO_PAGINATION.page } = this.dataProvider\n\n if (infinite || this.mode !== 'GRID') {\n await this.dataProvider.attach(reset)\n } else {\n await this.dataProvider.fetch({\n limit,\n page,\n sorters: this.sorters || this.compiledConfig?.sorters,\n sortings: this.sorters || this.compiledConfig?.sorters,\n filters: this.filters\n })\n\n this.pagination && (this.pagination!.limit = limit)\n }\n }\n }\n\n async updated(changes: PropertyValues<this>) {\n var needToSetPullToRefresh = false\n\n if (changes.has('filters')) {\n await this.requestUpdate()\n }\n\n if (changes.has('sorters')) {\n await this.requestUpdate()\n }\n\n if (changes.has('personalConfigProvider')) {\n this.personalConfig = await this.personalConfigProvider.load()\n } else if (changes.has('config') || changes.has('personalConfig')) {\n this.applyUpdatedConfiguration()\n }\n\n if (changes.has('fetchHandler')) {\n this.dataProvider && (this.dataProvider.fetchHandler = this.fetchHandler)\n needToSetPullToRefresh = true\n }\n\n if (changes.has('fetchOptions')) {\n this.dataProvider && (this.dataProvider.fetchOptions = this.fetchOptions)\n }\n\n if (changes.has('data')) {\n this.reset()\n }\n\n if (changes.has('mode')) {\n if (this.mode === 'GRID') {\n this.style.removeProperty('--ox-grist-padding')\n } else {\n this.style.setProperty('--ox-grist-padding', '0')\n }\n\n needToSetPullToRefresh = true\n this.setHeadroom()\n }\n\n if (changes.has('selectedRecords')) {\n var { records } = this.data || []\n var selectedRecords = this.selectedRecords || []\n\n var _records = this.dirtyData.records\n\n /* 원본데이타에서 index를 찾아서, 복사본 데이타의 selected를 설정한다. */\n selectedRecords.forEach(selected => {\n var index = records.indexOf(selected)\n var record = _records[index]\n if (record) {\n record['__selected__'] = true\n }\n })\n\n /* update _data property intentionally */\n this.refresh()\n }\n\n if (changes.has('urlParamsSensitive')) {\n if (this.urlParamsSensitive) {\n //@ts-ignore\n this.popstateEventHandler() // call for the first time\n\n window.addEventListener('popstate', this.popstateEventHandler)\n } else {\n window.removeEventListener('popstate', this.popstateEventHandler)\n }\n }\n\n if (needToSetPullToRefresh) {\n await this.setPullToRefresh()\n }\n }\n\n /**\n * Represents the compiled configuration of the component, which includes various settings and\n * column configurations. You can access this property to get information about how the component\n * is configured.\n *\n * @getter\n * @public\n * @type {GristConfig}\n */\n get compiledConfig(): GristConfig {\n return this._config\n }\n\n /**\n * Returns the dirty data in the component, which includes the records that have been added,\n * modified, or deleted but have not been committed to the main data yet.\n *\n * @getter\n * @public\n * @type {GristData} - An object representing the dirty data.\n */\n get dirtyData(): GristData {\n return (this.grist as any)?.data || {}\n }\n\n /**\n * Returns an array of GristRecord objects representing the records in the dirty state. These are\n * the records that have been added, modified, or deleted but have not been committed to the main\n * data yet.\n *\n * @getter\n * @public\n * @type {GristRecord[]} - An array of GristRecord objects representing the dirty records.\n */\n get dirtyRecords() {\n var { records = [] } = this.dirtyData\n return records\n .filter(record => record['__dirty__'])\n .filter(record => {\n // cuFlag 제외하고 키가 모두 빈값이면 필터함 (오브젝트일때는 키가 있어도 모든 값이 빈값이면 제외)\n const keys = Object.keys(record).filter(k => !k.startsWith('__') && k !== 'cuFlag')\n return keys.some(k => {\n const value = record[k]\n if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {\n return !Object.values(value).every(v => v === '' || v === null || v === undefined)\n }\n return typeof value === 'string' ? value.trim().length > 0 : !isEmpty(value)\n })\n })\n }\n\n /**\n * Exports a list of patches representing the changes in the dirty state of records. Each patch\n * contains information about whether a record was added, modified, or deleted, along with the\n * record's unique identifier and the changed field values.\n *\n * @param {Object} options - Export options that control the format of the patch list.\n * @param {string} options.flagName - The name of the flag field in the patch indicating the change type (default: 'patchFlag').\n * @param {string} options.addedFlag - The flag value for added records (default: '+').\n * @param {string} options.deletedFlag - The flag value for deleted records (default: '-').\n * @param {string} options.modifiedFlag - The flag value for modified records (default: 'M').\n * @param {string} options.idField - The name of the unique identifier field (default: 'id').\n * @returns {Object[]} - An array of objects representing the patches.\n */\n exportPatchList({ flagName = 'patchFlag', addedFlag = '+', deletedFlag = '-', modifiedFlag = 'M', idField = 'id' }) {\n let dirtyRecords = this.dirtyRecords\n if (!dirtyRecords || dirtyRecords.length == 0) {\n return []\n }\n\n return dirtyRecords.map(record => {\n let flag = record.__dirty__\n\n let patch: any = {\n [flagName]: flag == 'M' ? modifiedFlag : flag == '+' ? addedFlag : deletedFlag\n }\n\n if (idField in record && record[idField]) {\n patch[idField] = record[idField]\n }\n\n for (let key in record.__dirtyfields__) {\n const value = record[key]\n\n // id를 가진 object면 id, name만 남긴다 (ObjectRef 규격)\n if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date) && value.id) {\n patch[key] = { id: value.id, name: value.name }\n } else {\n // 그리드를 빈값으로 던지면\n patch[key] = value === '' || value === null || value === undefined ? null : value\n }\n }\n return patch\n })\n }\n\n /**\n * Exports the selected records or all records in the component, depending on the specified options.\n * You can use this method to export data from the component in various formats or for different purposes.\n *\n * @param {Object} options - Export options that control the behavior of the export.\n * @param {boolean} options.ifSelectedOnly - If true, exports only the selected records. If false, exports all records.\n * @param {boolean} options.includeHiddenField - If true, includes hidden fields in the exported data.\n * @returns {Object[]} - An array of objects representing the exported records.\n */\n exportRecords({ ifSelectedOnly = true, includeHiddenField = true } = {}) {\n let records = ifSelectedOnly ? this.selected : this.data.records\n\n if (ifSelectedOnly && (!records || records.length == 0)) {\n records = this.data.records\n }\n\n let columns = this.compiledConfig.columns.filter(column => column.type !== 'gutter')\n if (!includeHiddenField) {\n columns = columns.filter(column => !column.hidden)\n }\n let columnNames = columns.map(column => column.name)\n\n return records.map(item => {\n return columnNames.reduce((record, name) => {\n record[name] = item[name]\n return record\n }, {} as any)\n })\n }\n\n /**\n * Gets the currently selected records in the component. It returns an array of GristRecord objects\n * that are currently selected. You can access this getter to retrieve the selected records.\n *\n * @getter\n * @public\n * @type {GristRecord[]}\n */\n get selected() {\n var { records = [] } = this.grist?.data\n return records.filter(record => record['__selected__'])\n }\n\n /**\n * Sets the currently selected records in the component. You can use this setter to programmatically\n * select specific records by providing an array of GristRecord objects to be selected.\n *\n * @setter\n * @public\n * @type {GristRecord[]}\n */\n set selected(selected: GristRecord[]) {\n if (!this.grist) {\n console.warn('grist not ready')\n return\n }\n\n selected.forEach(record => (record.__selected__ = true))\n this.refresh()\n }\n\n /**\n * Selects records in the component based on the provided selector function. You can use this method\n * to programmatically select specific records in the component.\n *\n * @method\n * @param {GristSelectFunction} selector - A function that determines which records to select.\n * @param {boolean} reset - If true, clears the previous selection before applying the new one.\n * If false, adds to the existing selection.\n */\n select(selector: GristSelectFunction, reset: boolean = false) {\n var { records = [] } = this.grist?.data\n\n if (reset) {\n this.selected.forEach(record => (record.__selected__ = false))\n }\n\n records.filter(record => selector(record)).forEach(record => (record.__selected__ = true))\n this.refresh()\n }\n\n /**\n * Shows the loading spinner in the component's UI to indicate ongoing data loading or processing.\n * You can call this method to display the spinner when necessary.\n */\n showSpinner() {\n this._showSpinner = true\n }\n\n /**\n * Hides the loading spinner in the component's UI to indicate that data loading or processing has completed.\n * You can call this method to hide the spinner when loading or processing is finished.\n */\n hideSpinner() {\n this._showSpinner = false\n }\n\n /**\n * Focuses on the component, making it the active element in the document. This method is useful\n * when you want to programmatically set focus to the component.\n */\n focus() {\n super.focus()\n\n this.grist.focus()\n }\n\n /**\n * Commits the changes made in the dirty state to the component's data. This method updates the\n * component's data with the changes made in the dirty state and clears the dirty state.\n */\n commit() {\n var { page, total, limit, records } = this.grist.data\n\n this.data = {\n page,\n total,\n limit,\n records: records.map(record => {\n var copied = {\n ...record\n }\n\n delete copied.__seq__\n delete copied.__dirty__\n delete copied.__selected__\n delete copied.__changes__\n delete copied.__dirtyfields__\n delete copied.__origin__\n delete copied.__depth__\n delete copied.__expanded__\n delete copied.__check_in_tree__\n delete copied.__children__\n delete copied.__typename\n\n return copied\n })\n }\n }\n\n /**\n * Shows the headroom element in the component. The headroom element is typically used for\n * displaying additional information or controls at the top of the component.\n */\n showHeadroom() {\n if (this.head) {\n this.head.style.display = 'block'\n this.setHeadroom()\n }\n }\n\n /**\n * Hides the headroom element in the component. This method hides the additional information\n * or controls displayed at the top of the component.\n */\n hideHeadroom() {\n if (this.head) {\n this.head.style.display = 'none'\n this.setHeadroom()\n }\n }\n\n /**\n * Toggles the visibility of the headroom element in the component. If the headroom element is\n * currently visible, this method hides it. If it's hidden, this method shows it.\n */\n toggleHeadroom() {\n if (this.head) {\n const display = this.head.style.display\n this.head.style.display = display !== 'none' ? 'none' : 'block'\n\n this.setHeadroom()\n }\n }\n\n /**\n * Forced internal data to be reflected on the screen\n * Data changing through a normal method is automatically reflected on the screen, so it is a method that does not need to be used in general.\n * Therefore, it will be deprecated.\n * @method\n */\n refresh() {\n this.grist.refresh()\n }\n\n /**\n * Resets the component's data to its original state before any changes were made.\n * This method discards all unsaved changes and restores the data to its initial state.\n *\n * @method\n * @public\n */\n reset() {\n // TODO tree 형태의 데이타로 _data를 만들 때, children, collapsed 등을 감안한다.\n var {\n limit = ZERO_PAGINATION.limit,\n page = ZERO_PAGINATION.page,\n total = ZERO_PAGINATION.total,\n records = []\n } = this.data || ZERO_PAGINATION\n\n const { childrenProperty, expanded } = this.compiledConfig.tree\n\n /* 원본 데이타를 남기고, 복사본(_data)을 사용한다. */\n records = ([] as GristRecord[]).concat(\n ...records.map((record, idx) =>\n this.traverseReset(\n record,\n this.mode == 'GRID' ? (page - 1) * limit + idx + 1 : idx + 1,\n 0,\n childrenProperty,\n expanded as () => boolean\n )\n )\n )\n\n if (childrenProperty) {\n records = ([] as GristRecord[]).concat(...records.map(record => this.traverseExpanded(record)))\n }\n\n this._data = {\n limit,\n page,\n total,\n records\n }\n\n this.timeCapsule?.reset()\n this.snapshotTaker?.take(true)\n }\n\n private traverseReset(\n record: GristRecord,\n seq: number,\n __depth__: number,\n childrenProperty: string | undefined,\n expanded: () => boolean\n ): GristRecord {\n const copied = {\n ...record,\n __seq__: seq,\n __origin__: record\n }\n\n if (childrenProperty) {\n const children: GristRecord[] = record[childrenProperty!]\n\n const __expanded__ = (expanded as Function)(record)\n const __children__ = (children || []).map(child =>\n this.traverseReset(child, seq, __depth__ + 1, childrenProperty, expanded)\n )\n\n Object.assign(copied, { __depth__, __children__, __expanded__ })\n }\n\n return copied\n }\n\n private traverseExpanded(record: GristRecord): GristRecord[] {\n const { __expanded__, __children__ = [] } = record\n\n if (__expanded__ && __children__.length > 0) {\n return [record].concat(...__children__.map(child => this.traverseExpanded(child)))\n } else {\n return [record]\n }\n }\n\n /**\n * Checks for dirty records in the component's data and marks them as dirty.\n * Dirty records are those that have unsaved changes.\n */\n checkDirties() {\n const records = this.dirtyRecords\n const { columns = [] } = this.compiledConfig || {}\n\n for (var record of records || []) {\n var origin = record['__origin__'] || {}\n\n var dirtyFields = (record['__dirtyfields__'] = columns\n .filter(column => column.type !== 'gutter' && !isEqual(origin[column.name], record[column.name]))\n .reduce((sum, column) => {\n var name = column.name\n\n sum[name] = {\n before: origin[name],\n after: record[name]\n }\n\n return sum\n }, {} as any))\n\n if (record['__dirty__'] == 'M' && isEmpty(dirtyFields)) {\n delete record['__dirty__']\n }\n }\n\n this._data = { ...this.dirtyData }\n\n this.snapshotTaker?.touch()\n }\n\n /**\n * Clones the selected records in the component's data. It creates a copy of the selected records\n * and marks them as new (added) records.\n */\n cloneSelectedRecords() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n var cloned = {\n __dirty__: '+'\n } as GristRecord\n\n this.compiledConfig.columns\n .filter(column => column.record.editable)\n .forEach(column => {\n cloned[column.name] = record[column.name]\n })\n const rowIndex = this.dirtyData.records.findIndex(rec => rec === record)\n\n this.dirtyData.records.splice(rowIndex + 1, 0, cloned)\n })\n\n this.checkDirties()\n }\n\n /**\n * Adds child nodes to selected records in the component's tree data. It allows users to add child nodes\n * to the selected parent records.\n */\n addChildNodes() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n this.grist.addChildNode(record)\n })\n }\n\n /**\n * Adds sibling nodes to selected records in the component's tree data. It allows users to add sibling nodes\n * to the selected records.\n */\n addSiblingNodes() {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n this.grist.addSiblingNode(record)\n })\n }\n\n /**\n * Deletes the selected records in the component's data. It removes the selected records from the data,\n * optionally marking them as deleted.\n *\n * @method\n * @param {boolean} dirty - If true, the method marks the records as deleted.\n */\n deleteSelectedRecords(dirty = true) {\n const records = this.selected || ([] as GristRecord[])\n\n records.forEach(record => {\n if (dirty) {\n record.__dirty__ = '-'\n }\n\n const rowIndex = this.dirtyData.records.findIndex(rec => rec === record)\n this.dirtyData.records.splice(rowIndex, 1)\n })\n\n this.checkDirties()\n }\n\n /**\n * Adds a new record to the data grid. The added record is marked as newly created\n * by setting the `__dirty__` flag to '+'. This flag indicates that the record\n * is in a \"new\" state and hasn't been committed to the main data yet.\n *\n * @param {GristRecord} [record] - An optional record to add. If no record is provided,\n * an empty record with the `__dirty__` flag set to '+' will be added.\n */\n addRecord(record?: GristRecord) {\n this._data = {\n ...this._data,\n records: [\n ...this.dirtyData.records,\n {\n ...record,\n __dirty__: '+'\n }\n ]\n }\n }\n\n /**\n * Adds a new record to the top of the data grid. The added record is marked as newly created\n * by setting the `__dirty__` flag to '+'. This flag indicates that the record\n * is in a \"new\" state and hasn't been committed to the main data yet.\n *\n * This method is useful when you need to add new records at the top of the grid\n * without changing the default behavior of the appendable row.\n *\n * @param {GristRecord} [record] - An optional record to add. If no record is provided,\n * an empty record with the `__dirty__` flag set to '+' will be added.\n */\n addRecordToTop(record?: GristRecord) {\n const newRecord = {\n ...record,\n __dirty__: '+'\n }\n\n this._data = {\n ...this._data,\n records: [newRecord, ...this.dirtyData.records]\n }\n\n // 새 레코드에 포커스 및 스크롤 처리\n setTimeout(() => {\n // 그리드가 있는 경우 첫 번째 행에 포커스 설정\n if (this.grist) {\n // 포커스를 첫 번째 행으로 설정 (첫 번째 편집 가능한 셀로)\n const focusableColumns = this.compiledConfig.columns.filter(\n column => column.type !== 'gutter' && !column.hidden && column.record.editable\n )\n\n if (focusableColumns.length > 0) {\n const columnIndex = this.compiledConfig.columns.indexOf(focusableColumns[0])\n this.grist.dispatchEvent(\n new CustomEvent('focus-change', {\n bubbles: true,\n composed: true,\n detail: {\n row: 0,\n column: columnIndex\n }\n })\n )\n }\n\n // 스크롤을 맨 위로 이동\n this.grist.scrollTop = 0\n }\n }, 0)\n }\n\n /**\n * Retrieves the search text used for filtering records.\n *\n * @property {string}\n */\n get searchText() {\n return (this.filters?.find(filter => filter.operator === 'search')?.value as string)?.match(/^\\%(.*)\\%$/)?.[1] || ''\n }\n\n /**\n * Sets the search text for filtering records.\n *\n * @property {string}\n */\n set searchText(searchText: string) {\n var filters = (this.filters || []).filter((filter: FilterValue) => filter.operator !== 'search')\n\n if (searchText) {\n const filtersConfig = this.compiledConfig.columns.filter(columnConfig => !!columnConfig.filter)\n const searchColumns = filtersConfig.filter(columnConfig => {\n const filter = columnConfig.filter as FilterConfigObject\n return filter!.operator === 'search'\n })\n\n filters = [\n ...searchColumns.map((column: ColumnConfig) => {\n const { name } = column\n\n return {\n name,\n operator: 'search',\n value: `%${searchText}%`\n } as FilterValue\n }),\n ...filters\n ]\n }\n\n this.grist.dispatchEvent(\n new CustomEvent('fetch-params-change', {\n bubbles: true,\n composed: true,\n detail: {\n filters\n }\n })\n )\n }\n /**\n * Returns the current pagination limit.\n * @returns {number} The current pagination limit value\n */\n getCurrentLimit() {\n return this.dataProvider?.limit || ZERO_PAGINATION.limit\n }\n\n /**\n * Checks the validity of dirty records.\n * @returns {Array<{record: GristRecord, invalidFields: Array<{field: string, reason: ValidationReason}>}>} List of invalid records and their corresponding invalid fields\n */\n checkDirtyRecordsValidity(): { record: GristRecord; invalidFields: { field: string; reason: ValidationReason }[] }[] {\n const records = this.dirtyRecords\n const validationResults = []\n\n for (const record of records) {\n const invalidFields = []\n\n for (const column of this.compiledConfig.columns) {\n if (column.record?.mandatory && (record[column.name] === undefined || record[column.name] === null)) {\n invalidFields.push({\n field: column.name,\n reason: ValidationReason.MANDATORY\n })\n }\n // Additional validation rules can be implemented here.\n }\n\n if (invalidFields.length > 0) {\n validationResults.push({\n record,\n invalidFields\n })\n }\n }\n\n return validationResults\n }\n}\n"]}