bulade-ui 1.0.4 → 1.0.6

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 (128) hide show
  1. package/miniprogram_dist/bld-action-sheet/index.js +196 -0
  2. package/miniprogram_dist/bld-action-sheet/index.js.map +1 -0
  3. package/miniprogram_dist/bld-action-sheet/index.json +8 -0
  4. package/miniprogram_dist/bld-action-sheet/index.wxml +57 -0
  5. package/miniprogram_dist/bld-action-sheet/index.wxss +160 -0
  6. package/miniprogram_dist/bld-badge/index.js +156 -0
  7. package/miniprogram_dist/bld-badge/index.js.map +1 -0
  8. package/miniprogram_dist/bld-badge/index.json +4 -0
  9. package/miniprogram_dist/bld-badge/index.wxml +14 -0
  10. package/miniprogram_dist/bld-badge/index.wxss +43 -0
  11. package/miniprogram_dist/bld-button/index.wxml +0 -1
  12. package/miniprogram_dist/bld-drawer/index.js +2 -2
  13. package/miniprogram_dist/bld-drawer/index.js.map +1 -1
  14. package/miniprogram_dist/bld-drawer/index.wxss +4 -3
  15. package/miniprogram_dist/bld-empty-page/index.js +123 -0
  16. package/miniprogram_dist/bld-empty-page/index.js.map +1 -0
  17. package/miniprogram_dist/bld-empty-page/index.json +3 -0
  18. package/miniprogram_dist/bld-empty-page/index.wxml +11 -0
  19. package/miniprogram_dist/bld-empty-page/index.wxss +14 -0
  20. package/miniprogram_dist/bld-message/index.js +2 -2
  21. package/miniprogram_dist/bld-message/index.js.map +1 -1
  22. package/miniprogram_dist/bld-message/message.js +2 -2
  23. package/miniprogram_dist/bld-message/message.js.map +1 -1
  24. package/miniprogram_dist/bld-modal/index.js +223 -0
  25. package/miniprogram_dist/bld-modal/index.js.map +1 -0
  26. package/miniprogram_dist/bld-modal/index.json +6 -0
  27. package/miniprogram_dist/bld-modal/index.wxml +23 -0
  28. package/miniprogram_dist/bld-modal/index.wxss +97 -0
  29. package/miniprogram_dist/bld-modal/modal.js +147 -0
  30. package/miniprogram_dist/bld-modal/modal.js.map +1 -0
  31. package/miniprogram_dist/bld-navbar/index.js +167 -0
  32. package/miniprogram_dist/bld-navbar/index.js.map +1 -0
  33. package/miniprogram_dist/bld-navbar/index.json +6 -0
  34. package/miniprogram_dist/bld-navbar/index.wxml +8 -0
  35. package/miniprogram_dist/bld-navbar/index.wxss +31 -0
  36. package/miniprogram_dist/bld-navbar-group/index.js +243 -0
  37. package/miniprogram_dist/bld-navbar-group/index.js.map +1 -0
  38. package/miniprogram_dist/bld-navbar-group/index.json +4 -0
  39. package/miniprogram_dist/bld-navbar-group/index.wxml +37 -0
  40. package/miniprogram_dist/bld-navbar-group/index.wxss +30 -0
  41. package/miniprogram_dist/bld-notice-bar/index.js +171 -0
  42. package/miniprogram_dist/bld-notice-bar/index.js.map +1 -0
  43. package/miniprogram_dist/bld-notice-bar/index.json +3 -0
  44. package/miniprogram_dist/bld-notice-bar/index.wxml +30 -0
  45. package/miniprogram_dist/bld-notice-bar/index.wxss +51 -0
  46. package/miniprogram_dist/bld-pop-up/index.js +129 -0
  47. package/miniprogram_dist/bld-pop-up/index.js.map +1 -0
  48. package/miniprogram_dist/bld-pop-up/index.json +6 -0
  49. package/miniprogram_dist/bld-pop-up/index.wxml +18 -0
  50. package/miniprogram_dist/bld-pop-up/index.wxss +27 -0
  51. package/miniprogram_dist/bld-tag/index.js +134 -0
  52. package/miniprogram_dist/bld-tag/index.js.map +1 -0
  53. package/miniprogram_dist/bld-tag/index.json +3 -0
  54. package/miniprogram_dist/bld-tag/index.wxml +3 -0
  55. package/miniprogram_dist/bld-tag/index.wxss +108 -0
  56. package/miniprogram_dist/bld-toast/index.js +2 -2
  57. package/miniprogram_dist/bld-toast/index.js.map +1 -1
  58. package/miniprogram_dist/bld-toast/toast.js +2 -2
  59. package/miniprogram_dist/bld-toast/toast.js.map +1 -1
  60. package/miniprogram_dist/cell/index.js +2 -2
  61. package/miniprogram_dist/cell/index.js.map +1 -1
  62. package/miniprogram_dist/cell-group/index.js +2 -2
  63. package/miniprogram_dist/cell-group/index.js.map +1 -1
  64. package/miniprogram_dist/grid/index.js +2 -2
  65. package/miniprogram_dist/grid/index.js.map +1 -1
  66. package/miniprogram_dist/grid-item/index.js +2 -2
  67. package/miniprogram_dist/grid-item/index.js.map +1 -1
  68. package/miniprogram_dist/icon/index.js +2 -2
  69. package/miniprogram_dist/icon/index.js.map +1 -1
  70. package/miniprogram_dist/timeline/index.js +2 -2
  71. package/miniprogram_dist/timeline/index.js.map +1 -1
  72. package/miniprogram_dist/timeline-item/index.js +2 -2
  73. package/miniprogram_dist/timeline-item/index.js.map +1 -1
  74. package/package.json +1 -1
  75. package/src/bld-action-sheet/index.js +83 -0
  76. package/src/bld-action-sheet/index.json +8 -0
  77. package/src/bld-action-sheet/index.scss +180 -0
  78. package/src/bld-action-sheet/index.wxml +57 -0
  79. package/src/bld-action-sheet/index.wxss +160 -0
  80. package/src/bld-badge/index.js +53 -0
  81. package/src/bld-badge/index.json +4 -0
  82. package/src/bld-badge/index.scss +46 -0
  83. package/src/bld-badge/index.wxml +14 -0
  84. package/src/bld-badge/index.wxss +43 -0
  85. package/src/bld-button/index.wxml +0 -1
  86. package/src/bld-content-container/index.js +46 -0
  87. package/src/bld-content-container/index.json +3 -0
  88. package/src/bld-content-container/index.scss +0 -0
  89. package/src/bld-content-container/index.wxml +5 -0
  90. package/src/bld-content-container/index.wxss +0 -0
  91. package/src/bld-drawer/index.scss +8 -3
  92. package/src/bld-drawer/index.wxss +4 -3
  93. package/src/bld-empty-page/index.js +23 -0
  94. package/src/bld-empty-page/index.json +3 -0
  95. package/src/bld-empty-page/index.scss +15 -0
  96. package/src/bld-empty-page/index.wxml +11 -0
  97. package/src/bld-empty-page/index.wxss +14 -0
  98. package/src/bld-modal/index.js +123 -0
  99. package/src/bld-modal/index.json +6 -0
  100. package/src/bld-modal/index.scss +108 -0
  101. package/src/bld-modal/index.wxml +23 -0
  102. package/src/bld-modal/index.wxss +97 -0
  103. package/src/bld-modal/modal.js +38 -0
  104. package/src/bld-navbar/index.js +63 -0
  105. package/src/bld-navbar/index.json +6 -0
  106. package/src/bld-navbar/index.scss +35 -0
  107. package/src/bld-navbar/index.wxml +8 -0
  108. package/src/bld-navbar/index.wxss +31 -0
  109. package/src/bld-navbar-group/index.js +139 -0
  110. package/src/bld-navbar-group/index.json +4 -0
  111. package/src/bld-navbar-group/index.scss +33 -0
  112. package/src/bld-navbar-group/index.wxml +37 -0
  113. package/src/bld-navbar-group/index.wxss +30 -0
  114. package/src/bld-notice-bar/index.js +69 -0
  115. package/src/bld-notice-bar/index.json +3 -0
  116. package/src/bld-notice-bar/index.scss +59 -0
  117. package/src/bld-notice-bar/index.wxml +30 -0
  118. package/src/bld-notice-bar/index.wxss +51 -0
  119. package/src/bld-pop-up/index.js +29 -0
  120. package/src/bld-pop-up/index.json +6 -0
  121. package/src/bld-pop-up/index.scss +27 -0
  122. package/src/bld-pop-up/index.wxml +18 -0
  123. package/src/bld-pop-up/index.wxss +27 -0
  124. package/src/bld-tag/index.js +34 -0
  125. package/src/bld-tag/index.json +3 -0
  126. package/src/bld-tag/index.scss +127 -0
  127. package/src/bld-tag/index.wxml +3 -0
  128. package/src/bld-tag/index.wxss +108 -0
