@cortezaproject/corteza-vue 2022.3.0-dev.1 → 2022.3.0-dev.2

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
@@ -2001,7 +2001,7 @@ class Auth {
2001
2001
  handle(req = new URL(this.entrypointURL)) {
2002
2002
  return __awaiter(this, void 0, void 0, function* () {
2003
2003
  this.log.info('handling authentication');
2004
- if (/\/auth\/callback$/.test(req.pathname)) {
2004
+ if (this.isCallback(req.pathname)) {
2005
2005
  this.log.info('handling authentication callback');
2006
2006
  const params = new URLSearchParams(req.search);
2007
2007
  if (params.has('error')) {
@@ -2012,14 +2012,13 @@ class Auth {
2012
2012
  if (params.has('state')) {
2013
2013
  const state = params.get('state') || '';
2014
2014
  const storeKeyStateLocation = `auth.state.${state}.location`;
2015
- this.log.info('state received', state);
2016
2015
  const tmp = this.sessionStorage.getItem(storeKeyStateLocation);
2017
2016
  if (tmp === null) {
2018
2017
  console.warn('state does not match, restarting authentication flow');
2019
2018
  this.startAuthenticationFlow();
2020
2019
  return null;
2021
2020
  }
2022
- if (!/auth\/callback/.test(tmp)) {
2021
+ if (!this.isCallback(tmp)) {
2023
2022
  // if by some coincidence we got callback URL to finalLocation
2024
2023
  // we'll silently ignore it and redirect user back to entrypoint
2025
2024
  finalLocation = tmp;
@@ -2028,9 +2027,9 @@ class Auth {
2028
2027
  }
2029
2028
  const code = params.get('code') || '';
2030
2029
  this.log.info('authorization code received', code);
2031
- yield this.exchangeCode(code);
2030
+ const rsp = yield this.exchangeCode(code);
2032
2031
  this.startFinalState(finalLocation);
2033
- return null;
2032
+ return rsp;
2034
2033
  }
2035
2034
  }
2036
2035
  return this.check();
@@ -2156,7 +2155,7 @@ class Auth {
2156
2155
  this.log.debug('starting new authentication flow');
2157
2156
  this.incFlowCounter();
2158
2157
  const state = Math.random().toString(36).substring(2);
2159
- this.sessionStorage.setItem(`auth.state.${state}.location`, this.location.toString());
2158
+ this.sessionStorage.setItem(`auth.state.${state}.location`, this.getRedirect(this.location.toString()));
2160
2159
  this.location.assign(Make({
2161
2160
  url: `${this.cortezaAuthURL}` + oauth2FlowURL,
2162
2161
  query: {
@@ -2167,6 +2166,20 @@ class Auth {
2167
2166
  },
2168
2167
  }));
2169
2168
  }
2169
+ getRedirect(url) {
2170
+ const u = new URL(url);
2171
+ // In case someone started the flow on a callback route, default to the root
2172
+ // of the webapp.
2173
+ if (this.isCallback(u.pathname)) {
2174
+ u.pathname = '';
2175
+ u.search = '';
2176
+ u.hash = '';
2177
+ }
2178
+ return u.toString();
2179
+ }
2180
+ isCallback(url) {
2181
+ return /\/auth\/callback$/.test(url);
2182
+ }
2170
2183
  /**
2171
2184
  * protects against too many tries when we try to auto-fix the "state does not match" error
2172
2185
  * by restarting the aut flow.
@@ -2563,6 +2576,10 @@ class Settings {
2563
2576
  throw new Error('api.notDefined');
2564
2577
  }
2565
2578
 
2579
+ return this.fetch();
2580
+ }
2581
+
2582
+ async fetch() {
2566
2583
  return this.api.settingsCurrent().then(settings => {
2567
2584
  this.current = settings || {};
2568
2585
  return settings;
@@ -2608,7 +2625,7 @@ class Settings {
2608
2625
  var settings = {
2609
2626
  install(Vue) {
2610
2627
  // Should be used to initialize settings
2611
- Vue.prototype.$Settings = new Settings(); // Should be used to access settings
2628
+ Vue.prototype.$Settings = Vue.observable(new Settings()); // Should be used to access settings
2612
2629
 
2613
2630
  Vue.prototype.$s = Vue.prototype.$Settings.get.bind(Vue.prototype.$Settings);
2614
2631
  }
@@ -71660,7 +71677,8 @@ var script$g = {
71660
71677
  return {
71661
71678
  visible: false,
71662
71679
  attrs: {
71663
- href: null
71680
+ href: null,
71681
+ target: '_self'
71664
71682
  }
71665
71683
  };
71666
71684
  },
@@ -71715,7 +71733,7 @@ var script$g = {
71715
71733
  const __vue_script__$g = script$g;
71716
71734
 
71717
71735
  /* template */
71718
- var __vue_render__$e = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"link-popover-container"}},[_c('b-button',{staticClass:"text-dark font-weight-bold text-decoration-none",attrs:{"variant":"link","id":"link-popover"},on:{"click":_vm.showPopover}},[_c('span',{class:_vm.activeClasses(_vm.format.attrs)},[_c('font-awesome-icon',{attrs:{"icon":"link"}})],1)]),_vm._v(" "),(_vm.currentValue)?_c('b-popover',{ref:"popover",attrs:{"triggers":"focus","target":"link-popover","placement":"auto","show":_vm.visible,"container":"link-popover-container"},on:{"update:show":function($event){_vm.visible=$event;}}},[_c('b-input-group',[_c('b-form-input',{attrs:{"type":"url","autofocus":"","state":_vm.urlValid ? null : false,"placeholder":_vm.labels.urlPlaceholder},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.link.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.close.apply(null, arguments)}]},model:{value:(_vm.attrs.href),callback:function ($$v) {_vm.$set(_vm.attrs, "href", $$v);},expression:"attrs.href"}}),_vm._v(" "),_c('b-input-group-append',[_c('b-button',{attrs:{"disabled":!_vm.urlValid,"variant":"outline-success"},on:{"click":_vm.link}},[_vm._v("\n "+_vm._s(_vm.labels.ok)+"\n ")])],1)],1)],1):_vm._e()],1)};
71736
+ var __vue_render__$e = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"link-popover-container"}},[_c('b-button',{staticClass:"text-dark font-weight-bold text-decoration-none",attrs:{"variant":"link","id":"link-popover"},on:{"click":_vm.showPopover}},[_c('span',{class:_vm.activeClasses(_vm.format.attrs)},[_c('font-awesome-icon',{attrs:{"icon":"link"}})],1)]),_vm._v(" "),(_vm.currentValue)?_c('b-popover',{ref:"popover",attrs:{"triggers":"focus","target":"link-popover","placement":"auto","show":_vm.visible,"container":"link-popover-container"},on:{"update:show":function($event){_vm.visible=$event;}}},[_c('b-input-group',[_c('b-form-input',{attrs:{"type":"url","autofocus":"","state":_vm.urlValid ? null : false,"placeholder":_vm.labels.urlPlaceholder},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.link.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.close.apply(null, arguments)}]},model:{value:(_vm.attrs.href),callback:function ($$v) {_vm.$set(_vm.attrs, "href", $$v);},expression:"attrs.href"}}),_vm._v(" "),_c('b-input-group-append',[_c('b-button',{attrs:{"disabled":!_vm.urlValid,"variant":"outline-success"},on:{"click":_vm.link}},[_vm._v("\n "+_vm._s(_vm.labels.ok)+"\n ")])],1),_vm._v(" "),_c('b-checkbox',{staticClass:"py-1",attrs:{"value":"_blank","unchecked-value":"_self"},model:{value:(_vm.attrs.target),callback:function ($$v) {_vm.$set(_vm.attrs, "target", $$v);},expression:"attrs.target"}},[_vm._v("\n "+_vm._s(_vm.labels.openLinkInNewTab)+"\n ")])],1)],1):_vm._e()],1)};
71719
71737
  var __vue_staticRenderFns__$e = [];
