@element-plus/nightly 0.0.20240912 → 0.0.20240914
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/README.md +1 -1
- package/dist/index.full.js +42 -13
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +42 -13
- 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/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/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/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/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/src/autocomplete.mjs +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +9 -57
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +57 -9
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader/src/cascader2.mjs +7 -2
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +7 -2
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/menu.mjs +7 -3
- package/es/components/cascader-panel/src/menu.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/index.mjs +4 -4
- package/es/components/pagination/src/components/jumper.mjs +59 -9
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +9 -59
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/total.mjs +27 -7
- package/es/components/pagination/src/components/total.mjs.map +1 -1
- package/es/components/pagination/src/components/total2.mjs +7 -27
- package/es/components/pagination/src/components/total2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/segmented/index.mjs +2 -2
- package/es/components/segmented/src/segmented.mjs +30 -158
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +158 -30
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/segmented/src/types.d.ts +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/table/src/store/watcher.mjs +21 -5
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -1
- package/es/components/table/src/table/utils-helper.mjs +2 -2
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +29 -183
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +183 -29
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/step.mjs +169 -44
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +44 -169
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/index.mjs +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +9 -57
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +57 -9
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader/src/cascader2.js +6 -1
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +6 -1
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.js +6 -2
- package/lib/components/cascader-panel/src/menu.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/pagination/src/components/jumper.js +59 -9
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +9 -59
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/total.js +27 -7
- package/lib/components/pagination/src/components/total.js.map +1 -1
- package/lib/components/pagination/src/components/total2.js +7 -27
- package/lib/components/pagination/src/components/total2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/segmented/index.js +2 -2
- package/lib/components/segmented/src/segmented.js +30 -157
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +157 -30
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/segmented/src/types.d.ts +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/table/src/store/watcher.js +21 -5
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table/utils-helper.js +2 -2
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +29 -183
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +183 -29
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/step.js +168 -44
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +44 -168
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/index.js +4 -4
- 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/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.
|
|
1
|
+
{"version":3,"file":"jumper2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type Jumper from './jumper.vue'\n\nexport const paginationJumperProps = buildProps({\n size: {\n type: String,\n values: componentSizes,\n },\n} as const)\n\nexport type PaginationJumperProps = ExtractPropTypes<\n typeof paginationJumperProps\n>\n\nexport type PaginationJumperInstance = InstanceType<typeof Jumper>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,qBAAqB,GAAG,UAAU,CAAC;AAChD,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,cAAc;AAC1B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, toDisplayString } from 'vue';
|
|
2
|
+
import '../../../../hooks/index.mjs';
|
|
3
|
+
import { usePagination } from '../usePagination.mjs';
|
|
4
|
+
import { paginationTotalProps } from './total2.mjs';
|
|
5
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useLocale } from '../../../../hooks/use-locale/index.mjs';
|
|
7
|
+
import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
|
|
3
8
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
const __default__ = defineComponent({
|
|
10
|
+
name: "ElPaginationTotal"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: paginationTotalProps,
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const { t } = useLocale();
|
|
17
|
+
const ns = useNamespace("pagination");
|
|
18
|
+
const { disabled } = usePagination();
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createElementBlock("span", {
|
|
21
|
+
class: normalizeClass(unref(ns).e("total")),
|
|
22
|
+
disabled: unref(disabled)
|
|
23
|
+
}, toDisplayString(unref(t)("el.pagination.total", {
|
|
24
|
+
total: _ctx.total
|
|
25
|
+
})), 11, ["disabled"]);
|
|
26
|
+
};
|
|
8
27
|
}
|
|
9
28
|
});
|
|
29
|
+
var Total = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "total.vue"]]);
|
|
10
30
|
|
|
11
|
-
export {
|
|
31
|
+
export { Total as default };
|
|
12
32
|
//# sourceMappingURL=total.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"total.mjs","sources":["../../../../../../../packages/components/pagination/src/components/total.
|
|
1
|
+
{"version":3,"file":"total.mjs","sources":["../../../../../../../packages/components/pagination/src/components/total.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('total')\" :disabled=\"disabled\">\n {{\n t('el.pagination.total', {\n total,\n })\n }}\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { usePagination } from '../usePagination'\nimport { paginationTotalProps } from './total'\n\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { disabled } = usePagination()\n\ndefineOptions({\n name: 'ElPaginationTotal',\n})\n\ndefineProps(paginationTotalProps)\n</script>\n"],"names":[],"mappings":";;;;;;;;mCAmBc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;AANA,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AACpC,IAAM,MAAA,EAAE,aAAa,aAAc,EAAA,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../../
|
|
3
|
-
import { usePagination } from '../usePagination.mjs';
|
|
4
|
-
import { paginationTotalProps } from './total.mjs';
|
|
5
|
-
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useLocale } from '../../../../hooks/use-locale/index.mjs';
|
|
7
|
-
import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
|
|
8
3
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...__default__,
|
|
14
|
-
props: paginationTotalProps,
|
|
15
|
-
setup(__props) {
|
|
16
|
-
const { t } = useLocale();
|
|
17
|
-
const ns = useNamespace("pagination");
|
|
18
|
-
const { disabled } = usePagination();
|
|
19
|
-
return (_ctx, _cache) => {
|
|
20
|
-
return openBlock(), createElementBlock("span", {
|
|
21
|
-
class: normalizeClass(unref(ns).e("total")),
|
|
22
|
-
disabled: unref(disabled)
|
|
23
|
-
}, toDisplayString(unref(t)("el.pagination.total", {
|
|
24
|
-
total: _ctx.total
|
|
25
|
-
})), 11, ["disabled"]);
|
|
26
|
-
};
|
|
4
|
+
const paginationTotalProps = buildProps({
|
|
5
|
+
total: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 1e3
|
|
27
8
|
}
|
|
28
9
|
});
|
|
29
|
-
var Total = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "total.vue"]]);
|
|
30
10
|
|
|
31
|
-
export {
|
|
11
|
+
export { paginationTotalProps };
|
|
32
12
|
//# sourceMappingURL=total2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"total2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/total.
|
|
1
|
+
{"version":3,"file":"total2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/total.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type Total from './total.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const paginationTotalProps = buildProps({\n total: {\n type: Number,\n default: 1000,\n },\n} as const)\n\nexport type PaginationTotalProps = ExtractPropTypes<typeof paginationTotalProps>\n\nexport type TotalInstance = InstanceType<typeof Total>\n"],"names":[],"mappings":";;;AACY,MAAC,oBAAoB,GAAG,UAAU,CAAC;AAC/C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -6,8 +6,8 @@ import { elPaginationKey } from './constants.mjs';
|
|
|
6
6
|
import Prev from './components/prev2.mjs';
|
|
7
7
|
import Next from './components/next2.mjs';
|
|
8
8
|
import Sizes from './components/sizes2.mjs';
|
|
9
|
-
import Jumper from './components/
|
|
10
|
-
import Total from './components/
|
|
9
|
+
import Jumper from './components/jumper.mjs';
|
|
10
|
+
import Total from './components/total.mjs';
|
|
11
11
|
import Pager from './components/pager2.mjs';
|
|
12
12
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
13
13
|
import { isNumber } from '../../../utils/types.mjs';
|
|
@@ -5,7 +5,7 @@ import '../../tooltip/index.mjs';
|
|
|
5
5
|
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
6
6
|
import { buttonTypes } from '../../button/src/button.mjs';
|
|
7
7
|
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
8
|
-
import { useTooltipContentProps } from '../../tooltip/src/
|
|
8
|
+
import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
|
|
9
9
|
|
|
10
10
|
const popconfirmProps = buildProps({
|
|
11
11
|
title: String,
|
|
@@ -4,7 +4,7 @@ import '../../dropdown/index.mjs';
|
|
|
4
4
|
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
5
5
|
import { useTooltipTriggerProps } from '../../tooltip/src/trigger.mjs';
|
|
6
6
|
import { dropdownProps } from '../../dropdown/src/dropdown.mjs';
|
|
7
|
-
import { useTooltipContentProps } from '../../tooltip/src/
|
|
7
|
+
import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
|
|
8
8
|
import { isBoolean } from '../../../utils/types.mjs';
|
|
9
9
|
|
|
10
10
|
const popoverProps = buildProps({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Segmented from './src/
|
|
3
|
-
export { segmentedEmits, segmentedProps } from './src/
|
|
2
|
+
import Segmented from './src/segmented2.mjs';
|
|
3
|
+
export { segmentedEmits, segmentedProps } from './src/segmented.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const ElSegmented = withInstall(Segmented);
|
|
@@ -1,165 +1,37 @@
|
|
|
1
|
-
import { defineComponent, ref, reactive, computed, watch, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
-
import { useActiveElement, useResizeObserver } from '@vueuse/core';
|
|
3
|
-
import '../../../hooks/index.mjs';
|
|
4
|
-
import '../../form/index.mjs';
|
|
5
1
|
import '../../../utils/index.mjs';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
6
3
|
import '../../../constants/index.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { useId } from '../../../hooks/use-id/index.mjs';
|
|
11
|
-
import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
12
|
-
import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
6
|
+
import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
|
|
13
7
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
8
|
+
import { isString } from '@vue/shared';
|
|
9
|
+
import { isNumber, isBoolean } from '../../../utils/types.mjs';
|
|
16
10
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const state = reactive({
|
|
37
|
-
isInit: false,
|
|
38
|
-
width: 0,
|
|
39
|
-
translateX: 0,
|
|
40
|
-
focusVisible: false
|
|
41
|
-
});
|
|
42
|
-
const handleChange = (item) => {
|
|
43
|
-
const value = getValue(item);
|
|
44
|
-
emit(UPDATE_MODEL_EVENT, value);
|
|
45
|
-
emit(CHANGE_EVENT, value);
|
|
46
|
-
};
|
|
47
|
-
const getValue = (item) => {
|
|
48
|
-
return isObject(item) ? item.value : item;
|
|
49
|
-
};
|
|
50
|
-
const getLabel = (item) => {
|
|
51
|
-
return isObject(item) ? item.label : item;
|
|
52
|
-
};
|
|
53
|
-
const getDisabled = (item) => {
|
|
54
|
-
return !!(_disabled.value || (isObject(item) ? item.disabled : false));
|
|
55
|
-
};
|
|
56
|
-
const getSelected = (item) => {
|
|
57
|
-
return props.modelValue === getValue(item);
|
|
58
|
-
};
|
|
59
|
-
const getOption = (value) => {
|
|
60
|
-
return props.options.find((item) => getValue(item) === value);
|
|
61
|
-
};
|
|
62
|
-
const getItemCls = (item) => {
|
|
63
|
-
return [
|
|
64
|
-
ns.e("item"),
|
|
65
|
-
ns.is("selected", getSelected(item)),
|
|
66
|
-
ns.is("disabled", getDisabled(item))
|
|
67
|
-
];
|
|
68
|
-
};
|
|
69
|
-
const updateSelect = () => {
|
|
70
|
-
if (!segmentedRef.value)
|
|
71
|
-
return;
|
|
72
|
-
const selectedItem = segmentedRef.value.querySelector(".is-selected");
|
|
73
|
-
const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
|
|
74
|
-
if (!selectedItem || !selectedItemInput) {
|
|
75
|
-
state.width = 0;
|
|
76
|
-
state.translateX = 0;
|
|
77
|
-
state.focusVisible = false;
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const rect = selectedItem.getBoundingClientRect();
|
|
81
|
-
state.isInit = true;
|
|
82
|
-
state.width = rect.width;
|
|
83
|
-
state.translateX = selectedItem.offsetLeft;
|
|
84
|
-
try {
|
|
85
|
-
state.focusVisible = selectedItemInput.matches(":focus-visible");
|
|
86
|
-
} catch (e) {
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const segmentedCls = computed(() => [
|
|
90
|
-
ns.b(),
|
|
91
|
-
ns.m(segmentedSize.value),
|
|
92
|
-
ns.is("block", props.block)
|
|
93
|
-
]);
|
|
94
|
-
const selectedStyle = computed(() => ({
|
|
95
|
-
width: `${state.width}px`,
|
|
96
|
-
transform: `translateX(${state.translateX}px)`,
|
|
97
|
-
display: state.isInit ? "block" : "none"
|
|
98
|
-
}));
|
|
99
|
-
const selectedCls = computed(() => [
|
|
100
|
-
ns.e("item-selected"),
|
|
101
|
-
ns.is("disabled", getDisabled(getOption(props.modelValue))),
|
|
102
|
-
ns.is("focus-visible", state.focusVisible)
|
|
103
|
-
]);
|
|
104
|
-
const name = computed(() => {
|
|
105
|
-
return props.name || segmentedId.value;
|
|
106
|
-
});
|
|
107
|
-
useResizeObserver(segmentedRef, updateSelect);
|
|
108
|
-
watch(activeElement, updateSelect);
|
|
109
|
-
watch(() => props.modelValue, () => {
|
|
110
|
-
var _a;
|
|
111
|
-
updateSelect();
|
|
112
|
-
if (props.validateEvent) {
|
|
113
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
flush: "post"
|
|
117
|
-
});
|
|
118
|
-
return (_ctx, _cache) => {
|
|
119
|
-
return openBlock(), createElementBlock("div", {
|
|
120
|
-
id: unref(inputId),
|
|
121
|
-
ref_key: "segmentedRef",
|
|
122
|
-
ref: segmentedRef,
|
|
123
|
-
class: normalizeClass(unref(segmentedCls)),
|
|
124
|
-
role: "radiogroup",
|
|
125
|
-
"aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "segmented" : void 0,
|
|
126
|
-
"aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
|
|
127
|
-
}, [
|
|
128
|
-
createElementVNode("div", {
|
|
129
|
-
class: normalizeClass(unref(ns).e("group"))
|
|
130
|
-
}, [
|
|
131
|
-
createElementVNode("div", {
|
|
132
|
-
style: normalizeStyle(unref(selectedStyle)),
|
|
133
|
-
class: normalizeClass(unref(selectedCls))
|
|
134
|
-
}, null, 6),
|
|
135
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
|
|
136
|
-
return openBlock(), createElementBlock("label", {
|
|
137
|
-
key: index,
|
|
138
|
-
class: normalizeClass(getItemCls(item))
|
|
139
|
-
}, [
|
|
140
|
-
createElementVNode("input", {
|
|
141
|
-
class: normalizeClass(unref(ns).e("item-input")),
|
|
142
|
-
type: "radio",
|
|
143
|
-
name: unref(name),
|
|
144
|
-
disabled: getDisabled(item),
|
|
145
|
-
checked: getSelected(item),
|
|
146
|
-
onChange: ($event) => handleChange(item)
|
|
147
|
-
}, null, 42, ["name", "disabled", "checked", "onChange"]),
|
|
148
|
-
createElementVNode("div", {
|
|
149
|
-
class: normalizeClass(unref(ns).e("item-label"))
|
|
150
|
-
}, [
|
|
151
|
-
renderSlot(_ctx.$slots, "default", { item }, () => [
|
|
152
|
-
createTextVNode(toDisplayString(getLabel(item)), 1)
|
|
153
|
-
])
|
|
154
|
-
], 2)
|
|
155
|
-
], 2);
|
|
156
|
-
}), 128))
|
|
157
|
-
], 2)
|
|
158
|
-
], 10, ["id", "aria-label", "aria-labelledby"]);
|
|
159
|
-
};
|
|
160
|
-
}
|
|
11
|
+
const segmentedProps = buildProps({
|
|
12
|
+
options: {
|
|
13
|
+
type: definePropType(Array),
|
|
14
|
+
default: () => []
|
|
15
|
+
},
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: [String, Number, Boolean],
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
block: Boolean,
|
|
21
|
+
size: useSizeProp,
|
|
22
|
+
disabled: Boolean,
|
|
23
|
+
validateEvent: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
id: String,
|
|
28
|
+
name: String,
|
|
29
|
+
...useAriaProps(["ariaLabel"])
|
|
161
30
|
});
|
|
162
|
-
|
|
31
|
+
const segmentedEmits = {
|
|
32
|
+
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
33
|
+
[CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
34
|
+
};
|
|
163
35
|
|
|
164
|
-
export {
|
|
36
|
+
export { segmentedEmits, segmentedProps };
|
|
165
37
|
//# sourceMappingURL=segmented.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented.mjs","sources":["../../../../../../packages/components/segmented/src/segmented.
|
|
1
|
+
{"version":3,"file":"segmented.mjs","sources":["../../../../../../packages/components/segmented/src/segmented.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n isString,\n} from '@element-plus/utils'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { Option } from './types'\nimport type { ExtractPropTypes } from 'vue'\nimport type Segmented from './segmented.vue'\n\nexport const segmentedProps = buildProps({\n /**\n * @description options of segmented\n */\n options: {\n type: definePropType<Option[]>(Array),\n default: () => [],\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: [String, Number, Boolean],\n default: undefined,\n },\n /**\n * @description fit width of parent content\n */\n block: Boolean,\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description whether segmented is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description native `name` attribute\n */\n name: String,\n ...useAriaProps(['ariaLabel']),\n})\n\nexport type SegmentedProps = ExtractPropTypes<typeof segmentedProps>\n\nexport const segmentedEmits = {\n [UPDATE_MODEL_EVENT]: (val: any) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: any) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\nexport type SegmentedEmits = typeof segmentedEmits\n\nexport type SegmentedInstance = InstanceType<typeof Segmented>\n"],"names":[],"mappings":";;;;;;;;;;AASY,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,GAAG,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC3E;;;;"}
|
|
@@ -1,37 +1,165 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, ref, reactive, computed, watch, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { useActiveElement, useResizeObserver } from '@vueuse/core';
|
|
2
3
|
import '../../../hooks/index.mjs';
|
|
4
|
+
import '../../form/index.mjs';
|
|
5
|
+
import '../../../utils/index.mjs';
|
|
3
6
|
import '../../../constants/index.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
+
import { segmentedProps, segmentedEmits } from './segmented.mjs';
|
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { useId } from '../../../hooks/use-id/index.mjs';
|
|
11
|
+
import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
12
|
+
import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
|
|
7
13
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
14
|
+
import { isObject } from '@vue/shared';
|
|
15
|
+
import { debugWarn } from '../../../utils/error.mjs';
|
|
10
16
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const __default__ = defineComponent({
|
|
18
|
+
name: "ElSegmented"
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: segmentedProps,
|
|
23
|
+
emits: segmentedEmits,
|
|
24
|
+
setup(__props, { emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const ns = useNamespace("segmented");
|
|
27
|
+
const segmentedId = useId();
|
|
28
|
+
const segmentedSize = useFormSize();
|
|
29
|
+
const _disabled = useFormDisabled();
|
|
30
|
+
const { formItem } = useFormItem();
|
|
31
|
+
const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
|
|
32
|
+
formItemContext: formItem
|
|
33
|
+
});
|
|
34
|
+
const segmentedRef = ref(null);
|
|
35
|
+
const activeElement = useActiveElement();
|
|
36
|
+
const state = reactive({
|
|
37
|
+
isInit: false,
|
|
38
|
+
width: 0,
|
|
39
|
+
translateX: 0,
|
|
40
|
+
focusVisible: false
|
|
41
|
+
});
|
|
42
|
+
const handleChange = (item) => {
|
|
43
|
+
const value = getValue(item);
|
|
44
|
+
emit(UPDATE_MODEL_EVENT, value);
|
|
45
|
+
emit(CHANGE_EVENT, value);
|
|
46
|
+
};
|
|
47
|
+
const getValue = (item) => {
|
|
48
|
+
return isObject(item) ? item.value : item;
|
|
49
|
+
};
|
|
50
|
+
const getLabel = (item) => {
|
|
51
|
+
return isObject(item) ? item.label : item;
|
|
52
|
+
};
|
|
53
|
+
const getDisabled = (item) => {
|
|
54
|
+
return !!(_disabled.value || (isObject(item) ? item.disabled : false));
|
|
55
|
+
};
|
|
56
|
+
const getSelected = (item) => {
|
|
57
|
+
return props.modelValue === getValue(item);
|
|
58
|
+
};
|
|
59
|
+
const getOption = (value) => {
|
|
60
|
+
return props.options.find((item) => getValue(item) === value);
|
|
61
|
+
};
|
|
62
|
+
const getItemCls = (item) => {
|
|
63
|
+
return [
|
|
64
|
+
ns.e("item"),
|
|
65
|
+
ns.is("selected", getSelected(item)),
|
|
66
|
+
ns.is("disabled", getDisabled(item))
|
|
67
|
+
];
|
|
68
|
+
};
|
|
69
|
+
const updateSelect = () => {
|
|
70
|
+
if (!segmentedRef.value)
|
|
71
|
+
return;
|
|
72
|
+
const selectedItem = segmentedRef.value.querySelector(".is-selected");
|
|
73
|
+
const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
|
|
74
|
+
if (!selectedItem || !selectedItemInput) {
|
|
75
|
+
state.width = 0;
|
|
76
|
+
state.translateX = 0;
|
|
77
|
+
state.focusVisible = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const rect = selectedItem.getBoundingClientRect();
|
|
81
|
+
state.isInit = true;
|
|
82
|
+
state.width = rect.width;
|
|
83
|
+
state.translateX = selectedItem.offsetLeft;
|
|
84
|
+
try {
|
|
85
|
+
state.focusVisible = selectedItemInput.matches(":focus-visible");
|
|
86
|
+
} catch (e) {
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const segmentedCls = computed(() => [
|
|
90
|
+
ns.b(),
|
|
91
|
+
ns.m(segmentedSize.value),
|
|
92
|
+
ns.is("block", props.block)
|
|
93
|
+
]);
|
|
94
|
+
const selectedStyle = computed(() => ({
|
|
95
|
+
width: `${state.width}px`,
|
|
96
|
+
transform: `translateX(${state.translateX}px)`,
|
|
97
|
+
display: state.isInit ? "block" : "none"
|
|
98
|
+
}));
|
|
99
|
+
const selectedCls = computed(() => [
|
|
100
|
+
ns.e("item-selected"),
|
|
101
|
+
ns.is("disabled", getDisabled(getOption(props.modelValue))),
|
|
102
|
+
ns.is("focus-visible", state.focusVisible)
|
|
103
|
+
]);
|
|
104
|
+
const name = computed(() => {
|
|
105
|
+
return props.name || segmentedId.value;
|
|
106
|
+
});
|
|
107
|
+
useResizeObserver(segmentedRef, updateSelect);
|
|
108
|
+
watch(activeElement, updateSelect);
|
|
109
|
+
watch(() => props.modelValue, () => {
|
|
110
|
+
var _a;
|
|
111
|
+
updateSelect();
|
|
112
|
+
if (props.validateEvent) {
|
|
113
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
flush: "post"
|
|
117
|
+
});
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
return openBlock(), createElementBlock("div", {
|
|
120
|
+
id: unref(inputId),
|
|
121
|
+
ref_key: "segmentedRef",
|
|
122
|
+
ref: segmentedRef,
|
|
123
|
+
class: normalizeClass(unref(segmentedCls)),
|
|
124
|
+
role: "radiogroup",
|
|
125
|
+
"aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "segmented" : void 0,
|
|
126
|
+
"aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
|
|
127
|
+
}, [
|
|
128
|
+
createElementVNode("div", {
|
|
129
|
+
class: normalizeClass(unref(ns).e("group"))
|
|
130
|
+
}, [
|
|
131
|
+
createElementVNode("div", {
|
|
132
|
+
style: normalizeStyle(unref(selectedStyle)),
|
|
133
|
+
class: normalizeClass(unref(selectedCls))
|
|
134
|
+
}, null, 6),
|
|
135
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
|
|
136
|
+
return openBlock(), createElementBlock("label", {
|
|
137
|
+
key: index,
|
|
138
|
+
class: normalizeClass(getItemCls(item))
|
|
139
|
+
}, [
|
|
140
|
+
createElementVNode("input", {
|
|
141
|
+
class: normalizeClass(unref(ns).e("item-input")),
|
|
142
|
+
type: "radio",
|
|
143
|
+
name: unref(name),
|
|
144
|
+
disabled: getDisabled(item),
|
|
145
|
+
checked: getSelected(item),
|
|
146
|
+
onChange: ($event) => handleChange(item)
|
|
147
|
+
}, null, 42, ["name", "disabled", "checked", "onChange"]),
|
|
148
|
+
createElementVNode("div", {
|
|
149
|
+
class: normalizeClass(unref(ns).e("item-label"))
|
|
150
|
+
}, [
|
|
151
|
+
renderSlot(_ctx.$slots, "default", { item }, () => [
|
|
152
|
+
createTextVNode(toDisplayString(getLabel(item)), 1)
|
|
153
|
+
])
|
|
154
|
+
], 2)
|
|
155
|
+
], 2);
|
|
156
|
+
}), 128))
|
|
157
|
+
], 2)
|
|
158
|
+
], 10, ["id", "aria-label", "aria-labelledby"]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
30
161
|
});
|
|
31
|
-
|
|
32
|
-
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
33
|
-
[CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
34
|
-
};
|
|
162
|
+
var Segmented = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "segmented.vue"]]);
|
|
35
163
|
|
|
36
|
-
export {
|
|
164
|
+
export { Segmented as default };
|
|
37
165
|
//# sourceMappingURL=segmented2.mjs.map
|