@opentinyvue/vue-cascader-panel 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 CascaderPanel from './src/index';
13
+ export default CascaderPanel;
package/lib/index.js ADDED
@@ -0,0 +1,62 @@
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, $props, $setup } from "@opentinyvue/vue-common";
11
+ import PcTemplate from "./pc.js";
12
+ import MobileFirstTemplate from "./mobile-first.js";
13
+ var template = function template2(mode) {
14
+ var _process$env;
15
+ var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
16
+ if ("pc" === (tinyMode || mode)) {
17
+ return PcTemplate;
18
+ }
19
+ if ("mobile-first" === (tinyMode || mode)) {
20
+ return MobileFirstTemplate;
21
+ }
22
+ return PcTemplate;
23
+ };
24
+ var CascaderPanel = defineComponent({
25
+ name: $prefix + "CascaderPanel",
26
+ componentName: "CascaderPanel",
27
+ props: _extends({}, $props, {
28
+ modelValue: {},
29
+ options: Array,
30
+ props: Object,
31
+ border: {
32
+ type: Boolean,
33
+ default: true
34
+ },
35
+ renderLabel: Function,
36
+ // 面板是直接使用,还是在级联组件中被使用, 先仅影响pc模板
37
+ // 私有属性,无需体现在api 文档
38
+ onlyUsePanel: {
39
+ type: Boolean,
40
+ default: true
41
+ }
42
+ }),
43
+ setup: function setup(props, context) {
44
+ return $setup({
45
+ props,
46
+ context,
47
+ template
48
+ });
49
+ }
50
+ });
51
+ var version = "2.21.0";
52
+ CascaderPanel.model = {
53
+ prop: "modelValue",
54
+ event: "update:modelValue"
55
+ };
56
+ CascaderPanel.install = function(Vue) {
57
+ Vue.component(CascaderPanel.name, CascaderPanel);
58
+ };
59
+ CascaderPanel.version = version;
60
+ export {
61
+ CascaderPanel as default
62
+ };
@@ -0,0 +1,111 @@
1
+ import { defineComponent, $prefix, $props, setup } from '@opentinyvue/vue-common';
2
+ import { renderless, api } from '@opentinyvue/vue-renderless/cascader-panel/vue';
3
+ import CascaderMenu from '@opentinyvue/vue-cascader-menu';
4
+
5
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
6
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
7
+ if (render) {
8
+ options.render = render;
9
+ options.staticRenderFns = staticRenderFns;
10
+ options._compiled = true;
11
+ }
12
+ var hook;
13
+ if (injectStyles) {
14
+ hook = injectStyles;
15
+ }
16
+ if (hook) {
17
+ if (options.functional) {
18
+ options._injectStyles = hook;
19
+ var originalRender = options.render;
20
+ options.render = function renderWithStyleInjection(h, context) {
21
+ hook.call(context);
22
+ return originalRender(h, context);
23
+ };
24
+ } else {
25
+ var existing = options.beforeCreate;
26
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
27
+ }
28
+ }
29
+ return {
30
+ exports: scriptExports,
31
+ options
32
+ };
33
+ }
34
+
35
+ function _extends() {
36
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
37
+ for (var e = 1; e < arguments.length; e++) {
38
+ var t = arguments[e];
39
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
40
+ }
41
+ return n;
42
+ }, _extends.apply(null, arguments);
43
+ }
44
+ var render = function render2() {
45
+ var _vm = this;
46
+ var _h = _vm.$createElement;
47
+ var _c = _vm._self._c || _h;
48
+ return _c("div", {
49
+ class: ["flex rounded text-xs", _vm.border ? "border border-solid border-color-border" : ""],
50
+ attrs: {
51
+ "data-tag": "tiny-cascader-panel"
52
+ },
53
+ on: {
54
+ "keydown": _vm.handleKeyDown
55
+ }
56
+ }, _vm._l(_vm.state.menus, function(menu, index) {
57
+ return _c("cascader-menu", {
58
+ key: index,
59
+ attrs: {
60
+ "tiny_mode": "mobile-first",
61
+ "index": index,
62
+ "nodes": menu
63
+ }
64
+ });
65
+ }), 1);
66
+ };
67
+ var staticRenderFns = [];
68
+ var __vue2_script = defineComponent({
69
+ name: $prefix + "CascaderPanel",
70
+ components: {
71
+ CascaderMenu
72
+ },
73
+ inheritAttrs: false,
74
+ emits: ["update:modelValue", "change", "close", "expand-change", "active-item-change"],
75
+ props: _extends({}, $props, {
76
+ modelValue: {},
77
+ options: Array,
78
+ props: Object,
79
+ border: {
80
+ type: Boolean,
81
+ default: true
82
+ },
83
+ renderLabel: Function
84
+ }),
85
+ inject: ["cascaderRoot"],
86
+ provide: function provide() {
87
+ return {
88
+ panel: this
89
+ };
90
+ },
91
+ setup: function setup$1(props, context) {
92
+ return setup({
93
+ props,
94
+ context,
95
+ renderless,
96
+ api
97
+ });
98
+ }
99
+ });
100
+ var __cssModules = {};
101
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
102
+ function __vue2_injectStyles(context) {
103
+ for (var o in __cssModules) {
104
+ this[o] = __cssModules[o];
105
+ }
106
+ }
107
+ var mobileFirst = /* @__PURE__ */ function() {
108
+ return __component__.exports;
109
+ }();
110
+
111
+ export { mobileFirst as default };
package/lib/pc.js ADDED
@@ -0,0 +1,100 @@
1
+ import { defineComponent, $prefix, setup } from '@opentinyvue/vue-common';
2
+ import { renderless, api } from '@opentinyvue/vue-renderless/cascader-panel/vue';
3
+ import CascaderMenu from '@opentinyvue/vue-cascader-menu';
4
+ import '@opentinyvue/vue-theme/cascader-panel/index.css';
5
+
6
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
7
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
8
+ if (render) {
9
+ options.render = render;
10
+ options.staticRenderFns = staticRenderFns;
11
+ options._compiled = true;
12
+ }
13
+ var hook;
14
+ if (injectStyles) {
15
+ hook = injectStyles;
16
+ }
17
+ if (hook) {
18
+ if (options.functional) {
19
+ options._injectStyles = hook;
20
+ var originalRender = options.render;
21
+ options.render = function renderWithStyleInjection(h, context) {
22
+ hook.call(context);
23
+ return originalRender(h, context);
24
+ };
25
+ } else {
26
+ var existing = options.beforeCreate;
27
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
28
+ }
29
+ }
30
+ return {
31
+ exports: scriptExports,
32
+ options
33
+ };
34
+ }
35
+
36
+ var __vue2_script = defineComponent({
37
+ name: $prefix + "CascaderPanel",
38
+ componentName: $prefix + "CascaderPanel",
39
+ components: {
40
+ CascaderMenu
41
+ },
42
+ props: {
43
+ modelValue: {},
44
+ options: Array,
45
+ props: Object,
46
+ border: {
47
+ type: Boolean,
48
+ default: true
49
+ },
50
+ renderLabel: Function,
51
+ onlyUsePanel: Boolean
52
+ },
53
+ provide: function provide() {
54
+ return {
55
+ panel: this
56
+ };
57
+ },
58
+ emits: ["update:modelValue", "change", "close", "expand-change", "active-item-change", "load-data"],
59
+ setup: function setup$1(props, context) {
60
+ return setup({
61
+ props,
62
+ context,
63
+ renderless,
64
+ api
65
+ });
66
+ }
67
+ });
68
+ var render = function render2() {
69
+ var _vm = this;
70
+ var _h = _vm.$createElement;
71
+ var _c = _vm._self._c || _h;
72
+ return _c("div", {
73
+ class: ["tiny-cascader-panel", _vm.border && "is-bordered"],
74
+ on: {
75
+ "keydown": _vm.handleKeyDown
76
+ }
77
+ }, _vm._l(_vm.state.menus, function(menu, index) {
78
+ return _c("cascader-menu", {
79
+ key: index,
80
+ attrs: {
81
+ "index": index,
82
+ "nodes": menu,
83
+ "onlyUsePanel": _vm.onlyUsePanel
84
+ }
85
+ });
86
+ }), 1);
87
+ };
88
+ var staticRenderFns = [];
89
+ var __cssModules = {};
90
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
91
+ function __vue2_injectStyles(context) {
92
+ for (var o in __cssModules) {
93
+ this[o] = __cssModules[o];
94
+ }
95
+ }
96
+ var pc = /* @__PURE__ */ function() {
97
+ return __component__.exports;
98
+ }();
99
+
100
+ export { pc as default };
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@opentinyvue/vue-cascader-panel",
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-renderless": "~3.21.0",
12
+ "@opentinyvue/vue-cascader-menu": "~2.21.0",
13
+ "@opentinyvue/vue-theme": "~3.21.0"
14
+ },
15
+ "license": "MIT",
16
+ "types": "index.d.ts",
17
+ "scripts": {
18
+ "build": "pnpm -w build:ui $npm_package_name",
19
+ "//postversion": "pnpm build"
20
+ }
21
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;