hzzt-plus 0.0.1-dev-04 → 0.0.1-dev-06

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 (75) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +134 -51
  3. package/dist/index.full.min.js +13 -13
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +12 -12
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +125 -48
  8. package/es/component.mjs +3 -1
  9. package/es/component.mjs.map +1 -1
  10. package/es/components/index.d.ts +1 -0
  11. package/es/components/index.mjs +1 -0
  12. package/es/components/index.mjs.map +1 -1
  13. package/es/components/tab/index.d.ts +45 -0
  14. package/es/components/tab/index.mjs +8 -0
  15. package/es/components/tab/index.mjs.map +1 -0
  16. package/es/components/tab/src/index.mjs +78 -0
  17. package/es/components/tab/src/index.mjs.map +1 -0
  18. package/es/components/tab/src/index.vue.d.ts +45 -0
  19. package/es/components/tab/style/css.d.ts +2 -0
  20. package/es/components/tab/style/css.mjs +3 -0
  21. package/es/components/tab/style/css.mjs.map +1 -0
  22. package/es/components/tab/style/index.d.ts +2 -0
  23. package/es/components/tab/style/index.mjs +3 -0
  24. package/es/components/tab/style/index.mjs.map +1 -0
  25. package/es/directives/download/index.d.ts +3 -0
  26. package/es/directives/download/index.mjs +21 -0
  27. package/es/directives/download/index.mjs.map +1 -0
  28. package/es/directives/height/index.d.ts +3 -0
  29. package/es/directives/height/index.mjs +80 -0
  30. package/es/directives/height/index.mjs.map +1 -0
  31. package/es/directives/index.d.ts +1 -0
  32. package/es/directives/index.mjs +2 -0
  33. package/es/directives/index.mjs.map +1 -0
  34. package/es/index.d.ts +1 -0
  35. package/es/index.mjs +2 -0
  36. package/es/index.mjs.map +1 -1
  37. package/global.d.ts +1 -0
  38. package/lib/component.js +3 -1
  39. package/lib/component.js.map +1 -1
  40. package/lib/components/index.d.ts +1 -0
  41. package/lib/components/index.js +2 -0
  42. package/lib/components/index.js.map +1 -1
  43. package/lib/components/tab/index.d.ts +45 -0
  44. package/lib/components/tab/index.js +13 -0
  45. package/lib/components/tab/index.js.map +1 -0
  46. package/lib/components/tab/src/index.js +82 -0
  47. package/lib/components/tab/src/index.js.map +1 -0
  48. package/lib/components/tab/src/index.vue.d.ts +45 -0
  49. package/lib/components/tab/style/css.d.ts +2 -0
  50. package/lib/components/tab/style/css.js +6 -0
  51. package/lib/components/tab/style/css.js.map +1 -0
  52. package/lib/components/tab/style/index.d.ts +2 -0
  53. package/lib/components/tab/style/index.js +6 -0
  54. package/lib/components/tab/style/index.js.map +1 -0
  55. package/lib/directives/download/index.d.ts +3 -0
  56. package/lib/directives/download/index.js +25 -0
  57. package/lib/directives/download/index.js.map +1 -0
  58. package/lib/directives/height/index.d.ts +3 -0
  59. package/lib/directives/height/index.js +84 -0
  60. package/lib/directives/height/index.js.map +1 -0
  61. package/lib/directives/index.d.ts +1 -0
  62. package/lib/directives/index.js +10 -0
  63. package/lib/directives/index.js.map +1 -0
  64. package/lib/index.d.ts +1 -0
  65. package/lib/index.js +20 -11
  66. package/lib/index.js.map +1 -1
  67. package/package.json +1 -1
  68. package/theme/base.css +1 -1
  69. package/theme/hzzt-tab.css +1 -0
  70. package/theme/index.css +1 -1
  71. package/theme/src/base.scss +1 -1
  72. package/theme/src/common/{position.scss → display.scss} +35 -0
  73. package/theme/src/common/font.scss +13 -0
  74. package/theme/src/index.scss +1 -0
  75. package/theme/src/tab.scss +63 -0
@@ -1,6 +1,7 @@
1
1
  /*! Hzzt Plus v0.0.1 */
