hzzt-plus 0.0.3 → 0.0.4

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 (69) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +426 -295
  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 +13 -13
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +427 -297
  8. package/es/components/collapse/index.mjs +2 -2
  9. package/es/components/collapse/src/collapse.mjs +67 -0
  10. package/es/components/collapse/src/collapse.mjs.map +1 -1
  11. package/es/components/collapse/src/collapse2.mjs +0 -67
  12. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  13. package/es/components/confirm-password/index.d.ts +352 -283
  14. package/es/components/confirm-password/src/confirm-password.mjs.map +1 -1
  15. package/es/components/confirm-password/src/confirm-password.vue.d.ts +352 -283
  16. package/es/components/dropdown/src/index.mjs.map +1 -1
  17. package/es/components/icon/src/index.mjs.map +1 -1
  18. package/es/components/icon/src/index.vue.d.ts +75 -39
  19. package/es/components/page-size/index.d.ts +2201 -12995
  20. package/es/components/page-size/src/index.mjs.map +1 -1
  21. package/es/components/page-size/src/index.vue.d.ts +2201 -12995
  22. package/es/components/pagination/index.d.ts +75 -39
  23. package/es/components/pagination/src/index.mjs.map +1 -1
  24. package/es/components/pagination/src/index.vue.d.ts +75 -39
  25. package/es/components/tab/src/index.mjs.map +1 -1
  26. package/es/components/title/src/title.mjs.map +1 -1
  27. package/es/components/tooltip/index.d.ts +606 -2136
  28. package/es/components/tooltip/src/tooltip.vue.d.ts +606 -2136
  29. package/es/directives/drag/index.d.ts +3 -0
  30. package/es/directives/drag/index.mjs +81 -0
  31. package/es/directives/drag/index.mjs.map +1 -0
  32. package/es/directives/index.d.ts +1 -0
  33. package/es/directives/index.mjs +1 -0
  34. package/es/directives/index.mjs.map +1 -1
  35. package/es/index.mjs +1 -0
  36. package/es/index.mjs.map +1 -1
  37. package/lib/components/collapse/index.js +2 -2
  38. package/lib/components/collapse/src/collapse.js +70 -0
  39. package/lib/components/collapse/src/collapse.js.map +1 -1
  40. package/lib/components/collapse/src/collapse2.js +0 -70
  41. package/lib/components/collapse/src/collapse2.js.map +1 -1
  42. package/lib/components/confirm-password/index.d.ts +352 -283
  43. package/lib/components/confirm-password/src/confirm-password.js.map +1 -1
  44. package/lib/components/confirm-password/src/confirm-password.vue.d.ts +352 -283
  45. package/lib/components/dropdown/src/index.js.map +1 -1
  46. package/lib/components/icon/src/index.js.map +1 -1
  47. package/lib/components/icon/src/index.vue.d.ts +75 -39
  48. package/lib/components/page-size/index.d.ts +2201 -12995
  49. package/lib/components/page-size/src/index.js.map +1 -1
  50. package/lib/components/page-size/src/index.vue.d.ts +2201 -12995
  51. package/lib/components/pagination/index.d.ts +75 -39
  52. package/lib/components/pagination/src/index.js.map +1 -1
  53. package/lib/components/pagination/src/index.vue.d.ts +75 -39
  54. package/lib/components/tab/src/index.js.map +1 -1
  55. package/lib/components/title/src/title.js.map +1 -1
  56. package/lib/components/tooltip/index.d.ts +606 -2136
  57. package/lib/components/tooltip/src/tooltip.vue.d.ts +606 -2136
  58. package/lib/directives/drag/index.d.ts +3 -0
  59. package/lib/directives/drag/index.js +85 -0
  60. package/lib/directives/drag/index.js.map +1 -0
  61. package/lib/directives/index.d.ts +1 -0
  62. package/lib/directives/index.js +2 -0
  63. package/lib/directives/index.js.map +1 -1
  64. package/lib/index.js +18 -16
  65. package/lib/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/theme/base.css +1 -1
  68. package/theme/index.css +1 -1
  69. package/theme/src/common/display.scss +1 -1
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from 'vue';
2
+ declare const Drag: ObjectDirective;
3
+ export default Drag;
@@ -0,0 +1,81 @@
1
+ const Drag = {
2
+ mounted(el, binding) {
3
+ let callback = binding.value;
4
+ if (!callback) {
5
+ callback = () => ({});
6
+ }
7
+ initMouseEvent(el, callback);
8
+ },
9
+ updated(el, binding) {
10
+ let callback = binding.value;
11
+ if (!callback) {
12
+ callback = () => ({});
13
+ }
14
+ initMouseEvent(el, callback);
15
+ },
16
+ unmounted(el) {
17
+ el.onmousedown = null;
18
+ el.onmousemove = null;
19
+ el.onmouseup = null;
20
+ }
21
+ };
22
+ function initMouseEvent(el, callback) {
23
+ let startPoint = null;
24
+ let endPoint = null;
25
+ let roiDiv = null;
26
+ const onMousedown = (e) => {
27
+ if (e.ctrlKey) {
28
+ startPoint = { x: e.x, y: e.y };
29
+ document.onselectstart = () => false;
30
+ document.ondragstart = () => false;
31
+ } else {
32
+ removeRoi();
33
+ startPoint = null;
34
+ endPoint = null;
35
+ }
36
+ };
37
+ const onMousemove = (e) => {
38
+ if (e.ctrlKey && startPoint) {
39
+ endPoint = { x: e.x, y: e.y };
40
+ removeRoi();
41
+ createRoi();
42
+ } else {
43
+ removeRoi();
44
+ startPoint = null;
45
+ endPoint = null;
46
+ document.onselectstart = null;
47
+ document.ondragstart = null;
48
+ }
49
+ };
50
+ const onMouseup = () => {
51
+ if (roiDiv) {
52
+ callback(roiDiv.getBoundingClientRect());
53
+ }
54
+ document.onselectstart = null;
55
+ document.ondragstart = null;
56
+ removeRoi();
57
+ startPoint = null;
58
+ endPoint = null;
59
+ };
60
+ function removeRoi() {
61
+ if (roiDiv && document.body.contains(roiDiv)) {
62
+ document.body.removeChild(roiDiv);
63
+ }
64
+ roiDiv = null;
65
+ }
66
+ function createRoi() {
67
+ roiDiv = document.createElement("div");
68
+ const distX = endPoint.x - startPoint.x;
69
+ const distY = endPoint.y - startPoint.y;
70
+ const left = startPoint.x < endPoint.x ? startPoint.x : endPoint.x;
71
+ const top = startPoint.y < endPoint.y ? startPoint.y : endPoint.y;
72
+ roiDiv.style.cssText = `position: fixed;z-index: 9999;width: ${Math.abs(distX)}px;height: ${Math.abs(distY)}px;border: 1px solid #0655c3;left: ${left}px;top: ${top}px;pointer-events: none;`;
73
+ document.body.appendChild(roiDiv);
74
+ }
75
+ el.onmousedown = onMousedown;
76
+ el.onmousemove = onMousemove;
77
+ el.onmouseup = onMouseup;
78
+ }
79
+
80
+ export { Drag as default };
81
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/drag/index.ts"],"sourcesContent":["import type { DirectiveBinding, ObjectDirective } from 'vue'\n\ntype Point = {\n x: number\n y: number\n}\n\ntype CallbackHandler = (rect?: DOMRect) => void\n\nconst Drag: ObjectDirective = {\n // 当被绑定的元素插入到 DOM 中时……\n mounted(el: HTMLElement, binding: DirectiveBinding) {\n let callback = binding.value\n if (!callback) {\n callback = () => ({})\n }\n\n initMouseEvent(el, callback)\n },\n updated(el: HTMLElement, binding: DirectiveBinding) {\n let callback = binding.value\n if (!callback) {\n callback = () => ({})\n }\n initMouseEvent(el, callback)\n },\n // 只调用一次,指令与元素解绑时调用。\n unmounted(el: HTMLElement) {\n el.onmousedown = null\n el.onmousemove = null\n el.onmouseup = null\n },\n}\n\nfunction initMouseEvent(el: HTMLElement, callback: CallbackHandler) {\n let startPoint: Point | null = null\n let endPoint: Point | null = null\n let roiDiv: HTMLDivElement | null = null\n\n const onMousedown = (e: MouseEvent) => {\n if (e.ctrlKey) {\n startPoint = { x: e.x, y: e.y }\n document.onselectstart = () => false\n document.ondragstart = () => false\n } else {\n removeRoi()\n startPoint = null\n endPoint = null\n }\n }\n\n const onMousemove = (e: MouseEvent) => {\n if (e.ctrlKey && startPoint) {\n endPoint = { x: e.x, y: e.y }\n removeRoi()\n createRoi()\n } else {\n removeRoi()\n startPoint = null\n endPoint = null\n document.onselectstart = null\n document.ondragstart = null\n }\n }\n const onMouseup = () => {\n if (roiDiv) {\n callback(roiDiv.getBoundingClientRect())\n }\n document.onselectstart = null\n document.ondragstart = null\n removeRoi()\n startPoint = null\n endPoint = null\n }\n\n function removeRoi() {\n if (roiDiv && document.body.contains(roiDiv)) {\n document.body.removeChild(roiDiv)\n }\n roiDiv = null\n }\n\n function createRoi() {\n roiDiv = document.createElement('div')\n const distX = endPoint!.x - startPoint!.x\n const distY = endPoint!.y - startPoint!.y\n const left = startPoint!.x < endPoint!.x ? startPoint!.x : endPoint!.x\n const top = startPoint!.y < endPoint!.y ? startPoint!.y : endPoint!.y\n roiDiv.style.cssText = `position: fixed;z-index: 9999;width: ${Math.abs(\n distX\n )}px;height: ${Math.abs(\n distY\n )}px;border: 1px solid #0655c3;left: ${left}px;top: ${top}px;pointer-events: none;`\n document.body.appendChild(roiDiv)\n }\n\n el.onmousedown = onMousedown\n el.onmousemove = onMousemove\n el.onmouseup = onMouseup\n}\n\nexport default Drag\n"],"names":[],"mappings":"AAAK,MAAC,IAAI,GAAG;AACb,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,IAAI,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;AACjC,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AACjC,GAAG;AACH,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,IAAI,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;AACjC,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AACjC,GAAG;AACH,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAC1B,IAAI,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAC1B,IAAI,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC;AACxB,GAAG;AACH,EAAE;AACF,SAAS,cAAc,CAAC,EA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,CAAC,wBAAwB,CAAC,CAAC;AAClM,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,EAAE,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,EAAE,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AAC3B;;;;"}
@@ -2,3 +2,4 @@ export { default as Download } from './download';
2
2
  export { default as Height } from './height';
3
3
  export { default as Blur } from './blur';
4
4
  export { default as Highlight } from './highlight';
5
+ export { default as Drag } from './drag';
@@ -2,4 +2,5 @@ export { default as Download } from './download/index.mjs';
2
2
  export { default as Height } from './height/index.mjs';
3
3
  export { default as Blur } from './blur/index.mjs';
4
4
  export { default as Highlight } from './highlight/index.mjs';
5
+ export { default as Drag } from './drag/index.mjs';
5
6
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/es/index.mjs CHANGED
@@ -25,6 +25,7 @@ export { default as Download } from './directives/download/index.mjs';
25
25
  export { default as Height } from './directives/height/index.mjs';
26
26
  export { default as Blur } from './directives/blur/index.mjs';
27
27
  export { default as Highlight } from './directives/highlight/index.mjs';
28
+ export { default as Drag } from './directives/drag/index.mjs';
28
29
  export { buildLocaleContext, buildTranslator, localeContextKey, translate, useLocale } from './hooks/use-locale/index.mjs';
29
30
  export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './hooks/use-size/index.mjs';
30
31
  export { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from './hooks/use-namespace/index.mjs';
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
@@ -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/collapse2.js');
7
- require('./src/collapse.js');
6
+ var collapse = require('./src/collapse.js');
7
+ require('./src/collapse2.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const HzztCollapse = install.withInstall(collapse["default"]);
@@ -1,3 +1,73 @@
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 pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
8
+ var index = require('../../../hooks/use-locale/index.js');
9
+
10
+ const _hoisted_1 = { class: "hzzt-collapse" };
11
+ const _hoisted_2 = { class: "flex align-items-center" };
12
+ const _hoisted_3 = { class: "hzzt-collapse-title-wrapper" };
13
+ const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
14
+ const _hoisted_5 = { class: "hzzt-collapse-title" };
15
+ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
16
+ const _hoisted_7 = {
17
+ key: 0,
18
+ class: "hzzt-collapse-text"
19
+ };
20
+ const __default__ = vue.defineComponent({
21
+ name: "HzztCollapse"
22
+ });
23
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
24
+ ...__default__,
25
+ props: {
26
+ defaultActive: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ title: {
31
+ type: String,
32
+ default: ""
33
+ },
34
+ expand: {
35
+ type: Boolean,
36
+ default: true
37
+ }
38
+ },
39
+ setup(__props) {
40
+ const props = __props;
41
+ const { t } = index.useLocale();
42
+ const active = vue.ref(props.defaultActive);
43
+ vue.watch(() => props.defaultActive, (val) => {
44
+ active.value = val;
45
+ });
46
+ function toggle() {
47
+ active.value = !active.value;
48
+ }
49
+ return (_ctx, _cache) => {
50
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
51
+ vue.createElementVNode("div", {
52
+ class: "hzzt-collapse-header",
53
+ onClick: toggle
54
+ }, [
55
+ vue.createElementVNode("div", _hoisted_2, [
56
+ vue.createElementVNode("div", _hoisted_3, [
57
+ _hoisted_4,
58
+ vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(__props.title), 1)
59
+ ]),
60
+ _hoisted_6
61
+ ]),
62
+ __props.expand ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7, vue.toDisplayString(active.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)) : vue.createCommentVNode("v-if", true)
63
+ ]),
64
+ vue.renderSlot(_ctx.$slots, "active", { active: active.value }),
65
+ vue.renderSlot(_ctx.$slots, "default")
66
+ ]);
67
+ };
68
+ }
69
+ });
70
+ var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
71
+
72
+ exports["default"] = Collapse;
3
73
  //# sourceMappingURL=collapse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"collapse.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse\">\n <div class=\"hzzt-collapse-header\" @click=\"toggle\">\n <div class=\"flex align-items-center\">\n <div class=\"hzzt-collapse-title-wrapper\">\n <div class=\"hzzt-collapse-title-block\" />\n <div class=\"hzzt-collapse-title\">{{ title }}</div>\n </div>\n <div class=\"hzzt-collapse-line\" />\n </div>\n <span v-if=\"expand\" class=\"hzzt-collapse-text\">{{\n active ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand')\n }}</span>\n </div>\n <slot name=\"active\" :active=\"active\" />\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue'\nimport { useLocale } from '@hzzt-plus/hooks'\n\ndefineOptions({\n name: 'HzztCollapse',\n})\nconst { t } = useLocale()\nconst props = defineProps({\n defaultActive: {\n type: Boolean,\n default: false,\n },\n title: {\n type: String,\n default: '',\n },\n expand: {\n type: Boolean,\n default: true,\n },\n})\n\nconst active = ref(props.defaultActive)\n\nwatch(\n () => props.defaultActive,\n (val: boolean) => {\n active.value = val\n }\n)\n\nfunction toggle() {\n active.value = !active.value\n}\n</script>\n"],"names":["_createElementVNode","_toDisplayString","_openBlock","_createElementBlock","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,KAAA;AACA,IAAA,KAAS,EAAiB;;;AAEZ,KACN;AACR,IAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;;;AACA,UAAM,OAAI,EAAc,MAAA;AAgBxB,SAAM,EAAA;AAEN,UAAAA,sBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,YACQA,sBAAM,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,cACM,UAAA;AAChB,cAAAA,sBAAe,CAAA,KAAA,EAAA,UAAA,EAAAC,mBAAA,CAAA,OAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;AAAA,aACjB,CAAA;AAAA,YACF,UAAA;AAEA,WAAA,CAAA;AACE,UAAO,OAAA,CAAA,MAAgB,IAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,MAAA,EAAA,UAAA,EAAAF,mBAAA,CAAA,MAAA,CAAA,KAAA,GAAAG,SAAA,CAAA,CAAA,CAAA,CAAA,uBAAA,CAAA,GAAAA,SAAA,CAAA,CAAA,CAAA,CAAA,sBAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAAC,sBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,SACzB,CAAA;;;;;;;;;;;"}