71720
71738
 
71721
71739
  /* style */
@@ -78301,8 +78319,9 @@ class Link extends Link$1 {
78301
78319
  get schema() {
78302
78320
  const base = super.schema;
78303
78321
  return { ...base,
78304
- toDOM: node => ['a', { ...node.attrs,
78322
+ toDOM: node => ['a', {
78305
78323
  target: '_blank',
78324
+ ...node.attrs,
78306
78325
  rel: 'noopener noreferrer nofollow'
78307
78326
  }, 0]
78308
78327
  };
@@ -81109,6 +81128,31 @@ var __vue_staticRenderFns__$x = [];
81109
81128
  //
81110
81129
  //
81111
81130
  //
81131
+ //
81132
+ //
81133
+ //
81134
+ //
81135
+ //
81136
+ //
81137
+ //
81138
+ //
81139
+ //
81140
+ //
81141
+ //
81142
+ //
81143
+ //
81144
+ //
81145
+ //
81146
+ //
81147
+ //
81148
+ //
81149
+ //
81150
+ //
81151
+ //
81152
+ //
81153
+ //
81154
+ //
81155
+ //
81112
81156
  var script$C = {
81113
81157
  props: {
81114
81158
  sidebarPinned: {
@@ -81125,6 +81169,10 @@ var script$C = {
81125
81169
  type: String,
81126
81170
  default: '../'
81127
81171
  },
81172
+ settings: {
81173
+ type: Object,
81174
+ required: true
81175
+ },
81128
81176
  labels: {
81129
81177
  type: Object,
81130
81178
  required: true
@@ -81144,6 +81192,35 @@ var script$C = {
81144
81192
  return `https://docs.cortezaproject.org/corteza-docs/${year}.${month}/index.html`;
81145
81193
  },
81146
81194
 
81195
+ helpLinks() {
81196
+ const {
81197
+ helpLinks = []
81198
+ } = this.settings || {};
81199
+ return (helpLinks || []).filter(({
81200
+ handle,
81201
+ url
81202
+ }) => handle && url);
81203
+ },
81204
+
81205
+ profileLinks() {
81206
+ const {
81207
+ profileLinks = []
81208
+ } = this.settings || {};
81209
+ return (profileLinks || []).filter(({
81210
+ handle,
81211
+ url
81212
+ }) => handle && url);
81213
+ },
81214
+
81215
+ onlyVersion() {
81216
+ const {
81217
+ hideForumLink,
81218
+ hideDocumentationLink,
81219
+ hideFeedbackLink
81220
+ } = this.settings || {};
81221
+ return !this.helpLinks.length && hideForumLink && hideDocumentationLink && hideFeedbackLink;
81222
+ },
81223
+
81147
81224
  frontendVersion() {
81148
81225
  /* eslint-disable no-undef */
81149
81226
  return VERSION;
@@ -81158,17 +81235,17 @@ const __vue_script__$C = script$C;
81158
81235
  /* template */
81159
81236
  var __vue_render__$y = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"header-navigation d-flex align-items-center justify-content-between sticky-top pr-3 pl-5 "},[_c('div',{staticClass:"d-flex text-nowrap flex-grow-1 align-items-center header h-100 w-100"},[[_c('div',{staticClass:"spacer",class:{
81160
81237
  'expanded': _vm.sidebarPinned,
81161
- }})],_vm._v(" "),_c('div',{staticClass:"d-flex align-items-center ml-2 text-truncate mr-auto h-100"},[_c('h2',{staticClass:"d-none d-sm-block mb-0"},[_vm._t("title")],2)]),_vm._v(" "),_c('div',{staticClass:"ml-3"},[_vm._t("tools")],2),_vm._v(" "),(!_vm.hideAppSelector)?_c('b-button',{staticClass:"d-flex align-items-center justify-content-center text-dark border-0 nav-icon rounded-circle ml-2",attrs:{"variant":"outline-light","href":_vm.appSelectorURL,"size":"lg"}},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['fas', 'grip-horizontal']}})],1):_vm._e(),_vm._v(" "),_c('b-dropdown',{staticClass:"nav-icon mx-1",attrs:{"size":"lg","variant":"outline-light","toggle-class":"text-decoration-none text-dark rounded-circle border-0 w-100","menu-class":"border-0 shadow-sm text-dark font-weight-bold mt-2","right":"","no-caret":""},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('div',{staticClass:"d-flex align-items-center justify-content-center"},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['far', 'question-circle']}}),_vm._v(" "),_c('span',{staticClass:"sr-only"},[_vm._v("\n Help\n ")])],1)]},proxy:true}])},[_vm._v(" "),_c('div',[_vm._t("help-dropdown")],2),_vm._v(" "),_c('b-dropdown-item',{attrs:{"href":"https://forum.cortezaproject.org/","target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpForum)+"\n ")]),_vm._v(" "),_c('b-dropdown-item',{attrs:{"href":_vm.documentationURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpDocumentation)+"\n ")]),_vm._v(" "),_c('b-dropdown-item',{attrs:{"href":"mailto:info@crust.tech","target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpFeedback)+"\n ")]),_vm._v(" "),_c('b-dropdown-divider'),_vm._v(" "),_c('b-dropdown-item',{staticClass:"small",attrs:{"disabled":""}},[_vm._v("\n "+_vm._s(_vm.labels.helpVersion)+"\n "),_c('br'),_vm._v("\n "+_vm._s(_vm.frontendVersion)+"\n ")])],1),_vm._v(" "),_c('b-dropdown',{staticClass:"nav-user-icon",attrs:{"data-v-onboarding":"profile","size":"lg","variant":"outline-light","toggle-class":"nav-icon text-decoration-none text-dark rounded-circle border","menu-class":"border-0 shadow-sm text-dark font-weight-bold mt-2","right":"","no-caret":""},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('div',{staticClass:"d-flex align-items-center justify-content-center"},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['far', 'user']}}),_vm._v(" "),_c('span',{staticClass:"sr-only"},[_vm._v("\n "+_vm._s(_vm.labels.helpForum)+"\n ")])],1)]},proxy:true}])},[_vm._v(" "),_c('b-dropdown-text',{staticClass:"text-muted mb-2"},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsLoggedInAs)+"\n ")]),_vm._v(" "),_c('div',[_vm._t("avatar-dropdown")],2),_vm._v(" "),_c('b-dropdown-item',{attrs:{"href":_vm.userProfileURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsProfile)+"\n ")]),_vm._v(" "),_c('b-dropdown-item',{attrs:{"href":_vm.changePasswordURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsChangePassword)+"\n ")]),_vm._v(" "),_c('b-dropdown-divider'),_vm._v(" "),_c('b-dropdown-item',{staticClass:"mt-2",attrs:{"href":""},on:{"click":function($event){return _vm.$auth.logout()}}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsLogout)+"\n ")])],1)],2)])};
81238
+ }})],_vm._v(" "),_c('div',{staticClass:"d-flex align-items-center ml-2 text-truncate mr-auto h-100"},[_c('h2',{staticClass:"d-none d-sm-block mb-0"},[_vm._t("title")],2)]),_vm._v(" "),_c('div',{staticClass:"ml-3"},[_vm._t("tools")],2),_vm._v(" "),(!_vm.hideAppSelector && !_vm.settings.hideAppSelector)?_c('b-button',{staticClass:"d-flex align-items-center justify-content-center text-dark border-0 nav-icon rounded-circle ml-2",attrs:{"variant":"outline-light","href":_vm.appSelectorURL,"size":"lg"}},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['fas', 'grip-horizontal']}})],1):_vm._e(),_vm._v(" "),(!_vm.settings.hideHelp)?_c('b-dropdown',{staticClass:"nav-icon mx-1",attrs:{"size":"lg","variant":"outline-light","toggle-class":"text-decoration-none text-dark rounded-circle border-0 w-100","menu-class":"topbar-dropdown-menu border-0 shadow-sm text-dark font-weight-bold mt-2","right":"","no-caret":""},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('div',{staticClass:"d-flex align-items-center justify-content-center"},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['far', 'question-circle']}}),_vm._v(" "),_c('span',{staticClass:"sr-only"},[_vm._v("\n Help\n ")])],1)]},proxy:true}],null,false,3609523728)},[_vm._v(" "),_c('div',[_vm._t("help-dropdown")],2),_vm._v(" "),_vm._l((_vm.helpLinks),function(helpLink,index){return _c('b-dropdown-item',{key:index,attrs:{"href":helpLink.url,"target":helpLink.newTab ? '_blank' : ''}},[_vm._v("\n "+_vm._s(helpLink.handle)+"\n ")])}),_vm._v(" "),(!_vm.settings.hideForumLink)?_c('b-dropdown-item',{attrs:{"href":"https://forum.cortezaproject.org/","target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpForum)+"\n ")]):_vm._e(),_vm._v(" "),(!_vm.settings.hideDocumentationLink)?_c('b-dropdown-item',{attrs:{"href":_vm.documentationURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpDocumentation)+"\n ")]):_vm._e(),_vm._v(" "),(!_vm.settings.hideFeedbackLink)?_c('b-dropdown-item',{attrs:{"href":"mailto:info@crust.tech","target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.helpFeedback)+"\n ")]):_vm._e(),_vm._v(" "),(!_vm.onlyVersion)?_c('b-dropdown-divider'):_vm._e(),_vm._v(" "),_c('b-dropdown-item',{staticClass:"small",attrs:{"disabled":""}},[_vm._v("\n "+_vm._s(_vm.labels.helpVersion)+"\n "),_c('br'),_vm._v("\n "+_vm._s(_vm.frontendVersion)+"\n ")])],2):_vm._e(),_vm._v(" "),(!_vm.settings.hideProfile)?_c('b-dropdown',{staticClass:"nav-user-icon",attrs:{"data-v-onboarding":"profile","size":"lg","variant":"outline-light","toggle-class":"nav-icon text-decoration-none text-dark rounded-circle border","menu-class":"topbar-dropdown-menu border-0 shadow-sm text-dark font-weight-bold mt-2","right":"","no-caret":""},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('div',{staticClass:"d-flex align-items-center justify-content-center"},[_c('font-awesome-icon',{staticClass:"m-0 h5",attrs:{"icon":['far', 'user']}}),_vm._v(" "),_c('span',{staticClass:"sr-only"},[_vm._v("\n "+_vm._s(_vm.labels.helpForum)+"\n ")])],1)]},proxy:true}],null,false,2199786693)},[_vm._v(" "),_c('b-dropdown-text',{staticClass:"text-muted mb-2"},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsLoggedInAs)+"\n ")]),_vm._v(" "),_c('div',[_vm._t("avatar-dropdown")],2),_vm._v(" "),_vm._l((_vm.profileLinks),function(profileLink,index){return _c('b-dropdown-item',{key:index,attrs:{"href":profileLink.url,"target":profileLink.newTab ? '_blank' : ''}},[_vm._v("\n "+_vm._s(profileLink.handle)+"\n ")])}),_vm._v(" "),(!_vm.settings.hideProfileLink)?_c('b-dropdown-item',{attrs:{"href":_vm.userProfileURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsProfile)+"\n ")]):_vm._e(),_vm._v(" "),(!_vm.settings.hideChangePasswordLink)?_c('b-dropdown-item',{attrs:{"href":_vm.changePasswordURL,"target":"_blank"}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsChangePassword)+"\n ")]):_vm._e(),_vm._v(" "),_c('b-dropdown-divider'),_vm._v(" "),_c('b-dropdown-item',{staticClass:"mt-2",attrs:{"href":""},on:{"click":function($event){return _vm.$auth.logout()}}},[_vm._v("\n "+_vm._s(_vm.labels.userSettingsLogout)+"\n ")])],2):_vm._e()],2)])};
81162
81239
  var __vue_staticRenderFns__$y = [];