2
2
 
3
3
  import { warn, unref, computed, isRef, ref, inject, getCurrentInstance, provide, defineComponent, renderSlot, useSlots, openBlock, createElementBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withDirectives, withModifiers, normalizeClass, Fragment, renderList, watch } from 'vue';
4
+ export * from '@hzzt-plus/directives';
4
5
 
5
6
  var _a;
6
7
  const isClient = typeof window !== "undefined";
@@ -7058,20 +7059,20 @@ var _export_sfc = (sfc, props) => {
7058
7059
  return target;
7059
7060
  };
7060
7061
 
7061
- const _hoisted_1$2 = {
7062
+ const _hoisted_1$3 = {
7062
7063
  key: 0,
7063
7064
  class: "hzzt-title flex align-items-center"
7064
7065
  };
7065
- const _hoisted_2$2 = {
7066
+ const _hoisted_2$3 = {
7066
7067
  key: 0,
7067
7068
  class: "decorative-line"
7068
7069
  };
7069
- const _hoisted_3$2 = { class: "label-name" };
7070
- const __default__$2 = defineComponent({
7070
+ const _hoisted_3$3 = { class: "label-name" };
7071
+ const __default__$3 = defineComponent({
7071
7072
  name: "HzztTitle"
7072
7073
  });
7073
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7074
- ...__default__$2,
7074
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
7075
+ ...__default__$3,
7075
7076
  props: {
7076
7077
  label: String,
7077
7078
  sideline: {
@@ -7087,10 +7088,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7087
7088
  return props.label || ((_c = (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) == null ? void 0 : _b[0]) == null ? void 0 : _c.children);
7088
7089
  });
7089
7090
  return (_ctx, _cache) => {
7090
- return unref(showLabel) ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
7091
- __props.sideline ? (openBlock(), createElementBlock("span", _hoisted_2$2)) : createCommentVNode("v-if", true),
7091
+ return unref(showLabel) ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
7092
+ __props.sideline ? (openBlock(), createElementBlock("span", _hoisted_2$3)) : createCommentVNode("v-if", true),
7092
7093
  renderSlot(_ctx.$slots, "before"),
7093
- createElementVNode("label", _hoisted_3$2, [
7094
+ createElementVNode("label", _hoisted_3$3, [
7094
7095
  renderSlot(_ctx.$slots, "default", {}, () => [
7095
7096
  createTextVNode(toDisplayString(__props.label), 1)
7096
7097
  ])
@@ -7099,7 +7100,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7099
7100
  };
7100
7101
  }
7101
7102
  });
7102
- var Title = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "index.vue"]]);
7103
+ var Title = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "index.vue"]]);
7103
7104
 
7104
7105
  const HzztTitle = withInstall(Title);
7105
7106
 
@@ -7175,18 +7176,18 @@ const ClickOutside = {
7175
7176
  }
7176
7177
  };
7177
7178
 
