@operato/app 1.2.46 → 1.2.48
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 +17 -0
- package/dist/src/selector/ox-selector-resource-id.d.ts +3 -2
- package/dist/src/selector/ox-selector-resource-id.js +9 -4
- package/dist/src/selector/ox-selector-resource-id.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.d.ts +3 -2
- package/dist/src/selector/ox-selector-resource-object-legacy.js +12 -5
- package/dist/src/selector/ox-selector-resource-object-legacy.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object.d.ts +2 -1
- package/dist/src/selector/ox-selector-resource-object.js +13 -4
- package/dist/src/selector/ox-selector-resource-object.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/selector/ox-selector-resource-id.ts +7 -5
- package/src/selector/ox-selector-resource-object-legacy.ts +11 -4
- package/src/selector/ox-selector-resource-object.ts +21 -5
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": "1.2.
|
|
5
|
+
"version": "1.2.48",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -119,16 +119,16 @@
|
|
|
119
119
|
"@material/mwc-button": "^0.27.0",
|
|
120
120
|
"@material/mwc-icon": "^0.27.0",
|
|
121
121
|
"@material/mwc-icon-button": "^0.27.0",
|
|
122
|
-
"@operato/attachment": "^1.2.
|
|
123
|
-
"@operato/data-grist": "^1.2.
|
|
124
|
-
"@operato/font": "^1.2.
|
|
122
|
+
"@operato/attachment": "^1.2.48",
|
|
123
|
+
"@operato/data-grist": "^1.2.47",
|
|
124
|
+
"@operato/font": "^1.2.48",
|
|
125
125
|
"@operato/form": "^1.2.46",
|
|
126
126
|
"@operato/graphql": "^1.2.46",
|
|
127
127
|
"@operato/i18n": "^1.2.35",
|
|
128
128
|
"@operato/input": "^1.2.39",
|
|
129
|
-
"@operato/layout": "^1.2.
|
|
130
|
-
"@operato/property-editor": "^1.2.
|
|
131
|
-
"@operato/shell": "^1.2.
|
|
129
|
+
"@operato/layout": "^1.2.48",
|
|
130
|
+
"@operato/property-editor": "^1.2.48",
|
|
131
|
+
"@operato/shell": "^1.2.48",
|
|
132
132
|
"@operato/styles": "^1.2.35",
|
|
133
133
|
"@operato/utils": "^1.2.35",
|
|
134
134
|
"codemirror": "^5.64.0",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"prettier --write"
|
|
172
172
|
]
|
|
173
173
|
},
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "544b53dcf92cddc36c9b44f802fe862920a3a683"
|
|
175
175
|
}
|
|
@@ -4,7 +4,7 @@ import gql from 'graphql-tag'
|
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
|
5
5
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
6
|
|
|
7
|
-
import { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'
|
|
7
|
+
import { DataGrist, FetchOption, GristData, GristRecord, InheritedValueType, ZERO_DATA } from '@operato/data-grist'
|
|
8
8
|
import { client } from '@operato/graphql'
|
|
9
9
|
import { i18next } from '@operato/i18n'
|
|
10
10
|
import { closePopup } from '@operato/popup'
|
|
@@ -52,6 +52,7 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
52
52
|
@property({ type: Object }) data: GristData = ZERO_DATA
|
|
53
53
|
@property({ type: String }) queryName!: string
|
|
54
54
|
@property({ type: Object }) basicArgs: any
|
|
55
|
+
@property({ type: String }) inherited?: InheritedValueType = 'Include'
|
|
55
56
|
@property({ type: Object }) confirmCallback?: (record?: GristRecord) => void
|
|
56
57
|
@property({ type: Array }) selectedRecords: GristRecord[] = []
|
|
57
58
|
|
|
@@ -163,11 +164,11 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
163
164
|
this.grist.focus()
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
async fetchHandler({ page = 1, limit = 100, sorters = [], filters = [] }: FetchOption) {
|
|
167
|
+
async fetchHandler({ page = 1, limit = 100, sorters = [], filters = [], inherited }: FetchOption) {
|
|
167
168
|
const response = await client.query({
|
|
168
169
|
query: gql`
|
|
169
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
170
|
-
q: ${this.queryName}(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
170
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $inherited) {
|
|
171
|
+
q: ${this.queryName}(filters: $filters, pagination: $pagination, sortings: $sortings, inhereted: $inherited) {
|
|
171
172
|
items {
|
|
172
173
|
id
|
|
173
174
|
name
|
|
@@ -180,7 +181,8 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
180
181
|
variables: {
|
|
181
182
|
filters,
|
|
182
183
|
pagination: { page, limit },
|
|
183
|
-
sortings: sorters
|
|
184
|
+
sortings: sorters,
|
|
185
|
+
inherited: inherited || this.inherited
|
|
184
186
|
}
|
|
185
187
|
})
|
|
186
188
|
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
GristData,
|
|
14
14
|
GristEventHandler,
|
|
15
15
|
GristRecord,
|
|
16
|
+
InheritedValueType,
|
|
16
17
|
ZERO_DATA
|
|
17
18
|
} from '@operato/data-grist'
|
|
18
19
|
import { MultiColumnFormStyles, SearchForm } from '@operato/form'
|
|
@@ -60,6 +61,7 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
60
61
|
@property({ type: Object }) data: GristData = ZERO_DATA
|
|
61
62
|
@property({ type: String }) queryName!: string
|
|
62
63
|
@property({ type: Object }) basicArgs: any
|
|
64
|
+
@property({ type: String }) inherited?: InheritedValueType = 'Include'
|
|
63
65
|
@property({ type: Object }) confirmCallback?: (record?: GristRecord | null) => void
|
|
64
66
|
@property({ type: Array }) selectedRecords: GristRecord[] = []
|
|
65
67
|
|
|
@@ -130,15 +132,19 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
130
132
|
closePopup(this)
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
fetchHandler: FetchHandler = async ({ filters, page, limit, sorters = [] }) => {
|
|
135
|
+
fetchHandler: FetchHandler = async ({ filters, page, limit, sorters = [], inherited }) => {
|
|
134
136
|
const response = await client.query({
|
|
135
137
|
query: gql`
|
|
136
|
-
query {
|
|
137
|
-
fetch: ${
|
|
138
|
+
query($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $inherited: InheritedValueType) {
|
|
139
|
+
fetch: ${
|
|
140
|
+
this.queryName
|
|
141
|
+
} (filters: $filters, pagination: $pagination, sortings: $sortings, inherited: $inherited)
|
|
142
|
+
{
|
|
138
143
|
${this.getSelectFields()}
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
146
|
`,
|
|
147
|
+
variables: await this._buildConditions({ filters, page, limit, sorters, inherited: inherited || this.inherited }),
|
|
142
148
|
context: gqlContext()
|
|
143
149
|
})
|
|
144
150
|
|
|
@@ -339,7 +345,7 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
339
345
|
}
|
|
340
346
|
}
|
|
341
347
|
|
|
342
|
-
async _buildConditions({ filters, page, limit, sorters }: FetchOption) {
|
|
348
|
+
async _buildConditions({ filters, page, limit, sorters, inherited }: FetchOption) {
|
|
343
349
|
const queryConditions = {
|
|
344
350
|
filters: [],
|
|
345
351
|
...this.basicArgs
|
|
@@ -348,6 +354,7 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
348
354
|
queryConditions.filters = [...queryConditions.filters, ...(await this.searchForm.getQueryFilters())]
|
|
349
355
|
queryConditions.pagination = { page, limit }
|
|
350
356
|
queryConditions.sortings = sorters
|
|
357
|
+
queryConditions.inherited = inherited
|
|
351
358
|
|
|
352
359
|
return queryConditions
|
|
353
360
|
}
|
|
@@ -4,7 +4,15 @@ import gql from 'graphql-tag'
|
|
|
4
4
|
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
5
5
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
DataGrist,
|
|
9
|
+
FetchHandler,
|
|
10
|
+
GristData,
|
|
11
|
+
GristEventHandler,
|
|
12
|
+
GristRecord,
|
|
13
|
+
ZERO_DATA,
|
|
14
|
+
InheritedValueType
|
|
15
|
+
} from '@operato/data-grist'
|
|
8
16
|
import { client, gqlContext } from '@operato/graphql'
|
|
9
17
|
import { i18next } from '@operato/i18n'
|
|
10
18
|
import { closePopup } from '@operato/popup'
|
|
@@ -52,6 +60,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
52
60
|
@property({ type: Object }) data: GristData = ZERO_DATA
|
|
53
61
|
@property({ type: String }) queryName!: string
|
|
54
62
|
@property({ type: Object }) basicArgs: any
|
|
63
|
+
@property({ type: String }) inherited?: InheritedValueType = 'Include'
|
|
55
64
|
@property({ type: Object }) confirmCallback?: (record?: GristRecord | null) => void
|
|
56
65
|
@property({ type: Array }) selectedRecords: GristRecord[] = []
|
|
57
66
|
|
|
@@ -118,7 +127,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
118
127
|
closePopup(this)
|
|
119
128
|
}
|
|
120
129
|
|
|
121
|
-
fetchHandler: FetchHandler = async ({ filters = [], page, limit, sortings = [] }) => {
|
|
130
|
+
fetchHandler: FetchHandler = async ({ filters = [], page, limit, sortings = [], inherited }) => {
|
|
122
131
|
if (this.basicArgs?.filters) {
|
|
123
132
|
filters = adjustFilters(filters, this.basicArgs.filters)
|
|
124
133
|
}
|
|
@@ -126,13 +135,20 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
126
135
|
|
|
127
136
|
const response = await client.query({
|
|
128
137
|
query: gql`
|
|
129
|
-
query($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
130
|
-
fetch: ${
|
|
138
|
+
query($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $inherited: InheritedValueType) {
|
|
139
|
+
fetch: ${
|
|
140
|
+
this.queryName
|
|
141
|
+
} (filters: $filters, pagination: $pagination, sortings: $sortings, inherited: $inherited) {
|
|
131
142
|
${this.getQueryFields()}
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
`,
|
|
135
|
-
variables: {
|
|
146
|
+
variables: {
|
|
147
|
+
filters,
|
|
148
|
+
pagination,
|
|
149
|
+
sortings,
|
|
150
|
+
inherited: inherited || this.inherited
|
|
151
|
+
},
|
|
136
152
|
context: gqlContext()
|
|
137
153
|
})
|
|
138
154
|
|