@opentiny/vue-divider 3.19.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
@@ -2,13 +2,12 @@ function _extends() {
2
2
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
3
3
  for (var e = 1; e < arguments.length; e++) {
4
4
  var t = arguments[e];
5
- for (var r in t)
6
- ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
5
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7
6
  }
8
7
  return n;
9
8
  }, _extends.apply(null, arguments);
10
9
  }
11
- import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common";
10
+ import { defineComponent, $prefix, $setup, $props } from "@opentiny/vue-common";
12
11
  import PcTemplate from "./pc.js";
13
12
  import "@opentiny/vue-theme/divider/index.css";
14
13
  var template = function template2(mode) {
@@ -17,40 +16,57 @@ var template = function template2(mode) {
17
16
  return PcTemplate;
18
17
  };
19
18
  var $constants = {};
19
+ var dividerProps = _extends({}, $props, {
20
+ _constants: {
21
+ type: Object,
22
+ default: function _default() {
23
+ return $constants;
24
+ }
25
+ },
26
+ direction: {
27
+ type: String,
28
+ default: "horizontal"
29
+ },
30
+ color: {
31
+ type: String,
32
+ default: ""
33
+ },
34
+ borderStyle: {
35
+ type: String,
36
+ default: "solid"
37
+ },
38
+ contentPosition: {
39
+ type: String,
40
+ default: "center"
41
+ },
42
+ contentColor: {
43
+ type: String,
44
+ default: ""
45
+ },
46
+ contentBackgroundColor: {
47
+ type: String,
48
+ default: ""
49
+ },
50
+ fontSize: {
51
+ type: String,
52
+ default: function _default2() {
53
+ return "14px";
54
+ }
55
+ },
56
+ margin: String,
57
+ offset: String,
58
+ height: String,
59
+ status: {
60
+ type: String,
61
+ values: ["default", "success", "warning", "error", "info"],
62
+ default: function _default3() {
63
+ return "default";
64
+ }
65
+ }
66
+ });
20
67
  var Divider = defineComponent({
21
68
  name: $prefix + "Divider",
22
- props: _extends({}, $props, {
23
- _constants: {
24
- type: Object,
25
- default: function _default() {
26
- return $constants;
27
- }
28
- },
29
- direction: {
30
- type: String,
31
- default: "horizontal"
32
- },
33
- color: {
34
- type: String,
35
- default: ""
36
- },
37
- borderStyle: {
38
- type: String,
39
- default: "solid"
40
- },
41
- contentPosition: {
42
- type: String,
43
- default: "center"
44
- },
45
- contentColor: {
46
- type: String,
47
- default: ""
48
- },
49
- contentBackgroundColor: {
50
- type: String,
51
- default: ""
52
- }
53
- }),
69
+ props: dividerProps,
54
70
  setup: function setup(props, context) {
55
71
  return $setup({
56
72
  props,
@@ -59,7 +75,7 @@ var Divider = defineComponent({
59
75
  });
60
76
  }
61
77
  });
62
- var version = "3.19.0";
78
+ var version = "3.21.0";
63
79
  Divider.install = function(Vue) {
64
80
  Vue.component(Divider.name, Divider);
65
81
  };
@@ -0,0 +1,93 @@
1
+ import { renderless, api } from '@opentiny/vue-renderless/divider/vue';
2
+ import { defineComponent, props, setup } from '@opentiny/vue-common';
3
+ import { openBlock, createElementBlock, normalizeStyle, normalizeClass, createCommentVNode, renderSlot } from 'vue';
4
+
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
+ };
14
+ }
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;
22
+ }
23
+ }
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;
36
+ };
37
+
38
+ var classes = {
39
+ "status-default": "border-color-border",
40
+ "status-info": "border-color-brand",
41
+ "status-warning": "border-color-warning",
42
+ "status-success": "border-color-success",
43
+ "status-error": "border-color-error"
44
+ };
45
+ var _sfc_main = defineComponent({
46
+ props: [].concat(props, ["type", "vertical", "lineColor", "textPosition", "status", "margin", "offset", "fontSize", "height"]),
47
+ setup: function setup$1(props2, context) {
48
+ return setup({
49
+ props: props2,
50
+ context,
51
+ renderless,
52
+ api,
53
+ classes
54
+ });
55
+ }
56
+ });
57
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
58
+ return openBlock(), createElementBlock(
59
+ "div",
60
+ {
61
+ "data-tag": "aui-divider",
62
+ style: normalizeStyle(_ctx.state.rootStyle),
63
+ class: normalizeClass(_ctx.m("overflow-hidden relative", _ctx.vertical ? "inline-block w-px border-l" : "h-auto flex items-center justify-center w-full", _ctx.gcls("status-" + _ctx.status)))
64
+ },
65
+ [!_ctx.vertical ? (openBlock(), createElementBlock(
66
+ "div",
67
+ {
68
+ key: 0,
69
+ class: normalizeClass(["h-px w-full border-t", [_ctx.gcls("status-" + _ctx.status)]]),
70
+ style: normalizeStyle(_ctx.state.lineStyle)
71
+ },
72
+ null,
73
+ 6
74
+ /* CLASS, STYLE */
75
+ )) : createCommentVNode("v-if", true), !_ctx.vertical ? (openBlock(), createElementBlock(
76
+ "span",
77
+ {
78
+ key: 1,
79
+ ref: "text",
80
+ class: "absolute py-0 px-3.5 bg-white",
81
+ style: normalizeStyle(_ctx.state.textStyle)
82
+ },
83
+ [renderSlot(_ctx.$slots, "default")],
84
+ 4
85
+ /* STYLE */
86
+ )) : createCommentVNode("v-if", true)],
87
+ 6
88
+ /* CLASS, STYLE */
89
+ );
90
+ }
91
+ var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
92
+
93
+ export { mobileFirst as default };
package/lib/pc.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import { renderless, api } from '@opentiny/vue-renderless/divider/vue';
2
2
  import { defineComponent, props, setup } from '@opentiny/vue-common';