7178
- const _hoisted_1$1 = ["onClick"];
7179
- const _hoisted_2$1 = { class: "hzzt-dropdown-name" };
7180
- const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("span", { class: "caret" }, null, -1);
7181
- const _hoisted_4$1 = { class: "hzzt-dropdown-menu" };
7182
- const _hoisted_5$1 = ["onClick"];
7183
- const _hoisted_6$1 = { class: "submenu" };
7184
- const _hoisted_7$1 = ["onClick"];
7185
- const __default__$1 = defineComponent({
7179
+ const _hoisted_1$2 = ["onClick"];
7180
+ const _hoisted_2$2 = { class: "hzzt-dropdown-name" };
7181
+ const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("span", { class: "caret" }, null, -1);
7182
+ const _hoisted_4$2 = { class: "hzzt-dropdown-menu" };
7183
+ const _hoisted_5$2 = ["onClick"];
7184
+ const _hoisted_6$2 = { class: "submenu" };
7185
+ const _hoisted_7$2 = ["onClick"];
7186
+ const __default__$2 = defineComponent({
7186
7187
  name: "HzztDropDown"
7187
7188
  });
7188
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7189
- ...__default__$1,
7189
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7190
+ ...__default__$2,
7190
7191
  props: {
7191
7192
  options: {
7192
7193
  type: Array,
@@ -7241,9 +7242,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7241
7242
  createElementVNode("li", {
7242
7243
  class: normalizeClass({ "hzzt-dropdown-li": true, "hzzt-dropdown-li-show": toggle.value })
7243
7244
  }, [
7244
- createElementVNode("span", _hoisted_2$1, toDisplayString(__props.label), 1),
7245
- _hoisted_3$1,
7246
- createElementVNode("ul", _hoisted_4$1, [
7245
+ createElementVNode("span", _hoisted_2$2, toDisplayString(__props.label), 1),
7246
+ _hoisted_3$2,
7247
+ createElementVNode("ul", _hoisted_4$2, [
7247
7248
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
7248
7249
  return openBlock(), createElementBlock(Fragment, null, [
7249
7250
  unref(isEmpty)(option[__props.props.children]) ? (openBlock(), createElementBlock("li", {
@@ -7253,12 +7254,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7253
7254
  createElementVNode("a", {
7254
7255
  onClick: ($event) => selectValue([option[__props.props.value]]),
7255
7256
  class: "hzzt-dropdown-menu-item-label"
7256
- }, toDisplayString(option[__props.props.label]), 9, _hoisted_5$1)
7257
+ }, toDisplayString(option[__props.props.label]), 9, _hoisted_5$2)
7257
7258
  ], 2)) : (openBlock(), createElementBlock("li", {
7258
7259
  key: index + "submenu",
7259
7260
  class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
7260
7261
  }, [
7261
- createElementVNode("a", _hoisted_6$1, toDisplayString(option[__props.props.label]), 1),
7262
+ createElementVNode("a", _hoisted_6$2, toDisplayString(option[__props.props.label]), 1),
7262
7263
  createElementVNode("ul", {
7263
7264
  class: normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
7264
7265
  }, [
@@ -7270,7 +7271,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7270
7271
  createElementVNode("a", {
7271
7272
  onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]]),
7272
7273
  class: "hzzt-dropdown-menu-item-label"
7273
- }, toDisplayString(child[__props.props.label]), 9, _hoisted_7$1)
7274
+ }, toDisplayString(child[__props.props.label]), 9, _hoisted_7$2)
7274
7275
  ], 2);
7275
7276
  }), 128))
7276
7277
  ], 2)
@@ -7283,31 +7284,31 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7283
7284
  }), 256))
7284
7285
  ])
7285
7286
  ], 2)
7286
- ], 8, _hoisted_1$1)), [
7287
+ ], 8, _hoisted_1$2)), [
7287
7288
  [unref(ClickOutside), close]
7288
7289
  ]);
7289
7290
  };
7290
7291
  }
7291
7292
  });
7292
- var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "index.vue"]]);
7293
+ var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "index.vue"]]);
7293
7294
 
7294
7295
  const HzztDropdown = withInstall(Dropdown);
7295
7296
 
