@fangzhongya/fang-ui 0.0.22 → 0.0.23

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.
@@ -15,4 +15,18 @@
15
15
 
16
16
  .com {
17
17
  font-size: 20px;
18
+ }
19
+
20
+ .icon {
21
+ --color: inherit;
22
+ height: 1em;
23
+ width: 1em;
24
+ line-height: 1em;
25
+ display: inline-flex;
26
+ justify-content: center;
27
+ align-items: center;
28
+ position: relative;
29
+ fill: currentColor;
30
+ color: var(--color);
31
+ font-size: inherit;
18
32
  }
@@ -5,6 +5,9 @@ declare const Icon: {
5
5
  type: StringConstructor;
6
6
  default: string;
7
7
  };
8
+ iconClass: {
9
+ type: StringConstructor;
10
+ };
8
11
  type: {
9
12
  type: StringConstructor;
10
13
  };
@@ -28,7 +31,7 @@ declare const Icon: {
28
31
  runtime: boolean;
29
32
  flip: "" | "horizontal" | "vertical" | "both";
30
33
  rotate: number;
31
- }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
34
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLElement, ComponentProvideOptions, {
32
35
  P: {};
33
36
  B: {};
34
37
  D: {};
@@ -40,6 +43,9 @@ declare const Icon: {
40
43
  type: StringConstructor;
41
44
  default: string;
42
45
  };
46
+ iconClass: {
47
+ type: StringConstructor;
48
+ };
43
49
  type: {
44
50
  type: StringConstructor;
45
51
  };
@@ -72,6 +78,9 @@ declare const Icon: {
72
78
  type: StringConstructor;
73
79
  default: string;
74
80
  };
81
+ iconClass: {
82
+ type: StringConstructor;
83
+ };
75
84
  type: {
76
85
  type: StringConstructor;
77
86
  };
@@ -97,9 +106,7 @@ declare const Icon: {
97
106
  rotate: number;
98
107
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
99
108
  $slots: {
100
- default?(_: {
101
- class: string;
102
- }): any;
109
+ default?(_: {}): any;
103
110
  };
104
111
  }) & Plugin;
105
112
  export { Icon, Icon as default };
@@ -1,5 +1,16 @@
1
1
  @use '../css/common.scss' as *;
2
2
 
