@opentinyvue/vue-cell 2.22.0 → 3.22.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
@@ -2,38 +2,42 @@ import { t } from '@opentinyvue/vue-locale';
2
2
  import { renderless, api } from '@opentinyvue/vue-renderless/cell/vue';
3
3
  import { defineComponent, $prefix, setup } from '@opentinyvue/vue-common';
4
4
  import { IconChevronRight } from '@opentinyvue/vue-icon';
5
+ import { openBlock, createElementBlock, normalizeClass, createTextVNode, toDisplayString, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode } from 'vue';
5
6
 
6
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
7
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
8
- if (render) {
9
- options.render = render;
10
- options.staticRenderFns = staticRenderFns;
11
- options._compiled = true;
7
+ function _createForOfIteratorHelperLoose(r, e) {
8
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9
+ if (t) return (t = t.call(r)).next.bind(t);
10
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
11
+ t && (r = t);
12
+ var o = 0;
13
+ return function() {
14
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
15
+ };
12
16
  }
13
- var hook;
14
- if (injectStyles) {
15
- hook = injectStyles;
16
- }
17
- if (hook) {
18
- if (options.functional) {
19
- options._injectStyles = hook;
20
- var originalRender = options.render;
21
- options.render = function renderWithStyleInjection(h, context) {
22
- hook.call(context);
23
- return originalRender(h, context);
24
- };
25
- } else {
26
- var existing = options.beforeCreate;
27
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
28
- }
17
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _unsupportedIterableToArray(r, a) {
20
+ if (r) {
21
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
+ var t = {}.toString.call(r).slice(8, -1);
23
+ 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;
29
24
  }
30
- return {
31
- exports: scriptExports,
32
- options
33
- };
34
25
  }
26
+ function _arrayLikeToArray(r, a) {
27
+ (null == a || a > r.length) && (a = r.length);
28
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
29
+ return n;
30
+ }
31
+ var _export_sfc = function _export_sfc2(sfc, props) {
32
+ var target = sfc.__vccOpts || sfc;
33
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
34
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
35
+ target[key] = val;
36
+ }
37
+ return target;
38
+ };
35
39
 
36
- var __vue2_script = defineComponent({
40
+ var _sfc_main = defineComponent({
37
41
  name: $prefix + "Cell",
38
42
  componentName: "Cell",
39
43
  props: {
@@ -66,44 +70,35 @@ var __vue2_script = defineComponent({
66
70
  });
67
71
  }
68
72
  });
69
- var render = function render2() {
70
- var _vm = this;
71
- var _h = _vm.$createElement;
72
- var _c = _vm._self._c || _h;
73
- return _c("div", {
74
- staticClass: "border-0 border-color-border rounded relative w-full h-7 leading-7 sm:leading-6.5 pr-5 sm:pr-7 pl-0 sm:pl-3 cursor-pointer line-clamp-1",
75
- class: [_vm.m(_vm.data ? "text-color-text-primary" : "text-color-icon-placeholder", _vm.state.isDisplayOnly ? "pointer-events-none cursor-default text-color-text-primary pl-0" : "sm:border", _vm.state.isDisabled ? "sm:bg-color-bg-4 cursor-not-allowed" : "")],
76
- attrs: {
77
- "data-tag": "tiny-cell"
78
- },
79
- on: {
80
- "click": function click($event) {
81
- _vm.state.isDisabled ? "" : _vm.$emit("click", $event);
82
- }
83
- }
84
- }, [_vm._v(" " + _vm._s(_vm.state.isDisplayOnly ? _vm.data || "-" : _vm.data || _vm.placeholder) + " "), !(_vm.state.isDisplayOnly || _vm.state.isDisabled) ? _c("div", {
85
- attrs: {
86
- "data-tag": "tiny-cell-icon"
87
- }
88
- }, [_vm._t("icon", function() {
89
- return [_c(_vm.icon, {
90
- tag: "component",
91
- staticClass: "h-4 w-4 absolute top-1.5 sm:top-1 right-0 sm:right-2 fill-color-icon-placeholder"
92
- })];
93
- })], 2) : _vm._e()]);
73
+ var _hoisted_1 = {
74
+ key: 0,
75
+ "data-tag": "tiny-cell-icon"
94
76
  };
95
- var staticRenderFns = [];
96
- var __cssModules = {};
97
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
98
- function __vue2_injectStyles(context) {
99
- for (var o in __cssModules) {
100
- this[o] = __cssModules[o];
101
- }
77
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
78
+ return openBlock(), createElementBlock(
79
+ "div",
80
+ {
81
+ "data-tag": "tiny-cell",
82
+ class: normalizeClass(["border-0 border-color-border rounded relative w-full h-7 leading-7 sm:leading-6.5 pr-5 sm:pr-7 pl-0 sm:pl-3 cursor-pointer line-clamp-1", [_ctx.m(_ctx.data ? "text-color-text-primary" : "text-color-icon-placeholder", _ctx.state.isDisplayOnly ? "pointer-events-none cursor-default text-color-text-primary pl-0" : "sm:border", _ctx.state.isDisabled ? "sm:bg-color-bg-4 cursor-not-allowed" : "")]]),
83
+ onClick: _cache[0] || (_cache[0] = function($event) {
84
+ return _ctx.state.isDisabled ? "" : _ctx.$emit("click", $event);
85
+ })
86
+ },
87
+ [createTextVNode(
88
+ toDisplayString(_ctx.state.isDisplayOnly ? _ctx.data || "-" : _ctx.data || _ctx.placeholder) + " ",
89
+ 1
90
+ /* TEXT */
91
+ ), !(_ctx.state.isDisplayOnly || _ctx.state.isDisabled) ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "icon", {}, function() {
92
+ return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
93
+ class: "h-4 w-4 absolute top-1.5 sm:top-1 right-0 sm:right-2 fill-color-icon-placeholder"
94
+ }))];
95
+ })])) : createCommentVNode("v-if", true)],
96
+ 2
97
+ /* CLASS */
98
+ );
102
99
  }
