@operato/app 9.0.0-beta.0 → 9.0.0-beta.5
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 +18 -0
- package/dist/src/filter-renderer/filter-resource-select.d.ts +1 -1
- package/dist/src/filter-renderer/filter-resource-select.js +1 -1
- package/dist/src/filter-renderer/filter-resource-select.js.map +1 -1
- package/dist/src/filters-form/filter-resource-select.d.ts +1 -1
- package/dist/src/filters-form/filter-resource-select.js +1 -1
- package/dist/src/filters-form/filter-resource-select.js.map +1 -1
- package/dist/src/grist-editor/index.js +1 -1
- package/dist/src/grist-editor/index.js.map +1 -1
- package/dist/stories/ox-selector-resource-object.stories.d.ts +1 -1
- package/dist/stories/ox-selector-resource-object.stories.js +1 -1
- package/dist/stories/ox-selector-resource-object.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @operato/app
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filter-renderer/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filter-renderer/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,SAAS,oBAAoB,CAAC,MAAoB,EAAE,KAAU,EAAE,eAAiC;IAC/F,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAA;IAE9F,IAAI,WAAW,CAAA;IACf,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,CAAC;QACrC,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;SAAM,CAAC;QACN,WAAW,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,UAAU,CAAC,CAAA;IACnC,CAAC;IAED,IAAI,QAAQ,GAAG,IAAI,CAAA;;eAEN,WAAW;yBACD,eAAe;mBACrB,SAAS;iBACX,MAAM;cACT,IAAI;mBACC,SAAS;oBACR,UAAU;;GAE3B,CAAA;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;QAChC,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;wBACrD,SAAS,CAAC,KAAK,GAAG,WAAW,CAAA;wBAE7B,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;wBAE3D,KAAK,CAAC,aAAa,CACjB,IAAI,WAAW,CAAC,eAAe,EAAE;4BAC/B,OAAO,EAAE,IAAI;4BACb,QAAQ,EAAE,IAAI;4BACd,MAAM,EAAE;gCACN,IAAI,EAAE,MAAM,CAAC,IAAI;gCACjB,QAAQ;gCACR,KAAK,EAAE,WAAW;6BACnB;yBACF,CAAC,CACH,CAAA;oBACH,CAAC,CAAA;oBAED,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAA;gBACtD,CAAC;;WAEJ;gBACH,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import '@operato/input/ox-checkbox.js'\nimport '../selector/ox-selector-resource-id.js'\n\nimport { html } from 'lit-html'\n\nimport { ColumnConfig, FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\ntype SelectedCallback = (value: { id: string; name: string; description: string }) => void\n\nfunction openResourceSelector(column: ColumnConfig, value: any, confirmCallback: SelectedCallback) {\n const { queryName, select, list, basicArgs, valueField = 'id', title } = column.record.options\n\n var actualValue\n if (typeof valueField === 'function') {\n actualValue = valueField(value)\n } else {\n actualValue = value?.[valueField]\n }\n\n var template = html`\n <ox-selector-resource-object\n .value=${actualValue}\n .confirmCallback=${confirmCallback}\n .queryName=${queryName}\n .columns=${select}\n .list=${list}\n .basicArgs=${basicArgs}\n .valueField=${valueField}\n ></ox-selector-resource-object>\n `\n\n const popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n search: {\n autofocus: true,\n placeholder: title || i18next.t('title.select_item'),\n handler: (instance: any, value: any) => {\n /* instance: template instance */\n instance.searchText(value)\n }\n },\n filter: {\n handler: (instance: any) => {\n /* instance: template instance */\n instance.toggleFilter()\n }\n }\n })\n}\n\nexport const FilterResourceSelect: FilterSelectRenderer = (column, value, owner: any) => {\n const filter = column.filter as FilterConfigObject\n const { operator = 'like' } = filter\n var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}\n const hideValue = value ? value[idField] : ''\n const text = value ? value[nameField] : ''\n\n return operator === 'like'\n ? html` <input\n type=\"text\"\n name=${column.name}\n .value=${text}\n @change=${(e: CustomEvent) => {\n const input = e.target as HTMLInputElement\n input.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name: column.name,\n operator,\n value: input.value\n }\n })\n )\n }}\n />`\n : operator == 'in'\n ? html``\n : operator === 'eq'\n ? html`\n <input name=\"${column.name}\" .value=${hideValue} type=\"text\" hidden />\n <input\n type=\"text\"\n name=\"${column.name}_disp\"\n .value=${text}\n readonly\n @click=${(e: Event) => {\n e.stopPropagation()\n\n const input = e.target as HTMLInputElement\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n let disp = selected ? selected[idField] : ''\n\n if (selected && nameField) {\n disp = selected[nameField]\n }\n\n input.value = disp\n\n let codeInput =\n owner.tagName.toLowerCase() == 'ox-grid-header'\n ? owner.renderRoot.querySelector(`[name=\"${column.name}\"]`)\n : owner.renderRoot.querySelector(`form [name=\"${column.name}\"]`)\n\n const objectValue = selected ? selected[idField] : ''\n codeInput.value = objectValue\n\n input.dispatchEvent(new Event('change', { bubbles: true }))\n\n owner.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name: column.name,\n operator,\n value: objectValue\n }\n })\n )\n }\n\n openResourceSelector(column, value, confirmCallback)\n }}\n />\n `\n : html``\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@operato/input/ox-checkbox.js';
|
|
2
|
-
import '../selector/ox-selector-resource-object';
|
|
2
|
+
import '../selector/ox-selector-resource-object.js';
|
|
3
3
|
import { html } from 'lit-html';
|
|
4
4
|
import { i18next } from '@operato/i18n';
|
|
5
5
|
import { openPopup } from '@operato/layout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filters-form/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filters-form/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,4CAA4C,CAAA;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAK3C,SAAS,oBAAoB,CAAC,MAAoB,EAAE,KAAU,EAAE,eAAiC;IAC/F,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,IAAK,EAAU,CAAA;IAEtG,IAAI,QAAQ,GAAG,IAAI,CAAA;;eAEN,KAAK;yBACK,eAAe;mBACrB,SAAS;iBACX,MAAM;cACT,IAAI;mBACC,SAAS;oBACR,UAAU;;GAE3B,CAAA;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;QAChC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,OAAO;QACb,MAAM,EAAE;YACN,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACpD,OAAO,EAAE,CAAC,QAAa,EAAE,KAAU,EAAE,EAAE;gBACrC,iCAAiC;gBACjC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YAC5B,CAAC;SACF;QACD,MA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AAC,CAAA;oBAED,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;gBAChE,CAAC;;WAEJ;gBACH,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import '@operato/input/ox-checkbox.js'\nimport '../selector/ox-selector-resource-object.js'\n\nimport { html } from 'lit-html'\n\nimport { FilterConfig, FilterSelectRenderer } from '@operato/form'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { GristRecord } from '@operato/data-grist'\n\ntype SelectedCallback = (value?: Partial<GristRecord>) => void\n\nfunction openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {\n const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || ({} as any)\n\n var template = html`\n <ox-selector-resource-object\n .value=${value}\n .confirmCallback=${confirmCallback}\n .queryName=${queryName}\n .columns=${select}\n .list=${list}\n .basicArgs=${basicArgs}\n .valueField=${valueField}\n ></ox-selector-resource-object>\n `\n\n const popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n search: {\n autofocus: true,\n placeholder: title || i18next.t('title.select_item'),\n handler: (instance: any, value: any) => {\n /* instance: template instance */\n instance.searchText(value)\n }\n },\n filter: {\n handler: (instance: any) => {\n /* instance: template instance */\n instance.toggleFilter()\n }\n }\n })\n}\n\nexport const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner: any) => {\n const { name, operator = 'like' } = filter\n var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || ({} as any)\n const hideValue = value ? value[idField] : ''\n const text = value ? value[nameField] : ''\n\n return operator === 'like'\n ? html` <input\n type=\"text\"\n name=${name}\n .value=${text}\n @change=${(e: CustomEvent) => {\n const input = e.target as HTMLInputElement\n input.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name,\n operator,\n value: input.value\n }\n })\n )\n }}\n />`\n : operator == 'in'\n ? html``\n : operator === 'eq'\n ? html`\n <input name=\"${name}\" .value=${hideValue} type=\"text\" hidden />\n <input\n type=\"text\"\n name=\"${name}_disp\"\n .value=${text}\n readonly\n @change=${() => false}\n @click=${(e: Event) => {\n e.stopPropagation()\n\n const input = e.target as HTMLInputElement\n const codeInput =\n owner.tagName.toLowerCase() == 'ox-grid-header'\n ? owner.renderRoot.querySelector(`[name=\"${name}\"]`)\n : owner.renderRoot.querySelector(`form [name=\"${name}\"]`)\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n let disp = selected ? selected[idField] : ''\n\n if (selected && nameField) {\n disp = selected[nameField]\n }\n input.value = disp\n\n const value = selected ? selected[idField] : ''\n codeInput.value = value\n\n codeInput.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true\n })\n )\n\n owner.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name: name,\n operator,\n value\n }\n })\n )\n }\n\n openResourceSelector(filter, codeInput.value, confirmCallback)\n }}\n />\n `\n : html``\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import { OxGristEditorCode } from './ox-grist-editor-code.js';
|
|
|
4
4
|
import { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js';
|
|
5
5
|
import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js';
|
|
6
6
|
import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js';
|
|
7
|
-
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab';
|
|
7
|
+
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js';
|
|
8
8
|
import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js';
|
|
9
9
|
import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js';
|
|
10
10
|
/* register grist renderer/editor for id */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grist-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc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AAC,aAAa,EAAE,yBAAyB,CAAC,CAAA;AAC1D,gBAAgB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAA;AAC5D,gBAAgB,CAAC,iBAAiB,EAAE,6BAA6B,CAAC,CAAA;AAClE,gBAAgB,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAA;AACpD,gBAAgB,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;AACnD,gBAAgB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;AACxD,gBAAgB,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { OxGristEditorJson } from './ox-grist-editor-json.js'\nimport { OxGristEditorCode } from './ox-grist-editor-code.js'\nimport { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js'\nimport { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'\nimport { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'\nimport { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js'\nimport { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'\nimport { OxGristRendererResourceCode } from './ox-grist-renderer-resource-code.js'\nimport { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'\n\n/* register grist renderer/editor for id */\nregisterEditor('resource-id', OxGristEditorResourceId)\nregisterEditor('resource-code', OxGristEditorResourceCode)\nregisterEditor('resource-object', OxGristEditorResourceObject)\nregisterEditor('json', OxGristEditorJson)\nregisterEditor('template', OxGristEditorCode)\n\nregisterRenderer('resource-id', OxGristRendererResourceId)\nregisterRenderer('resource-code', OxGristRendererResourceId)\nregisterRenderer('resource-object', OxGristRendererResourceObject)\nregisterRenderer('parameters', OxGristRendererJson5)\nregisterRenderer('value-map', OxGristRendererJson5)\nregisterRenderer('partition-keys', OxGristRendererJson5)\nregisterRenderer('crontab', OxGristRendererCrontab)\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
3
|
import { setClientLink, createMockLink } from '@operato/graphql/graphql-env.js';
|
|
4
|
-
import '../src/selector/ox-selector-resource-object';
|
|
4
|
+
import '../src/selector/ox-selector-resource-object.js';
|
|
5
5
|
setClientLink(createMockLink({
|
|
6
6
|
request: {
|
|
7
7
|
query: ''
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-selector-resource-object.stories.js","sourceRoot":"","sources":["../../stories/ox-selector-resource-object.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-selector-resource-object.stories.js","sourceRoot":"","sources":["../../stories/ox-selector-resource-object.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,gDAAgD,CAAA;AAEvD,aAAa,CACX,cAAc,CAAC;IACb,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;KACV;IACD,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,MAAM,EAAE,IAAI;SACb;KACF;CACF,CAAC,CACH,CAAA;AAED,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,SAAS,EAAE,6BAA6B;IACxC,QAAQ,EAAE;QACR,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAChC,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,UAAU,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAClC;CACF,CAAA;AAcD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;cAW7E,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;WACM,IAAI;YACH,SAAS,CAAC,KAAK,CAAC;iBACX,SAAS,CAAC,UAAU,CAAC;iBACrB,SAAS;uBACH,CAAC,MAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;eACvD;IACT;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,GAAG;QACV,SAAS,EAAE,EAAE;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,GAAG;QACV,SAAS,EAAE,EAAE;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,GAAG;QACV,SAAS,EAAE,EAAE;KACd;CACF;YACO,CAAC,MAAM,EAAE,aAAa,CAAC;iBAClB,EAAE;;;CAGlB,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,IAAI;CACjB,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { setClientLink, createMockLink } from '@operato/graphql/graphql-env.js'\nimport '../src/selector/ox-selector-resource-object.js'\n\nsetClientLink(\n createMockLink({\n request: {\n query: ''\n },\n result: {\n data: {\n viewer: null\n }\n }\n })\n)\n\nexport default {\n title: 'ox-selector-resource-object',\n component: 'ox-selector-resource-object',\n argTypes: {\n queryName: { control: 'string' },\n value: { control: 'string' },\n valueField: { control: 'string' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n queryName: string\n value?: string\n valueField?: string\n}\n\nconst Template: Story<ArgTypes> = ({ value = '', queryName, valueField }: ArgTypes) => html`\n <style>\n body {\n }\n </style>\n\n <script>\n const select = ['name', 'description']\n </script>\n\n <ox-selector-resource-object\n @change=${(e: Event) => {\n console.log((e.target as HTMLInputElement).value)\n }}\n name=${name}\n value=${ifDefined(value)}\n valueField=${ifDefined(valueField)}\n .queryName=${queryName}\n .confirmCallback=${(record: any) => console.log('confirm', record)}\n .columns=${[\n {\n type: 'string',\n name: 'id',\n header: 'id',\n hidden: true,\n width: 100,\n queryName: ''\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n hidden: false,\n width: 150,\n queryName: ''\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n hidden: false,\n width: 150,\n queryName: ''\n }\n ]}\n .list=${['name', 'description']}\n .basicArgs=${''}\n >\n </ox-selector-resource-object>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n value: '',\n queryName: 'entity',\n valueField: 'id'\n}\n"]}
|