@zeedhi/common 1.88.0 → 1.88.1

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.
@@ -7476,10 +7476,21 @@ class Select extends TextInput {
7476
7476
  const oldGet = this.datasource.get;
7477
7477
  this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
7478
7478
  const response = yield oldGet.call(this.datasource);
7479
+ if (!this.datasource.search && !this.manualMode) {
7480
+ this.cachedData = [...this.datasource.data];
7481
+ this.cachedTotal = this.datasource.total;
7482
+ }
7479
7483
  if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
7480
7484
  yield this.setValue(this.value, false);
7481
7485
  this.removePushedValue();
7482
7486
  }
7487
+ if (this.pushedValue && this.indexOf(this.pushedValue) === -1) {
7488
+ const filterValue = this.pushedValue[this.dataValue];
7489
+ const foundInData = this.datasource.data.find(this.getCondition(filterValue));
7490
+ if (!foundInData) {
7491
+ this.datasource.data.unshift(this.pushedValue);
7492
+ }
7493
+ }
7483
7494
  return response;
7484
7495
  });
7485
7496
  }
@@ -7483,10 +7483,21 @@
7483
7483
  const oldGet = this.datasource.get;
7484
7484
  this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
7485
7485
  const response = yield oldGet.call(this.datasource);
7486
+ if (!this.datasource.search && !this.manualMode) {
7487
+ this.cachedData = [...this.datasource.data];
7488
+ this.cachedTotal = this.datasource.total;
7489
+ }
7486
7490
  if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
7487
7491
  yield this.setValue(this.value, false);
7488
7492
  this.removePushedValue();
7489
7493
  }
7494
+ if (this.pushedValue && this.indexOf(this.pushedValue) === -1) {
7495
+ const filterValue = this.pushedValue[this.dataValue];
7496
+ const foundInData = this.datasource.data.find(this.getCondition(filterValue));
7497
+ if (!foundInData) {
7498
+ this.datasource.data.unshift(this.pushedValue);
7499
+ }
7500
+ }
7490
7501
  return response;
7491
7502
  });
7492
7503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.88.0",
3
+ "version": "1.88.1",
4
4
  "description": "Zeedhi Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -42,6 +42,5 @@
42
42
  "@types/lodash.times": "4.3.*",
43
43
  "lodash.times": "4.3.*",
44
44
  "mockdate": "3.0.*"
45
- },
46
- "gitHead": "b9e30e705a88fa882c1fbdf140c15cc7c47c7c87"
45
+ }
47
46
  }
package/LICENSE DELETED
@@ -1,24 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Zeedhi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
23
- This repository includes one file originally copied from https://github.com/vuetifyjs/vuetify/
24
- under /blob/v1.5.16/packages/vuetify/src/util/, mask.ts.
@@ -1,12 +0,0 @@
1
- export interface IJSONObject {
2
- path: string;
3
- }
4
- export declare class JsonCacheService {
5
- /**
6
- * jsons collection
7
- */
8
- static jsonCollection: IJSONObject[];
9
- static saveJSONCache(jsonCollection: IJSONObject[]): Promise<void>;
10
- static getJSONCache(path: string): any;
11
- static clearJSONCache(jsonCollection: IJSONObject[]): void;
12
- }