103
- var Cell = /* @__PURE__ */ function() {
104
- return __component__.exports;
105
- }();
106
- var version = "2.22.0";
100
+ var Cell = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
101
+ var version = "3.22.0";
107
102
  Cell.install = function(Vue) {
108
103
  Vue.component(Cell.name, Cell);
109
104
  };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-cell",
3
- "version": "2.22.0",
3
+ "version": "3.22.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@opentinyvue/vue-common": "~2.22.0",
11
- "@opentinyvue/vue-icon": "~2.22.0",
10
+ "@opentinyvue/vue-common": "~3.22.0",
11
+ "@opentinyvue/vue-icon": "~3.22.0",
12
12
  "@opentinyvue/vue-renderless": "~3.22.0",
13
- "@opentinyvue/vue-locale": "~2.22.0"
13
+ "@opentinyvue/vue-locale": "~3.22.0"
14
14
  },
15
15
  "license": "MIT",
16
16
  "types": "index.d.ts",
@@ -1,2 +1,45 @@
1
- declare const _default: any;
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
2
+ placeholder: {
3
+ type: StringConstructor;
4
+ default: any;
5
+ };
6
+ disabled: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ data: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ icon: {
15
+ type: (StringConstructor | ObjectConstructor)[];
16
+ default: () => import("@vue/reactivity").Raw<import("@vue/runtime-core").DefineComponent<{}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
17
+ [key: string]: any;
18
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{}>>, {}, {}>>;
19
+ };
20
+ }, any, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
21
+ placeholder: {
22
+ type: StringConstructor;
23
+ default: any;
24
+ };
25
+ disabled: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ data: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ icon: {
34
+ type: (StringConstructor | ObjectConstructor)[];
35
+ default: () => import("@vue/reactivity").Raw<import("@vue/runtime-core").DefineComponent<{}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
36
+ [key: string]: any;
37
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{}>>, {}, {}>>;
38
+ };
39
+ }>>, {
40
+ disabled: boolean;
41
+ icon: string | Record<string, any>;
42
+ data: string;
43
+ placeholder: string;
44
+ }, {}>;
2
45
  export default _default;