n20-project-component 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/demo.html +10 -0
- package/dist/n20-project-component.common.js +537 -0
- package/dist/n20-project-component.css +1 -0
- package/dist/n20-project-component.umd.js +547 -0
- package/dist/n20-project-component.umd.min.js +1 -0
- package/package.json +65 -0
- package/src/components/DemoButton/index.vue +74 -0
- package/src/components/N20CopyText/index.vue +171 -0
- package/src/index.js +39 -0
- package/src/styles/variables.scss +30 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["n20-project-component"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["n20-project-component"] = factory();
|
|
10
|
+
})((typeof self !== 'undefined' ? self : this), function() {
|
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
12
|
+
/******/ // The module cache
|
|
13
|
+
/******/ var installedModules = {};
|
|
14
|
+
/******/
|
|
15
|
+
/******/ // The require function
|
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
|
17
|
+
/******/
|
|
18
|
+
/******/ // Check if module is in cache
|
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
|
21
|
+
/******/ }
|
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
|
24
|
+
/******/ i: moduleId,
|
|
25
|
+
/******/ l: false,
|
|
26
|
+
/******/ exports: {}
|
|
27
|
+
/******/ };
|
|
28
|
+
/******/
|
|
29
|
+
/******/ // Execute the module function
|
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
31
|
+
/******/
|
|
32
|
+
/******/ // Flag the module as loaded
|
|
33
|
+
/******/ module.l = true;
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // Return the exports of the module
|
|
36
|
+
/******/ return module.exports;
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/
|
|
39
|
+
/******/
|
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
41
|
+
/******/ __webpack_require__.m = modules;
|
|
42
|
+
/******/
|
|
43
|
+
/******/ // expose the module cache
|
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // define getter function for harmony exports
|
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
50
|
+
/******/ }
|
|
51
|
+
/******/ };
|
|
52
|
+
/******/
|
|
53
|
+
/******/ // define __esModule on exports
|
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
57
|
+
/******/ }
|
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
59
|
+
/******/ };
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // create a fake namespace object
|
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
|
65
|
+
/******/ // mode & 8|1: behave like require
|
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
68
|
+
/******/ if(mode & 8) return value;
|
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
70
|
+
/******/ var ns = Object.create(null);
|
|
71
|
+
/******/ __webpack_require__.r(ns);
|
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
74
|
+
/******/ return ns;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
|
81
|
+
/******/ function getModuleExports() { return module; };
|
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
83
|
+
/******/ return getter;
|
|
84
|
+
/******/ };
|
|
85
|
+
/******/
|
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // __webpack_public_path__
|
|
90
|
+
/******/ __webpack_require__.p = "";
|
|
91
|
+
/******/
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // Load entry module and return exports
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
95
|
+
/******/ })
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
/******/ ({
|
|
98
|
+
|
|
99
|
+
/***/ "00be":
|
|
100
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
101
|
+
|
|
102
|
+
// extracted by mini-css-extract-plugin
|
|
103
|
+
|
|
104
|
+
/***/ }),
|
|
105
|
+
|
|
106
|
+
/***/ "021e":
|
|
107
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
108
|
+
|
|
109
|
+
"use strict";
|
|
110
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_1c0b7107_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f14e");
|
|
111
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_1c0b7107_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_1c0b7107_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
112
|
+
/* unused harmony reexport * */
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/***/ }),
|
|
116
|
+
|
|
117
|
+
/***/ "d72c":
|
|
118
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
119
|
+
|
|
120
|
+
"use strict";
|
|
121
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_540c418a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("00be");
|
|
122
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_540c418a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_540c418a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
123
|
+
/* unused harmony reexport * */
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/***/ }),
|
|
127
|
+
|
|
128
|
+
/***/ "f14e":
|
|
129
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
130
|
+
|
|
131
|
+
// extracted by mini-css-extract-plugin
|
|
132
|
+
|
|
133
|
+
/***/ }),
|
|
134
|
+
|
|
135
|
+
/***/ "fb15":
|
|
136
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
137
|
+
|
|
138
|
+
"use strict";
|
|
139
|
+
// ESM COMPAT FLAG
|
|
140
|
+
__webpack_require__.r(__webpack_exports__);
|
|
141
|
+
|
|
142
|
+
// EXPORTS
|
|
143
|
+
__webpack_require__.d(__webpack_exports__, "DemoButton", function() { return /* reexport */ DemoButton; });
|
|
144
|
+
__webpack_require__.d(__webpack_exports__, "N20CopyText", function() { return /* reexport */ N20CopyText; });
|
|
145
|
+
|
|
146
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
147
|
+
// This file is imported into lib/wc client bundles.
|
|
148
|
+
|
|
149
|
+
if (typeof window !== 'undefined') {
|
|
150
|
+
var currentScript = window.document.currentScript
|
|
151
|
+
if (false) { var getCurrentScript; }
|
|
152
|
+
|
|
153
|
+
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
154
|
+
if (src) {
|
|
155
|
+
__webpack_require__.p = src[1] // eslint-disable-line
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Indicate to webpack that this file can be concatenated
|
|
160
|
+
/* harmony default export */ var setPublicPath = (null);
|
|
161
|
+
|
|
162
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"53bb5eda-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DemoButton/index.vue?vue&type=template&id=1c0b7107&scoped=true
|
|
163
|
+
var render = function render() {
|
|
164
|
+
var _vm = this,
|
|
165
|
+
_c = _vm._self._c;
|
|
166
|
+
return _c('el-button', {
|
|
167
|
+
staticClass: "n20-demo-button",
|
|
168
|
+
attrs: {
|
|
169
|
+
"type": _vm.type,
|
|
170
|
+
"size": _vm.size,
|
|
171
|
+
"disabled": _vm.disabled,
|
|
172
|
+
"loading": _vm.loading,
|
|
173
|
+
"icon": _vm.icon
|
|
174
|
+
},
|
|
175
|
+
on: {
|
|
176
|
+
"click": _vm.handleClick
|
|
177
|
+
}
|
|
178
|
+
}, [_vm._t("default", function () {
|
|
179
|
+
return [_vm._v(_vm._s(_vm.text))];
|
|
180
|
+
})], 2);
|
|
181
|
+
};
|
|
182
|
+
var staticRenderFns = [];
|
|
183
|
+
|
|
184
|
+
// CONCATENATED MODULE: ./src/components/DemoButton/index.vue?vue&type=template&id=1c0b7107&scoped=true
|
|
185
|
+
|
|
186
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DemoButton/index.vue?vue&type=script&lang=js
|
|
187
|
+
/**
|
|
188
|
+
* DemoButton - 示例按钮组件
|
|
189
|
+
*
|
|
190
|
+
* 用于验证组件库构建流程。实际开发时可删除此组件,替换为业务组件。
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* <DemoButton type="primary" text="提交" @click="handleSubmit" />
|
|
194
|
+
*/
|
|
195
|
+
/* harmony default export */ var DemoButtonvue_type_script_lang_js = ({
|
|
196
|
+
name: 'N20DemoButton',
|
|
197
|
+
props: {
|
|
198
|
+
/** 按钮文本 */
|
|
199
|
+
text: {
|
|
200
|
+
type: String,
|
|
201
|
+
default: '按钮'
|
|
202
|
+
},
|
|
203
|
+
/** 按钮类型:primary / success / warning / danger / info / text */
|
|
204
|
+
type: {
|
|
205
|
+
type: String,
|
|
206
|
+
default: 'primary'
|
|
207
|
+
},
|
|
208
|
+
/** 按钮尺寸:medium / small / mini */
|
|
209
|
+
size: {
|
|
210
|
+
type: String,
|
|
211
|
+
default: ''
|
|
212
|
+
},
|
|
213
|
+
/** 是否禁用 */
|
|
214
|
+
disabled: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: false
|
|
217
|
+
},
|
|
218
|
+
/** 是否加载中 */
|
|
219
|
+
loading: {
|
|
220
|
+
type: Boolean,
|
|
221
|
+
default: false
|
|
222
|
+
},
|
|
223
|
+
/** 图标类名 */
|
|
224
|
+
icon: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: ''
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
methods: {
|
|
230
|
+
handleClick(e) {
|
|
231
|
+
this.$emit('click', e);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
// CONCATENATED MODULE: ./src/components/DemoButton/index.vue?vue&type=script&lang=js
|
|
236
|
+
/* harmony default export */ var components_DemoButtonvue_type_script_lang_js = (DemoButtonvue_type_script_lang_js);
|
|
237
|
+
// EXTERNAL MODULE: ./src/components/DemoButton/index.vue?vue&type=style&index=0&id=1c0b7107&prod&lang=scss&scoped=true
|
|
238
|
+
var DemoButtonvue_type_style_index_0_id_1c0b7107_prod_lang_scss_scoped_true = __webpack_require__("021e");
|
|
239
|
+
|
|
240
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
241
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
242
|
+
|
|
243
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
244
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
245
|
+
// be included in the final webpack user bundle.
|
|
246
|
+
|
|
247
|
+
function normalizeComponent(
|
|
248
|
+
scriptExports,
|
|
249
|
+
render,
|
|
250
|
+
staticRenderFns,
|
|
251
|
+
functionalTemplate,
|
|
252
|
+
injectStyles,
|
|
253
|
+
scopeId,
|
|
254
|
+
moduleIdentifier /* server only */,
|
|
255
|
+
shadowMode /* vue-cli only */
|
|
256
|
+
) {
|
|
257
|
+
// Vue.extend constructor export interop
|
|
258
|
+
var options =
|
|
259
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
260
|
+
|
|
261
|
+
// render functions
|
|
262
|
+
if (render) {
|
|
263
|
+
options.render = render
|
|
264
|
+
options.staticRenderFns = staticRenderFns
|
|
265
|
+
options._compiled = true
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// functional template
|
|
269
|
+
if (functionalTemplate) {
|
|
270
|
+
options.functional = true
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// scopedId
|
|
274
|
+
if (scopeId) {
|
|
275
|
+
options._scopeId = 'data-v-' + scopeId
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
var hook
|
|
279
|
+
if (moduleIdentifier) {
|
|
280
|
+
// server build
|
|
281
|
+
hook = function (context) {
|
|
282
|
+
// 2.3 injection
|
|
283
|
+
context =
|
|
284
|
+
context || // cached call
|
|
285
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
286
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
287
|
+
// 2.2 with runInNewContext: true
|
|
288
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
289
|
+
context = __VUE_SSR_CONTEXT__
|
|
290
|
+
}
|
|
291
|
+
// inject component styles
|
|
292
|
+
if (injectStyles) {
|
|
293
|
+
injectStyles.call(this, context)
|
|
294
|
+
}
|
|
295
|
+
// register component module identifier for async chunk inferrence
|
|
296
|
+
if (context && context._registeredComponents) {
|
|
297
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// used by ssr in case component is cached and beforeCreate
|
|
301
|
+
// never gets called
|
|
302
|
+
options._ssrRegister = hook
|
|
303
|
+
} else if (injectStyles) {
|
|
304
|
+
hook = shadowMode
|
|
305
|
+
? function () {
|
|
306
|
+
injectStyles.call(
|
|
307
|
+
this,
|
|
308
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
: injectStyles
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (hook) {
|
|
315
|
+
if (options.functional) {
|
|
316
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
317
|
+
// go through the normalizer
|
|
318
|
+
options._injectStyles = hook
|
|
319
|
+
// register for functional component in vue file
|
|
320
|
+
var originalRender = options.render
|
|
321
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
322
|
+
hook.call(context)
|
|
323
|
+
return originalRender(h, context)
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
// inject component registration as beforeCreate hook
|
|
327
|
+
var existing = options.beforeCreate
|
|
328
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return {
|
|
333
|
+
exports: scriptExports,
|
|
334
|
+
options: options
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// CONCATENATED MODULE: ./src/components/DemoButton/index.vue
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
/* normalize component */
|
|
346
|
+
|
|
347
|
+
var component = normalizeComponent(
|
|
348
|
+
components_DemoButtonvue_type_script_lang_js,
|
|
349
|
+
render,
|
|
350
|
+
staticRenderFns,
|
|
351
|
+
false,
|
|
352
|
+
null,
|
|
353
|
+
"1c0b7107",
|
|
354
|
+
null
|
|
355
|
+
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
/* harmony default export */ var DemoButton = (component.exports);
|
|
359
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"53bb5eda-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/N20CopyText/index.vue?vue&type=template&id=540c418a&scoped=true
|
|
360
|
+
var N20CopyTextvue_type_template_id_540c418a_scoped_true_render = function render() {
|
|
361
|
+
var _vm = this,
|
|
362
|
+
_c = _vm._self._c;
|
|
363
|
+
return _c('span', {
|
|
364
|
+
staticClass: "n20-copy-text",
|
|
365
|
+
on: {
|
|
366
|
+
"click": function ($event) {
|
|
367
|
+
$event.stopPropagation();
|
|
368
|
+
return _vm.handleCopy.apply(null, arguments);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}, [_c('span', {
|
|
372
|
+
ref: "content",
|
|
373
|
+
staticClass: "n20-copy-text__content"
|
|
374
|
+
}, [_vm._t("default", function () {
|
|
375
|
+
return [_vm._v(_vm._s(_vm.text))];
|
|
376
|
+
})], 2), _vm.showIcon ? _c('i', {
|
|
377
|
+
class: ['n20-copy-text__icon', _vm.copied ? 'el-icon-check' : 'el-icon-document-copy'],
|
|
378
|
+
style: {
|
|
379
|
+
order: _vm.iconPosition === 'left' ? -1 : 1
|
|
380
|
+
}
|
|
381
|
+
}) : _vm._e(), _c('transition', {
|
|
382
|
+
attrs: {
|
|
383
|
+
"name": "n20-copy-fade"
|
|
384
|
+
}
|
|
385
|
+
}, [_vm.copied ? _c('span', {
|
|
386
|
+
staticClass: "n20-copy-text__tip"
|
|
387
|
+
}, [_vm._v(_vm._s(_vm.successTip))]) : _vm._e()])], 1);
|
|
388
|
+
};
|
|
389
|
+
var N20CopyTextvue_type_template_id_540c418a_scoped_true_staticRenderFns = [];
|
|
390
|
+
|
|
391
|
+
// CONCATENATED MODULE: ./src/components/N20CopyText/index.vue?vue&type=template&id=540c418a&scoped=true
|
|
392
|
+
|
|
393
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/N20CopyText/index.vue?vue&type=script&lang=js
|
|
394
|
+
/**
|
|
395
|
+
* N20CopyText - 点击复制文本组件
|
|
396
|
+
*
|
|
397
|
+
* 点击后将指定文本复制到剪贴板,显示成功反馈。
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* <N20CopyText :text="row.billNo">{{ row.billNo }}</N20CopyText>
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* <!-- 自动获取 slot 内容 -->
|
|
404
|
+
* <N20CopyText>BILL-2024-001</N20CopyText>
|
|
405
|
+
*/
|
|
406
|
+
/* harmony default export */ var N20CopyTextvue_type_script_lang_js = ({
|
|
407
|
+
name: 'N20CopyText',
|
|
408
|
+
props: {
|
|
409
|
+
/** 要复制的文本(默认取 slot 内文本) */
|
|
410
|
+
text: {
|
|
411
|
+
type: [String, Number],
|
|
412
|
+
default: ''
|
|
413
|
+
},
|
|
414
|
+
/** 复制成功提示文字 */
|
|
415
|
+
successTip: {
|
|
416
|
+
type: String,
|
|
417
|
+
default: '已复制'
|
|
418
|
+
},
|
|
419
|
+
/** 是否显示复制图标 */
|
|
420
|
+
showIcon: {
|
|
421
|
+
type: Boolean,
|
|
422
|
+
default: true
|
|
423
|
+
},
|
|
424
|
+
/** 图标位置 */
|
|
425
|
+
iconPosition: {
|
|
426
|
+
type: String,
|
|
427
|
+
default: 'right',
|
|
428
|
+
validator: v => ['left', 'right'].includes(v)
|
|
429
|
+
},
|
|
430
|
+
/** 是否禁用 */
|
|
431
|
+
disabled: {
|
|
432
|
+
type: Boolean,
|
|
433
|
+
default: false
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
data() {
|
|
437
|
+
return {
|
|
438
|
+
copied: false,
|
|
439
|
+
timer: null
|
|
440
|
+
};
|
|
441
|
+
},
|
|
442
|
+
beforeDestroy() {
|
|
443
|
+
clearTimeout(this.timer);
|
|
444
|
+
},
|
|
445
|
+
methods: {
|
|
446
|
+
async handleCopy() {
|
|
447
|
+
if (this.disabled || this.copied) return;
|
|
448
|
+
const copyText = this.text || this.$refs.content && this.$refs.content.innerText || '';
|
|
449
|
+
if (!copyText) return;
|
|
450
|
+
try {
|
|
451
|
+
if (navigator.clipboard && window.isSecureContext) {
|
|
452
|
+
await navigator.clipboard.writeText(String(copyText));
|
|
453
|
+
} else {
|
|
454
|
+
// fallback for HTTP or older browsers
|
|
455
|
+
const textarea = document.createElement('textarea');
|
|
456
|
+
textarea.value = String(copyText);
|
|
457
|
+
textarea.style.position = 'fixed';
|
|
458
|
+
textarea.style.left = '-9999px';
|
|
459
|
+
document.body.appendChild(textarea);
|
|
460
|
+
textarea.select();
|
|
461
|
+
document.execCommand('copy');
|
|
462
|
+
document.body.removeChild(textarea);
|
|
463
|
+
}
|
|
464
|
+
this.copied = true;
|
|
465
|
+
this.$emit('copy', String(copyText));
|
|
466
|
+
this.timer = setTimeout(() => {
|
|
467
|
+
this.copied = false;
|
|
468
|
+
}, 2000);
|
|
469
|
+
} catch (err) {
|
|
470
|
+
this.$emit('error', err);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
// CONCATENATED MODULE: ./src/components/N20CopyText/index.vue?vue&type=script&lang=js
|
|
476
|
+
/* harmony default export */ var components_N20CopyTextvue_type_script_lang_js = (N20CopyTextvue_type_script_lang_js);
|
|
477
|
+
// EXTERNAL MODULE: ./src/components/N20CopyText/index.vue?vue&type=style&index=0&id=540c418a&prod&lang=scss&scoped=true
|
|
478
|
+
var N20CopyTextvue_type_style_index_0_id_540c418a_prod_lang_scss_scoped_true = __webpack_require__("d72c");
|
|
479
|
+
|
|
480
|
+
// CONCATENATED MODULE: ./src/components/N20CopyText/index.vue
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
/* normalize component */
|
|
488
|
+
|
|
489
|
+
var N20CopyText_component = normalizeComponent(
|
|
490
|
+
components_N20CopyTextvue_type_script_lang_js,
|
|
491
|
+
N20CopyTextvue_type_template_id_540c418a_scoped_true_render,
|
|
492
|
+
N20CopyTextvue_type_template_id_540c418a_scoped_true_staticRenderFns,
|
|
493
|
+
false,
|
|
494
|
+
null,
|
|
495
|
+
"540c418a",
|
|
496
|
+
null
|
|
497
|
+
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
/* harmony default export */ var N20CopyText = (N20CopyText_component.exports);
|
|
501
|
+
// CONCATENATED MODULE: ./src/index.js
|
|
502
|
+
/**
|
|
503
|
+
* n20-project-component
|
|
504
|
+
* PC 端 Vue 2 + Element UI 组件库
|
|
505
|
+
*/
|
|
506
|
+
|
|
507
|
+
// ========== 组件导入 ==========
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
// ========== 组件列表 ==========
|
|
512
|
+
const components = {
|
|
513
|
+
DemoButton: DemoButton,
|
|
514
|
+
N20CopyText: N20CopyText
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
// ========== 按需导出 ==========
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
// ========== 全量注册(Vue.use)==========
|
|
521
|
+
const install = Vue => {
|
|
522
|
+
if (install.installed) return;
|
|
523
|
+
install.installed = true;
|
|
524
|
+
Object.values(components).forEach(component => {
|
|
525
|
+
Vue.component(component.name, component);
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// 支持通过 <script> 标签直接引入时自动注册
|
|
530
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
531
|
+
install(window.Vue);
|
|
532
|
+
}
|
|
533
|
+
/* harmony default export */ var src_0 = ({
|
|
534
|
+
install,
|
|
535
|
+
...components
|
|
536
|
+
});
|
|
537
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (src_0);
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
/***/ })
|
|
545
|
+
|
|
546
|
+
/******/ });
|
|
547
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["n20-project-component"]=e():t["n20-project-component"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"00be":function(t,e,n){},"021e":function(t,e,n){"use strict";n("f14e")},d72c:function(t,e,n){"use strict";n("00be")},f14e:function(t,e,n){},fb15:function(t,e,n){"use strict";if(n.r(e),n.d(e,"DemoButton",(function(){return d})),n.d(e,"N20CopyText",(function(){return h})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=function(){var t=this,e=t._self._c;return e("el-button",{staticClass:"n20-demo-button",attrs:{type:t.type,size:t.size,disabled:t.disabled,loading:t.loading,icon:t.icon},on:{click:t.handleClick}},[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)},c=[],s={name:"N20DemoButton",props:{text:{type:String,default:"按钮"},type:{type:String,default:"primary"},size:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""}},methods:{handleClick(t){this.$emit("click",t)}}},a=s;n("021e");function l(t,e,n,o,i,r,c,s){var a,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),o&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),c?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},l._ssrRegister=a):i&&(a=s?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(l.functional){l._injectStyles=a;var u=l.render;l.render=function(t,e){return a.call(e),u(t,e)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:l}}var u=l(a,r,c,!1,null,"1c0b7107",null),d=u.exports,f=function(){var t=this,e=t._self._c;return e("span",{staticClass:"n20-copy-text",on:{click:function(e){return e.stopPropagation(),t.handleCopy.apply(null,arguments)}}},[e("span",{ref:"content",staticClass:"n20-copy-text__content"},[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2),t.showIcon?e("i",{class:["n20-copy-text__icon",t.copied?"el-icon-check":"el-icon-document-copy"],style:{order:"left"===t.iconPosition?-1:1}}):t._e(),e("transition",{attrs:{name:"n20-copy-fade"}},[t.copied?e("span",{staticClass:"n20-copy-text__tip"},[t._v(t._s(t.successTip))]):t._e()])],1)},p=[],y={name:"N20CopyText",props:{text:{type:[String,Number],default:""},successTip:{type:String,default:"已复制"},showIcon:{type:Boolean,default:!0},iconPosition:{type:String,default:"right",validator:t=>["left","right"].includes(t)},disabled:{type:Boolean,default:!1}},data(){return{copied:!1,timer:null}},beforeDestroy(){clearTimeout(this.timer)},methods:{async handleCopy(){if(this.disabled||this.copied)return;const t=this.text||this.$refs.content&&this.$refs.content.innerText||"";if(t)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(String(t));else{const e=document.createElement("textarea");e.value=String(t),e.style.position="fixed",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}this.copied=!0,this.$emit("copy",String(t)),this.timer=setTimeout(()=>{this.copied=!1},2e3)}catch(e){this.$emit("error",e)}}}},m=y,_=(n("d72c"),l(m,f,p,!1,null,"540c418a",null)),h=_.exports;const b={DemoButton:d,N20CopyText:h},x=t=>{x.installed||(x.installed=!0,Object.values(b).forEach(e=>{t.component(e.name,e)}))};"undefined"!==typeof window&&window.Vue&&x(window.Vue);var v={install:x,...b};e["default"]=v}})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n20-project-component",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "PC 端 Vue 2 + Element UI 组件库",
|
|
5
|
+
"main": "dist/n20-project-component.umd.min.js",
|
|
6
|
+
"module": "dist/n20-project-component.common.js",
|
|
7
|
+
"style": "dist/n20-project-component.css",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vue-cli-service serve --open",
|
|
15
|
+
"build": "vue-cli-service build --target lib --name n20-project-component src/index.js",
|
|
16
|
+
"lint": "vue-cli-service lint",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"vue": "^2.6.0",
|
|
21
|
+
"element-ui": "^2.15.0"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
26
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
27
|
+
"@vue/cli-service": "~4.5.0",
|
|
28
|
+
"babel-eslint": "^10.1.0",
|
|
29
|
+
"core-js": "^3.6.5",
|
|
30
|
+
"element-ui": "^2.15.14",
|
|
31
|
+
"eslint": "^6.7.2",
|
|
32
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
33
|
+
"sass": "1.26.2",
|
|
34
|
+
"sass-loader": "8.0.2",
|
|
35
|
+
"vue": "^2.6.11",
|
|
36
|
+
"vue-template-compiler": "^2.6.11"
|
|
37
|
+
},
|
|
38
|
+
"eslintConfig": {
|
|
39
|
+
"root": true,
|
|
40
|
+
"env": {
|
|
41
|
+
"node": true
|
|
42
|
+
},
|
|
43
|
+
"extends": [
|
|
44
|
+
"plugin:vue/essential",
|
|
45
|
+
"eslint:recommended"
|
|
46
|
+
],
|
|
47
|
+
"parserOptions": {
|
|
48
|
+
"parser": "babel-eslint"
|
|
49
|
+
},
|
|
50
|
+
"rules": {}
|
|
51
|
+
},
|
|
52
|
+
"browserslist": [
|
|
53
|
+
"> 1%",
|
|
54
|
+
"last 2 versions",
|
|
55
|
+
"not dead"
|
|
56
|
+
],
|
|
57
|
+
"keywords": [
|
|
58
|
+
"vue2",
|
|
59
|
+
"element-ui",
|
|
60
|
+
"component-library",
|
|
61
|
+
"n20"
|
|
62
|
+
],
|
|
63
|
+
"author": "",
|
|
64
|
+
"license": "MIT"
|
|
65
|
+
}
|