native-document 1.0.245 → 1.0.247

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": "native-document",
3
- "version": "1.0.245",
3
+ "version": "1.0.247",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -50,6 +50,7 @@ export default function ListGroup(label, props = {}) {
50
50
  selectByClick: $(false),
51
51
  loopOnKeyboard: $(false),
52
52
  hideIfEmpty: null,
53
+ showTitleWhen: null,
53
54
  props,
54
55
  };
55
56
  }
@@ -134,10 +135,18 @@ ListGroup.prototype.data = function(data) {
134
135
  this.$description.data = data;
135
136
  return this;
136
137
  };
138
+
137
139
  /**
138
140
  * @return {this}
139
141
  */
140
142
  ListGroup.prototype.hideIfEmpty = function() {
141
143
  this.$description.hideIfEmpty = true;
142
144
  return this;
145
+ };
146
+
147
+ /**
148
+ * @param {Observable} $observable
149
+ */
150
+ ListGroup.prototype.showTitleWhen = function($observable) {
151
+ this.$description.showTitleWhen = $observable;
143
152
  };
@@ -51,6 +51,7 @@ export interface ListGroupInterface {
51
51
  on(event: string, handler: (...args: unknown[]) => void): this;
52
52
  emit(event: string, ...args: unknown[]): void;
53
53
  hasListeners(event: string): boolean;
54
+ showTitleWhen(observable: ObservableItem<boolean>): boolean;
54
55
  }
55
56
 
56
57
  export declare function ListGroup(label: ValidChild, props?: GlobalAttributes): ListGroupInterface;
@@ -539,4 +539,12 @@ ObservableArray.prototype.fnClear = function () {
539
539
  return () => this.clear();
540
540
  };
541
541
 
542
+ ObservableArray.prototype.val = function () {
543
+ const result = [];
544
+ for(const element of this.$currentValue) {
545
+ result.push(element?.__$Observable ? element.val() : element);
546
+ }
547
+ return result;
548
+ };
549
+
542
550
  export default ObservableArray;
@@ -70,7 +70,7 @@ export const StoreFactory = function() {
70
70
  from.subscribe((data, _, operations) => {
71
71
  const callback = methods[operations.action];
72
72
  if(!callback) {
73
- originalSet(data);
73
+ originalSet([...data]);
74
74
  return;
75
75
  }
76
76
  callback(...(operations.args||[]));
@@ -46,7 +46,7 @@ function buildContent($desc) {
46
46
  const content = [];
47
47
 
48
48
  if($desc.loading) {
49
- content.push(ShowIf($desc.loading, Spinner({ class: 'btn-spinner' })));
49
+ content.push(ShowIf($desc.loading, Spinner({ class: 'btn-spinner' }).size($desc.size)));
50
50
  }
51
51
 
52
52
  if($desc.icon && isIconBefore($desc.iconPosition)) {
@@ -272,9 +272,12 @@
272
272
  &.is-large { width: var(--btn-height-large); }
273
273
  }
274
274
  }
275
- .btn.is-loading:not(.is-outline) .spinner,
276
- .btn.is-loading:not(.is-ghost) .spinner {
277
- --spinner-color: white !important;
275
+ .btn.is-loading .spinner{
276
+ --spinner-color: white;
277
+ }
278
+ .btn.is-loading.is-outline .spinner,
279
+ .btn.is-loading.is-ghost .spinner {
280
+ --spinner-color: var(--gray-lite-2);
278
281
  }
279
282
 
280
283
  .btn-icon {
@@ -63,5 +63,9 @@ function buildGroupHeader($desc, instance) {
63
63
  header.nd.onStopClick(() => $desc.collapsed.toggle());
64
64
  }
65
65
 
66
+ if($desc.showTitleWhen) {
67
+ return ShowIf($desc.showTitleWhen, header);
68
+ }
69
+
66
70
  return header;
67
71
  }
@@ -57,6 +57,6 @@
57
57
 
58
58
  .list-group-items {
59
59
  .list-item {
60
- padding-left: calc(var(--list-group-items-indent) + 14px);
60
+ padding-left: calc(var(--list-group-items-indent) + 5px);
61
61
  }
62
62
  }
@@ -1,9 +1,9 @@
1
1
  :root {
2
2
  --spinner-size-extra-small: 16px;
3
- --spinner-size-small: 24px;
4
- --spinner-size-medium: 36px;
5
- --spinner-size-large: 48px;
6
- --spinner-size-extra-large: 64px;
3
+ --spinner-size-small: 20px;
4
+ --spinner-size-medium: 32px;
5
+ --spinner-size-large: 45px;
6
+ --spinner-size-extra-large: 60px;
7
7
 
8
8
  --spinner-speed-slow: 1.2s;
9
9
  --spinner-speed-normal: 0.8s;