@visactor/vstory 0.0.23-alpha.4 → 0.0.23-alpha.6

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.js CHANGED
@@ -185861,7 +185861,7 @@
185861
185861
  character: {
185862
185862
  Table: {
185863
185863
  runtime: {
185864
- list: ["CommonLayout", "TableType", "TableCommonSpec", "CellStyle", "ColWidth", "RowHeight"]
185864
+ list: ["CommonLayout", "TableType", "TableCommonSpec", "TableTheme", "ShowHeader", "ColWidth", "RowHeight", "ColVisible", "RowVisible", "ColStyle", "RowStyle", "ContentColStyle", "ContentRowStyle", "CellStyle"]
185865
185865
  }
185866
185866
  },
185867
185867
  PivotChart: {
@@ -189092,14 +189092,23 @@
189092
189092
  return _createClass(ColWidthRuntime, [{
189093
189093
  key: "applyConfigToAttribute",
189094
189094
  value: function applyConfigToAttribute(character) {
189095
+ var _a, _b;
189096
+ if ("ListTable" !== character.getRuntimeConfig().getAttribute().tableType) return;
189095
189097
  var spec = character.getRuntimeConfig().getAttribute().spec,
189096
189098
  options = character.getRuntimeConfig().config.options;
189097
- options.colWidth && Object.keys(options.colWidth).length > 0 && (spec.columns = spec.columns.map(function (column, index) {
189098
- var width = +options.colWidth[index];
189099
- return isValidNumber$3(width) ? Object.assign({}, column, {
189100
- width: width
189101
- }) : column;
189102
- }));
189099
+ if (options.colWidth && Object.keys(options.colWidth).length > 0) {
189100
+ var lastColVisible = null !== (_b = Object.values(null !== (_a = options.colVisible) && void 0 !== _a ? _a : {})) && void 0 !== _b ? _b : [],
189101
+ visibleIndexes = [];
189102
+ for (var i = 0; i <= lastColVisible.length + spec.columns.length; i += 1) {
189103
+ !1 !== lastColVisible[i] && visibleIndexes.push(i);
189104
+ }
189105
+ spec.columns = spec.columns.map(function (column, index) {
189106
+ var colWidth = options.colWidth[visibleIndexes[index]];
189107
+ return isValidNumber$3(colWidth) ? Object.assign({}, column, {
189108
+ width: colWidth
189109
+ }) : column;
189110
+ });
189111
+ }
189103
189112
  }
189104
189113
  }]);
189105
189114
  }();
@@ -189113,6 +189122,7 @@
189113
189122
  return _createClass(RowHeightRuntime, [{
189114
189123
  key: "applyConfigToAttribute",
189115
189124
  value: function applyConfigToAttribute(character) {
189125
+ if ("ListTable" !== character.getRuntimeConfig().getAttribute().tableType) return;
189116
189126
  var spec = character.getRuntimeConfig().getAttribute().spec,
189117
189127
  options = character.getRuntimeConfig().config.options;
189118
189128
  options.rowHeight && Object.keys(options.rowHeight).length > 0 && (spec.customComputeRowHeight = function (args) {
@@ -189145,12 +189155,229 @@
189145
189155
  }();
189146
189156
  var TableTypeRuntimeInstance = new TableTypeRuntime();
189147
189157
 
189158
+ var TableThemeRuntime = /*#__PURE__*/function () {
189159
+ function TableThemeRuntime() {
189160
+ _classCallCheck(this, TableThemeRuntime);
189161
+ this.type = "TableTheme";
189162
+ }
189163
+ return _createClass(TableThemeRuntime, [{
189164
+ key: "applyConfigToAttribute",
189165
+ value: function applyConfigToAttribute(character) {
189166
+ var _a, _b;
189167
+ var spec = character.getRuntimeConfig().getAttribute().spec,
189168
+ options = character.getRuntimeConfig().config.options,
189169
+ tableType = character.getRuntimeConfig().getAttribute().tableType;
189170
+ spec.theme || (spec.theme = {}), isValid$3(options.theme) && (spec.theme = merge$2(spec.theme, options.theme)), "ListTable" === tableType && ((null === (_a = options.theme) || void 0 === _a ? void 0 : _a.headerStyle) && spec.columns && spec.columns.forEach(function (col) {
189171
+ col.headerStyle && (col.headerStyle = merge$2(col.headerStyle, options.theme.headerStyle));
189172
+ }), (null === (_b = options.theme) || void 0 === _b ? void 0 : _b.bodyStyle) && spec.columns && spec.columns.forEach(function (col) {
189173
+ col.style && (col.style = merge$2(col.style, options.theme.bodyStyle));
189174
+ }));
189175
+ }
189176
+ }]);
189177
+ }();
189178
+ var TableThemeRuntimeInstance = new TableThemeRuntime();
189179
+
189180
+ var ShowHeaderRuntime = /*#__PURE__*/function () {
189181
+ function ShowHeaderRuntime() {
189182
+ _classCallCheck(this, ShowHeaderRuntime);
189183
+ this.type = "ShowHeader";
189184
+ }
189185
+ return _createClass(ShowHeaderRuntime, [{
189186
+ key: "applyConfigToAttribute",
189187
+ value: function applyConfigToAttribute(character) {
189188
+ var spec = character.getRuntimeConfig().getAttribute().spec,
189189
+ options = character.getRuntimeConfig().config.options;
189190
+ isValid$3(options.showHeader) && (spec.showHeader = !1 !== options.showHeader);
189191
+ }
189192
+ }]);
189193
+ }();
189194
+ var ShowHeaderRuntimeInstance = new ShowHeaderRuntime();
189195
+
189196
+ var ColVisibleRuntime = /*#__PURE__*/function () {
189197
+ function ColVisibleRuntime() {
189198
+ _classCallCheck(this, ColVisibleRuntime);
189199
+ this.type = "ColVisible";
189200
+ }
189201
+ return _createClass(ColVisibleRuntime, [{
189202
+ key: "applyConfigToAttribute",
189203
+ value: function applyConfigToAttribute(character) {
189204
+ if ("ListTable" !== character.getRuntimeConfig().getAttribute().tableType) return;
189205
+ var spec = character.getRuntimeConfig().getAttribute().spec,
189206
+ options = character.getRuntimeConfig().config.options;
189207
+ options.colVisible && Object.keys(options.colVisible).length > 0 && (spec.columns = spec.columns.map(function (column, index) {
189208
+ var hide = !1 === options.colVisible[index];
189209
+ return Object.assign({}, column, {
189210
+ hide: hide
189211
+ });
189212
+ }));
189213
+ }
189214
+ }]);
189215
+ }();
189216
+ var ColVisibleRuntimeInstance = new ColVisibleRuntime();
189217
+
189218
+ var RowVisibleRuntime = /*#__PURE__*/function () {
189219
+ function RowVisibleRuntime() {
189220
+ _classCallCheck(this, RowVisibleRuntime);
189221
+ this.type = "RowVisible";
189222
+ }
189223
+ return _createClass(RowVisibleRuntime, [{
189224
+ key: "applyConfigToAttribute",
189225
+ value: function applyConfigToAttribute(character) {
189226
+ if ("ListTable" !== character.getRuntimeConfig().getAttribute().tableType) return;
189227
+ var spec = character.getRuntimeConfig().getAttribute().spec,
189228
+ options = character.getRuntimeConfig().config.options;
189229
+ if (options.rowVisible && Object.keys(options.rowVisible).length > 0) {
189230
+ var records = [],
189231
+ headerRowVisible = options.rowVisible[-1];
189232
+ spec.showHeader = !1 !== headerRowVisible && !1 !== options.showHeader, spec.records.forEach(function (record, index) {
189233
+ !1 !== options.rowVisible[index] && records.push(record);
189234
+ }), spec.records = records;
189235
+ }
189236
+ }
189237
+ }]);
189238
+ }();
189239
+ var RowVisibleRuntimeInstance = new RowVisibleRuntime();
189240
+
189241
+ var ColStyleRuntime = /*#__PURE__*/function () {
189242
+ function ColStyleRuntime() {
189243
+ _classCallCheck(this, ColStyleRuntime);
189244
+ this.type = "ColStyle";
189245
+ }
189246
+ return _createClass(ColStyleRuntime, [{
189247
+ key: "afterInitialize",
189248
+ value: function afterInitialize(character, vTable) {
189249
+ var options = character.getRuntimeConfig().config.options,
189250
+ rowHeaderCount = vTable.rowHeaderLevelCount,
189251
+ rowCount = vTable.rowCount;
189252
+ options.colStyle && Object.keys(options.colStyle).length > 0 && Object.keys(options.colStyle).forEach(function (key) {
189253
+ var col = parseInt(key, 10),
189254
+ styleKey = "colStyle-".concat(col),
189255
+ colStyle = options.colStyle[col];
189256
+ colStyle && (vTable.registerCustomCellStyle(styleKey, colStyle), vTable.arrangeCustomCellStyle({
189257
+ range: {
189258
+ start: {
189259
+ col: col + rowHeaderCount,
189260
+ row: 0
189261
+ },
189262
+ end: {
189263
+ col: col + rowHeaderCount,
189264
+ row: rowCount - 1
189265
+ }
189266
+ }
189267
+ }, styleKey));
189268
+ });
189269
+ }
189270
+ }]);
189271
+ }();
189272
+ var ColStyleRuntimeInstance = new ColStyleRuntime();
189273
+
189274
+ var RowStyleRuntime = /*#__PURE__*/function () {
189275
+ function RowStyleRuntime() {
189276
+ _classCallCheck(this, RowStyleRuntime);
189277
+ this.type = "RowStyle";
189278
+ }
189279
+ return _createClass(RowStyleRuntime, [{
189280
+ key: "afterInitialize",
189281
+ value: function afterInitialize(character, vTable) {
189282
+ var options = character.getRuntimeConfig().config.options,
189283
+ colHeaderCount = vTable.columnHeaderLevelCount,
189284
+ colCount = vTable.colCount;
189285
+ options.rowStyle && Object.keys(options.rowStyle).length > 0 && Object.keys(options.rowStyle).forEach(function (key) {
189286
+ var row = parseInt(key, 10),
189287
+ styleKey = "rowStyle-".concat(row),
189288
+ rowStyle = options.rowStyle[row];
189289
+ rowStyle && (vTable.registerCustomCellStyle(styleKey, rowStyle), vTable.arrangeCustomCellStyle({
189290
+ range: {
189291
+ start: {
189292
+ row: row + colHeaderCount,
189293
+ col: 0
189294
+ },
189295
+ end: {
189296
+ row: row + colHeaderCount,
189297
+ col: colCount - 1
189298
+ }
189299
+ }
189300
+ }, styleKey));
189301
+ });
189302
+ }
189303
+ }]);
189304
+ }();
189305
+ var RowStyleRuntimeInstance = new RowStyleRuntime();
189306
+
189307
+ var ContentColStyleRuntime = /*#__PURE__*/function () {
189308
+ function ContentColStyleRuntime() {
189309
+ _classCallCheck(this, ContentColStyleRuntime);
189310
+ this.type = "ContentColStyle";
189311
+ }
189312
+ return _createClass(ContentColStyleRuntime, [{
189313
+ key: "afterInitialize",
189314
+ value: function afterInitialize(character, vTable) {
189315
+ var options = character.getRuntimeConfig().config.options,
189316
+ rowHeaderCount = vTable.rowHeaderLevelCount,
189317
+ rowCount = vTable.rowCount,
189318
+ colHeaderCount = vTable.columnHeaderLevelCount;
189319
+ options.contentColStyle && Object.keys(options.contentColStyle).length > 0 && Object.keys(options.contentColStyle).forEach(function (key) {
189320
+ var col = parseInt(key, 10),
189321
+ styleKey = "contentColStyle-".concat(col),
189322
+ colStyle = options.contentColStyle[col];
189323
+ colStyle && (vTable.registerCustomCellStyle(styleKey, colStyle), vTable.arrangeCustomCellStyle({
189324
+ range: {
189325
+ start: {
189326
+ col: col + rowHeaderCount,
189327
+ row: colHeaderCount
189328
+ },
189329
+ end: {
189330
+ col: col + rowHeaderCount,
189331
+ row: rowCount - 1
189332
+ }
189333
+ }
189334
+ }, styleKey));
189335
+ });
189336
+ }
189337
+ }]);
189338
+ }();
189339
+ var ContentColStyleRuntimeInstance = new ContentColStyleRuntime();
189340
+
189341
+ var ContentRowStyleRuntime = /*#__PURE__*/function () {
189342
+ function ContentRowStyleRuntime() {
189343
+ _classCallCheck(this, ContentRowStyleRuntime);
189344
+ this.type = "ContentRowStyle";
189345
+ }
189346
+ return _createClass(ContentRowStyleRuntime, [{
189347
+ key: "afterInitialize",
189348
+ value: function afterInitialize(character, vTable) {
189349
+ var options = character.getRuntimeConfig().config.options,
189350
+ rowHeaderCount = vTable.rowHeaderLevelCount,
189351
+ colHeaderCount = vTable.columnHeaderLevelCount,
189352
+ colCount = vTable.colCount;
189353
+ options.contentRowStyle && Object.keys(options.contentRowStyle).length > 0 && Object.keys(options.contentRowStyle).forEach(function (key) {
189354
+ var row = parseInt(key, 10),
189355
+ styleKey = "contentRowStyle-".concat(row),
189356
+ rowStyle = options.contentRowStyle[row];
189357
+ rowStyle && (vTable.registerCustomCellStyle(styleKey, rowStyle), vTable.arrangeCustomCellStyle({
189358
+ range: {
189359
+ start: {
189360
+ row: row + colHeaderCount,
189361
+ col: rowHeaderCount
189362
+ },
189363
+ end: {
189364
+ row: row + colHeaderCount,
189365
+ col: colCount - 1
189366
+ }
189367
+ }
189368
+ }, styleKey));
189369
+ });
189370
+ }
189371
+ }]);
189372
+ }();
189373
+ var ContentRowStyleRuntimeInstance = new ContentRowStyleRuntime();
189374
+
189148
189375
  var _register = !1;
189149
189376
  function registerCharacters() {
189150
189377
  _register || (_register = !0, StoryFactory.registerCharacter(VChartCharacter.type, VChartCharacter), registerRankingBarTemp(), registerAllVChart(), StoryFactory.registerCharacter(RankingBarCharacter.type, RankingBarCharacter), StoryFactory.registerCharacter(WaveScatterCharacter.type, WaveScatterCharacter), StoryFactory.registerCharacter(ScatterBarCharacter.type, ScatterBarCharacter), StoryFactory.registerCharacter(TextCharacter.type, TextCharacter), StoryFactory.registerCharacter(RectCharacter.type, RectCharacter), StoryFactory.registerCharacter(ImageCharacter.type, ImageCharacter), StoryFactory.registerCharacter(LineCharacter.type, LineCharacter), StoryFactory.registerCharacter(ShapeCharacter.type, ShapeCharacter), StoryFactory.registerCharacter(PolygonCharacter.type, PolygonCharacter), StoryFactory.registerCharacter(ArcCharacter.type, ArcCharacter), StoryFactory.registerCharacter(TimelineCharacter.type, TimelineCharacter), StoryFactory.registerCharacter(UnitCharacter.type, UnitCharacter), StoryFactory.registerCharacter(VTableCharacter.type, VTableCharacter), StoryFactory.registerCharacter(PivotChartCharacter.type, PivotChartCharacter), registerRuntime());
189151
189378
  }
189152
189379
  function registerRuntime() {
189153
- RuntimeStore.register(CommonLayoutRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance$1), RuntimeStore.register(SeriesSpecRuntimeInstance), RuntimeStore.register(MarkStyleRuntimeInstance), RuntimeStore.register(LabelStyleRuntimeInstance), RuntimeStore.register(TotalLabelRuntimeInstance), RuntimeStore.register(RankingBarRuntimeInstance), RuntimeStore.register(WaveScatterRuntimeInstance), RuntimeStore.register(BaseGraphicRuntimeInstance), RuntimeStore.register(TextRuntimeInstance), RuntimeStore.register(LineRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance), RuntimeStore.register(CellStyleRuntimeInstance), RuntimeStore.register(ColWidthRuntimeInstance), RuntimeStore.register(RowHeightRuntimeInstance), RuntimeStore.register(TableTypeRuntimeInstance);
189380
+ RuntimeStore.register(CommonLayoutRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance$1), RuntimeStore.register(SeriesSpecRuntimeInstance), RuntimeStore.register(MarkStyleRuntimeInstance), RuntimeStore.register(LabelStyleRuntimeInstance), RuntimeStore.register(TotalLabelRuntimeInstance), RuntimeStore.register(RankingBarRuntimeInstance), RuntimeStore.register(WaveScatterRuntimeInstance), RuntimeStore.register(BaseGraphicRuntimeInstance), RuntimeStore.register(TextRuntimeInstance), RuntimeStore.register(LineRuntimeInstance), RuntimeStore.register(CommonSpecRuntimeInstance), RuntimeStore.register(TableTypeRuntimeInstance), RuntimeStore.register(TableThemeRuntimeInstance), RuntimeStore.register(ShowHeaderRuntimeInstance), RuntimeStore.register(ColWidthRuntimeInstance), RuntimeStore.register(RowHeightRuntimeInstance), RuntimeStore.register(ColVisibleRuntimeInstance), RuntimeStore.register(RowVisibleRuntimeInstance), RuntimeStore.register(ColStyleRuntimeInstance), RuntimeStore.register(RowStyleRuntimeInstance), RuntimeStore.register(ContentColStyleRuntimeInstance), RuntimeStore.register(ContentRowStyleRuntimeInstance), RuntimeStore.register(CellStyleRuntimeInstance);
189154
189381
  }
189155
189382
 
189156
189383
  function getPayload(action) {
@@ -196401,6 +196628,7 @@
196401
196628
  exports.CommonScaleToActionProcessor = CommonScaleToActionProcessor;
196402
196629
  exports.CommonStyleActionProcessor = CommonStyleActionProcessor;
196403
196630
  exports.CommonVisibilityActionProcessor = CommonVisibilityActionProcessor;
196631
+ exports.DefaultTheme = DefaultTheme;
196404
196632
  exports.Easing = Easing$1;
196405
196633
  exports.Edit = Edit;
196406
196634
  exports.GlobalTickerStore = GlobalTickerStore;