3
- $temp-late: 'temp-late';
4
- @include b($temp-late) {
3
+ $icon: 'icon';
4
+ @include b($icon) {
5
+ --color: inherit;
6
+ height: 1em;
7
+ width: 1em;
8
+ line-height: 1em;
9
+ display: inline-flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ position: relative;
13
+ fill: currentColor;
14
+ color: var(--color);
15
+ font-size: inherit;
5
16
  }
@@ -28,6 +28,9 @@ const dataProps = buildProps.buildProps({
28
28
  type: String,
29
29
  default: ""
30
30
  },
31
+ iconClass: {
32
+ type: String
33
+ },
31
34
  /**
32
35
  * @props { String} type= ( )
33
36
  * 图标类型
@@ -9,6 +9,9 @@ export declare const dataProps: {
9
9
  type: StringConstructor;
10
10
  default: string;
11
11
  };
12
+ iconClass: {
13
+ type: StringConstructor;
14
+ };
12
15
  /**
13
16
  * @props { String} type= ( )
14
17
  * 图标类型
@@ -26,6 +26,9 @@ const dataProps = buildProps({
26
26
  type: String,
27
27
  default: ""
28
28
  },
29
+ iconClass: {
30
+ type: String
31
+ },
29
32
  /**
30
33
  * @props { String} type= ( )
31
34
  * 图标类型
@@ -119,42 +119,44 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
119
119
  ...data.dataExpose
120
120
  });
121
121
  return (_ctx, _cache) => {
122
- return vue.renderSlot(_ctx.$slots, "default", {
122
+ return vue.openBlock(), vue.createElementBlock("i", {
123
123
  class: vue.normalizeClass(vue.unref(cs).z())
124
- }, () => [
125
- outputType.value === "css" ? (vue.openBlock(), vue.createElementBlock("i", {
126
- key: 0,
127
- ctype: outputType.value,
128
- class: vue.normalizeClass([vue.unref(cs).z(), outputName.value]),
129
- style: vue.normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
130
- }, null, 14, _hoisted_1)) : outputType.value === "font" ? (vue.openBlock(), vue.createElementBlock("i", {
131
- key: 1,
132
- ctype: outputType.value,
133
- class: vue.normalizeClass([vue.unref(cs).z(), outputName.value]),
134
- style: vue.normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
135
- }, null, 14, _hoisted_2)) : outputType.value === "img" ? (vue.openBlock(), vue.createElementBlock("img", {
136
- key: 2,
137
- ctype: outputType.value,
138
- class: vue.normalizeClass([vue.unref(cs).z()]),
139
- style: vue.normalizeStyle([{ "border": "0", "display": "inline-flex", "align-items": "center", "object-fit": "contain", "justify-content": "center" }, transformStyle.value]),
140
- src: outputName.value
141
- }, null, 14, _hoisted_3)) : outputType.value === "str" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [], 64)) : outputType.value === "com" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(outputName.value), {
142
- key: 4,
143
- ctype: outputType.value,
144
- class: vue.normalizeClass([vue.unref(cs).z()]),
145
- style: vue.normalizeStyle(transformStyle.value)
146
- }, null, 8, ["ctype", "class", "style"])) : (vue.openBlock(), vue.createElementBlock("svg", {
147
- key: 5,
148
- ctype: outputType.value,
149
- class: vue.normalizeClass([vue.unref(cs).z()]),
150
- style: vue.normalizeStyle(transformStyle.value),
151
- "aria-hidden": "true"
152
- }, [
153
- vue.createElementVNode("use", {
154
- "xlink:href": `#icon-${outputName.value}`
155
- }, null, 8, _hoisted_5)
156
- ], 14, _hoisted_4))
157
- ]);
124
+ }, [
125
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
126
+ outputType.value === "css" ? (vue.openBlock(), vue.createElementBlock("i", {
127
+ key: 0,
128
+ ctype: outputType.value,
129
+ class: vue.normalizeClass([outputName.value, props.iconClass]),
130
+ style: vue.normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
131
+ }, null, 14, _hoisted_1)) : outputType.value === "font" ? (vue.openBlock(), vue.createElementBlock("i", {
132
+ key: 1,
133
+ ctype: outputType.value,
134
+ class: vue.normalizeClass([outputName.value, props.iconClass]),
135
+ style: vue.normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
136
+ }, null, 14, _hoisted_2)) : outputType.value === "img" ? (vue.openBlock(), vue.createElementBlock("img", {
137
+ key: 2,
138
+ ctype: outputType.value,
139
+ class: vue.normalizeClass([props.iconClass]),
140
+ style: vue.normalizeStyle([{ "border": "0", "display": "inline-flex", "align-items": "center", "object-fit": "contain", "justify-content": "center" }, transformStyle.value]),
141
+ src: outputName.value
142
+ }, null, 14, _hoisted_3)) : outputType.value === "str" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [], 64)) : outputType.value === "com" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(outputName.value), {
143
+ key: 4,
144
+ ctype: outputType.value,
145
+ class: vue.normalizeClass([props.iconClass]),
146
+ style: vue.normalizeStyle(transformStyle.value)
147
+ }, null, 8, ["ctype", "class", "style"])) : (vue.openBlock(), vue.createElementBlock("svg", {
148
+ key: 5,
149
+ ctype: outputType.value,
150
+ class: vue.normalizeClass([props.iconClass]),
151
+ style: vue.normalizeStyle(transformStyle.value),
152
+ "aria-hidden": "true"
153
+ }, [
154
+ vue.createElementVNode("use", {
155
+ "xlink:href": `#icon-${outputName.value}`
156
+ }, null, 8, _hoisted_5)
157
+ ], 14, _hoisted_4))
158
+ ])
159
+ ], 2);
158
160
  };
159
161
  }
160
162
  });
@@ -2,12 +2,10 @@ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, Pub
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
- default?(_: {
6
- class: string;
7
- }): any;
5
+ default?(_: {}): any;
8
6
  };
9
7
  refs: {};
10
- rootEl: any;
8
+ rootEl: HTMLElement;
11
9
  };
12
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
11
  declare const __VLS_component: DefineComponent<ExtractPropTypes<{
@@ -15,6 +13,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
15
13
  type: StringConstructor;
16
14
  default: string;
17
15
  };
16
+ iconClass: {
17
+ type: StringConstructor;
18
+ };
18
19
  type: {
19
20
  type: StringConstructor;
20
21
  };
@@ -38,6 +39,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
38
39
  type: StringConstructor;
39
40
  default: string;
40
41
  };
42
+ iconClass: {
43
+ type: StringConstructor;
44
+ };
41
45
  type: {
42
46
  type: StringConstructor;
43
47
  };
@@ -61,7 +65,7 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
61
65
  runtime: boolean;
62
66
  flip: "" | "horizontal" | "vertical" | "both";
63
67
  rotate: number;
64
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
68
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
65
69
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
66
70
  export default _default;
67
71
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, renderSlot, normalizeClass, unref, createElementBlock, createBlock, openBlock, normalizeStyle, Fragment, resolveDynamicComponent, createElementVNode } from "vue";
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createBlock, normalizeStyle, Fragment, resolveDynamicComponent, createElementVNode } from "vue";
2
2
  import { dataEmits, dataProps, dataExpose } from "./data.js";
3
3
  import { useCssName } from "../../../hooks/cssname/index.js";
4
4
  import "@fangzhongya/utils/basic/string/splitUpper";
@@ -117,42 +117,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
117
  ...dataExpose
118
118
  });
119
119
  return (_ctx, _cache) => {
120
- return renderSlot(_ctx.$slots, "default", {
120
+ return openBlock(), createElementBlock("i", {
121
121
  class: normalizeClass(unref(cs).z())
122
- }, () => [
123
- outputType.value === "css" ? (openBlock(), createElementBlock("i", {
124
- key: 0,
125
- ctype: outputType.value,
126
- class: normalizeClass([unref(cs).z(), outputName.value]),
127
- style: normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
128
- }, null, 14, _hoisted_1)) : outputType.value === "font" ? (openBlock(), createElementBlock("i", {
129
- key: 1,
130
- ctype: outputType.value,
131
- class: normalizeClass([unref(cs).z(), outputName.value]),
132
- style: normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
133
- }, null, 14, _hoisted_2)) : outputType.value === "img" ? (openBlock(), createElementBlock("img", {
134
- key: 2,
135
- ctype: outputType.value,
136
- class: normalizeClass([unref(cs).z()]),
137
- style: normalizeStyle([{ "border": "0", "display": "inline-flex", "align-items": "center", "object-fit": "contain", "justify-content": "center" }, transformStyle.value]),
138
- src: outputName.value
139
- }, null, 14, _hoisted_3)) : outputType.value === "str" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [], 64)) : outputType.value === "com" ? (openBlock(), createBlock(resolveDynamicComponent(outputName.value), {
140
- key: 4,
141
- ctype: outputType.value,
142
- class: normalizeClass([unref(cs).z()]),
143
- style: normalizeStyle(transformStyle.value)
144
- }, null, 8, ["ctype", "class", "style"])) : (openBlock(), createElementBlock("svg", {
145
- key: 5,
146
- ctype: outputType.value,
147
- class: normalizeClass([unref(cs).z()]),
148
- style: normalizeStyle(transformStyle.value),
149
- "aria-hidden": "true"
150
- }, [
151
- createElementVNode("use", {
152
- "xlink:href": `#icon-${outputName.value}`
153
- }, null, 8, _hoisted_5)
154
- ], 14, _hoisted_4))
155
- ]);
122
+ }, [
123
+ renderSlot(_ctx.$slots, "default", {}, () => [
124
+ outputType.value === "css" ? (openBlock(), createElementBlock("i", {
125
+ key: 0,
126
+ ctype: outputType.value,
127
+ class: normalizeClass([outputName.value, props.iconClass]),
128
+ style: normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
129
+ }, null, 14, _hoisted_1)) : outputType.value === "font" ? (openBlock(), createElementBlock("i", {
130
+ key: 1,
131
+ ctype: outputType.value,
132
+ class: normalizeClass([outputName.value, props.iconClass]),
133
+ style: normalizeStyle([{ "display": "inline-flex", "align-items": "center", "justify-content": "center" }, transformStyle.value])
134
+ }, null, 14, _hoisted_2)) : outputType.value === "img" ? (openBlock(), createElementBlock("img", {
135
+ key: 2,
136
+ ctype: outputType.value,
137
+ class: normalizeClass([props.iconClass]),
138
+ style: normalizeStyle([{ "border": "0", "display": "inline-flex", "align-items": "center", "object-fit": "contain", "justify-content": "center" }, transformStyle.value]),
139
+ src: outputName.value
140
+ }, null, 14, _hoisted_3)) : outputType.value === "str" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [], 64)) : outputType.value === "com" ? (openBlock(), createBlock(resolveDynamicComponent(outputName.value), {
141
+ key: 4,
142
+ ctype: outputType.value,
143
+ class: normalizeClass([props.iconClass]),
144
+ style: normalizeStyle(transformStyle.value)
145
+ }, null, 8, ["ctype", "class", "style"])) : (openBlock(), createElementBlock("svg", {
146
+ key: 5,
147
+ ctype: outputType.value,
148
+ class: normalizeClass([props.iconClass]),
149
+ style: normalizeStyle(transformStyle.value),
150
+ "aria-hidden": "true"
151
+ }, [
152
+ createElementVNode("use", {
153
+ "xlink:href": `#icon-${outputName.value}`
154
+ }, null, 8, _hoisted_5)
155
+ ], 14, _hoisted_4))
156
+ ])
157
+ ], 2);
156
158
  };
157
159
  }
158
160
  });
@@ -2,6 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const elementPlus = require("element-plus");
5
+ const index$1 = require("../../icon/index.cjs");
5
6
  const use = require("../../common/use.cjs");
6
7
  const index = require("../../../hooks/cssname/index.cjs");
7
8
  const util$1 = require("./util.cjs");
@@ -43,7 +44,7 @@ const _sfc_main = vue.defineComponent({
43
44
  if (i) {
44
45
  if (typeof i === "string") {
45
46
  return vue.h(
46
- elementPlus.ElIcon,
47
+ index$1.Icon,
47
48
  {
48
49
  class: cs.z("icon")
49
50
  },
@@ -53,7 +54,7 @@ const _sfc_main = vue.defineComponent({
53
54
  );
54
55
  } else {
55
56
  return vue.h(
56
- elementPlus.ElIcon,
57
+ index$1.Icon,
57
58
  {
58
59
  class: cs.z("icon")
59
60
  },
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, h } from "vue";
2
- import { ElSubMenu, ElMenuItem, ElIcon } from "element-plus";
2
+ import { ElSubMenu, ElMenuItem } from "element-plus";
3
+ import { Icon } from "../../icon/index.js";
3
4
  import { useHide } from "../../common/use.js";
4
5
  import { useCssName } from "../../../hooks/cssname/index.js";
5
6
  import { setLabel } from "./util.js";
@@ -41,7 +42,7 @@ const _sfc_main = defineComponent({
41
42
  if (i) {
42
43
  if (typeof i === "string") {
43
44
  return h(
44
- ElIcon,
45
+ Icon,
45
46
  {
46
47
  class: cs.z("icon")
47
48
  },
@@ -51,7 +52,7 @@ const _sfc_main = defineComponent({
51
52
  );
52
53
  } else {
53
54
  return h(
54
- ElIcon,
55
+ Icon,
55
56
  {
56
57
  class: cs.z("icon")
57
58
  },
@@ -60,17 +60,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
60
60
  if (props.domClass) {
61
61
  const v = getPrentClass.getPrentClass(dom2, props.domClass);
62
62
  if (v && refRightKey.value.contains(v)) {
63
- return true;
63
+ return v;
64
64
  }
65
65
  } else {
66
- return true;
66
+ return dom2;
67
67
  }
68
68
  }
69
- return false;
70
69
  }
71
70
  function handleContextmenu(event) {
72
71
  let target = event.target;
73
- if (isDomClass(target)) {
72
+ target = isDomClass(target);
73
+ if (target) {
74
74
  dom.value = target;
75
75
  let x = 0, y = 0;
76
76
  if (event.x || event.y) {
@@ -58,17 +58,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
58
  if (props.domClass) {
59
59
  const v = getPrentClass(dom2, props.domClass);
60
60
  if (v && refRightKey.value.contains(v)) {
61
- return true;
61
+ return v;
62
62
  }
63
63
  } else {
64
- return true;
64
+ return dom2;
65
65
  }
66
66
  }
67
- return false;
68
67
  }
69
68
  function handleContextmenu(event) {
70
69
  let target = event.target;
71
- if (isDomClass(target)) {
70
+ target = isDomClass(target);
71
+ if (target) {
72
72
  dom.value = target;
73
73
  let x = 0, y = 0;
74
74
  if (event.x || event.y) {
@@ -0,0 +1,18 @@
1
+ :root {
2
+ --icon-picker-on: rgb(91, 189, 246);
3
+ --icon-picker-border: #eee;
4
+ --color-primary: #409eff;
5
+ --bag-primary: #409eff;
6
+ --bag-primary-text: #fff;
7
+ --border: #eee;
8
+ --layout-panel-gap: 10px;
9
+ --layout-panel-padding: 20px;
10
+ --layout-form-item-padding-right: var(
11
+ --layout-panel-gap
12
+ );
13
+ --g-main-bg: var(--bg-color-page);
14
+ }
15
+
16
+ .com {
17
+ font-size: 20px;
18
+ }
package/dist/index.css CHANGED
@@ -358,6 +358,20 @@
358
358
  left: 0;
359
359
  }
360
360
 
361
+ .icon {
362
+ --color: inherit;
363
+ height: 1em;
364
+ width: 1em;
365
+ line-height: 1em;
366
+ display: inline-flex;
367
+ justify-content: center;
368
+ align-items: center;
369
+ position: relative;
370
+ fill: currentColor;
371
+ color: var(--color);
372
+ font-size: inherit;
373
+ }
374
+
361
375
  .lists-div .lists-table {
362
376
  width: 100%;
363
377
  height: 100%;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.0.22",
4
+ "version": "0.0.23",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -49,12 +49,12 @@
49
49
  "vxe-table": "4.14.4",
50
50
  "@fang-ui/components": "0.0.1-0",
51
51
  "@fang-ui/directives": "0.0.1-0",
52
- "@fang-ui/icons": "0.0.1-0",
53
52
  "@fang-ui/hooks": "0.0.1-0",
53
+ "@fang-ui/icons": "0.0.1-0",
54
54
  "@fang-ui/locale": "0.0.1-0",
55
+ "@fang-ui/theme": "0.0.1-0",
55
56
  "@fang-ui/types": "0.0.1-0",
56
- "@fang-ui/utils": "0.0.1-0",
57
- "@fang-ui/theme": "0.0.1-0"
57
+ "@fang-ui/utils": "0.0.1-0"
58
58
  },
59
59
  "main": "./dist/index.cjs",
60
60
  "module": "./dist/index.js",