element-ps 1.0.11 → 1.0.15

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.
Files changed (146) hide show
  1. package/dist/index.full.js +165 -146
  2. package/dist/index.full.min.js +4 -4
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +4 -4
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +164 -147
  7. package/es/components/descriptions/index.d.ts +14 -2
  8. package/es/components/descriptions/src/description-item.d.ts +7 -1
  9. package/es/components/descriptions/src/descriptions.type.d.ts +1 -0
  10. package/es/components/input-number/index.d.ts +2 -0
  11. package/es/components/input-number/src/input-number.vue.d.ts +2 -0
  12. package/es/components/rate/index.d.ts +75 -246
  13. package/es/components/rate/src/rate.d.ts +26 -0
  14. package/es/components/rate/src/rate.vue.d.ts +108 -0
  15. package/es/index.mjs +6 -5
  16. package/es/index.mjs.map +1 -1
  17. package/es/packages/components/affix/index.mjs +2 -2
  18. package/es/packages/components/affix/src/affix.mjs +22 -5
  19. package/es/packages/components/affix/src/affix.mjs.map +1 -1
  20. package/es/packages/components/affix/src/affix.vue_vue&type=script&lang.mjs +1 -1
  21. package/es/packages/components/affix/src/affix2.mjs +5 -22
  22. package/es/packages/components/affix/src/affix2.mjs.map +1 -1
  23. package/es/packages/components/backtop/index.mjs +2 -2
  24. package/es/packages/components/backtop/src/backtop.mjs +5 -19
  25. package/es/packages/components/backtop/src/backtop.mjs.map +1 -1
  26. package/es/packages/components/backtop/src/backtop.vue_vue&type=script&lang.mjs +1 -1
  27. package/es/packages/components/backtop/src/backtop2.mjs +19 -5
  28. package/es/packages/components/backtop/src/backtop2.mjs.map +1 -1
  29. package/es/packages/components/cascader/src/index.vue_vue&type=script&lang.mjs.map +1 -1
  30. package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs +8 -6
  31. package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs.map +1 -1
  32. package/es/packages/components/descriptions/src/description-item.mjs +3 -0
  33. package/es/packages/components/descriptions/src/description-item.mjs.map +1 -1
  34. package/es/packages/components/descriptions/src/descriptions-cell.mjs +2 -1
  35. package/es/packages/components/descriptions/src/descriptions-cell.mjs.map +1 -1
  36. package/es/packages/components/empty/index.mjs +2 -2
  37. package/es/packages/components/empty/src/empty.mjs +12 -5
  38. package/es/packages/components/empty/src/empty.mjs.map +1 -1
  39. package/es/packages/components/empty/src/empty.vue_vue&type=script&lang.mjs +1 -1
  40. package/es/packages/components/empty/src/empty2.mjs +5 -12
  41. package/es/packages/components/empty/src/empty2.mjs.map +1 -1
  42. package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs.map +1 -1
  43. package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs +10 -8
  44. package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map +1 -1
  45. package/es/packages/components/image-viewer/index.mjs +2 -2
  46. package/es/packages/components/image-viewer/src/image-viewer.mjs +5 -25
  47. package/es/packages/components/image-viewer/src/image-viewer.mjs.map +1 -1
  48. package/es/packages/components/image-viewer/src/image-viewer.vue_vue&type=script&lang.mjs +1 -1
  49. package/es/packages/components/image-viewer/src/image-viewer2.mjs +25 -5
  50. package/es/packages/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  51. package/es/packages/components/index.mjs +6 -5
  52. package/es/packages/components/index.mjs.map +1 -1
  53. package/es/packages/components/input-number/index.mjs +2 -2
  54. package/es/packages/components/input-number/src/input-number.mjs +49 -5
  55. package/es/packages/components/input-number/src/input-number.mjs.map +1 -1
  56. package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs +5 -3
  57. package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs.map +1 -1
  58. package/es/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.mjs.map +1 -1
  59. package/es/packages/components/input-number/src/input-number2.mjs +5 -49
  60. package/es/packages/components/input-number/src/input-number2.mjs.map +1 -1
  61. package/es/packages/components/rate/index.mjs +6 -8
  62. package/es/packages/components/rate/index.mjs.map +1 -1
  63. package/es/packages/components/rate/src/rate.mjs +87 -0
  64. package/es/packages/components/rate/src/rate.mjs.map +1 -0
  65. package/es/packages/components/rate/src/{index.vue_vue&type=script&lang.mjs → rate.vue_vue&type=script&lang.mjs} +19 -88
  66. package/es/packages/components/rate/src/rate.vue_vue&type=script&lang.mjs.map +1 -0
  67. package/es/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.mjs → rate.vue_vue&type=template&id=38c42df6&lang.mjs} +1 -1
  68. package/es/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.mjs.map +1 -0
  69. package/es/packages/components/rate/src/rate2.mjs +7 -0
  70. package/es/packages/components/rate/src/rate2.mjs.map +1 -0
  71. package/lib/components/descriptions/index.d.ts +14 -2
  72. package/lib/components/descriptions/src/description-item.d.ts +7 -1
  73. package/lib/components/descriptions/src/descriptions.type.d.ts +1 -0
  74. package/lib/components/input-number/index.d.ts +2 -0
  75. package/lib/components/input-number/src/input-number.vue.d.ts +2 -0
  76. package/lib/components/rate/index.d.ts +75 -246
  77. package/lib/components/rate/src/rate.d.ts +26 -0
  78. package/lib/components/rate/src/rate.vue.d.ts +108 -0
  79. package/lib/index.js +8 -5
  80. package/lib/index.js.map +1 -1
  81. package/lib/packages/components/affix/index.js +2 -2
  82. package/lib/packages/components/affix/src/affix.js +21 -5
  83. package/lib/packages/components/affix/src/affix.js.map +1 -1
  84. package/lib/packages/components/affix/src/affix.vue_vue&type=script&lang.js +1 -1
  85. package/lib/packages/components/affix/src/affix2.js +5 -21
  86. package/lib/packages/components/affix/src/affix2.js.map +1 -1
  87. package/lib/packages/components/backtop/index.js +2 -2
  88. package/lib/packages/components/backtop/src/backtop.js +6 -19
  89. package/lib/packages/components/backtop/src/backtop.js.map +1 -1
  90. package/lib/packages/components/backtop/src/backtop.vue_vue&type=script&lang.js +1 -1
  91. package/lib/packages/components/backtop/src/backtop2.js +19 -6
  92. package/lib/packages/components/backtop/src/backtop2.js.map +1 -1
  93. package/lib/packages/components/cascader/src/index.vue_vue&type=script&lang.js.map +1 -1
  94. package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js +8 -6
  95. package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js.map +1 -1
  96. package/lib/packages/components/descriptions/src/description-item.js +3 -0
  97. package/lib/packages/components/descriptions/src/description-item.js.map +1 -1
  98. package/lib/packages/components/descriptions/src/descriptions-cell.js +2 -1
  99. package/lib/packages/components/descriptions/src/descriptions-cell.js.map +1 -1
  100. package/lib/packages/components/empty/index.js +2 -2
  101. package/lib/packages/components/empty/src/empty.js +12 -6
  102. package/lib/packages/components/empty/src/empty.js.map +1 -1
  103. package/lib/packages/components/empty/src/empty.vue_vue&type=script&lang.js +1 -1
  104. package/lib/packages/components/empty/src/empty2.js +6 -12
  105. package/lib/packages/components/empty/src/empty2.js.map +1 -1
  106. package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js.map +1 -1
  107. package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js +10 -8
  108. package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js.map +1 -1
  109. package/lib/packages/components/image-viewer/index.js +2 -2
  110. package/lib/packages/components/image-viewer/src/image-viewer.js +5 -24
  111. package/lib/packages/components/image-viewer/src/image-viewer.js.map +1 -1
  112. package/lib/packages/components/image-viewer/src/image-viewer.vue_vue&type=script&lang.js +1 -1
  113. package/lib/packages/components/image-viewer/src/image-viewer2.js +24 -5
  114. package/lib/packages/components/image-viewer/src/image-viewer2.js.map +1 -1
  115. package/lib/packages/components/index.js +8 -5
  116. package/lib/packages/components/index.js.map +1 -1
  117. package/lib/packages/components/input-number/index.js +2 -2
  118. package/lib/packages/components/input-number/src/input-number.js +48 -5
  119. package/lib/packages/components/input-number/src/input-number.js.map +1 -1
  120. package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js +5 -3
  121. package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js.map +1 -1
  122. package/lib/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.js.map +1 -1
  123. package/lib/packages/components/input-number/src/input-number2.js +5 -48
  124. package/lib/packages/components/input-number/src/input-number2.js.map +1 -1
  125. package/lib/packages/components/rate/index.js +8 -8
  126. package/lib/packages/components/rate/index.js.map +1 -1
  127. package/lib/packages/components/rate/src/rate.js +92 -0
  128. package/lib/packages/components/rate/src/rate.js.map +1 -0
  129. package/lib/packages/components/rate/src/{index.vue_vue&type=script&lang.js → rate.vue_vue&type=script&lang.js} +19 -88
  130. package/lib/packages/components/rate/src/rate.vue_vue&type=script&lang.js.map +1 -0
  131. package/lib/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.js → rate.vue_vue&type=template&id=38c42df6&lang.js} +1 -1
  132. package/lib/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.js.map +1 -0
  133. package/lib/packages/components/rate/src/rate2.js +12 -0
  134. package/lib/packages/components/rate/src/rate2.js.map +1 -0
  135. package/package.json +1 -1
  136. package/web-types.json +1 -1
  137. package/es/components/rate/src/index.vue.d.ts +0 -141
  138. package/es/packages/components/rate/src/index.mjs +0 -7
  139. package/es/packages/components/rate/src/index.mjs.map +0 -1
  140. package/es/packages/components/rate/src/index.vue_vue&type=script&lang.mjs.map +0 -1
  141. package/es/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.mjs.map +0 -1
  142. package/lib/components/rate/src/index.vue.d.ts +0 -141
  143. package/lib/packages/components/rate/src/index.js +0 -12
  144. package/lib/packages/components/rate/src/index.js.map +0 -1
  145. package/lib/packages/components/rate/src/index.vue_vue&type=script&lang.js.map +0 -1
  146. package/lib/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.js.map +0 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var affix = require('./affix2.js');
