@operato/data-grist 2.0.0-alpha.7 → 2.0.0-alpha.80
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 +297 -0
- package/demo/data-grist-test.html +25 -14
- package/demo/index.html +25 -14
- package/demo/report-test.html +13 -2
- package/dist/src/accumulator/accumulator.js +4 -4
- package/dist/src/accumulator/accumulator.js.map +1 -1
- package/dist/src/configure/rows-option-builder.js +2 -1
- package/dist/src/configure/rows-option-builder.js.map +1 -1
- package/dist/src/configure/zero-config.js +1 -0
- package/dist/src/configure/zero-config.js.map +1 -1
- package/dist/src/data-card/data-card-gutter-menu.d.ts +1 -1
- package/dist/src/data-card/data-card-gutter-menu.js +5 -5
- package/dist/src/data-card/data-card-gutter-menu.js.map +1 -1
- package/dist/src/data-card/data-card.d.ts +2 -2
- package/dist/src/data-card/data-card.js +3 -3
- package/dist/src/data-card/data-card.js.map +1 -1
- package/dist/src/data-card/event-handlers/record-card-click-handler.js +1 -1
- package/dist/src/data-card/event-handlers/record-card-click-handler.js.map +1 -1
- package/dist/src/data-card/record-card.d.ts +2 -2
- package/dist/src/data-card/record-card.js +26 -26
- package/dist/src/data-card/record-card.js.map +1 -1
- package/dist/src/data-grid/data-grid-accum-field.js +8 -3
- package/dist/src/data-grid/data-grid-accum-field.js.map +1 -1
- package/dist/src/data-grid/data-grid-body.d.ts +3 -3
- package/dist/src/data-grid/data-grid-body.js +9 -4
- package/dist/src/data-grid/data-grid-body.js.map +1 -1
- package/dist/src/data-grid/data-grid-field.d.ts +1 -1
- package/dist/src/data-grid/data-grid-field.js +2 -2
- package/dist/src/data-grid/data-grid-field.js.map +1 -1
- package/dist/src/data-grid/data-grid-footer.d.ts +2 -2
- package/dist/src/data-grid/data-grid-footer.js +17 -9
- package/dist/src/data-grid/data-grid-footer.js.map +1 -1
- package/dist/src/data-grid/data-grid-header.d.ts +1 -1
- package/dist/src/data-grid/data-grid-header.js +37 -37
- package/dist/src/data-grid/data-grid-header.js.map +1 -1
- package/dist/src/data-grid/data-grid.d.ts +1 -1
- package/dist/src/data-grid/data-grid.js +1 -1
- package/dist/src/data-grid/data-grid.js.map +1 -1
- package/dist/src/data-grist.d.ts +226 -4
- package/dist/src/data-grist.js +217 -25
- package/dist/src/data-grist.js.map +1 -1
- package/dist/src/data-list/data-list-gutter.js +12 -0
- package/dist/src/data-list/data-list-gutter.js.map +1 -1
- package/dist/src/data-list/data-list.d.ts +2 -2
- package/dist/src/data-list/data-list.js +3 -3
- package/dist/src/data-list/data-list.js.map +1 -1
- package/dist/src/data-list/event-handlers/record-partial-click-handler.js +1 -1
- package/dist/src/data-list/event-handlers/record-partial-click-handler.js.map +1 -1
- package/dist/src/data-list/record-partial.d.ts +2 -2
- package/dist/src/data-list/record-partial.js +20 -18
- package/dist/src/data-list/record-partial.js.map +1 -1
- package/dist/src/data-manipulator.d.ts +6 -6
- package/dist/src/data-manipulator.js +44 -29
- package/dist/src/data-manipulator.js.map +1 -1
- package/dist/src/data-report/data-report-body.d.ts +1 -1
- package/dist/src/data-report/data-report-component.d.ts +1 -1
- package/dist/src/data-report.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-checkbox.d.ts +3 -2
- package/dist/src/editors/ox-grist-editor-checkbox.js +9 -2
- package/dist/src/editors/ox-grist-editor-checkbox.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-color.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-date.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-datetime.d.ts +2 -2
- package/dist/src/editors/ox-grist-editor-datetime.js +1 -2
- package/dist/src/editors/ox-grist-editor-datetime.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-email.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-file.d.ts +3 -2
- package/dist/src/editors/ox-grist-editor-file.js +8 -2
- package/dist/src/editors/ox-grist-editor-file.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-image.d.ts +2 -2
- package/dist/src/editors/ox-grist-editor-image.js +8 -8
- package/dist/src/editors/ox-grist-editor-image.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-month.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-multiple-select.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-number.d.ts +3 -2
- package/dist/src/editors/ox-grist-editor-number.js +10 -9
- package/dist/src/editors/ox-grist-editor-number.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-password.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-select.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-tel.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-text.d.ts +2 -1
- package/dist/src/editors/ox-grist-editor-text.js +3 -0
- package/dist/src/editors/ox-grist-editor-text.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-textarea.d.ts +2 -1
- package/dist/src/editors/ox-grist-editor-textarea.js +3 -0
- package/dist/src/editors/ox-grist-editor-textarea.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-time.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-tree.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor-week.d.ts +1 -1
- package/dist/src/editors/ox-grist-editor.d.ts +4 -4
- package/dist/src/editors/ox-grist-editor.js +14 -12
- package/dist/src/editors/ox-grist-editor.js.map +1 -1
- package/dist/src/editors/ox-input-tree.d.ts +1 -1
- package/dist/src/empty-note.d.ts +2 -2
- package/dist/src/empty-note.js +3 -3
- package/dist/src/empty-note.js.map +1 -1
- package/dist/src/filters/filter-range-date.js +12 -1
- package/dist/src/filters/filter-range-date.js.map +1 -1
- package/dist/src/filters/filters-form.d.ts +1 -0
- package/dist/src/filters/filters-form.js +41 -23
- package/dist/src/filters/filters-form.js.map +1 -1
- package/dist/src/gutters/gutter-button.d.ts +1 -1
- package/dist/src/gutters/gutter-button.js +3 -3
- package/dist/src/gutters/gutter-button.js.map +1 -1
- package/dist/src/gutters/gutter-dirty.d.ts +1 -1
- package/dist/src/gutters/gutter-dirty.js +5 -5
- package/dist/src/gutters/gutter-dirty.js.map +1 -1
- package/dist/src/handlers/contextmenu-tree-mutation.js +5 -23
- package/dist/src/handlers/contextmenu-tree-mutation.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/record-view/record-creator.d.ts +2 -2
- package/dist/src/record-view/record-creator.js +1 -1
- package/dist/src/record-view/record-creator.js.map +1 -1
- package/dist/src/record-view/record-view-body.d.ts +3 -3
- package/dist/src/record-view/record-view-body.js +4 -4
- package/dist/src/record-view/record-view-body.js.map +1 -1
- package/dist/src/record-view/record-view.d.ts +2 -2
- package/dist/src/record-view/record-view.js +5 -5
- package/dist/src/record-view/record-view.js.map +1 -1
- package/dist/src/renderers/ox-grist-renderer-progress.d.ts +1 -1
- package/dist/src/renderers/ox-grist-renderer-tree.d.ts +1 -1
- package/dist/src/renderers/ox-grist-renderer.d.ts +2 -2
- package/dist/src/sorters/sorters-control.js +3 -3
- package/dist/src/sorters/sorters-control.js.map +1 -1
- package/dist/src/types.d.ts +1 -8
- package/dist/src/types.js.map +1 -1
- package/dist/stories/accumulator.stories.d.ts +1 -1
- package/dist/stories/accumulator.stories.js +126 -112
- package/dist/stories/accumulator.stories.js.map +1 -1
- package/dist/stories/barcode-input-filter.stories.d.ts +1 -1
- package/dist/stories/barcode-input-filter.stories.js +80 -72
- package/dist/stories/barcode-input-filter.stories.js.map +1 -1
- package/dist/stories/default-filters.stories.d.ts +1 -1
- package/dist/stories/default-filters.stories.js +80 -72
- package/dist/stories/default-filters.stories.js.map +1 -1
- package/dist/stories/dynamic-editable.stories.d.ts +1 -1
- package/dist/stories/dynamic-editable.stories.js +100 -79
- package/dist/stories/dynamic-editable.stories.js.map +1 -1
- package/dist/stories/empty-sorters.stories.d.ts +1 -1
- package/dist/stories/empty-sorters.stories.js +80 -71
- package/dist/stories/empty-sorters.stories.js.map +1 -1
- package/dist/stories/explicit-fetch.stories.d.ts +1 -1
- package/dist/stories/explicit-fetch.stories.js +81 -72
- package/dist/stories/explicit-fetch.stories.js.map +1 -1
- package/dist/stories/fixed-column.stories.d.ts +1 -1
- package/dist/stories/fixed-column.stories.js +122 -113
- package/dist/stories/fixed-column.stories.js.map +1 -1
- package/dist/stories/grist-modes.stories.d.ts +1 -1
- package/dist/stories/grist-modes.stories.js +155 -125
- package/dist/stories/grist-modes.stories.js.map +1 -1
- package/dist/stories/group-header.stories.d.ts +1 -1
- package/dist/stories/group-header.stories.js +122 -113
- package/dist/stories/group-header.stories.js.map +1 -1
- package/dist/stories/textarea.stories.d.ts +1 -1
- package/dist/stories/textarea.stories.js +113 -104
- package/dist/stories/textarea.stories.js.map +1 -1
- package/dist/stories/tree-column-with-checkbox.stories.d.ts +1 -1
- package/dist/stories/tree-column-with-checkbox.stories.js +126 -117
- package/dist/stories/tree-column-with-checkbox.stories.js.map +1 -1
- package/dist/stories/tree-column.stories.d.ts +1 -1
- package/dist/stories/tree-column.stories.js +126 -117
- package/dist/stories/tree-column.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/default-value/default-value.md +1 -1
- package/docs/default-value/value-generator/date-generator.md +2 -2
- package/docs/default-value/value-generator/month-date-generator.md +2 -2
- package/docs/default-value/value-generator/week-date-generator.md +2 -2
- package/docs/default-value/value-generator/year-date-generator.md +2 -2
- package/package.json +21 -20
- package/src/accumulator/accumulator.ts +4 -4
- package/src/configure/rows-option-builder.ts +11 -1
- package/src/configure/zero-config.ts +1 -0
- package/src/data-card/data-card-gutter-menu.ts +5 -5
- package/src/data-card/data-card.ts +3 -3
- package/src/data-card/event-handlers/record-card-click-handler.ts +1 -1
- package/src/data-card/record-card.ts +30 -32
- package/src/data-grid/data-grid-accum-field.ts +8 -3
- package/src/data-grid/data-grid-body.ts +10 -5
- package/src/data-grid/data-grid-field.ts +1 -1
- package/src/data-grid/data-grid-footer.ts +18 -11
- package/src/data-grid/data-grid-header.ts +67 -68
- package/src/data-grid/data-grid.ts +3 -3
- package/src/data-grist.ts +274 -27
- package/src/data-list/data-list-gutter.ts +12 -0
- package/src/data-list/data-list.ts +3 -3
- package/src/data-list/event-handlers/record-partial-click-handler.ts +1 -1
- package/src/data-list/record-partial.ts +22 -22
- package/src/data-manipulator.ts +52 -31
- package/src/editors/ox-grist-editor-checkbox.ts +12 -2
- package/src/editors/ox-grist-editor-datetime.ts +1 -2
- package/src/editors/ox-grist-editor-file.ts +12 -2
- package/src/editors/ox-grist-editor-image.ts +10 -7
- package/src/editors/ox-grist-editor-number.ts +11 -9
- package/src/editors/ox-grist-editor-text.ts +4 -0
- package/src/editors/ox-grist-editor-textarea.ts +4 -0
- package/src/editors/ox-grist-editor.ts +14 -10
- package/src/empty-note.ts +3 -3
- package/src/filters/filter-range-date.ts +16 -1
- package/src/filters/filters-form.ts +69 -46
- package/src/gutters/gutter-button.ts +3 -3
- package/src/gutters/gutter-dirty.ts +5 -5
- package/src/handlers/contextmenu-tree-mutation.ts +5 -23
- package/src/index.ts +0 -1
- package/src/record-view/record-creator.ts +1 -1
- package/src/record-view/record-view-body.ts +4 -4
- package/src/record-view/record-view.ts +5 -5
- package/src/sorters/sorters-control.ts +3 -3
- package/src/types.ts +1 -9
- package/stories/accumulator.stories.ts +128 -118
- package/stories/barcode-input-filter.stories.ts +91 -82
- package/stories/default-filters.stories.ts +91 -82
- package/stories/dynamic-editable.stories.ts +108 -86
- package/stories/empty-sorters.stories.ts +92 -82
- package/stories/explicit-fetch.stories.ts +93 -83
- package/stories/fixed-column.stories.ts +134 -124
- package/stories/grist-modes.stories.ts +167 -141
- package/stories/group-header.stories.ts +134 -124
- package/stories/textarea.stories.ts +115 -110
- package/stories/tree-column-with-checkbox.stories.ts +134 -124
- package/stories/tree-column.stories.ts +134 -124
- package/themes/grist-theme.css +1 -1
- package/dist/src/value-generator/date-generator.d.ts +0 -6
- package/dist/src/value-generator/date-generator.js +0 -30
- package/dist/src/value-generator/date-generator.js.map +0 -1
- package/dist/src/value-generator/hour-time-generator.d.ts +0 -7
- package/dist/src/value-generator/hour-time-generator.js +0 -29
- package/dist/src/value-generator/hour-time-generator.js.map +0 -1
- package/dist/src/value-generator/index.d.ts +0 -1
- package/dist/src/value-generator/index.js +0 -2
- package/dist/src/value-generator/index.js.map +0 -1
- package/dist/src/value-generator/minute-time-generator.d.ts +0 -7
- package/dist/src/value-generator/minute-time-generator.js +0 -29
- package/dist/src/value-generator/minute-time-generator.js.map +0 -1
- package/dist/src/value-generator/month-date-generator.d.ts +0 -7
- package/dist/src/value-generator/month-date-generator.js +0 -31
- package/dist/src/value-generator/month-date-generator.js.map +0 -1
- package/dist/src/value-generator/now-generator.d.ts +0 -4
- package/dist/src/value-generator/now-generator.js +0 -8
- package/dist/src/value-generator/now-generator.js.map +0 -1
- package/dist/src/value-generator/registry.d.ts +0 -11
- package/dist/src/value-generator/registry.js +0 -50
- package/dist/src/value-generator/registry.js.map +0 -1
- package/dist/src/value-generator/time-generator.d.ts +0 -6
- package/dist/src/value-generator/time-generator.js +0 -28
- package/dist/src/value-generator/time-generator.js.map +0 -1
- package/dist/src/value-generator/today-generator.d.ts +0 -4
- package/dist/src/value-generator/today-generator.js +0 -8
- package/dist/src/value-generator/today-generator.js.map +0 -1
- package/dist/src/value-generator/week-date-generator.d.ts +0 -7
- package/dist/src/value-generator/week-date-generator.js +0 -29
- package/dist/src/value-generator/week-date-generator.js.map +0 -1
- package/dist/src/value-generator/year-date-generator.d.ts +0 -7
- package/dist/src/value-generator/year-date-generator.js +0 -29
- package/dist/src/value-generator/year-date-generator.js.map +0 -1
- package/src/value-generator/date-generator.ts +0 -35
- package/src/value-generator/hour-time-generator.ts +0 -43
- package/src/value-generator/index.ts +0 -1
- package/src/value-generator/minute-time-generator.ts +0 -43
- package/src/value-generator/month-date-generator.ts +0 -38
- package/src/value-generator/now-generator.ts +0 -10
- package/src/value-generator/registry.ts +0 -58
- package/src/value-generator/time-generator.ts +0 -33
- package/src/value-generator/today-generator.ts +0 -10
- package/src/value-generator/week-date-generator.ts +0 -40
- package/src/value-generator/year-date-generator.ts +0 -36
@@ -9,7 +9,7 @@ function dispatchEvent(field: DataGridField, event: string) {
|
|
9
9
|
new CustomEvent(event, {
|
10
10
|
bubbles: true,
|
11
11
|
composed: true,
|
12
|
-
detail: field
|
12
|
+
detail: field.record
|
13
13
|
})
|
14
14
|
)
|
15
15
|
}
|
@@ -42,7 +42,7 @@ export const ContextMenuTreeMutation = function (
|
|
42
42
|
dispatchEvent(field, 'add-sibling-node')
|
43
43
|
}}
|
44
44
|
>
|
45
|
-
<
|
45
|
+
<md-icon slot="icon">add</md-icon>
|
46
46
|
</ox-popup-menuitem>
|
47
47
|
|
48
48
|
<ox-popup-menuitem
|
@@ -51,25 +51,7 @@ export const ContextMenuTreeMutation = function (
|
|
51
51
|
dispatchEvent(field, 'add-child-node')
|
52
52
|
}}
|
53
53
|
>
|
54
|
-
<
|
55
|
-
</ox-popup-menuitem>
|
56
|
-
|
57
|
-
<ox-popup-menuitem
|
58
|
-
label="move up"
|
59
|
-
@click=${() => {
|
60
|
-
dispatchEvent(field, 'move-up')
|
61
|
-
}}
|
62
|
-
>
|
63
|
-
<mwc-icon slot="icon">arrow_upward</mwc-icon>
|
64
|
-
</ox-popup-menuitem>
|
65
|
-
|
66
|
-
<ox-popup-menuitem
|
67
|
-
label="move down"
|
68
|
-
@click=${() => {
|
69
|
-
dispatchEvent(field, 'move-down')
|
70
|
-
}}
|
71
|
-
>
|
72
|
-
<mwc-icon slot="icon">arrow_downward</mwc-icon>
|
54
|
+
<md-icon slot="icon">playlist_add</md-icon>
|
73
55
|
</ox-popup-menuitem>
|
74
56
|
|
75
57
|
<div separator></div>
|
@@ -80,7 +62,7 @@ export const ContextMenuTreeMutation = function (
|
|
80
62
|
dispatchEvent(field, 'collapse-all')
|
81
63
|
}}
|
82
64
|
>
|
83
|
-
<
|
65
|
+
<md-icon slot="icon">unfold_less</md-icon>
|
84
66
|
</ox-popup-menuitem>
|
85
67
|
|
86
68
|
<ox-popup-menuitem
|
@@ -89,7 +71,7 @@ export const ContextMenuTreeMutation = function (
|
|
89
71
|
dispatchEvent(field, 'expand-all')
|
90
72
|
}}
|
91
73
|
>
|
92
|
-
<
|
74
|
+
<md-icon slot="icon">unfold_more</md-icon>
|
93
75
|
</ox-popup-menuitem>
|
94
76
|
`,
|
95
77
|
top: e.pageY,
|
package/src/index.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
import '../data-grid/data-grid-field'
|
3
3
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
@@ -34,7 +34,7 @@ export class RecordViewBody extends LitElement {
|
|
34
34
|
color: var(--record-view-label-color);
|
35
35
|
}
|
36
36
|
|
37
|
-
label
|
37
|
+
label md-icon {
|
38
38
|
display: none;
|
39
39
|
}
|
40
40
|
|
@@ -43,7 +43,7 @@ export class RecordViewBody extends LitElement {
|
|
43
43
|
font-weight: bold;
|
44
44
|
}
|
45
45
|
|
46
|
-
label[editable]
|
46
|
+
label[editable] md-icon {
|
47
47
|
display: inline-block;
|
48
48
|
font-size: var(--record-view-label-icon-size);
|
49
49
|
opacity: 0.5;
|
@@ -99,7 +99,7 @@ export class RecordViewBody extends LitElement {
|
|
99
99
|
|
100
100
|
return html`
|
101
101
|
<label ?editable=${editable}
|
102
|
-
><span>${mandatory ? '*' : ''}${this._renderLabel(column)}</span> <
|
102
|
+
><span>${mandatory ? '*' : ''}${this._renderLabel(column)}</span> <md-icon>edit</md-icon></label
|
103
103
|
>
|
104
104
|
<ox-grid-field
|
105
105
|
.rowIndex=${rowIndex}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@material/
|
1
|
+
import '@material/web/icon/icon.js'
|
2
2
|
import './record-view-body'
|
3
3
|
import '@operato/input/ox-input-file.js'
|
4
4
|
import '../data-grid/data-grid-field'
|
@@ -53,7 +53,7 @@ export class RecordView extends LitElement {
|
|
53
53
|
vertical-align: middle;
|
54
54
|
}
|
55
55
|
|
56
|
-
[footer] button
|
56
|
+
[footer] button md-icon {
|
57
57
|
margin-top: -3px;
|
58
58
|
margin-right: 5px;
|
59
59
|
font-size: var(--record-view-footer-iconbutton-size);
|
@@ -74,9 +74,9 @@ export class RecordView extends LitElement {
|
|
74
74
|
<ox-record-view-body .columns=${this.columns} .record=${this.record} .rowIndex=${this.rowIndex}>
|
75
75
|
</ox-record-view-body>
|
76
76
|
<div footer>
|
77
|
-
<button @click=${this.onReset.bind(this)}><
|
78
|
-
<button @click=${this.onCancel.bind(this)}><
|
79
|
-
<button @click=${this.onOK.bind(this)} ok><
|
77
|
+
<button @click=${this.onReset.bind(this)}><md-icon>refresh</md-icon><span>Reset</span></button>
|
78
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>clear</md-icon><span>Cancel</span></button>
|
79
|
+
<button @click=${this.onOK.bind(this)} ok><md-icon>radio_button_unchecked</md-icon><span>OK</span></button>
|
80
80
|
</div>
|
81
81
|
`
|
82
82
|
}
|
@@ -29,9 +29,9 @@ export class SortersControl extends LitElement {
|
|
29
29
|
text-transform: capitalize;
|
30
30
|
user-select: none;
|
31
31
|
}
|
32
|
-
[option]
|
32
|
+
[option] md-icon {
|
33
33
|
margin-left: var(--margin-default);
|
34
|
-
--
|
34
|
+
--md-icon-size: var(--fontsize-large);
|
35
35
|
color: var(--primary-color);
|
36
36
|
}
|
37
37
|
[option] sub {
|
@@ -99,7 +99,7 @@ export class SortersControl extends LitElement {
|
|
99
99
|
${desc === null
|
100
100
|
? html``
|
101
101
|
: html`
|
102
|
-
<
|
102
|
+
<md-icon>${desc ? 'keyboard_arrow_down' : 'keyboard_arrow_up'}</md-icon>
|
103
103
|
${rank === 0 ? html`` : html`<sub>${rank}</sub>`}
|
104
104
|
`}
|
105
105
|
</div>
|
package/src/types.ts
CHANGED
@@ -427,15 +427,6 @@ export type HeaderConfig = {
|
|
427
427
|
*/
|
428
428
|
export type HeaderRenderer = (column: ColumnConfig) => any
|
429
429
|
|
430
|
-
/**
|
431
|
-
* Function type for generating values.
|
432
|
-
*
|
433
|
-
* @callback ValueGeneratorFn
|
434
|
-
* @param {...any} args - The arguments used for generating a value.
|
435
|
-
* @returns {*} - The generated value.
|
436
|
-
*/
|
437
|
-
export type ValueGeneratorFn = (...args: any[]) => any
|
438
|
-
|
439
430
|
/**
|
440
431
|
* Configuration for specifying default values for fields in a record.
|
441
432
|
* Default values can be set using predefined value generator functions or custom user-defined functions.
|
@@ -627,6 +618,7 @@ export type ImexConfig = {
|
|
627
618
|
export type RowsConfig = {
|
628
619
|
accumulator?: boolean
|
629
620
|
appendable: boolean
|
621
|
+
editable: boolean
|
630
622
|
insertable: boolean
|
631
623
|
selectable?: RowSelectableConfig
|
632
624
|
groups: GroupConfig[]
|
@@ -3,7 +3,7 @@ import '../src/filters/filters-form.js'
|
|
3
3
|
import '../src/sorters/sorters-control.js'
|
4
4
|
import '../src/record-view/record-creator.js'
|
5
5
|
import '@operato/popup/ox-popup-list.js'
|
6
|
-
import '@material/
|
6
|
+
import '@material/web/icon/icon.js'
|
7
7
|
|
8
8
|
import { html, TemplateResult } from 'lit'
|
9
9
|
|
@@ -103,9 +103,14 @@ const config = {
|
|
103
103
|
header: 'accval',
|
104
104
|
record: {
|
105
105
|
editable: true,
|
106
|
-
align: 'right'
|
106
|
+
align: 'right',
|
107
|
+
defaultValue: 100
|
107
108
|
},
|
108
109
|
accumulator: 'avg',
|
110
|
+
// accumulator: {
|
111
|
+
// type: 'avg',
|
112
|
+
// tag: true
|
113
|
+
// },
|
109
114
|
sortable: true,
|
110
115
|
width: 130
|
111
116
|
},
|
@@ -116,7 +121,10 @@ const config = {
|
|
116
121
|
header: 'accval2',
|
117
122
|
record: {
|
118
123
|
editable: true,
|
119
|
-
align: 'right'
|
124
|
+
align: 'right',
|
125
|
+
renderer: (value: any, column: any, record: any) => {
|
126
|
+
return value && Intl.NumberFormat('en-US').format(value)
|
127
|
+
}
|
120
128
|
},
|
121
129
|
accumulator: {
|
122
130
|
type: 'sum',
|
@@ -163,9 +171,6 @@ const config = {
|
|
163
171
|
{
|
164
172
|
name: 'name',
|
165
173
|
desc: true
|
166
|
-
},
|
167
|
-
{
|
168
|
-
name: 'email'
|
169
174
|
}
|
170
175
|
],
|
171
176
|
pagination: {
|
@@ -196,137 +201,142 @@ interface ArgTypes {
|
|
196
201
|
fetchHandler: object
|
197
202
|
}
|
198
203
|
|
199
|
-
const Template: Story<ArgTypes> = ({
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
<style>
|
213
|
-
ox-grist {
|
214
|
-
height: 600px;
|
215
|
-
}
|
204
|
+
const Template: Story<ArgTypes> = ({ config, mode = 'GRID', urlParamsSensitive = false, fetchHandler }: ArgTypes) =>
|
205
|
+
html` <link
|
206
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
207
|
+
rel="stylesheet"
|
208
|
+
/>
|
209
|
+
<link
|
210
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
211
|
+
rel="stylesheet"
|
212
|
+
/>
|
213
|
+
<link
|
214
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
215
|
+
rel="stylesheet"
|
216
|
+
/>
|
216
217
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
align-items: center;
|
221
|
-
padding: var(--padding-default) var(--padding-wide);
|
222
|
-
background-color: var(--theme-white-color);
|
223
|
-
box-shadow: var(--box-shadow);
|
218
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
219
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
220
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
224
221
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
--mdc-icon-size: 18px;
|
230
|
-
}
|
231
|
-
#sorters {
|
232
|
-
margin-left: auto;
|
233
|
-
margin-right: var(--margin-default);
|
234
|
-
padding-left: var(--padding-narrow);
|
235
|
-
border-bottom: var(--border-dark-color);
|
236
|
-
position: relative;
|
237
|
-
color: var(--secondary-color);
|
238
|
-
font-size: var(--fontsize-default);
|
239
|
-
user-select: none;
|
240
|
-
}
|
222
|
+
<style>
|
223
|
+
ox-grist {
|
224
|
+
height: 600px;
|
225
|
+
}
|
241
226
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
227
|
+
[slot='headroom'] {
|
228
|
+
display: flex;
|
229
|
+
flex-direction: row;
|
230
|
+
align-items: center;
|
231
|
+
padding: var(--padding-default) var(--padding-wide);
|
232
|
+
background-color: var(--theme-white-color);
|
233
|
+
box-shadow: var(--box-shadow);
|
246
234
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
235
|
+
--md-icon-size: 24px;
|
236
|
+
}
|
237
|
+
#sorters md-icon,
|
238
|
+
#modes md-icon {
|
239
|
+
--md-icon-size: 18px;
|
240
|
+
}
|
241
|
+
#sorters {
|
242
|
+
margin-left: auto;
|
243
|
+
margin-right: var(--margin-default);
|
244
|
+
padding-left: var(--padding-narrow);
|
245
|
+
border-bottom: var(--border-dark-color);
|
246
|
+
position: relative;
|
247
|
+
color: var(--secondary-color);
|
248
|
+
font-size: var(--fontsize-default);
|
249
|
+
user-select: none;
|
250
|
+
}
|
253
251
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
color: var(--secondary-text-color);
|
259
|
-
cursor: default;
|
260
|
-
}
|
252
|
+
#sorters > * {
|
253
|
+
padding: var(--padding-narrow);
|
254
|
+
vertical-align: middle;
|
255
|
+
}
|
261
256
|
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
257
|
+
#modes > * {
|
258
|
+
padding: var(--padding-narrow);
|
259
|
+
opacity: 0.5;
|
260
|
+
color: var(--primary-text-color);
|
261
|
+
cursor: pointer;
|
262
|
+
}
|
266
263
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
264
|
+
#modes > md-icon[active] {
|
265
|
+
border-radius: 9px;
|
266
|
+
background-color: rgba(var(--primary-color-rgb), 0.05);
|
267
|
+
opacity: 1;
|
268
|
+
color: var(--secondary-text-color);
|
269
|
+
cursor: default;
|
270
|
+
}
|
271
271
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
padding: 5px;
|
277
|
-
width: 36px;
|
278
|
-
height: 36px;
|
279
|
-
cursor: pointer;
|
280
|
-
}
|
272
|
+
#modes > md-icon:hover {
|
273
|
+
opacity: 1;
|
274
|
+
color: var(--secondary-text-color);
|
275
|
+
}
|
281
276
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
277
|
+
#add {
|
278
|
+
width: 50px;
|
279
|
+
text-align: right;
|
280
|
+
}
|
286
281
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
282
|
+
#add button {
|
283
|
+
background-color: var(--primary-color);
|
284
|
+
border: 0;
|
285
|
+
border-radius: 50%;
|
286
|
+
padding: 5px;
|
287
|
+
width: 36px;
|
288
|
+
height: 36px;
|
289
|
+
cursor: pointer;
|
290
|
+
}
|
291
291
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
}
|
292
|
+
#add button:hover {
|
293
|
+
background-color: var(--focus-background-color);
|
294
|
+
box-shadow: var(--box-shadow);
|
295
|
+
}
|
297
296
|
|
298
|
-
|
299
|
-
|
300
|
-
|
297
|
+
#add button md-icon {
|
298
|
+
font-size: 2em;
|
299
|
+
color: var(--theme-white-color);
|
300
|
+
}
|
301
301
|
|
302
|
-
@media only screen and (max-width: 460px) {
|
303
302
|
#filters {
|
304
|
-
|
303
|
+
display: flex;
|
304
|
+
justify-content: center;
|
305
|
+
align-items: center;
|
305
306
|
}
|
306
307
|
|
307
|
-
#
|
308
|
-
|
308
|
+
#filters * {
|
309
|
+
margin-right: var(--margin-default);
|
309
310
|
}
|
310
|
-
}
|
311
|
-
</style>
|
312
311
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
?url-params-sensitive=${urlParamsSensitive}
|
318
|
-
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
319
|
-
>
|
320
|
-
<div slot="headroom">
|
321
|
-
<div id="filters">
|
322
|
-
<ox-filters-form autofocus></ox-filters-form>
|
323
|
-
</div>
|
312
|
+
@media only screen and (max-width: 460px) {
|
313
|
+
#filters {
|
314
|
+
flex-direction: column;
|
315
|
+
}
|
324
316
|
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
317
|
+
#modes {
|
318
|
+
display: none;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
</style>
|
322
|
+
|
323
|
+
<ox-grist
|
324
|
+
mode="GRID"
|
325
|
+
.config=${config}
|
326
|
+
.fetchHandler=${fetchHandler}
|
327
|
+
?url-params-sensitive=${urlParamsSensitive}
|
328
|
+
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
329
|
+
>
|
330
|
+
<div slot="headroom">
|
331
|
+
<div id="filters">
|
332
|
+
<ox-filters-form autofocus></ox-filters-form>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
<ox-record-creator id="add" light-popup>
|
336
|
+
<button><md-icon>add</md-icon></button>
|
337
|
+
</ox-record-creator>
|
338
|
+
</div>
|
339
|
+
</ox-grist>`
|
330
340
|
|
331
341
|
export const Regular = Template.bind({})
|
332
342
|
Regular.args = {
|