@operato/data-grist 9.0.0-beta.7 → 9.0.0-beta.70
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 +275 -0
- package/README.md +337 -44
- package/dist/src/data-grid/data-grid-body.js +30 -27
- package/dist/src/data-grid/data-grid-body.js.map +1 -1
- package/dist/src/data-grist.d.ts +13 -1
- package/dist/src/data-grist.js +42 -0
- package/dist/src/data-grist.js.map +1 -1
- package/dist/src/data-report.js +4 -4
- package/dist/src/data-report.js.map +1 -1
- package/dist/src/editors/ox-grist-editor-json5.d.ts +8 -0
- package/dist/src/editors/ox-grist-editor-json5.js +66 -0
- package/dist/src/editors/ox-grist-editor-json5.js.map +1 -0
- package/dist/src/editors/ox-popup-code-input.d.ts +14 -0
- package/dist/src/editors/ox-popup-code-input.js +78 -0
- package/dist/src/editors/ox-popup-code-input.js.map +1 -0
- package/dist/src/editors/registry.js +3 -1
- package/dist/src/editors/registry.js.map +1 -1
- package/dist/src/formatters/registry.d.ts +1 -1
- package/dist/src/gutters/registry.d.ts +1 -1
- package/dist/src/handlers/registry.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -14
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/stories/accumulator-format.stories.d.ts +0 -41
- package/dist/stories/accumulator-format.stories.js +0 -237
- package/dist/stories/accumulator-format.stories.js.map +0 -1
- package/dist/stories/barcode-input-filter.stories.d.ts +0 -33
- package/dist/stories/barcode-input-filter.stories.js +0 -185
- package/dist/stories/barcode-input-filter.stories.js.map +0 -1
- package/dist/stories/bounded-select-filters.stories.d.ts +0 -25
- package/dist/stories/bounded-select-filters.stories.js +0 -283
- package/dist/stories/bounded-select-filters.stories.js.map +0 -1
- package/dist/stories/bounded-select-record.stories.d.ts +0 -25
- package/dist/stories/bounded-select-record.stories.js +0 -286
- package/dist/stories/bounded-select-record.stories.js.map +0 -1
- package/dist/stories/click-event-custom.stories.d.ts +0 -45
- package/dist/stories/click-event-custom.stories.js +0 -248
- package/dist/stories/click-event-custom.stories.js.map +0 -1
- package/dist/stories/click-event.stories.d.ts +0 -45
- package/dist/stories/click-event.stories.js +0 -243
- package/dist/stories/click-event.stories.js.map +0 -1
- package/dist/stories/creatable-only-column.stories.d.ts +0 -29
- package/dist/stories/creatable-only-column.stories.js +0 -232
- package/dist/stories/creatable-only-column.stories.js.map +0 -1
- package/dist/stories/default-filters.stories.d.ts +0 -26
- package/dist/stories/default-filters.stories.js +0 -219
- package/dist/stories/default-filters.stories.js.map +0 -1
- package/dist/stories/dynamic-editable.stories.d.ts +0 -25
- package/dist/stories/dynamic-editable.stories.js +0 -293
- package/dist/stories/dynamic-editable.stories.js.map +0 -1
- package/dist/stories/empty-sorters.stories.d.ts +0 -25
- package/dist/stories/empty-sorters.stories.js +0 -162
- package/dist/stories/empty-sorters.stories.js.map +0 -1
- package/dist/stories/explicit-fetch.stories.d.ts +0 -25
- package/dist/stories/explicit-fetch.stories.js +0 -166
- package/dist/stories/explicit-fetch.stories.js.map +0 -1
- package/dist/stories/fixed-column.stories.d.ts +0 -26
- package/dist/stories/fixed-column.stories.js +0 -383
- package/dist/stories/fixed-column.stories.js.map +0 -1
- package/dist/stories/grid-setting.stories.d.ts +0 -47
- package/dist/stories/grid-setting.stories.js +0 -453
- package/dist/stories/grid-setting.stories.js.map +0 -1
- package/dist/stories/grist-modes.stories.d.ts +0 -37
- package/dist/stories/grist-modes.stories.js +0 -416
- package/dist/stories/grist-modes.stories.js.map +0 -1
- package/dist/stories/group-header.stories.d.ts +0 -26
- package/dist/stories/group-header.stories.js +0 -410
- package/dist/stories/group-header.stories.js.map +0 -1
- package/dist/stories/record-view.stories.d.ts +0 -24
- package/dist/stories/record-view.stories.js +0 -125
- package/dist/stories/record-view.stories.js.map +0 -1
- package/dist/stories/textarea.stories.d.ts +0 -37
- package/dist/stories/textarea.stories.js +0 -229
- package/dist/stories/textarea.stories.js.map +0 -1
- package/dist/stories/tree-column-with-checkbox.stories.d.ts +0 -26
- package/dist/stories/tree-column-with-checkbox.stories.js +0 -267
- package/dist/stories/tree-column-with-checkbox.stories.js.map +0 -1
- package/dist/stories/tree-column.stories.d.ts +0 -26
- package/dist/stories/tree-column.stories.js +0 -266
- package/dist/stories/tree-column.stories.js.map +0 -1
- package/index.ts +0 -1
@@ -1,266 +0,0 @@
|
|
1
|
-
import '../src/index.js';
|
2
|
-
import '../src/filters/filters-form.js';
|
3
|
-
import '../src/sorters/sorters-control.js';
|
4
|
-
import '../src/record-view/ox-record-creator.js';
|
5
|
-
import '@operato/popup/ox-popup-list.js';
|
6
|
-
import '@material/web/icon/icon.js';
|
7
|
-
import { html } from 'lit';
|
8
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
9
|
-
import { CommonHeaderStyles, CommonGristStyles } from '@operato/styles';
|
10
|
-
const fetchHandler = async ({ page, limit }) => {
|
11
|
-
var total = 120993;
|
12
|
-
var start = (page - 1) * limit;
|
13
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
14
|
-
var records = Array(limit * page > total ? total % limit : limit)
|
15
|
-
.fill('')
|
16
|
-
.map((item, idx) => {
|
17
|
-
return {
|
18
|
-
id: String(idx),
|
19
|
-
name: idx % 2 ? `shnam-${start + idx + 1}` : `heartyoh-${start + idx + 1}`,
|
20
|
-
description: idx % 2 ? `hatiolabmanager${start + idx + 1}1234567890` : `hatiosea manager-${start + idx + 1}`,
|
21
|
-
active: Math.round(Math.random() * 2) % 2 ? true : false,
|
22
|
-
accval: Math.random(),
|
23
|
-
createdAt: Date.now(),
|
24
|
-
updatedAt: Date.now(),
|
25
|
-
children: [
|
26
|
-
...Array.from({ length: 3 }, (_, idx) => {
|
27
|
-
return {
|
28
|
-
id: `sub:${idx}`,
|
29
|
-
name: 'subitem' + idx,
|
30
|
-
description: 'sub items...',
|
31
|
-
active: Math.round(Math.random() * 2) % 2 ? true : false,
|
32
|
-
accval: Math.random(),
|
33
|
-
children: [
|
34
|
-
...Array.from({ length: 3 }, (_, idx2) => {
|
35
|
-
return {
|
36
|
-
id: `sub-sub:${idx}:${idx2}`,
|
37
|
-
name: 'sub-subitem:' + idx2,
|
38
|
-
description: 'sub sub items...',
|
39
|
-
active: Math.round(Math.random() * 2) % 2 ? true : false,
|
40
|
-
accval: Math.random(),
|
41
|
-
children: [],
|
42
|
-
createdAt: Date.now(),
|
43
|
-
updatedAt: Date.now()
|
44
|
-
};
|
45
|
-
})
|
46
|
-
],
|
47
|
-
createdAt: Date.now(),
|
48
|
-
updatedAt: Date.now()
|
49
|
-
};
|
50
|
-
})
|
51
|
-
]
|
52
|
-
};
|
53
|
-
});
|
54
|
-
return {
|
55
|
-
total,
|
56
|
-
records
|
57
|
-
};
|
58
|
-
};
|
59
|
-
const config = {
|
60
|
-
list: {
|
61
|
-
thumbnail: 'thumbnail',
|
62
|
-
fields: ['name', 'description'],
|
63
|
-
details: ['role', 'email']
|
64
|
-
},
|
65
|
-
columns: [
|
66
|
-
{
|
67
|
-
type: 'gutter',
|
68
|
-
gutterName: 'dirty',
|
69
|
-
fixed: true
|
70
|
-
},
|
71
|
-
// {
|
72
|
-
// type: 'gutter',
|
73
|
-
// gutterName: 'sequence',
|
74
|
-
// fixed: true
|
75
|
-
// },
|
76
|
-
{
|
77
|
-
type: 'tree',
|
78
|
-
name: 'name',
|
79
|
-
label: true,
|
80
|
-
header: 'name',
|
81
|
-
record: {
|
82
|
-
editable: true,
|
83
|
-
options: {
|
84
|
-
selectable: false
|
85
|
-
}
|
86
|
-
},
|
87
|
-
filter: 'search',
|
88
|
-
sortable: true,
|
89
|
-
width: 200,
|
90
|
-
fixed: true,
|
91
|
-
handlers: {
|
92
|
-
contextmenu: 'contextmenu-tree-mutation'
|
93
|
-
}
|
94
|
-
},
|
95
|
-
{
|
96
|
-
type: 'gutter',
|
97
|
-
gutterName: 'row-selector',
|
98
|
-
multiple: true
|
99
|
-
},
|
100
|
-
{
|
101
|
-
type: 'string',
|
102
|
-
name: 'description',
|
103
|
-
header: 'description',
|
104
|
-
filter: 'search',
|
105
|
-
record: {
|
106
|
-
editable: true,
|
107
|
-
align: 'left'
|
108
|
-
},
|
109
|
-
width: 200
|
110
|
-
},
|
111
|
-
{
|
112
|
-
type: 'boolean',
|
113
|
-
name: 'active',
|
114
|
-
header: 'active',
|
115
|
-
record: {
|
116
|
-
editable: true
|
117
|
-
},
|
118
|
-
filter: true,
|
119
|
-
sortable: true,
|
120
|
-
width: 60
|
121
|
-
},
|
122
|
-
{
|
123
|
-
type: 'number',
|
124
|
-
name: 'accval',
|
125
|
-
label: true,
|
126
|
-
header: 'accval',
|
127
|
-
record: {
|
128
|
-
editable: true,
|
129
|
-
align: 'right'
|
130
|
-
},
|
131
|
-
accumulator: 'sum',
|
132
|
-
sortable: true,
|
133
|
-
width: 130
|
134
|
-
},
|
135
|
-
{
|
136
|
-
type: 'datetime',
|
137
|
-
name: 'updatedAt',
|
138
|
-
header: 'updated at',
|
139
|
-
record: {
|
140
|
-
editable: true,
|
141
|
-
defaultValue: {
|
142
|
-
name: 'now'
|
143
|
-
}
|
144
|
-
},
|
145
|
-
filter: 'between',
|
146
|
-
sortable: true,
|
147
|
-
width: 180
|
148
|
-
}
|
149
|
-
],
|
150
|
-
rows: {
|
151
|
-
appendable: false,
|
152
|
-
selectable: {
|
153
|
-
multiple: true
|
154
|
-
},
|
155
|
-
handlers: {
|
156
|
-
// focus: 'select-row-toggle'
|
157
|
-
},
|
158
|
-
classifier: function (record, rowIndex) {
|
159
|
-
const rate = record['rate'];
|
160
|
-
const emphasized = rate < 10 ? ['black', 'white'] : rate < 25 ? ['yellow', 'blue'] : rate < 40 ? ['cyan', 'red'] : undefined;
|
161
|
-
return {
|
162
|
-
emphasized
|
163
|
-
};
|
164
|
-
},
|
165
|
-
accumulator: true
|
166
|
-
},
|
167
|
-
sorters: [
|
168
|
-
{
|
169
|
-
name: 'name',
|
170
|
-
desc: true
|
171
|
-
},
|
172
|
-
{
|
173
|
-
name: 'email'
|
174
|
-
}
|
175
|
-
],
|
176
|
-
pagination: {
|
177
|
-
pages: [20, 30, 50, 100, 200]
|
178
|
-
},
|
179
|
-
tree: {
|
180
|
-
childrenProperty: 'children'
|
181
|
-
}
|
182
|
-
};
|
183
|
-
export default {
|
184
|
-
title: 'tree column',
|
185
|
-
component: 'ox-grist',
|
186
|
-
argTypes: {
|
187
|
-
config: { control: 'object' }
|
188
|
-
}
|
189
|
-
};
|
190
|
-
const Template = ({ config }) => html ` <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
191
|
-
|
192
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
193
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
194
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
195
|
-
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
196
|
-
|
197
|
-
<link
|
198
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
199
|
-
rel="stylesheet"
|
200
|
-
/>
|
201
|
-
<link
|
202
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
203
|
-
rel="stylesheet"
|
204
|
-
/>
|
205
|
-
<link
|
206
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
207
|
-
rel="stylesheet"
|
208
|
-
/>
|
209
|
-
|
210
|
-
<style>
|
211
|
-
${MDTypeScaleStyles.cssText}
|
212
|
-
</style>
|
213
|
-
|
214
|
-
<style>
|
215
|
-
${CommonGristStyles.cssText}
|
216
|
-
${CommonHeaderStyles.cssText}
|
217
|
-
</style>
|
218
|
-
|
219
|
-
<style>
|
220
|
-
ox-grist {
|
221
|
-
height: 600px;
|
222
|
-
}
|
223
|
-
|
224
|
-
ox-filters-form {
|
225
|
-
flex: 1;
|
226
|
-
}
|
227
|
-
</style>
|
228
|
-
|
229
|
-
<ox-grist
|
230
|
-
mode="GRID"
|
231
|
-
.config=${config}
|
232
|
-
.fetchHandler=${fetchHandler}
|
233
|
-
@filters-change=${(e) => console.log('filters', e.target.filters)}
|
234
|
-
>
|
235
|
-
<div slot="headroom" class="header">
|
236
|
-
<div class="filters">
|
237
|
-
<ox-filters-form autofocus></ox-filters-form>
|
238
|
-
|
239
|
-
<div id="sorters">
|
240
|
-
Sort
|
241
|
-
<md-icon
|
242
|
-
@click=${(e) => {
|
243
|
-
const target = e.currentTarget;
|
244
|
-
target.closest('#sorters').querySelector('#sorter-control').open({
|
245
|
-
right: 0,
|
246
|
-
top: target.offsetTop + target.offsetHeight
|
247
|
-
});
|
248
|
-
}}
|
249
|
-
>expand_more</md-icon
|
250
|
-
>
|
251
|
-
<ox-popup id="sorter-control">
|
252
|
-
<ox-sorters-control> </ox-sorters-control>
|
253
|
-
</ox-popup>
|
254
|
-
</div>
|
255
|
-
|
256
|
-
<ox-record-creator id="add" light-popup>
|
257
|
-
<button><md-icon>add</md-icon></button>
|
258
|
-
</ox-record-creator>
|
259
|
-
</div>
|
260
|
-
</div>
|
261
|
-
</ox-grist>`;
|
262
|
-
export const Regular = Template.bind({});
|
263
|
-
Regular.args = {
|
264
|
-
config
|
265
|
-
};
|
266
|
-
//# sourceMappingURL=tree-column.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"tree-column.stories.js","sourceRoot":"","sources":["../../stories/tree-column.stories.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,gCAAgC,CAAA;AACvC,OAAO,mCAAmC,CAAA;AAC1C,OAAO,yCAAyC,CAAA;AAChD,OAAO,iCAAiC,CAAA;AACxC,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAA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EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;KAC9B;IACD,IAAI,EAAE;QACJ,gBAAgB,EAAE,UAAU;KAC7B;CACF,CAAA;AAED,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC9B;CACF,CAAA;AAYD,MAAM,QAAQ,GAAoB,CAAC,EAAE,MAAM,EAAY,EAAE,EAAE,CACzD,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;QAqBE,iBAAiB,CAAC,OAAO;;;;QAIzB,iBAAiB,CAAC,OAAO;QACzB,kBAAkB,CAAC,OAAO;;;;;;;;;;;;;;;gBAelB,MAAM;sBACA,YAAY;wBACV,CAAC,CAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAG,CAAC,CAAC,MAAc,CAAC,OAAO,CAAC;;;;;;;;;uBAShE,CAAC,CAAQ,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,CAAC,CAAC,aAA4B,CAC5C;IAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAE,CAAC,aAAa,CAAC,iBAAiB,CAAS,CAAC,IAAI,CAAC;QAC1E,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,YAAY;KAC5C,CAAC,CAAA;AACJ,CAAC;;;;;;;;;;;;;gBAaC,CAAA;AAEhB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM;CACP,CAAA","sourcesContent":["import '../src/index.js'\nimport '../src/filters/filters-form.js'\nimport '../src/sorters/sorters-control.js'\nimport '../src/record-view/ox-record-creator.js'\nimport '@operato/popup/ox-popup-list.js'\nimport '@material/web/icon/icon.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nimport { CommonHeaderStyles, CommonGristStyles } from '@operato/styles'\n\nimport {\n ColumnConfig,\n FetchHandler,\n GristClassifier,\n GristEventHandlerSet,\n GristRecord,\n ValidationCallback\n} from '../src/types.js'\n\nconst fetchHandler: FetchHandler = async ({ page, limit }) => {\n var total = 120993\n var start = (page! - 1) * limit!\n\n await new Promise(resolve => setTimeout(resolve, 500))\n\n var records = Array(limit! * page! > total ? total % limit! : limit)\n .fill('')\n .map((item, idx) => {\n return {\n id: String(idx),\n name: idx % 2 ? `shnam-${start + idx + 1}` : `heartyoh-${start + idx + 1}`,\n description: idx % 2 ? `hatiolabmanager${start + idx + 1}1234567890` : `hatiosea manager-${start + idx + 1}`,\n active: Math.round(Math.random() * 2) % 2 ? true : false,\n accval: Math.random(),\n createdAt: Date.now(),\n updatedAt: Date.now(),\n children: [\n ...Array.from({ length: 3 }, (_, idx) => {\n return {\n id: `sub:${idx}`,\n name: 'subitem' + idx,\n description: 'sub items...',\n active: Math.round(Math.random() * 2) % 2 ? true : false,\n accval: Math.random(),\n children: [\n ...Array.from({ length: 3 }, (_, idx2) => {\n return {\n id: `sub-sub:${idx}:${idx2}`,\n name: 'sub-subitem:' + idx2,\n description: 'sub sub items...',\n active: Math.round(Math.random() * 2) % 2 ? true : false,\n accval: Math.random(),\n children: [],\n createdAt: Date.now(),\n updatedAt: Date.now()\n }\n })\n ],\n createdAt: Date.now(),\n updatedAt: Date.now()\n }\n })\n ]\n }\n })\n\n return {\n total,\n records\n }\n}\n\nconst config = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'description'],\n details: ['role', 'email']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty',\n fixed: true\n },\n // {\n // type: 'gutter',\n // gutterName: 'sequence',\n // fixed: true\n // },\n {\n type: 'tree',\n name: 'name',\n label: true,\n header: 'name',\n record: {\n editable: true,\n options: {\n selectable: false\n }\n },\n filter: 'search',\n sortable: true,\n width: 200,\n fixed: true,\n handlers: {\n contextmenu: 'contextmenu-tree-mutation'\n }\n },\n {\n type: 'gutter',\n gutterName: 'row-selector',\n multiple: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n filter: 'search',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'number',\n name: 'accval',\n label: true,\n header: 'accval',\n record: {\n editable: true,\n align: 'right'\n },\n accumulator: 'sum',\n sortable: true,\n width: 130\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true,\n defaultValue: {\n name: 'now'\n }\n },\n filter: 'between',\n sortable: true,\n width: 180\n }\n ],\n rows: {\n appendable: false,\n selectable: {\n multiple: true\n },\n handlers: {\n // focus: 'select-row-toggle'\n },\n classifier: function (record, rowIndex) {\n const rate = record['rate']\n const emphasized =\n rate < 10 ? ['black', 'white'] : rate < 25 ? ['yellow', 'blue'] : rate < 40 ? ['cyan', 'red'] : undefined\n return {\n emphasized\n }\n } as GristClassifier,\n accumulator: true\n },\n sorters: [\n {\n name: 'name',\n desc: true\n },\n {\n name: 'email'\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n },\n tree: {\n childrenProperty: 'children'\n }\n}\n\nexport default {\n title: 'tree column',\n component: 'ox-grist',\n argTypes: {\n config: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n config: object\n}\n\nconst Template: Story<ArgTypes> = ({ config }: ArgTypes) =>\n html` <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n <link href=\"/themes/grist-theme.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n ${CommonGristStyles.cssText}\n ${CommonHeaderStyles.cssText}\n </style>\n\n <style>\n ox-grist {\n height: 600px;\n }\n\n ox-filters-form {\n flex: 1;\n }\n </style>\n\n <ox-grist\n mode=\"GRID\"\n .config=${config}\n .fetchHandler=${fetchHandler}\n @filters-change=${(e: Event) => console.log('filters', (e.target as any).filters)}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n\n <div id=\"sorters\">\n Sort\n <md-icon\n @click=${(e: Event) => {\n const target = e.currentTarget as HTMLElement\n ;(target.closest('#sorters')!.querySelector('#sorter-control') as any).open({\n right: 0,\n top: target.offsetTop + target.offsetHeight\n })\n }}\n >expand_more</md-icon\n >\n <ox-popup id=\"sorter-control\">\n <ox-sorters-control> </ox-sorters-control>\n </ox-popup>\n </div>\n\n <ox-record-creator id=\"add\" light-popup>\n <button><md-icon>add</md-icon></button>\n </ox-record-creator>\n </div>\n </div>\n </ox-grist>`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n config\n}\n"]}
|
package/index.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './src/index.js'
|