@operato/app 2.0.0-alpha.6 → 2.0.0-alpha.61

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/app",
3
3
  "description": "WebApplication production supporting components following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-alpha.6",
5
+ "version": "2.0.0-alpha.61",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "exports": {
@@ -136,43 +136,43 @@
136
136
  "@material/mwc-button": "^0.27.0",
137
137
  "@material/mwc-icon": "^0.27.0",
138
138
  "@material/mwc-icon-button": "^0.27.0",
139
- "@operato/attachment": "^2.0.0-alpha.6",
140
- "@operato/data-grist": "^2.0.0-alpha.6",
141
- "@operato/font": "^2.0.0-alpha.6",
142
- "@operato/form": "^2.0.0-alpha.0",
143
- "@operato/graphql": "^2.0.0-alpha.0",
144
- "@operato/i18n": "^2.0.0-alpha.0",
145
- "@operato/input": "^2.0.0-alpha.4",
146
- "@operato/layout": "^2.0.0-alpha.4",
147
- "@operato/property-editor": "^2.0.0-alpha.6",
148
- "@operato/shell": "^2.0.0-alpha.0",
149
- "@operato/styles": "^2.0.0-alpha.0",
150
- "@operato/utils": "^2.0.0-alpha.0",
151
- "cm6-graphql": "^0.0.12",
139
+ "@operato/attachment": "^2.0.0-alpha.61",
140
+ "@operato/data-grist": "^2.0.0-alpha.61",
141
+ "@operato/font": "^2.0.0-alpha.61",
142
+ "@operato/form": "^2.0.0-alpha.57",
143
+ "@operato/graphql": "^2.0.0-alpha.57",
144
+ "@operato/i18n": "^2.0.0-alpha.59",
145
+ "@operato/input": "^2.0.0-alpha.59",
146
+ "@operato/layout": "^2.0.0-alpha.57",
147
+ "@operato/property-editor": "^2.0.0-alpha.61",
148
+ "@operato/shell": "^2.0.0-alpha.57",
149
+ "@operato/styles": "^2.0.0-alpha.57",
150
+ "@operato/utils": "^2.0.0-alpha.57",
151
+ "cm6-graphql": "^0.0.14",
152
152
  "codemirror": "^6.0.1",
153
153
  "cronstrue": "^2.2.0",
154
154
  "cross-fetch": "^3.1.5",
155
155
  "graphql": "^16.5.0",
156
156
  "graphql-config": "^5.0.2",
157
157
  "graphql-tag": "^2.12.6",
158
- "lit": "^2.5.0"
158
+ "lit": "^3.1.2"
159
159
  },
160
160
  "devDependencies": {
161
- "@custom-elements-manifest/analyzer": "^0.8.1",
161
+ "@custom-elements-manifest/analyzer": "^0.9.2",
162
162
  "@hatiolab/prettier-config": "^1.0.0",
163
- "@open-wc/eslint-config": "^10.0.0",
163
+ "@open-wc/eslint-config": "^12.0.3",
164
164
  "@open-wc/testing": "^3.1.6",
165
- "@typescript-eslint/eslint-plugin": "^5.59.1",
166
- "@typescript-eslint/parser": "^5.59.1",
165
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
166
+ "@typescript-eslint/parser": "^7.0.1",
167
167
  "@web/dev-server": "^0.3.0",
168
- "@web/dev-server-storybook": "^0.7.4",
169
- "@web/test-runner": "^0.17.0",
168
+ "@web/dev-server-storybook": "^2.0.1",
169
+ "@web/test-runner": "^0.18.0",
170
170
  "concurrently": "^8.0.1",
171
171
  "eslint": "^8.39.0",
172
- "eslint-config-prettier": "^8.3.0",
173
- "husky": "^8.0.1",
174
- "lint-staged": "^13.2.2",
175
- "prettier": "^2.4.1",
172
+ "eslint-config-prettier": "^9.1.0",
173
+ "husky": "^9.0.11",
174
+ "lint-staged": "^15.2.2",
175
+ "prettier": "^3.2.5",
176
176
  "tslib": "^2.3.1",
177
177
  "typescript": "^5.0.4"
178
178
  },
@@ -189,5 +189,5 @@
189
189
  "prettier --write"
190
190
  ]
191
191
  },
192
- "gitHead": "9b56040758ce57f30663bf7e0934587087a1076b"
192
+ "gitHead": "6ba512f14bf258b7a2d81496af95d81e5247437f"
193
193
  }
@@ -6,22 +6,16 @@ import { html } from 'lit-html'
6
6
  import { FilterConfig, FilterSelectRenderer } from '@operato/form'
7
7
  import { i18next } from '@operato/i18n'
8
8
  import { openPopup } from '@operato/layout'
9
+ import { GristRecord } from '@operato/data-grist'
9
10
 
10
- type SelectedCallback = (value: { id: string; name: string; description: string }) => void
11
+ type SelectedCallback = (value?: Partial<GristRecord>) => void
11
12
 
