@things-factory/calendar 9.1.13 → 10.0.0-beta.1

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,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@operato/data-grist';
3
3
  import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
4
- import { PageView, store } from '@operato/shell';
4
+ import { PageView } from '@operato/shell';
5
5
  import { css, html } from 'lit';
6
6
  import { customElement, property, query } from 'lit/decorators.js';
7
7
  import { ScopedElementsMixin } from '@open-wc/scoped-elements';
@@ -10,10 +10,9 @@ import { client } from '@operato/graphql';
10
10
  import { i18next, localize } from '@operato/i18n';
11
11
  import { notify, openPopup } from '@operato/layout';
12
12
  import { isMobileDevice } from '@operato/utils';
13
- import { connect } from 'pwa-helpers/connect-mixin';
14
13
  import gql from 'graphql-tag';
15
14
  import { CalendarImporter } from './calendar-importer';
16
- let CalendarListPage = class CalendarListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
15
+ let CalendarListPage = class CalendarListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
17
16
  constructor() {
18
17
  super(...arguments);
19
18
  this.mode = isMobileDevice() ? 'CARD' : 'GRID';
@@ -23,66 +22,53 @@ let CalendarListPage = class CalendarListPage extends connect(store)(localize(i1
23
22
  CommonGristStyles,
24
23
  CommonHeaderStyles,
25
24
  css `
26
- :host {
27
- display: flex;
25
+ :host { display: flex;
28
26
 
29
27
  width: 100%;
30
28
 
31
29
  --grid-record-emphasized-background-color: #8b0000;
32
30
  --grid-record-emphasized-color: #ff6b6b;
33
- }
31
+ }
34
32
 
35
- ox-grist {
36
- overflow-y: auto;
33
+ ox-grist { overflow-y: auto;
37
34
  flex: 1;
38
- }
35
+ }
39
36
 
40
- ox-filters-form {
41
- flex: 1;
42
- }
37
+ ox-filters-form { flex: 1;
38
+ }
43
39
  `
44
40
  ]; }
45
41
  static get scopedElements() {
46
- return {
47
- 'calendar-importer': CalendarImporter
42
+ return { 'calendar-importer': CalendarImporter
48
43
  };
49
44
  }
50
45
  get context() {
51
- return {
52
- title: i18next.t('title.calendar list'),
53
- search: {
54
- handler: (search) => {
46
+ return { title: i18next.t('title.calendar list'),
47
+ search: { handler: (search) => {
55
48
  this.grist.searchText = search;
56
49
  },
57
50
  value: this.grist?.searchText || '',
58
- autofocus: true
59
- },
60
- filter: {
61
- handler: () => {
51
+ autofocus: true },
52
+ filter: { handler: () => {
62
53
  this.grist.toggleHeadroom();
63
54
  }
64
55
  },
65
56
  help: 'calendar/calendar',
66
57
  actions: [
67
- {
68
- title: i18next.t('button.save'),
58
+ { title: i18next.t('button.save'),
69
59
  action: this._updateCalendar.bind(this),
70
60
  ...CommonButtonStyles.save
71
61
  },
72
- {
73
- title: i18next.t('button.delete'),
62
+ { title: i18next.t('button.delete'),
74
63
  action: this._deleteCalendar.bind(this),
75
64
  ...CommonButtonStyles.delete
76
65
  }
77
66
  ],
78
- exportable: {
79
- name: i18next.t('title.calendar list'),
67
+ exportable: { name: i18next.t('title.calendar list'),
80
68
  data: this.exportHandler.bind(this)
81
69
  },
82
- importable: {
83
- handler: this.importHandler.bind(this)
84
- }
85
- };
70
+ importable: { handler: this.importHandler.bind(this)
71
+ } };
86
72
  }
87
73
  render() {
88
74
  const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
@@ -103,113 +89,90 @@ let CalendarListPage = class CalendarListPage extends connect(store)(localize(i1
103
89
  `;
104
90
  }
105
91
  async pageInitialized(lifecycle) {
106
- this.gristConfig = {
107
- list: {
108
- fields: ['name', 'description'],
92
+ this.gristConfig = { list: { fields: ['name', 'description'],
109
93
  details: ['active', 'updatedAt']
110
94
  },
111
95
  columns: [
112
96
  { type: 'gutter', gutterName: 'sequence' },
113
97
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
114
- {
115
- type: 'string',
98
+ { type: 'string',
116
99
  name: 'name',
117
100
  header: i18next.t('field.name'),
118
- record: {
119
- editable: true
101
+ record: { editable: true
120
102
  },
121
103
  filter: 'search',
122
104
  sortable: true,
123
105
  width: 150
124
106
  },
125
- {
126
- type: 'string',
107
+ { type: 'string',
127
108
  name: 'description',
128
109
  header: i18next.t('field.description'),
129
- record: {
130
- editable: true
110
+ record: { editable: true
131
111
  },
132
112
  filter: 'search',
133
113
  width: 200
134
114
  },
135
- {
136
- type: 'checkbox',
115
+ { type: 'checkbox',
137
116
  name: 'active',
138
117
  label: true,
139
118
  header: i18next.t('field.active'),
140
- record: {
141
- editable: true
119
+ record: { editable: true
142
120
  },
143
121
  filter: true,
144
122
  sortable: true,
145
123
  width: 60
146
124
  },
147
- {
148
- type: 'resource-object',
125
+ { type: 'resource-object',
149
126
  name: 'updater',
150
127
  header: i18next.t('field.updater'),
151
- record: {
152
- editable: false
128
+ record: { editable: false
153
129
  },
154
130
  sortable: true,
155
131
  width: 120
156
132
  },
157
- {
158
- type: 'datetime',
133
+ { type: 'datetime',
159
134
  name: 'updatedAt',
160
135
  header: i18next.t('field.updated_at'),
161
- record: {
162
- editable: false
136
+ record: { editable: false
163
137
  },
164
138
  sortable: true,
165
139
  width: 180
166
140
  }
167
141
  ],
168
- rows: {
169
- selectable: {
170
- multiple: true
142
+ rows: { selectable: { multiple: true
171
143
  }
172
144
  },
173
145
  sorters: [
174
- {
175
- name: 'name'
146
+ { name: 'name'
176
147
  }
177
148
  ]
178
149
  };
179
150
  }
180
151
  async pageUpdated(changes, lifecycle) {
181
- if (this.active) {
182
- // do something here when this page just became as active
152
+ if (this.active) { // do something here when this page just became as active
183
153
  }
184
154
  }
185
155
  async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
186
- const response = await client.query({
187
- query: gql `
188
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
189
- responses: calendars(filters: $filters, pagination: $pagination, sortings: $sortings) {
190
- items {
191
- id
156
+ const response = await client.query({ query: gql `
157
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: calendars(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
192
158
  name
193
159
  description
194
160
  active
195
- updater {
196
- id
161
+ updater { id
197
162
  name
198
- }
163
+ }
199
164
  updatedAt
200
- }
165
+ }
201
166
  total
202
- }
203
- }
167
+ }
168
+ }
204
169
  `,
205
- variables: {
206
- filters,
170
+ variables: { filters,
207
171
  pagination: { page, limit },
208
172
  sortings
209
173
  }
210
174
  });
211
- return {
212
- total: response.data.responses.total || 0,
175
+ return { total: response.data.responses.total || 0,
213
176
  records: response.data.responses.items || []
214
177
  };
215
178
  }
@@ -217,20 +180,16 @@ let CalendarListPage = class CalendarListPage extends connect(store)(localize(i1
217
180
  if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
218
181
  const ids = this.grist.selected.map(record => record.id);
219
182
  if (ids && ids.length > 0) {
220
- const response = await client.mutate({
221
- mutation: gql `
222
- mutation ($ids: [String!]!) {
223
- deleteCalendars(ids: $ids)
224
- }
183
+ const response = await client.mutate({ mutation: gql `
184
+ mutation ($ids: [String!]!) { deleteCalendars(ids: $ids)
185
+ }
225
186
  `,
226
- variables: {
227
- ids
187
+ variables: { ids
228
188
  }
229
189
  });
230
190
  if (!response.errors) {
231
191
  this.grist.fetch();
232
- notify({
233
- message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
192
+ notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
234
193
  });
235
194
  }
236
195
  }
@@ -248,16 +207,12 @@ let CalendarListPage = class CalendarListPage extends connect(store)(localize(i1
248
207
  patchField.cuFlag = patch.__dirty__;
249
208
  return patchField;
250
209
  });
251
- const response = await client.mutate({
252
- mutation: gql `
253
- mutation ($patches: [CalendarPatch!]!) {
254
- updateMultipleCalendar(patches: $patches) {
255
- name
256
- }
257
- }
210
+ const response = await client.mutate({ mutation: gql `
211
+ mutation ($patches: [CalendarPatch!]!) { updateMultipleCalendar(patches: $patches) { name
212
+ }
213
+ }
258
214
  `,
259
- variables: {
260
- patches
215
+ variables: { patches
261
216
  }
262
217
  });
263
218
  if (!response.errors) {
@@ -285,8 +240,7 @@ let CalendarListPage = class CalendarListPage extends connect(store)(localize(i1
285
240
  this.grist.fetch();
286
241
  }}
287
242
  ></calendar-importer>
288
- `, {
289
- backdrop: true,
243
+ `, { backdrop: true,
290
244
  size: 'large',
291
245
  title: i18next.t('title.import calendar')
292
246
  });
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-list-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG/C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,OA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,CAAC;8BAAiB,SAAS;+CAAA;AAnCjC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAgT5B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\n\nimport { CalendarImporter } from './calendar-importer'\n\n@customElement('calendar-list-page')\nexport class CalendarListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n ox-filters-form {\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'calendar-importer': CalendarImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.calendar list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || '',\n autofocus: true\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'calendar/calendar',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateCalendar.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteCalendar.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.calendar list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: calendars(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteCalendar() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteCalendars(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateCalendar() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [CalendarPatch!]!) {\n updateMultipleCalendar(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(calendar => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = calendar[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <calendar-importer\n .calendars=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></calendar-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import calendar')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"calendar-list-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG/C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAA/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oBAAoB,CAAC;GACvB,gBAAgB,CA6O5B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { CalendarImporter } from './calendar-importer'\n\n@customElement('calendar-list-page')\nexport class CalendarListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n\n ox-filters-form { flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'calendar-importer': CalendarImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.calendar list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || '',\n autofocus: true\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'calendar/calendar',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateCalendar.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteCalendar.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.calendar list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: calendars(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteCalendar() { if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteCalendars(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateCalendar() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [CalendarPatch!]!) { updateMultipleCalendar(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(calendar => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = calendar[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <calendar-importer\n .calendars=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></calendar-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import calendar')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
@@ -3,14 +3,7 @@ import { PropertyValues } from 'lit';
3
3
  import { PageView } from '@operato/shell';
4
4
  import { BizEvent, CALENDAR } from '@operato/event-view/types.js';
5
5
  import { OxEventView } from '@operato/event-view';
6
- declare const CalendarPage_base: (new (...args: any[]) => {
7
- _storeUnsubscribe: import("redux").Unsubscribe;
8
- connectedCallback(): void;
9
- disconnectedCallback(): void;
10
- stateChanged(_state: unknown): void;
11
- readonly isConnected: boolean;
12
- }) & typeof PageView;
13
- export declare class CalendarPage extends CalendarPage_base {
6
+ export declare class CalendarPage extends PageView {
14
7
  static styles: import("lit").CSSResult[];
15
8
  itemId?: string;
16
9
  params: any;
@@ -18,9 +11,7 @@ export declare class CalendarPage extends CalendarPage_base {
18
11
  render(): import("lit-html").TemplateResult<1>;
19
12
  updated(changes: PropertyValues<this>): void;
20
13
  fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]>;
21
- stateChanged(state: any): void;
22
14
  pageInitialized(lifecycle: any): void;
23
15
  pageUpdated(changes: any, lifecycle: any, before: any): void;
24
16
  pageDisposed(lifecycle: any): void;
25
17
  }
26
- export {};
@@ -2,11 +2,10 @@ import { __decorate, __metadata } from "tslib";
2
2
  import '@operato/event-view/ox-event-view.js';
3
3
  import { html, css } from 'lit';
4
4
  import { customElement, property, query } from 'lit/decorators.js';
5
- import { connect } from 'pwa-helpers/connect-mixin.js';
6
- import { store, PageView } from '@operato/shell';
5
+ import { PageView } from '@operato/shell';
7
6
  import { OxEventView } from '@operato/event-view';
8
7
  import { ScrollbarStyles } from '@operato/styles';
9
- let CalendarPage = class CalendarPage extends connect(store)(PageView) {
8
+ let CalendarPage = class CalendarPage extends PageView {
10
9
  static { this.styles = [
11
10
  ScrollbarStyles,
12
11
  css `
@@ -40,12 +39,6 @@ let CalendarPage = class CalendarPage extends connect(store)(PageView) {
40
39
  });
41
40
  return eventMap;
42
41
  }
43
- stateChanged(state) {
44
- /*
45
- * application wide state changed
46
- *
47
- */
48
- }
49
42
  /*
50
43
  * page lifecycle
51
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-page.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-page.ts"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;aACjD,WAAM,GAAG;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;KAUF;KACF,AAbY,CAaZ;IAOD,MAAM;QACJ,OAAO,IAAI,CAAA,iDAAiD,IAAI,oBAAoB,CAAA;IACtF,CAAC;IAED,OAAO,CAAC,OAA6B;QACnC;;;WAGG;QACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnD,kBAAkB;QACpB,CAAC;IACH,CAAC;IAED,sBAAsB,CAAC,QAAkB;QACvC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAA;QAE5C,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YAC5B,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,YAAY,CAAC,KAAU;QACrB;;;WAGG;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IAEH,eAAe,CAAC,SAAc;QAC5B;;;;;;;WAOG;IACL,CAAC;IAED,WAAW,CAAC,OAAY,EAAE,SAAc,EAAE,MAAW;QACnD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB;;eAEG;YACH,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,UAAU,CAAA;YAClC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,8BAA8B;QAChC,CAAC;IACH,CAAC;IAED,YAAY,CAAC,SAAc;QACzB;;;;;;;;WAQG;IACL,CAAC;;AAnG2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAY;AAEf;IAAvB,KAAK,CAAC,eAAe,CAAC;8BAAa,WAAW;+CAAA;AAnBpC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAoHxB","sourcesContent":["import '@operato/event-view/ox-event-view.js'\n\nimport { PropertyValues, html, css } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { store, PageView } from '@operato/shell'\nimport { BizEvent, CALENDAR, EventProvider } from '@operato/event-view/types.js'\nimport { OxEventView } from '@operato/event-view'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('calendar-page')\nexport class CalendarPage extends connect(store)(PageView) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n }\n\n ox-event-view {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: String }) itemId?: string\n @property({ type: Object }) params: any\n\n @query('ox-event-view') eventView!: OxEventView\n\n render() {\n return html` <ox-event-view mode=\"monthly\" .eventProvider=${this}></ox-event-view> `\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * If this page properties are changed, this callback will be invoked.\n * This callback will be called back only when this page is activated.\n */\n if (changes.has('itemId') || changes.has('params')) {\n /* do something */\n }\n }\n\n fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]> {\n const eventMap = new Map<Date, BizEvent[]>()\n\n calendar.forEach(({ date }) => {\n eventMap.set(date, [])\n })\n\n return eventMap\n }\n\n stateChanged(state: any) {\n /*\n * application wide state changed\n *\n */\n }\n\n /*\n * page lifecycle\n *\n * - pageInitialized(lifecycle)\n * - pageUpdated(changes, lifecycle, changedBefore)\n * - pageDisposed(lifecycle)\n *\n * lifecycle value has\n * - active : this page is activated\n * - page : first path of href\n * - resourceId : second path of href\n * - params : search params object of href\n * - initialized : initialized state of this page\n *\n * you can update lifecycle values, or add custom values\n * by calling this.pageUpdate({ ...values }, force)\n * If lifecycle values changed by this.pageUpdate(...),\n * this.pageUpdated(...) will be called back right after.\n * If you want to invoke this.pageUpdated(...) callback,\n * set force argument to true.\n *\n * you can re-initialize this page\n * by calling this.pageReset().\n * this.pageInitialized(...) followed by this.pageDisposed(...) will be invoked\n * by calling this.pageReset().\n *\n * you can invoke this.pageDisposed()\n * by calling this.pageDispose()\n */\n\n pageInitialized(lifecycle: any) {\n /*\n * This page is initialized.\n * It's right time to configure of this page.\n *\n * - called before when this page activated first\n * - called when i18next resource is updated (loaded, changed, ..)\n * - called right after this.pageReset()\n */\n }\n\n pageUpdated(changes: any, lifecycle: any, before: any) {\n if (this.active) {\n /*\n * this page is activated\n */\n this.itemId = lifecycle.resourceId\n this.params = lifecycle.params\n } else {\n /* this page is deactivated */\n }\n }\n\n pageDisposed(lifecycle: any) {\n /*\n * This page is disposed.\n * It's right time to release system resources.\n *\n * - called just before (re)pageInitialized\n * - called right after when i18next resource updated (loaded, changed, ..)\n * - called right after this.pageReset()\n * - called right after this.pageDispose()\n */\n }\n}\n"]}
1
+ {"version":3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E,CAAC;YAChB;;eAEG;YACH,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,UAAU,CAAA;YAClC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,8BAA8B;QAChC,CAAC;IACH,CAAC;IAED,YAAY,CAAC,SAAc;QACzB;;;;;;;;WAQG;IACL,CAAC;;AA7F2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAY;AAEf;IAAvB,KAAK,CAAC,eAAe,CAAC;8BAAa,WAAW;+CAAA;AAnBpC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8GxB","sourcesContent":["import '@operato/event-view/ox-event-view.js'\n\nimport { PropertyValues, html, css } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { PageView } from '@operato/shell'\nimport { BizEvent, CALENDAR, EventProvider } from '@operato/event-view/types.js'\nimport { OxEventView } from '@operato/event-view'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('calendar-page')\nexport class CalendarPage extends PageView {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n }\n\n ox-event-view {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: String }) itemId?: string\n @property({ type: Object }) params: any\n\n @query('ox-event-view') eventView!: OxEventView\n\n render() {\n return html` <ox-event-view mode=\"monthly\" .eventProvider=${this}></ox-event-view> `\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * If this page properties are changed, this callback will be invoked.\n * This callback will be called back only when this page is activated.\n */\n if (changes.has('itemId') || changes.has('params')) {\n /* do something */\n }\n }\n\n fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]> {\n const eventMap = new Map<Date, BizEvent[]>()\n\n calendar.forEach(({ date }) => {\n eventMap.set(date, [])\n })\n\n return eventMap\n }\n\n\n /*\n * page lifecycle\n *\n * - pageInitialized(lifecycle)\n * - pageUpdated(changes, lifecycle, changedBefore)\n * - pageDisposed(lifecycle)\n *\n * lifecycle value has\n * - active : this page is activated\n * - page : first path of href\n * - resourceId : second path of href\n * - params : search params object of href\n * - initialized : initialized state of this page\n *\n * you can update lifecycle values, or add custom values\n * by calling this.pageUpdate({ ...values }, force)\n * If lifecycle values changed by this.pageUpdate(...),\n * this.pageUpdated(...) will be called back right after.\n * If you want to invoke this.pageUpdated(...) callback,\n * set force argument to true.\n *\n * you can re-initialize this page\n * by calling this.pageReset().\n * this.pageInitialized(...) followed by this.pageDisposed(...) will be invoked\n * by calling this.pageReset().\n *\n * you can invoke this.pageDisposed()\n * by calling this.pageDispose()\n */\n\n pageInitialized(lifecycle: any) {\n /*\n * This page is initialized.\n * It's right time to configure of this page.\n *\n * - called before when this page activated first\n * - called when i18next resource is updated (loaded, changed, ..)\n * - called right after this.pageReset()\n */\n }\n\n pageUpdated(changes: any, lifecycle: any, before: any) {\n if (this.active) {\n /*\n * this page is activated\n */\n this.itemId = lifecycle.resourceId\n this.params = lifecycle.params\n } else {\n /* this page is deactivated */\n }\n }\n\n pageDisposed(lifecycle: any) {\n /*\n * This page is disposed.\n * It's right time to release system resources.\n *\n * - called just before (re)pageInitialized\n * - called right after when i18next resource updated (loaded, changed, ..)\n * - called right after this.pageReset()\n * - called right after this.pageDispose()\n */\n }\n}\n"]}
@@ -2,13 +2,7 @@ import '@operato/data-grist';
2
2
  import { PageView } from '@operato/shell';
3
3
  import { FetchOption } from '@operato/data-grist';
4
4
  import { EventImporter } from './event-importer';
5
- declare const EventListPage_base: (new (...args: any[]) => {
6
- _storeUnsubscribe: import("redux").Unsubscribe;
7
- connectedCallback(): void;
8
- disconnectedCallback(): void;
9
- stateChanged(_state: unknown): void;
10
- readonly isConnected: boolean;
11
- }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
5
+ declare const EventListPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
12
6
  export declare class EventListPage extends EventListPage_base {
13
7
  static styles: import("lit").CSSResult[];
14
8
  static get scopedElements(): {