hzzt-plus 0.0.1-dev → 0.0.1-dev-01

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.
@@ -7016,7 +7016,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7016
7016
  },
7017
7017
  emits: ["change"],
7018
7018
  setup(__props, { emit: emits }) {
7019
- const props = __props;
7019
+ const dProps = __props;
7020
7020
  const toggle = ref(false);
7021
7021
  function dropToggle() {
7022
7022
  toggle.value = !toggle.value;
@@ -7025,10 +7025,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7025
7025
  toggle.value = false;
7026
7026
  }
7027
7027
  function selectValue(val) {
7028
- if (props.returnType === "Array") {
7028
+ if (dProps.returnType === "Array") {
7029
7029
  emits("change", val);
7030
7030
  }
7031
- if (props.returnType === "String") {
7031
+ if (dProps.returnType === "String") {
7032
7032
  emits("change", val.last);
7033
7033
  }
7034
7034
  }
@@ -7045,31 +7045,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7045
7045
  createElementVNode("ul", _hoisted_4, [
7046
7046
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
7047
7047
  return openBlock(), createElementBlock(Fragment, null, [
7048
- option[props.children] && option[props.children].length ? (openBlock(), createElementBlock("li", {
7049
- class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[props.value]) }),
7048
+ option[__props.props.children] && option[__props.props.children].length ? (openBlock(), createElementBlock("li", {
7049
+ class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[__props.props.value]) }),
7050
7050
  key: index
7051
7051
  }, [
7052
7052
  createElementVNode("a", {
7053
- onClick: ($event) => selectValue([option[props.value]]),
7053
+ onClick: ($event) => selectValue([option[__props.props.value]]),
7054
7054
  class: "hzzt-dropdown-menu-item-label"
7055
- }, toDisplayString(option[props.label]), 9, _hoisted_5)
7055
+ }, toDisplayString(option[__props.props.label]), 9, _hoisted_5)
7056
7056
  ], 2)) : (openBlock(), createElementBlock("li", {
7057
7057
  key: index + "submenu",
7058
7058
  class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
7059
7059
  }, [
7060
- createElementVNode("a", _hoisted_6, toDisplayString(option[props.label]), 1),
7060
+ createElementVNode("a", _hoisted_6, toDisplayString(option[__props.props.label]), 1),
7061
7061
  createElementVNode("ul", {
7062
7062
  class: normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
7063
7063
  }, [
7064
7064
  (openBlock(true), createElementBlock(Fragment, null, renderList(option.children, (child, cIndex) => {
7065
7065
  return openBlock(), createElementBlock("li", {
7066
- class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[props.value]) }),
7066
+ class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[__props.props.value]) }),
7067
7067
  key: cIndex
7068
7068
  }, [
7069
7069
  createElementVNode("a", {
7070
- onClick: ($event) => selectValue([option[props.value], child[props.value]]),
7070
+ onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]]),
7071
7071
  class: "hzzt-dropdown-menu-item-label"
7072
- }, toDisplayString(child[props.label]), 9, _hoisted_7)
7072
+ }, toDisplayString(child[__props.props.label]), 9, _hoisted_7)
7073
7073
  ], 2);
7074
7074
  }), 128))
7075
7075
  ], 2)
@@ -26,7 +26,7 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
26
26
  default: string;
27
27
  };