3
- import { openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createCommentVNode } from 'vue';
3
+ import { openBlock, createElementBlock, normalizeClass, normalizeStyle, createCommentVNode, renderSlot } from 'vue';
4
4
 
5
5
  function _createForOfIteratorHelperLoose(r, e) {
6
6
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7
- if (t)
8
- return (t = t.call(r)).next.bind(t);
7
+ if (t) return (t = t.call(r)).next.bind(t);
9
8
  if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
10
9
  t && (r = t);
11
10
  var o = 0;
@@ -17,29 +16,36 @@ function _createForOfIteratorHelperLoose(r, e) {
17
16
  }
18
17
  function _unsupportedIterableToArray(r, a) {
19
18
  if (r) {
20
- if ("string" == typeof r)
21
- return _arrayLikeToArray(r, a);
19
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
20
  var t = {}.toString.call(r).slice(8, -1);
23
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;
24
22
  }
25
23
  }
26
24
  function _arrayLikeToArray(r, a) {
27
25
  (null == a || a > r.length) && (a = r.length);
28
- for (var e = 0, n = Array(a); e < a; e++)
29
- n[e] = r[e];
26
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
30
27
  return n;
31
28
  }
32
29
  var _export_sfc = function _export_sfc2(sfc, props) {
33
30
  var target = sfc.__vccOpts || sfc;
34
31
  for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
35
- var _step$value2 = _step.value, key = _step$value2[0], val = _step$value2[1];
32
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
36
33
  target[key] = val;
37
34
  }
38
35
  return target;
39
36
  };
40
37
 
