@opentinyvue/vue-grid-select 3.27.0 → 3.29.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/lib/pc.js ADDED
@@ -0,0 +1,230 @@
1
+ import { defineComponent, $prefix, props, setup } from '@opentinyvue/vue-common';
2
+ import { renderless, api } from '@opentinyvue/vue-renderless/grid-select/vue';
3
+ import Grid from '@opentinyvue/vue-grid';
4
+ import BaseSelect from '@opentinyvue/vue-base-select';
5
+ import { resolveComponent, openBlock, createBlock, withCtx, createVNode, mergeProps, withModifiers } from 'vue';
6
+
7
+ function _createForOfIteratorHelperLoose(r, e) {
8
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9
+ if (t) return (t = t.call(r)).next.bind(t);
10
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
11
+ t && (r = t);
12
+ var o = 0;
13
+ return function() {
14
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
15
+ };
16
+ }
17
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _unsupportedIterableToArray(r, a) {
20
+ if (r) {
21
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
+ var t = {}.toString.call(r).slice(8, -1);
23
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
24
+ }
25
+ }
26
+ function _arrayLikeToArray(r, a) {
27
+ (null == a || a > r.length) && (a = r.length);
28
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
29
+ return n;
30
+ }
31
+ var _export_sfc = function _export_sfc2(sfc, props) {
32
+ var target = sfc.__vccOpts || sfc;
33
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
34
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
35
+ target[key] = val;
36
+ }
37
+ return target;
38
+ };
39
+
40
+ function _extends() {
41
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
42
+ for (var e = 1; e < arguments.length; e++) {
43
+ var t = arguments[e];
44
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
45
+ }
46
+ return n;
47
+ }, _extends.apply(null, arguments);
48
+ }
49
+ var _sfc_main = defineComponent({
50
+ name: $prefix + "GridSelect",
51
+ components: {
52
+ TinyGrid: Grid,
53
+ TinyBaseSelect: BaseSelect
54
+ },
55
+ props: _extends({}, props, {
56
+ // 基础 props
57
+ clearable: Boolean,
58
+ disabled: Boolean,
59
+ size: String,
60
+ placeholder: String,
61
+ readonly: Boolean,
62
+ modelValue: {},
63
+ multiple: Boolean,
64
+ // 弹框相关
65
+ popperClass: String,
66
+ popperAppendToBody: {
67
+ type: Boolean,
68
+ default: true
69
+ },
70
+ placement: {
71
+ type: String,
72
+ default: "bottom-start"
73
+ },
74
+ dropStyle: {
75
+ type: Object,
76
+ default: function _default() {
77
+ return {};
78
+ }
79
+ },
80
+ // 标签相关
81
+ collapseTags: Boolean,
82
+ copyable: Boolean,
83
+ textSplit: {
84
+ type: String,
85
+ default: ","
86
+ },
87
+ hoverExpand: Boolean,
88
+ clickExpand: Boolean,
89
+ showTips: {
90
+ type: Boolean,
91
+ default: true
92
+ },
93
+ // 搜索和过滤
94
+ filterable: Boolean,
95
+ filterMethod: Function,
96
+ searchable: Boolean,
97
+ // 远程搜索
98
+ remote: Boolean,
99
+ remoteMethod: Function,
100
+ remoteConfig: {
101
+ type: Object,
102
+ default: function _default2() {
103
+ return {
104
+ showIcon: false,
105
+ clearData: false,
106
+ autoSearch: false
107
+ };
108
+ }
109
+ },
110
+ reserveKeyword: Boolean,
111
+ extraQueryParams: {
112
+ type: [Object, String, Boolean, Array, Number],
113
+ default: ""
114
+ },
115
+ initQuery: Function,
116
+ // 表格配置
117
+ gridOp: {
118
+ type: Object,
119
+ default: function _default3() {
120
+ return {};
121
+ }
122
+ },
123
+ selectConfig: {
124
+ type: Object,
125
+ default: function _default4() {
126
+ return {
127
+ checkMethod: function checkMethod() {
128
+ return true;
129
+ }
130
+ };
131
+ }
132
+ },
133
+ radioConfig: {
134
+ type: Object,
135
+ default: function _default5() {
136
+ return {
137
+ checkMethod: function checkMethod() {
138
+ return true;
139
+ }
140
+ };
141
+ }
142
+ },
143
+ // 字段映射
144
+ textField: {
145
+ type: String,
146
+ default: "label"
147
+ },
148
+ valueField: {
149
+ type: String,
150
+ default: "value"
151
+ },
152
+ // 多选相关
153
+ multipleLimit: {
154
+ type: Number,
155
+ default: 0
156
+ }
157
+ }),
158
+ setup: function setup$1(props2, context) {
159
+ return setup({
160
+ props: props2,
161
+ context,
162
+ renderless,
163
+ api
164
+ });
165
+ }
166
+ });
167
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
168
+ var _component_tiny_grid = resolveComponent("tiny-grid");
169
+ var _component_tiny_base_select = resolveComponent("tiny-base-select");
170
+ return openBlock(), createBlock(_component_tiny_base_select, {
171
+ ref: "baseSelectRef",
172
+ class: "tiny-grid-select",
173
+ modelValue: _ctx.state.modelValue,
174
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
175
+ return _ctx.state.modelValue = $event;
176
+ }),
177
+ clearable: _ctx.clearable,
178
+ multiple: _ctx.multiple,
179
+ filterable: _ctx.filterable,
180
+ "filter-method": _ctx.filter,
181
+ "text-field": _ctx.textField,
182
+ "value-field": _ctx.valueField,
183
+ size: _ctx.size,
184
+ disabled: _ctx.disabled,
185
+ placeholder: _ctx.placeholder,
186
+ readonly: _ctx.readonly,
187
+ "popper-class": _ctx.popperClass,
188
+ "popper-append-to-body": _ctx.popperAppendToBody,
189
+ placement: _ctx.placement,
190
+ "drop-style": _ctx.dropStyle,
191
+ "hover-expand": _ctx.hoverExpand,
192
+ "click-expand": _ctx.clickExpand,
193
+ "collapse-tags": _ctx.collapseTags,
194
+ copyable: _ctx.copyable,
195
+ "text-split": _ctx.textSplit,
196
+ "show-tips": _ctx.showTips,
197
+ searchable: _ctx.searchable,
198
+ "multiple-limit": _ctx.multipleLimit,
199
+ remote: _ctx.remote,
200
+ "remote-method": _ctx.remoteMethod,
201
+ "init-query": _ctx.initQuery,
202
+ "extra-query-params": _ctx.extraQueryParams,
203
+ "remote-config": _ctx.remoteConfig,
204
+ onVisibleChange: _ctx.handleVisibleChange
205
+ }, {
206
+ panel: withCtx(function() {
207
+ var _ctx$gridOp, _ctx$state$gridData;
208
+ return [createVNode(_component_tiny_grid, mergeProps({
209
+ ref: "gridRef",
210
+ "auto-resize": "",
211
+ "row-id": _ctx.valueField,
212
+ "select-config": _ctx.buildSelectConfig(),
213
+ "radio-config": _ctx.buildRadioConfig(),
214
+ "highlight-current-row": true,
215
+ columns: ((_ctx$gridOp = _ctx.gridOp) == null ? void 0 : _ctx$gridOp.columns) || [],
216
+ data: Array.isArray(_ctx.state.gridData) ? _ctx.state.gridData : ((_ctx$state$gridData = _ctx.state.gridData) == null ? void 0 : _ctx$state$gridData.data) || _ctx.state.gridData || [],
217
+ onSelectAll: _ctx.selectChange,
218
+ onSelectChange: _ctx.selectChange,
219
+ onRadioChange: _ctx.radioChange,
220
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(function() {
221
+ }, ["stop"]))
222
+ }, _ctx.gridOp), null, 16, ["row-id", "select-config", "radio-config", "columns", "data", "onSelectAll", "onSelectChange", "onRadioChange"])];
223
+ }),
224
+ _: 1
225
+ /* STABLE */
226
+ }, 8, ["modelValue", "clearable", "multiple", "filterable", "filter-method", "text-field", "value-field", "size", "disabled", "placeholder", "readonly", "popper-class", "popper-append-to-body", "placement", "drop-style", "hover-expand", "click-expand", "collapse-tags", "copyable", "text-split", "show-tips", "searchable", "multiple-limit", "remote", "remote-method", "init-query", "extra-query-params", "remote-config", "onVisibleChange"]);
227
+ }
228
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
229
+
230
+ export { pc as default };
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-grid-select",
3
3
  "type": "module",