81163
81240
 
81164
81241
  /* style */
81165
81242
  const __vue_inject_styles__$D = function (inject) {
81166
81243
  if (!inject) return
81167
- inject("data-v-d822059c_0", { source: ".icon-logo[data-v-d822059c]{height:calc(64px / 2);background-repeat:no-repeat;background-position:center}.nav-icon[data-v-d822059c]{width:40px;height:40px}.nav-user-icon[data-v-d822059c]{width:50px;height:50px}.header-navigation[data-v-d822059c]{width:100vw;height:64px;background-color:#f3f3f5!important}.header-navigation h2[data-v-d822059c]{padding-left:calc(.5rem + 2px)}.spacer[data-v-d822059c]{min-width:0;-webkit-transition:min-width .15s ease-in-out;-moz-transition:min-width .15s ease-in-out;-o-transition:min-width .15s ease-in-out;transition:min-width .15s ease-in-out}.spacer.expanded[data-v-d822059c]{min-width:calc(320px - 42px);-webkit-transition:min-width .2s ease-in-out;-moz-transition:min-width .2s ease-in-out;-o-transition:min-width .2s ease-in-out;transition:min-width .2s ease-in-out}", map: undefined, media: undefined });
81244
+ inject("data-v-39d2e772_0", { source: ".icon-logo[data-v-39d2e772]{height:calc(64px / 2);background-repeat:no-repeat;background-position:center}.nav-icon[data-v-39d2e772]{width:40px;height:40px}.nav-user-icon[data-v-39d2e772]{width:50px;height:50px}.header-navigation[data-v-39d2e772]{width:100vw;height:64px;background-color:#f3f3f5!important}.header-navigation h2[data-v-39d2e772]{padding-left:calc(.5rem + 2px)}.topbar-dropdown-menu[data-v-39d2e772]{max-height:80vh;overflow-y:auto}.spacer[data-v-39d2e772]{min-width:0;-webkit-transition:min-width .15s ease-in-out;-moz-transition:min-width .15s ease-in-out;-o-transition:min-width .15s ease-in-out;transition:min-width .15s ease-in-out}.spacer.expanded[data-v-39d2e772]{min-width:calc(320px - 42px);-webkit-transition:min-width .2s ease-in-out;-moz-transition:min-width .2s ease-in-out;-o-transition:min-width .2s ease-in-out;transition:min-width .2s ease-in-out}", map: undefined, media: undefined });
81168
81245
 
81169
81246
  };