6
+ var affix = require('./affix.js');
7
7
 
8
8
  var script = vue.defineComponent({
9
9
  name: "PsAffix",
@@ -2,27 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var props = require('../../../utils/props.js');
5
+ var affix_vue_vue_type_script_lang = require('./affix.vue_vue&type=script&lang.js');
6
+ var affix_vue_vue_type_template_id_0745df9e_lang = require('./affix.vue_vue&type=template&id=0745df9e&lang.js');
6
7
 
7
- const affixProps = props.buildProps({
8
- zIndex: {
9
- type: props.definePropType([Number, String]),
10
- default: 100
11
- },
12
- target: {
13
- type: String,
14
- default: ""
15
- },
16
- offset: {
17
- type: Number,
18
- default: 0
19
- },
20
- position: {
21
- type: String,
22
- values: ["top", "bottom"],
23
- default: "top"
24
- }
25
- });
8
+ affix_vue_vue_type_script_lang["default"].render = affix_vue_vue_type_template_id_0745df9e_lang.render;
9
+ affix_vue_vue_type_script_lang["default"].__file = "packages/components/affix/src/affix.vue";
26
10
 
27
- exports.affixProps = affixProps;
11
+ exports["default"] = affix_vue_vue_type_script_lang["default"];
28
12
  //# sourceMappingURL=affix2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"affix2.js","sources":["../../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\n\nexport const affixProps = buildProps({\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n target: {\n type: String,\n default: '',\n },\n offset: {\n type: Number,\n default: 0,\n },\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;MAKa,aAAaA,iBAAW;AAAA,EACnC,QAAQ;AAAA,IACN,MAAMC,qBAA+B,CAAC,QAAQ;AAAA,IAC9C,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,UAAU;AAAA,IACR,MAAM;AAAA,IACN,QAAQ,CAAC,OAAO;AAAA,IAChB,SAAS;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"affix2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('../../utils/with-install.js');
6
- require('./src/backtop2.js');
7
- var backtop = require('./src/backtop.js');
6
+ require('./src/backtop.js');
7
+ var backtop = require('./src/backtop2.js');
8
8
  var backtop_vue_vue_type_script_lang = require('./src/backtop.vue_vue&type=script&lang.js');
9
9
 
10
10
  const PsBacktop = withInstall.withInstall(backtop_vue_vue_type_script_lang["default"]);
@@ -2,24 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const backtopProps = {
6
- visibilityHeight: {
7
- type: Number,
8
- default: 200
9
- },
10
- target: {
11
- type: String,
12
- default: ""
13
- },
14
- right: {
15
- type: Number,
16
- default: 40
17
- },
18
- bottom: {
19
- type: Number,
20
- default: 40
21
- }
22
- };
5
+ var backtop_vue_vue_type_script_lang = require('./backtop.vue_vue&type=script&lang.js');
6
+ var backtop_vue_vue_type_template_id_63a7fea6_lang = require('./backtop.vue_vue&type=template&id=63a7fea6&lang.js');
23
7
 
24
- exports.backtopProps = backtopProps;
8
+ backtop_vue_vue_type_script_lang["default"].render = backtop_vue_vue_type_template_id_63a7fea6_lang.render;
9
+ backtop_vue_vue_type_script_lang["default"].__file = "packages/components/backtop/src/backtop.vue";
10
+
11
+ exports["default"] = backtop_vue_vue_type_script_lang["default"];
25
12
  //# sourceMappingURL=backtop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backtop.js","sources":["../../../../../../../packages/components/backtop/src/backtop.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const backtopProps = {\n visibilityHeight: {\n type: Number,\n default: 200,\n },\n target: {\n type: String,\n default: '',\n },\n right: {\n type: Number,\n default: 40,\n },\n bottom: {\n type: Number,\n default: 40,\n },\n} as const\nexport type BacktopProps = ExtractPropTypes<typeof backtopProps>\n"],"names":[],"mappings":";;;;MAEa,eAAe;AAAA,EAC1B,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"backtop.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var error = require('../../../utils/error.js');
7
- var backtop = require('./backtop.js');
7
+ var backtop = require('./backtop2.js');
8
8
  var index = require('../../icon/index.js');
9
9
  var icons = require('@element-plus/icons');
10
10
 
@@ -2,11 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var backtop_vue_vue_type_script_lang = require('./backtop.vue_vue&type=script&lang.js');
6
- var backtop_vue_vue_type_template_id_63a7fea6_lang = require('./backtop.vue_vue&type=template&id=63a7fea6&lang.js');
5
+ const backtopProps = {
6
+ visibilityHeight: {
7
+ type: Number,
8
+ default: 200
9
+ },
10
+ target: {
11
+ type: String,
12
+ default: ""
13
+ },
14
+ right: {
15
+ type: Number,
16
+ default: 40
17
+ },
18
+ bottom: {
19
+ type: Number,
20
+ default: 40
21
+ }
22
+ };
7
23
 
8
- backtop_vue_vue_type_script_lang["default"].render = backtop_vue_vue_type_template_id_63a7fea6_lang.render;
9
- backtop_vue_vue_type_script_lang["default"].__file = "packages/components/backtop/src/backtop.vue";
10
-
11
- exports["default"] = backtop_vue_vue_type_script_lang["default"];
24
+ exports.backtopProps = backtopProps;
12
25
  //# sourceMappingURL=backtop2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backtop2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"backtop2.js","sources":["../../../../../../../packages/components/backtop/src/backtop.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const backtopProps = {\n visibilityHeight: {\n type: Number,\n default: 200,\n },\n target: {\n type: String,\n default: '',\n },\n right: {\n type: Number,\n default: 40,\n },\n bottom: {\n type: Number,\n default: 40,\n },\n} as const\nexport type BacktopProps = ExtractPropTypes<typeof backtopProps>\n"],"names":[],"mappings":";;;;MAEa,eAAe;AAAA,EAC1B,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/cascader/src/index.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'el-cascader',\n realSize && `el-cascader--${realSize}`,\n { 'is-disabled': isDisabled },\n ]\"\n >\n <ps-input\n ref='input'\n v-model.trim='inputValue'\n :placeholder='inputPlaceholder'\n :readonly='readonly'\n :disabled='isDisabled'\n :validate-event='false'\n :size='realSize'\n :class=\"{ 'is-focus': popperVisible }\"\n >\n <template #suffix>\n <ps-icon\n v-if='clearBtnVisible'\n key='clear'\n class='el-input__icon icon-circle-close'\n >\n <circle-close />\n </ps-icon>\n <ps-icon\n v-else\n key='arrow-down'\n :class=\"[\n 'el-input__icon',\n 'icon-arrow-down',\n ]\"\n >\n <arrow-down />\n </ps-icon>\n </template>\n </ps-input>\n\n <div v-if='multiple' ref='tagWrapper' class='el-cascader__tags'>\n <ps-tag\n v-for='tag in presentTags'\n :key='tag.key'\n type='info'\n :size='tagSize'\n :hit='tag.hitState'\n :closable='tag.closable'\n disable-transitions\n >\n <span>{{ tag.text }}</span>\n </ps-tag>\n <input\n v-if='filterable && !isDisabled'\n v-model.trim='searchInputValue'\n type='text'\n class='el-cascader__search-input'\n :placeholder=\"presentText ? '' : inputPlaceholder\"\n />\n </div>\n </div>\n</template>\n\n<script lang='ts'>\nimport {\n computed,\n defineComponent,\n inject,\n onMounted,\n ref,\n} from 'vue'\n\nimport PsCascaderPanel, {\n CommonProps\n} from '@element-ps/components/cascader-panel'\nimport PsInput from '@element-ps/components/input'\nimport PsTag from '@element-ps/components/tag'\nimport PsIcon from '@element-ps/components/icon'\n\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\n\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose, Check, ArrowDown } from '@element-plus/icons'\n\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type {\n CascaderNode,\n Tag\n} from '@element-ps/components/cascader-panel'\nimport type { ComponentSize } from '@element-ps/utils/types'\n\ntype cascaderPanelType = InstanceType<typeof PsCascaderPanel>\ntype inputType = InstanceType<typeof PsInput>\n\nconst DEFAULT_INPUT_HEIGHT = 40\n\nconst INPUT_HEIGHT_MAP = {\n medium: 36,\n small: 32,\n mini: 28\n}\n\nexport default defineComponent({\n name: 'PsCascader',\n components: {\n PsInput,\n PsTag,\n PsIcon,\n CircleClose,\n Check,\n ArrowDown\n },\n props: {\n ...CommonProps,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize\n },\n placeholder: {\n type: String\n },\n disabled: Boolean,\n clearable: Boolean,\n filterable: Boolean,\n filterMethod: {\n type: Function as PropType<(node: CascaderNode, keyword: string) => boolean>,\n default: (node: CascaderNode, keyword: string) =>\n node.text.includes(keyword)\n },\n separator: {\n type: String,\n default: ' / '\n },\n showAllLevels: {\n type: Boolean,\n default: true\n },\n collapseTags: Boolean,\n debounce: {\n type: Number,\n default: 300\n },\n beforeFilter: {\n type: Function as PropType<(value: string) => boolean | Promise<any>>,\n default: () => true\n },\n popperClass: {\n type: String,\n default: ''\n },\n popperAppendToBody: {\n type: Boolean,\n default: true\n },\n widget: {\n type: String\n }\n },\n setup(props) {\n let inputInitialHeight = 0\n\n const { t } = useLocaleInject()\n const $ELEMENT = useGlobalConfig()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n\n const input: Ref<inputType | null> = ref(null)\n const tagWrapper = ref(null)\n const panel: Ref<cascaderPanelType | null> = ref(null)\n const inputHover = ref(false)\n const filtering = ref(false)\n const inputValue = ref('')\n const searchInputValue = ref('')\n const presentTags: Ref<Tag[]> = ref([])\n\n const isDisabled = computed(() => props.disabled || elForm.disabled)\n const inputPlaceholder = computed(\n () => props.placeholder || t('el.cascader.placeholder')\n )\n const realSize: ComputedRef<ComponentSize> = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n const tagSize = computed(() =>\n ['small', 'mini'].includes(realSize.value) ? 'mini' : 'small'\n )\n const multiple = computed(() => !!props.props.multiple)\n const readonly = computed(() => !props.filterable || multiple.value)\n\n const checkedNodes: ComputedRef<CascaderNode[]> = computed(\n () => panel.value?.checkedNodes || []\n )\n const clearBtnVisible = computed(() => {\n if (\n !props.clearable ||\n isDisabled.value ||\n filtering.value ||\n !inputHover.value\n )\n return false\n\n return !!checkedNodes.value.length\n })\n const presentText = computed(() => {\n const { showAllLevels, separator } = props\n const nodes = checkedNodes.value\n return nodes.length\n ? multiple.value\n ? ' '\n : nodes[0].calcText(showAllLevels, separator)\n : ''\n })\n\n onMounted(() => {\n const inputEl = input.value?.$el\n inputInitialHeight =\n inputEl?.offsetHeight ||\n INPUT_HEIGHT_MAP[realSize.value] ||\n DEFAULT_INPUT_HEIGHT\n })\n\n return {\n input,\n tagWrapper,\n inputPlaceholder,\n presentText,\n inputValue,\n searchInputValue,\n presentTags,\n isDisabled,\n realSize,\n tagSize,\n multiple,\n readonly,\n clearBtnVisible,\n }\n }\n})\n</script>\n"],"names":["defineComponent","PsInput","PsTag","PsIcon","CircleClose","Check","ArrowDown","CommonProps","isValidComponentSize","useLocaleInject","useGlobalConfig","inject","elFormKey","elFormItemKey","ref","computed"],"mappings":";;;;;;;;;;;;;;;;;;AAgGA,MAAM,uBAAuB;AAE7B,MAAM,mBAAmB;AAAA,EACvB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA;AAGR,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,aACVC;AAAA,WACAC;AAAA,YACAC;AAAA,iBACAC;AAAA,WACAC;AAAA,eACAC;AAAA;AAAA,EAEF,OAAO;AAAA,OACFC;AAAA,IACH,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAWC;AAAA;AAAA,IAEb,aAAa;AAAA,MACX,MAAM;AAAA;AAAA,IAER,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,CAAC,MAAoB,YAC5B,KAAK,KAAK,SAAS;AAAA;AAAA,IAEvB,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,cAAc;AAAA,IACd,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AA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E,eAAe,cAAc;AACrC,YAAM,QAAQ,aAAa;AAC3B,aAAO,MAAM,SACT,SAAS,QACP,MACA,MAAM,GAAG,SAAS,eAAe,aACnC;AAAA;AAGN,kBAAU,MAAM;;AACd,YAAM,UAAU,YAAM,UAAN,mBAAa;AAC7B,2BACE,oCAAS,iBACT,iBAAiB,SAAS,UAC1B;AAAA;AAGJ,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/cascader/src/index.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'el-cascader',\n realSize && `el-cascader--${realSize}`,\n { 'is-disabled': isDisabled },\n ]\"\n :widget=\"widget\"\n >\n <ps-input\n ref='input'\n v-model.trim='inputValue'\n :placeholder='inputPlaceholder'\n :readonly='readonly'\n :disabled='isDisabled'\n :validate-event='false'\n :size='realSize'\n :class=\"{ 'is-focus': popperVisible }\"\n >\n <template #suffix>\n <ps-icon\n v-if='clearBtnVisible'\n key='clear'\n class='el-input__icon icon-circle-close'\n >\n <circle-close />\n </ps-icon>\n <ps-icon\n v-else\n key='arrow-down'\n :class=\"[\n 'el-input__icon',\n 'icon-arrow-down',\n ]\"\n >\n <arrow-down />\n </ps-icon>\n </template>\n </ps-input>\n\n <div v-if='multiple' ref='tagWrapper' class='el-cascader__tags'>\n <ps-tag\n v-for='tag in presentTags'\n :key='tag.key'\n type='info'\n :size='tagSize'\n :hit='tag.hitState'\n :closable='tag.closable'\n disable-transitions\n >\n <span>{{ tag.text }}</span>\n </ps-tag>\n <input\n v-if='filterable && !isDisabled'\n v-model.trim='searchInputValue'\n type='text'\n class='el-cascader__search-input'\n :placeholder=\"presentText ? '' : inputPlaceholder\"\n />\n </div>\n </div>\n</template>\n\n<script lang='ts'>\nimport {\n computed,\n defineComponent,\n inject,\n onMounted,\n ref,\n} from 'vue'\n\nimport PsCascaderPanel, {\n CommonProps\n} from '@element-ps/components/cascader-panel'\nimport PsInput from '@element-ps/components/input'\nimport PsTag from '@element-ps/components/tag'\nimport PsIcon from '@element-ps/components/icon'\n\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\n\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose, Check, ArrowDown } from '@element-plus/icons'\n\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type {\n CascaderNode,\n Tag\n} from '@element-ps/components/cascader-panel'\nimport type { ComponentSize } from '@element-ps/utils/types'\n\ntype cascaderPanelType = InstanceType<typeof PsCascaderPanel>\ntype inputType = InstanceType<typeof PsInput>\n\nconst DEFAULT_INPUT_HEIGHT = 40\n\nconst INPUT_HEIGHT_MAP = {\n medium: 36,\n small: 32,\n mini: 28\n}\n\nexport default defineComponent({\n name: 'PsCascader',\n components: {\n PsInput,\n PsTag,\n PsIcon,\n CircleClose,\n Check,\n ArrowDown\n },\n props: {\n ...CommonProps,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize\n },\n placeholder: {\n type: String\n },\n disabled: Boolean,\n clearable: Boolean,\n filterable: Boolean,\n filterMethod: {\n type: Function as PropType<(node: CascaderNode, keyword: string) => boolean>,\n default: (node: CascaderNode, keyword: string) =>\n node.text.includes(keyword)\n },\n separator: {\n type: String,\n default: ' / '\n },\n showAllLevels: {\n type: Boolean,\n default: true\n },\n collapseTags: Boolean,\n debounce: {\n type: Number,\n default: 300\n },\n beforeFilter: {\n type: Function as PropType<(value: string) => boolean | Promise<any>>,\n default: () => true\n },\n popperClass: {\n type: String,\n default: ''\n },\n popperAppendToBody: {\n type: Boolean,\n default: true\n },\n widget: {\n type: String\n }\n },\n setup(props) {\n let inputInitialHeight = 0\n\n const { t } = useLocaleInject()\n const $ELEMENT = useGlobalConfig()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n\n const input: Ref<inputType | null> = ref(null)\n const tagWrapper = ref(null)\n const panel: Ref<cascaderPanelType | null> = ref(null)\n const inputHover = ref(false)\n const filtering = ref(false)\n const inputValue = ref('')\n const searchInputValue = ref('')\n const presentTags: Ref<Tag[]> = ref([])\n\n const isDisabled = computed(() => props.disabled || elForm.disabled)\n const inputPlaceholder = computed(\n () => props.placeholder || t('el.cascader.placeholder')\n )\n const realSize: ComputedRef<ComponentSize> = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n const tagSize = computed(() =>\n ['small', 'mini'].includes(realSize.value) ? 'mini' : 'small'\n )\n const multiple = computed(() => !!props.props.multiple)\n const readonly = computed(() => !props.filterable || multiple.value)\n\n const checkedNodes: ComputedRef<CascaderNode[]> = computed(\n () => panel.value?.checkedNodes || []\n )\n const clearBtnVisible = computed(() => {\n if (\n !props.clearable ||\n isDisabled.value ||\n filtering.value ||\n !inputHover.value\n )\n return false\n\n return !!checkedNodes.value.length\n })\n const presentText = computed(() => {\n const { showAllLevels, separator } = props\n const nodes = checkedNodes.value\n return nodes.length\n ? multiple.value\n ? ' '\n : nodes[0].calcText(showAllLevels, separator)\n : ''\n })\n\n onMounted(() => {\n const inputEl = input.value?.$el\n inputInitialHeight =\n inputEl?.offsetHeight ||\n INPUT_HEIGHT_MAP[realSize.value] ||\n DEFAULT_INPUT_HEIGHT\n })\n\n return {\n input,\n tagWrapper,\n inputPlaceholder,\n presentText,\n inputValue,\n searchInputValue,\n presentTags,\n isDisabled,\n realSize,\n tagSize,\n multiple,\n readonly,\n clearBtnVisible,\n }\n }\n})\n</script>\n"],"names":["defineComponent","PsInput","PsTag","PsIcon","CircleClose","Check","ArrowDown","CommonProps","isValidComponentSize","useLocaleInject","useGlobalConf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vue = require('vue');
6
6
 
7
- const _hoisted_1 = {
7
+ const _hoisted_1 = ["widget"];
8
+ const _hoisted_2 = {
8
9
  key: 0,
9
10
  ref: "tagWrapper",
10
11
  class: "el-cascader__tags"
11
12
  };
12
- const _hoisted_2 = ["placeholder"];
13
+ const _hoisted_3 = ["placeholder"];
13
14
  function render(_ctx, _cache, $props, $setup, $data, $options) {
14
15
  const _component_circle_close = vue.resolveComponent("circle-close");
15
16
  const _component_ps_icon = vue.resolveComponent("ps-icon");
@@ -21,7 +22,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
21
22
  "el-cascader",
22
23
  _ctx.realSize && `el-cascader--${_ctx.realSize}`,
23
24
  { "is-disabled": _ctx.isDisabled }
24
- ])
25
+ ]),
26
+ widget: _ctx.widget
25
27
  }, [
26
28
  vue.createVNode(_component_ps_input, {
27
29
  ref: "input",
@@ -59,7 +61,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
59
61
  ]),
60
62
  _: 1
61
63
  }, 8, ["modelValue", "placeholder", "readonly", "disabled", "size", "class"]),
