@opentinyvue/vue-color-picker 2.21.0 → 3.21.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/index.js CHANGED
@@ -76,7 +76,7 @@ var ColorPicker = defineComponent({
76
76
  });
77
77
  }
78
78
  });
79
- var version = "2.21.0";
79
+ var version = "3.21.0";
80
80
  ColorPicker.model = {
81
81
  prop: "modelValue",
82
82
  event: "update:modelValue"
package/lib/mobile.js CHANGED
@@ -1,44 +1,41 @@
1
1
  import { renderless, api } from '@opentinyvue/vue-renderless/color-picker/vue';
2
2
  import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
+ import { openBlock, createElementBlock } from 'vue';
3
4
 
4
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
5
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
6
- if (render) {
7
- options.render = render;
8
- options.staticRenderFns = staticRenderFns;
9
- options._compiled = true;
5
+ function _createForOfIteratorHelperLoose(r, e) {
6
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7
+ if (t) return (t = t.call(r)).next.bind(t);
8
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
9
+ t && (r = t);
10
+ var o = 0;
11
+ return function() {
12
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
13
+ };
10
14
  }
11
- var hook;
12
- if (injectStyles) {
13
- hook = injectStyles;
14
- }
15
- if (hook) {
16
- if (options.functional) {
17
- options._injectStyles = hook;
18
- var originalRender = options.render;
19
- options.render = function renderWithStyleInjection(h, context) {
20
- hook.call(context);
21
- return originalRender(h, context);
22
- };
23
- } else {
24
- var existing = options.beforeCreate;
25
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
26
- }
15
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16
+ }
17
+ function _unsupportedIterableToArray(r, a) {
18
+ if (r) {
19
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
20
+ var t = {}.toString.call(r).slice(8, -1);
21
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
27
22
  }
28
- return {
29
- exports: scriptExports,
30
- options
31
- };
32
23
  }
33
-
34
- var render = function render2() {
35
- var _vm = this;
36
- var _h = _vm.$createElement;
37
- var _c = _vm._self._c || _h;
38
- return _c("div");
24
+ function _arrayLikeToArray(r, a) {
25
+ (null == a || a > r.length) && (a = r.length);
26
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
27
+ return n;
28
+ }
29
+ var _export_sfc = function _export_sfc2(sfc, props) {
30
+ var target = sfc.__vccOpts || sfc;
31
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
32
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
33
+ target[key] = val;
34
+ }
35
+ return target;
39
36
  };
40
- var staticRenderFns = [];
41
- var __vue2_script = defineComponent({
37
+
38
+ var _sfc_main = defineComponent({
42
39
  emits: ["update:modelValue"],
43
40
  props: [].concat(props, ["modelValue"]),
44
41
  setup: function setup$1(props2, context) {
@@ -50,15 +47,9 @@ var __vue2_script = defineComponent({
50
47
  });
51
48
  }
52
49
  });
53
- var __cssModules = {};
54
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
55
- function __vue2_injectStyles(context) {
56
- for (var o in __cssModules) {
57
- this[o] = __cssModules[o];
58
- }
50
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
51
+ return openBlock(), createElementBlock("div");
59
52
  }
60
- var mobile = /* @__PURE__ */ function() {
61
- return __component__.exports;
62
- }();
53
+ var mobile = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
63
54
 
64
55
  export { mobile as default };
package/lib/pc.js CHANGED
@@ -3,88 +3,42 @@ import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
3
  import { IconChevronDown } from '@opentinyvue/vue-icon';
4
4
  import ColorSelectPanel from '@opentinyvue/vue-color-select-panel';
5
5
  import '@opentinyvue/vue-theme/color-picker/index.css';
6
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, Transition, withCtx } from 'vue';
6
7
 
7
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
8
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
9
- if (render) {
10
- options.render = render;
11
- options.staticRenderFns = staticRenderFns;
12
- options._compiled = true;
8
+ function _createForOfIteratorHelperLoose(r, e) {
9
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
10
+ if (t) return (t = t.call(r)).next.bind(t);
11
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
12
+ t && (r = t);
13
+ var o = 0;
14
+ return function() {
15
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
16
+ };
13
17
  }
14
- var hook;
15
- if (injectStyles) {
16
- hook = injectStyles;
17
- }
18
- if (hook) {
19
- if (options.functional) {
20
- options._injectStyles = hook;
21
- var originalRender = options.render;
22
- options.render = function renderWithStyleInjection(h, context) {
23
- hook.call(context);
24
- return originalRender(h, context);
25
- };
26
- } else {
27
- var existing = options.beforeCreate;
28
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
29
- }
18
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19
+ }
20
+ function _unsupportedIterableToArray(r, a) {
21
+ if (r) {
22
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
23
+ var t = {}.toString.call(r).slice(8, -1);
24
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
30
25
  }
31
- return {
32
- exports: scriptExports,
33
- options
34
- };
35
26
  }
36
-
37
- var render = function render2() {
38
- var _vm$state$hex;
39
- var _vm = this;
40
- var _h = _vm.$createElement;
41
- var _c = _vm._self._c || _h;
42
- return _c("div", {
43
- class: [{
44
- "tiny-color-picker": true
45
- }, _vm.state.size ? "tiny-color-picker--" + _vm.state.size : ""],
46
- on: {
47
- "click": function click() {
48
- return _vm.changeVisible(!_vm.state.isShow);
49
- }
50
- }
51
- }, [_c("div", {
52
- staticClass: "tiny-color-picker__inner",
53
- style: {
54
- background: (_vm$state$hex = _vm.state.hex) !== null && _vm$state$hex !== void 0 ? _vm$state$hex : ""
55
- }
56
- }, [_c("IconChevronDown")], 1), _c("Transition", {
57
- attrs: {
58
- "name": "tiny-zoom-in-top"
59
- }
60
- }, [_c("color-select", {
61
- style: {
62
- "min-width": "420px"
63
- },
64
- attrs: {
65
- "visible": _vm.state.isShow,
66
- "alpha": _vm.alpha,
67
- "predefine": _vm.state.predefineStack,
68
- "history": _vm.state.stack,
69
- "format": _vm.format,
70
- "enable-history": _vm.state.enableHistory,
71
- "enable-predefine-color": _vm.state.enablePredefineColor
72
- },
73
- on: {
74
- "confirm": _vm.onConfirm,
75
- "cancel": _vm.onCancel
76
- },
77
- model: {
78
- value: _vm.state.hex,
79
- callback: function callback($$v) {
80
- _vm.$set(_vm.state, "hex", $$v);
81
- },
82
- expression: "state.hex"
83
- }
84
- })], 1)], 1);
27
+ function _arrayLikeToArray(r, a) {
28
+ (null == a || a > r.length) && (a = r.length);
29
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
30
+ return n;
31
+ }
32
+ var _export_sfc = function _export_sfc2(sfc, props) {
33
+ var target = sfc.__vccOpts || sfc;
34
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
35
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
36
+ target[key] = val;
37
+ }
38
+ return target;
85
39
  };
86
- var staticRenderFns = [];
87
- var __vue2_script = defineComponent({
40
+
41
+ var _sfc_main = defineComponent({
88
42
  emits: ["update:modelValue", "confirm", "cancel"],
89
43
  props: [].concat(props, ["modelValue", "visible", "alpha", "predefine", "history", "size", "format", "enableHistory", "enablePredefineColor"]),
90
44
  components: {
@@ -100,15 +54,61 @@ var __vue2_script = defineComponent({
100
54
  });
101
55
  }
102
56
  });
103
- var __cssModules = {};
104
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
105
- function __vue2_injectStyles(context) {
106
- for (var o in __cssModules) {
107
- this[o] = __cssModules[o];
108
- }
57
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
58
+ var _ctx$state$hex;
59
+ var _component_IconChevronDown = resolveComponent("IconChevronDown");
60
+ var _component_color_select = resolveComponent("color-select");
61
+ return openBlock(), createElementBlock(
62
+ "div",
63
+ {
64
+ class: normalizeClass([{
65
+ "tiny-color-picker": true
66
+ }, _ctx.state.size ? "tiny-color-picker--" + _ctx.state.size : ""]),
67
+ onClick: _cache[1] || (_cache[1] = function() {
68
+ return _ctx.changeVisible(!_ctx.state.isShow);
69
+ })
70
+ },
71
+ [createElementVNode(
72
+ "div",
73
+ {
74
+ class: "tiny-color-picker__inner",
75
+ style: normalizeStyle({
76
+ background: (_ctx$state$hex = _ctx.state.hex) != null ? _ctx$state$hex : ""
77
+ })
78
+ },
79
+ [createVNode(_component_IconChevronDown)],
80
+ 4
81
+ /* STYLE */
82
+ ), createVNode(Transition, {
83
+ name: "tiny-zoom-in-top"
84
+ }, {
85
+ default: withCtx(function() {
86
+ return [createVNode(_component_color_select, {
87
+ onConfirm: _ctx.onConfirm,
88
+ onCancel: _ctx.onCancel,
89
+ modelValue: _ctx.state.hex,
90
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
91
+ return _ctx.state.hex = $event;
92
+ }),
93
+ visible: _ctx.state.isShow,
94
+ alpha: _ctx.alpha,
95
+ predefine: _ctx.state.predefineStack,
96
+ history: _ctx.state.stack,
97
+ format: _ctx.format,
98
+ style: {
99
+ "min-width": "420px"
100
+ },
101
+ "enable-history": _ctx.state.enableHistory,
102
+ "enable-predefine-color": _ctx.state.enablePredefineColor
103
+ }, null, 8, ["onConfirm", "onCancel", "modelValue", "visible", "alpha", "predefine", "history", "format", "enable-history", "enable-predefine-color"])];
104
+ }),
105
+ _: 1
106
+ /* STABLE */
107
+ })],
108
+ 2
109
+ /* CLASS */
110
+ );
109
111
  }
110
- var pc = /* @__PURE__ */ function() {
111
- return __component__.exports;
112
- }();
112
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
113
113
 
114
114
  export { pc as default };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-color-picker",
3
- "version": "2.21.0",
3
+ "version": "3.21.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "dependencies": {
9
- "@opentinyvue/vue-color-select-panel": "~2.21.0",
10
- "@opentinyvue/vue-common": "~2.21.0",
11
- "@opentinyvue/vue-icon": "~2.21.0",
9
+ "@opentinyvue/vue-color-select-panel": "~3.21.0",
10
+ "@opentinyvue/vue-common": "~3.21.0",
11
+ "@opentinyvue/vue-icon": "~3.21.0",
12
12
  "@opentinyvue/vue-renderless": "~3.21.0",
13
13
  "@opentinyvue/vue-theme": "~3.21.0"
14
14
  },
package/src/index.d.ts CHANGED
@@ -1,2 +1,81 @@
1
- declare const _default: any;
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
2
+ _constants: {
3
+ type: ObjectConstructor;
4
+ default: () => {};
5
+ };
6
+ modelValue: StringConstructor;
7
+ visible: BooleanConstructor;
8
+ alpha: BooleanConstructor;
9
+ predefine: ArrayConstructor;
10
+ history: ArrayConstructor;
11
+ size: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ validator(val: string): boolean;
15
+ };
16
+ format: {
17
+ type: ArrayConstructor;
18
+ default: () => never[];
19
+ validator(val: string[]): boolean;
20
+ };
21
+ enableHistory: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ enablePredefineColor: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ tiny_mode: StringConstructor;
30
+ tiny_mode_root: BooleanConstructor;
31
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
32
+ tiny_renderless: FunctionConstructor;
33
+ tiny_theme: StringConstructor;
34
+ tiny_chart_theme: ObjectConstructor;
35
+ }, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
36
+ [key: string]: any;
37
+ }>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
38
+ _constants: {
39
+ type: ObjectConstructor;
40
+ default: () => {};
41
+ };
42
+ modelValue: StringConstructor;
43
+ visible: BooleanConstructor;
44
+ alpha: BooleanConstructor;
45
+ predefine: ArrayConstructor;
46
+ history: ArrayConstructor;
47
+ size: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ validator(val: string): boolean;
51
+ };
52
+ format: {
53
+ type: ArrayConstructor;
54
+ default: () => never[];
55
+ validator(val: string[]): boolean;
56
+ };
57
+ enableHistory: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ enablePredefineColor: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
65
+ tiny_mode: StringConstructor;
66
+ tiny_mode_root: BooleanConstructor;
67
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
68
+ tiny_renderless: FunctionConstructor;
69
+ tiny_theme: StringConstructor;
70
+ tiny_chart_theme: ObjectConstructor;
71
+ }>>, {
72
+ format: unknown[];
73
+ size: string;
74
+ tiny_mode_root: boolean;
75
+ _constants: Record<string, any>;
76
+ visible: boolean;
77
+ alpha: boolean;
78
+ enableHistory: boolean;
79
+ enablePredefineColor: boolean;
80
+ }, {}>;
2
81
  export default _default;
