sard 1.0.19 → 1.0.21
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/index.js +3 -3
- package/locale/index.js +2 -7
- package/locale/lang/fa-IR.d.ts +166 -0
- package/locale/lang/fa-IR.js +155 -0
- package/package.json +1 -1
- package/utils/index.js +3 -3
- package/utils/object.d.ts +5 -0
- package/utils/object.js +20 -1
- package/utils/string.d.ts +6 -0
- package/utils/string.js +13 -1
package/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { chooseFile, getFileName, imageDataToDataURL, isFileUrl, isImageFile, is
|
|
|
6
6
|
import { isBoolean, isConfigObject, isDate, isEmptyArray, isFunction, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isString, isUndefined } from "./utils/is.js";
|
|
7
7
|
import { addUnit, debounce, getPageRange, isEmptyBinding, isEmptyValue, isRenderVisible, isVisibleEmpty, noop, sleep, splitUnit, throttle } from "./utils/utils.js";
|
|
8
8
|
import { ALPHANUMERIC_CHARS, ECLList, qrcode } from "./utils/qrcode.js";
|
|
9
|
-
import { chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap } from "./utils/object.js";
|
|
9
|
+
import { assignDeep, chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap } from "./utils/object.js";
|
|
10
10
|
import { arrayEqual, arrayMove, shuffle, spreadEach, toArray } from "./utils/array.js";
|
|
11
|
-
import { addSeparator, camelCase, capitalize, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst } from "./utils/string.js";
|
|
11
|
+
import { addSeparator, camelCase, capitalize, interpolate, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst } from "./utils/string.js";
|
|
12
12
|
import { getAspectFillSize, getAspectFitSize, getRotatedRect, getScrollIntoViewValue, getTouchPoint, getTransformOrigin, getTwoPointsDistance, isRectEqual, isSizeEqual, matchScrollVisible, scrollToTarget } from "./utils/geometry.js";
|
|
13
13
|
import { getDampingValue, getInBoundValue, getOverflowRangeInArea, getRectDampingValue } from "./utils/physics.js";
|
|
14
14
|
import { createInertialAnimate } from "./utils/inertialAnimate.js";
|
|
@@ -217,4 +217,4 @@ function prepareEnvironment() {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
|
-
export { ADD_SWIPER_CONTEXT_KEY, ALPHANUMERIC_CHARS, Accordion, AccordionItem, ActionSheet, ActionSheetItem, Alert, Avatar, AvatarGroup, BackTop, Badge, Barcode, BarcodeFormatList, BarcodeTextPositionList, Button, Calendar, CalendarInput, CalendarPopout, CancelError, Card, Cascader, CascaderInput, CascaderPopout, Checkbox, CheckboxGroup, CheckboxInput, CheckboxPopout, Col, Collapse, ColorPicker, ColorPickerInput, ColorPickerPopout, Compact, CoolIcon, CountDown, CountTo, CropImage, DateStrip, DatetimePicker, DatetimePickerInput, DatetimePickerPopout, DatetimeRangePicker, DatetimeRangePickerInput, DatetimeRangePickerPopout, Descriptions, DescriptionsItem, Dialog, Divider, Dnd, DndHandle, DndItem, Dropdown, DropdownItem, ECLList, Ellipsis, Empty, Fab, FabItem, Flex, FloatingBubble, FloatingPanel, Form, FormItem, FormItemPlain, FormPlain, Friction, Grid, GridItem, Image, Indexes, IndexesAnchor, IndexesNav, Input, Keyboard, KeyboardPopout, List, ListItem, LoadMore, LoadMoreStatus, Loading, Marquee, Menu, MenuItem, Motion, Navbar, NavbarItem, NavbarPit, NoticeBar, Notify, OnlyChild, Overlay, Pagination, PasswordInput, Picker, PickerInput, PickerPopout, PickerView, PickerViewColumn, Popout, PopoutInput, Popover, Popup, PreviewImage, ProgressBar, ProgressCircle, PullDownRefresh, PuzzleVerify, Qrcode, REMOVE_SWIPER_CONTEXT_KEY, Radio, RadioGroup, RadioInput, RadioPopout, Rate, ReadMore, Result, RotateVerify, Row, SWIPER_AUTO_HEIGHT_KEY, ScrollList, ScrollSpy, ScrollSpyAnchor, Search, Segmented, SegmentedItem, Select, SelectInput, SelectOption, SelectOptionGroup, SelectPopout, ShareSheet, ShareSheetIcon, ShareSheetItem, ShareSheetRow, Sidebar, SidebarItem, Signature, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonParagraph, SkeletonTitle, SlideVerify, Slider, Spring, StatusBar, Step, Stepper, Steps, Sticky, StickyBox, SwipeAction, Swiper, SwiperItem, Switch, Tab, Tabbar, TabbarItem, TabbarPit, Table, Tabs, Tag, Text, Timeline, TimelineItem, Toast, Tree, TreeBranch, TreeNode, Upload, UploadPreview, Waterfall, WaterfallItem, WaterfallLoad, Watermark, actionSheet, addSeparator, addUnit, arrayEqual, arrayMove, autoUpdate, barcode, baseLunarYear, calculateBarcodeLayout, camelCase, capitalize, chainGet, chainSet, checkRtl, chooseFile, clamp, clipboard, computePosition, createActionSheet, createBem, createBemStruct, createCropImage, createDialog, createInertialAnimate, createNotify, createPreviewImage, createToast, cropImage, cssVar, cssVarName, currentLocale, debounce, deepClone, defaultBemConfig, defaultColorPickerPresets, defaultColorPickerValue, defaultOptionKeys, defineSetupFnComponent, dialog, earthlyBranches, enhanceComponent, extend, flatVNode, flexGap, formatColor, formatDate, formatNumber, formatTime, getAllImperatives, getAspectFillSize, getAspectFitSize, getAvailableImperative, getCurrentTime, getDampingValue, getDayOfYear, getDaysAfterLastDay, getDaysBeforeFirstDay, getDaysInMonth, getDaysSinceUnixEpoch, getDecimalsLength, getFileName, getFirstDayWeekday, getGridCenterSize, getGridIndex, getGridPrizeCount, getImperatives, getInBoundValue, getLeafNodes, getLunarDayName, getLunarHourName, getLunarLeapMonth, getLunarLeapMonthDays, getLunarMonthDays, getLunarMonthName, getLunarYearDays, getLunarYearName, getNextMonthDate, getNextMonthHeadDays, getNodeLevel, getOverflowRangeInArea, getPageRange, getPrevMonthDate, getPrevMonthTailDays, getPreviewColor, getRectDampingValue, getRotatedRect, getScrollIntoViewValue, getScrollTop, getTouchPoint, getTransformOrigin, getTreeCheckedKeys, getTreeHalfCheckedKeys, getTwoPointsDistance, heavenlyStems, hslToHsv, hslToHwb, hslToRgb, hsvToHsl, hwbToHsl, imageDataToDataURL, inRange, initializeCheckNodes, installer, isBoolean, isCancelError, isColorScheme, isConfigObject, isDate, isEmptyArray, isEmptyBinding, isEmptyValue, isFileUrl, isFunction, isImageFile, isImageUrl, isKorean, isLeapYear, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isRectEqual, isRenderVisible, isSizeEqual, isString, isUndefined, isVideoFile, isVideoUrl, isVisibleEmpty, kebabCase, loadImage, localeContextKey, logError, looseToNumber, lowerFirst, lunarDayNames, lunarInfo, lunarMonthNames, lunarToSolar, lunarYearNames, mapTreeToGrid, matchScrollVisible, measureTextWidth, minmaxDate, mround, nestedToMulti, noop, normalizeBarcodeOptions, normalizeHsla, normalizeHsva, notify, omit, omitFormPopoutProps, parseColor, parseDate, partition, partitionPopoutInputProps, pascalCase, pick, plateEnglishLetterKeys, plateProvinceKeys, plateSuffixKeys, popupManager, prepareEnvironment, previewImage, provideColorScheme, provideLocale, qrcode, random, reactiveComputed, readFileContent, rgbToHsl, round, safeAreaInsets, scrollToTarget, setCheckedRecursively, setLocale, shuffle, sleep, snakeCase, solarToLunar, splitUnit, spreadEach, springFestivals, throttle, toArray, toDate, toDateNumber, toDateString, toMonthNumber, toReactive, toTouchEvent, toast, treeToMap, uniqid, updateAncestorsChecked, upperFirst, useClickOutside, useColorScheme, useComposition, useCountDown, useDragPinch, useElementBackTop, useElementScroll, useFormContext, useFormItem, useFormItemContext, useFormPopout, useImperative, useInPopup, useIndeterminate, useInitialVelocity, useIntersectionObserver, useKeyList, useLocale, useLockScroll, useLuckyDraw, useLuckyGrid, useLuckyWheel, useMotioning, useOptionKeys, usePageBackTop, usePageScroll, usePointerDown, usePopoutInput, usePopper, usePopupEnter, usePopupVisibleHookProvide, useReachBottom, useResizeObserver, useRtl, useScrollSide, useScrollSpy, useScroller, useSimulatedClick, useSimulatedDblClick, useSimulatedPress, useSingleTask, useSlotMachine, useStopMovedClick, useTimeout, useTimeoutLoading, useTranslate, useTranslateWithPrefix, useWindowResize, useZIndex, walkAncestor, walkDescendant, walkNodes, windowInfo, withResolvers };
|
|
220
|
+
export { ADD_SWIPER_CONTEXT_KEY, ALPHANUMERIC_CHARS, Accordion, AccordionItem, ActionSheet, ActionSheetItem, Alert, Avatar, AvatarGroup, BackTop, Badge, Barcode, BarcodeFormatList, BarcodeTextPositionList, Button, Calendar, CalendarInput, CalendarPopout, CancelError, Card, Cascader, CascaderInput, CascaderPopout, Checkbox, CheckboxGroup, CheckboxInput, CheckboxPopout, Col, Collapse, ColorPicker, ColorPickerInput, ColorPickerPopout, Compact, CoolIcon, CountDown, CountTo, CropImage, DateStrip, DatetimePicker, DatetimePickerInput, DatetimePickerPopout, DatetimeRangePicker, DatetimeRangePickerInput, DatetimeRangePickerPopout, Descriptions, DescriptionsItem, Dialog, Divider, Dnd, DndHandle, DndItem, Dropdown, DropdownItem, ECLList, Ellipsis, Empty, Fab, FabItem, Flex, FloatingBubble, FloatingPanel, Form, FormItem, FormItemPlain, FormPlain, Friction, Grid, GridItem, Image, Indexes, IndexesAnchor, IndexesNav, Input, Keyboard, KeyboardPopout, List, ListItem, LoadMore, LoadMoreStatus, Loading, Marquee, Menu, MenuItem, Motion, Navbar, NavbarItem, NavbarPit, NoticeBar, Notify, OnlyChild, Overlay, Pagination, PasswordInput, Picker, PickerInput, PickerPopout, PickerView, PickerViewColumn, Popout, PopoutInput, Popover, Popup, PreviewImage, ProgressBar, ProgressCircle, PullDownRefresh, PuzzleVerify, Qrcode, REMOVE_SWIPER_CONTEXT_KEY, Radio, RadioGroup, RadioInput, RadioPopout, Rate, ReadMore, Result, RotateVerify, Row, SWIPER_AUTO_HEIGHT_KEY, ScrollList, ScrollSpy, ScrollSpyAnchor, Search, Segmented, SegmentedItem, Select, SelectInput, SelectOption, SelectOptionGroup, SelectPopout, ShareSheet, ShareSheetIcon, ShareSheetItem, ShareSheetRow, Sidebar, SidebarItem, Signature, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonParagraph, SkeletonTitle, SlideVerify, Slider, Spring, StatusBar, Step, Stepper, Steps, Sticky, StickyBox, SwipeAction, Swiper, SwiperItem, Switch, Tab, Tabbar, TabbarItem, TabbarPit, Table, Tabs, Tag, Text, Timeline, TimelineItem, Toast, Tree, TreeBranch, TreeNode, Upload, UploadPreview, Waterfall, WaterfallItem, WaterfallLoad, Watermark, actionSheet, addSeparator, addUnit, arrayEqual, arrayMove, assignDeep, autoUpdate, barcode, baseLunarYear, calculateBarcodeLayout, camelCase, capitalize, chainGet, chainSet, checkRtl, chooseFile, clamp, clipboard, computePosition, createActionSheet, createBem, createBemStruct, createCropImage, createDialog, createInertialAnimate, createNotify, createPreviewImage, createToast, cropImage, cssVar, cssVarName, currentLocale, debounce, deepClone, defaultBemConfig, defaultColorPickerPresets, defaultColorPickerValue, defaultOptionKeys, defineSetupFnComponent, dialog, earthlyBranches, enhanceComponent, extend, flatVNode, flexGap, formatColor, formatDate, formatNumber, formatTime, getAllImperatives, getAspectFillSize, getAspectFitSize, getAvailableImperative, getCurrentTime, getDampingValue, getDayOfYear, getDaysAfterLastDay, getDaysBeforeFirstDay, getDaysInMonth, getDaysSinceUnixEpoch, getDecimalsLength, getFileName, getFirstDayWeekday, getGridCenterSize, getGridIndex, getGridPrizeCount, getImperatives, getInBoundValue, getLeafNodes, getLunarDayName, getLunarHourName, getLunarLeapMonth, getLunarLeapMonthDays, getLunarMonthDays, getLunarMonthName, getLunarYearDays, getLunarYearName, getNextMonthDate, getNextMonthHeadDays, getNodeLevel, getOverflowRangeInArea, getPageRange, getPrevMonthDate, getPrevMonthTailDays, getPreviewColor, getRectDampingValue, getRotatedRect, getScrollIntoViewValue, getScrollTop, getTouchPoint, getTransformOrigin, getTreeCheckedKeys, getTreeHalfCheckedKeys, getTwoPointsDistance, heavenlyStems, hslToHsv, hslToHwb, hslToRgb, hsvToHsl, hwbToHsl, imageDataToDataURL, inRange, initializeCheckNodes, installer, interpolate, isBoolean, isCancelError, isColorScheme, isConfigObject, isDate, isEmptyArray, isEmptyBinding, isEmptyValue, isFileUrl, isFunction, isImageFile, isImageUrl, isKorean, isLeapYear, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isRectEqual, isRenderVisible, isSizeEqual, isString, isUndefined, isVideoFile, isVideoUrl, isVisibleEmpty, kebabCase, loadImage, localeContextKey, logError, looseToNumber, lowerFirst, lunarDayNames, lunarInfo, lunarMonthNames, lunarToSolar, lunarYearNames, mapTreeToGrid, matchScrollVisible, measureTextWidth, minmaxDate, mround, nestedToMulti, noop, normalizeBarcodeOptions, normalizeHsla, normalizeHsva, notify, omit, omitFormPopoutProps, parseColor, parseDate, partition, partitionPopoutInputProps, pascalCase, pick, plateEnglishLetterKeys, plateProvinceKeys, plateSuffixKeys, popupManager, prepareEnvironment, previewImage, provideColorScheme, provideLocale, qrcode, random, reactiveComputed, readFileContent, rgbToHsl, round, safeAreaInsets, scrollToTarget, setCheckedRecursively, setLocale, shuffle, sleep, snakeCase, solarToLunar, splitUnit, spreadEach, springFestivals, throttle, toArray, toDate, toDateNumber, toDateString, toMonthNumber, toReactive, toTouchEvent, toast, treeToMap, uniqid, updateAncestorsChecked, upperFirst, useClickOutside, useColorScheme, useComposition, useCountDown, useDragPinch, useElementBackTop, useElementScroll, useFormContext, useFormItem, useFormItemContext, useFormPopout, useImperative, useInPopup, useIndeterminate, useInitialVelocity, useIntersectionObserver, useKeyList, useLocale, useLockScroll, useLuckyDraw, useLuckyGrid, useLuckyWheel, useMotioning, useOptionKeys, usePageBackTop, usePageScroll, usePointerDown, usePopoutInput, usePopper, usePopupEnter, usePopupVisibleHookProvide, useReachBottom, useResizeObserver, useRtl, useScrollSide, useScrollSpy, useScroller, useSimulatedClick, useSimulatedDblClick, useSimulatedPress, useSingleTask, useSlotMachine, useStopMovedClick, useTimeout, useTimeoutLoading, useTranslate, useTranslateWithPrefix, useWindowResize, useZIndex, walkAncestor, walkDescendant, walkNodes, windowInfo, withResolvers };
|
package/locale/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { chainGet } from "../utils/object.js";
|
|
2
|
+
import { interpolate } from "../utils/string.js";
|
|
2
3
|
import zh_CN_default from "./lang/zh-CN.js";
|
|
3
4
|
import { computed, inject, ref, shallowRef, watch } from "vue";
|
|
4
5
|
//#region packages/sard/locale/index.ts
|
|
@@ -11,13 +12,7 @@ function useTranslate(prefix = "") {
|
|
|
11
12
|
const chain = typeof chainOrData === "string" ? prefix ? prefix + "." + chainOrData : chainOrData : prefix;
|
|
12
13
|
data = chainOrData && typeof chainOrData === "object" ? chainOrData : data;
|
|
13
14
|
const result = chainGet(locale.value, chain);
|
|
14
|
-
if (typeof result === "string")
|
|
15
|
-
if (data) return result.replace(/\{([^}]*)\}/g, (match, p1) => {
|
|
16
|
-
const value = data[p1];
|
|
17
|
-
return value != null ? String(value) : match;
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
15
|
+
if (typeof result === "string") return data ? interpolate(result, data) : result;
|
|
21
16
|
return chain;
|
|
22
17
|
};
|
|
23
18
|
const select = (chain) => {
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
_sard: {
|
|
3
|
+
actionSheet: {
|
|
4
|
+
cancel: string;
|
|
5
|
+
};
|
|
6
|
+
calendar: {
|
|
7
|
+
weeks: {
|
|
8
|
+
0: string;
|
|
9
|
+
1: string;
|
|
10
|
+
2: string;
|
|
11
|
+
3: string;
|
|
12
|
+
4: string;
|
|
13
|
+
5: string;
|
|
14
|
+
6: string;
|
|
15
|
+
};
|
|
16
|
+
abbrWeeks: {
|
|
17
|
+
0: string;
|
|
18
|
+
1: string;
|
|
19
|
+
2: string;
|
|
20
|
+
3: string;
|
|
21
|
+
4: string;
|
|
22
|
+
5: string;
|
|
23
|
+
6: string;
|
|
24
|
+
};
|
|
25
|
+
fullWeeks: {
|
|
26
|
+
0: string;
|
|
27
|
+
1: string;
|
|
28
|
+
2: string;
|
|
29
|
+
3: string;
|
|
30
|
+
4: string;
|
|
31
|
+
5: string;
|
|
32
|
+
6: string;
|
|
33
|
+
};
|
|
34
|
+
monthTitle: string;
|
|
35
|
+
start: string;
|
|
36
|
+
end: string;
|
|
37
|
+
to: string;
|
|
38
|
+
multipleOutlet: string;
|
|
39
|
+
};
|
|
40
|
+
cascader: {
|
|
41
|
+
pleaseSelect: string;
|
|
42
|
+
error: string;
|
|
43
|
+
noData: string;
|
|
44
|
+
};
|
|
45
|
+
cropImage: {
|
|
46
|
+
confirm: string;
|
|
47
|
+
cancel: string;
|
|
48
|
+
};
|
|
49
|
+
datetimePicker: {
|
|
50
|
+
y: string;
|
|
51
|
+
M: string;
|
|
52
|
+
d: string;
|
|
53
|
+
h: string;
|
|
54
|
+
m: string;
|
|
55
|
+
s: string;
|
|
56
|
+
};
|
|
57
|
+
datetimeRangePickerInput: {
|
|
58
|
+
to: string;
|
|
59
|
+
};
|
|
60
|
+
dialog: {
|
|
61
|
+
confirm: string;
|
|
62
|
+
cancel: string;
|
|
63
|
+
};
|
|
64
|
+
empty: {
|
|
65
|
+
noData: string;
|
|
66
|
+
};
|
|
67
|
+
form: {
|
|
68
|
+
defaultValidateMessages: {
|
|
69
|
+
default: string;
|
|
70
|
+
required: string;
|
|
71
|
+
enum: string;
|
|
72
|
+
whitespace: string;
|
|
73
|
+
date: {
|
|
74
|
+
format: string;
|
|
75
|
+
parse: string;
|
|
76
|
+
invalid: string;
|
|
77
|
+
};
|
|
78
|
+
types: {
|
|
79
|
+
string: string;
|
|
80
|
+
function: string;
|
|
81
|
+
array: string;
|
|
82
|
+
object: string;
|
|
83
|
+
number: string;
|
|
84
|
+
date: string;
|
|
85
|
+
boolean: string;
|
|
86
|
+
integer: string;
|
|
87
|
+
float: string;
|
|
88
|
+
regexp: string;
|
|
89
|
+
email: string;
|
|
90
|
+
url: string;
|
|
91
|
+
hex: string;
|
|
92
|
+
};
|
|
93
|
+
string: {
|
|
94
|
+
len: string;
|
|
95
|
+
min: string;
|
|
96
|
+
max: string;
|
|
97
|
+
range: string;
|
|
98
|
+
};
|
|
99
|
+
number: {
|
|
100
|
+
len: string;
|
|
101
|
+
min: string;
|
|
102
|
+
max: string;
|
|
103
|
+
range: string;
|
|
104
|
+
};
|
|
105
|
+
array: {
|
|
106
|
+
len: string;
|
|
107
|
+
min: string;
|
|
108
|
+
max: string;
|
|
109
|
+
range: string;
|
|
110
|
+
};
|
|
111
|
+
pattern: {
|
|
112
|
+
mismatch: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
loadMore: {
|
|
117
|
+
incompleteText: string;
|
|
118
|
+
loadingText: string;
|
|
119
|
+
completeText: string;
|
|
120
|
+
errorText: string;
|
|
121
|
+
};
|
|
122
|
+
pagination: {
|
|
123
|
+
previous: string;
|
|
124
|
+
next: string;
|
|
125
|
+
};
|
|
126
|
+
popout: {
|
|
127
|
+
confirm: string;
|
|
128
|
+
cancel: string;
|
|
129
|
+
};
|
|
130
|
+
pullDownRefresh: {
|
|
131
|
+
unready: string;
|
|
132
|
+
ready: string;
|
|
133
|
+
loading: string;
|
|
134
|
+
doneSuccess: string;
|
|
135
|
+
doneFail: string;
|
|
136
|
+
};
|
|
137
|
+
readMore: {
|
|
138
|
+
fold: string;
|
|
139
|
+
unfold: string;
|
|
140
|
+
};
|
|
141
|
+
select: {
|
|
142
|
+
selected: string;
|
|
143
|
+
selectAll: string;
|
|
144
|
+
clearSelect: string;
|
|
145
|
+
};
|
|
146
|
+
shareSheet: {
|
|
147
|
+
cancel: string;
|
|
148
|
+
};
|
|
149
|
+
signature: {
|
|
150
|
+
confirm: string;
|
|
151
|
+
clear: string;
|
|
152
|
+
cancel: string;
|
|
153
|
+
};
|
|
154
|
+
tree: {
|
|
155
|
+
addSibling: string;
|
|
156
|
+
addChild: string;
|
|
157
|
+
addRoot: string;
|
|
158
|
+
removeNode: string;
|
|
159
|
+
edit: string;
|
|
160
|
+
please: string;
|
|
161
|
+
error: string;
|
|
162
|
+
noData: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export default _default;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
//#region packages/sard/locale/lang/fa-IR.ts
|
|
2
|
+
const formTypeTemplate = "{label} یک {type} معتبر نیست";
|
|
3
|
+
var fa_IR_default = { _sard: {
|
|
4
|
+
actionSheet: { cancel: "انصراف" },
|
|
5
|
+
calendar: {
|
|
6
|
+
weeks: {
|
|
7
|
+
0: "یکشنبه",
|
|
8
|
+
1: "دوشنبه",
|
|
9
|
+
2: "سهشنبه",
|
|
10
|
+
3: "چهارشنبه",
|
|
11
|
+
4: "پنجشنبه",
|
|
12
|
+
5: "جمعه",
|
|
13
|
+
6: "شنبه"
|
|
14
|
+
},
|
|
15
|
+
abbrWeeks: {
|
|
16
|
+
0: "یک",
|
|
17
|
+
1: "دو",
|
|
18
|
+
2: "سه",
|
|
19
|
+
3: "چهار",
|
|
20
|
+
4: "پنج",
|
|
21
|
+
5: "جمعه",
|
|
22
|
+
6: "شنبه"
|
|
23
|
+
},
|
|
24
|
+
fullWeeks: {
|
|
25
|
+
0: "یکشنبه",
|
|
26
|
+
1: "دوشنبه",
|
|
27
|
+
2: "سهشنبه",
|
|
28
|
+
3: "چهارشنبه",
|
|
29
|
+
4: "پنجشنبه",
|
|
30
|
+
5: "جمعه",
|
|
31
|
+
6: "شنبه"
|
|
32
|
+
},
|
|
33
|
+
monthTitle: "{year}/{month}",
|
|
34
|
+
start: "شروع",
|
|
35
|
+
end: "پایان",
|
|
36
|
+
to: "تا",
|
|
37
|
+
multipleOutlet: "{count} تاریخ انتخاب شده"
|
|
38
|
+
},
|
|
39
|
+
cascader: {
|
|
40
|
+
pleaseSelect: "لطفاً انتخاب کنید",
|
|
41
|
+
error: "درخواست ناموفق بود، برای بارگذاری مجدد کلیک کنید",
|
|
42
|
+
noData: "دادهای وجود ندارد"
|
|
43
|
+
},
|
|
44
|
+
cropImage: {
|
|
45
|
+
confirm: "تأیید",
|
|
46
|
+
cancel: "انصراف"
|
|
47
|
+
},
|
|
48
|
+
datetimePicker: {
|
|
49
|
+
y: "",
|
|
50
|
+
M: "",
|
|
51
|
+
d: "",
|
|
52
|
+
h: "",
|
|
53
|
+
m: "",
|
|
54
|
+
s: ""
|
|
55
|
+
},
|
|
56
|
+
datetimeRangePickerInput: { to: "تا" },
|
|
57
|
+
dialog: {
|
|
58
|
+
confirm: "تأیید",
|
|
59
|
+
cancel: "انصراف"
|
|
60
|
+
},
|
|
61
|
+
empty: { noData: "دادهای وجود ندارد" },
|
|
62
|
+
form: { defaultValidateMessages: {
|
|
63
|
+
default: "خطای اعتبارسنجی فیلد {label}",
|
|
64
|
+
required: "{label} الزامی است",
|
|
65
|
+
enum: "{label} باید یکی از [{enum}] باشد",
|
|
66
|
+
whitespace: "{label} نمیتواند خالی باشد",
|
|
67
|
+
date: {
|
|
68
|
+
format: "فرمت تاریخ {label} نامعتبر است",
|
|
69
|
+
parse: "{label} نمیتواند به تاریخ تبدیل شود",
|
|
70
|
+
invalid: "{label} تاریخ نامعتبر است"
|
|
71
|
+
},
|
|
72
|
+
types: {
|
|
73
|
+
string: formTypeTemplate,
|
|
74
|
+
function: formTypeTemplate,
|
|
75
|
+
array: formTypeTemplate,
|
|
76
|
+
object: formTypeTemplate,
|
|
77
|
+
number: formTypeTemplate,
|
|
78
|
+
date: formTypeTemplate,
|
|
79
|
+
boolean: formTypeTemplate,
|
|
80
|
+
integer: formTypeTemplate,
|
|
81
|
+
float: formTypeTemplate,
|
|
82
|
+
regexp: formTypeTemplate,
|
|
83
|
+
email: formTypeTemplate,
|
|
84
|
+
url: formTypeTemplate,
|
|
85
|
+
hex: formTypeTemplate
|
|
86
|
+
},
|
|
87
|
+
string: {
|
|
88
|
+
len: "{label} باید {len} کاراکتر باشد",
|
|
89
|
+
min: "{label} باید حداقل {min} کاراکتر باشد",
|
|
90
|
+
max: "{label} باید حداکثر {max} کاراکتر باشد",
|
|
91
|
+
range: "{label} باید بین {min}-{max} کاراکتر باشد"
|
|
92
|
+
},
|
|
93
|
+
number: {
|
|
94
|
+
len: "{label} باید برابر {len} باشد",
|
|
95
|
+
min: "{label} باید حداقل {min} باشد",
|
|
96
|
+
max: "{label} باید حداکثر {max} باشد",
|
|
97
|
+
range: "{label} باید بین {min}-{max} باشد"
|
|
98
|
+
},
|
|
99
|
+
array: {
|
|
100
|
+
len: "باید {len} {label} باشد",
|
|
101
|
+
min: "حداقل {min} {label}",
|
|
102
|
+
max: "حداکثر {max} {label}",
|
|
103
|
+
range: "تعداد {label} باید بین {min}-{max} باشد"
|
|
104
|
+
},
|
|
105
|
+
pattern: { mismatch: "{label} با الگوی {pattern} مطابقت ندارد" }
|
|
106
|
+
} },
|
|
107
|
+
loadMore: {
|
|
108
|
+
incompleteText: "برای نمایش موارد بیشتر کلیک کنید",
|
|
109
|
+
loadingText: "در حال بارگذاری...",
|
|
110
|
+
completeText: "مورد دیگری وجود ندارد",
|
|
111
|
+
errorText: "درخواست ناموفق بود، برای بارگذاری مجدد کلیک کنید"
|
|
112
|
+
},
|
|
113
|
+
pagination: {
|
|
114
|
+
previous: "قبلی",
|
|
115
|
+
next: "بعدی"
|
|
116
|
+
},
|
|
117
|
+
popout: {
|
|
118
|
+
confirm: "تأیید",
|
|
119
|
+
cancel: "انصراف"
|
|
120
|
+
},
|
|
121
|
+
pullDownRefresh: {
|
|
122
|
+
unready: "برای تازهسازی به پایین بکشید",
|
|
123
|
+
ready: "برای تازهسازی رها کنید",
|
|
124
|
+
loading: "در حال بارگذاری...",
|
|
125
|
+
doneSuccess: "تازهسازی با موفقیت انجام شد",
|
|
126
|
+
doneFail: "تازهسازی ناموفق بود"
|
|
127
|
+
},
|
|
128
|
+
readMore: {
|
|
129
|
+
fold: "جمعکردن",
|
|
130
|
+
unfold: "بازکردن"
|
|
131
|
+
},
|
|
132
|
+
select: {
|
|
133
|
+
selected: "{num} مورد انتخاب شده",
|
|
134
|
+
selectAll: "انتخاب همه",
|
|
135
|
+
clearSelect: "پاککردن انتخاب"
|
|
136
|
+
},
|
|
137
|
+
shareSheet: { cancel: "انصراف" },
|
|
138
|
+
signature: {
|
|
139
|
+
confirm: "تأیید",
|
|
140
|
+
clear: "پاککردن",
|
|
141
|
+
cancel: "انصراف"
|
|
142
|
+
},
|
|
143
|
+
tree: {
|
|
144
|
+
addSibling: "افزودن گره همسطح",
|
|
145
|
+
addChild: "افزودن گره فرزند",
|
|
146
|
+
addRoot: "افزودن گره ریشه",
|
|
147
|
+
removeNode: "حذف گره",
|
|
148
|
+
edit: "ویرایش گره",
|
|
149
|
+
please: "لطفاً عنوان را وارد کنید",
|
|
150
|
+
error: "درخواست ناموفق بود، برای بارگذاری مجدد کلیک کنید",
|
|
151
|
+
noData: "دادهای وجود ندارد"
|
|
152
|
+
}
|
|
153
|
+
} };
|
|
154
|
+
//#endregion
|
|
155
|
+
export { fa_IR_default as default };
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { chooseFile, getFileName, imageDataToDataURL, isFileUrl, isImageFile, is
|
|
|
6
6
|
import { isBoolean, isConfigObject, isDate, isEmptyArray, isFunction, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isString, isUndefined } from "./is.js";
|
|
7
7
|
import { addUnit, debounce, getPageRange, isEmptyBinding, isEmptyValue, isRenderVisible, isVisibleEmpty, noop, sleep, splitUnit, throttle } from "./utils.js";
|
|
8
8
|
import { ALPHANUMERIC_CHARS, ECLList, qrcode } from "./qrcode.js";
|
|
9
|
-
import { chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap } from "./object.js";
|
|
9
|
+
import { assignDeep, chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap } from "./object.js";
|
|
10
10
|
import { arrayEqual, arrayMove, shuffle, spreadEach, toArray } from "./array.js";
|
|
11
|
-
import { addSeparator, camelCase, capitalize, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst } from "./string.js";
|
|
11
|
+
import { addSeparator, camelCase, capitalize, interpolate, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst } from "./string.js";
|
|
12
12
|
import { getAspectFillSize, getAspectFitSize, getRotatedRect, getScrollIntoViewValue, getTouchPoint, getTransformOrigin, getTwoPointsDistance, isRectEqual, isSizeEqual, matchScrollVisible, scrollToTarget } from "./geometry.js";
|
|
13
13
|
import { getDampingValue, getInBoundValue, getOverflowRangeInArea, getRectDampingValue } from "./physics.js";
|
|
14
14
|
import { createInertialAnimate } from "./inertialAnimate.js";
|
|
@@ -24,4 +24,4 @@ import { Friction } from "./scroller/Friction.js";
|
|
|
24
24
|
import { Spring } from "./scroller/Spring.js";
|
|
25
25
|
import { withResolvers } from "./polyfill.js";
|
|
26
26
|
import { useScroller } from "./scroller/useScroller.js";
|
|
27
|
-
export { ALPHANUMERIC_CHARS, BarcodeFormatList, BarcodeTextPositionList, ECLList, Friction, OnlyChild, Spring, addSeparator, addUnit, arrayEqual, arrayMove, barcode, baseLunarYear, calculateBarcodeLayout, camelCase, capitalize, chainGet, chainSet, checkRtl, chooseFile, clamp, clipboard, createBem, createBemStruct, createInertialAnimate, cssVar, cssVarName, debounce, deepClone, defaultBemConfig, defaultColorPickerPresets, defaultColorPickerValue, defineSetupFnComponent, earthlyBranches, enhanceComponent, extend, flatVNode, formatColor, formatDate, formatNumber, getAspectFillSize, getAspectFitSize, getDampingValue, getDayOfYear, getDaysAfterLastDay, getDaysBeforeFirstDay, getDaysInMonth, getDaysSinceUnixEpoch, getDecimalsLength, getFileName, getFirstDayWeekday, getInBoundValue, getLeafNodes, getLunarDayName, getLunarHourName, getLunarLeapMonth, getLunarLeapMonthDays, getLunarMonthDays, getLunarMonthName, getLunarYearDays, getLunarYearName, getNextMonthDate, getNextMonthHeadDays, getNodeLevel, getOverflowRangeInArea, getPageRange, getPrevMonthDate, getPrevMonthTailDays, getPreviewColor, getRectDampingValue, getRotatedRect, getScrollIntoViewValue, getScrollTop, getTouchPoint, getTransformOrigin, getTreeCheckedKeys, getTreeHalfCheckedKeys, getTwoPointsDistance, heavenlyStems, hslToHsv, hslToHwb, hslToRgb, hsvToHsl, hwbToHsl, imageDataToDataURL, inRange, initializeCheckNodes, isBoolean, isConfigObject, isDate, isEmptyArray, isEmptyBinding, isEmptyValue, isFileUrl, isFunction, isImageFile, isImageUrl, isKorean, isLeapYear, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isRectEqual, isRenderVisible, isSizeEqual, isString, isUndefined, isVideoFile, isVideoUrl, isVisibleEmpty, kebabCase, loadImage, logError, looseToNumber, lowerFirst, lunarDayNames, lunarInfo, lunarMonthNames, lunarToSolar, lunarYearNames, mapTreeToGrid, matchScrollVisible, measureTextWidth, minmaxDate, mround, nestedToMulti, noop, normalizeBarcodeOptions, normalizeHsla, normalizeHsva, omit, parseColor, parseDate, partition, pascalCase, pick, qrcode, random, readFileContent, rgbToHsl, round, scrollToTarget, setCheckedRecursively, shuffle, sleep, snakeCase, solarToLunar, splitUnit, spreadEach, springFestivals, throttle, toArray, toDate, toDateNumber, toDateString, toMonthNumber, toTouchEvent, treeToMap, uniqid, updateAncestorsChecked, upperFirst, useScroller, walkAncestor, walkDescendant, walkNodes, withResolvers };
|
|
27
|
+
export { ALPHANUMERIC_CHARS, BarcodeFormatList, BarcodeTextPositionList, ECLList, Friction, OnlyChild, Spring, addSeparator, addUnit, arrayEqual, arrayMove, assignDeep, barcode, baseLunarYear, calculateBarcodeLayout, camelCase, capitalize, chainGet, chainSet, checkRtl, chooseFile, clamp, clipboard, createBem, createBemStruct, createInertialAnimate, cssVar, cssVarName, debounce, deepClone, defaultBemConfig, defaultColorPickerPresets, defaultColorPickerValue, defineSetupFnComponent, earthlyBranches, enhanceComponent, extend, flatVNode, formatColor, formatDate, formatNumber, getAspectFillSize, getAspectFitSize, getDampingValue, getDayOfYear, getDaysAfterLastDay, getDaysBeforeFirstDay, getDaysInMonth, getDaysSinceUnixEpoch, getDecimalsLength, getFileName, getFirstDayWeekday, getInBoundValue, getLeafNodes, getLunarDayName, getLunarHourName, getLunarLeapMonth, getLunarLeapMonthDays, getLunarMonthDays, getLunarMonthName, getLunarYearDays, getLunarYearName, getNextMonthDate, getNextMonthHeadDays, getNodeLevel, getOverflowRangeInArea, getPageRange, getPrevMonthDate, getPrevMonthTailDays, getPreviewColor, getRectDampingValue, getRotatedRect, getScrollIntoViewValue, getScrollTop, getTouchPoint, getTransformOrigin, getTreeCheckedKeys, getTreeHalfCheckedKeys, getTwoPointsDistance, heavenlyStems, hslToHsv, hslToHwb, hslToRgb, hsvToHsl, hwbToHsl, imageDataToDataURL, inRange, initializeCheckNodes, interpolate, isBoolean, isConfigObject, isDate, isEmptyArray, isEmptyBinding, isEmptyValue, isFileUrl, isFunction, isImageFile, isImageUrl, isKorean, isLeapYear, isNoEmptyArray, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isRectEqual, isRenderVisible, isSizeEqual, isString, isUndefined, isVideoFile, isVideoUrl, isVisibleEmpty, kebabCase, loadImage, logError, looseToNumber, lowerFirst, lunarDayNames, lunarInfo, lunarMonthNames, lunarToSolar, lunarYearNames, mapTreeToGrid, matchScrollVisible, measureTextWidth, minmaxDate, mround, nestedToMulti, noop, normalizeBarcodeOptions, normalizeHsla, normalizeHsva, omit, parseColor, parseDate, partition, pascalCase, pick, qrcode, random, readFileContent, rgbToHsl, round, scrollToTarget, setCheckedRecursively, shuffle, sleep, snakeCase, solarToLunar, splitUnit, spreadEach, springFestivals, throttle, toArray, toDate, toDateNumber, toDateString, toMonthNumber, toTouchEvent, treeToMap, uniqid, updateAncestorsChecked, upperFirst, useScroller, walkAncestor, walkDescendant, walkNodes, withResolvers };
|
package/utils/object.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export declare function deepClone(target: any): any;
|
|
|
23
23
|
* 深拷贝其他对象到第一个对象
|
|
24
24
|
*/
|
|
25
25
|
export declare function extend(...args: any[]): any;
|
|
26
|
+
/**
|
|
27
|
+
* 深度合并多个对象并返回新对象:纯对象会递归合并,数组等其他非纯对象会被整体覆盖。
|
|
28
|
+
* 与 `extend` 不同,不会修改传入的任何对象。
|
|
29
|
+
*/
|
|
30
|
+
export declare function assignDeep(...objects: Record<string, any>[]): Record<string, any>;
|
|
26
31
|
export declare function treeToMap(tree: AnyObject[], keyName: string, childrenName: string, parentName: string): {
|
|
27
32
|
[p: string]: AnyObject;
|
|
28
33
|
};
|
package/utils/object.js
CHANGED
|
@@ -71,6 +71,25 @@ function extend(...args) {
|
|
|
71
71
|
}
|
|
72
72
|
return target;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* 深度合并多个对象并返回新对象:纯对象会递归合并,数组等其他非纯对象会被整体覆盖。
|
|
76
|
+
* 与 `extend` 不同,不会修改传入的任何对象。
|
|
77
|
+
*/
|
|
78
|
+
function assignDeep(...objects) {
|
|
79
|
+
const result = {};
|
|
80
|
+
for (const object of objects) {
|
|
81
|
+
if (object == null) continue;
|
|
82
|
+
Object.keys(object).forEach((key) => {
|
|
83
|
+
const value = object[key];
|
|
84
|
+
if (value === void 0) return;
|
|
85
|
+
if (isPlainObject(value)) {
|
|
86
|
+
const prev = result[key];
|
|
87
|
+
result[key] = assignDeep(isPlainObject(prev) ? prev : {}, value);
|
|
88
|
+
} else result[key] = value;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
74
93
|
function treeToMap(tree, keyName, childrenName, parentName) {
|
|
75
94
|
const map = {};
|
|
76
95
|
function recurse(children, parent) {
|
|
@@ -131,4 +150,4 @@ function nestedToMulti(nested, values, { getValue, getChildren }) {
|
|
|
131
150
|
return columns;
|
|
132
151
|
}
|
|
133
152
|
//#endregion
|
|
134
|
-
export { chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap };
|
|
153
|
+
export { assignDeep, chainGet, chainSet, deepClone, extend, nestedToMulti, omit, partition, pick, treeToMap };
|
package/utils/string.d.ts
CHANGED
|
@@ -35,3 +35,9 @@ export declare function uniqid(): string;
|
|
|
35
35
|
* 判断是否为韩文字符
|
|
36
36
|
*/
|
|
37
37
|
export declare function isKorean(text: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 使用 `{key}` 占位符替换模板内容:
|
|
40
|
+
* `data` 为对象时按名匹配(`{name}`),为数组时按下标匹配(`{0}`)。
|
|
41
|
+
* 对应值为 `null`/`undefined` 或不存在时保留占位符原样;不传 `data` 时原样返回。
|
|
42
|
+
*/
|
|
43
|
+
export declare function interpolate(template: string, data?: Record<string, any> | any[]): string;
|
package/utils/string.js
CHANGED
|
@@ -64,5 +64,17 @@ function uniqid() {
|
|
|
64
64
|
function isKorean(text) {
|
|
65
65
|
return /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* 使用 `{key}` 占位符替换模板内容:
|
|
69
|
+
* `data` 为对象时按名匹配(`{name}`),为数组时按下标匹配(`{0}`)。
|
|
70
|
+
* 对应值为 `null`/`undefined` 或不存在时保留占位符原样;不传 `data` 时原样返回。
|
|
71
|
+
*/
|
|
72
|
+
function interpolate(template, data) {
|
|
73
|
+
if (data == null) return template;
|
|
74
|
+
return template.replace(/\{([^}]*)\}/g, (match, key) => {
|
|
75
|
+
const value = Array.isArray(data) ? data[Number(key)] : data[key];
|
|
76
|
+
return value != null ? String(value) : match;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
67
79
|
//#endregion
|
|
68
|
-
export { addSeparator, camelCase, capitalize, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst };
|
|
80
|
+
export { addSeparator, camelCase, capitalize, interpolate, isKorean, kebabCase, lowerFirst, pascalCase, snakeCase, uniqid, upperFirst };
|