hzzt-plus 2.0.6 → 2.0.8

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 (104) hide show
  1. package/dist/index.full.js +74 -67
  2. package/dist/index.full.min.js +10 -10
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +10 -10
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +74 -67
  7. package/dist/locale/en.js +1 -1
  8. package/dist/locale/en.min.js +1 -1
  9. package/dist/locale/en.min.mjs +1 -1
  10. package/dist/locale/en.mjs +1 -1
  11. package/dist/locale/zh-cn.js +1 -1
  12. package/dist/locale/zh-cn.min.js +1 -1
  13. package/dist/locale/zh-cn.min.mjs +1 -1
  14. package/dist/locale/zh-cn.mjs +1 -1
  15. package/es/components/collapse/index.d.ts +6 -0
  16. package/es/components/collapse/index.mjs +2 -2
  17. package/es/components/collapse/src/collapse.mjs +0 -88
  18. package/es/components/collapse/src/collapse.mjs.map +1 -1
  19. package/es/components/collapse/src/collapse.vue.d.ts +6 -0
  20. package/es/components/collapse/src/collapse2.mjs +88 -0
  21. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  22. package/es/components/icon/index.d.ts +438 -3
  23. package/es/components/icon/index.mjs +12 -11
  24. package/es/components/icon/index.mjs.map +1 -1
  25. package/es/components/icon/src/index.mjs +13 -5
  26. package/es/components/icon/src/index.mjs.map +1 -1
  27. package/es/components/icon/src/index.vue.d.ts +6 -0
  28. package/es/components/index.mjs +3 -3
  29. package/es/components/lazy-list/index.mjs +2 -2
  30. package/es/components/lazy-list/src/lazy-list.mjs +80 -22
  31. package/es/components/lazy-list/src/lazy-list.mjs.map +1 -1
  32. package/es/components/lazy-list/src/lazy-list2.mjs +22 -80
  33. package/es/components/lazy-list/src/lazy-list2.mjs.map +1 -1
  34. package/es/components/page-size/index.d.ts +6 -0
  35. package/es/components/page-size/src/index.vue.d.ts +6 -0
  36. package/es/components/pagination/index.d.ts +6 -0
  37. package/es/components/pagination/src/index.vue.d.ts +6 -0
  38. package/es/components/quarter-picker/index.d.ts +6 -0
  39. package/es/components/quarter-picker/src/index.vue.d.ts +6 -0
  40. package/es/components/scroll/src/scroll.vue.d.ts +6 -0
  41. package/es/components/select/src/select.vue.d.ts +6 -0
  42. package/es/components/select-input/index.mjs +2 -2
  43. package/es/components/select-input/src/select-input.mjs +45 -124
  44. package/es/components/select-input/src/select-input.mjs.map +1 -1
  45. package/es/components/select-input/src/select-input2.mjs +124 -45
  46. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  47. package/es/components/select-textarea/src/select-textarea2.mjs +1 -1
  48. package/es/components/tab/index.d.ts +6 -0
  49. package/es/components/tab/src/index.vue.d.ts +6 -0
  50. package/es/components/title/index.mjs +2 -2
  51. package/es/components/title/src/title.mjs +11 -54
  52. package/es/components/title/src/title.mjs.map +1 -1
  53. package/es/components/title/src/title2.mjs +54 -11
  54. package/es/components/title/src/title2.mjs.map +1 -1
  55. package/es/index.mjs +3 -3
  56. package/es/version.d.ts +1 -1
  57. package/es/version.mjs +1 -1
  58. package/es/version.mjs.map +1 -1
  59. package/lib/components/collapse/index.d.ts +6 -0
  60. package/lib/components/collapse/index.js +2 -2
  61. package/lib/components/collapse/src/collapse.js +0 -91
  62. package/lib/components/collapse/src/collapse.js.map +1 -1
  63. package/lib/components/collapse/src/collapse.vue.d.ts +6 -0
  64. package/lib/components/collapse/src/collapse2.js +91 -0
  65. package/lib/components/collapse/src/collapse2.js.map +1 -1
  66. package/lib/components/icon/index.d.ts +438 -3
  67. package/lib/components/icon/index.js +14 -13
  68. package/lib/components/icon/index.js.map +1 -1
  69. package/lib/components/icon/src/index.js +12 -4
  70. package/lib/components/icon/src/index.js.map +1 -1
  71. package/lib/components/icon/src/index.vue.d.ts +6 -0
  72. package/lib/components/index.js +3 -3
  73. package/lib/components/lazy-list/index.js +2 -2
  74. package/lib/components/lazy-list/src/lazy-list.js +80 -23
  75. package/lib/components/lazy-list/src/lazy-list.js.map +1 -1
  76. package/lib/components/lazy-list/src/lazy-list2.js +23 -80
  77. package/lib/components/lazy-list/src/lazy-list2.js.map +1 -1
  78. package/lib/components/page-size/index.d.ts +6 -0
  79. package/lib/components/page-size/src/index.vue.d.ts +6 -0
  80. package/lib/components/pagination/index.d.ts +6 -0
  81. package/lib/components/pagination/src/index.vue.d.ts +6 -0
  82. package/lib/components/quarter-picker/index.d.ts +6 -0
  83. package/lib/components/quarter-picker/src/index.vue.d.ts +6 -0
  84. package/lib/components/scroll/src/scroll.vue.d.ts +6 -0
  85. package/lib/components/select/src/select.vue.d.ts +6 -0
  86. package/lib/components/select-input/index.js +2 -2
  87. package/lib/components/select-input/src/select-input.js +46 -124
  88. package/lib/components/select-input/src/select-input.js.map +1 -1
  89. package/lib/components/select-input/src/select-input2.js +124 -46
  90. package/lib/components/select-input/src/select-input2.js.map +1 -1
  91. package/lib/components/select-textarea/src/select-textarea2.js +1 -1
  92. package/lib/components/tab/index.d.ts +6 -0
  93. package/lib/components/tab/src/index.vue.d.ts +6 -0
  94. package/lib/components/title/index.js +2 -2
  95. package/lib/components/title/src/title.js +11 -54
  96. package/lib/components/title/src/title.js.map +1 -1
  97. package/lib/components/title/src/title2.js +54 -11
  98. package/lib/components/title/src/title2.js.map +1 -1
  99. package/lib/index.js +3 -3
  100. package/lib/version.d.ts +1 -1
  101. package/lib/version.js +1 -1
  102. package/lib/version.js.map +1 -1
  103. package/package.json +1 -1
  104. package/web-types.json +1 -1
