@xjw_/vue3-npm-system 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -283,7 +283,7 @@ const directives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
283
283
  throttle
284
284
  }, Symbol.toStringTag, { value: "Module" }));
285
285
  const _hoisted_1$4 = ["href", "xlink:href"];
286
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
286
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
287
287
  __name: "SvgIcon",
288
288
  props: {
289
289
  iconClass: {
@@ -336,8 +336,8 @@ const _export_sfc = (sfc, props) => {
336
336
  }
337
337
  return target;
338
338
  };
339
- const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-bc56d70e"]]);
340
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
339
+ const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-bc56d70e"]]);
340
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
341
341
  __name: "XDatePicker",
342
342
  props: {
343
343
  type: {
@@ -544,8 +544,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
544
544
  };
545
545
  }
546
546
  });
547
- const XDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-264a8a79"]]);
548
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
547
+ const XDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-264a8a79"]]);
548
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
549
549
  __name: "XElForm",
550
550
  props: {
551
551
  model: {
@@ -686,8 +686,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
686
686
  };
687
687
  }
688
688
  });
689
- const XElForm = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-441b419b"]]);
690
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
689
+ const XElForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-441b419b"]]);
690
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
691
691
  __name: "XElFormItem",
692
692
  props: {
693
693
  label: {
@@ -770,8 +770,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
770
770
  };
771
771
  }
772
772
  });
773
- const XElFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-50c1c717"]]);
774
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
773
+ const XElFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-50c1c717"]]);
774
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
775
775
  __name: "XElOption",
776
776
  props: {
777
777
  label: {
@@ -831,7 +831,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
831
831
  };
832
832
  }
833
833
  });
834
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
834
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
835
835
  __name: "XElSelect",
836
836
  props: {
837
837
  modelValue: {
@@ -955,7 +955,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
955
955
  }
956
956
  });
957
957
  const _hoisted_1$3 = { class: "x-pagination" };
958
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
958
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
959
959
  __name: "XPagination",
960
960
  props: {
961
961
  currentPage: {
@@ -1027,8 +1027,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1027
1027
  };
1028
1028
  }
1029
1029
  });
1030
- const XPagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-bd405b6e"]]);
1031
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1030
+ const XPagination = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-bd405b6e"]]);
1031
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1032
1032
  __name: "XVxeTable",
1033
1033
  props: {
1034
1034
  tableData: { type: Array, default: () => [] },
@@ -1292,7 +1292,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1292
1292
  };
1293
1293
  }
1294
1294
  });
1295
- const XVxeTable = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9111013e"]]);
1295
+ const XVxeTable = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9111013e"]]);
1296
1296
  const _hoisted_1$2 = { class: "x-report-table" };
1297
1297
  const _hoisted_2$2 = { class: "report-header" };
1298
1298
  const _hoisted_3$2 = { class: "report-title" };
@@ -1320,7 +1320,7 @@ const _hoisted_24 = { key: 0 };
1320
1320
  const _hoisted_25 = { class: "" };
1321
1321
  const _hoisted_26 = { class: "" };
1322
1322
  const _hoisted_27 = { class: "" };
1323
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1323
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1324
1324
  __name: "XReportTable",
1325
1325
  props: {
1326
1326
  tableData: { type: Array, default: () => [] },
@@ -1642,7 +1642,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1642
1642
  };
1643
1643
  }
1644
1644
  });
