@xatlas/rainbow-core 2.0.9 → 2.1.1

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/core.umd.js CHANGED
@@ -3145,11 +3145,23 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3145
3145
  }
3146
3146
  }) : '', h("a", {
3147
3147
  "on": {
3148
- "click": function click() {
3149
- return _this.handleRowAction(a, record);
3148
+ "click": function click(e) {
3149
+ return _this.handleRowAction(a, record, e);
3150
3150
  }
3151
3151
  }
3152
- }, [a.name])];
3152
+ }, [a.name, a.action === 'file' ? h("input", {
3153
+ "attrs": {
3154
+ "type": "file",
3155
+ "name": "file"
3156
+ },
3157
+ "style": "display: none",
3158
+ "on": {
3159
+ "change": function change(e) {
3160
+ _this.onFileChange(a, e.target.files);
3161
+ e.target.value = '';
3162
+ }
3163
+ }
3164
+ }) : ''])];
3153
3165
  })]), _this.rowActions(record).filter(function (a) {
3154
3166
  return !rowCollapseAction.includes(a.key);
3155
3167
  }).length ? h("a-divider", {
@@ -3180,11 +3192,23 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3180
3192
  "key": a.id
3181
3193
  }, [h("a", {
3182
3194
  "on": {
3183
- "click": function click() {
3184
- return _this.handleRowAction(a, record);
3195
+ "click": function click(e) {
3196
+ return _this.handleRowAction(a, record, e);
3197
+ }
3198
+ }
3199
+ }, [a.name, a.action === 'file' ? h("input", {
3200
+ "attrs": {
3201
+ "type": "file",
3202
+ "name": "file"
3203
+ },
3204
+ "style": "display: none",
3205
+ "on": {
3206
+ "change": function change(e) {
3207
+ _this.onFileChange(a, e.target.files);
3208
+ e.target.value = '';
3185
3209
  }
3186
3210
  }
3187
- }, [a.name])]);
3211
+ }) : ''])]);
3188
3212
  })])])];
3189
3213
  } else if (rowCollapseActionNumber) {
3190
3214
  children = [h("span", [_this.rowActions(record).slice(0, rowCollapseActionNumber).map(function (a, index) {
@@ -3194,11 +3218,23 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3194
3218
  }
3195
3219
  }) : '', h("a", {
3196
3220
  "on": {
3197
- "click": function click() {
3198
- return _this.handleRowAction(a, record);
3221
+ "click": function click(e) {
3222
+ return _this.handleRowAction(a, record, e);
3199
3223
  }
3200
3224
  }
3201
- }, [a.name])];
3225
+ }, [a.name, a.action === 'file' ? h("input", {
3226
+ "attrs": {
3227
+ "type": "file",
3228
+ "name": "file"
3229
+ },
3230
+ "style": "display: none",
3231
+ "on": {
3232
+ "change": function change(e) {
3233
+ _this.onFileChange(a, e.target.files);
3234
+ e.target.value = '';
3235
+ }
3236
+ }
3237
+ }) : ''])];
3202
3238
  })]), _this.rowActions(record).slice(0, rowCollapseActionNumber).length ? h("a-divider", {
3203
3239
  "attrs": {
3204
3240
  "type": "vertical"
@@ -3225,11 +3261,23 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3225
3261
  "key": a.id
3226
3262
  }, [h("a", {
3227
3263
  "on": {
3228
- "click": function click() {
3229
- return _this.handleRowAction(a, record);
3264
+ "click": function click(e) {
3265
+ return _this.handleRowAction(a, record, e);
3230
3266
  }
3231
3267
  }
3232
- }, [a.name])]);
3268
+ }, [a.name, a.action === 'file' ? h("input", {
3269
+ "attrs": {
3270
+ "type": "file",
3271
+ "name": "file"
3272
+ },
3273
+ "style": "display: none",
3274
+ "on": {
3275
+ "change": function change(e) {
3276
+ _this.onFileChange(a, e.target.files);
3277
+ e.target.value = '';
3278
+ }
3279
+ }
3280
+ }) : ''])]);
3233
3281
  })])])];
3234
3282
  } else {
3235
3283
  children = _this.rowActions(record).map(function (a, index) {
@@ -3239,11 +3287,23 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3239
3287
  }
3240
3288
  }) : '', h("a", {
3241
3289
  "on": {
3242
- "click": function click() {
3243
- return _this.handleRowAction(a, record);
3290
+ "click": function click(e) {
3291
+ return _this.handleRowAction(a, record, e);
3244
3292
  }
3245
3293
  }
3246
- }, [a.name])];
3294
+ }, [a.name, a.action === 'file' ? h("input", {
3295
+ "attrs": {
3296
+ "type": "file",
3297
+ "name": "file"
3298
+ },
3299
+ "style": "display: none",
3300
+ "on": {
3301
+ "change": function change(e) {
3302
+ _this.onFileChange(a, e.target.files);
3303
+ e.target.value = '';
3304
+ }
3305
+ }
3306
+ }) : ''])];
3247
3307
  });
3248
3308
  }