@@ -1,16 +1,59 @@
1
- import '../../../utils/index.mjs';
1
+ import { defineComponent, computed, useSlots, unref, openBlock, createElementBlock, createElementVNode, createCommentVNode, renderSlot, normalizeClass, createTextVNode, toDisplayString } from 'vue';
2
+ import { titleProps } from './title.mjs';
2
3
  import '../../../hooks/index.mjs';
3
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
4
- import { useSizeProp } from '../../../hooks/use-size/index.mjs';
4
+ import { useFormSize } from 'element-plus';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
7
+ import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
5
8
 
6
- const titleProps = buildProps({
7
- label: String,
8
- sideline: {
9
- type: Boolean,
10
- default: true
11
- },
12
- size: useSizeProp
9
+ const _hoisted_1 = {
10
+ key: 0,
11
+ class: "hzzt-title flex align-items-center justify-content-between"
12
+ };
13
+ const _hoisted_2 = { class: "flex align-items-center" };
14
+ const _hoisted_3 = {
15
+ key: 0,
16
+ class: "hzzt-title__line"
17
+ };
18
+ const __default__ = defineComponent({
19
+ name: "HzztTitle"
13
20
  });
21
+ const _sfc_main = /* @__PURE__ */ defineComponent({
22
+ ...__default__,
23
+ props: titleProps,
24
+ setup(__props) {
25
+ const props = __props;
26
+ const formSize = useFormSize();
27
+ const ns = useNamespace("title");
28
+ const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
29
+ const nameKls = computed(() => {
30
+ return [ns.e("name"), ns.em("name", trueSize.value)];
31
+ });
32
+ const slots = useSlots();
33
+ const showLabel = computed(() => {
34
+ var _a, _b, _c;
35
+ 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);
36
+ });
37
+ return (_ctx, _cache) => {
38
+ return unref(showLabel) ? (openBlock(), createElementBlock("div", _hoisted_1, [
39
+ createElementVNode("div", _hoisted_2, [
40
+ _ctx.sideline ? (openBlock(), createElementBlock("span", _hoisted_3)) : createCommentVNode("v-if", true),
41
+ renderSlot(_ctx.$slots, "before"),
42
+ createElementVNode("label", {
43
+ class: normalizeClass(unref(nameKls))
44
+ }, [
45
+ renderSlot(_ctx.$slots, "default", {}, () => [
46
+ createTextVNode(toDisplayString(_ctx.label), 1)
47
+ ])
48
+ ], 2),
49
+ renderSlot(_ctx.$slots, "after")
50
+ ]),
51
+ renderSlot(_ctx.$slots, "right")
52
+ ])) : createCommentVNode("v-if", true);
53
+ };
54
+ }
55
+ });
56
+ var HzztTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "title.vue"]]);
14
57
 
