liyu-pc-base 1.0.462 → 1.0.464

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/{AttributeNomTable-BV3zeA9I.js → AttributeNomTable-Btcv4dpk.js} +3 -3
  2. package/dist/{AttributeNomTable-BV3zeA9I.js.map → AttributeNomTable-Btcv4dpk.js.map} +1 -1
  3. package/dist/{AttributeTable-Dztznjrx.js → AttributeTable-HcS2fmlm.js} +3 -3
  4. package/dist/{AttributeTable-Dztznjrx.js.map → AttributeTable-HcS2fmlm.js.map} +1 -1
  5. package/dist/{FieldRender-DAWgg6Kx.js → FieldRender-_5fZHx2i.js} +129 -128
  6. package/dist/{FieldRender-DAWgg6Kx.js.map → FieldRender-_5fZHx2i.js.map} +1 -1
  7. package/dist/{FieldRender2-CUJg6NaY.js → FieldRender2-BkYaLGjE.js} +27 -27
  8. package/dist/{FieldRender2-CUJg6NaY.js.map → FieldRender2-BkYaLGjE.js.map} +1 -1
  9. package/dist/{FormRender3-eHgGyKvd.js → FormRender3-CQunCnTT.js} +42 -41
  10. package/dist/{FormRender3-eHgGyKvd.js.map → FormRender3-CQunCnTT.js.map} +1 -1
  11. package/dist/{ImportExcelModal-RqLC4zwa.js → ImportExcelModal-Dvr7w6wi.js} +2 -2
  12. package/dist/{ImportExcelModal-RqLC4zwa.js.map → ImportExcelModal-Dvr7w6wi.js.map} +1 -1
  13. package/dist/{JsonObj-Bq62nHPb.js → JsonObj-BeJglj0_.js} +3 -3
  14. package/dist/{JsonObj-Bq62nHPb.js.map → JsonObj-BeJglj0_.js.map} +1 -1
  15. package/dist/{JsonStr-DE1QSIsP.js → JsonStr-ioCxYW7M.js} +3 -3
  16. package/dist/{JsonStr-DE1QSIsP.js.map → JsonStr-ioCxYW7M.js.map} +1 -1
  17. package/dist/{RemoteCascader-DyHXstUo.js → RemoteCascader-D0FJGyVl.js} +4 -4
  18. package/dist/{RemoteCascader-DyHXstUo.js.map → RemoteCascader-D0FJGyVl.js.map} +1 -1
  19. package/dist/{RemoteFilterSelect-CapzhUOg.js → RemoteFilterSelect-Cy-B4cYQ.js} +4 -4
  20. package/dist/{RemoteFilterSelect-CapzhUOg.js.map → RemoteFilterSelect-Cy-B4cYQ.js.map} +1 -1
  21. package/dist/{RemoteModal-jn_BF1Qc.js → RemoteModal-BkZe6XmX.js} +906 -906
  22. package/dist/RemoteModal-BkZe6XmX.js.map +1 -0
  23. package/dist/{RemoteSelect-DvptpIwS.js → RemoteSelect-BYuPqqMr.js} +7 -7
  24. package/dist/{RemoteSelect-DvptpIwS.js.map → RemoteSelect-BYuPqqMr.js.map} +1 -1
  25. package/dist/{RemoteSelectPro-BZ8f2PBe.js → RemoteSelectPro-BD63ztS-.js} +15 -15
  26. package/dist/{RemoteSelectPro-BZ8f2PBe.js.map → RemoteSelectPro-BD63ztS-.js.map} +1 -1
  27. package/dist/{RemoteTable2-DEUCRHzb.js → RemoteTable2-9zGIUfmK.js} +4 -4
  28. package/dist/{RemoteTable2-DEUCRHzb.js.map → RemoteTable2-9zGIUfmK.js.map} +1 -1
  29. package/dist/{RemoteText-BCKZJK52.js → RemoteText-CvwHF6Y1.js} +5 -5
  30. package/dist/{RemoteText-BCKZJK52.js.map → RemoteText-CvwHF6Y1.js.map} +1 -1
  31. package/dist/{SearchRender-IUErhCeG.js → SearchRender-Cj5FWHBa.js} +98 -97
  32. package/dist/{SearchRender-IUErhCeG.js.map → SearchRender-Cj5FWHBa.js.map} +1 -1
  33. package/dist/{TinymceEditor-Czp3rC1v.js → TinymceEditor-CD7KKRSe.js} +1677 -1673
  34. package/dist/{TinymceEditor-Czp3rC1v.js.map → TinymceEditor-CD7KKRSe.js.map} +1 -1
  35. package/dist/api/api-model.js +1 -1
  36. package/dist/api/api-model.js.map +1 -1
  37. package/dist/api/typing.js.map +1 -1
  38. package/dist/components/FormRender/utils.js +1 -1
  39. package/dist/components/FormRender/utils.js.map +1 -1
  40. package/dist/components/gridPage/utils.js.map +1 -1
  41. package/dist/components/index.js +157 -157
  42. package/dist/components/index.js.map +1 -1
  43. package/dist/components/remotePages/index.js +1 -1
  44. package/dist/components/remotePages/utils.js.map +1 -1
  45. package/dist/{default-DA2gkrqk.js.map → default-DmCqrYQi.js.map} +1 -1
  46. package/dist/{function-CCxDERgN.js → function-BE9bvzmH.js} +2 -2
  47. package/dist/function-BE9bvzmH.js.map +1 -0
  48. package/dist/index.js +2 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/{init-plugin-CCr5cWmK.js.map → init-plugin-1SOa4xzt.js.map} +1 -1
  51. package/dist/liyu-pc-base.css +1 -1
  52. package/dist/lodash-CRdKFc7e.js +3293 -0
  53. package/dist/{lodash-T_IuH2iQ.js.map → lodash-CRdKFc7e.js.map} +1 -1
  54. package/dist/{md5-Qtffih6R.js → md5-DN8yWfVo.js} +1 -1
  55. package/dist/{md5-Qtffih6R.js.map → md5-DN8yWfVo.js.map} +1 -1
  56. package/dist/{modal-tools-9zfwQHxQ.js → modal-tools-C_oj5djt.js} +1 -1
  57. package/dist/{modal-tools-9zfwQHxQ.js.map → modal-tools-C_oj5djt.js.map} +1 -1
  58. package/dist/props-util-D7nkeN4W.js +743 -0
  59. package/dist/props-util-D7nkeN4W.js.map +1 -0
  60. package/dist/{remotePages-BGCsHRif.js → remotePages-CesXjGUs.js} +7079 -7079
  61. package/dist/remotePages-CesXjGUs.js.map +1 -0
  62. package/dist/{role-manage-lBQC9aSQ.js → role-manage-b5j6oF_w.js} +1 -1
  63. package/dist/{role-manage-lBQC9aSQ.js.map → role-manage-b5j6oF_w.js.map} +1 -1
  64. package/dist/{chunk-BdsCSvBP.js → rolldown-runtime-Dqa2HsxW.js} +1 -1
  65. package/dist/{tableModal-CQ5qVgsT.js → tableModal-DncchtOd.js} +3 -3
  66. package/dist/{tableModal-CQ5qVgsT.js.map → tableModal-DncchtOd.js.map} +1 -1
  67. package/dist/{tablePro-BAezR640.js → tablePro-22FJtdrh.js} +682 -681
  68. package/dist/{tablePro-BAezR640.js.map → tablePro-22FJtdrh.js.map} +1 -1
  69. package/dist/utils/excel.js.map +1 -1
  70. package/dist/utils/function.js +1 -1
  71. package/dist/utils/hooks/useFetchData.js +1 -1
  72. package/dist/utils/hooks/useFetchData.js.map +1 -1
  73. package/dist/utils/hooks/useTableColumn.js.map +1 -1
  74. package/package.json +2 -2
  75. package/dist/FieldRender-Bd3iAR2P.js +0 -2
  76. package/dist/FormRender3-DZ0a4vrD.js +0 -2
  77. package/dist/RemoteModal-B3Vw7EPw.js +0 -2
  78. package/dist/RemoteModal-jn_BF1Qc.js.map +0 -1
  79. package/dist/SearchRender-DnvmG9jF.js +0 -2
  80. package/dist/function-CCxDERgN.js.map +0 -1
  81. package/dist/lodash-T_IuH2iQ.js +0 -3292
  82. package/dist/props-util-CmLAXMMR.js +0 -742
  83. package/dist/props-util-CmLAXMMR.js.map +0 -1
  84. package/dist/remotePages-BGCsHRif.js.map +0 -1
  85. package/dist/tablePro-CKKqZ5sb.js +0 -2
  86. /package/dist/{_plugin-vue_export-helper-D3hKq4w_.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
  87. /package/dist/{default-DA2gkrqk.js → default-DmCqrYQi.js} +0 -0
  88. /package/dist/{init-plugin-CCr5cWmK.js → init-plugin-1SOa4xzt.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { n as e } from "./chunk-BdsCSvBP.js";
2
- import { t } from "./_plugin-vue_export-helper-D3hKq4w_.js";
1
+ import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
+ import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { Fragment as n, createElementBlock as r, createElementVNode as i, createSlots as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, reactive as u, ref as d, renderList as f, resolveComponent as p, toDisplayString as m, watch as h, withCtx as g } from "vue";
4
4
  import { cloneDeep as _ } from "lodash-es";
5
5
  import { PlusOutlined as v } from "@ant-design/icons-vue";
@@ -132,6 +132,6 @@ function C(e, t, c, u, d, h) {
132
132
  }, null, 8, ["value", "onUpdate:value"])])])