1645
- const XReportTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-00481d7c"]]);
1645
+ const XReportTable = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-00481d7c"]]);
1646
1646
  const _hoisted_1$1 = {
1647
1647
  key: 0,
1648
1648
  class: "search-top"
@@ -1687,7 +1687,7 @@ const _hoisted_14 = { class: "search-top-extra-content" };
1687
1687
  const _hoisted_15 = { class: "search-top__actions" };
1688
1688
  const _hoisted_16 = { class: "search-form__buttons" };
1689
1689
  const _hoisted_17 = { class: "search-form__buttons" };
1690
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1690
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1691
1691
  __name: "XSearchBar",
1692
1692
  props: {
1693
1693
  modelValue: {
@@ -1759,7 +1759,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1759
1759
  const slots = useSlots();
1760
1760
  const showMore = ref(false);
1761
1761
  const queryFormRef = ref();
1762
- const vxeFormRef = ref();
1763
1762
  const dynamicFormRef = ref();
1764
1763
  const componentMap = {
1765
1764
  "el-input": ElInput,
@@ -1783,7 +1782,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1783
1782
  }
1784
1783
  });
1785
1784
  const hasFormSlot = computed(() => !!slots.form);
1786
- const hasVxeFormSlot = computed(() => !!slots.vxeForm);
1787
1785
  const hasDynamicFields = computed(() => parsedSearchList.value.length > 0);
1788
1786
  const vxeFormSpan = computed(() => Math.floor(24 / props.columns));
1789
1787
  const formContainerStyle = computed(() => ({
@@ -1874,9 +1872,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1874
1872
  dynamicFormRef.value.resetFields();
1875
1873
  });
1876
1874
  }
1877
- if (hasVxeFormSlot.value && vxeFormRef.value && typeof vxeFormRef.value.reset === "function") {
1878
- vxeFormRef.value.reset();
1879
- }
1880
1875
  if (props.queryForm && Object.keys(props.queryForm).length > 0) {
1881
1876
  const emptyForm = {};
1882
1877
  Object.keys(props.queryForm).forEach((key) => {
@@ -1896,25 +1891,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1896
1891
  }
1897
1892
  function searchParentList() {
1898
1893
  if (props.rules && Object.keys(props.rules).length > 0) {
1899
- if (hasVxeFormSlot.value && vxeFormRef.value) {
1900
- return new Promise((resolve, reject) => {
1901
- if (typeof vxeFormRef.value.validate === "function") {
1902
- vxeFormRef.value.validate((valid) => {
1903
- if (valid) {
1904
- showMore.value = true;
1905
- reject(false);
1906
- } else {
1907
- showMore.value = false;
1908
- emit("list-update", 1);
1909
- resolve(true);
1910
- }
1911
- });
1912
- } else {
1913
- emit("list-update", 1);
1914
- resolve(true);
1915
- }
1916
- });
1917
- }
1918
1894
  if (hasFormSlot.value && queryFormRef.value && typeof queryFormRef.value.validate === "function") {
1919
1895
  return new Promise((resolve, reject) => {
1920
1896
  queryFormRef.value.validate((valid) => {
@@ -1957,13 +1933,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1957
1933
  }, { deep: true });
1958
1934
  __expose({
1959
1935
  queryFormRef,
1960
- vxeFormRef,
1961
1936
  dynamicFormRef
1962
1937
  });
1963
1938
  return (_ctx, _cache) => {
1964
1939
  const _component_el_button = resolveComponent("el-button");
1965
- const _component_vxe_form_item = resolveComponent("vxe-form-item");
1966
- const _component_vxe_form = resolveComponent("vxe-form");
1967
1940
  return openBlock(), createElementBlock("div", {
1968
1941
  class: "search",
1969
1942
  style: normalizeStyle({ paddingBottom: __props.paddingBottom })
@@ -2101,55 +2074,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2101
2074
  ]),
2102
2075
  _: 3
2103
2076
  }, 8, ["rules", "model", "span", "label-width"])) : createCommentVNode("", true),
2104
- hasVxeFormSlot.value ? (openBlock(), createBlock(_component_vxe_form, {
2105
- key: 1,
2106
- data: __props.queryForm,
2107
- rules: __props.rules,
2108
- span: vxeFormSpan.value,
2109
- titleColon: "",
2110
- vertical: "",
2111
- "title-align": "right",
2112
- "title-width": __props.titleWidth,
2113
- size: "medium",
2114
- ref_key: "vxeFormRef",
2115
- ref: vxeFormRef
2116
- }, {
2117
- default: withCtx(() => [
2118
- renderSlot(_ctx.$slots, "vxeForm", {}, void 0, true),
2119
- !__props.showSearch ? (openBlock(), createBlock(_component_vxe_form_item, {
2120
- key: 0,
2121
- span: buttonItemSpan.value,
2122
- align: "right"
2123
- }, {
2124
- default: withCtx(() => [
2125
- createVNode(_component_el_button, {
2126
- plain: "",
2127
- onClick: reset
2128
- }, {
2129
- default: withCtx(() => _cache[7] || (_cache[7] = [
2130
- createTextVNode("重 置")
2131
- ])),
2132
- _: 1,
2133
- __: [7]
2134
- }),
2135
- createVNode(_component_el_button, {
2136
- type: "primary",
2137
- onClick: searchParentList
2138
- }, {
2139
- default: withCtx(() => _cache[8] || (_cache[8] = [
2140
- createTextVNode("查 询")
2141
- ])),
2142
- _: 1,
2143
- __: [8]
2144
- })
2145
- ]),
2146
- _: 1
2147
- }, 8, ["span"])) : createCommentVNode("", true)
2148
- ]),
2149
- _: 3
2150
- }, 8, ["data", "rules", "span", "title-width"])) : createCommentVNode("", true),
2151
2077
  hasDynamicFields.value ? (openBlock(), createBlock(XElForm, {
2152
- key: 2,
2078
+ key: 1,
2153
2079
  rules: dynamicRules.value,
2154
2080
  model: __props.queryForm,
2155
2081
  ref_key: "dynamicFormRef",
@@ -2199,21 +2125,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2199
2125
  plain: "",
2200
2126
  onClick: reset
2201
2127
  }, {
2202
- default: withCtx(() => _cache[9] || (_cache[9] = [
2128
+ default: withCtx(() => _cache[7] || (_cache[7] = [
2203
2129
  createTextVNode("重 置")
2204
2130
  ])),
2205
2131
  _: 1,
2206
- __: [9]
2132
+ __: [7]
2207
2133
  }),
2208
2134
  createVNode(_component_el_button, {
2209
2135
  type: "primary",
2210
2136
  onClick: searchParentList
2211
2137
  }, {
2212
- default: withCtx(() => _cache[10] || (_cache[10] = [
2138
+ default: withCtx(() => _cache[8] || (_cache[8] = [
2213
2139
  createTextVNode("查 询")
2214
2140
  ])),
2215
2141
  _: 1,
2216
- __: [10]
2142
+ __: [8]
2217
2143
  })
2218
2144
  ])
2219
2145
  ]),
@@ -2230,7 +2156,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2230
2156
  };
2231
2157
  }
2232
2158
  });
2233
- const XSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7caed879"]]);
2159
+ const XSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0c479461"]]);
2234
2160
  const _hoisted_1 = { class: "x-split-layout__sidebar-menu" };
2235
2161
  const _hoisted_2 = ["onClick"];
2236
2162
  const _hoisted_3 = { class: "x-split-layout__menu-icon" };
@@ -2245,7 +2171,7 @@ const _hoisted_8 = {
2245
2171
  key: 1,
2246
2172
  class: "x-split-layout__content-footer"
2247
2173
  };
2248
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2174
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2249
2175
  __name: "XSplitLayout",
2250
2176
  props: {
2251
2177
  height: { type: String, default: "100%" },
@@ -2448,7 +2374,95 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2448
2374
  };
2449
2375
  }
2450
2376
  });
2451
- const XSplitLayout = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c57f39a8"]]);
2377
+ const XSplitLayout = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c57f39a8"]]);
2378
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2379
+ __name: "XSwitch",
2380
+ props: {
2381
+ modelValue: {
2382
+ type: [Boolean, String, Number],
2383
+ default: void 0
2384
+ },
2385
+ activeColor: {
2386
+ type: String,
2387
+ default: "#67C23A"
2388
+ },
2389
+ inactiveColor: {
2390
+ type: String,
2391
+ default: void 0
2392
+ },
2393
+ activeText: {
2394
+ type: String,
2395
+ default: void 0
2396
+ },
2397
+ inactiveText: {
2398
+ type: String,
2399
+ default: void 0
2400
+ },
2401
+ activeValue: {
2402
+ type: [Boolean, String, Number],
2403
+ default: true
2404
+ },
2405
+ inactiveValue: {
2406
+ type: [Boolean, String, Number],
2407
+ default: false
2408
+ },
2409
+ activeIcon: {
2410
+ type: Object,
2411
+ default: void 0
2412
+ },
2413
+ inactiveIcon: {
2414
+ type: Object,
2415
+ default: void 0
2416
+ },
2417
+ width: {
2418
+ type: [String, Number],
2419
+ default: void 0
2420
+ },
2421
+ size: {
2422
+ type: String,
2423
+ default: void 0
2424
+ },
2425
+ disabled: {
2426
+ type: Boolean,
2427
+ default: false
2428
+ },
2429
+ loading: {
2430
+ type: Boolean,
2431
+ default: false
2432
+ },
2433
+ inlinePrompt: {
2434
+ type: Boolean,
2435
+ default: false
2436
+ }
2437
+ },
2438
+ emits: ["update:modelValue", "change"],
2439
+ setup(__props, { emit: __emit }) {
2440
+ const props = __props;
2441
+ const emit = __emit;
2442
+ const switchAttrs = computed(() => {
2443
+ return {
2444
+ ...props,
2445
+ "active-color": props.activeColor,
2446
+ "inactive-color": props.inactiveColor,
2447
+ "active-text": props.activeText,
2448
+ "inactive-text": props.inactiveText,
2449
+ "active-value": props.activeValue,
2450
+ "inactive-value": props.inactiveValue,
2451
+ "active-icon": props.activeIcon,
2452
+ "inactive-icon": props.inactiveIcon,
2453
+ "inline-prompt": props.inlinePrompt
2454
+ };
2455
+ });
2456
+ const handleChange = (val) => {
2457
+ emit("update:modelValue", val);
2458
+ emit("change", val);
2459
+ };
2460
+ return (_ctx, _cache) => {
2461
+ const _component_el_switch = resolveComponent("el-switch");
2462
+ return openBlock(), createBlock(_component_el_switch, mergeProps({ "model-value": __props.modelValue }, switchAttrs.value, { "onUpdate:modelValue": handleChange }), null, 16, ["model-value"]);
2463
+ };
2464
+ }
2465
+ });
2452
2466
  const _sfc_main = /* @__PURE__ */ defineComponent({
2453
2467
  __name: "XVxeColumn",
2454
2468
  props: {
@@ -2527,7 +2541,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2527
2541
  return {
2528
2542
  name,
2529
2543
  fn: withCtx((slotData) => [
2530
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotData || {})))
2544
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotData || {})), void 0, true)
2531
2545
  ])
