@opentinyvue/vue-fall-menu 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 - present TinyVue Authors.
4
+ Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2022 - present TinyVue Authors.
3
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license.
6
+ *
7
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10
+ *
11
+ */
12
+ import FallMenu from './src/index';
13
+ export default FallMenu;
package/lib/index.js ADDED
@@ -0,0 +1,44 @@
1
+ function _extends() {
2
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
3
+ for (var e = 1; e < arguments.length; e++) {
4
+ var t = arguments[e];
5
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
6
+ }
7
+ return n;
8
+ }, _extends.apply(null, arguments);
9
+ }
10
+ import { defineComponent, $prefix, $setup, $props } from "@opentinyvue/vue-common";
11
+ import PcTemplate from "./pc.js";
12
+ import "@opentinyvue/vue-theme/fall-menu/index.css";
13
+ var template = function template2(mode) {
14
+ var _process$env;
15
+ typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
16
+ return PcTemplate;
17
+ };
18
+ var fallMenuProps = _extends({}, $props, {
19
+ data: {
20
+ type: Array,
21
+ default: function _default() {
22
+ return [];
23
+ }
24
+ }
25
+ });
26
+ var FallMenu = defineComponent({
27
+ name: $prefix + "FallMenu",
28
+ props: fallMenuProps,
29
+ setup: function setup(props, context) {
30
+ return $setup({
31
+ props,
32
+ context,
33
+ template
34
+ });
35
+ }
36
+ });
37
+ var version = "2.21.0";
38
+ FallMenu.install = function(Vue) {
39
+ Vue.component(FallMenu.name, FallMenu);
40
+ };
41
+ FallMenu.version = version;
42
+ export {
43
+ FallMenu as default
44
+ };
package/lib/pc.js ADDED
@@ -0,0 +1,198 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/fall-menu/vue';
2
+ import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
+ import Row from '@opentinyvue/vue-row';
4
+ import Col from '@opentinyvue/vue-col';
5
+ import { iconChevronLeft, iconChevronRight } from '@opentinyvue/vue-icon';
6
+
7
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
8
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
9
+ if (render) {
10
+ options.render = render;
11
+ options.staticRenderFns = staticRenderFns;
12
+ options._compiled = true;
13
+ }
14
+ var hook;
15
+ if (injectStyles) {
16
+ hook = injectStyles;
17
+ }
18
+ if (hook) {
19
+ if (options.functional) {
20
+ options._injectStyles = hook;
21
+ var originalRender = options.render;
22
+ options.render = function renderWithStyleInjection(h, context) {
23
+ hook.call(context);
24
+ return originalRender(h, context);
25
+ };
26
+ } else {
27
+ var existing = options.beforeCreate;
28
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
29
+ }
30
+ }
31
+ return {
32
+ exports: scriptExports,
33
+ options
34
+ };
35
+ }
36
+
37
+ var __vue2_script = defineComponent({
38
+ props: [].concat(props, ["data"]),
39
+ components: {
40
+ TinyRow: Row,
41
+ TinyCol: Col,
42
+ IconChevronLeft: iconChevronLeft(),
43
+ IconChevronRight: iconChevronRight()
44
+ },
45
+ setup: function setup$1(props2, context) {
46
+ return setup({
47
+ props: props2,
48
+ context,
49
+ renderless,
50
+ api
51
+ });
52
+ }
53
+ });
54
+ var render = function render2() {
55
+ var _vm = this;
56
+ var _h = _vm.$createElement;
57
+ var _c = _vm._self._c || _h;
58
+ return _c("div", {
59
+ staticClass: "tiny-fall-menu"
60
+ }, [_c("div", {
61
+ staticClass: "tiny-fall-menu__wrap"
62
+ }, [_c("div", {
63
+ staticClass: "tiny-fall-menu__nav"
64
+ }, [_c("div", {
65
+ staticClass: "tiny-fall-menu__subnav"
66
+ }, [_c("div", {
67
+ directives: [{
68
+ name: "show",
69
+ rawName: "v-show",
70
+ value: _vm.state.pager !== 1,
71
+ expression: "state.pager !== 1"
72
+ }],
73
+ staticClass: "icon-slot-left",
74
+ on: {
75
+ "click": function click($event) {
76
+ return _vm.arrowClick(-1);
77
+ }
78
+ }
79
+ }, [_vm._t("left", function() {
80
+ return [_c("icon-chevron-left", {
81
+ staticClass: "tiny-svg-size"
82
+ })];
83
+ })], 2), _c("div", {
84
+ ref: "list",
85
+ staticClass: "tiny-fall-menu__list",
86
+ style: {
87
+ left: _vm.state.left
88
+ }
89
+ }, [_c("ul", _vm._l(_vm.state.data, function(level1, index) {
90
+ return _c("li", {
91
+ key: index,
92
+ class: [index >= _vm.state.pagerData.index[_vm.state.pager - 1] && _vm.state.pager !== _vm.state.pagerData.size ? "fall-hide" : ""],
93
+ on: {
94
+ "click": function click($event) {
95
+ return _vm.clickActive(index);
96
+ },
97
+ "mouseover": function mouseover($event) {
98
+ return _vm.mouseover(index);
99
+ },
100
+ "mouseout": _vm.mouseout
101
+ }
102
+ }, [_vm._t("level1", function() {
103
+ return [_c("a", {
104
+ class: [index === _vm.state.active ? "active-show" : "", index === _vm.state.activeNode ? "now" : ""],
105
+ attrs: {
106
+ "href": level1.url
107
+ }
108
+ }, [_vm._v(_vm._s(level1.title) + " ")])];
109
+ }, {
110
+ "slotScope": level1
111
+ })], 2);
112
+ }), 0)]), _c("div", {
113
+ directives: [{
114
+ name: "show",
115
+ rawName: "v-show",
116
+ value: _vm.state.pager !== _vm.state.pagerData.size,
117
+ expression: "state.pager !== state.pagerData.size"
118
+ }],
119
+ staticClass: "icon-slot-right",
120
+ on: {
121
+ "click": function click($event) {
122
+ return _vm.arrowClick(1);
123
+ }
124
+ }
125
+ }, [_vm._t("right", function() {
126
+ return [_c("icon-chevron-right", {
127
+ staticClass: "tiny-svg-size"
128
+ })];
129
+ })], 2)]), _c("tiny-row", [_c("div", {
130
+ directives: [{
131
+ name: "show",
132
+ rawName: "v-show",
133
+ value: _vm.state.isActive,
134
+ expression: "state.isActive"
135
+ }],
136
+ ref: "fall",
137
+ staticClass: "tiny-fall-menu__box",
138
+ class: {
139
+ active: _vm.state.isActive
140
+ },
141
+ on: {
142
+ "mouseover": function mouseover($event) {
143
+ return _vm.overContent(true);
144
+ },
145
+ "mouseout": function mouseout($event) {
146
+ return _vm.overContent(false);
147
+ }
148
+ }
149
+ }, [_c("div", {
150
+ staticClass: "contbox"
151
+ }, _vm._l(_vm.state.level2data, function(level2, index) {
152
+ return _c("tiny-col", {
153
+ key: index,
154
+ staticClass: "cont",
155
+ attrs: {
156
+ "xs": 6,
157
+ "sm": 3,
158
+ "md": 3,
159
+ "lg": 3,
160
+ "xl": 2
161
+ }
162
+ }, [_c("ul", {
163
+ staticClass: "sublist clearfix"
164
+ }, [_c("li", [_c("h3", {
165
+ staticClass: "mcate-item-hd"
166
+ }, [_vm._t("level2", function() {
167
+ return [_c("span", [_vm._v(_vm._s(level2.title))])];
168
+ }, {
169
+ "slotScope": level2
170
+ })], 2), _c("p", {
171
+ staticClass: "mcate-item-bd"
172
+ }, [_vm._t("level3", function() {
173
+ return _vm._l(level2.children, function(level3, index3) {
174
+ return _c("a", {
175
+ key: index3,
176
+ attrs: {
177
+ "href": level3.url
178
+ }
179
+ }, [_vm._v(_vm._s(level3.title))]);
180
+ });
181
+ }, {
182
+ "slotScope": level2.children
183
+ })], 2)])])]);
184
+ }), 1)])])], 1)])]);
185
+ };
186
+ var staticRenderFns = [];
187
+ var __cssModules = {};
188
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
189
+ function __vue2_injectStyles(context) {
190
+ for (var o in __cssModules) {
191
+ this[o] = __cssModules[o];
192
+ }
193
+ }
194
+ var pc = /* @__PURE__ */ function() {
195
+ return __component__.exports;
196
+ }();
197
+
198
+ export { pc as default };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@opentinyvue/vue-fall-menu",
3
+ "version": "2.21.0",
4
+ "description": "",
5
+ "main": "./lib/index.js",
6
+ "module": "./lib/index.js",
7
+ "sideEffects": false,
8
+ "type": "module",
9
+ "dependencies": {
10
+ "@opentinyvue/vue-common": "~2.21.0",
11
+ "@opentinyvue/vue-icon": "~2.21.0",
12
+ "@opentinyvue/vue-renderless": "~3.21.0",
13
+ "@opentinyvue/vue-row": "~2.21.0",
14
+ "@opentinyvue/vue-col": "~2.21.0",
15
+ "@opentinyvue/vue-theme": "~3.21.0"
16
+ },
17
+ "license": "MIT",
18
+ "types": "index.d.ts",
19
+ "scripts": {
20
+ "build": "pnpm -w build:ui $npm_package_name",
21
+ "//postversion": "pnpm build"
22
+ }
23
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ export interface IData {
2
+ children: IData[];
3
+ url: string;
4
+ }
5
+ export declare const fallMenuProps: {
6
+ data: {
7
+ type: {
8
+ (arrayLength: number): IData[];
9
+ (...items: IData[]): IData[];
10
+ new (arrayLength: number): IData[];
11
+ new (...items: IData[]): IData[];
12
+ isArray(arg: any): arg is any[];
13
+ readonly prototype: any[];
14
+ from<T>(arrayLike: ArrayLike<T>): T[];
15
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
16
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
17
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
18
+ of<T_4>(...items: T_4[]): T_4[];
19
+ readonly [Symbol.species]: ArrayConstructor;
20
+ };
21
+ default: () => never[];
22
+ };
23
+ tiny_mode: StringConstructor;
24
+ tiny_mode_root: BooleanConstructor;
25
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
26
+ tiny_renderless: FunctionConstructor;
27
+ tiny_theme: StringConstructor;
28
+ tiny_chart_theme: ObjectConstructor;
29
+ };
30
+ declare const _default: any;
31
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;