@@ -1,73 +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 pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
8
- var index = require('../../../hooks/use-locale/index.js');
9
-
10
- const _hoisted_1 = { class: "hzzt-collapse" };
11
- const _hoisted_2 = { class: "flex align-items-center" };
12
- const _hoisted_3 = { class: "hzzt-collapse-title-wrapper" };
13
- const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
14
- const _hoisted_5 = { class: "hzzt-collapse-title" };
15
- const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
16
- const _hoisted_7 = {
17
- key: 0,
18
- class: "hzzt-collapse-text"
19
- };
20
- const __default__ = vue.defineComponent({
21
- name: "HzztCollapse"
22
- });
23
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
24
- ...__default__,
25
- props: {
26
- defaultActive: {
27
- type: Boolean,
28
- default: false
29
- },
30
- title: {
31
- type: String,
32
- default: ""
33
- },
34
- expand: {
35
- type: Boolean,
36
- default: true
37
- }
38
- },
39
- setup(__props) {
40
- const props = __props;
41
- const { t } = index.useLocale();
42
- const active = vue.ref(props.defaultActive);
43
- vue.watch(() => props.defaultActive, (val) => {
44
- active.value = val;
45
- });
46
- function toggle() {
47
- active.value = !active.value;
48
- }
49
- return (_ctx, _cache) => {
50
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
51
- vue.createElementVNode("div", {
52
- class: "hzzt-collapse-header",
53
- onClick: toggle
54
- }, [
55
- vue.createElementVNode("div", _hoisted_2, [
56
- vue.createElementVNode("div", _hoisted_3, [
57
- _hoisted_4,
58
- vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(__props.title), 1)
59
- ]),
60
- _hoisted_6
61
- ]),
62
- __props.expand ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7, vue.toDisplayString(active.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)) : vue.createCommentVNode("v-if", true)
63
- ]),
64
- vue.renderSlot(_ctx.$slots, "active", { active: active.value }),
65
- vue.renderSlot(_ctx.$slots, "default")
66
- ]);
67
- };
68
- }
69
- });
70
- var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
71
-
72
- exports["default"] = Collapse;
73
3
  //# sourceMappingURL=collapse2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse2.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse\">\n <div class=\"hzzt-collapse-header\" @click=\"toggle\">\n <div class=\"flex align-items-center\">\n <div class=\"hzzt-collapse-title-wrapper\">\n <div class=\"hzzt-collapse-title-block\" />\n <div class=\"hzzt-collapse-title\">{{ title }}</div>\n </div>\n <div class=\"hzzt-collapse-line\" />\n </div>\n <span v-if=\"expand\" class=\"hzzt-collapse-text\">{{\n active ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand')\n }}</span>\n </div>\n <slot name=\"active\" :active=\"active\" />\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue'\nimport { useLocale } from '@hzzt-plus/hooks'\n\ndefineOptions({\n name: 'HzztCollapse',\n})\nconst { t } = useLocale()\nconst props = defineProps({\n defaultActive: {\n type: Boolean,\n default: false,\n },\n title: {\n type: String,\n default: '',\n },\n expand: {\n type: Boolean,\n default: true,\n },\n})\n\nconst active = ref(props.defaultActive)\n\nwatch(\n () => props.defaultActive,\n (val: boolean) => {\n active.value = val\n }\n)\n\nfunction toggle() {\n active.value = !active.value\n}\n</script>\n"],"names":["useLocale","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;;uCAuBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AAgBxB,IAAM,MAAA,MAAA,GAASC,OAAI,CAAA,KAAA,CAAM,aAAa,CAAA,CAAA;AAEtC,IAAAC,SAAA,CACE,MAAM,KAAA,CAAM,aACZ,EAAA,CAAC,GAAiB,KAAA;AAChB,MAAA,MAAA,CAAO,KAAQ,GAAA,GAAA,CAAA;AAAA,KAEnB,CAAA,CAAA;AAEA,IAAkB,SAAA,MAAA,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"collapse2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}