@mozaic-ds/vue 0.35.0-beta.2 → 0.35.0-beta.3

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.
@@ -12227,7 +12227,7 @@ var uncurryThis = __webpack_require__(1702);
12227
12227
  var toString = __webpack_require__(1340);
12228
12228
  var regexpFlags = __webpack_require__(7066);
12229
12229
  var stickyHelpers = __webpack_require__(2999);
12230
- var shared = __webpack_require__(921);
12230
+ var shared = __webpack_require__(2309);
12231
12231
  var create = __webpack_require__(30);
12232
12232
  var getInternalState = (__webpack_require__(9909).get);
12233
12233
  var UNSUPPORTED_DOT_ALL = __webpack_require__(9441);
@@ -12523,7 +12523,7 @@ module.exports = function (target, TAG, STATIC) {
12523
12523
  /***/ 6200:
12524
12524
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
12525
12525
 
12526
- var shared = __webpack_require__(921);
12526
+ var shared = __webpack_require__(2309);
12527
12527
  var uid = __webpack_require__(9711);
12528
12528
 
12529
12529
  var keys = shared('keys');
@@ -12549,7 +12549,7 @@ module.exports = store;
12549
12549
 
12550
12550
  /***/ }),
12551
12551
 
12552
- /***/ 921:
12552
+ /***/ 2309:
12553
12553
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
12554
12554
 
12555
12555
  var IS_PURE = __webpack_require__(1913);
@@ -13183,7 +13183,7 @@ exports.f = wellKnownSymbol;
13183
13183
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
13184
13184
 
13185
13185
  var global = __webpack_require__(7854);
13186
- var shared = __webpack_require__(921);
13186
+ var shared = __webpack_require__(2309);
13187
13187
  var hasOwn = __webpack_require__(2597);
13188
13188
  var uid = __webpack_require__(9711);
13189
13189
  var NATIVE_SYMBOL = __webpack_require__(6293);
@@ -15516,7 +15516,7 @@ var definePropertyModule = __webpack_require__(3070);
15516
15516
  var definePropertiesModule = __webpack_require__(6048);
15517
15517
  var propertyIsEnumerableModule = __webpack_require__(5296);
15518
15518
  var defineBuiltIn = __webpack_require__(8052);
15519
- var shared = __webpack_require__(921);
15519
+ var shared = __webpack_require__(2309);
15520
15520
  var sharedKey = __webpack_require__(6200);
15521
15521
  var hiddenKeys = __webpack_require__(3501);
15522
15522
  var uid = __webpack_require__(9711);
@@ -15820,7 +15820,7 @@ var $ = __webpack_require__(2109);
15820
15820
  var getBuiltIn = __webpack_require__(5005);
15821
15821
  var hasOwn = __webpack_require__(2597);
15822
15822
  var toString = __webpack_require__(1340);
15823
- var shared = __webpack_require__(921);
15823
+ var shared = __webpack_require__(2309);
15824
15824
  var NATIVE_SYMBOL_REGISTRY = __webpack_require__(2015);
15825
15825
 
15826
15826
  var StringToSymbolRegistry = shared('string-to-symbol-registry');
@@ -15874,7 +15874,7 @@ var $ = __webpack_require__(2109);
15874
15874
  var hasOwn = __webpack_require__(2597);
15875
15875
  var isSymbol = __webpack_require__(2190);
15876
15876
  var tryToString = __webpack_require__(6330);
15877
- var shared = __webpack_require__(921);
15877
+ var shared = __webpack_require__(2309);
15878
15878
  var NATIVE_SYMBOL_REGISTRY = __webpack_require__(2015);
15879
15879
 
15880
15880
  var SymbolToStringRegistry = shared('symbol-to-string-registry');
@@ -22381,22 +22381,18 @@ MLink.install = function (Vue) {
22381
22381
  Vue.component(MLink.name, MLink);
22382
22382
  };
22383
22383
 
