@mixd-id/web-scaffold 0.1.230406349 → 0.1.230406351

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406349",
4
+ "version": "0.1.230406351",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -533,6 +533,10 @@
533
533
 
534
534
  </div>
535
535
 
536
+ <div class="p-5">
537
+ <Button ref="saveConfigBtn" class="w-[90px] py-2" :state="configChanged ? 1 : -1" @click="save">Save</Button>
538
+ </div>
539
+
536
540
  </TransitionGroup>
537
541
 
538
542
  <div :class="$style.resize1"
@@ -702,6 +706,10 @@ export default{
702
706
  return config
703
707
  },
704
708
 
709
+ configChanged(){
710
+ return JSON.stringify(this.cConfig) !== this.initialConfig
711
+ },
712
+
705
713
  componentsConfig(){
706
714
  if(!this.cConfig.components)
707
715
  this.cConfig.components = {}
@@ -870,6 +878,8 @@ export default{
870
878
 
871
879
  data: {},
872
880
 
881
+ initialConfig: null,
882
+
873
883
  datasourceTabs: [
874
884
  /*{ text:"Columns", value:1 },*/
875
885
  { text:"Filters", value:2 },
@@ -896,7 +906,7 @@ export default{
896
906
  }
897
907
  },
898
908
 
899
- emits: [ 'change' ],
909
+ emits: [ 'change', 'save' ],
900
910
 
901
911
  inject: [ 'alert', 'appStyle', 'confirm', 'socket' ],
902
912
 
@@ -1276,6 +1286,14 @@ export default{
1276
1286
  .then(res => {
1277
1287
  generatePivotColumns(this.selectedDatasource, res.items)
1278
1288
  })
1289
+ },
1290
+
1291
+ save(){
1292
+ this.$refs.saveConfigBtn.setState(2)
1293
+ this.socket.send(this.configSrc,
1294
+ { key:this.configKey, config:this.cConfig })
1295
+ .then(_ => this.initialConfig = JSON.stringify(this.cConfig))
1296
+ .finally(_ => this.$refs.saveConfigBtn.resetState())
1279
1297
  }
1280
1298
 
1281
1299
  },
@@ -1285,6 +1303,8 @@ export default{
1285
1303
  config: Object,
1286
1304
 
1287
1305
  src: String,
1306
+ configSrc: String,
1307
+ configKey: String,
1288
1308
 
1289
1309
  datasourceSrc: String,
1290
1310
  datasourceListSrc: String,
@@ -1332,8 +1352,10 @@ export default{
1332
1352
  },
1333
1353
 
1334
1354
  cConfig(to, from){
1335
- if(!from)
1355
+ if(!from){
1336
1356
  this.load()
1357
+ this.initialConfig = JSON.stringify(this.cConfig)
1358
+ }
1337
1359
  }
1338
1360
 
1339
1361
  }