bkui-vue 0.0.2-beta.35 → 0.0.2-beta.37
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/dist/index.cjs.js +25 -25
- package/dist/index.esm.js +30 -14
- package/dist/index.umd.js +44 -44
- package/lib/affix/index.js +391 -1
- package/lib/alert/index.js +287 -1
- package/lib/animate-number/index.js +219 -1
- package/lib/backtop/index.js +264 -1
- package/lib/badge/index.js +304 -1
- package/lib/breadcrumb/index.js +379 -1
- package/lib/button/index.js +403 -1
- package/lib/card/index.js +369 -1
- package/lib/cascader/index.js +2095 -2
- package/lib/checkbox/index.js +602 -1
- package/lib/code-diff/index.js +5548 -1
- package/lib/collapse/index.js +605 -1
- package/lib/collapse-transition/index.js +237 -1
- package/lib/color-picker/index.js +2735 -1
- package/lib/components.js +770 -1
- package/lib/config-provider/index.js +377 -1
- package/lib/container/index.js +408 -1
- package/lib/date-picker/index.js +5576 -1
- package/lib/dialog/index.js +1324 -2
- package/lib/directives/index.js +1386 -2
- package/lib/dist.index.js +179 -1
- package/lib/divider/index.js +237 -1
- package/lib/dropdown/index.js +455 -1
- package/lib/exception/index.js +435 -1
- package/lib/fixed-navbar/index.js +222 -1
- package/lib/form/index.js +1004 -1
- package/lib/hooks.js +133 -1
- package/lib/icon/angle-double-down-line.js +541 -1
- package/lib/icon/angle-double-left-line.js +541 -1
- package/lib/icon/angle-double-left.js +541 -1
- package/lib/icon/angle-double-right-line.js +541 -1
- package/lib/icon/angle-double-right.js +541 -1
- package/lib/icon/angle-double-up-line.js +541 -1
- package/lib/icon/angle-down-fill.js +541 -1
- package/lib/icon/angle-down-line.js +541 -1
- package/lib/icon/angle-down.js +541 -1
- package/lib/icon/angle-left.js +541 -1
- package/lib/icon/angle-right.js +541 -1
- package/lib/icon/angle-up-fill.js +541 -1
- package/lib/icon/angle-up.js +541 -1
- package/lib/icon/archive-fill.js +541 -1
- package/lib/icon/arrows-left.js +541 -1
- package/lib/icon/arrows-right.js +541 -1
- package/lib/icon/assistant.js +541 -1
- package/lib/icon/audio-fill.js +541 -1
- package/lib/icon/bk.js +541 -1
- package/lib/icon/circle.js +541 -1
- package/lib/icon/close-line.js +541 -1
- package/lib/icon/close.js +541 -1
- package/lib/icon/code.js +541 -1
- package/lib/icon/cog-shape.js +541 -1
- package/lib/icon/collapse-left.js +541 -1
- package/lib/icon/copy-shape.js +541 -1
- package/lib/icon/copy.js +541 -1
- package/lib/icon/data-shape.js +541 -1
- package/lib/icon/del.js +541 -1
- package/lib/icon/doc-fill.js +541 -1
- package/lib/icon/done.js +541 -1
- package/lib/icon/down-shape.js +541 -1
- package/lib/icon/down-small.js +541 -1
- package/lib/icon/edit-line.js +541 -1
- package/lib/icon/ellipsis.js +541 -1
- package/lib/icon/enlarge-line.js +541 -1
- package/lib/icon/error.js +541 -1
- package/lib/icon/excel-fill.js +541 -1
- package/lib/icon/exclamation-circle-shape.js +541 -1
- package/lib/icon/eye.js +541 -1
- package/lib/icon/filliscreen-line.js +541 -1
- package/lib/icon/fix-line.js +541 -1
- package/lib/icon/fix-shape.js +541 -1
- package/lib/icon/folder-open.js +541 -1
- package/lib/icon/folder-shape-open.js +541 -1
- package/lib/icon/folder-shape.js +541 -1
- package/lib/icon/folder.js +541 -1
- package/lib/icon/funnel.js +541 -1
- package/lib/icon/help-document-fill.js +541 -1
- package/lib/icon/help-fill.js +541 -1
- package/lib/icon/help.js +541 -1
- package/lib/icon/image-fill.js +563 -1
- package/lib/icon/img-error.js +563 -1
- package/lib/icon/img-placehoulder.js +563 -1
- package/lib/icon/index.js +2353 -1
- package/lib/icon/info-line.js +563 -1
- package/lib/icon/info.js +563 -1
- package/lib/icon/left-shape.js +563 -1
- package/lib/icon/left-turn-line.js +563 -1
- package/lib/icon/narrow-line.js +563 -1
- package/lib/icon/original.js +563 -1
- package/lib/icon/pdf-fill.js +563 -1
- package/lib/icon/play-shape.js +563 -1
- package/lib/icon/plus.js +563 -1
- package/lib/icon/ppt-fill.js +563 -1
- package/lib/icon/qq.js +563 -1
- package/lib/icon/right-shape.js +563 -1
- package/lib/icon/right-turn-line.js +563 -1
- package/lib/icon/search.js +563 -1
- package/lib/icon/share.js +563 -1
- package/lib/icon/spinner.js +563 -1
- package/lib/icon/success.js +563 -1
- package/lib/icon/switcher-loading.js +563 -1
- package/lib/icon/text-file.js +563 -1
- package/lib/icon/text-fill.js +563 -1
- package/lib/icon/transfer.js +563 -1
- package/lib/icon/tree-application-shape.js +563 -1
- package/lib/icon/unfull-screen.js +563 -1
- package/lib/icon/unvisible.js +563 -1
- package/lib/icon/up-shape.js +563 -1
- package/lib/icon/upload.js +563 -1
- package/lib/icon/video-fill.js +563 -1
- package/lib/icon/warn.js +563 -1
- package/lib/icon/weixin-pro.js +563 -1
- package/lib/icon/weixin.js +563 -1
- package/lib/image/index.js +681 -1
- package/lib/index.js +195 -1
- package/lib/info-box/index.js +1514 -2
- package/lib/input/index.js +1038 -1
- package/lib/link/index.js +232 -1
- package/lib/loading/index.js +443 -1
- package/lib/locale/index.js +489 -1
- package/lib/menu/index.js +793 -1
- package/lib/message/index.js +1842 -2
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/modal/index.js +407 -1
- package/lib/navigation/index.js +439 -1
- package/lib/notify/index.js +470 -1
- package/lib/overflow-title/index.js +547 -1
- package/lib/pagination/index.js +974 -1
- package/lib/plugin-popover/index.js +4121 -1
- package/lib/plugins/index.js +130 -1
- package/lib/pop-confirm/index.js +367 -1
- package/lib/popover/content.d.ts +8 -0
- package/lib/popover/index.d.ts +12 -0
- package/lib/popover/index.js +4127 -1
- package/lib/popover/popover.d.ts +7 -0
- package/lib/popover/props.d.ts +3 -0
- package/lib/popover2/index.js +171 -1
- package/lib/preset.js +164 -1
- package/lib/process/index.js +1146 -2
- package/lib/progress/index.js +495 -1
- package/lib/radio/index.js +693 -1
- package/lib/rate/index.js +406 -1
- package/lib/resize-layout/index.js +499 -1
- package/lib/search-select/index.js +3024 -2
- package/lib/select/index.d.ts +25 -3
- package/lib/select/index.js +2599 -2
- package/lib/select/select.d.ts +11 -1
- package/lib/shared/index.js +2832 -1
- package/lib/sideslider/index.js +1056 -2
- package/lib/slider/index.js +1683 -2
- package/lib/steps/index.js +1215 -2
- package/lib/swiper/index.js +404 -1
- package/lib/switcher/index.js +335 -1
- package/lib/tab/index.js +935 -1
- package/lib/table/index.js +6588 -1
- package/lib/table-column/index.js +768 -1
- package/lib/tag/index.js +309 -1
- package/lib/tag-input/index.d.ts +9 -0
- package/lib/tag-input/index.js +1758 -1
- package/lib/tag-input/tag-input.d.ts +20 -0
- package/lib/tag-input/tag-props.d.ts +3 -0
- package/lib/time-picker/index.js +142 -1
- package/lib/timeline/index.js +310 -1
- package/lib/transfer/index.js +767 -1
- package/lib/tree/index.js +2664 -1
- package/lib/upload/index.js +3257 -2
- package/lib/virtual-render/index.js +806 -1
- package/package.json +1 -1
- package/lib/cascader/index.js.LICENSE.txt +0 -1
- package/lib/dialog/index.js.LICENSE.txt +0 -1
- package/lib/directives/index.js.LICENSE.txt +0 -14
- package/lib/info-box/index.js.LICENSE.txt +0 -1
- package/lib/message/index.js.LICENSE.txt +0 -6
- package/lib/process/index.js.LICENSE.txt +0 -1
- package/lib/search-select/index.js.LICENSE.txt +0 -1
- package/lib/select/index.js.LICENSE.txt +0 -1
- package/lib/sideslider/index.js.LICENSE.txt +0 -1
- package/lib/slider/index.js.LICENSE.txt +0 -1
- package/lib/steps/index.js.LICENSE.txt +0 -1
- package/lib/upload/index.js.LICENSE.txt +0 -1
package/lib/checkbox/index.js
CHANGED
@@ -1 +1,602 @@
|
|
1
|
-
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
+
module.exports = factory(require("../shared"), require("vue"), require("../config-provider"));
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
5
|
+
define(["../shared", "vue", "../config-provider"], factory);
|
6
|
+
else {
|
7
|
+
var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../config-provider")) : factory(root["../shared"], root["vue"], root["../config-provider"]);
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9
|
+
}
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__2717__) => {
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
12
|
+
/******/ "use strict";
|
13
|
+
/******/ var __webpack_modules__ = ({
|
14
|
+
|
15
|
+
/***/ 2717:
|
16
|
+
/***/ ((module) => {
|
17
|
+
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
|
19
|
+
|
20
|
+
/***/ }),
|
21
|
+
|
22
|
+
/***/ 4212:
|
23
|
+
/***/ ((module) => {
|
24
|
+
|
25
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
|
26
|
+
|
27
|
+
/***/ }),
|
28
|
+
|
29
|
+
/***/ 748:
|
30
|
+
/***/ ((module) => {
|
31
|
+
|
32
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
|
33
|
+
|
34
|
+
/***/ })
|
35
|
+
|
36
|
+
/******/ });
|
37
|
+
/************************************************************************/
|
38
|
+
/******/ // The module cache
|
39
|
+
/******/ var __webpack_module_cache__ = {};
|
40
|
+
/******/
|
41
|
+
/******/ // The require function
|
42
|
+
/******/ function __webpack_require__(moduleId) {
|
43
|
+
/******/ // Check if module is in cache
|
44
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
45
|
+
/******/ if (cachedModule !== undefined) {
|
46
|
+
/******/ return cachedModule.exports;
|
47
|
+
/******/ }
|
48
|
+
/******/ // Create a new module (and put it into the cache)
|
49
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
50
|
+
/******/ // no module.id needed
|
51
|
+
/******/ // no module.loaded needed
|
52
|
+
/******/ exports: {}
|
53
|
+
/******/ };
|
54
|
+
/******/
|
55
|
+
/******/ // Execute the module function
|
56
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
57
|
+
/******/
|
58
|
+
/******/ // Return the exports of the module
|
59
|
+
/******/ return module.exports;
|
60
|
+
/******/ }
|
61
|
+
/******/
|
62
|
+
/************************************************************************/
|
63
|
+
/******/ /* webpack/runtime/define property getters */
|
64
|
+
/******/ (() => {
|
65
|
+
/******/ // define getter functions for harmony exports
|
66
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
67
|
+
/******/ for(var key in definition) {
|
68
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
69
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
70
|
+
/******/ }
|
71
|
+
/******/ }
|
72
|
+
/******/ };
|
73
|
+
/******/ })();
|
74
|
+
/******/
|
75
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
76
|
+
/******/ (() => {
|
77
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
78
|
+
/******/ })();
|
79
|
+
/******/
|
80
|
+
/******/ /* webpack/runtime/make namespace object */
|
81
|
+
/******/ (() => {
|
82
|
+
/******/ // define __esModule on exports
|
83
|
+
/******/ __webpack_require__.r = (exports) => {
|
84
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
85
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
86
|
+
/******/ }
|
87
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
88
|
+
/******/ };
|
89
|
+
/******/ })();
|
90
|
+
/******/
|
91
|
+
/************************************************************************/
|
92
|
+
var __webpack_exports__ = {};
|
93
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
94
|
+
(() => {
|
95
|
+
// ESM COMPAT FLAG
|
96
|
+
__webpack_require__.r(__webpack_exports__);
|
97
|
+
|
98
|
+
// EXPORTS
|
99
|
+
__webpack_require__.d(__webpack_exports__, {
|
100
|
+
BkCheckbox: () => (/* binding */ BkCheckbox),
|
101
|
+
BkCheckboxGroup: () => (/* reexport */ checkbox_group),
|
102
|
+
"default": () => (/* binding */ src)
|
103
|
+
});
|
104
|
+
|
105
|
+
// EXTERNAL MODULE: external "../shared"
|
106
|
+
var external_shared_ = __webpack_require__(4212);
|
107
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
108
|
+
function _typeof(obj) {
|
109
|
+
"@babel/helpers - typeof";
|
110
|
+
|
111
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
112
|
+
return typeof obj;
|
113
|
+
} : function (obj) {
|
114
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
115
|
+
}, _typeof(obj);
|
116
|
+
}
|
117
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
118
|
+
|
119
|
+
function _toPrimitive(input, hint) {
|
120
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
121
|
+
var prim = input[Symbol.toPrimitive];
|
122
|
+
if (prim !== undefined) {
|
123
|
+
var res = prim.call(input, hint || "default");
|
124
|
+
if (_typeof(res) !== "object") return res;
|
125
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
126
|
+
}
|
127
|
+
return (hint === "string" ? String : Number)(input);
|
128
|
+
}
|
129
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
130
|
+
|
131
|
+
|
132
|
+
function _toPropertyKey(arg) {
|
133
|
+
var key = _toPrimitive(arg, "string");
|
134
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
135
|
+
}
|
136
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
137
|
+
|
138
|
+
function _defineProperty(obj, key, value) {
|
139
|
+
key = _toPropertyKey(key);
|
140
|
+
if (key in obj) {
|
141
|
+
Object.defineProperty(obj, key, {
|
142
|
+
value: value,
|
143
|
+
enumerable: true,
|
144
|
+
configurable: true,
|
145
|
+
writable: true
|
146
|
+
});
|
147
|
+
} else {
|
148
|
+
obj[key] = value;
|
149
|
+
}
|
150
|
+
return obj;
|
151
|
+
}
|
152
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
153
|
+
function _arrayWithHoles(arr) {
|
154
|
+
if (Array.isArray(arr)) return arr;
|
155
|
+
}
|
156
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
157
|
+
function _iterableToArrayLimit(arr, i) {
|
158
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
159
|
+
if (null != _i) {
|
160
|
+
var _s,
|
161
|
+
_e,
|
162
|
+
_x,
|
163
|
+
_r,
|
164
|
+
_arr = [],
|
165
|
+
_n = !0,
|
166
|
+
_d = !1;
|
167
|
+
try {
|
168
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
169
|
+
if (Object(_i) !== _i) return;
|
170
|
+
_n = !1;
|
171
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
172
|
+
} catch (err) {
|
173
|
+
_d = !0, _e = err;
|
174
|
+
} finally {
|
175
|
+
try {
|
176
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
177
|
+
} finally {
|
178
|
+
if (_d) throw _e;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
return _arr;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
185
|
+
function _arrayLikeToArray(arr, len) {
|
186
|
+
if (len == null || len > arr.length) len = arr.length;
|
187
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
188
|
+
return arr2;
|
189
|
+
}
|
190
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
191
|
+
|
192
|
+
function _unsupportedIterableToArray(o, minLen) {
|
193
|
+
if (!o) return;
|
194
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
195
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
196
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
197
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
198
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
199
|
+
}
|
200
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
201
|
+
function _nonIterableRest() {
|
202
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
203
|
+
}
|
204
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
function _slicedToArray(arr, i) {
|
210
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
211
|
+
}
|
212
|
+
// EXTERNAL MODULE: external "vue"
|
213
|
+
var external_vue_ = __webpack_require__(748);
|
214
|
+
// EXTERNAL MODULE: external "../config-provider"
|
215
|
+
var external_config_provider_ = __webpack_require__(2717);
|
216
|
+
;// CONCATENATED MODULE: ../../packages/checkbox/src/common.ts
|
217
|
+
/*
|
218
|
+
* Tencent is pleased to support the open source community by making
|
219
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
220
|
+
*
|
221
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
222
|
+
*
|
223
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
224
|
+
*
|
225
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
226
|
+
*
|
227
|
+
* ---------------------------------------------------
|
228
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
229
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
230
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
231
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
232
|
+
*
|
233
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
234
|
+
* the Software.
|
235
|
+
*
|
236
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
237
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
238
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
239
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
240
|
+
* IN THE SOFTWARE.
|
241
|
+
*/
|
242
|
+
|
243
|
+
|
244
|
+
var checkboxGroupKey = Symbol('CheckboxGroup');
|
245
|
+
function useFocus() {
|
246
|
+
var isFocus = (0,external_vue_.ref)(false);
|
247
|
+
var blur = function blur() {
|
248
|
+
isFocus.value = false;
|
249
|
+
};
|
250
|
+
var focus = function focus() {
|
251
|
+
isFocus.value = true;
|
252
|
+
};
|
253
|
+
return [isFocus, {
|
254
|
+
blur: blur,
|
255
|
+
focus: focus
|
256
|
+
}];
|
257
|
+
}
|
258
|
+
;
|
259
|
+
var useCheckbox = function useCheckbox() {
|
260
|
+
var currentInstance = (0,external_vue_.getCurrentInstance)();
|
261
|
+
var props = currentInstance.props,
|
262
|
+
emit = currentInstance.emit;
|
263
|
+
var checkboxGroup = (0,external_vue_.inject)(checkboxGroupKey, external_shared_.EMPTY_OBJ);
|
264
|
+
var isGroup = !(0,external_shared_.isEmptyObj)(checkboxGroup);
|
265
|
+
var inputRef = (0,external_vue_.ref)();
|
266
|
+
var isChecked = (0,external_vue_.ref)(props.checked);
|
267
|
+
// 禁用状态
|
268
|
+
var isDisabled = (0,external_vue_.computed)(function () {
|
269
|
+
if (isGroup && checkboxGroup.props.disabled) {
|
270
|
+
return true;
|
271
|
+
}
|
272
|
+
return props.disabled;
|
273
|
+
});
|
274
|
+
// 触发更新
|
275
|
+
var triggerChange = function triggerChange() {
|
276
|
+
// 单独使用时状态切换返回 trueLabel、falseLabel
|
277
|
+
var nextValue = isChecked.value ? props.trueLabel : props.falseLabel;
|
278
|
+
emit('update:modelValue', nextValue);
|
279
|
+
emit('change', nextValue);
|
280
|
+
// 更新 checkbox-group
|
281
|
+
// 配合 checkbox-group 使用时返回 props.label
|
282
|
+
if (isGroup) {
|
283
|
+
checkboxGroup.handleChange();
|
284
|
+
}
|
285
|
+
(0,external_vue_.nextTick)(function () {
|
286
|
+
// 选中状态保持同步
|
287
|
+
if (inputRef.value.checked !== isChecked.value) {
|
288
|
+
inputRef.value.checked = isChecked.value;
|
289
|
+
}
|
290
|
+
});
|
291
|
+
};
|
292
|
+
// 响应modelValue
|
293
|
+
if (isGroup) {
|
294
|
+
(0,external_vue_.watch)(function () {
|
295
|
+
return checkboxGroup.props.modelValue;
|
296
|
+
}, function (modelValue) {
|
297
|
+
isChecked.value = modelValue.includes(props.label);
|
298
|
+
}, {
|
299
|
+
deep: true
|
300
|
+
});
|
301
|
+
} else {
|
302
|
+
(0,external_vue_.watch)(function () {
|
303
|
+
return props.modelValue;
|
304
|
+
}, function (modelValue) {
|
305
|
+
if (modelValue === '') {
|
306
|
+
return;
|
307
|
+
}
|
308
|
+
isChecked.value = modelValue === props.trueLabel;
|
309
|
+
}, {
|
310
|
+
immediate: true
|
311
|
+
});
|
312
|
+
}
|
313
|
+
(0,external_vue_.watch)(function () {
|
314
|
+
return props.checked;
|
315
|
+
}, function () {
|
316
|
+
isChecked.value = props.checked;
|
317
|
+
if (props.immediateEmitChange !== false) {
|
318
|
+
triggerChange();
|
319
|
+
}
|
320
|
+
});
|
321
|
+
var setChecked = function setChecked() {
|
322
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
323
|
+
isChecked.value = value;
|
324
|
+
};
|
325
|
+
// 值更新
|
326
|
+
var handleChange = function handleChange(event) {
|
327
|
+
if (isDisabled.value) {
|
328
|
+
return;
|
329
|
+
}
|
330
|
+
var $targetInput = event.target;
|
331
|
+
isChecked.value = $targetInput.checked;
|
332
|
+
triggerChange();
|
333
|
+
};
|
334
|
+
(0,external_vue_.onMounted)(function () {
|
335
|
+
if (isGroup) {
|
336
|
+
checkboxGroup.register(currentInstance.proxy);
|
337
|
+
}
|
338
|
+
});
|
339
|
+
(0,external_vue_.onBeforeUnmount)(function () {
|
340
|
+
if (isGroup) {
|
341
|
+
checkboxGroup.unregister(currentInstance.proxy);
|
342
|
+
}
|
343
|
+
});
|
344
|
+
return {
|
345
|
+
inputRef: inputRef,
|
346
|
+
isChecked: isChecked,
|
347
|
+
isDisabled: isDisabled,
|
348
|
+
setChecked: setChecked,
|
349
|
+
handleChange: handleChange
|
350
|
+
};
|
351
|
+
};
|
352
|
+
;// CONCATENATED MODULE: ../../packages/checkbox/src/checkbox.tsx
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
/*
|
357
|
+
* Tencent is pleased to support the open source community by making
|
358
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
359
|
+
*
|
360
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
361
|
+
*
|
362
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
363
|
+
*
|
364
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
365
|
+
*
|
366
|
+
* ---------------------------------------------------
|
367
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
368
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
369
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
370
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
371
|
+
*
|
372
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
373
|
+
* the Software.
|
374
|
+
*
|
375
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
376
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
377
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
378
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
379
|
+
* IN THE SOFTWARE.
|
380
|
+
*/
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
var checkboxProps = {
|
386
|
+
modelValue: external_shared_.PropTypes.oneOfType([String, Number, Boolean]),
|
387
|
+
label: external_shared_.PropTypes.oneOfType([String, Number, Boolean]),
|
388
|
+
trueLabel: external_shared_.PropTypes.oneOfType([String, Number, Boolean]).def(true),
|
389
|
+
falseLabel: external_shared_.PropTypes.oneOfType([String, Number, Boolean]).def(false),
|
390
|
+
disabled: external_shared_.PropTypes.bool.def(false),
|
391
|
+
checked: external_shared_.PropTypes.bool.def(false),
|
392
|
+
indeterminate: external_shared_.PropTypes.bool,
|
393
|
+
beforeChange: external_shared_.PropTypes.func,
|
394
|
+
size: external_shared_.PropTypes.size().def(external_shared_.SizeEnum.LARGE),
|
395
|
+
immediateEmitChange: external_shared_.PropTypes.bool.def(true) // 默认设置checked是否触发change事件
|
396
|
+
};
|
397
|
+
|
398
|
+
/* harmony default export */ const src_checkbox = ((0,external_vue_.defineComponent)({
|
399
|
+
name: 'Checkbox',
|
400
|
+
props: checkboxProps,
|
401
|
+
emits: {
|
402
|
+
'update:modelValue': function updateModelValue(value) {
|
403
|
+
return value !== undefined;
|
404
|
+
},
|
405
|
+
change: function change(value) {
|
406
|
+
return value !== undefined;
|
407
|
+
}
|
408
|
+
},
|
409
|
+
setup: function setup(props) {
|
410
|
+
var _useFocus = useFocus(),
|
411
|
+
_useFocus2 = _slicedToArray(_useFocus, 2),
|
412
|
+
isFocus = _useFocus2[0],
|
413
|
+
_useFocus2$ = _useFocus2[1],
|
414
|
+
handleBlur = _useFocus2$.blur,
|
415
|
+
handleFocus = _useFocus2$.focus;
|
416
|
+
var _useCheckbox = useCheckbox(),
|
417
|
+
inputRef = _useCheckbox.inputRef,
|
418
|
+
isChecked = _useCheckbox.isChecked,
|
419
|
+
isDisabled = _useCheckbox.isDisabled,
|
420
|
+
setChecked = _useCheckbox.setChecked,
|
421
|
+
handleChange = _useCheckbox.handleChange;
|
422
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
423
|
+
resolveClassName = _usePrefix.resolveClassName;
|
424
|
+
return {
|
425
|
+
inputRef: inputRef,
|
426
|
+
isFocus: isFocus,
|
427
|
+
isChecked: isChecked,
|
428
|
+
isDisabled: isDisabled,
|
429
|
+
setChecked: setChecked,
|
430
|
+
handleBlur: handleBlur,
|
431
|
+
handleFocus: handleFocus,
|
432
|
+
handleChange: handleChange,
|
433
|
+
size: props.size,
|
434
|
+
resolveClassName: resolveClassName
|
435
|
+
};
|
436
|
+
},
|
437
|
+
render: function render() {
|
438
|
+
var _classes,
|
439
|
+
_this = this;
|
440
|
+
var checkboxClass = (0,external_shared_.classes)((_classes = {}, _defineProperty(_classes, "".concat(this.resolveClassName('checkbox')), true), _defineProperty(_classes, 'is-focused', this.isFocus), _defineProperty(_classes, 'is-checked', this.isChecked), _defineProperty(_classes, 'is-disabled', this.isDisabled), _defineProperty(_classes, 'is-indeterminated', this.indeterminate), _classes));
|
441
|
+
var renderLabel = function renderLabel() {
|
442
|
+
if (!_this.label && !_this.$slots["default"]) {
|
443
|
+
return null;
|
444
|
+
}
|
445
|
+
return (0,external_vue_.createVNode)("span", {
|
446
|
+
"class": "".concat(_this.resolveClassName('checkbox-label'))
|
447
|
+
}, [_this.$slots["default"] ? _this.$slots["default"]() : _this.label]);
|
448
|
+
};
|
449
|
+
return (0,external_vue_.createVNode)("label", {
|
450
|
+
"class": checkboxClass
|
451
|
+
}, [(0,external_vue_.createVNode)("span", {
|
452
|
+
"class": [this.resolveClassName('checkbox-input'), this.size]
|
453
|
+
}, [(0,external_vue_.createVNode)("input", {
|
454
|
+
"ref": "inputRef",
|
455
|
+
"role": "checkbox",
|
456
|
+
"type": "checkbox",
|
457
|
+
"class": "".concat(this.resolveClassName('checkbox-original')),
|
458
|
+
"disabled": this.isDisabled,
|
459
|
+
"checked": this.isChecked,
|
460
|
+
"onChange": this.handleChange
|
461
|
+
}, null)]), renderLabel()]);
|
462
|
+
}
|
463
|
+
}));
|
464
|
+
;// CONCATENATED MODULE: ../../packages/checkbox/src/checkbox-group.tsx
|
465
|
+
|
466
|
+
/*
|
467
|
+
* Tencent is pleased to support the open source community by making
|
468
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
469
|
+
*
|
470
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
471
|
+
*
|
472
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
473
|
+
*
|
474
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
475
|
+
*
|
476
|
+
* ---------------------------------------------------
|
477
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
478
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
479
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
480
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
481
|
+
*
|
482
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
483
|
+
* the Software.
|
484
|
+
*
|
485
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
486
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
487
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
488
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
489
|
+
* IN THE SOFTWARE.
|
490
|
+
*/
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
var checkboxGroupProps = {
|
496
|
+
name: external_shared_.PropTypes.string.def(''),
|
497
|
+
modelValue: external_shared_.PropTypes.array,
|
498
|
+
disabled: external_shared_.PropTypes.bool,
|
499
|
+
withValidate: external_shared_.PropTypes.bool.def(true)
|
500
|
+
};
|
501
|
+
/* harmony default export */ const checkbox_group = ((0,external_vue_.defineComponent)({
|
502
|
+
name: 'CheckboxGroup',
|
503
|
+
props: checkboxGroupProps,
|
504
|
+
emits: ['change', 'update:modelValue'],
|
505
|
+
setup: function setup(props, context) {
|
506
|
+
var formItem = (0,external_shared_.useFormItem)();
|
507
|
+
var checkboxInstanceList = [];
|
508
|
+
var register = function register(checkboxContext) {
|
509
|
+
checkboxInstanceList.push(checkboxContext);
|
510
|
+
};
|
511
|
+
var unregister = function unregister(checkboxContext) {
|
512
|
+
var index = checkboxInstanceList.indexOf(checkboxContext);
|
513
|
+
if (index > -1) {
|
514
|
+
checkboxInstanceList.splice(index, 1);
|
515
|
+
}
|
516
|
+
};
|
517
|
+
var handleChange = function handleChange() {
|
518
|
+
var nextValue = checkboxInstanceList.reduce(function (result, checkboxInstance) {
|
519
|
+
if (checkboxInstance.isChecked) {
|
520
|
+
result.push(checkboxInstance.label);
|
521
|
+
}
|
522
|
+
return result;
|
523
|
+
}, []);
|
524
|
+
context.emit('update:modelValue', nextValue);
|
525
|
+
context.emit('change', nextValue);
|
526
|
+
};
|
527
|
+
(0,external_vue_.provide)(checkboxGroupKey, {
|
528
|
+
name: 'CheckboxGroup',
|
529
|
+
props: props,
|
530
|
+
register: register,
|
531
|
+
unregister: unregister,
|
532
|
+
handleChange: handleChange
|
533
|
+
});
|
534
|
+
(0,external_vue_.watch)(function () {
|
535
|
+
return props.modelValue;
|
536
|
+
}, function () {
|
537
|
+
var _a;
|
538
|
+
if (props.withValidate) {
|
539
|
+
(_a = formItem === null || formItem === void 0 ? void 0 : formItem.validate) === null || _a === void 0 ? void 0 : _a.call(formItem, 'change');
|
540
|
+
}
|
541
|
+
});
|
542
|
+
(0,external_vue_.onMounted)(function () {
|
543
|
+
var modelValue = props.modelValue || [];
|
544
|
+
checkboxInstanceList.forEach(function (checkboxInstance) {
|
545
|
+
if (modelValue.includes(checkboxInstance.label)) {
|
546
|
+
checkboxInstance.setChecked(true);
|
547
|
+
}
|
548
|
+
});
|
549
|
+
});
|
550
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
551
|
+
resolveClassName = _usePrefix.resolveClassName;
|
552
|
+
return {
|
553
|
+
resolveClassName: resolveClassName
|
554
|
+
};
|
555
|
+
},
|
556
|
+
render: function render() {
|
557
|
+
var _a;
|
558
|
+
return (0,external_vue_.createVNode)("div", {
|
559
|
+
"class": "".concat(this.resolveClassName('checkbox-group'))
|
560
|
+
}, [(_a = this.$slots) === null || _a === void 0 ? void 0 : _a["default"]()]);
|
561
|
+
}
|
562
|
+
}));
|
563
|
+
;// CONCATENATED MODULE: ../../packages/checkbox/src/index.ts
|
564
|
+
/*
|
565
|
+
* Tencent is pleased to support the open source community by making
|
566
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
567
|
+
*
|
568
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
569
|
+
*
|
570
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
571
|
+
*
|
572
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
573
|
+
*
|
574
|
+
* ---------------------------------------------------
|
575
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
576
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
577
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
578
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
579
|
+
*
|
580
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
581
|
+
* the Software.
|
582
|
+
*
|
583
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
584
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
585
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
586
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
587
|
+
* IN THE SOFTWARE.
|
588
|
+
*/
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
var BkCheckbox = (0,external_shared_.withInstallProps)(src_checkbox, {
|
593
|
+
Group: checkbox_group
|
594
|
+
});
|
595
|
+
/* harmony default export */ const src = (BkCheckbox);
|
596
|
+
|
597
|
+
})();
|
598
|
+
|
599
|
+
/******/ return __webpack_exports__;
|
600
|
+
/******/ })()
|
601
|
+
;
|
602
|
+
});
|