15
- export { titleProps };
58
+ export { HzztTitle as default };
16
59
  //# sourceMappingURL=title2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.ts"],"sourcesContent":["import { buildProps } from '@hzzt-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Title from './title.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nexport const titleProps = buildProps({\n label: String,\n sideline: {\n type: Boolean,\n default: true,\n },\n size: useSizeProp,\n} as const)\nexport type TitleProps = ExtractPropTypes<typeof titleProps>\n\nexport type TitleInstance = InstanceType<typeof Title>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC;;;;"}
1
+ {"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.vue"],"sourcesContent":["<template>\n <div v-if=\"showLabel\" class=\"hzzt-title flex align-items-center justify-content-between\">\n <div class=\"flex align-items-center\">\n <span v-if=\"sideline\" class=\"hzzt-title__line\" />\n <slot name=\"before\" />\n <label :class=\"nameKls\">\n <slot>{{ label }}</slot>\n </label>\n <slot name=\"after\" />\n </div>\n\n <slot name=\"right\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { titleProps } from './title'\nimport {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\nimport { useFormSize } from 'element-plus'\n\ndefineOptions({\n name: 'HzztTitle',\n})\n\nconst props = defineProps(titleProps)\n\nconst formSize = useFormSize()\n\nconst ns = useNamespace('title')\n\nconst trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n)\n\nconst nameKls = computed(() => {\n return [ns.e('name'), ns.em('name', trueSize.value)]\n})\n\nconst slots = useSlots()\n\nconst showLabel = computed(\n () => props.label || slots?.default?.()?.[0]?.children\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;mCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAE7B,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,QAAW,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAA,aAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,aACH,GAAA,QAAiB,CAAA,MAAA;AAAyB,MACxD,OAAA,CAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAEA,KAAM,CAAA,CAAA;AACJ,IAAO,MAAA,KAAI,GAAA,QAAQ,EAAG;AAA6B,IACrD,MAAC,SAAA,GAAA,QAAA,CAAA,MAAA;AAED,MAAA,IAAM,QAAQ,EAAS,CAAA;AAEvB,MAAA,OAAkB,KAAA,CAAA,KAAA,KAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;AAAA,KAAA,CAChB;AAA8C,IAChD,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;"}
package/es/index.mjs CHANGED
@@ -5,7 +5,7 @@ import './constants/index.mjs';
5
5
  import './directives/index.mjs';
6
6
  import './hooks/index.mjs';
7
7
  export { makeInstaller } from './make-installer.mjs';
8
- export { titleProps } from './components/title/src/title2.mjs';
8
+ export { titleProps } from './components/title/src/title.mjs';
9
9
  export { HzztTitle } from './components/title/index.mjs';
10
10
  export { HzztDropdown } from './components/dropdown/index.mjs';
11
11
  export { HzztCollapse } from './components/collapse/index.mjs';
@@ -23,7 +23,7 @@ export { HzztCheckButton } from './components/check-button/index.mjs';
23
23
  export { HzztQuarterPicker } from './components/quarter-picker/index.mjs';
24
24
  export { scanEmits, scanProps } from './components/scan/src/scan.mjs';
25
25
  export { HzztScan } from './components/scan/index.mjs';
26
- export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input2.mjs';
26
+ export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input.mjs';
27
27
  export { HzztSelectInput } from './components/select-input/index.mjs';
28
28
  export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea.mjs';
29
29
  export { HzztSelectTextarea } from './components/select-textarea/index.mjs';
@@ -36,7 +36,7 @@ export { HzztSelect } from './components/select/index.mjs';
36
36
  export { clickInputEmits, clickInputProps } from './components/click-input/src/click-input.mjs';
37
37
  export { HzztClickInput } from './components/click-input/index.mjs';