28
28
  }, {
29
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
29
+ dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
30
30
  options: {
31
31
  type: ArrayConstructor;
32
32
  default: () => never[];
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
26
26
  default: string;
27
27
  };
28
28
  }, {
29
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
29
+ dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
30
30
  options: {
31
31
  type: ArrayConstructor;
32
32
  default: () => never[];
@@ -45,7 +45,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  },
46
46
  emits: ["change"],
47
47
  setup(__props, { emit: emits }) {
48
- const props = __props;
48
+ const dProps = __props;
49
49
  const toggle = ref(false);
50
50
  function dropToggle() {
51
51
  toggle.value = !toggle.value;
@@ -54,10 +54,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
54
54
  toggle.value = false;
55
55
  }
56
56
  function selectValue(val) {
57
- if (props.returnType === "Array") {
57
+ if (dProps.returnType === "Array") {
58
58
  emits("change", val);
59
59
  }
60
- if (props.returnType === "String") {
60
+ if (dProps.returnType === "String") {
61
61
  emits("change", val.last);
62
62
  }
63
63
  }
@@ -74,31 +74,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
74
  createElementVNode("ul", _hoisted_4, [
75
75
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
76
76
  return openBlock(), createElementBlock(Fragment, null, [
77
- option[props.children] && option[props.children].length ? (openBlock(), createElementBlock("li", {
78
- class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[props.value]) }),
77
+ option[__props.props.children] && option[__props.props.children].length ? (openBlock(), createElementBlock("li", {
78
+ class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[__props.props.value]) }),
79
79
  key: index
80
80
  }, [
81
81
  createElementVNode("a", {
82
- onClick: ($event) => selectValue([option[props.value]]),
82
+ onClick: ($event) => selectValue([option[__props.props.value]]),
83
83
  class: "hzzt-dropdown-menu-item-label"
84
- }, toDisplayString(option[props.label]), 9, _hoisted_5)
84
+ }, toDisplayString(option[__props.props.label]), 9, _hoisted_5)
85
85
  ], 2)) : (openBlock(), createElementBlock("li", {
86
86
  key: index + "submenu",
87
87
  class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
88
88
  }, [
89
- createElementVNode("a", _hoisted_6, toDisplayString(option[props.label]), 1),
89
+ createElementVNode("a", _hoisted_6, toDisplayString(option[__props.props.label]), 1),
90
90
  createElementVNode("ul", {
91
91
  class: normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
92
92
  }, [
93
93
  (openBlock(true), createElementBlock(Fragment, null, renderList(option.children, (child, cIndex) => {
94
94
  return openBlock(), createElementBlock("li", {
95
- class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[props.value]) }),
95
+ class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[__props.props.value]) }),
96
96
  key: cIndex
97
97
  }, [
98
98
  createElementVNode("a", {
99
- onClick: ($event) => selectValue([option[props.value], child[props.value]]),
99
+ onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]]),
100
100
  class: "hzzt-dropdown-menu-item-label"
101
- }, toDisplayString(child[props.label]), 9, _hoisted_7)
101
+ }, toDisplayString(child[__props.props.label]), 9, _hoisted_7)
102
102
  ], 2);
103
103
  }), 128))
104
104
  ], 2)
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"option[props.children]&&option[props.children].length\" :key=\"index\">\n <a @click=\"selectValue([option[props.value]])\" class=\"hzzt-dropdown-menu-item-label\">{{ option[props.label] }}</a>\n </li>\n <li :key=\"index+'submenu'\" class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\" v-else>\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-'+position]\" class=\"hzzt-dropdown-menu\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(child[props.value]) }\"\n :key=\"cIndex\" v-for=\"(child, cIndex) in option.children\">\n <a @click=\"selectValue([option[props.value], child[props.value]])\"\n class=\"hzzt-dropdown-menu-item-label\">{{ child[props.label] }}</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\" v-if=\"option.divider\" :key=\"index+'divider'\"></li>\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue';\n import {ClickOutside as vClickOutside} from 'element-plus';\n\n const props = defineProps({\n options: {\n type: Array,\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n });\n\n const emits = defineEmits(['change']);\n\n defineOptions({\n name: 'HzztDropDown',\n });\n\n const toggle = ref(false);\n\n function dropToggle() {\n toggle.value = !toggle.value;\n }\n\n function close() {\n toggle.value = false;\n }\n\n function selectValue(val) {\n if (props.returnType === 'Array') {\n emits('change', val);\n }\n if (props.returnType === 'String') {\n emits('change', val.last);\n }\n }\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCAgEgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,MAAA,GAAS,IAAI,KAAK,CAAA,CAAA;AAExB,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,SAAA,WAAA,CAAqB,GAAK,EAAA;AACxB,MAAI,IAAA,KAAA,CAAM,eAAe,OAAS,EAAA;AAChC,QAAA,KAAA,CAAM,UAAU,GAAG,CAAA,CAAA;AAAA,OACrB;AACA,MAAI,IAAA,KAAA,CAAM,eAAe,QAAU,EAAA;AACjC,QAAM,KAAA,CAAA,QAAA,EAAU,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"option[props.children]&&option[props.children].length\" :key=\"index\">\n <a @click=\"selectValue([option[props.value]])\" class=\"hzzt-dropdown-menu-item-label\">{{ option[props.label] }}</a>\n </li>\n <li :key=\"index+'submenu'\" class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\" v-else>\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-'+position]\" class=\"hzzt-dropdown-menu\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(child[props.value]) }\"\n :key=\"cIndex\" v-for=\"(child, cIndex) in option.children\">\n <a @click=\"selectValue([option[props.value], child[props.value]])\"\n class=\"hzzt-dropdown-menu-item-label\">{{ child[props.label] }}</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\" v-if=\"option.divider\" :key=\"index+'divider'\"></li>\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue';\n import {ClickOutside as vClickOutside} from 'element-plus';\n\n const dProps = defineProps({\n options: {\n type: Array,\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n });\n\n const emits = defineEmits(['change']);\n\n defineOptions({\n name: 'HzztDropDown',\n });\n\n const toggle = ref(false);\n\n function dropToggle() {\n toggle.value = !toggle.value;\n }\n\n function close() {\n toggle.value = false;\n }\n\n function selectValue(val) {\n if (dProps.returnType === 'Array') {\n emits('change', val);\n }\n if (dProps.returnType === 'String') {\n emits('change', val.last);\n }\n }\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCAgEgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,MAAA,GAAS,IAAI,KAAK,CAAA,CAAA;AAExB,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,SAAA,WAAA,CAAqB,GAAK,EAAA;AACxB,MAAI,IAAA,MAAA,CAAO,eAAe,OAAS,EAAA;AACjC,QAAA,KAAA,CAAM,UAAU,GAAG,CAAA,CAAA;AAAA,OACrB;AACA,MAAI,IAAA,MAAA,CAAO,eAAe,QAAU,EAAA;AAClC,QAAM,KAAA,CAAA,QAAA,EAAU,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -26,7 +26,7 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
26
26
  default: string;
