znyg-frontend-common 1.0.44 → 1.0.45

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFormItem.vue.mjs","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps<SearchFormItem>()\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n debugger\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createBlock","_resolveDynamicComponent","column","render","search","el","_mergeProps","handleSearchProps","placeholder","searchParam","_searchParam","clearable","modelValue","key","handleProp","prop","$event","modelModifiers","trim","data","columnEnum","options","includes","_createSlots","default","_withCtx","_createElementBlock","_Fragment","_renderList","col","index","label","fieldNames","_renderSlot","$slots","_","name","fn","_createElementVNode","_toDisplayString"],"mappings":"gWAAA,SAAAA,EAIkBC,EAAYC,EAAAC,EAACC,E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em.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps<SearchFormItem>()\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createBlock","_resolveDynamicComponent","column","render","search","el","_mergeProps","handleSearchProps","placeholder","searchParam","_searchParam","clearable","modelValue","key","handleProp","prop","$event","modelModifiers","trim","data","columnEnum","options","includes","_createSlots","default","_withCtx","_createElementBlock","_Fragment","_renderList","col","index","label","fieldNames","_renderSlot","$slots","_","name","fn","_createElementVNode","_toDisplayString"],"mappings":"gWAAA,SAAAA,EAIkBC,EAAYC,EAAAC,EAACC,EAAOC,EAAQC,GAJ9C,OAAAC,IAAAC,EAAAC,EAAAN,EAIkBO,eAAYC,QAAC,MAAOR,EAAQO,OAAOE,QAAAC,MAAAC,EAAW,IAAOV,EAAIW,qBAAAX,EAAAY,YAAAC,YAAAb,EAAAc,aAAAC,UAAAf,EAAAe,WAAA,CAJ3EC,aAIIF,aAA0Ef,EAAAO,OAAAE,QAAAS,KAAAjB,EAAAkB,WAAAnB,EAAAO,OAAAa,OACzE,sBAAarB,EAAU,KAAAA,EAAA,GAAAsB,GAAqBpB,EAAUc,aAAAf,EAAAO,OAAAE,QAAAS,KAAAjB,EAAAkB,WAAAnB,EAAAO,OAAAa,OAAAC,GACtDC,eAAO,CAAAC,MAAA,GANZC,KAAA,gBAAAxB,EAAAO,OAAAE,QAAAC,GAAAT,EAAAwB,WAAA,GAYcC,QAAA,CAAA,WAAA,aAAAC,SAAA3B,EAAAO,OAAAE,QAAAC,IAAAT,EAAAwB,WAAA,KAFMG,EAAA,CAAAC,QAAAC,GAAA,IAAA,CACd,WAAA9B,EAAAO,OAAAE,QAAAC,IAAAN,GAAsE,GAAK2B,EAAAC,EAAA,CAAAd,IAAA,GAAAe,EAAAhC,EAAAwB,YAAA,CAAAS,EAAAC,KAAQ/B,MAAiBE,EAAK,aAAA,CAAIY,IAAKiB,EAAAC,MAAAF,EAAAjC,EAAAoC,WAAAD,oCAEpH,KAAA,EAAmB,CAbvB,QAAA;uBAAAE,EAAAxC,EAAAyC,OAAA,UAAA,CAAArB,IAAA,OAOoBsB,EAAA;eAAA,CAA0C,aAP9DxC,EAAAO,OAOuDE,QAAOC,GAAA,CACxD+B,KAAA,UAAAC,GAAAZ,GAAA,EAAAN,UAAA,CARNmB,EAAA,OAAA,KAAAC,EAAApB,EAAAvB,EAAAoC,WAAAD,QAAA;eAAAlB,IAAA,UAAA,oEAAArB,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFormItem.vue2.mjs","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps({\n column: { required: true },\n searchParam: { required: true }\n})\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n debugger\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["props","__props","_searchParam","computed","searchParam","fieldNames","label","column","value","dictCode","children","enumMap","inject","ref","Map","columnEnum","enumData","get","prop","search","el","map","item","handleSearchProps","searchEl","searchProps","nodeKey","placeholder","includes","type","isRange","rangeSeparator","startPlaceholder","endPlaceholder","clearable","defaultValue"],"mappings":"yOA2BE,MAAMA,EAAQC,EAMRC,EAAeC,GAAS,IAAMH,EAAMI,cAGpCC,EAAaF,GAAS,KAC1B,IAAIG,EAAQN,EAAMO,OAAOF,YAAYC,OAAS,QAC1CE,EAAQR,EAAMO,OAAOF,YAAYG,OAAS,QAExC,MAAAC,SAAEA,GAAaT,EAAMO,OAKpB,OAJHE,IACMH,EAAA,OACAE,EAAA,QAEH,CACLF,QACAE,QACAE,SAAUV,EAAMO,OAAOF,YAAYK,UAAY,WACjD,IAKIC,EAAUC,EAAO,UAAWC,EAAQ,IAAAC,MACpCC,EAAaZ,GAAS,KAC1B,IAAIa,EAAWL,EAAQH,MAAMS,IAAIjB,EAAMO,OAAOW,MAC1C,OAACF,GAC2B,cAA5BhB,EAAMO,OAAOY,QAAQC,IAAsBpB,EAAMO,OAAOF,aAC/CW,EAAAA,EAASK,KAAKC,IAChB,IAAKA,EAAMhB,MAAOgB,EAAKjB,EAAWG,MAAMF,OAAQE,MAAOc,EAAKjB,EAAWG,MAAMA,YAGjFQ,GANe,EAMf,IAIHO,EAAoBpB,GAAS,KAC3B,MAAAG,EAAQD,EAAWG,MAAMF,MACzBE,EAAQH,EAAWG,MAAMA,MACzBE,EAAWL,EAAWG,MAAME,SAC5Bc,EAAWxB,EAAMO,OAAOY,QAAQC,GACtC,IAAIK,EAAczB,EAAMO,OAAOY,QAAQnB,OAAS,CAAC,EAO1C,MANU,gBAAbwB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOI,YAAYgB,QAASlB,IAEtE,aAAbgB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOE,QAAOE,cAElEe,CAAA,IAIHE,EAAcxB,GAAS,KACrB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,GAAI,CAAC,gBAAiB,YAAa,cAAcS,SAAST,GAAQnB,OAAO6B,OAASV,GAAQnB,OAAO8B,QACxF,MAAA,CACLC,eAAgBZ,GAAQnB,OAAO+B,gBAAkB,IACjDC,iBAAkBb,GAAQnB,OAAOgC,kBAAoB,OACrDC,eAAgBd,GAAQnB,OAAOiC,gBAAkB,QAI9C,MAAA,CAAEN,YADWR,GAAQnB,OAAO2B,cAAgBR,GAAQC,IAAIQ,SAAS,SAAW,MAAQ,OACtE,IAIjBM,EAAY/B,GAAS,KACnB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,OAAOA,GAAQnB,OAAOkC,YAAsC,MAAxBf,GAAQgB,cAAgD,MAAxBhB,GAAQgB,aAAgB"}
1
+ {"version":3,"file":"SearchFormItem.vue2.mjs","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps({\n column: { required: true },\n searchParam: { required: true }\n})\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["props","__props","_searchParam","computed","searchParam","fieldNames","label","column","value","dictCode","children","enumMap","inject","ref","Map","columnEnum","enumData","get","prop","search","el","map","item","handleSearchProps","searchEl","searchProps","nodeKey","placeholder","includes","type","isRange","rangeSeparator","startPlaceholder","endPlaceholder","clearable","defaultValue"],"mappings":"yOA2BE,MAAMA,EAAQC,EAMRC,EAAeC,GAAS,IAAMH,EAAMI,cAGpCC,EAAaF,GAAS,KAC1B,IAAIG,EAAQN,EAAMO,OAAOF,YAAYC,OAAS,QAC1CE,EAAQR,EAAMO,OAAOF,YAAYG,OAAS,QAExC,MAAAC,SAAEA,GAAaT,EAAMO,OAKpB,OAJHE,IACMH,EAAA,OACAE,EAAA,QAEH,CACLF,QACAE,QACAE,SAAUV,EAAMO,OAAOF,YAAYK,UAAY,WACjD,IAKIC,EAAUC,EAAO,UAAWC,EAAQ,IAAAC,MACpCC,EAAaZ,GAAS,KAC1B,IAAIa,EAAWL,EAAQH,MAAMS,IAAIjB,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ollbar as a}from"element-plus";import{formatValue as d}from"../../../utils/index.mjs";var s=Object.defineProperty,l=(e,t)=>s(e,"name",{value:t,configurable:!0});let r;const p=[],m=l((()=>document.querySelector("body")),"getBody"),c=l(((i,s,c)=>{const u={left:"auto",top:"auto",right:"auto",bottom:"auto",
2
2
  // width: 'auto',
3
3
  // height: 'auto',
4
- position:"absolute",id:"popwindow_"+Math.ceil(1e6*Math.random()),zIndex:9999,animate:!1,animateInClass:"animate__animated animate__faster animate__fadeIn",animateOutClass:"animate__animated animate__faster animate__fadeOut",draggable:!1,draggableClass:"",dragInParent:!1},h={...i};void 0!==i.left&&(h.left=d(h.left)),void 0!==i.top&&(h.top=d(h.top)),void 0!==i.right&&(h.right=d(h.right)),void 0!==i.bottom&&(h.bottom=d(h.bottom)),void 0!==i.width&&(h.width=d(h.width)),void 0!==i.height&&(h.height=d(h.height));const f=Object.assign(u,h),v=l((()=>{g(f.id)}),"close");g(f.id);const w=f.animate?f.animateInClass:"",b=document.createElement("div");b.id=f.id,b.style.pointerEvents="auto";let y=m();i.appendParent&&(y=document.getElementById(i.appendParent)),y.appendChild(b);const C=l((()=>{const e=b.querySelector(".popWindow"),t=f.draggableClass?b.querySelector("."+f.draggableClass):e;if(t){const o=y?y.clientWidth-e.clientWidth:1/0,n=y?y.clientHeight-e.clientHeight:1/0;t.onmousedown=t=>{const i=t.pageX-e.offsetLeft,a=t.pageY-e.offsetTop,d=l((t=>{let d=t.pageX-i,s=t.pageY-a;f.dragInParent&&(d=d<0?0:d>o?o:d,s=s<0?0:s>n?n:s),e.style.left=`${d}px`,e.style.top=`${s}px`}),"onMouseMove"),s=l((()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s)}),"onMouseUp");document.addEventListener("mousemove",d),document.addEventListener("mouseup",s)}}}),"startDrag"),W=e("div",{class:"popWindow "+w,style:{left:f.left,right:f.right,top:f.top,bottom:f.bottom,position:f.position,zIndex:f.zIndex,width:f.width,height:f.height}},[e(a,null,{default:l((()=>[i.render?i.render({close:v,option:f}):e(s,t({is:s},c,{onClose:l((()=>v()),"onClose")}),null)]),"default")})]);return W.appContext=r,W.children?.length&&(W.children[0].appContext=r),o(W,b),n((()=>{const e={id:f.id,tag:f.tag,node:b,option:f};p.push(e),f.draggable&&C()})),{id:f.id,close:v}}),"showPopWindow"),u=l((e=>{if(!e)return;const{option:t,node:n}=e;if(t.onClose?.(),t.animate){const i=n.querySelector(".popWindow");i.className="popWindow "+t.animateOutClass,i.addEventListener("animationend",(()=>{o(null,n),n.remove(),p.splice(p.indexOf(e),1)}))}else o(null,n),n.remove(),p.splice(p.indexOf(e),1)}),"removePopWindow"),g=l((e=>{const t=p.find((t=>t.id===e));t&&u(t)}),"closePopWindowById"),h=l((e=>{p.filter((t=>t.tag===e)).forEach((e=>u(e)))}),"closePopWindowByTag"),f=l((()=>p),"getAllPopWindows"),v=l((e=>{const{appContext:t}=e||i()||{};return r=t,{showPopWindow:c}}),"initPopWindow");export{g as closePopWindowById,h as closePopWindowByTag,f as getAllPopWindows,v as initPopWindow,c as showPopWindow};
4
+ position:"absolute",id:"popwindow_"+Math.ceil(1e6*Math.random()),zIndex:9999,animate:!1,animateInClass:"animate__animated animate__faster animate__fadeIn",animateOutClass:"animate__animated animate__faster animate__fadeOut",draggable:!1,draggableClass:"",dragInParent:!1,style:{}},h={...i};void 0!==i.left&&(h.left=d(h.left)),void 0!==i.top&&(h.top=d(h.top)),void 0!==i.right&&(h.right=d(h.right)),void 0!==i.bottom&&(h.bottom=d(h.bottom)),void 0!==i.width&&(h.width=d(h.width)),void 0!==i.height&&(h.height=d(h.height));const f=Object.assign(u,h),v=l((()=>{g(f.id)}),"close");g(f.id);const w=f.animate?f.animateInClass:"",b=document.createElement("div");b.id=f.id,b.style.pointerEvents="auto";let y=m();i.appendParent&&(y=document.getElementById(i.appendParent)),y.appendChild(b);const C=l((()=>{const e=b.querySelector(".popWindow"),t=f.draggableClass?b.querySelector("."+f.draggableClass):e;if(t){const o=y?y.clientWidth-e.clientWidth:1/0,n=y?y.clientHeight-e.clientHeight:1/0;t.onmousedown=t=>{const i=t.pageX-e.offsetLeft,a=t.pageY-e.offsetTop,d=l((t=>{let d=t.pageX-i,s=t.pageY-a;f.dragInParent&&(d=d<0?0:d>o?o:d,s=s<0?0:s>n?n:s),e.style.left=`${d}px`,e.style.top=`${s}px`}),"onMouseMove"),s=l((()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s)}),"onMouseUp");document.addEventListener("mousemove",d),document.addEventListener("mouseup",s)}}}),"startDrag"),W=e("div",{class:"popWindow "+w,style:{left:f.left,right:f.right,top:f.top,bottom:f.bottom,position:f.position,zIndex:f.zIndex,width:f.width,height:f.height,...f.style}},[e(a,null,{default:l((()=>[i.render?i.render({close:v,option:f}):e(s,t({is:s},c,{onClose:l((()=>v()),"onClose")}),null)]),"default")})]);return W.appContext=r,W.children?.length&&(W.children[0].appContext=r),o(W,b),n((()=>{const e={id:f.id,tag:f.tag,node:b,option:f};p.push(e),f.draggable&&C()})),{id:f.id,close:v}}),"showPopWindow"),u=l((e=>{if(!e)return;const{option:t,node:n}=e;if(t.onClose?.(),t.animate){const i=n.querySelector(".popWindow");i.className="popWindow "+t.animateOutClass,i.addEventListener("animationend",(()=>{o(null,n),n.remove(),p.splice(p.indexOf(e),1)}))}else o(null,n),n.remove(),p.splice(p.indexOf(e),1)}),"removePopWindow"),g=l((e=>{const t=p.find((t=>t.id===e));t&&u(t)}),"closePopWindowById"),h=l((e=>{p.filter((t=>t.tag===e)).forEach((e=>u(e)))}),"closePopWindowByTag"),f=l((()=>p),"getAllPopWindows"),v=l((e=>{const{appContext:t}=e||i()||{};return r=t,{showPopWindow:c}}),"initPopWindow");export{g as closePopWindowById,h as closePopWindowByTag,f as getAllPopWindows,v as initPopWindow,c as showPopWindow};
5
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/usePopWindow/src/index.tsx"],"sourcesContent":["import { type AppContext, type Component, type ComponentInternalInstance, getCurrentInstance, nextTick, render } from 'vue'\n\nimport { ElScrollbar } from 'element-plus'\nimport { formatValue } from '../../../utils'\nimport { type PopWindowInfoProps, type PopWindowProps } from './interface'\n\nlet appContextConst: AppContext | undefined\nconst popWindowList: Array<any> = []\nconst getBody = (): Element => {\n return document.querySelector('body') as HTMLBodyElement\n}\n/**\n * 显示弹出窗口\n *\n * 此函数用于创建并显示一个弹出窗口,支持自定义样式和内容通过参数传递\n * 可以选择附加到特定的父元素,并且在渲染后会将自身添加到弹出窗口列表中\n *\n * @param props 弹出窗口的属性,包括位置、尺寸等样式属性以及附加属性\n * @param component 可选参数,用于指定弹出窗口内渲染的自定义组件类型,如果props中传了render函数,则无效\n * @param componentProps 可选参数,传递给自定义组件的属性\n */\nexport const showPopWindow = (props: PopWindowProps, component?: Component, componentProps?: any) => {\n const op = {\n left: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n // width: 'auto',\n // height: 'auto',\n position: 'absolute',\n id: 'popwindow_' + Math.ceil(Math.random() * 1000000),\n zIndex: 9999,\n animate: false,\n animateInClass: 'animate__animated animate__faster animate__fadeIn',\n animateOutClass: 'animate__animated animate__faster animate__fadeOut',\n draggable: false,\n draggableClass: '',\n dragInParent: false\n }\n const propsFormat = { ...props }\n if (props.left !== undefined) propsFormat.left = formatValue(propsFormat.left)\n if (props.top !== undefined) propsFormat.top = formatValue(propsFormat.top)\n if (props.right !== undefined) propsFormat.right = formatValue(propsFormat.right)\n if (props.bottom !== undefined) propsFormat.bottom = formatValue(propsFormat.bottom)\n if (props.width !== undefined) propsFormat.width = formatValue(propsFormat.width)\n if (props.height !== undefined) propsFormat.height = formatValue(propsFormat.height)\n\n const option: PopWindowProps = Object.assign(op, propsFormat)\n const close = () => {\n closePopWindowById(option.id)\n }\n\n // 相同的id只会存在一个\n closePopWindowById(option.id)\n\n const animateClass = option.animate ? option.animateInClass : ''\n\n const container = document.createElement('div')\n // container.id = 'popwindow_' + Math.ceil(Math.random() * 1000000)\n container.id = option.id\n container.style.pointerEvents = 'auto'\n\n let parentEl = getBody()\n if (props.appendParent) {\n parentEl = document.getElementById(props.appendParent)\n }\n parentEl.appendChild(container)\n\n // 拖动功能实现\n const startDrag = () => {\n const el = container.querySelector('.popWindow') as HTMLElement\n const draggableEl: HTMLElement = option.draggableClass ? (container.querySelector('.' + option.draggableClass) as HTMLElement) : el\n\n if (draggableEl) {\n // 限制拖动在父容器内\n // if (parentEl) {\n // 计算拖动范围\n const maxLeft = parentEl ? parentEl.clientWidth - el.clientWidth : Infinity\n const maxTop = parentEl ? parentEl.clientHeight - el.clientHeight : Infinity\n // }\n draggableEl.onmousedown = (eDown: MouseEvent) => {\n const offsetX = eDown.pageX - el.offsetLeft\n const offsetY = eDown.pageY - el.offsetTop\n\n const onMouseMove = (e: MouseEvent) => {\n let left = e.pageX - offsetX\n let top = e.pageY - offsetY\n if (option.dragInParent) {\n left = left < 0 ? 0 : left > maxLeft ? maxLeft : left\n top = top < 0 ? 0 : top > maxTop ? maxTop : top\n }\n\n el.style.left = `${left}px`\n el.style.top = `${top}px`\n }\n\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove)\n document.removeEventListener('mouseup', onMouseUp)\n }\n\n document.addEventListener('mousemove', onMouseMove)\n document.addEventListener('mouseup', onMouseUp)\n }\n }\n }\n const vm = (\n <div\n class={'popWindow ' + animateClass}\n style={{\n left: option.left,\n right: option.right,\n top: option.top,\n bottom: option.bottom,\n position: option.position,\n zIndex: option.zIndex,\n width: option.width,\n height: option.height\n }}>\n <ElScrollbar>\n {props.render ? props.render({ close, option }) : <component is={component} {...componentProps} onClose={() => close()}></component>}\n </ElScrollbar>\n </div>\n )\n vm.appContext = appContextConst\n // 这里是为了让插槽的子组件能获取到appContext\n if (vm.children?.length) {\n vm.children[0].appContext = appContextConst\n }\n render(vm, container)\n\n nextTick(() => {\n const popWindowInfo = { id: option.id, tag: option.tag, node: container, option }\n popWindowList.push(popWindowInfo)\n option.draggable && startDrag()\n })\n\n return { id: option.id, close }\n}\nconst removePopWindow = (popWindowInfo: PopWindowInfoProps) => {\n if (!popWindowInfo) return\n const { option, node } = popWindowInfo\n option.onClose?.()\n if (option.animate) {\n const popWindowNode = node.querySelector('.popWindow')\n popWindowNode.className = 'popWindow ' + option.animateOutClass\n popWindowNode.addEventListener('animationend', () => {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n })\n } else {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n }\n}\n\n/**\n * 根据ID关闭弹出窗口\n *\n * @param id 弹出窗口的唯一标识符\n */\nexport const closePopWindowById = (id: string) => {\n const popWindowItem = popWindowList.find((item) => item.id === id)\n if (popWindowItem) {\n removePopWindow(popWindowItem)\n }\n}\n\n/**\n * 根据tag关闭弹出窗口\n *\n * @param tag 弹出窗口的tag\n */\nexport const closePopWindowByTag = (tag: string) => {\n const popWindows = popWindowList.filter((item) => item.tag === tag)\n popWindows.forEach((item) => removePopWindow(item))\n}\n\n/**\n * 获取所有弹窗信息\n *\n * @returns {PopWindowInfoProps[]} 所有弹窗的列表\n */\nexport const getAllPopWindows = (): PopWindowInfoProps[] => {\n return popWindowList\n}\n\nexport const initPopWindow = (ctx?: ComponentInternalInstance) => {\n const { appContext } = ctx || getCurrentInstance() || {}\n appContextConst = appContext\n\n return { showPopWindow }\n}\n"],"names":["appContextConst","popWindowList","getBody","__name","document","querySelector","showPopWindow","props","component","componentProps","op","left","top","right","bottom","position","id","Math","ceil","random","zIndex","animate","animateInClass","animateOutClass","draggable","draggableClass","dragInParent","propsFormat","undefined","formatValue","width","height","option","Object","assign","close","closePopWindowById","animateClass","container","createElement","style","pointerEvents","parentEl","appendParent","getElementById","appendChild","startDrag","el","draggableEl","maxLeft","clientWidth","Infinity","maxTop","clientHeight","onmousedown","eDown","offsetX","pageX","offsetLeft","offsetY","pageY","offsetTop","onMouseMove","e","onMouseUp","removeEventListener","addEventListener","vm","_createVNode","class","ElScrollbar","default","render","_mergeProps","is","onClose","appContext","children","length","nextTick","popWindowInfo","tag","node","push","removePopWindow","popWindowNode","className","remove","splice","indexOf","popWindowItem","find","item","closePopWindowByTag","filter","forEach","getAllPopWindows","initPopWindow","ctx","getCurrentInstance"],"mappings":"iRAMA,IAAIA,EACJ,MAAMC,EAA4B,GAC5BC,EAAyBC,GAAA,IACtBC,SAASC,cAAc,SADhBH,WAaHI,EAAgBA,GAAAA,CAACC,EAAuBC,EAAuBC,KAC1E,MAAMC,EAAK,CACTC,KAAM,OACNC,IAAK,OACLC,MAAO,OACPC,OAAQ;;;AAGRC,SAAU,WACVC,GAAI,aAAeC,KAAKC,KAAqB,IAAhBD,KAAKE,UAClCC,OAAQ,KACRC,SAAS,EACTC,eAAgB,oDAChBC,gBAAiB,qDACjBC,WAAW,EACXC,eAAgB,GAChBC,cAAc,GAEVC,EAAc,IAAKpB,QACNqB,IAAfrB,EAAMI,SAAgCA,KAAOkB,EAAYF,EAAYhB,YACvDiB,IAAdrB,EAAMK,QAA+BA,IAAMiB,EAAYF,EAAYf,WACnDgB,IAAhBrB,EAAMM,UAAiCA,MAAQgB,EAAYF,EAAYd,aACtDe,IAAjBrB,EAAMO,WAAkCA,OAASe,EAAYF,EAAYb,cACzDc,IAAhBrB,EAAMuB,UAAiCA,MAAQD,EAAYF,EAAYG,aACtDF,IAAjBrB,EAAMwB,WAAkCA,OAASF,EAAYF,EAAYI,SAE7E,MAAMC,EAAyBC,OAAOC,OAAOxB,EAAIiB,GAC3CQ,EAAchC,GAAA,KAClBiC,EAAmBJ,EAAOhB,GAAE,GADhBmB,SAKdC,EAAmBJ,EAAOhB,IAE1B,MAAMqB,EAAeL,EAAOX,QAAUW,EAAOV,eAAiB,GAExDgB,EAAYlC,SAASmC,cAAc,OAEzCD,EAAUtB,GAAKgB,EAAOhB,GACtBsB,EAAUE,MAAMC,cAAgB,OAEhC,IAAIC,EAAWxC,IACXK,E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BC,EAAqD9F,GAAA+F,IAC1D,MAAAtB,WAAEA,GAAesB,GAAOC,KAAwB,CAAC,EAGhD,OAFWvB,EAAAA,EAEX,CAAEtE,gBAAc,GAJK4F"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/usePopWindow/src/index.tsx"],"sourcesContent":["import { type AppContext, type Component, type ComponentInternalInstance, getCurrentInstance, nextTick, render } from 'vue'\n\nimport { ElScrollbar } from 'element-plus'\nimport { formatValue } from '../../../utils'\nimport { type PopWindowInfoProps, type PopWindowProps } from './interface'\n\nlet appContextConst: AppContext | undefined\nconst popWindowList: Array<any> = []\nconst getBody = (): Element => {\n return document.querySelector('body') as HTMLBodyElement\n}\n/**\n * 显示弹出窗口\n *\n * 此函数用于创建并显示一个弹出窗口,支持自定义样式和内容通过参数传递\n * 可以选择附加到特定的父元素,并且在渲染后会将自身添加到弹出窗口列表中\n *\n * @param props 弹出窗口的属性,包括位置、尺寸等样式属性以及附加属性\n * @param component 可选参数,用于指定弹出窗口内渲染的自定义组件类型,如果props中传了render函数,则无效\n * @param componentProps 可选参数,传递给自定义组件的属性\n */\nexport const showPopWindow = (props: PopWindowProps, component?: Component, componentProps?: any) => {\n const op = {\n left: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n // width: 'auto',\n // height: 'auto',\n position: 'absolute',\n id: 'popwindow_' + Math.ceil(Math.random() * 1000000),\n zIndex: 9999,\n animate: false,\n animateInClass: 'animate__animated animate__faster animate__fadeIn',\n animateOutClass: 'animate__animated animate__faster animate__fadeOut',\n draggable: false,\n draggableClass: '',\n dragInParent: false,\n style: {}\n }\n const propsFormat = { ...props }\n if (props.left !== undefined) propsFormat.left = formatValue(propsFormat.left)\n if (props.top !== undefined) propsFormat.top = formatValue(propsFormat.top)\n if (props.right !== undefined) propsFormat.right = formatValue(propsFormat.right)\n if (props.bottom !== undefined) propsFormat.bottom = formatValue(propsFormat.bottom)\n if (props.width !== undefined) propsFormat.width = formatValue(propsFormat.width)\n if (props.height !== undefined) propsFormat.height = formatValue(propsFormat.height)\n\n const option: PopWindowProps = Object.assign(op, propsFormat)\n const close = () => {\n closePopWindowById(option.id)\n }\n\n // 相同的id只会存在一个\n closePopWindowById(option.id)\n\n const animateClass = option.animate ? option.animateInClass : ''\n\n const container = document.createElement('div')\n // container.id = 'popwindow_' + Math.ceil(Math.random() * 1000000)\n container.id = option.id\n container.style.pointerEvents = 'auto'\n\n let parentEl = getBody()\n if (props.appendParent) {\n parentEl = document.getElementById(props.appendParent)\n }\n parentEl.appendChild(container)\n\n // 拖动功能实现\n const startDrag = () => {\n const el = container.querySelector('.popWindow') as HTMLElement\n const draggableEl: HTMLElement = option.draggableClass ? (container.querySelector('.' + option.draggableClass) as HTMLElement) : el\n\n if (draggableEl) {\n // 限制拖动在父容器内\n // if (parentEl) {\n // 计算拖动范围\n const maxLeft = parentEl ? parentEl.clientWidth - el.clientWidth : Infinity\n const maxTop = parentEl ? parentEl.clientHeight - el.clientHeight : Infinity\n // }\n draggableEl.onmousedown = (eDown: MouseEvent) => {\n const offsetX = eDown.pageX - el.offsetLeft\n const offsetY = eDown.pageY - el.offsetTop\n\n const onMouseMove = (e: MouseEvent) => {\n let left = e.pageX - offsetX\n let top = e.pageY - offsetY\n if (option.dragInParent) {\n left = left < 0 ? 0 : left > maxLeft ? maxLeft : left\n top = top < 0 ? 0 : top > maxTop ? maxTop : top\n }\n\n el.style.left = `${left}px`\n el.style.top = `${top}px`\n }\n\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove)\n document.removeEventListener('mouseup', onMouseUp)\n }\n\n document.addEventListener('mousemove', onMouseMove)\n document.addEventListener('mouseup', onMouseUp)\n }\n }\n }\n debugger\n const vm = (\n <div\n class={'popWindow ' + animateClass}\n style={{\n left: option.left,\n right: option.right,\n top: option.top,\n bottom: option.bottom,\n position: option.position,\n zIndex: option.zIndex,\n width: option.width,\n height: option.height,\n ...option.style\n }}>\n <ElScrollbar>\n {props.render ? props.render({ close, option }) : <component is={component} {...componentProps} onClose={() => close()}></component>}\n </ElScrollbar>\n </div>\n )\n vm.appContext = appContextConst\n // 这里是为了让插槽的子组件能获取到appContext\n if (vm.children?.length) {\n vm.children[0].appContext = appContextConst\n }\n render(vm, container)\n\n nextTick(() => {\n const popWindowInfo = { id: option.id, tag: option.tag, node: container, option }\n popWindowList.push(popWindowInfo)\n option.draggable && startDrag()\n })\n\n return { id: option.id, close }\n}\nconst removePopWindow = (popWindowInfo: PopWindowInfoProps) => {\n if (!popWindowInfo) return\n const { option, node } = popWindowInfo\n option.onClose?.()\n if (option.animate) {\n const popWindowNode = node.querySelector('.popWindow')\n popWindowNode.className = 'popWindow ' + option.animateOutClass\n popWindowNode.addEventListener('animationend', () => {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n })\n } else {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n }\n}\n\n/**\n * 根据ID关闭弹出窗口\n *\n * @param id 弹出窗口的唯一标识符\n */\nexport const closePopWindowById = (id: string) => {\n const popWindowItem = popWindowList.find((item) => item.id === id)\n if (popWindowItem) {\n removePopWindow(popWindowItem)\n }\n}\n\n/**\n * 根据tag关闭弹出窗口\n *\n * @param tag 弹出窗口的tag\n */\nexport const closePopWindowByTag = (tag: string) => {\n const popWindows = popWindowList.filter((item) => item.tag === tag)\n popWindows.forEach((item) => removePopWindow(item))\n}\n\n/**\n * 获取所有弹窗信息\n *\n * @returns {PopWindowInfoProps[]} 所有弹窗的列表\n */\nexport const getAllPopWindows = (): PopWindowInfoProps[] => {\n return popWindowList\n}\n\nexport const initPopWindow = (ctx?: ComponentInternalInstance) => {\n const { appContext } = ctx || getCurrentInstance() || {}\n appContextConst = appContext\n\n return { showPopWindow }\n}\n"],"names":["appContextConst","popWindowList","getBody","__name","document","querySelector","showPopWindow","props","component","componentProps","op","left","top","right","bottom","position","id","Math","ceil","random","zIndex","animate","animateInClass","animateOutClass","draggable","draggableClass","dragInParent","style","propsFormat","undefined","formatValue","width","height","option","Object","assign","close","closePopWindowById","animateClass","container","createElement","pointerEvents","parentEl","appendParent","getElementById","appendChild","startDrag","el","draggableEl","maxLeft","clientWidth","Infinity","maxTop","clientHeight","onmousedown","eDown","offsetX","pageX","offsetLeft","offsetY","pageY","offsetTop","onMouseMove","e","onMouseUp","removeEventListener","addEventListener","vm","_createVNode","class","ElScrollbar","default","render","_mergeProps","is","onClose","appContext","children","length","nextTick","popWindowInfo","tag","node","push","removePopWindow","popWindowNode","className","remove","splice","indexOf","popWindowItem","find","item","closePopWindowByTag","filter","forEach","getAllPopWindows","initPopWindow","ctx","getCurrentInstance"],"mappings":"iRAMA,IAAIA,EACJ,MAAMC,EAA4B,GAC5BC,EAAyBC,GAAA,IACtBC,SAASC,cAAc,SADhBH,WAaHI,EAAgBA,GAAAA,CAACC,EAAuBC,EAAuBC,KAC1E,MAAMC,EAAK,CACTC,KAAM,OACNC,IAAK,OACLC,MAAO,OACPC,OAAQ;;;AAGRC,SAAU,WACVC,GAAI,aAAeC,KAAKC,KAAqB,IAAhBD,KAAKE,UAClCC,OAAQ,KACRC,SAAS,EACTC,eAAgB,oDAChBC,gBAAiB,qDACjBC,WAAW,EACXC,eAAgB,GAChBC,cAAc,EACdC,MAAO,CAAA,GAEHC,EAAc,IAAKrB,QACNsB,IAAftB,EAAMI,SAAgCA,KAAOmB,EAAYF,EAAYjB,YACvDkB,IAAdtB,EAAMK,QAA+BA,IAAMkB,EAAYF,EAAYhB,WACnDiB,IAAhBtB,EAAMM,UAAiCA,MAAQiB,EAAYF,EAAYf,aACtDgB,IAAjBtB,EAAMO,WAAkCA,OAASgB,EAAYF,EAAYd,cACzDe,IAAhBtB,EAAMwB,UAAiCA,MAAQD,EAAYF,EAAYG,aACtDF,IAAjBtB,EAAMyB,WAAkCA,OAASF,EAAYF,EAAYI,SAE7E,MAAMC,EAAyBC,OAAOC,OAAOzB,EAAIkB,GAC3CQ,EAAcjC,GAA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AAM0E,EAAgBzF,EAAc0F,MAAeC,GAAAA,EAAK5E,KAAOA,IAC3D0E,GACFN,EAAgBM,EAAa,GAHE1E,sBAYtB6E,EAAuC1F,GAAA8E,IAC/BhF,EAAc6F,QAAiBF,GAAAA,EAAKX,MAAQA,IACpDc,SAASH,GAASR,EAAgBQ,IAAK,GAFhBX,uBAUvBe,EAA+C7F,GAAA,IACnDF,GADuB+F,oBAInBC,EAAqD9F,GAAA+F,IAC1D,MAAAtB,WAAEA,GAAesB,GAAOC,KAAwB,CAAC,EAGhD,OAFWvB,EAAAA,EAEX,CAAEtE,gBAAc,GAJK4F"}
@@ -35,6 +35,8 @@ export interface PopWindowProps {
35
35
  animateOutClass?: string;
36
36
  /**弹窗层级,默认为9999 */
37
37
  zIndex?: number;
38
+ /** 弹窗样式 */
39
+ style?: any;
38
40
  /** 关闭事件回调 */
39
41
  onClose?: () => void;
40
42
  /** 渲染函数,如果不传,则需要传显示的Component */
package/es/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import o from"./installer.mjs";export{install}from"./installer.mjs";import"./functions/index.mjs";import"./hooks/index.mjs";export{copyText,formatValue}from"./utils/index.mjs";import"./directives/index.mjs";import"./components/index.mjs";import e from"./functions/modules/log.mjs";export{closePopWindowById,closePopWindowByTag,getAllPopWindows,showPopWindow}from"./hooks/usePopWindow/src/index.mjs";export{usePopWindow}from"./hooks/usePopWindow/index.mjs";export{useDialog}from"./hooks/useDialog/index.mjs";export{default as ImageViewer}from"./hooks/useImageViewer/src/index.vue.mjs";export{useImageViewer}from"./hooks/useImageViewer/index.mjs";export{useDrawer}from"./hooks/useDrawer/index.mjs";export{withInstall,withInstallDirectives}from"./utils/install.mjs";export{developFn}from"./utils/myDevelop.mjs";export{default as vCopy}from"./directives/modules/copy.mjs";export{default as vDrag}from"./directives/modules/drag.mjs";export{default as vAutoScroll}from"./directives/modules/autoScroll.mjs";export{default as vTooltip}from"./directives/modules/tooltip.mjs";export{default as vConfirm}from"./directives/modules/confirm.mjs";export{default as vCountTo}from"./directives/modules/countTo.mjs";export{default as utils}from"./functions/modules/uitls.mjs";import*as s from"./functions/modules/is.mjs";export{s as is};export{useZnForm}from"./components/znForm/src/hooks/useZnForm.mjs";export{useZnSearch}from"./components/znSearch/src/hooks/useProSearch.mjs";export{ZnTable}from"./components/znTable/index.mjs";export{ZnTreeFilter}from"./components/znTreeFilter/index.mjs";export{ZnChart}from"./components/znChart/index.mjs";export{ZnCountTo}from"./components/znCountTo/index.mjs";export{ZnTest}from"./components/znTest/index.mjs";export{ZnForm}from"./components/znForm/index.mjs";export{ZnTimeline}from"./components/znTimeLine/index.mjs";export{ZnWorkGrid}from"./components/znWorkGrid/index.mjs";export{ZnGrid,ZnGridItem}from"./components/znGrid/index.mjs";export{ZnSearch}from"./components/znSearch/index.mjs";export{ZnNumberScroll}from"./components/znNumberScroll/index.mjs";globalThis.log=e;"function"==typeof globalThis?.log?.success&&globalThis.log.primary("1.0.44","欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/");export{o as default,e as log};
1
+ import o from"./installer.mjs";export{install}from"./installer.mjs";import"./functions/index.mjs";import"./hooks/index.mjs";export{copyText,formatValue}from"./utils/index.mjs";import"./directives/index.mjs";import"./components/index.mjs";import e from"./functions/modules/log.mjs";export{closePopWindowById,closePopWindowByTag,getAllPopWindows,showPopWindow}from"./hooks/usePopWindow/src/index.mjs";export{usePopWindow}from"./hooks/usePopWindow/index.mjs";export{useDialog}from"./hooks/useDialog/index.mjs";export{default as ImageViewer}from"./hooks/useImageViewer/src/index.vue.mjs";export{useImageViewer}from"./hooks/useImageViewer/index.mjs";export{useDrawer}from"./hooks/useDrawer/index.mjs";export{withInstall,withInstallDirectives}from"./utils/install.mjs";export{developFn}from"./utils/myDevelop.mjs";export{default as vCopy}from"./directives/modules/copy.mjs";export{default as vDrag}from"./directives/modules/drag.mjs";export{default as vAutoScroll}from"./directives/modules/autoScroll.mjs";export{default as vTooltip}from"./directives/modules/tooltip.mjs";export{default as vConfirm}from"./directives/modules/confirm.mjs";export{default as vCountTo}from"./directives/modules/countTo.mjs";export{default as utils}from"./functions/modules/uitls.mjs";import*as s from"./functions/modules/is.mjs";export{s as is};export{useZnForm}from"./components/znForm/src/hooks/useZnForm.mjs";export{useZnSearch}from"./components/znSearch/src/hooks/useProSearch.mjs";export{ZnTable}from"./components/znTable/index.mjs";export{ZnTreeFilter}from"./components/znTreeFilter/index.mjs";export{ZnChart}from"./components/znChart/index.mjs";export{ZnCountTo}from"./components/znCountTo/index.mjs";export{ZnTest}from"./components/znTest/index.mjs";export{ZnForm}from"./components/znForm/index.mjs";export{ZnTimeline}from"./components/znTimeLine/index.mjs";export{ZnWorkGrid}from"./components/znWorkGrid/index.mjs";export{ZnGrid,ZnGridItem}from"./components/znGrid/index.mjs";export{ZnSearch}from"./components/znSearch/index.mjs";export{ZnNumberScroll}from"./components/znNumberScroll/index.mjs";globalThis.log=e;"function"==typeof globalThis?.log?.success&&globalThis.log.primary("1.0.45","欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/");export{o as default,e as log};
2
2
  //# sourceMappingURL=index.mjs.map
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/index.ts"],"sourcesContent":["import installer from './installer'\nimport { log } from './functions'\nexport * from './hooks'\nexport * from './utils'\nexport * from './installer'\nexport * from './directives'\nexport * from './functions'\nexport * from './components'\n\nexport default installer\nglobalThis.log = log\nconst version = '1.0.44'\nif (typeof globalThis?.log?.success === 'function') {\n globalThis.log.primary(version, '欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/')\n}\n"],"names":["globalThis","log","success","primary"],"mappings":"+hEAUAA,WAAWC,IAAMA,EAEuB,mBAA7BD,YAAYC,KAAKC,SACfF,WAAAC,IAAIE,QAFD,SAEkB"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/index.ts"],"sourcesContent":["import installer from './installer'\nimport { log } from './functions'\nexport * from './hooks'\nexport * from './utils'\nexport * from './installer'\nexport * from './directives'\nexport * from './functions'\nexport * from './components'\n\nexport default installer\nglobalThis.log = log\nconst version = '1.0.45'\nif (typeof globalThis?.log?.success === 'function') {\n globalThis.log.primary(version, '欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/')\n}\n"],"names":["globalThis","log","success","primary"],"mappings":"+hEAUAA,WAAWC,IAAMA,EAEuB,mBAA7BD,YAAYC,KAAKC,SACfF,WAAAC,IAAIE,QAFD,SAEkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFormItem.vue.js","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps<SearchFormItem>()\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n debugger\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","openBlock","_createBlock","_resolveDynamicComponent","resolveDynamicComponent","column","render","search","el","_mergeProps","mergeProps","handleSearchProps","placeholder","searchParam","_searchParam","clearable","modelValue","key","handleProp","prop","$event","modelModifiers","trim","data","columnEnum","options","includes","_createSlots","default","_withCtx","_createElementBlock","createElementBlock","_Fragment","Fragment","_renderList","col","index","createBlock","label","fieldNames","_renderSlot","$slots","_","name","fn","withCtx","_createElementVNode","createElementVNode","_toDisplayString"],"mappings":"oMAAA,SAAAA,EAIkBC,EAAYC,EAAAC,EAACC,EAAOC,EAAQC,GAJ9C,OAAAC,EAAAC,YAAAC,EAAAA,YAAAC,EAAAC,wBAAAR,EAIkBS,eAAYC,QAAC,MAAOV,EAAQS,OAAOE,QAAAC,MAAAC,EAAAC,WAAW,IAAOb,EAAIc,qBAAAd,EAAAe,YAAAC,YAAAhB,EAAAiB,aAAAC,UAAAlB,EAAAkB,WAAA,CAJ3EC,aAIIF,aAA0ElB,EAAAS,OAAAE,QAAAU,KAAApB,EAAAqB,WAAAtB,EAAAS,OAAAc,OACzE,sBAAaxB,EAAU,KAAAA,EAAA,GAAAyB,GAAqBvB,EAAUiB,aAAAlB,EAAAS,OAAAE,QAAAU,KAAApB,EAAAqB,WAAAtB,EAAAS,OAAAc,OAAAC,GACtDC,eAAO,CAAAC,MAAA,GANZC,KAAA,gBAAA3B,EAAAS,OAAAE,QAAAC,GAAAX,EAAA2B,WAAA,GAYcC,QAAA,CAAA,WAAA,aAAAC,SAAA9B,EAAAS,OAAAE,QAAAC,IAAAX,EAAA2B,WAAA,KAFMG,EAAAA,YAAA,CAAAC,QAAAC,WAAA,IAAA,CACd,WAAAjC,EAAAS,OAAAE,QAAAC,IAAAR,EAAAC,WAAsE,GAAK6B,EAAAC,mBAAAC,EAAAC,SAAA,CAAAhB,IAAA,GAAAiB,EAAAA,WAAArC,EAAA2B,YAAA,CAAAW,EAAAC,KAAQpC,EAAAA,cAAiBqC,YAAAlC,EAAAC,wBAAK,aAAA,CAAIa,IAAKmB,EAAAE,MAAAH,EAAAtC,EAAA0C,WAAAD,oCAEpH,KAAA,EAAmB,CAbvB,QAAA;uBAAAE,EAAAA,WAAA9C,EAAA+C,OAAA,UAAA,CAAAxB,IAAA,OAOoByB,EAAA;eAAA,CAA0C,aAP9D9C,EAAAS,OAOuDE,QAAOC,GAAA,CACxDmC,KAAA,UAAAC,GAAAf,EAAAgB,SAAA,EAAAtB,UAAA,CARNuB,EAAAC,mBAAA,OAAA,KAAAC,EAAAA,gBAAAzB,EAAA1B,EAAA0C,WAAAD,QAAA;eAAArB,IAAA,UAAA,oEAAAxB,gBAAA"}
1
+ {"version":3,"file":"SearchFormItem.vue.js","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps<SearchFormItem>()\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","openBlock","_createBlock","_resolveDynamicComponent","resolveDynamicComponent","column","render","search","el","_mergeProps","mergeProps","handleSearchProps","placeholder","searchParam","_searchParam","clearable","modelValue","key","handleProp","prop","$event","modelModifiers","trim","data","columnEnum","options","includes","_createSlots","default","_withCtx","_createElementBlock","createElementBlock","_Fragment","Fragment","_renderList","col","index","createBlock","label","fieldNames","_renderSlot","$slots","_","name","fn","withCtx","_createElementVNode","createElementVNode","_toDisplayString"],"mappings":"oMAAA,SAAAA,EAIkBC,EAAYC,EAAAC,EAACC,EAAOC,EAAQC,GAJ9C,OAAAC,EAAAC,YAAAC,EAAAA,YAAAC,EAAAC,wBAAAR,EAIkBS,eAAYC,QAAC,MAAOV,EAAQS,OAAOE,QAAAC,MAAAC,EAAAC,WAAW,IAAOb,EAAIc,qBAAAd,EAAAe,YAAAC,YAAAhB,EAAAiB,aAAAC,UAAAlB,EAAAkB,WAAA,CAJ3EC,aAIIF,aAA0ElB,EAAAS,OAAAE,QAAAU,KAAApB,EAAAqB,WAAAtB,EAAAS,OAAAc,OACzE,sBAAaxB,EAAU,KAAAA,EAAA,GAAAyB,GAAqBvB,EAAUiB,aAAAlB,EAAAS,OAAAE,QAAAU,KAAApB,EAAAqB,WAAAtB,EAAAS,OAAAc,OAAAC,GACtDC,eAAO,CAAAC,MAAA,GANZC,KAAA,gBAAA3B,EAAAS,OAAAE,QAAAC,GAAAX,EAAA2B,WAAA,GAYcC,QAAA,CAAA,WAAA,aAAAC,SAAA9B,EAAAS,OAAAE,QAAAC,IAAAX,EAAA2B,WAAA,KAFMG,EAAAA,YAAA,CAAAC,QAAAC,WAAA,IAAA,CACd,WAAAjC,EAAAS,OAAAE,QAAAC,IAAAR,EAAAC,WAAsE,GAAK6B,EAAAC,mBAAAC,EAAAC,SAAA,CAAAhB,IAAA,GAAAiB,EAAAA,WAAArC,EAAA2B,YAAA,CAAAW,EAAAC,KAAQpC,EAAAA,cAAiBqC,YAAAlC,EAAAC,wBAAK,aAAA,CAAIa,IAAKmB,EAAAE,MAAAH,EAAAtC,EAAA0C,WAAAD,oCAEpH,KAAA,EAAmB,CAbvB,QAAA;uBAAAE,EAAAA,WAAA9C,EAAA+C,OAAA,UAAA,CAAAxB,IAAA,OAOoByB,EAAA;eAAA,CAA0C,aAP9D9C,EAAAS,OAOuDE,QAAOC,GAAA,CACxDmC,KAAA,UAAAC,GAAAf,EAAAgB,SAAA,EAAAtB,UAAA,CARNuB,EAAAC,mBAAA,OAAA,KAAAC,EAAAA,gBAAAzB,EAAA1B,EAAA0C,WAAAD,QAAA;eAAArB,IAAA,UAAA,oEAAAxB,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFormItem.vue2.js","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps({\n column: { required: true },\n searchParam: { required: true }\n})\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n debugger\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["props","__props","_searchParam","computed","searchParam","fieldNames","label","column","value","dictCode","children","enumMap","inject","ref","Map","columnEnum","enumData","get","prop","search","el","map","item","handleSearchProps","searchEl","searchProps","nodeKey","placeholder","includes","type","isRange","rangeSeparator","startPlaceholder","endPlaceholder","clearable","defaultValue"],"mappings":"oPA2BE,MAAMA,EAAQC,EAMRC,EAAeC,EAAAA,UAAS,IAAMH,EAAMI,cAGpCC,EAAaF,EAAAA,UAAS,KAC1B,IAAIG,EAAQN,EAAMO,OAAOF,YAAYC,OAAS,QAC1CE,EAAQR,EAAMO,OAAOF,YAAYG,OAAS,QAExC,MAAAC,SAAEA,GAAaT,EAAMO,OAKpB,OAJHE,IACMH,EAAA,OACAE,EAAA,QAEH,CACLF,QACAE,QACAE,SAAUV,EAAMO,OAAOF,YAAYK,UAAY,WACjD,IAKIC,EAAUC,EAAAA,OAAO,UAAWC,EAAAA,IAAQ,IAAAC,MACpCC,EAAaZ,EAAAA,UAAS,KAC1B,IAAIa,EAAWL,EAAQH,MAAMS,IAAIjB,EAAMO,OAAOW,MAC1C,OAACF,GAC2B,cAA5BhB,EAAMO,OAAOY,QAAQC,IAAsBpB,EAAMO,OAAOF,aAC/CW,EAAAA,EAASK,KAAKC,IAChB,IAAKA,EAAMhB,MAAOgB,EAAKjB,EAAWG,MAAMF,OAAQE,MAAOc,EAAKjB,EAAWG,MAAMA,YAGjFQ,GANe,EAMf,IAIHO,EAAoBpB,EAAAA,UAAS,KAC3B,MAAAG,EAAQD,EAAWG,MAAMF,MACzBE,EAAQH,EAAWG,MAAMA,MACzBE,EAAWL,EAAWG,MAAME,SAC5Bc,EAAWxB,EAAMO,OAAOY,QAAQC,GACtC,IAAIK,EAAczB,EAAMO,OAAOY,QAAQnB,OAAS,CAAC,EAO1C,MANU,gBAAbwB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOI,YAAYgB,QAASlB,IAEtE,aAAbgB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOE,QAAOE,cAElEe,CAAA,IAIHE,EAAcxB,EAAAA,UAAS,KACrB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,GAAI,CAAC,gBAAiB,YAAa,cAAcS,SAAST,GAAQnB,OAAO6B,OAASV,GAAQnB,OAAO8B,QACxF,MAAA,CACLC,eAAgBZ,GAAQnB,OAAO+B,gBAAkB,IACjDC,iBAAkBb,GAAQnB,OAAOgC,kBAAoB,OACrDC,eAAgBd,GAAQnB,OAAOiC,gBAAkB,QAI9C,MAAA,CAAEN,YADWR,GAAQnB,OAAO2B,cAAgBR,GAAQC,IAAIQ,SAAS,SAAW,MAAQ,OACtE,IAIjBM,EAAY/B,EAAAA,UAAS,KACnB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,OAAOA,GAAQnB,OAAOkC,YAAsC,MAAxBf,GAAQgB,cAAgD,MAAxBhB,GAAQgB,aAAgB"}
1
+ {"version":3,"file":"SearchFormItem.vue2.js","sources":["../../../../../../../../../packages/components/znTable/src/components/SearchForm/components/SearchFormItem.vue"],"sourcesContent":["<template>\n <component\n :is=\"column.search?.render ?? `el-${column.search?.el}`\"\n v-bind=\"{ ...handleSearchProps, ...placeholder, searchParam: _searchParam, clearable }\"\n v-model.trim=\"_searchParam[column.search?.key ?? handleProp(column.prop!)]\"\n :data=\"column.search?.el === 'tree-select' ? columnEnum : []\"\n :options=\"['cascader', 'select-v2'].includes(column.search?.el!) ? columnEnum : []\">\n <template v-if=\"column.search?.el === 'cascader'\" #default=\"{ data }\">\n <span>{{ data[fieldNames.label] }}</span>\n </template>\n <template v-if=\"column.search?.el === 'select'\">\n <component :is=\"`el-option`\" v-for=\"(col, index) in columnEnum\" :key=\"index\" :label=\"col[fieldNames.label]\" :value=\"col[fieldNames.value]\"></component>\n </template>\n <slot v-else></slot>\n </component>\n</template>\n\n<script setup lang=\"ts\" name=\"SearchFormItem\">\n import { computed, inject, ref } from 'vue'\n\n import { ColumnProps } from '../../../interface'\n import { handleProp } from '../../../utils'\n\n interface SearchFormItem {\n column: ColumnProps\n searchParam: { [key: string]: any }\n }\n const props = defineProps({\n column: { required: true },\n searchParam: { required: true }\n})\n\n // Re receive SearchParam\n const _searchParam = computed(() => props.searchParam)\n\n // 判断 fieldNames 设置 label && value && children 的 key 值\n const fieldNames = computed(() => {\n let label = props.column.fieldNames?.label ?? 'label'\n let value = props.column.fieldNames?.value ?? 'value'\n\n const { dictCode } = props.column\n if (dictCode) {\n label = 'name'\n value = 'code'\n }\n return {\n label: label,\n value: value,\n children: props.column.fieldNames?.children ?? 'children'\n }\n })\n\n // 接收 enumMap (el 为 select-v2 需单独处理 enumData)\n\n const enumMap = inject('enumMap', ref(new Map()))\n const columnEnum = computed(() => {\n let enumData = enumMap.value.get(props.column.prop)\n if (!enumData) return []\n if (props.column.search?.el === 'select-v2' && props.column.fieldNames) {\n enumData = enumData.map((item: { [key: string]: any }) => {\n return { ...item, label: item[fieldNames.value.label], value: item[fieldNames.value.value] }\n })\n }\n return enumData\n })\n\n // 处理透传的 searchProps (el 为 tree-select、cascader 的时候需要给下默认 label && value && children)\n const handleSearchProps = computed(() => {\n const label = fieldNames.value.label\n const value = fieldNames.value.value\n const children = fieldNames.value.children\n const searchEl = props.column.search?.el\n let searchProps = props.column.search?.props ?? {}\n if (searchEl === 'tree-select') {\n searchProps = { ...searchProps, props: { ...searchProps, label, children }, nodeKey: value }\n }\n if (searchEl === 'cascader') {\n searchProps = { ...searchProps, props: { ...searchProps, label, value, children } }\n }\n return searchProps\n })\n\n // 处理默认 placeholder\n const placeholder = computed(() => {\n const search = props.column.search\n if (['datetimerange', 'daterange', 'monthrange'].includes(search?.props?.type) || search?.props?.isRange) {\n return {\n rangeSeparator: search?.props?.rangeSeparator ?? '至',\n startPlaceholder: search?.props?.startPlaceholder ?? '开始时间',\n endPlaceholder: search?.props?.endPlaceholder ?? '结束时间'\n }\n }\n const placeholder = search?.props?.placeholder ?? (search?.el?.includes('input') ? '请输入' : '请选择')\n return { placeholder }\n })\n\n // 是否有清除按钮 (当搜索项有默认值时,清除按钮不显示)\n const clearable = computed(() => {\n const search = props.column.search\n return search?.props?.clearable ?? (search?.defaultValue == null || search?.defaultValue == undefined)\n })\n</script>\n"],"names":["props","__props","_searchParam","computed","searchParam","fieldNames","label","column","value","dictCode","children","enumMap","inject","ref","Map","columnEnum","enumData","get","prop","search","el","map","item","handleSearchProps","searchEl","searchProps","nodeKey","placeholder","includes","type","isRange","rangeSeparator","startPlaceholder","endPlaceholder","clearable","defaultValue"],"mappings":"oPA2BE,MAAMA,EAAQC,EAMRC,EAAeC,EAAAA,UAAS,IAAMH,EAAMI,cAGpCC,EAAaF,EAAAA,UAAS,KAC1B,IAAIG,EAAQN,EAAMO,OAAOF,YAAYC,OAAS,QAC1CE,EAAQR,EAAMO,OAAOF,YAAYG,OAAS,QAExC,MAAAC,SAAEA,GAAaT,EAAMO,OAKpB,OAJHE,IACMH,EAAA,OACAE,EAAA,QAEH,CACLF,QACAE,QACAE,SAAUV,EAAMO,OAAOF,YAAYK,UAAY,WACjD,IAKIC,EAAUC,EAAAA,OAAO,UAAWC,EAAAA,IAAQ,IAAAC,MACpCC,EAAaZ,EAAAA,UAAS,KAC1B,IAAIa,EAAWL,EAAQH,MAAMS,IAAIjB,EAAMO,OAAOW,MAC1C,OAACF,GAC2B,cAA5BhB,EAAMO,OAAOY,QAAQC,IAAsBpB,EAAMO,OAAOF,aAC/CW,EAAAA,EAASK,KAAKC,IAChB,IAAKA,EAAMhB,MAAOgB,EAAKjB,EAAWG,MAAMF,OAAQE,MAAOc,EAAKjB,EAAWG,MAAMA,YAGjFQ,GANe,EAMf,IAIHO,EAAoBpB,EAAAA,UAAS,KAC3B,MAAAG,EAAQD,EAAWG,MAAMF,MACzBE,EAAQH,EAAWG,MAAMA,MACzBE,EAAWL,EAAWG,MAAME,SAC5Bc,EAAWxB,EAAMO,OAAOY,QAAQC,GACtC,IAAIK,EAAczB,EAAMO,OAAOY,QAAQnB,OAAS,CAAC,EAO1C,MANU,gBAAbwB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOI,YAAYgB,QAASlB,IAEtE,aAAbgB,IACYC,EAAA,IAAKA,EAAazB,MAAO,IAAKyB,EAAanB,QAAOE,QAAOE,cAElEe,CAAA,IAIHE,EAAcxB,EAAAA,UAAS,KACrB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,GAAI,CAAC,gBAAiB,YAAa,cAAcS,SAAST,GAAQnB,OAAO6B,OAASV,GAAQnB,OAAO8B,QACxF,MAAA,CACLC,eAAgBZ,GAAQnB,OAAO+B,gBAAkB,IACjDC,iBAAkBb,GAAQnB,OAAOgC,kBAAoB,OACrDC,eAAgBd,GAAQnB,OAAOiC,gBAAkB,QAI9C,MAAA,CAAEN,YADWR,GAAQnB,OAAO2B,cAAgBR,GAAQC,IAAIQ,SAAS,SAAW,MAAQ,OACtE,IAIjBM,EAAY/B,EAAAA,UAAS,KACnB,MAAAgB,EAASnB,EAAMO,OAAOY,OAC5B,OAAOA,GAAQnB,OAAOkC,YAAsC,MAAxBf,GAAQgB,cAAgD,MAAxBhB,GAAQgB,aAAgB"}
@@ -1,5 +1,5 @@
1
1
  "use strict";var e=require("vue"),t=require("element-plus"),o=require("../../../utils/index.js"),n=Object.defineProperty,i=(e,t)=>n(e,"name",{value:t,configurable:!0});let a;const d=[],r=i((()=>document.querySelector("body")),"getBody"),s=i(((n,s,l)=>{const u={left:"auto",top:"auto",right:"auto",bottom:"auto",
2
2
  // width: 'auto',
3
3
  // height: 'auto',
4
- position:"absolute",id:"popwindow_"+Math.ceil(1e6*Math.random()),zIndex:9999,animate:!1,animateInClass:"animate__animated animate__faster animate__fadeIn",animateOutClass:"animate__animated animate__faster animate__fadeOut",draggable:!1,draggableClass:"",dragInParent:!1},c={...n};void 0!==n.left&&(c.left=o.formatValue(c.left)),void 0!==n.top&&(c.top=o.formatValue(c.top)),void 0!==n.right&&(c.right=o.formatValue(c.right)),void 0!==n.bottom&&(c.bottom=o.formatValue(c.bottom)),void 0!==n.width&&(c.width=o.formatValue(c.width)),void 0!==n.height&&(c.height=o.formatValue(c.height));const m=Object.assign(u,c),g=i((()=>{p(m.id)}),"close");p(m.id);const h=m.animate?m.animateInClass:"",f=document.createElement("div");f.id=m.id,f.style.pointerEvents="auto";let w=r();n.appendParent&&(w=document.getElementById(n.appendParent)),w.appendChild(f);const v=i((()=>{const e=f.querySelector(".popWindow"),t=m.draggableClass?f.querySelector("."+m.draggableClass):e;if(t){const o=w?w.clientWidth-e.clientWidth:1/0,n=w?w.clientHeight-e.clientHeight:1/0;t.onmousedown=t=>{const a=t.pageX-e.offsetLeft,d=t.pageY-e.offsetTop,r=i((t=>{let i=t.pageX-a,r=t.pageY-d;m.dragInParent&&(i=i<0?0:i>o?o:i,r=r<0?0:r>n?n:r),e.style.left=`${i}px`,e.style.top=`${r}px`}),"onMouseMove"),s=i((()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)}),"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}}),"startDrag"),P=e.createVNode("div",{class:"popWindow "+h,style:{left:m.left,right:m.right,top:m.top,bottom:m.bottom,position:m.position,zIndex:m.zIndex,width:m.width,height:m.height}},[e.createVNode(t.ElScrollbar,null,{default:i((()=>[n.render?n.render({close:g,option:m}):e.createVNode(s,e.mergeProps({is:s},l,{onClose:i((()=>g()),"onClose")}),null)]),"default")})]);return P.appContext=a,P.children?.length&&(P.children[0].appContext=a),e.render(P,f),e.nextTick((()=>{const e={id:m.id,tag:m.tag,node:f,option:m};d.push(e),m.draggable&&v()})),{id:m.id,close:g}}),"showPopWindow"),l=i((t=>{if(!t)return;const{option:o,node:n}=t;if(o.onClose?.(),o.animate){const i=n.querySelector(".popWindow");i.className="popWindow "+o.animateOutClass,i.addEventListener("animationend",(()=>{e.render(null,n),n.remove(),d.splice(d.indexOf(t),1)}))}else e.render(null,n),n.remove(),d.splice(d.indexOf(t),1)}),"removePopWindow"),p=i((e=>{const t=d.find((t=>t.id===e));t&&l(t)}),"closePopWindowById"),u=i((e=>{d.filter((t=>t.tag===e)).forEach((e=>l(e)))}),"closePopWindowByTag"),c=i((()=>d),"getAllPopWindows"),m=i((t=>{const{appContext:o}=t||e.getCurrentInstance()||{};return a=o,{showPopWindow:s}}),"initPopWindow");exports.closePopWindowById=p,exports.closePopWindowByTag=u,exports.getAllPopWindows=c,exports.initPopWindow=m,exports.showPopWindow=s;
4
+ position:"absolute",id:"popwindow_"+Math.ceil(1e6*Math.random()),zIndex:9999,animate:!1,animateInClass:"animate__animated animate__faster animate__fadeIn",animateOutClass:"animate__animated animate__faster animate__fadeOut",draggable:!1,draggableClass:"",dragInParent:!1,style:{}},c={...n};void 0!==n.left&&(c.left=o.formatValue(c.left)),void 0!==n.top&&(c.top=o.formatValue(c.top)),void 0!==n.right&&(c.right=o.formatValue(c.right)),void 0!==n.bottom&&(c.bottom=o.formatValue(c.bottom)),void 0!==n.width&&(c.width=o.formatValue(c.width)),void 0!==n.height&&(c.height=o.formatValue(c.height));const m=Object.assign(u,c),g=i((()=>{p(m.id)}),"close");p(m.id);const h=m.animate?m.animateInClass:"",f=document.createElement("div");f.id=m.id,f.style.pointerEvents="auto";let w=r();n.appendParent&&(w=document.getElementById(n.appendParent)),w.appendChild(f);const v=i((()=>{const e=f.querySelector(".popWindow"),t=m.draggableClass?f.querySelector("."+m.draggableClass):e;if(t){const o=w?w.clientWidth-e.clientWidth:1/0,n=w?w.clientHeight-e.clientHeight:1/0;t.onmousedown=t=>{const a=t.pageX-e.offsetLeft,d=t.pageY-e.offsetTop,r=i((t=>{let i=t.pageX-a,r=t.pageY-d;m.dragInParent&&(i=i<0?0:i>o?o:i,r=r<0?0:r>n?n:r),e.style.left=`${i}px`,e.style.top=`${r}px`}),"onMouseMove"),s=i((()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)}),"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}}),"startDrag"),y=e.createVNode("div",{class:"popWindow "+h,style:{left:m.left,right:m.right,top:m.top,bottom:m.bottom,position:m.position,zIndex:m.zIndex,width:m.width,height:m.height,...m.style}},[e.createVNode(t.ElScrollbar,null,{default:i((()=>[n.render?n.render({close:g,option:m}):e.createVNode(s,e.mergeProps({is:s},l,{onClose:i((()=>g()),"onClose")}),null)]),"default")})]);return y.appContext=a,y.children?.length&&(y.children[0].appContext=a),e.render(y,f),e.nextTick((()=>{const e={id:m.id,tag:m.tag,node:f,option:m};d.push(e),m.draggable&&v()})),{id:m.id,close:g}}),"showPopWindow"),l=i((t=>{if(!t)return;const{option:o,node:n}=t;if(o.onClose?.(),o.animate){const i=n.querySelector(".popWindow");i.className="popWindow "+o.animateOutClass,i.addEventListener("animationend",(()=>{e.render(null,n),n.remove(),d.splice(d.indexOf(t),1)}))}else e.render(null,n),n.remove(),d.splice(d.indexOf(t),1)}),"removePopWindow"),p=i((e=>{const t=d.find((t=>t.id===e));t&&l(t)}),"closePopWindowById"),u=i((e=>{d.filter((t=>t.tag===e)).forEach((e=>l(e)))}),"closePopWindowByTag"),c=i((()=>d),"getAllPopWindows"),m=i((t=>{const{appContext:o}=t||e.getCurrentInstance()||{};return a=o,{showPopWindow:s}}),"initPopWindow");exports.closePopWindowById=p,exports.closePopWindowByTag=u,exports.getAllPopWindows=c,exports.initPopWindow=m,exports.showPopWindow=s;
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../packages/hooks/usePopWindow/src/index.tsx"],"sourcesContent":["import { type AppContext, type Component, type ComponentInternalInstance, getCurrentInstance, nextTick, render } from 'vue'\n\nimport { ElScrollbar } from 'element-plus'\nimport { formatValue } from '../../../utils'\nimport { type PopWindowInfoProps, type PopWindowProps } from './interface'\n\nlet appContextConst: AppContext | undefined\nconst popWindowList: Array<any> = []\nconst getBody = (): Element => {\n return document.querySelector('body') as HTMLBodyElement\n}\n/**\n * 显示弹出窗口\n *\n * 此函数用于创建并显示一个弹出窗口,支持自定义样式和内容通过参数传递\n * 可以选择附加到特定的父元素,并且在渲染后会将自身添加到弹出窗口列表中\n *\n * @param props 弹出窗口的属性,包括位置、尺寸等样式属性以及附加属性\n * @param component 可选参数,用于指定弹出窗口内渲染的自定义组件类型,如果props中传了render函数,则无效\n * @param componentProps 可选参数,传递给自定义组件的属性\n */\nexport const showPopWindow = (props: PopWindowProps, component?: Component, componentProps?: any) => {\n const op = {\n left: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n // width: 'auto',\n // height: 'auto',\n position: 'absolute',\n id: 'popwindow_' + Math.ceil(Math.random() * 1000000),\n zIndex: 9999,\n animate: false,\n animateInClass: 'animate__animated animate__faster animate__fadeIn',\n animateOutClass: 'animate__animated animate__faster animate__fadeOut',\n draggable: false,\n draggableClass: '',\n dragInParent: false\n }\n const propsFormat = { ...props }\n if (props.left !== undefined) propsFormat.left = formatValue(propsFormat.left)\n if (props.top !== undefined) propsFormat.top = formatValue(propsFormat.top)\n if (props.right !== undefined) propsFormat.right = formatValue(propsFormat.right)\n if (props.bottom !== undefined) propsFormat.bottom = formatValue(propsFormat.bottom)\n if (props.width !== undefined) propsFormat.width = formatValue(propsFormat.width)\n if (props.height !== undefined) propsFormat.height = formatValue(propsFormat.height)\n\n const option: PopWindowProps = Object.assign(op, propsFormat)\n const close = () => {\n closePopWindowById(option.id)\n }\n\n // 相同的id只会存在一个\n closePopWindowById(option.id)\n\n const animateClass = option.animate ? option.animateInClass : ''\n\n const container = document.createElement('div')\n // container.id = 'popwindow_' + Math.ceil(Math.random() * 1000000)\n container.id = option.id\n container.style.pointerEvents = 'auto'\n\n let parentEl = getBody()\n if (props.appendParent) {\n parentEl = document.getElementById(props.appendParent)\n }\n parentEl.appendChild(container)\n\n // 拖动功能实现\n const startDrag = () => {\n const el = container.querySelector('.popWindow') as HTMLElement\n const draggableEl: HTMLElement = option.draggableClass ? (container.querySelector('.' + option.draggableClass) as HTMLElement) : el\n\n if (draggableEl) {\n // 限制拖动在父容器内\n // if (parentEl) {\n // 计算拖动范围\n const maxLeft = parentEl ? parentEl.clientWidth - el.clientWidth : Infinity\n const maxTop = parentEl ? parentEl.clientHeight - el.clientHeight : Infinity\n // }\n draggableEl.onmousedown = (eDown: MouseEvent) => {\n const offsetX = eDown.pageX - el.offsetLeft\n const offsetY = eDown.pageY - el.offsetTop\n\n const onMouseMove = (e: MouseEvent) => {\n let left = e.pageX - offsetX\n let top = e.pageY - offsetY\n if (option.dragInParent) {\n left = left < 0 ? 0 : left > maxLeft ? maxLeft : left\n top = top < 0 ? 0 : top > maxTop ? maxTop : top\n }\n\n el.style.left = `${left}px`\n el.style.top = `${top}px`\n }\n\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove)\n document.removeEventListener('mouseup', onMouseUp)\n }\n\n document.addEventListener('mousemove', onMouseMove)\n document.addEventListener('mouseup', onMouseUp)\n }\n }\n }\n const vm = (\n <div\n class={'popWindow ' + animateClass}\n style={{\n left: option.left,\n right: option.right,\n top: option.top,\n bottom: option.bottom,\n position: option.position,\n zIndex: option.zIndex,\n width: option.width,\n height: option.height\n }}>\n <ElScrollbar>\n {props.render ? props.render({ close, option }) : <component is={component} {...componentProps} onClose={() => close()}></component>}\n </ElScrollbar>\n </div>\n )\n vm.appContext = appContextConst\n // 这里是为了让插槽的子组件能获取到appContext\n if (vm.children?.length) {\n vm.children[0].appContext = appContextConst\n }\n render(vm, container)\n\n nextTick(() => {\n const popWindowInfo = { id: option.id, tag: option.tag, node: container, option }\n popWindowList.push(popWindowInfo)\n option.draggable && startDrag()\n })\n\n return { id: option.id, close }\n}\nconst removePopWindow = (popWindowInfo: PopWindowInfoProps) => {\n if (!popWindowInfo) return\n const { option, node } = popWindowInfo\n option.onClose?.()\n if (option.animate) {\n const popWindowNode = node.querySelector('.popWindow')\n popWindowNode.className = 'popWindow ' + option.animateOutClass\n popWindowNode.addEventListener('animationend', () => {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n })\n } else {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n }\n}\n\n/**\n * 根据ID关闭弹出窗口\n *\n * @param id 弹出窗口的唯一标识符\n */\nexport const closePopWindowById = (id: string) => {\n const popWindowItem = popWindowList.find((item) => item.id === id)\n if (popWindowItem) {\n removePopWindow(popWindowItem)\n }\n}\n\n/**\n * 根据tag关闭弹出窗口\n *\n * @param tag 弹出窗口的tag\n */\nexport const closePopWindowByTag = (tag: string) => {\n const popWindows = popWindowList.filter((item) => item.tag === tag)\n popWindows.forEach((item) => removePopWindow(item))\n}\n\n/**\n * 获取所有弹窗信息\n *\n * @returns {PopWindowInfoProps[]} 所有弹窗的列表\n */\nexport const getAllPopWindows = (): PopWindowInfoProps[] => {\n return popWindowList\n}\n\nexport const initPopWindow = (ctx?: ComponentInternalInstance) => {\n const { appContext } = ctx || getCurrentInstance() || {}\n appContextConst = appContext\n\n return { showPopWindow }\n}\n"],"names":["appContextConst","popWindowList","getBody","__name","document","querySelector","showPopWindow","props","component","componentProps","op","left","top","right","bottom","position","id","Math","ceil","random","zIndex","animate","animateInClass","animateOutClass","draggable","draggableClass","dragInParent","propsFormat","undefined","formatValue","width","height","option","Object","assign","close","closePopWindowById","animateClass","container","createElement","style","pointerEvents","parentEl","appendParent","getElementById","appendChild","startDrag","el","draggableEl","maxLeft","clientWidth","Infinity","maxTop","clientHeight","onmousedown","eDown","offsetX","pageX","offsetLeft","offsetY","pageY","offsetTop","onMouseMove","e","onMouseUp","removeEventListener","addEventListener","vm","_createVNode","class","ElScrollbar","default","render","_mergeProps","is","onClose","appContext","children","length","nextTick","popWindowInfo","tag","node","push","removePopWindow","popWindowNode","className","remove","splice","indexOf","popWindowItem","find","item","closePopWindowByTag","filter","forEach","getAllPopWindows","initPopWindow","ctx","getCurrentInstance"],"mappings":"wKAMA,IAAIA,EACJ,MAAMC,EAA4B,GAC5BC,EAAyBC,GAAA,IACtBC,SAASC,cAAc,SADhBH,WAaHI,EAAgBA,GAAAA,CAACC,EAAuBC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,GAE9BwE,EAAAA,OAAOL,EAAI7B,GAEXyC,EAAAA,UAAS,KACP,MAAMC,EAAgB,CAAEhE,GAAIgB,EAAOhB,GAAIiE,IAAKjD,EAAOiD,IAAKC,KAAM5C,EAAWN,UACzE/B,EAAckF,KAAKH,GACnBhD,EAAOR,WAAasB,GAAU,IAGzB,CAAE9B,GAAIgB,EAAOhB,GAAImB,QAAM,GApHH7B,iBAsHvB8E,EAAyDjF,GAAA6E,IAC7D,IAAKA,EAAe,OACd,MAAAhD,OAAEA,EAAAA,KAAQkD,GAASF,EAEzB,GADAhD,EAAO2C,YACH3C,EAAOX,QAAS,CACZgE,MAAAA,EAAgBH,EAAK7E,cAAc,cAC3BiF,EAAAA,UAAY,aAAetD,EAAOT,gBAClC2C,EAAAA,iBAAiB,gBAAgB,KAC7CM,EAAAA,OAAO,KAAMU,GACbA,EAAKK,SACLtF,EAAcuF,OAAOvF,EAAcwF,QAAQT,GAAgB,EAAC,GAC7D,MAEDR,EAAAA,OAAO,KAAMU,GACbA,EAAKK,SACLtF,EAAcuF,OAAOvF,EAAcwF,QAAQT,GAAgB,EAAC,GAfvCA,mBAwBZ5C,EAAqCjC,GAAAa,IAChD,MAAM0E,EAAgBzF,EAAc0F,MAAeC,GAAAA,EAAK5E,KAAOA,IAC3D0E,GACFN,EAAgBM,EAAa,GAHE1E,sBAYtB6E,EAAuC1F,GAAA8E,IAC/BhF,EAAc6F,QAAiBF,GAAAA,EAAKX,MAAQA,IACpDc,SAASH,GAASR,EAAgBQ,IAAK,GAFhBX,uBAUvBe,EAA+C7F,GAAA,IACnDF,GADuB+F,oBAInBC,EAAqD9F,GAAA+F,IAC1D,MAAAtB,WAAEA,GAAesB,GAAOC,EAAmBA,sBAAK,CAAC,EAGhD,OAFWvB,EAAAA,EAEX,CAAEtE,gBAAc,GAJK4F"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../packages/hooks/usePopWindow/src/index.tsx"],"sourcesContent":["import { type AppContext, type Component, type ComponentInternalInstance, getCurrentInstance, nextTick, render } from 'vue'\n\nimport { ElScrollbar } from 'element-plus'\nimport { formatValue } from '../../../utils'\nimport { type PopWindowInfoProps, type PopWindowProps } from './interface'\n\nlet appContextConst: AppContext | undefined\nconst popWindowList: Array<any> = []\nconst getBody = (): Element => {\n return document.querySelector('body') as HTMLBodyElement\n}\n/**\n * 显示弹出窗口\n *\n * 此函数用于创建并显示一个弹出窗口,支持自定义样式和内容通过参数传递\n * 可以选择附加到特定的父元素,并且在渲染后会将自身添加到弹出窗口列表中\n *\n * @param props 弹出窗口的属性,包括位置、尺寸等样式属性以及附加属性\n * @param component 可选参数,用于指定弹出窗口内渲染的自定义组件类型,如果props中传了render函数,则无效\n * @param componentProps 可选参数,传递给自定义组件的属性\n */\nexport const showPopWindow = (props: PopWindowProps, component?: Component, componentProps?: any) => {\n const op = {\n left: 'auto',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n // width: 'auto',\n // height: 'auto',\n position: 'absolute',\n id: 'popwindow_' + Math.ceil(Math.random() * 1000000),\n zIndex: 9999,\n animate: false,\n animateInClass: 'animate__animated animate__faster animate__fadeIn',\n animateOutClass: 'animate__animated animate__faster animate__fadeOut',\n draggable: false,\n draggableClass: '',\n dragInParent: false,\n style: {}\n }\n const propsFormat = { ...props }\n if (props.left !== undefined) propsFormat.left = formatValue(propsFormat.left)\n if (props.top !== undefined) propsFormat.top = formatValue(propsFormat.top)\n if (props.right !== undefined) propsFormat.right = formatValue(propsFormat.right)\n if (props.bottom !== undefined) propsFormat.bottom = formatValue(propsFormat.bottom)\n if (props.width !== undefined) propsFormat.width = formatValue(propsFormat.width)\n if (props.height !== undefined) propsFormat.height = formatValue(propsFormat.height)\n\n const option: PopWindowProps = Object.assign(op, propsFormat)\n const close = () => {\n closePopWindowById(option.id)\n }\n\n // 相同的id只会存在一个\n closePopWindowById(option.id)\n\n const animateClass = option.animate ? option.animateInClass : ''\n\n const container = document.createElement('div')\n // container.id = 'popwindow_' + Math.ceil(Math.random() * 1000000)\n container.id = option.id\n container.style.pointerEvents = 'auto'\n\n let parentEl = getBody()\n if (props.appendParent) {\n parentEl = document.getElementById(props.appendParent)\n }\n parentEl.appendChild(container)\n\n // 拖动功能实现\n const startDrag = () => {\n const el = container.querySelector('.popWindow') as HTMLElement\n const draggableEl: HTMLElement = option.draggableClass ? (container.querySelector('.' + option.draggableClass) as HTMLElement) : el\n\n if (draggableEl) {\n // 限制拖动在父容器内\n // if (parentEl) {\n // 计算拖动范围\n const maxLeft = parentEl ? parentEl.clientWidth - el.clientWidth : Infinity\n const maxTop = parentEl ? parentEl.clientHeight - el.clientHeight : Infinity\n // }\n draggableEl.onmousedown = (eDown: MouseEvent) => {\n const offsetX = eDown.pageX - el.offsetLeft\n const offsetY = eDown.pageY - el.offsetTop\n\n const onMouseMove = (e: MouseEvent) => {\n let left = e.pageX - offsetX\n let top = e.pageY - offsetY\n if (option.dragInParent) {\n left = left < 0 ? 0 : left > maxLeft ? maxLeft : left\n top = top < 0 ? 0 : top > maxTop ? maxTop : top\n }\n\n el.style.left = `${left}px`\n el.style.top = `${top}px`\n }\n\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove)\n document.removeEventListener('mouseup', onMouseUp)\n }\n\n document.addEventListener('mousemove', onMouseMove)\n document.addEventListener('mouseup', onMouseUp)\n }\n }\n }\n debugger\n const vm = (\n <div\n class={'popWindow ' + animateClass}\n style={{\n left: option.left,\n right: option.right,\n top: option.top,\n bottom: option.bottom,\n position: option.position,\n zIndex: option.zIndex,\n width: option.width,\n height: option.height,\n ...option.style\n }}>\n <ElScrollbar>\n {props.render ? props.render({ close, option }) : <component is={component} {...componentProps} onClose={() => close()}></component>}\n </ElScrollbar>\n </div>\n )\n vm.appContext = appContextConst\n // 这里是为了让插槽的子组件能获取到appContext\n if (vm.children?.length) {\n vm.children[0].appContext = appContextConst\n }\n render(vm, container)\n\n nextTick(() => {\n const popWindowInfo = { id: option.id, tag: option.tag, node: container, option }\n popWindowList.push(popWindowInfo)\n option.draggable && startDrag()\n })\n\n return { id: option.id, close }\n}\nconst removePopWindow = (popWindowInfo: PopWindowInfoProps) => {\n if (!popWindowInfo) return\n const { option, node } = popWindowInfo\n option.onClose?.()\n if (option.animate) {\n const popWindowNode = node.querySelector('.popWindow')\n popWindowNode.className = 'popWindow ' + option.animateOutClass\n popWindowNode.addEventListener('animationend', () => {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n })\n } else {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n }\n}\n\n/**\n * 根据ID关闭弹出窗口\n *\n * @param id 弹出窗口的唯一标识符\n */\nexport const closePopWindowById = (id: string) => {\n const popWindowItem = popWindowList.find((item) => item.id === id)\n if (popWindowItem) {\n removePopWindow(popWindowItem)\n }\n}\n\n/**\n * 根据tag关闭弹出窗口\n *\n * @param tag 弹出窗口的tag\n */\nexport const closePopWindowByTag = (tag: string) => {\n const popWindows = popWindowList.filter((item) => item.tag === tag)\n popWindows.forEach((item) => removePopWindow(item))\n}\n\n/**\n * 获取所有弹窗信息\n *\n * @returns {PopWindowInfoProps[]} 所有弹窗的列表\n */\nexport const getAllPopWindows = (): PopWindowInfoProps[] => {\n return popWindowList\n}\n\nexport const initPopWindow = (ctx?: ComponentInternalInstance) => {\n const { appContext } = ctx || getCurrentInstance() || {}\n appContextConst = appContext\n\n return { showPopWindow }\n}\n"],"names":["appContextConst","popWindowList","getBody","__name","document","querySelector","showPopWindow","props","component","componentProps","op","left","top","right","bottom","position","id","Math","ceil","random","zIndex","animate","animateInClass","animateOutClass","draggable","draggableClass","dragInParent","style","propsFormat","undefined","formatValue","width","height","option","Object","assign","close","closePopWindowById","animateClass","container","createElement","pointerEvents","parentEl","appendParent","getElementById","appendChild","startDrag","el","draggableEl","maxLeft","clientWidth","Infinity","maxTop","clientHeight","onmousedown","eDown","offsetX","pageX","offsetLeft","offsetY","pageY","offsetTop","onMouseMove","e","onMouseUp","removeEventListener","addEventListener","vm","_createVNode","class","ElScrollbar","default","render","_mergeProps","is","onClose","appContext","children","length","nextTick","popWindowInfo","tag","node","push","removePopWindow","popWindowNode","className","remove","splice","indexOf","popWindowItem","find","item","closePopWindowByTag","filter","forEach","getAllPopWindows","initPopWindow","ctx","getCurrentInstance"],"mappings":"wKAMA,IAAIA,EACJ,MAAMC,EAA4B,GAC5BC,EAAyBC,GAAA,IACtBC,SAASC,cAAc,SADhBH,WAaHI,EAAgBA,GAAAA,CAACC,EAAuBC,EAAuBC,KAC1E,MAAMC,EAAK,CACTC,KAAM,OACNC,IAAK,OACLC,MAAO,OACPC,OAAQ;;;AAGRC,SAAU,WACVC,GAAI,aAAeC,KAAKC,KAAqB,IAAhBD,KAAKE,UAClCC,OAAQ,KACRC,SAAS,EACTC,eAAgB,oDAChBC,gBAAiB,qDACjBC,WAAW,EACXC,eAAgB,GAChBC,cAAc,EACdC,MAAO,CAAA,GAEHC,EAAc,IAAKrB,QACNsB,IAAftB,EAAMI,SAAgCA,KAAOmB,EAAAA,YAAYF,EAAYjB,YACvDkB,IAAdtB,EAAMK,QAA+BA,IAAMkB,EAAAA,YAAYF,EAAYhB,WACnDiB,IAAhBtB,EAAMM,UAAiCA,MAAQiB,EAAAA,YAAYF,EAAYf,aACtDgB,IAAjBtB,EAAMO,WAAkCA,OAASgB,EAAAA,YAAYF,EAAYd,cACzDe,IAAhBtB,EAAMwB,UAAiCA,MAAQD,EAAAA,YAAYF,EAAYG,aACtDF,IAAjBtB,EAAMyB,WAAkCA,OAASF,EAAAA,YAAYF,EAAYI,SAE7E,MAAMC,EAAyBC,OAAOC,OAAOzB,EAAIkB,GAC3CQ,EAAcjC,GAAA,KAClBkC,EAAmBJ,EAAOjB,GAAE,GADhBoB,SAKdC,EAAmBJ,EAAOjB,IAE1B,MAAMsB,EAAeL,EAAOZ,QAAUY,EAAOX,eAAiB,GAExDiB,EAAYnC,SAASoC,cAAc,OAEzCD,EAAUvB,GAAKiB,EAAOjB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AAc6F,QAAiBF,GAAAA,EAAKX,MAAQA,IACpDc,SAASH,GAASR,EAAgBQ,IAAK,GAFhBX,uBAUvBe,EAA+C7F,GAAA,IACnDF,GADuB+F,oBAInBC,EAAqD9F,GAAA+F,IAC1D,MAAAtB,WAAEA,GAAesB,GAAOC,EAAmBA,sBAAK,CAAC,EAGhD,OAFWvB,EAAAA,EAEX,CAAEtE,gBAAc,GAJK4F"}
@@ -35,6 +35,8 @@ export interface PopWindowProps {
35
35
  animateOutClass?: string;
36
36
  /**弹窗层级,默认为9999 */
37
37
  zIndex?: number;
38
+ /** 弹窗样式 */
39
+ style?: any;
38
40
  /** 关闭事件回调 */
39
41
  onClose?: () => void;
40
42
  /** 渲染函数,如果不传,则需要传显示的Component */
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./installer.js");require("./functions/index.js"),require("./hooks/index.js");var r=require("./utils/index.js");require("./directives/index.js"),require("./components/index.js");var o=require("./functions/modules/log.js"),s=require("./hooks/usePopWindow/src/index.js"),i=require("./hooks/usePopWindow/index.js"),n=require("./hooks/useDialog/index.js"),t=require("./hooks/useImageViewer/src/index.vue.js"),u=require("./hooks/useImageViewer/index.js"),l=require("./hooks/useDrawer/index.js"),d=require("./utils/install.js"),p=require("./utils/myDevelop.js"),x=require("./directives/modules/copy.js"),c=require("./directives/modules/drag.js"),a=require("./directives/modules/autoScroll.js"),m=require("./directives/modules/tooltip.js"),j=require("./directives/modules/confirm.js"),q=require("./directives/modules/countTo.js"),h=require("./functions/modules/uitls.js"),Z=require("./functions/modules/is.js"),w=require("./components/znForm/src/hooks/useZnForm.js"),f=require("./components/znSearch/src/hooks/useProSearch.js"),T=require("./components/znTable/index.js"),g=require("./components/znTreeFilter/index.js"),v=require("./components/znChart/index.js"),z=require("./components/znCountTo/index.js"),W=require("./components/znTest/index.js"),y=require("./components/znForm/index.js"),P=require("./components/znTimeLine/index.js"),I=require("./components/znWorkGrid/index.js"),k=require("./components/znGrid/index.js"),F=require("./components/znSearch/index.js"),S=require("./components/znNumberScroll/index.js");globalThis.log=o.default;"function"==typeof globalThis?.log?.success&&globalThis.log.primary("1.0.44","欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/"),exports.default=e.default,exports.install=e.install,exports.copyText=r.copyText,exports.formatValue=r.formatValue,exports.log=o.default,exports.closePopWindowById=s.closePopWindowById,exports.closePopWindowByTag=s.closePopWindowByTag,exports.getAllPopWindows=s.getAllPopWindows,exports.showPopWindow=s.showPopWindow,exports.usePopWindow=i.usePopWindow,exports.useDialog=n.useDialog,exports.ImageViewer=t.default,exports.useImageViewer=u.useImageViewer,exports.useDrawer=l.useDrawer,exports.withInstall=d.withInstall,exports.withInstallDirectives=d.withInstallDirectives,exports.developFn=p.developFn,exports.vCopy=x.default,exports.vDrag=c.default,exports.vAutoScroll=a.default,exports.vTooltip=m.default,exports.vConfirm=j.default,exports.vCountTo=q.default,exports.utils=h.default,exports.is=Z,exports.useZnForm=w.useZnForm,exports.useZnSearch=f.useZnSearch,exports.ZnTable=T.ZnTable,exports.ZnTreeFilter=g.ZnTreeFilter,exports.ZnChart=v.ZnChart,exports.ZnCountTo=z.ZnCountTo,exports.ZnTest=W.ZnTest,exports.ZnForm=y.ZnForm,exports.ZnTimeline=P.ZnTimeline,exports.ZnWorkGrid=I.ZnWorkGrid,exports.ZnGrid=k.ZnGrid,exports.ZnGridItem=k.ZnGridItem,exports.ZnSearch=F.ZnSearch,exports.ZnNumberScroll=S.ZnNumberScroll;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./installer.js");require("./functions/index.js"),require("./hooks/index.js");var r=require("./utils/index.js");require("./directives/index.js"),require("./components/index.js");var o=require("./functions/modules/log.js"),s=require("./hooks/usePopWindow/src/index.js"),i=require("./hooks/usePopWindow/index.js"),n=require("./hooks/useDialog/index.js"),t=require("./hooks/useImageViewer/src/index.vue.js"),u=require("./hooks/useImageViewer/index.js"),l=require("./hooks/useDrawer/index.js"),d=require("./utils/install.js"),p=require("./utils/myDevelop.js"),x=require("./directives/modules/copy.js"),c=require("./directives/modules/drag.js"),a=require("./directives/modules/autoScroll.js"),m=require("./directives/modules/tooltip.js"),j=require("./directives/modules/confirm.js"),q=require("./directives/modules/countTo.js"),h=require("./functions/modules/uitls.js"),Z=require("./functions/modules/is.js"),w=require("./components/znForm/src/hooks/useZnForm.js"),f=require("./components/znSearch/src/hooks/useProSearch.js"),T=require("./components/znTable/index.js"),g=require("./components/znTreeFilter/index.js"),v=require("./components/znChart/index.js"),z=require("./components/znCountTo/index.js"),W=require("./components/znTest/index.js"),y=require("./components/znForm/index.js"),P=require("./components/znTimeLine/index.js"),I=require("./components/znWorkGrid/index.js"),k=require("./components/znGrid/index.js"),F=require("./components/znSearch/index.js"),S=require("./components/znNumberScroll/index.js");globalThis.log=o.default;"function"==typeof globalThis?.log?.success&&globalThis.log.primary("1.0.45","欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/"),exports.default=e.default,exports.install=e.install,exports.copyText=r.copyText,exports.formatValue=r.formatValue,exports.log=o.default,exports.closePopWindowById=s.closePopWindowById,exports.closePopWindowByTag=s.closePopWindowByTag,exports.getAllPopWindows=s.getAllPopWindows,exports.showPopWindow=s.showPopWindow,exports.usePopWindow=i.usePopWindow,exports.useDialog=n.useDialog,exports.ImageViewer=t.default,exports.useImageViewer=u.useImageViewer,exports.useDrawer=l.useDrawer,exports.withInstall=d.withInstall,exports.withInstallDirectives=d.withInstallDirectives,exports.developFn=p.developFn,exports.vCopy=x.default,exports.vDrag=c.default,exports.vAutoScroll=a.default,exports.vTooltip=m.default,exports.vConfirm=j.default,exports.vCountTo=q.default,exports.utils=h.default,exports.is=Z,exports.useZnForm=w.useZnForm,exports.useZnSearch=f.useZnSearch,exports.ZnTable=T.ZnTable,exports.ZnTreeFilter=g.ZnTreeFilter,exports.ZnChart=v.ZnChart,exports.ZnCountTo=z.ZnCountTo,exports.ZnTest=W.ZnTest,exports.ZnForm=y.ZnForm,exports.ZnTimeline=P.ZnTimeline,exports.ZnWorkGrid=I.ZnWorkGrid,exports.ZnGrid=k.ZnGrid,exports.ZnGridItem=k.ZnGridItem,exports.ZnSearch=F.ZnSearch,exports.ZnNumberScroll=S.ZnNumberScroll;
2
2
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../packages/index.ts"],"sourcesContent":["import installer from './installer'\nimport { log } from './functions'\nexport * from './hooks'\nexport * from './utils'\nexport * from './installer'\nexport * from './directives'\nexport * from './functions'\nexport * from './components'\n\nexport default installer\nglobalThis.log = log\nconst version = '1.0.44'\nif (typeof globalThis?.log?.success === 'function') {\n globalThis.log.primary(version, '欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/')\n}\n"],"names":["globalThis","log","default","success","primary"],"mappings":"0jDAUAA,WAAWC,IAAMA,EAAAC,QAEuB,mBAA7BF,YAAYC,KAAKE,SACfH,WAAAC,IAAIG,QAFD,SAEkB"}
1
+ {"version":3,"file":"index.js","sources":["../../../packages/index.ts"],"sourcesContent":["import installer from './installer'\nimport { log } from './functions'\nexport * from './hooks'\nexport * from './utils'\nexport * from './installer'\nexport * from './directives'\nexport * from './functions'\nexport * from './components'\n\nexport default installer\nglobalThis.log = log\nconst version = '1.0.45'\nif (typeof globalThis?.log?.success === 'function') {\n globalThis.log.primary(version, '欢迎使用znyg-frontend-common,在线文档:https://tech.suitbim.com/znyg-frontend-common-docs/')\n}\n"],"names":["globalThis","log","default","success","primary"],"mappings":"0jDAUAA,WAAWC,IAAMA,EAAAC,QAEuB,mBAA7BF,YAAYC,KAAKE,SACfH,WAAAC,IAAIG,QAFD,SAEkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "znyg-frontend-common",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "前端公用库",
5
5
  "license": "MIT",
6
6
  "keywords": [