@element-plus/nightly 0.0.20231010 → 0.0.20231011
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +157 -46
- package/dist/index.full.min.js +24 -24
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +25 -25
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +157 -46
- 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/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/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/carousel/index.d.ts +5 -0
- package/es/components/carousel/src/carousel.vue.d.ts +5 -0
- package/es/components/carousel/src/carousel2.mjs +7 -2
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +6 -0
- package/es/components/carousel/src/use-carousel.mjs +33 -1
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/checkbox/index.d.ts +12 -0
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
- package/es/components/checkbox/src/checkbox.d.ts +1 -0
- package/es/components/checkbox/src/checkbox.mjs +2 -1
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +4 -0
- package/es/components/checkbox/src/composables/use-checkbox-status.mjs +2 -2
- package/es/components/checkbox/src/composables/use-checkbox-status.mjs.map +1 -1
- package/es/components/color-picker/index.d.ts +18 -1
- package/es/components/color-picker/src/color-picker.d.ts +2 -0
- package/es/components/color-picker/src/color-picker.mjs +3 -1
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +18 -1
- package/es/components/color-picker/src/color-picker2.mjs +83 -11
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/descriptions/src/description-item.mjs.map +1 -1
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/table/src/table.mjs +2 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/transfer/index.d.ts +40 -0
- package/es/components/transfer/src/transfer-panel.vue.d.ts +8 -0
- package/es/components/transfer/src/transfer.vue.d.ts +40 -0
- package/es/components/tree-v2/index.d.ts +8 -0
- package/es/components/tree-v2/src/tree-node.vue.d.ts +8 -0
- package/es/components/tree-v2/src/tree.vue.d.ts +8 -0
- package/es/hooks/use-focus-controller/index.d.ts +6 -1
- package/es/hooks/use-focus-controller/index.mjs +5 -2
- package/es/hooks/use-focus-controller/index.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/carousel/index.d.ts +5 -0
- package/lib/components/carousel/src/carousel.vue.d.ts +5 -0
- package/lib/components/carousel/src/carousel2.js +7 -2
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +6 -0
- package/lib/components/carousel/src/use-carousel.js +32 -0
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +12 -0
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
- package/lib/components/checkbox/src/checkbox.d.ts +1 -0
- package/lib/components/checkbox/src/checkbox.js +2 -1
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +4 -0
- package/lib/components/checkbox/src/composables/use-checkbox-status.js +1 -1
- package/lib/components/checkbox/src/composables/use-checkbox-status.js.map +1 -1
- package/lib/components/color-picker/index.d.ts +18 -1
- package/lib/components/color-picker/src/color-picker.d.ts +2 -0
- package/lib/components/color-picker/src/color-picker.js +3 -1
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +18 -1
- package/lib/components/color-picker/src/color-picker2.js +93 -21
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/descriptions/src/description-item.js.map +1 -1
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/table/src/table.js +2 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/transfer/index.d.ts +40 -0
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +8 -0
- package/lib/components/transfer/src/transfer.vue.d.ts +40 -0
- package/lib/components/tree-v2/index.d.ts +8 -0
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +8 -0
- package/lib/components/tree-v2/src/tree.vue.d.ts +8 -0
- package/lib/hooks/use-focus-controller/index.d.ts +6 -1
- package/lib/hooks/use-focus-controller/index.js +5 -2
- package/lib/hooks/use-focus-controller/index.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/tags.json +1 -1
- package/theme-chalk/el-color-picker.css +1 -1
- package/theme-chalk/el-table-v2.css +1 -1
- package/theme-chalk/el-table.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/color-picker.scss +8 -2
- package/theme-chalk/src/common/var.scss +1 -0
- package/theme-chalk/src/table.scss +16 -9
- package/web-types.json +1 -1
|
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
};
|
|
7
7
|
label: {
|
|
8
8
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
9
|
+
default: undefined;
|
|
9
10
|
};
|
|
10
11
|
indeterminate: BooleanConstructor;
|
|
11
12
|
disabled: BooleanConstructor;
|
|
@@ -50,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
51
|
};
|
|
51
52
|
label: {
|
|
52
53
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
54
|
+
default: undefined;
|
|
53
55
|
};
|
|
54
56
|
indeterminate: BooleanConstructor;
|
|
55
57
|
disabled: BooleanConstructor;
|
|
@@ -133,6 +135,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
135
|
};
|
|
134
136
|
label: {
|
|
135
137
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
138
|
+
default: undefined;
|
|
136
139
|
};
|
|
137
140
|
indeterminate: BooleanConstructor;
|
|
138
141
|
disabled: BooleanConstructor;
|
|
@@ -174,6 +177,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
174
177
|
"onUpdate:modelValue"?: ((val: import("./checkbox").CheckboxValueType) => any) | undefined;
|
|
175
178
|
}, {
|
|
176
179
|
modelValue: string | number | boolean;
|
|
180
|
+
label: string | number | boolean | Record<string, any>;
|
|
177
181
|
id: string;
|
|
178
182
|
disabled: boolean;
|
|
179
183
|
name: string;
|
|
@@ -14,6 +14,7 @@ export declare const checkboxProps: {
|
|
|
14
14
|
*/
|
|
15
15
|
label: {
|
|
16
16
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
17
|
+
default: undefined;
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* @description Set indeterminate state, only responsible for style control
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.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 },\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,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;;;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox.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;;;;;"}
|
|
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
};
|
|
6
6
|
label: {
|
|
7
7
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
8
|
+
default: undefined;
|
|
8
9
|
};
|
|
9
10
|
indeterminate: BooleanConstructor;
|
|
10
11
|
disabled: BooleanConstructor;
|
|
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
50
|
};
|
|
50
51
|
label: {
|
|
51
52
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
53
|
+
default: undefined;
|
|
52
54
|
};
|
|
53
55
|
indeterminate: BooleanConstructor;
|
|
54
56
|
disabled: BooleanConstructor;
|
|
@@ -132,6 +134,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
132
134
|
};
|
|
133
135
|
label: {
|
|
134
136
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
137
|
+
default: undefined;
|
|
135
138
|
};
|
|
136
139
|
indeterminate: BooleanConstructor;
|
|
137
140
|
disabled: BooleanConstructor;
|
|
@@ -173,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
173
176
|
"onUpdate:modelValue"?: ((val: import("./checkbox").CheckboxValueType) => any) | undefined;
|
|
174
177
|
}, {
|
|
175
178
|
modelValue: string | number | boolean;
|
|
179
|
+
label: string | number | boolean | Record<string, any>;
|
|
176
180
|
id: string;
|
|
177
181
|
disabled: boolean;
|
|
178
182
|
name: string;
|
|
@@ -41,7 +41,7 @@ const useCheckboxStatus = (props, slots, { model }) => {
|
|
|
41
41
|
return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
|
|
42
42
|
}));
|
|
43
43
|
const hasOwnLabel = vue.computed(() => {
|
|
44
|
-
return !!
|
|
44
|
+
return !!slots.default || !lodashUnified.isNil(props.label);
|
|
45
45
|
});
|
|
46
46
|
return {
|
|
47
47
|
checkboxButtonSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkbox-status.js","sources":["../../../../../../../packages/components/checkbox/src/composables/use-checkbox-status.ts"],"sourcesContent":["import { computed, inject, ref, toRaw } from 'vue'\nimport { isEqual } from 'lodash-unified'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isArray, isBoolean, isObject } from '@element-plus/utils'\nimport { checkboxGroupContextKey } from '../constants'\n\nimport type { ComponentInternalInstance } from 'vue'\nimport type { CheckboxProps } from '../checkbox'\nimport type { CheckboxModel } from '../composables'\n\nexport const useCheckboxStatus = (\n props: CheckboxProps,\n slots: ComponentInternalInstance['slots'],\n { model }: Pick<CheckboxModel, 'model'>\n) => {\n const checkboxGroup = inject(checkboxGroupContextKey, undefined)\n const isFocused = ref(false)\n const isChecked = computed<boolean>(() => {\n const value = model.value\n if (isBoolean(value)) {\n return value\n } else if (isArray(value)) {\n if (isObject(props.label)) {\n return value.map(toRaw).some((o) => isEqual(o, props.label))\n } else {\n return value.map(toRaw).includes(props.label)\n }\n } else if (value !== null && value !== undefined) {\n return value === props.trueLabel\n } else {\n return !!value\n }\n })\n\n const checkboxButtonSize = useFormSize(\n computed(() => checkboxGroup?.size?.value),\n {\n prop: true,\n }\n )\n const checkboxSize = useFormSize(computed(() => checkboxGroup?.size?.value))\n\n const hasOwnLabel = computed<boolean>(() => {\n return !!
|
|
1
|
+
{"version":3,"file":"use-checkbox-status.js","sources":["../../../../../../../packages/components/checkbox/src/composables/use-checkbox-status.ts"],"sourcesContent":["import { computed, inject, ref, toRaw } from 'vue'\nimport { isEqual, isNil } from 'lodash-unified'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isArray, isBoolean, isObject } from '@element-plus/utils'\nimport { checkboxGroupContextKey } from '../constants'\n\nimport type { ComponentInternalInstance } from 'vue'\nimport type { CheckboxProps } from '../checkbox'\nimport type { CheckboxModel } from '../composables'\n\nexport const useCheckboxStatus = (\n props: CheckboxProps,\n slots: ComponentInternalInstance['slots'],\n { model }: Pick<CheckboxModel, 'model'>\n) => {\n const checkboxGroup = inject(checkboxGroupContextKey, undefined)\n const isFocused = ref(false)\n const isChecked = computed<boolean>(() => {\n const value = model.value\n if (isBoolean(value)) {\n return value\n } else if (isArray(value)) {\n if (isObject(props.label)) {\n return value.map(toRaw).some((o) => isEqual(o, props.label))\n } else {\n return value.map(toRaw).includes(props.label)\n }\n } else if (value !== null && value !== undefined) {\n return value === props.trueLabel\n } else {\n return !!value\n }\n })\n\n const checkboxButtonSize = useFormSize(\n computed(() => checkboxGroup?.size?.value),\n {\n prop: true,\n }\n )\n const checkboxSize = useFormSize(computed(() => checkboxGroup?.size?.value))\n\n const hasOwnLabel = computed<boolean>(() => {\n return !!slots.default || !isNil(props.label)\n })\n\n return {\n checkboxButtonSize,\n isChecked,\n isFocused,\n checkboxSize,\n hasOwnLabel,\n }\n}\n\nexport type CheckboxStatus = ReturnType<typeof useCheckboxStatus>\n"],"names":["inject","checkboxGroupContextKey","ref","computed","isBoolean","isArray","isObject","toRaw","isEqual","useFormSize","isNil"],"mappings":";;;;;;;;;;;;;AAKY,MAAC,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK;AAC9D,EAAE,MAAM,aAAa,GAAGA,UAAM,CAACC,iCAAuB,EAAE,KAAK,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,SAAS,GAAGC,OAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,MAAM,SAAS,GAAGC,YAAQ,CAAC,MAAM;AACnC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAC9B,IAAI,IAAIC,eAAS,CAAC,KAAK,CAAC,EAAE;AAC1B,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK,MAAM,IAAIC,cAAO,CAAC,KAAK,CAAC,EAAE;AAC/B,MAAM,IAAIC,eAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,OAAO,KAAK,CAAC,GAAG,CAACC,SAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAKC,qBAAO,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,OAAO,MAAM;AACb,QAAQ,OAAO,KAAK,CAAC,GA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 -46,9 +46,11 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
|
|
|
46
46
|
}>> & {
|
|
47
47
|
onChange?: ((val: string | null) => any) | undefined;
|
|
48
48
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
49
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
50
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
49
51
|
onActiveChange?: ((val: string | null) => any) | undefined;
|
|
50
52
|
}>>;
|
|
51
|
-
emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "activeChange", val: string | null) => void);
|
|
53
|
+
emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "blur", event: FocusEvent) => void) & ((event: "activeChange", val: string | null) => void);
|
|
52
54
|
t: import("../..").Translator;
|
|
53
55
|
ns: {
|
|
54
56
|
namespace: import("vue").ComputedRef<string>;
|
|
@@ -6644,6 +6646,12 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
|
|
|
6644
6646
|
readonly disabled: boolean;
|
|
6645
6647
|
}>;
|
|
6646
6648
|
}> & {} & import("vue").ComponentCustomProperties) | undefined>;
|
|
6649
|
+
triggerRef: import("vue").Ref<any>;
|
|
6650
|
+
inputRef: import("vue").Ref<any>;
|
|
6651
|
+
isFocused: import("vue").Ref<boolean>;
|
|
6652
|
+
_handleFocus: (event: FocusEvent) => void;
|
|
6653
|
+
handleBlur: (event: FocusEvent) => void;
|
|
6654
|
+
handleFocus: (event: FocusEvent) => void;
|
|
6647
6655
|
shouldActiveChange: boolean;
|
|
6648
6656
|
color: import("./src/utils/color").default;
|
|
6649
6657
|
showPicker: import("vue").Ref<boolean>;
|
|
@@ -6664,6 +6672,11 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
|
|
|
6664
6672
|
handleConfirm: () => void;
|
|
6665
6673
|
confirmValue: () => void;
|
|
6666
6674
|
clear: () => void;
|
|
6675
|
+
handleClickOutside: (event: Event) => void;
|
|
6676
|
+
handleEsc: (event: KeyboardEvent) => void;
|
|
6677
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
6678
|
+
focus: () => void;
|
|
6679
|
+
blur: () => void;
|
|
6667
6680
|
ElButton: import("@element-plus/nightly/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
6668
6681
|
readonly size: {
|
|
6669
6682
|
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
@@ -10834,6 +10847,8 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
|
|
|
10834
10847
|
"update:modelValue": (val: string | null) => boolean;
|
|
10835
10848
|
change: (val: string | null) => boolean;
|
|
10836
10849
|
activeChange: (val: string | null) => boolean;
|
|
10850
|
+
focus: (event: FocusEvent) => boolean;
|
|
10851
|
+
blur: (event: FocusEvent) => boolean;
|
|
10837
10852
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10838
10853
|
readonly modelValue: StringConstructor;
|
|
10839
10854
|
readonly id: StringConstructor;
|
|
@@ -10859,6 +10874,8 @@ export declare const ElColorPicker: import("@element-plus/nightly/es/utils").SFC
|
|
|
10859
10874
|
}>> & {
|
|
10860
10875
|
onChange?: ((val: string | null) => any) | undefined;
|
|
10861
10876
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
10877
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
10878
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
10862
10879
|
onActiveChange?: ((val: string | null) => any) | undefined;
|
|
10863
10880
|
}, {
|
|
10864
10881
|
readonly popperClass: string;
|
|
@@ -27,6 +27,8 @@ export declare const colorPickerEmits: {
|
|
|
27
27
|
"update:modelValue": (val: string | null) => boolean;
|
|
28
28
|
change: (val: string | null) => boolean;
|
|
29
29
|
activeChange: (val: string | null) => boolean;
|
|
30
|
+
focus: (event: FocusEvent) => boolean;
|
|
31
|
+
blur: (event: FocusEvent) => boolean;
|
|
30
32
|
};
|
|
31
33
|
export declare type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>;
|
|
32
34
|
export declare type ColorPickerEmits = typeof colorPickerEmits;
|
|
@@ -41,7 +41,9 @@ const colorPickerProps = runtime.buildProps({
|
|
|
41
41
|
const colorPickerEmits = {
|
|
42
42
|
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
|
|
43
43
|
[event.CHANGE_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
|
|
44
|
-
activeChange: (val) => shared.isString(val) || lodashUnified.isNil(val)
|
|
44
|
+
activeChange: (val) => shared.isString(val) || lodashUnified.isNil(val),
|
|
45
|
+
focus: (event) => event instanceof FocusEvent,
|
|
46
|
+
blur: (event) => event instanceof FocusEvent
|
|
45
47
|
};
|
|
46
48
|
const colorPickerContextKey = Symbol("colorPickerContextKey");
|
|
47
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.js","sources":["../../../../../../packages/components/color-picker/src/color-picker.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { buildProps, definePropType, isString } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'\nimport type ColorPicker from './color-picker.vue'\n\nexport const colorPickerProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description ColorPicker id\n */\n id: String,\n /**\n * @description whether to display the alpha slider\n */\n showAlpha: Boolean,\n /**\n * @description color format of v-model\n */\n colorFormat: String,\n /**\n * @description whether to disable the ColorPicker\n */\n disabled: Boolean,\n /**\n * @description size of ColorPicker\n */\n size: useSizeProp,\n /**\n * @description custom class name for ColorPicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description ColorPicker aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description ColorPicker tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description predefined color options\n */\n predefine: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport const colorPickerEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | null) => isString(val) || isNil(val),\n [CHANGE_EVENT]: (val: string | null) => isString(val) || isNil(val),\n activeChange: (val: string | null) => isString(val) || isNil(val),\n}\n\nexport type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>\nexport type ColorPickerEmits = typeof colorPickerEmits\nexport type ColorPickerInstance = InstanceType<typeof ColorPicker>\n\nexport interface ColorPickerContext {\n currentColor: ComputedRef<string>\n}\n\nexport const colorPickerContextKey: InjectionKey<ColorPickerContext> = Symbol(\n 'colorPickerContextKey'\n)\n"],"names":["buildProps","useSizeProp","definePropType","UPDATE_MODEL_EVENT","isString","isNil","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;;AAIY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAACC,wBAAkB,GAAG,CAAC,GAAG,KAAKC,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AAC5D,EAAE,CAACC,kBAAY,GAAG,CAAC,GAAG,KAAKF,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AACtD,EAAE,YAAY,EAAE,CAAC,GAAG,KAAKD,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AACpD,EAAE;AACU,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB;;;;;;"}
|
|
1
|
+
{"version":3,"file":"color-picker.js","sources":["../../../../../../packages/components/color-picker/src/color-picker.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { buildProps, definePropType, isString } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'\nimport type ColorPicker from './color-picker.vue'\n\nexport const colorPickerProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description ColorPicker id\n */\n id: String,\n /**\n * @description whether to display the alpha slider\n */\n showAlpha: Boolean,\n /**\n * @description color format of v-model\n */\n colorFormat: String,\n /**\n * @description whether to disable the ColorPicker\n */\n disabled: Boolean,\n /**\n * @description size of ColorPicker\n */\n size: useSizeProp,\n /**\n * @description custom class name for ColorPicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description ColorPicker aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description ColorPicker tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description predefined color options\n */\n predefine: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport const colorPickerEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | null) => isString(val) || isNil(val),\n [CHANGE_EVENT]: (val: string | null) => isString(val) || isNil(val),\n activeChange: (val: string | null) => isString(val) || isNil(val),\n focus: (event: FocusEvent) => event instanceof FocusEvent,\n blur: (event: FocusEvent) => event instanceof FocusEvent,\n}\n\nexport type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>\nexport type ColorPickerEmits = typeof colorPickerEmits\nexport type ColorPickerInstance = InstanceType<typeof ColorPicker>\n\nexport interface ColorPickerContext {\n currentColor: ComputedRef<string>\n}\n\nexport const colorPickerContextKey: InjectionKey<ColorPickerContext> = Symbol(\n 'colorPickerContextKey'\n)\n"],"names":["buildProps","useSizeProp","definePropType","UPDATE_MODEL_EVENT","isString","isNil","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;;AAIY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAACC,wBAAkB,GAAG,CAAC,GAAG,KAAKC,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AAC5D,EAAE,CAACC,kBAAY,GAAG,CAAC,GAAG,KAAKF,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AACtD,EAAE,YAAY,EAAE,CAAC,GAAG,KAAKD,eAAQ,CAAC,GAAG,CAAC,IAAIC,mBAAK,CAAC,GAAG,CAAC;AACpD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,KAAK,YAAY,UAAU;AAC/C,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,YAAY,UAAU;AAC9C,EAAE;AACU,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB;;;;;;"}
|
|
@@ -48,9 +48,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
48
|
}>> & {
|
|
49
49
|
onChange?: ((val: string | null) => any) | undefined;
|
|
50
50
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
51
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
52
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
51
53
|
onActiveChange?: ((val: string | null) => any) | undefined;
|
|
52
54
|
}>>;
|
|
53
|
-
emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "activeChange", val: string | null) => void);
|
|
55
|
+
emit: ((event: "update:modelValue", val: string | null) => void) & ((event: "change", val: string | null) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "blur", event: FocusEvent) => void) & ((event: "activeChange", val: string | null) => void);
|
|
54
56
|
t: import("@element-plus/nightly/es/hooks").Translator;
|
|
55
57
|
ns: {
|
|
56
58
|
namespace: import("vue").ComputedRef<string>;
|
|
@@ -6646,6 +6648,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6646
6648
|
readonly disabled: boolean;
|
|
6647
6649
|
}>;
|
|
6648
6650
|
}> & {} & import("vue").ComponentCustomProperties) | undefined>;
|
|
6651
|
+
triggerRef: import("vue").Ref<any>;
|
|
6652
|
+
inputRef: import("vue").Ref<any>;
|
|
6653
|
+
isFocused: import("vue").Ref<boolean>;
|
|
6654
|
+
_handleFocus: (event: FocusEvent) => void;
|
|
6655
|
+
handleBlur: (event: FocusEvent) => void;
|
|
6656
|
+
handleFocus: (event: FocusEvent) => void;
|
|
6649
6657
|
shouldActiveChange: boolean;
|
|
6650
6658
|
color: Color;
|
|
6651
6659
|
showPicker: import("vue").Ref<boolean>;
|
|
@@ -6666,6 +6674,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6666
6674
|
handleConfirm: () => void;
|
|
6667
6675
|
confirmValue: () => void;
|
|
6668
6676
|
clear: () => void;
|
|
6677
|
+
handleClickOutside: (event: Event) => void;
|
|
6678
|
+
handleEsc: (event: KeyboardEvent) => void;
|
|
6679
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
6680
|
+
focus: () => void;
|
|
6681
|
+
blur: () => void;
|
|
6669
6682
|
ElButton: import("@element-plus/nightly/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
6670
6683
|
readonly size: {
|
|
6671
6684
|
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
@@ -10836,6 +10849,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10836
10849
|
"update:modelValue": (val: string | null) => boolean;
|
|
10837
10850
|
change: (val: string | null) => boolean;
|
|
10838
10851
|
activeChange: (val: string | null) => boolean;
|
|
10852
|
+
focus: (event: FocusEvent) => boolean;
|
|
10853
|
+
blur: (event: FocusEvent) => boolean;
|
|
10839
10854
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10840
10855
|
readonly modelValue: StringConstructor;
|
|
10841
10856
|
readonly id: StringConstructor;
|
|
@@ -10861,6 +10876,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10861
10876
|
}>> & {
|
|
10862
10877
|
onChange?: ((val: string | null) => any) | undefined;
|
|
10863
10878
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
10879
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
10880
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
10864
10881
|
onActiveChange?: ((val: string | null) => any) | undefined;
|
|
10865
10882
|
}, {
|
|
10866
10883
|
readonly popperClass: string;
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var lodashUnified = require('lodash-unified');
|
|
7
|
-
var index$
|
|
8
|
-
var index$
|
|
7
|
+
var index$5 = require('../../button/index.js');
|
|
8
|
+
var index$7 = require('../../icon/index.js');
|
|
9
9
|
require('../../../directives/index.js');
|
|
10
|
-
var index$
|
|
11
|
-
var index$
|
|
10
|
+
var index$3 = require('../../tooltip/index.js');
|
|
11
|
+
var index$4 = require('../../input/index.js');
|
|
12
12
|
require('../../form/index.js');
|
|
13
13
|
require('../../../hooks/index.js');
|
|
14
14
|
require('../../../constants/index.js');
|
|
@@ -25,11 +25,14 @@ var index = require('../../../hooks/use-locale/index.js');
|
|
|
25
25
|
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
26
26
|
var useFormItem = require('../../form/src/hooks/use-form-item.js');
|
|
27
27
|
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
|
|
28
|
+
var index$2 = require('../../../hooks/use-focus-controller/index.js');
|
|
28
29
|
var event = require('../../../constants/event.js');
|
|
29
30
|
var error = require('../../../utils/error.js');
|
|
30
|
-
var
|
|
31
|
+
var aria = require('../../../constants/aria.js');
|
|
32
|
+
var index$6 = require('../../../directives/click-outside/index.js');
|
|
31
33
|
|
|
32
|
-
const _hoisted_1 = ["
|
|
34
|
+
const _hoisted_1 = ["onKeydown"];
|
|
35
|
+
const _hoisted_2 = ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex"];
|
|
33
36
|
const __default__ = vue.defineComponent({
|
|
34
37
|
name: "ElColorPicker"
|
|
35
38
|
});
|
|
@@ -51,6 +54,27 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
54
|
const sv = vue.ref();
|
|
52
55
|
const alpha = vue.ref();
|
|
53
56
|
const popper = vue.ref();
|
|
57
|
+
const triggerRef = vue.ref();
|
|
58
|
+
const inputRef = vue.ref();
|
|
59
|
+
const {
|
|
60
|
+
isFocused,
|
|
61
|
+
handleFocus: _handleFocus,
|
|
62
|
+
handleBlur
|
|
63
|
+
} = index$2.useFocusController(triggerRef, {
|
|
64
|
+
beforeBlur(event) {
|
|
65
|
+
var _a;
|
|
66
|
+
return (_a = popper.value) == null ? void 0 : _a.isFocusInsideContent(event);
|
|
67
|
+
},
|
|
68
|
+
afterBlur() {
|
|
69
|
+
setShowPicker(false);
|
|
70
|
+
resetColor();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const handleFocus = (event) => {
|
|
74
|
+
if (colorDisabled.value)
|
|
75
|
+
return blur();
|
|
76
|
+
_handleFocus(event);
|
|
77
|
+
};
|
|
54
78
|
let shouldActiveChange = true;
|
|
55
79
|
const color$1 = vue.reactive(new color["default"]({
|
|
56
80
|
enableAlpha: props.showAlpha,
|
|
@@ -79,7 +103,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
103
|
return [
|
|
80
104
|
ns.b("picker"),
|
|
81
105
|
ns.is("disabled", colorDisabled.value),
|
|
82
|
-
ns.bm("picker", colorSize.value)
|
|
106
|
+
ns.bm("picker", colorSize.value),
|
|
107
|
+
ns.is("focused", isFocused.value)
|
|
83
108
|
];
|
|
84
109
|
});
|
|
85
110
|
function displayedRgb(color2, showAlpha) {
|
|
@@ -150,6 +175,41 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
150
175
|
}
|
|
151
176
|
resetColor();
|
|
152
177
|
}
|
|
178
|
+
function handleClickOutside(event) {
|
|
179
|
+
if (!showPicker.value)
|
|
180
|
+
return;
|
|
181
|
+
hide();
|
|
182
|
+
if (isFocused.value) {
|
|
183
|
+
const _event = new FocusEvent("focus", event);
|
|
184
|
+
handleBlur(_event);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function handleEsc(event) {
|
|
188
|
+
event.preventDefault();
|
|
189
|
+
event.stopPropagation();
|
|
190
|
+
setShowPicker(false);
|
|
191
|
+
resetColor();
|
|
192
|
+
}
|
|
193
|
+
function handleKeyDown(event) {
|
|
194
|
+
switch (event.code) {
|
|
195
|
+
case aria.EVENT_CODE.enter:
|
|
196
|
+
case aria.EVENT_CODE.space:
|
|
197
|
+
event.preventDefault();
|
|
198
|
+
event.stopPropagation();
|
|
199
|
+
show();
|
|
200
|
+
inputRef.value.focus();
|
|
201
|
+
break;
|
|
202
|
+
case aria.EVENT_CODE.esc:
|
|
203
|
+
handleEsc(event);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function focus() {
|
|
208
|
+
triggerRef.value.focus();
|
|
209
|
+
}
|
|
210
|
+
function blur() {
|
|
211
|
+
triggerRef.value.blur();
|
|
212
|
+
}
|
|
153
213
|
vue.onMounted(() => {
|
|
154
214
|
if (props.modelValue) {
|
|
155
215
|
customInput.value = currentColor.value;
|
|
@@ -187,10 +247,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
187
247
|
expose({
|
|
188
248
|
color: color$1,
|
|
189
249
|
show,
|
|
190
|
-
hide
|
|
250
|
+
hide,
|
|
251
|
+
focus,
|
|
252
|
+
blur
|
|
191
253
|
});
|
|
192
254
|
return (_ctx, _cache) => {
|
|
193
|
-
return vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
255
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$3.ElTooltip), {
|
|
194
256
|
ref_key: "popper",
|
|
195
257
|
ref: popper,
|
|
196
258
|
visible: showPicker.value,
|
|
@@ -203,10 +265,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
203
265
|
effect: "light",
|
|
204
266
|
trigger: "click",
|
|
205
267
|
transition: `${vue.unref(ns).namespace.value}-zoom-in-top`,
|
|
206
|
-
persistent: ""
|
|
268
|
+
persistent: "",
|
|
269
|
+
onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
|
|
207
270
|
}, {
|
|
208
271
|
content: vue.withCtx(() => [
|
|
209
|
-
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div",
|
|
272
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
273
|
+
onKeydown: vue.withKeys(handleEsc, ["esc"])
|
|
274
|
+
}, [
|
|
210
275
|
vue.createElementVNode("div", {
|
|
211
276
|
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "main-wrapper"))
|
|
212
277
|
}, [
|
|
@@ -241,7 +306,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
241
306
|
vue.createElementVNode("span", {
|
|
242
307
|
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "value"))
|
|
243
308
|
}, [
|
|
244
|
-
vue.createVNode(vue.unref(index$
|
|
309
|
+
vue.createVNode(vue.unref(index$4.ElInput), {
|
|
310
|
+
ref_key: "inputRef",
|
|
311
|
+
ref: inputRef,
|
|
245
312
|
modelValue: customInput.value,
|
|
246
313
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
|
|
247
314
|
"validate-event": false,
|
|
@@ -250,7 +317,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
250
317
|
onBlur: handleConfirm
|
|
251
318
|
}, null, 8, ["modelValue", "onKeyup"])
|
|
252
319
|
], 2),
|
|
253
|
-
vue.createVNode(vue.unref(index$
|
|
320
|
+
vue.createVNode(vue.unref(index$5.ElButton), {
|
|
254
321
|
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "link-btn")),
|
|
255
322
|
text: "",
|
|
256
323
|
size: "small",
|
|
@@ -261,7 +328,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
261
328
|
]),
|
|
262
329
|
_: 1
|
|
263
330
|
}, 8, ["class"]),
|
|
264
|
-
vue.createVNode(vue.unref(index$
|
|
331
|
+
vue.createVNode(vue.unref(index$5.ElButton), {
|
|
265
332
|
plain: "",
|
|
266
333
|
size: "small",
|
|
267
334
|
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "btn")),
|
|
@@ -273,20 +340,25 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
273
340
|
_: 1
|
|
274
341
|
}, 8, ["class"])
|
|
275
342
|
], 2)
|
|
276
|
-
])), [
|
|
277
|
-
[vue.unref(index$
|
|
343
|
+
], 40, _hoisted_1)), [
|
|
344
|
+
[vue.unref(index$6["default"]), handleClickOutside]
|
|
278
345
|
])
|
|
279
346
|
]),
|
|
280
347
|
default: vue.withCtx(() => [
|
|
281
348
|
vue.createElementVNode("div", {
|
|
282
349
|
id: vue.unref(buttonId),
|
|
350
|
+
ref_key: "triggerRef",
|
|
351
|
+
ref: triggerRef,
|
|
283
352
|
class: vue.normalizeClass(vue.unref(btnKls)),
|
|
284
353
|
role: "button",
|
|
285
354
|
"aria-label": vue.unref(buttonAriaLabel),
|
|
286
355
|
"aria-labelledby": vue.unref(buttonAriaLabelledby),
|
|
287
356
|
"aria-description": vue.unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
|
|
288
|
-
|
|
289
|
-
|
|
357
|
+
"aria-disabled": vue.unref(colorDisabled),
|
|
358
|
+
tabindex: vue.unref(colorDisabled) ? -1 : _ctx.tabindex,
|
|
359
|
+
onKeydown: handleKeyDown,
|
|
360
|
+
onFocus: handleFocus,
|
|
361
|
+
onBlur: _cache[1] || (_cache[1] = (...args) => vue.unref(handleBlur) && vue.unref(handleBlur)(...args))
|
|
290
362
|
}, [
|
|
291
363
|
vue.unref(colorDisabled) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
292
364
|
key: 0,
|
|
@@ -305,7 +377,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
305
377
|
backgroundColor: vue.unref(displayedColor)
|
|
306
378
|
})
|
|
307
379
|
}, [
|
|
308
|
-
vue.withDirectives(vue.createVNode(vue.unref(index$
|
|
380
|
+
vue.withDirectives(vue.createVNode(vue.unref(index$7.ElIcon), {
|
|
309
381
|
class: vue.normalizeClass([vue.unref(ns).be("picker", "icon"), vue.unref(ns).is("icon-arrow-down")])
|
|
310
382
|
}, {
|
|
311
383
|
default: vue.withCtx(() => [
|
|
@@ -315,7 +387,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
315
387
|
}, 8, ["class"]), [
|
|
316
388
|
[vue.vShow, _ctx.modelValue || showPanelColor.value]
|
|
317
389
|
]),
|
|
318
|
-
vue.withDirectives(vue.createVNode(vue.unref(index$
|
|
390
|
+
vue.withDirectives(vue.createVNode(vue.unref(index$7.ElIcon), {
|
|
319
391
|
class: vue.normalizeClass([vue.unref(ns).be("picker", "empty"), vue.unref(ns).is("icon-close")])
|
|
320
392
|
}, {
|
|
321
393
|
default: vue.withCtx(() => [
|
|
@@ -328,7 +400,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
328
400
|
], 6)
|
|
329
401
|
], 2)
|
|
330
402
|
], 2)
|
|
331
|
-
], 42,
|
|
403
|
+
], 42, _hoisted_2)
|
|
332
404
|
]),
|
|
333
405
|
_: 1
|
|
334
406
|
}, 8, ["visible", "popper-class", "transition"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker2.js","sources":["../../../../../../packages/components/color-picker/src/color-picker.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"popper\"\n :visible=\"showPicker\"\n :show-arrow=\"false\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :offset=\"0\"\n :gpu-acceleration=\"false\"\n :popper-class=\"[ns.be('picker', 'panel'), ns.b('dropdown'), popperClass]\"\n :stop-popper-mouse-event=\"false\"\n effect=\"light\"\n trigger=\"click\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n persistent\n >\n <template #content>\n <div v-click-outside=\"hide\">\n <div :class=\"ns.be('dropdown', 'main-wrapper')\">\n <hue-slider ref=\"hue\" class=\"hue-slider\" :color=\"color\" vertical />\n <sv-panel ref=\"sv\" :color=\"color\" />\n </div>\n <alpha-slider v-if=\"showAlpha\" ref=\"alpha\" :color=\"color\" />\n <predefine\n v-if=\"predefine\"\n ref=\"predefine\"\n :color=\"color\"\n :colors=\"predefine\"\n />\n <div :class=\"ns.be('dropdown', 'btns')\">\n <span :class=\"ns.be('dropdown', 'value')\">\n <el-input\n v-model=\"customInput\"\n :validate-event=\"false\"\n size=\"small\"\n @keyup.enter=\"handleConfirm\"\n @blur=\"handleConfirm\"\n />\n </span>\n <el-button\n :class=\"ns.be('dropdown', 'link-btn')\"\n text\n size=\"small\"\n @click=\"clear\"\n >\n {{ t('el.colorpicker.clear') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ns.be('dropdown', 'btn')\"\n @click=\"confirmValue\"\n >\n {{ t('el.colorpicker.confirm') }}\n </el-button>\n </div>\n </div>\n </template>\n <template #default>\n <div\n :id=\"buttonId\"\n :class=\"btnKls\"\n role=\"button\"\n :aria-label=\"buttonAriaLabel\"\n :aria-labelledby=\"buttonAriaLabelledby\"\n :aria-description=\"\n t('el.colorpicker.description', { color: modelValue || '' })\n \"\n :tabindex=\"tabindex\"\n @keydown.enter=\"handleTrigger\"\n >\n <div v-if=\"colorDisabled\" :class=\"ns.be('picker', 'mask')\" />\n <div :class=\"ns.be('picker', 'trigger')\" @click=\"handleTrigger\">\n <span :class=\"[ns.be('picker', 'color'), ns.is('alpha', showAlpha)]\">\n <span\n :class=\"ns.be('picker', 'color-inner')\"\n :style=\"{\n backgroundColor: displayedColor,\n }\"\n >\n <el-icon\n v-show=\"modelValue || showPanelColor\"\n :class=\"[ns.be('picker', 'icon'), ns.is('icon-arrow-down')]\"\n >\n <arrow-down />\n </el-icon>\n <el-icon\n v-show=\"!modelValue && !showPanelColor\"\n :class=\"[ns.be('picker', 'empty'), ns.is('icon-close')]\"\n >\n <close />\n </el-icon>\n </span>\n </span>\n </div>\n </div>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { ElInput } from '@element-plus/components/input'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { debugWarn } from '@element-plus/utils'\nimport { ArrowDown, Close } from '@element-plus/icons-vue'\nimport AlphaSlider from './components/alpha-slider.vue'\nimport HueSlider from './components/hue-slider.vue'\nimport Predefine from './components/predefine.vue'\nimport SvPanel from './components/sv-panel.vue'\nimport Color from './utils/color'\nimport {\n colorPickerContextKey,\n colorPickerEmits,\n colorPickerProps,\n} from './color-picker'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElColorPicker',\n})\nconst props = defineProps(colorPickerProps)\nconst emit = defineEmits(colorPickerEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('color')\nconst { formItem } = useFormItem()\nconst colorSize = useFormSize()\nconst colorDisabled = useFormDisabled()\n\nconst { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst hue = ref<InstanceType<typeof HueSlider>>()\nconst sv = ref<InstanceType<typeof SvPanel>>()\nconst alpha = ref<InstanceType<typeof AlphaSlider>>()\nconst popper = ref<TooltipInstance>()\n\n// active-change is used to prevent modelValue changes from triggering.\nlet shouldActiveChange = true\n\nconst color = reactive(\n new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n) as Color\n\nconst showPicker = ref(false)\nconst showPanelColor = ref(false)\nconst customInput = ref('')\n\nconst displayedColor = computed(() => {\n if (!props.modelValue && !showPanelColor.value) {\n return 'transparent'\n }\n return displayedRgb(color, props.showAlpha)\n})\n\nconst currentColor = computed(() => {\n return !props.modelValue && !showPanelColor.value ? '' : color.value\n})\n\nconst buttonAriaLabel = computed<string | undefined>(() => {\n return !isLabeledByFormItem.value\n ? props.label || t('el.colorpicker.defaultLabel')\n : undefined\n})\n\nconst buttonAriaLabelledby = computed<string | undefined>(() => {\n return isLabeledByFormItem.value ? formItem?.labelId : undefined\n})\n\nconst btnKls = computed(() => {\n return [\n ns.b('picker'),\n ns.is('disabled', colorDisabled.value),\n ns.bm('picker', colorSize.value),\n ]\n})\n\nfunction displayedRgb(color: Color, showAlpha: boolean) {\n if (!(color instanceof Color)) {\n throw new TypeError('color should be instance of _color Class')\n }\n\n const { r, g, b } = color.toRgb()\n return showAlpha\n ? `rgba(${r}, ${g}, ${b}, ${color.get('alpha') / 100})`\n : `rgb(${r}, ${g}, ${b})`\n}\n\nfunction setShowPicker(value: boolean) {\n showPicker.value = value\n}\n\nconst debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true })\n\nfunction show() {\n if (colorDisabled.value) return\n setShowPicker(true)\n}\n\nfunction hide() {\n debounceSetShowPicker(false)\n resetColor()\n}\n\nfunction resetColor() {\n nextTick(() => {\n if (props.modelValue) {\n color.fromString(props.modelValue)\n } else {\n color.value = ''\n nextTick(() => {\n showPanelColor.value = false\n })\n }\n })\n}\n\nfunction handleTrigger() {\n if (colorDisabled.value) return\n debounceSetShowPicker(!showPicker.value)\n}\n\nfunction handleConfirm() {\n color.fromString(customInput.value)\n}\n\nfunction confirmValue() {\n const value = color.value\n emit(UPDATE_MODEL_EVENT, value)\n emit('change', value)\n if (props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n debounceSetShowPicker(false)\n // check if modelValue change, if not change, then reset color.\n nextTick(() => {\n const newColor = new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n if (!color.compare(newColor)) {\n resetColor()\n }\n })\n}\n\nfunction clear() {\n debounceSetShowPicker(false)\n emit(UPDATE_MODEL_EVENT, null)\n emit('change', null)\n if (props.modelValue !== null && props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n resetColor()\n}\n\nonMounted(() => {\n if (props.modelValue) {\n customInput.value = currentColor.value\n }\n})\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n showPanelColor.value = false\n } else if (newVal && newVal !== color.value) {\n shouldActiveChange = false\n color.fromString(newVal)\n }\n }\n)\n\nwatch(\n () => currentColor.value,\n (val) => {\n customInput.value = val\n shouldActiveChange && emit('activeChange', val)\n shouldActiveChange = true\n }\n)\n\nwatch(\n () => color.value,\n () => {\n if (!props.modelValue && !showPanelColor.value) {\n showPanelColor.value = true\n }\n }\n)\n\nwatch(\n () => showPicker.value,\n () => {\n nextTick(() => {\n hue.value?.update()\n sv.value?.update()\n alpha.value?.update()\n })\n }\n)\n\nprovide(colorPickerContextKey, {\n currentColor,\n})\n\ndefineExpose({\n /**\n * @description current color object\n */\n color,\n /**\n * @description manually show ColorPicker\n */\n show,\n /**\n * @description manually hide ColorPicker\n */\n hide,\n})\n</script>\n"],"names":["useLocale","useNamespace","useFormItem","useFormSize","useFormDisabled","useFormItemInputId","ref","color","reactive","Color","computed","debounce","nextTick","UPDATE_MODEL_EVENT","debugWarn","onMounted","watch","provide","colorPickerContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAyIc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA,EAAE,aAAaC,uBAAY,EAAA,CAAA;AACjC,IAAA,MAAM,YAAYC,8BAAY,EAAA,CAAA;AAC9B,IAAA,MAAM,gBAAgBC,kCAAgB,EAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,OAAA,EAAS,QAAU,EAAA,mBAAA,EAAA,GAAwBC,+BAAmB,KAAO,EAAA;AAAA,MAC3E,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAA,MAAM,MAAMC,OAAoC,EAAA,CAAA;AAChD,IAAA,MAAM,KAAKA,OAAkC,EAAA,CAAA;AAC7C,IAAA,MAAM,QAAQA,OAAsC,EAAA,CAAA;AACpD,IAAA,MAAM,SAASA,OAAqB,EAAA,CAAA;AAGpC,IAAA,IAAI,kBAAqB,GAAA,IAAA,CAAA;AAEzB,IAAM,MAAAC,OAAA,GAAQC,YACZ,CAAA,IAAIC,gBAAM,CAAA;AAAA,MACR,aAAa,KAAM,CAAA,SAAA;AAAA,MACnB,MAAA,EAAQ,MAAM,WAAe,IAAA,EAAA;AAAA,MAC7B,OAAO,KAAM,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AA;AAAA,KAEzB,CAAA,CAAA;AAEA,IACEA,SAAA,CAAA,MAAMT,OAAM,CAAA,KAAA,EACZ,MAAM;AACJ,MAAA,IAAI,CAAC,KAAA,CAAM,UAAc,IAAA,CAAC,eAAe,KAAO,EAAA;AAC9C,QAAA,cAAA,CAAe,KAAQ,GAAA,IAAA,CAAA;AAAA,OACzB;AAAA,KAEJ,CAAA,CAAA;AAEA,IACES,SAAA,CAAA,MAAM,UAAW,CAAA,KAAA,EACjB,MAAM;AACJ,MAAAJ,YAAA,CAAS,MAAM;AACb,QAAA,IAAI,QAAc,EAAA,CAAA;AAClB,QAAA,CAAA,EAAG,OAAO,KAAO,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AACjB,QAAA,CAAA,EAAA,GAAM,QAAc,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,QACrB,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,OAEL,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AAA+B,IAC7BK,WAAA,CAAAC,iCAAA,EAAA;AAAA,MACD,YAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,aAIAX,OAAA;AAAA,MAIA,IAAA;AAAA,MACD,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"color-picker2.js","sources":["../../../../../../packages/components/color-picker/src/color-picker.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"popper\"\n :visible=\"showPicker\"\n :show-arrow=\"false\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :offset=\"0\"\n :gpu-acceleration=\"false\"\n :popper-class=\"[ns.be('picker', 'panel'), ns.b('dropdown'), popperClass]\"\n :stop-popper-mouse-event=\"false\"\n effect=\"light\"\n trigger=\"click\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n persistent\n @hide=\"setShowPicker(false)\"\n >\n <template #content>\n <div v-click-outside=\"handleClickOutside\" @keydown.esc=\"handleEsc\">\n <div :class=\"ns.be('dropdown', 'main-wrapper')\">\n <hue-slider ref=\"hue\" class=\"hue-slider\" :color=\"color\" vertical />\n <sv-panel ref=\"sv\" :color=\"color\" />\n </div>\n <alpha-slider v-if=\"showAlpha\" ref=\"alpha\" :color=\"color\" />\n <predefine\n v-if=\"predefine\"\n ref=\"predefine\"\n :color=\"color\"\n :colors=\"predefine\"\n />\n <div :class=\"ns.be('dropdown', 'btns')\">\n <span :class=\"ns.be('dropdown', 'value')\">\n <el-input\n ref=\"inputRef\"\n v-model=\"customInput\"\n :validate-event=\"false\"\n size=\"small\"\n @keyup.enter=\"handleConfirm\"\n @blur=\"handleConfirm\"\n />\n </span>\n <el-button\n :class=\"ns.be('dropdown', 'link-btn')\"\n text\n size=\"small\"\n @click=\"clear\"\n >\n {{ t('el.colorpicker.clear') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ns.be('dropdown', 'btn')\"\n @click=\"confirmValue\"\n >\n {{ t('el.colorpicker.confirm') }}\n </el-button>\n </div>\n </div>\n </template>\n <template #default>\n <div\n :id=\"buttonId\"\n ref=\"triggerRef\"\n :class=\"btnKls\"\n role=\"button\"\n :aria-label=\"buttonAriaLabel\"\n :aria-labelledby=\"buttonAriaLabelledby\"\n :aria-description=\"\n t('el.colorpicker.description', { color: modelValue || '' })\n \"\n :aria-disabled=\"colorDisabled\"\n :tabindex=\"colorDisabled ? -1 : tabindex\"\n @keydown=\"handleKeyDown\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n >\n <div v-if=\"colorDisabled\" :class=\"ns.be('picker', 'mask')\" />\n <div :class=\"ns.be('picker', 'trigger')\" @click=\"handleTrigger\">\n <span :class=\"[ns.be('picker', 'color'), ns.is('alpha', showAlpha)]\">\n <span\n :class=\"ns.be('picker', 'color-inner')\"\n :style=\"{\n backgroundColor: displayedColor,\n }\"\n >\n <el-icon\n v-show=\"modelValue || showPanelColor\"\n :class=\"[ns.be('picker', 'icon'), ns.is('icon-arrow-down')]\"\n >\n <arrow-down />\n </el-icon>\n <el-icon\n v-show=\"!modelValue && !showPanelColor\"\n :class=\"[ns.be('picker', 'empty'), ns.is('icon-close')]\"\n >\n <close />\n </el-icon>\n </span>\n </span>\n </div>\n </div>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { ElInput } from '@element-plus/components/input'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n useFocusController,\n useLocale,\n useNamespace,\n} from '@element-plus/hooks'\nimport { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { debugWarn } from '@element-plus/utils'\nimport { ArrowDown, Close } from '@element-plus/icons-vue'\nimport AlphaSlider from './components/alpha-slider.vue'\nimport HueSlider from './components/hue-slider.vue'\nimport Predefine from './components/predefine.vue'\nimport SvPanel from './components/sv-panel.vue'\nimport Color from './utils/color'\nimport {\n colorPickerContextKey,\n colorPickerEmits,\n colorPickerProps,\n} from './color-picker'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElColorPicker',\n})\nconst props = defineProps(colorPickerProps)\nconst emit = defineEmits(colorPickerEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('color')\nconst { formItem } = useFormItem()\nconst colorSize = useFormSize()\nconst colorDisabled = useFormDisabled()\n\nconst { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst hue = ref<InstanceType<typeof HueSlider>>()\nconst sv = ref<InstanceType<typeof SvPanel>>()\nconst alpha = ref<InstanceType<typeof AlphaSlider>>()\nconst popper = ref<TooltipInstance>()\nconst triggerRef = ref()\nconst inputRef = ref()\n\nconst {\n isFocused,\n handleFocus: _handleFocus,\n handleBlur,\n} = useFocusController(triggerRef, {\n beforeBlur(event) {\n return popper.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n setShowPicker(false)\n resetColor()\n },\n})\n\nconst handleFocus = (event: FocusEvent) => {\n if (colorDisabled.value) return blur()\n _handleFocus(event)\n}\n\n// active-change is used to prevent modelValue changes from triggering.\nlet shouldActiveChange = true\n\nconst color = reactive(\n new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n) as Color\n\nconst showPicker = ref(false)\nconst showPanelColor = ref(false)\nconst customInput = ref('')\n\nconst displayedColor = computed(() => {\n if (!props.modelValue && !showPanelColor.value) {\n return 'transparent'\n }\n return displayedRgb(color, props.showAlpha)\n})\n\nconst currentColor = computed(() => {\n return !props.modelValue && !showPanelColor.value ? '' : color.value\n})\n\nconst buttonAriaLabel = computed<string | undefined>(() => {\n return !isLabeledByFormItem.value\n ? props.label || t('el.colorpicker.defaultLabel')\n : undefined\n})\n\nconst buttonAriaLabelledby = computed<string | undefined>(() => {\n return isLabeledByFormItem.value ? formItem?.labelId : undefined\n})\n\nconst btnKls = computed(() => {\n return [\n ns.b('picker'),\n ns.is('disabled', colorDisabled.value),\n ns.bm('picker', colorSize.value),\n ns.is('focused', isFocused.value),\n ]\n})\n\nfunction displayedRgb(color: Color, showAlpha: boolean) {\n if (!(color instanceof Color)) {\n throw new TypeError('color should be instance of _color Class')\n }\n\n const { r, g, b } = color.toRgb()\n return showAlpha\n ? `rgba(${r}, ${g}, ${b}, ${color.get('alpha') / 100})`\n : `rgb(${r}, ${g}, ${b})`\n}\n\nfunction setShowPicker(value: boolean) {\n showPicker.value = value\n}\n\nconst debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true })\n\nfunction show() {\n if (colorDisabled.value) return\n setShowPicker(true)\n}\n\nfunction hide() {\n debounceSetShowPicker(false)\n resetColor()\n}\n\nfunction resetColor() {\n nextTick(() => {\n if (props.modelValue) {\n color.fromString(props.modelValue)\n } else {\n color.value = ''\n nextTick(() => {\n showPanelColor.value = false\n })\n }\n })\n}\n\nfunction handleTrigger() {\n if (colorDisabled.value) return\n debounceSetShowPicker(!showPicker.value)\n}\n\nfunction handleConfirm() {\n color.fromString(customInput.value)\n}\n\nfunction confirmValue() {\n const value = color.value\n emit(UPDATE_MODEL_EVENT, value)\n emit('change', value)\n if (props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n debounceSetShowPicker(false)\n // check if modelValue change, if not change, then reset color.\n nextTick(() => {\n const newColor = new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n if (!color.compare(newColor)) {\n resetColor()\n }\n })\n}\n\nfunction clear() {\n debounceSetShowPicker(false)\n emit(UPDATE_MODEL_EVENT, null)\n emit('change', null)\n if (props.modelValue !== null && props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n resetColor()\n}\n\nfunction handleClickOutside(event: Event) {\n if (!showPicker.value) return\n hide()\n\n if (isFocused.value) {\n const _event = new FocusEvent('focus', event)\n handleBlur(_event)\n }\n}\n\nfunction handleEsc(event: KeyboardEvent) {\n event.preventDefault()\n event.stopPropagation()\n setShowPicker(false)\n resetColor()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n switch (event.code) {\n case EVENT_CODE.enter:\n case EVENT_CODE.space:\n event.preventDefault()\n event.stopPropagation()\n show()\n inputRef.value.focus()\n break\n case EVENT_CODE.esc:\n handleEsc(event)\n break\n }\n}\n\nfunction focus() {\n triggerRef.value.focus()\n}\n\nfunction blur() {\n triggerRef.value.blur()\n}\n\nonMounted(() => {\n if (props.modelValue) {\n customInput.value = currentColor.value\n }\n})\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n showPanelColor.value = false\n } else if (newVal && newVal !== color.value) {\n shouldActiveChange = false\n color.fromString(newVal)\n }\n }\n)\n\nwatch(\n () => currentColor.value,\n (val) => {\n customInput.value = val\n shouldActiveChange && emit('activeChange', val)\n shouldActiveChange = true\n }\n)\n\nwatch(\n () => color.value,\n () => {\n if (!props.modelValue && !showPanelColor.value) {\n showPanelColor.value = true\n }\n }\n)\n\nwatch(\n () => showPicker.value,\n () => {\n nextTick(() => {\n hue.value?.update()\n sv.value?.update()\n alpha.value?.update()\n })\n }\n)\n\nprovide(colorPickerContextKey, {\n currentColor,\n})\n\ndefineExpose({\n /**\n * @description current color object\n */\n color,\n /**\n * @description manually show ColorPicker\n */\n show,\n /**\n * @description manually hide ColorPicker\n */\n hide,\n /**\n * @description focus the input element\n */\n focus,\n /**\n * @description blur the input element\n */\n blur,\n})\n</script>\n"],"names":["useLocale","useNamespace","useFormItem","useFormSize","useFormDisabled","useFormItemInputId","ref","useFocusController","Color","computed","color","debounce","nextTick","UPDATE_MODEL_EVENT","debugWarn","EVENT_CODE","onMounted","watch","provide","colorPickerContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAmJc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA,EAAE,aAAaC,uBAAY,EAAA,CAAA;AACjC,IAAA,MAAM,YAAYC,8BAAY,E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 @@
|
|
|
1
|
-
{"version":3,"file":"description-item.js","sources":["../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { buildProps } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, Slot, VNode } from 'vue'\n\nconst descriptionItemProps = buildProps({\n label: {\n type: String,\n default: '',\n },\n span: {\n type: Number,\n default: 1,\n },\n width: {\n type: [String, Number],\n default: '',\n },\n minWidth: {\n type: [String, Number],\n default: '',\n },\n align: {\n type: String,\n default: 'left',\n },\n labelAlign: {\n type: String,\n default: '',\n },\n className: {\n type: String,\n default: '',\n },\n labelClassName: {\n type: String,\n default: '',\n },\n})\nconst DescriptionItem = defineComponent({\n name: 'ElDescriptionsItem',\n props: descriptionItemProps,\n})\n\nexport default DescriptionItem\n\ntype DescriptionItemProps = ExtractPropTypes<typeof descriptionItemProps>\nexport type DescriptionItemVNode = VNode & {\n children: { [name: string]: Slot } | null\n props: Partial<DescriptionItemProps> | null\n}\n"],"names":["buildProps","defineComponent"],"mappings":";;;;;;;;AAEA,MAAM,oBAAoB,GAAGA,kBAAU,CAAC;AACxC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,CAAC,CAAC;AACE,MAAC,eAAe,GAAGC,mBAAe,CAAC;AACxC,EAAE,IAAI,EAAE,oBAAoB;AAC5B,EAAE,KAAK,EAAE,oBAAoB;AAC7B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"description-item.js","sources":["../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { buildProps } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, Slot, VNode } from 'vue'\n\nconst descriptionItemProps = buildProps({\n /**\n * @description label text\n */\n label: {\n type: String,\n default: '',\n },\n /**\n * @description colspan of column\n */\n span: {\n type: Number,\n default: 1,\n },\n /**\n * @description column width, the width of the same column in different rows is set by the max value (If no `border`, width contains label and content)\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column minimum width, columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion (If no`border`, width contains label and content)\n */\n minWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column content alignment (If no `border`, effective for both label and content)\n */\n align: {\n type: String,\n default: 'left',\n },\n /**\n * @description column label alignment, if omitted, the value of the above `align` attribute will be applied (If no `border`, please use `align` attribute)\n */\n labelAlign: {\n type: String,\n default: '',\n },\n /**\n * @description column content custom class name\n */\n className: {\n type: String,\n default: '',\n },\n /**\n * @description column label custom class name\n */\n labelClassName: {\n type: String,\n default: '',\n },\n})\nconst DescriptionItem = defineComponent({\n name: 'ElDescriptionsItem',\n props: descriptionItemProps,\n})\n\nexport default DescriptionItem\n\ntype DescriptionItemProps = ExtractPropTypes<typeof descriptionItemProps>\nexport type DescriptionItemVNode = VNode & {\n children: { [name: string]: Slot } | null\n props: Partial<DescriptionItemProps> | null\n}\n"],"names":["buildProps","defineComponent"],"mappings":";;;;;;;;AAEA,MAAM,oBAAoB,GAAGA,kBAAU,CAAC;AACxC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,CAAC,CAAC;AACE,MAAC,eAAe,GAAGC,mBAAe,CAAC;AACxC,EAAE,IAAI,EAAE,oBAAoB;AAC5B,EAAE,KAAK,EAAE,oBAAoB;AAC7B,CAAC;;;;"}
|