@things-factory/board-ui 6.1.48 → 6.1.54

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.
@@ -1,100 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@operato/data-grist';
3
- import gql from 'graphql-tag';
4
- import { css, html, LitElement } from 'lit';
5
- import { property } from 'lit/decorators.js';
6
- import { client } from '@operato/graphql';
7
- import { i18next } from '@operato/i18n';
8
- import { isMobileDevice } from '@operato/utils';
9
- export class ThemeImporter extends LitElement {
10
- constructor() {
11
- super(...arguments);
12
- this.themes = [];
13
- this.columns = {
14
- list: { fields: ['name', 'description'] },
15
- pagination: { infinite: true },
16
- columns: [
17
- {
18
- type: 'string',
19
- name: 'name',
20
- header: i18next.t('field.name'),
21
- width: 150
22
- },
23
- {
24
- type: 'string',
25
- name: 'description',
26
- header: i18next.t('field.description'),
27
- width: 200
28
- },
29
- {
30
- type: 'checkbox',
31
- name: 'active',
32
- header: i18next.t('field.active'),
33
- width: 60
34
- }
35
- ]
36
- };
37
- }
38
- render() {
39
- return html `
40
- <ox-grist
41
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
42
- .config=${this.columns}
43
- .data=${{
44
- records: this.themes
45
- }}
46
- ></ox-grist>
47
-
48
- <div class="button-container">
49
- <mwc-button raised @click="${this.save.bind(this)}">${i18next.t('button.save')}</mwc-button>
50
- </div>
51
- `;
52
- }
53
- async save() {
54
- var _a;
55
- const response = await client.mutate({
56
- mutation: gql `
57
- mutation importThemes($themes: [ThemePatch!]!) {
58
- importThemes(themes: $themes)
59
- }
60
- `,
61
- variables: { themes: this.themes }
62
- });
63
- if ((_a = response.errors) === null || _a === void 0 ? void 0 : _a.length)
64
- return;
65
- this.dispatchEvent(new CustomEvent('imported'));
66
- }
67
- }
68
- ThemeImporter.styles = [
69
- css `
70
- :host {
71
- display: flex;
72
- flex-direction: column;
73
-
74
- background-color: #fff;
75
- }
76
-
77
- ox-grist {
78
- flex: 1;
79
- }
80
-
81
- .button-container {
82
- display: flex;
83
- margin-left: auto;
84
- padding: var(--padding-default);
85
- }
86
-
87
- mwc-button {
88
- margin-left: var(--margin-default);
89
- }
90
- `
91
- ];
92
- __decorate([
93
- property({ type: Array }),
94
- __metadata("design:type", Array)
95
- ], ThemeImporter.prototype, "themes", void 0);
96
- __decorate([
97
- property({ type: Object }),
98
- __metadata("design:type", Object)
99
- ], ThemeImporter.prototype, "columns", void 0);
100
- //# sourceMappingURL=theme-importer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-importer.js","sourceRoot":"","sources":["../../../client/pages/theme/theme-importer.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,OAAO,aAAc,SAAQ,UAAU;IAA7C;;QA0B6B,WAAM,GAAU,EAAE,CAAA;QACjB,YAAO,GAAG;YACpC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAgCH,CAAC;IA9BC,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBACd;YACN,OAAO,EAAE,IAAI,CAAC,MAAM;SACrB;;;;qCAI4B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAEjF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACnC,CAAC,CAAA;QAEF,IAAI,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAhFM,oBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;6CAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAuB1B","sourcesContent":["import '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\n\nexport class ThemeImporter extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-grist {\n flex: 1;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n\n mwc-button {\n margin-left: var(--margin-default);\n }\n `\n ]\n\n @property({ type: Array }) themes: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.themes\n }}\n ></ox-grist>\n\n <div class=\"button-container\">\n <mwc-button raised @click=\"${this.save.bind(this)}\">${i18next.t('button.save')}</mwc-button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importThemes($themes: [ThemePatch!]!) {\n importThemes(themes: $themes)\n }\n `,\n variables: { themes: this.themes }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n"]}