@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.js CHANGED
@@ -2007,7 +2007,7 @@ class Auth {
2007
2007
  handle(req = new URL(this.entrypointURL)) {
2008
2008
  return __awaiter(this, void 0, void 0, function* () {
2009
2009
  this.log.info('handling authentication');
2010
- if (/\/auth\/callback$/.test(req.pathname)) {
2010
+ if (this.isCallback(req.pathname)) {
2011
2011
  this.log.info('handling authentication callback');
2012
2012
  const params = new URLSearchParams(req.search);
2013
2013
  if (params.has('error')) {
@@ -2018,14 +2018,13 @@ class Auth {
2018
2018
  if (params.has('state')) {
2019
2019
  const state = params.get('state') || '';
2020
2020
  const storeKeyStateLocation = `auth.state.${state}.location`;
2021
- this.log.info('state received', state);
2022
2021
  const tmp = this.sessionStorage.getItem(storeKeyStateLocation);
2023
2022
  if (tmp === null) {
2024
2023
  console.warn('state does not match, restarting authentication flow');
2025
2024
  this.startAuthenticationFlow();
2026
2025
  return null;
2027
2026
  }
2028
- if (!/auth\/callback/.test(tmp)) {
2027
+ if (!this.isCallback(tmp)) {
2029
2028
  // if by some coincidence we got callback URL to finalLocation
2030
2029
  // we'll silently ignore it and redirect user back to entrypoint
2031
2030
  finalLocation = tmp;
@@ -2034,9 +2033,9 @@ class Auth {
2034
2033
  }
2035
2034
  const code = params.get('code') || '';
2036
2035
  this.log.info('authorization code received', code);
2037
- yield this.exchangeCode(code);
2036
+ const rsp = yield this.exchangeCode(code);
2038
2037
  this.startFinalState(finalLocation);
2039
- return null;
2038
+ return rsp;
2040
2039
  }
2041
2040
  }
2042
2041
  return this.check();
@@ -2162,7 +2161,7 @@ class Auth {
2162
2161
  this.log.debug('starting new authentication flow');
2163
2162
  this.incFlowCounter();
2164
2163
  const state = Math.random().toString(36).substring(2);
2165
- this.sessionStorage.setItem(`auth.state.${state}.location`, this.location.toString());
2164
+ this.sessionStorage.setItem(`auth.state.${state}.location`, this.getRedirect(this.location.toString()));
2166
2165
  this.location.assign(Make({
2167
2166
  url: `${this.cortezaAuthURL}` + oauth2FlowURL,
2168
2167
  query: {
@@ -2173,6 +2172,20 @@ class Auth {
2173
2172
  },
2174
2173
  }));
2175
2174
  }
2175
+ getRedirect(url) {
2176
+ const u = new URL(url);
2177
+ // In case someone started the flow on a callback route, default to the root
2178
+ // of the webapp.
2179
+ if (this.isCallback(u.pathname)) {
2180
+ u.pathname = '';
2181
+ u.search = '';
2182
+ u.hash = '';
2183
+ }
2184
+ return u.toString();
2185
+ }
2186
+ isCallback(url) {
2187
+ return /\/auth\/callback$/.test(url);
2188
+ }
2176
2189
  /**
2177
2190
  * protects against too many tries when we try to auto-fix the "state does not match" error
2178
2191
  * by restarting the aut flow.
@@ -2569,6 +2582,10 @@ class Settings {
2569
2582
  throw new Error('api.notDefined');
2570
2583
  }
2571
2584
 
2585
+ return this.fetch();
2586
+ }
2587
+
2588
+ async fetch() {
2572
2589
  return this.api.settingsCurrent().then(settings => {
2573
2590
  this.current = settings || {};
2574
2591
  return settings;
@@ -2614,7 +2631,7 @@ class Settings {
2614
2631
  var settings = {
2615
2632
  install(Vue) {
2616
2633
  // Should be used to initialize settings
2617
- Vue.prototype.$Settings = new Settings(); // Should be used to access settings
2634
+ Vue.prototype.$Settings = Vue.observable(new Settings()); // Should be used to access settings
2618
2635
 
2619
2636
  Vue.prototype.$s = Vue.prototype.$Settings.get.bind(Vue.prototype.$Settings);
2620
2637
  }
@@ -71666,7 +71683,8 @@ var script$g = {
71666
71683
  return {
71667
71684
  visible: false,
71668
71685
  attrs: {
71669
- href: null
71686
+ href: null,
71687
+ target: '_self'
71670
71688
  }
71671
71689
  };
71672
71690
  },
@@ -71721,7 +71739,7 @@ var script$g = {
71721
71739
  const __vue_script__$g = script$g;
71722
71740
 
71723
71741
  /* template */
71724
- 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)};
71742
+ 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)};
71725
71743
  var __vue_staticRenderFns__$e = [];
71726
71744
 
71727
71745
  /* style */
@@ -78307,8 +78325,9 @@ class Link extends tiptapExtensions.Link {
78307
78325
  get schema() {
78308
78326
  const base = super.schema;
78309
78327
  return { ...base,
78310
- toDOM: node => ['a', { ...node.attrs,
78328
+ toDOM: node => ['a', {
78311
78329
  target: '_blank',
78330
+ ...node.attrs,
78312
78331
  rel: 'noopener noreferrer nofollow'
78313
78332
  }, 0]
78314
78333
  };
@@ -81115,6 +81134,31 @@ var __vue_staticRenderFns__$x = [];
81115
81134
  //
81116
81135
  //
81117
81136
  //
81137
+ //
81138
+ //
81139
+ //
81140
+ //
81141
+ //
81142
+ //
81143
+ //
81144
+ //
81145
+ //
81146
+ //
81147
+ //
81148
+ //
81149
+ //
81150
+ //
81151
+ //
81152
+ //
81153
+ //
81154
+ //
81155
+ //
81156
+ //
81157
+ //
81158
+ //
81159
+ //
81160
+ //
81161
+ //
81118
81162
  var script$C = {
81119
81163
  props: {
81120
81164
  sidebarPinned: {
@@ -81131,6 +81175,10 @@ var script$C = {
81131
81175
  type: String,
81132
81176
  default: '../'
81133
81177
  },
81178
+ settings: {
81179
+ type: Object,
81180
+ required: true
81181
+ },
81134
81182
  labels: {
81135
81183
  type: Object,
81136
81184
  required: true
@@ -81150,6 +81198,35 @@ var script$C = {
81150
81198
  return `https://docs.cortezaproject.org/corteza-docs/${year}.${month}/index.html`;
81151
81199
  },
81152
81200
 
81201
+ helpLinks() {
81202
+ const {
81203
+ helpLinks = []
81204
+ } = this.settings || {};
81205
+ return (helpLinks || []).filter(({
81206
+ handle,
81207
+ url
81208
+ }) => handle && url);
81209
+ },
81210
+
81211
+ profileLinks() {
81212
+ const {
81213
+ profileLinks = []
81214
+ } = this.settings || {};
81215
+ return (profileLinks || []).filter(({
81216
+ handle,
81217
+ url
81218
+ }) => handle && url);
81219
+ },
81220
+
81221
+ onlyVersion() {
81222
+ const {
81223
+ hideForumLink,
81224
+ hideDocumentationLink,
81225
+ hideFeedbackLink
81226
+ } = this.settings || {};
81227
+ return !this.helpLinks.length && hideForumLink && hideDocumentationLink && hideFeedbackLink;
81228
+ },
81229
+
81153
81230
  frontendVersion() {
81154
81231
  /* eslint-disable no-undef */
81155
81232
  return VERSION;
@@ -81164,17 +81241,17 @@ const __vue_script__$C = script$C;
81164
81241
  /* template */
81165
81242
  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:{
81166
81243
  'expanded': _vm.sidebarPinned,
81167
- }})],_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)])};
81244
+ }})],_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)])};
81168
81245
  var __vue_staticRenderFns__$y = [];
