@retailcrm/embed-ui-v1-components 0.9.4 → 0.9.6
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/host.cjs +196 -255
- package/dist/host.css +1 -0
- package/dist/host.js +197 -256
- package/dist/remote.cjs +12 -14
- package/dist/remote.d.ts +2 -7
- package/dist/remote.js +13 -15
- package/package.json +22 -29
- package/dist/host.d.ts +0 -750
package/dist/remote.cjs
CHANGED
|
@@ -228,15 +228,15 @@ function buildFormatLongFn(args) {
|
|
|
228
228
|
}
|
|
229
229
|
function buildLocalizeFn(args) {
|
|
230
230
|
return (value, options) => {
|
|
231
|
-
const context =
|
|
231
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
232
232
|
let valuesArray;
|
|
233
233
|
if (context === "formatting" && args.formattingValues) {
|
|
234
234
|
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
235
|
-
const width =
|
|
235
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
236
236
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
237
237
|
} else {
|
|
238
238
|
const defaultWidth = args.defaultWidth;
|
|
239
|
-
const width =
|
|
239
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
240
240
|
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
241
241
|
}
|
|
242
242
|
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
@@ -319,10 +319,9 @@ function toDate(argument, context) {
|
|
|
319
319
|
return constructFrom(context || argument, argument);
|
|
320
320
|
}
|
|
321
321
|
function startOfWeek(date, options) {
|
|
322
|
-
var _a, _b, _c, _d;
|
|
323
322
|
const defaultOptions2 = getDefaultOptions();
|
|
324
|
-
const weekStartsOn =
|
|
325
|
-
const _date = toDate(date, options
|
|
323
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
324
|
+
const _date = toDate(date, options?.in);
|
|
326
325
|
const day = _date.getDay();
|
|
327
326
|
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
328
327
|
_date.setDate(_date.getDate() - diff);
|
|
@@ -331,7 +330,7 @@ function startOfWeek(date, options) {
|
|
|
331
330
|
}
|
|
332
331
|
function isSameWeek(laterDate, earlierDate, options) {
|
|
333
332
|
const [laterDate_, earlierDate_] = normalizeDates(
|
|
334
|
-
options
|
|
333
|
+
options?.in,
|
|
335
334
|
laterDate,
|
|
336
335
|
earlierDate
|
|
337
336
|
);
|
|
@@ -410,7 +409,7 @@ const formatDistance$2 = (token, count, options) => {
|
|
|
410
409
|
} else {
|
|
411
410
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
412
411
|
}
|
|
413
|
-
if (options
|
|
412
|
+
if (options?.addSuffix) {
|
|
414
413
|
if (options.comparison && options.comparison > 0) {
|
|
415
414
|
return "in " + result;
|
|
416
415
|
} else {
|
|
@@ -822,7 +821,7 @@ const formatDistance$1 = (token, count, options) => {
|
|
|
822
821
|
} else {
|
|
823
822
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
824
823
|
}
|
|
825
|
-
if (options
|
|
824
|
+
if (options?.addSuffix) {
|
|
826
825
|
if (options.comparison && options.comparison > 0) {
|
|
827
826
|
return "en " + result;
|
|
828
827
|
} else {
|
|
@@ -1186,7 +1185,7 @@ function declension(scheme, count) {
|
|
|
1186
1185
|
}
|
|
1187
1186
|
function buildLocalizeTokenFn(scheme) {
|
|
1188
1187
|
return (count, options) => {
|
|
1189
|
-
if (options
|
|
1188
|
+
if (options?.addSuffix) {
|
|
1190
1189
|
if (options.comparison && options.comparison > 0) {
|
|
1191
1190
|
if (scheme.future) {
|
|
1192
1191
|
return declension(scheme.future, count);
|
|
@@ -1238,7 +1237,7 @@ const formatDistanceLocale = {
|
|
|
1238
1237
|
}
|
|
1239
1238
|
}),
|
|
1240
1239
|
halfAMinute: (_count, options) => {
|
|
1241
|
-
if (options
|
|
1240
|
+
if (options?.addSuffix) {
|
|
1242
1241
|
if (options.comparison && options.comparison > 0) {
|
|
1243
1242
|
return "через полминуты";
|
|
1244
1243
|
} else {
|
|
@@ -1646,7 +1645,7 @@ const formattingDayPeriodValues = {
|
|
|
1646
1645
|
};
|
|
1647
1646
|
const ordinalNumber = (dirtyNumber, options) => {
|
|
1648
1647
|
const number = Number(dirtyNumber);
|
|
1649
|
-
const unit = options
|
|
1648
|
+
const unit = options?.unit;
|
|
1650
1649
|
let suffix;
|
|
1651
1650
|
if (unit === "date") {
|
|
1652
1651
|
suffix = "-е";
|
|
@@ -1837,9 +1836,8 @@ const formatDateTime = (date, locale = void 0) => dateFns.format(date, "Pp", {
|
|
|
1837
1836
|
}[locale ?? detectLocale()] ?? enGB
|
|
1838
1837
|
});
|
|
1839
1838
|
function detectLocale() {
|
|
1840
|
-
var _a, _b, _c, _d;
|
|
1841
1839
|
const instance = vue.getCurrentInstance();
|
|
1842
|
-
const i18n =
|
|
1840
|
+
const i18n = instance?.appContext?.app?.config?.globalProperties?.$i18n;
|
|
1843
1841
|
if (i18n) {
|
|
1844
1842
|
try {
|
|
1845
1843
|
const locale = (typeof i18n.locale === "object" ? i18n.locale.value : i18n.locale) ?? "en-GB";
|
package/dist/remote.d.ts
CHANGED
|
@@ -1393,6 +1393,8 @@ declare type UiTextboxProperties = {
|
|
|
1393
1393
|
disabled?: boolean;
|
|
1394
1394
|
invalid?: boolean;
|
|
1395
1395
|
multiline?: boolean;
|
|
1396
|
+
rows?: number | `${number}`;
|
|
1397
|
+
cols?: number | `${number}`;
|
|
1396
1398
|
outlined?: boolean;
|
|
1397
1399
|
};
|
|
1398
1400
|
|
|
@@ -1659,10 +1661,3 @@ declare enum VARIANT {
|
|
|
1659
1661
|
}
|
|
1660
1662
|
|
|
1661
1663
|
export { }
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
declare global {
|
|
1665
|
-
interface Window {
|
|
1666
|
-
MSStream: unknown;
|
|
1667
|
-
}
|
|
1668
|
-
}
|
package/dist/remote.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h,
|
|
1
|
+
import { defineComponent, h, ref, inject, getCurrentInstance } from "vue";
|
|
2
2
|
import "@remote-ui/rpc";
|
|
3
3
|
import { preview } from "@retailcrm/image-preview";
|
|
4
4
|
import { format } from "date-fns";
|
|
@@ -226,15 +226,15 @@ function buildFormatLongFn(args) {
|
|
|
226
226
|
}
|
|
227
227
|
function buildLocalizeFn(args) {
|
|
228
228
|
return (value, options) => {
|
|
229
|
-
const context =
|
|
229
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
230
230
|
let valuesArray;
|
|
231
231
|
if (context === "formatting" && args.formattingValues) {
|
|
232
232
|
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
233
|
-
const width =
|
|
233
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
234
234
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
235
235
|
} else {
|
|
236
236
|
const defaultWidth = args.defaultWidth;
|
|
237
|
-
const width =
|
|
237
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
238
238
|
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
239
239
|
}
|
|
240
240
|
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
@@ -317,10 +317,9 @@ function toDate(argument, context) {
|
|
|
317
317
|
return constructFrom(context || argument, argument);
|
|
318
318
|
}
|
|
319
319
|
function startOfWeek(date, options) {
|
|
320
|
-
var _a, _b, _c, _d;
|
|
321
320
|
const defaultOptions2 = getDefaultOptions();
|
|
322
|
-
const weekStartsOn =
|
|
323
|
-
const _date = toDate(date, options
|
|
321
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
322
|
+
const _date = toDate(date, options?.in);
|
|
324
323
|
const day = _date.getDay();
|
|
325
324
|
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
326
325
|
_date.setDate(_date.getDate() - diff);
|
|
@@ -329,7 +328,7 @@ function startOfWeek(date, options) {
|
|
|
329
328
|
}
|
|
330
329
|
function isSameWeek(laterDate, earlierDate, options) {
|
|
331
330
|
const [laterDate_, earlierDate_] = normalizeDates(
|
|
332
|
-
options
|
|
331
|
+
options?.in,
|
|
333
332
|
laterDate,
|
|
334
333
|
earlierDate
|
|
335
334
|
);
|
|
@@ -408,7 +407,7 @@ const formatDistance$2 = (token, count, options) => {
|
|
|
408
407
|
} else {
|
|
409
408
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
410
409
|
}
|
|
411
|
-
if (options
|
|
410
|
+
if (options?.addSuffix) {
|
|
412
411
|
if (options.comparison && options.comparison > 0) {
|
|
413
412
|
return "in " + result;
|
|
414
413
|
} else {
|
|
@@ -820,7 +819,7 @@ const formatDistance$1 = (token, count, options) => {
|
|
|
820
819
|
} else {
|
|
821
820
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
822
821
|
}
|
|
823
|
-
if (options
|
|
822
|
+
if (options?.addSuffix) {
|
|
824
823
|
if (options.comparison && options.comparison > 0) {
|
|
825
824
|
return "en " + result;
|
|
826
825
|
} else {
|
|
@@ -1184,7 +1183,7 @@ function declension(scheme, count) {
|
|
|
1184
1183
|
}
|
|
1185
1184
|
function buildLocalizeTokenFn(scheme) {
|
|
1186
1185
|
return (count, options) => {
|
|
1187
|
-
if (options
|
|
1186
|
+
if (options?.addSuffix) {
|
|
1188
1187
|
if (options.comparison && options.comparison > 0) {
|
|
1189
1188
|
if (scheme.future) {
|
|
1190
1189
|
return declension(scheme.future, count);
|
|
@@ -1236,7 +1235,7 @@ const formatDistanceLocale = {
|
|
|
1236
1235
|
}
|
|
1237
1236
|
}),
|
|
1238
1237
|
halfAMinute: (_count, options) => {
|
|
1239
|
-
if (options
|
|
1238
|
+
if (options?.addSuffix) {
|
|
1240
1239
|
if (options.comparison && options.comparison > 0) {
|
|
1241
1240
|
return "через полминуты";
|
|
1242
1241
|
} else {
|
|
@@ -1644,7 +1643,7 @@ const formattingDayPeriodValues = {
|
|
|
1644
1643
|
};
|
|
1645
1644
|
const ordinalNumber = (dirtyNumber, options) => {
|
|
1646
1645
|
const number = Number(dirtyNumber);
|
|
1647
|
-
const unit = options
|
|
1646
|
+
const unit = options?.unit;
|
|
1648
1647
|
let suffix;
|
|
1649
1648
|
if (unit === "date") {
|
|
1650
1649
|
suffix = "-е";
|
|
@@ -1835,9 +1834,8 @@ const formatDateTime = (date, locale = void 0) => format(date, "Pp", {
|
|
|
1835
1834
|
}[locale ?? detectLocale()] ?? enGB
|
|
1836
1835
|
});
|
|
1837
1836
|
function detectLocale() {
|
|
1838
|
-
var _a, _b, _c, _d;
|
|
1839
1837
|
const instance = getCurrentInstance();
|
|
1840
|
-
const i18n =
|
|
1838
|
+
const i18n = instance?.appContext?.app?.config?.globalProperties?.$i18n;
|
|
1841
1839
|
if (i18n) {
|
|
1842
1840
|
try {
|
|
1843
1841
|
const locale = (typeof i18n.locale === "object" ? i18n.locale.value : i18n.locale) ?? "en-GB";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retailcrm/embed-ui-v1-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
7
7
|
"repository": "git@github.com:retailcrm/embed-ui.git",
|
|
@@ -54,46 +54,39 @@
|
|
|
54
54
|
"vue": "^3.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@omnicajs/vue-remote": "^0.2.
|
|
58
|
-
"@remote-ui/rpc": "^1.4.
|
|
57
|
+
"@omnicajs/vue-remote": "^0.2.9",
|
|
58
|
+
"@remote-ui/rpc": "^1.4.7",
|
|
59
59
|
"@retailcrm/image-preview": "^1.0.2",
|
|
60
60
|
"date-fns": "^4.1.0",
|
|
61
61
|
"lodash.isequal": "^4.5.0",
|
|
62
62
|
"vue3-perfect-scrollbar": "^1.6.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@storybook/addon-a11y": "^
|
|
66
|
-
"@storybook/addon-docs": "^
|
|
67
|
-
"@storybook/addon-
|
|
68
|
-
"@storybook/addon-
|
|
69
|
-
"@storybook/
|
|
70
|
-
"@storybook/
|
|
71
|
-
"@storybook/
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@storybook/theming": "^8.4.7",
|
|
76
|
-
"@storybook/types": "^8.4.7",
|
|
77
|
-
"@storybook/vue3": "^8.4.7",
|
|
78
|
-
"@storybook/vue3-vite": "^8.4.7",
|
|
79
|
-
"@types/lodash.isequal": "^4.5.6",
|
|
80
|
-
"@vitejs/plugin-vue": "^5.1.4",
|
|
81
|
-
"@vue/compiler-sfc": "^3.5.12",
|
|
65
|
+
"@storybook/addon-a11y": "^10.1.5",
|
|
66
|
+
"@storybook/addon-docs": "^10.1.5",
|
|
67
|
+
"@storybook/addon-links": "^10.1.5",
|
|
68
|
+
"@storybook/addon-themes": "^10.1.5",
|
|
69
|
+
"@storybook/builder-vite": "^10.1.5",
|
|
70
|
+
"@storybook/vue3": "^10.1.5",
|
|
71
|
+
"@storybook/vue3-vite": "^10.1.5",
|
|
72
|
+
"@types/lodash.isequal": "^4.5.8",
|
|
73
|
+
"@vitejs/plugin-vue": "^6.0.2",
|
|
74
|
+
"@vue/compiler-sfc": "^3.5.25",
|
|
82
75
|
"@vue/test-utils": "^2.4.6",
|
|
83
76
|
"@yandex/ymaps3-types": "^0.0.21",
|
|
84
|
-
"less": "^4.2
|
|
77
|
+
"less": "^4.4.2",
|
|
85
78
|
"react": "^18.3.1",
|
|
86
79
|
"react-dom": "^18.3.1",
|
|
87
80
|
"remark-gfm": "^4.0.0",
|
|
88
|
-
"storybook": "^
|
|
89
|
-
"tsx": "^4.
|
|
81
|
+
"storybook": "^10.1.5",
|
|
82
|
+
"tsx": "^4.21.0",
|
|
90
83
|
"typescript": "^5.9.3",
|
|
91
|
-
"uuid": "^
|
|
92
|
-
"vite": "^
|
|
93
|
-
"vite-plugin-dts": "^4.5.
|
|
84
|
+
"uuid": "^13.0.0",
|
|
85
|
+
"vite": "^7.2.7",
|
|
86
|
+
"vite-plugin-dts": "^4.5.4",
|
|
94
87
|
"vite-svg-loader": "^5.1.0",
|
|
95
|
-
"vitest": "^
|
|
96
|
-
"vue": "^3.5.
|
|
97
|
-
"vue-i18n": "10"
|
|
88
|
+
"vitest": "^4.0.15",
|
|
89
|
+
"vue": "^3.5.25",
|
|
90
|
+
"vue-i18n": "10.0.8"
|
|
98
91
|
}
|
|
99
92
|
}
|