not-bulma 1.0.67 → 1.0.69
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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import UICommon from "../common.js";
|
|
3
3
|
import ErrorsList from "../various/ui.errors.list.svelte";
|
|
4
4
|
|
|
5
|
-
import { createEventDispatcher } from "svelte";
|
|
5
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
6
6
|
let dispatch = createEventDispatcher();
|
|
7
7
|
|
|
8
8
|
export let inputStarted = false;
|
|
@@ -32,6 +32,14 @@
|
|
|
32
32
|
? UICommon.CLASS_OK
|
|
33
33
|
: UICommon.CLASS_ERR;
|
|
34
34
|
|
|
35
|
+
onMount(() => {
|
|
36
|
+
if (value instanceof Date) {
|
|
37
|
+
value = value.toISOString().split("T")[0];
|
|
38
|
+
} else if (value.indexOf("T") > 0) {
|
|
39
|
+
value = value.split("T")[0];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
35
43
|
function onBlur(ev) {
|
|
36
44
|
let data = {
|
|
37
45
|
field: fieldname,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export let value;
|
|
3
|
+
export let max = 100;
|
|
4
|
+
export let color = "";
|
|
5
|
+
export let size = "";
|
|
6
|
+
export let classes = "";
|
|
8
7
|
</script>
|
|
9
8
|
|
|
10
|
-
<progress
|
|
9
|
+
<progress
|
|
10
|
+
class="
|
|
11
11
|
progress
|
|
12
12
|
{classes}
|
|
13
|
-
{color
|
|
14
|
-
{size
|
|
13
|
+
{color ? `is-${color}` : ''}
|
|
14
|
+
{size ? `is-${size}` : ''}"
|
|
15
|
+
{value}
|
|
16
|
+
{max}>{value}%</progress
|
|
17
|
+
>
|
package/src/frame/common.js
CHANGED
|
@@ -149,11 +149,13 @@ class notCommon {
|
|
|
149
149
|
|
|
150
150
|
static TZ_OFFSET = (new Date().getTimezoneOffset() / 60) * -1;
|
|
151
151
|
static DEV_ENV = "production";
|
|
152
|
-
static ENV_TYPE = window.NOT_ENV_TYPE
|
|
152
|
+
static ENV_TYPE = window.NOT_ENV_TYPE
|
|
153
|
+
? window.NOT_ENV_TYPE
|
|
154
|
+
: notCommon.DEV_ENV;
|
|
153
155
|
static NOOP = () => {};
|
|
154
156
|
|
|
155
157
|
static mute() {
|
|
156
|
-
|
|
158
|
+
notCommon.ENV_TYPE = "production";
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
static pad(n) {
|
|
@@ -263,7 +265,7 @@ class notCommon {
|
|
|
263
265
|
if (typeof testie !== "function") {
|
|
264
266
|
return typeof testie;
|
|
265
267
|
} else {
|
|
266
|
-
if (
|
|
268
|
+
if (notCommon.isClass(testie)) {
|
|
267
269
|
return "class";
|
|
268
270
|
} else {
|
|
269
271
|
return "function";
|
|
@@ -281,15 +283,15 @@ class notCommon {
|
|
|
281
283
|
let localIsoString =
|
|
282
284
|
date.getFullYear() +
|
|
283
285
|
"-" +
|
|
284
|
-
|
|
286
|
+
notCommon.pad(date.getMonth() + 1) +
|
|
285
287
|
"-" +
|
|
286
|
-
|
|
288
|
+
notCommon.pad(date.getDate()) +
|
|
287
289
|
"T" +
|
|
288
|
-
|
|
290
|
+
notCommon.pad(date.getHours()) +
|
|
289
291
|
":" +
|
|
290
|
-
|
|
292
|
+
notCommon.pad(date.getMinutes()) +
|
|
291
293
|
":" +
|
|
292
|
-
|
|
294
|
+
notCommon.pad(date.getSeconds());
|
|
293
295
|
return localIsoString;
|
|
294
296
|
}
|
|
295
297
|
|
|
@@ -298,44 +300,44 @@ class notCommon {
|
|
|
298
300
|
let date =
|
|
299
301
|
today.getFullYear() +
|
|
300
302
|
"-" +
|
|
301
|
-
|
|
303
|
+
notCommon.pad(today.getMonth() + 1) +
|
|
302
304
|
"-" +
|
|
303
|
-
|
|
305
|
+
notCommon.pad(today.getDate());
|
|
304
306
|
return date;
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
static backlog = [];
|
|
308
310
|
|
|
309
311
|
static backlogAdd(msg, type = "log") {
|
|
310
|
-
if (
|
|
311
|
-
|
|
312
|
+
if (notCommon.get("backlog") === true) {
|
|
313
|
+
notCommon.backlog.push({ msg, type });
|
|
312
314
|
}
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
static dumpBacklog() {
|
|
316
|
-
while (
|
|
317
|
-
let row =
|
|
318
|
-
window[
|
|
318
|
+
while (notCommon.backlog.length) {
|
|
319
|
+
let row = notCommon.backlog.shift();
|
|
320
|
+
window[notCommon.LOG][row.type](...row.msg);
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
static logMsg() {
|
|
323
|
-
let now =
|
|
325
|
+
let now = notCommon.localIsoDate();
|
|
324
326
|
// eslint-disable-next-line no-console
|
|
325
|
-
window[
|
|
326
|
-
|
|
327
|
+
window[notCommon.LOG].log(`[${now}]: `, ...arguments);
|
|
328
|
+
notCommon.backlogAdd([`[${now}]: `, ...arguments], "log");
|
|
327
329
|
}
|
|
328
330
|
|
|
329
331
|
static log() {
|
|
330
|
-
|
|
332
|
+
notCommon.logMsg(...arguments);
|
|
331
333
|
}
|
|
332
334
|
|
|
333
335
|
static createLogger(prefix) {
|
|
334
336
|
return {
|
|
335
|
-
log:
|
|
336
|
-
error:
|
|
337
|
-
debug:
|
|
338
|
-
report:
|
|
337
|
+
log: notCommon.genLogMsg(prefix),
|
|
338
|
+
error: notCommon.genLogError(prefix),
|
|
339
|
+
debug: notCommon.genLogDebug(prefix),
|
|
340
|
+
report: notCommon.report,
|
|
339
341
|
};
|
|
340
342
|
}
|
|
341
343
|
|
|
@@ -358,35 +360,35 @@ class notCommon {
|
|
|
358
360
|
* @returns {boolean} true если это запущено в окружении разработки
|
|
359
361
|
**/
|
|
360
362
|
static isDev() {
|
|
361
|
-
return
|
|
363
|
+
return notCommon.ENV_TYPE === notCommon.DEV_ENV;
|
|
362
364
|
}
|
|
363
365
|
|
|
364
366
|
static debug() {
|
|
365
|
-
if (
|
|
366
|
-
return
|
|
367
|
+
if (notCommon.isDev()) {
|
|
368
|
+
return notCommon.logMsg(...arguments);
|
|
367
369
|
} else {
|
|
368
|
-
return
|
|
370
|
+
return notCommon.NOOP;
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
373
|
|
|
372
374
|
static genLogDebug(prefix) {
|
|
373
|
-
if (
|
|
374
|
-
return
|
|
375
|
+
if (notCommon.isDev()) {
|
|
376
|
+
return notCommon.genLogMsg(prefix);
|
|
375
377
|
} else {
|
|
376
|
-
return
|
|
378
|
+
return notCommon.NOOP;
|
|
377
379
|
}
|
|
378
380
|
}
|
|
379
381
|
|
|
380
382
|
static error() {
|
|
381
|
-
|
|
383
|
+
notCommon.logError(...arguments);
|
|
382
384
|
}
|
|
383
385
|
|
|
384
386
|
//Функция вывода сообщения об ошибке
|
|
385
387
|
static logError() {
|
|
386
|
-
let now =
|
|
388
|
+
let now = notCommon.localIsoDate();
|
|
387
389
|
// eslint-disable-next-line no-console
|
|
388
|
-
window[
|
|
389
|
-
|
|
390
|
+
window[notCommon.LOG].error(`[${now}]: `, ...arguments);
|
|
391
|
+
notCommon.backlogAdd([`[${now}]: `, ...arguments], "error");
|
|
390
392
|
}
|
|
391
393
|
|
|
392
394
|
static genLogError(prefix) {
|
|
@@ -403,21 +405,21 @@ class notCommon {
|
|
|
403
405
|
}
|
|
404
406
|
|
|
405
407
|
static report(e) {
|
|
406
|
-
if (
|
|
407
|
-
let reporter =
|
|
408
|
+
if (notCommon.getApp()) {
|
|
409
|
+
let reporter = notCommon.getApp().getService("nsErrorReporter");
|
|
408
410
|
if (reporter) {
|
|
409
|
-
reporter.report(e).catch(
|
|
411
|
+
reporter.report(e).catch(notCommon.error);
|
|
410
412
|
}
|
|
411
413
|
} else {
|
|
412
|
-
if (!
|
|
413
|
-
|
|
414
|
+
if (!notCommon.get("production")) {
|
|
415
|
+
notCommon.error(...arguments);
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
}
|
|
417
419
|
|
|
418
420
|
static trace() {
|
|
419
|
-
if (!
|
|
420
|
-
|
|
421
|
+
if (!notCommon.get("production")) {
|
|
422
|
+
notCommon.trace(...arguments);
|
|
421
423
|
}
|
|
422
424
|
}
|
|
423
425
|
|
|
@@ -440,19 +442,19 @@ class notCommon {
|
|
|
440
442
|
static buildURL({ prefix, module, model, id, action }) {
|
|
441
443
|
let url = ["/"];
|
|
442
444
|
if (prefix) {
|
|
443
|
-
url.push(encodeURIComponent(
|
|
445
|
+
url.push(encodeURIComponent(notCommon.trimBackslash(prefix)));
|
|
444
446
|
}
|
|
445
447
|
if (module) {
|
|
446
|
-
url.push(encodeURIComponent(
|
|
448
|
+
url.push(encodeURIComponent(notCommon.trimBackslash(module)));
|
|
447
449
|
}
|
|
448
450
|
if (model) {
|
|
449
|
-
url.push(encodeURIComponent(
|
|
451
|
+
url.push(encodeURIComponent(notCommon.trimBackslash(model)));
|
|
450
452
|
}
|
|
451
453
|
if (id) {
|
|
452
|
-
url.push(encodeURIComponent(
|
|
454
|
+
url.push(encodeURIComponent(notCommon.trimBackslash(id)));
|
|
453
455
|
}
|
|
454
456
|
if (action) {
|
|
455
|
-
url.push(encodeURIComponent(
|
|
457
|
+
url.push(encodeURIComponent(notCommon.trimBackslash(action)));
|
|
456
458
|
}
|
|
457
459
|
url = url.filter((el) => el !== "");
|
|
458
460
|
return url.join("/").replace(/\/\//g, "/");
|
|
@@ -488,11 +490,11 @@ class notCommon {
|
|
|
488
490
|
}
|
|
489
491
|
|
|
490
492
|
static getApp() {
|
|
491
|
-
return
|
|
493
|
+
return notCommon.get("app");
|
|
492
494
|
}
|
|
493
495
|
|
|
494
496
|
static extendAppConfig(conf, conf2) {
|
|
495
|
-
return
|
|
497
|
+
return notCommon.deepMerge(conf, conf2);
|
|
496
498
|
}
|
|
497
499
|
|
|
498
500
|
static absorbModule() {
|
|
@@ -510,7 +512,7 @@ class notCommon {
|
|
|
510
512
|
delete targets.mod;
|
|
511
513
|
}
|
|
512
514
|
} else {
|
|
513
|
-
|
|
515
|
+
notCommon.log(
|
|
514
516
|
"WARNING: absorbModule format obsoleted, use object {defaultConf, mod, services, uis, wsc, etc}"
|
|
515
517
|
);
|
|
516
518
|
defaultConf = arguments[0];
|
|
@@ -528,17 +530,20 @@ class notCommon {
|
|
|
528
530
|
for (let prop in mod) {
|
|
529
531
|
//add manifest to other
|
|
530
532
|
if (prop === "manifest") {
|
|
531
|
-
defaultConf =
|
|
533
|
+
defaultConf = notCommon.extendAppConfig(
|
|
534
|
+
defaultConf,
|
|
535
|
+
mod.manifest
|
|
536
|
+
);
|
|
532
537
|
continue;
|
|
533
538
|
}
|
|
534
|
-
if (typeof
|
|
539
|
+
if (typeof notCommon.get(`absorb.${prop}`) === "function") {
|
|
535
540
|
if (!Object.prototype.hasOwnProperty.call(targets, prop)) {
|
|
536
541
|
targets[prop] = {};
|
|
537
|
-
|
|
542
|
+
notCommon.log(
|
|
538
543
|
`WARNING: no accamulator object provided for '${prop}' collection`
|
|
539
544
|
);
|
|
540
545
|
}
|
|
541
|
-
|
|
546
|
+
notCommon.get(`absorb.${prop}`)(targets[prop], mod[prop]);
|
|
542
547
|
} else if (prop.indexOf("nc") === 0) {
|
|
543
548
|
if (
|
|
544
549
|
!Object.prototype.hasOwnProperty.call(
|
|
@@ -569,12 +574,12 @@ class notCommon {
|
|
|
569
574
|
static registry = {};
|
|
570
575
|
|
|
571
576
|
static register(key, val) {
|
|
572
|
-
|
|
577
|
+
notCommon.registry[key] = val;
|
|
573
578
|
}
|
|
574
579
|
|
|
575
580
|
static get(key) {
|
|
576
|
-
return Object.prototype.hasOwnProperty.call(
|
|
577
|
-
?
|
|
581
|
+
return Object.prototype.hasOwnProperty.call(notCommon.registry, key)
|
|
582
|
+
? notCommon.registry[key]
|
|
578
583
|
: null;
|
|
579
584
|
}
|
|
580
585
|
|
|
@@ -598,7 +603,7 @@ class notCommon {
|
|
|
598
603
|
}
|
|
599
604
|
for (let t in obj) {
|
|
600
605
|
if (Object.prototype.hasOwnProperty.call(obj, t)) {
|
|
601
|
-
obj[t] =
|
|
606
|
+
obj[t] = notCommon.stripProxy(obj[t]);
|
|
602
607
|
}
|
|
603
608
|
}
|
|
604
609
|
}
|
|
@@ -615,15 +620,17 @@ class notCommon {
|
|
|
615
620
|
}
|
|
616
621
|
|
|
617
622
|
static getAPI(type) {
|
|
618
|
-
return
|
|
623
|
+
return notCommon.getManager()
|
|
624
|
+
? notCommon.getManager().getAPI(type)
|
|
625
|
+
: null;
|
|
619
626
|
}
|
|
620
627
|
|
|
621
628
|
static setManager(v) {
|
|
622
|
-
|
|
629
|
+
notCommon.MANAGER = v;
|
|
623
630
|
}
|
|
624
631
|
|
|
625
632
|
static getManager() {
|
|
626
|
-
return
|
|
633
|
+
return notCommon.MANAGER;
|
|
627
634
|
}
|
|
628
635
|
|
|
629
636
|
static getJSON(url) {
|
|
@@ -637,15 +644,16 @@ class notCommon {
|
|
|
637
644
|
}
|
|
638
645
|
|
|
639
646
|
static registerWidgetEvents(events) {
|
|
640
|
-
if (
|
|
647
|
+
if (notCommon.getApp()) {
|
|
641
648
|
Object.keys(events).forEach((eventName) => {
|
|
642
|
-
|
|
649
|
+
notCommon.getApp().on(eventName, events[eventName]);
|
|
643
650
|
});
|
|
644
651
|
}
|
|
645
652
|
}
|
|
646
653
|
|
|
647
654
|
static navigate(url) {
|
|
648
|
-
|
|
655
|
+
notCommon.getApp() &&
|
|
656
|
+
notCommon.getApp().getWorking("router").navigate(url);
|
|
649
657
|
}
|
|
650
658
|
}
|
|
651
659
|
|
|
@@ -34,10 +34,10 @@ class notTable extends EventEmitter {
|
|
|
34
34
|
constructor(input = {}) {
|
|
35
35
|
super();
|
|
36
36
|
this.id = "table-" + Math.random();
|
|
37
|
-
this.options =
|
|
38
|
-
DEFAULT_OPTIONS,
|
|
39
|
-
input.options ? input.options : {}
|
|
40
|
-
|
|
37
|
+
this.options = {
|
|
38
|
+
...DEFAULT_OPTIONS,
|
|
39
|
+
...(input.options ? input.options : {}),
|
|
40
|
+
};
|
|
41
41
|
this.ui = {};
|
|
42
42
|
this.data = {
|
|
43
43
|
raw: [],
|