@@ -1,2 +1,40 @@
1
- declare const _default: any;
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
+ tiny_mode?: any;
3
+ tiny_mode_root?: any;
4
+ tiny_template?: any;
5
+ tiny_renderless?: any;
6
+ _constants?: any;
7
+ tiny_theme?: any;
8
+ tiny_chart_theme?: any;
9
+ modelValue?: any;
10
+ }>, {
11
+ t: (this: any, path: any, options?: any) => any;
12
+ vm: any;
13
+ f: (props: any, attrs?: {}) => {};
14
+ a: (attrs: any, filters: any, include: any) => {};
15
+ d: (props: any) => void;
16
+ dp: (props: any) => void;
17
+ gcls: (key: any) => any;
18
+ m: (...cssClasses: any[]) => string;
19
+ }, any, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
20
+ tiny_mode?: any;
21
+ tiny_mode_root?: any;
22
+ tiny_template?: any;
23
+ tiny_renderless?: any;
24
+ _constants?: any;
25
+ tiny_theme?: any;
26
+ tiny_chart_theme?: any;
27
+ modelValue?: any;
28
+ }>>> & {
29
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
30
+ }, {
31
+ readonly tiny_mode?: any;
32
+ readonly tiny_mode_root?: any;
33
+ readonly tiny_template?: any;
34
+ readonly tiny_renderless?: any;
35
+ readonly _constants?: any;
36
+ readonly tiny_theme?: any;
37
+ readonly tiny_chart_theme?: any;
38
+ readonly modelValue?: any;
39
+ }, {}>;
2
40
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,2 +1,66 @@
1
- declare const _default: any;
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
+ format?: any;
3
+ size?: any;
4
+ tiny_mode?: any;
5
+ tiny_mode_root?: any;
6
+ tiny_template?: any;
7
+ tiny_renderless?: any;
8
+ _constants?: any;
9
+ tiny_theme?: any;
10
+ tiny_chart_theme?: any;
11
+ modelValue?: any;
12
+ visible?: any;
13
+ alpha?: any;
14
+ predefine?: any;
15
+ history?: any;
16
+ enableHistory?: any;
17
+ enablePredefineColor?: any;
18
+ }>, {
19
+ t: (this: any, path: any, options?: any) => any;
20
+ vm: any;
21
+ f: (props: any, attrs?: {}) => {};
22
+ a: (attrs: any, filters: any, include: any) => {};
23
+ d: (props: any) => void;
24
+ dp: (props: any) => void;
25
+ gcls: (key: any) => any;
26
+ m: (...cssClasses: any[]) => string;
27
+ }, any, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("cancel" | "update:modelValue" | "confirm")[], "cancel" | "update:modelValue" | "confirm", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
28
+ format?: any;
29
+ size?: any;
30
+ tiny_mode?: any;
31
+ tiny_mode_root?: any;
32
+ tiny_template?: any;
33
+ tiny_renderless?: any;
34
+ _constants?: any;
35
+ tiny_theme?: any;
36
+ tiny_chart_theme?: any;
37
+ modelValue?: any;
38
+ visible?: any;
39
+ alpha?: any;
40
+ predefine?: any;
41
+ history?: any;
42
+ enableHistory?: any;
43
+ enablePredefineColor?: any;
44
+ }>>> & {
45
+ onCancel?: ((...args: any[]) => any) | undefined;
46
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
47
+ onConfirm?: ((...args: any[]) => any) | undefined;
48
+ }, {
49
+ readonly format?: any;
50
+ readonly size?: any;
51
+ readonly tiny_mode?: any;
52
+ readonly tiny_mode_root?: any;
53
+ readonly tiny_template?: any;
54
+ readonly tiny_renderless?: any;
55
+ readonly _constants?: any;
56
+ readonly tiny_theme?: any;
57
+ readonly tiny_chart_theme?: any;
58
+ readonly modelValue?: any;
59
+ readonly visible?: any;
60
+ readonly alpha?: any;
61
+ readonly predefine?: any;
62
+ readonly history?: any;
63
+ readonly enableHistory?: any;
64
+ readonly enablePredefineColor?: any;
65
+ }, {}>;
2
66
  export default _default;