@disy/cadenza.js 1.7.0 → 1.8.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.
package/sandbox.html CHANGED
@@ -28,7 +28,21 @@
28
28
  form, fieldset {
29
29
  display: flex;
30
30
  flex-direction: column;
31
- gap: 16px;
31
+ gap: 12px;
32
+ }
33
+ fieldset > div {
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: 4px;
37
+ }
38
+ fieldset small {
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 4px;
42
+
43
+ & > * {
44
+ margin-block: 0;
45
+ }
32
46
  }
33
47
  main {
34
48
  flex: 1;
@@ -57,11 +71,13 @@
57
71
  const action = actionSelect.value;
58
72
  const settingsTemplate = document.querySelector(`[data-action=${action}]`);
59
73
  settingsContainer.append(settingsTemplate.content.cloneNode(true));
60
- const commonSettingsTemplate = document.getElementById(`common-${settingsTemplate.dataset.common}`);
61
- if (commonSettingsTemplate) {
62
- settingsContainer.append(
63
- document.createElement('hr'),
64
- commonSettingsTemplate.content.cloneNode(true));
74
+ if (settingsTemplate.dataset.common) {
75
+ settingsTemplate.dataset.common.split(',').forEach(commonId => {
76
+ const commonSettingsTemplate = document.getElementById(`common-${commonId}`);
77
+ settingsContainer.append(
78
+ document.createElement('hr'),
79
+ commonSettingsTemplate.content.cloneNode(true));
80
+ })
65
81
  }
66
82
 
67
83
  const data = localStorage.getItem(`cadenzajs-sandbox-${action}`);
@@ -118,6 +134,7 @@
118
134
  function getOptions ({
119
135
  disabledUiFeatures,
120
136
  expandNavigator,
137
+ filter,
121
138
  geometry,
122
139
  hideMainHeaderAndFooter,
123
140
  hideWorkbookToolBar,
@@ -129,12 +146,12 @@
129
146
  minScale,
130
147
  parts,
131
148
  simplifiedOperationMode,
132
- useMapSrs,
133
- filter
149
+ useMapSrs
134
150
  }) {
135
151
  return {
136
152
  disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
137
153
  expandNavigator: (expandNavigator === 'on'),
154
+ filter: filter && parseFilterVariables(filter),
138
155
  geometry: geometry && JSON.parse(geometry),
139
156
  hideMainHeaderAndFooter: (hideMainHeaderAndFooter === 'on'),
140
157
  hideWorkbookToolBar: (hideWorkbookToolBar === 'on'),
@@ -146,8 +163,7 @@
146
163
  minScale,
147
164
  parts: parts && parts.split(','),
148
165
  ...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }),
149
- useMapSrs: useMapSrs === 'on',
150
- filter: filter && parseFilterVariables(filter)
166
+ useMapSrs: useMapSrs === 'on'
151
167
  };
152
168
  }
153
169
 
@@ -224,11 +240,25 @@
224
240
  </div>
225
241
  <div>
226
242
  <label for="disabledUiFeatures">Disabled UI features</label>
227
- <input name="disabledUiFeatures" id="disabledUiFeatures" placeholder="feature1,feature2...">
243
+ <input name="disabledUiFeatures" id="disabledUiFeatures" placeholder="feature1,feature2,...">
244
+
245
+ <small>
246
+ <p>Comma-separated list of features</p>
247
+
248
+ Supported features:
249
+ <ul>
250
+ <li>workbook-design</li>
251
+ <li>workbook-view-management</li>
252
+ </ul>
253
+ </small>
228
254
  </div>
229
255
  <div>
230
256
  <label for="filter">Filter</label>
231
- <input name="filter" id="filter" placeholder='{ "textvar": "foo", "numbervar": 42.0, "datevar1": "2000-01-01T00.000Z", "datevar2": "{{currentDate}}" }'>
257
+ <textarea name="filter" id="filter" rows="3"></textarea>
258
+ <small>
259
+ <p>A JSON object with filter variable names and values</p>
260
+ <p>Dates need to be ISO strings<br>(e.g. <code>"2023-11-17T17:12:06.175Z"</code>).<br>Use <code>"{{currentDate}}"</code> for the current date.</p>
261
+ </small>
232
262
  </div>
233
263
  </template>
234
264
 
@@ -301,7 +331,7 @@
301
331
  </div>
302
332
  </template>
303
333
 
304
- <template data-action="showMap" data-common="show">
334
+ <template data-action="showMap" data-common="map,show">
305
335
  <div>
306
336
  <label for="embeddingTargetId">Embedding target ID of the map view *</label>
307
337
  <input name="embeddingTargetId" id="embeddingTargetId" required>