@gct-paas/word 0.1.73-patch.11 → 0.1.73-patch.12

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/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.73-patch.11 */
1
+ /*! @gct-paas/word v0.1.73-patch.12 */
2
2
  import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toValue, unref, useCssVars, useModel, useSlots, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
3
3
  import FloatingVue, { PopperWrapper } from "floating-vue";
4
4
  import VueKonva from "vue-konva";
@@ -104111,6 +104111,251 @@ var init_TextUtil = __esmMin((() => {
104111
104111
  _defineProperty(TextUtil, "layoutSizeCache", /* @__PURE__ */ new Map());
104112
104112
  }));
104113
104113
  //#endregion
104114
+ //#region src/runtime/designer/ribbon/constant/font.ts
104115
+ var FontFamilyEnum, FontFamilyOptions, FontSizeOptions;
104116
+ var init_font = __esmMin((() => {
104117
+ FontFamilyEnum = /* @__PURE__ */ function(FontFamilyEnum) {
104118
+ FontFamilyEnum["Serif"] = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
104119
+ /** 宋体 */
104120
+ FontFamilyEnum["SimSun"] = "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif";
104121
+ /** 黑体 */
104122
+ FontFamilyEnum["SimHei"] = "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif";
104123
+ /** 楷体 */
104124
+ FontFamilyEnum["KaiTi"] = "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif";
104125
+ return FontFamilyEnum;
104126
+ }({});
104127
+ FontFamilyOptions = [
104128
+ {
104129
+ label: "默认",
104130
+ value: "Roboto,RobotoDraft,Helvetica,Arial,sans-serif"
104131
+ },
104132
+ {
104133
+ label: "宋体",
104134
+ value: "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif"
104135
+ },
104136
+ {
104137
+ label: "黑体",
104138
+ value: "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif"
104139
+ },
104140
+ {
104141
+ label: "楷体",
104142
+ value: "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif"
104143
+ }
104144
+ ];
104145
+ FontSizeOptions = [
104146
+ {
104147
+ label: "初号",
104148
+ value: "42"
104149
+ },
104150
+ {
104151
+ label: "小初",
104152
+ value: "36"
104153
+ },
104154
+ {
104155
+ label: "一号",
104156
+ value: "26"
104157
+ },
104158
+ {
104159
+ label: "小一",
104160
+ value: "24"
104161
+ },
104162
+ {
104163
+ label: "二号",
104164
+ value: "22"
104165
+ },
104166
+ {
104167
+ label: "小二",
104168
+ value: "18"
104169
+ },
104170
+ {
104171
+ label: "三号",
104172
+ value: "16"
104173
+ },
104174
+ {
104175
+ label: "小三",
104176
+ value: "15"
104177
+ },
104178
+ {
104179
+ label: "四号",
104180
+ value: "14"
104181
+ },
104182
+ {
104183
+ label: "小四",
104184
+ value: "12"
104185
+ },
104186
+ {
104187
+ label: "五号",
104188
+ value: "10.5"
104189
+ },
104190
+ {
104191
+ label: "小五",
104192
+ value: "9"
104193
+ },
104194
+ {
104195
+ label: "六号",
104196
+ value: "7.5"
104197
+ },
104198
+ {
104199
+ label: "小六",
104200
+ value: "6.5"
104201
+ },
104202
+ {
104203
+ label: "七号",
104204
+ value: "5.5"
104205
+ },
104206
+ {
104207
+ label: "八号",
104208
+ value: "5"
104209
+ },
104210
+ {
104211
+ label: "5",
104212
+ value: 5
104213
+ },
104214
+ {
104215
+ label: "5.5",
104216
+ value: 5.5
104217
+ },
104218
+ {
104219
+ label: "6.5",
104220
+ value: 6.5
104221
+ },
104222
+ {
104223
+ label: "7.5",
104224
+ value: 7.5
104225
+ },
104226
+ {
104227
+ label: "8",
104228
+ value: 8
104229
+ },
104230
+ {
104231
+ label: "9",
104232
+ value: 9
104233
+ },
104234
+ {
104235
+ label: "10",
104236
+ value: 10
104237
+ },
104238
+ {
104239
+ label: "10.5",
104240
+ value: 10.5
104241
+ },
104242
+ {
104243
+ label: "11",
104244
+ value: 11
104245
+ },
104246
+ {
104247
+ label: "12",
104248
+ value: 12
104249
+ },
104250
+ {
104251
+ label: "14",
104252
+ value: 14
104253
+ },
104254
+ {
104255
+ label: "16",
104256
+ value: 16
104257
+ },
104258
+ {
104259
+ label: "18",
104260
+ value: 18
104261
+ },
104262
+ {
104263
+ label: "20",
104264
+ value: 20
104265
+ },
104266
+ {
104267
+ label: "22",
104268
+ value: 22
104269
+ },
104270
+ {
104271
+ label: "24",
104272
+ value: 24
104273
+ },
104274
+ {
104275
+ label: "26",
104276
+ value: 26
104277
+ },
104278
+ {
104279
+ label: "28",
104280
+ value: 28
104281
+ },
104282
+ {
104283
+ label: "30",
104284
+ value: 30
104285
+ },
104286
+ {
104287
+ label: "36",
104288
+ value: 36
104289
+ },
104290
+ {
104291
+ label: "48",
104292
+ value: 48
104293
+ },
104294
+ {
104295
+ label: "56",
104296
+ value: 56
104297
+ },
104298
+ {
104299
+ label: "72",
104300
+ value: 72
104301
+ },
104302
+ {
104303
+ label: "96",
104304
+ value: 96
104305
+ }
104306
+ ];
104307
+ }));
104308
+ //#endregion
104309
+ //#region src/utils/fonts/normalize-document-font.ts
104310
+ /**
104311
+ * 从 OOXML rFonts 取展示用字体名。
104312
+ * 中文 Word 常把字体写在 eastAsia,优先于 ascii。
104313
+ */
104314
+ function pickDocumentFontName(rFonts) {
104315
+ if (!rFonts) return void 0;
104316
+ return rFonts.eastAsia || rFonts.ascii || rFonts.hAnsi || rFonts.cs || void 0;
104317
+ }
104318
+ /**
104319
+ * 识别是否为产品支持的黑 / 宋 / 楷(含常见别名)。
104320
+ * 无法识别时返回 null(应回落默认字体)。
104321
+ * 注意:不能用裸 includes('serif'),否则会误伤 "sans-serif"。
104322
+ */
104323
+ function detectSupportedCjkKind(fontFamily) {
104324
+ if (!fontFamily) return null;
104325
+ const name = fontFamily.toLowerCase();
104326
+ const isKai = /lxgw|wenkai|kaiti|楷/.test(name) || /(^|[,\"\s])kai([,\"\s]|$)/.test(name) || name.includes("stkai");
104327
+ const isSong = /noto\s*serif|notoserif|simsun|华文宋|stsong|songti|宋体/.test(name) || /(^|[,\"\s])song([,\"\s]|$)/.test(name);
104328
+ const isHei = /noto\s*sans|notosans|simhei|华文黑|stheiti|黑体/.test(name) || name.includes("heiti");
104329
+ if (isKai) return "kai";
104330
+ if (isSong && !isHei) return "song";
104331
+ if (isHei) return "hei";
104332
+ return null;
104333
+ }
104334
+ /**
104335
+ * 将任意字体名归一到产品支持的黑 / 宋 / 楷。
104336
+ * 无法识别(如 Arial、微软雅黑)时回落默认字体。
104337
+ */
104338
+ function normalizeSupportedFontFamily(fontFamily) {
104339
+ if (!fontFamily) return DEFAULT_FONT_FAMILY;
104340
+ if (fontFamily === "Roboto,RobotoDraft,Helvetica,Arial,sans-serif" || fontFamily === FontFamilyEnum.Serif) return fontFamily;
104341
+ for (const stack of SUPPORTED_DOCUMENT_FONT_FAMILIES) if (fontFamily === stack) return fontFamily;
104342
+ const kind = detectSupportedCjkKind(fontFamily);
104343
+ if (kind === "kai") return FontFamilyEnum.KaiTi;
104344
+ if (kind === "song") return FontFamilyEnum.SimSun;
104345
+ if (kind === "hei") return FontFamilyEnum.SimHei;
104346
+ return DEFAULT_FONT_FAMILY;
104347
+ }
104348
+ var SUPPORTED_DOCUMENT_FONT_FAMILIES;
104349
+ var init_normalize_document_font = __esmMin((() => {
104350
+ init_constants$1();
104351
+ init_font();
104352
+ SUPPORTED_DOCUMENT_FONT_FAMILIES = [
104353
+ FontFamilyEnum.SimHei,
104354
+ FontFamilyEnum.SimSun,
104355
+ FontFamilyEnum.KaiTi
104356
+ ];
104357
+ }));
104358
+ //#endregion
104114
104359
  //#region src/core/view/runs/TextRun.ts
104115
104360
  var TextRun;
104116
104361
  var init_TextRun = __esmMin((() => {
@@ -104118,6 +104363,7 @@ var init_TextRun = __esmMin((() => {
104118
104363
  init_constants$1();
104119
104364
  init_helpers();
104120
104365
  init_TextUtil();
104366
+ init_normalize_document_font();
104121
104367
  init_defineProperty();
104122
104368
  TextRun = class TextRun extends LayoutNode {
104123
104369
  constructor(options) {
@@ -104284,11 +104530,11 @@ var init_TextRun = __esmMin((() => {
104284
104530
  * @returns TextRun 的样式属性
104285
104531
  */
104286
104532
  static textStyle2LayoutStyle(textStyle) {
104287
- var _textStyle$rFonts;
104288
104533
  if (!textStyle) return {};
104289
104534
  const layoutStyle = {};
104290
104535
  if (textStyle.sz !== void 0) layoutStyle.fontSize = textStyle.sz / 2 * 96 / 72;
104291
- if ((_textStyle$rFonts = textStyle.rFonts) === null || _textStyle$rFonts === void 0 ? void 0 : _textStyle$rFonts.ascii) layoutStyle.fontFamily = textStyle.rFonts.ascii;
104536
+ const rawFontFamily = pickDocumentFontName(textStyle.rFonts);
104537
+ if (rawFontFamily) layoutStyle.fontFamily = normalizeSupportedFontFamily(rawFontFamily);
104292
104538
  if (textStyle.highlight) layoutStyle.highlight = normalizeColor(textStyle.highlight, "none");
104293
104539
  if (textStyle.color) layoutStyle.color = normalizeColor(textStyle.color, DEFAULT_TEXT_COLOR);
104294
104540
  if (textStyle.b !== void 0) layoutStyle.bold = textStyle.b;
@@ -123980,6 +124226,17 @@ var init_uom_convert_runtime = __esmMin((() => {
123980
124226
  DEFAULT_INPUT_FIELD = "qty_";
123981
124227
  }));
123982
124228
  //#endregion
124229
+ //#region src/runtime/canvas/table/render/material-consume/derived-qty.ts
124230
+ /**
124231
+ * 未选择物料时,已消耗数量与当前行消耗数量保持一致。
124232
+ * 空值统一写为 null,避免数值字段向提交接口传递空字符串。
124233
+ */
124234
+ function resolveConsumedQtyWithoutProduct(value) {
124235
+ if (value === void 0 || value === null || value === "") return null;
124236
+ return Number(value);
124237
+ }
124238
+ var init_derived_qty = __esmMin((() => {}));
124239
+ //#endregion
123983
124240
  //#region src/runtime/canvas/table/render/material-consume/material-consume-table-controller.ts
123984
124241
  /**
123985
124242
  * 解析规则配置字符串解析成对象
@@ -124007,6 +124264,7 @@ var init_material_consume_table_controller = __esmMin((() => {
124007
124264
  init_TriggerUtil();
124008
124265
  init_data();
124009
124266
  init_uom_convert_runtime();
124267
+ init_derived_qty();
124010
124268
  init_defineProperty();
124011
124269
  MCDataUtil = class MCDataUtil {
124012
124270
  /**
@@ -124507,7 +124765,7 @@ var init_material_consume_table_controller = __esmMin((() => {
124507
124765
  const modifySingleRow = (row, rowIndex) => {
124508
124766
  const fieldKey = `${this.subTableInfo.valuePath}[${rowIndex}].qty_consumed_`;
124509
124767
  if (!row.product_id_) {
124510
- doc.dataManager.set(fieldKey, row.qty_ ? Number(row.qty_) : "", "user");
124768
+ doc.dataManager.set(fieldKey, resolveConsumedQtyWithoutProduct(row.qty_), "user");
124511
124769
  return;
124512
124770
  }
124513
124771
  let total = 0;
@@ -138254,204 +138512,12 @@ var table_ribbon_group_vue_vue_type_script_setup_true_name_table_ribbon_group_la
138254
138512
  init__plugin_vue_export_helper();
138255
138513
  var table_ribbon_group_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_ribbon_group_vue_vue_type_script_setup_true_name_table_ribbon_group_lang_default, [["__scopeId", "data-v-a6ebfeaa"]]);
138256
138514
  //#endregion
138257
- //#region src/runtime/designer/ribbon/constant/font.ts
138258
- /** 字重 */
138259
- var FontFamilyEnum = /* @__PURE__ */ function(FontFamilyEnum) {
138260
- FontFamilyEnum["Serif"] = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
138261
- /** 宋体 */
138262
- FontFamilyEnum["SimSun"] = "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif";
138263
- /** 黑体 */
138264
- FontFamilyEnum["SimHei"] = "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif";
138265
- /** 楷体 */
138266
- FontFamilyEnum["KaiTi"] = "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif";
138267
- return FontFamilyEnum;
138268
- }({});
138269
- var FontFamilyOptions = [
138270
- {
138271
- label: "默认",
138272
- value: "Roboto,RobotoDraft,Helvetica,Arial,sans-serif"
138273
- },
138274
- {
138275
- label: "宋体",
138276
- value: "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif"
138277
- },
138278
- {
138279
- label: "黑体",
138280
- value: "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif"
138281
- },
138282
- {
138283
- label: "楷体",
138284
- value: "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif"
138285
- }
138286
- ];
138287
- var FontSizeOptions = [
138288
- {
138289
- label: "初号",
138290
- value: "42"
138291
- },
138292
- {
138293
- label: "小初",
138294
- value: "36"
138295
- },
138296
- {
138297
- label: "一号",
138298
- value: "26"
138299
- },
138300
- {
138301
- label: "小一",
138302
- value: "24"
138303
- },
138304
- {
138305
- label: "二号",
138306
- value: "22"
138307
- },
138308
- {
138309
- label: "小二",
138310
- value: "18"
138311
- },
138312
- {
138313
- label: "三号",
138314
- value: "16"
138315
- },
138316
- {
138317
- label: "小三",
138318
- value: "15"
138319
- },
138320
- {
138321
- label: "四号",
138322
- value: "14"
138323
- },
138324
- {
138325
- label: "小四",
138326
- value: "12"
138327
- },
138328
- {
138329
- label: "五号",
138330
- value: "10.5"
138331
- },
138332
- {
138333
- label: "小五",
138334
- value: "9"
138335
- },
138336
- {
138337
- label: "六号",
138338
- value: "7.5"
138339
- },
138340
- {
138341
- label: "小六",
138342
- value: "6.5"
138343
- },
138344
- {
138345
- label: "七号",
138346
- value: "5.5"
138347
- },
138348
- {
138349
- label: "八号",
138350
- value: "5"
138351
- },
138352
- {
138353
- label: "5",
138354
- value: 5
138355
- },
138356
- {
138357
- label: "5.5",
138358
- value: 5.5
138359
- },
138360
- {
138361
- label: "6.5",
138362
- value: 6.5
138363
- },
138364
- {
138365
- label: "7.5",
138366
- value: 7.5
138367
- },
138368
- {
138369
- label: "8",
138370
- value: 8
138371
- },
138372
- {
138373
- label: "9",
138374
- value: 9
138375
- },
138376
- {
138377
- label: "10",
138378
- value: 10
138379
- },
138380
- {
138381
- label: "10.5",
138382
- value: 10.5
138383
- },
138384
- {
138385
- label: "11",
138386
- value: 11
138387
- },
138388
- {
138389
- label: "12",
138390
- value: 12
138391
- },
138392
- {
138393
- label: "14",
138394
- value: 14
138395
- },
138396
- {
138397
- label: "16",
138398
- value: 16
138399
- },
138400
- {
138401
- label: "18",
138402
- value: 18
138403
- },
138404
- {
138405
- label: "20",
138406
- value: 20
138407
- },
138408
- {
138409
- label: "22",
138410
- value: 22
138411
- },
138412
- {
138413
- label: "24",
138414
- value: 24
138415
- },
138416
- {
138417
- label: "26",
138418
- value: 26
138419
- },
138420
- {
138421
- label: "28",
138422
- value: 28
138423
- },
138424
- {
138425
- label: "30",
138426
- value: 30
138427
- },
138428
- {
138429
- label: "36",
138430
- value: 36
138431
- },
138432
- {
138433
- label: "48",
138434
- value: 48
138435
- },
138436
- {
138437
- label: "56",
138438
- value: 56
138439
- },
138440
- {
138441
- label: "72",
138442
- value: 72
138443
- },
138444
- {
138445
- label: "96",
138446
- value: 96
138447
- }
138448
- ];
138449
- //#endregion
138450
138515
  //#region src/runtime/designer/ribbon/tabs/word-tab.vue?vue&type=script&setup=true&name=home-tab&lang.ts
138451
138516
  init_dist();
138452
138517
  init_base$2();
138453
138518
  init_core();
138454
138519
  init_asset_helper_util();
138520
+ init_font();
138455
138521
  init_logic$1();
138456
138522
  init_constants$1();
138457
138523
  var _hoisted_1$104 = { class: "items-container" };
@@ -143674,6 +143740,7 @@ var manifest$7 = {
143674
143740
  //#endregion
143675
143741
  //#region src/suites/edhr/manifest/paper-widget/_common_/basic.ts
143676
143742
  init_constants$1();
143743
+ init_font();
143677
143744
  var DEFAULT_WIDGET_TEXT_STYLE = {
143678
143745
  fontFamily: FontFamilyEnum.Serif,
143679
143746
  fontSize: 13,
@@ -158403,6 +158470,7 @@ var widget_barcode_config_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
158403
158470
  //#endregion
158404
158471
  //#region src/suites/shared/panel/config/editor/font-editor/font-editor.vue?vue&type=script&setup=true&lang.ts
158405
158472
  init_base$2();
158473
+ init_font();
158406
158474
  var _hoisted_1$8 = { class: "content" };
158407
158475
  var _hoisted_2$4 = { class: "value" };
158408
158476
  var font_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 未选择物料时,已消耗数量与当前行消耗数量保持一致。
3
+ * 空值统一写为 null,避免数值字段向提交接口传递空字符串。
4
+ */
5
+ export declare function resolveConsumedQtyWithoutProduct(value: unknown): number | null;
@@ -0,0 +1,16 @@
1
+ export type DocRFonts = {
2
+ ascii?: string;
3
+ hAnsi?: string;
4
+ eastAsia?: string;
5
+ cs?: string;
6
+ };
7
+ /**
8
+ * 从 OOXML rFonts 取展示用字体名。
9
+ * 中文 Word 常把字体写在 eastAsia,优先于 ascii。
10
+ */
11
+ export declare function pickDocumentFontName(rFonts?: DocRFonts | null): string | undefined;
12
+ /**
13
+ * 将任意字体名归一到产品支持的黑 / 宋 / 楷。
14
+ * 无法识别(如 Arial、微软雅黑)时回落默认字体。
15
+ */
16
+ export declare function normalizeSupportedFontFamily(fontFamily?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.73-patch.11",
3
+ "version": "0.1.73-patch.12",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",