bkui-vue 0.0.2-beta.37 → 0.0.2-beta.39

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.
Files changed (180) hide show
  1. package/dist/index.cjs.js +2 -2
  2. package/dist/index.esm.js +11 -4
  3. package/dist/index.umd.js +12 -12
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -391
  7. package/lib/alert/index.js +1 -287
  8. package/lib/animate-number/index.js +1 -219
  9. package/lib/backtop/index.js +1 -264
  10. package/lib/badge/index.js +1 -304
  11. package/lib/breadcrumb/index.js +1 -379
  12. package/lib/button/index.js +1 -403
  13. package/lib/card/index.js +1 -369
  14. package/lib/cascader/index.js +2 -2095
  15. package/lib/cascader/index.js.LICENSE.txt +1 -0
  16. package/lib/checkbox/index.js +1 -602
  17. package/lib/code-diff/index.js +1 -5548
  18. package/lib/collapse/index.js +1 -605
  19. package/lib/collapse-transition/index.js +1 -237
  20. package/lib/color-picker/index.js +1 -2735
  21. package/lib/components.js +1 -770
  22. package/lib/config-provider/index.js +1 -377
  23. package/lib/container/index.js +1 -408
  24. package/lib/date-picker/index.js +1 -5576
  25. package/lib/dialog/index.js +2 -1324
  26. package/lib/dialog/index.js.LICENSE.txt +1 -0
  27. package/lib/directives/index.js +2 -1386
  28. package/lib/directives/index.js.LICENSE.txt +14 -0
  29. package/lib/dist.index.js +1 -179
  30. package/lib/divider/index.js +1 -237
  31. package/lib/dropdown/index.js +1 -455
  32. package/lib/exception/index.js +1 -435
  33. package/lib/fixed-navbar/index.js +1 -222
  34. package/lib/form/index.js +1 -1004
  35. package/lib/hooks.js +1 -133
  36. package/lib/icon/angle-double-down-line.js +1 -541
  37. package/lib/icon/angle-double-left-line.js +1 -541
  38. package/lib/icon/angle-double-left.js +1 -541
  39. package/lib/icon/angle-double-right-line.js +1 -541
  40. package/lib/icon/angle-double-right.js +1 -541
  41. package/lib/icon/angle-double-up-line.js +1 -541
  42. package/lib/icon/angle-down-fill.js +1 -541
  43. package/lib/icon/angle-down-line.js +1 -541
  44. package/lib/icon/angle-down.js +1 -541
  45. package/lib/icon/angle-left.js +1 -541
  46. package/lib/icon/angle-right.js +1 -541
  47. package/lib/icon/angle-up-fill.js +1 -541
  48. package/lib/icon/angle-up.js +1 -541
  49. package/lib/icon/archive-fill.js +1 -541
  50. package/lib/icon/arrows-left.js +1 -541
  51. package/lib/icon/arrows-right.js +1 -541
  52. package/lib/icon/assistant.js +1 -541
  53. package/lib/icon/audio-fill.js +1 -541
  54. package/lib/icon/bk.js +1 -541
  55. package/lib/icon/circle.js +1 -541
  56. package/lib/icon/close-line.js +1 -541
  57. package/lib/icon/close.js +1 -541
  58. package/lib/icon/code.js +1 -541
  59. package/lib/icon/cog-shape.js +1 -541
  60. package/lib/icon/collapse-left.js +1 -541
  61. package/lib/icon/copy-shape.js +1 -541
  62. package/lib/icon/copy.js +1 -541
  63. package/lib/icon/data-shape.js +1 -541
  64. package/lib/icon/del.js +1 -541
  65. package/lib/icon/doc-fill.js +1 -541
  66. package/lib/icon/done.js +1 -541
  67. package/lib/icon/down-shape.js +1 -541
  68. package/lib/icon/down-small.js +1 -541
  69. package/lib/icon/edit-line.js +1 -541
  70. package/lib/icon/ellipsis.js +1 -541
  71. package/lib/icon/enlarge-line.js +1 -541
  72. package/lib/icon/error.js +1 -541
  73. package/lib/icon/excel-fill.js +1 -541
  74. package/lib/icon/exclamation-circle-shape.js +1 -541
  75. package/lib/icon/eye.js +1 -541
  76. package/lib/icon/filliscreen-line.js +1 -541
  77. package/lib/icon/fix-line.js +1 -541
  78. package/lib/icon/fix-shape.js +1 -541
  79. package/lib/icon/folder-open.js +1 -541
  80. package/lib/icon/folder-shape-open.js +1 -541
  81. package/lib/icon/folder-shape.js +1 -541
  82. package/lib/icon/folder.js +1 -541
  83. package/lib/icon/funnel.js +1 -541
  84. package/lib/icon/help-document-fill.js +1 -541
  85. package/lib/icon/help-fill.js +1 -541
  86. package/lib/icon/help.js +1 -541
  87. package/lib/icon/image-fill.js +1 -563
  88. package/lib/icon/img-error.js +1 -563
  89. package/lib/icon/img-placehoulder.js +1 -563
  90. package/lib/icon/index.js +1 -2353
  91. package/lib/icon/info-line.js +1 -563
  92. package/lib/icon/info.js +1 -563
  93. package/lib/icon/left-shape.js +1 -563
  94. package/lib/icon/left-turn-line.js +1 -563
  95. package/lib/icon/narrow-line.js +1 -563
  96. package/lib/icon/original.js +1 -563
  97. package/lib/icon/pdf-fill.js +1 -563
  98. package/lib/icon/play-shape.js +1 -563
  99. package/lib/icon/plus.js +1 -563
  100. package/lib/icon/ppt-fill.js +1 -563
  101. package/lib/icon/qq.js +1 -563
  102. package/lib/icon/right-shape.js +1 -563
  103. package/lib/icon/right-turn-line.js +1 -563
  104. package/lib/icon/search.js +1 -563
  105. package/lib/icon/share.js +1 -563
  106. package/lib/icon/spinner.js +1 -563
  107. package/lib/icon/success.js +1 -563
  108. package/lib/icon/switcher-loading.js +1 -563
  109. package/lib/icon/text-file.js +1 -563
  110. package/lib/icon/text-fill.js +1 -563
  111. package/lib/icon/transfer.js +1 -563
  112. package/lib/icon/tree-application-shape.js +1 -563
  113. package/lib/icon/unfull-screen.js +1 -563
  114. package/lib/icon/unvisible.js +1 -563
  115. package/lib/icon/up-shape.js +1 -563
  116. package/lib/icon/upload.js +1 -563
  117. package/lib/icon/video-fill.js +1 -563
  118. package/lib/icon/warn.js +1 -563
  119. package/lib/icon/weixin-pro.js +1 -563
  120. package/lib/icon/weixin.js +1 -563
  121. package/lib/image/index.js +1 -681
  122. package/lib/index.js +1 -195
  123. package/lib/info-box/index.js +2 -1514
  124. package/lib/info-box/index.js.LICENSE.txt +1 -0
  125. package/lib/input/index.js +1 -1038
  126. package/lib/link/index.js +1 -232
  127. package/lib/loading/index.js +1 -443
  128. package/lib/locale/index.js +1 -489
  129. package/lib/menu/index.js +1 -793
  130. package/lib/message/index.js +2 -1842
  131. package/lib/message/index.js.LICENSE.txt +6 -0
  132. package/lib/modal/index.js +1 -407
  133. package/lib/navigation/index.js +1 -439
  134. package/lib/notify/index.js +1 -470
  135. package/lib/overflow-title/index.js +1 -547
  136. package/lib/pagination/index.js +1 -974
  137. package/lib/plugin-popover/index.js +1 -4121
  138. package/lib/plugins/index.js +1 -130
  139. package/lib/pop-confirm/index.js +1 -367
  140. package/lib/popover/index.js +1 -4127
  141. package/lib/popover2/index.js +1 -171
  142. package/lib/preset.js +1 -164
  143. package/lib/process/index.js +2 -1146
  144. package/lib/process/index.js.LICENSE.txt +1 -0
  145. package/lib/progress/index.js +1 -495
  146. package/lib/radio/index.js +1 -693
  147. package/lib/rate/index.js +1 -406
  148. package/lib/resize-layout/index.js +1 -499
  149. package/lib/search-select/index.js +2 -3024
  150. package/lib/search-select/index.js.LICENSE.txt +1 -0
  151. package/lib/select/index.js +2 -2599
  152. package/lib/select/index.js.LICENSE.txt +1 -0
  153. package/lib/select/select.css +9 -0
  154. package/lib/select/select.less +11 -0
  155. package/lib/select/select.variable.css +9 -0
  156. package/lib/shared/index.js +1 -2832
  157. package/lib/sideslider/index.js +2 -1056
  158. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  159. package/lib/slider/index.js +2 -1683
  160. package/lib/slider/index.js.LICENSE.txt +1 -0
  161. package/lib/steps/index.js +2 -1215
  162. package/lib/steps/index.js.LICENSE.txt +1 -0
  163. package/lib/swiper/index.js +1 -404
  164. package/lib/swiper/swiper.css +0 -6
  165. package/lib/swiper/swiper.less +0 -8
  166. package/lib/swiper/swiper.variable.css +0 -6
  167. package/lib/switcher/index.js +1 -335
  168. package/lib/tab/index.js +1 -935
  169. package/lib/table/index.js +1 -6588
  170. package/lib/table-column/index.js +1 -768
  171. package/lib/tag/index.js +1 -309
  172. package/lib/tag-input/index.js +1 -1758
  173. package/lib/time-picker/index.js +1 -142
  174. package/lib/timeline/index.js +1 -310
  175. package/lib/transfer/index.js +1 -767
  176. package/lib/tree/index.js +1 -2664
  177. package/lib/upload/index.js +2 -3257
  178. package/lib/upload/index.js.LICENSE.txt +1 -0
  179. package/lib/virtual-render/index.js +1 -806
  180. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -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
