@cortezaproject/corteza-vue 2022.3.3-rc.1 → 2022.3.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.
package/dist/index.es.js CHANGED
@@ -79276,17 +79276,17 @@ var script$m = {
79276
79276
  const __vue_script__$m = script$m;
79277
79277
 
79278
79278
  /* template */
79279
- var __vue_render__$j = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.link)?_c('a',{staticClass:"pointer",on:{"click":_vm.onClick}},[_c('font-awesome-icon',{attrs:{"icon":['fas', 'lock']}})],1):_c('b-button',{attrs:{"variant":_vm.buttonVariant},on:{"click":_vm.onClick}},[_vm._t("default",function(){return [(_vm.showButtonIcon)?_c('font-awesome-icon',{attrs:{"icon":['fas', 'lock']}}):_vm._e(),_vm._v(" "),(_vm.buttonLabel)?_c('span',[_vm._v("\n "+_vm._s(_vm.buttonLabel)+"\n ")]):_vm._e()]})],2)};
79279
+ var __vue_render__$j = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.link)?_c('a',{staticClass:"pointer",attrs:{"data-test-id":"link-permissions"},on:{"click":_vm.onClick}},[_c('font-awesome-icon',{attrs:{"icon":['fas', 'lock']}})],1):_c('b-button',{attrs:{"data-test-id":"button-permissions","variant":_vm.buttonVariant},on:{"click":_vm.onClick}},[_vm._t("default",function(){return [(_vm.showButtonIcon)?_c('font-awesome-icon',{attrs:{"icon":['fas', 'lock']}}):_vm._e(),_vm._v(" "),(_vm.buttonLabel)?_c('span',[_vm._v("\n "+_vm._s(_vm.buttonLabel)+"\n ")]):_vm._e()]})],2)};
79280
79280
  var __vue_staticRenderFns__$j = [];
79281
79281
 
79282
79282
  /* style */
79283
79283
  const __vue_inject_styles__$n = function (inject) {
79284
79284
  if (!inject) return
79285
- inject("data-v-4c4b66ba_0", { source: ".pointer[data-v-4c4b66ba]{cursor:pointer}", map: undefined, media: undefined });
79285
+ inject("data-v-f7d1d1dc_0", { source: ".pointer[data-v-f7d1d1dc]{cursor:pointer}", map: undefined, media: undefined });
79286
79286
 
79287
79287
  };
79288
79288
  /* scoped */
79289
- const __vue_scope_id__$n = "data-v-4c4b66ba";
79289
+ const __vue_scope_id__$n = "data-v-f7d1d1dc";
79290
79290
  /* module identifier */
79291
79291
  const __vue_module_identifier__$n = undefined;
79292
79292
  /* functional template */
