asv-hlps 1.0.98 → 1.2.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.
@@ -0,0 +1 @@
1
+ export declare type BtnVariant = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import { Bill } from "../../models";
2
2
  declare class AmountOnBillPipe {
3
- get(bill: Bill): number;
3
+ transform(bill: Bill): number;
4
4
  }
5
5
  declare const _default: AmountOnBillPipe;
6
6
  export default _default;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const bill_1 = require("../../bill");
4
4
  class AmountOnBillPipe {
5
- get(bill) {
5
+ transform(bill) {
6
6
  return (0, bill_1.getTotalAmountAllIncludedOnBill)(bill.sales);
7
7
  }
8
8
  }
@@ -1,6 +1,6 @@
1
1
  import { Bill } from "../../models/entities/bills/Bill";
2
2
  declare class AmountOnListBillPipe {
3
- get(bills: Bill[], param: string): number;
3
+ transform(bills: Bill[], param: "due" | "all" | "paid"): number;
4
4
  }
5
5
  declare const _default: AmountOnListBillPipe;
6
6
  export default _default;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const bill_1 = require("../../bill");
4
4
  class AmountOnListBillPipe {
5
- get(bills, param) {
5
+ transform(bills, param) {
6
6
  switch (param) {
7
7
  case "due":
8
8
  return (0, bill_1.getTotalDueAmountOnListBill)(bills);
@@ -1,14 +1,16 @@
1
- import "./bill";
2
1
  import { HlpEntry } from "./helpers/hlpEntry";
3
2
  import HlpProduct from "./helpers/hlpProduct";
4
- import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
5
3
  import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
4
+ import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
6
5
  import StockPipe from "./helpers/pipes/stock-pipe";
6
+ import "./bill";
7
+ import "./bootstrap";
7
8
  import "./models/index";
8
9
  import "./pdfs/invoices/amountInvoice";
9
10
  import "./pdfs/invoices/infoInvoice";
10
11
  import "./pdfs/tools/tools";
11
12
  import "./product";
13
+ import "./react-utils";
12
14
  import "./sale";
13
15
  import "./typeorm";
14
16
  import "./user";
@@ -23,4 +25,6 @@ export * from "./sale";
23
25
  export * from "./typeorm";
24
26
  export * from "./user";
25
27
  export * from "./utils";
28
+ export * from "./react-utils";
29
+ export * from "./bootstrap";
26
30
  export { HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe };
package/lib/cjs/index.js CHANGED
@@ -18,22 +18,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.AmountOnBillPipe = exports.AmountOnListBillPipe = exports.StockPipe = exports.HlpEntry = exports.HlpProduct = void 0;
21
- require("./bill");
22
21
  const hlpEntry_1 = require("./helpers/hlpEntry");
23
22
  Object.defineProperty(exports, "HlpEntry", { enumerable: true, get: function () { return hlpEntry_1.HlpEntry; } });
24
23
  const hlpProduct_1 = __importDefault(require("./helpers/hlpProduct"));
25
24
  exports.HlpProduct = hlpProduct_1.default;
26
- const amount_on_list_bill_pipe_1 = __importDefault(require("./helpers/pipes/amount-on-list-bill-pipe"));
27
- exports.AmountOnListBillPipe = amount_on_list_bill_pipe_1.default;
28
25
  const amount_on_bill_pipe_1 = __importDefault(require("./helpers/pipes/amount-on-bill-pipe"));
29
26
  exports.AmountOnBillPipe = amount_on_bill_pipe_1.default;
27
+ const amount_on_list_bill_pipe_1 = __importDefault(require("./helpers/pipes/amount-on-list-bill-pipe"));
28
+ exports.AmountOnListBillPipe = amount_on_list_bill_pipe_1.default;
30
29
  const stock_pipe_1 = __importDefault(require("./helpers/pipes/stock-pipe"));
31
30
  exports.StockPipe = stock_pipe_1.default;
31
+ require("./bill");
32
+ require("./bootstrap");
32
33
  require("./models/index");
33
34
  require("./pdfs/invoices/amountInvoice");
34
35
  require("./pdfs/invoices/infoInvoice");
35
36
  require("./pdfs/tools/tools");
36
37
  require("./product");
38
+ require("./react-utils");
37
39
  require("./sale");
38
40
  require("./typeorm");
39
41
  require("./user");
@@ -48,3 +50,5 @@ __exportStar(require("./sale"), exports);
48
50
  __exportStar(require("./typeorm"), exports);
49
51
  __exportStar(require("./user"), exports);
50
52
  __exportStar(require("./utils"), exports);
53
+ __exportStar(require("./react-utils"), exports);
54
+ __exportStar(require("./bootstrap"), exports);
@@ -0,0 +1 @@
1
+ export declare const selectOptionsToLabelAndValue: (objs: any[], valueProp?: string, labelProp?: string) => any[];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectOptionsToLabelAndValue = void 0;
4
+ const selectOptionsToLabelAndValue = (objs, valueProp = "id", labelProp = "name") => {
5
+ if (!objs.length) {
6
+ return objs;
7
+ }
8
+ let options = [];
9
+ for (const obj of objs) {
10
+ options.push({ value: obj[valueProp], label: obj[labelProp] });
11
+ }
12
+ return options;
13
+ };
14
+ exports.selectOptionsToLabelAndValue = selectOptionsToLabelAndValue;
package/lib/cjs/utils.js CHANGED
@@ -163,7 +163,7 @@ const formatToString = (val, separator = " ", currency = "") => {
163
163
  exports.formatToString = formatToString;
164
164
  const formatToStringCfa = (val) => {
165
165
  // return String(val).replace(/(.)(?=(\d{3})+$)/g, '$1 ') + ' CFA';
166
- return (0, exports.formatToString)(val, " ", " CFA");
166
+ return (0, exports.formatToString)(val, " ", " FCFA");
167
167
  };
168
168
  exports.formatToStringCfa = formatToStringCfa;
169
169
  // const = reformatDates(fromDate: string, toDate: string) => {
@@ -0,0 +1 @@
1
+ export declare type BtnVariant = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Bill } from "../../models";
2
2
  declare class AmountOnBillPipe {
3
- get(bill: Bill): number;
3
+ transform(bill: Bill): number;
4
4
  }
5
5
  declare const _default: AmountOnBillPipe;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { getTotalAmountAllIncludedOnBill } from "../../bill";
2
2
  class AmountOnBillPipe {
3
- get(bill) {
3
+ transform(bill) {
4
4
  return getTotalAmountAllIncludedOnBill(bill.sales);
5
5
  }
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { Bill } from "../../models/entities/bills/Bill";
2
2
  declare class AmountOnListBillPipe {
3
- get(bills: Bill[], param: string): number;
3
+ transform(bills: Bill[], param: "due" | "all" | "paid"): number;
4
4
  }
5
5
  declare const _default: AmountOnListBillPipe;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { getTotalDueAmountOnListBill, getTotalAmountOnListBill } from "../../bill";
2
2
  class AmountOnListBillPipe {
3
- get(bills, param) {
3
+ transform(bills, param) {
4
4
  switch (param) {
5
5
  case "due":
6
6
  return getTotalDueAmountOnListBill(bills);
@@ -1,14 +1,16 @@
1
- import "./bill";
2
1
  import { HlpEntry } from "./helpers/hlpEntry";
3
2
  import HlpProduct from "./helpers/hlpProduct";
4
- import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
5
3
  import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
4
+ import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
6
5
  import StockPipe from "./helpers/pipes/stock-pipe";
6
+ import "./bill";
7
+ import "./bootstrap";
7
8
  import "./models/index";
8
9
  import "./pdfs/invoices/amountInvoice";
9
10
  import "./pdfs/invoices/infoInvoice";
10
11
  import "./pdfs/tools/tools";
11
12
  import "./product";
13
+ import "./react-utils";
12
14
  import "./sale";
13
15
  import "./typeorm";
14
16
  import "./user";
@@ -23,4 +25,6 @@ export * from "./sale";
23
25
  export * from "./typeorm";
24
26
  export * from "./user";
25
27
  export * from "./utils";
28
+ export * from "./react-utils";
29
+ export * from "./bootstrap";
26
30
  export { HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe };
package/lib/esm/index.js CHANGED
@@ -1,14 +1,16 @@
1
- import "./bill";
2
1
  import { HlpEntry } from "./helpers/hlpEntry";
3
2
  import HlpProduct from "./helpers/hlpProduct";
4
- import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
5
3
  import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
4
+ import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
6
5
  import StockPipe from "./helpers/pipes/stock-pipe";
6
+ import "./bill";
7
+ import "./bootstrap";
7
8
  import "./models/index";
8
9
  import "./pdfs/invoices/amountInvoice";
9
10
  import "./pdfs/invoices/infoInvoice";
10
11
  import "./pdfs/tools/tools";
11
12
  import "./product";
13
+ import "./react-utils";
12
14
  import "./sale";
13
15
  import "./typeorm";
14
16
  import "./user";
@@ -23,5 +25,7 @@ export * from "./sale";
23
25
  export * from "./typeorm";
24
26
  export * from "./user";
25
27
  export * from "./utils";
28
+ export * from "./react-utils";
29
+ export * from "./bootstrap";
26
30
  // export * from "./helpers/hlpProduct";
27
31
  export { HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe };
@@ -0,0 +1 @@
1
+ export declare const selectOptionsToLabelAndValue: (objs: any[], valueProp?: string, labelProp?: string) => any[];
@@ -0,0 +1,10 @@
1
+ export const selectOptionsToLabelAndValue = (objs, valueProp = "id", labelProp = "name") => {
2
+ if (!objs.length) {
3
+ return objs;
4
+ }
5
+ let options = [];
6
+ for (const obj of objs) {
7
+ options.push({ value: obj[valueProp], label: obj[labelProp] });
8
+ }
9
+ return options;
10
+ };
package/lib/esm/utils.js CHANGED
@@ -134,7 +134,7 @@ export const formatToString = (val, separator = " ", currency = "") => {
134
134
  };
135
135
  export const formatToStringCfa = (val) => {
136
136
  // return String(val).replace(/(.)(?=(\d{3})+$)/g, '$1 ') + ' CFA';
137
- return formatToString(val, " ", " CFA");
137
+ return formatToString(val, " ", " FCFA");
138
138
  };
139
139
  // const = reformatDates(fromDate: string, toDate: string) => {
140
140
  export const reformatDates = (fromDate, toDate) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.0.98",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",