81170
81247
  /* scoped */
81171
- const __vue_scope_id__$D = "data-v-d822059c";
81248
+ const __vue_scope_id__$D = "data-v-39d2e772";
81172
81249
  /* module identifier */
81173
81250
  const __vue_module_identifier__$D = undefined;
81174
81251
  /* functional template */
@@ -82606,28 +82683,18 @@ var script$P = {
82606
82683
  * Update parent component (if needed)
82607
82684
  * @param v
82608
82685
  */
82609
- selected(items) {
82610
- const value = items.map(i => i[this.valueField]);
82611
- /**
82612
- * Make sure we do not fall into an infinite loop
82613
- *
82614
- * If we emit update/input event, parent will update value/v-modal
82615
- * and watcher function for value will trigger the sync and recreate
82616
- * the selected array and trigger this watcher!
82617
- */
82686
+ selected: {
82687
+ immediate: false,
82618
82688
 
82619
- if (value.length === this.value.length) {
82620
- if (value.filter(v => !this.value.includes(v)).length === 0) {
82621
- return;
82622
- }
82623
- } // satisfy value.sync
82689
+ handler(items) {
82690
+ const value = items.map(i => i[this.valueField]); // satisfy value.sync
82624
82691
 
82692
+ this.$emit('update:value', value); // satisfy v-model
82625
82693
 
82626
- this.$emit('update:value', value); // satisfy v-model
82694
+ this.$emit('input', value);
82695
+ }
82627
82696
 
82628
- this.$emit('input', value);
82629
82697
  },
82630
-
82631
82698
  options: {
82632
82699
  deep: true,
82633
82700
  immediate: true,
@@ -82637,11 +82704,26 @@ var script$P = {
82637
82704
  }
82638
82705
 
82639
82706
  },
82707
+ value: {
82708
+ immediate: false,
82640
82709
 
82641
- value(vv) {
82642
- this.sync();
82643
- }
82710
+ handler(value = [], oldValue = []) {
82711
+ /**
82712
+ * Make sure we do not fall into an infinite loop
82713
+ *
82714
+ * If we update the value thenn sync will trigger recomputation of selected
82715
+ * Which then emits the update event and the loop will begin
82716
+ */
82717
+ if (value.length === oldValue.length) {
82718
+ if (value.filter(v => !oldValue.includes(v)).length === 0) {
82719
+ return;
82720
+ }
82721
+ }
82644
82722
 
82723
+ this.sync();
82724
+ }
82725
+
82726
+ }
82645
82727
  },
82646
82728
 
82647
82729
  created() {
@@ -82716,10 +82798,12 @@ var script$P = {
82716
82798
  this.available = this.frozen().filter(opt => !this.isPicked(opt));
82717
82799
  /**
82718
82800
  * filter all unpicked options, freeze each item in the array and
82719
- * build list of selected items
82801
+ * build list of selected items, traverse value to keep order
82720
82802
  */
82721
82803
 
82722
- this.selected = this.frozen().filter(opt => this.isPicked(opt));
82804
+ this.selected = this.value.map(v => {
82805
+ return this.frozen().find(item => item[this.valueField] === v);
82806
+ }).filter(f => f);
82723
82807
  },
82724
82808
 
82725
82809
  frozen() {
@@ -83421,18 +83505,18 @@ var __vue_render__$N = function () {var _vm=this;var _h=_vm.$createElement;var _
83421
83505
  }),attrs:{"icon":['fas', 'angle-up']}}),_vm._v(" "),_c('font-awesome-icon',{staticClass:"mt-1",style:({
83422
83506
  color: _vm.sort.field === c.meta.sortKey && _vm.sort.descending ? 'black' : 'grey',
83423
83507
  }),attrs:{"icon":['fas', 'angle-down']}})],1):_vm._e()],1)])}),1)],1),_vm._v(" "),_c('b-tbody',{staticClass:"h-100"},_vm._l((_vm.tabelify.rows),function(r,i){return _c('b-tr',{key:i,class:{
83424
- separator: !!r[0].separator,
83508
+ separator: !!(r[0] || {}).separator,
83425
83509
  }},_vm._l((r),function(c,j){return _c('b-td',_vm._b({key:j},'b-td',c.attrs || {},false),[_vm._v("\n "+_vm._s(c.value)+"\n ")])}),1)}),1)],2),_vm._v(" "),_c('b-card-footer',{staticClass:"d-flex p-1 rounded-0"},[_c('b-button-group',{staticClass:"ml-auto"},[_c('b-button',{staticClass:"d-flex align-items-center text-dark px-1",attrs:{"disabled":!_vm.hasPrevPage,"variant":"link"},on:{"click":function($event){return _vm.goToPage()}}},[_c('font-awesome-icon',{attrs:{"icon":['fas', 'angle-double-left']}})],1),_vm._v(" "),_c('b-button',{staticClass:"d-flex align-items-center text-dark",attrs:{"disabled":!_vm.hasPrevPage,"variant":"link"},on:{"click":function($event){return _vm.goToPage('prevPage')}}},[_c('font-awesome-icon',{staticClass:"mr-1",attrs:{"icon":['fas', 'angle-left']}}),_vm._v("\n "+_vm._s(_vm.labels.previous)+"\n ")],1),_vm._v(" "),_c('b-button',{staticClass:"d-flex align-items-center text-dark",attrs:{"disabled":!_vm.hasNextPage,"variant":"link"},on:{"click":function($event){return _vm.goToPage('nextPage')}}},[_vm._v("\n "+_vm._s(_vm.labels.next)+"\n "),_c('font-awesome-icon',{staticClass:"ml-1",attrs:{"icon":['fas', 'angle-right']}})],1)],1)],1)],1)};