@@ -0,0 +1,97 @@
1
+ .m-mask {
2
+ z-index: 1000;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ right: 0;
7
+ bottom: 0;
8
+ opacity: 1;
9
+ visibility: visible;
10
+ background: var(--color-mask, rgba(0, 0, 0, 0.55));
11
+ transition: all 0.25s ease-in-out;
12
+ }
13
+ .m-mask.is-hidden {
14
+ opacity: 0;
15
+ visibility: hidden;
16
+ }
17
+
18
+ .m-modal-wrap {
19
+ z-index: 1001;
20
+ position: fixed;
21
+ left: 50%;
22
+ top: 50%;
23
+ visibility: visible;
24
+ transform: translate3d(-50%, -50%, 0);
25
+ }
26
+ .m-modal-wrap.is-hidden {
27
+ visibility: hidden;
28
+ }
29
+ .m-modal-wrap .m-modal {
30
+ z-index: 9;
31
+ position: relative;
32
+ width: 540rpx;
33
+ transform: scale(0.9);
34
+ opacity: 0;
35
+ transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
36
+ }
37
+ .m-modal-wrap .m-modal.is-show {
38
+ opacity: 1;
39
+ transform: scale(1);
40
+ }
41
+ .m-modal-wrap .m-modal .m-modal__content {
42
+ position: relative;
43
+ padding-top: 30rpx;
44
+ height: 100%;
45
+ border: 0;
46
+ border-radius: 3rpx;
47
+ text-align: center;
48
+ background-color: #fff;
49
+ background-clip: padding-box;
50
+ overflow: hidden;
51
+ }
52
+ .m-modal-wrap .m-modal .m-modal__title {
53
+ margin: 0;
54
+ padding: 12rpx 30rpx 24rpx;
55
+ font-size: 36rpx;
56
+ line-height: 1;
57
+ color: #1c2438;
58
+ text-align: center;
59
+ }
60
+ .m-modal-wrap .m-modal .m-modal__body {
61
+ max-height: 300rpx;
62
+ margin-bottom: 30rpx;
63
+ padding: 20rpx 40rpx;
64
+ font-size: 28rpx;
65
+ color: #80848f;
66
+ line-height: 1.5;
67
+ overflow: auto;
68
+ -webkit-overflow-scrolling: touch;
69
+ }
70
+ .m-modal-wrap .m-modal .m-modal__btn-group {
71
+ position: relative;
72
+ display: flex;
73
+ }
74
+ .m-modal-wrap .m-modal .m-modal__btn-group::after {
75
+ content: "";
76
+ position: absolute;
77
+ top: 0;
78
+ left: 0;
79
+ width: 100%;
80
+ height: 1px;
81
+ transform: scaleY(0.5);
82
+ background: #ddd;
83
+ }
84
+ .m-modal-wrap .m-modal .m-modal__btn-group .m-modal__btn {
85
+ position: relative;
86
+ flex: 1;
87
+ }
88
+ .m-modal-wrap .m-modal .m-modal__btn-group .m-modal__btn.m-modal__btn--cancel::after {
89
+ content: "";
90
+ position: absolute;
91
+ top: 0;
92
+ right: 0;
93
+ width: 1px;
94
+ height: 100%;
95
+ transform: scaleX(0.5);
96
+ background: #ddd;
97
+ }
@@ -0,0 +1,147 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 34);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 34:
91
+ /***/ (function(module, exports, __webpack_require__) {
92
+
93
+ "use strict";
94
+
95
+
96
+ exports.__esModule = true;
97
+ function getCtx(selector) {
98
+ var pages = getCurrentPages();
99
+ var ctx = pages[pages.length - 1];
100
+ var componentCtx = ctx.selectComponent(selector);
101
+
102
+ if (!componentCtx) {
103
+ console.error('无法找到对应的组件,请按文档说明使用组件');
104
+ return null;
105
+ }
106
+ return componentCtx;
107
+ }
108
+
109
+ var Modal = function Modal(options) {
110
+
111
+ return new Promise(function (resolve, reject) {
112
+ var _options$selector = options.selector,
113
+ selector = _options$selector === undefined ? '#modal' : _options$selector;
114
+
115
+ var modal = getCtx(selector);
116
+ modal._reset();
117
+
118
+ modal._confirm = resolve;
119
+ modal._cancel = reject;
120
+ modal._show(options);
121
+
122
+ return modal;
123
+ });
124
+ };
125
+
126
+ Modal.alert = function (options) {
127
+ return Modal(Object.assign({
128
+ showCancelButton: false
129
+ }, options));
130
+ };
131
+ Modal.confirm = function (options) {
132
+ return Modal(options);
133
+ };
134
+
135
+ Modal.close = function () {
136
+ var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#modal';
137
+
138
+ var ctx = getCtx(selector);
139
+ ctx.close();
140
+ };
141
+
142
+ exports.default = Modal;
143
+
144
+ /***/ })
145
+
146
+ /******/ });
147
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/bld-modal/modal.js"],"names":["getCtx","selector","pages","getCurrentPages","ctx","length","componentCtx","selectComponent","console","error","Modal","Promise","resolve","reject","options","modal","_reset","_confirm","_cancel","_show","alert","Object","assign","showCancelButton","confirm","close"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,SAASA,MAAT,CAAgBC,QAAhB,EAA0B;AACxB,MAAMC,QAAQC,iBAAd;AACA,MAAMC,MAAMF,MAAMA,MAAMG,MAAN,GAAe,CAArB,CAAZ;AACA,MAAMC,eAAeF,IAAIG,eAAJ,CAAoBN,QAApB,CAArB;;AAEA,MAAI,CAACK,YAAL,EAAmB;AACjBE,YAAQC,KAAR,CAAc,sBAAd;AACA,WAAO,IAAP;AACD;AACD,SAAOH,YAAP;AACD;;AAED,IAAMI,QAAQ,SAARA,KAAQ,UAAW;;AAEvB,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AAAA,4BACNC,OADM,CAC9Bb,QAD8B;AAAA,QAC9BA,QAD8B,qCACnB,QADmB;;AAEtC,QAAMc,QAAQf,OAAOC,QAAP,CAAd;AACAc,UAAMC,MAAN;;AAEAD,UAAME,QAAN,GAAiBL,OAAjB;AACAG,UAAMG,OAAN,GAAgBL,MAAhB;AACAE,UAAMI,KAAN,CAAYL,OAAZ;;AAEA,WAAOC,KAAP;AACD,GAVM,CAAP;AAWD,CAbD;;AAeAL,MAAMU,KAAN,GAAc;AAAA,SAAWV,MAAMW,OAAOC,MAAP,CAAc;AAC3CC,sBAAkB;AADyB,GAAd,EAE5BT,OAF4B,CAAN,CAAX;AAAA,CAAd;AAGAJ,MAAMc,OAAN,GAAgB;AAAA,SAAWd,MAAMI,OAAN,CAAX;AAAA,CAAhB;;AAEAJ,MAAMe,KAAN,GAAc,YAAyB;AAAA,MAAxBxB,QAAwB,uEAAb,QAAa;;AACrC,MAAMG,MAAMJ,OAAOC,QAAP,CAAZ;AACAG,MAAIqB,KAAJ;AACD,CAHD;;kBAKef,K","file":"bld-modal/modal.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 34);\n","function getCtx(selector) {\n const pages = getCurrentPages()\n const ctx = pages[pages.length - 1]\n const componentCtx = ctx.selectComponent(selector)\n\n if (!componentCtx) {\n console.error('无法找到对应的组件,请按文档说明使用组件')\n return null\n }\n return componentCtx\n}\n\nconst Modal = options => {\n\n return new Promise((resolve, reject) => {\n const { selector = '#modal' } = options\n const modal = getCtx(selector)\n modal._reset()\n\n modal._confirm = resolve\n modal._cancel = reject\n modal._show(options)\n\n return modal\n })\n}\n\nModal.alert = options => Modal(Object.assign({\n showCancelButton: false\n}, options))\nModal.confirm = options => Modal(options)\n\nModal.close = (selector = '#modal') => {\n const ctx = getCtx(selector)\n ctx.close()\n}\n\nexport default Modal"],"sourceRoot":""}
@@ -0,0 +1,167 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 37);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 37:
91
+ /***/ (function(module, exports, __webpack_require__) {
92
+
93
+ "use strict";
94
+
95
+
96
+ Component({
97
+ externalClasses: ['custom-class'],
98
+
99
+ options: {
100
+ addGlobalClass: true
101
+ },
102
+
103
+ relations: {
104
+ '../bld-navbar-group/index': {
105
+ type: 'parent',
106
+ linked: function linked(target) {
107
+ this.parent = target;
108
+ },
109
+ unlinked: function unlinked() {
110
+ this.parent = null;
111
+ }
112
+ }
113
+ },
114
+
115
+ properties: {
116
+ name: {
117
+ type: String,
118
+ value: ''
119
+ },
120
+ title: {
121
+ type: String,
122
+ value: ''
123
+ },
124
+ value: {
125
+ type: String,
126
+ optionalTypes: [Number, String],
127
+ value: ''
128
+ }
129
+ },
130
+
131
+ data: {
132
+ activeName: '',
133
+ activeColor: ''
134
+ },
135
+
136
+ methods: {
137
+ onClick: function onClick() {
138
+ var _this = this;
139
+
140
+ var ev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
141
+
142
+ var parent = this.parent;
143
+
144
+ parent.triggerEvent('click', this.data.name);
145
+
146
+ var baseLeft = parent.data.baseLeft;
147
+
148
+ var query = this.createSelectorQuery();
149
+
150
+ query.select('.m-tab-item').boundingClientRect();
151
+ query.select('.m-tab-item__text').boundingClientRect();
152
+
153
+ query.exec(function (res) {
154
+ var offsetLeft = ev ? ev.currentTarget.offsetLeft : res[0].left - baseLeft;
155
+ var itemWidth = res[0].width;
156
+ var textWidth = res[1].width;
157
+
158
+ parent.updateScrollPositon(offsetLeft, itemWidth, textWidth, _this.data.name);
159
+ });
160
+ }
161
+ }
162
+ });
163
+
164
+ /***/ })
165
+
166
+ /******/ });
167
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/bld-navbar/index.js"],"names":["Component","externalClasses","options","addGlobalClass","relations","type","linked","target","parent","unlinked","properties","name","String","value","title","optionalTypes","Number","data","activeName","activeColor","methods","onClick","ev","triggerEvent","baseLeft","query","createSelectorQuery","select","boundingClientRect","exec","offsetLeft","currentTarget","res","left","itemWidth","width","textWidth","updateScrollPositon"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;AClFAA,UAAU;AACRC,mBAAiB,CAAC,cAAD,CADT;;AAGRC,WAAS;AACPC,oBAAgB;AADT,GAHD;;AAORC,aAAW;AACT,iCAA6B;AAC3BC,YAAM,QADqB;AAE3BC,YAF2B,kBAEpBC,MAFoB,EAEZ;AACb,aAAKC,MAAL,GAAcD,MAAd;AACD,OAJ0B;AAK3BE,cAL2B,sBAKhB;AACT,aAAKD,MAAL,GAAc,IAAd;AACD;AAP0B;AADpB,GAPH;;AAmBRE,cAAY;AACVC,UAAM;AACJN,YAAMO,MADF;AAEJC,aAAO;AAFH,KADI;AAKVC,WAAO;AACLT,YAAMO,MADD;AAELC,aAAO;AAFF,KALG;AASVA,WAAO;AACLR,YAAMO,MADD;AAELG,qBAAe,CAACC,MAAD,EAASJ,MAAT,CAFV;AAGLC,aAAO;AAHF;AATG,GAnBJ;;AAmCRI,QAAM;AACJC,gBAAY,EADR;AAEJC,iBAAa;AAFT,GAnCE;;AAwCRC,WAAS;AACPC,WADO,qBACY;AAAA;;AAAA,UAAXC,EAAW,uEAAN,IAAM;;AACjB,UAAMd,SAAS,KAAKA,MAApB;;AAEAA,aAAOe,YAAP,CAAoB,OAApB,EAA6B,KAAKN,IAAL,CAAUN,IAAvC;;AAEA,UAAMa,WAAWhB,OAAOS,IAAP,CAAYO,QAA7B;;AAEA,UAAMC,QAAQ,KAAKC,mBAAL,EAAd;;AAEAD,YAAME,MAAN,CAAa,aAAb,EAA4BC,kBAA5B;AACAH,YAAME,MAAN,CAAa,mBAAb,EAAkCC,kBAAlC;;AAEAH,YAAMI,IAAN,CAAW,eAAO;AAChB,YAAMC,aAAaR,KAAKA,GAAGS,aAAH,CAAiBD,UAAtB,GAAmCE,IAAI,CAAJ,EAAOC,IAAP,GAAcT,QAApE;AACA,YAAMU,YAAYF,IAAI,CAAJ,EAAOG,KAAzB;AACA,YAAMC,YAAYJ,IAAI,CAAJ,EAAOG,KAAzB;;AAEA3B,eAAO6B,mBAAP,CAA2BP,UAA3B,EAAuCI,SAAvC,EAAkDE,SAAlD,EAA6D,MAAKnB,IAAL,CAAUN,IAAvE;AACD,OAND;AAOD;AApBM;AAxCD,CAAV,E","file":"bld-navbar/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 37);\n","Component({\n externalClasses: ['custom-class'],\n\n options: {\n addGlobalClass: true,\n },\n\n relations: {\n '../bld-navbar-group/index': {\n type: 'parent',\n linked(target) {\n this.parent = target\n },\n unlinked() {\n this.parent = null\n }\n }\n },\n\n properties: {\n name: {\n type: String,\n value: ''\n },\n title: {\n type: String,\n value: ''\n },\n value: {\n type: String,\n optionalTypes: [Number, String],\n value: ''\n }\n },\n\n data: {\n activeName: '',\n activeColor: ''\n },\n\n methods: {\n onClick(ev = null) {\n const parent = this.parent\n\n parent.triggerEvent('click', this.data.name)\n\n const baseLeft = parent.data.baseLeft\n\n const query = this.createSelectorQuery()\n\n query.select('.m-tab-item').boundingClientRect()\n query.select('.m-tab-item__text').boundingClientRect()\n\n query.exec(res => {\n const offsetLeft = ev ? ev.currentTarget.offsetLeft : res[0].left - baseLeft\n const itemWidth = res[0].width\n const textWidth = res[1].width\n\n parent.updateScrollPositon(offsetLeft, itemWidth, textWidth, this.data.name)\n })\n }\n }\n})"],"sourceRoot":""}
@@ -0,0 +1,6 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "bld-badge": "../bld-badge/index"
5
+ }
6
+ }
@@ -0,0 +1,8 @@
1
+ <view class="m-tab-item {{activeName === name ? 'is-active': ''}}" bind:tap="onClick">
2
+ <view class="m-tab-item__content">
3
+ <view class="m-tab-item__text" style="{{ activeColor ? 'color:' + activeColor: '' }}">
4
+ {{ title }}
5
+ <bld-badge wx:if="{{ value }}" custom-class="m-badge-custom" value="{{ value }}" static />
6
+ </view>
7
+ </view>
8
+ </view>
@@ -0,0 +1,31 @@
1
+ :host {
2
+ flex: 1;
3
+ }
4
+
5
+ .m-tab-item {
6
+ position: relative;
7
+ flex: 1;
8
+ box-sizing: border-box;
9
+ padding: 0 5px;
10
+ display: flex;
11
+ justify-content: center;
12
+ color: #7d7e80;
13
+ line-height: 88rpx;
14
+ font-size: 28rpx;
15
+ -webkit-tap-highlight-color: transparent;
16
+ }
17
+ .m-tab-item.is-active {
18
+ font-weight: 500;
19
+ color: #323233;
20
+ }
21
+ .m-tab-item .m-tab-item__content {
22
+ margin: 0 20rpx;
23
+ white-space: nowrap;
24
+ }
25
+ .m-tab-item .m-tab-item__content .m-tab-item__text {
26
+ display: inline-block;
27
+ }
28
+ .m-tab-item .m-tab-item__content .m-tab-item__text .m-badge-custom {
29
+ margin-left: 6rpx;
30
+ vertical-align: text-top;
31
+ }