@element-plus/nightly 0.0.20250815 → 0.0.20250816
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +105 -36
- package/dist/index.full.min.js +19 -19
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +19 -19
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +105 -36
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/anchor/index.mjs +1 -1
- package/es/components/anchor/src/anchor-link.mjs +5 -81
- package/es/components/anchor/src/anchor-link.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs +81 -5
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +6 -0
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +12 -0
- package/es/components/cascader/src/cascader.d.ts +6 -0
- package/es/components/cascader/src/cascader.mjs +6 -0
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +12 -0
- package/es/components/cascader/src/cascader2.mjs +3 -3
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +5 -1
- package/es/components/cascader-panel/src/store.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +6 -63
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +63 -6
- package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +6 -5
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +178 -26
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +26 -178
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/index.mjs +13 -13
- package/es/components/input/src/input.d.ts +6 -0
- package/es/components/input/src/input.mjs +5 -0
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input.vue.d.ts +12 -0
- package/es/components/input/src/input2.mjs +3 -3
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +6 -0
- package/es/components/input-tag/src/input-tag.mjs +6 -0
- package/es/components/input-tag/src/input-tag.mjs.map +1 -1
- package/es/components/input-tag/src/input-tag.vue.d.ts +12 -0
- package/es/components/input-tag/src/input-tag2.mjs +2 -3
- package/es/components/input-tag/src/input-tag2.mjs.map +1 -1
- package/es/components/mention/src/mention.d.ts +6 -0
- package/es/components/mention/src/mention.vue.d.ts +12 -0
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +100 -15
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +15 -100
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/message-box/src/index.mjs +3 -1
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +1 -0
- package/es/components/pagination/src/components/jumper.mjs +58 -7
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +7 -58
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +18 -35
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +35 -18
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/components/prev.mjs +17 -35
- package/es/components/pagination/src/components/prev.mjs.map +1 -1
- package/es/components/pagination/src/components/prev2.mjs +35 -17
- package/es/components/pagination/src/components/prev2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +3 -3
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +122 -42
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +42 -122
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +30 -7
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +7 -30
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/popper/src/content.mjs +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +65 -5
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +5 -65
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +44 -28
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +28 -44
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/splitter/src/hooks/useResize.d.ts +2 -1
- package/es/components/splitter/src/hooks/useResize.mjs +34 -6
- package/es/components/splitter/src/hooks/useResize.mjs.map +1 -1
- package/es/components/splitter/src/split-bar.mjs +5 -7
- package/es/components/splitter/src/split-bar.mjs.map +1 -1
- package/es/components/splitter/src/split-bar.vue.d.ts +7 -12
- package/es/components/splitter/src/split-panel2.mjs +7 -6
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/splitter/src/splitter.d.ts +1 -0
- package/es/components/splitter/src/splitter.mjs +2 -1
- package/es/components/splitter/src/splitter.mjs.map +1 -1
- package/es/components/splitter/src/splitter.vue.d.ts +3 -0
- package/es/components/splitter/src/splitter2.mjs +22 -5
- package/es/components/splitter/src/splitter2.mjs.map +1 -1
- package/es/components/splitter/src/type.d.ts +1 -0
- package/es/components/splitter/src/type.mjs.map +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/steps.mjs +41 -35
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +35 -41
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +18 -8
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +8 -18
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +1 -1
- package/es/components/tooltip/index.mjs +3 -3
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +165 -30
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +30 -165
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +72 -14
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +14 -72
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/components/tooltip-v2/index.mjs +2 -2
- package/es/components/tooltip-v2/src/content.mjs +48 -110
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +110 -48
- package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -79
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +79 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
- package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/step.mjs +189 -44
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +44 -189
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +1 -1
- package/es/components/transfer/src/transfer.mjs +164 -68
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +68 -164
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/hooks/use-draggable/index.d.ts +1 -0
- package/es/hooks/use-draggable/index.mjs +7 -1
- package/es/hooks/use-draggable/index.mjs.map +1 -1
- package/es/index.d.ts +96 -1
- package/es/index.mjs +13 -13
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +1 -1
- package/lib/components/anchor/src/anchor-link.js +5 -81
- package/lib/components/anchor/src/anchor-link.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js +81 -5
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +6 -0
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +12 -0
- package/lib/components/cascader/src/cascader.d.ts +6 -0
- package/lib/components/cascader/src/cascader.js +6 -0
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +12 -0
- package/lib/components/cascader/src/cascader2.js +1 -1
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +5 -1
- package/lib/components/cascader-panel/src/store.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +6 -63
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +63 -6
- package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +6 -5
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +178 -27
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +27 -178
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/index.js +13 -13
- package/lib/components/input/src/input.d.ts +6 -0
- package/lib/components/input/src/input.js +5 -0
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input.vue.d.ts +12 -0
- package/lib/components/input/src/input2.js +1 -1
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +6 -0
- package/lib/components/input-tag/src/input-tag.js +6 -0
- package/lib/components/input-tag/src/input-tag.js.map +1 -1
- package/lib/components/input-tag/src/input-tag.vue.d.ts +12 -0
- package/lib/components/input-tag/src/input-tag2.js +1 -2
- package/lib/components/input-tag/src/input-tag2.js.map +1 -1
- package/lib/components/mention/src/mention.d.ts +6 -0
- package/lib/components/mention/src/mention.vue.d.ts +12 -0
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +100 -16
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +16 -100
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/message-box/src/index.js +3 -1
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +1 -0
- package/lib/components/pagination/src/components/jumper.js +58 -7
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +7 -58
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +18 -35
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +35 -18
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/components/prev.js +18 -35
- package/lib/components/pagination/src/components/prev.js.map +1 -1
- package/lib/components/pagination/src/components/prev2.js +35 -18
- package/lib/components/pagination/src/components/prev2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +3 -3
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +122 -43
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +43 -122
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +30 -8
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +8 -30
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/popper/src/content.js +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +65 -5
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +5 -65
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +44 -30
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +30 -44
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/splitter/src/hooks/useResize.d.ts +2 -1
- package/lib/components/splitter/src/hooks/useResize.js +33 -5
- package/lib/components/splitter/src/hooks/useResize.js.map +1 -1
- package/lib/components/splitter/src/split-bar.js +5 -7
- package/lib/components/splitter/src/split-bar.js.map +1 -1
- package/lib/components/splitter/src/split-bar.vue.d.ts +7 -12
- package/lib/components/splitter/src/split-panel2.js +7 -6
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/splitter/src/splitter.d.ts +1 -0
- package/lib/components/splitter/src/splitter.js +2 -1
- package/lib/components/splitter/src/splitter.js.map +1 -1
- package/lib/components/splitter/src/splitter.vue.d.ts +3 -0
- package/lib/components/splitter/src/splitter2.js +21 -4
- package/lib/components/splitter/src/splitter2.js.map +1 -1
- package/lib/components/splitter/src/type.d.ts +1 -0
- package/lib/components/splitter/src/type.js.map +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/steps.js +41 -36
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +36 -41
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +18 -8
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +8 -18
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +1 -1
- package/lib/components/tooltip/index.js +3 -3
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +163 -32
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +32 -163
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +72 -14
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +14 -72
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/components/tooltip-v2/index.js +2 -2
- package/lib/components/tooltip-v2/src/content.js +48 -110
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +110 -48
- package/lib/components/tooltip-v2/src/content2.js.map +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -79
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +79 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +2 -2
- package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/step.js +188 -44
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +44 -188
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +1 -1
- package/lib/components/transfer/src/transfer.js +164 -72
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +72 -164
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/hooks/use-draggable/index.d.ts +1 -0
- package/lib/hooks/use-draggable/index.js +6 -0
- package/lib/hooks/use-draggable/index.js.map +1 -1
- package/lib/index.d.ts +96 -1
- package/lib/index.js +13 -13
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-collapse.css +1 -1
- package/theme-chalk/el-splitter.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/collapse.scss +1 -1
- package/theme-chalk/src/splitter.scss +25 -4
- package/web-types.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transfer.js","sources":["../../../../../../packages/components/transfer/src/transfer.
|
1
|
+
{"version":3,"file":"transfer.js","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <template #empty>\n <slot name=\"left-empty\" />\n </template>\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <template #empty>\n <slot name=\"right-empty\" />\n </template>\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Comment, computed, h, reactive, ref, useSlots, watch } from 'vue'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n const defaultSlotVNodes = (slots.default?.({ option }) || []).filter(\n (node) => node.type !== Comment\n )\n if (defaultSlotVNodes.length) {\n return defaultSlotVNodes\n }\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description right panel ref */\n rightPanel,\n})\n</script>\n"],"names":["useSlots","useLocale","useNamespace","useFormItem","reactive","usePropsAlias","useComputedData","useCheckedChange","useMove","ref","computed","watch","debugWarn","h","Comment","_normalizeClass","_unref","_createVNode","TransferPanel"],"mappings":";;;;;;;;;;;;;;;;;;;;;uCAqFc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,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A,UAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAAA,IACF,MAAA,CAAA;AAEA,MAAA,UAAqB;AACnB,MAAA;AAEA,MAAM,UAAA;AAAwD,KAC5D,CAAA,CAAA;AAAwB,IAC1B,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AACA,MAAA,8CAA8B,CAAA,KAAA,EAAA;AAC5B,QAAO,KAAA,EAAAE,kBAAA,CAAAC,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AAAA,OACT,EAAA;AAEA,QAAOC,eAAA,CAAAC,wBAAA,EAAA;AAAA,UACL,OAAA,EAAA,WAAA;AAAA,UACA,GAAA,EAAO;AAAsD,UAC/D,IAAA,EAAAF,SAAA,CAAA,UAAA,CAAA;AAAA,UACD,eAAA,EAAAA,SAAA,CAAA,YAAA,CAAA;AAED,UAAa,WAAA,EAAAA,SAAA,CAAA,sBAAA,CAAA;AAAA,UAAA,KAAA,EAAAA,SAAA,CAAA,cAAA,CAAA;AAAA,UAEX,UAAA,EAAA,IAAA,CAAA,UAAA;AAAA,UAAA,MAAA,EAAA,IAAA,CAAA,MAAA;AAAA,UAEA,eAAA,EAAA,IAAA,CAAA,YAAA;AAAA,UAAA,iBAAA,EAAA,IAAA,CAAA,kBAAA;AAAA,UAEA,KAAA,EAAA,KAAA,CAAA,KAAA;AAAA,UACD,eAAA,EAAAA,SAAA,CAAA,qBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -2,172 +2,80 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var
|
6
|
-
var
|
7
|
-
var
|
8
|
-
var
|
9
|
-
var
|
10
|
-
var transferPanel = require('./transfer-panel2.js');
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
12
|
-
var useComputedData = require('./composables/use-computed-data.js');
|
13
|
-
var useMove = require('./composables/use-move.js');
|
14
|
-
var useCheckedChange = require('./composables/use-checked-change.js');
|
15
|
-
var index = require('../../../hooks/use-locale/index.js');
|
16
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
17
|
-
var useFormItem = require('../../form/src/hooks/use-form-item.js');
|
18
|
-
var usePropsAlias = require('./composables/use-props-alias.js');
|
19
|
-
var error = require('../../../utils/error.js');
|
20
|
-
var types = require('../../../utils/types.js');
|
5
|
+
var lodashUnified = require('lodash-unified');
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
7
|
+
var typescript = require('../../../utils/typescript.js');
|
8
|
+
var shared = require('@vue/shared');
|
9
|
+
var event = require('../../../constants/event.js');
|
21
10
|
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
leftPanel,
|
78
|
-
rightPanel
|
79
|
-
});
|
80
|
-
return (_ctx, _cache) => {
|
81
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
82
|
-
class: vue.normalizeClass(vue.unref(ns).b())
|
83
|
-
}, [
|
84
|
-
vue.createVNode(transferPanel["default"], {
|
85
|
-
ref_key: "leftPanel",
|
86
|
-
ref: leftPanel,
|
87
|
-
data: vue.unref(sourceData),
|
88
|
-
"option-render": vue.unref(optionRender),
|
89
|
-
placeholder: vue.unref(panelFilterPlaceholder),
|
90
|
-
title: vue.unref(leftPanelTitle),
|
91
|
-
filterable: _ctx.filterable,
|
92
|
-
format: _ctx.format,
|
93
|
-
"filter-method": _ctx.filterMethod,
|
94
|
-
"default-checked": _ctx.leftDefaultChecked,
|
95
|
-
props: props.props,
|
96
|
-
onCheckedChange: vue.unref(onSourceCheckedChange)
|
97
|
-
}, {
|
98
|
-
empty: vue.withCtx(() => [
|
99
|
-
vue.renderSlot(_ctx.$slots, "left-empty")
|
100
|
-
]),
|
101
|
-
default: vue.withCtx(() => [
|
102
|
-
vue.renderSlot(_ctx.$slots, "left-footer")
|
103
|
-
]),
|
104
|
-
_: 3
|
105
|
-
}, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
|
106
|
-
vue.createElementVNode("div", {
|
107
|
-
class: vue.normalizeClass(vue.unref(ns).e("buttons"))
|
108
|
-
}, [
|
109
|
-
vue.createVNode(vue.unref(index$2.ElButton), {
|
110
|
-
type: "primary",
|
111
|
-
class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
|
112
|
-
disabled: vue.unref(types.isEmpty)(checkedState.rightChecked),
|
113
|
-
onClick: vue.unref(addToLeft)
|
114
|
-
}, {
|
115
|
-
default: vue.withCtx(() => [
|
116
|
-
vue.createVNode(vue.unref(index$3.ElIcon), null, {
|
117
|
-
default: vue.withCtx(() => [
|
118
|
-
vue.createVNode(vue.unref(iconsVue.ArrowLeft))
|
119
|
-
]),
|
120
|
-
_: 1
|
121
|
-
}),
|
122
|
-
!vue.unref(types.isUndefined)(_ctx.buttonTexts[0]) ? (vue.openBlock(), vue.createElementBlock("span", { key: 0 }, vue.toDisplayString(_ctx.buttonTexts[0]), 1)) : vue.createCommentVNode("v-if", true)
|
123
|
-
]),
|
124
|
-
_: 1
|
125
|
-
}, 8, ["class", "disabled", "onClick"]),
|
126
|
-
vue.createVNode(vue.unref(index$2.ElButton), {
|
127
|
-
type: "primary",
|
128
|
-
class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
|
129
|
-
disabled: vue.unref(types.isEmpty)(checkedState.leftChecked),
|
130
|
-
onClick: vue.unref(addToRight)
|
131
|
-
}, {
|
132
|
-
default: vue.withCtx(() => [
|
133
|
-
!vue.unref(types.isUndefined)(_ctx.buttonTexts[1]) ? (vue.openBlock(), vue.createElementBlock("span", { key: 0 }, vue.toDisplayString(_ctx.buttonTexts[1]), 1)) : vue.createCommentVNode("v-if", true),
|
134
|
-
vue.createVNode(vue.unref(index$3.ElIcon), null, {
|
135
|
-
default: vue.withCtx(() => [
|
136
|
-
vue.createVNode(vue.unref(iconsVue.ArrowRight))
|
137
|
-
]),
|
138
|
-
_: 1
|
139
|
-
})
|
140
|
-
]),
|
141
|
-
_: 1
|
142
|
-
}, 8, ["class", "disabled", "onClick"])
|
143
|
-
], 2),
|
144
|
-
vue.createVNode(transferPanel["default"], {
|
145
|
-
ref_key: "rightPanel",
|
146
|
-
ref: rightPanel,
|
147
|
-
data: vue.unref(targetData),
|
148
|
-
"option-render": vue.unref(optionRender),
|
149
|
-
placeholder: vue.unref(panelFilterPlaceholder),
|
150
|
-
filterable: _ctx.filterable,
|
151
|
-
format: _ctx.format,
|
152
|
-
"filter-method": _ctx.filterMethod,
|
153
|
-
title: vue.unref(rightPanelTitle),
|
154
|
-
"default-checked": _ctx.rightDefaultChecked,
|
155
|
-
props: props.props,
|
156
|
-
onCheckedChange: vue.unref(onTargetCheckedChange)
|
157
|
-
}, {
|
158
|
-
empty: vue.withCtx(() => [
|
159
|
-
vue.renderSlot(_ctx.$slots, "right-empty")
|
160
|
-
]),
|
161
|
-
default: vue.withCtx(() => [
|
162
|
-
vue.renderSlot(_ctx.$slots, "right-footer")
|
163
|
-
]),
|
164
|
-
_: 3
|
165
|
-
}, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
|
166
|
-
], 2);
|
167
|
-
};
|
11
|
+
const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
|
12
|
+
const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
|
13
|
+
const transferProps = runtime.buildProps({
|
14
|
+
data: {
|
15
|
+
type: runtime.definePropType(Array),
|
16
|
+
default: () => []
|
17
|
+
},
|
18
|
+
titles: {
|
19
|
+
type: runtime.definePropType(Array),
|
20
|
+
default: () => []
|
21
|
+
},
|
22
|
+
buttonTexts: {
|
23
|
+
type: runtime.definePropType(Array),
|
24
|
+
default: () => []
|
25
|
+
},
|
26
|
+
filterPlaceholder: String,
|
27
|
+
filterMethod: {
|
28
|
+
type: runtime.definePropType(Function)
|
29
|
+
},
|
30
|
+
leftDefaultChecked: {
|
31
|
+
type: runtime.definePropType(Array),
|
32
|
+
default: () => []
|
33
|
+
},
|
34
|
+
rightDefaultChecked: {
|
35
|
+
type: runtime.definePropType(Array),
|
36
|
+
default: () => []
|
37
|
+
},
|
38
|
+
renderContent: {
|
39
|
+
type: runtime.definePropType(Function)
|
40
|
+
},
|
41
|
+
modelValue: {
|
42
|
+
type: runtime.definePropType(Array),
|
43
|
+
default: () => []
|
44
|
+
},
|
45
|
+
format: {
|
46
|
+
type: runtime.definePropType(Object),
|
47
|
+
default: () => ({})
|
48
|
+
},
|
49
|
+
filterable: Boolean,
|
50
|
+
props: {
|
51
|
+
type: runtime.definePropType(Object),
|
52
|
+
default: () => typescript.mutable({
|
53
|
+
label: "label",
|
54
|
+
key: "key",
|
55
|
+
disabled: "disabled"
|
56
|
+
})
|
57
|
+
},
|
58
|
+
targetOrder: {
|
59
|
+
type: String,
|
60
|
+
values: ["original", "push", "unshift"],
|
61
|
+
default: "original"
|
62
|
+
},
|
63
|
+
validateEvent: {
|
64
|
+
type: Boolean,
|
65
|
+
default: true
|
168
66
|
}
|
169
67
|
});
|
170
|
-
|
68
|
+
const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(shared.isArray) || shared.isArray(value) && lodashUnified.isNil(movedKeys);
|
69
|
+
const transferEmits = {
|
70
|
+
[event.CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(shared.isArray) && ["left", "right"].includes(direction),
|
71
|
+
[event.UPDATE_MODEL_EVENT]: (value) => shared.isArray(value),
|
72
|
+
[LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
|
73
|
+
[RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
|
74
|
+
};
|
171
75
|
|
172
|
-
exports
|
76
|
+
exports.LEFT_CHECK_CHANGE_EVENT = LEFT_CHECK_CHANGE_EVENT;
|
77
|
+
exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
|
78
|
+
exports.transferCheckedChangeFn = transferCheckedChangeFn;
|
79
|
+
exports.transferEmits = transferEmits;
|
80
|
+
exports.transferProps = transferProps;
|
173
81
|
//# sourceMappingURL=transfer2.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.
|
1
|
+
{"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type {\n ExtractPropTypes,\n h as H,\n VNode,\n __ExtractPublicPropTypes,\n} from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n /**\n * @description data source\n */\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n /**\n * @description custom list titles\n */\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description custom button texts\n */\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description placeholder for the filter input\n */\n filterPlaceholder: String,\n /**\n * @description custom filter method\n */\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n /**\n * @description key array of initially checked data items of the left list\n */\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description key array of initially checked data items of the right list\n */\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description custom render function for data items\n */\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description texts for checking status in list header\n */\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n /**\n * @description whether Transfer is filterable\n */\n filterable: Boolean,\n /**\n * @description prop aliases for data source\n */\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n /**\n * @description order strategy for elements in the target list. If set to `original`, the elements will keep the same order as the data source. If set to `push`, the newly added elements will be pushed to the bottom. If set to `unshift`, the newly added elements will be inserted on the top\n */\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\nexport type TransferPropsPublic = __ExtractPublicPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer> & unknown\n"],"names":["buildProps","definePropType","mutable","isArray","isNil","CHANGE_EVENT","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;;AAQY,MAAC,uBAAuB,GAAG,oBAAoB;AAC/C,MAAC,wBAAwB,GAAG,qBAAqB;AACjD,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,iBAAiB,EAAE,MAAM;AAC3B,EAAE,YAAY,EAAE;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E,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACC,cAAO,CAAC,IAAIA,cAAO,CAAC,KAAK,CAAC,IAAIC,mBAAK,CAAC,SAAS,EAAE;AACzH,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACF,cAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC7H,EAAE,CAACG,wBAAkB,GAAG,CAAC,KAAK,KAAKH,cAAO,CAAC,KAAK,CAAC;AACjD,EAAE,CAAC,uBAAuB,GAAG,uBAAuB;AACpD,EAAE,CAAC,wBAAwB,GAAG,uBAAuB;AACrD;;;;;;;;"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { ComputedRef, Ref } from 'vue';
|
2
2
|
export declare const useDraggable: (targetRef: Ref<HTMLElement | undefined>, dragRef: Ref<HTMLElement | undefined>, draggable: ComputedRef<boolean>, overflow?: ComputedRef<boolean>) => {
|
3
|
+
isDragging: Ref<boolean>;
|
3
4
|
resetPosition: () => void;
|
4
5
|
updatePosition: () => void;
|
5
6
|
};
|
@@ -10,6 +10,7 @@ const useDraggable = (targetRef, dragRef, draggable, overflow) => {
|
|
10
10
|
offsetX: 0,
|
11
11
|
offsetY: 0
|
12
12
|
};
|
13
|
+
const isDragging = vue.ref(false);
|
13
14
|
const adjustPosition = (moveX, moveY) => {
|
14
15
|
if (targetRef.value) {
|
15
16
|
const { offsetX, offsetY } = transform;
|
@@ -38,11 +39,15 @@ const useDraggable = (targetRef, dragRef, draggable, overflow) => {
|
|
38
39
|
const downY = e.clientY;
|
39
40
|
const { offsetX, offsetY } = transform;
|
40
41
|
const onMousemove = (e2) => {
|
42
|
+
if (!isDragging.value) {
|
43
|
+
isDragging.value = true;
|
44
|
+
}
|
41
45
|
const moveX = offsetX + e2.clientX - downX;
|
42
46
|
const moveY = offsetY + e2.clientY - downY;
|
43
47
|
adjustPosition(moveX, moveY);
|
44
48
|
};
|
45
49
|
const onMouseup = () => {
|
50
|
+
isDragging.value = false;
|
46
51
|
document.removeEventListener("mousemove", onMousemove);
|
47
52
|
document.removeEventListener("mouseup", onMouseup);
|
48
53
|
};
|
@@ -85,6 +90,7 @@ const useDraggable = (targetRef, dragRef, draggable, overflow) => {
|
|
85
90
|
offDraggable();
|
86
91
|
});
|
87
92
|
return {
|
93
|
+
isDragging,
|
88
94
|
resetPosition,
|
89
95
|
updatePosition
|
90
96
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-draggable/index.ts"],"sourcesContent":["import { onBeforeUnmount, onMounted, watchEffect } from 'vue'\nimport { addUnit } from '@element-plus/utils'\n\nimport type { ComputedRef, Ref } from 'vue'\n\nexport const useDraggable = (\n targetRef: Ref<HTMLElement | undefined>,\n dragRef: Ref<HTMLElement | undefined>,\n draggable: ComputedRef<boolean>,\n overflow?: ComputedRef<boolean>\n) => {\n const transform = {\n offsetX: 0,\n offsetY: 0,\n }\n\n const adjustPosition = (moveX: number, moveY: number) => {\n if (targetRef.value) {\n const { offsetX, offsetY } = transform\n const targetRect = targetRef.value.getBoundingClientRect()\n const targetLeft = targetRect.left\n const targetTop = targetRect.top\n const targetWidth = targetRect.width\n const targetHeight = targetRect.height\n\n const clientWidth = document.documentElement.clientWidth\n const clientHeight = document.documentElement.clientHeight\n\n const minLeft = -targetLeft + offsetX\n const minTop = -targetTop + offsetY\n const maxLeft = clientWidth - targetLeft - targetWidth + offsetX\n const maxTop =\n clientHeight -\n targetTop -\n (targetHeight < clientHeight ? targetHeight : 0) +\n offsetY\n\n if (!overflow?.value) {\n moveX = Math.min(Math.max(moveX, minLeft), maxLeft)\n moveY = Math.min(Math.max(moveY, minTop), maxTop)\n }\n\n transform.offsetX = moveX\n transform.offsetY = moveY\n\n targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(\n moveY\n )})`\n }\n }\n\n const onMousedown = (e: MouseEvent) => {\n const downX = e.clientX\n const downY = e.clientY\n const { offsetX, offsetY } = transform\n\n const onMousemove = (e: MouseEvent) => {\n const moveX = offsetX + e.clientX - downX\n const moveY = offsetY + e.clientY - downY\n\n adjustPosition(moveX, moveY)\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 const onDraggable = () => {\n if (dragRef.value && targetRef.value) {\n dragRef.value.addEventListener('mousedown', onMousedown)\n window.addEventListener('resize', updatePosition)\n }\n }\n\n const offDraggable = () => {\n if (dragRef.value && targetRef.value) {\n dragRef.value.removeEventListener('mousedown', onMousedown)\n window.removeEventListener('resize', updatePosition)\n }\n }\n\n const resetPosition = () => {\n transform.offsetX = 0\n transform.offsetY = 0\n\n if (targetRef.value) {\n targetRef.value.style.transform = ''\n }\n }\n\n const updatePosition = () => {\n const { offsetX, offsetY } = transform\n\n adjustPosition(offsetX, offsetY)\n }\n\n onMounted(() => {\n watchEffect(() => {\n if (draggable.value) {\n onDraggable()\n } else {\n offDraggable()\n }\n })\n })\n\n onBeforeUnmount(() => {\n offDraggable()\n })\n\n return {\n resetPosition,\n updatePosition,\n }\n}\n"],"names":["addUnit","onMounted","watchEffect","onBeforeUnmount"],"mappings":";;;;;;;AAEY,MAAC,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK;AACzE,EAAE,MAAM,SAAS,GAAG;AACpB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,OAAO,EAAE,CAAC;AACd,GAAG,CAAC;AACJ,EAAE,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK;AAC3C,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE;AACzB,MAAM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AC,OAAO,GAAG,KAAK,CAAC;AAChC,MAAM,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,UAAU,
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-draggable/index.ts"],"sourcesContent":["import { onBeforeUnmount, onMounted, ref, watchEffect } from 'vue'\nimport { addUnit } from '@element-plus/utils'\n\nimport type { ComputedRef, Ref } from 'vue'\n\nexport const useDraggable = (\n targetRef: Ref<HTMLElement | undefined>,\n dragRef: Ref<HTMLElement | undefined>,\n draggable: ComputedRef<boolean>,\n overflow?: ComputedRef<boolean>\n) => {\n const transform = {\n offsetX: 0,\n offsetY: 0,\n }\n\n const isDragging = ref(false)\n\n const adjustPosition = (moveX: number, moveY: number) => {\n if (targetRef.value) {\n const { offsetX, offsetY } = transform\n const targetRect = targetRef.value.getBoundingClientRect()\n const targetLeft = targetRect.left\n const targetTop = targetRect.top\n const targetWidth = targetRect.width\n const targetHeight = targetRect.height\n\n const clientWidth = document.documentElement.clientWidth\n const clientHeight = document.documentElement.clientHeight\n\n const minLeft = -targetLeft + offsetX\n const minTop = -targetTop + offsetY\n const maxLeft = clientWidth - targetLeft - targetWidth + offsetX\n const maxTop =\n clientHeight -\n targetTop -\n (targetHeight < clientHeight ? targetHeight : 0) +\n offsetY\n\n if (!overflow?.value) {\n moveX = Math.min(Math.max(moveX, minLeft), maxLeft)\n moveY = Math.min(Math.max(moveY, minTop), maxTop)\n }\n\n transform.offsetX = moveX\n transform.offsetY = moveY\n\n targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(\n moveY\n )})`\n }\n }\n\n const onMousedown = (e: MouseEvent) => {\n const downX = e.clientX\n const downY = e.clientY\n const { offsetX, offsetY } = transform\n\n const onMousemove = (e: MouseEvent) => {\n if (!isDragging.value) {\n isDragging.value = true\n }\n const moveX = offsetX + e.clientX - downX\n const moveY = offsetY + e.clientY - downY\n\n adjustPosition(moveX, moveY)\n }\n\n const onMouseup = () => {\n isDragging.value = false\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 const onDraggable = () => {\n if (dragRef.value && targetRef.value) {\n dragRef.value.addEventListener('mousedown', onMousedown)\n window.addEventListener('resize', updatePosition)\n }\n }\n\n const offDraggable = () => {\n if (dragRef.value && targetRef.value) {\n dragRef.value.removeEventListener('mousedown', onMousedown)\n window.removeEventListener('resize', updatePosition)\n }\n }\n\n const resetPosition = () => {\n transform.offsetX = 0\n transform.offsetY = 0\n\n if (targetRef.value) {\n targetRef.value.style.transform = ''\n }\n }\n\n const updatePosition = () => {\n const { offsetX, offsetY } = transform\n\n adjustPosition(offsetX, offsetY)\n }\n\n onMounted(() => {\n watchEffect(() => {\n if (draggable.value) {\n onDraggable()\n } else {\n offDraggable()\n }\n })\n })\n\n onBeforeUnmount(() => {\n offDraggable()\n })\n\n return {\n isDragging,\n resetPosition,\n updatePosition,\n }\n}\n"],"names":["ref","addUnit","onMounted","watchEffect","onBeforeUnmount"],"mappings":";;;;;;;AAEY,MAAC,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK;AACzE,EAAE,MAAM,SAAS,GAAG;AACpB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,OAAO,EAAE,CAAC;AACd,GAAG,CAAC;AACJ,EAAE,MAAM,UAAU,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAChC,EAAE,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK;AAC3C,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE;AACzB,MAAM,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;AAC7C,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,I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