38
38
  export { HzztScroll } from './components/scroll/index.mjs';
39
- export { lazyListEmits, lazyListProps } from './components/lazy-list/src/lazy-list.mjs';
39
+ export { lazyListEmits, lazyListProps } from './components/lazy-list/src/lazy-list2.mjs';
40
40
  export { HzztLazyList } from './components/lazy-list/index.mjs';
41
41
  export { INSTALLED_KEY } from './constants/key.mjs';
42
42
  export { componentSizeMap, componentSizes } from './constants/size.mjs';
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.0.6";
1
+ export declare const version = "2.0.8";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "2.0.6";
1
+ const version = "2.0.8";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '2.0.6'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '2.0.8'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
@@ -49,6 +49,8 @@ export declare const HzztCollapse: import("hzzt-plus/es/utils").SFCWithInstall<i
49
49
  type: StringConstructor;
50
50
  default: string;
51
51
  };
52
+ size: (NumberConstructor | StringConstructor)[];
53
+ color: StringConstructor;
52
54
  }, {
53
55
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
54
56
  name: {
@@ -59,6 +61,8 @@ export declare const HzztCollapse: import("hzzt-plus/es/utils").SFCWithInstall<i
59
61
  type: StringConstructor;
60
62
  default: string;
61
63
  };
64
+ size: (NumberConstructor | StringConstructor)[];
65
+ color: StringConstructor;
62
66
  }>> & {
63
67
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
64
68
  }>>;
@@ -174,6 +178,8 @@ export declare const HzztCollapse: import("hzzt-plus/es/utils").SFCWithInstall<i
174
178
  type: StringConstructor;
175
179
  default: string;
176
180
  };
181
+ size: (NumberConstructor | StringConstructor)[];
182
+ color: StringConstructor;
177
183
  }>>, {
178
184
  type: string;
179
185
  }>;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var collapse = require('./src/collapse.js');
