meemup-library 1.2.7 → 1.2.9
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/dist/controllers/ApiController.d.ts +1 -1
- package/dist/controllers/ColorController.d.ts +13 -13
- package/dist/controllers/ColorController.js +11 -11
- package/dist/controllers/MoneyController.js +4 -1
- package/dist/controllers/OrderScreenController.d.ts +5 -5
- package/dist/controllers/PrintContentController.js +268 -268
- package/dist/controllers/ProductModalController.d.ts +16 -18
- package/dist/controllers/ProductModalController.js +6 -4
- package/dist/controllers/ZoneController.d.ts +7 -7
- package/dist/controllers/ZoneController.js +7 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/IExtra.d.ts +2 -2
- package/dist/interfaces/IExtra.js +16 -1
- package/dist/interfaces/IExtraItem.d.ts +2 -0
- package/dist/interfaces/IExtraItem.js +3 -1
- package/dist/interfaces/IPointOfSaleLocalSetting.js +1 -2
- package/dist/interfaces/IProduct.d.ts +2 -1
- package/dist/interfaces/IProductExtra.d.ts +3 -9
- package/dist/interfaces/IProductExtra.js +3 -1
- package/dist/interfaces/ISelectedExtraItem.d.ts +2 -2
- package/dist/interfaces/ISelectedProductExtra.js +1 -3
- package/dist/interfaces/IStore.d.ts +4 -4
- package/dist/interfaces/database/{IDProductDefaultExtra.d.ts → IProductDefaultExtra.d.ts} +2 -2
- package/dist/types/TBaseExtra.d.ts +2 -2
- package/package.json +29 -29
- package/dist/interfaces/database/IDExtra.d.ts +0 -16
- package/dist/interfaces/database/IDExtraItem.d.ts +0 -20
- package/dist/interfaces/database/IDExtraItem.js +0 -1
- package/dist/interfaces/database/IDProduct.d.ts +0 -57
- package/dist/interfaces/database/IDProduct.js +0 -1
- package/dist/interfaces/database/IDProductDefaultExtra.js +0 -1
- /package/dist/interfaces/database/{IDExtra.js → IProductDefaultExtra.js} +0 -0
|
@@ -5,7 +5,6 @@ import IDriverAccount from "../interfaces/IDriverAccount";
|
|
|
5
5
|
export default class ApiController {
|
|
6
6
|
account: IAccount | IDriverAccount;
|
|
7
7
|
constructor(account: IAccount | IDriverAccount);
|
|
8
|
-
private getCompanyId;
|
|
9
8
|
defaultHeader(authorization?: boolean): Promise<{
|
|
10
9
|
Authorization?: string | undefined;
|
|
11
10
|
companyId: string;
|
|
@@ -18,4 +17,5 @@ export default class ApiController {
|
|
|
18
17
|
getWithAuth(url: string, header?: any): Promise<IAnswer>;
|
|
19
18
|
get(url: string, header?: any): Promise<IAnswer>;
|
|
20
19
|
deleteWithAuth(url: string, header?: any): Promise<IAnswer>;
|
|
20
|
+
private getCompanyId;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import IPointOfSaleSetting from "../interfaces/IPointOfSaleSetting";
|
|
2
|
-
import
|
|
2
|
+
import IProduct from "../interfaces/IProduct";
|
|
3
3
|
/**
|
|
4
4
|
* کلاس ColorController برای مدیریت رنگها و تولید رنگ متن بر اساس رنگ پس زمینه استفاده میشود.
|
|
5
5
|
*/
|
|
@@ -11,10 +11,10 @@ declare class ColorController {
|
|
|
11
11
|
*/
|
|
12
12
|
generateContrastColorForHex(background_color: string): string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* متد generateContrastColorForRgba برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGBA استفاده میشود.
|
|
15
|
+
* @param rgba_color رنگ پس زمینه به صورت RGBA (رنگ، سبز، آبی، شفافیت).
|
|
16
|
+
* @returns رنگ متن متناسب (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
17
|
+
*/
|
|
18
18
|
generateContrastColorForRgba(rgba_color: string): string;
|
|
19
19
|
/**
|
|
20
20
|
* متد generateContrastColorForRgb برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGB استفاده میشود.
|
|
@@ -23,15 +23,15 @@ declare class ColorController {
|
|
|
23
23
|
*/
|
|
24
24
|
generateContrastColorForRgb(rgb_color: string): string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
* متد generateContrastColorForBackground برای تولید رنگ متن بر اساس رنگ پس زمینه مورد نظر استفاده میشود.
|
|
27
|
+
* اگر رنگ پس زمینه null یا "transparent" باشد، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
28
|
+
* در غیر این صورت، از سه متد generateContrastColorForRgb و generateContrastColorForRgba و generateContrastColorForHex برای تولید رنگ متن استفاده میشود.
|
|
29
|
+
* اگر در هیچکدام از سه متد مورد نظر نگنجید، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
30
|
+
* @param background_color رنگ پس زمینه به هر فرمتی که میتواند string یا null باشد.
|
|
31
|
+
* @returns رنگ متن متناظر (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
32
|
+
*/
|
|
33
33
|
generateContrastColorForBackground(background_color: string | null, default_text_color?: string): string;
|
|
34
|
-
generateColorForPosProduct(product:
|
|
34
|
+
generateColorForPosProduct(product: IProduct, setting: IPointOfSaleSetting, defaultBackgroundColor: any, defaultTextColor: any): {
|
|
35
35
|
backgroundColor: any;
|
|
36
36
|
textColor: any;
|
|
37
37
|
};
|
|
@@ -20,10 +20,10 @@ class ColorController {
|
|
|
20
20
|
return text_color;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* متد generateContrastColorForRgba برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGBA استفاده میشود.
|
|
24
|
+
* @param rgba_color رنگ پس زمینه به صورت RGBA (رنگ، سبز، آبی، شفافیت).
|
|
25
|
+
* @returns رنگ متن متناسب (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
26
|
+
*/
|
|
27
27
|
generateContrastColorForRgba(rgba_color) {
|
|
28
28
|
var _a;
|
|
29
29
|
// استخراج مقادیر R، G، B از RGBA
|
|
@@ -56,13 +56,13 @@ class ColorController {
|
|
|
56
56
|
return text_color;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
* متد generateContrastColorForBackground برای تولید رنگ متن بر اساس رنگ پس زمینه مورد نظر استفاده میشود.
|
|
60
|
+
* اگر رنگ پس زمینه null یا "transparent" باشد، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
61
|
+
* در غیر این صورت، از سه متد generateContrastColorForRgb و generateContrastColorForRgba و generateContrastColorForHex برای تولید رنگ متن استفاده میشود.
|
|
62
|
+
* اگر در هیچکدام از سه متد مورد نظر نگنجید، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
63
|
+
* @param background_color رنگ پس زمینه به هر فرمتی که میتواند string یا null باشد.
|
|
64
|
+
* @returns رنگ متن متناظر (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
65
|
+
*/
|
|
66
66
|
generateContrastColorForBackground(background_color, default_text_color = "#000") {
|
|
67
67
|
// اگر رنگ پس زمینه null یا "transparent" باشد، رنگ سیاه را برگردانید
|
|
68
68
|
if (background_color === null || background_color.trim().toLowerCase() === "transparent") {
|
|
@@ -23,7 +23,10 @@ export default new class MoneyController {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
format(money, currency = "$", preText = "") {
|
|
26
|
-
return `${preText}${currency}${Intl.NumberFormat("en-US", {
|
|
26
|
+
return `${preText}${currency}${Intl.NumberFormat("en-US", {
|
|
27
|
+
minimumFractionDigits: 2,
|
|
28
|
+
maximumFractionDigits: 2
|
|
29
|
+
}).format(this.round(money))}`;
|
|
27
30
|
}
|
|
28
31
|
sum(values) {
|
|
29
32
|
let sum = 0;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import IOrderScreenState from "../interfaces/IOrderScreenState";
|
|
2
2
|
import EnumOrderType from "../enums/EnumOrderType";
|
|
3
3
|
import IOrderItem from "../interfaces/order/IOrderItem";
|
|
4
|
-
import IDProduct from "../interfaces/database/IDProduct";
|
|
5
4
|
import ICategory from "../interfaces/ICategory";
|
|
5
|
+
import IProduct from "../interfaces/IProduct";
|
|
6
6
|
declare const _default: {
|
|
7
7
|
checkDayWeek: (index: number, weekDays: number) => boolean;
|
|
8
8
|
fetchCategories(categories: ICategory[]): ICategory[];
|
|
9
|
-
fetchProducts(arg: IOrderScreenState, products:
|
|
10
|
-
searchProduct(products:
|
|
11
|
-
productPrice(product:
|
|
12
|
-
productCountInOrder(product:
|
|
9
|
+
fetchProducts(arg: IOrderScreenState, products: IProduct[], categories: ICategory[]): IProduct[];
|
|
10
|
+
searchProduct(products: IProduct[], word: string): IProduct[];
|
|
11
|
+
productPrice(product: IProduct, orderType: EnumOrderType): number;
|
|
12
|
+
productCountInOrder(product: IProduct, items: IOrderItem[]): number;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|