12
13
  function openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {
13
14
  const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || {}
14
15
 
15
- var actualValue
16
- if (typeof valueField === 'function') {
17
- actualValue = valueField(value)
18
- } else {
19
- actualValue = value?.[valueField]
20
- }
21
-
22
16
  var template = html`
23
17
  <ox-selector-resource-object
24
- .value=${actualValue}
18
+ .value=${value}
25
19
  .confirmCallback=${confirmCallback}
26
20
  .queryName=${queryName}
27
21
  .columns=${select}
@@ -53,9 +47,9 @@ function openResourceSelector(filter: FilterConfig, value: any, confirmCallback:
53
47
 
54
48
  export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner: any) => {
55
49
  const { name, operator = 'like' } = filter
56
- var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {};
57
- const hideValue = value ? value[idField] : '';
58
- const text = value ? value[nameField] : '';
50
+ var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {}
51
+ const hideValue = value ? value[idField] : ''
52
+ const text = value ? value[nameField] : ''
59
53
 
60
54
  return operator === 'like'
61
55
  ? html` <input
@@ -87,26 +81,33 @@ export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner:
87
81
  name='${name}_disp'
88
82
  .value=${text}
89
83
  readonly
84
+ @change=${() => false}
90
85
  @click=${(e: Event) => {
91
86
  e.stopPropagation()
92
- const input = e.target as HTMLInputElement;
87
+
88
+ const input = e.target as HTMLInputElement
89
+ const codeInput =
90
+ owner.tagName.toLowerCase() == 'ox-grid-header'
91
+ ? owner.renderRoot.querySelector(`[name="${name}"]`)
92
+ : owner.renderRoot.querySelector(`form [name="${name}"]`)
93
93
 
94
94
  const confirmCallback = (selected?: { [field: string]: any }) => {
95
- let disp = selected ? selected[idField] : '';
95
+ let disp = selected ? selected[idField] : ''
96
96
 
97
- if(selected && nameField){
98
- disp = selected[nameField];
97
+ if (selected && nameField) {
98
+ disp = selected[nameField]
99
99
  }
100
- input.value = disp;
101
-
102
- let codeInput = owner.tagName.toLowerCase() == 'ox-grid-header'
103
- ? owner.renderRoot.querySelector(`[name="${name}"]`)
104
- : owner.renderRoot.querySelector(`form [name="${name}"]`);
100
+ input.value = disp
105
101
 
106
- const objectValue = selected ? selected[idField] : '';
107
- codeInput.value = objectValue;
102
+ const value = selected ? selected[idField] : ''
103
+ codeInput.value = value
108
104
 
109
- input.dispatchEvent(new Event('change', { bubbles: true }))
105
+ codeInput.dispatchEvent(
106
+ new Event('change', {
107
+ bubbles: true,
108
+ composed: true
109
+ })
110
+ )
110
111
 
111
112
  owner.dispatchEvent(
112
113
  new CustomEvent('filter-change', {
@@ -115,13 +116,13 @@ export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner:
115
116
  detail: {
116
117
  name: name,
117
118
  operator,
118
- value: objectValue
119
+ value
119
120
  }
120
121
  })
121
122
  )
122
123
  }
123
124
 
124
- openResourceSelector(filter, value, confirmCallback)
125
+ openResourceSelector(filter, codeInput.value, confirmCallback)
125
126
  }}
126
127
  />
127
128
  `
@@ -61,7 +61,7 @@ export class OxSelectorResourceObject extends LitElement {
61
61
  @property({ type: String }) queryName!: string
62
62
  @property({ type: Object }) basicArgs: any
63
63
  @property({ type: String }) inherited?: InheritedValueType = InheritedValueType.Include
64
- @property({ type: Object }) confirmCallback?: (record?: GristRecord | null) => void
64
+ @property({ type: Object }) confirmCallback?: (record?: Partial<GristRecord>) => void
65
65
  @property({ type: Array }) selectedRecords: GristRecord[] = []
66
66
 
67
67
  @property({ type: Array }) searchFields: any
@@ -114,7 +114,7 @@ export class OxSelectorResourceObject extends LitElement {
114
114
  }
115
115
 
116
116
  onEmpty() {
117
- this.confirmCallback && this.confirmCallback(null)
117
+ this.confirmCallback && this.confirmCallback()
118
118
  closePopup(this)
119
119
  }
120
120
 
@@ -37,7 +37,7 @@ body {
37
37
 
38
38
  --grid-record-background-color: var(--theme-white-color);
39
39
  --grid-record-odd-background-color: #f9f7f5;
40
- --grid-record-padding: var(--padding-default) 0 var(--padding-default) var(--padding-default);
40
+ --grid-record-padding: 0 5px 0 5px;
41
41
  --grid-record-color: var(--secondary-color);
42
42
  --grid-record-color-hover: var(--primary-color);
43
43
  --grid-record-wide-fontsize: var(--fontsize-small);