@concretecms/bedrock 1.4.14 → 1.5.0

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.
@@ -131,10 +131,12 @@
131
131
 
132
132
  setupTimes: function () {
133
133
  var my = this
134
+ var config = {}
135
+ config.maxOptions = null
134
136
  var $startTime = my.$element.find('select[data-select=start-time]')
135
137
  var $endTime = my.$element.find('select[data-select=end-time]')
136
- var startTimeSelect = new TomSelect($startTime.get(0))
137
- var endTimeSelect = new TomSelect($endTime.get(0))
138
+ var startTimeSelect = new TomSelect($startTime.get(0), config)
139
+ var endTimeSelect = new TomSelect($endTime.get(0), config)
138
140
 
139
141
  $startTime.data('TomSelect', startTimeSelect)
140
142
  $startTime.on('change', function () {
@@ -68,6 +68,10 @@ export default {
68
68
  type: Number,
69
69
  required: false,
70
70
  default: null
71
+ },
72
+ reloadOnReplace: {
73
+ type: Boolean,
74
+ default: false
71
75
  }
72
76
  },
73
77
  computed: {
@@ -274,6 +278,10 @@ export default {
274
278
  this.dropzone.processQueue()
275
279
  },
276
280
  uploadComplete(fileIds) {
281
+ if (this.replaceFileId && fileIds && fileIds.length && this.reloadOnReplace) {
282
+ window.location.reload()
283
+ return
284
+ }
277
285
  this.$emit('upload-complete', fileIds)
278
286
 
279
287
  ConcreteAlert.notify({
@@ -341,11 +341,11 @@
341
341
  if (my.getDragAreas().length) {
342
342
  throw new Error('No block supplied')
343
343
  }
344
- elem = $('<div class="ccm-area-drag-area"/>')
344
+ elem = $('<div class="ccm-area-drag-area ccm-ui"/>')
345
345
  drag_area = new Concrete.DragArea(elem, my, block)
346
346
  my.getBlockContainer().prepend(elem)
347
347
  } else {
348
- elem = $('<div class="ccm-area-drag-area"/>')
348
+ elem = $('<div class="ccm-area-drag-area ccm-ui"/>')
349
349
  drag_area = new Concrete.DragArea(elem, my, block)
350
350
  block.getContainer().after(elem)
351
351
  }
@@ -138,11 +138,11 @@ ConcreteTree.prototype = {
138
138
  },
139
139
  select: function (select, data) {
140
140
  if (options.chooseNodeInForm) {
141
- var keys = $.map(data.tree.getSelectedNodes(), function (node) {
142
- return node.key
143
- })
141
+ const keys = my.getSelectedNodeKeys(data.tree.getRootNode(), ajaxData.treeNodeSelectedIDs)
142
+ if (keys.length) {
144
143
  options.onSelect(keys)
145
144
  }
145
+ }
146
146
  },
147
147
 
148
148
  selectMode: selectMode,
@@ -168,12 +168,9 @@ ConcreteTree.prototype = {
168
168
 
169
169
  var selectedNodes
170
170
  if (options.chooseNodeInForm) {
171
- selectedNodes = $.ui.fancytree.getTree($tree)
172
- selectedNodes = selectedNodes.getSelectedNodes()
173
- if (selectedNodes.length) {
174
- var keys = $.map(selectedNodes, function (node) {
175
- return node.key
176
- })
171
+ const tree = $.ui.fancytree.getTree($tree)
172
+ const keys = my.getSelectedNodeKeys(tree.getRootNode(), ajaxData.treeNodeSelectedIDs)
173
+ if (keys.length) {
177
174
  options.onSelect(keys)
178
175
  }
179
176
  }
@@ -310,6 +307,30 @@ ConcreteTree.prototype = {
310
307
  })
311
308
  },
312
309
 
310
+ getSelectedNodeKeys: function (node, selected) {
311
+ var my = this
312
+
313
+ // Initialize selected and deselected arrays
314
+ selected = selected || []
315
+ // Walk through all child nodes
316
+ if (node.hasChildren()) {
317
+ node.getChildren().forEach(function (child) {
318
+ // If the node is selected and not already in the selected array, add it
319
+ if (child.isSelected() && !selected.includes(parseInt(child.key))) {
320
+ selected.push(parseInt(child.key))
321
+ }
322
+ // If the node is not selected and is in the selected array, remove it
323
+ if (!child.isSelected() && selected.includes(parseInt(child.key))) {
324
+ selected.splice(selected.indexOf(parseInt(child.key)), 1)
325
+ }
326
+ // call the function recursively and merge the result with the selected array
327
+ selected = my.getSelectedNodeKeys(child, selected)
328
+ })
329
+ }
330
+
331
+ return selected
332
+ },
333
+
313
334
  getLoadNodePromise: function (node) {
314
335
  var my = this
315
336
  var ajaxData = my.options.ajaxData != false ? my.options.ajaxData : {}
@@ -689,7 +689,7 @@ div#ccm-menu-highlighter.ccm-block-highlight {
689
689
  */
690
690
  div.ccm-area-drag-area {
691
691
  height: 0;
692
- line-height: 0;
692
+ line-height: 0 !important; // This needs !important so it overrides the line height set on .ccm-ui
693
693
  transition: none;
694
694
 
695
695
  span {
@@ -102,7 +102,7 @@ div.ccm-ui {
102
102
  }
103
103
 
104
104
  tbody + tbody {
105
- border-top: (2 * $table-border-width) solid $table-border-color;
105
+ border-top: calc(var(--bs-border-width) * 2) solid $table-border-color;
106
106
  }
107
107
 
108
108
  .ccm-search-results-em,
@@ -1,7 +1,7 @@
1
1
  // Note - ideally these font families should be handled by Bootstrap but when using with
2
2
  // A bootstrap theme the font family from the theme can sometimes take precedence. So let's
3
3
  // redeclare it here as well.
4
- body div.ccm-ui {
4
+ body .ccm-ui {
5
5
  h1,
6
6
  .h1 {
7
7
  font-family: $headings-font-family;
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
 
23
- body div.ccm-ui { // Added body for extra specificity
23
+ body .ccm-ui { // Added body for extra specificity
24
24
  margin: 0; // 1
25
25
  font-family: var(--#{$prefix}body-font-family);
26
26
  // Concrete CMS
@@ -107,15 +107,15 @@ html.ccm-toolbar-visible {
107
107
  }
108
108
 
109
109
  .ui-widget {
110
- font-family: inherit;
110
+ font-family: var(--bs-body-font-family); // Should inherit this variable from a wrapping .ccm-ui class.
111
111
  }
112
112
 
113
113
  .ui-widget-header {
114
- color: inherit;
114
+ color: var(--bs-body-color); // Should inherit this variable from a wrapping .ccm-ui class.
115
115
  }
116
116
 
117
117
  .ui-widget-content {
118
- color: inherit; // These inherits ensure that this comes from bootstrap not jQuery UI
118
+ color: var(--bs-body-color); // Should inherit this variable from a wrapping .ccm-ui class.
119
119
  }
120
120
 
121
121
  .ui-widget-overlay {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concretecms/bedrock",
3
- "version": "1.4.14",
3
+ "version": "1.5.0",
4
4
  "description": "The asset framework and dependencies for Concrete CMS.",
5
5
  "scripts": {
6
6
  "lint": "standardx \"**/*.{js,vue}\" && stylelint assets/**/*.{scss,vue}",
@@ -12,14 +12,13 @@
12
12
  "storybook": "start-storybook -p55600 -s./.storybook/public"
13
13
  },
14
14
  "dependencies": {
15
- "@concretecms/bedrock": "^1.4.13",
16
15
  "@fortawesome/fontawesome-free": "^5.15.1",
17
16
  "ace-builds": "^1.4.12",
18
17
  "ajax-bootstrap-select": "^1.4.5",
19
18
  "backstretch": "^1.2.2",
20
19
  "blueimp-file-upload": "^10.31.0",
21
20
  "bootbox": "github:makeusabrew/bootbox#master",
22
- "bootstrap": "5.2.3",
21
+ "bootstrap": "5.3.3",
23
22
  "bootstrap-select": "github:snapappointments/bootstrap-select",
24
23
  "bootstrap-tourist": "git+https://git@github.com/concrete5/bootstrap-tourist.git",
25
24
  "check-password-strength": "^2.0.7",