62
- _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
64
+ _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
63
65
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.presentTags, (tag) => {
64
66
  return vue.openBlock(), vue.createBlock(_component_ps_tag, {
65
67
  key: tag.key,
@@ -81,7 +83,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
81
83
  type: "text",
82
84
  class: "el-cascader__search-input",
83
85
  placeholder: _ctx.presentText ? "" : _ctx.inputPlaceholder
84
- }, null, 8, _hoisted_2)), [
86
+ }, null, 8, _hoisted_3)), [
85
87
  [
86
88
  vue.vModelText,
87
89
  _ctx.searchInputValue,
@@ -90,7 +92,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
90
92
  ]
91
93
  ]) : vue.createCommentVNode("v-if", true)
92
94
  ], 512)) : vue.createCommentVNode("v-if", true)
93
- ], 2);
95
+ ], 10, _hoisted_1);
94
96
  }
95
97
 
96
98
  exports.render = render;
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue_vue&type=template&id=0429c2db&lang.js","sources":["../../../../../../../packages/components/cascader/src/index.vue?vue&type=template&id=0429c2db&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'el-cascader',\n realSize && `el-cascader--${realSize}`,\n { 'is-disabled': isDisabled },\n ]\"\n >\n <ps-input\n ref='input'\n v-model.trim='inputValue'\n :placeholder='inputPlaceholder'\n :readonly='readonly'\n :disabled='isDisabled'\n :validate-event='false'\n :size='realSize'\n :class=\"{ 'is-focus': popperVisible }\"\n >\n <template #suffix>\n <ps-icon\n v-if='clearBtnVisible'\n key='clear'\n class='el-input__icon icon-circle-close'\n >\n <circle-close />\n </ps-icon>\n <ps-icon\n v-else\n key='arrow-down'\n :class=\"[\n 'el-input__icon',\n 'icon-arrow-down',\n ]\"\n >\n <arrow-down />\n </ps-icon>\n </template>\n </ps-input>\n\n <div v-if='multiple' ref='tagWrapper' class='el-cascader__tags'>\n <ps-tag\n v-for='tag in presentTags'\n :key='tag.key'\n type='info'\n :size='tagSize'\n :hit='tag.hitState'\n :closable='tag.closable'\n disable-transitions\n >\n <span>{{ tag.text }}</span>\n </ps-tag>\n <input\n v-if='filterable && !isDisabled'\n v-model.trim='searchInputValue'\n type='text'\n class='el-cascader__search-input'\n :placeholder=\"presentText ? '' : inputPlaceholder\"\n />\n </div>\n </div>\n</template>\n\n<script lang='ts'>\nimport {\n computed,\n defineComponent,\n inject,\n onMounted,\n ref,\n} from 'vue'\n\nimport PsCascaderPanel, {\n CommonProps\n} from '@element-ps/components/cascader-panel'\nimport PsInput from '@element-ps/components/input'\nimport PsTag from '@element-ps/components/tag'\nimport PsIcon from '@element-ps/components/icon'\n\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\n\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose, Check, ArrowDown } from '@element-plus/icons'\n\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type {\n CascaderNode,\n Tag\n} from '@element-ps/components/cascader-panel'\nimport type { ComponentSize } from '@element-ps/utils/types'\n\ntype cascaderPanelType = InstanceType<typeof PsCascaderPanel>\ntype inputType = InstanceType<typeof PsInput>\n\nconst DEFAULT_INPUT_HEIGHT = 40\n\nconst INPUT_HEIGHT_MAP = {\n medium: 36,\n small: 32,\n mini: 28\n}\n\nexport default defineComponent({\n name: 'PsCascader',\n components: {\n PsInput,\n PsTag,\n PsIcon,\n CircleClose,\n Check,\n ArrowDown\n },\n props: {\n ...CommonProps,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize\n },\n placeholder: {\n type: String\n },\n disabled: Boolean,\n clearable: Boolean,\n filterable: Boolean,\n filterMethod: {\n type: Function as PropType<(node: CascaderNode, keyword: string) => boolean>,\n default: (node: CascaderNode, keyword: string) =>\n node.text.includes(keyword)\n },\n separator: {\n type: String,\n default: ' / '\n },\n showAllLevels: {\n type: Boolean,\n default: true\n },\n collapseTags: Boolean,\n debounce: {\n type: Number,\n default: 300\n },\n beforeFilter: {\n type: Function as PropType<(value: string) => boolean | Promise<any>>,\n default: () => true\n },\n popperClass: {\n type: String,\n default: ''\n },\n popperAppendToBody: {\n type: Boolean,\n default: true\n },\n widget: {\n type: String\n }\n },\n setup(props) {\n let inputInitialHeight = 0\n\n const { t } = useLocaleInject()\n const $ELEMENT = useGlobalConfig()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n\n const input: Ref<inputType | null> = ref(null)\n const tagWrapper = ref(null)\n const panel: Ref<cascaderPanelType | null> = ref(null)\n const inputHover = ref(false)\n const filtering = ref(false)\n const inputValue = ref('')\n const searchInputValue = ref('')\n const presentTags: Ref<Tag[]> = ref([])\n\n const isDisabled = computed(() => props.disabled || elForm.disabled)\n const inputPlaceholder = computed(\n () => props.placeholder || t('el.cascader.placeholder')\n )\n const realSize: ComputedRef<ComponentSize> = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n const tagSize = computed(() =>\n ['small', 'mini'].includes(realSize.value) ? 'mini' : 'small'\n )\n const multiple = computed(() => !!props.props.multiple)\n const readonly = computed(() => !props.filterable || multiple.value)\n\n const checkedNodes: ComputedRef<CascaderNode[]> = computed(\n () => panel.value?.checkedNodes || []\n )\n const clearBtnVisible = computed(() => {\n if (\n !props.clearable ||\n isDisabled.value ||\n filtering.value ||\n !inputHover.value\n )\n return false\n\n return !!checkedNodes.value.length\n })\n const presentText = computed(() => {\n const { showAllLevels, separator } = props\n const nodes = checkedNodes.value\n return nodes.length\n ? multiple.value\n ? ' '\n : nodes[0].calcText(showAllLevels, separator)\n : ''\n })\n\n onMounted(() => {\n const inputEl = input.value?.$el\n inputInitialHeight =\n inputEl?.offsetHeight ||\n INPUT_HEIGHT_MAP[realSize.value] ||\n DEFAULT_INPUT_HEIGHT\n })\n\n return {\n input,\n tagWrapper,\n inputPlaceholder,\n presentText,\n inputValue,\n searchInputValue,\n presentTags,\n isDisabled,\n realSize,\n tagSize,\n multiple,\n readonly,\n clearBtnVisible,\n }\n }\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_createBlock","_createElementVNode"],"mappings":";;;;;;;;EAuCyB,KAAI;AAAA,EAAa,OAAM;AAAA;;;;;;;;0BAtC9CA;IACG;;;;;;IAMDC;MACE,KAAI;AAAA,kBACU;mEAAA;sBAAd;MACC,aAAa;MACb,UAAU;MACV,UAAU;MACV,kBAAgB;AAAA,MAChB,MAAM;MACN,wCAAqB;;MAEX,oBACT;QACQ,yCADRC;UAEE,KAAI;AAAA,UACJ,OAAM;AAAA;+BAEN;YAAAD;;;gCAEFC;UAEE,KAAI;AAAA,UACH,0BAAO;AAAA;;;;+BAKR;YAAAD;;;;;;;IAKK,kCAAXD,8BAAA;4BACEA,0DACgB,mBAAP;gCADTE;UAEG,KAAK,IAAI;AAAA,UACV,MAAK;AAAA,UACJ,MAAM;UACN,KAAK,IAAI;AAAA,UACT,UAAU,IAAI;AAAA,UACf,uBAAA;AAAA;+BAEA;YAAAC,yDAAS,IAAI;;;;;MAGP,oBAAe,uDADvBH;;qEAEgB;QACd,MAAK;AAAA,QACL,OAAM;AAAA,QACL,aAAa,wBAAmB;;;;UAHnB;;kBAAd;AAAA;AAAA;;;;;;;"}
1
+ {"version":3,"file":"index.vue_vue&type=template&id=0429c2db&lang.js","sources":["../../../../../../../packages/components/cascader/src/index.vue?vue&type=template&id=0429c2db&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'el-cascader',\n realSize && `el-cascader--${realSize}`,\n { 'is-disabled': isDisabled },\n ]\"\n :widget=\"widget\"\n >\n <ps-input\n ref='input'\n v-model.trim='inputValue'\n :placeholder='inputPlaceholder'\n :readonly='readonly'\n :disabled='isDisabled'\n :validate-event='false'\n :size='realSize'\n :class=\"{ 'is-focus': popperVisible }\"\n >\n <template #suffix>\n <ps-icon\n v-if='clearBtnVisible'\n key='clear'\n class='el-input__icon icon-circle-close'\n >\n <circle-close />\n </ps-icon>\n <ps-icon\n v-else\n key='arrow-down'\n :class=\"[\n 'el-input__icon',\n 'icon-arrow-down',\n ]\"\n >\n <arrow-down />\n </ps-icon>\n </template>\n </ps-input>\n\n <div v-if='multiple' ref='tagWrapper' class='el-cascader__tags'>\n <ps-tag\n v-for='tag in presentTags'\n :key='tag.key'\n type='info'\n :size='tagSize'\n :hit='tag.hitState'\n :closable='tag.closable'\n disable-transitions\n >\n <span>{{ tag.text }}</span>\n </ps-tag>\n <input\n v-if='filterable && !isDisabled'\n v-model.trim='searchInputValue'\n type='text'\n class='el-cascader__search-input'\n :placeholder=\"presentText ? '' : inputPlaceholder\"\n />\n </div>\n </div>\n</template>\n\n<script lang='ts'>\nimport {\n computed,\n defineComponent,\n inject,\n onMounted,\n ref,\n} from 'vue'\n\nimport PsCascaderPanel, {\n CommonProps\n} from '@element-ps/components/cascader-panel'\nimport PsInput from '@element-ps/components/input'\nimport PsTag from '@element-ps/components/tag'\nimport PsIcon from '@element-ps/components/icon'\n\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\n\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose, Check, ArrowDown } from '@element-plus/icons'\n\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type {\n CascaderNode,\n Tag\n} from '@element-ps/components/cascader-panel'\nimport type { ComponentSize } from '@element-ps/utils/types'\n\ntype cascaderPanelType = InstanceType<typeof PsCascaderPanel>\ntype inputType = InstanceType<typeof PsInput>\n\nconst DEFAULT_INPUT_HEIGHT = 40\n\nconst INPUT_HEIGHT_MAP = {\n medium: 36,\n small: 32,\n mini: 28\n}\n\nexport default defineComponent({\n name: 'PsCascader',\n components: {\n PsInput,\n PsTag,\n PsIcon,\n CircleClose,\n Check,\n ArrowDown\n },\n props: {\n ...CommonProps,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize\n },\n placeholder: {\n type: String\n },\n disabled: Boolean,\n clearable: Boolean,\n filterable: Boolean,\n filterMethod: {\n type: Function as PropType<(node: CascaderNode, keyword: string) => boolean>,\n default: (node: CascaderNode, keyword: string) =>\n node.text.includes(keyword)\n },\n separator: {\n type: String,\n default: ' / '\n },\n showAllLevels: {\n type: Boolean,\n default: true\n },\n collapseTags: Boolean,\n debounce: {\n type: Number,\n default: 300\n },\n beforeFilter: {\n type: Function as PropType<(value: string) => boolean | Promise<any>>,\n default: () => true\n },\n popperClass: {\n type: String,\n default: ''\n },\n popperAppendToBody: {\n type: Boolean,\n default: true\n },\n widget: {\n type: String\n }\n },\n setup(props) {\n let inputInitialHeight = 0\n\n const { t } = useLocaleInject()\n const $ELEMENT = useGlobalConfig()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n\n const input: Ref<inputType | null> = ref(null)\n const tagWrapper = ref(null)\n const panel: Ref<cascaderPanelType | null> = ref(null)\n const inputHover = ref(false)\n const filtering = ref(false)\n const inputValue = ref('')\n const searchInputValue = ref('')\n const presentTags: Ref<Tag[]> = ref([])\n\n const isDisabled = computed(() => props.disabled || elForm.disabled)\n const inputPlaceholder = computed(\n () => props.placeholder || t('el.cascader.placeholder')\n )\n const realSize: ComputedRef<ComponentSize> = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n const tagSize = computed(() =>\n ['small', 'mini'].includes(realSize.value) ? 'mini' : 'small'\n )\n const multiple = computed(() => !!props.props.multiple)\n const readonly = computed(() => !props.filterable || multiple.value)\n\n const checkedNodes: ComputedRef<CascaderNode[]> = computed(\n () => panel.value?.checkedNodes || []\n )\n const clearBtnVisible = computed(() => {\n if (\n !props.clearable ||\n isDisabled.value ||\n filtering.value ||\n !inputHover.value\n )\n return false\n\n return !!checkedNodes.value.length\n })\n const presentText = computed(() => {\n const { showAllLevels, separator } = props\n const nodes = checkedNodes.value\n return nodes.length\n ? multiple.value\n ? ' '\n : nodes[0].calcText(showAllLevels, separator)\n : ''\n })\n\n onMounted(() => {\n const inputEl = input.value?.$el\n inputInitialHeight =\n inputEl?.offsetHeight ||\n INPUT_HEIGHT_MAP[realSize.value] ||\n DEFAULT_INPUT_HEIGHT\n })\n\n return {\n input,\n tagWrapper,\n inputPlaceholder,\n presentText,\n inputValue,\n searchInputValue,\n presentTags,\n isDisabled,\n realSize,\n tagSize,\n multiple,\n readonly,\n clearBtnVisible,\n }\n }\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_createBlock","_createElementVNode"],"mappings":";;;;;;;;;EAwCyB,KAAI;AAAA,EAAa,OAAM;AAAA;;;;;;;;0BAvC9CA;IACG;;;;;IAKA,QAAQ;;IAETC;MACE,KAAI;AAAA,kBACU;mEAAA;sBAAd;MACC,aAAa;MACb,UAAU;MACV,UAAU;MACV,kBAAgB;AAAA,MAChB,MAAM;MACN,wCAAqB;;MAEX,oBACT;QACQ,yCADRC;UAEE,KAAI;AAAA,UACJ,OAAM;AAAA;+BAEN;YAAAD;;;gCAEFC;UAEE,KAAI;AAAA,UACH,0BAAO;AAAA;;;;+BAKR;YAAAD;;;;;;;IAKK,kCAAXD,8BAAA;4BACEA,0DACgB,mBAAP;gCADTE;UAEG,KAAK,IAAI;AAAA,UACV,MAAK;AAAA,UACJ,MAAM;UACN,KAAK,IAAI;AAAA,UACT,UAAU,IAAI;AAAA,UACf,uBAAA;AAAA;+BAEA;YAAAC,yDAAS,IAAI;;;;;MAGP,oBAAe,uDADvBH;;qEAEgB;QACd,MAAK;AAAA,QACL,OAAM;AAAA,QACL,aAAa,wBAAmB;;;;UAHnB;;kBAAd;AAAA;AAAA;;;;;;;"}
@@ -38,6 +38,9 @@ var DescriptionsItem = vue.defineComponent({
38
38
  labelClassName: {
39
39
  type: String,
40
40
  default: ""
41
+ },
42
+ widget: {
43
+ type: String
41
44
  }
42
45
  }
43
46
  });