133
133
  }))]), 1032, ["columns", "data-source"])], 64);
134
134
  }
135
- var w = /* @__PURE__ */ t(b, [["render", C]]);
135
+ var w = /*#__PURE__*/ t(b, [["render", C]]);
136
136
  //#endregion
137
137
  export { x as n, w as t };
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeNomTable-BV3zeA9I.js","names":[],"sources":["../src/components/FormRender/AttributeNomTable/index.vue","../src/components/FormRender/AttributeNomTable/index.vue"],"sourcesContent":["<template>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined />\n </template>\n 添加一行\n </a-button>\n <a-table\n :columns=\"columns\"\n :data-source=\"dataSource\"\n :pagination=\"false\"\n :row-height=\"16\"\n :scroll=\"{ y: 200 }\"\n bordered\n class=\"ant-table-striped attribute-table\"\n size=\"small\"\n >\n <template v-for=\"col in ['name', 'value']\" :key=\"col\" #[col]=\"{ record }\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" :size=\"'small'\" style=\"margin: -5px 0\" />\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '日期',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '数量',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeNomTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: Array,\n required: true,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n","<template>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined />\n </template>\n 添加一行\n </a-button>\n <a-table\n :columns=\"columns\"\n :data-source=\"dataSource\"\n :pagination=\"false\"\n :row-height=\"16\"\n :scroll=\"{ y: 200 }\"\n bordered\n class=\"ant-table-striped attribute-table\"\n size=\"small\"\n >\n <template v-for=\"col in ['name', 'value']\" :key=\"col\" #[col]=\"{ record }\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" :size=\"'small'\" style=\"margin: -5px 0\" />\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '日期',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '数量',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeNomTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: Array,\n required: true,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n"],"mappings":";;;;;;AAyCA,IAAM,IAAU;CACd;EACE,OAAO;EACP,WAAW;EACX,OAAO;EACR;CACD;EACE,OAAO;EACP,WAAW;EACX,OAAO;EACP,OAAO,EAAE,cAAc,QAAQ;EAChC;CACD;EACE,OAAO;EACP,WAAW;EACX,OAAO;EACP,OAAO,EAAE,cAAc,SAAS;EACjC;CACD;EACE,OAAO;EACP,WAAW;EACX,OAAO,EAAE,cAAc,aAAa;EACrC;CACF,EAQD,IAAe,EAAgB;CAC7B,MAAM;CACN,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EAED,OAAO;GACL,MAAM;GACN,UAAU;GACV,eAAe,EAAE;GAClB;EACD,WAAW;GACT,MAAM;GACN,UAAU;GACX;EACD,YAAY;GACV,MAAM;GACN,eAAe;GAChB;EACF;CACD,OAAO,CAAC,eAAe;CACvB,MAAM,GAAO,EAAE,WAAQ;EACrB,IAAM,IAAoD,EAAS,EAAE,CAAC,EAChE,KAAQ,MAAgB;AAC5B,KAAa,KAAO,EAClB,EAAW,MAAM,QAAQ,MAAmB,MAAQ,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,CAAA;EANF,GAAA;qBAOE,EAyBU,GAAA;EAxBP,SAAS,EAAA;EACT,eAAa,EAAA;EACb,YAAY;EACZ,cAAY;EACZ,QAAQ,EAAA,GAAA,KAAU;EACnB,UAAA;EACA,OAAM;EACN,MAAK;IAfT,EAAA;EAsBe,WAAS,GAOZ,EAPgB,gBAAM,CAC5B,EAMM,OANN,GAMM,CALJ,EAIO,QAAA,MAAA,CAHL,EAEe,GAAA;GAFD,OAAM;GAAS,YAAO,MAAE,EAAA,OAAO,EAAO,IAAG;;GAzBjE,SAAA,QA0BqB,AAAA,EAAA,OAAA,CAAT,EAAS,KAAA,MAAN,MAAE,GAAA,CAAA,CAAA;GA1BjB,GAAA;;EA+Be,QAAM,QAAE,CA/BvB,EA+BsB,MAAC,EAAG,EAAA,WAAW,OAAM,GAAG,QAAI,EAAA,CAAA,CAAA;EA/BlD,GAAA;KAAA,EAiB4B,CAAA,QAAA,QAAiB,GAAxB;EAjBrB,MAiB2D;EAjB3D,IAAA,GAoBY,EAHwD,gBAAM,CACpE,EAEM,OAAA,MAAA,CADJ,EAAgG,GAAA;GAA/E,OAAO,EAAA,aAAa,EAAO,KAAK;GAnBzD,mBAAA,MAAA,EAmBgC,aAAa,EAAO,KAAK,KAAG;GAAI,MAAM;GAAS,OAAA,EAAA,QAAA,UAAsB"}
1
+ {"version":3,"file":"AttributeNomTable-Btcv4dpk.js","names":[],"sources":["../src/components/FormRender/AttributeNomTable/index.vue","../src/components/FormRender/AttributeNomTable/index.vue"],"sourcesContent":["<template>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined />\n </template>\n 添加一行\n </a-button>\n <a-table\n :columns=\"columns\"\n :data-source=\"dataSource\"\n :pagination=\"false\"\n :row-height=\"16\"\n :scroll=\"{ y: 200 }\"\n bordered\n class=\"ant-table-striped attribute-table\"\n size=\"small\"\n >\n <template v-for=\"col in ['name', 'value']\" :key=\"col\" #[col]=\"{ record }\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" :size=\"'small'\" style=\"margin: -5px 0\" />\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '日期',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '数量',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeNomTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: Array,\n required: true,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n","<template>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined />\n </template>\n 添加一行\n </a-button>\n <a-table\n :columns=\"columns\"\n :data-source=\"dataSource\"\n :pagination=\"false\"\n :row-height=\"16\"\n :scroll=\"{ y: 200 }\"\n bordered\n class=\"ant-table-striped attribute-table\"\n size=\"small\"\n >\n <template v-for=\"col in ['name', 'value']\" :key=\"col\" #[col]=\"{ record }\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" :size=\"'small'\" style=\"margin: -5px 0\" />\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '日期',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '数量',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeNomTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: Array,\n required: true,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n"],"mappings":";;;;;;AAyCA,IAAM,IAAU;CACd;EACE,OAAO;EACP,WAAW;EACX,OAAO;CACT;CACA;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iB4B,CAAA,QAAA,OAAA,IAAP;EAjBrB,MAiB2D;EAjB3D,IAAA,GAoBY,EAHwD,gBAAM,CACpE,EAEM,OAAA,MAAA,CADJ,EAAgG,GAAA;GAA/E,OAAO,EAAA,aAAa,EAAO,IAAG,CAAE;GAnBzD,mBAAA,MAAA,EAmBgC,aAAa,EAAO,IAAG,CAAE,KAAG;GAAI,MAAM;GAAS,OAAA,EAAA,QAAA,SAAA"}
@@ -1,5 +1,5 @@
1
- import { n as e } from "./chunk-BdsCSvBP.js";
2
- import { t } from "./_plugin-vue_export-helper-D3hKq4w_.js";
1
+ import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
+ import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { createElementBlock as n, createElementVNode as r, createSlots as i, createTextVNode as a, createVNode as o, defineComponent as s, openBlock as c, reactive as l, ref as u, renderList as d, resolveComponent as f, toDisplayString as p, watch as m, withCtx as h } from "vue";
4
4
  import { cloneDeep as g } from "lodash-es";