- });
1
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("../shared"),require("vue"),require("../config-provider"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider"],r);else{var t="object"==typeof exports?r(require("../shared"),require("vue"),require("../config-provider")):r(e["../shared"],e.vue,e["../config-provider"]);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(self,((e,r,t)=>(()=>{"use strict";var o={2717:e=>{e.exports=t},4212:r=>{r.exports=e},748:e=>{e.exports=r}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return o[e](t,t.exports,i),t.exports}i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{i.r(a),i.d(a,{BkCheckbox:()=>p,BkCheckboxGroup:()=>f,default:()=>h});var e=i(4212);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function t(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}var n=i(748),l=i(2717),u=Symbol("CheckboxGroup"),s={modelValue:e.PropTypes.oneOfType([String,Number,Boolean]),label:e.PropTypes.oneOfType([String,Number,Boolean]),trueLabel:e.PropTypes.oneOfType([String,Number,Boolean]).def(!0),falseLabel:e.PropTypes.oneOfType([String,Number,Boolean]).def(!1),disabled:e.PropTypes.bool.def(!1),checked:e.PropTypes.bool.def(!1),indeterminate:e.PropTypes.bool,beforeChange:e.PropTypes.func,size:e.PropTypes.size().def(e.SizeEnum.LARGE),immediateEmitChange:e.PropTypes.bool.def(!0)};const c=(0,n.defineComponent)({name:"Checkbox",props:s,emits:{"update:modelValue":function(e){return void 0!==e},change:function(e){return void 0!==e}},setup:function(r){var t,i,a=function(){var e=(0,n.ref)(!1);return[e,{blur:function(){e.value=!1},focus:function(){e.value=!0}}]}(),s=(i=2,function(e){if(Array.isArray(e))return e}(t=a)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,n,i,a,l=[],u=!0,s=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(o=i.call(t)).done)&&(l.push(o.value),l.length!==r);u=!0);}catch(e){s=!0,n=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw n}}return l}}(t,i)||function(e,r){if(e){if("string"==typeof e)return o(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,r):void 0}}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],d=s[1],f=d.blur,p=d.focus,h=function(){var r=(0,n.getCurrentInstance)(),t=r.props,o=r.emit,i=(0,n.inject)(u,e.EMPTY_OBJ),a=!(0,e.isEmptyObj)(i),l=(0,n.ref)(),s=(0,n.ref)(t.checked),c=(0,n.computed)((function(){return!(!a||!i.props.disabled)||t.disabled})),d=function(){var e=s.value?t.trueLabel:t.falseLabel;o("update:modelValue",e),o("change",e),a&&i.handleChange(),(0,n.nextTick)((function(){l.value.checked!==s.value&&(l.value.checked=s.value)}))};return a?(0,n.watch)((function(){return i.props.modelValue}),(function(e){s.value=e.includes(t.label)}),{deep:!0}):(0,n.watch)((function(){return t.modelValue}),(function(e){""!==e&&(s.value=e===t.trueLabel)}),{immediate:!0}),(0,n.watch)((function(){return t.checked}),(function(){s.value=t.checked,!1!==t.immediateEmitChange&&d()})),(0,n.onMounted)((function(){a&&i.register(r.proxy)})),(0,n.onBeforeUnmount)((function(){a&&i.unregister(r.proxy)})),{inputRef:l,isChecked:s,isDisabled:c,setChecked:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];s.value=e},handleChange:function(e){if(!c.value){var r=e.target;s.value=r.checked,d()}}}}(),b=h.inputRef,v=h.isChecked,m=h.isDisabled,y=h.setChecked,g=h.handleChange,C=(0,l.usePrefix)().resolveClassName;return{inputRef:b,isFocus:c,isChecked:v,isDisabled:m,setChecked:y,handleBlur:f,handleFocus:p,handleChange:g,size:r.size,resolveClassName:C}},render:function(){var r,o=this,i=(0,e.classes)((t(r={},"".concat(this.resolveClassName("checkbox")),!0),t(r,"is-focused",this.isFocus),t(r,"is-checked",this.isChecked),t(r,"is-disabled",this.isDisabled),t(r,"is-indeterminated",this.indeterminate),r));return(0,n.createVNode)("label",{class:i},[(0,n.createVNode)("span",{class:[this.resolveClassName("checkbox-input"),this.size]},[(0,n.createVNode)("input",{ref:"inputRef",role:"checkbox",type:"checkbox",class:"".concat(this.resolveClassName("checkbox-original")),disabled:this.isDisabled,checked:this.isChecked,onChange:this.handleChange},null)]),o.label||o.$slots.default?(0,n.createVNode)("span",{class:"".concat(o.resolveClassName("checkbox-label"))},[o.$slots.default?o.$slots.default():o.label]):null])}});var d={name:e.PropTypes.string.def(""),modelValue:e.PropTypes.array,disabled:e.PropTypes.bool,withValidate:e.PropTypes.bool.def(!0)};const f=(0,n.defineComponent)({name:"CheckboxGroup",props:d,emits:["change","update:modelValue"],setup:function(r,t){var o=(0,e.useFormItem)(),i=[];return(0,n.provide)(u,{name:"CheckboxGroup",props:r,register:function(e){i.push(e)},unregister:function(e){var r=i.indexOf(e);r>-1&&i.splice(r,1)},handleChange:function(){var e=i.reduce((function(e,r){return r.isChecked&&e.push(r.label),e}),[]);t.emit("update:modelValue",e),t.emit("change",e)}}),(0,n.watch)((function(){return r.modelValue}),(function(){var e;r.withValidate&&(null===(e=null==o?void 0:o.validate)||void 0===e||e.call(o,"change"))})),(0,n.onMounted)((function(){var e=r.modelValue||[];i.forEach((function(r){e.includes(r.label)&&r.setChecked(!0)}))})),{resolveClassName:(0,l.usePrefix)().resolveClassName}},render:function(){var e;return(0,n.createVNode)("div",{class:"".concat(this.resolveClassName("checkbox-group"))},[null===(e=this.$slots)||void 0===e?void 0:e.default()])}});var p=(0,e.withInstallProps)(c,{Group:f});const h=p})(),a})()));