bkui-vue 0.0.1-beta.388 → 0.0.1-beta.389

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