@platforma-sdk/ui-vue 1.45.36 → 1.45.37
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/.turbo/turbo-build.log +46 -46
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/components/BlockLayout.vue2.js +3 -3
- package/dist/components/BlockLayout.vue2.js.map +1 -1
- package/dist/components/BlockLoader.vue.js.map +1 -1
- package/dist/components/LoaderPage.vue.js +2 -2
- package/dist/components/LoaderPage.vue.js.map +1 -1
- package/dist/components/NotFound.vue.js +3 -3
- package/dist/components/NotFound.vue.js.map +1 -1
- package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +73 -73
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js +100 -100
- package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js.map +1 -1
- package/dist/components/PlAgCellFile/PlAgCellFile.vue.js.map +1 -1
- package/dist/components/PlAgCellProgress/PlAgCellProgress.vue.js.map +1 -1
- package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue.js +6 -6
- package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue.js.map +1 -1
- package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue.js.map +1 -1
- package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue.js.map +1 -1
- package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.js +22 -22
- package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.js.map +1 -1
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.js +3 -3
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +50 -50
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js +35 -35
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js.map +1 -1
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +15 -15
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
- package/dist/components/PlAgRowNumHeader.vue.js +13 -13
- package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
- package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue.js +16 -16
- package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue.js.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +6 -6
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/DynamicForm.vue2.js +57 -57
- package/dist/components/PlAnnotations/components/DynamicForm.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +6 -6
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -1
- package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue.js +7 -7
- package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue.js.map +1 -1
- package/dist/components/PlBtnExportArchive/Item.vue2.js +23 -23
- package/dist/components/PlBtnExportArchive/Item.vue2.js.map +1 -1
- package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue2.js.map +1 -1
- package/dist/components/PlBtnExportArchive/Summary.vue2.js +22 -22
- package/dist/components/PlBtnExportArchive/Summary.vue2.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableAddFilterV2.vue.js +9 -9
- package/dist/components/PlTableFilters/PlTableAddFilterV2.vue.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFilterEntryV2.vue.js +3 -3
- package/dist/components/PlTableFilters/PlTableFilterEntryV2.vue.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js +9 -9
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js.map +1 -1
- package/dist/components/ValueOrErrorsComponent.vue.js.map +1 -1
- package/dist/plugins/Monetization/EndOfPeriod.vue2.js +9 -9
- package/dist/plugins/Monetization/EndOfPeriod.vue2.js.map +1 -1
- package/dist/plugins/Monetization/LimitCard.vue2.js +40 -40
- package/dist/plugins/Monetization/LimitCard.vue2.js.map +1 -1
- package/dist/plugins/Monetization/MonetizationSidebar.vue.js +3 -3
- package/dist/plugins/Monetization/MonetizationSidebar.vue.js.map +1 -1
- package/dist/plugins/Monetization/RunStatus.vue2.js +12 -12
- package/dist/plugins/Monetization/RunStatus.vue2.js.map +1 -1
- package/dist/plugins/Monetization/UserCabinetCard.vue2.js +22 -22
- package/dist/plugins/Monetization/UserCabinetCard.vue2.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgTextAndButtonCell.vue.js","sources":["../../../src/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ICellRendererParams, RowDoubleClickedEvent } from 'ag-grid-enterprise';\nimport type { MaskIconName16 } from '@milaboratories/uikit';\nimport { PlMaskIcon16 } from '@milaboratories/uikit';\nimport './pl-ag-text-and-button-cell.scss';\n\nconst props = defineProps<{\n params: ICellRendererParams & {\n /**\n * Button icon MaskIconName16\n */\n icon?: MaskIconName16;\n /**\n * Button label\n */\n btnLabel?: string;\n /**\n * If invokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row. In this case,\n * the handler passed to the component is not called, even if it is defined.\n *\n * If invokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but the provided handler will be called, receiving\n * the ICellRendererParams as an argument.\n */\n invokeRowsOnDoubleClick?: boolean;\n /**\n * plHandler parameter is a click handler that is invoked when\n * the invokeRowsOnDoubleClick property is set to false.\n */\n onClick?: (params: ICellRendererParams) => void;\n };\n}>();\n\nfunction triggerRowDoubleClick() {\n if (props.params.invokeRowsOnDoubleClick) {\n const gridApi = props.params.api;\n\n const event: RowDoubleClickedEvent = {\n rowPinned: props.params.node.rowPinned,\n api: gridApi,\n rowIndex: props.params.node.rowIndex,\n context: gridApi,\n type: 'rowDoubleClicked',\n node: props.params.node,\n data: props.params.data,\n event: null,\n };\n\n gridApi.dispatchEvent(event);\n } else {\n props.params.onClick?.(props.params);\n }\n}\n</script>\n<template>\n <div class=\"pl-ag-grid-open-cell d-flex\">\n <div class=\"pl-ag-grid-open-cell__value\">\n {{ params.value }}\n </div>\n <div class=\"pl-ag-grid-open-cell__activator text-caps11 align-center\" @click.stop=\"triggerRowDoubleClick\">\n <PlMaskIcon16 :name=\"params.icon ?? 'maximize'\" />\n {{ params.btnLabel ?? 'Open' }}\n </div>\n </div>\n</template>\n"],"names":["props","__props","triggerRowDoubleClick","gridApi","event","_b","_a"],"mappings":";;;;;;;;;AAMA,UAAMA,IAAQC;AA4Bd,aAASC,IAAwB;;AAC/B,UAAIF,EAAM,OAAO,yBAAyB;AACxC,cAAMG,IAAUH,EAAM,OAAO,KAEvBI,IAA+B;AAAA,UACnC,WAAWJ,EAAM,OAAO,KAAK;AAAA,UAC7B,KAAKG;AAAA,UACL,UAAUH,EAAM,OAAO,KAAK;AAAA,UAC5B,SAASG;AAAA,UACT,MAAM;AAAA,UACN,MAAMH,EAAM,OAAO;AAAA,UACnB,MAAMA,EAAM,OAAO;AAAA,UACnB,OAAO;AAAA,QAAA;AAGT,QAAAG,EAAQ,cAAcC,CAAK;AAAA,MAC7B;AACE,SAAAC,KAAAC,IAAAN,EAAM,QAAO,YAAb,QAAAK,EAAA,KAAAC,GAAuBN,EAAM;AAAA,IAEjC
|
|
1
|
+
{"version":3,"file":"PlAgTextAndButtonCell.vue.js","sources":["../../../src/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ICellRendererParams, RowDoubleClickedEvent } from 'ag-grid-enterprise';\nimport type { MaskIconName16 } from '@milaboratories/uikit';\nimport { PlMaskIcon16 } from '@milaboratories/uikit';\nimport './pl-ag-text-and-button-cell.scss';\n\nconst props = defineProps<{\n params: ICellRendererParams & {\n /**\n * Button icon MaskIconName16\n */\n icon?: MaskIconName16;\n /**\n * Button label\n */\n btnLabel?: string;\n /**\n * If invokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row. In this case,\n * the handler passed to the component is not called, even if it is defined.\n *\n * If invokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but the provided handler will be called, receiving\n * the ICellRendererParams as an argument.\n */\n invokeRowsOnDoubleClick?: boolean;\n /**\n * plHandler parameter is a click handler that is invoked when\n * the invokeRowsOnDoubleClick property is set to false.\n */\n onClick?: (params: ICellRendererParams) => void;\n };\n}>();\n\nfunction triggerRowDoubleClick() {\n if (props.params.invokeRowsOnDoubleClick) {\n const gridApi = props.params.api;\n\n const event: RowDoubleClickedEvent = {\n rowPinned: props.params.node.rowPinned,\n api: gridApi,\n rowIndex: props.params.node.rowIndex,\n context: gridApi,\n type: 'rowDoubleClicked',\n node: props.params.node,\n data: props.params.data,\n event: null,\n };\n\n gridApi.dispatchEvent(event);\n } else {\n props.params.onClick?.(props.params);\n }\n}\n</script>\n<template>\n <div class=\"pl-ag-grid-open-cell d-flex\">\n <div class=\"pl-ag-grid-open-cell__value\">\n {{ params.value }}\n </div>\n <div class=\"pl-ag-grid-open-cell__activator text-caps11 align-center\" @click.stop=\"triggerRowDoubleClick\">\n <PlMaskIcon16 :name=\"params.icon ?? 'maximize'\" />\n {{ params.btnLabel ?? 'Open' }}\n </div>\n </div>\n</template>\n"],"names":["props","__props","triggerRowDoubleClick","gridApi","event","_b","_a","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_createVNode","_unref","PlMaskIcon16"],"mappings":";;;;;;;;;AAMA,UAAMA,IAAQC;AA4Bd,aAASC,IAAwB;;AAC/B,UAAIF,EAAM,OAAO,yBAAyB;AACxC,cAAMG,IAAUH,EAAM,OAAO,KAEvBI,IAA+B;AAAA,UACnC,WAAWJ,EAAM,OAAO,KAAK;AAAA,UAC7B,KAAKG;AAAA,UACL,UAAUH,EAAM,OAAO,KAAK;AAAA,UAC5B,SAASG;AAAA,UACT,MAAM;AAAA,UACN,MAAMH,EAAM,OAAO;AAAA,UACnB,MAAMA,EAAM,OAAO;AAAA,UACnB,OAAO;AAAA,QAAA;AAGT,QAAAG,EAAQ,cAAcC,CAAK;AAAA,MAC7B;AACE,SAAAC,KAAAC,IAAAN,EAAM,QAAO,YAAb,QAAAK,EAAA,KAAAC,GAAuBN,EAAM;AAAA,IAEjC;sBAGEO,EAAA,GAAAC,EAQM,OARNC,GAQM;AAAA,MAPJC,EAEM,OAFNC,GAEMC,EADDX,EAAA,OAAO,KAAK,GAAA,CAAA;AAAA,MAEjBS,EAGM,OAAA;AAAA,QAHD,OAAM;AAAA,QAA4D,WAAYR,GAAqB,CAAA,MAAA,CAAA;AAAA,MAAA;QACtGW,EAAkDC,EAAAC,CAAA,GAAA;AAAA,UAAnC,MAAMd,EAAA,OAAO,QAAI;AAAA,QAAA;UAAkB,MAClDW,EAAGX,EAAA,OAAO,YAAQ,MAAA,GAAA,CAAA;AAAA,MAAA;;;;"}
|
|
@@ -42,9 +42,9 @@ const x = /* @__PURE__ */ y({
|
|
|
42
42
|
disabled: l.value.steps.length === 0,
|
|
43
43
|
onClick: e[3] || (e[3] = h((t) => c("delete-schema"), ["stop"]))
|
|
44
44
|
}, {
|
|
45
|
-
default: o(() => e[5] || (e[5] = [
|
|
46
|
-
d(" Delete Schema ")
|
|
47
|
-
])),
|
|
45
|
+
default: o(() => [...e[5] || (e[5] = [
|
|
46
|
+
d(" Delete Schema ", -1)
|
|
47
|
+
])]),
|
|
48
48
|
_: 1
|
|
49
49
|
}, 8, ["disabled"])
|
|
50
50
|
]),
|
|
@@ -60,9 +60,9 @@ const x = /* @__PURE__ */ y({
|
|
|
60
60
|
icon: "add",
|
|
61
61
|
onClick: g
|
|
62
62
|
}, {
|
|
63
|
-
default: o(() => e[4] || (e[4] = [
|
|
64
|
-
d(" Add annotation ")
|
|
65
|
-
])),
|
|
63
|
+
default: o(() => [...e[4] || (e[4] = [
|
|
64
|
+
d(" Add annotation ", -1)
|
|
65
|
+
])]),
|
|
66
66
|
_: 1
|
|
67
67
|
}),
|
|
68
68
|
p("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationsSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { Annotation } from '../types';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst selectedStepId = defineModel<undefined | number>('selectedStepId');\n// Emits\nconst emits = defineEmits<{\n (e: 'delete-schema'): void;\n}>();\n// Actions\nfunction handleAddStep() {\n const id = randomInt();\n annotation.value.steps.push({\n id,\n label: `Filter #${annotation.value.steps.length + 1}`,\n filter: {\n id: randomInt(),\n type: 'and',\n filters: [],\n },\n });\n selectedStepId.value = id;\n};\n</script>\n\n<template>\n <PlSidebarItem>\n <template #header-content>\n <PlEditableTitle\n v-model=\"annotation.title\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Annotation Name\"\n :autofocus=\"annotation.title.length === 0\"\n />\n </template>\n <template v-if=\"annotation\" #body-content>\n <div :class=\"$style.root\">\n <PlBtnSecondary icon=\"add\" @click=\"handleAddStep\">\n Add annotation\n </PlBtnSecondary>\n\n <span :class=\"$style.tip\">Lower annotations override the ones above. Rearrange them by dragging.</span>\n\n <PlElementList\n v-model:items=\"annotation.steps\"\n :get-item-key=\"(item) => item.id\"\n :is-active=\"(item) => item.id === selectedStepId\"\n :item-class=\"$style.stepItem\"\n :class=\"$style.steps\"\n @item-click=\"(item) => selectedStepId = item.id\"\n >\n <template #item-title=\"{ item }\">\n {{ item.label }}\n </template>\n </PlElementList>\n </div>\n </template>\n <template #footer-content>\n <PlBtnGhost\n icon=\"delete-bin\"\n reverse\n :disabled=\"annotation.steps.length === 0\"\n @click.stop=\"emits('delete-schema')\"\n >\n Delete Schema\n </PlBtnGhost>\n </template>\n </PlSidebarItem>\n</template>\n\n<style lang=\"scss\" module>\n@use '@milaboratories/uikit/styles/variables' as *;\n\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.tip {\n margin-top: 12px;\n color: var(--txt-03);\n}\n\n.steps {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.stepItem {\n cursor: pointer;\n}\n</style>\n"],"names":["annotation","_useModel","selectedStepId","__props","emits","__emit","handleAddStep","id","randomInt"],"mappings":";;;;;;;;;;;;;AAYA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAAiBD,EAA+BE,GAAC,gBAAgB,GAEjEC,IAAQC;AAId,aAASC,IAAgB;AACvB,YAAMC,IAAKC,EAAA;AACX,MAAAR,EAAW,MAAM,MAAM,KAAK;AAAA,QAC1B,IAAAO;AAAA,QACA,OAAO,WAAWP,EAAW,MAAM,MAAM,SAAS,CAAC;AAAA,QACnD,QAAQ;AAAA,UACN,IAAIQ,EAAA;AAAA,UACJ,MAAM;AAAA,UACN,SAAS,CAAA;AAAA,QAAC;AAAA,MACZ,CACD,GACDN,EAAe,QAAQK;AAAA,IACzB
|
|
1
|
+
{"version":3,"file":"AnnotationsSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { Annotation } from '../types';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst selectedStepId = defineModel<undefined | number>('selectedStepId');\n// Emits\nconst emits = defineEmits<{\n (e: 'delete-schema'): void;\n}>();\n// Actions\nfunction handleAddStep() {\n const id = randomInt();\n annotation.value.steps.push({\n id,\n label: `Filter #${annotation.value.steps.length + 1}`,\n filter: {\n id: randomInt(),\n type: 'and',\n filters: [],\n },\n });\n selectedStepId.value = id;\n};\n</script>\n\n<template>\n <PlSidebarItem>\n <template #header-content>\n <PlEditableTitle\n v-model=\"annotation.title\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Annotation Name\"\n :autofocus=\"annotation.title.length === 0\"\n />\n </template>\n <template v-if=\"annotation\" #body-content>\n <div :class=\"$style.root\">\n <PlBtnSecondary icon=\"add\" @click=\"handleAddStep\">\n Add annotation\n </PlBtnSecondary>\n\n <span :class=\"$style.tip\">Lower annotations override the ones above. Rearrange them by dragging.</span>\n\n <PlElementList\n v-model:items=\"annotation.steps\"\n :get-item-key=\"(item) => item.id\"\n :is-active=\"(item) => item.id === selectedStepId\"\n :item-class=\"$style.stepItem\"\n :class=\"$style.steps\"\n @item-click=\"(item) => selectedStepId = item.id\"\n >\n <template #item-title=\"{ item }\">\n {{ item.label }}\n </template>\n </PlElementList>\n </div>\n </template>\n <template #footer-content>\n <PlBtnGhost\n icon=\"delete-bin\"\n reverse\n :disabled=\"annotation.steps.length === 0\"\n @click.stop=\"emits('delete-schema')\"\n >\n Delete Schema\n </PlBtnGhost>\n </template>\n </PlSidebarItem>\n</template>\n\n<style lang=\"scss\" module>\n@use '@milaboratories/uikit/styles/variables' as *;\n\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.tip {\n margin-top: 12px;\n color: var(--txt-03);\n}\n\n.steps {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.stepItem {\n cursor: pointer;\n}\n</style>\n"],"names":["annotation","_useModel","selectedStepId","__props","emits","__emit","handleAddStep","id","randomInt","_createBlock","_unref","PlSidebarItem","_createSlots","_createVNode","PlEditableTitle","_cache","$event","PlBtnGhost","_createElementVNode","_normalizeClass","$style","PlBtnSecondary","PlElementList","item","_withCtx","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;AAYA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAAiBD,EAA+BE,GAAC,gBAAgB,GAEjEC,IAAQC;AAId,aAASC,IAAgB;AACvB,YAAMC,IAAKC,EAAA;AACX,MAAAR,EAAW,MAAM,MAAM,KAAK;AAAA,QAC1B,IAAAO;AAAA,QACA,OAAO,WAAWP,EAAW,MAAM,MAAM,SAAS,CAAC;AAAA,QACnD,QAAQ;AAAA,UACN,IAAIQ,EAAA;AAAA,UACJ,MAAM;AAAA,UACN,SAAS,CAAA;AAAA,QAAC;AAAA,MACZ,CACD,GACDN,EAAe,QAAQK;AAAA,IACzB;2BAIEE,EA0CgBC,EAAAC,CAAA,GAAA,MAAAC,EAAA;AAAA,MAzCH,oBACT,MAME;AAAA,QANFC,EAMEH,EAAAI,CAAA,GAAA;AAAA,UALS,YAAAd,EAAA,MAAW;AAAA,UAAX,uBAAAe,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAhB,EAAA,MAAW,QAAKgB;AAAA,UACxB,cAAY;AAAA,UACb,aAAU;AAAA,UACV,aAAY;AAAA,UACX,WAAWhB,EAAA,MAAW,MAAM,WAAM;AAAA,QAA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;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as D, mergeModels as O, useModel as
|
|
2
|
-
import { isNil as
|
|
1
|
+
import { defineComponent as D, mergeModels as O, useModel as h, computed as c, watch as x, resolveComponent as P, createElementBlock as v, createCommentVNode as V, openBlock as u, normalizeClass as B, Fragment as y, renderList as S, createBlock as p, unref as d, withCtx as _, createTextVNode as j, toDisplayString as U } from "vue";
|
|
2
|
+
import { isNil as w } from "../../../lib/util/helpers/dist/utils.js";
|
|
3
3
|
import { getFilterUiMetadata as R, getFilterUiTypeOptions as z, PlDropdown as T, PlTextField as E, PlNumberField as k, PlCheckbox as I } from "@milaboratories/uikit";
|
|
4
4
|
const L = { key: 7 }, G = /* @__PURE__ */ D({
|
|
5
5
|
__name: "DynamicForm",
|
|
@@ -11,90 +11,90 @@ const L = { key: 7 }, G = /* @__PURE__ */ D({
|
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const t =
|
|
14
|
+
setup(i) {
|
|
15
|
+
const t = h(i, "modelValue"), s = i, b = c(() => {
|
|
16
16
|
var n;
|
|
17
|
-
const
|
|
18
|
-
if ("column" in
|
|
19
|
-
return (n =
|
|
17
|
+
const l = t.value;
|
|
18
|
+
if ("column" in l)
|
|
19
|
+
return (n = s.columns.find((r) => r.id === l.column)) == null ? void 0 : n.obj;
|
|
20
20
|
}), F = c(() => {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
return R(
|
|
24
|
-
}), M = c(() => z(b.value)), f = c(() =>
|
|
25
|
-
const
|
|
26
|
-
return
|
|
21
|
+
const l = t.value;
|
|
22
|
+
if (l.type && typeof l.type == "string")
|
|
23
|
+
return R(l.type);
|
|
24
|
+
}), M = c(() => z(b.value)), f = c(() => s.columns.map((l) => ({ label: l.label, value: l.id }))), C = c(() => {
|
|
25
|
+
const l = F.value, n = b.value;
|
|
26
|
+
return l && n ? s.columns.filter((r) => l.supportedFor(n, r.obj)).map((r) => ({
|
|
27
27
|
label: r.label,
|
|
28
28
|
value: r.id
|
|
29
29
|
})) : [];
|
|
30
|
-
}), m = (
|
|
31
|
-
t.value[
|
|
30
|
+
}), m = (l, n) => {
|
|
31
|
+
t.value[l] = n;
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
() =>
|
|
35
|
-
(
|
|
36
|
-
for (const [n, r] of Object.entries(
|
|
33
|
+
x(
|
|
34
|
+
() => s.formMetadata,
|
|
35
|
+
(l) => {
|
|
36
|
+
for (const [n, r] of Object.entries(l))
|
|
37
37
|
if (t.value[n] === void 0) {
|
|
38
38
|
const o = r.defaultValue();
|
|
39
|
-
|
|
39
|
+
w(o) || (t.value[n] = o);
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
{ immediate: !0, deep: !0 }
|
|
43
43
|
);
|
|
44
|
-
function g(
|
|
45
|
-
return
|
|
44
|
+
function g(l) {
|
|
45
|
+
return l === "FilterType" || l === "FilterUiType";
|
|
46
46
|
}
|
|
47
|
-
return (
|
|
47
|
+
return (l, n) => {
|
|
48
48
|
const r = P("DynamicForm", !0);
|
|
49
|
-
return
|
|
49
|
+
return i.formMetadata ? (u(), v("div", {
|
|
50
50
|
key: 0,
|
|
51
|
-
class: B(
|
|
51
|
+
class: B(l.$style.form)
|
|
52
52
|
}, [
|
|
53
|
-
(u(!0), v(
|
|
54
|
-
o.fieldType === "form" ? (u(), v(
|
|
53
|
+
(u(!0), v(y, null, S(i.formMetadata, (o, e) => (u(), v(y, { key: e }, [
|
|
54
|
+
o.fieldType === "form" ? (u(), v(y, { key: 0 }, [
|
|
55
55
|
"form" in o ? (u(), p(r, {
|
|
56
56
|
key: 0,
|
|
57
|
-
"model-value": t.value[
|
|
57
|
+
"model-value": t.value[e],
|
|
58
58
|
"form-metadata": o.form,
|
|
59
|
-
columns:
|
|
60
|
-
"onUpdate:modelValue": (a) => m(
|
|
59
|
+
columns: s.columns,
|
|
60
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
61
61
|
}, null, 8, ["model-value", "form-metadata", "columns", "onUpdate:modelValue"])) : V("", !0)
|
|
62
|
-
], 64)) : g(o.fieldType) ? (u(), p(
|
|
62
|
+
], 64)) : g(o.fieldType) ? (u(), p(d(T), {
|
|
63
63
|
key: 1,
|
|
64
|
-
"model-value": t.value[
|
|
65
|
-
label: o.label ??
|
|
64
|
+
"model-value": t.value[e],
|
|
65
|
+
label: o.label ?? e,
|
|
66
66
|
options: M.value,
|
|
67
|
-
"onUpdate:modelValue": (a) => m(
|
|
68
|
-
}, null, 8, ["model-value", "label", "options", "onUpdate:modelValue"])) : o.fieldType === "string" ? (u(), p(
|
|
67
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
68
|
+
}, null, 8, ["model-value", "label", "options", "onUpdate:modelValue"])) : o.fieldType === "string" ? (u(), p(d(E), {
|
|
69
69
|
key: 2,
|
|
70
|
-
"model-value": t.value[
|
|
71
|
-
label: o.label ??
|
|
72
|
-
"onUpdate:modelValue": (a) => m(
|
|
73
|
-
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "SUniversalPColumnId" ? (u(), p(
|
|
70
|
+
"model-value": t.value[e],
|
|
71
|
+
label: o.label ?? e,
|
|
72
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
73
|
+
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "SUniversalPColumnId" ? (u(), p(d(T), {
|
|
74
74
|
key: 3,
|
|
75
|
-
"model-value": t.value[
|
|
76
|
-
label: o.label ??
|
|
77
|
-
options:
|
|
78
|
-
"onUpdate:modelValue": (a) => m(
|
|
79
|
-
}, null, 8, ["model-value", "label", "options", "onUpdate:modelValue"])) : o.fieldType === "number" ? (u(), p(
|
|
75
|
+
"model-value": t.value[e],
|
|
76
|
+
label: o.label ?? e,
|
|
77
|
+
options: e === "column" ? f.value : C.value,
|
|
78
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
79
|
+
}, null, 8, ["model-value", "label", "options", "onUpdate:modelValue"])) : o.fieldType === "number" ? (u(), p(d(k), {
|
|
80
80
|
key: 4,
|
|
81
|
-
"model-value": t.value[
|
|
82
|
-
label: o.label ??
|
|
83
|
-
"onUpdate:modelValue": (a) => m(
|
|
84
|
-
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "number?" ? (u(), p(
|
|
81
|
+
"model-value": t.value[e],
|
|
82
|
+
label: o.label ?? e,
|
|
83
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
84
|
+
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "number?" ? (u(), p(d(k), {
|
|
85
85
|
key: 5,
|
|
86
|
-
"model-value": t.value[
|
|
87
|
-
label: o.label ??
|
|
86
|
+
"model-value": t.value[e],
|
|
87
|
+
label: o.label ?? e,
|
|
88
88
|
clearable: !0,
|
|
89
|
-
"onUpdate:modelValue": (a) => m(
|
|
90
|
-
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "boolean" || o.fieldType === "boolean?" ? (u(), p(
|
|
89
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
90
|
+
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])) : o.fieldType === "boolean" || o.fieldType === "boolean?" ? (u(), p(d(I), {
|
|
91
91
|
key: 6,
|
|
92
|
-
"model-value": !!t.value[
|
|
93
|
-
label: o.label ??
|
|
94
|
-
"onUpdate:modelValue": (a) => m(
|
|
92
|
+
"model-value": !!t.value[e],
|
|
93
|
+
label: o.label ?? e,
|
|
94
|
+
"onUpdate:modelValue": (a) => m(e, a)
|
|
95
95
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
96
|
+
default: _(() => [
|
|
97
|
+
j(U(o.label ?? e), 1)
|
|
98
98
|
]),
|
|
99
99
|
_: 2
|
|
100
100
|
}, 1032, ["model-value", "label", "onUpdate:modelValue"])) : (u(), v("pre", L, "TODO:" + U(o.fieldType), 1))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.vue2.js","sources":["../../../../src/components/PlAnnotations/components/DynamicForm.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T extends FilterSpecLeaf = FilterSpecLeaf\">\nimport { computed, watch } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport type { FilterSpecTypeFieldRecord } from '@milaboratories/uikit';\nimport { getFilterUiMetadata, getFilterUiTypeOptions, PlCheckbox, PlDropdown, PlNumberField, PlTextField } from '@milaboratories/uikit';\nimport type { FilterSpecLeaf, SimplifiedUniversalPColumnEntry, SUniversalPColumnId } from '@platforma-sdk/model';\n\nimport type { FilterSpecType } from '../types';\n\ntype ObjectEntries<T, K extends keyof T = keyof T> = [K, T[K]][];\n\nconst formData = defineModel<T>({ default: () => ({}) });\n\nconst props = defineProps<{\n columns: SimplifiedUniversalPColumnEntry[];\n formMetadata: FilterSpecTypeFieldRecord<T>;\n}>();\n\nconst columnSpecRef = computed(() => {\n const value = formData.value;\n if ('column' in value) {\n return props.columns.find((c) => c.id === value.column)?.obj;\n }\n return undefined;\n});\n\nconst typeMetadataRef = computed(() => {\n const value = formData.value;\n if (value.type && typeof value.type === 'string') {\n return getFilterUiMetadata(value.type);\n }\n return undefined;\n});\n\nconst filterUiTypeOptions = computed(() => {\n return getFilterUiTypeOptions(columnSpecRef.value);\n});\n\nconst firstColumnsOptions = computed(() => props.columns.map((c) => ({ label: c.label, value: c.id })));\nconst secondColumnOptions = computed(() => {\n const typeMetadata = typeMetadataRef.value;\n const columnSpec = columnSpecRef.value;\n if (typeMetadata && columnSpec) {\n return props.columns.filter((c) => typeMetadata.supportedFor(columnSpec, c.obj)).map((c) => ({\n label: c.label,\n value: c.id,\n }));\n }\n return [];\n});\n\nconst setFieldValue = <K extends keyof T>(fieldName: K, value: T[K]) => {\n formData.value[fieldName] = value;\n};\n\nwatch(() => props.formMetadata, (newForm) => {\n for (const [fieldName, field] of Object.entries(newForm) as ObjectEntries<typeof newForm>) {\n if (formData.value[fieldName] === undefined) {\n const value = field.defaultValue();\n if (!isNil(value)) {\n formData.value[fieldName] = value;\n }\n }\n }\n},\n{ immediate: true, deep: true },\n);\n\nfunction isFilterType(type: string | undefined): boolean {\n return type === 'FilterType'\n // @deprecated version\n || type === 'FilterUiType';\n}\n\n</script>\n\n<template>\n <div v-if=\"formMetadata\" :class=\"$style.form\">\n <template v-for=\"(field, fieldName) in formMetadata\" :key=\"fieldName\">\n <template v-if=\"field.fieldType === 'form'\">\n <!-- TODO: Nested Form not described in FilterUi, we need to define it later. Even more in type it don't possible situations -->\n <DynamicForm\n v-if=\"'form' in field\"\n :model-value=\"formData[fieldName] as any\"\n :form-metadata=\"field.form as any\"\n :columns=\"props.columns\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"isFilterType(field.fieldType)\">\n <PlDropdown\n :model-value=\"formData[fieldName] as FilterSpecType\"\n :label=\"field.label ?? fieldName\"\n :options=\"filterUiTypeOptions\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'string'\">\n <PlTextField\n :model-value=\"formData[fieldName] as string\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'SUniversalPColumnId'\">\n <PlDropdown\n :model-value=\"formData[fieldName] as SUniversalPColumnId\"\n :label=\"field.label ?? fieldName\"\n :options=\"fieldName === 'column' ? firstColumnsOptions : secondColumnOptions\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'number'\">\n <PlNumberField\n :model-value=\"formData[fieldName] as number\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'number?'\">\n <PlNumberField\n :model-value=\"formData[fieldName] as (undefined | number)\"\n :label=\"field.label ?? fieldName\"\n :clearable=\"true\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'boolean' || field.fieldType === 'boolean?'\">\n <PlCheckbox\n :model-value=\"Boolean(formData[fieldName])\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n >\n {{ field.label ?? fieldName }}\n </PlCheckbox>\n </template>\n <template v-else>\n <pre>TODO:{{ field.fieldType }}</pre>\n </template>\n </template>\n </div>\n</template>\n\n<style module>\n.form {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n</style>\n"],"names":["formData","_useModel","__props","props","columnSpecRef","computed","value","_a","c","typeMetadataRef","getFilterUiMetadata","filterUiTypeOptions","getFilterUiTypeOptions","firstColumnsOptions","secondColumnOptions","typeMetadata","columnSpec","setFieldValue","fieldName","watch","newForm","field","isNil","isFilterType","type"],"mappings":";;;;;;;;;;;;;;AAYA,UAAMA,IAAWC,EAAcC,GAAA,YAAwB,GAEjDC,IAAQD,GAKRE,IAAgBC,EAAS,MAAM;;AACnC,YAAMC,IAAQN,EAAS;AACvB,UAAI,YAAYM;AACd,gBAAOC,IAAAJ,EAAM,QAAQ,KAAK,CAACK,MAAMA,EAAE,OAAOF,EAAM,MAAM,MAA/C,gBAAAC,EAAkD;AAAA,IAG7D,CAAC,GAEKE,IAAkBJ,EAAS,MAAM;AACrC,YAAMC,IAAQN,EAAS;AACvB,UAAIM,EAAM,QAAQ,OAAOA,EAAM,QAAS;AACtC,eAAOI,EAAoBJ,EAAM,IAAI;AAAA,IAGzC,CAAC,GAEKK,IAAsBN,EAAS,MAC5BO,EAAuBR,EAAc,KAAK,CAClD,GAEKS,IAAsBR,EAAS,MAAMF,EAAM,QAAQ,IAAI,CAACK,OAAO,EAAE,OAAOA,EAAE,OAAO,OAAOA,EAAE,GAAA,EAAK,CAAC,GAChGM,IAAsBT,EAAS,MAAM;AACzC,YAAMU,IAAeN,EAAgB,OAC/BO,IAAaZ,EAAc;AACjC,aAAIW,KAAgBC,IACXb,EAAM,QAAQ,OAAO,CAACK,MAAMO,EAAa,aAAaC,GAAYR,EAAE,GAAG,CAAC,EAAE,IAAI,CAACA,OAAO;AAAA,QAC3F,OAAOA,EAAE;AAAA,QACT,OAAOA,EAAE;AAAA,MAAA,EACT,IAEG,CAAA;AAAA,IACT,CAAC,GAEKS,IAAgB,CAAoBC,GAAcZ,MAAgB;AACtE,MAAAN,EAAS,MAAMkB,CAAS,IAAIZ;AAAA,IAC9B;AAEA,IAAAa;AAAA,MAAM,MAAMhB,EAAM;AAAA,MAAc,CAACiB,MAAY;AAC3C,mBAAW,CAACF,GAAWG,CAAK,KAAK,OAAO,QAAQD,CAAO;AACrD,cAAIpB,EAAS,MAAMkB,CAAS,MAAM,QAAW;AAC3C,kBAAMZ,IAAQe,EAAM,aAAA;AACpB,YAAKC,EAAMhB,CAAK,MACdN,EAAS,MAAMkB,CAAS,IAAIZ;AAAA,UAEhC;AAAA,MAEJ;AAAA,MACA,EAAE,WAAW,IAAM,MAAM,GAAA;AAAA,IAAK;AAG9B,aAASiB,EAAaC,GAAmC;AACvD,aAAOA,MAAS,gBAEXA,MAAS;AAAA,IAChB
|
|
1
|
+
{"version":3,"file":"DynamicForm.vue2.js","sources":["../../../../src/components/PlAnnotations/components/DynamicForm.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T extends FilterSpecLeaf = FilterSpecLeaf\">\nimport { computed, watch } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport type { FilterSpecTypeFieldRecord } from '@milaboratories/uikit';\nimport { getFilterUiMetadata, getFilterUiTypeOptions, PlCheckbox, PlDropdown, PlNumberField, PlTextField } from '@milaboratories/uikit';\nimport type { FilterSpecLeaf, SimplifiedUniversalPColumnEntry, SUniversalPColumnId } from '@platforma-sdk/model';\n\nimport type { FilterSpecType } from '../types';\n\ntype ObjectEntries<T, K extends keyof T = keyof T> = [K, T[K]][];\n\nconst formData = defineModel<T>({ default: () => ({}) });\n\nconst props = defineProps<{\n columns: SimplifiedUniversalPColumnEntry[];\n formMetadata: FilterSpecTypeFieldRecord<T>;\n}>();\n\nconst columnSpecRef = computed(() => {\n const value = formData.value;\n if ('column' in value) {\n return props.columns.find((c) => c.id === value.column)?.obj;\n }\n return undefined;\n});\n\nconst typeMetadataRef = computed(() => {\n const value = formData.value;\n if (value.type && typeof value.type === 'string') {\n return getFilterUiMetadata(value.type);\n }\n return undefined;\n});\n\nconst filterUiTypeOptions = computed(() => {\n return getFilterUiTypeOptions(columnSpecRef.value);\n});\n\nconst firstColumnsOptions = computed(() => props.columns.map((c) => ({ label: c.label, value: c.id })));\nconst secondColumnOptions = computed(() => {\n const typeMetadata = typeMetadataRef.value;\n const columnSpec = columnSpecRef.value;\n if (typeMetadata && columnSpec) {\n return props.columns.filter((c) => typeMetadata.supportedFor(columnSpec, c.obj)).map((c) => ({\n label: c.label,\n value: c.id,\n }));\n }\n return [];\n});\n\nconst setFieldValue = <K extends keyof T>(fieldName: K, value: T[K]) => {\n formData.value[fieldName] = value;\n};\n\nwatch(() => props.formMetadata, (newForm) => {\n for (const [fieldName, field] of Object.entries(newForm) as ObjectEntries<typeof newForm>) {\n if (formData.value[fieldName] === undefined) {\n const value = field.defaultValue();\n if (!isNil(value)) {\n formData.value[fieldName] = value;\n }\n }\n }\n},\n{ immediate: true, deep: true },\n);\n\nfunction isFilterType(type: string | undefined): boolean {\n return type === 'FilterType'\n // @deprecated version\n || type === 'FilterUiType';\n}\n\n</script>\n\n<template>\n <div v-if=\"formMetadata\" :class=\"$style.form\">\n <template v-for=\"(field, fieldName) in formMetadata\" :key=\"fieldName\">\n <template v-if=\"field.fieldType === 'form'\">\n <!-- TODO: Nested Form not described in FilterUi, we need to define it later. Even more in type it don't possible situations -->\n <DynamicForm\n v-if=\"'form' in field\"\n :model-value=\"formData[fieldName] as any\"\n :form-metadata=\"field.form as any\"\n :columns=\"props.columns\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"isFilterType(field.fieldType)\">\n <PlDropdown\n :model-value=\"formData[fieldName] as FilterSpecType\"\n :label=\"field.label ?? fieldName\"\n :options=\"filterUiTypeOptions\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'string'\">\n <PlTextField\n :model-value=\"formData[fieldName] as string\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'SUniversalPColumnId'\">\n <PlDropdown\n :model-value=\"formData[fieldName] as SUniversalPColumnId\"\n :label=\"field.label ?? fieldName\"\n :options=\"fieldName === 'column' ? firstColumnsOptions : secondColumnOptions\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'number'\">\n <PlNumberField\n :model-value=\"formData[fieldName] as number\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'number?'\">\n <PlNumberField\n :model-value=\"formData[fieldName] as (undefined | number)\"\n :label=\"field.label ?? fieldName\"\n :clearable=\"true\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n />\n </template>\n <template v-else-if=\"field.fieldType === 'boolean' || field.fieldType === 'boolean?'\">\n <PlCheckbox\n :model-value=\"Boolean(formData[fieldName])\"\n :label=\"field.label ?? fieldName\"\n @update:model-value=\"setFieldValue(fieldName, $event as T[keyof T])\"\n >\n {{ field.label ?? fieldName }}\n </PlCheckbox>\n </template>\n <template v-else>\n <pre>TODO:{{ field.fieldType }}</pre>\n </template>\n </template>\n </div>\n</template>\n\n<style module>\n.form {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n</style>\n"],"names":["formData","_useModel","__props","props","columnSpecRef","computed","value","_a","c","typeMetadataRef","getFilterUiMetadata","filterUiTypeOptions","getFilterUiTypeOptions","firstColumnsOptions","secondColumnOptions","typeMetadata","columnSpec","setFieldValue","fieldName","watch","newForm","field","isNil","isFilterType","type","_createElementBlock","_normalizeClass","$style","_openBlock","_Fragment","_renderList","_createBlock","_component_DynamicForm","$event","_unref","PlDropdown","PlTextField","PlNumberField","PlCheckbox","_hoisted_1","_toDisplayString"],"mappings":";;;;;;;;;;;;;;AAYA,UAAMA,IAAWC,EAAcC,GAAA,YAAwB,GAEjDC,IAAQD,GAKRE,IAAgBC,EAAS,MAAM;;AACnC,YAAMC,IAAQN,EAAS;AACvB,UAAI,YAAYM;AACd,gBAAOC,IAAAJ,EAAM,QAAQ,KAAK,CAACK,MAAMA,EAAE,OAAOF,EAAM,MAAM,MAA/C,gBAAAC,EAAkD;AAAA,IAG7D,CAAC,GAEKE,IAAkBJ,EAAS,MAAM;AACrC,YAAMC,IAAQN,EAAS;AACvB,UAAIM,EAAM,QAAQ,OAAOA,EAAM,QAAS;AACtC,eAAOI,EAAoBJ,EAAM,IAAI;AAAA,IAGzC,CAAC,GAEKK,IAAsBN,EAAS,MAC5BO,EAAuBR,EAAc,KAAK,CAClD,GAEKS,IAAsBR,EAAS,MAAMF,EAAM,QAAQ,IAAI,CAACK,OAAO,EAAE,OAAOA,EAAE,OAAO,OAAOA,EAAE,GAAA,EAAK,CAAC,GAChGM,IAAsBT,EAAS,MAAM;AACzC,YAAMU,IAAeN,EAAgB,OAC/BO,IAAaZ,EAAc;AACjC,aAAIW,KAAgBC,IACXb,EAAM,QAAQ,OAAO,CAACK,MAAMO,EAAa,aAAaC,GAAYR,EAAE,GAAG,CAAC,EAAE,IAAI,CAACA,OAAO;AAAA,QAC3F,OAAOA,EAAE;AAAA,QACT,OAAOA,EAAE;AAAA,MAAA,EACT,IAEG,CAAA;AAAA,IACT,CAAC,GAEKS,IAAgB,CA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9 +69,9 @@ const T = { key: 1 }, K = /* @__PURE__ */ w({
|
|
|
69
69
|
icon: "add",
|
|
70
70
|
onClick: h
|
|
71
71
|
}, {
|
|
72
|
-
default: n(() => l[2] || (l[2] = [
|
|
73
|
-
p(" Filter ")
|
|
74
|
-
])),
|
|
72
|
+
default: n(() => [...l[2] || (l[2] = [
|
|
73
|
+
p(" Filter ", -1)
|
|
74
|
+
])]),
|
|
75
75
|
_: 1
|
|
76
76
|
}),
|
|
77
77
|
S.value ? (d(), r(s(C), {
|
|
@@ -81,9 +81,9 @@ const T = { key: 1 }, K = /* @__PURE__ */ w({
|
|
|
81
81
|
disabled: !a.hasSelectedColumns,
|
|
82
82
|
onClick: x
|
|
83
83
|
}, {
|
|
84
|
-
default: n(() => l[3] || (l[3] = [
|
|
85
|
-
p(" From selection ")
|
|
86
|
-
])),
|
|
84
|
+
default: n(() => [...l[3] || (l[3] = [
|
|
85
|
+
p(" From selection ", -1)
|
|
86
|
+
])]),
|
|
87
87
|
_: 1
|
|
88
88
|
}, 8, ["disabled"])) : f("", !0)
|
|
89
89
|
], 2),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type Props = {\n columns: SimplifiedUniversalPColumnEntry[];\n hasSelectedColumns?: boolean;\n getValuesForSelectedColumns?: () => Promise<undefined | { columnId: PObjectId; values: string[] }>;\n};\n</script>\n<script setup lang=\"ts\">\nimport { isNil, randomInt } from '@milaboratories/helpers';\nimport type {\n FilterSpecTypeFieldRecord,\n} from '@milaboratories/uikit';\nimport {\n getFilterUiMetadata,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { FilterSpecLeaf, PObjectId, SimplifiedUniversalPColumnEntry, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { computed } from 'vue';\nimport type { Filter, FilterSpec } from '../types';\nimport { createDefaultFilterMetadata } from '../utils';\nimport DynamicForm from './DynamicForm.vue';\n\n// Models\nconst step = defineModel<Filter>('step', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst withSelection = computed(() => {\n return props.hasSelectedColumns !== undefined && props.getValuesForSelectedColumns !== undefined;\n});\n// Actions\nconst addFilterPlaceholder = () => {\n step.value.filter.filters.push({\n id: randomInt(),\n isExpanded: true,\n type: undefined,\n });\n};\n\nasync function addFilterFromSelected() {\n if (props.hasSelectedColumns === undefined || props.getValuesForSelectedColumns === undefined) return;\n\n const data = await props.getValuesForSelectedColumns();\n if (!data || data.values.length === 0) return;\n\n const { columnId, values } = data;\n const shortReminder = values.slice(0, 3).join(', ') + (values.length > 3 ? ` and ${values.length - 3} more` : '');\n\n step.value.filter.filters.push({\n id: randomInt(),\n name: `Selected list (${shortReminder})`,\n isExpanded: false,\n type: 'or',\n filters: values.map((value, i) => ({\n id: i,\n type: 'patternEquals',\n column: columnId as SUniversalPColumnId,\n value,\n })),\n });\n}\n\n// Getters\nconst getColumnLabel = (filter: FilterSpec) => {\n if (!isNil(filter.name)) return filter.name;\n return props.columns\n .find((c) => 'column' in filter ? c.id === filter.column : false)?.label\n ?? filter.type;\n};\n\nconst getFormMetadata = (filter: FilterSpec): FilterSpecTypeFieldRecord<FilterSpecLeaf> => {\n return !isNil(filter.type)\n ? getFilterUiMetadata(filter.type).form as FilterSpecTypeFieldRecord<FilterSpecLeaf>\n : createDefaultFilterMetadata();\n};\n\nconst getFilterValues = (filter: FilterSpec) => {\n if (filter.type === 'or' || filter.type === 'and') {\n return filter.filters.map((f) => 'value' in f && !isNil(f.value) ? f.value : null).filter((v) => !isNil(v)).join (', ');\n }\n return null;\n};\n</script>\n\n<template>\n <PlSidebarItem v-if=\"step\">\n <template #header-content>\n <PlEditableTitle\n :key=\"step.id\"\n v-model=\"step.label\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Annotation Name\"\n :autofocus=\"step.label.length === 0\"\n />\n </template>\n <template #body-content>\n <div :class=\"$style.root\">\n <div :class=\"$style.actions\">\n <PlBtnSecondary style=\"width: 100%;\" icon=\"add\" @click=\"addFilterPlaceholder\">\n Filter\n </PlBtnSecondary>\n <PlBtnSecondary v-if=\"withSelection\" style=\"width: 100%;\" icon=\"add\" :disabled=\"!props.hasSelectedColumns\" @click=\"addFilterFromSelected\">\n From selection\n </PlBtnSecondary>\n </div>\n\n <PlElementList\n v-model:items=\"step.filter.filters\"\n :get-item-key=\"(item) => item.id\"\n :is-expanded=\"(item) => Boolean(item.isExpanded)\"\n :on-expand=\"(item) => item.isExpanded = !Boolean(item.isExpanded)\"\n >\n <template #item-title=\"{ item }\">\n {{ getColumnLabel(item) }}\n </template>\n <template #item-content=\"{ item, index }\">\n <template v-if=\"item.type !== 'or' && item.type !== 'and'\">\n <DynamicForm\n v-model=\"(step.filter.filters[index] as FilterSpecLeaf)\"\n :columns=\"props.columns\"\n :form-metadata=\"getFormMetadata(item)\"\n />\n </template>\n <template v-else>\n <div>{{ getFilterValues(item) }}</div>\n </template>\n </template>\n </PlElementList>\n </div>\n </template>\n </PlSidebarItem>\n</template>\n\n<style lang=\"scss\" module>\n@use '@milaboratories/uikit/styles/variables' as *;\n\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.actions {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n</style>\n"],"names":["step","_useModel","__props","props","withSelection","computed","addFilterPlaceholder","randomInt","addFilterFromSelected","data","columnId","values","shortReminder","value","i","getColumnLabel","filter","isNil","_a","c","getFormMetadata","createDefaultFilterMetadata","getFilterUiMetadata","getFilterValues","f","v"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAOC,EAAmBC,GAAC,MAA0B,GAErDC,IAAQD,GAERE,IAAgBC,EAAS,MACtBF,EAAM,uBAAuB,UAAaA,EAAM,gCAAgC,MACxF,GAEKG,IAAuB,MAAM;AACjC,MAAAN,EAAK,MAAM,OA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,OAAO,CAACC,MAAM,CAACR,EAAMQ,CAAC,CAAC,EAAE,KAAM,IAAI,IAEjH
|
|
1
|
+
{"version":3,"file":"FilterSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type Props = {\n columns: SimplifiedUniversalPColumnEntry[];\n hasSelectedColumns?: boolean;\n getValuesForSelectedColumns?: () => Promise<undefined | { columnId: PObjectId; values: string[] }>;\n};\n</script>\n<script setup lang=\"ts\">\nimport { isNil, randomInt } from '@milaboratories/helpers';\nimport type {\n FilterSpecTypeFieldRecord,\n} from '@milaboratories/uikit';\nimport {\n getFilterUiMetadata,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { FilterSpecLeaf, PObjectId, SimplifiedUniversalPColumnEntry, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { computed } from 'vue';\nimport type { Filter, FilterSpec } from '../types';\nimport { createDefaultFilterMetadata } from '../utils';\nimport DynamicForm from './DynamicForm.vue';\n\n// Models\nconst step = defineModel<Filter>('step', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst withSelection = computed(() => {\n return props.hasSelectedColumns !== undefined && props.getValuesForSelectedColumns !== undefined;\n});\n// Actions\nconst addFilterPlaceholder = () => {\n step.value.filter.filters.push({\n id: randomInt(),\n isExpanded: true,\n type: undefined,\n });\n};\n\nasync function addFilterFromSelected() {\n if (props.hasSelectedColumns === undefined || props.getValuesForSelectedColumns === undefined) return;\n\n const data = await props.getValuesForSelectedColumns();\n if (!data || data.values.length === 0) return;\n\n const { columnId, values } = data;\n const shortReminder = values.slice(0, 3).join(', ') + (values.length > 3 ? ` and ${values.length - 3} more` : '');\n\n step.value.filter.filters.push({\n id: randomInt(),\n name: `Selected list (${shortReminder})`,\n isExpanded: false,\n type: 'or',\n filters: values.map((value, i) => ({\n id: i,\n type: 'patternEquals',\n column: columnId as SUniversalPColumnId,\n value,\n })),\n });\n}\n\n// Getters\nconst getColumnLabel = (filter: FilterSpec) => {\n if (!isNil(filter.name)) return filter.name;\n return props.columns\n .find((c) => 'column' in filter ? c.id === filter.column : false)?.label\n ?? filter.type;\n};\n\nconst getFormMetadata = (filter: FilterSpec): FilterSpecTypeFieldRecord<FilterSpecLeaf> => {\n return !isNil(filter.type)\n ? getFilterUiMetadata(filter.type).form as FilterSpecTypeFieldRecord<FilterSpecLeaf>\n : createDefaultFilterMetadata();\n};\n\nconst getFilterValues = (filter: FilterSpec) => {\n if (filter.type === 'or' || filter.type === 'and') {\n return filter.filters.map((f) => 'value' in f && !isNil(f.value) ? f.value : null).filter((v) => !isNil(v)).join (', ');\n }\n return null;\n};\n</script>\n\n<template>\n <PlSidebarItem v-if=\"step\">\n <template #header-content>\n <PlEditableTitle\n :key=\"step.id\"\n v-model=\"step.label\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Annotation Name\"\n :autofocus=\"step.label.length === 0\"\n />\n </template>\n <template #body-content>\n <div :class=\"$style.root\">\n <div :class=\"$style.actions\">\n <PlBtnSecondary style=\"width: 100%;\" icon=\"add\" @click=\"addFilterPlaceholder\">\n Filter\n </PlBtnSecondary>\n <PlBtnSecondary v-if=\"withSelection\" style=\"width: 100%;\" icon=\"add\" :disabled=\"!props.hasSelectedColumns\" @click=\"addFilterFromSelected\">\n From selection\n </PlBtnSecondary>\n </div>\n\n <PlElementList\n v-model:items=\"step.filter.filters\"\n :get-item-key=\"(item) => item.id\"\n :is-expanded=\"(item) => Boolean(item.isExpanded)\"\n :on-expand=\"(item) => item.isExpanded = !Boolean(item.isExpanded)\"\n >\n <template #item-title=\"{ item }\">\n {{ getColumnLabel(item) }}\n </template>\n <template #item-content=\"{ item, index }\">\n <template v-if=\"item.type !== 'or' && item.type !== 'and'\">\n <DynamicForm\n v-model=\"(step.filter.filters[index] as FilterSpecLeaf)\"\n :columns=\"props.columns\"\n :form-metadata=\"getFormMetadata(item)\"\n />\n </template>\n <template v-else>\n <div>{{ getFilterValues(item) }}</div>\n </template>\n </template>\n </PlElementList>\n </div>\n </template>\n </PlSidebarItem>\n</template>\n\n<style lang=\"scss\" module>\n@use '@milaboratories/uikit/styles/variables' as *;\n\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.actions {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n</style>\n"],"names":["step","_useModel","__props","props","withSelection","computed","addFilterPlaceholder","randomInt","addFilterFromSelected","data","columnId","values","shortReminder","value","i","getColumnLabel","filter","isNil","_a","c","getFormMetadata","createDefaultFilterMetadata","getFilterUiMetadata","getFilterValues","f","v","_createBlock","_unref","PlSidebarItem","PlEditableTitle","_cache","$event","_createElementVNode","_normalizeClass","$style","_createVNode","PlBtnSecondary","PlElementList","item","_withCtx","_createTextVNode","_toDisplayString","index","DynamicForm","_createElementBlock","_hoisted_1"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAOC,EAAmBC,GAAC,MAA0B,GAErDC,IAAQD,GAERE,IAAgBC,EAAS,MACtBF,EAAM,uBAAuB,UAAaA,EAAM,gCAAgC,MACxF,GAEKG,IAAuB,MAAM;AACjC,MAAAN,EAAK,MAAM,OAAO,QAAQ,KAAK;AAAA,QAC7B,IAAIO,EAAA;AAAA,QACJ,YAAY;AAAA,QACZ,MAAM;AAAA,MAAA,CACP;AAAA,IACH;AAEA,mBAAeC,IAAwB;AACrC,UAAIL,EAAM,uBAAuB,UAAaA,EAAM,gCAAgC,OAAW;AAE/F,YAAMM,IAAO,MAAMN,EAAM,4BAAA;AACzB,UAAI,CAACM,KAAQA,EAAK,OAAO,WAAW,EAAG;AAEvC,YAAM,EAAE,UAAAC,GAAU,QAAAC,EAAA,IAAWF,GACvBG,IAAgBD,EAAO,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,KAAKA,EAAO,SAAS,IAAI,QAAQA,EAAO,SAAS,CAAC,UAAU;AAE9G,MAAAX,EAAK,MAAM,OAAO,QAAQ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MAAK,OAAO,QAAQ0C,CAAK;AAAA,gBAAzB,uBAAA,CAAAX,MAAA/B,EAAA,MAAK,OAAO,QAAQ0C,CAAK,IAAAX;AAAA,gBAClC,SAAS5B,EAAM;AAAA,gBACf,iBAAeiB,EAAgBkB,CAAI;AAAA,cAAA,wFAItCM,EAAsC,OAAAC,GAAAJ,EAA9BlB,EAAgBe,CAAI,CAAA,GAAA,CAAA;AAAA,YAAA;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAnnotations.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from './FilterSidebar.vue';\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport { PlSidebarGroup, useConfirm } from '@milaboratories/uikit';\n\nimport type { Annotation } from '../types';\nimport AnnotationsSidebar from './AnnotationsSidebar.vue';\nimport FilterSidebar from './FilterSidebar.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: 'Reset Schema',\n message: 'Are you sure you want to reset the schema? This action cannot be undone.',\n confirmLabel: 'Yes, reset',\n cancelLabel: 'No, cancel',\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\n</script>\n\n<template>\n <PlSidebarGroup :class=\"$style.sidebarGroup\">\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style lang=\"scss\" module>\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","props","__props","selectedStepId","shallowRef","selectedStep","computed","isNil","step","effect","confirmResetSchema","useConfirm","handleDeleteSchema","_a"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,UAAMA,IAAaC,KAAwB,YAAgC,GAErEC,IAAQC,GAERC,IAAiBC,EAA+B,MAAS,GACzDC,IAAeC,EAAS,MACrBC,EAAMJ,EAAe,KAAK,KAAKI,EAAMR,EAAW,KAAK,IACxD,SACAA,EAAW,MAAM,MAAM,KAAK,CAACS,MAASA,EAAK,OAAOL,EAAe,KAAK,CAC3E;AAGD,IAAAM,EAAO,WAA4B;AACjC,MAAIN,EAAe,UAAU,UAAaJ,EAAW,MAAM,MAAM,SAAS,MACxEI,EAAe,QAAQJ,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,UAAMW,IAAqBC,EAAW;AAAA,MACpC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,mBAAeC,IAAqB;;AAClC,MAAI,MAAMF,QACRP,EAAe,QAAQ,SACvBU,IAAAZ,EAAM,mBAAN,QAAAY,EAAA,KAAAZ;AAAA,IAEJ
|
|
1
|
+
{"version":3,"file":"PlAnnotations.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from './FilterSidebar.vue';\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport { PlSidebarGroup, useConfirm } from '@milaboratories/uikit';\n\nimport type { Annotation } from '../types';\nimport AnnotationsSidebar from './AnnotationsSidebar.vue';\nimport FilterSidebar from './FilterSidebar.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: 'Reset Schema',\n message: 'Are you sure you want to reset the schema? This action cannot be undone.',\n confirmLabel: 'Yes, reset',\n cancelLabel: 'No, cancel',\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\n</script>\n\n<template>\n <PlSidebarGroup :class=\"$style.sidebarGroup\">\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style lang=\"scss\" module>\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","props","__props","selectedStepId","shallowRef","selectedStep","computed","isNil","step","effect","confirmResetSchema","useConfirm","handleDeleteSchema","_a","_createBlock","_unref","PlSidebarGroup","_normalizeClass","$style","_createVNode","AnnotationsSidebar","$event","FilterSidebar"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,UAAMA,IAAaC,KAAwB,YAAgC,GAErEC,IAAQC,GAERC,IAAiBC,EAA+B,MAAS,GACzDC,IAAeC,EAAS,MACrBC,EAAMJ,EAAe,KAAK,KAAKI,EAAMR,EAAW,KAAK,IACxD,SACAA,EAAW,MAAM,MAAM,KAAK,CAACS,MAASA,EAAK,OAAOL,EAAe,KAAK,CAC3E;AAGD,IAAAM,EAAO,WAA4B;AACjC,MAAIN,EAAe,UAAU,UAAaJ,EAAW,MAAM,MAAM,SAAS,MACxEI,EAAe,QAAQJ,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,UAAMW,IAAqBC,EAAW;AAAA,MACpC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,mBAAeC,IAAqB;;AAClC,MAAI,MAAMF,QACRP,EAAe,QAAQ,SACvBU,IAAAZ,EAAM,mBAAN,QAAAY,EAAA,KAAAZ;AAAA,IAEJ;2BAKEa,EAqBiBC,EAAAC,CAAA,GAAA;AAAA,MArBA,OAAKC,EAAEC,EAAAA,OAAO,YAAY;AAAA,IAAA;MAC9B,YACT,MAME;AAAA,QANFC,EAMEC,GAAA;AAAA,UALQ,YAAYrB,EAAA;AAAA,wDAAAA,EAAU,QAAAsB;AAAA,UACtB,gBAAgBlB,EAAA;AAAA,4DAAAA,EAAc,QAAAkB;AAAA,UACrC,OAAKJ,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASjB,EAAM;AAAA,UACf,gBAAeW;AAAA,QAAA;;MAGT,YACT,MAQE;AAAA,QAPMP,EAAA,cADRS,EAQEQ,GAAA;AAAA;UANQ,MAAMjB,EAAA;AAAA,kDAAAA,EAAY,QAAAgB;AAAA,UACzB,OAAKJ,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASjB,EAAM;AAAA,UACf,gBAAgBE,EAAA;AAAA,UAChB,oBAAoBF,EAAM;AAAA,UAC1B,6BAA6BA,EAAM;AAAA,QAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAnnotationsModal.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotationsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PlPureSlideModal } from '@milaboratories/uikit';\nimport { effect, shallowRef } from 'vue';\n\nimport type { Annotation } from '../types';\nimport type { Props } from './PlAnnotations.vue';\nimport PlAnnotations from './PlAnnotations.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst opened = defineModel<boolean>('opened', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Actions\nasync function handleDeleteSchema() {\n opened.value = false;\n props.onDeleteSchema?.();\n}\n</script>\n\n<template>\n <PlPureSlideModal v-model=\"opened\" :class=\"$style.modal\" width=\"768px\">\n <PlAnnotations\n v-model:annotation=\"annotation\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :has-selected-columns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </PlPureSlideModal>\n</template>\n\n<style lang=\"scss\" module>\n.modal {\n display: flex;\n}\n\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","opened","__props","props","selectedStepId","shallowRef","effect","handleDeleteSchema","_a"],"mappings":";;;;;;;;;;;;;;;;;;AASA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAASD,EAAoBE,GAAC,QAA4B,GAE1DC,IAAQD,GAERE,IAAiBC,EAA+B,MAAS;AAE/D,IAAAC,EAAO,WAA4B;AACjC,MAAIF,EAAe,UAAU,UAAaL,EAAW,MAAM,MAAM,SAAS,MACxEK,EAAe,QAAQL,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,mBAAeQ,IAAqB;;AAClC,MAAAN,EAAO,QAAQ,KACfO,IAAAL,EAAM,mBAAN,QAAAK,EAAA,KAAAL;AAAA,IACF
|
|
1
|
+
{"version":3,"file":"PlAnnotationsModal.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotationsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PlPureSlideModal } from '@milaboratories/uikit';\nimport { effect, shallowRef } from 'vue';\n\nimport type { Annotation } from '../types';\nimport type { Props } from './PlAnnotations.vue';\nimport PlAnnotations from './PlAnnotations.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst opened = defineModel<boolean>('opened', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Actions\nasync function handleDeleteSchema() {\n opened.value = false;\n props.onDeleteSchema?.();\n}\n</script>\n\n<template>\n <PlPureSlideModal v-model=\"opened\" :class=\"$style.modal\" width=\"768px\">\n <PlAnnotations\n v-model:annotation=\"annotation\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :has-selected-columns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </PlPureSlideModal>\n</template>\n\n<style lang=\"scss\" module>\n.modal {\n display: flex;\n}\n\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","opened","__props","props","selectedStepId","shallowRef","effect","handleDeleteSchema","_a","_createBlock","_unref","PlPureSlideModal","$event","_normalizeClass","$style","_createVNode","PlAnnotations"],"mappings":";;;;;;;;;;;;;;;;;;AASA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAASD,EAAoBE,GAAC,QAA4B,GAE1DC,IAAQD,GAERE,IAAiBC,EAA+B,MAAS;AAE/D,IAAAC,EAAO,WAA4B;AACjC,MAAIF,EAAe,UAAU,UAAaL,EAAW,MAAM,MAAM,SAAS,MACxEK,EAAe,QAAQL,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,mBAAeQ,IAAqB;;AAClC,MAAAN,EAAO,QAAQ,KACfO,IAAAL,EAAM,mBAAN,QAAAK,EAAA,KAAAL;AAAA,IACF;2BAIEM,EASmBC,EAAAC,CAAA,GAAA;AAAA,kBATQV,EAAA;AAAA,oDAAAA,EAAM,QAAAW;AAAA,MAAG,OAAKC,EAAEC,EAAAA,OAAO,KAAK;AAAA,MAAE,OAAM;AAAA,IAAA;iBAC7D,MAOE;AAAA,QAPFC,EAOEC,GAAA;AAAA,UANQ,YAAYjB,EAAA;AAAA,wDAAAA,EAAU,QAAAa;AAAA,UAC7B,OAAKC,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASX,EAAM;AAAA,UACf,wBAAsBA,EAAM;AAAA,UAC5B,6BAA6BA,EAAM;AAAA,UACnC,gBAAeI;AAAA,QAAA;;;;;;"}
|
|
@@ -25,9 +25,9 @@ const O = { class: "pl-app-notification-alert" }, S = { class: "pl-app-notificat
|
|
|
25
25
|
width: "720px",
|
|
26
26
|
style: { "max-height": "100vh" }
|
|
27
27
|
}, {
|
|
28
|
-
title: r(() => e[2] || (e[2] = [
|
|
29
|
-
p(" Errors ")
|
|
30
|
-
])),
|
|
28
|
+
title: r(() => [...e[2] || (e[2] = [
|
|
29
|
+
p(" Errors ", -1)
|
|
30
|
+
])]),
|
|
31
31
|
default: r(() => [
|
|
32
32
|
v("div", S, [
|
|
33
33
|
(u(!0), i(P, null, E(_.value, (t) => {
|
|
@@ -59,15 +59,15 @@ const O = { class: "pl-app-notification-alert" }, S = { class: "pl-app-notificat
|
|
|
59
59
|
icon: "arrow-right",
|
|
60
60
|
onClick: V
|
|
61
61
|
}, {
|
|
62
|
-
default: r(() => e[3] || (e[3] = [
|
|
63
|
-
p("See errors")
|
|
64
|
-
])),
|
|
62
|
+
default: r(() => [...e[3] || (e[3] = [
|
|
63
|
+
p("See errors", -1)
|
|
64
|
+
])]),
|
|
65
65
|
_: 1
|
|
66
66
|
}),
|
|
67
67
|
o(l(M))
|
|
68
68
|
]),
|
|
69
69
|
default: r(() => [
|
|
70
|
-
e[4] || (e[4] = p(" Some outputs have errors. "))
|
|
70
|
+
e[4] || (e[4] = p(" Some outputs have errors. ", -1))
|
|
71
71
|
]),
|
|
72
72
|
_: 1
|
|
73
73
|
}, 8, ["modelValue"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAppErrorNotificationAlert.vue.js","sources":["../../../src/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { BlockOutputsBase } from '@platforma-sdk/model';\nimport type { OutputErrors } from '../../types';\n// @TODO module\nimport './pl-app-error-notification-alert.scss';\nimport { PlBtnPrimary, PlDialogModal, PlNotificationAlert, PlSpacer, PlLogView } from '@milaboratories/uikit';\nimport { computed, ref, watch } from 'vue';\n\nexport type FullMessage = { fullMessage: string };\n\nconst props = defineProps<{ errors: OutputErrors<BlockOutputsBase> }>();\n\nconst isModalOpen = ref(false);\n\nconst isAlertOpen = ref(true);\n\nconst existingErrors = computed(() => Object.entries(props.errors).filter((item) => !!item[1]));\n\nfunction showErrors() {\n isModalOpen.value = true;\n}\n\n// @TODO (temp)\nwatch(\n () => props.errors,\n (errors) => {\n isAlertOpen.value = Object.values(errors).some((v) => !!v);\n },\n { immediate: true, deep: true },\n);\n</script>\n<template>\n <div class=\"pl-app-notification-alert\">\n <PlDialogModal v-model=\"isModalOpen\" width=\"720px\" style=\"max-height: 100vh\">\n <template #title> Errors </template>\n <div class=\"pl-app-notification-alert__content\">\n <template v-for=\"item in existingErrors\" :key=\"item[0]\">\n <div class=\"pl-app-notification-alert__item\">\n <div class=\"pl-app-notification-alert__title\">Block output: {{ item[0] }}</div>\n <PlLogView\n :value=\"item[1]?.message\"\n :valueToCopy=\"'fullMessage' in (item[1] ?? {}) ? (item[1] as unknown as FullMessage).fullMessage : item[1]?.message\"\n :download-filename=\"`output-${item[0]}-error.txt`\"\n />\n </div>\n </template>\n </div>\n </PlDialogModal>\n\n <PlNotificationAlert v-model=\"isAlertOpen\" type=\"error\" closable>\n Some outputs have errors.\n <template #actions>\n <PlBtnPrimary icon=\"arrow-right\" @click=\"showErrors\">See errors</PlBtnPrimary>\n <PlSpacer />\n </template>\n </PlNotificationAlert>\n </div>\n</template>\n"],"names":["props","__props","isModalOpen","ref","isAlertOpen","existingErrors","computed","item","showErrors","watch","errors","v"],"mappings":";;;;;;;;;AAUA,UAAMA,IAAQC,GAERC,IAAcC,EAAI,EAAK,GAEvBC,IAAcD,EAAI,EAAI,GAEtBE,IAAiBC,EAAS,MAAM,OAAO,QAAQN,EAAM,MAAM,EAAE,OAAO,CAACO,MAAS,CAAC,CAACA,EAAK,CAAC,CAAC,CAAC;AAE9F,aAASC,IAAa;AACpB,MAAAN,EAAY,QAAQ;AAAA,IACtB;AAGA,WAAAO;AAAA,MACE,MAAMT,EAAM;AAAA,MACZ,CAACU,MAAW;AACV,QAAAN,EAAY,QAAQ,OAAO,OAAOM,CAAM,EAAE,KAAK,CAACC,MAAM,CAAC,CAACA,CAAC;AAAA,MAC3D;AAAA,MACA,EAAE,WAAW,IAAM,MAAM,GAAA;AAAA,IAAK
|
|
1
|
+
{"version":3,"file":"PlAppErrorNotificationAlert.vue.js","sources":["../../../src/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { BlockOutputsBase } from '@platforma-sdk/model';\nimport type { OutputErrors } from '../../types';\n// @TODO module\nimport './pl-app-error-notification-alert.scss';\nimport { PlBtnPrimary, PlDialogModal, PlNotificationAlert, PlSpacer, PlLogView } from '@milaboratories/uikit';\nimport { computed, ref, watch } from 'vue';\n\nexport type FullMessage = { fullMessage: string };\n\nconst props = defineProps<{ errors: OutputErrors<BlockOutputsBase> }>();\n\nconst isModalOpen = ref(false);\n\nconst isAlertOpen = ref(true);\n\nconst existingErrors = computed(() => Object.entries(props.errors).filter((item) => !!item[1]));\n\nfunction showErrors() {\n isModalOpen.value = true;\n}\n\n// @TODO (temp)\nwatch(\n () => props.errors,\n (errors) => {\n isAlertOpen.value = Object.values(errors).some((v) => !!v);\n },\n { immediate: true, deep: true },\n);\n</script>\n<template>\n <div class=\"pl-app-notification-alert\">\n <PlDialogModal v-model=\"isModalOpen\" width=\"720px\" style=\"max-height: 100vh\">\n <template #title> Errors </template>\n <div class=\"pl-app-notification-alert__content\">\n <template v-for=\"item in existingErrors\" :key=\"item[0]\">\n <div class=\"pl-app-notification-alert__item\">\n <div class=\"pl-app-notification-alert__title\">Block output: {{ item[0] }}</div>\n <PlLogView\n :value=\"item[1]?.message\"\n :valueToCopy=\"'fullMessage' in (item[1] ?? {}) ? (item[1] as unknown as FullMessage).fullMessage : item[1]?.message\"\n :download-filename=\"`output-${item[0]}-error.txt`\"\n />\n </div>\n </template>\n </div>\n </PlDialogModal>\n\n <PlNotificationAlert v-model=\"isAlertOpen\" type=\"error\" closable>\n Some outputs have errors.\n <template #actions>\n <PlBtnPrimary icon=\"arrow-right\" @click=\"showErrors\">See errors</PlBtnPrimary>\n <PlSpacer />\n </template>\n </PlNotificationAlert>\n </div>\n</template>\n"],"names":["props","__props","isModalOpen","ref","isAlertOpen","existingErrors","computed","item","showErrors","watch","errors","v","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_unref","PlDialogModal","$event","_cache","_createElementVNode","_hoisted_2","_Fragment","_renderList","_hoisted_3","PlLogView","_a","_b","PlNotificationAlert","PlBtnPrimary","PlSpacer"],"mappings":";;;;;;;;;AAUA,UAAMA,IAAQC,GAERC,IAAcC,EAAI,EAAK,GAEvBC,IAAcD,EAAI,EAAI,GAEtBE,IAAiBC,EAAS,MAAM,OAAO,QAAQN,EAAM,MAAM,EAAE,OAAO,CAACO,MAAS,CAAC,CAACA,EAAK,CAAC,CAAC,CAAC;AAE9F,aAASC,IAAa;AACpB,MAAAN,EAAY,QAAQ;AAAA,IACtB;AAGA,WAAAO;AAAA,MACE,MAAMT,EAAM;AAAA,MACZ,CAACU,MAAW;AACV,QAAAN,EAAY,QAAQ,OAAO,OAAOM,CAAM,EAAE,KAAK,CAACC,MAAM,CAAC,CAACA,CAAC;AAAA,MAC3D;AAAA,MACA,EAAE,WAAW,IAAM,MAAM,GAAA;AAAA,IAAK,cAI9BC,EAAA,GAAAC,EAwBM,OAxBNC,GAwBM;AAAA,MAvBJC,EAcgBC,EAAAC,CAAA,GAAA;AAAA,oBAdQf,EAAA;AAAA,sDAAAA,EAAW,QAAAgB;AAAA,QAAE,OAAM;AAAA,QAAQ,OAAA,EAAA,cAAA,QAAA;AAAA,MAAA;QACtC,SAAM,MAAQ,CAAA,GAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,YAAR,YAAQ,EAAA;AAAA,QAAA;mBACzB,MAWM;AAAA,UAXNC,EAWM,OAXNC,GAWM;AAAA,oBAVJR,EASWS,GAAA,MAAAC,EATclB,EAAA,OAAc,CAAtBE,MAAI;;0BACnBM,EAOM,OAAA;AAAA,qBARuCN,EAAI,CAAA;AAAA,gBAC5C,OAAM;AAAA,cAAA;gBACTa,EAA+E,OAA/EI,GAA8C,qBAAiBjB,EAAI,CAAA,CAAA,GAAA,CAAA;AAAA,gBACnEQ,EAIEC,EAAAS,CAAA,GAAA;AAAA,kBAHC,QAAOC,IAAAnB,EAAI,CAAA,MAAJ,gBAAAmB,EAAS;AAAA,kBAChB,aAAW,kBAAoBnB,EAAI,CAAA,KAAA,CAAA,KAAcA,KAAmC,eAAcoB,IAAApB,EAAI,CAAA,MAAJ,gBAAAoB,EAAS;AAAA,kBAC3G,+BAA6BpB,EAAI,CAAA,CAAA;AAAA,gBAAA;;;;;;;MAO5CQ,EAMsBC,EAAAY,CAAA,GAAA;AAAA,oBANQxB,EAAA;AAAA,sDAAAA,EAAW,QAAAc;AAAA,QAAE,MAAK;AAAA,QAAQ,UAAA;AAAA,MAAA;QAE3C,WACT,MAA8E;AAAA,UAA9EH,EAA8EC,EAAAa,CAAA,GAAA;AAAA,YAAhE,MAAK;AAAA,YAAe,SAAOrB;AAAA,UAAA;uBAAY,MAAU,CAAA,GAAAW,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,gBAAV,cAAU,EAAA;AAAA,YAAA;;;UAC/DJ,EAAYC,EAAAc,CAAA,CAAA;AAAA,QAAA;mBAJiD,MAE/D;AAAA,4BAF+D,+BAE/D,EAAA;AAAA,QAAA;;;;;;"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { defineComponent as o, createElementBlock as
|
|
2
|
-
import { prettyBytes as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as o, createElementBlock as i, openBlock as n, normalizeClass as s, createElementVNode as l, toDisplayString as a, unref as r, createTextVNode as u } from "vue";
|
|
2
|
+
import { prettyBytes as d } from "../../lib/util/helpers/dist/prettyBytes.js";
|
|
3
|
+
const k = /* @__PURE__ */ o({
|
|
4
4
|
__name: "Item",
|
|
5
5
|
props: {
|
|
6
6
|
item: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
return (
|
|
10
|
-
class: s(
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (t, m) => (n(), i("div", {
|
|
10
|
+
class: s(t.$style.item)
|
|
11
11
|
}, [
|
|
12
12
|
l("div", {
|
|
13
|
-
class: s(
|
|
14
|
-
},
|
|
15
|
-
e.item.status === "in-progress" ? (
|
|
13
|
+
class: s(t.$style.name)
|
|
14
|
+
}, a(e.item.fileName), 3),
|
|
15
|
+
e.item.status === "in-progress" ? (n(), i("div", {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: s(
|
|
17
|
+
class: s(t.$style.details)
|
|
18
18
|
}, [
|
|
19
|
-
l("span", null, r(
|
|
20
|
-
|
|
21
|
-
l("span", null, r(
|
|
22
|
-
], 2)) : e.item.status === "completed" ? (
|
|
19
|
+
l("span", null, a(r(d)(e.item.current, {})), 1),
|
|
20
|
+
m[0] || (m[0] = l("span", null, "/", -1)),
|
|
21
|
+
l("span", null, a(r(d)(e.item.size, {})), 1)
|
|
22
|
+
], 2)) : e.item.status === "completed" ? (n(), i("div", {
|
|
23
23
|
key: 1,
|
|
24
|
-
class: s(
|
|
24
|
+
class: s(t.$style.details)
|
|
25
25
|
}, [
|
|
26
|
-
|
|
27
|
-
l("span", null, r(
|
|
28
|
-
], 2)) : e.item.status === "error" ? (
|
|
26
|
+
m[1] || (m[1] = u(" Done ", -1)),
|
|
27
|
+
l("span", null, a(r(d)(e.item.size, {})), 1)
|
|
28
|
+
], 2)) : e.item.status === "error" ? (n(), i("div", {
|
|
29
29
|
key: 2,
|
|
30
|
-
class: s(
|
|
30
|
+
class: s(t.$style.error)
|
|
31
31
|
}, [
|
|
32
|
-
l("span", null,
|
|
33
|
-
], 2)) : (
|
|
32
|
+
l("span", null, a(e.item.error), 1)
|
|
33
|
+
], 2)) : (n(), i("div", {
|
|
34
34
|
key: 3,
|
|
35
|
-
class: s(
|
|
35
|
+
class: s(t.$style.details)
|
|
36
36
|
}, " Pending ", 2))
|
|
37
37
|
], 2));
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
k as default
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=Item.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Item.vue2.js","sources":["../../../src/components/PlBtnExportArchive/Item.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ExportItem } from './types';\nimport { prettyBytes } from '@milaboratories/helpers';\n\ndefineProps<{\n item: ExportItem;\n}>();\n</script>\n\n<template>\n <div\n :class=\"$style.item\"\n >\n <div :class=\"$style.name\">{{ item.fileName }}</div>\n <div v-if=\"item.status === 'in-progress'\" :class=\"$style.details\">\n <span>{{ prettyBytes(item.current, {}) }}</span>\n <span>/</span>\n <span>{{ prettyBytes(item.size, {}) }}</span>\n </div>\n <div v-else-if=\"item.status === 'completed'\" :class=\"$style.details\">\n Done <span>{{ prettyBytes(item.size, {}) }}</span>\n </div>\n <div v-else-if=\"item.status === 'error'\" :class=\"$style.error\">\n <span>{{ item.error }}</span>\n </div>\n <div v-else :class=\"$style.details\">\n Pending\n </div>\n </div>\n</template>\n\n<style module>\n.item {\n display: flex;\n flex-direction: column;\n margin-bottom: 8px;\n overflow: hidden;\n --name-font-size: 12px;\n --details-font-size: 10px;\n}\n.name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--name-font-size);\n font-weight: 600;\n}\n\n.details {\n font-size: var(--details-font-size);\n font-weight: 400;\n color: rgba(255, 255, 255, 0.6);\n}\n\n.error {\n font-size: var(--details-font-size);\n font-weight: 400;\n color: var(--txt-error);\n span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","$style","_createElementVNode","_toDisplayString","__props","_unref","prettyBytes","_cache"],"mappings":";;;;;;;;2BAUEA,EAkBM,OAAA;AAAA,MAjBH,OAAKC,EAAEC,EAAAA,OAAO,IAAI;AAAA,IAAA;MAEnBC,EAAmD,OAAA;AAAA,QAA7C,OAAKF,EAAEC,EAAAA,OAAO,IAAI;AAAA,MAAA,GAAKE,EAAAC,EAAA,KAAK,QAAQ,GAAA,CAAA;AAAA,MAC/BA,EAAA,KAAK,WAAM,sBAAtBL,EAIM,OAAA;AAAA;QAJqC,OAAKC,EAAEC,EAAAA,OAAO,OAAO;AAAA,MAAA;QAC9DC,EAAgD,QAAA,MAAAC,EAAvCE,EAAAC,CAAA,EAAYF,EAAA,KAAK,SAAO,EAAA,CAAA,GAAA,CAAA;AAAA,QACjCG,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAL,EAAc,cAAR,KAAC,EAAA;AAAA,QACPA,EAA6C,QAAA,MAAAC,EAApCE,EAAAC,CAAA,EAAYF,EAAA,KAAK,MAAI,CAAA,CAAA,CAAA,GAAA,CAAA;AAAA,MAAA,SAEhBA,EAAA,KAAK,WAAM,oBAA3BL,EAEM,OAAA;AAAA;QAFwC,OAAKC,EAAEC,EAAAA,OAAO,OAAO;AAAA,MAAA;0BAAE,UAC9D,EAAA;AAAA,QAAAC,EAA6C,QAAA,MAAAC,EAApCE,EAAAC,CAAA,EAAYF,EAAA,KAAK,MAAI,CAAA,CAAA,CAAA,GAAA,CAAA;AAAA,MAAA,SAErBA,EAAA,KAAK,WAAM,gBAA3BL,EAEM,OAAA;AAAA;QAFoC,OAAKC,EAAEC,EAAAA,OAAO,KAAK;AAAA,MAAA;QAC3DC,EAA6B,QAAA,MAAAC,EAApBC,EAAA,KAAK,KAAK,GAAA,CAAA;AAAA,MAAA,eAErBL,EAEM,OAAA;AAAA;QAFO,OAAKC,EAAEC,EAAAA,OAAO,OAAO;AAAA,MAAA,GAAE,aAEpC,CAAA;AAAA,IAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlBtnExportArchive.vue2.js","sources":["../../../src/components/PlBtnExportArchive/PlBtnExportArchive.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlIcon16,\n PlIcon24,\n useClickOutside,\n} from '@milaboratories/uikit';\nimport { ZipWriter } from '@zip.js/zip.js';\nimport { reactive, computed, ref } from 'vue';\nimport type { ExportItem, ExportsMap, FileExportEntry } from './types';\nimport Item from './Item.vue';\nimport { getFileNameFromHandle, ChunkedStreamReader } from '@platforma-sdk/model';\nimport { getRawPlatformaInstance } from '@platforma-sdk/model';\nimport { uniqueId } from '@milaboratories/helpers';\nimport Summary from './Summary.vue';\n\ntype FilePickerAcceptType = {\n description?: string;\n accept?: Record<string, string[]>;\n};\n\nconst props = defineProps<{\n fileExports?: FileExportEntry[];\n suggestedFileName?: string;\n disabled?: boolean;\n filePickerTypes?: FilePickerAcceptType[];\n strategy?: 'parallel'; // default is sequential\n debugFn?: (fileName: string) => Promise<void>;\n}>();\n\nconst defaultData = () => ({\n loading: false,\n name: '',\n exports: undefined as ExportsMap | undefined,\n showExports: false,\n});\n\nconst data = reactive(defaultData());\n\nconst updateExportsItem = (id: string, partial: Partial<ExportItem>) => {\n const it = data.exports?.get(id);\n if (it) {\n data.exports?.set(id, { ...it, ...partial });\n }\n};\n\nconst isReadyToExport = computed(() => {\n return props.fileExports !== undefined && !props.disabled;\n});\n\nconst items = computed(() => {\n return Array.from(data.exports?.values() ?? []);\n});\n\nconst archive = computed<ExportItem>(() => {\n return {\n fileName: data.name,\n current: items.value.reduce((acc, item) => acc + item.current, 0),\n size: items.value.reduce((acc, item) => acc + item.size, 0),\n status: items.value.some((item) => item.status === 'in-progress') ? 'in-progress' : items.value.every((item) => item.status === 'completed') ? 'completed' : 'pending',\n hasErrors: items.value.some((item) => item.status === 'error'),\n };\n});\n\ntype ZipRequest = {\n id: string;\n fileName: string;\n size: number;\n stream: ReadableStream<Uint8Array>;\n};\n\nconst exportRawTsvs = async () => {\n if (data.loading) {\n data.showExports = true;\n return;\n }\n\n if (!isReadyToExport.value || !props.fileExports) {\n return;\n }\n\n const defaultFileName = `${new Date().toISOString().split('T')[0]}_Export.zip`;\n const defaultTypes = [{\n description: 'ZIP files',\n accept: {\n 'application/zip': ['.zip'],\n },\n }];\n\n // @ts-expect-error - type definition issue TODO: fix this\n const newHandle = await window.showSaveFilePicker({\n types: props.filePickerTypes || defaultTypes,\n suggestedName: props.suggestedFileName || defaultFileName,\n });\n\n data.loading = true;\n data.name = newHandle.name;\n data.showExports = true;\n data.exports = new Map();\n\n try {\n const writableStream = await newHandle.createWritable();\n const zip = new ZipWriter(writableStream, { keepOrder: true, zip64: true, bufferedWrite: false });\n try {\n const requests = [] as ZipRequest[];\n\n for (const entry of props.fileExports) {\n const { importHandle, blobHandle, fileName: customFileName } = entry;\n const fileName = customFileName ?? getFileNameFromHandle(importHandle);\n const { handle, size } = blobHandle;\n\n const id = uniqueId();\n\n data.exports?.set(id, { fileName, current: 0, size, status: 'pending' });\n\n const stream = ChunkedStreamReader.create({\n fetchChunk: async ({ from, to }) => {\n if (props.debugFn) {\n await props.debugFn(fileName);\n }\n\n return await getRawPlatformaInstance().blobDriver.getContent(handle, { from, to });\n },\n totalSize: size,\n onError: async (error) => {\n updateExportsItem(id, { status: 'error', error });\n await new Promise((resolve) => setTimeout(resolve, 1000)); // primitive for now\n return 'continue';\n },\n });\n\n // Create a chunked stream reader for efficient streaming\n requests.push({ id, fileName, size, stream });\n }\n\n const processRequest = async (request: ZipRequest) => {\n const { id, fileName, size, stream } = request;\n const update = (partial: Partial<ExportItem>) => {\n const it = data.exports?.get(id);\n if (it) {\n data.exports?.set(id, { ...it, ...partial });\n }\n };\n await zip.add(fileName, stream, {\n bufferedWrite: true,\n onstart: () => {\n update({ status: 'in-progress' });\n return undefined;\n },\n onprogress: (current: number) => {\n update({ current, status: 'in-progress' });\n return undefined;\n },\n onend() {\n update({ current: size, status: 'completed' });\n return undefined;\n },\n });\n };\n\n if (props.strategy === 'parallel') {\n await Promise.all(requests.map(processRequest));\n } else {\n for (const request of requests) {\n await processRequest(request);\n }\n }\n } finally {\n await zip.close().catch((error) => {\n console.error('Error closing zip', error);\n });\n }\n } finally {\n data.loading = false;\n }\n};\n\nconst progressesRef = ref();\n\nuseClickOutside([progressesRef], () => {\n data.showExports = false;\n});\n</script>\n\n<template>\n <PlBtnGhost\n :disabled=\"!isReadyToExport\" :loading=\"data.loading\" :class=\"{ [$style['has-exports']]: data.exports }\"\n @click.stop=\"exportRawTsvs\"\n >\n <slot />\n <template #append>\n <PlIcon24 :class=\"$style.icon\" name=\"download\" />\n </template>\n </PlBtnGhost>\n <Teleport to=\"body\">\n <div v-if=\"data.exports && data.showExports\" ref=\"progressesRef\" :class=\"$style.progresses\">\n <PlIcon16 :class=\"$style.close\" name=\"close\" @click.stop=\"data.showExports = false\" />\n <Summary :item=\"archive\" />\n <div :class=\"$style.itemsContainer\" class=\"pl-scrollable-y\">\n <Item v-for=\"item in data.exports?.values()\" :key=\"item.fileName\" :item=\"item\" />\n </div>\n </div>\n </Teleport>\n</template>\n\n<style module>\n.progresses {\n position: fixed;\n top: 8px;\n right: 8px;\n width: 350px;\n height: auto;\n max-height: 400px;\n overflow: auto;\n background: rgba(0, 0, 0, 0.85);\n border-radius: 8px;\n padding: 20px 8px 8px 20px;\n color: white;\n font-size: 12px;\n font-weight: 600;\n z-index: 1000;\n\n .itemsContainer {\n max-height: 300px;\n }\n\n .close {\n position: absolute;\n top: 8px;\n right: 8px;\n cursor: pointer;\n --icon-color: white;\n }\n}\n</style>\n"],"names":["props","__props","data","reactive","updateExportsItem","id","partial","it","_a","_b","isReadyToExport","computed","items","archive","acc","item","exportRawTsvs","defaultFileName","defaultTypes","newHandle","writableStream","zip","ZipWriter","requests","entry","importHandle","blobHandle","customFileName","fileName","getFileNameFromHandle","handle","size","uniqueId","stream","ChunkedStreamReader","from","to","getRawPlatformaInstance","error","resolve","processRequest","request","update","current","progressesRef","ref","useClickOutside"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,UAAMA,IAAQC,GAgBRC,IAAOC,EAPc;AAAA,MACzB,SAAS;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CAGoB,GAE7BC,IAAoB,CAACC,GAAYC,MAAiC;;AACtE,YAAMC,KAAKC,IAAAN,EAAK,YAAL,gBAAAM,EAAc,IAAIH;AAC7B,MAAIE,OACFE,IAAAP,EAAK,YAAL,QAAAO,EAAc,IAAIJ,GAAI,EAAE,GAAGE,GAAI,GAAGD;IAEtC,GAEMI,IAAkBC,EAAS,MACxBX,EAAM,gBAAgB,UAAa,CAACA,EAAM,QAClD,GAEKY,IAAQD,EAAS,MAAM;;AAC3B,aAAO,MAAM,OAAKH,IAAAN,EAAK,YAAL,gBAAAM,EAAc,aAAY,EAAE;AAAA,IAChD,CAAC,GAEKK,IAAUF,EAAqB,OAC5B;AAAA,MACL,UAAUT,EAAK;AAAA,MACf,SAASU,EAAM,MAAM,OAAO,CAACE,GAAKC,MAASD,IAAMC,EAAK,SAAS,CAAC;AAAA,MAChE,MAAMH,EAAM,MAAM,OAAO,CAACE,GAAKC,MAASD,IAAMC,EAAK,MAAM,CAAC;AAAA,MAC1D,QAAQH,EAAM,MAAM,KAAK,CAACG,MAASA,EAAK,WAAW,aAAa,IAAI,gBAAgBH,EAAM,MAAM,MAAM,CAACG,MAASA,EAAK,WAAW,WAAW,IAAI,cAAc;AAAA,MAC7J,WAAWH,EAAM,MAAM,KAAK,CAACG,MAASA,EAAK,WAAW,OAAO;AAAA,IAAA,EAEhE,GASKC,IAAgB,YAAY;;AAChC,UAAId,EAAK,SAAS;AAChB,QAAAA,EAAK,cAAc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,MACjB;AAAA,IACF,GAEM0C,IAAgBC,EAAA;AAEtB,WAAAC,EAAgB,CAACF,CAAa,GAAG,MAAM;AACrC,MAAA1C,EAAK,cAAc;AAAA,IACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PlBtnExportArchive.vue2.js","sources":["../../../src/components/PlBtnExportArchive/PlBtnExportArchive.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlIcon16,\n PlIcon24,\n useClickOutside,\n} from '@milaboratories/uikit';\nimport { ZipWriter } from '@zip.js/zip.js';\nimport { reactive, computed, ref } from 'vue';\nimport type { ExportItem, ExportsMap, FileExportEntry } from './types';\nimport Item from './Item.vue';\nimport { getFileNameFromHandle, ChunkedStreamReader } from '@platforma-sdk/model';\nimport { getRawPlatformaInstance } from '@platforma-sdk/model';\nimport { uniqueId } from '@milaboratories/helpers';\nimport Summary from './Summary.vue';\n\ntype FilePickerAcceptType = {\n description?: string;\n accept?: Record<string, string[]>;\n};\n\nconst props = defineProps<{\n fileExports?: FileExportEntry[];\n suggestedFileName?: string;\n disabled?: boolean;\n filePickerTypes?: FilePickerAcceptType[];\n strategy?: 'parallel'; // default is sequential\n debugFn?: (fileName: string) => Promise<void>;\n}>();\n\nconst defaultData = () => ({\n loading: false,\n name: '',\n exports: undefined as ExportsMap | undefined,\n showExports: false,\n});\n\nconst data = reactive(defaultData());\n\nconst updateExportsItem = (id: string, partial: Partial<ExportItem>) => {\n const it = data.exports?.get(id);\n if (it) {\n data.exports?.set(id, { ...it, ...partial });\n }\n};\n\nconst isReadyToExport = computed(() => {\n return props.fileExports !== undefined && !props.disabled;\n});\n\nconst items = computed(() => {\n return Array.from(data.exports?.values() ?? []);\n});\n\nconst archive = computed<ExportItem>(() => {\n return {\n fileName: data.name,\n current: items.value.reduce((acc, item) => acc + item.current, 0),\n size: items.value.reduce((acc, item) => acc + item.size, 0),\n status: items.value.some((item) => item.status === 'in-progress') ? 'in-progress' : items.value.every((item) => item.status === 'completed') ? 'completed' : 'pending',\n hasErrors: items.value.some((item) => item.status === 'error'),\n };\n});\n\ntype ZipRequest = {\n id: string;\n fileName: string;\n size: number;\n stream: ReadableStream<Uint8Array>;\n};\n\nconst exportRawTsvs = async () => {\n if (data.loading) {\n data.showExports = true;\n return;\n }\n\n if (!isReadyToExport.value || !props.fileExports) {\n return;\n }\n\n const defaultFileName = `${new Date().toISOString().split('T')[0]}_Export.zip`;\n const defaultTypes = [{\n description: 'ZIP files',\n accept: {\n 'application/zip': ['.zip'],\n },\n }];\n\n // @ts-expect-error - type definition issue TODO: fix this\n const newHandle = await window.showSaveFilePicker({\n types: props.filePickerTypes || defaultTypes,\n suggestedName: props.suggestedFileName || defaultFileName,\n });\n\n data.loading = true;\n data.name = newHandle.name;\n data.showExports = true;\n data.exports = new Map();\n\n try {\n const writableStream = await newHandle.createWritable();\n const zip = new ZipWriter(writableStream, { keepOrder: true, zip64: true, bufferedWrite: false });\n try {\n const requests = [] as ZipRequest[];\n\n for (const entry of props.fileExports) {\n const { importHandle, blobHandle, fileName: customFileName } = entry;\n const fileName = customFileName ?? getFileNameFromHandle(importHandle);\n const { handle, size } = blobHandle;\n\n const id = uniqueId();\n\n data.exports?.set(id, { fileName, current: 0, size, status: 'pending' });\n\n const stream = ChunkedStreamReader.create({\n fetchChunk: async ({ from, to }) => {\n if (props.debugFn) {\n await props.debugFn(fileName);\n }\n\n return await getRawPlatformaInstance().blobDriver.getContent(handle, { from, to });\n },\n totalSize: size,\n onError: async (error) => {\n updateExportsItem(id, { status: 'error', error });\n await new Promise((resolve) => setTimeout(resolve, 1000)); // primitive for now\n return 'continue';\n },\n });\n\n // Create a chunked stream reader for efficient streaming\n requests.push({ id, fileName, size, stream });\n }\n\n const processRequest = async (request: ZipRequest) => {\n const { id, fileName, size, stream } = request;\n const update = (partial: Partial<ExportItem>) => {\n const it = data.exports?.get(id);\n if (it) {\n data.exports?.set(id, { ...it, ...partial });\n }\n };\n await zip.add(fileName, stream, {\n bufferedWrite: true,\n onstart: () => {\n update({ status: 'in-progress' });\n return undefined;\n },\n onprogress: (current: number) => {\n update({ current, status: 'in-progress' });\n return undefined;\n },\n onend() {\n update({ current: size, status: 'completed' });\n return undefined;\n },\n });\n };\n\n if (props.strategy === 'parallel') {\n await Promise.all(requests.map(processRequest));\n } else {\n for (const request of requests) {\n await processRequest(request);\n }\n }\n } finally {\n await zip.close().catch((error) => {\n console.error('Error closing zip', error);\n });\n }\n } finally {\n data.loading = false;\n }\n};\n\nconst progressesRef = ref();\n\nuseClickOutside([progressesRef], () => {\n data.showExports = false;\n});\n</script>\n\n<template>\n <PlBtnGhost\n :disabled=\"!isReadyToExport\" :loading=\"data.loading\" :class=\"{ [$style['has-exports']]: data.exports }\"\n @click.stop=\"exportRawTsvs\"\n >\n <slot />\n <template #append>\n <PlIcon24 :class=\"$style.icon\" name=\"download\" />\n </template>\n </PlBtnGhost>\n <Teleport to=\"body\">\n <div v-if=\"data.exports && data.showExports\" ref=\"progressesRef\" :class=\"$style.progresses\">\n <PlIcon16 :class=\"$style.close\" name=\"close\" @click.stop=\"data.showExports = false\" />\n <Summary :item=\"archive\" />\n <div :class=\"$style.itemsContainer\" class=\"pl-scrollable-y\">\n <Item v-for=\"item in data.exports?.values()\" :key=\"item.fileName\" :item=\"item\" />\n </div>\n </div>\n </Teleport>\n</template>\n\n<style module>\n.progresses {\n position: fixed;\n top: 8px;\n right: 8px;\n width: 350px;\n height: auto;\n max-height: 400px;\n overflow: auto;\n background: rgba(0, 0, 0, 0.85);\n border-radius: 8px;\n padding: 20px 8px 8px 20px;\n color: white;\n font-size: 12px;\n font-weight: 600;\n z-index: 1000;\n\n .itemsContainer {\n max-height: 300px;\n }\n\n .close {\n position: absolute;\n top: 8px;\n right: 8px;\n cursor: pointer;\n --icon-color: white;\n }\n}\n</style>\n"],"names":["props","__props","data","reactive","updateExportsItem","id","partial","it","_a","_b","isReadyToExport","computed","items","archive","acc","item","exportRawTsvs","defaultFileName","defaultTypes","newHandle","writableStream","zip","ZipWriter","requests","entry","importHandle","blobHandle","customFileName","fileName","getFileNameFromHandle","handle","size","uniqueId","stream","ChunkedStreamReader","from","to","getRawPlatformaInstance","error","resolve","processRequest","request","update","current","progressesRef","ref","useClickOutside","_createVNode","_unref","PlBtnGhost","_normalizeClass","$style","PlIcon24","_renderSlot","_ctx","_createBlock","_Teleport","_createElementBlock","PlIcon16","_cache","_withModifiers","$event","Summary","_createElementVNode","_openBlock","_Fragment","Item"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,UAAMA,IAAQC,GAgBRC,IAAOC,EAPc;AAAA,MACzB,SAAS;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CAGoB,GAE7BC,IAAoB,CAACC,GAAYC,MAAiC;;AACtE,YAAMC,KAAKC,IAAAN,EAAK,YAAL,gBAAAM,EAAc,IAAIH;AAC7B,MAAIE,OACFE,IAAAP,EAAK,YAAL,QAAAO,EAAc,IAAIJ,GAAI,EAAE,GAAGE,GAAI,GAAGD;IAEtC,GAEMI,IAAkBC,EAAS,MACxBX,EAAM,gBAAgB,UAAa,CAACA,EAAM,QAClD,GAEKY,IAAQD,EAAS,MAAM;;AAC3B,aAAO,MAAM,OAAKH,IAAAN,EAAK,YAAL,gBAAAM,EAAc,aAAY,EAAE;AAAA,IAChD,CAAC,GAEKK,IAAUF,EAAqB,OAC5B;AAAA,MACL,UAAUT,EAAK;AAAA,MACf,SAASU,EAAM,MAAM,OAAO,CAACE,GAAKC,MAASD,IAAMC,EAAK,SAAS,CAAC;AAAA,MAChE,MAAMH,EAAM,MAAM,OAAO,CAACE,GAAKC,MAASD,IAAMC,EAAK,MAAM,CAAC;AAAA,MAC1D,QAAQH,EAAM,MAAM,KAAK,CAACG,MAASA,EAAK,WAAW,aAAa,IAAI,gBAAgBH,EAAM,MAAM,MAAM,CAACG,MAASA,EAAK,WAAW,W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