duoyun-ui 2.2.2 → 2.2.8
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/elements/badge.d.ts +2 -16
- package/elements/badge.d.ts.map +1 -1
- package/elements/badge.js +4 -158
- package/elements/badge.js.map +1 -1
- package/elements/banner.d.ts +2 -17
- package/elements/banner.d.ts.map +1 -1
- package/elements/banner.js +4 -127
- package/elements/banner.js.map +1 -1
- package/elements/base/chart.d.ts +2 -2
- package/elements/base/resize.d.ts +1 -22
- package/elements/base/resize.d.ts.map +1 -1
- package/elements/base/resize.js +1 -95
- package/elements/base/resize.js.map +1 -1
- package/elements/base/scroll.d.ts +1 -8
- package/elements/base/scroll.d.ts.map +1 -1
- package/elements/base/scroll.js +1 -158
- package/elements/base/scroll.js.map +1 -1
- package/elements/base/visible.d.ts +1 -18
- package/elements/base/visible.d.ts.map +1 -1
- package/elements/base/visible.js +1 -112
- package/elements/base/visible.js.map +1 -1
- package/elements/button.d.ts +2 -24
- package/elements/button.d.ts.map +1 -1
- package/elements/button.js +7 -287
- package/elements/button.js.map +1 -1
- package/elements/checkbox.d.ts +3 -21
- package/elements/checkbox.d.ts.map +1 -1
- package/elements/checkbox.js +6 -180
- package/elements/checkbox.js.map +1 -1
- package/elements/code-block.d.ts +2 -7
- package/elements/code-block.d.ts.map +1 -1
- package/elements/code-block.js +4 -432
- package/elements/code-block.js.map +1 -1
- package/elements/collapse.d.ts +3 -29
- package/elements/collapse.d.ts.map +1 -1
- package/elements/collapse.js +6 -197
- package/elements/collapse.js.map +1 -1
- package/elements/compartment.d.ts +2 -5
- package/elements/compartment.d.ts.map +1 -1
- package/elements/compartment.js +4 -23
- package/elements/compartment.js.map +1 -1
- package/elements/contextmenu.d.ts +5 -42
- package/elements/contextmenu.d.ts.map +1 -1
- package/elements/contextmenu.js +8 -285
- package/elements/contextmenu.js.map +1 -1
- package/elements/countdown.d.ts +2 -12
- package/elements/countdown.d.ts.map +1 -1
- package/elements/countdown.js +4 -94
- package/elements/countdown.js.map +1 -1
- package/elements/divider.d.ts +2 -8
- package/elements/divider.d.ts.map +1 -1
- package/elements/divider.js +4 -129
- package/elements/divider.js.map +1 -1
- package/elements/empty.d.ts +2 -8
- package/elements/empty.d.ts.map +1 -1
- package/elements/empty.js +4 -59
- package/elements/empty.js.map +1 -1
- package/elements/grouped-picker.d.ts +29 -0
- package/elements/grouped-picker.d.ts.map +1 -0
- package/elements/grouped-picker.js +199 -0
- package/elements/grouped-picker.js.map +1 -0
- package/elements/input.d.ts +4 -36
- package/elements/input.d.ts.map +1 -1
- package/elements/input.js +6 -489
- package/elements/input.js.map +1 -1
- package/elements/letters.d.ts +4 -0
- package/elements/letters.d.ts.map +1 -0
- package/elements/letters.js +56 -0
- package/elements/letters.js.map +1 -0
- package/elements/link.d.ts +3 -5
- package/elements/link.d.ts.map +1 -1
- package/elements/link.js +6 -38
- package/elements/link.js.map +1 -1
- package/elements/list.d.ts +5 -58
- package/elements/list.d.ts.map +1 -1
- package/elements/list.js +19 -664
- package/elements/list.js.map +1 -1
- package/elements/modal.d.ts +5 -63
- package/elements/modal.d.ts.map +1 -1
- package/elements/modal.js +13 -411
- package/elements/modal.js.map +1 -1
- package/elements/options.d.ts +4 -32
- package/elements/options.d.ts.map +1 -1
- package/elements/options.js +5 -254
- package/elements/options.js.map +1 -1
- package/elements/page-loadbar.js +1 -1
- package/elements/paragraph.d.ts +2 -2
- package/elements/paragraph.d.ts.map +1 -1
- package/elements/paragraph.js +4 -45
- package/elements/paragraph.js.map +1 -1
- package/elements/placeholder.d.ts +2 -14
- package/elements/placeholder.d.ts.map +1 -1
- package/elements/placeholder.js +4 -114
- package/elements/placeholder.js.map +1 -1
- package/elements/radio.d.ts +5 -24
- package/elements/radio.d.ts.map +1 -1
- package/elements/radio.js +7 -165
- package/elements/radio.js.map +1 -1
- package/elements/rate.d.ts +2 -12
- package/elements/rate.d.ts.map +1 -1
- package/elements/rate.js +4 -142
- package/elements/rate.js.map +1 -1
- package/elements/rolling-number.d.ts +4 -0
- package/elements/rolling-number.d.ts.map +1 -0
- package/elements/rolling-number.js +56 -0
- package/elements/rolling-number.js.map +1 -0
- package/elements/scroll-box.d.ts +2 -2
- package/elements/scroll-box.d.ts.map +1 -1
- package/elements/scroll-box.js +4 -5
- package/elements/scroll-box.js.map +1 -1
- package/elements/segmented.d.ts +3 -20
- package/elements/segmented.d.ts.map +1 -1
- package/elements/segmented.js +4 -191
- package/elements/segmented.js.map +1 -1
- package/elements/slider.d.ts +2 -20
- package/elements/slider.d.ts.map +1 -1
- package/elements/slider.js +4 -261
- package/elements/slider.js.map +1 -1
- package/elements/sort-box.d.ts +1 -2
- package/elements/sort-box.d.ts.map +1 -1
- package/elements/sort-box.js +4 -15
- package/elements/sort-box.js.map +1 -1
- package/elements/space.d.ts +2 -4
- package/elements/space.d.ts.map +1 -1
- package/elements/space.js +4 -37
- package/elements/space.js.map +1 -1
- package/elements/switch.d.ts +2 -11
- package/elements/switch.d.ts.map +1 -1
- package/elements/switch.js +5 -134
- package/elements/switch.js.map +1 -1
- package/elements/tag.d.ts +3 -16
- package/elements/tag.d.ts.map +1 -1
- package/elements/tag.js +4 -133
- package/elements/tag.js.map +1 -1
- package/elements/timeline.d.ts.map +1 -1
- package/elements/timeline.js +0 -1
- package/elements/timeline.js.map +1 -1
- package/elements/toast.js +1 -1
- package/elements/wait.js +1 -1
- package/helper/error.js +2 -39
- package/helper/error.js.map +1 -1
- package/helper/webapp.d.ts +4 -5
- package/helper/webapp.d.ts.map +1 -1
- package/helper/webapp.js +5 -11
- package/helper/webapp.js.map +1 -1
- package/lib/animations.d.ts +1 -10
- package/lib/animations.d.ts.map +1 -1
- package/lib/animations.js +1 -29
- package/lib/animations.js.map +1 -1
- package/lib/cache.d.ts +1 -18
- package/lib/cache.d.ts.map +1 -1
- package/lib/cache.js +1 -62
- package/lib/cache.js.map +1 -1
- package/lib/color.d.ts +1 -37
- package/lib/color.d.ts.map +1 -1
- package/lib/color.js +1 -98
- package/lib/color.js.map +1 -1
- package/lib/decorators.d.ts +2 -0
- package/lib/decorators.d.ts.map +1 -0
- package/lib/decorators.js +2 -0
- package/lib/decorators.js.map +1 -0
- package/lib/easing.d.ts +2 -0
- package/lib/easing.d.ts.map +1 -0
- package/lib/easing.js +2 -0
- package/lib/easing.js.map +1 -0
- package/lib/element.d.ts +1 -18
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +1 -131
- package/lib/element.js.map +1 -1
- package/lib/encode.d.ts +1 -10
- package/lib/encode.d.ts.map +1 -1
- package/lib/encode.js +1 -48
- package/lib/encode.js.map +1 -1
- package/lib/hotkeys.d.ts +1 -43
- package/lib/hotkeys.d.ts.map +1 -1
- package/lib/hotkeys.js +1 -247
- package/lib/hotkeys.js.map +1 -1
- package/lib/icons.d.ts +1 -114
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +1 -90
- package/lib/icons.js.map +1 -1
- package/lib/image.d.ts +1 -39
- package/lib/image.d.ts.map +1 -1
- package/lib/image.js +1 -140
- package/lib/image.js.map +1 -1
- package/lib/locale.d.ts +1 -87
- package/lib/locale.d.ts.map +1 -1
- package/lib/locale.js +1 -8
- package/lib/locale.js.map +1 -1
- package/lib/map.d.ts +1 -8
- package/lib/map.d.ts.map +1 -1
- package/lib/map.js +1 -31
- package/lib/map.js.map +1 -1
- package/lib/number.d.ts +1 -94
- package/lib/number.d.ts.map +1 -1
- package/lib/number.js +1 -169
- package/lib/number.js.map +1 -1
- package/lib/patterns.d.ts +1 -9
- package/lib/patterns.d.ts.map +1 -1
- package/lib/patterns.js +1 -11
- package/lib/patterns.js.map +1 -1
- package/lib/styles.d.ts +1 -4
- package/lib/styles.d.ts.map +1 -1
- package/lib/styles.js +1 -28
- package/lib/styles.js.map +1 -1
- package/lib/theme.d.ts +1 -85
- package/lib/theme.d.ts.map +1 -1
- package/lib/theme.js +6 -70
- package/lib/theme.js.map +1 -1
- package/lib/time.d.ts +1 -81
- package/lib/time.d.ts.map +1 -1
- package/lib/time.js +1 -255
- package/lib/time.js.map +1 -1
- package/lib/timer.d.ts +1 -25
- package/lib/timer.d.ts.map +1 -1
- package/lib/timer.js +1 -106
- package/lib/timer.js.map +1 -1
- package/lib/types.d.ts +1 -13
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +1 -16
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +1 -79
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -240
- package/lib/utils.js.map +1 -1
- package/locales/en.d.ts +1 -37
- package/locales/en.d.ts.map +1 -1
- package/locales/en.js +1 -36
- package/locales/en.js.map +1 -1
- package/locales/zh.d.ts +1 -3
- package/locales/zh.d.ts.map +1 -1
- package/locales/zh.js +1 -37
- package/locales/zh.js.map +1 -1
- package/package.json +4 -6
- package/patterns/console.d.ts +1 -1
- package/patterns/form.d.ts +5 -3
- package/patterns/form.d.ts.map +1 -1
- package/patterns/form.js +18 -5
- package/patterns/form.js.map +1 -1
- package/react/DyBadge.d.ts +1 -9
- package/react/DyBadge.js +1 -1
- package/react/DyBanner.d.ts +1 -6
- package/react/DyBanner.js +1 -1
- package/react/DyButton.d.ts +1 -15
- package/react/DyButton.js +1 -1
- package/react/DyCheckbox.d.ts +1 -7
- package/react/DyCheckbox.js +1 -1
- package/react/DyCheckboxGroup.d.ts +1 -7
- package/react/DyCheckboxGroup.js +1 -1
- package/react/DyCoachMark.d.ts +0 -5
- package/react/DyCoachMark.js +1 -1
- package/react/DyCodeBlock.d.ts +1 -5
- package/react/DyCodeBlock.js +1 -1
- package/react/DyCollapse.d.ts +1 -5
- package/react/DyCollapse.js +1 -1
- package/react/DyCollapsePanel.d.ts +1 -6
- package/react/DyCollapsePanel.js +1 -1
- package/react/DyCompartment.d.ts +1 -3
- package/react/DyCompartment.js +1 -1
- package/react/DyCountdown.d.ts +1 -5
- package/react/DyCountdown.js +1 -1
- package/react/DyDivider.d.ts +1 -6
- package/react/DyDivider.js +1 -1
- package/react/DyDrawer.d.ts +1 -21
- package/react/DyDrawer.js +1 -1
- package/react/DyEmpty.d.ts +1 -5
- package/react/DyEmpty.js +1 -1
- package/react/DyGroupedPicker.d.ts +27 -0
- package/react/DyGroupedPicker.js +22 -0
- package/react/DyInput.d.ts +1 -22
- package/react/DyInput.js +1 -1
- package/react/DyLegend.d.ts +0 -4
- package/react/DyLegend.js +1 -1
- package/react/DyLetters.d.ts +15 -0
- package/react/{DyListOutside.js → DyLetters.js} +4 -4
- package/react/DyList.d.ts +0 -13
- package/react/DyList.js +1 -1
- package/react/DyOptions.d.ts +1 -5
- package/react/DyOptions.js +1 -1
- package/react/DyPatForm.d.ts +1 -0
- package/react/DyPlaceholder.d.ts +1 -10
- package/react/DyPlaceholder.js +1 -1
- package/react/DyRadio.d.ts +1 -6
- package/react/DyRadio.js +1 -1
- package/react/DyRadioGroup.d.ts +1 -7
- package/react/DyRadioGroup.js +1 -1
- package/react/DyRate.d.ts +1 -7
- package/react/DyRate.js +1 -1
- package/react/DyRollingNumber.d.ts +15 -0
- package/react/{DyListItem.js → DyRollingNumber.js} +5 -5
- package/react/DySegmented.d.ts +1 -8
- package/react/DySegmented.js +1 -1
- package/react/DySlider.d.ts +1 -12
- package/react/DySlider.js +1 -1
- package/react/DySortItem.d.ts +1 -3
- package/react/DySortItem.js +1 -1
- package/react/DySpace.d.ts +1 -4
- package/react/DySpace.js +1 -1
- package/react/DySwitch.d.ts +1 -7
- package/react/DySwitch.js +1 -1
- package/react/DyTag.d.ts +1 -9
- package/react/DyTag.js +1 -1
- package/svelte/badge.d.ts +0 -8
- package/svelte/banner.d.ts +0 -5
- package/svelte/button.d.ts +0 -14
- package/svelte/checkbox.d.ts +0 -6
- package/svelte/coach-mark.d.ts +0 -5
- package/svelte/code-block.d.ts +0 -4
- package/svelte/collapse.d.ts +0 -4
- package/svelte/compartment.d.ts +0 -2
- package/svelte/countdown.d.ts +0 -4
- package/svelte/divider.d.ts +0 -5
- package/svelte/drawer.d.ts +0 -20
- package/svelte/empty.d.ts +0 -4
- package/svelte/grouped-picker.d.ts +19 -0
- package/svelte/grouped-picker.js +2 -0
- package/svelte/legend.d.ts +0 -4
- package/svelte/letters.d.ts +9 -0
- package/svelte/letters.js +2 -0
- package/svelte/list.d.ts +4 -11
- package/svelte/options.d.ts +0 -4
- package/svelte/pat-form.d.ts +1 -0
- package/svelte/placeholder.d.ts +0 -9
- package/svelte/radio.d.ts +0 -6
- package/svelte/rate.d.ts +0 -6
- package/svelte/rolling-number.d.ts +9 -0
- package/svelte/rolling-number.js +2 -0
- package/svelte/segmented.d.ts +0 -7
- package/svelte/slider.d.ts +0 -11
- package/svelte/space.d.ts +0 -3
- package/svelte/switch.d.ts +0 -6
- package/svelte/tag.d.ts +0 -8
- package/vue/DyBadge.vue +2 -8
- package/vue/DyBanner.vue +4 -6
- package/vue/DyButton.vue +2 -14
- package/vue/DyCheckbox.vue +4 -7
- package/vue/DyCheckboxGroup.vue +4 -7
- package/vue/DyCoachMark.vue +4 -8
- package/vue/DyCodeBlock.vue +2 -4
- package/vue/DyCollapse.vue +2 -4
- package/vue/DyCollapsePanel.vue +4 -6
- package/vue/DyCompartment.vue +2 -2
- package/vue/DyCountdown.vue +4 -5
- package/vue/DyDivider.vue +2 -5
- package/vue/DyDrawer.vue +4 -21
- package/vue/DyEmpty.vue +2 -4
- package/vue/DyGroupedPicker.vue +53 -0
- package/vue/DyInput.vue +4 -22
- package/vue/DyLegend.vue +2 -6
- package/vue/{DyListOutside.vue → DyLetters.vue} +8 -8
- package/vue/DyList.vue +4 -16
- package/vue/DyOptions.vue +2 -4
- package/vue/DyPatForm.vue +2 -2
- package/vue/DyPlaceholder.vue +2 -9
- package/vue/DyRadio.vue +4 -6
- package/vue/DyRadioGroup.vue +4 -7
- package/vue/DyRate.vue +4 -7
- package/vue/DyRollingNumber.vue +42 -0
- package/vue/DySegmented.vue +4 -8
- package/vue/DySlider.vue +4 -12
- package/vue/DySortItem.vue +2 -2
- package/vue/DySpace.vue +2 -3
- package/vue/DySwitch.vue +4 -7
- package/vue/DyTag.vue +4 -9
- package/elements/flow.d.ts +0 -52
- package/elements/flow.d.ts.map +0 -1
- package/elements/flow.js +0 -703
- package/elements/flow.js.map +0 -1
- package/elements/map.d.ts +0 -48
- package/elements/map.d.ts.map +0 -1
- package/elements/map.js +0 -396
- package/elements/map.js.map +0 -1
- package/react/DyFlow.d.ts +0 -24
- package/react/DyFlow.js +0 -18
- package/react/DyFlowCanvas.d.ts +0 -29
- package/react/DyFlowCanvas.js +0 -18
- package/react/DyListItem.d.ts +0 -24
- package/react/DyListOutside.d.ts +0 -15
- package/react/DyMap.d.ts +0 -32
- package/react/DyMap.js +0 -18
- package/svelte/flow.d.ts +0 -18
- package/svelte/flow.js +0 -2
- package/svelte/map.d.ts +0 -26
- package/svelte/map.js +0 -2
- package/vue/DyFlow.vue +0 -49
- package/vue/DyFlowCanvas.vue +0 -53
- package/vue/DyListItem.vue +0 -48
- package/vue/DyMap.vue +0 -56
package/lib/encode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode.js","sourceRoot":"","sources":["../src/lib/encode.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"encode.js","sourceRoot":"","sources":["../src/lib/encode.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
package/lib/hotkeys.d.ts
CHANGED
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
win?: string;
|
|
3
|
-
mac?: string;
|
|
4
|
-
macSymbol?: string;
|
|
5
|
-
alias?: string;
|
|
6
|
-
symbol?: string;
|
|
7
|
-
};
|
|
8
|
-
type NormalizeKey = string;
|
|
9
|
-
/**
|
|
10
|
-
* @see
|
|
11
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values
|
|
12
|
-
*/
|
|
13
|
-
export declare function normalizeKey(code: string): NormalizeKey;
|
|
14
|
-
export declare const isMac: boolean;
|
|
15
|
-
/**Get the platform button */
|
|
16
|
-
export declare function getDisplayKey(code: string, type?: keyof Key): string;
|
|
17
|
-
/**Custom key map */
|
|
18
|
-
export declare function setKeys(keysRecord: Record<NormalizeKey, Key>): void;
|
|
19
|
-
/**Detect whether the current keyboard event matches the specified button */
|
|
20
|
-
export declare function matchHotKey(evt: KeyboardEvent, hotkey: string): string | boolean;
|
|
21
|
-
export type HotKeyHandles = {
|
|
22
|
-
onLock?: (evt: KeyboardEvent) => void;
|
|
23
|
-
onUnlock?: (evt: KeyboardEvent) => void;
|
|
24
|
-
onUncapture?: (evt: KeyboardEvent) => void;
|
|
25
|
-
[index: string]: ((evt: KeyboardEvent) => void) | undefined;
|
|
26
|
-
};
|
|
27
|
-
/**Release the lock state of the continuous button, see `hotkeys` */
|
|
28
|
-
export declare function unlock(): void;
|
|
29
|
-
type HotkeysOptions = {
|
|
30
|
-
stopPropagation?: boolean;
|
|
31
|
-
preventDefault?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Must have non-control character;
|
|
35
|
-
* Not case sensitive;
|
|
36
|
-
* Support `a-b`, press `a`, hotkeys be locked, wait next `keydown` event, allow call `unlock`
|
|
37
|
-
*/
|
|
38
|
-
export declare function hotkeys(handles: HotKeyHandles, options?: HotkeysOptions): (event: KeyboardEvent) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Support space,enter
|
|
41
|
-
*/
|
|
42
|
-
export declare const commonHandle: (event: KeyboardEvent) => void;
|
|
43
|
-
export {};
|
|
1
|
+
export * from '@mantou/tap-ui/lib/hotkeys';
|
|
44
2
|
//# sourceMappingURL=hotkeys.d.ts.map
|
package/lib/hotkeys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../src/lib/hotkeys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../src/lib/hotkeys.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
package/lib/hotkeys.js
CHANGED
|
@@ -1,248 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { proxyObject } from './utils';
|
|
3
|
-
/**
|
|
4
|
-
* @see
|
|
5
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values
|
|
6
|
-
*/
|
|
7
|
-
export function normalizeKey(code) {
|
|
8
|
-
const s = code.toLowerCase();
|
|
9
|
-
if (s.startsWith('control'))
|
|
10
|
-
return 'ctrl';
|
|
11
|
-
if (s.startsWith('meta') || s === 'command' || s.startsWith('os'))
|
|
12
|
-
return 'meta';
|
|
13
|
-
if (s.startsWith('shift'))
|
|
14
|
-
return 'shift';
|
|
15
|
-
if (s.startsWith('alt') || s === 'option')
|
|
16
|
-
return 'alt';
|
|
17
|
-
return s.replace(/^(digit|key|numpad)/, '');
|
|
18
|
-
}
|
|
19
|
-
function appendToMap(keys) {
|
|
20
|
-
Object.entries(keys).forEach(([named, key]) => {
|
|
21
|
-
Object.entries(key).forEach(([_, k]) => {
|
|
22
|
-
map[k] = named;
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const keysInfo = {
|
|
27
|
-
ctrl: {
|
|
28
|
-
alias: 'control',
|
|
29
|
-
macSymbol: '⌃',
|
|
30
|
-
},
|
|
31
|
-
meta: {
|
|
32
|
-
win: 'win',
|
|
33
|
-
mac: 'command',
|
|
34
|
-
macSymbol: '⌘',
|
|
35
|
-
},
|
|
36
|
-
shift: {
|
|
37
|
-
symbol: '⇧',
|
|
38
|
-
},
|
|
39
|
-
alt: {
|
|
40
|
-
mac: 'option',
|
|
41
|
-
macSymbol: '⌥',
|
|
42
|
-
},
|
|
43
|
-
escape: {
|
|
44
|
-
alias: 'esc',
|
|
45
|
-
},
|
|
46
|
-
backspace: {
|
|
47
|
-
symbol: '⌫',
|
|
48
|
-
},
|
|
49
|
-
enter: {
|
|
50
|
-
alias: 'return',
|
|
51
|
-
symbol: '↵',
|
|
52
|
-
},
|
|
53
|
-
space: {
|
|
54
|
-
symbol: '␣',
|
|
55
|
-
},
|
|
56
|
-
capsLock: {
|
|
57
|
-
symbol: '⇪',
|
|
58
|
-
},
|
|
59
|
-
arrowdown: {
|
|
60
|
-
alias: 'down',
|
|
61
|
-
symbol: '↓',
|
|
62
|
-
},
|
|
63
|
-
arrowup: {
|
|
64
|
-
alias: 'up',
|
|
65
|
-
symbol: '↑',
|
|
66
|
-
},
|
|
67
|
-
arrowleft: {
|
|
68
|
-
alias: 'left',
|
|
69
|
-
symbol: '←',
|
|
70
|
-
},
|
|
71
|
-
arrowright: {
|
|
72
|
-
alias: 'right',
|
|
73
|
-
symbol: '→',
|
|
74
|
-
},
|
|
75
|
-
minus: {
|
|
76
|
-
symbol: '-',
|
|
77
|
-
},
|
|
78
|
-
equal: {
|
|
79
|
-
symbol: '=',
|
|
80
|
-
},
|
|
81
|
-
period: {
|
|
82
|
-
symbol: '.',
|
|
83
|
-
},
|
|
84
|
-
comma: {
|
|
85
|
-
symbol: ',',
|
|
86
|
-
},
|
|
87
|
-
slash: {
|
|
88
|
-
symbol: '/',
|
|
89
|
-
},
|
|
90
|
-
backslash: {
|
|
91
|
-
symbol: '|',
|
|
92
|
-
},
|
|
93
|
-
bracketleft: {
|
|
94
|
-
symbol: '[',
|
|
95
|
-
},
|
|
96
|
-
bracketright: {
|
|
97
|
-
symbol: ']',
|
|
98
|
-
},
|
|
99
|
-
semicolon: {
|
|
100
|
-
symbol: ';',
|
|
101
|
-
},
|
|
102
|
-
quote: {
|
|
103
|
-
symbol: "'",
|
|
104
|
-
},
|
|
105
|
-
backquote: {
|
|
106
|
-
symbol: '`',
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
const map = proxyObject({});
|
|
110
|
-
appendToMap(keysInfo);
|
|
111
|
-
export const isMac = navigator.platform.includes('Mac');
|
|
112
|
-
/**Get the platform button */
|
|
113
|
-
export function getDisplayKey(code, type) {
|
|
114
|
-
const key = normalizeKey(code);
|
|
115
|
-
const keyObj = keysInfo[key];
|
|
116
|
-
let result;
|
|
117
|
-
if (!keyObj) {
|
|
118
|
-
result = key;
|
|
119
|
-
}
|
|
120
|
-
else if (type) {
|
|
121
|
-
result = keyObj[type];
|
|
122
|
-
}
|
|
123
|
-
if (!result) {
|
|
124
|
-
result = (isMac ? keyObj.macSymbol || keyObj.mac : keyObj.win) || keyObj.symbol || key;
|
|
125
|
-
}
|
|
126
|
-
return result.replace(/^(.)/, (_substr, $1) => $1.toUpperCase());
|
|
127
|
-
}
|
|
128
|
-
/**Custom key map */
|
|
129
|
-
export function setKeys(keysRecord) {
|
|
130
|
-
Object.assign(keysInfo, keysRecord);
|
|
131
|
-
appendToMap(keysRecord);
|
|
132
|
-
}
|
|
133
|
-
const hotkeySplitter = /,(?!,)/;
|
|
134
|
-
// https://bugs.webkit.org/show_bug.cgi?id=174931
|
|
135
|
-
// const keySplitter = /(?<!\+)\+/;
|
|
136
|
-
const keySplitter = /\+/;
|
|
137
|
-
/**Detect whether the current keyboard event matches the specified button */
|
|
138
|
-
export function matchHotKey(evt, hotkey) {
|
|
139
|
-
const keys = hotkey.split(keySplitter).map((k) => map[k]);
|
|
140
|
-
const targetKeyEvent = { ctrl: false, meta: false, shift: false, alt: false, namedKey: '' };
|
|
141
|
-
keys.forEach((named) => {
|
|
142
|
-
switch (named) {
|
|
143
|
-
case 'ctrl':
|
|
144
|
-
return (targetKeyEvent.ctrl = true);
|
|
145
|
-
case 'meta':
|
|
146
|
-
return (targetKeyEvent.meta = true);
|
|
147
|
-
case 'shift':
|
|
148
|
-
return (targetKeyEvent.shift = true);
|
|
149
|
-
case 'alt':
|
|
150
|
-
return (targetKeyEvent.alt = true);
|
|
151
|
-
default:
|
|
152
|
-
return (targetKeyEvent.namedKey = named);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
let nextKey = '';
|
|
156
|
-
if (targetKeyEvent.namedKey.length > 2 && targetKeyEvent.namedKey.includes('-')) {
|
|
157
|
-
// not support `a--`, `--a`, `a--b`, only allow `a-b`
|
|
158
|
-
[targetKeyEvent.namedKey, nextKey] = [...targetKeyEvent.namedKey.split('-')];
|
|
159
|
-
}
|
|
160
|
-
const match = evt.ctrlKey === targetKeyEvent.ctrl &&
|
|
161
|
-
evt.metaKey === targetKeyEvent.meta &&
|
|
162
|
-
evt.shiftKey === targetKeyEvent.shift &&
|
|
163
|
-
evt.altKey === targetKeyEvent.alt &&
|
|
164
|
-
(!targetKeyEvent.namedKey ||
|
|
165
|
-
normalizeKey(evt.code) === targetKeyEvent.namedKey ||
|
|
166
|
-
/**
|
|
167
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
|
|
168
|
-
*/
|
|
169
|
-
evt.key.toLowerCase() === targetKeyEvent.namedKey);
|
|
170
|
-
return nextKey ? match && nextKey : match;
|
|
171
|
-
}
|
|
172
|
-
let locked = false;
|
|
173
|
-
const unlockCallback = new Set();
|
|
174
|
-
/**Release the lock state of the continuous button, see `hotkeys` */
|
|
175
|
-
export function unlock() {
|
|
176
|
-
locked = false;
|
|
177
|
-
unlockCallback.forEach((callback) => callback());
|
|
178
|
-
unlockCallback.clear();
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Must have non-control character;
|
|
182
|
-
* Not case sensitive;
|
|
183
|
-
* Support `a-b`, press `a`, hotkeys be locked, wait next `keydown` event, allow call `unlock`
|
|
184
|
-
*/
|
|
185
|
-
export function hotkeys(handles, options = {}) {
|
|
186
|
-
const { stopPropagation, preventDefault = true } = options;
|
|
187
|
-
return (event) => {
|
|
188
|
-
if (event.isComposing)
|
|
189
|
-
return;
|
|
190
|
-
if (locked)
|
|
191
|
-
return;
|
|
192
|
-
let captured = false;
|
|
193
|
-
const nextKeyHandleSet = new Map();
|
|
194
|
-
for (const str in handles) {
|
|
195
|
-
const handle = handles[str];
|
|
196
|
-
if (!handle)
|
|
197
|
-
break;
|
|
198
|
-
const shortcuts = str.split(hotkeySplitter).map((e) => e.trim());
|
|
199
|
-
const matchResult = shortcuts.map((hotkey) => matchHotKey(event, hotkey));
|
|
200
|
-
if (matchResult.some((r) => r === true)) {
|
|
201
|
-
captured = true;
|
|
202
|
-
if (preventDefault)
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
if (stopPropagation)
|
|
205
|
-
event.stopPropagation();
|
|
206
|
-
handle(event);
|
|
207
|
-
}
|
|
208
|
-
matchResult.filter(isNotBoolean).forEach((key) => {
|
|
209
|
-
const set = nextKeyHandleSet.get(key) || new Set();
|
|
210
|
-
set.add(handle);
|
|
211
|
-
nextKeyHandleSet.set(key, set);
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
if (nextKeyHandleSet.size) {
|
|
215
|
-
captured = true;
|
|
216
|
-
unlockCallback.clear();
|
|
217
|
-
handles.onLock?.(event);
|
|
218
|
-
locked = true;
|
|
219
|
-
const nextKeyHandle = (evt) => {
|
|
220
|
-
handles.onUnlock?.(evt);
|
|
221
|
-
locked = false;
|
|
222
|
-
evt.stopPropagation();
|
|
223
|
-
evt.preventDefault();
|
|
224
|
-
let nextKeyCaptured = false;
|
|
225
|
-
nextKeyHandleSet.forEach((handleSet, k) => {
|
|
226
|
-
if (matchHotKey(evt, k)) {
|
|
227
|
-
nextKeyCaptured = true;
|
|
228
|
-
handleSet.forEach((h) => h(evt));
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
if (!nextKeyCaptured)
|
|
232
|
-
handles.onUncapture?.(evt);
|
|
233
|
-
};
|
|
234
|
-
unlockCallback.add(() => removeEventListener('keydown', nextKeyHandle, { capture: true }));
|
|
235
|
-
addEventListener('keydown', nextKeyHandle, { once: true, capture: true });
|
|
236
|
-
}
|
|
237
|
-
if (!captured)
|
|
238
|
-
handles.onUncapture?.(event);
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Support space,enter
|
|
243
|
-
*/
|
|
244
|
-
export const commonHandle = hotkeys({
|
|
245
|
-
'space,enter': (evt) => evt.target.click(),
|
|
246
|
-
esc: (evt) => evt.target.blur(),
|
|
247
|
-
});
|
|
1
|
+
export * from '@mantou/tap-ui/lib/hotkeys';
|
|
248
2
|
//# sourceMappingURL=hotkeys.js.map
|
package/lib/hotkeys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hotkeys.js","sourceRoot":"","sources":["../src/lib/hotkeys.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hotkeys.js","sourceRoot":"","sources":["../src/lib/hotkeys.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
package/lib/icons.d.ts
CHANGED
|
@@ -1,115 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function genIcon(d: string, ext?: string): string;
|
|
3
|
-
declare const defaultIcons: {
|
|
4
|
-
loading: string;
|
|
5
|
-
search: string;
|
|
6
|
-
outward: string;
|
|
7
|
-
menu: string;
|
|
8
|
-
filter: string;
|
|
9
|
-
more: string;
|
|
10
|
-
close: string;
|
|
11
|
-
delete: string;
|
|
12
|
-
add: string;
|
|
13
|
-
right: string;
|
|
14
|
-
left: string;
|
|
15
|
-
expand: string;
|
|
16
|
-
sort: string;
|
|
17
|
-
rollup: string;
|
|
18
|
-
check: string;
|
|
19
|
-
date: string;
|
|
20
|
-
schedule: string;
|
|
21
|
-
copy: string;
|
|
22
|
-
info: string;
|
|
23
|
-
warning: string;
|
|
24
|
-
error: string;
|
|
25
|
-
success: string;
|
|
26
|
-
help: string;
|
|
27
|
-
star: string;
|
|
28
|
-
colorize: string;
|
|
29
|
-
back: string;
|
|
30
|
-
forward: string;
|
|
31
|
-
tune: string;
|
|
32
|
-
visibility: string;
|
|
33
|
-
visibilityOff: string;
|
|
34
|
-
refresh: string;
|
|
35
|
-
};
|
|
36
|
-
export declare const icons: ((value?: Partial<{
|
|
37
|
-
loading: string;
|
|
38
|
-
search: string;
|
|
39
|
-
outward: string;
|
|
40
|
-
menu: string;
|
|
41
|
-
filter: string;
|
|
42
|
-
more: string;
|
|
43
|
-
close: string;
|
|
44
|
-
delete: string;
|
|
45
|
-
add: string;
|
|
46
|
-
right: string;
|
|
47
|
-
left: string;
|
|
48
|
-
expand: string;
|
|
49
|
-
sort: string;
|
|
50
|
-
rollup: string;
|
|
51
|
-
check: string;
|
|
52
|
-
date: string;
|
|
53
|
-
schedule: string;
|
|
54
|
-
copy: string;
|
|
55
|
-
info: string;
|
|
56
|
-
warning: string;
|
|
57
|
-
error: string;
|
|
58
|
-
success: string;
|
|
59
|
-
help: string;
|
|
60
|
-
star: string;
|
|
61
|
-
colorize: string;
|
|
62
|
-
back: string;
|
|
63
|
-
forward: string;
|
|
64
|
-
tune: string;
|
|
65
|
-
visibility: string;
|
|
66
|
-
visibilityOff: string;
|
|
67
|
-
refresh: string;
|
|
68
|
-
}> | undefined) => void) & Omit<{
|
|
69
|
-
name: never;
|
|
70
|
-
apply: never;
|
|
71
|
-
call: never;
|
|
72
|
-
bind: never;
|
|
73
|
-
toString: never;
|
|
74
|
-
prototype: never;
|
|
75
|
-
length: never;
|
|
76
|
-
arguments: never;
|
|
77
|
-
caller: never;
|
|
78
|
-
[Symbol.hasInstance]: never;
|
|
79
|
-
[Symbol.metadata]: never;
|
|
80
|
-
}, "menu" | "search" | "sort" | "filter" | "close" | "copy" | "error" | "left" | "right" | "visibility" | "loading" | "outward" | "more" | "delete" | "add" | "expand" | "rollup" | "check" | "date" | "schedule" | "info" | "warning" | "success" | "help" | "star" | "colorize" | "back" | "forward" | "tune" | "visibilityOff" | "refresh"> & {
|
|
81
|
-
loading: string;
|
|
82
|
-
search: string;
|
|
83
|
-
outward: string;
|
|
84
|
-
menu: string;
|
|
85
|
-
filter: string;
|
|
86
|
-
more: string;
|
|
87
|
-
close: string;
|
|
88
|
-
delete: string;
|
|
89
|
-
add: string;
|
|
90
|
-
right: string;
|
|
91
|
-
left: string;
|
|
92
|
-
expand: string;
|
|
93
|
-
sort: string;
|
|
94
|
-
rollup: string;
|
|
95
|
-
check: string;
|
|
96
|
-
date: string;
|
|
97
|
-
schedule: string;
|
|
98
|
-
copy: string;
|
|
99
|
-
info: string;
|
|
100
|
-
warning: string;
|
|
101
|
-
error: string;
|
|
102
|
-
success: string;
|
|
103
|
-
help: string;
|
|
104
|
-
star: string;
|
|
105
|
-
colorize: string;
|
|
106
|
-
back: string;
|
|
107
|
-
forward: string;
|
|
108
|
-
tune: string;
|
|
109
|
-
visibility: string;
|
|
110
|
-
visibilityOff: string;
|
|
111
|
-
refresh: string;
|
|
112
|
-
};
|
|
113
|
-
export declare function extendIcons<T extends Record<string, string>>(customIcons: Partial<typeof defaultIcons> & T): Store<typeof defaultIcons & T>;
|
|
114
|
-
export {};
|
|
1
|
+
export * from '@mantou/tap-ui/lib/icons';
|
|
115
2
|
//# sourceMappingURL=icons.d.ts.map
|
package/lib/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
package/lib/icons.js
CHANGED
|
@@ -1,91 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { raw } from '@mantou/gem/lib/utils';
|
|
3
|
-
// 24x24, single path
|
|
4
|
-
export function genIcon(d, ext = '') {
|
|
5
|
-
return raw `
|
|
6
|
-
<svg part="icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
7
|
-
<path d="M0 0h24v24H0z" fill="none" stroke="none"></path>
|
|
8
|
-
<path d="${d}"></path>
|
|
9
|
-
${ext}
|
|
10
|
-
</svg>
|
|
11
|
-
`;
|
|
12
|
-
}
|
|
13
|
-
const defaultIcons = {
|
|
14
|
-
loading: genIcon('', raw `
|
|
15
|
-
<path class="bar1" d="M5 5h2.8v14h-2.8z"></path>
|
|
16
|
-
<path class="bar2" d="M10.6 5h2.8v14h-2.8z"></path>
|
|
17
|
-
<path class="bar3" d="M15.6 5h2.8v14h-2.8z"></path>
|
|
18
|
-
<style>
|
|
19
|
-
svg {
|
|
20
|
-
opacity: 0.5;
|
|
21
|
-
}
|
|
22
|
-
path {
|
|
23
|
-
transform-origin: center;
|
|
24
|
-
}
|
|
25
|
-
.bar1 {
|
|
26
|
-
animation: grow 1.5s linear infinite;
|
|
27
|
-
}
|
|
28
|
-
.bar2 {
|
|
29
|
-
animation: grow 1.5s linear -0.5s infinite;
|
|
30
|
-
}
|
|
31
|
-
.bar3 {
|
|
32
|
-
animation: grow 1.5s linear -1s infinite;
|
|
33
|
-
}
|
|
34
|
-
@keyframes grow {
|
|
35
|
-
0% {
|
|
36
|
-
transform: scaleY(0);
|
|
37
|
-
opacity: 0;
|
|
38
|
-
}
|
|
39
|
-
50% {
|
|
40
|
-
transform: scaleY(1);
|
|
41
|
-
opacity: 1;
|
|
42
|
-
}
|
|
43
|
-
100% {
|
|
44
|
-
transform: scaleY(0);
|
|
45
|
-
opacity: 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
49
|
-
`),
|
|
50
|
-
search: genIcon(`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`),
|
|
51
|
-
outward: genIcon('', raw `
|
|
52
|
-
<polygon points="6,6 6,8 14.59,8 5,17.59 6.41,19 16,9.41 16,18 18,18 18,6"></polygon>
|
|
53
|
-
`),
|
|
54
|
-
menu: genIcon(`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`),
|
|
55
|
-
filter: genIcon(`M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z`),
|
|
56
|
-
more: genIcon(`M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`),
|
|
57
|
-
close: genIcon(`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`),
|
|
58
|
-
delete: genIcon(`M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z`),
|
|
59
|
-
add: genIcon(`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`),
|
|
60
|
-
right: genIcon(`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`),
|
|
61
|
-
left: genIcon(`M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z`),
|
|
62
|
-
expand: genIcon(`M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z`),
|
|
63
|
-
sort: genIcon('', raw `
|
|
64
|
-
<path part="up" d="M8 13v-7.175L5.425 8.4l-1.425-1.4 5-5 5 5-1.425 1.4-2.575-2.575v7.175h-2Z"></path>
|
|
65
|
-
<path part="down" d="M15 22 10 17l1.425-1.4 2.575 2.575v-7.175h2v7.175l2.575-2.575 1.425 1.4L15 22Z"></path>
|
|
66
|
-
`),
|
|
67
|
-
rollup: genIcon(`M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z`),
|
|
68
|
-
check: genIcon(`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`),
|
|
69
|
-
date: genIcon(`M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z`),
|
|
70
|
-
schedule: genIcon(`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z`),
|
|
71
|
-
copy: genIcon(`M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z`),
|
|
72
|
-
info: genIcon(`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`),
|
|
73
|
-
warning: genIcon(`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`),
|
|
74
|
-
error: genIcon(`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`),
|
|
75
|
-
success: genIcon(`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`),
|
|
76
|
-
help: genIcon(`M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z`),
|
|
77
|
-
star: genIcon(`M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24z`),
|
|
78
|
-
colorize: genIcon(`M20.71 5.63l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z`),
|
|
79
|
-
back: genIcon(`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`),
|
|
80
|
-
forward: genIcon(`M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`),
|
|
81
|
-
tune: genIcon(`M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z`),
|
|
82
|
-
visibility: genIcon(`M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z`),
|
|
83
|
-
visibilityOff: genIcon(`M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z`),
|
|
84
|
-
refresh: genIcon(`M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z`),
|
|
85
|
-
};
|
|
86
|
-
export const icons = createStore(defaultIcons);
|
|
87
|
-
export function extendIcons(customIcons) {
|
|
88
|
-
icons(customIcons);
|
|
89
|
-
return icons;
|
|
90
|
-
}
|
|
1
|
+
export * from '@mantou/tap-ui/lib/icons';
|
|
91
2
|
//# sourceMappingURL=icons.js.map
|
package/lib/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
package/lib/image.d.ts
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function createCanvas(width?: number, height?: number): HTMLCanvasElement;
|
|
3
|
-
export declare function createDataURLFromSVG(rawStr: string): string;
|
|
4
|
-
/**Create SVG according to the text */
|
|
5
|
-
export declare function createSVGFromText(text: string, options?: {
|
|
6
|
-
/**background color */
|
|
7
|
-
color?: HexColor;
|
|
8
|
-
colors?: HexColor[];
|
|
9
|
-
showLen?: number;
|
|
10
|
-
rotate?: number;
|
|
11
|
-
translate?: number[];
|
|
12
|
-
}): string;
|
|
13
|
-
export interface CreateBitmapFromSvgOptions {
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
type?: `image/${'png' | 'jpeg'}`;
|
|
17
|
-
quality?: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function createBitmapFromSvg(svg: string, { width, height, type, quality }?: CreateBitmapFromSvgOptions): Promise<File>;
|
|
20
|
-
export declare function createDataURLFromBlob(blob: Blob): Promise<string>;
|
|
21
|
-
interface LimitOptions {
|
|
22
|
-
fileSize?: number;
|
|
23
|
-
dimension?: {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
interface OutputOptions {
|
|
29
|
-
aspectRatio?: number;
|
|
30
|
-
/**Default: File */
|
|
31
|
-
type?: 'url';
|
|
32
|
-
}
|
|
33
|
-
type Origin = (HTMLImageElement & {
|
|
34
|
-
type?: string;
|
|
35
|
-
}) | File;
|
|
36
|
-
/**Compression `HTMLImageElement`/`File` to DataURL/`File` */
|
|
37
|
-
export declare function compressionImage(origin: Origin, limit: LimitOptions, output: OutputOptions): Promise<string>;
|
|
38
|
-
export declare function compressionImage(origin: Origin, limit: LimitOptions): Promise<File>;
|
|
39
|
-
export {};
|
|
1
|
+
export * from '@mantou/tap-ui/lib/image';
|
|
40
2
|
//# sourceMappingURL=image.d.ts.map
|
package/lib/image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/lib/image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/lib/image.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|