@operato/attribute 1.2.41

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.
Files changed (68) hide show
  1. package/.editorconfig +29 -0
  2. package/.storybook/main.js +3 -0
  3. package/.storybook/server.mjs +8 -0
  4. package/CHANGELOG.md +11 -0
  5. package/README.md +75 -0
  6. package/dist/src/grist-editor/index.d.ts +1 -0
  7. package/dist/src/grist-editor/index.js +7 -0
  8. package/dist/src/grist-editor/index.js.map +1 -0
  9. package/dist/src/grist-editor/ox-grist-editor-attribute.d.ts +12 -0
  10. package/dist/src/grist-editor/ox-grist-editor-attribute.js +81 -0
  11. package/dist/src/grist-editor/ox-grist-editor-attribute.js.map +1 -0
  12. package/dist/src/grist-editor/ox-grist-editor-attributes.d.ts +12 -0
  13. package/dist/src/grist-editor/ox-grist-editor-attributes.js +81 -0
  14. package/dist/src/grist-editor/ox-grist-editor-attributes.js.map +1 -0
  15. package/dist/src/grist-editor/ox-popup-attribute.d.ts +13 -0
  16. package/dist/src/grist-editor/ox-popup-attribute.js +92 -0
  17. package/dist/src/grist-editor/ox-popup-attribute.js.map +1 -0
  18. package/dist/src/grist-editor/ox-popup-attributes.d.ts +13 -0
  19. package/dist/src/grist-editor/ox-popup-attributes.js +92 -0
  20. package/dist/src/grist-editor/ox-popup-attributes.js.map +1 -0
  21. package/dist/src/index.d.ts +1 -0
  22. package/dist/src/index.js +2 -0
  23. package/dist/src/index.js.map +1 -0
  24. package/dist/src/ox-attribute-form.d.ts +14 -0
  25. package/dist/src/ox-attribute-form.js +199 -0
  26. package/dist/src/ox-attribute-form.js.map +1 -0
  27. package/dist/src/ox-attribute-view.d.ts +12 -0
  28. package/dist/src/ox-attribute-view.js +176 -0
  29. package/dist/src/ox-attribute-view.js.map +1 -0
  30. package/dist/src/types.d.ts +23 -0
  31. package/dist/src/types.js +2 -0
  32. package/dist/src/types.js.map +1 -0
  33. package/dist/stories/ox-attribute-form.stories.d.ts +18 -0
  34. package/dist/stories/ox-attribute-form.stories.js +80 -0
  35. package/dist/stories/ox-attribute-form.stories.js.map +1 -0
  36. package/dist/stories/ox-attribute-view.stories.d.ts +18 -0
  37. package/dist/stories/ox-attribute-view.stories.js +73 -0
  38. package/dist/stories/ox-attribute-view.stories.js.map +1 -0
  39. package/dist/stories/ox-grist-editor-attribute.stories.d.ts +25 -0
  40. package/dist/stories/ox-grist-editor-attribute.stories.js +310 -0
  41. package/dist/stories/ox-grist-editor-attribute.stories.js.map +1 -0
  42. package/dist/stories/ox-grist-editor-attributes.stories.d.ts +25 -0
  43. package/dist/stories/ox-grist-editor-attributes.stories.js +310 -0
  44. package/dist/stories/ox-grist-editor-attributes.stories.js.map +1 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -0
  46. package/package.json +106 -0
  47. package/src/grist-editor/index.ts +10 -0
  48. package/src/grist-editor/ox-grist-editor-attributes.ts +94 -0
  49. package/src/grist-editor/ox-popup-attributes.ts +93 -0
  50. package/src/index.ts +1 -0
  51. package/src/ox-attribute-form.ts +218 -0
  52. package/src/ox-attribute-view.ts +182 -0
  53. package/src/types.ts +23 -0
  54. package/stories/ox-attribute-form.stories.ts +94 -0
  55. package/stories/ox-attribute-view.stories.ts +87 -0
  56. package/stories/ox-grist-editor-attributes.stories.ts +328 -0
  57. package/themes/app-theme.css +142 -0
  58. package/themes/form-theme.css +75 -0
  59. package/themes/grist-theme.css +194 -0
  60. package/themes/oops-theme.css +26 -0
  61. package/themes/report-theme.css +47 -0
  62. package/translations/en.json +4 -0
  63. package/translations/ko.json +4 -0
  64. package/translations/ms.json +4 -0
  65. package/translations/zh.json +1 -0
  66. package/tsconfig.json +23 -0
  67. package/web-dev-server.config.mjs +27 -0
  68. package/web-test-runner.config.mjs +41 -0
