bkui-vue 0.0.1-beta.393 → 0.0.1-beta.395

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