7296
- const _hoisted_1 = { class: "hzzt-collapse" };
7297
- const _hoisted_2 = { class: "flex align-items-center" };
7298
- const _hoisted_3 = { class: "hzzt-collapse-title-wrapper" };
7299
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
7300
- const _hoisted_5 = { class: "hzzt-collapse-title" };
7301
- const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
7302
- const _hoisted_7 = {
7297
+ const _hoisted_1$1 = { class: "hzzt-collapse" };
7298
+ const _hoisted_2$1 = { class: "flex align-items-center" };
7299
+ const _hoisted_3$1 = { class: "hzzt-collapse-title-wrapper" };
7300
+ const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
7301
+ const _hoisted_5$1 = { class: "hzzt-collapse-title" };
7302
+ const _hoisted_6$1 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
7303
+ const _hoisted_7$1 = {
7303
7304
  key: 0,
7304
7305
  class: "hzzt-collapse-text"
7305
7306
  };
7306
- const __default__ = defineComponent({
7307
+ const __default__$1 = defineComponent({
7307
7308
  name: "HzztCollapse"
7308
7309
  });
7309
- const _sfc_main = /* @__PURE__ */ defineComponent({
7310
- ...__default__,
7310
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7311
+ ...__default__$1,
7311
7312
  props: {
7312
7313
  defaultActive: {
7313
7314
  type: Boolean,
@@ -7334,19 +7335,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7334
7335
  active.value = !active.value;
7335
7336
  }
7336
7337
  return (_ctx, _cache) => {
7337
- return openBlock(), createElementBlock("div", _hoisted_1, [
7338
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
7338
7339
  createElementVNode("div", {
7339
7340
  class: "hzzt-collapse-header",
7340
7341
  onClick: toggle
7341
7342
  }, [
7342
- createElementVNode("div", _hoisted_2, [
7343
- createElementVNode("div", _hoisted_3, [
7344
- _hoisted_4,
7345
- createElementVNode("div", _hoisted_5, toDisplayString(__props.title), 1)
7343
+ createElementVNode("div", _hoisted_2$1, [
7344
+ createElementVNode("div", _hoisted_3$1, [
7345
+ _hoisted_4$1,
7346
+ createElementVNode("div", _hoisted_5$1, toDisplayString(__props.title), 1)
7346
7347
  ]),
7347
- _hoisted_6
7348
+ _hoisted_6$1
7348
7349
  ]),
7349
- __props.expand ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(active.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)) : createCommentVNode("v-if", true)
7350
+ __props.expand ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(active.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)) : createCommentVNode("v-if", true)
7350
7351
  ]),
7351
7352
  renderSlot(_ctx.$slots, "active", { active: active.value }),
7352
7353
  renderSlot(_ctx.$slots, "default")
@@ -7354,15 +7355,91 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7354
7355
  };
7355
7356
  }
7356
7357
  });
7357
- var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "index.vue"]]);
7358
+ var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "index.vue"]]);
7358
7359
 
7359
7360
  const HzztCollapse = withInstall(Collapse);
7360
7361
 
7362
+ const _hoisted_1 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
7363
+ const _hoisted_2 = { class: "flex align-items-center" };
7364
+ const _hoisted_3 = { class: "flex" };
7365
+ const _hoisted_4 = ["onClick"];
7366
+ const _hoisted_5 = { class: "hzzt-tab-badge" };
7367
+ const _hoisted_6 = {
7368
+ key: 0,
7369
+ class: "hzzt-tab-badge-count"
7370
+ };
7371
+ const _hoisted_7 = { class: "flex wrap" };
7372
+ const __default__ = defineComponent({
7373
+ name: "HzztTab"
7374
+ });
7375
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7376
+ ...__default__,
7377
+ props: {
7378
+ tabList: {
7379
+ type: Array,
7380
+ default: () => []
7381
+ },
7382
+ modelValue: {
7383
+ type: [Number, String, Array]
7384
+ }
7385
+ },
7386
+ emits: ["update:modelValue", "tab-click"],
7387
+ setup(__props, { emit }) {
7388
+ const props = __props;
7389
+ const customTabList = computed(() => props.tabList.map((value) => {
7390
+ const tab = value;
7391
+ return {
7392
+ key: tab.name + "-" + tab.number,
7393
+ ...tab,
7394
+ number: Number(tab.number || 0),
7395
+ hide: tab.hide
7396
+ };
7397
+ }).filter((tab) => !tab.hide));
7398
+ function tabClick(tab, event) {
7399
+ if (tab.name === props.modelValue)
7400
+ return;
7401
+ emit("update:modelValue", tab.name);
7402
+ emit("tab-click", tab, event);
7403
+ }
7404
+ return (_ctx, _cache) => {
7405
+ return openBlock(), createElementBlock("div", _hoisted_1, [
7406
+ createElementVNode("div", _hoisted_2, [
7407
+ createElementVNode("div", _hoisted_3, [
7408
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab) => {
7409
+ return openBlock(), createElementBlock("div", {
7410
+ key: tab.key,
7411
+ onClick: ($event) => tabClick(tab, $event),
7412
+ class: "hzzt-tab-pane"
7413
+ }, [
7414
+ createElementVNode("div", _hoisted_5, [
7415
+ createElementVNode("p", {
7416
+ class: normalizeClass([{ active: __props.modelValue === tab.name }, "hzzt-tab-badge-text"])
7417
+ }, toDisplayString(tab.label), 3),
7418
+ tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true)
7419
+ ])
7420
+ ], 8, _hoisted_4);
7421
+ }), 128))
7422
+ ]),
7423
+ renderSlot(_ctx.$slots, "filter"),
7424
+ renderSlot(_ctx.$slots, "extra")
7425
+ ]),
7426
+ createElementVNode("div", _hoisted_7, [
7427
+ renderSlot(_ctx.$slots, "right")
7428
+ ])
7429
+ ]);
7430
+ };
7431
+ }
7432
+ });
7433
+ var Tab = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "index.vue"]]);
7434
+
7435
+ const HzztTab = withInstall(Tab);
7436
+
7361
7437
  var Components = [
7362
7438
  HzztConfigProvider,
7363
7439
  HzztTitle,
7364
7440
  HzztDropdown,
7365
- HzztCollapse
7441
+ HzztCollapse,
7442
+ HzztTab
7366
7443
  ];
