mumuki-styles 1.15.2 → 1.15.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 674216b443c03a9321dd23982bf9fe07335b7db2
4
- data.tar.gz: b64ace560a30a6e537baf566c4d40e4e9c0f8bab
3
+ metadata.gz: 742f298ec679b7184501f9473d34414af445f08a
4
+ data.tar.gz: 84f2509a80b478698fd04cd81d6307401cb37171
5
5
  SHA512:
6
- metadata.gz: 23af8d17c476160a9a0dbb7462c9eacd19c7dea540393861227223edbd56f199f35be0f132594ffa72c4a5186f3c75ed150df965fe23381cfc8c09b7582f76fa
7
- data.tar.gz: ed541f61ed8c2b625d40b6fa86165281b53552c1a96619cec49c220e17971f4a2e266239ff84e373544188acd24a1d0cc1d51eeb6d19025046fe93e5a36b40d2
6
+ metadata.gz: 2317ad57048e4e1a6bdb20d5449c7fb16ba81e97ed53b087e2e524c5da55f629151f46f176fa188086e5329fd9e7d2cc6fc02b928b7f522b1f98f27219809b08
7
+ data.tar.gz: 979966b522596a2f114584f217c1654b0268afd9185b2ef4f61e140d4e1ed3d003ac742cd4c425941a9fc9ceb4d45ad74553d354d73872b617d8221b53867428
@@ -12868,24 +12868,24 @@ mumuki.load(function () {
12868
12868
  }
12869
12869
  }
12870
12870
 
12871
- function entityID(entity) {
12872
- return 'mu-erd-' + entity.toLowerCase().replace(/[_]/g, '-');
12871
+ function entityID(entity, index) {
12872
+ return 'mu-erd-' + index + '-' + entity.toLowerCase().replace(/[_]/g, '-');
12873
12873
  }
12874
12874
 
12875
- function columnID(entity, column) {
12876
- return entityID(entity) + '-' + column.toLowerCase().replace(/[_]/g, '-');
12875
+ function columnID(entity, column, index) {
12876
+ return entityID(entity, index) + '-' + column.toLowerCase().replace(/[_]/g, '-');
12877
12877
  }
12878
12878
 
12879
12879
  function keyIconFor(column, field) {
12880
12880
  return !!column[field] ? '<i class="fa fa-fw fa-key mu-erd-' + field + '"></i>' : '';
12881
12881
  }
12882
12882
 
12883
- function generateEntityColumns(entity) {
12883
+ function generateEntityColumns(entity, index) {
12884
12884
  var columns = entity.columns || [];
12885
12885
  var html = '';
12886
12886
  columns.forEach(function (column) {
12887
12887
  html += [
12888
- '<li id="', columnID(entity.name, column.name), '" class="mu-erd-entity-column">',
12888
+ '<li id="', columnID(entity.name, column.name, index), '" class="mu-erd-entity-column">',
12889
12889
  ' <span class="mu-erd-entity-column-name">',
12890
12890
  keyIconFor(column, 'pk'),
12891
12891
  keyIconFor(column, 'fk'),
@@ -12898,15 +12898,15 @@ mumuki.load(function () {
12898
12898
  return html;
12899
12899
  }
12900
12900
 
12901
- function appendEntities($diagram, entities) {
12901
+ function appendEntities($diagram, entities, index) {
12902
12902
  entities.forEach(function (entity) {
12903
12903
  var $entity = $([
12904
- '<div id="', entityID(entity.name), '" class="mu-erd-entity">',
12904
+ '<div id="', entityID(entity.name, index), '" class="mu-erd-entity">',
12905
12905
  ' <div class="mu-erd-entity-name">',
12906
12906
  entity.name,
12907
12907
  ' </div>',
12908
12908
  ' <ul class="mu-erd-entity-columns">',
12909
- generateEntityColumns(entity),
12909
+ generateEntityColumns(entity, index),
12910
12910
  ' </ul>',
12911
12911
  '</div>',
12912
12912
  ].join(''));
@@ -12914,8 +12914,8 @@ mumuki.load(function () {
12914
12914
  });
12915
12915
  }
12916
12916
 
12917
- function drawColumnFK(entity, column) {
12918
- return drawFK(entity, column, column.fk);
12917
+ function drawColumnFK(entity, index, column) {
12918
+ return drawFK(entity, column, column.fk, index);
12919
12919
  }
12920
12920
 
12921
12921
  function getDirection($entityFrom, $entityTo) {
@@ -12929,15 +12929,15 @@ mumuki.load(function () {
12929
12929
  return direction.replace(' ', '_');
12930
12930
  }
12931
12931
 
12932
- function drawFK(entity, column, fk) {
12932
+ function drawFK(entity, column, fk, index) {
12933
12933
  if (!fk) return '';
12934
12934
  var $entity = {
12935
- from: $('#' + entityID(entity.name)),
12936
- to: $('#' + entityID(fk.to.entity))
12935
+ from: $('#' + entityID(entity.name, index)),
12936
+ to: $('#' + entityID(fk.to.entity, index))
12937
12937
  }
12938
12938
  var $column = {
12939
- from: $('#' + columnID(entity.name, column.name)),
12940
- to: $('#' + columnID(fk.to.entity, fk.to.column))
12939
+ from: $('#' + columnID(entity.name, column.name, index)),
12940
+ to: $('#' + columnID(fk.to.entity, fk.to.column, index))
12941
12941
  }
12942
12942
  var direction = getDirection($entity.from, $entity.to);
12943
12943
  var points = getPointsFrom(direction, $entity, $column);
@@ -12952,18 +12952,18 @@ mumuki.load(function () {
12952
12952
  return availableDirections[direction]($entity, $column);
12953
12953
  }
12954
12954
 
12955
- function drawConnectorLines(entity) {
12955
+ function drawConnectorLines(entity, index) {
12956
12956
  var columns = entity.columns || [];
12957
- return columns.map(drawColumnFK.bind(this, entity)).join('');
12957
+ return columns.map(drawColumnFK.bind(this, entity, index)).join('');
12958
12958
  }
12959
12959
 
12960
- function getSVGFor(entity) {
12961
- return ['<svg>', drawConnectorLines(entity), '</svg>'].join('');
12960
+ function getSVGFor(entity, index) {
12961
+ return ['<svg>', drawConnectorLines(entity, index), '</svg>'].join('');
12962
12962
  }
12963
12963
 
12964
- function appendConnectors($diagram, entities) {
12964
+ function appendConnectors($diagram, entities, index) {
12965
12965
  entities.forEach(function (entity) {
12966
- var $svg = $(getSVGFor(entity));
12966
+ var $svg = $(getSVGFor(entity, index));
12967
12967
  $diagram.append($svg);
12968
12968
  });
12969
12969
  }
@@ -12999,8 +12999,8 @@ mumuki.load(function () {
12999
12999
  self.each(function (i) {
13000
13000
  var $diagram = $(self[i]);
13001
13001
  var entities = mapEntities($diagram.data('entities'));
13002
- appendEntities($diagram, entities);
13003
- appendConnectors($diagram, entities);
13002
+ appendEntities($diagram, entities, i);
13003
+ appendConnectors($diagram, entities, i);
13004
13004
  });
13005
13005
  return self;
13006
13006
  }
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Styles
3
- VERSION = "1.15.2"
3
+ VERSION = "1.15.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-styles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.2
4
+ version: 1.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Scarpa