cnhis-design-vue 3.1.9-beta.12 → 3.1.9-beta.13

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.
Files changed (44) hide show
  1. package/es/packages/fabric-chart/index.d.ts +34 -0
  2. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +34 -0
  3. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +12 -9
  4. package/es/packages/fabric-chart/src/hooks/useCenter.d.ts +4 -0
  5. package/es/packages/fabric-chart/src/hooks/useCenter.js +7 -0
  6. package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +10 -3
  7. package/es/packages/fabric-chart/src/hooks/useDraw.js +9 -8
  8. package/es/packages/fabric-chart/src/hooks/useGrid.d.ts +4 -1
  9. package/es/packages/fabric-chart/src/hooks/useGrid.js +4 -6
  10. package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +4 -0
  11. package/es/packages/fabric-chart/src/hooks/useLeft.js +66 -0
  12. package/es/packages/fabric-chart/src/hooks/useTop.d.ts +4 -0
  13. package/es/packages/fabric-chart/src/hooks/useTop.js +124 -0
  14. package/es/packages/fabric-chart/src/interface.d.ts +10 -2
  15. package/es/packages/fabric-chart/src/utils/index.d.ts +2 -0
  16. package/es/packages/fabric-chart/src/utils/index.js +15352 -0
  17. package/es/packages/form-render/index.d.ts +1 -1
  18. package/es/packages/form-render/index.js +1 -0
  19. package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
  20. package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +9 -4
  21. package/es/packages/form-render/src/hooks/index.d.ts +1 -0
  22. package/es/packages/form-render/src/hooks/index.js +1 -0
  23. package/es/packages/form-render/src/hooks/useInitialData.d.ts +5 -0
  24. package/es/packages/form-render/src/hooks/useInitialData.js +11 -0
  25. package/es/packages/index.css +13 -4
  26. package/es/packages/index.js +1 -0
  27. package/es/packages/scale-view/src/ScaleView.vue_vue_type_script_setup_true_lang.js +6 -2
  28. package/es/packages/scale-view/src/components/composables/choose-common.d.ts +1 -0
  29. package/es/packages/scale-view/src/components/composables/choose-common.js +6 -1
  30. package/es/packages/scale-view/src/components/formitem/r-checkbox.js +11 -5
  31. package/es/packages/scale-view/src/components/formitem/r-radio.js +14 -7
  32. package/es/packages/scale-view/src/hooks/scaleview-init.js +3 -1
  33. package/es/packages/scale-view/style/index.css +13 -4
  34. package/es/packages/select-label/src/LabelFormContent.vue_vue_type_script_setup_true_lang.js +1 -2
  35. package/package.json +1 -4
  36. package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.js +0 -1
  37. package/es/packages/bpmn-workflow/types/BpmnViewer.d.js +0 -1
  38. package/es/packages/bpmn-workflow/types/ModelingModule.d.js +0 -1
  39. package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.js +0 -1
  40. package/es/packages/fabric-chart/src/Center.js +0 -4
  41. package/es/packages/fabric-chart/src/Center.vue.d.ts +0 -2
  42. package/es/packages/fabric-chart/src/Center.vue_vue_type_script_setup_true_lang.js +0 -15
  43. package/es/packages/fabric-chart/src/Top.js +0 -4
  44. package/es/packages/fabric-chart/src/Top.vue_vue_type_script_setup_true_lang.js +0 -128
@@ -251,7 +251,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
251
251
  "x-read-pretty"?: boolean | undefined;
252
252
  "x-compile-omitted"?: string[] | undefined;
253
253
  }>>;