2532
2546
  };
2533
2547
  })
@@ -2535,17 +2549,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2535
2549
  };
2536
2550
  }
2537
2551
  });
2552
+ const XVxeColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ace2083"]]);
2538
2553
  const components = {
2539
2554
  XDatePicker,
2540
2555
  XElForm,
2541
2556
  XElFormItem,
2542
- XElOption: _sfc_main$7,
2543
- XElSelect: _sfc_main$6,
2557
+ XElOption: _sfc_main$8,
2558
+ XElSelect: _sfc_main$7,
2544
2559
  XPagination,
2545
2560
  XReportTable,
2546
2561
  XSearchBar,
2547
2562
  XSplitLayout,
2548
- XVxeColumn: _sfc_main,
2563
+ XSwitch: _sfc_main$1,
2564
+ XVxeColumn,
2549
2565
  XVxeTable
2550
2566
  };
2551
2567
  const install = (app) => {
@@ -2568,13 +2584,14 @@ export {
2568
2584
  XDatePicker,
2569
2585
  XElForm,
2570
2586
  XElFormItem,
2571
- _sfc_main$7 as XElOption,
2572
- _sfc_main$6 as XElSelect,
2587
+ _sfc_main$8 as XElOption,
2588
+ _sfc_main$7 as XElSelect,
2573
2589
  XPagination,
2574
2590
  XReportTable,
2575
2591
  XSearchBar,
2576
2592
  XSplitLayout,
2577
- _sfc_main as XVxeColumn,
2593
+ _sfc_main$1 as XSwitch,
2594
+ XVxeColumn,
2578
2595
  XVxeTable,
2579
2596
  index as default,
2580
2597
  directives,