5
5
  import { PlusOutlined as _ } from "@ant-design/icons-vue";
@@ -130,6 +130,6 @@ function S(e, t, s, l, u, m) {
130
130
  }, null, 8, ["value", "onUpdate:value"])])])
131
131
  }))]), 1032, ["columns", "data-source"])]);
132
132
  }
133
- var C = /* @__PURE__ */ t(y, [["render", S]]);
133
+ var C = /*#__PURE__*/ t(y, [["render", S]]);
134
134
  //#endregion
135
135
  export { b as n, C as t };
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeTable-Dztznjrx.js","names":[],"sources":["../src/components/FormRender/AttributeTable/index.vue","../src/components/FormRender/AttributeTable/index.vue"],"sourcesContent":["<template>\n <div>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined/>\n </template>\n 添加一行\n </a-button>\n <a-table\n size=\"small\"\n class=\"ant-table-striped attribute-table\"\n :columns=\"columns\"\n :data-source=\"dataSource\"\n bordered\n :scroll=\"{ y: 200 }\"\n :pagination=\"false\"\n >\n <template v-for=\"col in ['name', 'value']\" #[col]=\"{ record }\" :key=\"col\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" style=\"margin: -5px 0\"/>\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '属性',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '值',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: [Array, Object],\n required: false,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {\n },\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n","<template>\n <div>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined/>\n </template>\n 添加一行\n </a-button>\n <a-table\n size=\"small\"\n class=\"ant-table-striped attribute-table\"\n :columns=\"columns\"\n :data-source=\"dataSource\"\n bordered\n :scroll=\"{ y: 200 }\"\n :pagination=\"false\"\n >\n <template v-for=\"col in ['name', 'value']\" #[col]=\"{ record }\" :key=\"col\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" style=\"margin: -5px 0\"/>\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '属性',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '值',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: [Array, Object],\n required: false,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {\n },\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n"],"mappings":";;;;;;AA0CA,IAAM,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AAA,QAAA,QAAiB,GAAxB;EAjBvB,MAiBkD;EAjBlD,IAAA,GAoBc,EAH6C,gBAAM,CACzD,EAEM,OAAA,MAAA,CADJ,EAA+E,GAAA;GAA9D,OAAO,EAAA,aAAa,EAAO,KAAK;GAnB3D,mBAAA,MAAA,EAmBkC,aAAa,EAAO,KAAK,KAAG;GAAG,OAAA,EAAA,QAAA,UAAsB"}
1
+ {"version":3,"file":"AttributeTable-HcS2fmlm.js","names":[],"sources":["../src/components/FormRender/AttributeTable/index.vue","../src/components/FormRender/AttributeTable/index.vue"],"sourcesContent":["<template>\n <div>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined/>\n </template>\n 添加一行\n </a-button>\n <a-table\n size=\"small\"\n class=\"ant-table-striped attribute-table\"\n :columns=\"columns\"\n :data-source=\"dataSource\"\n bordered\n :scroll=\"{ y: 200 }\"\n :pagination=\"false\"\n >\n <template v-for=\"col in ['name', 'value']\" #[col]=\"{ record }\" :key=\"col\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" style=\"margin: -5px 0\"/>\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '属性',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '值',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: [Array, Object],\n required: false,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {\n },\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n","<template>\n <div>\n <a-button size=\"small\" type=\"primary\" @click=\"add_attr\">\n <template #icon>\n <plus-outlined/>\n </template>\n 添加一行\n </a-button>\n <a-table\n size=\"small\"\n class=\"ant-table-striped attribute-table\"\n :columns=\"columns\"\n :data-source=\"dataSource\"\n bordered\n :scroll=\"{ y: 200 }\"\n :pagination=\"false\"\n >\n <template v-for=\"col in ['name', 'value']\" #[col]=\"{ record }\" :key=\"col\">\n <div>\n <a-input v-model:value=\"editableData[record.key][col]\" style=\"margin: -5px 0\"/>\n </div>\n </template>\n <template #operation=\"{ record }\">\n <div class=\"editable-row-operations\">\n <span>\n <a-popconfirm title=\"确认删除?\" @confirm=\"cancel(record.key)\">\n <a>删除</a>\n </a-popconfirm>\n </span>\n </div>\n </template>\n <template #footer>共{{ dataSource.length }}个属性。</template>\n </a-table>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { UnwrapRef } from 'vue';\nimport { defineComponent, reactive, ref, watch } from 'vue';\nimport { cloneDeep } from 'lodash-es';\nimport { PlusOutlined } from '@ant-design/icons-vue';\n\nconst columns = [\n {\n title: '序号',\n dataIndex: 'key',\n width: '10%',\n },\n {\n title: '属性',\n dataIndex: 'name',\n width: '40%',\n slots: { customRender: 'name' },\n },\n {\n title: '值',\n dataIndex: 'value',\n width: '40%',\n slots: { customRender: 'value' },\n },\n {\n title: '操作',\n dataIndex: 'operation',\n slots: { customRender: 'operation' },\n },\n];\n\ninterface DataItem {\n key: string;\n name: string;\n value: string;\n}\n\nexport default defineComponent({\n name: 'AttributeTable',\n props: {\n field: {\n type: Object,\n required: true,\n },\n\n value: {\n type: [Array, Object],\n required: false,\n default: () => [],\n },\n formModel: {\n type: Object,\n required: true,\n },\n init_model: {\n type: Object,\n default: () => {\n },\n },\n },\n emits: ['update:value'],\n setup(props, { emit }) {\n const editableData: UnwrapRef<Record<string, DataItem>> = reactive({});\n const edit = (key: string) => {\n editableData[key] = cloneDeep(\n dataSource.value.filter((item: DataItem) => key === item.key)[0],\n );\n };\n\n const dataSource: any = ref([]);\n if (props.value && props.value.hasOwnProperty('length')) {\n props.value.map((item: any, index: number) => {\n dataSource.value.push({ key: (index + 1).toString(), ...item });\n edit((index + 1).toString());\n });\n }\n\n const cancel = (key: string) => {\n dataSource.value = dataSource.value.filter((item: DataItem) => key !== item.key);\n delete editableData[key];\n };\n\n const add_attr = () => {\n if (dataSource.value.length == 0) {\n dataSource.value.push({ key: '1', name: '', value: '' });\n edit('1');\n } else {\n const last: DataItem = dataSource.value[dataSource.value.length - 1];\n const key: string = (Number(last.key) + 1).toString();\n dataSource.value.push({ key: key, name: '', value: '' });\n edit(key);\n }\n };\n\n const handleChange = () => {\n const list = dataSource.value.map((item: DataItem) => {\n return { name: editableData[item.key].name, value: editableData[item.key].value };\n });\n emit('update:value', list);\n };\n\n watch(() => editableData, handleChange, {\n deep: true,\n });\n\n return {\n props,\n columns,\n editableData,\n dataSource,\n add_attr,\n cancel,\n };\n },\n\n data() {\n return {\n model: this.value,\n };\n },\n components: {\n PlusOutlined,\n },\n});\n</script>\n<style lang=\"less\">\n.attribute-table {\n .ant-table-footer {\n padding: 5px;\n }\n}\n</style>\n"],"mappings":";;;;;;AA0CA,IAAM,IAAU;CACd;EACE,OAAO;EACP,WAAW;EACX,OAAO;CACT;CACA;EACE,OAAO;EACP,WAAW;EACX,OAAO;EACP,OAAO,EAAE,cAAc,OAAO;CAChC;CACA;EACE,OAAO;EACP,WAAW;EACX,OAAO;EACP,OAAO,EAAE,cAAc,QAAQ;CACjC;CACA;EACE,OAAO;EACP,WAAW;EACX,OAAO,EAAE,cAAc,YAAY;CACrC;AACF,GAQA,IAAe,EAAgB;CAC7B,MAAM;CACN,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;EACZ;EAEA,OAAO;GACL,MAAM,CAAC,OAAO,MAAM;GACpB,UAAU;GACV,eAAe,CAAC;EAClB;EACA,WAAW;GACT,MAAM;GACN,UAAU;EACZ;EACA,YAAY;GACV,MAAM;GACN,eAAe,CACf;EACF;CACF;CACA,OAAO,CAAC,cAAc;CACtB,MAAM,GAAO,EAAE,WAAQ;EACrB,IAAM,IAAoD,EAAS,CAAC,CAAC,GAC/D,KAAQ,MAAgB;GAC5B,EAAa,KAAO,EAClB,EAAW,MAA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