@opentinyvue/vue-color-select-panel 3.25.0 → 3.26.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/lib/pc.js +141 -113
- package/package.json +11 -11
package/lib/pc.js
CHANGED
|
@@ -4,12 +4,10 @@ import { renderless as renderless$3, api as api$3 } from '@opentinyvue/vue-rende
|
|
|
4
4
|
import { defineComponent, setup, props, directive } from '@opentinyvue/vue-common';
|
|
5
5
|
import { renderless as renderless$1, api as api$1 } from '@opentinyvue/vue-renderless/color-select-panel/hue-select/vue';
|
|
6
6
|
import { api, renderless } from '@opentinyvue/vue-renderless/color-select-panel/sv-select/vue';
|
|
7
|
-
import { openBlock, createElementBlock, normalizeStyle, createElementVNode, resolveComponent, createVNode, resolveDirective, withDirectives, withModifiers, createBlock, createCommentVNode, withCtx, Fragment, renderList,
|
|
7
|
+
import { openBlock, createElementBlock, normalizeStyle, createElementVNode, resolveComponent, createVNode, resolveDirective, withDirectives, withModifiers, createBlock, createCommentVNode, withCtx, Fragment, renderList, toDisplayString, createTextVNode } from 'vue';
|
|
8
8
|
import { renderless as renderless$2, api as api$2 } from '@opentinyvue/vue-renderless/color-select-panel/alpha-select/vue';
|
|
9
9
|
import '@opentinyvue/vue-theme/color-select-panel/index.css';
|
|
10
10
|
import { Clickoutside } from '@opentinyvue/vue-directive';
|
|
11
|
-
import Collapse from '@opentinyvue/vue-collapse';
|
|
12
|
-
import CollapseItem from '@opentinyvue/vue-collapse-item';
|
|
13
11
|
import Select from '@opentinyvue/vue-select';
|
|
14
12
|
import Option from '@opentinyvue/vue-option';
|
|
15
13
|
|
|
@@ -153,12 +151,24 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
153
151
|
"div",
|
|
154
152
|
{
|
|
155
153
|
ref: "thumb",
|
|
154
|
+
class: "tiny-color-select-panel__inner__hue-select-thumb",
|
|
156
155
|
style: normalizeStyle({
|
|
157
|
-
|
|
158
|
-
transform: "
|
|
156
|
+
left: _ctx.state.thumbLeft + "px",
|
|
157
|
+
transform: "translateX(-50%)"
|
|
159
158
|
})
|
|
160
159
|
},
|
|
161
|
-
|
|
160
|
+
[createElementVNode(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
class: "tiny-color-select-panel__inner__hue-select-thumb-heart",
|
|
164
|
+
style: normalizeStyle({
|
|
165
|
+
background: _ctx.color.value
|
|
166
|
+
})
|
|
167
|
+
},
|
|
168
|
+
null,
|
|
169
|
+
4
|
|
170
|
+
/* STYLE */
|
|
171
|
+
)],
|
|
162
172
|
4
|
|
163
173
|
/* STYLE */
|
|
164
174
|
)],
|
|
@@ -211,13 +221,24 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
211
221
|
{
|
|
212
222
|
class: "tiny-color-select-panel__alpha__thumb",
|
|
213
223
|
style: normalizeStyle({
|
|
214
|
-
top:
|
|
224
|
+
top: "-2px",
|
|
215
225
|
left: _ctx.state.left + "px",
|
|
216
226
|
transform: "translateX(-50%)"
|
|
217
227
|
}),
|
|
218
228
|
ref: "alphaThumb"
|
|
219
229
|
},
|
|
220
|
-
|
|
230
|
+
[createElementVNode(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
class: "tiny-color-select-panel__inner__hue-select-thumb-heart",
|
|
234
|
+
style: normalizeStyle({
|
|
235
|
+
background: _ctx.color.value
|
|
236
|
+
})
|
|
237
|
+
},
|
|
238
|
+
null,
|
|
239
|
+
4
|
|
240
|
+
/* STYLE */
|
|
241
|
+
)],
|
|
221
242
|
4
|
|
222
243
|
/* STYLE */
|
|
223
244
|
)],
|
|
@@ -234,8 +255,6 @@ var _sfc_main = defineComponent({
|
|
|
234
255
|
AlphaSelect,
|
|
235
256
|
TinyButton: Button,
|
|
236
257
|
TinyInput: Input,
|
|
237
|
-
TinyCollapse: Collapse,
|
|
238
|
-
TinyCollapseItem: CollapseItem,
|
|
239
258
|
TinySelect: Select,
|
|
240
259
|
TinyOption: Option
|
|
241
260
|
},
|
|
@@ -252,30 +271,46 @@ var _sfc_main = defineComponent({
|
|
|
252
271
|
}
|
|
253
272
|
});
|
|
254
273
|
var _hoisted_1 = {
|
|
255
|
-
|
|
274
|
+
key: 1,
|
|
275
|
+
class: "tiny-color-select-panel__no-alpha"
|
|
256
276
|
};
|
|
257
277
|
var _hoisted_2 = {
|
|
258
|
-
|
|
259
|
-
class: "tiny-color-select-panel__tools__format-select"
|
|
278
|
+
class: "tiny-color-select-panel__tools"
|
|
260
279
|
};
|
|
261
280
|
var _hoisted_3 = {
|
|
262
|
-
|
|
281
|
+
key: 0,
|
|
282
|
+
class: "tiny-color-select-panel__tools__format-select"
|
|
263
283
|
};
|
|
264
284
|
var _hoisted_4 = {
|
|
285
|
+
class: "tiny-color-select-panel__tools-style"
|
|
286
|
+
};
|
|
287
|
+
var _hoisted_5 = {
|
|
265
288
|
key: 0,
|
|
266
|
-
class: "tiny-color-select-
|
|
289
|
+
class: "tiny-color-select-panel__tools-hex"
|
|
267
290
|
};
|
|
268
|
-
var _hoisted_5 = ["onClick"];
|
|
269
291
|
var _hoisted_6 = {
|
|
270
|
-
key: 1
|
|
292
|
+
key: 1,
|
|
293
|
+
class: "tiny-color-select-panel__tools-hex"
|
|
271
294
|
};
|
|
272
295
|
var _hoisted_7 = {
|
|
296
|
+
key: 2
|
|
297
|
+
};
|
|
298
|
+
var _hoisted_8 = {
|
|
273
299
|
key: 0,
|
|
300
|
+
class: "tiny-color-select-panel__history"
|
|
301
|
+
};
|
|
302
|
+
var _hoisted_9 = ["onClick"];
|
|
303
|
+
var _hoisted_10 = {
|
|
304
|
+
key: 3,
|
|
305
|
+
class: "tiny-color-select-panel__predefine-title"
|
|
306
|
+
};
|
|
307
|
+
var _hoisted_11 = {
|
|
308
|
+
key: 4,
|
|
274
309
|
class: "tiny-color-select-panel__predefine"
|
|
275
310
|
};
|
|
276
|
-
var
|
|
277
|
-
var
|
|
278
|
-
|
|
311
|
+
var _hoisted_12 = ["onClick"];
|
|
312
|
+
var _hoisted_13 = {
|
|
313
|
+
class: "tiny-color-select-panel__tools-btns"
|
|
279
314
|
};
|
|
280
315
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
281
316
|
var _component_hue_select = resolveComponent("hue-select");
|
|
@@ -284,13 +319,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
284
319
|
var _component_tiny_select = resolveComponent("tiny-select");
|
|
285
320
|
var _component_tiny_input = resolveComponent("tiny-input");
|
|
286
321
|
var _component_tiny_button = resolveComponent("tiny-button");
|
|
287
|
-
var _component_tiny_collapse_item = resolveComponent("tiny-collapse-item");
|
|
288
|
-
var _component_tiny_collapse = resolveComponent("tiny-collapse");
|
|
289
322
|
var _directive_clickoutside = resolveDirective("clickoutside");
|
|
290
323
|
return _ctx.state.showPicker ? withDirectives((openBlock(), createElementBlock("div", {
|
|
291
324
|
key: 0,
|
|
292
325
|
class: "tiny-color-select-panel",
|
|
293
|
-
onClick: _cache[
|
|
326
|
+
onClick: _cache[6] || (_cache[6] = withModifiers(function() {
|
|
294
327
|
}, ["stop"]))
|
|
295
328
|
}, [createVNode(_component_hue_select, {
|
|
296
329
|
color: _ctx.state.color,
|
|
@@ -300,7 +333,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
300
333
|
key: 0,
|
|
301
334
|
color: _ctx.state.color,
|
|
302
335
|
onReady: _ctx.onAlphaReady
|
|
303
|
-
}, null, 8, ["color", "onReady"])) : createCommentVNode("v-if", true),
|
|
336
|
+
}, null, 8, ["color", "onReady"])) : createCommentVNode("v-if", true), !_ctx.alpha ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("v-if", true), createElementVNode(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
class: "tiny-color-select-panel__display",
|
|
340
|
+
style: normalizeStyle({
|
|
341
|
+
background: _ctx.state.color.value
|
|
342
|
+
})
|
|
343
|
+
},
|
|
344
|
+
null,
|
|
345
|
+
4
|
|
346
|
+
/* STYLE */
|
|
347
|
+
), createElementVNode("div", _hoisted_2, [_ctx.state.formats.length ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(_component_tiny_select, {
|
|
304
348
|
modelValue: _ctx.state.currentFormat,
|
|
305
349
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
|
|
306
350
|
return _ctx.state.currentFormat = $event;
|
|
@@ -324,28 +368,79 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
324
368
|
}),
|
|
325
369
|
_: 1
|
|
326
370
|
/* STABLE */
|
|
327
|
-
}, 8, ["modelValue"])])) : createCommentVNode("v-if", true), createVNode(_component_tiny_input, {
|
|
371
|
+
}, 8, ["modelValue"])])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_4, [_ctx.state.currentFormat === "hex" || _ctx.state.currentFormat === "css" || !_ctx.state.currentFormat ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(_component_tiny_input, {
|
|
372
|
+
class: "tiny-color-select-panel__tools-hex1",
|
|
328
373
|
modelValue: _ctx.state.input,
|
|
329
374
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
|
|
330
375
|
return _ctx.state.input = $event;
|
|
376
|
+
})
|
|
377
|
+
}, null, 8, ["modelValue"])])) : (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_tiny_input, {
|
|
378
|
+
class: "tiny-color-select-panel__tools-hex4",
|
|
379
|
+
modelValue: _ctx.state.hexInput4,
|
|
380
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = function($event) {
|
|
381
|
+
return _ctx.state.hexInput4 = $event;
|
|
382
|
+
})
|
|
383
|
+
}, null, 8, ["modelValue"]), createVNode(_component_tiny_input, {
|
|
384
|
+
class: "tiny-color-select-panel__tools-hex5",
|
|
385
|
+
modelValue: _ctx.state.hexInput5,
|
|
386
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = function($event) {
|
|
387
|
+
return _ctx.state.hexInput5 = $event;
|
|
388
|
+
})
|
|
389
|
+
}, null, 8, ["modelValue"]), createVNode(_component_tiny_input, {
|
|
390
|
+
class: "tiny-color-select-panel__tools-hex6",
|
|
391
|
+
modelValue: _ctx.state.hexInput6,
|
|
392
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = function($event) {
|
|
393
|
+
return _ctx.state.hexInput6 = $event;
|
|
394
|
+
})
|
|
395
|
+
}, null, 8, ["modelValue"]), createVNode(_component_tiny_input, {
|
|
396
|
+
class: "tiny-color-select-panel__tools-hex7",
|
|
397
|
+
modelValue: _ctx.state.hexInput7,
|
|
398
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = function($event) {
|
|
399
|
+
return _ctx.state.hexInput7 = $event;
|
|
400
|
+
})
|
|
401
|
+
}, null, 8, ["modelValue"])]))])]), _ctx.state.enableHistory ? (openBlock(), createElementBlock("div", _hoisted_7, [_ctx.state.enableHistory && _ctx.state.stack.length ? (openBlock(), createElementBlock("div", _hoisted_8, [(openBlock(true), createElementBlock(
|
|
402
|
+
Fragment,
|
|
403
|
+
null,
|
|
404
|
+
renderList(_ctx.state.stack, function(color, key) {
|
|
405
|
+
return openBlock(), createElementBlock("div", {
|
|
406
|
+
class: "tiny-color-select-panel__history__color-block",
|
|
407
|
+
key,
|
|
408
|
+
style: normalizeStyle({
|
|
409
|
+
background: color
|
|
410
|
+
}),
|
|
411
|
+
onClick: function onClick() {
|
|
412
|
+
return _ctx.onHistoryClick(color);
|
|
413
|
+
}
|
|
414
|
+
}, null, 12, _hoisted_9);
|
|
331
415
|
}),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
416
|
+
128
|
|
417
|
+
/* KEYED_FRAGMENT */
|
|
418
|
+
))])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true), _ctx.state.enablePredefineColor ? (openBlock(), createElementBlock(
|
|
419
|
+
"div",
|
|
420
|
+
_hoisted_10,
|
|
421
|
+
toDisplayString(_ctx.t("ui.colorSelectPanel.predefine")),
|
|
422
|
+
1
|
|
423
|
+
/* TEXT */
|
|
424
|
+
)) : createCommentVNode("v-if", true), _ctx.state.enablePredefineColor && _ctx.state.predefineStack.length ? (openBlock(), createElementBlock("div", _hoisted_11, [(openBlock(true), createElementBlock(
|
|
425
|
+
Fragment,
|
|
426
|
+
null,
|
|
427
|
+
renderList(_ctx.state.predefineStack, function(color, key) {
|
|
428
|
+
return openBlock(), createElementBlock("div", {
|
|
429
|
+
class: "tiny-color-select-panel__predefine__color-block",
|
|
430
|
+
key,
|
|
431
|
+
style: normalizeStyle({
|
|
432
|
+
background: color
|
|
433
|
+
}),
|
|
434
|
+
onClick: function onClick() {
|
|
435
|
+
return _ctx.onPredefineColorClick(color);
|
|
436
|
+
}
|
|
437
|
+
}, null, 12, _hoisted_12);
|
|
343
438
|
}),
|
|
344
|
-
|
|
345
|
-
/*
|
|
346
|
-
|
|
347
|
-
type: "primary",
|
|
439
|
+
128
|
|
440
|
+
/* KEYED_FRAGMENT */
|
|
441
|
+
))])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_13, [createVNode(_component_tiny_button, {
|
|
348
442
|
size: "small",
|
|
443
|
+
type: "primary",
|
|
349
444
|
onClick: _ctx.onConfirm
|
|
350
445
|
}, {
|
|
351
446
|
default: withCtx(function() {
|
|
@@ -357,79 +452,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
357
452
|
}),
|
|
358
453
|
_: 1
|
|
359
454
|
/* STABLE */
|
|
360
|
-
}, 8, ["onClick"])
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}, {
|
|
367
|
-
default: withCtx(function() {
|
|
368
|
-
return [_ctx.state.stack.length ? (openBlock(), createElementBlock("div", _hoisted_4, [(openBlock(true), createElementBlock(
|
|
369
|
-
Fragment,
|
|
370
|
-
null,
|
|
371
|
-
renderList(_ctx.state.stack, function(color, key) {
|
|
372
|
-
return openBlock(), createElementBlock("div", {
|
|
373
|
-
class: "tiny-color-select-panel__history__color-block",
|
|
374
|
-
key,
|
|
375
|
-
style: normalizeStyle({
|
|
376
|
-
background: color
|
|
377
|
-
}),
|
|
378
|
-
onClick: function onClick() {
|
|
379
|
-
return _ctx.onHistoryClick(color);
|
|
380
|
-
}
|
|
381
|
-
}, null, 12, _hoisted_5);
|
|
382
|
-
}),
|
|
383
|
-
128
|
|
384
|
-
/* KEYED_FRAGMENT */
|
|
385
|
-
))])) : createCommentVNode("v-if", true), !_ctx.state.stack.length ? (openBlock(), createElementBlock(
|
|
386
|
-
"div",
|
|
387
|
-
_hoisted_6,
|
|
388
|
-
toDisplayString(_ctx.t("ui.colorSelectPanel.empty")),
|
|
389
|
-
1
|
|
390
|
-
/* TEXT */
|
|
391
|
-
)) : createCommentVNode("v-if", true)];
|
|
392
|
-
}),
|
|
393
|
-
_: 1
|
|
394
|
-
/* STABLE */
|
|
395
|
-
}, 8, ["title"])) : createCommentVNode("v-if", true), _ctx.state.enablePredefineColor ? (openBlock(), createBlock(_component_tiny_collapse_item, {
|
|
396
|
-
key: 1,
|
|
397
|
-
title: _ctx.t("ui.colorSelectPanel.predefine"),
|
|
398
|
-
name: "predefine"
|
|
399
|
-
}, {
|
|
400
|
-
default: withCtx(function() {
|
|
401
|
-
return [_ctx.state.predefineStack.length ? (openBlock(), createElementBlock("div", _hoisted_7, [(openBlock(true), createElementBlock(
|
|
402
|
-
Fragment,
|
|
403
|
-
null,
|
|
404
|
-
renderList(_ctx.state.predefineStack, function(color, key) {
|
|
405
|
-
return openBlock(), createElementBlock("div", {
|
|
406
|
-
class: "tiny-color-select-panel__predefine__color-block",
|
|
407
|
-
key,
|
|
408
|
-
style: normalizeStyle({
|
|
409
|
-
background: color
|
|
410
|
-
}),
|
|
411
|
-
onClick: function onClick() {
|
|
412
|
-
return _ctx.onPredefineColorClick(color);
|
|
413
|
-
}
|
|
414
|
-
}, null, 12, _hoisted_8);
|
|
415
|
-
}),
|
|
416
|
-
128
|
|
417
|
-
/* KEYED_FRAGMENT */
|
|
418
|
-
))])) : createCommentVNode("v-if", true), !_ctx.state.predefineStack.length ? (openBlock(), createElementBlock(
|
|
419
|
-
"div",
|
|
420
|
-
_hoisted_9,
|
|
421
|
-
toDisplayString(_ctx.t("ui.colorSelectPanel.empty")),
|
|
422
|
-
1
|
|
423
|
-
/* TEXT */
|
|
424
|
-
)) : createCommentVNode("v-if", true)];
|
|
425
|
-
}),
|
|
426
|
-
_: 1
|
|
427
|
-
/* STABLE */
|
|
428
|
-
}, 8, ["title"])) : createCommentVNode("v-if", true)];
|
|
429
|
-
}),
|
|
430
|
-
_: 1
|
|
431
|
-
/* STABLE */
|
|
432
|
-
})])), [[_directive_clickoutside, _ctx.onClickOutside]]) : createCommentVNode("v-if", true);
|
|
455
|
+
}, 8, ["onClick"]), createVNode(_component_tiny_button, {
|
|
456
|
+
type: "text",
|
|
457
|
+
text: _ctx.t("ui.colorSelectPanel.cancel"),
|
|
458
|
+
size: "small",
|
|
459
|
+
onClick: _ctx.onCancel
|
|
460
|
+
}, null, 8, ["text", "onClick"])])])), [[_directive_clickoutside, _ctx.onClickOutside]]) : createCommentVNode("v-if", true);
|
|
433
461
|
}
|
|
434
462
|
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
435
463
|
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-color-select-panel",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.26.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"module": "./lib/index.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opentinyvue/vue-button": "~3.
|
|
12
|
-
"@opentinyvue/vue-collapse": "~3.
|
|
13
|
-
"@opentinyvue/vue-collapse-item": "~3.
|
|
14
|
-
"@opentinyvue/vue-common": "~3.
|
|
15
|
-
"@opentinyvue/vue-directive": "~3.
|
|
16
|
-
"@opentinyvue/vue-input": "~3.
|
|
17
|
-
"@opentinyvue/vue-option": "~3.
|
|
18
|
-
"@opentinyvue/vue-renderless": "~3.
|
|
19
|
-
"@opentinyvue/vue-select": "~3.
|
|
20
|
-
"@opentinyvue/vue-theme": "~3.
|
|
11
|
+
"@opentinyvue/vue-button": "~3.26.0",
|
|
12
|
+
"@opentinyvue/vue-collapse": "~3.26.0",
|
|
13
|
+
"@opentinyvue/vue-collapse-item": "~3.26.0",
|
|
14
|
+
"@opentinyvue/vue-common": "~3.26.0",
|
|
15
|
+
"@opentinyvue/vue-directive": "~3.26.0",
|
|
16
|
+
"@opentinyvue/vue-input": "~3.26.0",
|
|
17
|
+
"@opentinyvue/vue-option": "~3.26.0",
|
|
18
|
+
"@opentinyvue/vue-renderless": "~3.26.0",
|
|
19
|
+
"@opentinyvue/vue-select": "~3.26.0",
|
|
20
|
+
"@opentinyvue/vue-theme": "~3.26.0"
|
|
21
21
|
},
|
|
22
22
|
"types": "index.d.ts"
|
|
23
23
|
}
|