22384
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/listbox/MListBoxActions.vue?vue&type=template&id=dc7f0b5a&
22385
- var MListBoxActionsvue_type_template_id_dc7f0b5a_render = function render() {
22384
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/listbox/MListBoxActions.vue?vue&type=template&id=6fe6b471&
22385
+ var MListBoxActionsvue_type_template_id_6fe6b471_render = function render() {
22386
22386
  var _vm = this,
22387
22387
  _c = _vm._self._c;
22388
22388
  return _c('div', {
22389
22389
  directives: [{
22390
22390
  name: "click-outside",
22391
22391
  rawName: "v-click-outside",
22392
- value: _vm.onClickOutside,
22393
- expression: "onClickOutside"
22392
+ value: _vm.closeListbox,
22393
+ expression: "closeListbox"
22394
22394
  }],
22395
- staticClass: "mc-listbox-options",
22396
- class: {
22397
- 'mc-listbox-options--fixed': _vm.hasDataTable
22398
- },
22399
- style: _vm.setStyles
22395
+ staticClass: "mc-listbox-options"
22400
22396
  }, [_c('button', {
22401
22397
  ref: "trigger",
22402
22398
  staticClass: "mc-listbox-options__trigger",
@@ -22405,29 +22401,32 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_render = function render() {
22405
22401
  },
22406
22402
  on: {
22407
22403
  "click": function click($event) {
22408
- return _vm.onSwitch($event);
22404
+ return _vm.onClickTrigger($event);
22409
22405
  }
22410
22406
  }
22411
- }, [_c('m-icon', {
22407
+ }, [_c('MIcon', {
22412
22408
  attrs: {
22413
- "name": "DisplayOptions24",
22409
+ "name": _vm.icon,
22414
22410
  "color": _vm.triggerIconColor
22415
22411
  }
22416
22412
  }), _c('span', {
22417
22413
  staticClass: "mc-listbox-options__trigger-label"
22418
22414
  }, [_vm._v(_vm._s(_vm.triggerLabel))])], 1), _c('div', {
22415
+ directives: [{
22416
+ name: "show",
22417
+ rawName: "v-show",
22418
+ value: _vm.isOpen,
22419
+ expression: "isOpen"
22420
+ }],
22419
22421
  ref: "listbox",
22420
22422
  staticClass: "mc-listbox-options__container",
22421
- class: {
22422
- 'is-open': _vm.isOpen,
22423
- 'align-right': _vm.position == 'right',
22424
- 'align-top': _vm.displayTop
22425
- },
22423
+ class: _vm.classObjectListbox,
22424
+ style: _vm.styleObjectListbox,
22426
22425
  attrs: {
22427
22426
  "role": "listbox",
22428
22427
  "aria-labelledby": "listbox"
22429
22428
  }
22430
- }, _vm._l(_vm.listItems, function (list, i) {
22429
+ }, _vm._l(_vm.getItems, function (list, i) {
22431
22430
  return _c('ul', {
22432
22431
  key: "list".concat(i),
22433
22432
  staticClass: "mc-listbox-options__list"
@@ -22438,7 +22437,7 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_render = function render() {
22438
22437
  class: {
22439
22438
  'is-disabled': item.disabled
22440
22439
  }
22441
- }, [item.icon ? _c('m-icon', {
22440
+ }, [item.icon ? _c('MIcon', {
22442
22441
  staticClass: "mc-listbox-options__icon",
22443
22442
  attrs: {
22444
22443
  "name": item.icon,
@@ -22466,7 +22465,7 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_render = function render() {
22466
22465
  }), 0);
22467
22466
  }), 0)]);
22468
22467
  };
22469
- var MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns = [];
22468
+ var MListBoxActionsvue_type_template_id_6fe6b471_staticRenderFns = [];
22470
22469
 
22471
22470
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/listbox/MListBoxActions.vue?vue&type=script&lang=js&
22472
22471
 
@@ -22516,18 +22515,35 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns = [];
22516
22515
  triggerIconColor: {
22517
22516
  type: String,
22518
22517
  default: 'currentColor'
22518
+ },
22519
+ icon: {
22520
+ type: String,
22521
+ default: 'DisplayOptions24'
22519
22522
  }
22520
22523
  },
22521
22524
  data: function data() {
22522
22525
  return {
22523
22526
  isOpen: this.open,
22524
22527
  displayTop: false,
22525
- posTop: '0px',
22526
- hasDataTable: false
22528
+ listboxTop: '0px',
22529
+ listboxLeft: '0px'
22527
22530
  };
22528
22531
  },
22529
22532
  computed: {
22530
- listItems: function listItems() {
22533
+ classObjectListbox: function classObjectListbox() {
22534
+ return {
22535
+ 'is-open': this.isOpen,
22536
+ 'align-right': this.position == 'right',
22537
+ 'align-top': this.displayTop
22538
+ };
22539
+ },
22540
+ styleObjectListbox: function styleObjectListbox() {
22541
+ return {
22542
+ top: this.listboxTop,
22543
+ left: this.listboxLeft
22544
+ };
22545
+ },
22546
+ getItems: function getItems() {
22531
22547
  var hasNestedArray = this.items.filter(Array.isArray).length;
22532
22548
  if (hasNestedArray === 0) {
22533
22549
  var listItems = [];
@@ -22535,40 +22551,20 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns = [];
22535
22551
  return [this.items];
22536
22552
  }
22537
22553
  return this.items;
22538
- },
22539
- setStyles: function setStyles() {
22540
- return {
22541
- '--listbox-top': this.hasDataTable ? this.posTop + 'px' : null
22542
- };
22543
22554
  }
22544
22555
  },
22545
22556
  mounted: function mounted() {
22546
- this.hasDataTable = this.$parent.$options._componentTag === 'm-data-table' ? true : false;
22547
- if (this.hasDataTable) {
22548
- this.$parent.$el.querySelector('.mc-data-table__body').addEventListener('scroll', this.handleScroll);
22549
- }
22557
+ this.teleport(this.$refs.listbox);
22558
+ },
22559
+ created: function created() {
22560
+ window.addEventListener('scroll', this.closeListbox, {
22561
+ capture: true
22562
+ });
22550
22563
  },
22551
22564
  destroyed: function destroyed() {
22552
- if (this.hasDataTable) {
22553
- this.$parent.$el.querySelector('.mc-data-table__body').removeEventListener('scroll', this.handleScroll);
22554
- }
22565
+ window.removeEventListener('scroll', this.closeListbox);
22555
22566
  },
22556
22567
  methods: {
22557
- onClickOutside: function onClickOutside() {
22558
- this.isOpen = false;
22559
- },
22560
- onSwitch: function onSwitch(e) {
22561
- if (!this.isOpen) {
22562
- if (this.$refs.listbox.clientHeight + e.clientY >= window.innerHeight) {
22563
- this.displayTop = true;
22564
- }
22565
- if (this.hasDataTable) {
22566
- var buttonSizes = this.$refs.trigger.getBoundingClientRect();
22567
- this.posTop = buttonSizes.top + buttonSizes.height;
22568
- }
22569
- }
22570
- this.isOpen = !this.isOpen;
22571
- },
22572
22568
  onClickItem: function onClickItem(item, listIndex, itemIndex) {
22573
22569
  var valToEmit = Object.assign({
22574
22570
  listIndex: listIndex,
@@ -22577,17 +22573,46 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns = [];
22577
22573
  this.$emit('update:itemSelected', valToEmit); // TODO: deprecated
22578
22574
  this.$emit('item-clicked', valToEmit);
22579
22575
  },
22580
- handleScroll: function handleScroll() {
22576
+ onClickTrigger: function onClickTrigger(e) {
22577
+ var _this = this;
22578
+ this.$nextTick(function () {
22579
+ if (_this.$refs.listbox.clientHeight + e.clientY >= window.innerHeight) {
22580
+ _this.displayTop = true;
22581
+ }
22582
+ });
22583
+ this.isOpen = !this.isOpen;
22584
+ this.setListBoxPosition();
22585
+ },
22586
+ setListBoxPosition: function setListBoxPosition() {
22587
+ var _this$$refs$trigger$g = this.$refs.trigger.getBoundingClientRect(),
22588
+ top = _this$$refs$trigger$g.top,
22589
+ left = _this$$refs$trigger$g.left,
22590
+ height = _this$$refs$trigger$g.height;
22591
+ var topValue = Math.floor(top) + Math.floor(height) + window.scrollY;
22592
+ var leftValue = Math.floor(left);
22593
+ this.listboxTop = "".concat(topValue, "px");
22594
+ this.listboxLeft = "".concat(leftValue, "px");
22595
+ },
22596
+ teleport: function teleport(elToMove, elTarget) {
22597
+ var target = elTarget !== null && elTarget !== void 0 ? elTarget : document.body;
22598
+ if (target && elToMove) {
22599
+ target.append(elToMove);
22600
+ }
22601
+ },
22602
+ closeListbox: function closeListbox() {
22603
+ if (!this.isOpen) {
22604
+ return;
22605
+ }
22581
22606
  this.isOpen = false;
22582
22607
  }
22583
22608
  }
22584
22609
  });
22585
22610
  ;// CONCATENATED MODULE: ./src/components/listbox/MListBoxActions.vue?vue&type=script&lang=js&
22586
22611
  /* harmony default export */ var listbox_MListBoxActionsvue_type_script_lang_js_ = (MListBoxActionsvue_type_script_lang_js_);
22587
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-41.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/listbox/MListBoxActions.vue?vue&type=style&index=0&id=dc7f0b5a&prod&lang=scss&
22612
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-41.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/listbox/MListBoxActions.vue?vue&type=style&index=0&id=6fe6b471&prod&lang=scss&
22588
22613
  // extracted by mini-css-extract-plugin
22589
22614
 
22590
- ;// CONCATENATED MODULE: ./src/components/listbox/MListBoxActions.vue?vue&type=style&index=0&id=dc7f0b5a&prod&lang=scss&
22615
+ ;// CONCATENATED MODULE: ./src/components/listbox/MListBoxActions.vue?vue&type=style&index=0&id=6fe6b471&prod&lang=scss&
22591
22616
 
22592
22617
  ;// CONCATENATED MODULE: ./src/components/listbox/MListBoxActions.vue
22593
22618
 
@@ -22600,8 +22625,8 @@ var MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns = [];
22600
22625
 
22601
22626
  var MListBoxActions_component = normalizeComponent(
22602
22627
  listbox_MListBoxActionsvue_type_script_lang_js_,
22603
- MListBoxActionsvue_type_template_id_dc7f0b5a_render,
22604
- MListBoxActionsvue_type_template_id_dc7f0b5a_staticRenderFns,
22628
+ MListBoxActionsvue_type_template_id_6fe6b471_render,
22629
+ MListBoxActionsvue_type_template_id_6fe6b471_staticRenderFns,
22605
22630
  false,
22606
22631
  null,
22607
22632
  null,