@xuda.io/runtime-bundle 1.0.1384 → 1.0.1385
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/js/xuda-runtime-bundle.js +30 -30
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +30 -30
- package/js/xuda-runtime-slim.min.es.js +30 -30
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +30 -30
- package/js/xuda-worker-bundle.js +30 -30
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -29223,6 +29223,36 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29223
29223
|
_dataSourceFilterModelType,
|
|
29224
29224
|
);
|
|
29225
29225
|
|
|
29226
|
+
if (_dataSourceFilterModelType === 'index' && _ds?.progDataSource?.sortModel) {
|
|
29227
|
+
function sortByKeys(array, sortConfig) {
|
|
29228
|
+
return array.sort((a, b) => {
|
|
29229
|
+
for (let config of sortConfig) {
|
|
29230
|
+
const key = config.field_id;
|
|
29231
|
+
const direction = config.sort_dir === 'desc' ? -1 : 1;
|
|
29232
|
+
|
|
29233
|
+
const valA = a.value[key];
|
|
29234
|
+
const valB = b.value[key];
|
|
29235
|
+
|
|
29236
|
+
// Handle numeric comparison
|
|
29237
|
+
if (typeof valA === 'number' && typeof valB === 'number') {
|
|
29238
|
+
if (valA !== valB) {
|
|
29239
|
+
return (valA - valB) * direction;
|
|
29240
|
+
}
|
|
29241
|
+
}
|
|
29242
|
+
// Handle string comparison
|
|
29243
|
+
else if (typeof valA === 'string' && typeof valB === 'string') {
|
|
29244
|
+
if (valA !== valB) {
|
|
29245
|
+
return valA.localeCompare(valB) * direction;
|
|
29246
|
+
}
|
|
29247
|
+
}
|
|
29248
|
+
}
|
|
29249
|
+
return 0;
|
|
29250
|
+
});
|
|
29251
|
+
}
|
|
29252
|
+
const sorted = sortByKeys(_ds.v.raw_data.rows, _ds.progDataSource.sortModel);
|
|
29253
|
+
_ds.v.raw_data.rows = sorted;
|
|
29254
|
+
}
|
|
29255
|
+
|
|
29226
29256
|
if (_ds?.progDataSource?.dataSourceLimit) {
|
|
29227
29257
|
const ret_rows_found = await func.db.get_query(SESSION_ID, _ds._dataSourceTableId, _ds.v.couchView, dataSourceSession, _ds.viewSourceDesc, 'datasource table', prog_obj.progDataSource.dataSourceReduce, null, null, true, null, null, null, filterModel, _dataSourceFilterModelType);
|
|
29228
29258
|
_ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
|
|
@@ -29241,17 +29271,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29241
29271
|
data = [];
|
|
29242
29272
|
}
|
|
29243
29273
|
|
|
29244
|
-
// let _KEY = 0;
|
|
29245
|
-
// for (const _VAL of data) {
|
|
29246
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29247
|
-
// _KEY++;
|
|
29248
|
-
// }
|
|
29249
|
-
|
|
29250
29274
|
_ds.rows_found = data?.length || 0;
|
|
29251
29275
|
|
|
29252
|
-
// if (!_ds.v.raw_data) {
|
|
29253
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29254
|
-
// }
|
|
29255
29276
|
let _KEY = 0;
|
|
29256
29277
|
for (const _VAL of data) {
|
|
29257
29278
|
_ds.v.raw_data.rows.push({ id: _KEY, value: { _KEY, _VAL } });
|
|
@@ -29266,13 +29287,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29266
29287
|
data = {};
|
|
29267
29288
|
}
|
|
29268
29289
|
|
|
29269
|
-
// for (let [_KEY, _VAL] of Object.keys(data)) {
|
|
29270
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29271
|
-
// }
|
|
29272
29290
|
_ds.rows_found = Object.keys(data)?.length || 0;
|
|
29273
|
-
// if (!_ds.v.raw_data) {
|
|
29274
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29275
|
-
// }
|
|
29276
29291
|
|
|
29277
29292
|
for (let [_KEY, _VAL] of Object.keys(data)) {
|
|
29278
29293
|
_ds.v.raw_data.rows.push({ id: _KEY, value: { _KEY, _VAL } });
|
|
@@ -29287,21 +29302,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29287
29302
|
data = '';
|
|
29288
29303
|
}
|
|
29289
29304
|
|
|
29290
|
-
// if (!_ds.v.raw_data) {
|
|
29291
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29292
|
-
// }
|
|
29293
|
-
|
|
29294
|
-
// let _KEY = 0;
|
|
29295
|
-
// let arr = data.split(",");
|
|
29296
|
-
// for (const _VAL of arr) {
|
|
29297
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29298
|
-
// _KEY++;
|
|
29299
|
-
// }
|
|
29300
|
-
// _ds.rows_found = arr?.length || 0;
|
|
29301
|
-
// if (!_ds.v.raw_data) {
|
|
29302
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29303
|
-
// }
|
|
29304
|
-
|
|
29305
29305
|
let _KEY = 0;
|
|
29306
29306
|
let arr = data.split(',');
|
|
29307
29307
|
for (const _VAL of arr) {
|