7367
7444
 
7368
7445
  var Plugins = [];
@@ -7372,4 +7449,4 @@ var installer = makeInstaller([...Components, ...Plugins]);
7372
7449
  const install = installer.install;
7373
7450
  const version = installer.version;
7374
7451
 
7375
- export { HzztCollapse, HzztConfigProvider, HzztDropdown, HzztTitle, INSTALLED_KEY, SIZE_INJECTION_KEY, WEEK_DAYS, buildLocaleContext, buildTranslator, componentSizeMap, componentSizes, configProviderContextKey, configProviderProps, datePickTypes, installer as default, install, localeContextKey, makeInstaller, provideGlobalConfig, translate, useGlobalConfig, useGlobalSize, useLocale, useSizeProp, useSizeProps, version };
7452
+ export { HzztCollapse, HzztConfigProvider, HzztDropdown, HzztTab, HzztTitle, INSTALLED_KEY, SIZE_INJECTION_KEY, WEEK_DAYS, buildLocaleContext, buildTranslator, componentSizeMap, componentSizes, configProviderContextKey, configProviderProps, datePickTypes, installer as default, install, localeContextKey, makeInstaller, provideGlobalConfig, translate, useGlobalConfig, useGlobalSize, useLocale, useSizeProp, useSizeProps, version };
package/es/component.mjs CHANGED
@@ -2,12 +2,14 @@ import { HzztTitle } from './components/title/index.mjs';
2
2
  import { HzztDropdown } from './components/dropdown/index.mjs';
3
3
  import { HzztCollapse } from './components/collapse/index.mjs';
4
4
  import { HzztConfigProvider } from './components/config-provider/index.mjs';
5
+ import { HzztTab } from './components/tab/index.mjs';
5
6
 
6
7
  var Components = [
7
8
  HzztConfigProvider,
8
9
  HzztTitle,
9
10
  HzztDropdown,
10
- HzztCollapse
11
+ HzztCollapse,
12
+ HzztTab
11
13
  ];
12
14
 
13
15
  export { Components as default };
@@ -1 +1 @@
1
- {"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n] as Plugin[]\n"],"names":[],"mappings":";;;;;AAIA,iBAAe;AACf,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,YAAY;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import {HzztTitle} from '@hzzt-plus/components/title'\nimport {HzztDropdown} from '@hzzt-plus/components/dropdown'\nimport {HzztCollapse} from '@hzzt-plus/components/collapse'\nimport {HzztConfigProvider} from '@hzzt-plus/components/config-provider'\nimport {HzztTab} from '@hzzt-plus/components/tab'\n\nimport type {Plugin} from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n] as Plugin[]\n"],"names":[],"mappings":";;;;;;AAKA,iBAAe;AACf,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,OAAO;AACT,CAAC;;;;"}
@@ -2,3 +2,4 @@ export * from './title';
2
2
  export * from './dropdown';
3
3
  export * from './collapse';
4
4
  export * from './config-provider';
5
+ export * from './tab';
@@ -2,6 +2,7 @@ export { HzztTitle } from './title/index.mjs';
2
2
  export { HzztDropdown } from './dropdown/index.mjs';