83426
83510
  var __vue_staticRenderFns__$N = [];
83427
83511
 
83428
83512
  /* style */
83429
83513
  const __vue_inject_styles__$U = function (inject) {
83430
83514
  if (!inject) return
83431
- inject("data-v-52bf61e6_0", { source: ".foreign[data-v-52bf61e6]{border:1px solid rgba(22,36,37,.8);border-top:0;border-bottom:0}.separator[data-v-52bf61e6]{border-top:2px solid rgba(22,36,37,.5)}.card-rounded[data-v-52bf61e6]{border-radius:1rem 1rem 0 0}", map: undefined, media: undefined });
83515
+ inject("data-v-b515bfce_0", { source: ".foreign[data-v-b515bfce]{border:1px solid rgba(22,36,37,.8);border-top:0;border-bottom:0}.separator[data-v-b515bfce]{border-top:2px solid rgba(22,36,37,.5)}.card-rounded[data-v-b515bfce]{border-radius:1rem 1rem 0 0}", map: undefined, media: undefined });
83432
83516
 
83433
83517
  };
83434
83518
  /* scoped */
83435
- const __vue_scope_id__$U = "data-v-52bf61e6";
83519
+ const __vue_scope_id__$U = "data-v-b515bfce";
83436
83520
  /* module identifier */
83437
83521
  const __vue_module_identifier__$U = undefined;
83438
83522
  /* functional template */