st-comp 0.0.86 → 0.0.88
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/components.d.ts +1 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +10 -10
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +89 -89
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +7 -7
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +138 -138
- package/es/Table.cjs +1 -20
- package/es/Table.js +390 -3589
- package/es/TreeMap.cjs +1 -2
- package/es/TreeMap.js +1 -163
- package/es/VarietySearch.cjs +2 -2
- package/es/VarietySearch.js +1551 -1391
- package/es/VirtualTable.cjs +4 -4
- package/es/VirtualTable.js +100 -100
- package/es/{base-4865d432.cjs → base-2b869b95.cjs} +1 -1
- package/es/{base-6faccb01.js → base-5e2578a9.js} +65 -65
- package/es/{castArray-bdee0d50.js → castArray-9b96e1ad.js} +1 -1
- package/es/castArray-adec592d.cjs +1 -0
- package/es/{config-provider-465c8253.cjs → config-provider-25d2db4b.cjs} +1 -1
- package/es/{config-provider-be0e9c36.js → config-provider-ddbd0b1c.js} +11 -11
- package/es/{el-button-aad5268b.cjs → el-button-8fca9a5d.cjs} +1 -1
- package/es/{el-button-1b9c4fd6.js → el-button-daeb181f.js} +56 -56
- package/es/{el-empty-348c46f7.js → el-empty-b1d5d1e4.js} +4 -4
- package/es/{el-empty-608948d9.cjs → el-empty-d83469ab.cjs} +1 -1
- package/es/el-icon-0bfbe0c8.js +3795 -0
- package/es/el-icon-19bc1691.cjs +20 -0
- package/es/{el-overlay-4713107e.cjs → el-overlay-88994e77.cjs} +2 -2
- package/es/{el-overlay-400ac6ce.js → el-overlay-fcd84f34.js} +46 -46
- package/es/{el-scrollbar-83abe3de.js → el-scrollbar-0f49204a.js} +46 -46
- package/es/{el-scrollbar-bc381e35.cjs → el-scrollbar-43353984.cjs} +1 -1
- package/es/{el-select-895360ba.js → el-select-1a2f2c95.js} +285 -285
- package/es/el-select-c3d21536.cjs +9 -0
- package/es/{el-tag-30cecca3.js → el-tag-1e32cb79.js} +122 -122
- package/es/el-tag-7737bede.cjs +1 -0
- package/es/{focus-trap-a169f160.cjs → focus-trap-19c04a47.cjs} +1 -1
- package/es/{focus-trap-5ac78614.js → focus-trap-82e6ab3c.js} +18 -18
- package/es/{raf-92c5ed6d.js → raf-7414f3eb.js} +1 -1
- package/es/{raf-5e5c53db.cjs → raf-a8539dc6.cjs} +1 -1
- package/es/{scroll-bb8039ba.cjs → scroll-5ec08336.cjs} +1 -1
- package/es/{scroll-264c50f3.js → scroll-8d15ce5a.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-item-6cef6b15.cjs → use-form-item-3d2a7ac7.cjs} +2 -2
- package/es/{use-form-item-0e9cae13.js → use-form-item-ea29755c.js} +138 -137
- package/es/use-global-config-3496cd4f.cjs +1 -0
- package/es/use-global-config-9eba4e5e.js +110 -0
- package/es/{vnode-b78096e3.js → vnode-2ad5aae4.js} +4 -4
- package/es/{vnode-abafec9e.cjs → vnode-b447c505.cjs} +1 -1
- package/es/{zh-cn-e4d38144.cjs → zh-cn-35bd18a8.cjs} +1 -1
- package/es/{zh-cn-8aaa7dd2.js → zh-cn-6a7c1846.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +153 -153
- package/lib/{index-137cb843.js → index-cf938a55.js} +18765 -18608
- package/lib/{python-02b0f7eb.js → python-40015c17.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietySearch/components/CommonIndicator/index.vue +190 -59
- package/packages/VarietySearch/components/FactorScreen/index.vue +84 -27
- package/packages/VarietySearch/config.js +41 -12
- package/packages/VarietySearch/index.vue +67 -12
- package/src/pages/VarietySearch/index.vue +70 -11
- package/es/castArray-3341cbb4.cjs +0 -1
- package/es/el-icon-158ddc19.cjs +0 -1
- package/es/el-icon-d385d377.js +0 -593
- package/es/el-select-7116533b.cjs +0 -9
- package/es/el-tag-2c7e5d4a.cjs +0 -1
- package/es/use-global-config-17f3d7c7.cjs +0 -1
- package/es/use-global-config-8c9c775f.js +0 -110
|
@@ -4,16 +4,15 @@ import defaultConfig from "./config.js";
|
|
|
4
4
|
import FactorScreen from "./components/FactorScreen/index.vue";
|
|
5
5
|
import CommonIndicator from "./components/CommonIndicator/index.vue";
|
|
6
6
|
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
// 配置项
|
|
9
|
-
config: { type: Object, default: {} },
|
|
10
|
-
});
|
|
7
|
+
const props = defineProps({ config: { type: Object, default: {} } });
|
|
11
8
|
const searchData = defineModel("searchData", {
|
|
12
9
|
default: {
|
|
13
10
|
// 品种市场
|
|
14
11
|
varietyMarket: null,
|
|
15
12
|
// 常用选项
|
|
16
13
|
commonOption: [],
|
|
14
|
+
// 上市板块
|
|
15
|
+
marketIds: [],
|
|
17
16
|
// 自定标签
|
|
18
17
|
customTag: [],
|
|
19
18
|
// 因子筛选
|
|
@@ -45,16 +44,30 @@ const varietyMarketDict = computed(() => {
|
|
|
45
44
|
// 选项数据源: 常用选项
|
|
46
45
|
const commonOptionDict = computed(() => {
|
|
47
46
|
const { varietyMarket } = searchData.value;
|
|
48
|
-
//
|
|
47
|
+
// 已选品种市场,仅展示匹配的
|
|
49
48
|
if (varietyMarket) {
|
|
50
49
|
const memo = varietyMarketDict.value.find(({ value }) => value === varietyMarket).memo;
|
|
51
50
|
return config.value.commonOption.options.filter(({ value }) => memo.includes(value));
|
|
52
51
|
}
|
|
53
|
-
//
|
|
52
|
+
// 未选品种市场,展示全部
|
|
54
53
|
else {
|
|
55
54
|
return config.value.commonOption.options;
|
|
56
55
|
}
|
|
57
56
|
});
|
|
57
|
+
// 选项数据源: 上市市场
|
|
58
|
+
const marketIdsOptionDict = computed(() => {
|
|
59
|
+
const { varietyMarket } = searchData.value;
|
|
60
|
+
// 已选品种市场, 仅展示匹配的
|
|
61
|
+
if (varietyMarket) {
|
|
62
|
+
return config.value.marketIds.options.filter((item) => {
|
|
63
|
+
return item.varietyMarketIds.includes(varietyMarket);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// 未选品种市场,展示全部
|
|
67
|
+
else {
|
|
68
|
+
return config.value.marketIds.options;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
58
71
|
// 选项数据源: 自定标签
|
|
59
72
|
const customTagDict = computed(() => {
|
|
60
73
|
return config.value.customTag.options;
|
|
@@ -62,7 +75,7 @@ const customTagDict = computed(() => {
|
|
|
62
75
|
|
|
63
76
|
// 不限
|
|
64
77
|
const clearRow = (key) => {
|
|
65
|
-
if (["commonOption", "customTag", "factorScreen", "commonIndicator"].includes(key)) searchData.value[key] = [];
|
|
78
|
+
if (["commonOption", "marketIds", "customTag", "factorScreen", "commonIndicator"].includes(key)) searchData.value[key] = [];
|
|
66
79
|
else searchData.value[key] = null;
|
|
67
80
|
};
|
|
68
81
|
|
|
@@ -78,6 +91,18 @@ watch(
|
|
|
78
91
|
}
|
|
79
92
|
}
|
|
80
93
|
);
|
|
94
|
+
// 监视: 上市市场数据源
|
|
95
|
+
watch(
|
|
96
|
+
() => marketIdsOptionDict.value,
|
|
97
|
+
(newValue) => {
|
|
98
|
+
// 如果常用选项已经进行了勾选, 则只保留常用选项中存在的值
|
|
99
|
+
if (searchData.value.marketIds.length) {
|
|
100
|
+
searchData.value.marketIds = searchData.value.marketIds.filter((id) => {
|
|
101
|
+
return newValue.find(({ value }) => value === id);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
);
|
|
81
106
|
|
|
82
107
|
defineExpose({
|
|
83
108
|
// 生成接口传参结构的数据
|
|
@@ -92,11 +117,15 @@ defineExpose({
|
|
|
92
117
|
if (data.commonOption?.length) {
|
|
93
118
|
params.optionId = data.commonOption.join(",");
|
|
94
119
|
}
|
|
95
|
-
// 3
|
|
120
|
+
// 3.上市板块
|
|
121
|
+
if (data.marketIds?.length) {
|
|
122
|
+
params.marketIds = data.marketIds;
|
|
123
|
+
}
|
|
124
|
+
// 4.自定标签
|
|
96
125
|
if (data.customTag?.length) {
|
|
97
126
|
params.tagIds = data.customTag;
|
|
98
127
|
}
|
|
99
|
-
//
|
|
128
|
+
// 5.因子筛选
|
|
100
129
|
if (config.value.factorScreen?.show) {
|
|
101
130
|
const { factorScreen } = data;
|
|
102
131
|
if (factorScreen?.list?.length) {
|
|
@@ -114,10 +143,10 @@ defineExpose({
|
|
|
114
143
|
params.sql = factorScreen.sqlValue;
|
|
115
144
|
}
|
|
116
145
|
}
|
|
117
|
-
//
|
|
146
|
+
// 6.常用指标
|
|
118
147
|
{
|
|
119
148
|
const QIQUANKYES = ["expireDays", "virtualRealDegree", "yearProfitRate", "impliedVolatility", "levelMultiplier", "turnover", "volume", "openInterest", "optionsCpType", "optionGear"];
|
|
120
|
-
// 1.常用指标-基本面(
|
|
149
|
+
// 1.常用指标-基本面(type:undefined的指标, 且[期权]的常用指标不计入基本面)
|
|
121
150
|
const query = data.commonIndicator.reduce((result, item) => {
|
|
122
151
|
const { key, type, range, unit } = item;
|
|
123
152
|
// 股息率
|
|
@@ -181,7 +210,12 @@ defineExpose({
|
|
|
181
210
|
if (netProfitQueryDto) {
|
|
182
211
|
params.netProfitQueryDto = { ...netProfitQueryDto, netProfit: netProfitQueryDto.netProfit * 100000000.0 };
|
|
183
212
|
}
|
|
184
|
-
// 4
|
|
213
|
+
// 4.常用指标-股价分位
|
|
214
|
+
const priceLevelIndicator = data.commonIndicator.find(({ key }) => key === "priceLevels");
|
|
215
|
+
if (priceLevelIndicator) {
|
|
216
|
+
params.priceLevels = priceLevelIndicator.priceLevels;
|
|
217
|
+
}
|
|
218
|
+
// 5.常用指标-期权相关参数
|
|
185
219
|
const searchOptionDto = {};
|
|
186
220
|
data.commonIndicator.forEach((item) => {
|
|
187
221
|
const { key } = item;
|
|
@@ -291,6 +325,27 @@ defineExpose({
|
|
|
291
325
|
>
|
|
292
326
|
</el-checkbox-group>
|
|
293
327
|
</div>
|
|
328
|
+
<!-- 上市板块 -->
|
|
329
|
+
<div
|
|
330
|
+
v-if="config.marketIds?.show && marketIdsOptionDict.length"
|
|
331
|
+
class="variety-search-row"
|
|
332
|
+
>
|
|
333
|
+
<div class="title">
|
|
334
|
+
<span>上市板块: </span>
|
|
335
|
+
<span @click="clearRow('marketIds')">不限</span>
|
|
336
|
+
</div>
|
|
337
|
+
<el-checkbox-group
|
|
338
|
+
v-model="searchData.marketIds"
|
|
339
|
+
size="small"
|
|
340
|
+
>
|
|
341
|
+
<el-checkbox
|
|
342
|
+
v-for="{ label, value } in marketIdsOptionDict"
|
|
343
|
+
:label="value"
|
|
344
|
+
:key="value"
|
|
345
|
+
>{{ label }}</el-checkbox
|
|
346
|
+
>
|
|
347
|
+
</el-checkbox-group>
|
|
348
|
+
</div>
|
|
294
349
|
<!-- 自定标签 -->
|
|
295
350
|
<div
|
|
296
351
|
v-if="config.customTag?.show && customTagDict.length"
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script setup>
|
|
16
|
-
import
|
|
16
|
+
import axios from "axios";
|
|
17
|
+
import { ref, onMounted } from "vue";
|
|
17
18
|
|
|
18
19
|
const varietySearchRef = ref(null);
|
|
19
20
|
const varietySearchData = ref({
|
|
20
21
|
varietyMarket: null,
|
|
21
22
|
commonOption: [],
|
|
23
|
+
marketIds: [],
|
|
22
24
|
customTag: [],
|
|
23
25
|
factorScreen: {
|
|
24
26
|
list: [],
|
|
@@ -28,15 +30,20 @@ const varietySearchData = ref({
|
|
|
28
30
|
commonIndicator: [],
|
|
29
31
|
});
|
|
30
32
|
const varietySearchConfig = ref({
|
|
31
|
-
// 品种市场
|
|
33
|
+
// 品种市场 [选项: 前端默认]
|
|
32
34
|
varietyMarket: {
|
|
33
35
|
show: true,
|
|
34
36
|
},
|
|
35
|
-
// 常用选项
|
|
37
|
+
// 常用选项 [选项: 前端默认]
|
|
36
38
|
commonOption: {
|
|
37
39
|
show: true,
|
|
38
40
|
},
|
|
39
|
-
//
|
|
41
|
+
// 上市板块 [选项: 接口获取**!]
|
|
42
|
+
marketIds: {
|
|
43
|
+
show: true,
|
|
44
|
+
options: [],
|
|
45
|
+
},
|
|
46
|
+
// 自定标签 [选项: 接口获取**!]
|
|
40
47
|
customTag: {
|
|
41
48
|
show: true,
|
|
42
49
|
options: [
|
|
@@ -44,20 +51,24 @@ const varietySearchConfig = ref({
|
|
|
44
51
|
{ label: "自定标签二", value: 2 },
|
|
45
52
|
],
|
|
46
53
|
},
|
|
47
|
-
// 因子筛选
|
|
54
|
+
// 因子筛选 [选项: 接口获取**!]
|
|
48
55
|
factorScreen: {
|
|
49
56
|
show: true,
|
|
57
|
+
sqlShow: true,
|
|
58
|
+
// 周期下拉框数据源
|
|
50
59
|
cycleOptions: [
|
|
51
|
-
{ label: "周期一", value: 1 },
|
|
52
|
-
{ label: "周期二", value: 2 },
|
|
60
|
+
{ label: "Mock周期一", value: 1 },
|
|
61
|
+
{ label: "Mock周期二", value: 2 },
|
|
53
62
|
],
|
|
63
|
+
// 因子下拉框数据源
|
|
54
64
|
factorOptions: [
|
|
55
|
-
{ label: "因子一", value: 1 },
|
|
56
|
-
{ label: "因子二", value: 2 },
|
|
65
|
+
{ label: "Mock因子一", value: 1 },
|
|
66
|
+
{ label: "Mock因子二", value: 2 },
|
|
57
67
|
],
|
|
58
|
-
|
|
68
|
+
// 因子使用说明数据源
|
|
69
|
+
factorDescriptions: [],
|
|
59
70
|
},
|
|
60
|
-
// 常用指标
|
|
71
|
+
// 常用指标 [选项: 前端默认]
|
|
61
72
|
commonIndicator: {
|
|
62
73
|
show: true,
|
|
63
74
|
},
|
|
@@ -65,8 +76,56 @@ const varietySearchConfig = ref({
|
|
|
65
76
|
|
|
66
77
|
const formatData = ref(null);
|
|
67
78
|
|
|
79
|
+
// 查询
|
|
68
80
|
const query = () => {
|
|
69
81
|
const res = varietySearchRef.value.formatData(varietySearchData.value);
|
|
70
82
|
formatData.value = res;
|
|
71
83
|
};
|
|
84
|
+
// 获取: 上市板块
|
|
85
|
+
const getMarketIdsOptions = () => {
|
|
86
|
+
varietySearchConfig.value.marketIds.options = [
|
|
87
|
+
{ label: "沪深主板", value: 1, varietyMarketIds: [3] },
|
|
88
|
+
{ label: "创业板", value: 2, varietyMarketIds: [3] },
|
|
89
|
+
{ label: "科创板", value: 4, varietyMarketIds: [3] },
|
|
90
|
+
{ label: "新三板", value: 8, varietyMarketIds: [3] },
|
|
91
|
+
{ label: "沪股通", value: 1024, varietyMarketIds: [3] },
|
|
92
|
+
{ label: "深股通", value: 2048, varietyMarketIds: [3] },
|
|
93
|
+
{ label: "沪港通", value: 4096, varietyMarketIds: [5] },
|
|
94
|
+
{ label: "深港通", value: 8192, varietyMarketIds: [5] },
|
|
95
|
+
];
|
|
96
|
+
};
|
|
97
|
+
// 获取: 因子使用说明数据源
|
|
98
|
+
const getFactorDescriptionApi = async () => {
|
|
99
|
+
const { data } = await axios({
|
|
100
|
+
method: "post",
|
|
101
|
+
headers: {
|
|
102
|
+
token: "09c77eb8eb452a8e07ed5ac37252b663",
|
|
103
|
+
},
|
|
104
|
+
url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/getFactorConfigByPage",
|
|
105
|
+
data: {
|
|
106
|
+
pageNum: 1,
|
|
107
|
+
pageSize: 9999,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
varietySearchConfig.value.factorScreen.factorDescriptions = data.body?.list
|
|
111
|
+
.map((item) => {
|
|
112
|
+
return {
|
|
113
|
+
...item,
|
|
114
|
+
// 测试Mock文案, 实际无需map
|
|
115
|
+
factorDesc: `用于衡量阴线箱体的最高点相对于30周期指数移动平均线(EMA30)的偏离程度。`,
|
|
116
|
+
factorScoreDefine: `
|
|
117
|
+
1.计算60周期EMA趋势:如果最近三个周期中至少有两个周期的EMA呈上升趋势,则 值为 1,表示多头趋势。否则,值为 -1,表示空头趋势。
|
|
118
|
+
2.判断布林线位置和趋势:
|
|
119
|
+
如果当前收盘价位于布林线的中间区域,根据EMA趋势判断:如果是空头趋势,值为 -1;如果是多头趋势,值为 1。
|
|
120
|
+
如果当前收盘价远离布林线的上轨或下轨,根据EMA趋势判断:如果是空头趋势,值为 1,表示反转信号。如果是多头趋势,值为 -1,表示反转信号。
|
|
121
|
+
`,
|
|
122
|
+
};
|
|
123
|
+
})
|
|
124
|
+
.filter((item) => [1, 3].includes(item.type));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
onMounted(() => {
|
|
128
|
+
getMarketIdsOptions();
|
|
129
|
+
getFactorDescriptionApi();
|
|
130
|
+
});
|
|
72
131
|
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./base-4865d432.cjs");function a(){if(!arguments.length)return[];var r=arguments[0];return t.isArray(r)?r:[r]}exports.castArray=a;
|
package/es/el-icon-158ddc19.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const S=require("./use-global-config-17f3d7c7.cjs"),g=require("./el-tag-2c7e5d4a.cjs"),s=require("./base-4865d432.cjs"),e=require("vue"),y=require("./use-form-item-6cef6b15.cjs"),B=require("./focus-trap-a169f160.cjs");var I=Object.create,K=function(){function n(){}return function(t){if(!s.isObject$1(t))return{};if(I)return I(t);n.prototype=t;var o=new n;return n.prototype=void 0,o}}();const q=K;function j(n,t,o){switch(o.length){case 0:return n.call(t);case 1:return n.call(t,o[0]);case 2:return n.call(t,o[0],o[1]);case 3:return n.call(t,o[0],o[1],o[2])}return n.apply(t,o)}function H(n,t){var o=-1,l=n.length;for(t||(t=Array(l));++o<l;)t[o]=n[o];return t}var W=800,J=16,Q=Date.now;function X(n){var t=0,o=0;return function(){var l=Q(),i=J-(l-o);if(o=l,i>0){if(++t>=W)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function Y(n){return function(){return n}}var Z=S.defineProperty?function(n,t){return S.defineProperty(n,"toString",{configurable:!0,enumerable:!1,value:Y(t),writable:!0})}:g.identity;const _=Z;var ee=X(_);const P=ee;function ne(n,t,o,l){var i=!o;o||(o={});for(var c=-1,f=t.length;++c<f;){var a=t[c],v=l?l(o[a],n[a],a,o,n):void 0;v===void 0&&(v=n[a]),i?S.baseAssignValue(o,a,v):S.assignValue(o,a,v)}return o}var L=Math.max;function z(n,t,o){return t=L(t===void 0?n.length-1:t,0),function(){for(var l=arguments,i=-1,c=L(l.length-t,0),f=Array(c);++i<c;)f[i]=l[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=l[i];return a[t]=o(f),j(n,this,a)}}function te(n){var t=[];if(n!=null)for(var o in Object(n))t.push(o);return t}var oe=Object.prototype,le=oe.hasOwnProperty;function ae(n){if(!s.isObject$1(n))return te(n);var t=g.isPrototype(n),o=[];for(var l in n)l=="constructor"&&(t||!le.call(n,l))||o.push(l);return o}function re(n){return g.isArrayLike(n)?g.arrayLikeKeys(n,!0):ae(n)}var $=s.Symbol?s.Symbol.isConcatSpreadable:void 0;function ie(n){return s.isArray(n)||g.isArguments(n)||!!($&&n&&n[$])}function w(n,t,o,l,i){var c=-1,f=n.length;for(o||(o=ie),i||(i=[]);++c<f;){var a=n[c];t>0&&o(a)?t>1?w(a,t-1,o,l,i):g.arrayPush(i,a):l||(i[i.length]=a)}return i}function ue(n){var t=n==null?0:n.length;return t?w(n,1):[]}function se(n){return P(z(n,void 0,ue),n+"")}var de=g.overArg(Object.getPrototypeOf,Object);const D=de;var F=typeof exports=="object"&&exports&&!exports.nodeType&&exports,N=F&&typeof module=="object"&&module&&!module.nodeType&&module,ce=N&&N.exports===F,T=ce?s.root.Buffer:void 0,O=T?T.allocUnsafe:void 0;function fe(n,t){if(t)return n.slice();var o=n.length,l=O?O(o):new n.constructor(o);return n.copy(l),l}function V(n){var t=new n.constructor(n.byteLength);return new g.Uint8Array(t).set(new g.Uint8Array(n)),t}function ve(n,t){var o=t?V(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.length)}function be(n){return typeof n.constructor=="function"&&!g.isPrototype(n)?q(D(n)):{}}function me(n,t,o){for(var l=-1,i=t.length,c={};++l<i;){var f=t[l],a=s.baseGet(n,f);o(a,f)&&S.baseSet(c,s.castPath(f,n),a)}return c}function pe(n,t){return me(n,t,function(o,l){return g.hasIn(n,l)})}var he=se(function(n,t){return n==null?{}:pe(n,t)});const ke=he,A={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object]},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:y.useSizeProp,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},G={[B.UPDATE_MODEL_EVENT]:n=>s.isString(n)||s.isNumber(n)||s.isBoolean(n),change:n=>s.isString(n)||s.isNumber(n)||s.isBoolean(n)},E=Symbol("checkboxGroupContextKey"),ge=({model:n,isChecked:t})=>{const o=e.inject(E,void 0),l=e.computed(()=>{var c,f;const a=(c=o==null?void 0:o.max)==null?void 0:c.value,v=(f=o==null?void 0:o.min)==null?void 0:f.value;return!s.isUndefined(a)&&n.value.length>=a&&!t.value||!s.isUndefined(v)&&n.value.length<=v&&t.value});return{isDisabled:y.useFormDisabled(e.computed(()=>(o==null?void 0:o.disabled.value)||l.value)),isLimitDisabled:l}},Ce=(n,{model:t,isLimitExceeded:o,hasOwnLabel:l,isDisabled:i,isLabeledByFormItem:c})=>{const f=e.inject(E,void 0),{formItem:a}=y.useFormItem(),{emit:v}=e.getCurrentInstance();function r(u){var m,p;return u===n.trueLabel||u===!0?(m=n.trueLabel)!=null?m:!0:(p=n.falseLabel)!=null?p:!1}function h(u,m){v("change",r(u),m)}function k(u){if(o.value)return;const m=u.target;v("change",r(m.checked),u)}async function x(u){o.value||!l.value&&!i.value&&c.value&&(u.composedPath().some(b=>b.tagName==="LABEL")||(t.value=r([!1,n.falseLabel].includes(t.value)),await e.nextTick(),h(t.value,u)))}const d=e.computed(()=>(f==null?void 0:f.validateEvent)||n.validateEvent);return e.watch(()=>n.modelValue,()=>{d.value&&(a==null||a.validate("change").catch(u=>s.debugWarn(u)))}),{handleChange:k,onClickRoot:x}},ye=n=>{const t=e.ref(!1),{emit:o}=e.getCurrentInstance(),l=e.inject(E,void 0),i=e.computed(()=>s.isUndefined(l)===!1),c=e.ref(!1);return{model:e.computed({get(){var a,v;return i.value?(a=l==null?void 0:l.modelValue)==null?void 0:a.value:(v=n.modelValue)!=null?v:t.value},set(a){var v,r;i.value&&s.isArray$1(a)?(c.value=((v=l==null?void 0:l.max)==null?void 0:v.value)!==void 0&&a.length>(l==null?void 0:l.max.value),c.value===!1&&((r=l==null?void 0:l.changeEvent)==null||r.call(l,a))):(o(B.UPDATE_MODEL_EVENT,a),t.value=a)}}),isGroup:i,isLimitExceeded:c}},xe=(n,t,{model:o})=>{const l=e.inject(E,void 0),i=e.ref(!1),c=e.computed(()=>{const r=o.value;return s.isBoolean(r)?r:s.isArray$1(r)?s.isObject(n.label)?r.map(e.toRaw).some(h=>g.isEqual(h,n.label)):r.map(e.toRaw).includes(n.label):r!=null?r===n.trueLabel:!!r}),f=y.useFormSize(e.computed(()=>{var r;return(r=l==null?void 0:l.size)==null?void 0:r.value}),{prop:!0}),a=y.useFormSize(e.computed(()=>{var r;return(r=l==null?void 0:l.size)==null?void 0:r.value})),v=e.computed(()=>!!(t.default||n.label));return{checkboxButtonSize:f,isChecked:c,isFocused:i,checkboxSize:a,hasOwnLabel:v}},Ee=(n,{model:t})=>{function o(){s.isArray$1(t.value)&&!t.value.includes(n.label)?t.value.push(n.label):t.value=n.trueLabel||!0}n.checked&&o()},M=(n,t)=>{const{formItem:o}=y.useFormItem(),{model:l,isGroup:i,isLimitExceeded:c}=ye(n),{isFocused:f,isChecked:a,checkboxButtonSize:v,checkboxSize:r,hasOwnLabel:h}=xe(n,t,{model:l}),{isDisabled:k}=ge({model:l,isChecked:a}),{inputId:x,isLabeledByFormItem:d}=y.useFormItemInputId(n,{formItemContext:o,disableIdGeneration:h,disableIdManagement:i}),{handleChange:u,onClickRoot:m}=Ce(n,{model:l,isLimitExceeded:c,hasOwnLabel:h,isDisabled:k,isLabeledByFormItem:d});return Ee(n,{model:l}),{inputId:x,isLabeledByFormItem:d,isChecked:a,isDisabled:k,isFocused:f,checkboxButtonSize:v,checkboxSize:r,hasOwnLabel:h,model:l,handleChange:u,onClickRoot:m}},Se=["tabindex","role","aria-checked"],Be=["id","aria-hidden","name","tabindex","disabled","true-value","false-value"],we=["id","aria-hidden","disabled","value","name","tabindex"],Ie=e.defineComponent({name:"ElCheckbox"}),Le=e.defineComponent({...Ie,props:A,emits:G,setup(n){const t=n,o=e.useSlots(),{inputId:l,isLabeledByFormItem:i,isChecked:c,isDisabled:f,isFocused:a,checkboxSize:v,hasOwnLabel:r,model:h,handleChange:k,onClickRoot:x}=M(t,o),d=s.useNamespace("checkbox"),u=e.computed(()=>[d.b(),d.m(v.value),d.is("disabled",f.value),d.is("bordered",t.border),d.is("checked",c.value)]),m=e.computed(()=>[d.e("input"),d.is("disabled",f.value),d.is("checked",c.value),d.is("indeterminate",t.indeterminate),d.is("focus",a.value)]);return(p,b)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(!e.unref(r)&&e.unref(i)?"span":"label"),{class:e.normalizeClass(e.unref(u)),"aria-controls":p.indeterminate?p.controls:null,onClick:e.unref(x)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(m)),tabindex:p.indeterminate?0:void 0,role:p.indeterminate?"checkbox":void 0,"aria-checked":p.indeterminate?"mixed":void 0},[p.trueLabel||p.falseLabel?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:e.unref(l),"onUpdate:modelValue":b[0]||(b[0]=C=>e.isRef(h)?h.value=C:null),class:e.normalizeClass(e.unref(d).e("original")),type:"checkbox","aria-hidden":p.indeterminate?"true":"false",name:p.name,tabindex:p.tabindex,disabled:e.unref(f),"true-value":p.trueLabel,"false-value":p.falseLabel,onChange:b[1]||(b[1]=(...C)=>e.unref(k)&&e.unref(k)(...C)),onFocus:b[2]||(b[2]=C=>a.value=!0),onBlur:b[3]||(b[3]=C=>a.value=!1),onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},null,42,Be)),[[e.vModelCheckbox,e.unref(h)]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,id:e.unref(l),"onUpdate:modelValue":b[5]||(b[5]=C=>e.isRef(h)?h.value=C:null),class:e.normalizeClass(e.unref(d).e("original")),type:"checkbox","aria-hidden":p.indeterminate?"true":"false",disabled:e.unref(f),value:p.label,name:p.name,tabindex:p.tabindex,onChange:b[6]||(b[6]=(...C)=>e.unref(k)&&e.unref(k)(...C)),onFocus:b[7]||(b[7]=C=>a.value=!0),onBlur:b[8]||(b[8]=C=>a.value=!1),onClick:b[9]||(b[9]=e.withModifiers(()=>{},["stop"]))},null,42,we)),[[e.vModelCheckbox,e.unref(h)]]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(d).e("inner"))},null,2)],10,Se),e.unref(r)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(d).e("label"))},[e.renderSlot(p.$slots,"default"),p.$slots.default?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.label),1)],64))],2)):e.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-controls","onClick"]))}});var $e=s._export_sfc(Le,[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox.vue"]]);const Ne=["name","tabindex","disabled","true-value","false-value"],Te=["name","tabindex","disabled","value"],Oe=e.defineComponent({name:"ElCheckboxButton"}),Pe=e.defineComponent({...Oe,props:A,emits:G,setup(n){const t=n,o=e.useSlots(),{isFocused:l,isChecked:i,isDisabled:c,checkboxButtonSize:f,model:a,handleChange:v}=M(t,o),r=e.inject(E,void 0),h=s.useNamespace("checkbox"),k=e.computed(()=>{var d,u,m,p;const b=(u=(d=r==null?void 0:r.fill)==null?void 0:d.value)!=null?u:"";return{backgroundColor:b,borderColor:b,color:(p=(m=r==null?void 0:r.textColor)==null?void 0:m.value)!=null?p:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),x=e.computed(()=>[h.b("button"),h.bm("button",f.value),h.is("disabled",c.value),h.is("checked",i.value),h.is("focus",l.value)]);return(d,u)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(x))},[d.trueLabel||d.falseLabel?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":u[0]||(u[0]=m=>e.isRef(a)?a.value=m:null),class:e.normalizeClass(e.unref(h).be("button","original")),type:"checkbox",name:d.name,tabindex:d.tabindex,disabled:e.unref(c),"true-value":d.trueLabel,"false-value":d.falseLabel,onChange:u[1]||(u[1]=(...m)=>e.unref(v)&&e.unref(v)(...m)),onFocus:u[2]||(u[2]=m=>l.value=!0),onBlur:u[3]||(u[3]=m=>l.value=!1),onClick:u[4]||(u[4]=e.withModifiers(()=>{},["stop"]))},null,42,Ne)),[[e.vModelCheckbox,e.unref(a)]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":u[5]||(u[5]=m=>e.isRef(a)?a.value=m:null),class:e.normalizeClass(e.unref(h).be("button","original")),type:"checkbox",name:d.name,tabindex:d.tabindex,disabled:e.unref(c),value:d.label,onChange:u[6]||(u[6]=(...m)=>e.unref(v)&&e.unref(v)(...m)),onFocus:u[7]||(u[7]=m=>l.value=!0),onBlur:u[8]||(u[8]=m=>l.value=!1),onClick:u[9]||(u[9]=e.withModifiers(()=>{},["stop"]))},null,42,Te)),[[e.vModelCheckbox,e.unref(a)]]),d.$slots.default||d.label?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(h).be("button","inner")),style:e.normalizeStyle(e.unref(i)?e.unref(k):void 0)},[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(d.label),1)])],6)):e.createCommentVNode("v-if",!0)],2))}});var U=s._export_sfc(Pe,[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox-button.vue"]]);const ze=s.buildProps({modelValue:{type:s.definePropType(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:y.useSizeProp,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),De={[B.UPDATE_MODEL_EVENT]:n=>s.isArray$1(n),change:n=>s.isArray$1(n)},Fe=e.defineComponent({name:"ElCheckboxGroup"}),Ve=e.defineComponent({...Fe,props:ze,emits:De,setup(n,{emit:t}){const o=n,l=s.useNamespace("checkbox"),{formItem:i}=y.useFormItem(),{inputId:c,isLabeledByFormItem:f}=y.useFormItemInputId(o,{formItemContext:i}),a=async r=>{t(B.UPDATE_MODEL_EVENT,r),await e.nextTick(),t("change",r)},v=e.computed({get(){return o.modelValue},set(r){a(r)}});return e.provide(E,{...ke(e.toRefs(o),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:v,changeEvent:a}),e.watch(()=>o.modelValue,()=>{o.validateEvent&&(i==null||i.validate("change").catch(r=>s.debugWarn(r)))}),(r,h)=>{var k;return e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.tag),{id:e.unref(c),class:e.normalizeClass(e.unref(l).b("group")),role:"group","aria-label":e.unref(f)?void 0:r.label||"checkbox-group","aria-labelledby":e.unref(f)?(k=e.unref(i))==null?void 0:k.labelId:void 0},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var R=s._export_sfc(Ve,[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox-group.vue"]]);const Ae=s.withInstall($e,{CheckboxButton:U,CheckboxGroup:R});s.withNoopInstall(U);const Ge=s.withNoopInstall(R);exports.ElCheckbox=Ae;exports.ElCheckboxGroup=Ge;exports.baseFlatten=w;exports.cloneArrayBuffer=V;exports.cloneBuffer=fe;exports.cloneTypedArray=ve;exports.copyArray=H;exports.copyObject=ne;exports.getPrototype=D;exports.initCloneObject=be;exports.keysIn=re;exports.overRest=z;exports.setToString=P;
|