@element-plus/nightly 0.0.20240208 → 0.0.20240210
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.full.js +4 -3
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -3
- 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/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/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox.mjs +117 -50
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +50 -117
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +1 -1
- package/es/components/radio/src/radio-group.mjs +1 -1
- package/es/components/radio/src/radio.mjs +73 -30
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +30 -73
- package/es/components/radio/src/radio2.mjs.map +1 -1
- 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.mjs +2 -2
- package/es/components/slider/src/slider.mjs +91 -233
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +233 -91
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/index.mjs +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox.js +117 -51
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +51 -117
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +1 -1
- package/lib/components/radio/src/radio-group.js +1 -1
- package/lib/components/radio/src/radio.js +73 -32
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +32 -73
- package/lib/components/radio/src/radio2.js.map +1 -1
- 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.js +2 -2
- package/lib/components/slider/src/slider.js +92 -233
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider2.js +233 -92
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/index.js +3 -3
- 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":"checkbox.js","sources":["../../../../../../packages/components/checkbox/src/checkbox.
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../../../../packages/components/checkbox/src/checkbox.vue"],"sourcesContent":["<template>\n <component\n :is=\"!hasOwnLabel && isLabeledByFormItem ? 'span' : 'label'\"\n :class=\"compKls\"\n :aria-controls=\"indeterminate ? controls : null\"\n @click=\"onClickRoot\"\n >\n <span :class=\"spanKls\">\n <input\n v-if=\"trueLabel || falseLabel\"\n :id=\"inputId\"\n v-model=\"model\"\n :class=\"ns.e('original')\"\n type=\"checkbox\"\n :indeterminate=\"indeterminate\"\n :name=\"name\"\n :tabindex=\"tabindex\"\n :disabled=\"isDisabled\"\n :true-value=\"trueLabel\"\n :false-value=\"falseLabel\"\n @change=\"handleChange\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n @click.stop\n />\n <input\n v-else\n :id=\"inputId\"\n v-model=\"model\"\n :class=\"ns.e('original')\"\n type=\"checkbox\"\n :indeterminate=\"indeterminate\"\n :disabled=\"isDisabled\"\n :value=\"label\"\n :name=\"name\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n @click.stop\n />\n <span :class=\"ns.e('inner')\" />\n </span>\n <span v-if=\"hasOwnLabel\" :class=\"ns.e('label')\">\n <slot />\n <template v-if=\"!$slots.default\">{{ label }}</template>\n </span>\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { checkboxEmits, checkboxProps } from './checkbox'\nimport { useCheckbox } from './composables'\n\ndefineOptions({\n name: 'ElCheckbox',\n})\n\nconst props = defineProps(checkboxProps)\ndefineEmits(checkboxEmits)\nconst slots = useSlots()\n\nconst {\n inputId,\n isLabeledByFormItem,\n isChecked,\n isDisabled,\n isFocused,\n checkboxSize,\n hasOwnLabel,\n model,\n handleChange,\n onClickRoot,\n} = useCheckbox(props, slots)\n\nconst ns = useNamespace('checkbox')\n\nconst compKls = computed(() => {\n return [\n ns.b(),\n ns.m(checkboxSize.value),\n ns.is('disabled', isDisabled.value),\n ns.is('bordered', props.border),\n ns.is('checked', isChecked.value),\n ]\n})\n\nconst spanKls = computed(() => {\n return [\n ns.e('input'),\n ns.is('disabled', isDisabled.value),\n ns.is('checked', isChecked.value),\n ns.is('indeterminate', props.indeterminate),\n ns.is('focus', isFocused.value),\n ]\n})\n</script>\n"],"names":["useSlots","useCheckbox","useNamespace","computed"],"mappings":";;;;;;;;;;;;;;uCAwDc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA;AAAA,MACJ,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAAC,uBAAA,CAAY,OAAO,KAAK,CAAA,CAAA;AAE5B,IAAM,MAAA,EAAA,GAAKC,mBAAa,UAAU,CAAA,CAAA;AAElC,IAAM,MAAA,OAAA,GAAUC,aAAS,MAAM;AAC7B,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QACL,EAAA,CAAG,CAAE,CAAA,YAAA,CAAa,KAAK,CAAA;AAAA,QACvB,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,QAClC,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,KAAA,CAAM,MAAM,CAAA;AAAA,QAC9B,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,OAClC,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,OAAA,GAAUA,aAAS,MAAM;AAC7B,MAAO,OAAA;AAAA,QACL,EAAA,CAAG,EAAE,OAAO,CAAA;AAAA,QACZ,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,QAClC,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,QAChC,EAAG,CAAA,EAAA,CAAG,eAAiB,EAAA,KAAA,CAAM,aAAa,CAAA;AAAA,QAC1C,EAAG,CAAA,EAAA,CAAG,OAAS,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,OAChC,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,125 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../../constants/index.js');
|
|
6
6
|
require('../../../hooks/index.js');
|
|
7
|
-
|
|
8
|
-
require('
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
7
|
+
require('../../../utils/index.js');
|
|
8
|
+
var index = require('../../../hooks/use-size/index.js');
|
|
9
|
+
var event = require('../../../constants/event.js');
|
|
10
|
+
var shared = require('@vue/shared');
|
|
11
|
+
var types = require('../../../utils/types.js');
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
ns.is("checked", isChecked.value),
|
|
52
|
-
ns.is("indeterminate", props.indeterminate),
|
|
53
|
-
ns.is("focus", isFocused.value)
|
|
54
|
-
];
|
|
55
|
-
});
|
|
56
|
-
return (_ctx, _cache) => {
|
|
57
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!vue.unref(hasOwnLabel) && vue.unref(isLabeledByFormItem) ? "span" : "label"), {
|
|
58
|
-
class: vue.normalizeClass(vue.unref(compKls)),
|
|
59
|
-
"aria-controls": _ctx.indeterminate ? _ctx.controls : null,
|
|
60
|
-
onClick: vue.unref(onClickRoot)
|
|
61
|
-
}, {
|
|
62
|
-
default: vue.withCtx(() => [
|
|
63
|
-
vue.createElementVNode("span", {
|
|
64
|
-
class: vue.normalizeClass(vue.unref(spanKls))
|
|
65
|
-
}, [
|
|
66
|
-
_ctx.trueLabel || _ctx.falseLabel ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
67
|
-
key: 0,
|
|
68
|
-
id: vue.unref(inputId),
|
|
69
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(model) ? model.value = $event : null),
|
|
70
|
-
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
71
|
-
type: "checkbox",
|
|
72
|
-
indeterminate: _ctx.indeterminate,
|
|
73
|
-
name: _ctx.name,
|
|
74
|
-
tabindex: _ctx.tabindex,
|
|
75
|
-
disabled: vue.unref(isDisabled),
|
|
76
|
-
"true-value": _ctx.trueLabel,
|
|
77
|
-
"false-value": _ctx.falseLabel,
|
|
78
|
-
onChange: _cache[1] || (_cache[1] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
|
|
79
|
-
onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
|
|
80
|
-
onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
|
|
81
|
-
onClick: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
82
|
-
}, ["stop"]))
|
|
83
|
-
}, null, 42, _hoisted_1)), [
|
|
84
|
-
[vue.vModelCheckbox, vue.unref(model)]
|
|
85
|
-
]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
86
|
-
key: 1,
|
|
87
|
-
id: vue.unref(inputId),
|
|
88
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue.isRef(model) ? model.value = $event : null),
|
|
89
|
-
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
90
|
-
type: "checkbox",
|
|
91
|
-
indeterminate: _ctx.indeterminate,
|
|
92
|
-
disabled: vue.unref(isDisabled),
|
|
93
|
-
value: _ctx.label,
|
|
94
|
-
name: _ctx.name,
|
|
95
|
-
tabindex: _ctx.tabindex,
|
|
96
|
-
onChange: _cache[6] || (_cache[6] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
|
|
97
|
-
onFocus: _cache[7] || (_cache[7] = ($event) => isFocused.value = true),
|
|
98
|
-
onBlur: _cache[8] || (_cache[8] = ($event) => isFocused.value = false),
|
|
99
|
-
onClick: _cache[9] || (_cache[9] = vue.withModifiers(() => {
|
|
100
|
-
}, ["stop"]))
|
|
101
|
-
}, null, 42, _hoisted_2)), [
|
|
102
|
-
[vue.vModelCheckbox, vue.unref(model)]
|
|
103
|
-
]),
|
|
104
|
-
vue.createElementVNode("span", {
|
|
105
|
-
class: vue.normalizeClass(vue.unref(ns).e("inner"))
|
|
106
|
-
}, null, 2)
|
|
107
|
-
], 2),
|
|
108
|
-
vue.unref(hasOwnLabel) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
109
|
-
key: 0,
|
|
110
|
-
class: vue.normalizeClass(vue.unref(ns).e("label"))
|
|
111
|
-
}, [
|
|
112
|
-
vue.renderSlot(_ctx.$slots, "default"),
|
|
113
|
-
!_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
114
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
115
|
-
], 64)) : vue.createCommentVNode("v-if", true)
|
|
116
|
-
], 2)) : vue.createCommentVNode("v-if", true)
|
|
117
|
-
]),
|
|
118
|
-
_: 3
|
|
119
|
-
}, 8, ["class", "aria-controls", "onClick"]);
|
|
120
|
-
};
|
|
13
|
+
const checkboxProps = {
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: [Number, String, Boolean],
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: [String, Boolean, Number, Object],
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
indeterminate: Boolean,
|
|
23
|
+
disabled: Boolean,
|
|
24
|
+
checked: Boolean,
|
|
25
|
+
name: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
trueLabel: {
|
|
30
|
+
type: [String, Number],
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
falseLabel: {
|
|
34
|
+
type: [String, Number],
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
id: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
controls: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
border: Boolean,
|
|
46
|
+
size: index.useSizeProp,
|
|
47
|
+
tabindex: [String, Number],
|
|
48
|
+
validateEvent: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
121
51
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
52
|
+
};
|
|
53
|
+
const checkboxEmits = {
|
|
54
|
+
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val),
|
|
55
|
+
change: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val)
|
|
56
|
+
};
|
|
124
57
|
|
|
125
|
-
exports
|
|
58
|
+
exports.checkboxEmits = checkboxEmits;
|
|
59
|
+
exports.checkboxProps = checkboxProps;
|
|
126
60
|
//# sourceMappingURL=checkbox2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox2.js","sources":["../../../../../../packages/components/checkbox/src/checkbox.
|
|
1
|
+
{"version":3,"file":"checkbox2.js","sources":["../../../../../../packages/components/checkbox/src/checkbox.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { isBoolean, isNumber, isString } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Checkbox from './checkbox.vue'\n\nexport type CheckboxValueType = string | number | boolean\n\nexport const checkboxProps = {\n /**\n * @description binding value\n */\n modelValue: {\n type: [Number, String, Boolean],\n default: undefined,\n },\n /**\n * @description value of the Checkbox when used inside a `checkbox-group`\n */\n label: {\n type: [String, Boolean, Number, Object],\n default: undefined,\n },\n /**\n * @description Set indeterminate state, only responsible for style control\n */\n indeterminate: Boolean,\n /**\n * @description whether the Checkbox is disabled\n */\n disabled: Boolean,\n /**\n * @description if the Checkbox is checked\n */\n checked: Boolean,\n /**\n * @description native 'name' attribute\n */\n name: {\n type: String,\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's checked\n */\n trueLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's not checked\n */\n falseLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description same as [aria-controls](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls), takes effect when `indeterminate` is `true`\n */\n controls: {\n type: String,\n default: undefined,\n },\n /**\n * @description whether to add a border around Checkbox\n */\n border: Boolean,\n /**\n * @description size of the Checkbox\n */\n size: useSizeProp,\n /**\n * @description input tabindex\n */\n tabindex: [String, Number],\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const checkboxEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n change: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type CheckboxProps = ExtractPropTypes<typeof checkboxProps>\nexport type CheckboxEmits = typeof checkboxEmits\nexport type CheckboxInstance = InstanceType<typeof Checkbox>\n"],"names":["useSizeProp","UPDATE_MODEL_EVENT","isString","isNumber","isBoolean"],"mappings":";;;;;;;;;;;;AAGY,MAAC,aAAa,GAAG;AAC7B,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;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AAC3C,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAEA,iBAAW;AACnB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE;AACU,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,wBAAkB,GAAG,CAAC,GAAG,KAAKC,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AACjF,EAAE,MAAM,EAAE,CAAC,GAAG,KAAKF,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AACnE;;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -102,7 +102,7 @@ var types = require('./cascader-panel/src/types.js');
|
|
|
102
102
|
var config = require('./cascader-panel/src/config.js');
|
|
103
103
|
var checkTag = require('./check-tag/src/check-tag.js');
|
|
104
104
|
var checkboxGroup = require('./checkbox/src/checkbox-group.js');
|
|
105
|
-
var checkbox = require('./checkbox/src/
|
|
105
|
+
var checkbox = require('./checkbox/src/checkbox2.js');
|
|
106
106
|
var constants$3 = require('./checkbox/src/constants.js');
|
|
107
107
|
var col = require('./col/src/col.js');
|
|
108
108
|
var collapse = require('./collapse/src/collapse.js');
|
|
@@ -154,7 +154,7 @@ var arrow = require('./popper/src/arrow2.js');
|
|
|
154
154
|
var trigger = require('./popper/src/trigger2.js');
|
|
155
155
|
var content = require('./popper/src/content2.js');
|
|
156
156
|
var progress = require('./progress/src/progress.js');
|
|
157
|
-
var radio = require('./radio/src/
|
|
157
|
+
var radio = require('./radio/src/radio2.js');
|
|
158
158
|
var radioGroup = require('./radio/src/radio-group.js');
|
|
159
159
|
var radioButton = require('./radio/src/radio-button.js');
|
|
160
160
|
var constants$b = require('./radio/src/constants.js');
|
|
@@ -170,7 +170,7 @@ var token = require('./select/src/token.js');
|
|
|
170
170
|
var token$1 = require('./select-v2/src/token.js');
|
|
171
171
|
var skeleton = require('./skeleton/src/skeleton.js');
|
|
172
172
|
var skeletonItem = require('./skeleton/src/skeleton-item.js');
|
|
173
|
-
var slider = require('./slider/src/
|
|
173
|
+
var slider = require('./slider/src/slider.js');
|
|
174
174
|
var constants$e = require('./slider/src/constants.js');
|
|
175
175
|
var space = require('./space/src/space.js');
|
|
176
176
|
var useSpace = require('./space/src/use-space.js');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var radio$1 = require('./src/
|
|
6
|
+
var radio$1 = require('./src/radio.js');
|
|
7
7
|
var radioButton$1 = require('./src/radio-button2.js');
|
|
8
8
|
var radioGroup$1 = require('./src/radio-group2.js');
|
|
9
|
-
var radio = require('./src/
|
|
9
|
+
var radio = require('./src/radio2.js');
|
|
10
10
|
var radioGroup = require('./src/radio-group.js');
|
|
11
11
|
var radioButton = require('./src/radio-button.js');
|
|
12
12
|
var constants = require('./src/constants.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
|
-
var radio = require('./
|
|
6
|
+
var radio = require('./radio2.js');
|
|
7
7
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
8
|
|
|
9
9
|
const radioButtonProps = runtime.buildProps({
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
6
|
require('../../../hooks/index.js');
|
|
7
|
-
var radio = require('./
|
|
7
|
+
var radio = require('./radio2.js');
|
|
8
8
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
9
|
var index = require('../../../hooks/use-size/index.js');
|
|
10
10
|
|
|
@@ -2,41 +2,82 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
require('../../../constants/index.js');
|
|
5
|
+
var vue = require('vue');
|
|
7
6
|
require('../../../hooks/index.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var types = require('../../../utils/types.js');
|
|
7
|
+
var radio = require('./radio2.js');
|
|
8
|
+
var useRadio = require('./use-radio.js');
|
|
9
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
11
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: {
|
|
18
|
-
type: [String, Number, Boolean],
|
|
19
|
-
default: ""
|
|
20
|
-
}
|
|
12
|
+
const _hoisted_1 = ["value", "name", "disabled"];
|
|
13
|
+
const __default__ = vue.defineComponent({
|
|
14
|
+
name: "ElRadio"
|
|
21
15
|
});
|
|
22
|
-
const
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: radio.radioProps,
|
|
19
|
+
emits: radio.radioEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const ns = index.useNamespace("radio");
|
|
23
|
+
const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio.useRadio(props, emit);
|
|
24
|
+
function handleChange() {
|
|
25
|
+
vue.nextTick(() => emit("change", modelValue.value));
|
|
26
|
+
}
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
var _a;
|
|
29
|
+
return vue.openBlock(), vue.createElementBlock("label", {
|
|
30
|
+
class: vue.normalizeClass([
|
|
31
|
+
vue.unref(ns).b(),
|
|
32
|
+
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
33
|
+
vue.unref(ns).is("focus", vue.unref(focus)),
|
|
34
|
+
vue.unref(ns).is("bordered", _ctx.border),
|
|
35
|
+
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
|
|
36
|
+
vue.unref(ns).m(vue.unref(size))
|
|
37
|
+
])
|
|
38
|
+
}, [
|
|
39
|
+
vue.createElementVNode("span", {
|
|
40
|
+
class: vue.normalizeClass([
|
|
41
|
+
vue.unref(ns).e("input"),
|
|
42
|
+
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
43
|
+
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
|
|
44
|
+
])
|
|
45
|
+
}, [
|
|
46
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
47
|
+
ref_key: "radioRef",
|
|
48
|
+
ref: radioRef,
|
|
49
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
|
|
50
|
+
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
51
|
+
value: _ctx.label,
|
|
52
|
+
name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
|
|
53
|
+
disabled: vue.unref(disabled),
|
|
54
|
+
type: "radio",
|
|
55
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
|
|
56
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
|
|
57
|
+
onChange: handleChange,
|
|
58
|
+
onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
59
|
+
}, ["stop"]))
|
|
60
|
+
}, null, 42, _hoisted_1), [
|
|
61
|
+
[vue.vModelRadio, vue.unref(modelValue)]
|
|
62
|
+
]),
|
|
63
|
+
vue.createElementVNode("span", {
|
|
64
|
+
class: vue.normalizeClass(vue.unref(ns).e("inner"))
|
|
65
|
+
}, null, 2)
|
|
66
|
+
], 2),
|
|
67
|
+
vue.createElementVNode("span", {
|
|
68
|
+
class: vue.normalizeClass(vue.unref(ns).e("label")),
|
|
69
|
+
onKeydown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
70
|
+
}, ["stop"]))
|
|
71
|
+
}, [
|
|
72
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
73
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
74
|
+
])
|
|
75
|
+
], 34)
|
|
76
|
+
], 2);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
33
79
|
});
|
|
34
|
-
|
|
35
|
-
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val),
|
|
36
|
-
[event.CHANGE_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val)
|
|
37
|
-
};
|
|
80
|
+
var Radio = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "radio.vue"]]);
|
|
38
81
|
|
|
39
|
-
exports
|
|
40
|
-
exports.radioProps = radioProps;
|
|
41
|
-
exports.radioPropsBase = radioPropsBase;
|
|
82
|
+
exports["default"] = Radio;
|
|
42
83
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../../../../packages/components/radio/src/radio.
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<template>\n <label\n :class=\"[\n ns.b(),\n ns.is('disabled', disabled),\n ns.is('focus', focus),\n ns.is('bordered', border),\n ns.is('checked', modelValue === label),\n ns.m(size),\n ]\"\n >\n <span\n :class=\"[\n ns.e('input'),\n ns.is('disabled', disabled),\n ns.is('checked', modelValue === label),\n ]\"\n >\n <input\n ref=\"radioRef\"\n v-model=\"modelValue\"\n :class=\"ns.e('original')\"\n :value=\"label\"\n :name=\"name || radioGroup?.name\"\n :disabled=\"disabled\"\n type=\"radio\"\n @focus=\"focus = true\"\n @blur=\"focus = false\"\n @change=\"handleChange\"\n @click.stop\n />\n <span :class=\"ns.e('inner')\" />\n </span>\n <span :class=\"ns.e('label')\" @keydown.stop>\n <slot>\n {{ label }}\n </slot>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\" setup>\nimport { nextTick } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { radioEmits, radioProps } from './radio'\nimport { useRadio } from './use-radio'\n\ndefineOptions({\n name: 'ElRadio',\n})\n\nconst props = defineProps(radioProps)\nconst emit = defineEmits(radioEmits)\n\nconst ns = useNamespace('radio')\nconst { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(\n props,\n emit\n)\n\nfunction handleChange() {\n nextTick(() => emit('change', modelValue.value))\n}\n</script>\n"],"names":["useNamespace","useRadio","nextTick"],"mappings":";;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA,EAAE,UAAU,UAAY,EAAA,KAAA,EAAO,MAAM,QAAU,EAAA,UAAA,EAAA,GAAeC,iBAClE,CAAA,KAAA,EACA,IACF,CAAA,CAAA;AAEA,IAAwB,SAAA,YAAA,GAAA;AACtB,MAAAC,YAAA,CAAS,MAAM,IAAA,CAAK,QAAU,EAAA,UAAA,CAAW,KAAK,CAAC,CAAA,CAAA;AAAA,KACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,82 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
require('../../../constants/index.js');
|
|
6
7
|
require('../../../hooks/index.js');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
|
+
var index = require('../../../hooks/use-size/index.js');
|
|
10
|
+
var event = require('../../../constants/event.js');
|
|
11
|
+
var shared = require('@vue/shared');
|
|
12
|
+
var types = require('../../../utils/types.js');
|
|
11
13
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
props: radio.radioProps,
|
|
19
|
-
emits: radio.radioEmits,
|
|
20
|
-
setup(__props, { emit }) {
|
|
21
|
-
const props = __props;
|
|
22
|
-
const ns = index.useNamespace("radio");
|
|
23
|
-
const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio.useRadio(props, emit);
|
|
24
|
-
function handleChange() {
|
|
25
|
-
vue.nextTick(() => emit("change", modelValue.value));
|
|
26
|
-
}
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return vue.openBlock(), vue.createElementBlock("label", {
|
|
30
|
-
class: vue.normalizeClass([
|
|
31
|
-
vue.unref(ns).b(),
|
|
32
|
-
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
33
|
-
vue.unref(ns).is("focus", vue.unref(focus)),
|
|
34
|
-
vue.unref(ns).is("bordered", _ctx.border),
|
|
35
|
-
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
|
|
36
|
-
vue.unref(ns).m(vue.unref(size))
|
|
37
|
-
])
|
|
38
|
-
}, [
|
|
39
|
-
vue.createElementVNode("span", {
|
|
40
|
-
class: vue.normalizeClass([
|
|
41
|
-
vue.unref(ns).e("input"),
|
|
42
|
-
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
43
|
-
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
|
|
44
|
-
])
|
|
45
|
-
}, [
|
|
46
|
-
vue.withDirectives(vue.createElementVNode("input", {
|
|
47
|
-
ref_key: "radioRef",
|
|
48
|
-
ref: radioRef,
|
|
49
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
|
|
50
|
-
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
51
|
-
value: _ctx.label,
|
|
52
|
-
name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
|
|
53
|
-
disabled: vue.unref(disabled),
|
|
54
|
-
type: "radio",
|
|
55
|
-
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
|
|
56
|
-
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
|
|
57
|
-
onChange: handleChange,
|
|
58
|
-
onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
59
|
-
}, ["stop"]))
|
|
60
|
-
}, null, 42, _hoisted_1), [
|
|
61
|
-
[vue.vModelRadio, vue.unref(modelValue)]
|
|
62
|
-
]),
|
|
63
|
-
vue.createElementVNode("span", {
|
|
64
|
-
class: vue.normalizeClass(vue.unref(ns).e("inner"))
|
|
65
|
-
}, null, 2)
|
|
66
|
-
], 2),
|
|
67
|
-
vue.createElementVNode("span", {
|
|
68
|
-
class: vue.normalizeClass(vue.unref(ns).e("label")),
|
|
69
|
-
onKeydown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
70
|
-
}, ["stop"]))
|
|
71
|
-
}, [
|
|
72
|
-
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
73
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
74
|
-
])
|
|
75
|
-
], 34)
|
|
76
|
-
], 2);
|
|
77
|
-
};
|
|
14
|
+
const radioPropsBase = runtime.buildProps({
|
|
15
|
+
size: index.useSizeProp,
|
|
16
|
+
disabled: Boolean,
|
|
17
|
+
label: {
|
|
18
|
+
type: [String, Number, Boolean],
|
|
19
|
+
default: ""
|
|
78
20
|
}
|
|
79
21
|
});
|
|
80
|
-
|
|
22
|
+
const radioProps = runtime.buildProps({
|
|
23
|
+
...radioPropsBase,
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: [String, Number, Boolean],
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
},
|
|
32
|
+
border: Boolean
|
|
33
|
+
});
|
|
34
|
+
const radioEmits = {
|
|
35
|
+
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val),
|
|
36
|
+
[event.CHANGE_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val)
|
|
37
|
+
};
|
|
81
38
|
|
|
82
|
-
exports
|
|
39
|
+
exports.radioEmits = radioEmits;
|
|
40
|
+
exports.radioProps = radioProps;
|
|
41
|
+
exports.radioPropsBase = radioPropsBase;
|
|
83
42
|
//# sourceMappingURL=radio2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio2.js","sources":["../../../../../../packages/components/radio/src/radio.
|
|
1
|
+
{"version":3,"file":"radio2.js","sources":["../../../../../../packages/components/radio/src/radio.ts"],"sourcesContent":["import { buildProps, isBoolean, isNumber, isString } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type { ExtractPropTypes } from 'vue'\nimport type Radio from './radio.vue'\n\nexport const radioPropsBase = buildProps({\n /**\n * @description size of the Radio\n */\n size: useSizeProp,\n /**\n * @description whether Radio is disabled\n */\n disabled: Boolean,\n /**\n * @description the value of Radio\n */\n label: {\n type: [String, Number, Boolean],\n default: '',\n },\n})\n\nexport const radioProps = buildProps({\n ...radioPropsBase,\n /**\n * @description binding value\n */\n modelValue: {\n type: [String, Number, Boolean],\n default: '',\n },\n /**\n * @description native `name` attribute\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to add a border around Radio\n */\n border: Boolean,\n} as const)\n\nexport const radioEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type RadioProps = ExtractPropTypes<typeof radioProps>\nexport type RadioEmits = typeof radioEmits\nexport type RadioInstance = InstanceType<typeof Radio>\n"],"names":["buildProps","useSizeProp","UPDATE_MODEL_EVENT","isString","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;;AAGY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAGD,kBAAU,CAAC;AACrC,EAAE,GAAG,cAAc;AACnB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,CAACE,wBAAkB,GAAG,CAAC,GAAG,KAAKC,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAACC,kBAAY,GAAG,CAAC,GAAG,KAAKH,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AAC3E;;;;;;"}
|