254
- renderSchema: import("vue").ComputedRef<import("@formily/json-schema").Stringify<{
254
+ parsedSchema: import("vue").ComputedRef<import("@formily/json-schema").Stringify<{
255
255
  [key: symbol]: any;
256
256
  [key: `x-${string}`]: any;
257
257
  [key: `x-${number}`]: any;
@@ -13,6 +13,7 @@ export { useFormValidator } from './src/hooks/useFormValidator.js';
13
13
  export { BusinessCollector, useBusinessBinding } from './src/hooks/useBusinessBinding.js';
14
14
  export { ContextCollector, useChangeContext } from './src/hooks/useChangeContext.js';
15
15
  export { FormItemDepsCollector, useFormItemDeps } from './src/hooks/useFormItemDeps.js';
16
+ export { useInitialData } from './src/hooks/useInitialData.js';
16
17
 
17
18
  const FormRender = script;
18
19
  FormRender.install = function(app) {
@@ -251,7 +251,7 @@ declare const _default: import("vue").DefineComponent<{
251
251
  "x-read-pretty"?: boolean | undefined;
252
252
  "x-compile-omitted"?: string[] | undefined;
253
253
  }>>;
254
- renderSchema: import("vue").ComputedRef<import("@formily/vue").Stringify<{
254
+ parsedSchema: import("vue").ComputedRef<import("@formily/vue").Stringify<{
255
255
  [key: symbol]: any;
256
256
  [key: `x-${string}`]: any;
257
257
  [key: `x-${number}`]: any;
@@ -7,6 +7,7 @@ import * as index from './components/index.js';
7
7
  import { InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.js';
8
8
  import { injectOrProvide } from './utils/index.js';
9
9
  import { useBusinessBinding } from './hooks/useBusinessBinding.js';
10
+ import { useInitialData } from './hooks/useInitialData.js';
10
11
  import { useAsyncQueue } from './hooks/useAsyncQueue.js';
11
12
  import { useChangeContext } from './hooks/useChangeContext.js';
12
13
  import { useFormItemDeps } from './hooks/useFormItemDeps.js';
@@ -43,10 +44,11 @@ var script = /* @__PURE__ */ defineComponent({
43
44
  const formItemDepsCollector = useFormItemDeps().create();
44
45
  provide(InjectionFormItemDepsCollector, formItemDepsCollector);
45
46
  const formModel = createForm({
46
- initialValues: props.initialData,
47
+ initialValues: useInitialData().assignInitialData(props.initialData, props.fieldList),
47
48
  effects() {
48
49
  onFieldValueChange("*", (field) => {
49
50
  const fieldKey = field.props.name.toString();
51
+ console.log("emitChange");
50
52
  emit("formChange", {
51
53
  fieldInstance: field,
52
54
  fieldKey,
@@ -60,12 +62,15 @@ var script = /* @__PURE__ */ defineComponent({
60
62
  }
61
63
  });
62
64
  const SchemaField = injectOrProvide(InjectionSchemaField, () => createSchemaField({
63
- components: { ...index, ...props.components },
65
+ components: {
66
+ ...index,
67
+ ...props.components
68
+ },
64
69
  scope: props.scope
65
70
  }).SchemaField);
66
71
  const { traverse } = useFieldVisitor();
67
72
  const { transform } = useFieldList2Schema(businessCollector);
68
- const renderSchema = computed(() => {
73
+ const parsedSchema = computed(() => {
69
74
  if (props.schema) {
70
75
  return props.schema;
71
76
  }
@@ -103,7 +108,7 @@ var script = /* @__PURE__ */ defineComponent({
103
108
  createVNode(unref(FormProvider), { form: unref(formModel) }, {
104
109
  default: withCtx(() => [
105
110
  renderSlot(_ctx.$slots, "default", { schemaFiled: unref(SchemaField) }, () => [
106
- createVNode(unref(SchemaField), { schema: unref(renderSchema) }, null, 8, ["schema"])
111
+ createVNode(unref(SchemaField), { schema: unref(parsedSchema) }, null, 8, ["schema"])
107
112
  ]),
108
113
  __props.consumer ? (openBlock(), createBlock(unref(FormConsumer), { key: 0 }, {
109
114
  default: withCtx(({ form }) => [
@@ -9,3 +9,4 @@ export * from './useFormValidator';
9
9
  export * from './useBusinessBinding';
10
10
  export * from './useChangeContext';
11
11
  export * from './useFormItemDeps';
12
+ export * from './useInitialData';
@@ -9,3 +9,4 @@ export { useFormValidator } from './useFormValidator.js';
9
9
  export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.js';
10
10
  export { ContextCollector, useChangeContext } from './useChangeContext.js';
11
11
  export { FormItemDepsCollector, useFormItemDeps } from './useFormItemDeps.js';
12
+ export { useInitialData } from './useInitialData.js';
@@ -0,0 +1,5 @@
1
+ import { AnyObject } from '../../../../../es/src/types';
2
+ import { FieldItem } from '../../../../../es/packages/form-render';
3
+ export declare function useInitialData(): {
4
+ assignInitialData: (initialData?: AnyObject, fieldList?: FieldItem[]) => AnyObject;
5
+ };
@@ -0,0 +1,11 @@
1
+ function useInitialData() {
2
+ function assignInitialData(initialData, fieldList) {
3
+ return Object.assign({}, initialData, fieldList == null ? void 0 : fieldList.reduce((fin, cur) => {
4
+ cur.default_val && (fin[cur.val_key] = cur.default_val);
5
+ return fin;
6
+ }, {}));
7
+ }
8
+ return { assignInitialData };
9
+ }
10
+
11
+ export { useInitialData };
@@ -1557,6 +1557,12 @@ body > .vxe-table--tooltip-wrapper {
1557
1557
  max-width: 300px;
1558
1558
  border-bottom: 1px solid #d9d9d9;
1559
1559
  }
1560
+ .c-choice-wrap .choose-other {
1561
+ flex: 1;
1562
+ }
1563
+ .c-choice-wrap .other-span {
1564
+ word-break: break-all;
1565
+ }
1560
1566
  .c-choice-wrap.choice-wrap-1 label {
1561
1567
  width: 100%;
1562
1568
  }
@@ -1636,6 +1642,9 @@ body > .vxe-table--tooltip-wrapper {
1636
1642
  .c-scale .scale-container.scale-container-nopadding {
1637
1643
  height: 100%;
1638
1644
  }
1645
+ .c-scale .scale-container.scale-container-hasfooter {
1646
+ height: calc(100% - 50px);
1647
+ }
1639
1648
  .c-scale .scale-container::-webkit-scrollbar {
1640
1649
  width: 10px;
1641
1650
  height: 6px;
@@ -1673,7 +1682,6 @@ body > .vxe-table--tooltip-wrapper {
1673
1682
  width: 100%;
1674
1683
  }
1675
1684
  .main {
1676
- padding: 0 16px;
1677
1685
  box-sizing: border-box;
1678
1686
  }
1679
1687
  .main .scale-label-required {
@@ -1708,12 +1716,13 @@ body > .vxe-table--tooltip-wrapper {
1708
1716
  position: absolute;
1709
1717
  bottom: 0;
1710
1718
  left: 0;
1719
+ display: flex;
1720
+ align-items: center;
1711
1721
  width: 100%;
1712
- border-top: 1px solid #e8e8e8;
1713
- padding-top: 12px;
1714
1722
  height: 50px;
1715
- box-sizing: border-box;
1716
1723
  background: #fff;
1724
+ box-sizing: border-box;
1725
+ border-top: 1px solid #e8e8e8;
1717
1726
  }
1718
1727
  .footer .n-button + .n-button {
1719
1728
  margin-left: 8px;
@@ -43,6 +43,7 @@ export { useFormValidator } from './form-render/src/hooks/useFormValidator.js';
43
43
  export { BusinessCollector, useBusinessBinding } from './form-render/src/hooks/useBusinessBinding.js';
44
44
  export { ContextCollector, useChangeContext } from './form-render/src/hooks/useChangeContext.js';
45
45
  export { FormItemDepsCollector, useFormItemDeps } from './form-render/src/hooks/useFormItemDeps.js';
46
+ export { useInitialData } from './form-render/src/hooks/useInitialData.js';
46
47
 
47
48
  const components = {
48
49
  CGrid: Grid,
@@ -192,6 +192,10 @@ var script = /* @__PURE__ */ defineComponent({
192
192
  isSetObj && (state.choiceComObj[item.val_key] = choiceObj);
193
193
  nextLogicEvent(val, item, state.formArray);
194
194
  break;
195
+ case "EVALUATE_RADIO_BLOCK":
196
+ case "EVALUATE_CHECKBOX_BLOCK":
197
+ nextLogicEvent(val, item, state.formArray);
198
+ break;
195
199
  case "DATE":
196
200
  case "TIME":
197
201
  case "DATETIME":
@@ -313,7 +317,7 @@ var script = /* @__PURE__ */ defineComponent({
313
317
  ref: countdownDom
314
318
  }, unref(evaluateCountdownProps), { onCloseEvaluateCountdown: closeEvaluateCountdown }), null, 16)) : createCommentVNode("v-if", true),
315
319
  createElementVNode("div", {
316
- class: normalizeClass(["scale-container", { "scale-container-nopadding": unref(handlePageClass) }]),
320
+ class: normalizeClass(["scale-container", { "scale-container-nopadding": unref(handlePageClass), "scale-container-hasfooter": unref(showSaveBtn) }]),
317
321
  style: normalizeStyle(unref(scaleStyle))
318
322
  }, [
319
323
  unref(hasScore) ? (openBlock(), createBlock(unref(ScaleScore), {
@@ -386,7 +390,7 @@ var script = /* @__PURE__ */ defineComponent({
386
390
  key: 0,
387
391
  onClick: onSubmit,
388
392
  disabled: state.banSubmit,
389
- type: "info"
393
+ type: "primary"
390
394
  }, {
391
395
  default: withCtx(() => [
392
396
  _hoisted_8
@@ -7,4 +7,5 @@ export default function (props: any, state: any): {
7
7
  showPreSuffix: import("vue").ComputedRef<(o: any) => any>;
8
8
  handleDefPreSuffix: (v: any, i: number, curValue: any, isCheckbox?: boolean, hasOther?: boolean) => any;
9
9
  handleOptions: (options: any) => any;
10
+ stopClick: (e: any) => void;
10
11
  };
@@ -63,6 +63,10 @@ function chooseCommon(props, state) {
63
63
  return null;
64
64
  }).filter(Boolean) || [];
65
65
  };
66
+ const stopClick = (e) => {
67
+ e.preventDefault();
68
+ e.stopPropagation();
69
+ };
66
70
  return {
67
71
  choiceUseKey,
68
72
  choiceColor,
@@ -71,7 +75,8 @@ function chooseCommon(props, state) {
71
75
  isCheckboxItem,
72
76
  showPreSuffix,
73
77
  handleDefPreSuffix,
74
- handleOptions
78
+ handleOptions,
79
+ stopClick
75
80
  };
76
81
  }
77
82
 
@@ -52,7 +52,8 @@ var scriptCheckbox = defineComponent({
52
52
  choiceUseKey,
53
53
  isCheckboxItem,
54
54
  showPreSuffix,
55
- handleOptions
55
+ handleOptions,
56
+ stopClick
56
57
  } = chooseCommon(props, state);
57
58
  const chooseStyleSetting = ((_b = (_a = props.item) == null ? void 0 : _a.setting) == null ? void 0 : _b.chooseStyleSetting) || 1;
58
59
  const handlePreview = (e, url) => {
@@ -206,7 +207,8 @@ var scriptCheckbox = defineComponent({
206
207
  };
207
208
  const renderPresuffix = (o, i) => {
208
209
  return createVNode("div", {
209
- "class": "presuffix-wrap"
210
+ "class": "presuffix-wrap",
211
+ "onClick": stopClick
210
212
  }, [o.prefix && createVNode("span", {
211
213
  "class": "prefix-span",
212
214
  "style": {
@@ -233,11 +235,15 @@ var scriptCheckbox = defineComponent({
233
235
  return createVNode("span", {
234
236
  "style": {
235
237
  color: choiceColor.value(o)
236
- }
238
+ },
239
+ "class": "other-span"
237
240
  }, [o.label]);
238
241
  };
239
242
  const renderOther = (o) => {
240
- return createVNode(resolveComponent("n-input"), {
243
+ return createVNode("div", {
244
+ "class": "choose-other",
245
+ "onClick": stopClick
246
+ }, [createVNode(resolveComponent("n-input"), {
241
247
  "value": state.othersText,
242
248
  "onUpdate:value": [($event) => state.othersText = $event, () => handleCheckboxOther(true)],
243
249
  "disabled": props.isLock || props.inputLock,
@@ -246,7 +252,7 @@ var scriptCheckbox = defineComponent({
246
252
  },
247
253
  "placeholder": "\u8BF7\u8F93\u5165",
248
254
  "bordered": false
249
- }, null);
255
+ }, null)]);
250
256
  };
251
257
  const hasPreSuffix = (o) => {
252
258
  return isCheckboxItem.value && showPreSuffix.value(o);
@@ -51,7 +51,8 @@ var scriptRadio = defineComponent({
51
51
  choiceUseKey,
52
52
  isRadioItem,
53
53
  showPreSuffix,
54
- handleOptions
54
+ handleOptions,
55
+ stopClick
55
56
  } = chooseCommon(props, state);
56
57
  const chooseStyleSetting = ((_b = (_a = props.item) == null ? void 0 : _a.setting) == null ? void 0 : _b.chooseStyleSetting) || 1;
57
58
  const handlePreview = (e, url) => {
@@ -125,7 +126,8 @@ var scriptRadio = defineComponent({
125
126
  }, {
126
127
  immediate: true
127
128
  });
128
- const inputPreSuffixChange = (o, i) => {
129
+ const inputPreSuffixChange = (val, o, i) => {
130
+ state.optionsPreSuffixObj[o.key] = val;
129
131
  state.curvalue = o.key;
130
132
  let choiceObj = {
131
133
  othersText: state.othersText,
@@ -165,7 +167,8 @@ var scriptRadio = defineComponent({
165
167
  };
166
168
  const renderPresuffix = (o, i) => {
167
169
  return createVNode("div", {
168
- "class": "presuffix-wrap"
170
+ "class": "presuffix-wrap",
171
+ "onClick": stopClick
169
172
  }, [o.prefix && createVNode("span", {
170
173
  "class": "prefix-span",
171
174
  "style": {
@@ -180,7 +183,7 @@ var scriptRadio = defineComponent({
180
183
  },
181
184
  "placeholder": "\u8BF7\u8F93\u5165",
182
185
  "bordered": false,
183
- "onInput": () => inputPreSuffixChange(o)
186
+ "on-update:value": (val) => inputPreSuffixChange(val, o)
184
187
  }, null), o.suffix && createVNode("span", {
185
188
  "class": "suffix-span",
186
189
  "style": {
@@ -192,11 +195,15 @@ var scriptRadio = defineComponent({
192
195
  return createVNode("span", {
193
196
  "style": {
194
197
  color: choiceColor.value(o)
195
- }
198
+ },
199
+ "class": "other-span"
196
200
  }, [o.label]);
197
201
  };
198
202
  const renderOther = (o) => {
199
- return createVNode(resolveComponent("n-input"), {
203
+ return createVNode("div", {
204
+ "class": "choose-other",
205
+ "onClick": stopClick
206
+ }, [createVNode(resolveComponent("n-input"), {
200
207
  "value": state.othersText,
201
208
  "onUpdate:value": [($event) => state.othersText = $event, inputChange],
202
209
  "disabled": props.isLock || props.inputLock,
@@ -205,7 +212,7 @@ var scriptRadio = defineComponent({
205
212
  },
206
213
  "placeholder": "\u8BF7\u8F93\u5165",
207
214
  "bordered": false
208
- }, null);
215
+ }, null)]);
209
216
  };
210
217
  const hasPreSuffix = (o) => {
211
218
  return isRadioItem.value && showPreSuffix.value(o);
@@ -127,7 +127,9 @@ const ScaleViewInit = (props, state, emit, config) => {
127
127
  list = list.filter((v) => !filterArr.includes(v.type));
128
128
  state.formArray = formatArray(list || []);
129
129
  state.form = defaultFormValue(state.formArray);
130
- state.rules = formatRules(state.formArray);
130
+ if (!props.noBtn) {
131
+ state.rules = formatRules(state.formArray);
132
+ }
131
133
  state.fontSize = data.fontSize;
132
134
  state.spinning = false;
133
135
  state.hasFrontAddress = false;
@@ -54,6 +54,12 @@
54
54
  max-width: 300px;
55
55
  border-bottom: 1px solid #d9d9d9;
56
56
  }
57
+ .c-choice-wrap .choose-other {
58
+ flex: 1;
59
+ }
60
+ .c-choice-wrap .other-span {
61
+ word-break: break-all;
62
+ }
57
63
  .c-choice-wrap.choice-wrap-1 label {
58
64
  width: 100%;
59
65
  }
@@ -133,6 +139,9 @@
133
139
  .c-scale .scale-container.scale-container-nopadding {
134
140
  height: 100%;
135
141
  }
142
+ .c-scale .scale-container.scale-container-hasfooter {
143
+ height: calc(100% - 50px);
144
+ }
136
145
  .c-scale .scale-container::-webkit-scrollbar {
137
146
  width: 10px;
138
147
  height: 6px;
@@ -170,7 +179,6 @@
170
179
  width: 100%;
171
180
  }
172
181
  .main {
173
- padding: 0 16px;
174
182
  box-sizing: border-box;
175
183
  }
176
184
  .main .scale-label-required {
@@ -205,12 +213,13 @@
205
213
  position: absolute;
206
214
  bottom: 0;
207
215
  left: 0;
216
+ display: flex;
217
+ align-items: center;
208
218
  width: 100%;
209
- border-top: 1px solid #e8e8e8;
210
- padding-top: 12px;
211
219
  height: 50px;
212
- box-sizing: border-box;
213
220
  background: #fff;
221
+ box-sizing: border-box;
222
+ border-top: 1px solid #e8e8e8;
214
223
  }
215
224
  .footer .n-button + .n-button {
216
225
  margin-left: 8px;
@@ -326,7 +326,6 @@ var script = /* @__PURE__ */ defineComponent({
326
326
  return (_ctx, _cache) => {
327
327
  return openBlock(), createElementBlock("div", {
328
328
  class: "c-label-form-content",
329
- key: unref(theKey),
330
329
  ref_key: "labelFormContent",
331
330
  ref: labelFormContent
332
331
  }, [
@@ -434,7 +433,7 @@ var script = /* @__PURE__ */ defineComponent({
434
433
  ], 512), [
435
434
  [vShow, !unref(allDisable)]
436
435
  ])
437
- ]);
436
+ ], 512);
438
437
  };
439
438
  }
440
439
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.9-beta.12",
4
+ "version": "3.1.9-beta.13",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.js",
7
7
  "main": "es/packages/index.js",
@@ -32,7 +32,6 @@
32
32
  "@formily/core": "^2.1.9",
33
33
  "@formily/vue": "^2.1.9",
34
34
  "@highlightjs/vue-plugin": "^2.1.0",
35
- "@types/fabric": "^4.5.9",
36
35
  "@vicons/ionicons5": "^0.12.0",
37
36
  "@vueuse/core": "^8.6.0",
38
37
  "@vueuse/shared": "^8.6.0",
@@ -41,9 +40,7 @@
41
40
  "axios": "^0.27.2",
42
41
  "babel-preset-typescript": "7.0.0-alpha.19",
43
42
  "bpmn-js": "^9.2.2",
44
- "canvas": "^2.9.3",
45
43
  "crypto-js": "^4.1.1",
46
- "fabric": "^5.2.1",
47
44
  "highlight.js": "^11.5.1",
48
45
  "lodash": "^4.17.21",
49
46
  "lodash-es": "^4.17.21",
@@ -1,4 +0,0 @@
1
- import script from './Center.vue_vue_type_script_setup_true_lang.js';
2
- export { default } from './Center.vue_vue_type_script_setup_true_lang.js';
3
-
4
- script.__file = "packages/fabric-chart/src/Center.vue";
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,15 +0,0 @@
1
- import { defineComponent } from 'vue';
2
- import useGrid from './hooks/useGrid.js';
3
- import { drawLine } from './hooks/useDraw.js';
4
-
5
- var script = /* @__PURE__ */ defineComponent({
6
- __name: "Center",
7
- setup(__props) {
8
- useGrid(drawLine);
9
- return (_ctx, _cache) => {
10
- return null;
11
- };
12
- }
13
- });
14
-
15
- export { script as default };
@@ -1,4 +0,0 @@
1
- import script from './Top.vue_vue_type_script_setup_true_lang.js';
2
- export { default } from './Top.vue_vue_type_script_setup_true_lang.js';
3
-
4
- script.__file = "packages/fabric-chart/src/Top.vue";
@@ -1,128 +0,0 @@
1
- import { defineComponent, inject, onMounted, nextTick } from 'vue';
2
- import { fabric } from 'fabric';
3
- import { defaultStyle, drawTextGroup, defaultTextStyle, defaultRectStyle } from './hooks/useDraw.js';
4
- import { InjectionCanvas, InjectionPropItems } from './interface.js';
5
-
6
- var script = /* @__PURE__ */ defineComponent({
7
- __name: "Top",
8
- setup(__props) {
9
- const canvas = inject(InjectionCanvas);
10
- const propItems = inject(InjectionPropItems);
11
- const { originY, grid, originX, xCellWidth, gridXNumber, top } = propItems;
12
- function drawTop() {
13
- let list = [];
14
- drawTopDate(top, list);
15
- drawTopDay(top, list);
16
- drawTopTime(top, list);
17
- const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
18
- group && group.sendToBack();
19
- group && canvas.value.add(group);
20
- }
21
- function drawTopTime(top2, list) {
22
- var _a, _b;
23
- const dateHeight = ((_a = top2.date) == null ? void 0 : _a.height) || 0;
24
- const dayHeight = top2.dayHeight || 0;
25
- const height = originY - dateHeight - dayHeight;
26
- const titleHeight = dayHeight + height;
27
- const title = drawTextGroup({
28
- width: originX,
29
- height: titleHeight,
30
- ...defaultRectStyle
31
- }, {
32
- ...defaultTextStyle,
33
- ...((_b = top2.date) == null ? void 0 : _b.style) || {}
34
- }, {
35
- left: 0,
36
- top: dateHeight
37
- }, top2.xScalevalue.title);
38
- list.push(title);
39
- let timeList = [];
40
- for (let j = 0; j < grid.mainXCell; j++) {
41
- timeList.push(top2.xScalevalue.list);
42
- }
43
- timeList.flat().forEach((v, i) => {
44
- var _a2;
45
- const left = originX + i * xCellWidth;
46
- const textGroup = drawTextGroup({
47
- width: xCellWidth,
48
- height
49
- }, {
50
- ...defaultTextStyle,
51
- ...((_a2 = top2.date) == null ? void 0 : _a2.style) || {}
52
- }, {
53
- left,
54
- top: dateHeight + dayHeight
55
- }, v);
56
- list.push(textGroup);
57
- });
58
- }
59
- function drawTopDay(top2, list) {
60
- var _a;
61
- if (!top2.dayHeight)
62
- return false;
63
- const height = top2.dayHeight;
64
- const width = xCellWidth * grid.subSecondXCell;
65
- const dayList = gridXNumber / grid.subSecondXCell;
66
- for (let i = 0; i < dayList; i++) {
67
- const left = originX + i * width;
68
- const value = i % 2 === 0 ? "\u4E0A\u5348" : "\u4E0B\u5348";
69
- const textGroup = drawTextGroup({
70
- width,
71
- height
72
- }, {
73
- ...defaultTextStyle,
74
- ...((_a = top2.date) == null ? void 0 : _a.style) || {}
75
- }, {
76
- left,
77
- top: top2.date.height || 0
78
- }, value);
79
- list.push(textGroup);
80
- }
81
- }
82
- function drawTopDate(top2, list) {
83
- var _a;
84
- if (!top2.date.height)
85
- return false;
86
- const height = top2.date.height;
87
- const title = drawTextGroup({
88
- width: originX,
89
- height,
90
- ...defaultRectStyle
91
- }, {
92
- ...defaultTextStyle,
93
- ...((_a = top2.date) == null ? void 0 : _a.style) || {}
94
- }, {
95
- left: 0,
96
- top: 0
97
- }, top2.date.title);
98
- list.push(title);
99
- const width = xCellWidth * grid.subXCell;
100
- top2.date.list.forEach((v, i) => {
101
- var _a2;
102
- const left = originX + i * width;
103
- const textGroup = drawTextGroup({
104
- width,
105
- height
106
- }, {
107
- ...defaultTextStyle,
108
- ...((_a2 = top2.date) == null ? void 0 : _a2.style) || {}
109
- }, {
110
- left,
111
- top: 0
112
- }, v);
113
- list.push(textGroup);
114
- });
115
- }
116
- onMounted(() => {
117
- nextTick(() => {
118
- drawTop();
119
- canvas.value.renderAll();
120
- });
121
- });
122
- return (_ctx, _cache) => {
123
- return null;
124
- };
125
- }
126
- });
127
-
128
- export { script as default };