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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-bulma",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "not-* family UI components on Bulma CSS Framework",
5
5
  "main": "src/index.js",
6
6
  "svelte": "src/index.js",
@@ -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
- export let value;
3
- export let max = 100;
4
- export let color = '';
5
- export let size = '';
6
- export let classes = '';
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 class="
9
+ <progress
10
+ class="
11
11
  progress
12
12
  {classes}
13
- {color?`is-${color}`:''}
14
- {size?`is-${size}`:''}" {value} {max}>{value}%</progress>
13
+ {color ? `is-${color}` : ''}
14
+ {size ? `is-${size}` : ''}"
15
+ {value}
16
+ {max}>{value}%</progress
17
+ >
@@ -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 ? window.NOT_ENV_TYPE : this.DEV_ENV;
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
- this.ENV_TYPE = "production";
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 (this.isClass(testie)) {
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
- this.pad(date.getMonth() + 1) +
286
+ notCommon.pad(date.getMonth() + 1) +
285
287
  "-" +
286
- this.pad(date.getDate()) +
288
+ notCommon.pad(date.getDate()) +
287
289
  "T" +
288
- this.pad(date.getHours()) +
290
+ notCommon.pad(date.getHours()) +
289
291
  ":" +
290
- this.pad(date.getMinutes()) +
292
+ notCommon.pad(date.getMinutes()) +
291
293
  ":" +
292
- this.pad(date.getSeconds());
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
- this.pad(today.getMonth() + 1) +
303
+ notCommon.pad(today.getMonth() + 1) +
302
304
  "-" +
303
- this.pad(today.getDate());
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 (this.get("backlog") === true) {
311
- this.backlog.push({ msg, type });
312
+ if (notCommon.get("backlog") === true) {
313
+ notCommon.backlog.push({ msg, type });
312
314
  }
313
315
  }
314
316
 
315
317
  static dumpBacklog() {
316
- while (this.backlog.length) {
317
- let row = this.backlog.shift();
318
- window[this.LOG][row.type](...row.msg);
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 = this.localIsoDate();
325
+ let now = notCommon.localIsoDate();
324
326
  // eslint-disable-next-line no-console
325
- window[this.LOG].log(`[${now}]: `, ...arguments);
326
- this.backlogAdd([`[${now}]: `, ...arguments], "log");
327
+ window[notCommon.LOG].log(`[${now}]: `, ...arguments);
328
+ notCommon.backlogAdd([`[${now}]: `, ...arguments], "log");
327
329
  }
328
330
 
329
331
  static log() {
330
- this.logMsg(...arguments);
332
+ notCommon.logMsg(...arguments);
331
333
  }
332
334
 
333
335
  static createLogger(prefix) {
334
336
  return {
335
- log: this.genLogMsg(prefix),
336
- error: this.genLogError(prefix),
337
- debug: this.genLogDebug(prefix),
338
- report: this.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 this.ENV_TYPE === this.DEV_ENV;
363
+ return notCommon.ENV_TYPE === notCommon.DEV_ENV;
362
364
  }
363
365
 
364
366
  static debug() {
365
- if (this.isDev()) {
366
- return this.logMsg(...arguments);
367
+ if (notCommon.isDev()) {
368
+ return notCommon.logMsg(...arguments);
367
369
  } else {
368
- return this.NOOP;
370
+ return notCommon.NOOP;
369
371
  }
370
372
  }
371
373
 
372
374
  static genLogDebug(prefix) {
373
- if (this.isDev()) {
374
- return this.genLogMsg(prefix);
375
+ if (notCommon.isDev()) {
376
+ return notCommon.genLogMsg(prefix);
375
377
  } else {
376
- return this.NOOP;
378
+ return notCommon.NOOP;
377
379
  }
378
380
  }
379
381
 
380
382
  static error() {
381
- this.logError(...arguments);
383
+ notCommon.logError(...arguments);
382
384
  }
383
385
 
384
386
  //Функция вывода сообщения об ошибке
385
387
  static logError() {
386
- let now = this.localIsoDate();
388
+ let now = notCommon.localIsoDate();
387
389
  // eslint-disable-next-line no-console
388
- window[this.LOG].error(`[${now}]: `, ...arguments);
389
- this.backlogAdd([`[${now}]: `, ...arguments], "error");
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 (this.getApp()) {
407
- let reporter = this.getApp().getService("nsErrorReporter");
408
+ if (notCommon.getApp()) {
409
+ let reporter = notCommon.getApp().getService("nsErrorReporter");
408
410
  if (reporter) {
409
- reporter.report(e).catch(this.error.bind(this));
411
+ reporter.report(e).catch(notCommon.error);
410
412
  }
411
413
  } else {
412
- if (!this.get("production")) {
413
- this.error(...arguments);
414
+ if (!notCommon.get("production")) {
415
+ notCommon.error(...arguments);
414
416
  }
415
417
  }
416
418
  }
417
419
 
418
420
  static trace() {
419
- if (!this.get("production")) {
420
- this.trace(...arguments);
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(this.trimBackslash(prefix)));
445
+ url.push(encodeURIComponent(notCommon.trimBackslash(prefix)));
444
446
  }
445
447
  if (module) {
446
- url.push(encodeURIComponent(this.trimBackslash(module)));
448
+ url.push(encodeURIComponent(notCommon.trimBackslash(module)));
447
449
  }
448
450
  if (model) {
449
- url.push(encodeURIComponent(this.trimBackslash(model)));
451
+ url.push(encodeURIComponent(notCommon.trimBackslash(model)));
450
452
  }
451
453
  if (id) {
452
- url.push(encodeURIComponent(this.trimBackslash(id)));
454
+ url.push(encodeURIComponent(notCommon.trimBackslash(id)));
453
455
  }
454
456
  if (action) {
455
- url.push(encodeURIComponent(this.trimBackslash(action)));
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 this.get("app");
493
+ return notCommon.get("app");
492
494
  }
493
495
 
494
496
  static extendAppConfig(conf, conf2) {
495
- return this.deepMerge(conf, conf2);
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
- this.log(
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 = this.extendAppConfig(defaultConf, mod.manifest);
533
+ defaultConf = notCommon.extendAppConfig(
534
+ defaultConf,
535
+ mod.manifest
536
+ );
532
537
  continue;
533
538
  }
534
- if (typeof this.get(`absorb.${prop}`) === "function") {
539
+ if (typeof notCommon.get(`absorb.${prop}`) === "function") {
535
540
  if (!Object.prototype.hasOwnProperty.call(targets, prop)) {
536
541
  targets[prop] = {};
537
- this.log(
542
+ notCommon.log(
538
543
  `WARNING: no accamulator object provided for '${prop}' collection`
539
544
  );
540
545
  }
541
- this.get(`absorb.${prop}`)(targets[prop], mod[prop]);
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
- this.registry[key] = val;
577
+ notCommon.registry[key] = val;
573
578
  }
574
579
 
575
580
  static get(key) {
576
- return Object.prototype.hasOwnProperty.call(this.registry, key)
577
- ? this.registry[key]
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] = this.stripProxy(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 this.getManager() ? this.getManager().getAPI(type) : null;
623
+ return notCommon.getManager()
624
+ ? notCommon.getManager().getAPI(type)
625
+ : null;
619
626
  }
620
627
 
621
628
  static setManager(v) {
622
- this.MANAGER = v;
629
+ notCommon.MANAGER = v;
623
630
  }
624
631
 
625
632
  static getManager() {
626
- return this.MANAGER;
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 (this.getApp()) {
647
+ if (notCommon.getApp()) {
641
648
  Object.keys(events).forEach((eventName) => {
642
- this.getApp().on(eventName, events[eventName]);
649
+ notCommon.getApp().on(eventName, events[eventName]);
643
650
  });
644
651
  }
645
652
  }
646
653
 
647
654
  static navigate(url) {
648
- this.getApp() && this.getApp().getWorking("router").navigate(url);
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 = Object.assign(
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: [],