antd-mobile 5.18.0 → 5.19.0
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/2x/bundle/antd-mobile.cjs.js +47 -18976
- package/2x/bundle/antd-mobile.compatible.umd.js +25752 -0
- package/2x/bundle/antd-mobile.es.js +16123 -16565
- package/2x/bundle/antd-mobile.umd.js +64 -0
- package/2x/bundle/style.css +227 -273
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/cjs/components/button/button.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +1 -1
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -1
- package/2x/cjs/components/image-viewer/slide.js +75 -56
- package/2x/cjs/components/input/input.js +9 -2
- package/2x/cjs/components/modal/show.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/cjs/components/passcode-input/index.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
- package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
- package/2x/cjs/components/result/result.d.ts +1 -1
- package/2x/cjs/components/result/result.js +7 -1
- package/2x/cjs/components/search-bar/search-bar.js +12 -2
- package/2x/cjs/locales/base.d.ts +9 -0
- package/2x/cjs/locales/base.js +9 -0
- package/2x/cjs/locales/en-US.d.ts +9 -0
- package/2x/cjs/locales/es-ES.d.ts +9 -0
- package/2x/cjs/locales/fa-IR.d.ts +9 -0
- package/2x/cjs/locales/fr-FR.d.ts +9 -0
- package/2x/cjs/locales/id-ID.d.ts +9 -0
- package/2x/cjs/locales/kk-KZ.d.ts +9 -0
- package/2x/cjs/locales/ko-KR.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.js +9 -0
- package/2x/cjs/locales/zh-HK.d.ts +9 -0
- package/2x/cjs/locales/zh-TW.d.ts +9 -0
- package/2x/cjs/utils/matrix.d.ts +10 -0
- package/2x/cjs/utils/matrix.js +60 -0
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/es/components/button/button.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +1 -1
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/dialog/show.d.ts +1 -1
- package/2x/es/components/image-viewer/slide.js +73 -56
- package/2x/es/components/input/input.js +8 -2
- package/2x/es/components/modal/show.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/es/components/passcode-input/index.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.css +12 -12
- package/2x/es/components/passcode-input/passcode-input.js +15 -8
- package/2x/es/components/result/result.d.ts +1 -1
- package/2x/es/components/result/result.js +6 -1
- package/2x/es/components/search-bar/search-bar.js +12 -2
- package/2x/es/locales/base.d.ts +9 -0
- package/2x/es/locales/base.js +9 -0
- package/2x/es/locales/en-US.d.ts +9 -0
- package/2x/es/locales/es-ES.d.ts +9 -0
- package/2x/es/locales/fa-IR.d.ts +9 -0
- package/2x/es/locales/fr-FR.d.ts +9 -0
- package/2x/es/locales/id-ID.d.ts +9 -0
- package/2x/es/locales/kk-KZ.d.ts +9 -0
- package/2x/es/locales/ko-KR.d.ts +9 -0
- package/2x/es/locales/zh-CN.d.ts +9 -0
- package/2x/es/locales/zh-CN.js +9 -0
- package/2x/es/locales/zh-HK.d.ts +9 -0
- package/2x/es/locales/zh-TW.d.ts +9 -0
- package/2x/es/utils/matrix.d.ts +10 -0
- package/2x/es/utils/matrix.js +27 -0
- package/2x/package.json +1 -1
- package/2x/umd/antd-mobile.js +25752 -2
- package/bundle/antd-mobile.cjs.js +47 -18976
- package/bundle/antd-mobile.compatible.umd.js +25752 -0
- package/bundle/antd-mobile.es.js +16123 -16565
- package/bundle/antd-mobile.umd.js +64 -0
- package/bundle/style.css +1 -4088
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +1 -1
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/dialog/show.d.ts +1 -1
- package/cjs/components/image-viewer/slide.js +75 -56
- package/cjs/components/input/input.js +9 -2
- package/cjs/components/modal/show.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.css +11 -14
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/cjs/components/passcode-input/index.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.css +12 -12
- package/cjs/components/passcode-input/passcode-input.js +16 -8
- package/cjs/components/result/result.d.ts +1 -1
- package/cjs/components/result/result.js +7 -1
- package/cjs/components/search-bar/search-bar.js +12 -2
- package/cjs/locales/base.d.ts +9 -0
- package/cjs/locales/base.js +9 -0
- package/cjs/locales/en-US.d.ts +9 -0
- package/cjs/locales/es-ES.d.ts +9 -0
- package/cjs/locales/fa-IR.d.ts +9 -0
- package/cjs/locales/fr-FR.d.ts +9 -0
- package/cjs/locales/id-ID.d.ts +9 -0
- package/cjs/locales/kk-KZ.d.ts +9 -0
- package/cjs/locales/ko-KR.d.ts +9 -0
- package/cjs/locales/zh-CN.d.ts +9 -0
- package/cjs/locales/zh-CN.js +9 -0
- package/cjs/locales/zh-HK.d.ts +9 -0
- package/cjs/locales/zh-TW.d.ts +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +60 -0
- package/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/calendar/calendar.d.ts +1 -1
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/dialog/show.d.ts +1 -1
- package/es/components/image-viewer/slide.js +73 -56
- package/es/components/input/input.js +8 -2
- package/es/components/modal/show.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.css +11 -14
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +19 -17
- package/es/components/passcode-input/index.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.css +12 -12
- package/es/components/passcode-input/passcode-input.js +15 -8
- package/es/components/result/result.d.ts +1 -1
- package/es/components/result/result.js +6 -1
- package/es/components/search-bar/search-bar.js +12 -2
- package/es/locales/base.d.ts +9 -0
- package/es/locales/base.js +9 -0
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/es-ES.d.ts +9 -0
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/fr-FR.d.ts +9 -0
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/kk-KZ.d.ts +9 -0
- package/es/locales/ko-KR.d.ts +9 -0
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +9 -0
- package/es/locales/zh-HK.d.ts +9 -0
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +27 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
- package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
package/2x/es/locales/base.js
CHANGED
|
@@ -94,17 +94,26 @@ export const base = {
|
|
|
94
94
|
failedToLoad: 'Failed to load',
|
|
95
95
|
retry: 'Retry'
|
|
96
96
|
},
|
|
97
|
+
Input: {
|
|
98
|
+
clear: 'clear'
|
|
99
|
+
},
|
|
97
100
|
Mask: {
|
|
98
101
|
name: 'Mask'
|
|
99
102
|
},
|
|
100
103
|
Modal: {
|
|
101
104
|
ok: 'OK'
|
|
102
105
|
},
|
|
106
|
+
PasscodeInput: {
|
|
107
|
+
name: 'Passcode Input'
|
|
108
|
+
},
|
|
103
109
|
PullToRefresh: {
|
|
104
110
|
pulling: 'Scroll down to refresh',
|
|
105
111
|
canRelease: 'Release to refresh immediately',
|
|
106
112
|
complete: 'Refresh successful'
|
|
107
113
|
},
|
|
114
|
+
SearchBar: {
|
|
115
|
+
name: 'Search Bar'
|
|
116
|
+
},
|
|
108
117
|
Slider: {
|
|
109
118
|
name: 'Slider'
|
|
110
119
|
},
|
package/2x/es/locales/en-US.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const enUS: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/es-ES.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const esES: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/fa-IR.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const faIR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/fr-FR.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const frFR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/id-ID.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const idID: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/kk-KZ.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const kkKZ: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/ko-KR.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const koKR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/zh-CN.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const zhCN: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/zh-CN.js
CHANGED
|
@@ -96,17 +96,26 @@ const zhCN = mergeLocale(base, {
|
|
|
96
96
|
failedToLoad: '加载失败',
|
|
97
97
|
retry: '重新加载'
|
|
98
98
|
},
|
|
99
|
+
Input: {
|
|
100
|
+
clear: '清除'
|
|
101
|
+
},
|
|
99
102
|
Mask: {
|
|
100
103
|
name: '遮罩层'
|
|
101
104
|
},
|
|
102
105
|
Modal: {
|
|
103
106
|
ok: '我知道了'
|
|
104
107
|
},
|
|
108
|
+
PasscodeInput: {
|
|
109
|
+
name: '密码输入框'
|
|
110
|
+
},
|
|
105
111
|
PullToRefresh: {
|
|
106
112
|
pulling: '下拉刷新',
|
|
107
113
|
canRelease: '释放立即刷新',
|
|
108
114
|
complete: '刷新成功'
|
|
109
115
|
},
|
|
116
|
+
SearchBar: {
|
|
117
|
+
name: '搜索框'
|
|
118
|
+
},
|
|
110
119
|
Slider: {
|
|
111
120
|
name: '滑动输入条'
|
|
112
121
|
},
|
package/2x/es/locales/zh-HK.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const zhHK: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/es/locales/zh-TW.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ declare const zhTW: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type Matrix = readonly [number, number, number, number, number, number];
|
|
2
|
+
export declare const create: () => Matrix;
|
|
3
|
+
export declare const getTranslateX: (m: Matrix) => number;
|
|
4
|
+
export declare const getTranslateY: (m: Matrix) => number;
|
|
5
|
+
export declare const getScaleX: (m: Matrix) => number;
|
|
6
|
+
export declare const getScaleY: (m: Matrix) => number;
|
|
7
|
+
export declare const translate: (m: Matrix, x: number, y: number) => Matrix;
|
|
8
|
+
export declare const scale: (m: Matrix, scaleX: number, scaleY?: number) => Matrix;
|
|
9
|
+
export declare const apply: (m: Matrix, [ox, oy]: [number, number]) => [number, number];
|
|
10
|
+
export declare const multiply: (m1: Matrix, m2: Matrix) => Matrix;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const create = () => {
|
|
2
|
+
return [1, 0, 0, 1, 0, 0];
|
|
3
|
+
};
|
|
4
|
+
export const getTranslateX = m => {
|
|
5
|
+
return m[4];
|
|
6
|
+
};
|
|
7
|
+
export const getTranslateY = m => {
|
|
8
|
+
return m[5];
|
|
9
|
+
};
|
|
10
|
+
export const getScaleX = m => {
|
|
11
|
+
return m[0];
|
|
12
|
+
};
|
|
13
|
+
export const getScaleY = m => {
|
|
14
|
+
return m[3];
|
|
15
|
+
};
|
|
16
|
+
export const translate = (m, x, y) => {
|
|
17
|
+
return multiply([1, 0, 0, 1, x, y], m);
|
|
18
|
+
};
|
|
19
|
+
export const scale = (m, scaleX, scaleY = scaleX) => {
|
|
20
|
+
return multiply([scaleX, 0, 0, scaleY, 0, 0], m);
|
|
21
|
+
};
|
|
22
|
+
export const apply = (m, [ox, oy]) => {
|
|
23
|
+
return [m[0] * ox + m[2] * oy + m[4], m[1] * ox + m[3] * oy + m[5]];
|
|
24
|
+
};
|
|
25
|
+
export const multiply = (m1, m2) => {
|
|
26
|
+
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
|
|
27
|
+
};
|