sctj-components 1.0.0 → 1.0.1

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/PUBLISH_GUIDE.md CHANGED
@@ -205,12 +205,159 @@ npm view your-package-name
205
205
  npm install your-package-name
206
206
  ```
207
207
 
208
- ## 🔄 更新版本
208
+ ## 🔄 更新版本的标准流程
209
209
 
210
- 1. 修改代码
211
- 2. 更新版本号:`npm version patch/minor/major`
212
- 3. 构建:`npm run build:lib`
213
- 4. 发布:`npm publish`
210
+ ### 完整操作步骤
211
+
212
+ #### 1. 修改代码
213
+ ```bash
214
+ # 在 src/ 目录下修改组件代码
215
+ # 更新文档(如 README.md)如果需要
216
+ ```
217
+
218
+ #### 2. 更新版本号
219
+
220
+ 根据变更类型选择合适的版本号更新方式:
221
+
222
+ ```bash
223
+ # 补丁版本 (1.0.0 -> 1.0.1) - 修复 bug、小改动
224
+ npm version patch
225
+
226
+ # 次版本 (1.0.0 -> 1.1.0) - 新功能、向后兼容的改动
227
+ npm version minor
228
+
229
+ # 主版本 (1.0.0 -> 2.0.0) - 重大变更、不向后兼容
230
+ npm version major
231
+ ```
232
+
233
+ **或者手动修改 `package.json` 中的 `version` 字段**:
234
+ ```json
235
+ {
236
+ "version": "1.0.1"
237
+ }
238
+ ```
239
+
240
+ **注意**:`npm version` 命令会自动:
241
+ - 更新 `package.json` 中的版本号
242
+ - 创建一个 Git commit(如果使用 `npm version`)
243
+ - 创建 Git tag(如果使用 `npm version`)
244
+
245
+ #### 3. 构建组件库
246
+ ```bash
247
+ npm run build:lib
248
+ ```
249
+
250
+ 这会生成 `lib/` 目录下的构建文件。
251
+
252
+ #### 4. 提交到 Git(如果使用 `npm version`,这一步可能已自动完成)
253
+
254
+ ```bash
255
+ # 查看更改
256
+ git status
257
+
258
+ # 添加更改的文件
259
+ git add .
260
+
261
+ # 提交(如果使用 npm version,可能已经有 commit)
262
+ git commit -m "chore: 发布版本 1.0.1"
263
+
264
+ # 推送代码和标签
265
+ git push
266
+ git push --tags
267
+ ```
268
+
269
+ #### 5. 发布到 npm
270
+
271
+ ```bash
272
+ # 发布正式版本(latest)
273
+ npm publish
274
+
275
+ # 或发布测试版本
276
+ npm publish --tag beta
277
+ ```
278
+
279
+ ### 版本号规则(语义化版本)
280
+
281
+ 遵循 [语义化版本规范](https://semver.org/lang/zh-CN/):
282
+
283
+ - **主版本号(Major)**:不兼容的 API 修改
284
+ - 例如:`1.0.0` → `2.0.0`
285
+ - 使用:`npm version major`
286
+
287
+ - **次版本号(Minor)**:向后兼容的功能性新增
288
+ - 例如:`1.0.0` → `1.1.0`
289
+ - 使用:`npm version minor`
290
+
291
+ - **补丁版本号(Patch)**:向后兼容的问题修正
292
+ - 例如:`1.0.0` → `1.0.1`
293
+ - 使用:`npm version patch`
294
+
295
+ ### 快速更新流程(推荐)
296
+
297
+ ```bash
298
+ # 1. 修改代码后,更新版本号(会自动创建 commit 和 tag)
299
+ npm version patch # 或 minor、major
300
+
301
+ # 2. 构建(prepublishOnly 脚本会自动执行,但手动构建可以提前检查)
302
+ npm run build:lib
303
+
304
+ # 3. 推送到 Git
305
+ git push
306
+ git push --tags
307
+
308
+ # 4. 发布到 npm
309
+ npm publish
310
+ ```
311
+
312
+ ### 使用 prepublishOnly 脚本(已配置)
313
+
314
+ 你的 `package.json` 中已经配置了 `prepublishOnly`:
315
+
316
+ ```json
317
+ {
318
+ "scripts": {
319
+ "prepublishOnly": "npm run build:lib"
320
+ }
321
+ }
322
+ ```
323
+
324
+ 这意味着执行 `npm publish` 时会**自动**先执行 `npm run build:lib`,所以可以省略手动构建步骤:
325
+
326
+ ```bash
327
+ # 简化流程
328
+ npm version patch
329
+ git push && git push --tags
330
+ npm publish
331
+ ```
332
+
333
+ ### 发布到私有 npm 源
334
+
335
+ 如果使用私有源:
336
+
337
+ ```bash
338
+ # 1. 更新版本号
339
+ npm version patch
340
+
341
+ # 2. 推送代码
342
+ git push && git push --tags
343
+
344
+ # 3. 发布到私有源(如果已配置 .npmrc,直接 publish 即可)
345
+ npm publish
346
+
347
+ # 或指定私有源
348
+ npm publish --registry=https://your-private-registry-url
349
+ ```
350
+
351
+ ### 版本更新检查清单
352
+
353
+ - [ ] 代码修改完成并测试通过
354
+ - [ ] 更新版本号(使用 `npm version` 或手动修改)
355
+ - [ ] 构建成功(`npm run build:lib`)
356
+ - [ ] 检查 `lib/` 目录文件是否正确生成
357
+ - [ ] 提交代码到 Git(如果使用 `npm version` 已自动完成)
358
+ - [ ] 推送代码和标签到远程仓库
359
+ - [ ] 发布到 npm(正式版或测试版)
360
+ - [ ] 验证发布成功(`npm view sctj-components`)
214
361
 
215
362
  ## ⚠️ 常见问题
216
363
 
@@ -20,7 +20,7 @@ const _export_sfc = (sfc, props) => {
20
20
  return target;
21
21
  };
22
22
  const _hoisted_1$n = { class: "dict-tag-container" };
23
- const _hoisted_2$e = ["index"];
23
+ const _hoisted_2$f = ["index"];
24
24
  const _sfc_main$t = {
25
25
  __name: "index",
26
26
  props: {
@@ -49,7 +49,7 @@ const _sfc_main$t = {
49
49
  key: item.value,
50
50
  index: index2,
51
51
  class: normalizeClass(item.elTagClass)
52
- }, toDisplayString(item.label), 11, _hoisted_2$e)) : (openBlock(), createBlock(_component_el_tag, {
52
+ }, toDisplayString(item.label), 11, _hoisted_2$f)) : (openBlock(), createBlock(_component_el_tag, {
53
53
  "disable-transitions": true,
54
54
  key: item.value + "",
55
55
  index: index2,
@@ -235,7 +235,7 @@ const _sfc_main$r = defineComponent({
235
235
  }
236
236
  });
237
237
  const _hoisted_1$l = ["xlink:href", "fill"];
238
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
238
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
239
239
  return openBlock(), createElementBlock("svg", {
240
240
  class: normalizeClass(_ctx.svgClass),
241
241
  "aria-hidden": "true"
@@ -246,13 +246,13 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
246
246
  }, null, 8, _hoisted_1$l)
247
247
  ], 2);
248
248
  }
249
- const SCTJSvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$2]]);
249
+ const SCTJSvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$1]]);
250
250
  const index$2 = "";
251
251
  const index$1 = "";
252
252
  const index_vue_vue_type_style_index_0_scoped_ca0fa60b_lang = "";
253
253
  const index_vue_vue_type_style_index_1_lang = "";
254
254
  const _hoisted_1$k = { class: "upload-file" };
255
- const _hoisted_2$d = { class: "el-upload__tip" };
255
+ const _hoisted_2$e = { class: "el-upload__tip" };
256
256
  const _hoisted_3$c = { style: { "color": "#f56c6c" } };
257
257
  const _hoisted_4$a = { style: { "color": "#f56c6c" } };
258
258
  const _hoisted_5$8 = ["title"];
@@ -523,7 +523,7 @@ const _sfc_main$q = {
523
523
  unref(showTip) ? {
524
524
  name: "tip",
525
525
  fn: withCtx(() => [
526
- createElementVNode("div", _hoisted_2$d, [
526
+ createElementVNode("div", _hoisted_2$e, [
527
527
  createTextVNode(" \u8BF7\u4E0A\u4F20 "),
528
528
  __props.fileSize ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
529
529
  createTextVNode(" \u5927\u5C0F\u4E0D\u8D85\u8FC7 "),
@@ -633,7 +633,7 @@ const _sfc_main$q = {
633
633
  const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-ca0fa60b"]]);
634
634
  const index_vue_vue_type_style_index_0_scoped_13e683b8_lang = "";
635
635
  const _hoisted_1$j = { class: "component-upload-image" };
636
- const _hoisted_2$c = {
636
+ const _hoisted_2$d = {
637
637
  key: 0,
638
638
  class: "el-upload__tip"
639
639
  };
@@ -892,7 +892,7 @@ const _sfc_main$p = {
892
892
  ]),
893
893
  _: 1
894
894
  }, 8, ["disabled", "action", "limit", "http-request", "headers", "file-list", "class"]),
895
- unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
895
+ unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
896
896
  createTextVNode(" \u8BF7\u4E0A\u4F20 "),
897
897
  props.fileSize ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
898
898
  createTextVNode(" \u5927\u5C0F\u4E0D\u8D85\u8FC7 "),
@@ -1066,7 +1066,7 @@ for (const path in modules) {
1066
1066
  const index_vue_vue_type_style_index_0_scoped_f1b4799d_lang = "";
1067
1067
  const _withScopeId$7 = (n) => (pushScopeId("data-v-f1b4799d"), n = n(), popScopeId(), n);
1068
1068
  const _hoisted_1$h = { class: "icon-body" };
1069
- const _hoisted_2$b = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ createElementVNode("i", { class: "el-icon-search el-input__icon" }, null, -1));
1069
+ const _hoisted_2$c = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ createElementVNode("i", { class: "el-icon-search el-input__icon" }, null, -1));
1070
1070
  const _hoisted_3$a = { class: "icon-list" };
1071
1071
  const _hoisted_4$8 = ["onClick"];
1072
1072
  const _sfc_main$n = {
@@ -1106,7 +1106,7 @@ const _sfc_main$n = {
1106
1106
  onInput: filterIcons
1107
1107
  }, {
1108
1108
  suffix: withCtx(() => [
1109
- _hoisted_2$b
1109
+ _hoisted_2$c
1110
1110
  ]),
1111
1111
  _: 1
1112
1112
  }, 8, ["modelValue"]),
@@ -1155,12 +1155,12 @@ function useMobile() {
1155
1155
  checkIsMobile
1156
1156
  };
1157
1157
  }
1158
- const index_vue_vue_type_style_index_0_scoped_84111394_lang = "";
1158
+ const index_vue_vue_type_style_index_0_scoped_6e30b57f_lang = "";
1159
1159
  const _hoisted_1$g = {
1160
1160
  key: 0,
1161
1161
  class: "search-container"
1162
1162
  };
1163
- const _hoisted_2$a = {
1163
+ const _hoisted_2$b = {
1164
1164
  key: 1,
1165
1165
  class: "custom-drawer"
1166
1166
  };
@@ -1175,9 +1175,6 @@ const _sfc_main$m = {
1175
1175
  emits: ["update:visible"],
1176
1176
  setup(__props, { emit }) {
1177
1177
  const { isMobile } = useMobile();
1178
- watch$1(isMobile, (newVal) => {
1179
- emit("update:visible", !newVal);
1180
- }, { immediate: true });
1181
1178
  const close = () => {
1182
1179
  emit("update:visible", false);
1183
1180
  };
@@ -1193,7 +1190,7 @@ const _sfc_main$m = {
1193
1190
  })
1194
1191
  ], 512)), [
1195
1192
  [vShow, __props.visible]
1196
- ]) : (openBlock(), createElementBlock("div", _hoisted_2$a, [
1193
+ ]) : (openBlock(), createElementBlock("div", _hoisted_2$b, [
1197
1194
  createVNode(_component_el_drawer, {
1198
1195
  "model-value": __props.visible,
1199
1196
  title: "\u7B5B\u9009\u6761\u4EF6",
@@ -1209,7 +1206,7 @@ const _sfc_main$m = {
1209
1206
  };
1210
1207
  }
1211
1208
  };
1212
- const SCTJSearch = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-84111394"]]);
1209
+ const SCTJSearch = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-6e30b57f"]]);
1213
1210
  const _sfc_main$l = {
1214
1211
  __name: "index",
1215
1212
  props: {
@@ -1640,23 +1637,14 @@ const SCTJTable = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-
1640
1637
  const index_vue_vue_type_style_index_0_scoped_45fb95db_lang = "";
1641
1638
  const _sfc_main$j = {};
1642
1639
  const _hoisted_1$e = { class: "table-container" };
1643
- function _sfc_render$1(_ctx, _cache) {
1644
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
1645
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
1646
- ]);
1647
- }
1648
- const SCTJTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$1], ["__scopeId", "data-v-45fb95db"]]);
1649
- const index_vue_vue_type_style_index_0_scoped_12330962_lang = "";
1650
- const _sfc_main$i = {};
1651
- const _hoisted_1$d = { class: "table-page-container" };
1652
1640
  function _sfc_render(_ctx, _cache) {
1653
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
1641
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
1654
1642
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
1655
1643
  ]);
1656
1644
  }
1657
- const SCTJTablePageContainer = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render], ["__scopeId", "data-v-12330962"]]);
1645
+ const SCTJTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render], ["__scopeId", "data-v-45fb95db"]]);
1658
1646
  const index_vue_vue_type_style_index_0_scoped_f8b93d19_lang = "";
1659
- const _sfc_main$h = {
1647
+ const _sfc_main$i = {
1660
1648
  __name: "index",
1661
1649
  props: {
1662
1650
  showSearch: {
@@ -1796,10 +1784,10 @@ const _sfc_main$h = {
1796
1784
  };
1797
1785
  }
1798
1786
  };
1799
- const SCTJRightToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-f8b93d19"]]);
1787
+ const SCTJRightToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-f8b93d19"]]);
1800
1788
  const index_vue_vue_type_style_index_0_scoped_056cfdde_lang = "";
1801
- const _hoisted_1$c = { class: "table-top-action-container" };
1802
- const _sfc_main$g = {
1789
+ const _hoisted_1$d = { class: "table-top-action-container" };
1790
+ const _sfc_main$h = {
1803
1791
  __name: "index",
1804
1792
  props: {
1805
1793
  showSearch: {
@@ -1826,7 +1814,7 @@ const _sfc_main$g = {
1826
1814
  emit("refresh");
1827
1815
  };
1828
1816
  return (_ctx, _cache) => {
1829
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
1817
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
1830
1818
  renderSlot(_ctx.$slots, "left", {}, void 0, true),
1831
1819
  renderSlot(_ctx.$slots, "right", {}, () => [
1832
1820
  createVNode(SCTJRightToolbar, {
@@ -1840,7 +1828,58 @@ const _sfc_main$g = {
1840
1828
  };
1841
1829
  }
1842
1830
  };
1843
- const SCTJTableTopActionContainer = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-056cfdde"]]);
1831
+ const SCTJTableTopActionContainer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-056cfdde"]]);
1832
+ const index_vue_vue_type_style_index_0_scoped_cd968be9_lang = "";
1833
+ const _hoisted_1$c = { class: "table-page-container" };
1834
+ const _hoisted_2$a = { style: { "flex": "1", "height": "0" } };
1835
+ const _sfc_main$g = {
1836
+ __name: "index",
1837
+ props: {
1838
+ showSearch: {
1839
+ type: Boolean,
1840
+ default: true
1841
+ }
1842
+ },
1843
+ emits: ["refresh", "update:showSearch"],
1844
+ setup(__props, { emit }) {
1845
+ const props = __props;
1846
+ const { isMobile } = useMobile();
1847
+ const refresh = () => {
1848
+ emit("refresh");
1849
+ };
1850
+ const outSearch = computed$1({
1851
+ get() {
1852
+ return props.showSearch;
1853
+ },
1854
+ set(val) {
1855
+ emit("update:showSearch", val);
1856
+ }
1857
+ });
1858
+ watch$1(isMobile, (newVal) => {
1859
+ emit("update:showSearch", !newVal);
1860
+ }, { immediate: true });
1861
+ return (_ctx, _cache) => {
1862
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
1863
+ renderSlot(_ctx.$slots, "search", {}, void 0, true),
1864
+ createVNode(SCTJTableTopActionContainer, {
1865
+ showSearch: unref(outSearch),
1866
+ "onUpdate:showSearch": _cache[0] || (_cache[0] = ($event) => isRef(outSearch) ? outSearch.value = $event : null),
1867
+ onRefresh: refresh
1868
+ }, {
1869
+ left: withCtx(() => [
1870
+ renderSlot(_ctx.$slots, "btn", {}, void 0, true)
1871
+ ]),
1872
+ _: 3
1873
+ }, 8, ["showSearch"]),
1874
+ createElementVNode("div", _hoisted_2$a, [
1875
+ renderSlot(_ctx.$slots, "table", {}, void 0, true)
1876
+ ]),
1877
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
1878
+ ]);
1879
+ };
1880
+ }
1881
+ };
1882
+ const SCTJTablePageContainer = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-cd968be9"]]);
1844
1883
  const _sfc_main$f = {
1845
1884
  __name: "index",
1846
1885
  setup(__props) {