3
3
  export { HzztCollapse } from './collapse/index.mjs';
4
4
  export { HzztConfigProvider } from './config-provider/index.mjs';
5
+ export { HzztTab } from './tab/index.mjs';
5
6
  export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
6
7
  export { configProviderContextKey } from './config-provider/src/constants.mjs';
7
8
  export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,45 @@
1
+ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
2
+ tabList: {
3
+ type: ArrayConstructor;
4
+ default: () => never[];
5
+ };
6
+ modelValue: {
7
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
8
+ };
9
+ }, {
10
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
11
+ tabList: {
12
+ type: ArrayConstructor;
13
+ default: () => never[];
14
+ };
15
+ modelValue: {
16
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
17
+ };
18
+ }>> & {
19
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
20
+ "onTab-click"?: ((...args: any[]) => any) | undefined;
21
+ }>>;
22
+ emit: (event: "update:modelValue" | "tab-click", ...args: any[]) => void;
23
+ customTabList: import("vue").ComputedRef<{
24
+ number: number;
25
+ hide: boolean;
26
+ name: string;
27
+ label: string;
28
+ key: string;
29
+ }[]>;
30
+ tabClick: (tab: any, event: any) => void;
31
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "tab-click")[], "update:modelValue" | "tab-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
32
+ tabList: {
33
+ type: ArrayConstructor;
34
+ default: () => never[];
35
+ };
36
+ modelValue: {
37
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
38
+ };
39
+ }>> & {
40
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
41
+ "onTab-click"?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ tabList: unknown[];
44
+ }>> & Record<string, any>;
45
+ export default HzztTab;
@@ -0,0 +1,8 @@
1
+ import '../../utils/index.mjs';
2
+ import Tab from './src/index.mjs';
3
+ import { withInstall } from '../../utils/vue/install.mjs';
4
+
5
+ const HzztTab = withInstall(Tab);
6
+
7
+ export { HzztTab, HzztTab as default };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/tab/index.ts"],"sourcesContent":["import { withInstall } from '@hzzt-plus/utils'\n\nimport Tab from './src/index.vue';\n\nexport const HzztTab = withInstall(Tab);\nexport default HzztTab\n"],"names":[],"mappings":";;;;AAEY,MAAC,OAAO,GAAG,WAAW,CAAC,GAAG;;;;"}
@@ -0,0 +1,78 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, unref, normalizeClass, toDisplayString, createCommentVNode, renderSlot } from 'vue';
2
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
3
+
4
+ const _hoisted_1 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
5
+ const _hoisted_2 = { class: "flex align-items-center" };
6
+ const _hoisted_3 = { class: "flex" };
7
+ const _hoisted_4 = ["onClick"];
8
+ const _hoisted_5 = { class: "hzzt-tab-badge" };
9
+ const _hoisted_6 = {
10
+ key: 0,
11
+ class: "hzzt-tab-badge-count"
12
+ };
13
+ const _hoisted_7 = { class: "flex wrap" };
14
+ const __default__ = defineComponent({
15
+ name: "HzztTab"
16
+ });
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ ...__default__,
19
+ props: {
20
+ tabList: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ modelValue: {
25
+ type: [Number, String, Array]
26
+ }
27
+ },
28
+ emits: ["update:modelValue", "tab-click"],
29
+ setup(__props, { emit }) {
30
+ const props = __props;
31
+ const customTabList = computed(() => props.tabList.map((value) => {
32
+ const tab = value;
33
+ return {
34
+ key: tab.name + "-" + tab.number,
35
+ ...tab,
36
+ number: Number(tab.number || 0),
37
+ hide: tab.hide
38
+ };
39
+ }).filter((tab) => !tab.hide));
40
+ function tabClick(tab, event) {
41
+ if (tab.name === props.modelValue)
42
+ return;
43
+ emit("update:modelValue", tab.name);
44
+ emit("tab-click", tab, event);
45
+ }
46
+ return (_ctx, _cache) => {
47
+ return openBlock(), createElementBlock("div", _hoisted_1, [
48
+ createElementVNode("div", _hoisted_2, [
49
+ createElementVNode("div", _hoisted_3, [
50
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab) => {
51
+ return openBlock(), createElementBlock("div", {
52
+ key: tab.key,
53
+ onClick: ($event) => tabClick(tab, $event),
54
+ class: "hzzt-tab-pane"
55
+ }, [
56
+ createElementVNode("div", _hoisted_5, [
57
+ createElementVNode("p", {
58
+ class: normalizeClass([{ active: __props.modelValue === tab.name }, "hzzt-tab-badge-text"])
59
+ }, toDisplayString(tab.label), 3),
60
+ tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true)
61
+ ])
62
+ ], 8, _hoisted_4);
63
+ }), 128))
64
+ ]),
65
+ renderSlot(_ctx.$slots, "filter"),
66
+ renderSlot(_ctx.$slots, "extra")
67
+ ]),
68
+ createElementVNode("div", _hoisted_7, [
69
+ renderSlot(_ctx.$slots, "right")
70
+ ])
71
+ ]);
72
+ };
73
+ }
74
+ });
75
+ var Tab = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "index.vue"]]);
76
+
77
+ export { Tab as default };
78
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/tab/src/index.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-tab flex align-items-center justify-content-between wrap\">\n <div class=\"flex align-items-center\">\n <div class=\"flex\">\n <div :key=\"tab.key\" @click=\"tabClick(tab, $event)\" class=\"hzzt-tab-pane\" v-for=\"tab in customTabList\">\n <div class=\"hzzt-tab-badge\">\n <p :class=\"{ active: modelValue === tab.name }\" class=\"hzzt-tab-badge-text\">{{ tab.label }}</p>\n <p class=\"hzzt-tab-badge-count\" v-if=\"tab.number && tab.number !== 0\">{{\n tab.number > 999 ? '999+' : tab.number\n }}</p>\n </div>\n </div>\n </div>\n <slot name=\"filter\"></slot>\n <slot name=\"extra\" />\n </div>\n <div class=\"flex wrap\">\n <slot name=\"right\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n\n import {computed} from 'vue';\n\n defineOptions({\n name: 'HzztTab'\n })\n\n declare type Tab = {\n name: string,\n label: string,\n number: number,\n hide: boolean\n }\n\n const props = defineProps({\n tabList: {\n type: Array,\n default: () => [],\n },\n modelValue: {\n type: [Number, String, Array],\n },\n })\n\n const emit = defineEmits(['update:modelValue', 'tab-click'])\n\n const customTabList = computed(() => props.tabList.map(value => {\n const tab = value as Tab;\n return {\n key: (tab.name + '-' + tab.number) as string,\n ...tab,\n number: Number(tab.number || 0),\n hide: tab.hide,\n }\n }).filter((tab) => !tab.hide))\n\n function tabClick(tab, event) {\n if (tab.name === props.modelValue) return;\n emit('update:modelValue', tab.name);\n emit('tab-click', tab, event);\n }\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;mCA0BgB,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;AAqBA,IAAA,MAAM,gBAAgB,QAAS,CAAA,MAAM,KAAM,CAAA,OAAA,CAAQ,IAAI,CAAS,KAAA,KAAA;AAC9D,MAAA,MAAM,GAAM,GAAA,KAAA,CAAA;AACZ,MAAO,OAAA;AAAA,QACL,GAAM,EAAA,GAAA,CAAI,IAAO,GAAA,GAAA,GAAM,GAAI,CAAA,MAAA;AAAA,QAC3B,GAAG,GAAA;AAAA,QACH,MAAQ,EAAA,MAAA,CAAO,GAAI,CAAA,MAAA,IAAU,CAAC,CAAA;AAAA,QAC9B,MAAM,GAAI,CAAA,IAAA;AAAA,OACZ,CAAA;AAAA,KACD,EAAE,MAAO,CAAA,CAAC,QAAQ,CAAC,GAAA,CAAI,IAAI,CAAC,CAAA,CAAA;AAE7B,IAAA,SAAA,QAAA,CAAkB,KAAK,KAAO,EAAA;AAC5B,MAAI,IAAA,GAAA,CAAI,SAAS,KAAM,CAAA,UAAA;AAAY,QAAA,OAAA;AACnC,MAAK,IAAA,CAAA,mBAAA,EAAqB,IAAI,IAAI,CAAA,CAAA;AAClC,MAAK,IAAA,CAAA,WAAA,EAAa,KAAK,KAAK,CAAA,CAAA;AAAA,KAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,45 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ tabList: {
3
+ type: ArrayConstructor;
4
+ default: () => never[];
5
+ };
6
+ modelValue: {
7
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
8
+ };
9
+ }, {
10
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
11
+ tabList: {
12
+ type: ArrayConstructor;
13
+ default: () => never[];
14
+ };
15
+ modelValue: {
16
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
17
+ };
18
+ }>> & {
19
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
20
+ "onTab-click"?: ((...args: any[]) => any) | undefined;
21
+ }>>;
22
+ emit: (event: "update:modelValue" | "tab-click", ...args: any[]) => void;
23
+ customTabList: import("vue").ComputedRef<{
24
+ number: number;
25
+ hide: boolean;
26
+ name: string;
27
+ label: string;
28
+ key: string;
29
+ }[]>;
30
+ tabClick: (tab: any, event: any) => void;
31
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "tab-click")[], "update:modelValue" | "tab-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
32
+ tabList: {
33
+ type: ArrayConstructor;
34
+ default: () => never[];
35
+ };
36
+ modelValue: {
37
+ type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
38
+ };
39
+ }>> & {
40
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
41
+ "onTab-click"?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ tabList: unknown[];
44
+ }>;
45
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import 'hzzt-plus/es/components/base/style/css';
2
+ import 'hzzt-plus/theme/hzzt-tab.css';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/css.mjs';
2
+ import 'hzzt-plus/theme/hzzt-tab.css';
3
+ //# sourceMappingURL=css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ import 'hzzt-plus/es/components/base/style';
2
+ import 'hzzt-plus/theme/src/tab.scss';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/index.mjs';
2
+ import 'hzzt-plus/theme/src/tab.scss';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ declare const Download: ObjectDirective;
3
+ export default Download;
@@ -0,0 +1,21 @@
1
+ let handler;
2
+ const Download = {
3
+ mounted(el, binding) {
4
+ const { path, name = "download" } = binding.value || {};
5
+ handler = function(e) {
6
+ e.preventDefault();
7
+ const a = document.createElement("a");
8
+ a.href = path;
9
+ a.download = name;
10
+ a.click();
11
+ a.remove();
12
+ };
13
+ el.addEventListener("click", handler);
14
+ },
15
+ unmounted(el) {
16
+ el.removeEventListener("click", handler);
17
+ }
18
+ };
19
+
20
+ export { Download as default };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/download/index.ts"],"sourcesContent":["import type {\n DirectiveBinding,\n ObjectDirective,\n} from 'vue'\n\nlet handler;\nconst Download: ObjectDirective = {\n // 只调用一次,指令第一次绑定到元素时调用。在这里可以进行一次性的初始化设置。\n mounted(el: HTMLElement, binding: DirectiveBinding) {\n const {path, name = 'download'} = binding.value || {};\n\n handler = function (e) {\n e.preventDefault();\n const a = document.createElement('a');\n a.href = path;\n a.download = name;\n a.click();\n a.remove();\n };\n el.addEventListener('click', handler);\n },\n // 只调用一次,指令与元素解绑时调用。\n unmounted(el: HTMLElement) {\n el.removeEventListener('click', handler);\n },\n};\n\nexport default Download;\n\n"],"names":[],"mappings":"AAAA,IAAI,OAAO,CAAC;AACP,MAAC,QAAQ,GAAG;AACjB,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;AAC5D,IAAI,OAAO,GAAG,SAAS,CAAC,EAAE;AAC1B,MAAM,CAAC,CAAC,cAAc,EAAE,CAAC;AACzB,MAAM,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,MAAM,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;AACxB,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;AAChB,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;AACjB,KAAK,CAAC;AACN,IAAI,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC7C,GAAG;AACH;;;;"}
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ declare const Height: ObjectDirective;
3
+ export default Height;