@@ -0,0 +1,25 @@
1
+ import '@material/mwc-icon';
2
+ import '@operato/property-editor/ox-property-editor-checkbox.js';
3
+ import '@operato/property-editor/ox-property-editor-number.js';
4
+ import '@operato/property-editor/ox-property-editor-string.js';
5
+ import '@operato/property-editor/ox-property-editor-options.js';
6
+ import '@operato/property-editor/ox-properties-dynamic-view.js';
7
+ import '@operato/data-grist/ox-filters-form.js';
8
+ import '@operato/data-grist/ox-sorters-control.js';
9
+ import '@operato/grist-editor';
10
+ import '../src/grist-editor/index.js';
11
+ import { TemplateResult } from 'lit';
12
+ declare const _default: {
13
+ title: string;
14
+ component: string;
15
+ argTypes: {};
16
+ };
17
+ export default _default;
18
+ interface Story<T> {
19
+ (args: T): TemplateResult;
20
+ args?: Partial<T>;
21
+ argTypes?: Record<string, unknown>;
22
+ }
23
+ interface ArgTypes {
24
+ }
25
+ export declare const Regular: Story<ArgTypes>;
@@ -0,0 +1,310 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import '@operato/property-editor/ox-property-editor-checkbox.js';
4
+ import '@operato/property-editor/ox-property-editor-number.js';
5
+ import '@operato/property-editor/ox-property-editor-string.js';
6
+ import '@operato/property-editor/ox-property-editor-options.js';
7
+ import '@operato/property-editor/ox-properties-dynamic-view.js';
8
+ import '@operato/data-grist/ox-filters-form.js';
9
+ import '@operato/data-grist/ox-sorters-control.js';
10
+ import '@operato/grist-editor'; /* regiester grist editors */
11
+ /* set grist-editors */
12
+ import '../src/grist-editor/index.js';
13
+ import { css, html, LitElement } from 'lit';
14
+ import { state } from 'lit/decorators.js';
15
+ // import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'
16
+ // import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'
17
+ // import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
18
+ // // import { OxGristRendererCrontab } from '@operato/grist-editor/ox-grist-renderer-crontab.js'
19
+ // import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'
20
+ import { i18next } from '@operato/i18n';
21
+ import { OxPropertyEditor } from '@operato/property-editor';
22
+ import { CommonGristStyles } from '@operato/styles';
23
+ OxPropertyEditor.register({
24
+ number: 'ox-property-editor-number',
25
+ string: 'ox-property-editor-string',
26
+ boolean: 'ox-property-editor-checkbox',
27
+ options: 'ox-property-editor-options'
28
+ });
29
+ // registerEditor('parameters', OxGristEditorParameters)
30
+ // registerEditor('crontab', OxGristEditorCrontab)
31
+ // registerEditor('value-map', OxGristEditorValueMap)
32
+ // registerEditor('partition-keys', OxGristEditorPartitionKeys)
33
+ const fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }) => {
34
+ var total = 10;
35
+ var start = (page - 1) * limit;
36
+ return {
37
+ total,
38
+ records: Array(limit * page > total ? total % limit : limit)
39
+ .fill('')
40
+ .map((item, idx) => {
41
+ return {
42
+ id: idx,
43
+ entity: `entity-${start + idx + 1}`,
44
+ description: `description-${start + idx + 1}`,
45
+ attribute: {
46
+ brn: '1234567890-1234-1',
47
+ address: '경기도 성남시 분당구.',
48
+ credit: '최우수'
49
+ }
50
+ };
51
+ })
52
+ };
53
+ };
54
+ class GristDemo extends LitElement {
55
+ constructor() {
56
+ super(...arguments);
57
+ this.mode = 'CARD';
58
+ this.config = {
59
+ list: { fields: ['name', 'description', 'active'] },
60
+ columns: [
61
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
62
+ {
63
+ type: 'gutter',
64
+ gutterName: 'button',
65
+ icon: 'add',
66
+ handlers: {
67
+ click: 'record-copy'
68
+ }
69
+ },
70
+ { type: 'gutter', gutterName: 'sequence' },
71
+ {
72
+ type: 'gutter',
73
+ gutterName: 'button',
74
+ icon: 'arrow_upward',
75
+ handlers: {
76
+ click: 'move-up'
77
+ }
78
+ },
79
+ {
80
+ type: 'gutter',
81
+ gutterName: 'button',
82
+ icon: 'arrow_downward',
83
+ handlers: {
84
+ click: 'move-down'
85
+ }
86
+ },
87
+ {
88
+ type: 'string',
89
+ name: 'id',
90
+ hidden: true
91
+ },
92
+ {
93
+ type: 'string',
94
+ name: 'entity',
95
+ header: i18next.t('field.entity'),
96
+ record: {
97
+ editable: true
98
+ },
99
+ width: 140
100
+ },
101
+ {
102
+ type: 'string',
103
+ name: 'description',
104
+ header: i18next.t('field.description'),
105
+ record: {
106
+ editable: true
107
+ },
108
+ width: 180
109
+ },
110
+ {
111
+ type: 'select',
112
+ name: 'type',
113
+ header: i18next.t('field.type'),
114
+ record: {
115
+ options: ['', 'number', 'text', 'select', 'boolean', 'file'],
116
+ editable: true
117
+ },
118
+ width: 120
119
+ },
120
+ {
121
+ type: 'attributes',
122
+ name: 'attributes',
123
+ header: i18next.t('field.attributes'),
124
+ record: {
125
+ editable: true,
126
+ options: {
127
+ attributeSet: {
128
+ entity: 'Domain',
129
+ description: 'Attributes for Domain Entity',
130
+ items: [
131
+ {
132
+ name: '등록정보',
133
+ description: '회사 등록 정보',
134
+ tag: 'brn',
135
+ type: 'text',
136
+ active: true,
137
+ hidden: false
138
+ },
139
+ {
140
+ name: '주소',
141
+ description: '회사 주소',
142
+ tag: 'address',
143
+ type: 'text',
144
+ active: true,
145
+ hidden: false
146
+ },
147
+ {
148
+ name: '신용도',
149
+ description: '회사의 신용도',
150
+ tag: 'credit',
151
+ type: 'select',
152
+ options: {
153
+ options: [
154
+ { text: '최우수', value: '최우수' },
155
+ { text: '우수', value: '우수' },
156
+ { text: '보통', value: '보통' },
157
+ { text: '미달', value: '미달' }
158
+ ]
159
+ },
160
+ active: true,
161
+ hidden: false
162
+ },
163
+ {
164
+ name: '정보파일',
165
+ description: '참조 첨부 파일.',
166
+ tag: 'file',
167
+ type: 'file',
168
+ active: true,
169
+ hidden: false
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ },
175
+ width: 200
176
+ }
177
+ ],
178
+ rows: {
179
+ selectable: {
180
+ multiple: true
181
+ }
182
+ },
183
+ pagination: {
184
+ infinite: true
185
+ },
186
+ sorters: [
187
+ {
188
+ name: 'sequence'
189
+ }
190
+ ]
191
+ };
192
+ }
193
+ get grist() {
194
+ return this.renderRoot.querySelector('ox-grist');
195
+ }
196
+ render() {
197
+ const mode = this.mode || 'CARD';
198
+ return html `
199
+ <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
200
+ <div id="filters" slot="headroom">
201
+ <ox-filters-form @filters-change=${(e) => console.log('changed', e.detail)}></ox-filters-form>
202
+ </div>
203
+
204
+ <div slot="headroom" id="headroom">
205
+ <div id="modes">
206
+ <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
207
+ <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
208
+ <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
209
+ </div>
210
+ </div>
211
+ </ox-grist>
212
+ `;
213
+ }
214
+ }
215
+ GristDemo.styles = [
216
+ CommonGristStyles,
217
+ css `
218
+ :host {
219
+ display: flex;
220
+ flex-direction: column;
221
+ }
222
+
223
+ #tailer {
224
+ display: flex;
225
+ flex-direction: row;
226
+ margin: 0 var(--margin-default);
227
+ }
228
+
229
+ #tailer a {
230
+ padding: 0 var(--padding-default) 0 var(--padding-default);
231
+ margin: 0 var(--margin-narrow);
232
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
233
+ font-size: var(--fontsize-default);
234
+ color: var(--primary-color);
235
+ }
236
+ `
237
+ ];
238
+ __decorate([
239
+ state()
240
+ ], GristDemo.prototype, "mode", void 0);
241
+ customElements.define('ox-attribute', GristDemo);
242
+ export default {
243
+ title: 'ox-grist-editor-attributes',
244
+ component: 'ox-grist-editor-attributes',
245
+ argTypes: {}
246
+ };
247
+ const Template = ({}) => html `
248
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
249
+ <link href="/themes/app-theme.css" rel="stylesheet" />
250
+ <link href="/themes/oops-theme.css" rel="stylesheet" />
251
+ <link href="/themes/grist-theme.css" rel="stylesheet" />
252
+
253
+ <style>
254
+ [slot='headroom'] {
255
+ display: flex;
256
+ flex-direction: row;
257
+ align-items: center;
258
+ padding: var(--padding-default) var(--padding-wide);
259
+ border-top: 2px solid rgba(0, 0, 0, 0.2);
260
+ background-color: var(--theme-white-color);
261
+ box-shadow: var(--box-shadow);
262
+
263
+ --mdc-icon-size: 24px;
264
+ }
265
+ #sorters mwc-icon,
266
+ #modes mwc-icon {
267
+ --mdc-icon-size: 18px;
268
+ }
269
+ #sorters {
270
+ margin-left: auto;
271
+ margin-right: var(--margin-default);
272
+ padding-left: var(--padding-narrow);
273
+ border-bottom: var(--border-dark-color);
274
+ position: relative;
275
+ color: var(--secondary-color);
276
+ font-size: var(--fontsize-default);
277
+ user-select: none;
278
+ }
279
+
280
+ #sorters > * {
281
+ padding: var(--padding-narrow);
282
+ vertical-align: middle;
283
+ }
284
+
285
+ #filters {
286
+ display: flex;
287
+ justify-content: center;
288
+ align-items: center;
289
+ }
290
+
291
+ #filters * {
292
+ margin-right: var(--margin-default);
293
+ }
294
+
295
+ @media only screen and (max-width: 460px) {
296
+ #filters {
297
+ flex-direction: column;
298
+ }
299
+
300
+ #modes {
301
+ display: none;
302
+ }
303
+ }
304
+ </style>
305
+
306
+ <ox-attribute mode="LIST"></ox-attribute>
307
+ `;
308
+ export const Regular = Template.bind({});
309
+ Regular.args = {};
310
+ //# sourceMappingURL=ox-grist-editor-attribute.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-grist-editor-attribute.stories.js","sourceRoot":"","sources":["../../stories/ox-grist-editor-attribute.stories.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,yDAAyD,CAAA;AAChE,OAAO,uDAAuD,CAAA;AAC9D,OAAO,uDAAuD,CAAA;AAC9D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,wCAAwC,CAAA;AAC/C,OAAO,2CAA2C,CAAA;AAClD,OAAO,uBAAuB,CAAA,CAAC,6BAA6B;AAC5D,uBAAuB;AACvB,OAAO,8BAA8B,CAAA;AAErC,OAA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AC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;;;;KAI9E,CAAA;IACH,CAAC;;AAvLM,gBAAM,GAAG;IACd,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;KAmBF;CACF,AAtBY,CAsBZ;AAEQ;IAAR,KAAK,EAAE;uCAAsB;AAkKhC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;AAEhD,eAAe;IACb,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,4BAA4B;IACvC,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CACjD,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DH,CAAA;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@material/mwc-icon'\nimport '@operato/property-editor/ox-property-editor-checkbox.js'\nimport '@operato/property-editor/ox-property-editor-number.js'\nimport '@operato/property-editor/ox-property-editor-string.js'\nimport '@operato/property-editor/ox-property-editor-options.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/data-grist/ox-filters-form.js'\nimport '@operato/data-grist/ox-sorters-control.js'\nimport '@operato/grist-editor' /* regiester grist editors */\n/* set grist-editors */\nimport '../src/grist-editor/index.js'\n\nimport { css, html, LitElement, TemplateResult } from 'lit'\nimport { state } from 'lit/decorators.js'\n\nimport { FetchOption, GristRecord } from '@operato/data-grist'\n// import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'\n// import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'\n// import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\n// // import { OxGristRendererCrontab } from '@operato/grist-editor/ox-grist-renderer-crontab.js'\n// import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { CommonGristStyles } from '@operato/styles'\n\nOxPropertyEditor.register({\n number: 'ox-property-editor-number',\n string: 'ox-property-editor-string',\n boolean: 'ox-property-editor-checkbox',\n options: 'ox-property-editor-options'\n})\n\n// registerEditor('parameters', OxGristEditorParameters)\n// registerEditor('crontab', OxGristEditorCrontab)\n// registerEditor('value-map', OxGristEditorValueMap)\n// registerEditor('partition-keys', OxGristEditorPartitionKeys)\n\nconst fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) => {\n var total = 10\n var start = (page - 1) * limit\n\n return {\n total,\n records: Array(limit * page > total ? total % limit : limit)\n .fill('')\n .map((item, idx) => {\n return {\n id: idx,\n entity: `entity-${start + idx + 1}`,\n description: `description-${start + idx + 1}`,\n attribute: {\n brn: '1234567890-1234-1',\n address: '경기도 성남시 분당구.',\n credit: '최우수'\n }\n }\n })\n }\n}\n\nclass GristDemo extends LitElement {\n static styles = [\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n\n #tailer {\n display: flex;\n flex-direction: row;\n margin: 0 var(--margin-default);\n }\n\n #tailer a {\n padding: 0 var(--padding-default) 0 var(--padding-default);\n margin: 0 var(--margin-narrow);\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n font-size: var(--fontsize-default);\n color: var(--primary-color);\n }\n `\n ]\n\n @state() mode: String = 'CARD'\n\n get grist() {\n return this.renderRoot.querySelector('ox-grist')\n }\n\n config: any = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'entity',\n header: i18next.t('field.entity'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n options: ['', 'number', 'text', 'select', 'boolean', 'file'],\n editable: true\n },\n width: 120\n },\n {\n type: 'attributes',\n name: 'attributes',\n header: i18next.t('field.attributes'),\n record: {\n editable: true,\n options: {\n attributeSet: {\n entity: 'Domain',\n description: 'Attributes for Domain Entity',\n items: [\n {\n name: '등록정보',\n description: '회사 등록 정보',\n tag: 'brn',\n type: 'text',\n active: true,\n hidden: false\n },\n {\n name: '주소',\n description: '회사 주소',\n tag: 'address',\n type: 'text',\n active: true,\n hidden: false\n },\n {\n name: '신용도',\n description: '회사의 신용도',\n tag: 'credit',\n type: 'select',\n options: {\n options: [\n { text: '최우수', value: '최우수' },\n { text: '우수', value: '우수' },\n { text: '보통', value: '보통' },\n { text: '미달', value: '미달' }\n ]\n },\n active: true,\n hidden: false\n },\n {\n name: '정보파일',\n description: '참조 첨부 파일.',\n tag: 'file',\n type: 'file',\n active: true,\n hidden: false\n }\n ]\n }\n }\n },\n width: 200\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: [\n {\n name: 'sequence'\n }\n ]\n }\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>\n <div id=\"filters\" slot=\"headroom\">\n <ox-filters-form @filters-change=${(e: CustomEvent) => console.log('changed', e.detail)}></ox-filters-form>\n </div>\n\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"modes\">\n <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>\n </div>\n </div>\n </ox-grist>\n `\n }\n}\n\ncustomElements.define('ox-attribute', GristDemo)\n\nexport default {\n title: 'ox-grist-editor-attributes',\n component: 'ox-grist-editor-attributes',\n argTypes: {}\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {}\n\nconst Template: Story<ArgTypes> = ({}: ArgTypes) =>\n html`\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/oops-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/grist-theme.css\" rel=\"stylesheet\" />\n\n <style>\n [slot='headroom'] {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n\n --mdc-icon-size: 24px;\n }\n #sorters mwc-icon,\n #modes mwc-icon {\n --mdc-icon-size: 18px;\n }\n #sorters {\n margin-left: auto;\n margin-right: var(--margin-default);\n padding-left: var(--padding-narrow);\n border-bottom: var(--border-dark-color);\n position: relative;\n color: var(--secondary-color);\n font-size: var(--fontsize-default);\n user-select: none;\n }\n\n #sorters > * {\n padding: var(--padding-narrow);\n vertical-align: middle;\n }\n\n #filters {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n #filters * {\n margin-right: var(--margin-default);\n }\n\n @media only screen and (max-width: 460px) {\n #filters {\n flex-direction: column;\n }\n\n #modes {\n display: none;\n }\n }\n </style>\n\n <ox-attribute mode=\"LIST\"></ox-attribute>\n `\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
@@ -0,0 +1,25 @@
1
+ import '@material/mwc-icon';
2
+ import '@operato/property-editor/ox-property-editor-checkbox.js';
3
+ import '@operato/property-editor/ox-property-editor-number.js';
4
+ import '@operato/property-editor/ox-property-editor-string.js';
5
+ import '@operato/property-editor/ox-property-editor-options.js';
6
+ import '@operato/property-editor/ox-properties-dynamic-view.js';
7
+ import '@operato/data-grist/ox-filters-form.js';
8
+ import '@operato/data-grist/ox-sorters-control.js';
9
+ import '@operato/grist-editor';
10
+ import '../src/grist-editor/index.js';
11
+ import { TemplateResult } from 'lit';
12
+ declare const _default: {
13
+ title: string;
14
+ component: string;
15
+ argTypes: {};
16
+ };
17
+ export default _default;
18
+ interface Story<T> {
19
+ (args: T): TemplateResult;
20
+ args?: Partial<T>;
21
+ argTypes?: Record<string, unknown>;
22
+ }
23
+ interface ArgTypes {
24
+ }
25
+ export declare const Regular: Story<ArgTypes>;