@fangzhongya/fang-ui 0.1.36 → 0.1.37

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.
@@ -1,24 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const list = require("../../common/list.cjs");
3
4
  const name = "buttons";
4
5
  const dataProps = {
5
- options: {
6
- type: [Array]
7
- },
6
+ ...list.props,
8
7
  isFather: {
9
8
  type: Boolean
10
9
  },
10
+ isValue: {
11
+ type: Boolean
12
+ },
11
13
  disabled: {
12
14
  type: Boolean
13
15
  }
14
16
  };
15
- const dataEmits = ["clicks"];
17
+ const dataHandle = list.comHandle;
18
+ const dataEmits = [...list.emits, "clicks"];
16
19
  const dataSlot = {
17
20
  default: "default"
18
21
  };
19
22
  const dataExpose = {};
20
23
  exports.dataEmits = dataEmits;
21
24
  exports.dataExpose = dataExpose;
25
+ exports.dataHandle = dataHandle;
22
26
  exports.dataProps = dataProps;
23
27
  exports.dataSlot = dataSlot;
24
28
  exports.name = name;
@@ -1,9 +1,19 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
+ import { comHandle } from '../../common/list';
2
3
  /**
3
4
  * @title {h3} buttons
4
5
  */
5
6
  export declare const name = "buttons";
