@operato/data-grist 8.2.20 → 8.2.22
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 +16 -0
- package/dist/src/data-grid/data-grid-body-style.js +1 -1
- package/dist/src/data-grid/data-grid-body-style.js.map +1 -1
- package/dist/src/data-grid/data-grid-body.d.ts +15 -1
- package/dist/src/data-grid/data-grid-body.js +274 -49
- package/dist/src/data-grid/data-grid-body.js.map +1 -1
- package/dist/src/data-grid/event-handlers/data-grid-body-keydown-handler.js +36 -5
- package/dist/src/data-grid/event-handlers/data-grid-body-keydown-handler.js.map +1 -1
- package/dist/src/editors/ox-grist-editor.js +3 -0
- package/dist/src/editors/ox-grist-editor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/editors/ox-grist-editor-json5.d.ts +0 -8
- package/dist/src/editors/ox-grist-editor-json5.js +0 -66
- package/dist/src/editors/ox-grist-editor-json5.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-secret.d.ts +0 -5
- package/dist/src/editors/ox-grist-editor-secret.js +0 -23
- package/dist/src/editors/ox-grist-editor-secret.js.map +0 -1
- package/dist/src/editors/ox-grist-editor-timezone.d.ts +0 -6
- package/dist/src/editors/ox-grist-editor-timezone.js +0 -41
- package/dist/src/editors/ox-grist-editor-timezone.js.map +0 -1
- package/dist/src/editors/ox-popup-code-input.d.ts +0 -14
- package/dist/src/editors/ox-popup-code-input.js +0 -78
- package/dist/src/editors/ox-popup-code-input.js.map +0 -1
- package/dist/src/renderers/ox-grist-renderer-secret.d.ts +0 -2
- package/dist/src/renderers/ox-grist-renderer-secret.js +0 -77
- package/dist/src/renderers/ox-grist-renderer-secret.js.map +0 -1
- package/dist/stories/append-position.stories.d.ts +0 -8
- package/dist/stories/append-position.stories.js +0 -183
- package/dist/stories/append-position.stories.js.map +0 -1
- package/dist/stories/secret.stories.d.ts +0 -37
- package/dist/stories/secret.stories.js +0 -219
- package/dist/stories/secret.stories.js.map +0 -1
|
@@ -1,219 +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 = 5;
|
|
12
|
-
var start = (page - 1) * limit;
|
|
13
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
14
|
-
return {
|
|
15
|
-
total,
|
|
16
|
-
records: Array(limit * page > total ? total % limit : limit)
|
|
17
|
-
.fill('')
|
|
18
|
-
.map((item, idx) => {
|
|
19
|
-
return {
|
|
20
|
-
id: String(start + idx + 1),
|
|
21
|
-
name: `User ${start + idx + 1}`,
|
|
22
|
-
email: `user${start + idx + 1}@example.com`,
|
|
23
|
-
apiKey: `sk-${Math.random().toString(36).substring(2, 15)}`,
|
|
24
|
-
password: `password${start + idx + 1}`,
|
|
25
|
-
token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.${Math.random().toString(36).substring(2, 20)}`,
|
|
26
|
-
createdAt: Date.now(),
|
|
27
|
-
updatedAt: Date.now()
|
|
28
|
-
};
|
|
29
|
-
})
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
const config = {
|
|
33
|
-
list: {
|
|
34
|
-
thumbnail: 'thumbnail',
|
|
35
|
-
fields: ['name', 'email'],
|
|
36
|
-
details: ['apiKey', 'password', 'token']
|
|
37
|
-
},
|
|
38
|
-
columns: [
|
|
39
|
-
{
|
|
40
|
-
type: 'gutter',
|
|
41
|
-
gutterName: 'dirty'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: 'gutter',
|
|
45
|
-
gutterName: 'sequence'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: 'gutter',
|
|
49
|
-
gutterName: 'row-selector',
|
|
50
|
-
multiple: true
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'gutter',
|
|
54
|
-
gutterName: 'button',
|
|
55
|
-
icon: 'add',
|
|
56
|
-
title: 'add',
|
|
57
|
-
handlers: {
|
|
58
|
-
click: 'record-copy'
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
type: 'string',
|
|
63
|
-
name: 'id',
|
|
64
|
-
hidden: true
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: 'string',
|
|
68
|
-
name: 'name',
|
|
69
|
-
label: true,
|
|
70
|
-
header: 'Name',
|
|
71
|
-
record: {
|
|
72
|
-
editable: true
|
|
73
|
-
},
|
|
74
|
-
filter: 'search',
|
|
75
|
-
sortable: true,
|
|
76
|
-
width: 150
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
type: 'email',
|
|
80
|
-
name: 'email',
|
|
81
|
-
header: 'Email',
|
|
82
|
-
record: {
|
|
83
|
-
editable: true
|
|
84
|
-
},
|
|
85
|
-
filter: 'search',
|
|
86
|
-
sortable: true,
|
|
87
|
-
width: 200
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
type: 'secret',
|
|
91
|
-
name: 'apiKey',
|
|
92
|
-
header: 'API Key',
|
|
93
|
-
record: {
|
|
94
|
-
editable: true
|
|
95
|
-
},
|
|
96
|
-
filter: 'search',
|
|
97
|
-
sortable: true,
|
|
98
|
-
width: 250
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
type: 'secret',
|
|
102
|
-
name: 'password',
|
|
103
|
-
header: 'Password',
|
|
104
|
-
record: {
|
|
105
|
-
editable: false
|
|
106
|
-
},
|
|
107
|
-
filter: 'search',
|
|
108
|
-
sortable: true,
|
|
109
|
-
width: 150
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
type: 'secret',
|
|
113
|
-
name: 'token',
|
|
114
|
-
header: 'Access Token',
|
|
115
|
-
record: {
|
|
116
|
-
editable: true
|
|
117
|
-
},
|
|
118
|
-
filter: 'search',
|
|
119
|
-
sortable: true,
|
|
120
|
-
width: 300
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
type: 'date',
|
|
124
|
-
name: 'createdAt',
|
|
125
|
-
header: 'Created',
|
|
126
|
-
record: {
|
|
127
|
-
editable: true
|
|
128
|
-
},
|
|
129
|
-
sortable: true,
|
|
130
|
-
width: 120
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: 'date',
|
|
134
|
-
name: 'updatedAt',
|
|
135
|
-
header: 'Updated',
|
|
136
|
-
record: {
|
|
137
|
-
editable: true
|
|
138
|
-
},
|
|
139
|
-
sortable: true,
|
|
140
|
-
width: 120
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
pagination: {
|
|
144
|
-
pages: [10, 20, 50, 100]
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
export default {
|
|
148
|
-
title: 'Data-grist/secret editor in ox-grist',
|
|
149
|
-
component: 'ox-grist',
|
|
150
|
-
argTypes: {
|
|
151
|
-
config: { control: 'object' },
|
|
152
|
-
mode: { control: 'select', options: ['GRID', 'LIST', 'CARD'] },
|
|
153
|
-
urlParamsSensitive: { control: 'boolean' }
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const Template = ({ config, mode = 'GRID', urlParamsSensitive = false, fetchHandler }) => html ` <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
157
|
-
|
|
158
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
|
159
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
|
160
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
161
|
-
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
162
|
-
|
|
163
|
-
<link
|
|
164
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
165
|
-
rel="stylesheet"
|
|
166
|
-
/>
|
|
167
|
-
<link
|
|
168
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
169
|
-
rel="stylesheet"
|
|
170
|
-
/>
|
|
171
|
-
<link
|
|
172
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
173
|
-
rel="stylesheet"
|
|
174
|
-
/>
|
|
175
|
-
|
|
176
|
-
<style>
|
|
177
|
-
${MDTypeScaleStyles.cssText}
|
|
178
|
-
</style>
|
|
179
|
-
|
|
180
|
-
<style>
|
|
181
|
-
${CommonGristStyles.cssText} ${CommonHeaderStyles.cssText} #add {
|
|
182
|
-
margin-left: auto;
|
|
183
|
-
}
|
|
184
|
-
</style>
|
|
185
|
-
|
|
186
|
-
<style>
|
|
187
|
-
ox-grist {
|
|
188
|
-
height: 600px;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
ox-filters-form {
|
|
192
|
-
flex: 1;
|
|
193
|
-
}
|
|
194
|
-
</style>
|
|
195
|
-
|
|
196
|
-
<ox-grist
|
|
197
|
-
.config=${config}
|
|
198
|
-
.mode=${mode}
|
|
199
|
-
.fetchHandler=${fetchHandler}
|
|
200
|
-
?url-params-sensitive=${urlParamsSensitive}
|
|
201
|
-
@filters-change=${(e) => console.log('filters', e.target.filters)}
|
|
202
|
-
>
|
|
203
|
-
<div slot="headroom" class="header">
|
|
204
|
-
<div class="filters">
|
|
205
|
-
<ox-filters-form autofocus></ox-filters-form>
|
|
206
|
-
|
|
207
|
-
<ox-record-creator id="add" light-popup>
|
|
208
|
-
<button><md-icon>add</md-icon></button>
|
|
209
|
-
</ox-record-creator>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
</ox-grist>`;
|
|
213
|
-
export const SecretEditor = Template.bind({});
|
|
214
|
-
SecretEditor.args = {
|
|
215
|
-
config,
|
|
216
|
-
fetchHandler,
|
|
217
|
-
mode: 'GRID'
|
|
218
|
-
};
|
|
219
|
-
//# sourceMappingURL=secret.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secret.stories.js","sourceRoot":"","sources":["../../stories/secret.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,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAYvE,MAAM,YAAY,GAAiB,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAe,EAAE,EAAE;IACxE,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,GAAG,CAAC,IAAK,GAAG,CAAC,CAAC,GAAG,KAAM,CAAA;IAEhC,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;IAEtD,OAAO;QACL,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,KAAM,GAAG,IAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,KAAM,CAAC,CAAC,CAAC,KAAK,CAAC;aAC5D,IAAI,CAAC,EAAE,CAAC;aACR,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YACjB,O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EAAE,MAAM;CACb,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 FetchOption,\n GristClassifier,\n GristEventHandlerSet,\n GristRecord,\n ValidationCallback\n} from '../src/types.js'\n\nconst fetchHandler: FetchHandler = async ({ page, limit }: FetchOption) => {\n var total = 5\n var start = (page! - 1) * limit!\n\n await new Promise(resolve => setTimeout(resolve, 500))\n\n return {\n total,\n records: Array(limit! * page! > total ? total % limit! : limit)\n .fill('')\n .map((item, idx) => {\n return {\n id: String(start + idx + 1),\n name: `User ${start + idx + 1}`,\n email: `user${start + idx + 1}@example.com`,\n apiKey: `sk-${Math.random().toString(36).substring(2, 15)}`,\n password: `password${start + idx + 1}`,\n token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.${Math.random().toString(36).substring(2, 20)}`,\n createdAt: Date.now(),\n updatedAt: Date.now()\n }\n })\n }\n}\n\nconst config = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'email'],\n details: ['apiKey', 'password', 'token']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'row-selector',\n multiple: true\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n title: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n label: true,\n header: 'Name',\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'email',\n name: 'email',\n header: 'Email',\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n {\n type: 'secret',\n name: 'apiKey',\n header: 'API Key',\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 250\n },\n {\n type: 'secret',\n name: 'password',\n header: 'Password',\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'secret',\n name: 'token',\n header: 'Access Token',\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 300\n },\n {\n type: 'date',\n name: 'createdAt',\n header: 'Created',\n record: {\n editable: true\n },\n sortable: true,\n width: 120\n },\n {\n type: 'date',\n name: 'updatedAt',\n header: 'Updated',\n record: {\n editable: true\n },\n sortable: true,\n width: 120\n }\n ],\n pagination: {\n pages: [10, 20, 50, 100]\n }\n}\n\nexport default {\n title: 'Data-grist/secret editor in ox-grist',\n component: 'ox-grist',\n argTypes: {\n config: { control: 'object' },\n mode: { control: 'select', options: ['GRID', 'LIST', 'CARD'] },\n urlParamsSensitive: { control: 'boolean' }\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 mode: 'GRID' | 'LIST' | 'CARD'\n urlParamsSensitive: boolean\n fetchHandler: FetchHandler\n}\n\nconst Template: Story<ArgTypes> = ({ config, mode = 'GRID', urlParamsSensitive = false, fetchHandler }: 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} ${CommonHeaderStyles.cssText} #add {\n margin-left: auto;\n }\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 .config=${config}\n .mode=${mode}\n .fetchHandler=${fetchHandler}\n ?url-params-sensitive=${urlParamsSensitive}\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 <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 SecretEditor = Template.bind({})\nSecretEditor.args = {\n config,\n fetchHandler,\n mode: 'GRID'\n}\n"]}
|