38
+ function _extends() {
39
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
40
+ for (var e = 1; e < arguments.length; e++) {
41
+ var t = arguments[e];
42
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
43
+ }
44
+ return n;
45
+ }, _extends.apply(null, arguments);
46
+ }
41
47
  var _sfc_main = defineComponent({
42
- props: [].concat(props, ["direction", "color", "borderStyle", "contentPosition", "contentColor", "contentBackgroundColor"]),
48
+ props: [].concat(props, ["direction", "color", "borderStyle", "contentPosition", "contentColor", "contentBackgroundColor", "status", "margin", "offset", "fontSize", "height"]),
43
49
  setup: function setup$1(props2, context) {
44
50
  return setup({
45
51
  props: props2,
@@ -53,26 +59,35 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
53
59
  return openBlock(), createElementBlock(
54
60
  "div",
55
61
  {
56
- class: normalizeClass(["tiny-divider", "tiny-divider--" + _ctx.direction]),
57
- style: normalizeStyle({
58
- "border-top-style": _ctx.direction === "horizontal" ? _ctx.borderStyle : "",
59
- "border-left-style": _ctx.direction === "vertical" ? _ctx.borderStyle : "",
60
- "border-color": _ctx.color
61
- })
62
+ class: normalizeClass(["tiny-divider", "tiny-divider--" + _ctx.direction, _ctx.direction === "vertical" ? "tiny-divider--" + _ctx.status : ""]),
63
+ style: normalizeStyle(_ctx.state.rootStyle)
62
64
  },
63
- [_ctx.slots.default ? (openBlock(), createElementBlock(
65
+ [_ctx.direction !== "vertical" ? (openBlock(), createElementBlock(
64
66
  "div",
65
67
  {
66
68
  key: 0,
67
- class: normalizeClass(["tiny-divider__text", "is-" + _ctx.contentPosition]),
68
- style: normalizeStyle({
69
+ style: normalizeStyle(_extends({
70
+ "border-color": _ctx.color
71
+ }, _ctx.state.lineStyle)),
72
+ class: normalizeClass(["tiny-divider-line", "tiny-divider--" + _ctx.status])
73
+ },
74
+ null,
75
+ 6
76
+ /* CLASS, STYLE */
77
+ )) : createCommentVNode("v-if", true), _ctx.slots.default ? (openBlock(), createElementBlock(
78
+ "div",
79
+ {
80
+ key: 1,
81
+ ref: "text",
82
+ class: normalizeClass(["tiny-divider__text"]),
83
+ style: normalizeStyle(_extends({
69
84
  color: _ctx.contentColor,
70
85
  "background-color": _ctx.contentBackgroundColor
71
- })
86
+ }, _ctx.state.textStyle))
72
87
  },
73
88
  [renderSlot(_ctx.$slots, "default")],
74
- 6
75
- /* CLASS, STYLE */
89
+ 4
90
+ /* STYLE */
76
91
  )) : createCommentVNode("v-if", true)],
77
92
  6
78
93
  /* CLASS, STYLE */
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@opentiny/vue-divider",
3
- "version": "3.19.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
  "type": "module",
9
9
  "dependencies": {
10
- "@opentiny/vue-common": "~3.19.0",
11
- "@opentiny/vue-renderless": "~3.19.0",
12
- "@opentiny/vue-theme": "~3.19.0"
10
+ "@opentiny/vue-common": "~3.21.0",
11
+ "@opentiny/vue-renderless": "~3.21.0",
12
+ "@opentiny/vue-theme": "~3.21.0"
13
13
  },
14
14
  "license": "MIT",
15
15
  "types": "index.d.ts"
package/src/index.d.ts CHANGED
@@ -1,7 +1,56 @@
1
1
  import type { PropType } from '@opentiny/vue-common';
2
2
  export type DirectionType = 'horizontal' | 'vertical';
3
- export type BorderStyleType = 'dashed' | 'solid';
3
+ export type BorderStyleType = 'dashed' | 'solid' | 'dotted';
4
4
  export type ContentPositionType = 'left' | 'right' | 'center';
5
+ export declare const $constants: {};
6
+ export declare const dividerProps: {
7
+ _constants: {
8
+ type: ObjectConstructor;
9
+ default: () => {};
10
+ };
11
+ direction: {
12
+ type: PropType<DirectionType>;
13
+ default: string;
14
+ };
15
+ color: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ borderStyle: {
20
+ type: PropType<BorderStyleType>;
21
+ default: string;
22
+ };
23
+ contentPosition: {
24
+ type: PropType<ContentPositionType>;
25
+ default: string;
26
+ };
27
+ contentColor: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ contentBackgroundColor: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ fontSize: {
36
+ type: StringConstructor;
37
+ default: () => string;
38
+ };
39
+ margin: StringConstructor;
40
+ offset: StringConstructor;
41
+ height: StringConstructor;
42
+ status: {
43
+ type: StringConstructor;
44
+ values: string[];
45
+ default: () => string;
46
+ };
47
+ tiny_mode: StringConstructor;
48
+ tiny_mode_root: BooleanConstructor;
49
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
50
+ tiny_renderless: FunctionConstructor;
51
+ tiny_theme: StringConstructor;
52
+ tiny_chart_theme: ObjectConstructor;
53
+ };
5
54
  declare const _default: import("@vue/runtime-core").DefineComponent<{
6
55
  _constants: {
7
56
  type: ObjectConstructor;
@@ -31,6 +80,18 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
31
80
  type: StringConstructor;
32
81
  default: string;
33
82
  };
83
+ fontSize: {
84
+ type: StringConstructor;
85
+ default: () => string;
86
+ };
87
+ margin: StringConstructor;
88
+ offset: StringConstructor;
89
+ height: StringConstructor;
90
+ status: {
91
+ type: StringConstructor;
92
+ values: string[];
93
+ default: () => string;
94
+ };
34
95
  tiny_mode: StringConstructor;
35
96
  tiny_mode_root: BooleanConstructor;
36
97
  tiny_template: (ObjectConstructor | FunctionConstructor)[];
@@ -68,6 +129,18 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
68
129
  type: StringConstructor;
69
130
  default: string;
70
131
  };
132
+ fontSize: {
133
+ type: StringConstructor;
134
+ default: () => string;
135
+ };
136
+ margin: StringConstructor;
137
+ offset: StringConstructor;
138
+ height: StringConstructor;
139
+ status: {
140
+ type: StringConstructor;
141
+ values: string[];
142
+ default: () => string;
143
+ };
71
144
  tiny_mode: StringConstructor;
72
145
  tiny_mode_root: BooleanConstructor;
73
146
  tiny_template: (ObjectConstructor | FunctionConstructor)[];
@@ -75,12 +148,14 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
75
148
  tiny_theme: StringConstructor;
76
149
  tiny_chart_theme: ObjectConstructor;
77
150
  }>>, {
78
- color: string;
79
151
  tiny_mode_root: boolean;
80
152
  _constants: Record<string, any>;
81
153
  direction: DirectionType;
82
154
  contentPosition: ContentPositionType;
155
+ color: string;
156
+ fontSize: string;
83
157
  borderStyle: BorderStyleType;
158
+ status: string;
84
159
  contentColor: string;
85
160
  contentBackgroundColor: string;
86
161
  }, {}>;
@@ -0,0 +1,53 @@
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
+ type?: any;
3
+ tiny_mode?: any;
4
+ tiny_mode_root?: any;
5
+ tiny_template?: any;
6
+ tiny_renderless?: any;
7
+ _constants?: any;
8
+ tiny_theme?: any;
9
+ tiny_chart_theme?: any;
10
+ height?: any;
11
+ margin?: any;
12
+ offset?: any;
13
+ vertical?: any;
14
+ fontSize?: any;
15
+ status?: any;
16
+ lineColor?: any;
17
+ textPosition?: any;
18
+ }>, any, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
19
+ type?: any;
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
+ height?: any;
28
+ margin?: any;
29
+ offset?: any;
30
+ vertical?: any;
31
+ fontSize?: any;
32
+ status?: any;
33
+ lineColor?: any;
34
+ textPosition?: any;
35
+ }>>>, {
36
+ readonly type?: any;
37
+ readonly tiny_mode?: any;
38
+ readonly tiny_mode_root?: any;
39
+ readonly tiny_template?: any;
40
+ readonly tiny_renderless?: any;
41
+ readonly _constants?: any;
42
+ readonly tiny_theme?: any;
43
+ readonly tiny_chart_theme?: any;
44
+ readonly height?: any;
45
+ readonly margin?: any;
46
+ readonly offset?: any;
47
+ readonly vertical?: any;
48
+ readonly fontSize?: any;
49
+ readonly status?: any;
50
+ readonly lineColor?: any;
51
+ readonly textPosition?: any;
52
+ }, {}>;
53
+ export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
- color?: any;
3
2
  tiny_mode?: any;
4
3
  tiny_mode_root?: any;
5
4
  tiny_template?: any;
@@ -7,9 +6,15 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
7
6
  _constants?: any;
8
7
  tiny_theme?: any;
9
8
  tiny_chart_theme?: any;
9
+ height?: any;
10
10
  direction?: any;
11
+ margin?: any;
11
12
  contentPosition?: any;
13
+ offset?: any;
14
+ color?: any;
15
+ fontSize?: any;
12
16
  borderStyle?: any;
17
+ status?: any;
13
18
  contentColor?: any;
14
19
  contentBackgroundColor?: any;
15
20
  }>, {
@@ -20,8 +25,8 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
20
25
  d: (props: any) => void;
21
26
  dp: (props: any) => void;
22
27
  gcls: (key: any) => any;
28
+ m: (...cssClasses: any[]) => string;
23
29
  }, any, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
24
- color?: any;
25
30
  tiny_mode?: any;
26
31
  tiny_mode_root?: any;
27
32
  tiny_template?: any;
@@ -29,13 +34,18 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
29
34
  _constants?: any;
30
35
  tiny_theme?: any;
31
36
  tiny_chart_theme?: any;
37
+ height?: any;
32
38
  direction?: any;
39
+ margin?: any;
33
40
  contentPosition?: any;
41
+ offset?: any;
42
+ color?: any;
43
+ fontSize?: any;
34
44
  borderStyle?: any;
45
+ status?: any;
35
46
  contentColor?: any;
36
47
  contentBackgroundColor?: any;
37
48
  }>>>, {
38
- readonly color?: any;
39
49
  readonly tiny_mode?: any;
40
50
  readonly tiny_mode_root?: any;
41
51
  readonly tiny_template?: any;
@@ -43,9 +53,15 @@ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
43
53
  readonly _constants?: any;
44
54
  readonly tiny_theme?: any;
45
55
  readonly tiny_chart_theme?: any;
56
+ readonly height?: any;
46
57
  readonly direction?: any;
58
+ readonly margin?: any;
47
59
  readonly contentPosition?: any;
60
+ readonly offset?: any;
61
+ readonly color?: any;
62
+ readonly fontSize?: any;
48
63
  readonly borderStyle?: any;
64
+ readonly status?: any;
49
65
  readonly contentColor?: any;
50
66
  readonly contentBackgroundColor?: any;
51
67
  }, {}>;
package/src/token.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare const classes: {
2
+ 'status-default': string;
3
+ 'status-info': string;
4
+ 'status-warning': string;
5
+ 'status-success': string;
6
+ 'status-error': string;
7
+ };