{"ast":null,"code":"import { defineComponent, ref, watch, computed, openBlock, createElementBlock, normalizeClass, unref, createVNode, withCtx, Fragment, renderList, createBlock } from 'vue';\nimport { isEqual } from 'lodash-unified';\nimport { ElSelect, ElOption } from '../../../select/index.mjs';\nimport { usePagination } from '../usePagination.mjs';\nimport { paginationSizesProps } from './sizes.mjs';\nimport _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';\nimport { useLocale } from '../../../../hooks/use-locale/index.mjs';\nimport { useNamespace } from '../../../../hooks/use-namespace/index.mjs';\nimport { isArray } from '@vue/shared';\nconst __default__ = defineComponent({\n name: \"ElPaginationSizes\"\n});\nconst _sfc_main = /* @__PURE__ */defineComponent({\n ...__default__,\n props: paginationSizesProps,\n emits: [\"page-size-change\"],\n setup(__props, {\n emit\n }) {\n const props = __props;\n const {\n t\n } = useLocale();\n const ns = useNamespace(\"pagination\");\n const pagination = usePagination();\n const innerPageSize = ref(props.pageSize);\n watch(() => props.pageSizes, (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return;\n if (isArray(newVal)) {\n const pageSize = newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0];\n emit(\"page-size-change\", pageSize);\n }\n });\n watch(() => props.pageSize, newVal => {\n innerPageSize.value = newVal;\n });\n const innerPageSizes = computed(() => props.pageSizes);\n function handleChange(val) {\n var _a;\n if (val !== innerPageSize.value) {\n innerPageSize.value = val;\n (_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));\n }\n }\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"span\", {\n class: normalizeClass(unref(ns).e(\"sizes\"))\n }, [createVNode(unref(ElSelect), {\n \"model-value\": innerPageSize.value,\n disabled: _ctx.disabled,\n \"popper-class\": _ctx.popperClass,\n size: _ctx.size,\n teleported: _ctx.teleported,\n \"validate-event\": false,\n \"append-to\": _ctx.appendSizeTo,\n onChange: handleChange\n }, {\n default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(innerPageSizes), item => {\n return openBlock(), createBlock(unref(ElOption), {\n key: item,\n value: item,\n label: item + unref(t)(\"el.pagination.pagesize\")\n }, null, 8, [\"value\", \"label\"]);\n }), 128))]),\n _: 1\n }, 8, [\"model-value\", \"disabled\", \"popper-class\", \"size\", \"teleported\", \"append-to\"])], 2);\n };\n }\n});\nvar Sizes = /* @__PURE__ */_export_sfc(_sfc_main, [[\"__file\", \"sizes.vue\"]]);\nexport { Sizes as default };","map":{"version":3,"names":["name","t","useLocale","ns","useNamespace","pagination","usePagination","innerPageSize","ref","props","pageSize","watch","pageSizes","newVal","oldVal","isEqual","isArray","includes","emit","value","innerPageSizes","computed","handleChange","val","_a","handleSizeChange","call","Number","_ctx","_cache","openBlock","createElementBlock","class","normalizeClass","unref","e"],"sources":["../../../../../../../packages/components/pagination/src/components/sizes.vue"],"sourcesContent":["\n \n \n \n \n \n\n\n\n"],"mappings":";;;;;;;;;mCA+Bc;EACZA,IAAM;AACR;;;;;;;;;IAIM;MAAEC;IAAE,IAAIC,SAAU;IAClB,MAAAC,EAAA,GAAKC,YAAA,CAAa,YAAY;IACpC,MAAMC,UAAA,GAAaC,aAAc;IAC3B,MAAAC,aAAA,GAAgBC,GAAY,CAAAC,KAAA,CAAMC,QAAS;IAEjDC,KAAA,OAAAF,KAAA,CAAAG,SAAA,GAAAC,MAAA,EAAAC,MAAA;MACE,IAAAC,OAAY,CAAAF,MAAA,EAAAC,MAAA;MAEN,IAAAE,OAAA,CAAAH,MAAgB;QAChB,MAAAH,QAAA,GAAAG,MAAiB,CAAAI,QAAA,CAAAR,KAAA,CAAAC,QAAA,IAAAD,KAAA,CAAAC,QAAA,GAAAD,KAAA,CAAAG,SAAA;QACbM,IAAA,mBAAkB,EAAAR,QAAA;MAGxB;IAAiC,CACnC;IACFC,KAAA,OAAAF,KAAA,CAAAC,QAAA,EAAAG,MAAA;MACFN,aAAA,CAAAY,KAAA,GAAAN,MAAA;IAEA;IAAA,MAAAO,cACc,GAAAC,QAAA,OAAAZ,KAAA,CAAAG,SAAA;IAAA,SACAU,aAAAC,GAAA;MACV,IAAAC,EAAA;MACF,IAAAD,GAAA,KAAAhB,aAAA,CAAAY,KAAA;QACFZ,aAAA,CAAAY,KAAA,GAAAI,GAAA;QAEA,CAAAC,EAAuB,GAAAnB,UAAA,CAAAoB,gBAAe,SAAe,YAAAD,EAAA,CAAAE,IAAA,CAAArB,UAAA,EAAAsB,MAAA,CAAAJ,GAAA;MACrD;IACE;IACE,QAAAK,IAAA,EAAAC,MAAsB;MACX,OAAAC,SAAA,IAAAC,kBAA0B,OAAI;QAC3CC,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA/B,EAAA,EAAAgC,CAAA;MAAA,CACF,G","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}