@things-factory/lite-menu 7.0.1-alpha.10 → 7.0.1-alpha.102

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 (36) hide show
  1. package/client/actions/lite-menu.ts +16 -9
  2. package/client/bootstrap.ts +7 -1
  3. package/client/lite-menu-setting-let.ts +15 -6
  4. package/client/pages/addon-menu-setting.ts +45 -12
  5. package/client/reducers/lite-menu.ts +7 -5
  6. package/dist-client/actions/lite-menu.d.ts +2 -2
  7. package/dist-client/actions/lite-menu.js +14 -8
  8. package/dist-client/actions/lite-menu.js.map +1 -1
  9. package/dist-client/bootstrap.d.ts +1 -1
  10. package/dist-client/bootstrap.js +4 -1
  11. package/dist-client/bootstrap.js.map +1 -1
  12. package/dist-client/lite-menu-setting-let.d.ts +1 -2
  13. package/dist-client/lite-menu-setting-let.js +15 -6
  14. package/dist-client/lite-menu-setting-let.js.map +1 -1
  15. package/dist-client/pages/addon-menu-setting.d.ts +0 -1
  16. package/dist-client/pages/addon-menu-setting.js +40 -10
  17. package/dist-client/pages/addon-menu-setting.js.map +1 -1
  18. package/dist-client/reducers/lite-menu.js +5 -3
  19. package/dist-client/reducers/lite-menu.js.map +1 -1
  20. package/dist-client/tsconfig.tsbuildinfo +1 -1
  21. package/dist-server/service/lite-menu/lite-menu-query.js +13 -0
  22. package/dist-server/service/lite-menu/lite-menu-query.js.map +1 -1
  23. package/dist-server/service/lite-menu/lite-menu-type.js +9 -0
  24. package/dist-server/service/lite-menu/lite-menu-type.js.map +1 -1
  25. package/dist-server/service/lite-menu/lite-menu.js +9 -2
  26. package/dist-server/service/lite-menu/lite-menu.js.map +1 -1
  27. package/dist-server/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +13 -10
  29. package/server/service/lite-menu/lite-menu-query.ts +9 -1
  30. package/server/service/lite-menu/lite-menu-type.ts +8 -0
  31. package/server/service/lite-menu/lite-menu.ts +9 -3
  32. package/translations/en.json +3 -1
  33. package/translations/ja.json +3 -1
  34. package/translations/ko.json +3 -1
  35. package/translations/ms.json +2 -0
  36. package/translations/zh.json +3 -1
@@ -1,15 +1,15 @@
1
+ import '@material/web/icon/icon.js'
1
2
  import '@operato/menu/ox-menu-part.js'
2
- import '@material/mwc-icon'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { html } from 'lit'
6
6
 
7
+ import { store, InheritedValueType, clientSettingStore } from '@operato/shell'
7
8
  import { client } from '@operato/graphql'
8
9
  import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
9
- import { store, InheritedValueType } from '@operato/shell'
10
10
  import { isMobileDevice } from '@operato/utils'
11
- import { clientSettingStore } from '@operato/shell'
12
- import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base'
11
+
12
+ import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base/client'
13
13
 
14
14
  export const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS'
15
15
  export const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'
