@opentinyvue/vue-color-select-panel 3.24.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.
Files changed (2) hide show
  1. package/lib/pc.js +143 -114
  2. 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, createTextVNode, toDisplayString } from 'vue';
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
- top: _ctx.state.thumbTop + "px",
158
- transform: "translateY(-50%)"
156
+ left: _ctx.state.thumbLeft + "px",
157
+ transform: "translateX(-50%)"
159
158
  })
160
159
  },
161
- null,
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: 0,
224
+ top: "-2px",
215
225
  left: _ctx.state.left + "px",
216
226
  transform: "translateX(-50%)"
217
227
  }),
218
228
  ref: "alphaThumb"
219
229
  },
220
- null,
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
- class: "tiny-color-select-panel__tools"
274
+ key: 1,
275
+ class: "tiny-color-select-panel__no-alpha"
256
276
  };
257
277
  var _hoisted_2 = {
258
- key: 0,
259
- class: "tiny-color-select-panel__tools__format-select"
278
+ class: "tiny-color-select-panel__tools"
260
279
  };
261
280
  var _hoisted_3 = {
262
- class: "tiny-color-select-panel__tools-btns"
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-panel__history"
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 _hoisted_8 = ["onClick"];
277
- var _hoisted_9 = {
278
- key: 1
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[2] || (_cache[2] = withModifiers(function() {
326
+ onClick: _cache[6] || (_cache[6] = withModifiers(function() {
294
327
  }, ["stop"]))
295
328
  }, [createVNode(_component_hue_select, {
296
329
  color: _ctx.state.color,
@@ -300,11 +333,23 @@ 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), createElementVNode("div", _hoisted_1, [_ctx.state.formats.length ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(_component_tiny_select, {
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;
307
- })
351
+ }),
352
+ size: "small"
308
353
  }, {
309
354
  default: withCtx(function() {
310
355
  return [(openBlock(true), createElementBlock(
@@ -323,28 +368,79 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
323
368
  }),
324
369
  _: 1
325
370
  /* STABLE */
326
- }, 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",
327
373
  modelValue: _ctx.state.input,
328
374
  "onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
329
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);
330
415
  }),
331
- size: "small"
332
- }, null, 8, ["modelValue"]), createElementVNode("div", _hoisted_3, [createVNode(_component_tiny_button, {
333
- size: "small",
334
- onClick: _ctx.onCancel
335
- }, {
336
- default: withCtx(function() {
337
- return [createTextVNode(
338
- toDisplayString(_ctx.t("ui.colorSelectPanel.cancel")),
339
- 1
340
- /* TEXT */
341
- )];
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);
342
438
  }),
343
- _: 1
344
- /* STABLE */
345
- }, 8, ["onClick"]), createVNode(_component_tiny_button, {
346
- type: "primary",
439
+ 128
440
+ /* KEYED_FRAGMENT */
441
+ ))])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_13, [createVNode(_component_tiny_button, {
347
442
  size: "small",
443
+ type: "primary",
348
444
  onClick: _ctx.onConfirm
349
445
  }, {
350
446
  default: withCtx(function() {
@@ -356,79 +452,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
356
452
  }),
357
453
  _: 1
358
454
  /* STABLE */
359
- }, 8, ["onClick"])])]), createVNode(_component_tiny_collapse, null, {
360
- default: withCtx(function() {
361
- return [_ctx.state.enableHistory ? (openBlock(), createBlock(_component_tiny_collapse_item, {
362
- key: 0,
363
- title: _ctx.t("ui.colorSelectPanel.history"),
364
- name: "history"
365
- }, {
366
- default: withCtx(function() {
367
- return [_ctx.state.stack.length ? (openBlock(), createElementBlock("div", _hoisted_4, [(openBlock(true), createElementBlock(
368
- Fragment,
369
- null,
370
- renderList(_ctx.state.stack, function(color, key) {
371
- return openBlock(), createElementBlock("div", {
372
- class: "tiny-color-select-panel__history__color-block",
373
- key,
374
- style: normalizeStyle({
375
- background: color
376
- }),
377
- onClick: function onClick() {
378
- return _ctx.onHistoryClick(color);
379
- }
380
- }, null, 12, _hoisted_5);
381
- }),
382
- 128
383
- /* KEYED_FRAGMENT */
384
- ))])) : createCommentVNode("v-if", true), !_ctx.state.stack.length ? (openBlock(), createElementBlock(
385
- "div",
386
- _hoisted_6,
387
- toDisplayString(_ctx.t("ui.colorSelectPanel.empty")),
388
- 1
389
- /* TEXT */
390
- )) : createCommentVNode("v-if", true)];
391
- }),
392
- _: 1
393
- /* STABLE */
394
- }, 8, ["title"])) : createCommentVNode("v-if", true), _ctx.state.enablePredefineColor ? (openBlock(), createBlock(_component_tiny_collapse_item, {
395
- key: 1,
396
- title: _ctx.t("ui.colorSelectPanel.predefine"),
397
- name: "predefine"
398
- }, {
399
- default: withCtx(function() {
400
- return [_ctx.state.predefineStack.length ? (openBlock(), createElementBlock("div", _hoisted_7, [(openBlock(true), createElementBlock(
401
- Fragment,
402
- null,
403
- renderList(_ctx.state.predefineStack, function(color, key) {
404
- return openBlock(), createElementBlock("div", {
405
- class: "tiny-color-select-panel__predefine__color-block",
406
- key,
407
- style: normalizeStyle({
408
- background: color
409
- }),
410
- onClick: function onClick() {
411
- return _ctx.onPredefineColorClick(color);
412
- }
413
- }, null, 12, _hoisted_8);
414
- }),
415
- 128
416
- /* KEYED_FRAGMENT */
417
- ))])) : createCommentVNode("v-if", true), !_ctx.state.predefineStack.length ? (openBlock(), createElementBlock(
418
- "div",
419
- _hoisted_9,
420
- toDisplayString(_ctx.t("ui.colorSelectPanel.empty")),
421
- 1
422
- /* TEXT */
423
- )) : createCommentVNode("v-if", true)];
424
- }),
425
- _: 1
426
- /* STABLE */
427
- }, 8, ["title"])) : createCommentVNode("v-if", true)];
428
- }),
429
- _: 1
430
- /* STABLE */
431
- })])), [[_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);
432
461
  }
433
462
  var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
434
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.24.0",
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.24.0",
12
- "@opentinyvue/vue-collapse": "~3.24.0",
13
- "@opentinyvue/vue-collapse-item": "~3.24.0",
14
- "@opentinyvue/vue-common": "~3.24.0",
15
- "@opentinyvue/vue-directive": "~3.24.0",
16
- "@opentinyvue/vue-input": "~3.24.0",
17
- "@opentinyvue/vue-option": "~3.24.0",
18
- "@opentinyvue/vue-renderless": "~3.24.0",
19
- "@opentinyvue/vue-select": "~3.24.0",
20
- "@opentinyvue/vue-theme": "~3.24.0"
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
  }