27
27
  };
28
28
  }, {
29
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
29
+ dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
30
30
  options: {
31
31
  type: ArrayConstructor;
32
32
  default: () => never[];
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
26
26
  default: string;
27
27
  };
28
28
  }, {
29
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
29
+ dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
30
30
  options: {
31
31
  type: ArrayConstructor;
32
32
  default: () => never[];
@@ -49,7 +49,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
49
49
  },
50
50
  emits: ["change"],
51
51
  setup(__props, { emit: emits }) {
52
- const props = __props;
52
+ const dProps = __props;
53
53
  const toggle = vue.ref(false);
54
54
  function dropToggle() {
55
55
  toggle.value = !toggle.value;
@@ -58,10 +58,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
58
58
  toggle.value = false;
59
59
  }
60
60
  function selectValue(val) {
61
- if (props.returnType === "Array") {
61
+ if (dProps.returnType === "Array") {
62
62
  emits("change", val);
63
63
  }
64
- if (props.returnType === "String") {
64
+ if (dProps.returnType === "String") {
65
65
  emits("change", val.last);
66
66
  }
67
67
  }
@@ -78,31 +78,31 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
78
78
  vue.createElementVNode("ul", _hoisted_4, [
79
79
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (option, index) => {
80
80
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
81
- option[props.children] && option[props.children].length ? (vue.openBlock(), vue.createElementBlock("li", {
82
- class: vue.normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[props.value]) }),
81
+ option[__props.props.children] && option[__props.props.children].length ? (vue.openBlock(), vue.createElementBlock("li", {
82
+ class: vue.normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[__props.props.value]) }),
83
83
  key: index
84
84
  }, [
85
85
  vue.createElementVNode("a", {
86
- onClick: ($event) => selectValue([option[props.value]]),
86
+ onClick: ($event) => selectValue([option[__props.props.value]]),
87
87
  class: "hzzt-dropdown-menu-item-label"
88
- }, vue.toDisplayString(option[props.label]), 9, _hoisted_5)
88
+ }, vue.toDisplayString(option[__props.props.label]), 9, _hoisted_5)
89
89
  ], 2)) : (vue.openBlock(), vue.createElementBlock("li", {
90
90
  key: index + "submenu",
91
91
  class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
92
92
  }, [
93
- vue.createElementVNode("a", _hoisted_6, vue.toDisplayString(option[props.label]), 1),
93
+ vue.createElementVNode("a", _hoisted_6, vue.toDisplayString(option[__props.props.label]), 1),
94
94
  vue.createElementVNode("ul", {
95
95
  class: vue.normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
96
96
  }, [
97
97
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(option.children, (child, cIndex) => {
98
98
  return vue.openBlock(), vue.createElementBlock("li", {
99
- class: vue.normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[props.value]) }),
99
+ class: vue.normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(child[__props.props.value]) }),
100
100
  key: cIndex
101
101
  }, [
102
102
  vue.createElementVNode("a", {
103
- onClick: ($event) => selectValue([option[props.value], child[props.value]]),
103
+ onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]]),
104
104
  class: "hzzt-dropdown-menu-item-label"
105
- }, vue.toDisplayString(child[props.label]), 9, _hoisted_7)
105
+ }, vue.toDisplayString(child[__props.props.label]), 9, _hoisted_7)
106
106
  ], 2);
