@opentinyvue/vue-dept 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 Dept from './src/index';
2
+ export default Dept;
package/lib/index.js ADDED
@@ -0,0 +1,63 @@
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 "@opentinyvue/vue-theme/dept/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 Dept = defineComponent({
19
+ name: $prefix + "Dept",
20
+ props: _extends({}, $props, {
21
+ modelValue: String,
22
+ disabled: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ autoSelect: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ size: String,
31
+ fetchDeptList: Function,
32
+ fetchDeptByValue: Function,
33
+ fetchDept: Function,
34
+ beforeConfirm: Function,
35
+ title: {
36
+ type: String,
37
+ default: ""
38
+ },
39
+ displayOnly: {
40
+ type: Boolean,
41
+ default: false
42
+ }
43
+ }),
44
+ setup: function setup(props, context) {
45
+ return $setup({
46
+ props,
47
+ context,
48
+ template
49
+ });
50
+ }
51
+ });
52
+ var version = "2.21.0";
53
+ Dept.model = {
54
+ prop: "modelValue",
55
+ event: "update:modelValue"
56
+ };
57
+ Dept.install = function(Vue) {
58
+ Vue.component(Dept.name, Dept);
59
+ };
60
+ Dept.version = version;
61
+ export {
62
+ Dept as default
63
+ };
package/lib/pc.js ADDED
@@ -0,0 +1,279 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/dept/vue';
2
+ import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
+ import { IconPopup } from '@opentinyvue/vue-icon';
4
+ import Input from '@opentinyvue/vue-input';
5
+ import Row from '@opentinyvue/vue-row';
6
+ import Col from '@opentinyvue/vue-col';
7
+ import DialogBox from '@opentinyvue/vue-dialog-box';
8
+ import Select from '@opentinyvue/vue-select';
9
+ import Option from '@opentinyvue/vue-option';
10
+
11
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
12
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
13
+ if (render) {
14
+ options.render = render;
15
+ options.staticRenderFns = staticRenderFns;
16
+ options._compiled = true;
17
+ }
18
+ var hook;
19
+ if (injectStyles) {
20
+ hook = injectStyles;
21
+ }
22
+ if (hook) {
23
+ if (options.functional) {
24
+ options._injectStyles = hook;
25
+ var originalRender = options.render;
26
+ options.render = function renderWithStyleInjection(h, context) {
27
+ hook.call(context);
28
+ return originalRender(h, context);
29
+ };
30
+ } else {
31
+ var existing = options.beforeCreate;
32
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
33
+ }
34
+ }
35
+ return {
36
+ exports: scriptExports,
37
+ options
38
+ };
39
+ }
40
+
41
+ var __vue2_script = defineComponent({
42
+ components: {
43
+ TinyInput: Input,
44
+ TinyDialogBox: DialogBox,
45
+ TinySelect: Select,
46
+ TinyOption: Option,
47
+ TinyRow: Row,
48
+ TinyCol: Col,
49
+ IconPopup: IconPopup()
50
+ },
51
+ emits: ["open", "selected", "cancel", "change", "update:modelValue", "confirm", "close"],
52
+ props: [].concat(props, ["size", "modelValue", "disabled", "fetchDeptList", "fetchDeptByValue", "fetchDept", "beforeConfirm", "autoSelect", "title", "displayOnly"]),
53
+ setup: function setup$1(props2, context) {
54
+ return setup({
55
+ props: props2,
56
+ context,
57
+ renderless,
58
+ api
59
+ });
60
+ }
61
+ });
62
+ var render = function render2() {
63
+ var _vm = this;
64
+ var _h = _vm.$createElement;
65
+ var _c = _vm._self._c || _h;
66
+ return _c("div", {
67
+ staticClass: "tiny-dept"
68
+ }, [_c("tiny-input", {
69
+ attrs: {
70
+ "tiny_mode": "pc",
71
+ "size": _vm.size,
72
+ "disabled": _vm.disabled,
73
+ "readonly": "",
74
+ "display-only": _vm.displayOnly
75
+ },
76
+ scopedSlots: _vm._u([{
77
+ key: "suffix",
78
+ fn: function fn() {
79
+ return [_c("icon-popup", {
80
+ staticClass: "tiny-input__icon tiny-svg-icon",
81
+ on: {
82
+ "click": _vm.openDialog
83
+ }
84
+ })];
85
+ },
86
+ proxy: true
87
+ }]),
88
+ model: {
89
+ value: _vm.state.display,
90
+ callback: function callback($$v) {
91
+ _vm.$set(_vm.state, "display", $$v);
92
+ },
93
+ expression: "state.display"
94
+ }
95
+ }), _c("tiny-dialog-box", {
96
+ staticClass: "tiny-dept",
97
+ attrs: {
98
+ "visible": _vm.state.open,
99
+ "close-on-click-modal": false,
100
+ "width": "550px",
101
+ "append-to-body": "",
102
+ "title": _vm.title
103
+ },
104
+ on: {
105
+ "update:visible": function updateVisible($event) {
106
+ _vm.state.open = $event;
107
+ },
108
+ "close": _vm.closeDialog
109
+ },
110
+ scopedSlots: _vm._u([{
111
+ key: "footer",
112
+ fn: function fn() {
113
+ return [_c("span", {
114
+ staticClass: "tiny-toolbar"
115
+ }, [_c("button", {
116
+ staticClass: "tiny-button tiny-button--primary",
117
+ attrs: {
118
+ "type": "button"
119
+ },
120
+ on: {
121
+ "click": _vm.confirm
122
+ }
123
+ }, [_c("span", [_vm._v(_vm._s(_vm.t("ui.base.confirm")))])]), _c("button", {
124
+ staticClass: "tiny-button tiny-button--default",
125
+ attrs: {
126
+ "type": "button"
127
+ },
128
+ on: {
129
+ "click": _vm.cancel
130
+ }
131
+ }, [_c("span", [_vm._v(_vm._s(_vm.t("ui.base.cancel")))])])])];
132
+ },
133
+ proxy: true
134
+ }])
135
+ }, [_c("tiny-row", {
136
+ staticClass: "tiny-dept__search"
137
+ }, [_c("tiny-col", {
138
+ staticClass: "tiny-dept__label",
139
+ attrs: {
140
+ "title": _vm.t("ui.dept.search"),
141
+ "span": 3
142
+ }
143
+ }, [_vm._v(" " + _vm._s(_vm.t("ui.dept.search")) + " ")]), _c("tiny-col", {
144
+ attrs: {
145
+ "span": 5
146
+ }
147
+ }, [_c("tiny-select", {
148
+ staticClass: "tiny-detp__select",
149
+ attrs: {
150
+ "placement": "bottom-start",
151
+ "loading": _vm.state.loading,
152
+ "placeholder": _vm.t("ui.dept.input"),
153
+ "filterable": "",
154
+ "clearable": "",
155
+ "remote": "",
156
+ "remote-method": _vm.searchMethod
157
+ },
158
+ on: {
159
+ "change": _vm.searchChange,
160
+ "clear": function clear($event) {
161
+ return _vm.searchMethod("");
162
+ }
163
+ },
164
+ model: {
165
+ value: _vm.state.searchValue,
166
+ callback: function callback($$v) {
167
+ _vm.$set(_vm.state, "searchValue", $$v);
168
+ },
169
+ expression: "state.searchValue"
170
+ }
171
+ }, [_c("li", {
172
+ staticClass: "tiny-option tiny-select-dropdown__item",
173
+ staticStyle: {
174
+ "background": "#f1f1f1",
175
+ "cursor": "auto",
176
+ "border-bottom": "solid 1px #d9d9d9",
177
+ "box-shadow": "rgb(241, 241, 241) 0px -6px 0px 6px"
178
+ }
179
+ }, [_c("span", {
180
+ staticStyle: {
181
+ "float": "left",
182
+ "font-size": "12px"
183
+ }
184
+ }, [_vm._v(_vm._s(_vm.t("ui.dept.code")))]), _c("span", {
185
+ staticStyle: {
186
+ "float": "right"
187
+ }
188
+ }, [_vm._v(_vm._s(_vm.t("ui.dept.name")))])]), _vm._l(_vm.state.searchOptions, function(option, index) {
189
+ return _c("tiny-option", {
190
+ key: index,
191
+ attrs: {
192
+ "label": option.hrName,
193
+ "value": option.hrCode
194
+ }
195
+ }, [_c("span", {
196
+ staticStyle: {
197
+ "float": "left",
198
+ "font-size": "12px"
199
+ }
200
+ }, [_vm._v(_vm._s(option.hrCode))]), _c("span", {
201
+ staticStyle: {
202
+ "float": "right",
203
+ "color": "#8492a6",
204
+ "font-size": "12px"
205
+ }
206
+ }, [_vm._v(_vm._s(option.hrName))])]);
207
+ })], 2)], 1)], 1), _vm._l(_vm.deptState, function(dept, index) {
208
+ return _c("tiny-row", {
209
+ key: index,
210
+ staticClass: "tiny-dept__item"
211
+ }, [_c("tiny-col", {
212
+ staticClass: "tiny-dept__label",
213
+ attrs: {
214
+ "title": _vm.t("ui.dept." + dept.title),
215
+ "span": 3
216
+ }
217
+ }, [_vm._v(" " + _vm._s(_vm.t("ui.dept." + dept.title)) + " ")]), _c("tiny-col", {
218
+ attrs: {
219
+ "span": 9
220
+ }
221
+ }, [_c("tiny-select", {
222
+ ref: "select" + index,
223
+ refInFor: true,
224
+ staticClass: "tiny-detp__select",
225
+ attrs: {
226
+ "loading": _vm.state.loading,
227
+ "filterable": "",
228
+ "default-first-option": "",
229
+ "clearable": "",
230
+ "disabled": !!index && dept.disable
231
+ },
232
+ on: {
233
+ "visible-change": function visibleChange($event) {
234
+ return _vm.getCurrentList(index, $event);
235
+ },
236
+ "change": function change($event) {
237
+ return _vm.selectChange({
238
+ level: index,
239
+ value: $event
240
+ });
241
+ }
242
+ },
243
+ model: {
244
+ value: dept.value,
245
+ callback: function callback($$v) {
246
+ _vm.$set(dept, "value", $$v);
247
+ },
248
+ expression: "dept.value"
249
+ }
250
+ }, _vm._l(dept.options, function(option) {
251
+ return _c("tiny-option", {
252
+ key: option.hrCode,
253
+ attrs: {
254
+ "label": option.hrName,
255
+ "value": option.hrCode
256
+ }
257
+ });
258
+ }), 1)], 1)], 1);
259
+ }), _c("tiny-row", [_c("p", {
260
+ staticClass: "tiny-dept__label is-selected"
261
+ }, [_vm._v(" " + _vm._s(_vm.t("ui.dept.selected")) + " ")]), _c("p", {
262
+ staticClass: "tiny-dept__selected-info"
263
+ }, [_vm._v(" " + _vm._s(_vm.state.labels.join(" > ")) + " ")]), _vm._t("hrapprover", null, {
264
+ "slotScope": _vm.state
265
+ })], 2)], 2)], 1);
266
+ };
267
+ var staticRenderFns = [];
268
+ var __cssModules = {};
269
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
270
+ function __vue2_injectStyles(context) {
271
+ for (var o in __cssModules) {
272
+ this[o] = __cssModules[o];
273
+ }
274
+ }
275
+ var pc = /* @__PURE__ */ function() {
276
+ return __component__.exports;
277
+ }();
278
+
279
+ export { pc as default };
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@opentinyvue/vue-dept",
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-select": "~2.21.0",
14
+ "@opentinyvue/vue-option": "~2.21.0",
15
+ "@opentinyvue/vue-row": "~2.21.0",
16
+ "@opentinyvue/vue-col": "~2.21.0",
17
+ "@opentinyvue/vue-input": "~2.21.0",
18
+ "@opentinyvue/vue-theme": "~3.21.0",
19
+ "@opentinyvue/vue-dialog-box": "~2.21.0"
20
+ },
21
+ "license": "MIT",
22
+ "types": "index.d.ts",
23
+ "scripts": {
24
+ "build": "pnpm -w build:ui $npm_package_name",
25
+ "//postversion": "pnpm build"
26
+ }
27
+ }
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;