7
- require('./src/collapse2.js');
6
+ var collapse = require('./src/collapse2.js');
7
+ require('./src/collapse.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const HzztCollapse = install.withInstall(collapse["default"]);
@@ -1,94 +1,3 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
- require('../../../hooks/index.js');
7
- var index$1 = require('../../icon/src/index.js');
8
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
9
- var index = require('../../../hooks/use-locale/index.js');
10
-
11
- const _hoisted_1 = { class: "hzzt-collapse flex column" };
12
- const _hoisted_2 = { class: "hzzt-collapse__top" };
13
- const _hoisted_3 = { class: "hzzt-collapse__title" };
14
- const _hoisted_4 = {
15
- key: 0,
16
- class: "hzzt-collapse__line"
17
- };
18
- const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
19
- const __default__ = vue.defineComponent({
20
- name: "HzztCollapse"
21
- });
22
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
23
- ...__default__,
24
- props: {
25
- defaultActive: {
26
- type: Boolean,
27
- default: true
28
- },
29
- title: {
30
- type: String,
31
- default: ""
32
- },
33
- showLine: {
34
- type: Boolean,
35
- default: true
36
- },
37
- modelValue: {
38
- type: Boolean,
39
- default: true
40
- }
41
- },
42
- emits: ["update:modelValue"],
43
- setup(__props, { emit }) {
44
- const props = __props;
45
- const { t } = index.useLocale();
46
- const expand = vue.ref(props.modelValue);
47
- if (!props.defaultActive) {
48
- emit("update:modelValue", false);
49
- expand.value = false;
50
- }
51
- vue.watch(() => props.modelValue, (v) => {
52
- expand.value = v;
53
- });
54
- function toggle() {
55
- expand.value = !expand.value;
56
- emit("update:modelValue", expand.value);
57
- }
58
- return (_ctx, _cache) => {
59
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
60
- vue.createElementVNode("div", _hoisted_2, [
61
- vue.createElementVNode("div", _hoisted_3, [
62
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
63
- vue.createTextVNode(vue.toDisplayString(__props.title), 1)
64
- ])
65
- ]),
66
- __props.showLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true),
67
- vue.renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
68
- vue.createElementVNode("div", {
69
- class: "hzzt-collapse__btn",
70
- onClick: toggle
71
- }, [
72
- vue.createVNode(index$1["default"], {
73
- name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
74
- class: "hzzt-collapse__icon",
75
- size: "14"
76
- }, null, 8, ["name"]),
77
- vue.createElementVNode("span", null, vue.toDisplayString(expand.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)
78
- ])
79
- ])
80
- ]),
81
- vue.withDirectives(vue.createElementVNode("div", _hoisted_5, [
82
- vue.renderSlot(_ctx.$slots, "default")
83
- ], 512), [
84
- [vue.vShow, expand.value]
85
- ]),
86
- vue.renderSlot(_ctx.$slots, "active", { active: expand.value })
87
- ]);
88
- };
89
- }
90
- });
91
- var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
92
-
93
- exports["default"] = Collapse;
94
3
  //# sourceMappingURL=collapse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse flex column\">\n <div class=\"hzzt-collapse__top\">\n <div class=\"hzzt-collapse__title\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div v-if=\"showLine\" class=\"hzzt-collapse__line\" />\n <slot name=\"toggle-btn\">\n <div class=\"hzzt-collapse__btn\" @click=\"toggle\">\n <hzzt-icon :name=\"!expand ? 'hzzt-plus-square-outline' : 'hzzt-minus-square-outline'\"\n class=\"hzzt-collapse__icon\" size=\"14\" />\n <span>{{ expand ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand') }}</span>\n </div>\n </slot>\n </div>\n <div v-show=\"expand\" class=\"hzzt-collapse__content flex-1\">\n <slot />\n </div>\n\n <slot :active=\"expand\" name=\"active\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import {useLocale} from '@hzzt-plus/hooks'\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {ref, watch} from 'vue'\n\n defineOptions({\n name: 'HzztCollapse',\n })\n const {t} = useLocale()\n const props = defineProps({\n defaultActive: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n showLine: {\n type: Boolean,\n default: true,\n },\n modelValue: {\n type: Boolean,\n default: true,\n },\n })\n const emit = defineEmits(['update:modelValue'])\n\n const expand = ref(props.modelValue)\n\n if (!props.defaultActive) {\n emit('update:modelValue', false);\n expand.value = false;\n }\n\n watch(() => props.modelValue, (v) => {\n expand.value = v;\n })\n\n function toggle() {\n expand.value = !expand.value;\n emit('update:modelValue', expand.value);\n }\n\n</script>\n"],"names":["useLocale","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;uCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAIA,eAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAASC,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAEnC,IAAI,IAAA,CAAC,MAAM,aAAe,EAAA;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAAC,SAAA,CAAM,MAAM,KAAA,CAAM,UAAY,EAAA,CAAC,CAAM,KAAA;AACnC,MAAA,MAAA,CAAO,KAAQ,GAAA,CAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAS,MAAS,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AACvB,MAAK,IAAA,CAAA,mBAAA,EAAqB,OAAO,KAAK,CAAA,CAAA;AAAA,KACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"collapse.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -49,6 +49,8 @@ declare const _default: import("vue").DefineComponent<{
49
49
  type: StringConstructor;
50
50
  default: string;
51
51
  };
52
+ size: (NumberConstructor | StringConstructor)[];
53
+ color: StringConstructor;
52
54
  }, {
53
55
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
54
56
  name: {
@@ -59,6 +61,8 @@ declare const _default: import("vue").DefineComponent<{
59
61
  type: StringConstructor;
60
62
  default: string;
61
63
  };
64
+ size: (NumberConstructor | StringConstructor)[];
65
+ color: StringConstructor;
62
66
  }>> & {
63
67
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
64
68
  }>>;
@@ -174,6 +178,8 @@ declare const _default: import("vue").DefineComponent<{
174
178
  type: StringConstructor;
175
179
  default: string;
176
180
  };
181
+ size: (NumberConstructor | StringConstructor)[];
182
+ color: StringConstructor;
177
183
  }>>, {
178
184
  type: string;
179
185
  }>;