81169
81246
 
81170
81247
  /* style */
81171
81248
  const __vue_inject_styles__$D = function (inject) {
81172
81249
  if (!inject) return
81173
- 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 });
81250
+ 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 });
81174
81251
 
81175
81252
  };
81176
81253
  /* scoped */
81177
- const __vue_scope_id__$D = "data-v-d822059c";
81254
+ const __vue_scope_id__$D = "data-v-39d2e772";
81178
81255
  /* module identifier */
81179
81256
  const __vue_module_identifier__$D = undefined;
81180
81257
  /* functional template */
@@ -82612,28 +82689,18 @@ var script$P = {
82612
82689
  * Update parent component (if needed)
82613
82690
  * @param v
82614
82691
  */
82615
- selected(items) {
82616
- const value = items.map(i => i[this.valueField]);
82617
- /**
82618
- * Make sure we do not fall into an infinite loop
82619
- *
82620
- * If we emit update/input event, parent will update value/v-modal
82621
- * and watcher function for value will trigger the sync and recreate
82622
- * the selected array and trigger this watcher!
82623
- */
82692
+ selected: {
82693
+ immediate: false,
82624
82694
 
82625
- if (value.length === this.value.length) {
82626
- if (value.filter(v => !this.value.includes(v)).length === 0) {
82627
- return;
82628
- }
82629
- } // satisfy value.sync
82695
+ handler(items) {
82696
+ const value = items.map(i => i[this.valueField]); // satisfy value.sync
82630
82697
 
82698
+ this.$emit('update:value', value); // satisfy v-model
82631
82699
 
82632
- this.$emit('update:value', value); // satisfy v-model
82700
+ this.$emit('input', value);
82701
+ }
82633
82702
 
82634
- this.$emit('input', value);
82635
82703
  },
82636
-
82637
82704
  options: {
82638
82705
  deep: true,
82639
82706
  immediate: true,
@@ -82643,11 +82710,26 @@ var script$P = {
82643
82710
  }
82644
82711
 
82645
82712
  },
82713
+ value: {
82714
+ immediate: false,
82646
82715
 
82647
- value(vv) {
82648
- this.sync();
82649
- }
82716
+ handler(value = [], oldValue = []) {
82717
+ /**
82718
+ * Make sure we do not fall into an infinite loop
82719
+ *
82720
+ * If we update the value thenn sync will trigger recomputation of selected
82721
+ * Which then emits the update event and the loop will begin
82722
+ */
82723
+ if (value.length === oldValue.length) {
82724
+ if (value.filter(v => !oldValue.includes(v)).length === 0) {
82725
+ return;
82726
+ }
82727
+ }
82650
82728
 
82729
+ this.sync();
82730
+ }
82731
+
82732
+ }
82651
82733
  },
82652
82734
 
82653
82735
  created() {
@@ -82722,10 +82804,12 @@ var script$P = {
82722
82804
  this.available = this.frozen().filter(opt => !this.isPicked(opt));
82723
82805
  /**
82724
82806
  * filter all unpicked options, freeze each item in the array and
82725
- * build list of selected items
82807
+ * build list of selected items, traverse value to keep order
82726
82808
  */
82727
82809
 
82728
- this.selected = this.frozen().filter(opt => this.isPicked(opt));
82810
+ this.selected = this.value.map(v => {
82811
+ return this.frozen().find(item => item[this.valueField] === v);
82812
+ }).filter(f => f);
82729
82813
  },
82730
82814
 
82731
82815
  frozen() {
@@ -83427,18 +83511,18 @@ var __vue_render__$N = function () {var _vm=this;var _h=_vm.$createElement;var _
83427
83511
  }),attrs:{"icon":['fas', 'angle-up']}}),_vm._v(" "),_c('font-awesome-icon',{staticClass:"mt-1",style:({
83428
83512
  color: _vm.sort.field === c.meta.sortKey && _vm.sort.descending ? 'black' : 'grey',
83429
83513
  }),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:{
83430
- separator: !!r[0].separator,
83514
+ separator: !!(r[0] || {}).separator,
83431
83515
  }},_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)};
83432
83516
  var __vue_staticRenderFns__$N = [];
83433
83517
 
83434
83518
  /* style */
83435
83519
  const __vue_inject_styles__$U = function (inject) {
83436
83520
  if (!inject) return
83437
- 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 });
83521
+ 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 });
83438
83522
 
83439
83523
  };
83440
83524
  /* scoped */
83441
- const __vue_scope_id__$U = "data-v-52bf61e6";
83525
+ const __vue_scope_id__$U = "data-v-b515bfce";
83442
83526
  /* module identifier */
83443
83527
  const __vue_module_identifier__$U = undefined;
83444
83528
  /* functional template */