@operato/grist-editor 2.0.0-alpha.7 → 2.0.0-alpha.71
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 +354 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-grist-editor-crontab.d.ts +1 -1
- package/dist/src/ox-grist-editor-duration.d.ts +1 -1
- package/dist/src/ox-grist-editor-hashtags.d.ts +1 -1
- package/dist/src/ox-grist-editor-i18n-label.d.ts +13 -0
- package/dist/src/ox-grist-editor-i18n-label.js +85 -0
- package/dist/src/ox-grist-editor-i18n-label.js.map +1 -0
- package/dist/src/ox-grist-editor-parameters.d.ts +1 -1
- package/dist/src/ox-grist-editor-partition-keys.d.ts +1 -1
- package/dist/src/ox-grist-editor-partition-keys.js +1 -1
- package/dist/src/ox-grist-editor-partition-keys.js.map +1 -1
- package/dist/src/ox-grist-editor-quantifier.d.ts +1 -1
- package/dist/src/ox-grist-editor-value-map.d.ts +1 -1
- package/dist/src/ox-grist-editor-value-ranges.d.ts +1 -1
- package/dist/src/ox-grist-renderer-i18n-label.d.ts +2 -0
- package/dist/src/ox-grist-renderer-i18n-label.js +9 -0
- package/dist/src/ox-grist-renderer-i18n-label.js.map +1 -0
- package/dist/src/ox-grist-renderer-partition-keys.d.ts +1 -1
- package/dist/src/ox-grist-renderer-partition-keys.js +4 -4
- package/dist/src/ox-grist-renderer-partition-keys.js.map +1 -1
- package/dist/src/ox-popup-crontab-input.d.ts +2 -1
- package/dist/src/ox-popup-crontab-input.js +5 -2
- package/dist/src/ox-popup-crontab-input.js.map +1 -1
- package/dist/src/ox-popup-duration-input.d.ts +2 -1
- package/dist/src/ox-popup-duration-input.js +5 -2
- package/dist/src/ox-popup-duration-input.js.map +1 -1
- package/dist/src/ox-popup-hashtags-input.d.ts +2 -1
- package/dist/src/ox-popup-hashtags-input.js +5 -2
- package/dist/src/ox-popup-hashtags-input.js.map +1 -1
- package/dist/src/ox-popup-i18n-label-input.d.ts +16 -0
- package/dist/src/ox-popup-i18n-label-input.js +104 -0
- package/dist/src/ox-popup-i18n-label-input.js.map +1 -0
- package/dist/src/ox-popup-parameters-builder.d.ts +2 -1
- package/dist/src/ox-popup-parameters-builder.js +5 -2
- package/dist/src/ox-popup-parameters-builder.js.map +1 -1
- package/dist/src/ox-popup-partition-keys-input.d.ts +2 -1
- package/dist/src/ox-popup-partition-keys-input.js +5 -2
- package/dist/src/ox-popup-partition-keys-input.js.map +1 -1
- package/dist/src/ox-popup-value-map-input.d.ts +2 -1
- package/dist/src/ox-popup-value-map-input.js +5 -2
- package/dist/src/ox-popup-value-map-input.js.map +1 -1
- package/dist/src/ox-popup-value-ranges-input.d.ts +2 -1
- package/dist/src/ox-popup-value-ranges-input.js +3 -2
- package/dist/src/ox-popup-value-ranges-input.js.map +1 -1
- package/dist/stories/ox-grist-editor-crontab.stories.d.ts +1 -1
- package/dist/stories/ox-grist-editor-crontab.stories.js +66 -54
- package/dist/stories/ox-grist-editor-crontab.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -36
- package/src/index.ts +4 -0
- package/src/ox-grist-editor-i18n-label.ts +101 -0
- package/src/ox-grist-editor-partition-keys.ts +1 -1
- package/src/ox-grist-renderer-i18n-label.ts +12 -0
- package/src/ox-grist-renderer-partition-keys.ts +4 -4
- package/src/ox-popup-crontab-input.ts +5 -2
- package/src/ox-popup-duration-input.ts +5 -2
- package/src/ox-popup-hashtags-input.ts +5 -2
- package/src/ox-popup-i18n-label-input.ts +101 -0
- package/src/ox-popup-parameters-builder.ts +5 -2
- package/src/ox-popup-partition-keys-input.ts +5 -2
- package/src/ox-popup-value-map-input.ts +6 -2
- package/src/ox-popup-value-ranges-input.ts +3 -2
- package/stories/ox-grist-editor-crontab.stories.ts +71 -60
- package/themes/grist-theme.css +1 -1
|
@@ -6,7 +6,7 @@ import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
|
6
6
|
import '@operato/data-grist';
|
|
7
7
|
import '@operato/data-grist/ox-filters-form.js';
|
|
8
8
|
import '@operato/data-grist/ox-sorters-control.js';
|
|
9
|
-
import '@material/
|
|
9
|
+
import '@material/web/icon/icon.js';
|
|
10
10
|
import { TemplateResult } from 'lit';
|
|
11
11
|
declare const _default: {
|
|
12
12
|
title: string;
|
|
@@ -7,7 +7,7 @@ import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
|
7
7
|
import '@operato/data-grist';
|
|
8
8
|
import '@operato/data-grist/ox-filters-form.js';
|
|
9
9
|
import '@operato/data-grist/ox-sorters-control.js';
|
|
10
|
-
import '@material/
|
|
10
|
+
import '@material/web/icon/icon.js';
|
|
11
11
|
/* set grist-editors */
|
|
12
12
|
import { css, html, LitElement } from 'lit';
|
|
13
13
|
import { state } from 'lit/decorators.js';
|
|
@@ -311,9 +311,9 @@ class GristDemo extends LitElement {
|
|
|
311
311
|
|
|
312
312
|
<div slot="headroom" id="headroom">
|
|
313
313
|
<div id="modes">
|
|
314
|
-
<
|
|
315
|
-
<
|
|
316
|
-
<
|
|
314
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</md-icon>
|
|
315
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</md-icon>
|
|
316
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
317
317
|
</div>
|
|
318
318
|
</div>
|
|
319
319
|
</ox-grist>
|
|
@@ -353,65 +353,77 @@ export default {
|
|
|
353
353
|
argTypes: {}
|
|
354
354
|
};
|
|
355
355
|
const Template = ({}) => html `
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
356
|
+
<link
|
|
357
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
358
|
+
rel="stylesheet"
|
|
359
|
+
/>
|
|
360
|
+
<link
|
|
361
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
362
|
+
rel="stylesheet"
|
|
363
|
+
/>
|
|
364
|
+
<link
|
|
365
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
366
|
+
rel="stylesheet"
|
|
367
|
+
/>
|
|
360
368
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
flex-direction: row;
|
|
365
|
-
align-items: center;
|
|
366
|
-
padding: var(--padding-default) var(--padding-wide);
|
|
367
|
-
background-color: var(--theme-white-color);
|
|
368
|
-
box-shadow: var(--box-shadow);
|
|
369
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
370
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
|
371
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
369
372
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
margin-right: var(--margin-default);
|
|
379
|
-
padding-left: var(--padding-narrow);
|
|
380
|
-
border-bottom: var(--border-dark-color);
|
|
381
|
-
position: relative;
|
|
382
|
-
color: var(--secondary-color);
|
|
383
|
-
font-size: var(--fontsize-default);
|
|
384
|
-
user-select: none;
|
|
385
|
-
}
|
|
373
|
+
<style>
|
|
374
|
+
[slot='headroom'] {
|
|
375
|
+
display: flex;
|
|
376
|
+
flex-direction: row;
|
|
377
|
+
align-items: center;
|
|
378
|
+
padding: var(--padding-default) var(--padding-wide);
|
|
379
|
+
background-color: var(--theme-white-color);
|
|
380
|
+
box-shadow: var(--box-shadow);
|
|
386
381
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
--md-icon-size: 24px;
|
|
383
|
+
}
|
|
384
|
+
#sorters md-icon,
|
|
385
|
+
#modes md-icon {
|
|
386
|
+
--md-icon-size: 18px;
|
|
387
|
+
}
|
|
388
|
+
#sorters {
|
|
389
|
+
margin-left: auto;
|
|
390
|
+
margin-right: var(--margin-default);
|
|
391
|
+
padding-left: var(--padding-narrow);
|
|
392
|
+
border-bottom: var(--border-dark-color);
|
|
393
|
+
position: relative;
|
|
394
|
+
color: var(--secondary-color);
|
|
395
|
+
font-size: var(--fontsize-default);
|
|
396
|
+
user-select: none;
|
|
397
|
+
}
|
|
391
398
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
399
|
+
#sorters > * {
|
|
400
|
+
padding: var(--padding-narrow);
|
|
401
|
+
vertical-align: middle;
|
|
402
|
+
}
|
|
397
403
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
404
|
+
#filters {
|
|
405
|
+
display: flex;
|
|
406
|
+
justify-content: center;
|
|
407
|
+
align-items: center;
|
|
408
|
+
}
|
|
401
409
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
410
|
+
#filters * {
|
|
411
|
+
margin-right: var(--margin-default);
|
|
412
|
+
}
|
|
406
413
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
414
|
+
@media only screen and (max-width: 460px) {
|
|
415
|
+
#filters {
|
|
416
|
+
flex-direction: column;
|
|
410
417
|
}
|
|
411
|
-
</style>
|
|
412
418
|
|
|
413
|
-
|
|
414
|
-
|
|
419
|
+
#modes {
|
|
420
|
+
display: none;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
</style>
|
|
424
|
+
|
|
425
|
+
<ox-grist-demo mode="LIST"></ox-grist-demo>
|
|
426
|
+
`;
|
|
415
427
|
export const Regular = Template.bind({});
|
|
416
428
|
Regular.args = {};
|
|
417
429
|
//# sourceMappingURL=ox-grist-editor-crontab.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-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,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;;;;KAI9E,CAAA;IACH,CAAC;;AAnPM,gBAAM,GAAG;IACd,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;KAmBF;CACF,AAtBY,CAsBZ;AAEQ;IAAR,KAAK,EAAE;uCAAsB;AA8NhC,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;AAEjD,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,yBAAyB;IACpC,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CACjD,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DH,CAAA;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@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'\nimport '@operato/data-grist/ox-filters-form.js'\nimport '@operato/data-grist/ox-sorters-control.js'\nimport '@material/mwc-icon'\n\n/* set grist-editors */\nimport { css, html, LitElement, TemplateResult } from 'lit'\nimport { state } from 'lit/decorators.js'\n\nimport { FetchOption, GristRecord, OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { CommonGristStyles } from '@operato/styles'\n\nimport { OxGristEditorCrontab } from '../src/ox-grist-editor-crontab.js'\nimport { OxGristEditorDuration } from '../src/ox-grist-editor-duration.js'\nimport { OxGristEditorParameters } from '../src/ox-grist-editor-parameters.js'\nimport { OxGristEditorPartitionKeys } from '../src/ox-grist-editor-partition-keys.js'\n// import { OxGristRendererCrontab } from '../src/ox-grist-renderer-crontab.js'\nimport { OxGristEditorValueMap } from '../src/ox-grist-editor-value-map.js'\nimport { OxGristRendererDuration } from '../src/ox-grist-renderer-duration.js'\n\n// import { OxGristEditorJson } from './ox-grist-editor-json.js'\n// import { OxGristRendererCrontab } from '../src/ox-grist-renderer-crontab.js'\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\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\n\n/* register grist renderer/editor for id */\n// registerEditor('resource-id', OxGristEditorResourceId)\n// registerEditor('resource-object', OxGristEditorResourceObject)\n// registerEditor('resource-code', OxGristEditorResourceCode)\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('duration', OxGristEditorDuration)\n// registerEditor('json', OxGristEditorJson)\n\n// registerRenderer('resource-id', OxGristRendererResourceId)\n// registerRenderer('resource-object', OxGristRendererResourceObject)\nregisterRenderer('parameters', OxGristRendererJson5)\nregisterRenderer('value-map', OxGristRendererJson5)\nregisterRenderer('partition-keys', OxGristRendererJson5)\nregisterRenderer('duration', OxGristRendererDuration)\n// registerRenderer('crontab', OxGristRendererCrontab)\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 name: `name-${start + idx + 1}`,\n description: `description-${start + idx + 1}`,\n sequence: idx + 1,\n active: true,\n tag: `tag-${idx + 1}`,\n type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',\n spec: {\n ccp: {\n criticalLimits: 100,\n targetLimits: 200\n },\n qc: {\n criticalLimits: 300,\n targetLimits: true\n }\n },\n options:\n idx % 2 === 0\n ? {\n options: [\n {\n text: 'A',\n value: 'a'\n },\n {\n text: 'B',\n value: 'b'\n }\n ]\n }\n : undefined,\n schedule: '* * * * * *',\n duration: -3600,\n keyvalue: {},\n createdAt: Date.now(),\n updatedAt: Date.now()\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: 'number',\n name: 'sequence',\n hidden: true\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\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: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'string',\n name: 'tag',\n header: i18next.t('field.tag'),\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: 'crontab',\n name: 'schedule',\n header: i18next.t('field.schedule'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'duration',\n name: 'duration',\n header: i18next.t('field.duration'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'partition-keys',\n name: 'keyvalue',\n header: i18next.t('field.keyvalue'),\n record: {\n editable: true,\n options: {\n objectified: true,\n valuetype: 'string'\n }\n },\n width: 120\n },\n {\n type: 'parameters',\n name: 'options',\n header: i18next.t('field.options'),\n record: {\n editable: true,\n renderer: (value: any) => {\n return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : ''\n },\n options: async (value: any, column: any, record: GristRecord, row: GristRecord, field: any) => {\n return {\n name: record.type,\n help: '',\n spec:\n record.type === 'select'\n ? [\n {\n type: 'options',\n name: 'options',\n label: 'options'\n }\n ]\n : [],\n context: this.grist,\n objectified: true /* tell parameters editor not to need to parse */\n }\n }\n },\n width: 120\n },\n {\n type: 'string',\n name: 'unit',\n header: i18next.t('field.unit'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'number',\n name: 'quota',\n header: i18next.t('field.quota'),\n record: {\n editable: true\n },\n width: 60\n },\n {\n type: 'crontab',\n name: 'spec',\n header: i18next.t('field.spec'),\n record: {\n editable: true,\n options: {\n name,\n objectified: true\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-grist-demo', GristDemo)\n\nexport default {\n title: 'ox-grist-editor-crontab',\n component: 'ox-grist-editor-crontab',\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 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-grist-demo mode=\"LIST\"></ox-grist-demo>\n `\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-crontab.stories.js","sourceRoot":"","sources":["../../stories/ox-grist-editor-crontab.stories.ts"],"names":[],"mappings":";AAAA,OAAO,yDAAyD,CAAA;AAChE,OAAO,uDAAuD,CAAA;AAC9D,OAAO,uDAAuD,CAAA;AAC9D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,qBAAqB,CAAA;AAC5B,OAAO,wCAAwC,CAAA;AAC/C,OAAO,2CAA2C,CAAA;AAClD,OAAO,4BAA4B,CAAA;AAEnC,uBAAuB;AACvB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAA4B,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAA;AACrF,+EAA+E;AAC/E,OAAO,EAAE,qBAAqB,E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GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;;;;;8BAKnE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;8BACpD,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;8BACpD,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;;;;KAI7E,CAAA;IACH,CAAC;;AAnPM,gBAAM,GAAG;IACd,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;KAmBF;CACF,AAtBY,CAsBZ;AAEQ;IAAR,KAAK,EAAE;uCAAsB;AA8NhC,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;AAEjD,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,yBAAyB;IACpC,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEvD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@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'\nimport '@operato/data-grist/ox-filters-form.js'\nimport '@operato/data-grist/ox-sorters-control.js'\nimport '@material/web/icon/icon.js'\n\n/* set grist-editors */\nimport { css, html, LitElement, TemplateResult } from 'lit'\nimport { state } from 'lit/decorators.js'\n\nimport { FetchOption, GristRecord, OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { CommonGristStyles } from '@operato/styles'\n\nimport { OxGristEditorCrontab } from '../src/ox-grist-editor-crontab.js'\nimport { OxGristEditorDuration } from '../src/ox-grist-editor-duration.js'\nimport { OxGristEditorParameters } from '../src/ox-grist-editor-parameters.js'\nimport { OxGristEditorPartitionKeys } from '../src/ox-grist-editor-partition-keys.js'\n// import { OxGristRendererCrontab } from '../src/ox-grist-renderer-crontab.js'\nimport { OxGristEditorValueMap } from '../src/ox-grist-editor-value-map.js'\nimport { OxGristRendererDuration } from '../src/ox-grist-renderer-duration.js'\n\n// import { OxGristEditorJson } from './ox-grist-editor-json.js'\n// import { OxGristRendererCrontab } from '../src/ox-grist-renderer-crontab.js'\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\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\n\n/* register grist renderer/editor for id */\n// registerEditor('resource-id', OxGristEditorResourceId)\n// registerEditor('resource-object', OxGristEditorResourceObject)\n// registerEditor('resource-code', OxGristEditorResourceCode)\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('duration', OxGristEditorDuration)\n// registerEditor('json', OxGristEditorJson)\n\n// registerRenderer('resource-id', OxGristRendererResourceId)\n// registerRenderer('resource-object', OxGristRendererResourceObject)\nregisterRenderer('parameters', OxGristRendererJson5)\nregisterRenderer('value-map', OxGristRendererJson5)\nregisterRenderer('partition-keys', OxGristRendererJson5)\nregisterRenderer('duration', OxGristRendererDuration)\n// registerRenderer('crontab', OxGristRendererCrontab)\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 name: `name-${start + idx + 1}`,\n description: `description-${start + idx + 1}`,\n sequence: idx + 1,\n active: true,\n tag: `tag-${idx + 1}`,\n type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',\n spec: {\n ccp: {\n criticalLimits: 100,\n targetLimits: 200\n },\n qc: {\n criticalLimits: 300,\n targetLimits: true\n }\n },\n options:\n idx % 2 === 0\n ? {\n options: [\n {\n text: 'A',\n value: 'a'\n },\n {\n text: 'B',\n value: 'b'\n }\n ]\n }\n : undefined,\n schedule: '* * * * * *',\n duration: -3600,\n keyvalue: {},\n createdAt: Date.now(),\n updatedAt: Date.now()\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: 'number',\n name: 'sequence',\n hidden: true\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\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: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'string',\n name: 'tag',\n header: i18next.t('field.tag'),\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: 'crontab',\n name: 'schedule',\n header: i18next.t('field.schedule'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'duration',\n name: 'duration',\n header: i18next.t('field.duration'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'partition-keys',\n name: 'keyvalue',\n header: i18next.t('field.keyvalue'),\n record: {\n editable: true,\n options: {\n objectified: true,\n valuetype: 'string'\n }\n },\n width: 120\n },\n {\n type: 'parameters',\n name: 'options',\n header: i18next.t('field.options'),\n record: {\n editable: true,\n renderer: (value: any) => {\n return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : ''\n },\n options: async (value: any, column: any, record: GristRecord, row: GristRecord, field: any) => {\n return {\n name: record.type,\n help: '',\n spec:\n record.type === 'select'\n ? [\n {\n type: 'options',\n name: 'options',\n label: 'options'\n }\n ]\n : [],\n context: this.grist,\n objectified: true /* tell parameters editor not to need to parse */\n }\n }\n },\n width: 120\n },\n {\n type: 'string',\n name: 'unit',\n header: i18next.t('field.unit'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'number',\n name: 'quota',\n header: i18next.t('field.quota'),\n record: {\n editable: true\n },\n width: 60\n },\n {\n type: 'crontab',\n name: 'spec',\n header: i18next.t('field.spec'),\n record: {\n editable: true,\n options: {\n name,\n objectified: true\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 <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </ox-grist>\n `\n }\n}\n\ncustomElements.define('ox-grist-demo', GristDemo)\n\nexport default {\n title: 'ox-grist-editor-crontab',\n component: 'ox-grist-editor-crontab',\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) => html`\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 <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 background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n\n --md-icon-size: 24px;\n }\n #sorters md-icon,\n #modes md-icon {\n --md-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-grist-demo mode=\"LIST\"></ox-grist-demo>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|