@@ -1,3 +1,94 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ require('../../../hooks/index.js');
7
+ var index$1 = require('../../icon/src/index.js');
8
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
9
+ var index = require('../../../hooks/use-locale/index.js');
10
+
11
+ const _hoisted_1 = { class: "hzzt-collapse flex column" };
12
+ const _hoisted_2 = { class: "hzzt-collapse__top" };
13
+ const _hoisted_3 = { class: "hzzt-collapse__title" };
14
+ const _hoisted_4 = {
15
+ key: 0,
16
+ class: "hzzt-collapse__line"
17
+ };
18
+ const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
19
+ const __default__ = vue.defineComponent({
20
+ name: "HzztCollapse"
21
+ });
22
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
23
+ ...__default__,
24
+ props: {
25
+ defaultActive: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ title: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ showLine: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ modelValue: {
38
+ type: Boolean,
39
+ default: true
40
+ }
41
+ },
42
+ emits: ["update:modelValue"],
43
+ setup(__props, { emit }) {
44
+ const props = __props;
45
+ const { t } = index.useLocale();
46
+ const expand = vue.ref(props.modelValue);
47
+ if (!props.defaultActive) {
48
+ emit("update:modelValue", false);
49
+ expand.value = false;
50
+ }
51
+ vue.watch(() => props.modelValue, (v) => {
52
+ expand.value = v;
53
+ });
54
+ function toggle() {
55
+ expand.value = !expand.value;
56
+ emit("update:modelValue", expand.value);
57
+ }
58
+ return (_ctx, _cache) => {
59
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
60
+ vue.createElementVNode("div", _hoisted_2, [
61
+ vue.createElementVNode("div", _hoisted_3, [
62
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
63
+ vue.createTextVNode(vue.toDisplayString(__props.title), 1)
64
+ ])
65
+ ]),
66
+ __props.showLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true),
67
+ vue.renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
68
+ vue.createElementVNode("div", {
69
+ class: "hzzt-collapse__btn",
70
+ onClick: toggle
71
+ }, [
72
+ vue.createVNode(index$1["default"], {
73
+ name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
74
+ class: "hzzt-collapse__icon",
75
+ size: "14"
76
+ }, null, 8, ["name"]),
77
+ vue.createElementVNode("span", null, vue.toDisplayString(expand.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)
78
+ ])
79
+ ])
80
+ ]),
81
+ vue.withDirectives(vue.createElementVNode("div", _hoisted_5, [
82
+ vue.renderSlot(_ctx.$slots, "default")
83
+ ], 512), [
84
+ [vue.vShow, expand.value]
85
+ ]),
86
+ vue.renderSlot(_ctx.$slots, "active", { active: expand.value })
87
+ ]);
88
+ };
89
+ }
90
+ });
91
+ var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
92
+
93
+ exports["default"] = Collapse;
3
94
  //# sourceMappingURL=collapse2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"collapse2.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse flex column\">\n <div class=\"hzzt-collapse__top\">\n <div class=\"hzzt-collapse__title\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div v-if=\"showLine\" class=\"hzzt-collapse__line\" />\n <slot name=\"toggle-btn\">\n <div class=\"hzzt-collapse__btn\" @click=\"toggle\">\n <hzzt-icon :name=\"!expand ? 'hzzt-plus-square-outline' : 'hzzt-minus-square-outline'\"\n class=\"hzzt-collapse__icon\" size=\"14\" />\n <span>{{ expand ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand') }}</span>\n </div>\n </slot>\n </div>\n <div v-show=\"expand\" class=\"hzzt-collapse__content flex-1\">\n <slot />\n </div>\n\n <slot :active=\"expand\" name=\"active\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import {useLocale} from '@hzzt-plus/hooks'\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {ref, watch} from 'vue'\n\n defineOptions({\n name: 'HzztCollapse',\n })\n const {t} = useLocale()\n const props = defineProps({\n defaultActive: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n showLine: {\n type: Boolean,\n default: true,\n },\n modelValue: {\n type: Boolean,\n default: true,\n },\n })\n const emit = defineEmits(['update:modelValue'])\n\n const expand = ref(props.modelValue)\n\n if (!props.defaultActive) {\n emit('update:modelValue', false);\n expand.value = false;\n }\n\n watch(() => props.modelValue, (v) => {\n expand.value = v;\n })\n\n function toggle() {\n expand.value = !expand.value;\n emit('update:modelValue', expand.value);\n }\n\n</script>\n"],"names":["useLocale","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;uCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAIA,eAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAASC,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAEnC,IAAI,IAAA,CAAC,MAAM,aAAe,EAAA;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAAC,SAAA,CAAM,MAAM,KAAA,CAAM,UAAY,EAAA,CAAC,CAAM,KAAA;AACnC,MAAA,MAAA,CAAO,KAAQ,GAAA,CAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAS,MAAS,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AACvB,MAAK,IAAA,CAAA,mBAAA,EAAqB,OAAO,KAAK,CAAA,CAAA;AAAA,KACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}