@operato/data-grist 0.2.43 → 0.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/custom-elements.json +99 -99
- package/demo/index.html +70 -38
- package/dist/src/data-grid/data-grid-header.d.ts +1 -2
- package/dist/src/data-grid/data-grid-header.js +34 -9
- package/dist/src/data-grid/data-grid-header.js.map +1 -1
- package/dist/src/data-list/record-partial.d.ts +1 -1
- package/dist/src/data-list/record-partial.js +2 -3
- package/dist/src/data-list/record-partial.js.map +1 -1
- package/dist/src/filters/filter-range-date.js +1 -1
- package/dist/src/filters/filter-range-date.js.map +1 -1
- package/dist/src/filters/filter-range-number.js +3 -1
- package/dist/src/filters/filter-range-number.js.map +1 -1
- package/dist/src/filters/filter-select.d.ts +1 -0
- package/dist/src/filters/filter-select.js +1 -0
- package/dist/src/filters/filter-select.js.map +1 -1
- package/dist/src/filters/filter-styles.js +33 -3
- package/dist/src/filters/filter-styles.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/data-grid/data-grid-header.ts +36 -12
- package/src/data-list/record-partial.ts +3 -4
- package/src/filters/filter-range-date.ts +1 -1
- package/src/filters/filter-range-number.ts +3 -1
- package/src/filters/filter-select.ts +2 -1
- package/src/filters/filter-styles.ts +33 -3
- package/themes/grist-theme.css +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,51 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.2.47](https://github.com/hatiolab/operato/compare/v0.2.46...v0.2.47) (2021-12-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* operato/board/board-modeller and operato/input/buttons-radio ([d2a4344](https://github.com/hatiolab/operato/commit/d2a4344ae2ad10c9ebfca919a0c9ff7de29d7c6a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [0.2.46](https://github.com/hatiolab/operato/compare/v0.2.45...v0.2.46) (2021-12-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :rocket: New Features
|
|
19
|
+
|
|
20
|
+
* add layout and oops ([56737fa](https://github.com/hatiolab/operato/commit/56737fa117ed2135e279ca0f1e4c969daddf7b34))
|
|
21
|
+
* add operato/board modeller ([2acd6b3](https://github.com/hatiolab/operato/commit/2acd6b31a4d91317fa84ecee67874d2242968ec6))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### :bug: Bug Fix
|
|
25
|
+
|
|
26
|
+
* data-grist custom-element.json ([3b338d3](https://github.com/hatiolab/operato/commit/3b338d301b91fed30d2e191af580ac734b06c0ff))
|
|
27
|
+
* set all module version to 0.2.45 ([40cea11](https://github.com/hatiolab/operato/commit/40cea11fab09ab3fb96bcd7db797abd13b23c216))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### [0.2.45](https://github.com/hatiolab/operato/compare/v0.2.44...v0.2.45) (2021-12-11)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### :bug: Bug Fix
|
|
35
|
+
|
|
36
|
+
* data-grid filter popup title ([5c75c24](https://github.com/hatiolab/operato/commit/5c75c24a563dddccfdceb52ce9db3393ce13b0df))
|
|
37
|
+
* filter style ([6f5789d](https://github.com/hatiolab/operato/commit/6f5789d9594eacb005203ae0f916993d107322c2))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### [0.2.44](https://github.com/hatiolab/operato/compare/v0.2.43...v0.2.44) (2021-12-09)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### :bug: Bug Fix
|
|
45
|
+
|
|
46
|
+
* filter style ([2d39b59](https://github.com/hatiolab/operato/commit/2d39b59e2068483c64bb4adee450603d8fe29031))
|
|
47
|
+
* filter style ([65eb5ec](https://github.com/hatiolab/operato/commit/65eb5ec87645719b6b797d6592a9436a6cffe569))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
6
51
|
### [0.2.43](https://github.com/hatiolab/operato/compare/v0.2.42...v0.2.43) (2021-12-08)
|
|
7
52
|
|
|
8
53
|
|
package/custom-elements.json
CHANGED
|
@@ -17,6 +17,69 @@
|
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"kind": "javascript-module",
|
|
22
|
+
"path": "stories/index.stories.ts",
|
|
23
|
+
"declarations": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "variable",
|
|
26
|
+
"name": "Regular"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "variable",
|
|
30
|
+
"name": "CustomTitle"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"kind": "variable",
|
|
34
|
+
"name": "CustomCounter"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "variable",
|
|
38
|
+
"name": "SlottedContent"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"exports": [
|
|
42
|
+
{
|
|
43
|
+
"kind": "js",
|
|
44
|
+
"name": "default",
|
|
45
|
+
"declaration": {
|
|
46
|
+
"module": "stories/index.stories.ts"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"kind": "js",
|
|
51
|
+
"name": "Regular",
|
|
52
|
+
"declaration": {
|
|
53
|
+
"name": "Regular",
|
|
54
|
+
"module": "stories/index.stories.ts"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": "js",
|
|
59
|
+
"name": "CustomTitle",
|
|
60
|
+
"declaration": {
|
|
61
|
+
"name": "CustomTitle",
|
|
62
|
+
"module": "stories/index.stories.ts"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"kind": "js",
|
|
67
|
+
"name": "CustomCounter",
|
|
68
|
+
"declaration": {
|
|
69
|
+
"name": "CustomCounter",
|
|
70
|
+
"module": "stories/index.stories.ts"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"kind": "js",
|
|
75
|
+
"name": "SlottedContent",
|
|
76
|
+
"declaration": {
|
|
77
|
+
"name": "SlottedContent",
|
|
78
|
+
"module": "stories/index.stories.ts"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
20
83
|
{
|
|
21
84
|
"kind": "javascript-module",
|
|
22
85
|
"path": "src/const.ts",
|
|
@@ -1034,69 +1097,6 @@
|
|
|
1034
1097
|
"declarations": [],
|
|
1035
1098
|
"exports": []
|
|
1036
1099
|
},
|
|
1037
|
-
{
|
|
1038
|
-
"kind": "javascript-module",
|
|
1039
|
-
"path": "stories/index.stories.ts",
|
|
1040
|
-
"declarations": [
|
|
1041
|
-
{
|
|
1042
|
-
"kind": "variable",
|
|
1043
|
-
"name": "Regular"
|
|
1044
|
-
},
|
|
1045
|
-
{
|
|
1046
|
-
"kind": "variable",
|
|
1047
|
-
"name": "CustomTitle"
|
|
1048
|
-
},
|
|
1049
|
-
{
|
|
1050
|
-
"kind": "variable",
|
|
1051
|
-
"name": "CustomCounter"
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
"kind": "variable",
|
|
1055
|
-
"name": "SlottedContent"
|
|
1056
|
-
}
|
|
1057
|
-
],
|
|
1058
|
-
"exports": [
|
|
1059
|
-
{
|
|
1060
|
-
"kind": "js",
|
|
1061
|
-
"name": "default",
|
|
1062
|
-
"declaration": {
|
|
1063
|
-
"module": "stories/index.stories.ts"
|
|
1064
|
-
}
|
|
1065
|
-
},
|
|
1066
|
-
{
|
|
1067
|
-
"kind": "js",
|
|
1068
|
-
"name": "Regular",
|
|
1069
|
-
"declaration": {
|
|
1070
|
-
"name": "Regular",
|
|
1071
|
-
"module": "stories/index.stories.ts"
|
|
1072
|
-
}
|
|
1073
|
-
},
|
|
1074
|
-
{
|
|
1075
|
-
"kind": "js",
|
|
1076
|
-
"name": "CustomTitle",
|
|
1077
|
-
"declaration": {
|
|
1078
|
-
"name": "CustomTitle",
|
|
1079
|
-
"module": "stories/index.stories.ts"
|
|
1080
|
-
}
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
"kind": "js",
|
|
1084
|
-
"name": "CustomCounter",
|
|
1085
|
-
"declaration": {
|
|
1086
|
-
"name": "CustomCounter",
|
|
1087
|
-
"module": "stories/index.stories.ts"
|
|
1088
|
-
}
|
|
1089
|
-
},
|
|
1090
|
-
{
|
|
1091
|
-
"kind": "js",
|
|
1092
|
-
"name": "SlottedContent",
|
|
1093
|
-
"declaration": {
|
|
1094
|
-
"name": "SlottedContent",
|
|
1095
|
-
"module": "stories/index.stories.ts"
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
]
|
|
1099
|
-
},
|
|
1100
1100
|
{
|
|
1101
1101
|
"kind": "javascript-module",
|
|
1102
1102
|
"path": "src/configure/column-builder.ts",
|
|
@@ -9949,7 +9949,7 @@
|
|
|
9949
9949
|
{
|
|
9950
9950
|
"kind": "variable",
|
|
9951
9951
|
"name": "FilterStyles",
|
|
9952
|
-
"default": "css`\n [filter] input {\n
|
|
9952
|
+
"default": "css`\n :host {\n --ox-input-placeholder-color: var(--primary-color);\n\n --ox-input-padding: var(--padding-narrow) var(--padding-default);\n --ox-input-border: 1px solid rgba(0, 0, 0, 0.2);\n --ox-input-border-radius: var(--border-radius);\n --ox-input-font: normal 14px var(--theme-font);\n --ox-input-color: var(--primary-text-color);\n }\n\n [filter] input::placeholder {\n color: var(--ox-input-placeholder-color);\n opacity: 0.7;\n }\n [filter] input {\n margin: 0 10px 5px 10px;\n padding: var(--ox-input-padding);\n border: var(--ox-input-border);\n border-radius: var(--ox-input-border-radius);\n font: var(--ox-input-font);\n color: var(--ox-input-color, #3a5877);\n }\n [filter] input[type='number'] {\n padding-right: var(--padding-narrow);\n max-width: 100px;\n }\n [filter] input[type='datetime-local'] {\n padding-right: var(--padding-narrow);\n max-width: 170px;\n }\n [filter] input[name='from'] {\n margin: 0 0 5px 10px;\n }\n [filter] input[name='to'] {\n margin: 0 10px 5px 0;\n }\n`"
|
|
9953
9953
|
}
|
|
9954
9954
|
],
|
|
9955
9955
|
"exports": [
|
|
@@ -10608,6 +10608,41 @@
|
|
|
10608
10608
|
}
|
|
10609
10609
|
]
|
|
10610
10610
|
},
|
|
10611
|
+
{
|
|
10612
|
+
"kind": "javascript-module",
|
|
10613
|
+
"path": "src/interfaces/index.ts",
|
|
10614
|
+
"declarations": [],
|
|
10615
|
+
"exports": [
|
|
10616
|
+
{
|
|
10617
|
+
"kind": "js",
|
|
10618
|
+
"name": "*",
|
|
10619
|
+
"declaration": {
|
|
10620
|
+
"name": "*",
|
|
10621
|
+
"package": "./ox-search-field"
|
|
10622
|
+
}
|
|
10623
|
+
},
|
|
10624
|
+
{
|
|
10625
|
+
"kind": "js",
|
|
10626
|
+
"name": "*",
|
|
10627
|
+
"declaration": {
|
|
10628
|
+
"name": "*",
|
|
10629
|
+
"package": "./ox-grist-search-form"
|
|
10630
|
+
}
|
|
10631
|
+
}
|
|
10632
|
+
]
|
|
10633
|
+
},
|
|
10634
|
+
{
|
|
10635
|
+
"kind": "javascript-module",
|
|
10636
|
+
"path": "src/interfaces/ox-grist-search-form.ts",
|
|
10637
|
+
"declarations": [],
|
|
10638
|
+
"exports": []
|
|
10639
|
+
},
|
|
10640
|
+
{
|
|
10641
|
+
"kind": "javascript-module",
|
|
10642
|
+
"path": "src/interfaces/ox-search-field.ts",
|
|
10643
|
+
"declarations": [],
|
|
10644
|
+
"exports": []
|
|
10645
|
+
},
|
|
10611
10646
|
{
|
|
10612
10647
|
"kind": "javascript-module",
|
|
10613
10648
|
"path": "src/handlers/index.ts",
|
|
@@ -10777,41 +10812,6 @@
|
|
|
10777
10812
|
}
|
|
10778
10813
|
]
|
|
10779
10814
|
},
|
|
10780
|
-
{
|
|
10781
|
-
"kind": "javascript-module",
|
|
10782
|
-
"path": "src/interfaces/index.ts",
|
|
10783
|
-
"declarations": [],
|
|
10784
|
-
"exports": [
|
|
10785
|
-
{
|
|
10786
|
-
"kind": "js",
|
|
10787
|
-
"name": "*",
|
|
10788
|
-
"declaration": {
|
|
10789
|
-
"name": "*",
|
|
10790
|
-
"package": "./ox-search-field"
|
|
10791
|
-
}
|
|
10792
|
-
},
|
|
10793
|
-
{
|
|
10794
|
-
"kind": "js",
|
|
10795
|
-
"name": "*",
|
|
10796
|
-
"declaration": {
|
|
10797
|
-
"name": "*",
|
|
10798
|
-
"package": "./ox-grist-search-form"
|
|
10799
|
-
}
|
|
10800
|
-
}
|
|
10801
|
-
]
|
|
10802
|
-
},
|
|
10803
|
-
{
|
|
10804
|
-
"kind": "javascript-module",
|
|
10805
|
-
"path": "src/interfaces/ox-grist-search-form.ts",
|
|
10806
|
-
"declarations": [],
|
|
10807
|
-
"exports": []
|
|
10808
|
-
},
|
|
10809
|
-
{
|
|
10810
|
-
"kind": "javascript-module",
|
|
10811
|
-
"path": "src/interfaces/ox-search-field.ts",
|
|
10812
|
-
"declarations": [],
|
|
10813
|
-
"exports": []
|
|
10814
|
-
},
|
|
10815
10815
|
{
|
|
10816
10816
|
"kind": "javascript-module",
|
|
10817
10817
|
"path": "src/record-view/index.ts",
|
package/demo/index.html
CHANGED
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
editable: true
|
|
274
274
|
},
|
|
275
275
|
filter: {
|
|
276
|
-
type: '
|
|
276
|
+
type: 'datetime'
|
|
277
277
|
},
|
|
278
278
|
sortable: true,
|
|
279
279
|
width: 180
|
|
@@ -337,32 +337,62 @@
|
|
|
337
337
|
|
|
338
338
|
#headroom {
|
|
339
339
|
display: flex;
|
|
340
|
-
flex-direction:
|
|
341
|
-
background-color: var(--primary-color);
|
|
342
|
-
height: 200px;
|
|
340
|
+
flex-direction: row;
|
|
343
341
|
align-items: center;
|
|
344
|
-
|
|
345
|
-
|
|
342
|
+
padding: var(--padding-default) var(--padding-wide);
|
|
343
|
+
border-top: 2px solid rgba(0, 0, 0, 0.2);
|
|
344
|
+
background-color: var(--main-section-background-color);
|
|
346
345
|
}
|
|
347
346
|
|
|
348
347
|
#modes > * {
|
|
349
348
|
padding: var(--padding-narrow);
|
|
350
|
-
font-size:
|
|
351
|
-
opacity: 0.
|
|
349
|
+
font-size: 1em;
|
|
350
|
+
opacity: 0.5;
|
|
351
|
+
color: var(--primary-text-color);
|
|
352
|
+
cursor: pointer;
|
|
352
353
|
}
|
|
353
354
|
|
|
354
355
|
#modes > mwc-icon[active] {
|
|
355
|
-
border: 1px solid var(--status-warning-color);
|
|
356
356
|
border-radius: 9px;
|
|
357
|
-
background-color: rgba(
|
|
357
|
+
background-color: rgba(var(--primary-color-rgb), 0.05);
|
|
358
358
|
opacity: 1;
|
|
359
|
+
color: var(--secondary-text-color);
|
|
360
|
+
cursor: default;
|
|
359
361
|
}
|
|
360
362
|
|
|
361
363
|
#filters {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
flex: 1;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
#tailer {
|
|
368
|
+
display: flex;
|
|
369
|
+
flex-direction: row;
|
|
370
|
+
margin: 0 var(--margin-default);
|
|
371
|
+
}
|
|
372
|
+
#tailer a {
|
|
373
|
+
padding: 0 var(--padding-narrow) 0 var(--padding-default);
|
|
374
|
+
margin: 0 var(--margin-narrow);
|
|
375
|
+
border-left: 1px solid rgba(0, 0, 0, 0.1);
|
|
376
|
+
font-size: var(--fontsize-default);
|
|
377
|
+
color: var(--primary-color);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
#add button {
|
|
381
|
+
background-color: var(--status-success-color);
|
|
382
|
+
border: 0;
|
|
383
|
+
border-radius: 50%;
|
|
384
|
+
padding: 5px;
|
|
385
|
+
width: 36px;
|
|
386
|
+
height: 36px;
|
|
387
|
+
cursor: pointer;
|
|
388
|
+
}
|
|
389
|
+
#add button:hover {
|
|
390
|
+
background-color: var(--focus-background-color);
|
|
391
|
+
box-shadow: var(--box-shadow);
|
|
392
|
+
}
|
|
393
|
+
#add button mwc-icon {
|
|
394
|
+
font-size: 2em;
|
|
395
|
+
color: var(--theme-white-color);
|
|
366
396
|
}
|
|
367
397
|
`
|
|
368
398
|
]
|
|
@@ -390,30 +420,6 @@
|
|
|
390
420
|
></ox-grist-search-form>
|
|
391
421
|
<ox-grist .config=${config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
|
|
392
422
|
<div slot="headroom" id="headroom">
|
|
393
|
-
<h1>HEAD ROOM AREA</h1>
|
|
394
|
-
<div id="modes">
|
|
395
|
-
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
|
|
396
|
-
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
|
|
397
|
-
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
398
|
-
</div>
|
|
399
|
-
<div id="tailer">
|
|
400
|
-
<a href="./report-test.html">Report Test</a>|
|
|
401
|
-
<a
|
|
402
|
-
href="#"
|
|
403
|
-
@click=${() => {
|
|
404
|
-
this.renderRoot.querySelector('ox-grist').reset()
|
|
405
|
-
}}
|
|
406
|
-
>Reset</a
|
|
407
|
-
>|
|
|
408
|
-
<a
|
|
409
|
-
href="#"
|
|
410
|
-
@click=${() => {
|
|
411
|
-
this.renderRoot.querySelector('ox-grist').fetch(true)
|
|
412
|
-
}}
|
|
413
|
-
>Fetch</a
|
|
414
|
-
>
|
|
415
|
-
</div>
|
|
416
|
-
|
|
417
423
|
<div id="filters">
|
|
418
424
|
<mwc-icon
|
|
419
425
|
@click=${e => {
|
|
@@ -469,6 +475,32 @@
|
|
|
469
475
|
</div>
|
|
470
476
|
</ox-popup-list>
|
|
471
477
|
</div>
|
|
478
|
+
<div id="modes">
|
|
479
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
|
|
480
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
|
|
481
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
<div id="tailer">
|
|
485
|
+
<a href="./report-test.html">Report Test</a>
|
|
486
|
+
<a
|
|
487
|
+
href="#"
|
|
488
|
+
@click=${() => {
|
|
489
|
+
this.renderRoot.querySelector('ox-grist').reset()
|
|
490
|
+
}}
|
|
491
|
+
>Reset</a
|
|
492
|
+
>
|
|
493
|
+
<a
|
|
494
|
+
href="#"
|
|
495
|
+
@click=${() => {
|
|
496
|
+
this.renderRoot.querySelector('ox-grist').fetch(true)
|
|
497
|
+
}}
|
|
498
|
+
>Fetch</a
|
|
499
|
+
>
|
|
500
|
+
</div>
|
|
501
|
+
<div id="add">
|
|
502
|
+
<button><mwc-icon>add</mwc-icon></button>
|
|
503
|
+
</div>
|
|
472
504
|
</div>
|
|
473
505
|
</ox-grist>
|
|
474
506
|
`
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import '@operato/popup';
|
|
2
|
-
import '@operato/input';
|
|
3
2
|
import '@material/mwc-icon';
|
|
4
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
5
3
|
import { ColumnConfig, GristConfig, GristData } from '../types';
|
|
4
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
6
5
|
export declare class DataGridHeader extends LitElement {
|
|
7
6
|
static styles: import("lit").CSSResult[];
|
|
8
7
|
config: GristConfig;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@operato/popup';
|
|
3
|
-
import '@operato/input';
|
|
4
3
|
import '@material/mwc-icon';
|
|
5
|
-
import { css, html
|
|
6
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
|
-
import throttle from 'lodash-es/throttle';
|
|
4
|
+
import { LitElement, css, html } from 'lit';
|
|
8
5
|
import { ZERO_COLUMNS, ZERO_CONFIG, ZERO_DATA } from '../configure/zero-config';
|
|
6
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
9
7
|
import { FilterStyles } from '../filters/filter-styles';
|
|
10
8
|
import { getRenderer } from '../filters/registry';
|
|
9
|
+
import throttle from 'lodash-es/throttle';
|
|
11
10
|
let DataGridHeader = class DataGridHeader extends LitElement {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
@@ -94,8 +93,14 @@ let DataGridHeader = class DataGridHeader extends LitElement {
|
|
|
94
93
|
>
|
|
95
94
|
|
|
96
95
|
${type === 'select'
|
|
97
|
-
? html `<ox-popup-list multiple attr-selected="checked"
|
|
98
|
-
|
|
96
|
+
? html `<ox-popup-list multiple attr-selected="checked"
|
|
97
|
+
><div filter-title><mwc-icon>filter_alt</mwc-icon> filter by <strong>${column.name}</strong></div>
|
|
98
|
+
${getRenderer(type)(column, this)}</ox-popup-list
|
|
99
|
+
>`
|
|
100
|
+
: html ` <ox-popup
|
|
101
|
+
><div filter-title><mwc-icon>filter_alt</mwc-icon> filter by <strong>${column.name}</strong></div>
|
|
102
|
+
${getRenderer(type)(column, this)}</ox-popup
|
|
103
|
+
>`}
|
|
99
104
|
`;
|
|
100
105
|
}
|
|
101
106
|
updated(changes) {
|
|
@@ -185,7 +190,7 @@ DataGridHeader.styles = [
|
|
|
185
190
|
overflow: hidden;
|
|
186
191
|
}
|
|
187
192
|
|
|
188
|
-
div {
|
|
193
|
+
:scope > div {
|
|
189
194
|
display: flex;
|
|
190
195
|
|
|
191
196
|
white-space: nowrap;
|
|
@@ -226,11 +231,15 @@ DataGridHeader.styles = [
|
|
|
226
231
|
padding: 0;
|
|
227
232
|
border: 0;
|
|
228
233
|
}
|
|
229
|
-
span[sorter] mwc-icon
|
|
230
|
-
span[filter] mwc-icon {
|
|
234
|
+
span[sorter] mwc-icon {
|
|
231
235
|
font-size: var(--grid-header-sorter-size);
|
|
232
236
|
}
|
|
233
237
|
|
|
238
|
+
span[filter] > mwc-icon {
|
|
239
|
+
font-size: var(--fontsize-default);
|
|
240
|
+
line-height: 20px;
|
|
241
|
+
}
|
|
242
|
+
|
|
234
243
|
span[splitter] {
|
|
235
244
|
cursor: col-resize;
|
|
236
245
|
border-right: var(--grid-header-splitter-border);
|
|
@@ -243,6 +252,22 @@ DataGridHeader.styles = [
|
|
|
243
252
|
margin: 3px 0 0 0;
|
|
244
253
|
zoom: var(--grist-input-zoom);
|
|
245
254
|
}
|
|
255
|
+
[filter-title] {
|
|
256
|
+
color: var(--grid-header-filter-title-color);
|
|
257
|
+
font: var(--grid-header-filter-title-font);
|
|
258
|
+
text-transform: capitalize;
|
|
259
|
+
}
|
|
260
|
+
[filter-title] * {
|
|
261
|
+
vertical-align: middle;
|
|
262
|
+
}
|
|
263
|
+
[filter-title] mwc-icon {
|
|
264
|
+
opacity: 0.7;
|
|
265
|
+
color: var(--grid-header-filter-title-icon-color);
|
|
266
|
+
}
|
|
267
|
+
[filter] input[type='checkbox'] {
|
|
268
|
+
margin-left: 10px;
|
|
269
|
+
margin-bottom: 5px;
|
|
270
|
+
}
|
|
246
271
|
|
|
247
272
|
@media print {
|
|
248
273
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-header.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-header.ts"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,CAAA;AACvB,OAAO,gBAAgB,CAAA;AACvB,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,QAAQ,MAAM,oBAAo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AA;QACxD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAjRQ,qBAAM,GAAG;IACd,YAAY;IACZ,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwEF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkC;AAClC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAuC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAA4B;AAE9C;IAAR,KAAK,EAAE;gDAAqC;AAlFlC,cAAc;IAD1B,aAAa,CAAC,gBAAgB,CAAC;GACnB,cAAc,CAkR1B;SAlRY,cAAc","sourcesContent":["import '@operato/popup'\nimport '@operato/input'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle'\n\nimport { OxPopup } from '@operato/popup'\n\nimport { ZERO_COLUMNS, ZERO_CONFIG, ZERO_DATA } from '../configure/zero-config'\nimport { FilterStyles } from '../filters/filter-styles'\nimport { getRenderer } from '../filters/registry'\nimport { ColumnConfig, GristConfig, GristData, SortersConfig } from '../types'\n\n@customElement('ox-grid-header')\nexport class DataGridHeader extends LitElement {\n static styles = [\n FilterStyles,\n css`\n :host {\n display: grid;\n grid-template-columns: var(--grid-template-columns);\n\n overflow: hidden;\n }\n\n div {\n display: flex;\n\n white-space: nowrap;\n overflow: hidden;\n background-color: var(--grid-header-background-color);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n color: var(--grid-header-color);\n }\n\n div[gutter] {\n padding: var(--padding-default) 0 var(--padding-narrow) 0;\n text-align: center;\n }\n\n span {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n }\n\n span[for-title] {\n flex: 1;\n text-overflow: ellipsis;\n line-height: 1.6;\n text-transform: capitalize;\n }\n span[for-title] mwc-icon {\n font-size: var(--grid-record-fontsize);\n }\n\n span[sorter],\n span[filter] {\n padding: 0;\n border: 0;\n }\n span[sorter] mwc-icon,\n span[filter] mwc-icon {\n font-size: var(--grid-header-sorter-size);\n }\n\n span[splitter] {\n cursor: col-resize;\n border-right: var(--grid-header-splitter-border);\n }\n span[splitter]:hover {\n border-right: var(--grid-header-splitter-border-hover);\n }\n input[type='checkbox'],\n input[type='radio'] {\n margin: 3px 0 0 0;\n zoom: var(--grist-input-zoom);\n }\n\n @media print {\n :host {\n grid-template-columns: var(--grid-template-print-columns);\n }\n }\n `\n ]\n\n @property({ type: Object }) config: GristConfig = ZERO_CONFIG\n @property({ type: Array }) columns: ColumnConfig[] = ZERO_COLUMNS\n @property({ type: Object }) data: GristData = ZERO_DATA\n\n @state() private _sorters: SortersConfig = []\n private _lastAccVal?: number\n private _throttledNotifier?: any\n\n render() {\n var columns = this.columns || []\n\n return html`\n ${columns.map((column, idx) =>\n !column.hidden\n ? html`\n <div ?gutter=${column.type == 'gutter'} column>\n <span for-title @click=${(e: MouseEvent) => this._changeSort(column)}\n >${this._renderHeader(column)}\n </span>\n\n ${column.sortable\n ? html`\n <span sorter @click=${(e: MouseEvent) => this._changeSort(column)}>\n ${this._renderSortHeader(column)}\n </span>\n `\n : undefined}\n ${column.filter ? html` <span filter> ${this._renderFilterHeader(column)} </span> ` : undefined}\n ${column.resizable !== false\n ? html`\n <span splitter draggable=\"false\" @mousedown=${(e: MouseEvent) => this._mousedown(e, idx)}\n > </span\n >\n `\n : undefined}\n </div>\n `\n : undefined\n )}\n\n <div column></div>\n `\n }\n\n _renderHeader(column: ColumnConfig) {\n var { renderer } = column.header || {}\n var title = renderer.call(this, column)\n\n return html` ${title} `\n }\n\n _renderSortHeader(column: ColumnConfig) {\n var sorters = this._sorters\n\n var sorter = sorters.find(sorter => column.type !== 'gutter' && column.name == sorter.name)\n if (!sorter) {\n return html``\n }\n\n if (sorters.length > 1) {\n var rank = sorters.indexOf(sorter) + 1\n return sorter.desc\n ? html` <mwc-icon>keyboard_arrow_up</mwc-icon><sub>${rank}</sub> `\n : html` <mwc-icon>keyboard_arrow_down</mwc-icon><sub>${rank}</sub> `\n } else {\n return sorter.desc\n ? html` <mwc-icon>keyboard_arrow_up</mwc-icon> `\n : html` <mwc-icon>keyboard_arrow_down</mwc-icon> `\n }\n }\n\n _renderFilterHeader(column: ColumnConfig) {\n var filter = column.filter\n const type = typeof filter === 'boolean' ? column.type : filter?.type || column.type\n\n return html`\n <mwc-icon\n @click=${(e: Event) => {\n const parent = (e.target as HTMLElement).closest('[column]') as HTMLElement\n const popup = parent.querySelector('ox-popup, ox-popup-list') as OxPopup | null\n // const popup = (e.target as HTMLElement).nextSibling as OxPopupList | null\n\n // absolute position인 popup의 위치 부모는 grist 이므로,\n // data-grid-header 의 포지션 부모(grist)의 위치로부터 계산해야함.\n // this의 position을 relative로 하지 못하는 이유 : ox-popup-list가 grid body에 덮히기 때문.\n const top = parent.offsetTop + parent.offsetHeight\n const right = this.clientWidth - (parent.offsetLeft + parent.offsetWidth - this.scrollLeft)\n\n popup?.open({\n right,\n top\n })\n }}\n >filter_alt</mwc-icon\n >\n\n ${type === 'select'\n ? html`<ox-popup-list multiple attr-selected=\"checked\">${getRenderer(type)(column, this)}</ox-popup-list>`\n : html` <ox-popup>${getRenderer(type)(column, this)}</ox-popup>`}\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('config')) {\n this._sorters = this.config.sorters || []\n }\n }\n\n _changeSort(column: ColumnConfig) {\n if (!column.sortable) {\n return\n }\n\n var sorters = [...this._sorters]\n\n var idx = sorters.findIndex(sorter => sorter.name == column.name)\n if (idx !== -1) {\n let sorter = sorters[idx]\n if (sorter.desc) {\n sorters.splice(idx, 1)\n } else {\n sorter.desc = true\n }\n } else {\n var sorter = {\n name: column.name\n }\n\n sorters.push(sorter)\n }\n\n this._sorters = sorters\n\n this.dispatchEvent(\n new CustomEvent('sorters-change', {\n bubbles: true,\n composed: true,\n detail: this._sorters\n })\n )\n }\n\n _accumalate(x: number) {\n this._lastAccVal = (this._lastAccVal ?? 0) + x\n return this._lastAccVal\n }\n\n _notifyWidthChange(idx: number, width: number) {\n if (!this._throttledNotifier) {\n this._throttledNotifier = throttle((idx: number, width: number) => {\n this.dispatchEvent(\n new CustomEvent('column-width-change', {\n bubbles: true,\n composed: true,\n detail: {\n idx,\n width\n }\n })\n )\n\n this._lastAccVal = 0\n }, 100)\n }\n\n this._throttledNotifier(idx, width)\n }\n\n _mousedown(e: MouseEvent, idx: number) {\n e.stopPropagation()\n e.preventDefault()\n\n var mousemoveHandler = ((e: MouseEvent) => {\n e.stopPropagation()\n e.preventDefault()\n let column = this.columns[idx]\n\n let width = Math.max(0, Number(column.width) + this._accumalate(e.movementX))\n if (width == 0) {\n /* CLARIFY-ME 왜 마지막 이벤트의 offsetX로 음수 값이 오는가 */\n return\n }\n\n this._notifyWidthChange(idx, width)\n }).bind(this)\n\n var mouseupHandler = ((e: MouseEvent) => {\n document.removeEventListener('mousemove', mousemoveHandler)\n document.removeEventListener('mouseup', mouseupHandler)\n\n mousemoveHandler(e)\n }).bind(this)\n\n document.addEventListener('mousemove', mousemoveHandler)\n document.addEventListener('mouseup', mouseupHandler)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-grid-header.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-header.ts"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,CAAA;AACvB,OAAO,oBAAoB,CAAA;AAG3B,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA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I,CAAC,CAAA;QAEb,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;QACxD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AA3SQ,qBAAM,GAAG;IACd,YAAY;IACZ,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4FF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkC;AAClC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAuC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAA4B;AAE9C;IAAR,KAAK,EAAE;gDAAqC;AAtGlC,cAAc;IAD1B,aAAa,CAAC,gBAAgB,CAAC;GACnB,cAAc,CA4S1B;SA5SY,cAAc","sourcesContent":["import '@operato/popup'\nimport '@material/mwc-icon'\n\nimport { ColumnConfig, GristConfig, GristData, SortersConfig } from '../types'\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { ZERO_COLUMNS, ZERO_CONFIG, ZERO_DATA } from '../configure/zero-config'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { FilterStyles } from '../filters/filter-styles'\nimport { OxPopup } from '@operato/popup'\nimport { getRenderer } from '../filters/registry'\nimport throttle from 'lodash-es/throttle'\n\n@customElement('ox-grid-header')\nexport class DataGridHeader extends LitElement {\n static styles = [\n FilterStyles,\n css`\n :host {\n display: grid;\n grid-template-columns: var(--grid-template-columns);\n\n overflow: hidden;\n }\n\n :scope > div {\n display: flex;\n\n white-space: nowrap;\n overflow: hidden;\n background-color: var(--grid-header-background-color);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n color: var(--grid-header-color);\n }\n\n div[gutter] {\n padding: var(--padding-default) 0 var(--padding-narrow) 0;\n text-align: center;\n }\n\n span {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n }\n\n span[for-title] {\n flex: 1;\n text-overflow: ellipsis;\n line-height: 1.6;\n text-transform: capitalize;\n }\n span[for-title] mwc-icon {\n font-size: var(--grid-record-fontsize);\n }\n\n span[sorter],\n span[filter] {\n padding: 0;\n border: 0;\n }\n span[sorter] mwc-icon {\n font-size: var(--grid-header-sorter-size);\n }\n\n span[filter] > mwc-icon {\n font-size: var(--fontsize-default);\n line-height: 20px;\n }\n\n span[splitter] {\n cursor: col-resize;\n border-right: var(--grid-header-splitter-border);\n }\n span[splitter]:hover {\n border-right: var(--grid-header-splitter-border-hover);\n }\n input[type='checkbox'],\n input[type='radio'] {\n margin: 3px 0 0 0;\n zoom: var(--grist-input-zoom);\n }\n [filter-title] {\n color: var(--grid-header-filter-title-color);\n font: var(--grid-header-filter-title-font);\n text-transform: capitalize;\n }\n [filter-title] * {\n vertical-align: middle;\n }\n [filter-title] mwc-icon {\n opacity: 0.7;\n color: var(--grid-header-filter-title-icon-color);\n }\n [filter] input[type='checkbox'] {\n margin-left: 10px;\n margin-bottom: 5px;\n }\n\n @media print {\n :host {\n grid-template-columns: var(--grid-template-print-columns);\n }\n }\n `\n ]\n\n @property({ type: Object }) config: GristConfig = ZERO_CONFIG\n @property({ type: Array }) columns: ColumnConfig[] = ZERO_COLUMNS\n @property({ type: Object }) data: GristData = ZERO_DATA\n\n @state() private _sorters: SortersConfig = []\n private _lastAccVal?: number\n private _throttledNotifier?: any\n\n render() {\n var columns = this.columns || []\n\n return html`\n ${columns.map((column, idx) =>\n !column.hidden\n ? html`\n <div ?gutter=${column.type == 'gutter'} column>\n <span for-title @click=${(e: MouseEvent) => this._changeSort(column)}\n >${this._renderHeader(column)}\n </span>\n\n ${column.sortable\n ? html`\n <span sorter @click=${(e: MouseEvent) => this._changeSort(column)}>\n ${this._renderSortHeader(column)}\n </span>\n `\n : undefined}\n ${column.filter ? html` <span filter> ${this._renderFilterHeader(column)} </span> ` : undefined}\n ${column.resizable !== false\n ? html`\n <span splitter draggable=\"false\" @mousedown=${(e: MouseEvent) => this._mousedown(e, idx)}\n > </span\n >\n `\n : undefined}\n </div>\n `\n : undefined\n )}\n\n <div column></div>\n `\n }\n\n _renderHeader(column: ColumnConfig) {\n var { renderer } = column.header || {}\n var title = renderer.call(this, column)\n\n return html` ${title} `\n }\n\n _renderSortHeader(column: ColumnConfig) {\n var sorters = this._sorters\n\n var sorter = sorters.find(sorter => column.type !== 'gutter' && column.name == sorter.name)\n if (!sorter) {\n return html``\n }\n\n if (sorters.length > 1) {\n var rank = sorters.indexOf(sorter) + 1\n return sorter.desc\n ? html` <mwc-icon>keyboard_arrow_up</mwc-icon><sub>${rank}</sub> `\n : html` <mwc-icon>keyboard_arrow_down</mwc-icon><sub>${rank}</sub> `\n } else {\n return sorter.desc\n ? html` <mwc-icon>keyboard_arrow_up</mwc-icon> `\n : html` <mwc-icon>keyboard_arrow_down</mwc-icon> `\n }\n }\n\n _renderFilterHeader(column: ColumnConfig) {\n var filter = column.filter\n const type = typeof filter === 'boolean' ? column.type : filter?.type || column.type\n\n return html`\n <mwc-icon\n @click=${(e: Event) => {\n const parent = (e.target as HTMLElement).closest('[column]') as HTMLElement\n const popup = parent.querySelector('ox-popup, ox-popup-list') as OxPopup | null\n // const popup = (e.target as HTMLElement).nextSibling as OxPopupList | null\n\n // absolute position인 popup의 위치 부모는 grist 이므로,\n // data-grid-header 의 포지션 부모(grist)의 위치로부터 계산해야함.\n // this의 position을 relative로 하지 못하는 이유 : ox-popup-list가 grid body에 덮히기 때문.\n const top = parent.offsetTop + parent.offsetHeight\n const right = this.clientWidth - (parent.offsetLeft + parent.offsetWidth - this.scrollLeft)\n\n popup?.open({\n right,\n top\n })\n }}\n >filter_alt</mwc-icon\n >\n\n ${type === 'select'\n ? html`<ox-popup-list multiple attr-selected=\"checked\"\n ><div filter-title><mwc-icon>filter_alt</mwc-icon> filter by <strong>${column.name}</strong></div>\n ${getRenderer(type)(column, this)}</ox-popup-list\n >`\n : html` <ox-popup\n ><div filter-title><mwc-icon>filter_alt</mwc-icon> filter by <strong>${column.name}</strong></div>\n ${getRenderer(type)(column, this)}</ox-popup\n >`}\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('config')) {\n this._sorters = this.config.sorters || []\n }\n }\n\n _changeSort(column: ColumnConfig) {\n if (!column.sortable) {\n return\n }\n\n var sorters = [...this._sorters]\n\n var idx = sorters.findIndex(sorter => sorter.name == column.name)\n if (idx !== -1) {\n let sorter = sorters[idx]\n if (sorter.desc) {\n sorters.splice(idx, 1)\n } else {\n sorter.desc = true\n }\n } else {\n var sorter = {\n name: column.name\n }\n\n sorters.push(sorter)\n }\n\n this._sorters = sorters\n\n this.dispatchEvent(\n new CustomEvent('sorters-change', {\n bubbles: true,\n composed: true,\n detail: this._sorters\n })\n )\n }\n\n _accumalate(x: number) {\n this._lastAccVal = (this._lastAccVal ?? 0) + x\n return this._lastAccVal\n }\n\n _notifyWidthChange(idx: number, width: number) {\n if (!this._throttledNotifier) {\n this._throttledNotifier = throttle((idx: number, width: number) => {\n this.dispatchEvent(\n new CustomEvent('column-width-change', {\n bubbles: true,\n composed: true,\n detail: {\n idx,\n width\n }\n })\n )\n\n this._lastAccVal = 0\n }, 100)\n }\n\n this._throttledNotifier(idx, width)\n }\n\n _mousedown(e: MouseEvent, idx: number) {\n e.stopPropagation()\n e.preventDefault()\n\n var mousemoveHandler = ((e: MouseEvent) => {\n e.stopPropagation()\n e.preventDefault()\n let column = this.columns[idx]\n\n let width = Math.max(0, Number(column.width) + this._accumalate(e.movementX))\n if (width == 0) {\n /* CLARIFY-ME 왜 마지막 이벤트의 offsetX로 음수 값이 오는가 */\n return\n }\n\n this._notifyWidthChange(idx, width)\n }).bind(this)\n\n var mouseupHandler = ((e: MouseEvent) => {\n document.removeEventListener('mousemove', mousemoveHandler)\n document.removeEventListener('mouseup', mouseupHandler)\n\n mousemoveHandler(e)\n }).bind(this)\n\n document.addEventListener('mousemove', mousemoveHandler)\n document.addEventListener('mouseup', mouseupHandler)\n }\n}\n"]}
|
|
@@ -2,8 +2,8 @@ import '@material/mwc-icon';
|
|
|
2
2
|
import './data-list-gutter';
|
|
3
3
|
import './data-list-field';
|
|
4
4
|
import '../record-view';
|
|
5
|
-
import { GristConfig, GristData, GristRecord } from '../types';
|
|
6
5
|
import { LitElement, PropertyValues } from 'lit';
|
|
6
|
+
import { GristConfig, GristData, GristRecord } from '../types';
|
|
7
7
|
export declare class RecordPartial extends LitElement {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
config: GristConfig;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
// import { longpressable } from '@things-factory/utils'
|
|
3
2
|
import '@material/mwc-icon';
|
|
4
3
|
import './data-list-gutter';
|
|
5
4
|
import './data-list-field';
|
|
6
5
|
import '../record-view';
|
|
7
|
-
import {
|
|
8
|
-
import { ZERO_CONFIG, ZERO_DATA, ZERO_RECORD } from '../configure/zero-config';
|
|
6
|
+
import { css, html, LitElement } from 'lit';
|
|
9
7
|
import { customElement, property } from 'lit/decorators.js';
|
|
8
|
+
import { ZERO_CONFIG, ZERO_DATA, ZERO_RECORD } from '../configure/zero-config';
|
|
10
9
|
import { recordPartialClickHandler } from './event-handlers/record-partial-click-handler';
|
|
11
10
|
import { recordPartialDblClickHandler } from './event-handlers/record-partial-dblclick-handler';
|
|
12
11
|
// import { recordPartialLongPressHandler } from './event-handlers/record-partial-long-press-handler'
|