@@ -80931,6 +80931,11 @@ const definitions = {
80931
80931
  //
80932
80932
  var script$A = {
80933
80933
  name: 'c-prompt-toast',
80934
+ props: {
80935
+ hideToasts: {
80936
+ type: Boolean
80937
+ }
80938
+ },
80934
80939
 
80935
80940
  data() {
80936
80941
  return {
@@ -80999,7 +81004,7 @@ var script$A = {
80999
81004
  * passive (no feedback or input from user required) first and the rest later
81000
81005
  */
81001
81006
  toasts() {
81002
- return [...this.passive.values(), ...this.active];
81007
+ return this.hideToasts ? [] : [...this.passive.values(), ...this.active];
81003
81008
  },
81004
81009
 
81005
81010
  defaultTimeout() {
@@ -81031,11 +81036,11 @@ var script$A = {
81031
81036
  * We do this because we do not want it to be removed right away
81032
81037
  * but through a toast component's timeout
81033
81038
  */
81034
- prompts: {
81039
+ withComponents: {
81035
81040
  immediate: true,
81036
81041
 
81037
- handler() {
81038
- this.withComponents.forEach(p => {
81042
+ handler(wc) {
81043
+ wc.forEach(p => {
81039
81044
  if (p.passive) {
81040
81045
  this.passive.add(p);
81041
81046
  }
@@ -81108,11 +81113,11 @@ var __vue_staticRenderFns__$w = [];
81108
81113
  /* style */
81109
81114
  const __vue_inject_styles__$B = function (inject) {
81110
81115
  if (!inject) return
81111
- inject("data-v-1c635754_0", { source: ".slide-enter-active[data-v-1c635754]{transition:all .3s ease}.slide-leave-active[data-v-1c635754]{transition:all .8s cubic-bezier(1,.5,.8,1)}.slide-enter[data-v-1c635754],.slide-leave-to[data-v-1c635754]{transform:translateX(10px);opacity:0}", map: undefined, media: undefined });
81116
+ inject("data-v-7c0c67b4_0", { source: ".slide-enter-active[data-v-7c0c67b4]{transition:all .3s ease}.slide-leave-active[data-v-7c0c67b4]{transition:all .8s cubic-bezier(1,.5,.8,1)}.slide-enter[data-v-7c0c67b4],.slide-leave-to[data-v-7c0c67b4]{transform:translateX(10px);opacity:0}", map: undefined, media: undefined });
81112
81117
 
81113
81118
  };
81114
81119
  /* scoped */
81115
- const __vue_scope_id__$B = "data-v-1c635754";
81120
+ const __vue_scope_id__$B = "data-v-7c0c67b4";
81116
81121
  /* module identifier */
81117
81122
  const __vue_module_identifier__$B = undefined;
81118
81123
  /* functional template */
@@ -81256,6 +81261,11 @@ var script$C = {
81256
81261
  components: {
81257
81262
  CPromptToast: __vue_component__$B,
81258
81263
  CPromptModal: __vue_component__$C
81264
+ },
81265
+ props: {
81266
+ hideToasts: {
81267
+ type: Boolean
81268
+ }
81259
81269
  }
81260
81270
  };
81261
81271
 
@@ -81263,7 +81273,7 @@ var script$C = {
81263
81273
  const __vue_script__$C = script$C;
81264
81274
 
81265
81275
  /* template */
81266
- var __vue_render__$y = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('c-prompt-toast'),_vm._v(" "),_c('c-prompt-modal')],1)};
81276
+ var __vue_render__$y = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('c-prompt-toast',{attrs:{"hide-toasts":_vm.hideToasts}}),_vm._v(" "),_c('c-prompt-modal')],1)};
81267
81277
  var __vue_staticRenderFns__$y = [];
81268
81278
 
81269
81279
  /* style */
@@ -81305,14 +81315,16 @@ const variants = [
81305
81315
  { value: 'light', text: 'Light' },
81306
81316
  { value: 'dark', text: 'Dark' },
81307
81317
  ];
81308
- const prompts = Object.freeze([{
81318
+ const prompts = Object.freeze([
81319
+ {
81309
81320
  ref: 'redirect',
81310
81321
  meta: { short: 'Redirect user to an outside URL' },
81311
81322
  parameters: [
81312
81323
  { name: 'url', types: ['String'], required: true },
81313
81324
  { name: 'delay', types: ['Integer'], meta: { description: 'Redirection delay in seconds' } },
81314
81325
  ],
81315
- }, {
81326
+ },
81327
+ {
81316
81328
  ref: 'reroute',
81317
81329
  meta: { short: 'Redirect user to an internal application route' },
81318
81330
  parameters: [
@@ -81321,9 +81333,13 @@ const prompts = Object.freeze([{
81321
81333
  { name: 'query', types: ['KV'] },
81322
81334
  { name: 'delay', types: ['Integer'], meta: { description: 'Redirection delay in seconds' } },
81323
81335
  ],
81324
- }, {
81336
+ },
81337
+ {
81325
81338
  ref: 'recordPage',
81326
- meta: { short: 'Redirect user to the record page' },
81339
+ meta: {
81340
+ short: 'Redirect user to the record page',
81341
+ webapps: ['compose'],
81342
+ },
81327
81343
  parameters: [
81328
81344
  { name: 'module', types: ['ID', 'Handle', 'ComposeModule'] },
81329
81345
  { name: 'namespace', types: ['ID', 'Handle', 'ComposeNamespace'] },
@@ -81331,7 +81347,8 @@ const prompts = Object.freeze([{
81331
81347
  { name: 'edit', types: ['Boolean'] },
81332
81348
  { name: 'delay', types: ['Integer'], meta: { description: 'Redirection delay in seconds' } },
81333
81349
  ],
81334
- }, {
81350
+ },
81351
+ {
81335
81352
  ref: 'notification',
81336
81353
  meta: { short: 'Show non-blocking message to user' },
81337
81354
  parameters: [
@@ -81340,7 +81357,8 @@ const prompts = Object.freeze([{
81340
81357
  { name: 'variant', types: ['String'], meta: { visual: { input: { type: 'select', properties: { options: variants } } } } },
81341
81358
  { name: 'timeout', types: ['Integer'], meta: { description: 'How long do we show the notification in seconds' } },
81342
81359
  ],
81343
- }, {
81360
+ },
81361
+ {
81344
81362
  ref: 'alert',
81345
81363
  meta: { short: 'Prompt user with an alert' },
81346
81364
  parameters: [
@@ -81350,7 +81368,8 @@ const prompts = Object.freeze([{
81350
81368
  { name: 'buttonVariant', types: ['String'], meta: { visual: { input: { type: 'select', properties: { options: variants } } } } },
81351
81369
  { name: 'buttonValue', types: ['Any'] },
81352
81370
  ],
81353
- }, {
81371
+ },
81372
+ {
81354
81373
  ref: 'choice',
81355
81374
  meta: { short: 'Prompt user with choice' },
81356
81375
  parameters: [
@@ -81366,7 +81385,8 @@ const prompts = Object.freeze([{
81366
81385
  results: [
81367
81386
  { name: 'value', types: ['Any'] },
81368
81387
  ],
81369
- }, {
81388
+ },
81389
+ {
81370
81390
  ref: 'composeRecordPicker',
81371
81391
  meta: { short: 'Prompt user to select a Compose Record' },
81372
81392
  parameters: [
@@ -81381,7 +81401,8 @@ const prompts = Object.freeze([{
81381
81401
  results: [
81382
81402
  { name: 'value', types: ['ComposeRecord'] },
81383
81403
  ],
81384
- }, {
81404
+ },
81405
+ {
81385
81406
  ref: 'input',
81386
81407
  meta: { short: 'Prompt user with a single input' },
81387
81408
  parameters: [
@@ -81411,7 +81432,8 @@ const prompts = Object.freeze([{
81411
81432
  results: [
81412
81433
  { name: 'value', types: ['Any'] },
81413
81434
  ],
81414
- }, {
81435
+ },
81436
+ {
81415
81437
  ref: 'options',
81416
81438
  meta: { short: 'Prompt user with options' },
81417
81439
  parameters: [
@@ -81438,7 +81460,8 @@ const prompts = Object.freeze([{
81438
81460
  results: [
81439
81461
  { name: 'value', types: ['Any'] },
81440
81462
  ],
81441
- }].map(f => new automation.Function(Object.assign(Object.assign({}, f), { kind: 'prompt' }))));
81463
+ },
81464
+ ].map(f => new automation.Function(Object.assign(Object.assign({}, f), { kind: 'prompt' }))));
81442
81465
 
81443
81466
  //
81444
81467
  //
@@ -83783,15 +83806,12 @@ var script$V = {
83783
83806
  // tabelifyFrame returns a set of rows and columns that should be shown
83784
83807
  // for this frame.
83785
83808
  //
83786
- // maxSize is used to calculate the rowSpan that should be applied to joined
83787
- // frames with fewer rows then the other.
83788
- //
83789
83809
  // Flow outline:
83790
83810
  // * for each row of the frame:
83791
83811
  // ** find all foreign frames
83792
83812
  // ** tabelify foreign frames
83793
83813
  // ** merge with the current tabelified result
83794
- tabelifyFrame(frame, maxSize = 1) {
83814
+ tabelifyFrame(frame) {
83795
83815
  const outRows = [];
83796
83816
  const isLocal = frame.ref === this.localDataframe.ref; // Index selected columns
83797
83817
 
@@ -83822,7 +83842,7 @@ var script$V = {
83822
83842
  const usedKeys = this.keyColumns(frame);
83823
83843
 
83824
83844
  for (const r of frame.rows || []) {
83825
- maxSize = 1;
83845
+ let maxSize = 1;
83826
83846
  const row = this.tabelifyRow(r, [...selectedCols]);
83827
83847
  const auxRows = [];
83828
83848
 
@@ -83838,7 +83858,7 @@ var script$V = {
83838
83858
  // const refColumnIndexes = (this.options.columns[rf.ref] || []).map(({ name }) => {
83839
83859
  // return frame.columns.findIndex(fc => fc.name === name)
83840
83860
  // })
83841
- const aux = this.tabelifyFrame(rf, Math.max(rf.rows.length, maxSize)); // Optionally append header
83861
+ const aux = this.tabelifyFrame(rf, Math.max(rf.rows.length)); // Optionally append header
83842
83862
 
83843
83863
  if (!hSeanFrames[rf.ref]) {
83844
83864
  const x = [...aux.header];
@@ -84053,11 +84073,11 @@ var __vue_staticRenderFns__$P = [];
84053
84073
  /* style */
84054
84074
  const __vue_inject_styles__$W = function (inject) {
84055
84075
  if (!inject) return
84056
- 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 });
84076
+ inject("data-v-54580af2_0", { source: ".foreign[data-v-54580af2]{border:1px solid rgba(22,36,37,.8);border-top:0;border-bottom:0}.separator[data-v-54580af2]{border-top:2px solid rgba(22,36,37,.5)}.card-rounded[data-v-54580af2]{border-radius:1rem 1rem 0 0}", map: undefined, media: undefined });
84057
84077
 
84058
84078
  };
84059
84079
  /* scoped */
84060
- const __vue_scope_id__$W = "data-v-b515bfce";
84080
+ const __vue_scope_id__$W = "data-v-54580af2";
84061
84081
  /* module identifier */
84062
84082
  const __vue_module_identifier__$W = undefined;
84063
84083
  /* functional template */
@@ -84904,7 +84924,7 @@ function onlyFresh(existing, fresh) {
84904
84924
  const index = existing.map(({ stateID }) => stateID);
84905
84925
  return fresh.filter(({ stateID = undefined }) => stateID && !index.includes(stateID));
84906
84926
  }
84907
- function index$6 ({ api }) {
84927
+ function index$6 ({ api, webapp }) {
84908
84928
  return {
84909
84929
  strict: true,
84910
84930
  state: {
@@ -84969,6 +84989,7 @@ function index$6 ({ api }) {
84969
84989
  commit('loading');
84970
84990
  return resumeState(api, prompt, input)
84971
84991
  .then(() => commit('remove', prompt))
84992
+ .catch(() => commit('remove', prompt))
84972
84993
  .finally(() => commit('loading', false));
84973
84994
  });
84974
84995
  },
@@ -85002,7 +85023,12 @@ function index$6 ({ api }) {
85002
85023
  state.prompts = [];
85003
85024
  },
85004
85025
  update(state, pp) {
85005
- state.prompts.push(...pp);
85026
+ // // Check if prompt should be run only in certain webapps
85027
+ state.prompts.push(...pp.filter(({ ref }) => {
85028
+ return prompts.some(p => {
85029
+ return p.ref === ref && (!p.meta.webapps || p.meta.webapps.includes(webapp));
85030
+ });
85031
+ }));
85006
85032
  },
85007
85033
  remove(state, prompt) {
85008
85034
  state.prompts = state.prompts.filter(({ stateID }) => stateID !== prompt.stateID);