@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
@@ -2,7 +2,7 @@ import '../src/index.js'
|
|
2
2
|
import '../src/filters/filters-form.js'
|
3
3
|
import '../src/sorters/sorters-control.js'
|
4
4
|
import '@operato/popup/ox-popup-list.js'
|
5
|
-
import '@material/
|
5
|
+
import '@material/web/icon/icon.js'
|
6
6
|
|
7
7
|
import { html, TemplateResult } from 'lit'
|
8
8
|
|
@@ -102,95 +102,105 @@ interface Story<T> {
|
|
102
102
|
|
103
103
|
interface ArgTypes {}
|
104
104
|
|
105
|
-
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
}
|
105
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
106
|
+
html` <link
|
107
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
108
|
+
rel="stylesheet"
|
109
|
+
/>
|
110
|
+
<link
|
111
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
112
|
+
rel="stylesheet"
|
113
|
+
/>
|
114
|
+
<link
|
115
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
116
|
+
rel="stylesheet"
|
117
|
+
/>
|
118
|
+
|
119
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
120
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
121
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
122
|
+
|
123
|
+
<style>
|
124
|
+
[slot='headroom'] {
|
125
|
+
display: flex;
|
126
|
+
flex-direction: row;
|
127
|
+
align-items: center;
|
128
|
+
padding: var(--padding-default) var(--padding-wide);
|
129
|
+
background-color: var(--theme-white-color);
|
130
|
+
box-shadow: var(--box-shadow);
|
131
|
+
|
132
|
+
--md-icon-size: 24px;
|
133
|
+
}
|
134
|
+
#sorters md-icon,
|
135
|
+
#modes md-icon {
|
136
|
+
--md-icon-size: 18px;
|
137
|
+
}
|
138
|
+
#sorters {
|
139
|
+
margin-left: auto;
|
140
|
+
margin-right: var(--margin-default);
|
141
|
+
padding-left: var(--padding-narrow);
|
142
|
+
border-bottom: var(--border-dark-color);
|
143
|
+
position: relative;
|
144
|
+
color: var(--secondary-color);
|
145
|
+
font-size: var(--fontsize-default);
|
146
|
+
user-select: none;
|
147
|
+
}
|
149
148
|
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
#sorters > * {
|
150
|
+
padding: var(--padding-narrow);
|
151
|
+
vertical-align: middle;
|
152
|
+
}
|
153
153
|
|
154
|
-
@media only screen and (max-width: 460px) {
|
155
154
|
#filters {
|
156
|
-
|
155
|
+
display: flex;
|
156
|
+
justify-content: center;
|
157
|
+
align-items: center;
|
157
158
|
}
|
158
159
|
|
159
|
-
#
|
160
|
-
|
160
|
+
#filters * {
|
161
|
+
margin-right: var(--margin-default);
|
161
162
|
}
|
162
|
-
}
|
163
|
-
</style>
|
164
|
-
|
165
|
-
<ox-grist
|
166
|
-
.config=${config}
|
167
|
-
mode="GRID"
|
168
|
-
.fetchHandler=${fetchHandler}
|
169
|
-
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
170
|
-
>
|
171
|
-
<div slot="headroom">
|
172
|
-
<div id="filters">
|
173
|
-
<ox-filters-form></ox-filters-form>
|
174
|
-
</div>
|
175
163
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
164
|
+
@media only screen and (max-width: 460px) {
|
165
|
+
#filters {
|
166
|
+
flex-direction: column;
|
167
|
+
}
|
168
|
+
|
169
|
+
#modes {
|
170
|
+
display: none;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
</style>
|
174
|
+
|
175
|
+
<ox-grist
|
176
|
+
.config=${config}
|
177
|
+
mode="GRID"
|
178
|
+
.fetchHandler=${fetchHandler}
|
179
|
+
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
180
|
+
>
|
181
|
+
<div slot="headroom">
|
182
|
+
<div id="filters">
|
183
|
+
<ox-filters-form></ox-filters-form>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div id="sorters">
|
187
|
+
Sort
|
188
|
+
<md-icon
|
189
|
+
@click=${(e: Event) => {
|
190
|
+
const target = e.currentTarget as HTMLElement
|
191
|
+
;(target.closest('#sorters')!.querySelector('#sorter-control') as any).open({
|
192
|
+
right: 0,
|
193
|
+
top: target.offsetTop + target.offsetHeight
|
194
|
+
})
|
195
|
+
}}
|
196
|
+
>expand_more</md-icon
|
197
|
+
>
|
198
|
+
<ox-popup id="sorter-control">
|
199
|
+
<ox-sorters-control> </ox-sorters-control>
|
200
|
+
</ox-popup>
|
201
|
+
</div>
|
191
202
|
</div>
|
192
|
-
</
|
193
|
-
</ox-grist>`
|
203
|
+
</ox-grist>`
|
194
204
|
|
195
205
|
export const Regular = Template.bind({})
|
196
206
|
Regular.args = {}
|
@@ -2,7 +2,7 @@ import '../src/index.js'
|
|
2
2
|
import '../src/filters/filters-form.js'
|
3
3
|
import '../src/sorters/sorters-control.js'
|
4
4
|
import '@operato/popup/ox-popup-list.js'
|
5
|
-
import '@material/
|
5
|
+
import '@material/web/icon/icon.js'
|
6
6
|
|
7
7
|
import { html, TemplateResult } from 'lit'
|
8
8
|
|
@@ -107,96 +107,106 @@ interface ArgTypes {
|
|
107
107
|
explicitFetch: boolean
|
108
108
|
}
|
109
109
|
|
110
|
-
const Template: Story<ArgTypes> = ({ explicitFetch = false }: ArgTypes) =>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
}
|
110
|
+
const Template: Story<ArgTypes> = ({ explicitFetch = false }: ArgTypes) =>
|
111
|
+
html` <link
|
112
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
113
|
+
rel="stylesheet"
|
114
|
+
/>
|
115
|
+
<link
|
116
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
117
|
+
rel="stylesheet"
|
118
|
+
/>
|
119
|
+
<link
|
120
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
121
|
+
rel="stylesheet"
|
122
|
+
/>
|
123
|
+
|
124
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
125
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
126
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
127
|
+
|
128
|
+
<style>
|
129
|
+
[slot='headroom'] {
|
130
|
+
display: flex;
|
131
|
+
flex-direction: row;
|
132
|
+
align-items: center;
|
133
|
+
padding: var(--padding-default) var(--padding-wide);
|
134
|
+
background-color: var(--theme-white-color);
|
135
|
+
box-shadow: var(--box-shadow);
|
136
|
+
|
137
|
+
--md-icon-size: 24px;
|
138
|
+
}
|
139
|
+
#sorters md-icon,
|
140
|
+
#modes md-icon {
|
141
|
+
--md-icon-size: 18px;
|
142
|
+
}
|
143
|
+
#sorters {
|
144
|
+
margin-left: auto;
|
145
|
+
margin-right: var(--margin-default);
|
146
|
+
padding-left: var(--padding-narrow);
|
147
|
+
border-bottom: var(--border-dark-color);
|
148
|
+
position: relative;
|
149
|
+
color: var(--secondary-color);
|
150
|
+
font-size: var(--fontsize-default);
|
151
|
+
user-select: none;
|
152
|
+
}
|
154
153
|
|
155
|
-
|
156
|
-
|
157
|
-
|
154
|
+
#sorters > * {
|
155
|
+
padding: var(--padding-narrow);
|
156
|
+
vertical-align: middle;
|
157
|
+
}
|
158
158
|
|
159
|
-
@media only screen and (max-width: 460px) {
|
160
159
|
#filters {
|
161
|
-
|
160
|
+
display: flex;
|
161
|
+
justify-content: center;
|
162
|
+
align-items: center;
|
162
163
|
}
|
163
164
|
|
164
|
-
#
|
165
|
-
|
165
|
+
#filters * {
|
166
|
+
margin-right: var(--margin-default);
|
166
167
|
}
|
167
|
-
}
|
168
|
-
</style>
|
169
|
-
|
170
|
-
<ox-grist
|
171
|
-
.config=${config}
|
172
|
-
mode="GRID"
|
173
|
-
?explicit-fetch=${explicitFetch}
|
174
|
-
.fetchHandler=${fetchHandler}
|
175
|
-
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
176
|
-
>
|
177
|
-
<div slot="headroom">
|
178
|
-
<div id="filters">
|
179
|
-
<ox-filters-form></ox-filters-form>
|
180
|
-
</div>
|
181
168
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
169
|
+
@media only screen and (max-width: 460px) {
|
170
|
+
#filters {
|
171
|
+
flex-direction: column;
|
172
|
+
}
|
173
|
+
|
174
|
+
#modes {
|
175
|
+
display: none;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
</style>
|
179
|
+
|
180
|
+
<ox-grist
|
181
|
+
.config=${config}
|
182
|
+
mode="GRID"
|
183
|
+
?explicit-fetch=${explicitFetch}
|
184
|
+
.fetchHandler=${fetchHandler}
|
185
|
+
@filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}
|
186
|
+
>
|
187
|
+
<div slot="headroom">
|
188
|
+
<div id="filters">
|
189
|
+
<ox-filters-form></ox-filters-form>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div id="sorters">
|
193
|
+
Sort
|
194
|
+
<md-icon
|
195
|
+
@click=${(e: Event) => {
|
196
|
+
const target = e.currentTarget as HTMLElement
|
197
|
+
;(target.closest('#sorters')!.querySelector('#sorter-control') as any).open({
|
198
|
+
right: 0,
|
199
|
+
top: target.offsetTop + target.offsetHeight
|
200
|
+
})
|
201
|
+
}}
|
202
|
+
>expand_more</md-icon
|
203
|
+
>
|
204
|
+
<ox-popup id="sorter-control">
|
205
|
+
<ox-sorters-control> </ox-sorters-control>
|
206
|
+
</ox-popup>
|
207
|
+
</div>
|
197
208
|
</div>
|
198
|
-
</
|
199
|
-
</ox-grist>`
|
209
|
+
</ox-grist>`
|
200
210
|
|
201
211
|
export const Regular = Template.bind({})
|
202
212
|
Regular.args = {
|