107
107
  }), 128))
108
108
  ], 2)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"option[props.children]&&option[props.children].length\" :key=\"index\">\n <a @click=\"selectValue([option[props.value]])\" class=\"hzzt-dropdown-menu-item-label\">{{ option[props.label] }}</a>\n </li>\n <li :key=\"index+'submenu'\" class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\" v-else>\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-'+position]\" class=\"hzzt-dropdown-menu\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(child[props.value]) }\"\n :key=\"cIndex\" v-for=\"(child, cIndex) in option.children\">\n <a @click=\"selectValue([option[props.value], child[props.value]])\"\n class=\"hzzt-dropdown-menu-item-label\">{{ child[props.label] }}</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\" v-if=\"option.divider\" :key=\"index+'divider'\"></li>\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue';\n import {ClickOutside as vClickOutside} from 'element-plus';\n\n const props = defineProps({\n options: {\n type: Array,\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n });\n\n const emits = defineEmits(['change']);\n\n defineOptions({\n name: 'HzztDropDown',\n });\n\n const toggle = ref(false);\n\n function dropToggle() {\n toggle.value = !toggle.value;\n }\n\n function close() {\n toggle.value = false;\n }\n\n function selectValue(val) {\n if (props.returnType === 'Array') {\n emits('change', val);\n }\n if (props.returnType === 'String') {\n emits('change', val.last);\n }\n }\n\n</script>\n"],"names":["ref"],"mappings":";;;;;;;;;;;;;;;;uCAgEgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,MAAA,GAASA,QAAI,KAAK,CAAA,CAAA;AAExB,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,SAAA,WAAA,CAAqB,GAAK,EAAA;AACxB,MAAI,IAAA,KAAA,CAAM,eAAe,OAAS,EAAA;AAChC,QAAA,KAAA,CAAM,UAAU,GAAG,CAAA,CAAA;AAAA,OACrB;AACA,MAAI,IAAA,KAAA,CAAM,eAAe,QAAU,EAAA;AACjC,QAAM,KAAA,CAAA,QAAA,EAAU,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"option[props.children]&&option[props.children].length\" :key=\"index\">\n <a @click=\"selectValue([option[props.value]])\" class=\"hzzt-dropdown-menu-item-label\">{{ option[props.label] }}</a>\n </li>\n <li :key=\"index+'submenu'\" class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\" v-else>\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-'+position]\" class=\"hzzt-dropdown-menu\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(child[props.value]) }\"\n :key=\"cIndex\" v-for=\"(child, cIndex) in option.children\">\n <a @click=\"selectValue([option[props.value], child[props.value]])\"\n class=\"hzzt-dropdown-menu-item-label\">{{ child[props.label] }}</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\" v-if=\"option.divider\" :key=\"index+'divider'\"></li>\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue';\n import {ClickOutside as vClickOutside} from 'element-plus';\n\n const dProps = defineProps({\n options: {\n type: Array,\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n });\n\n const emits = defineEmits(['change']);\n\n defineOptions({\n name: 'HzztDropDown',\n });\n\n const toggle = ref(false);\n\n function dropToggle() {\n toggle.value = !toggle.value;\n }\n\n function close() {\n toggle.value = false;\n }\n\n function selectValue(val) {\n if (dProps.returnType === 'Array') {\n emits('change', val);\n }\n if (dProps.returnType === 'String') {\n emits('change', val.last);\n }\n }\n\n</script>\n"],"names":["ref"],"mappings":";;;;;;;;;;;;;;;;uCAgEgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,MAAA,GAASA,QAAI,KAAK,CAAA,CAAA;AAExB,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,SAAA,WAAA,CAAqB,GAAK,EAAA;AACxB,MAAI,IAAA,MAAA,CAAO,eAAe,OAAS,EAAA;AACjC,QAAA,KAAA,CAAM,UAAU,GAAG,CAAA,CAAA;AAAA,OACrB;AACA,MAAI,IAAA,MAAA,CAAO,eAAe,QAAU,EAAA;AAClC,QAAM,KAAA,CAAA,QAAA,EAAU,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hzzt-plus",
3
- "version": "0.0.1-dev",
3
+ "version": "0.0.1-dev-01",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "keywords": [
6
6
  "hzzt-plus",