@@ -1 +1 @@
1
- {"version":3,"file":"description-item.js","sources":["../../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\n\nexport default defineComponent({\n name: 'PsDescriptionsItem',\n props: {\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 },\n})\n"],"names":["defineComponent"],"mappings":";;;;;;AAEA,uBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,UAAU;AAAA,MACR,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"description-item.js","sources":["../../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\n\nexport default defineComponent({\n name: 'PsDescriptionsItem',\n props: {\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 widget: {\n type: String,\n }\n },\n})\n"],"names":["defineComponent"],"mappings":";;;;;;AAEA,uBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,UAAU;AAAA,MACR,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA;;;;"}
@@ -51,7 +51,8 @@ var PsDescriptionsCell = vue.defineComponent({
51
51
  labelAlign,
52
52
  labelClassName
53
53
  ],
54
- colSpan: this.descriptions.direction === "vertical" ? span : 1
54
+ colSpan: this.descriptions.direction === "vertical" ? span : 1,
55
+ widget: item.widget
55
56
  }, label);
56
57
  case "content":
57
58
  return vue.h(this.tag, {
@@ -1 +1 @@
1
- {"version":3,"file":"descriptions-cell.js","sources":["../../../../../../../packages/components/descriptions/src/descriptions-cell.ts"],"sourcesContent":["import { defineComponent, h, inject } from 'vue'\nimport { addUnit } from '@element-ps/utils/util'\nimport { getNormalizedProps } from '@element-ps/utils/vnode'\nimport { elDescriptionsKey } from './token'\n\nimport type { VNode } from 'vue'\nimport type {\n IDescriptionsInject,\n IDescriptionsItemInject,\n} from './descriptions.type'\n\nexport default defineComponent({\n name: 'PsDescriptionsCell',\n props: {\n cell: {\n type: Object,\n },\n tag: {\n type: String,\n },\n type: {\n type: String,\n },\n },\n setup() {\n const descriptions = inject(elDescriptionsKey, {} as IDescriptionsInject)\n\n return {\n descriptions,\n }\n },\n render() {\n const item = getNormalizedProps(\n this.cell as VNode\n ) as IDescriptionsItemInject\n\n const label = this.cell?.children?.label?.() || item.label\n const content = this.cell?.children?.default?.()\n const span = item.span\n const align = item.align ? `is-${item.align}` : ''\n const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : '' || align\n const className = item.className\n const labelClassName = item.labelClassName\n const style = {\n width: addUnit(item.width),\n minWidth: addUnit(item.minWidth),\n }\n\n switch (this.type) {\n case 'label':\n return h(\n this.tag as string,\n {\n style,\n class: [\n 'el-descriptions__cell',\n 'el-descriptions__label',\n { 'is-bordered-label': this.descriptions.border },\n labelAlign,\n labelClassName,\n ],\n colSpan: this.descriptions.direction === 'vertical' ? span : 1,\n },\n label\n )\n case 'content':\n return h(\n this.tag as string,\n {\n style,\n class: [\n 'el-descriptions__cell',\n 'el-descriptions__content',\n align,\n className,\n ],\n colSpan:\n this.descriptions.direction === 'vertical' ? span : span * 2 - 1,\n },\n content\n )\n default:\n return h(\n 'td',\n {\n style,\n class: ['el-descriptions__cell', align],\n colSpan: span,\n },\n [\n h(\n 'span',\n {\n class: ['el-descriptions__label', labelClassName],\n },\n label\n ),\n h(\n 'span',\n {\n class: ['el-descriptions__content', className],\n },\n content\n ),\n ]\n )\n }\n },\n})\n"],"names":["defineComponent","inject","elDescriptionsKey","getNormalizedProps","addUnit","h"],"mappings":";;;;;;;;;AAWA,yBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA;AAAA,IAER,KAAK;AAAA,MACH,MAAM;AAAA;AAAA,IAER,MAAM;AAAA,MACJ,MAAM;AAAA;AAAA;AAAA,EAGV,QAAQ;AACN,UAAM,eAAeC,WAAOC,yBAAmB;AAE/C,WAAO;AAAA,MACL;AAAA;AAAA;AAAA,EAGJ,SAAS;AA/BX;AAgCI,UAAM,OAAOC,yBACX,KAAK;AAGP,UAAM,QAAQ,wBAAK,SAAL,mBAAW,aAAX,mBAAqB,UAArB,gCAAkC,KAAK;AACrD,UAAM,UAAU,uBAAK,SAAL,mBAAW,aAAX,mBAAqB,YAArB;AAChB,UAAM,OAAO,KAAK;AAClB,UAAM,QAAQ,KAAK,QAAQ,MAAM,KAAK,UAAU;AAChD,UAAM,aAAa,KAAK,aAAa,MAAM,KAAK,eAAqB;AACrE,UAAM,YAAY,KAAK;AACvB,UAAM,iBAAiB,KAAK;AAC5B,UAAM,QAAQ;AAAA,MACZ,OAAOC,aAAQ,KAAK;AAAA,MACpB,UAAUA,aAAQ,KAAK;AAAA;AAGzB,YAAQ,KAAK;AAAA,WACN;AACH,eAAOC,MACL,KAAK,KACL;AAAA,UACE;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA;AAAA,YACA,EAAE,qBAAqB,KAAK,aAAa;AAAA,YACzC;AAAA,YACA;AAAA;AAAA,UAEF,SAAS,KAAK,aAAa,cAAc,aAAa,OAAO;AAAA,WAE/D;AAAA,WAEC;AACH,eAAOA,MACL,KAAK,KACL;AAAA,UACE;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,UAEF,SACE,KAAK,aAAa,cAAc,aAAa,OAAO,OAAO,IAAI;AAAA,WAEnE;AAAA;AAGF,eAAOA,MACL,MACA;AAAA,UACE;AAAA,UACA,OAAO,CAAC,yBAAyB;AAAA,UACjC,SAAS;AAAA,WAEX;AAAA,UACEA,MACE,QACA;AAAA,YACE,OAAO,CAAC,0BAA0B;AAAA,aAEpC;AAAA,UAEFA,MACE,QACA;AAAA,YACE,OAAO,CAAC,4BAA4B;AAAA,aAEtC;AAAA;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"descriptions-cell.js","sources":["../../../../../../../packages/components/descriptions/src/descriptions-cell.ts"],"sourcesContent":["import { defineComponent, h, inject } from 'vue'\nimport { addUnit } from '@element-ps/utils/util'\nimport { getNormalizedProps } from '@element-ps/utils/vnode'\nimport { elDescriptionsKey } from './token'\n\nimport type { VNode } from 'vue'\nimport type {\n IDescriptionsInject,\n IDescriptionsItemInject,\n} from './descriptions.type'\n\nexport default defineComponent({\n name: 'PsDescriptionsCell',\n props: {\n cell: {\n type: Object,\n },\n tag: {\n type: String,\n },\n type: {\n type: String,\n },\n },\n setup() {\n const descriptions = inject(elDescriptionsKey, {} as IDescriptionsInject)\n\n return {\n descriptions,\n }\n },\n render() {\n const item = getNormalizedProps(\n this.cell as VNode\n ) as IDescriptionsItemInject\n\n const label = this.cell?.children?.label?.() || item.label\n const content = this.cell?.children?.default?.()\n const span = item.span\n const align = item.align ? `is-${item.align}` : ''\n const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : '' || align\n const className = item.className\n const labelClassName = item.labelClassName\n const style = {\n width: addUnit(item.width),\n minWidth: addUnit(item.minWidth),\n }\n\n switch (this.type) {\n case 'label':\n return h(\n this.tag as string,\n {\n style,\n class: [\n 'el-descriptions__cell',\n 'el-descriptions__label',\n { 'is-bordered-label': this.descriptions.border },\n labelAlign,\n labelClassName,\n ],\n colSpan: this.descriptions.direction === 'vertical' ? span : 1,\n widget: item.widget\n },\n label\n )\n case 'content':\n return h(\n this.tag as string,\n {\n style,\n class: [\n 'el-descriptions__cell',\n 'el-descriptions__content',\n align,\n className,\n ],\n colSpan:\n this.descriptions.direction === 'vertical' ? span : span * 2 - 1,\n },\n content\n )\n default:\n return h(\n 'td',\n {\n style,\n class: ['el-descriptions__cell', align],\n colSpan: span,\n },\n [\n h(\n 'span',\n {\n class: ['el-descriptions__label', labelClassName],\n },\n label\n ),\n h(\n 'span',\n {\n class: ['el-descriptions__content', className],\n },\n content\n ),\n ]\n )\n }\n },\n})\n"],"names":["defineComponent","inject","elDescriptionsKey","getNormalizedProps","addUnit","h"],"mappings":";;;;;;;;;AAWA,yBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA;AAAA,IAER,KAAK;AAAA,MACH,MAAM;AAAA;AAAA,IAER,MAAM;AAAA,MACJ,MAAM;AAAA;AAAA;AAAA,EAGV,QAAQ;AACN,UAAM,eAAeC,WAAOC,yBAAmB;AAE/C,WAAO;AAAA,MACL;AAAA;AAAA;AAAA,EAGJ,SAAS;AA/BX;AAgCI,UAAM,OAAOC,yBACX,KAAK;AAGP,UAAM,QAAQ,wBAAK,SAAL,mBAAW,aAAX,mBAAqB,UAArB,gCAAkC,KAAK;AACrD,UAAM,UAAU,uBAAK,SAAL,mBAAW,aAAX,mBAAqB,YAArB;AAChB,UAAM,OAAO,KAAK;AAClB,UAAM,QAAQ,KAAK,QAAQ,MAAM,KAAK,UAAU;AAChD,UAAM,aAAa,KAAK,aAAa,MAAM,KAAK,eAAqB;AACrE,UAAM,YAAY,KAAK;AACvB,UAAM,iBAAiB,KAAK;AAC5B,UAAM,QAAQ;AAAA,MACZ,OAAOC,aAAQ,KAAK;AAAA,MACpB,UAAUA,aAAQ,KAAK;AAAA;AAGzB,YAAQ,KAAK;AAAA,WACN;AACH,eAAOC,MACL,KAAK,KACL;AAAA,UACE;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA;AAAA,YACA,EAAE,qBAAqB,KAAK,aAAa;AAAA,YACzC;AAAA,YACA;AAAA;AAAA,UAEF,SAAS,KAAK,aAAa,cAAc,aAAa,OAAO;AAAA,UAC7D,QAAQ,KAAK;AAAA,WAEf;AAAA,WAEC;AACH,eAAOA,MACL,KAAK,KACL;AAAA,UACE;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,UAEF,SACE,KAAK,aAAa,cAAc,aAAa,OAAO,OAAO,IAAI;AAAA,WAEnE;AAAA;AAGF,eAAOA,MACL,MACA;AAAA,UACE;AAAA,UACA,OAAO,CAAC,yBAAyB;AAAA,UACjC,SAAS;AAAA,WAEX;AAAA,UACEA,MACE,QACA;AAAA,YACE,OAAO,CAAC,0BAA0B;AAAA,aAEpC;AAAA,UAEFA,MACE,QACA;AAAA,YACE,OAAO,CAAC,4BAA4B;AAAA,aAEtC;AAAA;AAAA;AAAA;AAAA;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('../../utils/with-install.js');
6
- require('./src/empty.js');
7
- var empty = require('./src/empty2.js');
6
+ require('./src/empty2.js');
7
+ var empty = require('./src/empty.js');
8
8
  var empty_vue_vue_type_script_lang = require('./src/empty.vue_vue&type=script&lang.js');
9
9
 
10
10
  const PsEmpty = withInstall.withInstall(empty_vue_vue_type_script_lang["default"]);
@@ -2,11 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var empty_vue_vue_type_script_lang = require('./empty.vue_vue&type=script&lang.js');
6
- var empty_vue_vue_type_template_id_10d211eb_lang = require('./empty.vue_vue&type=template&id=10d211eb&lang.js');
5
+ const emptyProps = {
6
+ image: {
7
+ type: String,
8
+ default: ""
9
+ },
10
+ imageSize: Number,
11
+ description: {
12
+ type: String,
13
+ default: ""
14
+ }
15
+ };
7
16
 
8
- empty_vue_vue_type_script_lang["default"].render = empty_vue_vue_type_template_id_10d211eb_lang.render;
9
- empty_vue_vue_type_script_lang["default"].__file = "packages/components/empty/src/empty.vue";
10
-
11
- exports["default"] = empty_vue_vue_type_script_lang["default"];
17
+ exports.emptyProps = emptyProps;
12
18
  //# sourceMappingURL=empty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"empty.js","sources":["../../../../../../../packages/components/empty/src/empty.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const emptyProps = {\n image: {\n type: String,\n default: '',\n },\n imageSize: Number,\n description: {\n type: String,\n default: '',\n },\n} as const\nexport type EmptyProps = ExtractPropTypes<typeof emptyProps>\n"],"names":[],"mappings":";;;;MAEa,aAAa;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,EACX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  require('../../../hooks/index.js');
7
7
  require('./img-empty.js');
8
- var empty = require('./empty2.js');
8
+ var empty = require('./empty.js');
9
9
  var imgEmpty_vue_vue_type_script_lang = require('./img-empty.vue_vue&type=script&lang.js');
10
10
  var index = require('../../../hooks/use-locale/index.js');
11
11
 
@@ -2,17 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const emptyProps = {
6
- image: {
7
- type: String,
8
- default: ""
9
- },
10
- imageSize: Number,
11
- description: {
12
- type: String,
13
- default: ""
14
- }
15
- };
5
+ var empty_vue_vue_type_script_lang = require('./empty.vue_vue&type=script&lang.js');
6
+ var empty_vue_vue_type_template_id_10d211eb_lang = require('./empty.vue_vue&type=template&id=10d211eb&lang.js');
16
7
 
17
- exports.emptyProps = emptyProps;
8
+ empty_vue_vue_type_script_lang["default"].render = empty_vue_vue_type_template_id_10d211eb_lang.render;
9
+ empty_vue_vue_type_script_lang["default"].__file = "packages/components/empty/src/empty.vue";
10
+
11
+ exports["default"] = empty_vue_vue_type_script_lang["default"];
18
12
  //# sourceMappingURL=empty2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty2.js","sources":["../../../../../../../packages/components/empty/src/empty.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const emptyProps = {\n image: {\n type: String,\n default: '',\n },\n imageSize: Number,\n description: {\n type: String,\n default: '',\n },\n} as const\nexport type EmptyProps = ExtractPropTypes<typeof emptyProps>\n"],"names":[],"mappings":";;;;MAEa,aAAa;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,EACX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"empty2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"form-item.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AA8DA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,eACVC;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO,CAAC,QAAQ;AAAA,IAChB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,eAAe;AAAA,MACb,MAA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Ae;AAEvB,UAAM,gBAAgBL,aAAS,MAAM;AAAA,MACnC;AAAA,QACE,0BAA0B,OAAO;AAAA,QACjC,YAAY,cAAc,UAAU;AAAA,QACpC,iBAAiB,cAAc,UAAU;AAAA,QACzC,cAAc,cAAc,UAAU;AAAA,QACtC,eAAe,WAAW,SAAS,MAAM;AAAA,QACzC,kBAAkB,OAAO;AAAA;AAAA,MAE3B,UAAU,QAAQ,iBAAiB,UAAU,UAAU;AAAA;AAGzD,UAAM,kBAAkBA,aAAS,MAAM;AACrC,aACE,cAAc,UAAU,WACxB,MAAM,eACN,OAAO;AAAA;AAIX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"form-item.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"`form-item:label:${widget.split(':')[1]}`\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"`form-item:default:${widget.split(':')[1]}`\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AAkEA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,eACVC;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO,CAAC,QAAQ;AAAA,IAChB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,eAAe;AAAA,MACb,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAWC;AAAA;AAAA,IAEb,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA,EAGV,MAAM,OAAO,EAAE,SAAS;AACtB,UAAM,WAAWC;AAEjB,UAAM,SAASC,WAAOC,gBAAW;AACjC,UAAM,gBAAgBC,QAAI;AAC1B,UAAM,kBAAkBA,QAAI;AAE5B,UAAM,qBAAqBA,QAAI;AAE/B,UAAM,cAAcA;AAEpB,UAAM,KAAKC;AACX,UAAM,WAAWC,aAAS,MAAM;AAC9B,UAAI,SAAS,GAAG;AAChB,aAAO,UAAU,OAAO,KAAK,SAAS,UAAU;AAC9C,YAAI,OAAO,KAAK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{ value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
 
7
- const _hoisted_1 = ["for", "widget"];
8
- const _hoisted_2 = ["widget"];
7
+ const _hoisted_1 = ["widget"];
8
+ const _hoisted_2 = ["for", "widget"];
9
+ const _hoisted_3 = ["widget"];
9
10
  function render(_ctx, _cache, $props, $setup, $data, $options) {
10
11
  const _component_LabelWrap = vue.resolveComponent("LabelWrap");
11
12
  return vue.openBlock(), vue.createElementBlock("div", {
12
13
  ref: "formItemRef",
13
- class: vue.normalizeClass(["el-form-item", _ctx.formItemClass])
14
+ class: vue.normalizeClass(["el-form-item", _ctx.formItemClass]),
15
+ widget: _ctx.widget
14
16
  }, [
15
17
  vue.createVNode(_component_LabelWrap, {
16
18
  "is-auto-width": _ctx.labelStyle.width === "auto",
@@ -22,21 +24,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
22
24
  for: _ctx.labelFor,
23
25
  class: "el-form-item__label",
24
26
  style: vue.normalizeStyle(_ctx.labelStyle),
25
- widget: _ctx.widget
27
+ widget: `form-item:label:${_ctx.widget.split(":")[1]}`
26
28
  }, [
27
29
  vue.renderSlot(_ctx.$slots, "label", {
28
30
  label: _ctx.label + _ctx.elForm.labelSuffix
29
31
  }, () => [
30
32
  vue.createTextVNode(vue.toDisplayString(_ctx.label + _ctx.elForm.labelSuffix), 1)
31
33
  ])
32
- ], 12, _hoisted_1)) : vue.createCommentVNode("v-if", true)
34
+ ], 12, _hoisted_2)) : vue.createCommentVNode("v-if", true)
33
35
  ]),
