@element-plus/nightly 0.0.20220305 → 0.0.20220306
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/dist/index.css +1 -1
- package/dist/index.full.js +1142 -801
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1137 -800
- 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.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/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/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/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/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/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/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/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/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-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/autocomplete/index.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +4 -4
- package/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/cascader/index.d.ts +18 -18
- package/es/components/cascader/src/index.mjs +5 -4
- package/es/components/cascader/src/index.mjs.map +1 -1
- package/es/components/cascader/src/index.vue.d.ts +9 -9
- package/es/components/checkbox/src/checkbox-group.mjs +2 -1
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/useCheckbox.d.ts +4 -4
- package/es/components/checkbox/src/useCheckbox.mjs +6 -4
- package/es/components/checkbox/src/useCheckbox.mjs.map +1 -1
- package/es/components/color-picker/src/index.mjs +6 -5
- package/es/components/color-picker/src/index.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +3 -0
- package/es/components/dropdown/src/dropdown.d.ts +1 -0
- package/es/components/dropdown/src/dropdown.mjs +4 -0
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +3 -0
- package/es/components/dropdown/src/dropdown2.mjs +8 -5
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/form/index.d.ts +285 -210
- package/es/components/form/index.mjs +8 -5
- package/es/components/form/index.mjs.map +1 -1
- package/es/components/form/src/form-item.d.ts +21 -0
- package/es/components/form/src/form-item.mjs +41 -301
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item.vue.d.ts +104 -73
- package/es/components/form/src/form-item2.mjs +249 -0
- package/es/components/form/src/form-item2.mjs.map +1 -0
- package/es/components/form/src/form-label-wrap.d.ts +11 -0
- package/es/components/form/src/form-label-wrap.mjs +96 -0
- package/es/components/form/src/form-label-wrap.mjs.map +1 -0
- package/es/components/form/src/form.d.ts +25 -0
- package/es/components/form/src/form.mjs +43 -208
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +86 -76
- package/es/components/form/src/form2.mjs +130 -0
- package/es/components/form/src/form2.mjs.map +1 -0
- package/es/components/form/src/types.d.ts +9 -0
- package/es/components/form/src/types.mjs +2 -0
- package/es/components/form/src/types.mjs.map +1 -0
- package/es/components/form/src/utils.d.ts +9 -0
- package/es/components/form/src/utils.mjs +48 -0
- package/es/components/form/src/utils.mjs.map +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/input/index.d.ts +1 -1
- package/es/components/input/src/input.vue.d.ts +1 -1
- package/es/components/input/src/input2.mjs +3 -2
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/index.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +2 -2
- package/es/components/input-number/src/input-number2.mjs +2 -2
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/popover/index.d.ts +2 -0
- package/es/components/popover/src/index.mjs +6 -1
- package/es/components/popover/src/index.mjs.map +1 -1
- package/es/components/popover/src/index.vue.d.ts +1 -0
- package/es/components/radio/index.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +10 -10
- package/es/components/radio/src/radio-group2.mjs +3 -1
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/radio/src/radio.vue.d.ts +1 -1
- package/es/components/rate/index.d.ts +1 -1
- package/es/components/rate/src/rate.vue.d.ts +1 -1
- package/es/components/rate/src/rate2.mjs +2 -2
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/scrollbar/index.d.ts +3 -3
- package/es/components/scrollbar/src/scrollbar.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +3 -3
- package/es/components/select/src/useSelect.mjs +7 -6
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/index.d.ts +6 -6
- package/es/components/select-v2/src/defaults.d.ts +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +3 -3
- package/es/components/select-v2/src/useSelect.mjs +2 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/slider/index.d.ts +2 -2
- package/es/components/slider/src/index.mjs +3 -3
- package/es/components/slider/src/index.mjs.map +1 -1
- package/es/components/slider/src/index.vue.d.ts +1 -1
- package/es/components/slider/src/useSlide.d.ts +2 -2
- package/es/components/slider/src/useSlide.mjs +3 -3
- package/es/components/slider/src/useSlide.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +2 -2
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/index.d.ts +4 -0
- package/es/components/table/src/config.mjs +2 -2
- package/es/components/table/src/config.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.d.ts +4 -0
- package/es/components/table/src/table/style-helper.mjs +6 -1
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/index.mjs +11 -4
- package/es/components/table/src/table-column/index.mjs.map +1 -1
- package/es/components/table/src/table.mjs +7 -4
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +4 -0
- package/es/components/time-picker/src/common/picker.mjs +6 -5
- package/es/components/time-picker/src/common/picker.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +1 -1
- package/es/components/transfer/src/index.mjs +6 -4
- package/es/components/transfer/src/index.mjs.map +1 -1
- package/es/hooks/use-common-props/index.mjs +4 -4
- package/es/hooks/use-common-props/index.mjs.map +1 -1
- package/es/hooks/use-form-item/index.d.ts +2 -2
- package/es/hooks/use-form-item/index.mjs +3 -3
- package/es/hooks/use-form-item/index.mjs.map +1 -1
- package/es/index.mjs +3 -1
- package/es/index.mjs.map +1 -1
- package/es/tokens/form.d.ts +17 -37
- package/es/tokens/form.mjs +3 -3
- package/es/tokens/form.mjs.map +1 -1
- package/es/tokens/index.mjs +1 -1
- package/es/utils/error.d.ts +1 -0
- package/es/utils/error.mjs +5 -1
- package/es/utils/error.mjs.map +1 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/objects.d.ts +3 -5
- package/es/utils/objects.mjs +10 -35
- package/es/utils/objects.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +4 -4
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/cascader/index.d.ts +18 -18
- package/lib/components/cascader/src/index.js +4 -3
- package/lib/components/cascader/src/index.js.map +1 -1
- package/lib/components/cascader/src/index.vue.d.ts +9 -9
- package/lib/components/checkbox/src/checkbox-group.js +2 -1
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/useCheckbox.d.ts +4 -4
- package/lib/components/checkbox/src/useCheckbox.js +5 -3
- package/lib/components/checkbox/src/useCheckbox.js.map +1 -1
- package/lib/components/color-picker/src/index.js +5 -4
- package/lib/components/color-picker/src/index.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +3 -0
- package/lib/components/dropdown/src/dropdown.d.ts +1 -0
- package/lib/components/dropdown/src/dropdown.js +4 -0
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -0
- package/lib/components/dropdown/src/dropdown2.js +8 -5
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/form/index.d.ts +285 -210
- package/lib/components/form/index.js +10 -3
- package/lib/components/form/index.js.map +1 -1
- package/lib/components/form/src/form-item.d.ts +21 -0
- package/lib/components/form/src/form-item.js +42 -305
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item.vue.d.ts +104 -73
- package/lib/components/form/src/form-item2.js +257 -0
- package/lib/components/form/src/form-item2.js.map +1 -0
- package/lib/components/form/src/form-label-wrap.d.ts +11 -0
- package/lib/components/form/src/form-label-wrap.js +100 -0
- package/lib/components/form/src/form-label-wrap.js.map +1 -0
- package/lib/components/form/src/form.d.ts +25 -0
- package/lib/components/form/src/form.js +44 -208
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +86 -76
- package/lib/components/form/src/form2.js +134 -0
- package/lib/components/form/src/form2.js.map +1 -0
- package/lib/components/form/src/types.d.ts +9 -0
- package/lib/components/form/src/types.js +3 -0
- package/lib/components/form/src/types.js.map +1 -0
- package/lib/components/form/src/utils.d.ts +9 -0
- package/lib/components/form/src/utils.js +53 -0
- package/lib/components/form/src/utils.js.map +1 -0
- package/lib/components/index.js +6 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/index.d.ts +1 -1
- package/lib/components/input/src/input.vue.d.ts +1 -1
- package/lib/components/input/src/input2.js +3 -2
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/index.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +2 -2
- package/lib/components/input-number/src/input-number2.js +2 -2
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/popover/index.d.ts +2 -0
- package/lib/components/popover/src/index.js +6 -1
- package/lib/components/popover/src/index.js.map +1 -1
- package/lib/components/popover/src/index.vue.d.ts +1 -0
- package/lib/components/radio/index.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +10 -10
- package/lib/components/radio/src/radio-group2.js +3 -1
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/radio/src/radio.vue.d.ts +1 -1
- package/lib/components/rate/index.d.ts +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +1 -1
- package/lib/components/rate/src/rate2.js +1 -1
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/scrollbar/index.d.ts +3 -3
- package/lib/components/scrollbar/src/scrollbar.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +1 -1
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +3 -3
- package/lib/components/select/src/useSelect.js +6 -5
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/index.d.ts +6 -6
- package/lib/components/select-v2/src/defaults.d.ts +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +3 -3
- package/lib/components/select-v2/src/useSelect.js +2 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/slider/index.d.ts +2 -2
- package/lib/components/slider/src/index.js +2 -2
- package/lib/components/slider/src/index.js.map +1 -1
- package/lib/components/slider/src/index.vue.d.ts +1 -1
- package/lib/components/slider/src/useSlide.d.ts +2 -2
- package/lib/components/slider/src/useSlide.js +2 -2
- package/lib/components/slider/src/useSlide.js.map +1 -1
- package/lib/components/switch/src/switch2.js +2 -2
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/index.d.ts +4 -0
- package/lib/components/table/src/config.js +1 -1
- package/lib/components/table/src/config.js.map +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +4 -0
- package/lib/components/table/src/table/style-helper.js +6 -1
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table-column/index.js +11 -4
- package/lib/components/table/src/table-column/index.js.map +1 -1
- package/lib/components/table/src/table.js +7 -4
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +4 -0
- package/lib/components/time-picker/src/common/picker.js +5 -4
- package/lib/components/time-picker/src/common/picker.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +1 -1
- package/lib/components/transfer/src/index.js +5 -3
- package/lib/components/transfer/src/index.js.map +1 -1
- package/lib/hooks/use-common-props/index.js +3 -3
- package/lib/hooks/use-common-props/index.js.map +1 -1
- package/lib/hooks/use-form-item/index.d.ts +2 -2
- package/lib/hooks/use-form-item/index.js +2 -2
- package/lib/hooks/use-form-item/index.js.map +1 -1
- package/lib/index.js +9 -3
- package/lib/index.js.map +1 -1
- package/lib/tokens/form.d.ts +17 -37
- package/lib/tokens/form.js +4 -4
- package/lib/tokens/form.js.map +1 -1
- package/lib/tokens/index.js +2 -2
- package/lib/utils/error.d.ts +1 -0
- package/lib/utils/error.js +5 -1
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/objects.d.ts +3 -5
- package/lib/utils/objects.js +10 -34
- package/lib/utils/objects.js.map +1 -1
- 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/theme-chalk/el-dropdown.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/dropdown.scss +5 -0
- package/web-types.json +1 -1
- package/es/components/form/src/form.type.d.ts +0 -5
- package/es/components/form/src/form.type.mjs +0 -2
- package/es/components/form/src/form.type.mjs.map +0 -1
- package/es/components/form/src/label-wrap.d.ts +0 -13
- package/es/components/form/src/label-wrap.mjs +0 -83
- package/es/components/form/src/label-wrap.mjs.map +0 -1
- package/lib/components/form/src/form.type.d.ts +0 -5
- package/lib/components/form/src/form.type.js +0 -3
- package/lib/components/form/src/form.type.js.map +0 -1
- package/lib/components/form/src/label-wrap.d.ts +0 -13
- package/lib/components/form/src/label-wrap.js +0 -87
- package/lib/components/form/src/label-wrap.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.type.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
isAutoWidth: BooleanConstructor;
|
|
3
|
-
updateAll: BooleanConstructor;
|
|
4
|
-
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}> | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
isAutoWidth: BooleanConstructor;
|
|
8
|
-
updateAll: BooleanConstructor;
|
|
9
|
-
}>>, {
|
|
10
|
-
isAutoWidth: boolean;
|
|
11
|
-
updateAll: boolean;
|
|
12
|
-
}>;
|
|
13
|
-
export default _default;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, inject, watch, nextTick, onMounted, onUpdated, onBeforeUnmount, h, Fragment } from 'vue';
|
|
2
|
-
import '../../../utils/index.mjs';
|
|
3
|
-
import '../../../tokens/index.mjs';
|
|
4
|
-
import { elFormKey, elFormItemKey } from '../../../tokens/form.mjs';
|
|
5
|
-
import { addResizeListener, removeResizeListener } from '../../../utils/dom/resize-event.mjs';
|
|
6
|
-
|
|
7
|
-
var LabelWrap = defineComponent({
|
|
8
|
-
name: "ElLabelWrap",
|
|
9
|
-
props: {
|
|
10
|
-
isAutoWidth: Boolean,
|
|
11
|
-
updateAll: Boolean
|
|
12
|
-
},
|
|
13
|
-
setup(props, { slots }) {
|
|
14
|
-
const el = ref(null);
|
|
15
|
-
const elForm = inject(elFormKey);
|
|
16
|
-
const elFormItem = inject(elFormItemKey);
|
|
17
|
-
const computedWidth = ref(0);
|
|
18
|
-
watch(computedWidth, (val, oldVal) => {
|
|
19
|
-
if (props.updateAll) {
|
|
20
|
-
elForm.registerLabelWidth(val, oldVal);
|
|
21
|
-
elFormItem.updateComputedLabelWidth(val);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
const getLabelWidth = () => {
|
|
25
|
-
var _a;
|
|
26
|
-
if ((_a = el.value) == null ? void 0 : _a.firstElementChild) {
|
|
27
|
-
const width = window.getComputedStyle(el.value.firstElementChild).width;
|
|
28
|
-
return Math.ceil(parseFloat(width));
|
|
29
|
-
} else {
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const updateLabelWidth = (action = "update") => {
|
|
34
|
-
nextTick(() => {
|
|
35
|
-
if (slots.default && props.isAutoWidth) {
|
|
36
|
-
if (action === "update") {
|
|
37
|
-
computedWidth.value = getLabelWidth();
|
|
38
|
-
} else if (action === "remove") {
|
|
39
|
-
elForm.deregisterLabelWidth(computedWidth.value);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const updateLabelWidthFn = () => updateLabelWidth("update");
|
|
45
|
-
onMounted(() => {
|
|
46
|
-
addResizeListener(el.value.firstElementChild, updateLabelWidthFn);
|
|
47
|
-
updateLabelWidthFn();
|
|
48
|
-
});
|
|
49
|
-
onUpdated(updateLabelWidthFn);
|
|
50
|
-
onBeforeUnmount(() => {
|
|
51
|
-
var _a;
|
|
52
|
-
updateLabelWidth("remove");
|
|
53
|
-
removeResizeListener((_a = el.value) == null ? void 0 : _a.firstElementChild, updateLabelWidthFn);
|
|
54
|
-
});
|
|
55
|
-
function render() {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
if (!slots)
|
|
58
|
-
return null;
|
|
59
|
-
if (props.isAutoWidth) {
|
|
60
|
-
const autoLabelWidth = elForm.autoLabelWidth;
|
|
61
|
-
const style = {};
|
|
62
|
-
if (autoLabelWidth && autoLabelWidth !== "auto") {
|
|
63
|
-
const marginWidth = Math.max(0, parseInt(autoLabelWidth, 10) - computedWidth.value);
|
|
64
|
-
const marginPosition = elForm.labelPosition === "left" ? "marginRight" : "marginLeft";
|
|
65
|
-
if (marginWidth) {
|
|
66
|
-
style[marginPosition] = `${marginWidth}px`;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return h("div", {
|
|
70
|
-
ref: el,
|
|
71
|
-
class: ["el-form-item__label-wrap"],
|
|
72
|
-
style
|
|
73
|
-
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
74
|
-
} else {
|
|
75
|
-
return h(Fragment, { ref: el }, (_b = slots.default) == null ? void 0 : _b.call(slots));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return render;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export { LabelWrap as default };
|
|
83
|
-
//# sourceMappingURL=label-wrap.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label-wrap.mjs","sources":["../../../../../../packages/components/form/src/label-wrap.ts"],"sourcesContent":["import {\n defineComponent,\n Fragment,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n watch,\n} from 'vue'\nimport { addResizeListener, removeResizeListener } from '@element-plus/utils'\nimport { elFormItemKey, elFormKey } from '@element-plus/tokens'\nimport type { ResizableElement, Nullable } from '@element-plus/utils'\n\nimport type { CSSProperties } from 'vue'\n\nexport default defineComponent({\n name: 'ElLabelWrap',\n props: {\n isAutoWidth: Boolean,\n updateAll: Boolean,\n },\n setup(props, { slots }) {\n const el = ref<Nullable<HTMLElement>>(null)\n const elForm = inject(elFormKey)\n const elFormItem = inject(elFormItemKey)\n\n const computedWidth = ref(0)\n watch(computedWidth, (val, oldVal) => {\n if (props.updateAll) {\n elForm.registerLabelWidth(val, oldVal)\n elFormItem.updateComputedLabelWidth(val)\n }\n })\n\n const getLabelWidth = () => {\n if (el.value?.firstElementChild) {\n const width = window.getComputedStyle(el.value.firstElementChild).width\n return Math.ceil(parseFloat(width))\n } else {\n return 0\n }\n }\n const updateLabelWidth = (action = 'update') => {\n nextTick(() => {\n if (slots.default && props.isAutoWidth) {\n if (action === 'update') {\n computedWidth.value = getLabelWidth()\n } else if (action === 'remove') {\n elForm.deregisterLabelWidth(computedWidth.value)\n }\n }\n })\n }\n const updateLabelWidthFn = () => updateLabelWidth('update')\n\n onMounted(() => {\n addResizeListener(\n el.value.firstElementChild as ResizableElement,\n updateLabelWidthFn\n )\n updateLabelWidthFn()\n })\n\n onUpdated(updateLabelWidthFn)\n\n onBeforeUnmount(() => {\n updateLabelWidth('remove')\n removeResizeListener(\n el.value?.firstElementChild as ResizableElement,\n updateLabelWidthFn\n )\n })\n\n function render() {\n if (!slots) return null\n if (props.isAutoWidth) {\n const autoLabelWidth = elForm.autoLabelWidth\n const style = {} as CSSProperties\n if (autoLabelWidth && autoLabelWidth !== 'auto') {\n const marginWidth = Math.max(\n 0,\n parseInt(autoLabelWidth, 10) - computedWidth.value\n )\n const marginPosition =\n elForm.labelPosition === 'left' ? 'marginRight' : 'marginLeft'\n if (marginWidth) {\n style[marginPosition] = `${marginWidth}px`\n }\n }\n return h(\n 'div',\n {\n ref: el,\n class: ['el-form-item__label-wrap'],\n style,\n },\n slots.default?.()\n )\n } else {\n return h(Fragment, { ref: el }, slots.default?.())\n }\n }\n\n return render\n },\n})\n"],"names":[],"mappings":";;;;;;AAcA,gBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,aAAa;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,WAAW,EAAE,OAAO;AACxB,IAAI,SAAS,EAAE,OAAO;AACtB,GAAG;AACH,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE;AAC1B,IAAI,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACrC,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC7C,IAAI,MAAM,aAAa,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACjC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK;AAC1C,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE;AAC3B,QAAQ,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC/C,QAAQ,UAAU,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;AACjD,OAAO;AACP,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,aAAa,GAAG,MAAM;AAChC,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;AACnE,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC;AAChF,QAAQ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CA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|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
isAutoWidth: BooleanConstructor;
|
|
3
|
-
updateAll: BooleanConstructor;
|
|
4
|
-
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}> | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
isAutoWidth: BooleanConstructor;
|
|
8
|
-
updateAll: BooleanConstructor;
|
|
9
|
-
}>>, {
|
|
10
|
-
isAutoWidth: boolean;
|
|
11
|
-
updateAll: boolean;
|
|
12
|
-
}>;
|
|
13
|
-
export default _default;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
require('../../../utils/index.js');
|
|
7
|
-
require('../../../tokens/index.js');
|
|
8
|
-
var form = require('../../../tokens/form.js');
|
|
9
|
-
var resizeEvent = require('../../../utils/dom/resize-event.js');
|
|
10
|
-
|
|
11
|
-
var LabelWrap = vue.defineComponent({
|
|
12
|
-
name: "ElLabelWrap",
|
|
13
|
-
props: {
|
|
14
|
-
isAutoWidth: Boolean,
|
|
15
|
-
updateAll: Boolean
|
|
16
|
-
},
|
|
17
|
-
setup(props, { slots }) {
|
|
18
|
-
const el = vue.ref(null);
|
|
19
|
-
const elForm = vue.inject(form.elFormKey);
|
|
20
|
-
const elFormItem = vue.inject(form.elFormItemKey);
|
|
21
|
-
const computedWidth = vue.ref(0);
|
|
22
|
-
vue.watch(computedWidth, (val, oldVal) => {
|
|
23
|
-
if (props.updateAll) {
|
|
24
|
-
elForm.registerLabelWidth(val, oldVal);
|
|
25
|
-
elFormItem.updateComputedLabelWidth(val);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const getLabelWidth = () => {
|
|
29
|
-
var _a;
|
|
30
|
-
if ((_a = el.value) == null ? void 0 : _a.firstElementChild) {
|
|
31
|
-
const width = window.getComputedStyle(el.value.firstElementChild).width;
|
|
32
|
-
return Math.ceil(parseFloat(width));
|
|
33
|
-
} else {
|
|
34
|
-
return 0;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const updateLabelWidth = (action = "update") => {
|
|
38
|
-
vue.nextTick(() => {
|
|
39
|
-
if (slots.default && props.isAutoWidth) {
|
|
40
|
-
if (action === "update") {
|
|
41
|
-
computedWidth.value = getLabelWidth();
|
|
42
|
-
} else if (action === "remove") {
|
|
43
|
-
elForm.deregisterLabelWidth(computedWidth.value);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
const updateLabelWidthFn = () => updateLabelWidth("update");
|
|
49
|
-
vue.onMounted(() => {
|
|
50
|
-
resizeEvent.addResizeListener(el.value.firstElementChild, updateLabelWidthFn);
|
|
51
|
-
updateLabelWidthFn();
|
|
52
|
-
});
|
|
53
|
-
vue.onUpdated(updateLabelWidthFn);
|
|
54
|
-
vue.onBeforeUnmount(() => {
|
|
55
|
-
var _a;
|
|
56
|
-
updateLabelWidth("remove");
|
|
57
|
-
resizeEvent.removeResizeListener((_a = el.value) == null ? void 0 : _a.firstElementChild, updateLabelWidthFn);
|
|
58
|
-
});
|
|
59
|
-
function render() {
|
|
60
|
-
var _a, _b;
|
|
61
|
-
if (!slots)
|
|
62
|
-
return null;
|
|
63
|
-
if (props.isAutoWidth) {
|
|
64
|
-
const autoLabelWidth = elForm.autoLabelWidth;
|
|
65
|
-
const style = {};
|
|
66
|
-
if (autoLabelWidth && autoLabelWidth !== "auto") {
|
|
67
|
-
const marginWidth = Math.max(0, parseInt(autoLabelWidth, 10) - computedWidth.value);
|
|
68
|
-
const marginPosition = elForm.labelPosition === "left" ? "marginRight" : "marginLeft";
|
|
69
|
-
if (marginWidth) {
|
|
70
|
-
style[marginPosition] = `${marginWidth}px`;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return vue.h("div", {
|
|
74
|
-
ref: el,
|
|
75
|
-
class: ["el-form-item__label-wrap"],
|
|
76
|
-
style
|
|
77
|
-
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
78
|
-
} else {
|
|
79
|
-
return vue.h(vue.Fragment, { ref: el }, (_b = slots.default) == null ? void 0 : _b.call(slots));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return render;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
exports["default"] = LabelWrap;
|
|
87
|
-
//# sourceMappingURL=label-wrap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label-wrap.js","sources":["../../../../../../packages/components/form/src/label-wrap.ts"],"sourcesContent":["import {\n defineComponent,\n Fragment,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n watch,\n} from 'vue'\nimport { addResizeListener, removeResizeListener } from '@element-plus/utils'\nimport { elFormItemKey, elFormKey } from '@element-plus/tokens'\nimport type { ResizableElement, Nullable } from '@element-plus/utils'\n\nimport type { CSSProperties } from 'vue'\n\nexport default defineComponent({\n name: 'ElLabelWrap',\n props: {\n isAutoWidth: Boolean,\n updateAll: Boolean,\n },\n setup(props, { slots }) {\n const el = ref<Nullable<HTMLElement>>(null)\n const elForm = inject(elFormKey)\n const elFormItem = inject(elFormItemKey)\n\n const computedWidth = ref(0)\n watch(computedWidth, (val, oldVal) => {\n if (props.updateAll) {\n elForm.registerLabelWidth(val, oldVal)\n elFormItem.updateComputedLabelWidth(val)\n }\n })\n\n const getLabelWidth = () => {\n if (el.value?.firstElementChild) {\n const width = window.getComputedStyle(el.value.firstElementChild).width\n return Math.ceil(parseFloat(width))\n } else {\n return 0\n }\n }\n const updateLabelWidth = (action = 'update') => {\n nextTick(() => {\n if (slots.default && props.isAutoWidth) {\n if (action === 'update') {\n computedWidth.value = getLabelWidth()\n } else if (action === 'remove') {\n elForm.deregisterLabelWidth(computedWidth.value)\n }\n }\n })\n }\n const updateLabelWidthFn = () => updateLabelWidth('update')\n\n onMounted(() => {\n addResizeListener(\n el.value.firstElementChild as ResizableElement,\n updateLabelWidthFn\n )\n updateLabelWidthFn()\n })\n\n onUpdated(updateLabelWidthFn)\n\n onBeforeUnmount(() => {\n updateLabelWidth('remove')\n removeResizeListener(\n el.value?.firstElementChild as ResizableElement,\n updateLabelWidthFn\n )\n })\n\n function render() {\n if (!slots) return null\n if (props.isAutoWidth) {\n const autoLabelWidth = elForm.autoLabelWidth\n const style = {} as CSSProperties\n if (autoLabelWidth && autoLabelWidth !== 'auto') {\n const marginWidth = Math.max(\n 0,\n parseInt(autoLabelWidth, 10) - computedWidth.value\n )\n const marginPosition =\n elForm.labelPosition === 'left' ? 'marginRight' : 'marginLeft'\n if (marginWidth) {\n style[marginPosition] = `${marginWidth}px`\n }\n }\n return h(\n 'div',\n {\n ref: el,\n class: ['el-form-item__label-wrap'],\n style,\n },\n slots.default?.()\n )\n } else {\n return h(Fragment, { ref: el }, slots.default?.())\n }\n }\n\n return render\n },\n})\n"],"names":["defineComponent","ref","inject","elFormKey","elFormItemKey","watch","nextTick","onMounted","addResizeListener","onUpdated","onBeforeUnmount","removeResizeListener","h","Fragment"],"mappings":";;;;;;;;;;AAcA,gBAAeA,mBAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,aAAa;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,WAAW,EAAE,OAAO;AACxB,IAAI,SAAS,EAAE,OAAO;AACtB,GAAG;AACH,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE;AAC1B,IAAI,MAAM,EAAE,GAAGC,OAAG,CAAC,IAAI,CAAC,CAAC;AACzB,IAAI,MAAM,MAAM,GA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