@opentiny/vue-divider 2.20.0 → 2.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,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, $props, $setup, $prefix } 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 = "2.20.0";
78
+ var version = "2.undefined";
63
79
  Divider.install = function(Vue) {
64
80
  Vue.component(Divider.name, Divider);
65
81
  };
@@ -0,0 +1,85 @@
1
+ import { renderless, api } from '@opentiny/vue-renderless/divider/vue';
2
+ import { defineComponent, props, setup } from '@opentiny/vue-common';
3
+
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;
10
+ }
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
+ }
27
+ }
28
+ return {
29
+ exports: scriptExports,
30
+ options
31
+ };
32
+ }
33
+
34
+ var classes = {
35
+ "status-default": "border-color-border",
36
+ "status-info": "border-color-brand",
37
+ "status-warning": "border-color-warning",
38
+ "status-success": "border-color-success",
39
+ "status-error": "border-color-error"
40
+ };
41
+ var __vue2_script = defineComponent({
42
+ props: [].concat(props, ["type", "vertical", "lineColor", "textPosition", "status", "margin", "offset", "fontSize", "height"]),
43
+ setup: function setup$1(props2, context) {
44
+ return setup({
45
+ props: props2,
46
+ context,
47
+ renderless,
48
+ api,
49
+ classes
50
+ });
51
+ }
52
+ });
53
+ var render = function render2() {
54
+ var _vm = this;
55
+ var _h = _vm.$createElement;
56
+ var _c = _vm._self._c || _h;
57
+ return _c("div", {
58
+ class: _vm.m("overflow-hidden relative", _vm.vertical ? "inline-block w-px border-l" : "h-auto flex items-center justify-center w-full", _vm.gcls("status-" + _vm.status)),
59
+ style: _vm.state.rootStyle,
60
+ attrs: {
61
+ "data-tag": "aui-divider"
62
+ }
63
+ }, [!_vm.vertical ? _c("div", {
64
+ staticClass: "h-px w-full border-t",
65
+ class: [_vm.gcls("status-" + _vm.status)],
66
+ style: _vm.state.lineStyle
67
+ }) : _vm._e(), !_vm.vertical ? _c("span", {
68
+ ref: "text",
69
+ staticClass: "absolute py-0 px-3.5 bg-white",
70
+ style: _vm.state.textStyle
71
+ }, [_vm._t("default")], 2) : _vm._e()]);
72
+ };
73
+ var staticRenderFns = [];
74
+ var __cssModules = {};
75
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
76
+ function __vue2_injectStyles(context) {
77
+ for (var o in __cssModules) {
78
+ this[o] = __cssModules[o];
79
+ }
80
+ }
81
+ var mobileFirst = /* @__PURE__ */ function() {
82
+ return __component__.exports;
83
+ }();
84
+
85
+ export { mobileFirst as default };
package/lib/pc.js CHANGED
@@ -8,33 +8,9 @@ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTe
8
8
  options.staticRenderFns = staticRenderFns;
9
9
  options._compiled = true;
10
10
  }
11
- if (functionalTemplate) {
12
- options.functional = true;
13
- }
14
- if (scopeId) {
15
- options._scopeId = "data-v-" + scopeId;
16
- }
17
11
  var hook;
18
- if (moduleIdentifier) {
19
- hook = function hook2(context) {
20
- context = context || // cached call
21
- this.$vnode && this.$vnode.ssrContext || // stateful
22
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
23
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
24
- context = __VUE_SSR_CONTEXT__;
25
- }
26
- if (injectStyles) {
27
- injectStyles.call(this, context);
28
- }
29
- if (context && context._registeredComponents) {
30
- context._registeredComponents.add(moduleIdentifier);
31
- }
32
- };
33
- options._ssrRegister = hook;
34
- } else if (injectStyles) {
35
- hook = shadowMode ? function() {
36
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
37
- } : injectStyles;
12
+ if (injectStyles) {
13
+ hook = injectStyles;
38
14
  }
39
15
  if (hook) {
40
16
  if (options.functional) {
@@ -60,23 +36,25 @@ var render = function render2() {
60
36
  var _h = _vm.$createElement;
61
37
  var _c = _vm._self._c || _h;
62
38
  return _c("div", {
63
- class: ["tiny-divider", "tiny-divider--" + _vm.direction],
64
- style: {
65
- "border-top-style": _vm.direction === "horizontal" ? _vm.borderStyle : "",
66
- "border-left-style": _vm.direction === "vertical" ? _vm.borderStyle : "",
39
+ class: ["tiny-divider", "tiny-divider--" + _vm.direction, _vm.direction === "vertical" ? "tiny-divider--" + _vm.status : ""],
40
+ style: _vm.state.rootStyle
41
+ }, [_vm.direction !== "vertical" ? _c("div", {
42
+ class: ["tiny-divider-line", "tiny-divider--" + _vm.status],
43
+ style: Object.assign({
67
44
  "border-color": _vm.color
68
- }
69
- }, [_vm.slots.default ? _c("div", {
70
- class: ["tiny-divider__text", "is-" + _vm.contentPosition],
71
- style: {
45
+ }, _vm.state.lineStyle)
46
+ }) : _vm._e(), _vm.slots.default ? _c("div", {
47
+ ref: "text",
48
+ class: ["tiny-divider__text"],
49
+ style: Object.assign({
72
50
  color: _vm.contentColor,
73
51
  "background-color": _vm.contentBackgroundColor
74
- }
52
+ }, _vm.state.textStyle)
75
53
  }, [_vm._t("default")], 2) : _vm._e()]);
76
54
  };
77
55
  var staticRenderFns = [];
78
56
  var __vue2_script = defineComponent({
79
- props: [].concat(props, ["direction", "color", "borderStyle", "contentPosition", "contentColor", "contentBackgroundColor"]),
57
+ props: [].concat(props, ["direction", "color", "borderStyle", "contentPosition", "contentColor", "contentBackgroundColor", "status", "margin", "offset", "fontSize", "height"]),
80
58
  setup: function setup$1(props2, context) {
81
59
  return setup({
82
60
  props: props2,
@@ -87,7 +65,7 @@ var __vue2_script = defineComponent({
87
65
  }
88
66
  });
89
67
  var __cssModules = {};
90
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
68
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
91
69
  function __vue2_injectStyles(context) {
92
70
  for (var o in __cssModules) {
93
71
  this[o] = __cssModules[o];
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@opentiny/vue-divider",
3
- "version": "2.20.0",
3
+ "version": "2.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
- "@opentiny/vue-common": "~2.20.0",
11
- "@opentiny/vue-renderless": "~3.20.0",
12
- "@opentiny/vue-theme": "~3.20.0"
10
+ "@opentiny/vue-common": "~2.22.0",
11
+ "@opentiny/vue-renderless": "~3.22.0",
12
+ "@opentiny/vue-theme": "~3.22.0"
13
13
  },
14
14
  "license": "MIT",
15
15
  "types": "index.d.ts"
package/src/index.d.ts CHANGED
@@ -1,5 +1,55 @@
1
+ import type { PropType } from '@opentiny/vue-common';
1
2
  export type DirectionType = 'horizontal' | 'vertical';
2
- export type BorderStyleType = 'dashed' | 'solid';
3
+ export type BorderStyleType = 'dashed' | 'solid' | 'dotted';
3
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
+ };
4
54
  declare const _default: any;
5
55
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
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
+ };