@web-utils/component 3.0.1 → 3.0.2
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/index.mjs +477 -480
- package/package.json +1 -1
- package/web-types.json +1 -85
- package/color-picker/index.mjs +0 -296
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@web-utils/component",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.2",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -497,90 +497,6 @@
|
|
|
497
497
|
}
|
|
498
498
|
]
|
|
499
499
|
},
|
|
500
|
-
{
|
|
501
|
-
"name": "ColorPicker",
|
|
502
|
-
"description": "",
|
|
503
|
-
"attributes": [
|
|
504
|
-
{
|
|
505
|
-
"name": "popperClass",
|
|
506
|
-
"value": {
|
|
507
|
-
"kind": "expression",
|
|
508
|
-
"type": "string"
|
|
509
|
-
},
|
|
510
|
-
"default": ""
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
"name": "predefine",
|
|
514
|
-
"value": {
|
|
515
|
-
"kind": "expression",
|
|
516
|
-
"type": "array"
|
|
517
|
-
},
|
|
518
|
-
"default": ""
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
"name": "visible",
|
|
522
|
-
"value": {
|
|
523
|
-
"kind": "expression",
|
|
524
|
-
"type": "boolean"
|
|
525
|
-
},
|
|
526
|
-
"default": ""
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"name": "hideOnClickOutside",
|
|
530
|
-
"value": {
|
|
531
|
-
"kind": "expression",
|
|
532
|
-
"type": "boolean"
|
|
533
|
-
},
|
|
534
|
-
"default": "true"
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
"name": "value",
|
|
538
|
-
"value": {
|
|
539
|
-
"kind": "expression",
|
|
540
|
-
"type": "string"
|
|
541
|
-
},
|
|
542
|
-
"default": ""
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
"name": "offset",
|
|
546
|
-
"value": {
|
|
547
|
-
"kind": "expression",
|
|
548
|
-
"type": "number"
|
|
549
|
-
},
|
|
550
|
-
"default": ""
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
"name": "anchor",
|
|
554
|
-
"value": {
|
|
555
|
-
"kind": "expression",
|
|
556
|
-
"type": "HTMLElement"
|
|
557
|
-
},
|
|
558
|
-
"default": ""
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
"name": "appendToBody",
|
|
562
|
-
"value": {
|
|
563
|
-
"kind": "expression",
|
|
564
|
-
"type": "boolean"
|
|
565
|
-
},
|
|
566
|
-
"default": "true"
|
|
567
|
-
}
|
|
568
|
-
],
|
|
569
|
-
"events": [
|
|
570
|
-
{
|
|
571
|
-
"name": "pick"
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
"name": "clear"
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
"name": "input"
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
"name": "update:visible"
|
|
581
|
-
}
|
|
582
|
-
]
|
|
583
|
-
},
|
|
584
500
|
{
|
|
585
501
|
"name": "Comment",
|
|
586
502
|
"description": "",
|
package/color-picker/index.mjs
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
var a = (e, t, o) => new Promise((r, s) => {
|
|
2
|
-
var m = (i) => {
|
|
3
|
-
try {
|
|
4
|
-
n(o.next(i));
|
|
5
|
-
} catch (l) {
|
|
6
|
-
s(l);
|
|
7
|
-
}
|
|
8
|
-
}, h = (i) => {
|
|
9
|
-
try {
|
|
10
|
-
n(o.throw(i));
|
|
11
|
-
} catch (l) {
|
|
12
|
-
s(l);
|
|
13
|
-
}
|
|
14
|
-
}, n = (i) => i.done ? r(i.value) : Promise.resolve(i.value).then(m, h);
|
|
15
|
-
n((o = o.apply(e, t)).next());
|
|
16
|
-
});
|
|
17
|
-
import f from "element-ui/packages/color-picker/src/color";
|
|
18
|
-
import _ from "element-ui/src/utils/clickoutside";
|
|
19
|
-
import v from "element-ui/packages/color-picker/src/components/sv-panel";
|
|
20
|
-
import k from "element-ui/packages/color-picker/src/components/hue-slider";
|
|
21
|
-
import w from "element-ui/packages/color-picker/src/components/alpha-slider";
|
|
22
|
-
import C from "element-ui/packages/color-picker/src/components/predefine";
|
|
23
|
-
import $ from "element-ui/src/utils/vue-popper";
|
|
24
|
-
import y from "element-ui/src/mixins/locale";
|
|
25
|
-
import c from "element-ui/lib/button";
|
|
26
|
-
import P from "element-ui/lib/input";
|
|
27
|
-
import { n as d } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
28
|
-
var x = function() {
|
|
29
|
-
var e = this, t = e.$createElement, o = e._self._c || t;
|
|
30
|
-
return o("Transition", {
|
|
31
|
-
attrs: {
|
|
32
|
-
name: "el-zoom-in-top"
|
|
33
|
-
},
|
|
34
|
-
on: {
|
|
35
|
-
"after-leave": e.doDestroy
|
|
36
|
-
}
|
|
37
|
-
}, [o("div", {
|
|
38
|
-
directives: [{
|
|
39
|
-
name: "show",
|
|
40
|
-
rawName: "v-show",
|
|
41
|
-
value: e.showPopper,
|
|
42
|
-
expression: "showPopper"
|
|
43
|
-
}],
|
|
44
|
-
staticClass: "el-color-dropdown"
|
|
45
|
-
}, [o("div", {
|
|
46
|
-
staticClass: "el-color-dropdown__main-wrapper"
|
|
47
|
-
}, [o("HueSlider", {
|
|
48
|
-
ref: "hue",
|
|
49
|
-
staticStyle: {
|
|
50
|
-
float: "right"
|
|
51
|
-
},
|
|
52
|
-
attrs: {
|
|
53
|
-
color: e.color,
|
|
54
|
-
vertical: ""
|
|
55
|
-
}
|
|
56
|
-
}), o("SvPanel", {
|
|
57
|
-
ref: "sl",
|
|
58
|
-
attrs: {
|
|
59
|
-
color: e.color
|
|
60
|
-
}
|
|
61
|
-
})], 1), e.showAlpha ? o("AlphaSlider", {
|
|
62
|
-
ref: "alpha",
|
|
63
|
-
attrs: {
|
|
64
|
-
color: e.color
|
|
65
|
-
}
|
|
66
|
-
}) : e._e(), e.predefine ? o("Predefine", {
|
|
67
|
-
attrs: {
|
|
68
|
-
color: e.color,
|
|
69
|
-
colors: e.predefine
|
|
70
|
-
}
|
|
71
|
-
}) : e._e(), o("div", {
|
|
72
|
-
staticClass: "el-color-dropdown__btns"
|
|
73
|
-
}, [o("span", {
|
|
74
|
-
staticClass: "el-color-dropdown__value"
|
|
75
|
-
}, [o(P, {
|
|
76
|
-
attrs: {
|
|
77
|
-
"validate-event": !1,
|
|
78
|
-
size: "mini"
|
|
79
|
-
},
|
|
80
|
-
on: {
|
|
81
|
-
blur: e.handleConfirm
|
|
82
|
-
},
|
|
83
|
-
nativeOn: {
|
|
84
|
-
keyup: function(r) {
|
|
85
|
-
return !r.type.indexOf("key") && e._k(r.keyCode, "enter", 13, r.key, "Enter") ? null : e.handleConfirm.apply(null, arguments);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
model: {
|
|
89
|
-
value: e.customInput,
|
|
90
|
-
callback: function(r) {
|
|
91
|
-
e.customInput = r;
|
|
92
|
-
},
|
|
93
|
-
expression: "customInput"
|
|
94
|
-
}
|
|
95
|
-
})], 1), o(c, {
|
|
96
|
-
staticClass: "el-color-dropdown__link-btn",
|
|
97
|
-
attrs: {
|
|
98
|
-
size: "mini",
|
|
99
|
-
type: "text"
|
|
100
|
-
},
|
|
101
|
-
on: {
|
|
102
|
-
click: function(r) {
|
|
103
|
-
return e.$emit("clear");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}, [e._v(" " + e._s(e.t("el.colorpicker.clear")) + " ")]), o(c, {
|
|
107
|
-
staticClass: "el-color-dropdown__btn",
|
|
108
|
-
attrs: {
|
|
109
|
-
plain: "",
|
|
110
|
-
size: "mini"
|
|
111
|
-
},
|
|
112
|
-
on: {
|
|
113
|
-
click: e.confirmValue
|
|
114
|
-
}
|
|
115
|
-
}, [e._v(" " + e._s(e.t("el.colorpicker.confirm")) + " ")])], 1)], 1)]);
|
|
116
|
-
}, b = [];
|
|
117
|
-
const S = {
|
|
118
|
-
name: "ElColorPickerDropdown",
|
|
119
|
-
components: {
|
|
120
|
-
SvPanel: v,
|
|
121
|
-
HueSlider: k,
|
|
122
|
-
AlphaSlider: w,
|
|
123
|
-
Predefine: C
|
|
124
|
-
},
|
|
125
|
-
mixins: [$, y],
|
|
126
|
-
props: {
|
|
127
|
-
color: {
|
|
128
|
-
type: Object,
|
|
129
|
-
required: !0
|
|
130
|
-
},
|
|
131
|
-
showAlpha: Boolean,
|
|
132
|
-
predefine: Array
|
|
133
|
-
},
|
|
134
|
-
data() {
|
|
135
|
-
return {
|
|
136
|
-
customInput: ""
|
|
137
|
-
};
|
|
138
|
-
},
|
|
139
|
-
computed: {
|
|
140
|
-
currentColor() {
|
|
141
|
-
const e = this.$parent;
|
|
142
|
-
return !e.value && !e.showPanelColor ? "" : e.color.value;
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
watch: {
|
|
146
|
-
showPopper(e) {
|
|
147
|
-
e === !0 && this.$nextTick(() => {
|
|
148
|
-
const { sl: t, hue: o, alpha: r } = this.$refs;
|
|
149
|
-
t && t.update(), o && o.update(), r && r.update();
|
|
150
|
-
});
|
|
151
|
-
},
|
|
152
|
-
currentColor: {
|
|
153
|
-
immediate: !0,
|
|
154
|
-
handler(e) {
|
|
155
|
-
this.customInput = e;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
mounted() {
|
|
160
|
-
this.$parent.popperElm = this.popperElm = this.$el, this.referenceElm = this.$parent.$el;
|
|
161
|
-
},
|
|
162
|
-
methods: {
|
|
163
|
-
confirmValue() {
|
|
164
|
-
this.$emit("pick");
|
|
165
|
-
},
|
|
166
|
-
handleConfirm() {
|
|
167
|
-
this.color.fromString(this.customInput);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}, p = {};
|
|
171
|
-
var O = /* @__PURE__ */ d(
|
|
172
|
-
S,
|
|
173
|
-
x,
|
|
174
|
-
b,
|
|
175
|
-
!1,
|
|
176
|
-
g,
|
|
177
|
-
null,
|
|
178
|
-
null,
|
|
179
|
-
null
|
|
180
|
-
);
|
|
181
|
-
function g(e) {
|
|
182
|
-
for (let t in p)
|
|
183
|
-
this[t] = p[t];
|
|
184
|
-
}
|
|
185
|
-
const E = /* @__PURE__ */ function() {
|
|
186
|
-
return O.exports;
|
|
187
|
-
}();
|
|
188
|
-
var I = function() {
|
|
189
|
-
var e = this, t = e.$createElement, o = e._self._c || t;
|
|
190
|
-
return o(E, {
|
|
191
|
-
directives: [{
|
|
192
|
-
name: "clickoutside",
|
|
193
|
-
rawName: "v-clickoutside",
|
|
194
|
-
value: e.onClickOutside,
|
|
195
|
-
expression: "onClickOutside"
|
|
196
|
-
}],
|
|
197
|
-
ref: "dropdown",
|
|
198
|
-
class: ["el-color-picker__panel", e.popperClass || ""],
|
|
199
|
-
attrs: {
|
|
200
|
-
offset: e.offset,
|
|
201
|
-
"append-to-body": e.appendToBody,
|
|
202
|
-
color: e.color,
|
|
203
|
-
predefine: e.predefine
|
|
204
|
-
},
|
|
205
|
-
on: {
|
|
206
|
-
pick: e.confirmValue,
|
|
207
|
-
clear: e.clearValue
|
|
208
|
-
},
|
|
209
|
-
model: {
|
|
210
|
-
value: e.showPicker,
|
|
211
|
-
callback: function(r) {
|
|
212
|
-
e.showPicker = r;
|
|
213
|
-
},
|
|
214
|
-
expression: "showPicker"
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}, A = [];
|
|
218
|
-
const B = {
|
|
219
|
-
name: "ColorPicker",
|
|
220
|
-
directives: { Clickoutside: _ },
|
|
221
|
-
props: {
|
|
222
|
-
popperClass: String,
|
|
223
|
-
predefine: Array,
|
|
224
|
-
visible: Boolean,
|
|
225
|
-
hideOnClickOutside: {
|
|
226
|
-
type: Boolean,
|
|
227
|
-
default: !0
|
|
228
|
-
},
|
|
229
|
-
value: String,
|
|
230
|
-
offset: Number,
|
|
231
|
-
anchor: HTMLElement,
|
|
232
|
-
appendToBody: {
|
|
233
|
-
type: Boolean,
|
|
234
|
-
default: !0
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
data() {
|
|
238
|
-
return {
|
|
239
|
-
color: new f({ enableAlpha: !1 }),
|
|
240
|
-
showPicker: !1
|
|
241
|
-
};
|
|
242
|
-
},
|
|
243
|
-
watch: {
|
|
244
|
-
value: {
|
|
245
|
-
immediate: !0,
|
|
246
|
-
handler(e) {
|
|
247
|
-
e && e !== this.color.value && this.color.fromString(e);
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
visible: {
|
|
251
|
-
immediate: !0,
|
|
252
|
-
handler(e) {
|
|
253
|
-
return a(this, null, function* () {
|
|
254
|
-
e ? (yield this.$nextTick(), this.$refs.dropdown.referenceElm = this.anchor) : this.$refs.dropdown && this.$refs.dropdown.doDestroy(!0), this.showPicker = e;
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
methods: {
|
|
260
|
-
confirmValue() {
|
|
261
|
-
this.emitInput(this.color), this.$emit("pick", this.color.value), this.hide();
|
|
262
|
-
},
|
|
263
|
-
clearValue() {
|
|
264
|
-
this.$emit("clear"), this.hide();
|
|
265
|
-
},
|
|
266
|
-
emitInput(e) {
|
|
267
|
-
this.$emit("input", e.value);
|
|
268
|
-
},
|
|
269
|
-
onClickOutside() {
|
|
270
|
-
this.hideOnClickOutside && this.hide();
|
|
271
|
-
},
|
|
272
|
-
hide() {
|
|
273
|
-
this.$emit("update:visible", !1);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}, u = {};
|
|
277
|
-
var T = /* @__PURE__ */ d(
|
|
278
|
-
B,
|
|
279
|
-
I,
|
|
280
|
-
A,
|
|
281
|
-
!1,
|
|
282
|
-
z,
|
|
283
|
-
null,
|
|
284
|
-
null,
|
|
285
|
-
null
|
|
286
|
-
);
|
|
287
|
-
function z(e) {
|
|
288
|
-
for (let t in u)
|
|
289
|
-
this[t] = u[t];
|
|
290
|
-
}
|
|
291
|
-
const K = /* @__PURE__ */ function() {
|
|
292
|
-
return T.exports;
|
|
293
|
-
}();
|
|
294
|
-
export {
|
|
295
|
-
K as default
|
|
296
|
-
};
|