@opentinyvue/vue-dialog-select 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,2 @@
1
+ import DialogSelect from './src/index';
2
+ export default DialogSelect;
package/lib/index.js ADDED
@@ -0,0 +1,124 @@
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
+ var template = function template2() {
13
+ return PCTemplate;
14
+ };
15
+ var $constants = {
16
+ INPUT_HEIGHT: "32px",
17
+ INPUT_MARGIN_BOTTOM: "8px"
18
+ };
19
+ var DialogSelect = defineComponent({
20
+ name: $prefix + "DialogSelect",
21
+ props: _extends({}, $props, {
22
+ _constants: {
23
+ type: Object,
24
+ default: function _default() {
25
+ return $constants;
26
+ }
27
+ },
28
+ dialogOp: {
29
+ type: Object,
30
+ default: function _default2() {
31
+ return {};
32
+ }
33
+ },
34
+ visible: Boolean,
35
+ popseletor: {
36
+ type: String,
37
+ default: "grid",
38
+ validator: function validator(value) {
39
+ return ~["grid", "tree"].indexOf(value);
40
+ }
41
+ },
42
+ multi: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ gridOp: {
47
+ type: Object,
48
+ default: function _default3() {
49
+ return {
50
+ columns: [],
51
+ data: []
52
+ };
53
+ }
54
+ },
55
+ textField: {
56
+ type: String,
57
+ default: "label"
58
+ },
59
+ textSplit: {
60
+ type: String,
61
+ default: "/"
62
+ },
63
+ valueField: {
64
+ type: String,
65
+ default: "id"
66
+ },
67
+ valueSplit: {
68
+ type: String,
69
+ default: ";"
70
+ },
71
+ remoteSearch: Function,
72
+ showPager: {
73
+ type: Boolean,
74
+ default: true
75
+ },
76
+ pagerOp: {
77
+ type: Object,
78
+ default: function _default4() {
79
+ return {};
80
+ }
81
+ },
82
+ showSelectedBox: {
83
+ type: Boolean,
84
+ default: true
85
+ },
86
+ selectedBoxOp: {
87
+ type: Object,
88
+ default: function _default5() {
89
+ return {};
90
+ }
91
+ },
92
+ treeOp: {
93
+ type: Object,
94
+ default: function _default6() {
95
+ return {};
96
+ }
97
+ },
98
+ beforeClose: Function,
99
+ autoLookup: {
100
+ type: Boolean,
101
+ default: true
102
+ },
103
+ lookupMethod: Function,
104
+ mainHeight: {
105
+ type: Number,
106
+ default: 290
107
+ }
108
+ }),
109
+ setup: function setup(props, context) {
110
+ return $setup({
111
+ props,
112
+ context,
113
+ template
114
+ });
115
+ }
116
+ });
117
+ var version = "2.21.0";
118
+ DialogSelect.install = function(Vue) {
119
+ Vue.component(DialogSelect.name, DialogSelect);
120
+ };
121
+ DialogSelect.version = version;
122
+ export {
123
+ DialogSelect as default
124
+ };
package/lib/pc.js ADDED
@@ -0,0 +1,353 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/dialog-select/vue';
2
+ import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
+ import DialogBox from '@opentinyvue/vue-dialog-box';
4
+ import Button from '@opentinyvue/vue-button';
5
+ import Pager from '@opentinyvue/vue-pager';
6
+ import Grid from '@opentinyvue/vue-grid';
7
+ import Split from '@opentinyvue/vue-split';
8
+ import SelectedBox from '@opentinyvue/vue-selected-box';
9
+ import Input from '@opentinyvue/vue-input';
10
+ import Tree from '@opentinyvue/vue-tree';
11
+ import { iconSearch } from '@opentinyvue/vue-icon';
12
+ import '@opentinyvue/vue-theme/dialog-select/index.css';
13
+
14
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
15
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
16
+ if (render) {
17
+ options.render = render;
18
+ options.staticRenderFns = staticRenderFns;
19
+ options._compiled = true;
20
+ }
21
+ var hook;
22
+ if (injectStyles) {
23
+ hook = injectStyles;
24
+ }
25
+ if (hook) {
26
+ if (options.functional) {
27
+ options._injectStyles = hook;
28
+ var originalRender = options.render;
29
+ options.render = function renderWithStyleInjection(h, context) {
30
+ hook.call(context);
31
+ return originalRender(h, context);
32
+ };
33
+ } else {
34
+ var existing = options.beforeCreate;
35
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
36
+ }
37
+ }
38
+ return {
39
+ exports: scriptExports,
40
+ options
41
+ };
42
+ }
43
+
44
+ var __vue2_script = defineComponent({
45
+ emits: [
46
+ "open",
47
+ "close",
48
+ "opened",
49
+ "closed",
50
+ "drag-start",
51
+ "drag-end",
52
+ "drag-move",
53
+ "update:visible",
54
+ "size-change",
55
+ "current-change",
56
+ "prev-click",
57
+ "next-click",
58
+ "before-page-change",
59
+ "change",
60
+ // tiny 新增
61
+ "resize"
62
+ ],
63
+ props: [].concat(props, ["dialogOp", "visible", "popseletor", "multi", "gridOp", "textField", "textSplit", "valueField", "valueSplit", "remoteSearch", "showPager", "pagerOp", "showSelectedBox", "selectedBoxOp", "treeOp", "beforeClose", "autoLookup", "lookupMethod", "mainHeight"]),
64
+ components: {
65
+ TinyDialogBox: DialogBox,
66
+ TinyButton: Button,
67
+ TinyPager: Pager,
68
+ TinyGrid: Grid,
69
+ TinySplit: Split,
70
+ TinySelectedBox: SelectedBox,
71
+ TinyInput: Input,
72
+ TinyTree: Tree,
73
+ TinyIconSearch: iconSearch()
74
+ },
75
+ setup: function setup$1(props2, context) {
76
+ return setup({
77
+ props: props2,
78
+ context,
79
+ renderless,
80
+ api
81
+ });
82
+ }
83
+ });
84
+ var render = function render2() {
85
+ var _vm = this;
86
+ var _h = _vm.$createElement;
87
+ var _c = _vm._self._c || _h;
88
+ return _c("tiny-dialog-box", _vm._b({
89
+ class: ["tiny-dialog-select", {
90
+ "radio-check": !_vm.multi
91
+ }, {
92
+ "is-grid": _vm.popseletor === "grid"
93
+ }, {
94
+ "is-tree": _vm.popseletor === "tree"
95
+ }],
96
+ attrs: {
97
+ "visible": _vm.visible,
98
+ "modal": "",
99
+ "draggable": "",
100
+ "append-to-body": "",
101
+ "modal-append-to-body": "",
102
+ "close-on-press-escape": false,
103
+ "close-on-click-modal": false
104
+ },
105
+ on: {
106
+ "update:visible": function updateVisible($event) {
107
+ return _vm.$emit("update:visible", $event);
108
+ },
109
+ "open": function open($event) {
110
+ return _vm.$emit("open", $event);
111
+ },
112
+ "close": function close($event) {
113
+ return _vm.$emit("close", $event);
114
+ },
115
+ "opened": function opened($event) {
116
+ return _vm.$emit("opened", $event);
117
+ },
118
+ "closed": function closed($event) {
119
+ return _vm.$emit("closed", $event);
120
+ },
121
+ "drag-start": function dragStart($event) {
122
+ return _vm.$emit("drag-start", $event);
123
+ },
124
+ "drag-end": function dragEnd($event) {
125
+ return _vm.$emit("drag-end", $event);
126
+ },
127
+ "drag-move": function dragMove($event) {
128
+ return _vm.$emit("drag-move", $event);
129
+ },
130
+ "resize": function resize($event) {
131
+ return _vm.$emit("resize", $event);
132
+ }
133
+ },
134
+ scopedSlots: _vm._u([_vm.slots.title ? {
135
+ key: "title",
136
+ fn: function fn(params) {
137
+ return [_vm._t("title", null, null, params)];
138
+ }
139
+ } : null, {
140
+ key: "footer",
141
+ fn: function fn(params) {
142
+ return [_vm._t("footer", function() {
143
+ return [_c("div", {
144
+ staticClass: "tiny-dialog-select__footer"
145
+ }, [_c("div", {
146
+ staticClass: "tiny-dialog-select__footer-pager"
147
+ }, [_vm.popseletor === "grid" && _vm.showPager ? _c("tiny-pager", _vm._b({
148
+ ref: "pager",
149
+ attrs: {
150
+ "pager-count": 7
151
+ },
152
+ on: {
153
+ "size-change": function sizeChange($event) {
154
+ return _vm.$emit("size-change", $event);
155
+ },
156
+ "current-change": function currentChange($event) {
157
+ return _vm.$emit("current-change", $event);
158
+ },
159
+ "prev-click": function prevClick($event) {
160
+ return _vm.$emit("prev-click", $event);
161
+ },
162
+ "next-click": function nextClick($event) {
163
+ return _vm.$emit("next-click", $event);
164
+ },
165
+ "before-page-change": function beforePageChange($event) {
166
+ return _vm.$emit("before-page-change", $event);
167
+ }
168
+ }
169
+ }, "tiny-pager", _vm.pagerOp, false)) : _vm._e()], 1), _c("div", {
170
+ staticClass: "tiny-dialog-select__footer-buttons"
171
+ }, [_vm._t("footer-buttons", function() {
172
+ return [_c("tiny-button", {
173
+ on: {
174
+ "click": _vm.onFooterCancel
175
+ }
176
+ }, [_vm._v(_vm._s(_vm.t("ui.button.cancel")))]), _c("tiny-button", {
177
+ attrs: {
178
+ "type": "primary"
179
+ },
180
+ on: {
181
+ "click": _vm.onFooterConfirm
182
+ }
183
+ }, [_vm._v(_vm._s(_vm.t("ui.button.confirm")))])];
184
+ }, {
185
+ "cancel": _vm.onFooterCancel,
186
+ "confirm": _vm.onFooterConfirm
187
+ })], 2)])];
188
+ }, {
189
+ "cancel": _vm.onFooterCancel,
190
+ "confirm": _vm.onFooterConfirm
191
+ }, params)];
192
+ }
193
+ }], null, true)
194
+ }, "tiny-dialog-box", _vm.dialogOp, false), [_c("div", {
195
+ staticClass: "tiny-dialog-select__body"
196
+ }, [_vm.popseletor === "grid" && _vm.slots.search ? _c("div", {
197
+ staticClass: "tiny-dialog-select__body-search"
198
+ }, [_vm._t("search")], 2) : _vm._e(), _c("div", {
199
+ staticClass: "tiny-dialog-select__body-selector"
200
+ }, [_c("tiny-split", {
201
+ style: "height:" + _vm.mainHeight + "px",
202
+ attrs: {
203
+ "trigger-simple": "",
204
+ "disabled": !_vm.multi
205
+ },
206
+ scopedSlots: _vm._u([{
207
+ key: "left",
208
+ fn: function fn() {
209
+ return [_vm.popseletor === "grid" ? _c("div", {
210
+ staticClass: "tiny-dialog-select__body-grid",
211
+ style: "height:" + _vm.mainHeight + "px"
212
+ }, [_vm.visible || _vm.state.multiGridStore.inited ? _c("tiny-grid", _vm._b({
213
+ ref: "multiGrid",
214
+ attrs: {
215
+ "border": _vm.state.isBorder,
216
+ "stripe": false,
217
+ "auto-resize": "",
218
+ "height": _vm.mainHeight + "px",
219
+ "loading": _vm.state.multiGridStore.loading,
220
+ "row-id": _vm.valueField,
221
+ "columns": _vm.state.gridColumns,
222
+ "select-config": _vm.state.multiGridStore.selectConfig,
223
+ "radio-config": _vm.state.multiGridStore.radioConfig
224
+ },
225
+ on: {
226
+ "select-all": _vm.multiGridSelectAll,
227
+ "select-change": _vm.multiGridSelectChange,
228
+ "radio-change": _vm.multiGridRadioChange
229
+ }
230
+ }, "tiny-grid", _vm.gridOp, false)) : _vm._e()], 1) : _vm._e(), _vm.popseletor === "tree" ? _c("div", {
231
+ staticClass: "tiny-dialog-select__body-tree",
232
+ style: "height:" + _vm.mainHeight + "px"
233
+ }, [_c("tiny-input", {
234
+ attrs: {
235
+ "placeholder": _vm.t("ui.dialogSelect.treeSearch"),
236
+ "clearable": ""
237
+ },
238
+ on: {
239
+ "change": _vm.doMultiTreeFilter
240
+ },
241
+ scopedSlots: _vm._u([_vm.state.theme !== "saas" ? {
242
+ key: "prefix",
243
+ fn: function fn2() {
244
+ return [_c("tiny-icon-search")];
245
+ },
246
+ proxy: true
247
+ } : null], null, true),
248
+ model: {
249
+ value: _vm.state.multiTreeStore.filterText,
250
+ callback: function callback($$v) {
251
+ _vm.$set(_vm.state.multiTreeStore, "filterText", $$v);
252
+ },
253
+ expression: "state.multiTreeStore.filterText"
254
+ }
255
+ }), _c("div", {
256
+ staticClass: "tiny-dialog-select__body-tree-wrapper",
257
+ style: {
258
+ height: "calc(100% - " + _vm.state.constants.INPUT_HEIGHT + " - " + _vm.state.constants.INPUT_MARGIN_BOTTOM + " )"
259
+ }
260
+ }, [_c("div", [_vm.visible || _vm.state.multiTreeStore.inited ? _c("tiny-tree", _vm._b({
261
+ ref: "multiTree",
262
+ attrs: {
263
+ "show-checkbox": _vm.multi,
264
+ "show-radio": !_vm.multi,
265
+ "lazy-current": "",
266
+ "lazy": "",
267
+ "after-load": _vm.multiTreeAfterLoad,
268
+ "view-type": _vm.state.multiTreeStore.viewType,
269
+ "default-expanded-keys": _vm.state.multiTreeStore.expandedKeys,
270
+ "default-expanded-keys-highlight": _vm.state.multiTreeStore.highlight,
271
+ "filter-node-method": _vm.multiTreeFilterNode,
272
+ "filter-plain-method": _vm.multiTreeFilterPlain,
273
+ "default-checked-keys": _vm.state.multiTreeStore.checkedKeys
274
+ },
275
+ on: {
276
+ "leave-plain-view": _vm.multiTreeLeavePlain,
277
+ "check": _vm.multiTreeCheck,
278
+ "node-expand": _vm.multiTreeCheck,
279
+ "node-collapse": _vm.multiTreeCheck,
280
+ "check-plain": _vm.multiTreeCheck,
281
+ "check-change": _vm.multiTreeRadio
282
+ }
283
+ }, "tiny-tree", _vm.treeOp, false)) : _vm._e()], 1)])], 1) : _vm._e()];
284
+ },
285
+ proxy: true
286
+ }, {
287
+ key: "right",
288
+ fn: function fn() {
289
+ return [_vm.multi ? _c("div", {
290
+ staticClass: "tiny-dialog-select__body-box",
291
+ style: "height:" + _vm.mainHeight + "px"
292
+ }, [_vm.showSelectedBox ? _c("tiny-selected-box", _vm._b({
293
+ ref: "selectedBox",
294
+ attrs: {
295
+ "select": _vm.state.selectedDatas
296
+ },
297
+ on: {
298
+ "clear": _vm.selectedBoxClear,
299
+ "delete": _vm.selectedBoxDelete,
300
+ "drag": _vm.selectedBoxDrag
301
+ },
302
+ scopedSlots: _vm._u([_vm.slots.select ? {
303
+ key: "select",
304
+ fn: function fn2(params) {
305
+ return [_vm._t("select", null, null, params)];
306
+ }
307
+ } : null, _vm.slots.button ? {
308
+ key: "button",
309
+ fn: function fn2(params) {
310
+ return [_vm._t("button", null, null, params)];
311
+ }
312
+ } : null, _vm.slots.clear ? {
313
+ key: "clear",
314
+ fn: function fn2(params) {
315
+ return [_vm._t("clear", null, null, params)];
316
+ }
317
+ } : null, _vm.slots.option ? {
318
+ key: "option",
319
+ fn: function fn2(params) {
320
+ return [_vm._t("option", null, null, params)];
321
+ }
322
+ } : null, _vm.slots.close ? {
323
+ key: "close",
324
+ fn: function fn2(params) {
325
+ return [_vm._t("close", null, null, params)];
326
+ }
327
+ } : null], null, true)
328
+ }, "tiny-selected-box", _vm.selectedBoxOp, false)) : _vm._e()], 1) : _vm._e()];
329
+ },
330
+ proxy: true
331
+ }]),
332
+ model: {
333
+ value: _vm.state.splitValue,
334
+ callback: function callback($$v) {
335
+ _vm.$set(_vm.state, "splitValue", $$v);
336
+ },
337
+ expression: "state.splitValue"
338
+ }
339
+ })], 1)])]);
340
+ };
341
+ var staticRenderFns = [];
342
+ var __cssModules = {};
343
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
344
+ function __vue2_injectStyles(context) {
345
+ for (var o in __cssModules) {
346
+ this[o] = __cssModules[o];
347
+ }
348
+ }
349
+ var pc = /* @__PURE__ */ function() {
350
+ return __component__.exports;
351
+ }();
352
+
353
+ export { pc as default };
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@opentinyvue/vue-dialog-select",
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-renderless": "~3.21.0",
11
+ "@opentinyvue/vue-common": "~2.21.0",
12
+ "@opentinyvue/vue-dialog-box": "~2.21.0",
13
+ "@opentinyvue/vue-button": "~2.21.0",
14
+ "@opentinyvue/vue-pager": "~2.21.0",
15
+ "@opentinyvue/vue-grid": "~2.21.0",
16
+ "@opentinyvue/vue-split": "~2.21.0",
17
+ "@opentinyvue/vue-selected-box": "~2.21.0",
18
+ "@opentinyvue/vue-input": "~2.21.0",
19
+ "@opentinyvue/vue-tree": "~2.21.0",
20
+ "@opentinyvue/vue-theme": "~3.21.0",
21
+ "@opentinyvue/vue-icon": "~2.21.0"
22
+ },
23
+ "license": "MIT",
24
+ "types": "index.d.ts"
25
+ }
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;