3249
3309
  return {
@@ -3425,6 +3485,10 @@ function list_toPrimitive(input, hint) { if (list_typeof(input) !== "object" ||
3425
3485
  var key = this.configs['list.separateKey'] || null;
3426
3486
  var value = this.configs['list.separateValue'] || null;
3427
3487
  return key && value && record[key] === value ? 'list-separate-color' : '';
3488
+ },
3489
+ onFileChange: function onFileChange(action, files) {
3490
+ var key = action.list ? action.list : 'file';
3491
+ this.handleAction(action, null, list_defineProperty({}, key, files));
3428
3492
  }
3429
3493
  }
3430
3494
  });
@@ -3559,9 +3623,9 @@ function every(expressions, data) {
3559
3623
  return Object.keys(expressions).every(function (key) {
3560
3624
  var item = expressions[key];
3561
3625
  var result = key.split('.').reduce(function (p, c) {
3562
- return p && p[c] || undefined;
3626
+ return p && Object.hasOwn(p, c) ? p[c] : undefined;
3563
3627
  }, data);
3564
- if (result) {
3628
+ if (result || result === '' || result === null) {
3565
3629
  if (Array.isArray(item)) {
3566
3630
  return item.includes(result);
3567
3631
  } else if (every_typeof(item) === 'object' && Object.keys(item).length === 1) {
@@ -4796,9 +4860,17 @@ var ACTION_ACCESS = {
4796
4860
  }, _callee, null, [[0, 16]]);
4797
4861
  }))();
4798
4862
  },
4799
- handleRowAction: function handleRowAction(action, model) {
4863
+ handleRowAction: function handleRowAction(action, model, e) {
4864
+ var input = e.target.getElementsByTagName('input');
4800
4865
  this.selections = [model];
4801
- return this.handleAction(action, model);
4866
+ if (action.action === 'file') {
4867
+ e.stopPropagation();
4868
+ if (!input[0] || input[0].click() !== undefined) {
4869
+ e.path && e.path[1].getElementsByTagName('input')[0].click();
4870
+ }
4871
+ } else {
4872
+ return this.handleAction(action, model);
4873
+ }
4802
4874
  },
4803
4875
  handleAction: function handleAction(action, model, appendModel) {
4804
4876
  var _this4 = this;
@@ -9005,8 +9077,8 @@ var Filter_component = normalizeComponent(
9005
9077
  )
9006
9078
 
9007
9079
  /* harmony default export */ var Filter = (Filter_component.exports);
9008
- // CONCATENATED MODULE: ../node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4325b732-vue-loader-template"}!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/babel-loader/lib!../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib??vue-loader-options!../src/web/components/kits/action/Group.vue?vue&type=template&id=becd33d0&
9009
- var Groupvue_type_template_id_becd33d0_render = function render() {
9080
+ // CONCATENATED MODULE: ../node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4325b732-vue-loader-template"}!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/babel-loader/lib!../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib??vue-loader-options!../src/web/components/kits/action/Group.vue?vue&type=template&id=178a29ec&
9081
+ var Groupvue_type_template_id_178a29ec_render = function render() {
9010
9082
  var _vm = this,
9011
9083
  _c = _vm._self._c;
9012
9084
  return _c('div', {
@@ -9050,9 +9122,9 @@ var Groupvue_type_template_id_becd33d0_render = function render() {
9050
9122
  }), 1);
9051
9123
  }), 1);
9052
9124
  };
9053
- var Groupvue_type_template_id_becd33d0_staticRenderFns = [];
9125
+ var Groupvue_type_template_id_178a29ec_staticRenderFns = [];
9054
9126
 
9055
- // CONCATENATED MODULE: ../src/web/components/kits/action/Group.vue?vue&type=template&id=becd33d0&
9127
+ // CONCATENATED MODULE: ../src/web/components/kits/action/Group.vue?vue&type=template&id=178a29ec&
9056
9128
 
9057
9129
  // CONCATENATED MODULE: ../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib??vue-loader-options!../src/web/components/kits/action/Group.vue?vue&type=script&lang=js&
9058
9130
  function Groupvue_type_script_lang_js_typeof(obj) { "@babel/helpers - typeof"; return Groupvue_type_script_lang_js_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Groupvue_type_script_lang_js_typeof(obj); }
@@ -9094,7 +9166,7 @@ function Groupvue_type_script_lang_js_toPrimitive(input, hint) { if (Groupvue_ty
9094
9166
  if (action.action === 'file') {
9095
9167
  e.stopPropagation();
9096
9168
  if (!input[0] || input[0].click() !== undefined) {
9097
- e.path[1].getElementsByTagName('input')[0].click();
9169
+ e.path && e.path[1].getElementsByTagName('input')[0].click();
9098
9170
  }
9099
9171
  } else {
9100
9172
  this.$emit('action', action);
@@ -9118,8 +9190,8 @@ function Groupvue_type_script_lang_js_toPrimitive(input, hint) { if (Groupvue_ty
9118
9190
 
9119
9191
  var Group_component = normalizeComponent(
9120
9192
  action_Groupvue_type_script_lang_js_,
9121
- Groupvue_type_template_id_becd33d0_render,
9122
- Groupvue_type_template_id_becd33d0_staticRenderFns,
9193
+ Groupvue_type_template_id_178a29ec_render,
9194
+ Groupvue_type_template_id_178a29ec_staticRenderFns,
9123
9195
  false,
9124
9196
  null,
9125
9197
  null,