@element-plus/nightly 0.0.20221031 → 0.0.20221102
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 +153 -86
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +153 -86
- 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/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/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +2 -1
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +20 -59
- package/es/components/collapse/index.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.d.ts +0 -2
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/es/components/collapse/src/collapse-item2.mjs +34 -55
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/collapse/src/collapse.d.ts +0 -2
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +6 -25
- package/es/components/collapse/src/collapse2.mjs +5 -39
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/collapse/src/instance.d.ts +4 -0
- package/es/components/collapse/src/instance.mjs +2 -0
- package/es/components/collapse/src/instance.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/es/components/collapse/src/use-collapse-item.mjs +75 -0
- package/es/components/collapse/src/use-collapse-item.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse.d.ts +9 -0
- package/es/components/collapse/src/use-collapse.mjs +52 -0
- package/es/components/collapse/src/use-collapse.mjs.map +1 -0
- package/es/components/input/index.d.ts +2 -0
- package/es/components/input/index.mjs.map +1 -1
- package/es/components/tree-v2/index.d.ts +0 -1
- package/es/components/tree-v2/src/tree-node.mjs +2 -2
- package/es/components/tree-v2/src/tree-node.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.vue.d.ts +0 -1
- package/es/components/tree-v2/src/tree.vue.d.ts +0 -1
- package/es/utils/dom/style.mjs +4 -4
- package/es/utils/dom/style.mjs.map +1 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/types.d.ts +1 -0
- package/es/utils/types.mjs +8 -2
- package/es/utils/types.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/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +2 -1
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/collapse/index.d.ts +20 -59
- package/lib/components/collapse/index.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.d.ts +0 -2
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/lib/components/collapse/src/collapse-item2.js +37 -58
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/collapse/src/collapse.d.ts +0 -2
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +6 -25
- package/lib/components/collapse/src/collapse2.js +4 -38
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/collapse/src/instance.d.ts +4 -0
- package/lib/components/collapse/src/instance.js +3 -0
- package/lib/components/collapse/src/instance.js.map +1 -0
- package/lib/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/lib/components/collapse/src/use-collapse-item.js +80 -0
- package/lib/components/collapse/src/use-collapse-item.js.map +1 -0
- package/lib/components/collapse/src/use-collapse.d.ts +9 -0
- package/lib/components/collapse/src/use-collapse.js +57 -0
- package/lib/components/collapse/src/use-collapse.js.map +1 -0
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/tree-v2/index.d.ts +0 -1
- package/lib/components/tree-v2/src/tree-node.js +2 -2
- package/lib/components/tree-v2/src/tree-node.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +0 -1
- package/lib/components/tree-v2/src/tree.vue.d.ts +0 -1
- package/lib/utils/dom/style.js +4 -4
- package/lib/utils/dom/style.js.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.js +7 -0
- package/lib/utils/types.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-input-number.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/input-number.scss +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item2.js","sources":["../../../../../../packages/components/collapse/src/collapse-item.vue"],"sourcesContent":["<template>\n <div
|
|
1
|
+
{"version":3,"file":"collapse-item2.js","sources":["../../../../../../packages/components/collapse/src/collapse-item.vue"],"sourcesContent":["<template>\n <div :class=\"rootKls\">\n <div\n role=\"tab\"\n :aria-expanded=\"isActive\"\n :aria-controls=\"scopedContentId\"\n :aria-describedby=\"scopedContentId\"\n >\n <div\n :id=\"scopedHeadId\"\n :class=\"headKls\"\n role=\"button\"\n :tabindex=\"disabled ? -1 : 0\"\n @click=\"handleHeaderClick\"\n @keypress.space.enter.stop.prevent=\"handleEnterClick\"\n @focus=\"handleFocus\"\n @blur=\"focusing = false\"\n >\n <slot name=\"title\">{{ title }}</slot>\n <el-icon :class=\"arrowKls\">\n <arrow-right />\n </el-icon>\n </div>\n </div>\n <el-collapse-transition>\n <div\n v-show=\"isActive\"\n :id=\"scopedContentId\"\n :class=\"itemWrapperKls\"\n role=\"tabpanel\"\n :aria-hidden=\"!isActive\"\n :aria-labelledby=\"scopedHeadId\"\n >\n <div :class=\"itemContentKls\">\n <slot />\n </div>\n </div>\n </el-collapse-transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport ElCollapseTransition from '@element-plus/components/collapse-transition'\nimport ElIcon from '@element-plus/components/icon'\nimport { ArrowRight } from '@element-plus/icons-vue'\nimport { collapseItemProps } from './collapse-item'\nimport { useCollapseItem, useCollapseItemDOM } from './use-collapse-item'\n\ndefineOptions({\n name: 'ElCollapseItem',\n})\n\nconst props = defineProps(collapseItemProps)\nconst {\n focusing,\n id,\n isActive,\n handleFocus,\n handleHeaderClick,\n handleEnterClick,\n} = useCollapseItem(props)\n\nconst {\n arrowKls,\n headKls,\n rootKls,\n itemWrapperKls,\n itemContentKls,\n scopedContentId,\n scopedHeadId,\n} = useCollapseItemDOM(props, { focusing, isActive, id })\n\ndefineExpose({\n /** @description current collapse-item whether active */\n isActive,\n})\n</script>\n"],"names":["useCollapseItem","useCollapseItemDOM"],"mappings":";;;;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,EAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,gBAAA;AAAA,KAAA,GACEA,gCAAgB,KAAK,CAAA,CAAA;AAEzB,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,eAAA;AAAA,MACA,YAAA;AAAA,KAAA,GACEC,mCAAmB,KAAO,EAAA,EAAE,QAAU,EAAA,QAAA,EAAU,IAAI,CAAA,CAAA;AAExD,IAAa,MAAA,CAAA;AAAA,MAEX,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
|
-
import type Collapse from './collapse.vue';
|
|
3
2
|
import type { Arrayable } from 'element-plus/es/utils';
|
|
4
3
|
export declare type CollapseActiveName = string | number;
|
|
5
4
|
export declare type CollapseModelValue = Arrayable<CollapseActiveName>;
|
|
@@ -14,4 +13,3 @@ export declare const collapseEmits: {
|
|
|
14
13
|
change: (value: CollapseModelValue) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
15
14
|
};
|
|
16
15
|
export declare type CollapseEmits = typeof collapseEmits;
|
|
17
|
-
export declare type CollapseInstance = InstanceType<typeof Collapse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.js","sources":["../../../../../../packages/components/collapse/src/collapse.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type
|
|
1
|
+
{"version":3,"file":"collapse.js","sources":["../../../../../../packages/components/collapse/src/collapse.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Arrayable } from '@element-plus/utils'\n\nexport type CollapseActiveName = string | number\nexport type CollapseModelValue = Arrayable<CollapseActiveName>\n\nexport const emitChangeFn = (value: CollapseModelValue) =>\n typeof isNumber(value) || isString(value) || Array.isArray(value)\n\nexport const collapseProps = buildProps({\n accordion: Boolean,\n modelValue: {\n type: definePropType<CollapseModelValue>([Array, String, Number]),\n default: () => mutable([] as const),\n },\n} as const)\nexport type CollapseProps = ExtractPropTypes<typeof collapseProps>\n\nexport const collapseEmits = {\n [UPDATE_MODEL_EVENT]: emitChangeFn,\n [CHANGE_EVENT]: emitChangeFn,\n}\nexport type CollapseEmits = typeof collapseEmits\n"],"names":["isNumber","buildProps","definePropType","mutable","UPDATE_MODEL_EVENT","CHANGE_EVENT"],"mappings":";;;;;;;;;;;AAOY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK,OAAOA,aAAQ,CAAC,KAAK,EAAE;AAClD,MAAC,aAAa,GAAGC,kBAAU,CAAC;AACxC,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,wBAAkB,GAAG,YAAY;AACpC,EAAE,CAACC,kBAAY,GAAG,YAAY;AAC9B;;;;;;"}
|
|
@@ -1,48 +1,29 @@
|
|
|
1
|
-
import type { CollapseActiveName } from './collapse';
|
|
2
1
|
declare const _default: import("vue").DefineComponent<{
|
|
3
2
|
readonly accordion: BooleanConstructor;
|
|
4
|
-
readonly modelValue: import("
|
|
3
|
+
readonly modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue) | ((new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue))[], unknown, unknown, () => [], boolean>;
|
|
5
4
|
}, {
|
|
6
5
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
7
6
|
readonly accordion: BooleanConstructor;
|
|
8
|
-
readonly modelValue: import("
|
|
7
|
+
readonly modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue) | ((new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue))[], unknown, unknown, () => [], boolean>;
|
|
9
8
|
}>> & {
|
|
10
9
|
onChange?: ((value: import("./collapse").CollapseModelValue) => any) | undefined;
|
|
11
10
|
"onUpdate:modelValue"?: ((value: import("./collapse").CollapseModelValue) => any) | undefined;
|
|
12
11
|
}>>;
|
|
13
12
|
emit: ((event: "update:modelValue", value: import("./collapse").CollapseModelValue) => void) & ((event: "change", value: import("./collapse").CollapseModelValue) => void);
|
|
14
|
-
ns: {
|
|
15
|
-
namespace: import("vue").Ref<string>;
|
|
16
|
-
b: (blockSuffix?: string) => string;
|
|
17
|
-
e: (element?: string | undefined) => string;
|
|
18
|
-
m: (modifier?: string | undefined) => string;
|
|
19
|
-
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
20
|
-
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
21
|
-
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
22
|
-
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
23
|
-
is: {
|
|
24
|
-
(name: string, state: boolean | undefined): string;
|
|
25
|
-
(name: string): string;
|
|
26
|
-
};
|
|
27
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
28
|
-
cssVarName: (name: string) => string;
|
|
29
|
-
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
30
|
-
cssVarBlockName: (name: string) => string;
|
|
31
|
-
};
|
|
32
13
|
activeNames: import("vue").Ref<(string | number)[]>;
|
|
33
|
-
setActiveNames: (_activeNames: CollapseActiveName[]) => void;
|
|
34
|
-
|
|
14
|
+
setActiveNames: (_activeNames: import("./collapse").CollapseActiveName[]) => void;
|
|
15
|
+
rootKls: import("vue").ComputedRef<string>;
|
|
35
16
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
17
|
"update:modelValue": (value: import("./collapse").CollapseModelValue) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
37
18
|
change: (value: import("./collapse").CollapseModelValue) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
38
19
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
20
|
readonly accordion: BooleanConstructor;
|
|
40
|
-
readonly modelValue: import("
|
|
21
|
+
readonly modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue) | ((new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue))[], unknown, unknown, () => [], boolean>;
|
|
41
22
|
}>> & {
|
|
42
23
|
onChange?: ((value: import("./collapse").CollapseModelValue) => any) | undefined;
|
|
43
24
|
"onUpdate:modelValue"?: ((value: import("./collapse").CollapseModelValue) => any) | undefined;
|
|
44
25
|
}, {
|
|
45
|
-
readonly modelValue: import("
|
|
26
|
+
readonly modelValue: import("../../../utils").EpPropMergeType<(new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue) | ((new (...args: any[]) => import("./collapse").CollapseModelValue & {}) | (() => import("./collapse").CollapseModelValue))[], unknown, unknown>;
|
|
46
27
|
readonly accordion: boolean;
|
|
47
28
|
}>;
|
|
48
29
|
export default _default;
|
|
@@ -3,16 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
require('../../../utils/index.js');
|
|
7
|
-
require('../../../constants/index.js');
|
|
8
|
-
require('../../../hooks/index.js');
|
|
9
|
-
require('../../../tokens/index.js');
|
|
10
6
|
var collapse = require('./collapse.js');
|
|
7
|
+
var useCollapse = require('./use-collapse.js');
|
|
11
8
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
|
-
var lodashUnified = require('lodash-unified');
|
|
14
|
-
var event = require('../../../constants/event.js');
|
|
15
|
-
var collapse$1 = require('../../../tokens/collapse.js');
|
|
16
9
|
|
|
17
10
|
const __default__ = vue.defineComponent({
|
|
18
11
|
name: "ElCollapse"
|
|
@@ -23,42 +16,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
23
16
|
emits: collapse.collapseEmits,
|
|
24
17
|
setup(__props, { expose, emit }) {
|
|
25
18
|
const props = __props;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const setActiveNames = (_activeNames) => {
|
|
29
|
-
activeNames.value = _activeNames;
|
|
30
|
-
const value = props.accordion ? activeNames.value[0] : activeNames.value;
|
|
31
|
-
emit(event.UPDATE_MODEL_EVENT, value);
|
|
32
|
-
emit(event.CHANGE_EVENT, value);
|
|
33
|
-
};
|
|
34
|
-
const handleItemClick = (name) => {
|
|
35
|
-
if (props.accordion) {
|
|
36
|
-
setActiveNames([
|
|
37
|
-
(activeNames.value[0] || activeNames.value[0] === 0) && activeNames.value[0] === name ? "" : name
|
|
38
|
-
]);
|
|
39
|
-
} else {
|
|
40
|
-
const _activeNames = [...activeNames.value];
|
|
41
|
-
const index = _activeNames.indexOf(name);
|
|
42
|
-
if (index > -1) {
|
|
43
|
-
_activeNames.splice(index, 1);
|
|
44
|
-
} else {
|
|
45
|
-
_activeNames.push(name);
|
|
46
|
-
}
|
|
47
|
-
setActiveNames(_activeNames);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
vue.watch(() => props.modelValue, () => activeNames.value = lodashUnified.castArray(props.modelValue), { deep: true });
|
|
51
|
-
vue.provide(collapse$1.collapseContextKey, {
|
|
52
|
-
activeNames,
|
|
53
|
-
handleItemClick
|
|
54
|
-
});
|
|
19
|
+
const { activeNames, setActiveNames } = useCollapse.useCollapse(props, emit);
|
|
20
|
+
const { rootKls } = useCollapse.useCollapseDOM();
|
|
55
21
|
expose({
|
|
56
22
|
activeNames,
|
|
57
23
|
setActiveNames
|
|
58
24
|
});
|
|
59
25
|
return (_ctx, _cache) => {
|
|
60
26
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
61
|
-
class: vue.normalizeClass(vue.unref(
|
|
27
|
+
class: vue.normalizeClass(vue.unref(rootKls)),
|
|
62
28
|
role: "tablist",
|
|
63
29
|
"aria-multiselectable": "true"
|
|
64
30
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse2.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div :class=\"
|
|
1
|
+
{"version":3,"file":"collapse2.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div :class=\"rootKls\" role=\"tablist\" aria-multiselectable=\"true\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { collapseEmits, collapseProps } from './collapse'\nimport { useCollapse, useCollapseDOM } from './use-collapse'\n\ndefineOptions({\n name: 'ElCollapse',\n})\nconst props = defineProps(collapseProps)\nconst emit = defineEmits(collapseEmits)\n\nconst { activeNames, setActiveNames } = useCollapse(props, emit)\n\nconst { rootKls } = useCollapseDOM()\n\ndefineExpose({\n /** @description active names */\n activeNames,\n /** @description set active names */\n setActiveNames,\n})\n</script>\n"],"names":["useCollapse","useCollapseDOM"],"mappings":";;;;;;;;;uCAUc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,EAAE,WAAA,EAAa,cAAmB,EAAA,GAAAA,uBAAA,CAAY,OAAO,IAAI,CAAA,CAAA;AAE/D,IAAM,MAAA,EAAE,YAAYC,0BAAe,EAAA,CAAA;AAEnC,IAAa,MAAA,CAAA;AAAA,MAEX,WAAA;AAAA,MAEA,cAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CollapseItemProps } from './collapse-item';
|
|
2
|
+
export declare const useCollapseItem: (props: CollapseItemProps) => {
|
|
3
|
+
focusing: import("vue").Ref<boolean>;
|
|
4
|
+
id: import("vue").Ref<number>;
|
|
5
|
+
isActive: import("vue").ComputedRef<boolean | undefined>;
|
|
6
|
+
handleFocus: () => void;
|
|
7
|
+
handleHeaderClick: () => void;
|
|
8
|
+
handleEnterClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const useCollapseItemDOM: (props: CollapseItemProps, { focusing, isActive, id }: Partial<ReturnType<typeof useCollapseItem>>) => {
|
|
11
|
+
arrowKls: import("vue").ComputedRef<string[]>;
|
|
12
|
+
headKls: import("vue").ComputedRef<(string | {
|
|
13
|
+
focusing: boolean | undefined;
|
|
14
|
+
})[]>;
|
|
15
|
+
rootKls: import("vue").ComputedRef<string[]>;
|
|
16
|
+
itemWrapperKls: import("vue").ComputedRef<string>;
|
|
17
|
+
itemContentKls: import("vue").ComputedRef<string>;
|
|
18
|
+
scopedContentId: import("vue").ComputedRef<string>;
|
|
19
|
+
scopedHeadId: import("vue").ComputedRef<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
7
|
+
require('../../../utils/index.js');
|
|
8
|
+
require('../../../tokens/index.js');
|
|
9
|
+
var collapse = require('../../../tokens/collapse.js');
|
|
10
|
+
var rand = require('../../../utils/rand.js');
|
|
11
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
+
|
|
13
|
+
const useCollapseItem = (props) => {
|
|
14
|
+
const collapse$1 = vue.inject(collapse.collapseContextKey);
|
|
15
|
+
const focusing = vue.ref(false);
|
|
16
|
+
const isClick = vue.ref(false);
|
|
17
|
+
const id = vue.ref(rand.generateId());
|
|
18
|
+
const isActive = vue.computed(() => collapse$1 == null ? void 0 : collapse$1.activeNames.value.includes(props.name));
|
|
19
|
+
const handleFocus = () => {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
if (!isClick.value) {
|
|
22
|
+
focusing.value = true;
|
|
23
|
+
} else {
|
|
24
|
+
isClick.value = false;
|
|
25
|
+
}
|
|
26
|
+
}, 50);
|
|
27
|
+
};
|
|
28
|
+
const handleHeaderClick = () => {
|
|
29
|
+
if (props.disabled)
|
|
30
|
+
return;
|
|
31
|
+
collapse$1 == null ? void 0 : collapse$1.handleItemClick(props.name);
|
|
32
|
+
focusing.value = false;
|
|
33
|
+
isClick.value = true;
|
|
34
|
+
};
|
|
35
|
+
const handleEnterClick = () => {
|
|
36
|
+
collapse$1 == null ? void 0 : collapse$1.handleItemClick(props.name);
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
focusing,
|
|
40
|
+
id,
|
|
41
|
+
isActive,
|
|
42
|
+
handleFocus,
|
|
43
|
+
handleHeaderClick,
|
|
44
|
+
handleEnterClick
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
|
|
48
|
+
const ns = index.useNamespace("collapse");
|
|
49
|
+
const rootKls = vue.computed(() => [
|
|
50
|
+
ns.b("item"),
|
|
51
|
+
ns.is("active", vue.unref(isActive)),
|
|
52
|
+
ns.is("disabled", props.disabled)
|
|
53
|
+
]);
|
|
54
|
+
const headKls = vue.computed(() => [
|
|
55
|
+
ns.be("item", "header"),
|
|
56
|
+
ns.is("active", vue.unref(isActive)),
|
|
57
|
+
{ focusing: vue.unref(focusing) && !props.disabled }
|
|
58
|
+
]);
|
|
59
|
+
const arrowKls = vue.computed(() => [
|
|
60
|
+
ns.be("item", "arrow"),
|
|
61
|
+
ns.is("active", vue.unref(isActive))
|
|
62
|
+
]);
|
|
63
|
+
const itemWrapperKls = vue.computed(() => ns.be("item", "wrap"));
|
|
64
|
+
const itemContentKls = vue.computed(() => ns.be("item", "content"));
|
|
65
|
+
const scopedContentId = vue.computed(() => ns.b(`content-${vue.unref(id)}`));
|
|
66
|
+
const scopedHeadId = vue.computed(() => ns.b(`head-${vue.unref(id)}`));
|
|
67
|
+
return {
|
|
68
|
+
arrowKls,
|
|
69
|
+
headKls,
|
|
70
|
+
rootKls,
|
|
71
|
+
itemWrapperKls,
|
|
72
|
+
itemContentKls,
|
|
73
|
+
scopedContentId,
|
|
74
|
+
scopedHeadId
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.useCollapseItem = useCollapseItem;
|
|
79
|
+
exports.useCollapseItemDOM = useCollapseItemDOM;
|
|
80
|
+
//# sourceMappingURL=use-collapse-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-collapse-item.js","sources":["../../../../../../packages/components/collapse/src/use-collapse-item.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { generateId } from '@element-plus/utils'\nimport { collapseContextKey } from '@element-plus/tokens'\n\nimport type { CollapseItemProps } from './collapse-item'\n\nexport const useCollapseItem = (props: CollapseItemProps) => {\n const collapse = inject(collapseContextKey)\n\n const focusing = ref(false)\n const isClick = ref(false)\n const id = ref(generateId())\n\n const isActive = computed(() =>\n collapse?.activeNames.value.includes(props.name)\n )\n\n const handleFocus = () => {\n setTimeout(() => {\n if (!isClick.value) {\n focusing.value = true\n } else {\n isClick.value = false\n }\n }, 50)\n }\n\n const handleHeaderClick = () => {\n if (props.disabled) return\n collapse?.handleItemClick(props.name)\n focusing.value = false\n isClick.value = true\n }\n\n const handleEnterClick = () => {\n collapse?.handleItemClick(props.name)\n }\n\n return {\n focusing,\n id,\n isActive,\n handleFocus,\n handleHeaderClick,\n handleEnterClick,\n }\n}\n\nexport const useCollapseItemDOM = (\n props: CollapseItemProps,\n { focusing, isActive, id }: Partial<ReturnType<typeof useCollapseItem>>\n) => {\n const ns = useNamespace('collapse')\n\n const rootKls = computed(() => [\n ns.b('item'),\n ns.is('active', unref(isActive)),\n ns.is('disabled', props.disabled),\n ])\n const headKls = computed(() => [\n ns.be('item', 'header'),\n ns.is('active', unref(isActive)),\n { focusing: unref(focusing) && !props.disabled },\n ])\n const arrowKls = computed(() => [\n ns.be('item', 'arrow'),\n ns.is('active', unref(isActive)),\n ])\n const itemWrapperKls = computed(() => ns.be('item', 'wrap'))\n const itemContentKls = computed(() => ns.be('item', 'content'))\n const scopedContentId = computed(() => ns.b(`content-${unref(id)}`))\n const scopedHeadId = computed(() => ns.b(`head-${unref(id)}`))\n\n return {\n arrowKls,\n headKls,\n rootKls,\n itemWrapperKls,\n itemContentKls,\n scopedContentId,\n scoped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AC;AACpC,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,cAAc,GAAGF,YAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/D,EAAE,MAAM,cAAc,GAAGA,YAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAClE,EAAE,MAAM,eAAe,GAAGA,YAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAEE,SAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,MAAM,YAAY,GAAGF,YAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAEE,SAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,OAAO;AACX,IAAI,OAAO;AACX,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,YAAY;AAChB,GAAG,CAAC;AACJ;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { CollapseActiveName, CollapseEmits, CollapseProps } from './collapse';
|
|
3
|
+
export declare const useCollapse: (props: CollapseProps, emit: SetupContext<CollapseEmits>['emit']) => {
|
|
4
|
+
activeNames: import("vue").Ref<(string | number)[]>;
|
|
5
|
+
setActiveNames: (_activeNames: CollapseActiveName[]) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useCollapseDOM: () => {
|
|
8
|
+
rootKls: import("vue").ComputedRef<string>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../utils/index.js');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
require('../../../constants/index.js');
|
|
9
|
+
require('../../../tokens/index.js');
|
|
10
|
+
var lodashUnified = require('lodash-unified');
|
|
11
|
+
var event = require('../../../constants/event.js');
|
|
12
|
+
var collapse = require('../../../tokens/collapse.js');
|
|
13
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
+
|
|
15
|
+
const useCollapse = (props, emit) => {
|
|
16
|
+
const activeNames = vue.ref(lodashUnified.castArray(props.modelValue));
|
|
17
|
+
const setActiveNames = (_activeNames) => {
|
|
18
|
+
activeNames.value = _activeNames;
|
|
19
|
+
const value = props.accordion ? activeNames.value[0] : activeNames.value;
|
|
20
|
+
emit(event.UPDATE_MODEL_EVENT, value);
|
|
21
|
+
emit(event.CHANGE_EVENT, value);
|
|
22
|
+
};
|
|
23
|
+
const handleItemClick = (name) => {
|
|
24
|
+
if (props.accordion) {
|
|
25
|
+
setActiveNames([activeNames.value[0] === name ? "" : name]);
|
|
26
|
+
} else {
|
|
27
|
+
const _activeNames = [...activeNames.value];
|
|
28
|
+
const index = _activeNames.indexOf(name);
|
|
29
|
+
if (index > -1) {
|
|
30
|
+
_activeNames.splice(index, 1);
|
|
31
|
+
} else {
|
|
32
|
+
_activeNames.push(name);
|
|
33
|
+
}
|
|
34
|
+
setActiveNames(_activeNames);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
vue.watch(() => props.modelValue, () => activeNames.value = lodashUnified.castArray(props.modelValue), { deep: true });
|
|
38
|
+
vue.provide(collapse.collapseContextKey, {
|
|
39
|
+
activeNames,
|
|
40
|
+
handleItemClick
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
activeNames,
|
|
44
|
+
setActiveNames
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const useCollapseDOM = () => {
|
|
48
|
+
const ns = index.useNamespace("collapse");
|
|
49
|
+
const rootKls = vue.computed(() => ns.b());
|
|
50
|
+
return {
|
|
51
|
+
rootKls
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.useCollapse = useCollapse;
|
|
56
|
+
exports.useCollapseDOM = useCollapseDOM;
|
|
57
|
+
//# sourceMappingURL=use-collapse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-collapse.js","sources":["../../../../../../packages/components/collapse/src/use-collapse.ts"],"sourcesContent":["import { computed, provide, ref, watch } from 'vue'\nimport { ensureArray } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { collapseContextKey } from '@element-plus/tokens'\n\nimport type { SetupContext } from 'vue'\nimport type {\n CollapseActiveName,\n CollapseEmits,\n CollapseProps,\n} from './collapse'\n\nexport const useCollapse = (\n props: CollapseProps,\n emit: SetupContext<CollapseEmits>['emit']\n) => {\n const activeNames = ref(ensureArray(props.modelValue))\n\n const setActiveNames = (_activeNames: CollapseActiveName[]) => {\n activeNames.value = _activeNames\n const value = props.accordion ? activeNames.value[0] : activeNames.value\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n }\n\n const handleItemClick = (name: CollapseActiveName) => {\n if (props.accordion) {\n setActiveNames([activeNames.value[0] === name ? '' : name])\n } else {\n const _activeNames = [...activeNames.value]\n const index = _activeNames.indexOf(name)\n\n if (index > -1) {\n _activeNames.splice(index, 1)\n } else {\n _activeNames.push(name)\n }\n setActiveNames(_activeNames)\n }\n }\n\n watch(\n () => props.modelValue,\n () => (activeNames.value = ensureArray(props.modelValue)),\n { deep: true }\n )\n\n provide(collapseContextKey, {\n activeNames,\n handleItemClick,\n })\n return {\n activeNames,\n setActiveNames,\n }\n}\n\nexport const useCollapseDOM = () => {\n const ns = useNamespace('collapse')\n\n const rootKls = computed(() => ns.b())\n return {\n rootKls,\n }\n}\n"],"names":["ref","ensureArray","UPDATE_MODEL_EVENT","CHANGE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AAK,CAAC,UAAU,EAAE,MAAM,WAAW,CAAC,KAAK,GAAGH,uBAAW,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACzG,EAAEI,WAAO,CAACC,2BAAkB,EAAE;AAC9B,IAAI,WAAW;AACf,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,cAAc,GAAG,MAAM;AACpC,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,UAAU,CAAC,CAAC;AACtC,EAAE,MAAM,OAAO,GAAGC,YAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,EAAE,OAAO;AACT,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Input from './src/input.vue';
|
|
1
2
|
export declare const ElInput: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
3
|
readonly id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
3
4
|
readonly size: {
|
|
@@ -406,3 +407,4 @@ export declare const ElInput: import("element-plus/es/utils").SFCWithInstall<imp
|
|
|
406
407
|
}>> & Record<string, any>;
|
|
407
408
|
export default ElInput;
|
|
408
409
|
export * from './src/input';
|
|
410
|
+
export declare type InputInstance = InstanceType<typeof Input>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/input/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\n\nimport Input from './src/input.vue'\n\nexport const ElInput = withInstall(Input)\nexport default ElInput\n\nexport * from './src/input'\n"],"names":["withInstall","Input"],"mappings":";;;;;;;;;AAEY,MAAC,OAAO,GAAGA,mBAAW,CAACC,kBAAK;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/input/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\n\nimport Input from './src/input.vue'\n\nexport const ElInput = withInstall(Input)\nexport default ElInput\n\nexport * from './src/input'\n\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":["withInstall","Input"],"mappings":";;;;;;;;;AAEY,MAAC,OAAO,GAAGA,mBAAW,CAACC,kBAAK;;;;;;;"}
|
|
@@ -322,7 +322,6 @@ export declare const ElTreeV2: import("element-plus/es/utils").SFCWithInstall<im
|
|
|
322
322
|
readonly current: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
323
323
|
readonly hiddenExpandIcon: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
324
324
|
}, {
|
|
325
|
-
DEFAULT_ICON: string;
|
|
326
325
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
327
326
|
readonly node: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("./src/types").TreeNode) | (() => import("./src/types").TreeNode) | ((new (...args: any[]) => import("./src/types").TreeNode) | (() => import("./src/types").TreeNode))[], unknown, unknown, () => import("element-plus/es/utils").Mutable<{
|
|
328
327
|
readonly key: -1;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var index$1 = require('../../icon/index.js');
|
|
7
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
7
8
|
var index$2 = require('../../checkbox/index.js');
|
|
8
9
|
require('../../../hooks/index.js');
|
|
9
10
|
var treeNodeContent = require('./tree-node-content.js');
|
|
@@ -12,7 +13,6 @@ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper
|
|
|
12
13
|
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
14
|
|
|
14
15
|
const _hoisted_1 = ["aria-expanded", "aria-disabled", "aria-checked", "data-key", "onClick"];
|
|
15
|
-
const DEFAULT_ICON = "caret-right";
|
|
16
16
|
const __default__ = vue.defineComponent({
|
|
17
17
|
name: "ElTreeNode"
|
|
18
18
|
});
|
|
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
30
30
|
});
|
|
31
31
|
const icon = vue.computed(() => {
|
|
32
32
|
var _a;
|
|
33
|
-
return (_a = tree == null ? void 0 : tree.props.icon) != null ? _a :
|
|
33
|
+
return (_a = tree == null ? void 0 : tree.props.icon) != null ? _a : iconsVue.CaretRight;
|
|
34
34
|
});
|
|
35
35
|
const handleClick = (e) => {
|
|
36
36
|
emit("click", props.node, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node.js","sources":["../../../../../../packages/components/tree-v2/src/tree-node.vue"],"sourcesContent":["<template>\n <div\n ref=\"node$\"\n :class=\"[\n ns.b('node'),\n ns.is('expanded', expanded),\n ns.is('current', current),\n ns.is('focusable', !disabled),\n ns.is('checked', !disabled && checked),\n ]\"\n role=\"treeitem\"\n tabindex=\"-1\"\n :aria-expanded=\"expanded\"\n :aria-disabled=\"disabled\"\n :aria-checked=\"checked\"\n :data-key=\"node?.key\"\n @click.stop=\"handleClick\"\n @contextmenu=\"handleContextMenu\"\n >\n <div\n :class=\"ns.be('node', 'content')\"\n :style=\"{ paddingLeft: `${(node.level - 1) * indent}px` }\"\n >\n <el-icon\n v-if=\"icon\"\n :class=\"[\n ns.is('leaf', !!node?.isLeaf),\n ns.is('hidden', hiddenExpandIcon),\n {\n expanded: !node?.isLeaf && expanded,\n },\n ns.be('node', 'expand-icon'),\n ]\"\n @click.stop=\"handleExpandIconClick\"\n >\n <component :is=\"icon\" />\n </el-icon>\n <el-checkbox\n v-if=\"showCheckbox\"\n :model-value=\"checked\"\n :indeterminate=\"indeterminate\"\n :disabled=\"disabled\"\n @change=\"handleCheckChange\"\n @click.stop\n />\n <el-node-content :node=\"node\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { useNamespace } from '@element-plus/hooks'\nimport ElNodeContent from './tree-node-content'\nimport {\n NODE_CONTEXTMENU,\n ROOT_TREE_INJECTION_KEY,\n treeNodeEmits,\n treeNodeProps,\n} from './virtual-tree'\nimport type { CheckboxValueType } from '@element-plus/components/checkbox'\n\
|
|
1
|
+
{"version":3,"file":"tree-node.js","sources":["../../../../../../packages/components/tree-v2/src/tree-node.vue"],"sourcesContent":["<template>\n <div\n ref=\"node$\"\n :class=\"[\n ns.b('node'),\n ns.is('expanded', expanded),\n ns.is('current', current),\n ns.is('focusable', !disabled),\n ns.is('checked', !disabled && checked),\n ]\"\n role=\"treeitem\"\n tabindex=\"-1\"\n :aria-expanded=\"expanded\"\n :aria-disabled=\"disabled\"\n :aria-checked=\"checked\"\n :data-key=\"node?.key\"\n @click.stop=\"handleClick\"\n @contextmenu=\"handleContextMenu\"\n >\n <div\n :class=\"ns.be('node', 'content')\"\n :style=\"{ paddingLeft: `${(node.level - 1) * indent}px` }\"\n >\n <el-icon\n v-if=\"icon\"\n :class=\"[\n ns.is('leaf', !!node?.isLeaf),\n ns.is('hidden', hiddenExpandIcon),\n {\n expanded: !node?.isLeaf && expanded,\n },\n ns.be('node', 'expand-icon'),\n ]\"\n @click.stop=\"handleExpandIconClick\"\n >\n <component :is=\"icon\" />\n </el-icon>\n <el-checkbox\n v-if=\"showCheckbox\"\n :model-value=\"checked\"\n :indeterminate=\"indeterminate\"\n :disabled=\"disabled\"\n @change=\"handleCheckChange\"\n @click.stop\n />\n <el-node-content :node=\"node\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { CaretRight } from '@element-plus/icons-vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { useNamespace } from '@element-plus/hooks'\nimport ElNodeContent from './tree-node-content'\nimport {\n NODE_CONTEXTMENU,\n ROOT_TREE_INJECTION_KEY,\n treeNodeEmits,\n treeNodeProps,\n} from './virtual-tree'\nimport type { CheckboxValueType } from '@element-plus/components/checkbox'\n\ndefineOptions({\n name: 'ElTreeNode',\n})\n\nconst props = defineProps(treeNodeProps)\nconst emit = defineEmits(treeNodeEmits)\n\nconst tree = inject(ROOT_TREE_INJECTION_KEY)\nconst ns = useNamespace('tree')\n\nconst indent = computed(() => {\n return tree?.props.indent ?? 16\n})\n\nconst icon = computed(() => {\n return tree?.props.icon ?? CaretRight\n})\n\nconst handleClick = (e: MouseEvent) => {\n emit('click', props.node, e)\n}\nconst handleExpandIconClick = () => {\n emit('toggle', props.node)\n}\nconst handleCheckChange = (value: CheckboxValueType) => {\n emit('check', props.node, value)\n}\nconst handleContextMenu = (event: Event) => {\n if (tree?.instance?.vnode?.props?.['onNodeContextmenu']) {\n event.stopPropagation()\n event.preventDefault()\n }\n tree?.ctx.emit(NODE_CONTEXTMENU, event, props.node?.data, props.node)\n}\n</script>\n"],"names":["inject","ROOT_TREE_INJECTION_KEY","useNamespace","computed","CaretRight"],"mappings":";;;;;;;;;;;;;;;uCAiEc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,IAAA,GAAOA,WAAOC,mCAAuB,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAA,GAAKC,mBAAa,MAAM,CAAA,CAAA;AAE9B,IAAM,MAAA,MAAA,GAASC,aAAS,MAAM;AAC5B,MAAO,IAAA,EAAA,CAAA;AAAsB,MAC9B,OAAA,CAAA,EAAA,GAAA,IAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,IAAA,CAAA,KAAA,CAAA,MAAA,KAAA,IAAA,GAAA,EAAA,GAAA,EAAA,CAAA;AAED,KAAM,CAAA,CAAA;AACJ,IAAO,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 declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
readonly current: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
14
14
|
readonly hiddenExpandIcon: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
15
15
|
}, {
|
|
16
|
-
DEFAULT_ICON: string;
|
|
17
16
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
18
17
|
readonly node: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./types").TreeNode) | (() => import("./types").TreeNode) | ((new (...args: any[]) => import("./types").TreeNode) | (() => import("./types").TreeNode))[], unknown, unknown, () => import("../../../utils").Mutable<{
|
|
19
18
|
readonly key: -1;
|
|
@@ -322,7 +322,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
322
322
|
readonly current: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
323
323
|
readonly hiddenExpandIcon: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
324
324
|
}, {
|
|
325
|
-
DEFAULT_ICON: string;
|
|
326
325
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
327
326
|
readonly node: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./types").TreeNode) | (() => import("./types").TreeNode) | ((new (...args: any[]) => import("./types").TreeNode) | (() => import("./types").TreeNode))[], unknown, unknown, () => import("../../../utils").Mutable<{
|
|
328
327
|
readonly key: -1;
|
package/lib/utils/dom/style.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@vueuse/core');
|
|
6
|
-
require('../types.js');
|
|
6
|
+
var types = require('../types.js');
|
|
7
7
|
require('../strings.js');
|
|
8
8
|
var objects = require('../objects.js');
|
|
9
9
|
var error = require('../error.js');
|
|
@@ -67,10 +67,10 @@ const removeStyle = (element, style) => {
|
|
|
67
67
|
function addUnit(value, defaultUnit = "px") {
|
|
68
68
|
if (!value)
|
|
69
69
|
return "";
|
|
70
|
-
if (
|
|
71
|
-
return value;
|
|
72
|
-
} else if (core.isNumber(value)) {
|
|
70
|
+
if (core.isNumber(value) || types.isStringNumber(value)) {
|
|
73
71
|
return `${value}${defaultUnit}`;
|
|
72
|
+
} else if (shared.isString(value)) {
|
|
73
|
+
return value;
|
|
74
74
|
}
|
|
75
75
|
error.debugWarn(SCOPE, "binding value must be a string or number");
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../../packages/utils/dom/style.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { isNumber, isObject, isString } from '../types'\nimport { camelize } from '../strings'\nimport { entriesOf, keysOf } from '../objects'\nimport { debugWarn } from '../error'\nimport type { CSSProperties } from 'vue'\n\nconst SCOPE = 'utils/dom/style'\n\nexport const classNameToArray = (cls = '') =>\n cls.split(' ').filter((item) => !!item.trim())\n\nexport const hasClass = (el: Element, cls: string): boolean => {\n if (!el || !cls) return false\n if (cls.includes(' ')) throw new Error('className should not contain space.')\n return el.classList.contains(cls)\n}\n\nexport const addClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.add(...classNameToArray(cls))\n}\n\nexport const removeClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.remove(...classNameToArray(cls))\n}\n\nexport const getStyle = (\n element: HTMLElement,\n styleName: keyof CSSProperties\n): string => {\n if (!isClient || !element || !styleName) return ''\n\n let key = camelize(styleName)\n if (key === 'float') key = 'cssFloat'\n try {\n const style = (element.style as any)[key]\n if (style) return style\n const computed: any = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[key] : ''\n } catch {\n return (element.style as any)[key]\n }\n}\n\nexport const setStyle = (\n element: HTMLElement,\n styleName: CSSProperties | keyof CSSProperties,\n value?: string | number\n) => {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(([prop, value]) =>\n setStyle(element, prop, value)\n )\n } else {\n const key: any = camelize(styleName)\n element.style[key] = value as any\n }\n}\n\nexport const removeStyle = (\n element: HTMLElement,\n style: CSSProperties | keyof CSSProperties\n) => {\n if (!element || !style) return\n\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop))\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\n if (!value) return ''\n if (
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../../packages/utils/dom/style.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { isNumber, isObject, isString, isStringNumber } from '../types'\nimport { camelize } from '../strings'\nimport { entriesOf, keysOf } from '../objects'\nimport { debugWarn } from '../error'\nimport type { CSSProperties } from 'vue'\n\nconst SCOPE = 'utils/dom/style'\n\nexport const classNameToArray = (cls = '') =>\n cls.split(' ').filter((item) => !!item.trim())\n\nexport const hasClass = (el: Element, cls: string): boolean => {\n if (!el || !cls) return false\n if (cls.includes(' ')) throw new Error('className should not contain space.')\n return el.classList.contains(cls)\n}\n\nexport const addClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.add(...classNameToArray(cls))\n}\n\nexport const removeClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.remove(...classNameToArray(cls))\n}\n\nexport const getStyle = (\n element: HTMLElement,\n styleName: keyof CSSProperties\n): string => {\n if (!isClient || !element || !styleName) return ''\n\n let key = camelize(styleName)\n if (key === 'float') key = 'cssFloat'\n try {\n const style = (element.style as any)[key]\n if (style) return style\n const computed: any = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[key] : ''\n } catch {\n return (element.style as any)[key]\n }\n}\n\nexport const setStyle = (\n element: HTMLElement,\n styleName: CSSProperties | keyof CSSProperties,\n value?: string | number\n) => {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(([prop, value]) =>\n setStyle(element, prop, value)\n )\n } else {\n const key: any = camelize(styleName)\n element.style[key] = value as any\n }\n}\n\nexport const removeStyle = (\n element: HTMLElement,\n style: CSSProperties | keyof CSSProperties\n) => {\n if (!element || !style) return\n\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop))\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\n if (!value) return ''\n if (isNumber(value) || isStringNumber(value)) {\n return `${value}${defaultUnit}`\n } else if (isString(value)) {\n return value\n }\n debugWarn(SCOPE, 'binding value must be a string or number')\n}\n"],"names":["isClient","camelize","isObject","entriesOf","keysOf","isNumber","isStringNumber","isString","debugWarn"],"mappings":";;;;;;;;;;;AAKA,MAAM,KAAK,GAAG,iBAAiB,CAAC;AACpB,MAAC,gBAAgB,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;AACjF,MAAC,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK;AACrC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG;AACjB,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AACvB,IAAI,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;AAC3D,EAAE,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpC,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK;AACrC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;AACxB,IAAI,OAAO;AACX,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC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ils/index.js
CHANGED
|
@@ -56,6 +56,7 @@ exports.escapeStringRegexp = strings.escapeStringRegexp;
|
|
|
56
56
|
exports.isElement = types.isElement;
|
|
57
57
|
exports.isEmpty = types.isEmpty;
|
|
58
58
|
exports.isPropAbsent = types.isPropAbsent;
|
|
59
|
+
exports.isStringNumber = types.isStringNumber;
|
|
59
60
|
exports.isUndefined = types.isUndefined;
|
|
60
61
|
exports.mutable = typescript.mutable;
|
|
61
62
|
exports.attemptFocus = aria.attemptFocus;
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/utils/types.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare const isUndefined: (val: any) => val is undefined;
|
|
|
5
5
|
export declare const isEmpty: (val: unknown) => boolean;
|
|
6
6
|
export declare const isElement: (e: unknown) => e is Element;
|
|
7
7
|
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
|
|
8
|
+
export declare const isStringNumber: (val: string) => boolean;
|
package/lib/utils/types.js
CHANGED
|
@@ -17,6 +17,12 @@ const isElement = (e) => {
|
|
|
17
17
|
const isPropAbsent = (prop) => {
|
|
18
18
|
return lodashUnified.isNil(prop);
|
|
19
19
|
};
|
|
20
|
+
const isStringNumber = (val) => {
|
|
21
|
+
if (!shared.isString(val)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return !Number.isNaN(Number(val));
|
|
25
|
+
};
|
|
20
26
|
|
|
21
27
|
Object.defineProperty(exports, 'isArray', {
|
|
22
28
|
enumerable: true,
|
|
@@ -61,5 +67,6 @@ Object.defineProperty(exports, 'isVNode', {
|
|
|
61
67
|
exports.isElement = isElement;
|
|
62
68
|
exports.isEmpty = isEmpty;
|
|
63
69
|
exports.isPropAbsent = isPropAbsent;
|
|
70
|
+
exports.isStringNumber = isStringNumber;
|
|
64
71
|
exports.isUndefined = isUndefined;
|
|
65
72
|
//# sourceMappingURL=types.js.map
|
package/lib/utils/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n"],"names":["isArray","isObject","isNil"],"mappings":";;;;;;;;;AAaY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAIA,cAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAIC,eAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK;AAChC,EAAE,IAAI,OAAO,OAAO,KAAK,WAAW;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,OAAO,CAAC,YAAY,OAAO,CAAC;AAC9B,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,OAAOC,mBAAK,CAAC,IAAI,CAAC,CAAC;AACrB
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n\nexport const isStringNumber = (val: string): boolean => {\n if (!isString(val)) {\n return false\n }\n return !Number.isNaN(Number(val))\n}\n"],"names":["isArray","isObject","isNil","isString"],"mappings":";;;;;;;;;AAaY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAIA,cAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAIC,eAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK;AAChC,EAAE,IAAI,OAAO,OAAO,KAAK,WAAW;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,OAAO,CAAC,YAAY,OAAO,CAAC;AAC9B,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,OAAOC,mBAAK,CAAC,IAAI,CAAC,CAAC;AACrB,EAAE;AACU,MAAC,cAAc,GAAG,CAAC,GAAG,KAAK;AACvC,EAAE,IAAI,CAACC,eAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20221102";
|