@@ -44,12 +44,12 @@ export async function setupMenuPart(options) {
44
44
  HAMBURGER = {
45
45
  name: 'hamburger',
46
46
  template: html`
47
- <mwc-icon
47
+ <md-icon
48
48
  @click=${e =>
49
49
  toggleOverlay('ox-menu-part', {
50
50
  backdrop: true
51
51
  })}
52
- >view_headline</mwc-icon
52
+ >view_headline</md-icon
53
53
  >
54
54
  `,
55
55
  position: TOOL_POSITION.FRONT_END
@@ -73,13 +73,13 @@ export async function setupMenuPart(options) {
73
73
  }
74
74
  }
75
75
 
76
- export function updateMenuTemplate(template) {
76
+ export async function updateMenuTemplate(template) {
77
+ await fetchAddonMenus()
78
+
77
79
  store.dispatch({
78
80
  type: UPDATE_MENU_TEMPLATE,
79
81
  template
80
82
  })
81
-
82
- fetchAddonMenus()
83
83
  }
84
84
 
85
85
  export async function fetchAddonMenus() {
@@ -93,6 +93,7 @@ export async function fetchAddonMenus() {
93
93
  items {
94
94
  id
95
95
  name
96
+ label
96
97
  description
97
98
  appName
98
99
  parent
@@ -119,6 +120,12 @@ export async function fetchAddonMenus() {
119
120
  value: ['', applicationName]
120
121
  }
121
122
  ],
123
+ sortings: [
124
+ {
125
+ name: 'rank',
126
+ desc: false
127
+ }
128
+ ],
122
129
  inherited: InheritedValueType.Include
123
130
  }
124
131
  })
@@ -1,10 +1,16 @@
1
- import '@material/mwc-icon'
1
+ import '@material/web/icon/icon.js'
2
2
  import '@operato/i18n/ox-i18n.js'
3
3
  import './route'
4
4
 
5
5
  import { store } from '@operato/shell'
6
+
7
+ import { registerEditor as registerGristEditor } from '@operato/data-grist'
8
+ import { OxGristEditorI18nLabel } from '@operato/grist-editor/ox-grist-editor-i18n-label.js'
9
+
6
10
  import liteMenu from './reducers/lite-menu'
7
11
 
8
12
  export default function bootstrap() {
13
+ registerGristEditor('i18n-label', OxGristEditorI18nLabel)
14
+
9
15
  store.addReducers({ liteMenu })
10
16
  }
@@ -1,6 +1,5 @@
1
- import '@material/mwc-formfield'
2
- import '@material/mwc-checkbox'
3
1
  import '@operato/i18n/ox-i18n.js'
2
+ import '@material/web/checkbox/checkbox.js'
4
3
 
5
4
  import { css, html, LitElement } from 'lit'
6
5
  import { customElement, query, property, state } from 'lit/decorators.js'
@@ -15,8 +14,12 @@ export class LiteMenuSettingLet extends localize(i18next)(LitElement) {
15
14
  static styles = [
16
15
  css`
17
16
  label {
17
+ display: flex;
18
+ gap: 10px;
19
+ align-items: center;
20
+
18
21
  font: var(--label-font);
19
- color: var(--label-color);
22
+ color: var(--md-sys-color-on-primary-container);
20
23
  text-transform: var(--label-text-transform);
21
24
  }
22
25
  `
@@ -33,9 +36,15 @@ export class LiteMenuSettingLet extends localize(i18next)(LitElement) {
33
36
  <ox-i18n slot="title" msgid="title.lite-menu-setting"></ox-i18n>
34
37
 
35
38
  <div slot="content">
36
- <mwc-formfield label="hovering">
37
- <mwc-checkbox id="hovering" @change=${e => this.onChange(e)} ?checked=${checked} ?indeterminate=${indeterminate}></mwc-checkbox>
38
- </mwc-formfield>
39
+ <label>
40
+ <md-checkbox
41
+ id="hovering"
42
+ @change=${e => this.onChange(e)}
43
+ ?checked=${checked}
44
+ ?indeterminate=${indeterminate}
45
+ ></md-checkbox>
46
+ hovering
47
+ </label>
39
48
  </div>
40
49
  </setting-let>
41
50
  `
@@ -4,28 +4,31 @@ import '@operato/data-grist/ox-sorters-control.js'
4
4
  import '@operato/data-grist/ox-record-creator.js'
5
5
  import '@operato/popup/ox-popup.js'
6
6
  import '@operato/context/ox-context-page-toolbar.js'
7
- import '@material/mwc-icon'
8
7
 
9
8
  import gql from 'graphql-tag'
10
9
  import { css, html } from 'lit'
11
10
  import { customElement, property, query, state } from 'lit/decorators.js'
12
11
  import { connect } from 'pwa-helpers/connect-mixin.js'
13
12
 
14
- import { DataGrist, getEditor, getRenderer } from '@operato/data-grist'
13
+ import { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'
15
14
  import { client } from '@operato/graphql'
16
15
  import { i18next, localize } from '@operato/i18n'
17
16
  import { PageView, store } from '@operato/shell'
18
- import { ScrollbarStyles, CommonHeaderStyles } from '@operato/styles'
17
+ import { CommonGristStyles, ScrollbarStyles, CommonHeaderStyles } from '@operato/styles'
19
18
  import { isMobileDevice } from '@operato/utils'
20
19
 
20
+ import { getLanguages } from '@things-factory/auth-base/dist-client'
21
+ import { p13n } from '@operato/p13n'
22
+
21
23
  import { fetchAddonMenus } from '../actions/lite-menu'
22
24
 
23
25
  const applicationName = (document.querySelector('meta[name="application-name"]') as HTMLMetaElement)?.content
24
26
 
25
27
  @customElement('addon-menu-setting')
26
- class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
28
+ class AddonMenuSetting extends connect(store)(p13n(localize(i18next)(PageView))) {
27
29
  static styles = [
28
30
  ScrollbarStyles,
31
+ CommonGristStyles,
29
32
  CommonHeaderStyles,
30
33
  css`
31
34
  :host {
@@ -45,6 +48,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
45
48
 
46
49
  @state() config: any
47
50
  @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
51
+
48
52
  @state() menus: any[] = []
49
53
 
50
54
  @query('ox-grist') private grist!: DataGrist
@@ -65,7 +69,10 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
65
69
  action: () => {
66
70
  this.onDelete()
67
71
  },
68
- icon: 'delete'
72
+ icon: 'delete',
73
+ emphasis: {
74
+ danger: true
75
+ }
69
76
  },
70
77
  {
71
78
  title: i18next.t('button.save'),
@@ -88,12 +95,14 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
88
95
 
89
96
  render() {
90
97
  return html`
91
- <ox-grist .mode=${this.mode} .config=${this.config} .fetchHandler=${this.fetchHandler}>
98
+ <ox-grist
99
+ .mode=${this.mode}
100
+ .config=${this.config}
101
+ .fetchHandler=${this.fetchHandler}
102
+ .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
103
+ >
92
104
  <div slot="headroom" class="header">
93
- <div class="title">
94
- <mwc-icon>summarize</mwc-icon>
95
- ${i18next.t('text.addon-menu management')}
96
- </div>
105
+ <div class="title">${i18next.t('text.addon-menu management')}</div>
97
106
 
98
107
  <div class="filters">
99
108
  <ox-filters-form autofocus without-search></ox-filters-form>
@@ -101,6 +110,8 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
101
110
 
102
111
  <ox-context-page-toolbar class="actions" .context=${this.context}> </ox-context-page-toolbar>
103
112
  </div>
113
+
114
+ <ox-grist-personalizer slot="setting"></ox-grist-personalizer>
104
115
  </ox-grist>
105
116
  `
106
117
  }
@@ -126,6 +137,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
126
137
  rank: record.rank,
127
138
  active: record.active,
128
139
  privilege: record.privilege,
140
+ labels: record.labels,
129
141
  type: record.type,
130
142
  value: record.value,
131
143
  icon: record.icon
@@ -220,7 +232,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
220
232
  fetchAddonMenus() /* update menu-system */
221
233
  }
222
234
 
223
- async pageInitialized() {
235
+ async pageInitialized(lifecycle) {
224
236
  this.config = {
225
237
  list: {
226
238
  thumbnail: 'value',
@@ -261,6 +273,25 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
261
273
  sortable: true,
262
274
  width: 120
263
275
  },
276
+ {
277
+ type: 'i18n-label',
278
+ name: 'labels',
279
+ record: {
280
+ align: 'left',
281
+ editable: true,
282
+ renderer: (value, column, record, rowIndex, field) =>
283
+ html`<span>${value && typeof value == 'object' ? value[i18next.language] : record['name']}</span>`,
284
+ options: {
285
+ objectified: true,
286
+ languages: await getLanguages(),
287
+ displayColumn: 'label'
288
+ }
289
+ },
290
+ header: i18next.t('field.i18n-label'),
291
+ sortable: true,
292
+ filter: 'search',
293
+ width: 120
294
+ },
264
295
  {
265
296
  type: 'string',
266
297
  name: 'description',
@@ -427,7 +458,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
427
458
  }
428
459
  }
429
460
 
430
- async fetchHandler({ filters = [], page, limit, sortings = [] }) {
461
+ async fetchHandler({ filters = [], page, limit, sortings = [] }: FetchOption) {
431
462
  const response = (
432
463
  await client.query({
433
464
  query: gql`
@@ -436,6 +467,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
436
467
  items {
437
468
  id
438
469
  name
470
+ label
439
471
  description
440
472
  appName
441
473
  parent
@@ -456,6 +488,7 @@ class AddonMenuSetting extends connect(store)(localize(i18next)(PageView)) {
456
488
  owner
457
489
  super
458
490
  }
491
+ labels
459
492
  createdAt
460
493
  updatedAt
461
494
  creator {
@@ -30,7 +30,7 @@ function buildMenus(template, addon) {
30
30
  /* iterate group to put menu into parent menu */
31
31
  groups.forEach(group => {
32
32
  group.forEach(menu => {
33
- const { parent, name, rank, type, value, icon } = menu
33
+ const { parent, name, rank, label, type, value, icon } = menu
34
34
 
35
35
  const parentMenu = parent && menus.find(m => m.name === parent)
36
36
  if (parentMenu && !parentMenu.menus) {
@@ -39,15 +39,17 @@ function buildMenus(template, addon) {
39
39
  const children = parentMenu ? parentMenu.menus : menus
40
40
  children.push({
41
41
  name,
42
+ label,
43
+ rank,
42
44
  type,
43
45
  path:
44
46
  type === 'page'
45
47
  ? value
46
48
  : type === 'board'
47
- ? `board-viewer/${value}?title=${name}`
48
- : type === 'interactive-board'
49
- ? `board-viewer/${value}?interactive=true&title=${name}`
50
- : '',
49
+ ? `board-viewer/${value ?? ''}?title=${label || name}`
50
+ : type === 'interactive-board'
51
+ ? `board-viewer/${value ?? ''}?interactive=true&title=${label || name}`
52
+ : '',
51
53
  icon: icon || (type === 'page' ? 'menu' : type === 'board' || type === 'interactive-board' ? 'dashboard' : '')
52
54
  })
53
55
  })
@@ -1,7 +1,7 @@
1
+ import '@material/web/icon/icon.js';
1
2
  import '@operato/menu/ox-menu-part.js';
2
- import '@material/mwc-icon';
3
3
  export declare const UPDATE_ADDON_MENUS = "UPDATE_ADDON_MENUS";
4
4
  export declare const UPDATE_MENU_TEMPLATE = "UPDATE_MENU_TEMPLATE";
5
5
  export declare function setupMenuPart(options: any): Promise<void>;
6
- export declare function updateMenuTemplate(template: any): void;
6
+ export declare function updateMenuTemplate(template: any): Promise<void>;
7
7
  export declare function fetchAddonMenus(): Promise<void>;
@@ -1,13 +1,12 @@
1
+ import '@material/web/icon/icon.js';
1
2
  import '@operato/menu/ox-menu-part.js';
2
- import '@material/mwc-icon';
3
3
  import gql from 'graphql-tag';
4
4
  import { html } from 'lit';
5
+ import { store, InheritedValueType, clientSettingStore } from '@operato/shell';
5
6
  import { client } from '@operato/graphql';
6
7
  import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout';
7
- import { store, InheritedValueType } from '@operato/shell';
8
8
  import { isMobileDevice } from '@operato/utils';
9
- import { clientSettingStore } from '@operato/shell';
10
- import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base';
9
+ import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base/client';
11
10
  export const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS';
12
11
  export const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE';
13
12
  var HAMBURGER;
@@ -36,11 +35,11 @@ export async function setupMenuPart(options) {
36
35
  HAMBURGER = {
37
36
  name: 'hamburger',
38
37
  template: html `
39
- <mwc-icon
38
+ <md-icon
40
39
  @click=${e => toggleOverlay('ox-menu-part', {
41
40
  backdrop: true
42
41
  })}
43
- >view_headline</mwc-icon
42
+ >view_headline</md-icon
44
43
  >
45
44
  `,
46
45
  position: TOOL_POSITION.FRONT_END
@@ -62,12 +61,12 @@ export async function setupMenuPart(options) {
62
61
  }
63
62
  }
64
63
  }
65
- export function updateMenuTemplate(template) {
64
+ export async function updateMenuTemplate(template) {
65
+ await fetchAddonMenus();
66
66
  store.dispatch({
67
67
  type: UPDATE_MENU_TEMPLATE,
68
68
  template
69
69
  });
70
- fetchAddonMenus();
71
70
  }
72
71
  export async function fetchAddonMenus() {
73
72
  var _a;
@@ -79,6 +78,7 @@ export async function fetchAddonMenus() {
79
78
  items {
80
79
  id
81
80
  name
81
+ label
82
82
  description
83
83
  appName
84
84
  parent
@@ -105,6 +105,12 @@ export async function fetchAddonMenus() {
105
105
  value: ['', applicationName]
106
106
  }
107
107
  ],
108
+ sortings: [
109
+ {
110
+ name: 'rank',
111
+ desc: false
112
+ }
113
+ ],
108
114
  inherited: InheritedValueType.Include
109
115
  }
110
116
  })).data.liteMenus.items;
@@ -1 +1 @@
1
- {"version":3,"file":"lite-menu.js","sourceRoot":"","sources":["../../client/actions/lite-menu.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,oBAAoB,CAAA;AAE3B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,IAAI,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AC,aAAa,CAAC,+BAA+B,CAAqB,0CAAE,OAAO,CAAA;IAE3G,IAAI,SAAS,GAAG,CACd,MAAM,MAAM,CAAC,KAAK,CAAC;QACjB,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;OAkBT;QACD,SAAS,EAAE;YACT,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,IAAI;iBACZ;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC;iBAC7B;aACF;YACD,SAAS,EAAE,kBAAkB,CAAC,OAAO;SACtC;KACF,CAAC,CACH,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;IAEtB,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,eAAe,CAAC;KACnF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import '@operato/menu/ox-menu-part.js'\nimport '@material/mwc-icon'\n\nimport gql from 'graphql-tag'\nimport { html } from 'lit'\n\nimport { client } from '@operato/graphql'\nimport { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'\nimport { store, InheritedValueType } from '@operato/shell'\nimport { isMobileDevice } from '@operato/utils'\nimport { clientSettingStore } from '@operato/shell'\nimport { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base'\n\nexport const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS'\nexport const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'\n\nvar HAMBURGER\n\nexport async function setupMenuPart(options) {\n var { hovering = isMobileDevice() ? true : false, slotTemplate, portraitSlotTemplate, landscapeSlotTemplate, position = VIEWPART_POSITION.NAVBAR } = options || {}\n\n const { hovering: hoveringSetting } = (await clientSettingStore.get('lite-menu'))?.value || {}\n if (hoveringSetting !== undefined) {\n hovering = hoveringSetting\n }\n\n const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'\n const orientatedSlotTemplate = (orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``\n\n appendViewpart({\n name: 'ox-menu-part',\n viewpart: {\n show: !hovering,\n resizable: true,\n hovering: isMobileDevice() ? true : hovering,\n template: html` <ox-menu-part .orientation=${orientation}>${orientatedSlotTemplate}</ox-menu-part> `\n },\n position\n })\n\n // hovering이 true거나 모바일 일때는 계속 햄버거 버튼 표시\n if ((hovering || isMobileDevice()) && orientation == 'portrait') {\n if (!HAMBURGER) {\n HAMBURGER = {\n name: 'hamburger',\n template: html`\n <mwc-icon\n @click=${e =>\n toggleOverlay('ox-menu-part', {\n backdrop: true\n })}\n >view_headline</mwc-icon\n >\n `,\n position: TOOL_POSITION.FRONT_END\n }\n\n store.dispatch({\n /* incase of mobile : add hamburger tool */\n type: APPEND_APP_TOOL,\n tool: HAMBURGER\n })\n }\n } else {\n if (HAMBURGER) {\n store.dispatch({\n type: REMOVE_APP_TOOL,\n name: 'hamburger'\n })\n\n HAMBURGER = null\n }\n }\n}\n\nexport function updateMenuTemplate(template) {\n store.dispatch({\n type: UPDATE_MENU_TEMPLATE,\n template\n })\n\n fetchAddonMenus()\n}\n\nexport async function fetchAddonMenus() {\n var applicationName = (document.querySelector('meta[name=\"application-name\"]') as HTMLMetaElement)?.content\n\n var liteMenus = (\n await client.query({\n query: gql`\n query ($filters: [Filter!], $inherited: InheritedValueType) {\n liteMenus: myLiteMenus(filters: $filters, inherited: $inherited) {\n items {\n id\n name\n description\n appName\n parent\n rank\n active\n type\n value\n icon\n }\n total\n }\n }\n `,\n variables: {\n filters: [\n {\n name: 'active',\n operator: 'eq',\n value: true\n },\n {\n name: 'appName',\n operator: 'in',\n value: ['', applicationName]\n }\n ],\n inherited: InheritedValueType.Include\n }\n })\n ).data.liteMenus.items\n\n store.dispatch({\n type: UPDATE_ADDON_MENUS,\n addon: liteMenus.filter(menu => !menu.appName || menu.appName === applicationName)\n })\n}\n"]}
1
+ {"version":3,"file":"lite-menu.js","sourceRoot":"","sources":["../../client/actions/lite-menu.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,+BAA+B,CAAA;AAEtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAEtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAA;AAE1D,IAAI,SAAS,CAAA;AAEb,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAO;;IACzC,IAAI,EAAE,QAAQ,GAAG,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,QAAQ,GAAG,iBAAiB,CAAC,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAElK,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,CAAA,MAAA,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,0CAA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\nimport { html } from 'lit'\n\nimport { store, InheritedValueType, clientSettingStore } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base/client'\n\nexport const UPDATE_ADDON_MENUS = 'UPDATE_ADDON_MENUS'\nexport const UPDATE_MENU_TEMPLATE = 'UPDATE_MENU_TEMPLATE'\n\nvar HAMBURGER\n\nexport async function setupMenuPart(options) {\n var { hovering = isMobileDevice() ? true : false, slotTemplate, portraitSlotTemplate, landscapeSlotTemplate, position = VIEWPART_POSITION.NAVBAR } = options || {}\n\n const { hovering: hoveringSetting } = (await clientSettingStore.get('lite-menu'))?.value || {}\n if (hoveringSetting !== undefined) {\n hovering = hoveringSetting\n }\n\n const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'\n const orientatedSlotTemplate = (orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``\n\n appendViewpart({\n name: 'ox-menu-part',\n viewpart: {\n show: !hovering,\n resizable: true,\n hovering: isMobileDevice() ? true : hovering,\n template: html` <ox-menu-part .orientation=${orientation}>${orientatedSlotTemplate}</ox-menu-part> `\n },\n position\n })\n\n // hovering이 true거나 모바일 일때는 계속 햄버거 버튼 표시\n if ((hovering || isMobileDevice()) && orientation == 'portrait') {\n if (!HAMBURGER) {\n HAMBURGER = {\n name: 'hamburger',\n template: html`\n <md-icon\n @click=${e =>\n toggleOverlay('ox-menu-part', {\n backdrop: true\n })}\n >view_headline</md-icon\n >\n `,\n position: TOOL_POSITION.FRONT_END\n }\n\n store.dispatch({\n /* incase of mobile : add hamburger tool */\n type: APPEND_APP_TOOL,\n tool: HAMBURGER\n })\n }\n } else {\n if (HAMBURGER) {\n store.dispatch({\n type: REMOVE_APP_TOOL,\n name: 'hamburger'\n })\n\n HAMBURGER = null\n }\n }\n}\n\nexport async function updateMenuTemplate(template) {\n await fetchAddonMenus()\n\n store.dispatch({\n type: UPDATE_MENU_TEMPLATE,\n template\n })\n}\n\nexport async function fetchAddonMenus() {\n var applicationName = (document.querySelector('meta[name=\"application-name\"]') as HTMLMetaElement)?.content\n\n var liteMenus = (\n await client.query({\n query: gql`\n query ($filters: [Filter!], $inherited: InheritedValueType) {\n liteMenus: myLiteMenus(filters: $filters, inherited: $inherited) {\n items {\n id\n name\n label\n description\n appName\n parent\n rank\n active\n type\n value\n icon\n }\n total\n }\n }\n `,\n variables: {\n filters: [\n {\n name: 'active',\n operator: 'eq',\n value: true\n },\n {\n name: 'appName',\n operator: 'in',\n value: ['', applicationName]\n }\n ],\n sortings: [\n {\n name: 'rank',\n desc: false\n }\n ],\n inherited: InheritedValueType.Include\n }\n })\n ).data.liteMenus.items\n\n store.dispatch({\n type: UPDATE_ADDON_MENUS,\n addon: liteMenus.filter(menu => !menu.appName || menu.appName === applicationName)\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import '@material/mwc-icon';
1
+ import '@material/web/icon/icon.js';
2
2
  import '@operato/i18n/ox-i18n.js';
3
3
  import './route';
4
4
  export default function bootstrap(): void;
@@ -1,9 +1,12 @@
1
- import '@material/mwc-icon';
1
+ import '@material/web/icon/icon.js';
2
2
  import '@operato/i18n/ox-i18n.js';
3
3
  import './route';
4
4
  import { store } from '@operato/shell';
5
+ import { registerEditor as registerGristEditor } from '@operato/data-grist';
6
+ import { OxGristEditorI18nLabel } from '@operato/grist-editor/ox-grist-editor-i18n-label.js';
5
7
  import liteMenu from './reducers/lite-menu';
6
8
  export default function bootstrap() {
9
+ registerGristEditor('i18n-label', OxGristEditorI18nLabel);
7
10
  store.addReducers({ liteMenu });
8
11
  }
9
12
  //# sourceMappingURL=bootstrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,0BAA0B,CAAA;AACjC,OAAO,SAAS,CAAA;AAEhB,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAE3C,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,KAAK,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import '@material/mwc-icon'\nimport '@operato/i18n/ox-i18n.js'\nimport './route'\n\nimport { store } from '@operato/shell'\nimport liteMenu from './reducers/lite-menu'\n\nexport default function bootstrap() {\n store.addReducers({ liteMenu })\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,SAAS,CAAA;AAEhB,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAA;AAE5F,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAE3C,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAA;IAEzD,KAAK,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport './route'\n\nimport { store } from '@operato/shell'\n\nimport { registerEditor as registerGristEditor } from '@operato/data-grist'\nimport { OxGristEditorI18nLabel } from '@operato/grist-editor/ox-grist-editor-i18n-label.js'\n\nimport liteMenu from './reducers/lite-menu'\n\nexport default function bootstrap() {\n registerGristEditor('i18n-label', OxGristEditorI18nLabel)\n\n store.addReducers({ liteMenu })\n}\n"]}
@@ -1,6 +1,5 @@
1
- import '@material/mwc-formfield';
2
- import '@material/mwc-checkbox';
3
1
  import '@operato/i18n/ox-i18n.js';
2
+ import '@material/web/checkbox/checkbox.js';
4
3
  import { LitElement } from 'lit';
5
4
  declare const LiteMenuSettingLet_base: (new (...args: any[]) => LitElement) & typeof LitElement;
6
5
  export declare class LiteMenuSettingLet extends LiteMenuSettingLet_base {
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import '@material/mwc-formfield';
3
- import '@material/mwc-checkbox';
4
2
  import '@operato/i18n/ox-i18n.js';
3
+ import '@material/web/checkbox/checkbox.js';
5
4
  import { css, html, LitElement } from 'lit';
6
5
  import { customElement, property } from 'lit/decorators.js';
7
6
  import { clientSettingStore } from '@operato/shell';
@@ -16,9 +15,15 @@ let LiteMenuSettingLet = class LiteMenuSettingLet extends localize(i18next)(LitE
16
15
  <ox-i18n slot="title" msgid="title.lite-menu-setting"></ox-i18n>
17
16
 
18
17
  <div slot="content">
19
- <mwc-formfield label="hovering">
20
- <mwc-checkbox id="hovering" @change=${e => this.onChange(e)} ?checked=${checked} ?indeterminate=${indeterminate}></mwc-checkbox>
21
- </mwc-formfield>
18
+ <label>
19
+ <md-checkbox
20
+ id="hovering"
21
+ @change=${e => this.onChange(e)}
22
+ ?checked=${checked}
23
+ ?indeterminate=${indeterminate}
24
+ ></md-checkbox>
25
+ hovering
26
+ </label>
22
27
  </div>
23
28
  </setting-let>
24
29
  `;
@@ -61,8 +66,12 @@ let LiteMenuSettingLet = class LiteMenuSettingLet extends localize(i18next)(LitE
61
66
  LiteMenuSettingLet.styles = [
62
67
  css `
63
68
  label {
69
+ display: flex;
70
+ gap: 10px;
71
+ align-items: center;
72
+
64
73
  font: var(--label-font);
65
- color: var(--label-color);
74
+ color: var(--md-sys-color-on-primary-container);
66
75
  text-transform: var(--label-text-transform);
67
76
  }
68
77
  `
@@ -1 +1 @@
1
- {"version":3,"file":"lite-menu-setting-let.js","s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AS,CAAA;SAC1B;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;SACrB;QAED,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,CAAA,MAAA,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,0CAAE,KAAK,KAAI,EAAE,CAAA;QAC7F,IAAI,IAAI,CAAC,QAAQ,KAAK,cAAc,EAAE;YACpC,OAAM;SACP;QAED,IAAI;YACF,MAAM,kBAAkB,CAAC,GAAG,CAAC;gBAC3B,GAAG,EAAE,WAAW;gBAChB,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACxB;aACF,CAAC,CAAA;SACH;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACjB;QAED,aAAa,CAAC;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAA;IACJ,CAAC;;AA7DM,yBAAM,GAAG;IACd,GAAG,CAAA;;;;;;KAMF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;oDAAmB;AAXpC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CA+D9B;SA/DY,kBAAkB","sourcesContent":["import '@material/mwc-formfield'\nimport '@material/mwc-checkbox'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, query, property, state } from 'lit/decorators.js'\n\nimport { clientSettingStore } from '@operato/shell'\nimport { i18next, localize } from '@operato/i18n'\n\nimport { setupMenuPart } from './actions/lite-menu'\n\n@customElement('lite-menu-setting-let')\nexport class LiteMenuSettingLet extends localize(i18next)(LitElement) {\n static styles = [\n css`\n label {\n font: var(--label-font);\n color: var(--label-color);\n text-transform: var(--label-text-transform);\n }\n `\n ]\n\n @property({ type: Boolean }) hovering?: boolean\n\n render() {\n const checked = this.hovering === true\n const indeterminate = this.hovering === undefined\n\n return html`\n <setting-let>\n <ox-i18n slot=\"title\" msgid=\"title.lite-menu-setting\"></ox-i18n>\n\n <div slot=\"content\">\n <mwc-formfield label=\"hovering\">\n <mwc-checkbox id=\"hovering\" @change=${e => this.onChange(e)} ?checked=${checked} ?indeterminate=${indeterminate}></mwc-checkbox>\n </mwc-formfield>\n </div>\n </setting-let>\n `\n }\n\n async firstUpdated() {\n this.hovering = ((await clientSettingStore.get('lite-menu'))?.value || {}).hovering\n }\n\n async onChange(e: Event) {\n if (this.hovering === true) {\n this.hovering = false\n } else if (this.hovering === false) {\n this.hovering = undefined\n } else {\n this.hovering = true\n }\n\n const { hovering: valueFromStore } = (await clientSettingStore.get('lite-menu'))?.value || {}\n if (this.hovering === valueFromStore) {\n return\n }\n\n try {\n await clientSettingStore.put({\n key: 'lite-menu',\n value: {\n hovering: this.hovering\n }\n })\n } catch (e) {\n console.error(e)\n }\n\n setupMenuPart({\n hovering: this.hovering\n })\n }\n}\n"]}
1
+ {"version":3,"file":"lite-menu-setting-let.js","sourceRoot":"","sources":["../client/lite-menu-setting-let.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAS,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAG5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAiBnE,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,KAAK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CAAC,CAAA;IACJ,CAAC;;AAvEM,yBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;KAUF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;oDAAmB;AAfpC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAyE9B;SAzEY,kBAAkB","sourcesContent":["import '@operato/i18n/ox-i18n.js'\nimport '@material/web/checkbox/checkbox.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, query, property, state } from 'lit/decorators.js'\n\nimport { clientSettingStore } from '@operato/shell'\nimport { i18next, localize } from '@operato/i18n'\n\nimport { setupMenuPart } from './actions/lite-menu'\n\n@customElement('lite-menu-setting-let')\nexport class LiteMenuSettingLet extends localize(i18next)(LitElement) {\n static styles = [\n css`\n label {\n display: flex;\n gap: 10px;\n align-items: center;\n\n font: var(--label-font);\n color: var(--md-sys-color-on-primary-container);\n text-transform: var(--label-text-transform);\n }\n `\n ]\n\n @property({ type: Boolean }) hovering?: boolean\n\n render() {\n const checked = this.hovering === true\n const indeterminate = this.hovering === undefined\n\n return html`\n <setting-let>\n <ox-i18n slot=\"title\" msgid=\"title.lite-menu-setting\"></ox-i18n>\n\n <div slot=\"content\">\n <label>\n <md-checkbox\n id=\"hovering\"\n @change=${e => this.onChange(e)}\n ?checked=${checked}\n ?indeterminate=${indeterminate}\n ></md-checkbox>\n hovering\n </label>\n </div>\n </setting-let>\n `\n }\n\n async firstUpdated() {\n this.hovering = ((await clientSettingStore.get('lite-menu'))?.value || {}).hovering\n }\n\n async onChange(e: Event) {\n if (this.hovering === true) {\n this.hovering = false\n } else if (this.hovering === false) {\n this.hovering = undefined\n } else {\n this.hovering = true\n }\n\n const { hovering: valueFromStore } = (await clientSettingStore.get('lite-menu'))?.value || {}\n if (this.hovering === valueFromStore) {\n return\n }\n\n try {\n await clientSettingStore.put({\n key: 'lite-menu',\n value: {\n hovering: this.hovering\n }\n })\n } catch (e) {\n console.error(e)\n }\n\n setupMenuPart({\n hovering: this.hovering\n })\n }\n}\n"]}
@@ -4,4 +4,3 @@ import '@operato/data-grist/ox-sorters-control.js';
4
4
  import '@operato/data-grist/ox-record-creator.js';
5
5
  import '@operato/popup/ox-popup.js';
6
6
  import '@operato/context/ox-context-page-toolbar.js';
7
- import '@material/mwc-icon';