34
36
  _: 3
35
37
  }, 8, ["is-auto-width", "update-all"]),
36
38
  vue.createElementVNode("div", {
37
39
  class: "el-form-item__content",
38
40
  style: vue.normalizeStyle(_ctx.contentStyle),
39
- widget: _ctx.widget
41
+ widget: `form-item:default:${_ctx.widget.split(":")[1]}`
40
42
  }, [
41
43
  vue.renderSlot(_ctx.$slots, "default"),
42
44
  vue.createVNode(vue.Transition, { name: "el-zoom-in-top" }, {
@@ -54,8 +56,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
54
56
  ]),
55
57
  _: 3
56
58
  })
57
- ], 12, _hoisted_2)
58
- ], 2);
59
+ ], 12, _hoisted_3)
60
+ ], 10, _hoisted_1);
59
61
  }
60
62
 
61
63
  exports.render = render;
@@ -1 +1 @@
1
- {"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;;;;;0BACEA;IAAK,KAAI;AAAA,IAAc,2BAAM,gBAAuB;;IAClDC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;2BAEpB;QACQ,cAAS,YAAO,0BADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,0BAAO;UACP,QAAQ;;UAETE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;oDACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,0BAAO;MAAe,QAAQ;;MAChED;MACAD,kCAAY,MAAK;6BACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,2BAAM;;;mCAQH;;;;;;;;;;;"}
1
+ {"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"`form-item:label:${widget.split(':')[1]}`\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"`form-item:default:${widget.split(':')[1]}`\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;;;;;;0BACEA;IAAK,KAAI;AAAA,IAAc,2BAAM,gBAAuB;IAC9C,QAAQ;;IAEZC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;2BAEpB;QACQ,cAAS,YAAO,0BADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,0BAAO;UACP,2BAA2B,YAAO;;UAEnCE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;oDACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,0BAAO;MACrC,6BAA6B,YAAO;;MAExCD;MACAD,kCAAY,MAAK;6BACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,2BAAM;;;mCAQH;;;;;;;;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('../../utils/with-install.js');
6
- require('./src/image-viewer2.js');
7
- var imageViewer = require('./src/image-viewer.js');
6
+ require('./src/image-viewer.js');
7
+ var imageViewer = require('./src/image-viewer2.js');
8
8
  var imageViewer_vue_vue_type_script_lang = require('./src/image-viewer.vue_vue&type=script&lang.js');
9
9
 
10
10
  const PsImageViewer = withInstall.withInstall(imageViewer_vue_vue_type_script_lang["default"]);