4
- "version": "3.27.0",
4
+ "version": "3.29.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
8
8
  "main": "./lib/index.js",
9
9
  "module": "./lib/index.js",
10
10
  "dependencies": {
11
- "@opentinyvue/vue-base-select": "~3.27.0",
12
- "@opentinyvue/vue-common": "~3.27.0",
13
- "@opentinyvue/vue-grid": "~3.27.0",
14
- "@opentinyvue/vue-renderless": "~3.27.0"
11
+ "@opentinyvue/vue-base-select": "~3.29.0",
12
+ "@opentinyvue/vue-common": "~3.29.0",
13
+ "@opentinyvue/vue-grid": "~3.29.0",
14
+ "@opentinyvue/vue-renderless": "~3.29.0"
15
15
  },
16
16
  "types": "index.d.ts",
17
17
  "scripts": {
package/src/index.d.ts ADDED
@@ -0,0 +1,216 @@
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
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
13
+ clearable: BooleanConstructor;
14
+ disabled: BooleanConstructor;
15
+ size: StringConstructor;
16
+ placeholder: StringConstructor;
17
+ readonly: BooleanConstructor;
18
+ modelValue: {};
19
+ multiple: BooleanConstructor;
20
+ popperClass: StringConstructor;
21
+ popperAppendToBody: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ placement: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ dropStyle: {
30
+ type: ObjectConstructor;
31
+ default: () => {};
32
+ };
33
+ collapseTags: BooleanConstructor;
34
+ copyable: BooleanConstructor;
35
+ textSplit: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ hoverExpand: BooleanConstructor;
40
+ clickExpand: BooleanConstructor;
41
+ showTips: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ filterable: BooleanConstructor;
46
+ filterMethod: FunctionConstructor;
47
+ searchable: BooleanConstructor;
48
+ remote: BooleanConstructor;
49
+ remoteMethod: FunctionConstructor;
50
+ remoteConfig: {
51
+ type: ObjectConstructor;
52
+ default(): {
53
+ showIcon: boolean;
54
+ clearData: boolean;
55
+ autoSearch: boolean;
56
+ };
57
+ };
58
+ reserveKeyword: BooleanConstructor;
59
+ extraQueryParams: {
60
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor | ArrayConstructor)[];
61
+ default: string;
62
+ };
63
+ initQuery: FunctionConstructor;
64
+ gridOp: {
65
+ type: ObjectConstructor;
66
+ default: () => {};
67
+ };
68
+ selectConfig: {
69
+ type: ObjectConstructor;
70
+ default(): {
71
+ checkMethod(): true;
72
+ };
73
+ };
74
+ radioConfig: {
75
+ type: ObjectConstructor;
76
+ default(): {
77
+ checkMethod(): true;
78
+ };
79
+ };
80
+ textField: {
81
+ type: StringConstructor;
82
+ default: string;
83
+ };
84
+ valueField: {
85
+ type: StringConstructor;
86
+ default: string;
87
+ };
88
+ multipleLimit: {
89
+ type: NumberConstructor;
90
+ default: number;
91
+ };
92
+ tiny_mode: StringConstructor;
93
+ tiny_mode_root: BooleanConstructor;
94
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
95
+ tiny_renderless: FunctionConstructor;
96
+ tiny_theme: StringConstructor;
97
+ tiny_mcp_config: ObjectConstructor;
98
+ tiny_chart_theme: ObjectConstructor;
99
+ }, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
100
+ [key: string]: any;
101
+ }>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
102
+ clearable: BooleanConstructor;
103
+ disabled: BooleanConstructor;
104
+ size: StringConstructor;
105
+ placeholder: StringConstructor;
106
+ readonly: BooleanConstructor;
107
+ modelValue: {};
108
+ multiple: BooleanConstructor;
109
+ popperClass: StringConstructor;
110
+ popperAppendToBody: {
111
+ type: BooleanConstructor;
112
+ default: boolean;
113
+ };
114
+ placement: {
115
+ type: StringConstructor;
116
+ default: string;
117
+ };
118
+ dropStyle: {
119
+ type: ObjectConstructor;
120
+ default: () => {};
121
+ };
122
+ collapseTags: BooleanConstructor;
123
+ copyable: BooleanConstructor;
124
+ textSplit: {
125
+ type: StringConstructor;
126
+ default: string;
127
+ };
128
+ hoverExpand: BooleanConstructor;
129
+ clickExpand: BooleanConstructor;
130
+ showTips: {
131
+ type: BooleanConstructor;
132
+ default: boolean;
133
+ };
134
+ filterable: BooleanConstructor;
135
+ filterMethod: FunctionConstructor;
136
+ searchable: BooleanConstructor;
137
+ remote: BooleanConstructor;
138
+ remoteMethod: FunctionConstructor;
139
+ remoteConfig: {
140
+ type: ObjectConstructor;
141
+ default(): {
142
+ showIcon: boolean;
143
+ clearData: boolean;
144
+ autoSearch: boolean;
145
+ };
146
+ };
147
+ reserveKeyword: BooleanConstructor;
148
+ extraQueryParams: {
149
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor | ArrayConstructor)[];
150
+ default: string;
151
+ };
152
+ initQuery: FunctionConstructor;
153
+ gridOp: {
154
+ type: ObjectConstructor;
155
+ default: () => {};
156
+ };
157
+ selectConfig: {
158
+ type: ObjectConstructor;
159
+ default(): {
160
+ checkMethod(): true;
161
+ };
162
+ };
163
+ radioConfig: {
164
+ type: ObjectConstructor;
165
+ default(): {
166
+ checkMethod(): true;
167
+ };
168
+ };
169
+ textField: {
170
+ type: StringConstructor;
171
+ default: string;
172
+ };
173
+ valueField: {
174
+ type: StringConstructor;
175
+ default: string;
176
+ };
177
+ multipleLimit: {
178
+ type: NumberConstructor;
179
+ default: number;
180
+ };
181
+ tiny_mode: StringConstructor;
182
+ tiny_mode_root: BooleanConstructor;
183
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
184
+ tiny_renderless: FunctionConstructor;
185
+ tiny_theme: StringConstructor;
186
+ tiny_mcp_config: ObjectConstructor;
187
+ tiny_chart_theme: ObjectConstructor;
188
+ }>>, {
189
+ disabled: boolean;
190
+ placement: string;
191
+ tiny_mode_root: boolean;
192
+ popperAppendToBody: boolean;
193
+ textField: string;
194
+ valueField: string;
195
+ readonly: boolean;
196
+ hoverExpand: boolean;
197
+ clearable: boolean;
198
+ multiple: boolean;
199
+ dropStyle: Record<string, any>;
200
+ showTips: boolean;
201
+ remote: boolean;
202
+ remoteConfig: Record<string, any>;
203
+ filterable: boolean;
204
+ collapseTags: boolean;
205
+ reserveKeyword: boolean;
206
+ multipleLimit: number;
207
+ copyable: boolean;
208
+ gridOp: Record<string, any>;
209
+ selectConfig: Record<string, any>;
210
+ radioConfig: Record<string, any>;
211
+ textSplit: string;
212
+ extraQueryParams: string | number | boolean | Record<string, any> | unknown[];
213
+ searchable: boolean;
214
+ clickExpand: boolean;
215
+ }, {}>;
216
+ export default _default;