6
7
  export declare const dataProps: {
8
+ isFather: {
9
+ type: BooleanConstructor;
10
+ };
11
+ isValue: {
12
+ type: BooleanConstructor;
13
+ };
14
+ disabled: {
15
+ type: BooleanConstructor;
16
+ };
7
17
  options: {
8
18
  type: {
9
19
  (arrayLength: number): ObjAny[];
@@ -20,13 +30,31 @@ export declare const dataProps: {
20
30
  fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
21
31
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
22
32
  readonly [Symbol.species]: ArrayConstructor;
23
- }[];
33
+ };
34
+ default(): never[];
24
35
  };
25
- isFather: {
36
+ clearAbsent: {
26
37
  type: BooleanConstructor;
27
38
  };
28
- disabled: {
29
- type: BooleanConstructor;
39
+ label: {
40
+ type: (StringConstructor | FunctionConstructor)[];
41
+ default: string;
42
+ };
43
+ prop: {
44
+ type: (StringConstructor | FunctionConstructor)[];
45
+ default: string;
46
+ };
47
+ modelValue: {
48
+ type: null;
49
+ };
50
+ multiple: {
51
+ type: (BooleanConstructor | StringConstructor)[];
52
+ };
53
+ load: {
54
+ type: BooleanConstructor[];
55
+ };
56
+ optobj: {
57
+ type: BooleanConstructor[];
30
58
  };
31
59
  };
32
60
  export type DataProps = ExtractPropTypes<typeof dataProps>;
@@ -34,6 +62,7 @@ export type DataProps = ExtractPropTypes<typeof dataProps>;
34
62
  * @emits change (val:[String, Array])
35
63
  * 选择的时间
36
64
  */
65
+ export declare const dataHandle: typeof comHandle;
37
66
  export declare const dataEmits: string[];
38
67
  export type DataEmits = typeof dataEmits;
39
68
  /**
@@ -1,16 +1,19 @@
1
+ import { props, comHandle, emits } from "../../common/list.js";
1
2
  const name = "buttons";
2
3
  const dataProps = {
3
- options: {
4
- type: [Array]
5
- },
4
+ ...props,
6
5
  isFather: {
7
6
  type: Boolean
8
7
  },
8
+ isValue: {
9
+ type: Boolean
10
+ },
9
11
  disabled: {
10
12
  type: Boolean
11
13
  }
12
14
  };
13
- const dataEmits = ["clicks"];
15
+ const dataHandle = comHandle;
16
+ const dataEmits = [...emits, "clicks"];
14
17
  const dataSlot = {
15
18
  default: "default"
16
19
  };
@@ -18,6 +21,7 @@ const dataExpose = {};
18
21
  export {
19
22
  dataEmits,
20
23
  dataExpose,
24
+ dataHandle,
21
25
  dataProps,
22
26
  dataSlot,
23
27
  name
@@ -14,6 +14,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
14
14
  const prs = __props;
15
15
  const props = index$1.usePropsDefault(data.name, prs, data.dataProps);
16
16
  const emit = __emit;
17
+ const listFuObj = data.dataHandle(props, emit);
18
+ const value = listFuObj.value;
19
+ const multiple = listFuObj.multiple;
20
+ const valueOptions = vue.computed(() => {
21
+ if (props.isValue) {
22
+ return listFuObj.getValueObjs(value.value);
23
+ } else {
24
+ return props.options;
25
+ }
26
+ });
17
27
  function onClick(obj, index2, $event) {
18
28
  if (obj.click) {
19
29
  obj.click(obj, index2, $event);
@@ -25,7 +35,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
35
  ...data.dataExpose
26
36
  });
27
37
  return (_ctx, _cache) => {
28
- return vue.unref(props).isFather ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(props).options, (item, index2) => {
38
+ return vue.unref(props).isFather ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(valueOptions.value, (item, index2) => {
29
39
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
30
40
  !item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.Button), vue.mergeProps({
31
41
  key: 0,
@@ -44,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
54
  key: 1,
45
55
  class: vue.normalizeClass(vue.unref(cs).z())
46
56
  }, [
47
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).options, (item, index2) => {
57
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(valueOptions.value, (item, index2) => {
48
58
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
49
59
  !item.hide ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.Button), vue.mergeProps({
50
60
  key: 0,
@@ -1,6 +1,6 @@
1
- import { defineComponent, createElementBlock, unref, openBlock, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withModifiers, withCtx, createTextVNode, toDisplayString, normalizeClass } from "vue";
1
+ import { defineComponent, computed, createElementBlock, unref, openBlock, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withModifiers, withCtx, createTextVNode, toDisplayString, normalizeClass } from "vue";
2
2
  import { Button } from "../../button/index.js";
3
- import { name, dataProps, dataExpose, dataEmits } from "./data.js";
3
+ import { name, dataProps, dataHandle, dataExpose, dataEmits } from "./data.js";
4
4
  import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
5
5
  import { useCssName } from "../../../hooks/cssname/index.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -12,6 +12,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  const prs = __props;
13
13
  const props = usePropsDefault(name, prs, dataProps);
14
14
  const emit = __emit;
15
+ const listFuObj = dataHandle(props, emit);
16
+ const value = listFuObj.value;
17
+ const multiple = listFuObj.multiple;
18
+ const valueOptions = computed(() => {
19
+ if (props.isValue) {
20
+ return listFuObj.getValueObjs(value.value);
21
+ } else {
22
+ return props.options;
23
+ }
24
+ });
15
25
  function onClick(obj, index, $event) {
16
26
  if (obj.click) {
17
27
  obj.click(obj, index, $event);
@@ -23,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
33
  ...dataExpose
24
34
  });
25
35
  return (_ctx, _cache) => {
26
- return unref(props).isFather ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(props).options, (item, index) => {
36
+ return unref(props).isFather ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(valueOptions.value, (item, index) => {
27
37
  return openBlock(), createElementBlock(Fragment, { key: index }, [
28
38
  !item.hide ? (openBlock(), createBlock(unref(Button), mergeProps({
29
39
  key: 0,
@@ -42,7 +52,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
52
  key: 1,
43
53
  class: normalizeClass(unref(cs).z())
44
54
  }, [
45
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(props).options, (item, index) => {
55
+ (openBlock(true), createElementBlock(Fragment, null, renderList(valueOptions.value, (item, index) => {
46
56
  return openBlock(), createElementBlock(Fragment, { key: index }, [
47
57
  !item.hide ? (openBlock(), createBlock(unref(Button), mergeProps({
48
58
  key: 0,
@@ -226,7 +226,7 @@ function processOptions(obj, componObj, optionss, value, data) {
226
226
  }
227
227
  function renderComponent(tcom, compon, componObj, value, compons) {
228
228
  if (Object.keys(compons).includes(tcom)) {
229
- return vue.h(compons[tcom], componObj, value);
229
+ return vue.h(compons[tcom], componObj);
230
230
  }
231
231
  if (shared.isHTMLTag(compon) || shared.isSVGTag(compon)) {
232
232
  return vue.h(compon, componObj, value);
@@ -224,7 +224,7 @@ function processOptions(obj, componObj, optionss, value, data) {
224
224
  }
225
225
  function renderComponent(tcom, compon, componObj, value, compons) {
226
226
  if (Object.keys(compons).includes(tcom)) {
227
- return h(compons[tcom], componObj, value);
227
+ return h(compons[tcom], componObj);
228
228
  }
229
229
  if (isHTMLTag(compon) || isSVGTag(compon)) {
230
230
  return h(compon, componObj, value);
@@ -26,7 +26,8 @@
26
26
  width: 100%;
27
27
  display: inline-flex;
28
28
  align-items: center;
29
- padding: 1px;
29
+ box-sizing: content-box;
30
+ padding: 1.2px 1px;
30
31
  position: relative;
31
32
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
32
33
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -5,7 +5,8 @@ $double: 'double';
5
5
  width: 100%;
6
6
  display: inline-flex;
7
7
  align-items: center;
8
- padding: 1px;
8
+ box-sizing: content-box;
9
+ padding: 1.2px 1px;
9
10
  position: relative;
10
11
  box-shadow: 0 0 0 1px
11
12
  var(--#{e()}input-border-color, var(--#{e()}border-color)) inset;
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -78,7 +78,8 @@
78
78
  width: 100%;
79
79
  display: inline-flex;
80
80
  align-items: center;
81
- padding: 1px;
81
+ box-sizing: content-box;
82
+ padding: 1.2px 1px;
82
83
  position: relative;
83
84
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
84
85
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -40,7 +40,7 @@ function handlePropertyMapping(value, ckey, obj, robj, vxeconfig, table) {
40
40
  const propertyHandlers = {
41
41
  showOverflow: () => robj["show-overflow"] = value ? "tooltip" : void 0,
42
42
  showOverflowTooltip: () => robj["show-overflow"] = value ? "tooltip" : void 0,
43
- label: () => robj["title"] = value,
43
+ // label: () => (robj['title'] = value),
44
44
  sortable: () => robj[ckey] = value ? true : void 0,
45
45
  prop: () => robj["field"] = value,
46
46
  fixed: () => robj["fixed"] = value === true ? "left" : value,
@@ -111,7 +111,7 @@ function defaultDom(obj, scope, props, index2) {
111
111
  } else if (obj.type == "selection") {
112
112
  return;
113
113
  }
114
- domValue = use.useGetDomValue(obj, scope.row, props.options, scope.$index);
114
+ domValue = use.useGetDomValue(obj, scope.row, props.options, scope.$rowIndex);
115
115
  return vue.h(
116
116
  "span",
117
117
  {
@@ -38,7 +38,7 @@ function handlePropertyMapping(value, ckey, obj, robj, vxeconfig, table) {
38
38
  const propertyHandlers = {
39
39
  showOverflow: () => robj["show-overflow"] = value ? "tooltip" : void 0,
40
40
  showOverflowTooltip: () => robj["show-overflow"] = value ? "tooltip" : void 0,
41
- label: () => robj["title"] = value,
41
+ // label: () => (robj['title'] = value),
42
42
  sortable: () => robj[ckey] = value ? true : void 0,
43
43
  prop: () => robj["field"] = value,
44
44
  fixed: () => robj["fixed"] = value === true ? "left" : value,
@@ -109,7 +109,7 @@ function defaultDom(obj, scope, props, index) {
109
109
  } else if (obj.type == "selection") {
110
110
  return;
111
111
  }
112
- domValue = useGetDomValue(obj, scope.row, props.options, scope.$index);
112
+ domValue = useGetDomValue(obj, scope.row, props.options, scope.$rowIndex);
113
113
  return h(
114
114
  "span",
115
115
  {
@@ -27,7 +27,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
27
27
  index$3.useCompons(config.provides.compons, props);
28
28
  const tableRef = vue.ref();
29
29
  const emit = __emit;
30
- console.log("props.maxHeight", props.maxHeight);
31
30
  const rowObj = vue.ref();
32
31
  const isfocus = vue.ref(false);
33
32
  function onClick() {
@@ -105,6 +104,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
105
104
  trigger: attrs.assem.isRowSelect ? "row" : "cell"
106
105
  }
107
106
  });
107
+ const spanMethod = function(obj) {
108
+ const method = attrs.assem.spanMethod;
109
+ if (method) {
110
+ const v = method(obj);
111
+ if (v) {
112
+ return { rowspan: v[0], colspan: v[1] };
113
+ }
114
+ }
115
+ };
108
116
  const rowStyle = vue.computed(() => {
109
117
  const height = props.lineHeight;
110
118
  const rowStyle2 = attrs.assem.rowStyle;
@@ -233,6 +241,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
233
241
  "sort-config": config$1.value.sort,
234
242
  "checkbox-config": config$1.value.checkbox,
235
243
  "radio-config": config$1.value.radio,
244
+ "span-method": spanMethod,
236
245
  data: vue.unref(props).value,
237
246
  onCellClick,
238
247
  onSortChange: sortChange,
@@ -25,7 +25,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
25
  useCompons(provides.compons, props);
26
26
  const tableRef = ref();
27
27
  const emit = __emit;
28
- console.log("props.maxHeight", props.maxHeight);
29
28
  const rowObj = ref();
30
29
  const isfocus = ref(false);
31
30
  function onClick() {
@@ -103,6 +102,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
102
  trigger: attrs.assem.isRowSelect ? "row" : "cell"
104
103
  }
105
104
  });
105
+ const spanMethod = function(obj) {
106
+ const method = attrs.assem.spanMethod;
107
+ if (method) {
108
+ const v = method(obj);
109
+ if (v) {
110
+ return { rowspan: v[0], colspan: v[1] };
111
+ }
112
+ }
113
+ };
106
114
  const rowStyle = computed(() => {
107
115
  const height = props.lineHeight;
108
116
  const rowStyle2 = attrs.assem.rowStyle;
@@ -231,6 +239,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
231
239
  "sort-config": config.value.sort,
232
240
  "checkbox-config": config.value.checkbox,
233
241
  "radio-config": config.value.radio,
242
+ "span-method": spanMethod,
234
243
  data: unref(props).value,
235
244
  onCellClick,
236
245
  onSortChange: sortChange,
@@ -26,7 +26,8 @@
26
26
  width: 100%;
27
27
  display: inline-flex;
28
28
  align-items: center;
29
- padding: 1px;
29
+ box-sizing: content-box;
30
+ padding: 1.2px 1px;
30
31
  position: relative;
31
32
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
32
33
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
package/dist/css/page.css CHANGED
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -78,7 +78,8 @@
78
78
  width: 100%;
79
79
  display: inline-flex;
80
80
  align-items: center;
81
- padding: 1px;
81
+ box-sizing: content-box;
82
+ padding: 1.2px 1px;
82
83
  position: relative;
83
84
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
84
85
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1764065519442,
4
+ "lastModified": 1764079293714,
5
5
  "icons": {
6
6
  "bar": {
7
7
  "body": " <path fill=\"currentColor\" d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\" ></path> "
package/dist/index.css CHANGED
@@ -53,7 +53,8 @@
53
53
  width: 100%;
54
54
  display: inline-flex;
55
55
  align-items: center;
56
- padding: 1px;
56
+ box-sizing: content-box;
57
+ padding: 1.2px 1px;
57
58
  position: relative;
58
59
  box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
59
60
  border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.36",
4
+ "version": "0.1.37",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -51,9 +51,9 @@
51
51
  "vue-tsc": "^3.1.5",
52
52
  "vxe-table": "4.6.20",
53
53
  "@fang-ui/components": "0.0.1-0",
54
- "@fang-ui/hooks": "0.0.1-0",
55
54
  "@fang-ui/directives": "0.0.1-0",
56
55
  "@fang-ui/icons": "0.0.1-0",
56
+ "@fang-ui/hooks": "0.0.1-0",
57
57
  "@fang-ui/locale": "0.0.1-0",
58
58
  "@fang-ui/theme": "0.0.1-0",
59
59
  "@fang-ui/types": "0.0.1-0",
File without changes
File without changes