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/elements/button.js
CHANGED
|
@@ -32,307 +32,27 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import { history } from '@mantou/gem/lib/history';
|
|
39
|
-
import { addListener, classMap, QueryString } from '@mantou/gem/lib/utils';
|
|
40
|
-
import { commonHandle } from '../lib/hotkeys';
|
|
41
|
-
import { icons } from '../lib/icons';
|
|
42
|
-
import { focusStyle } from '../lib/styles';
|
|
43
|
-
import { getSemanticColor, theme } from '../lib/theme';
|
|
44
|
-
import { ContextMenu } from './contextmenu';
|
|
45
|
-
import { createHistoryParams } from './route';
|
|
46
|
-
import './use';
|
|
47
|
-
const elementTheme = createDecoratorTheme({ bg: '', color: '' });
|
|
35
|
+
import { adoptedStyle, customElement } from '@mantou/gem/lib/decorators';
|
|
36
|
+
import { css } from '@mantou/gem/lib/element';
|
|
37
|
+
import { TapButtonElement } from '@mantou/tap-ui/elements/button';
|
|
48
38
|
const style = css `
|
|
49
|
-
:host
|
|
50
|
-
|
|
51
|
-
align-items: stretch;
|
|
52
|
-
line-height: 1.2;
|
|
53
|
-
cursor: default;
|
|
54
|
-
user-select: none;
|
|
55
|
-
font-size: 0.875em;
|
|
56
|
-
border-radius: ${theme.normalRound};
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
}
|
|
59
|
-
:host(:not([borderless], [disabled])) {
|
|
60
|
-
box-shadow: ${theme.controlShadow};
|
|
61
|
-
}
|
|
62
|
-
:host([round]) {
|
|
63
|
-
border-radius: 10em;
|
|
64
|
-
}
|
|
65
|
-
.content,
|
|
66
|
-
.dropdown {
|
|
67
|
-
position: relative;
|
|
68
|
-
color: ${elementTheme.color};
|
|
69
|
-
background: ${elementTheme.bg};
|
|
70
|
-
border: 1px solid ${elementTheme.bg};
|
|
71
|
-
}
|
|
72
|
-
.content {
|
|
73
|
-
flex-grow: 1;
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
justify-content: center;
|
|
77
|
-
gap: 0.3em;
|
|
78
|
-
padding: 0.5em 1.5em;
|
|
79
|
-
min-width: 3em;
|
|
80
|
-
border-radius: inherit;
|
|
81
|
-
}
|
|
82
|
-
.content.corner {
|
|
83
|
-
border-start-end-radius: 0;
|
|
84
|
-
border-end-end-radius: 0;
|
|
85
|
-
}
|
|
86
|
-
.dropdown {
|
|
87
|
-
display: flex;
|
|
88
|
-
border-radius: inherit;
|
|
89
|
-
border-end-start-radius: 0;
|
|
90
|
-
border-start-start-radius: 0;
|
|
91
|
-
margin-inline-start: -1px;
|
|
92
|
-
padding-inline: 0.2em;
|
|
93
|
-
width: 1.4em;
|
|
94
|
-
}
|
|
95
|
-
.icon {
|
|
96
|
-
width: 1.2em;
|
|
97
|
-
}
|
|
98
|
-
:host([small]) {
|
|
99
|
-
font-size: 0.75em;
|
|
100
|
-
}
|
|
101
|
-
:host([small]) .content {
|
|
102
|
-
min-width: auto;
|
|
103
|
-
padding: 0.5em 0.8em;
|
|
104
|
-
}
|
|
105
|
-
:host([small]) .content {
|
|
106
|
-
min-width: auto;
|
|
107
|
-
padding: 0.5em 0.8em;
|
|
108
|
-
}
|
|
109
|
-
:host([square]) .content {
|
|
110
|
-
min-width: auto;
|
|
111
|
-
padding: 0.5em;
|
|
112
|
-
}
|
|
113
|
-
:host([type='reverse']) :where(.content, .dropdown) {
|
|
114
|
-
color: ${elementTheme.bg};
|
|
115
|
-
border-color: ${elementTheme.bg};
|
|
116
|
-
background: transparent;
|
|
117
|
-
}
|
|
118
|
-
:host([borderless]) :where(.content, .dropdown) {
|
|
119
|
-
border-color: transparent;
|
|
120
|
-
}
|
|
121
|
-
:host([disabled]) {
|
|
122
|
-
cursor: not-allowed;
|
|
123
|
-
}
|
|
124
|
-
:where(:host(:state(active)) .content, .content:where(:hover), .dropdown:where(:hover, :state(active)))::after {
|
|
125
|
-
content: '';
|
|
126
|
-
position: absolute;
|
|
127
|
-
inset: -1px;
|
|
128
|
-
background-color: currentColor;
|
|
129
|
-
border-radius: inherit;
|
|
130
|
-
opacity: 0.1;
|
|
131
|
-
transition: opacity 0.1s;
|
|
132
|
-
}
|
|
133
|
-
:active::after {
|
|
134
|
-
opacity: 0.13;
|
|
135
|
-
}
|
|
136
|
-
:host([disabled]) ::after {
|
|
137
|
-
content: none;
|
|
39
|
+
:host {
|
|
40
|
+
height: auto;
|
|
138
41
|
}
|
|
139
42
|
`;
|
|
140
43
|
let DuoyunButtonElement = (() => {
|
|
141
|
-
let _classDecorators = [customElement('dy-button'), adoptedStyle(style)
|
|
44
|
+
let _classDecorators = [customElement('dy-button'), adoptedStyle(style)];
|
|
142
45
|
let _classDescriptor;
|
|
143
46
|
let _classExtraInitializers = [];
|
|
144
47
|
let _classThis;
|
|
145
|
-
let _classSuper =
|
|
146
|
-
let _static_unnamed_decorators;
|
|
147
|
-
let _static_unnamed_initializers = [];
|
|
148
|
-
let _static_unnamed_extraInitializers = [];
|
|
149
|
-
let _static_button_decorators;
|
|
150
|
-
let _static_button_initializers = [];
|
|
151
|
-
let _static_button_extraInitializers = [];
|
|
152
|
-
let _static_dropdown_decorators;
|
|
153
|
-
let _static_dropdown_initializers = [];
|
|
154
|
-
let _static_dropdown_extraInitializers = [];
|
|
155
|
-
let _type_decorators;
|
|
156
|
-
let _type_initializers = [];
|
|
157
|
-
let _type_extraInitializers = [];
|
|
158
|
-
let _color_decorators;
|
|
159
|
-
let _color_initializers = [];
|
|
160
|
-
let _color_extraInitializers = [];
|
|
161
|
-
let _small_decorators;
|
|
162
|
-
let _small_initializers = [];
|
|
163
|
-
let _small_extraInitializers = [];
|
|
164
|
-
let _round_decorators;
|
|
165
|
-
let _round_initializers = [];
|
|
166
|
-
let _round_extraInitializers = [];
|
|
167
|
-
let _square_decorators;
|
|
168
|
-
let _square_initializers = [];
|
|
169
|
-
let _square_extraInitializers = [];
|
|
170
|
-
let _disabled_decorators;
|
|
171
|
-
let _disabled_initializers = [];
|
|
172
|
-
let _disabled_extraInitializers = [];
|
|
173
|
-
let _borderless_decorators;
|
|
174
|
-
let _borderless_initializers = [];
|
|
175
|
-
let _borderless_extraInitializers = [];
|
|
176
|
-
let _dropdown_decorators;
|
|
177
|
-
let _dropdown_initializers = [];
|
|
178
|
-
let _dropdown_extraInitializers = [];
|
|
179
|
-
let _route_decorators;
|
|
180
|
-
let _route_initializers = [];
|
|
181
|
-
let _route_extraInitializers = [];
|
|
182
|
-
let _params_decorators;
|
|
183
|
-
let _params_initializers = [];
|
|
184
|
-
let _params_extraInitializers = [];
|
|
185
|
-
let _query_decorators;
|
|
186
|
-
let _query_initializers = [];
|
|
187
|
-
let _query_extraInitializers = [];
|
|
188
|
-
let _icon_decorators;
|
|
189
|
-
let _icon_initializers = [];
|
|
190
|
-
let _icon_extraInitializers = [];
|
|
191
|
-
let _active_decorators;
|
|
192
|
-
let _active_initializers = [];
|
|
193
|
-
let _active_extraInitializers = [];
|
|
194
|
-
let _private_init_decorators;
|
|
195
|
-
let _private_init_initializers = [];
|
|
196
|
-
let _private_init_extraInitializers = [];
|
|
197
|
-
let _private_theme_decorators;
|
|
198
|
-
let _private_theme_initializers = [];
|
|
199
|
-
let _private_theme_extraInitializers = [];
|
|
48
|
+
let _classSuper = TapButtonElement;
|
|
200
49
|
var DuoyunButtonElement = class extends _classSuper {
|
|
201
50
|
static { _classThis = this; }
|
|
202
51
|
static {
|
|
203
52
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
204
|
-
_static_unnamed_decorators = [slot];
|
|
205
|
-
_static_button_decorators = [part];
|
|
206
|
-
_static_dropdown_decorators = [part];
|
|
207
|
-
_type_decorators = [attribute];
|
|
208
|
-
_color_decorators = [attribute];
|
|
209
|
-
_small_decorators = [boolattribute];
|
|
210
|
-
_round_decorators = [boolattribute];
|
|
211
|
-
_square_decorators = [boolattribute];
|
|
212
|
-
_disabled_decorators = [boolattribute];
|
|
213
|
-
_borderless_decorators = [boolattribute];
|
|
214
|
-
_dropdown_decorators = [property];
|
|
215
|
-
_route_decorators = [property];
|
|
216
|
-
_params_decorators = [property];
|
|
217
|
-
_query_decorators = [property];
|
|
218
|
-
_icon_decorators = [property];
|
|
219
|
-
_active_decorators = [state];
|
|
220
|
-
_private_init_decorators = [mounted()];
|
|
221
|
-
_private_theme_decorators = [elementTheme()];
|
|
222
|
-
__esDecorate(null, null, _static_unnamed_decorators, { kind: "field", name: "unnamed", static: true, private: false, access: { has: obj => "unnamed" in obj, get: obj => obj.unnamed, set: (obj, value) => { obj.unnamed = value; } }, metadata: _metadata }, _static_unnamed_initializers, _static_unnamed_extraInitializers);
|
|
223
|
-
__esDecorate(null, null, _static_button_decorators, { kind: "field", name: "button", static: true, private: false, access: { has: obj => "button" in obj, get: obj => obj.button, set: (obj, value) => { obj.button = value; } }, metadata: _metadata }, _static_button_initializers, _static_button_extraInitializers);
|
|
224
|
-
__esDecorate(null, null, _static_dropdown_decorators, { kind: "field", name: "dropdown", static: true, private: false, access: { has: obj => "dropdown" in obj, get: obj => obj.dropdown, set: (obj, value) => { obj.dropdown = value; } }, metadata: _metadata }, _static_dropdown_initializers, _static_dropdown_extraInitializers);
|
|
225
|
-
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
226
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
227
|
-
__esDecorate(null, null, _small_decorators, { kind: "field", name: "small", static: false, private: false, access: { has: obj => "small" in obj, get: obj => obj.small, set: (obj, value) => { obj.small = value; } }, metadata: _metadata }, _small_initializers, _small_extraInitializers);
|
|
228
|
-
__esDecorate(null, null, _round_decorators, { kind: "field", name: "round", static: false, private: false, access: { has: obj => "round" in obj, get: obj => obj.round, set: (obj, value) => { obj.round = value; } }, metadata: _metadata }, _round_initializers, _round_extraInitializers);
|
|
229
|
-
__esDecorate(null, null, _square_decorators, { kind: "field", name: "square", static: false, private: false, access: { has: obj => "square" in obj, get: obj => obj.square, set: (obj, value) => { obj.square = value; } }, metadata: _metadata }, _square_initializers, _square_extraInitializers);
|
|
230
|
-
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
231
|
-
__esDecorate(null, null, _borderless_decorators, { kind: "field", name: "borderless", static: false, private: false, access: { has: obj => "borderless" in obj, get: obj => obj.borderless, set: (obj, value) => { obj.borderless = value; } }, metadata: _metadata }, _borderless_initializers, _borderless_extraInitializers);
|
|
232
|
-
__esDecorate(null, null, _dropdown_decorators, { kind: "field", name: "dropdown", static: false, private: false, access: { has: obj => "dropdown" in obj, get: obj => obj.dropdown, set: (obj, value) => { obj.dropdown = value; } }, metadata: _metadata }, _dropdown_initializers, _dropdown_extraInitializers);
|
|
233
|
-
__esDecorate(null, null, _route_decorators, { kind: "field", name: "route", static: false, private: false, access: { has: obj => "route" in obj, get: obj => obj.route, set: (obj, value) => { obj.route = value; } }, metadata: _metadata }, _route_initializers, _route_extraInitializers);
|
|
234
|
-
__esDecorate(null, null, _params_decorators, { kind: "field", name: "params", static: false, private: false, access: { has: obj => "params" in obj, get: obj => obj.params, set: (obj, value) => { obj.params = value; } }, metadata: _metadata }, _params_initializers, _params_extraInitializers);
|
|
235
|
-
__esDecorate(null, null, _query_decorators, { kind: "field", name: "query", static: false, private: false, access: { has: obj => "query" in obj, get: obj => obj.query, set: (obj, value) => { obj.query = value; } }, metadata: _metadata }, _query_initializers, _query_extraInitializers);
|
|
236
|
-
__esDecorate(null, null, _icon_decorators, { kind: "field", name: "icon", static: false, private: false, access: { has: obj => "icon" in obj, get: obj => obj.icon, set: (obj, value) => { obj.icon = value; } }, metadata: _metadata }, _icon_initializers, _icon_extraInitializers);
|
|
237
|
-
__esDecorate(null, null, _active_decorators, { kind: "field", name: "active", static: false, private: false, access: { has: obj => "active" in obj, get: obj => obj.active, set: (obj, value) => { obj.active = value; } }, metadata: _metadata }, _active_initializers, _active_extraInitializers);
|
|
238
|
-
__esDecorate(null, null, _private_init_decorators, { kind: "field", name: "#init", static: false, private: true, access: { has: obj => #init in obj, get: obj => obj.#init, set: (obj, value) => { obj.#init = value; } }, metadata: _metadata }, _private_init_initializers, _private_init_extraInitializers);
|
|
239
|
-
__esDecorate(null, null, _private_theme_decorators, { kind: "field", name: "#theme", static: false, private: true, access: { has: obj => #theme in obj, get: obj => obj.#theme, set: (obj, value) => { obj.#theme = value; } }, metadata: _metadata }, _private_theme_initializers, _private_theme_extraInitializers);
|
|
240
53
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
241
54
|
DuoyunButtonElement = _classThis = _classDescriptor.value;
|
|
242
55
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
243
|
-
}
|
|
244
|
-
static unnamed = __runInitializers(_classThis, _static_unnamed_initializers, void 0);
|
|
245
|
-
static button = (__runInitializers(_classThis, _static_unnamed_extraInitializers), __runInitializers(_classThis, _static_button_initializers, void 0));
|
|
246
|
-
static dropdown = (__runInitializers(_classThis, _static_button_extraInitializers), __runInitializers(_classThis, _static_dropdown_initializers, void 0));
|
|
247
|
-
type = __runInitializers(this, _type_initializers, void 0);
|
|
248
|
-
color = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _color_initializers, void 0));
|
|
249
|
-
small = (__runInitializers(this, _color_extraInitializers), __runInitializers(this, _small_initializers, void 0));
|
|
250
|
-
round = (__runInitializers(this, _small_extraInitializers), __runInitializers(this, _round_initializers, void 0));
|
|
251
|
-
square = (__runInitializers(this, _round_extraInitializers), __runInitializers(this, _square_initializers, void 0));
|
|
252
|
-
disabled = (__runInitializers(this, _square_extraInitializers), __runInitializers(this, _disabled_initializers, void 0));
|
|
253
|
-
borderless = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _borderless_initializers, void 0));
|
|
254
|
-
dropdown = (__runInitializers(this, _borderless_extraInitializers), __runInitializers(this, _dropdown_initializers, void 0));
|
|
255
|
-
route = (__runInitializers(this, _dropdown_extraInitializers), __runInitializers(this, _route_initializers, void 0));
|
|
256
|
-
params = (__runInitializers(this, _route_extraInitializers), __runInitializers(this, _params_initializers, void 0));
|
|
257
|
-
query = (__runInitializers(this, _params_extraInitializers), __runInitializers(this, _query_initializers, void 0));
|
|
258
|
-
icon = (__runInitializers(this, _query_extraInitializers), __runInitializers(this, _icon_initializers, void 0));
|
|
259
|
-
active = (__runInitializers(this, _icon_extraInitializers), __runInitializers(this, _active_initializers, void 0));
|
|
260
|
-
#dropdownRef = (__runInitializers(this, _active_extraInitializers), createRef());
|
|
261
|
-
get #color() {
|
|
262
|
-
return getSemanticColor(this.color) || this.color || theme.primaryColor;
|
|
263
|
-
}
|
|
264
|
-
#onClick = () => {
|
|
265
|
-
if (this.disabled)
|
|
266
|
-
return;
|
|
267
|
-
if (this.route) {
|
|
268
|
-
history.push(createHistoryParams(this.route, {
|
|
269
|
-
title: this.route.title,
|
|
270
|
-
params: this.params,
|
|
271
|
-
query: new QueryString(this.query),
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
#onClickDropdown = async (e) => {
|
|
276
|
-
e.stopPropagation();
|
|
277
|
-
if (this.disabled)
|
|
278
|
-
return;
|
|
279
|
-
if (this.dropdown) {
|
|
280
|
-
const { value: element } = this.#dropdownRef;
|
|
281
|
-
const { right, bottom } = element.getBoundingClientRect();
|
|
282
|
-
const { width } = this.getBoundingClientRect();
|
|
283
|
-
element.active = true;
|
|
284
|
-
await ContextMenu.open(this.dropdown, {
|
|
285
|
-
x: right - width,
|
|
286
|
-
y: bottom,
|
|
287
|
-
width: `${width}px`,
|
|
288
|
-
});
|
|
289
|
-
element.active = false;
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
#init = __runInitializers(this, _private_init_initializers, () => addListener(this, 'click', this.#onClick));
|
|
293
|
-
#theme = (__runInitializers(this, _private_init_extraInitializers), __runInitializers(this, _private_theme_initializers, () => {
|
|
294
|
-
if (this.disabled)
|
|
295
|
-
return { bg: theme.disabledColor, color: theme.backgroundColor };
|
|
296
|
-
switch (this.color) {
|
|
297
|
-
case 'normal':
|
|
298
|
-
return { bg: theme.primaryColor, color: theme.backgroundColor };
|
|
299
|
-
case 'danger':
|
|
300
|
-
return { bg: theme.negativeColor, color: theme.backgroundColor };
|
|
301
|
-
case 'cancel':
|
|
302
|
-
return { bg: theme.hoverBackgroundColor, color: theme.textColor };
|
|
303
|
-
default:
|
|
304
|
-
return { bg: getSemanticColor(this.color) || this.color || theme.primaryColor, color: theme.backgroundColor };
|
|
305
|
-
}
|
|
306
|
-
}));
|
|
307
|
-
render = (__runInitializers(this, _private_theme_extraInitializers), () => {
|
|
308
|
-
return html `
|
|
309
|
-
<div
|
|
310
|
-
role="button"
|
|
311
|
-
tabindex=${-Number(this.disabled)}
|
|
312
|
-
aria-disabled=${this.disabled}
|
|
313
|
-
@keydown=${commonHandle}
|
|
314
|
-
class=${classMap({ content: true, corner: !!this.dropdown })}
|
|
315
|
-
part=${DuoyunButtonElement.button}
|
|
316
|
-
>
|
|
317
|
-
<dy-use v-if=${!!this.icon} class="icon" .element=${this.icon}></dy-use>
|
|
318
|
-
<slot></slot>
|
|
319
|
-
</div>
|
|
320
|
-
<dy-use
|
|
321
|
-
${this.#dropdownRef}
|
|
322
|
-
v-if=${!!this.dropdown}
|
|
323
|
-
class="dropdown"
|
|
324
|
-
part=${DuoyunButtonElement.dropdown}
|
|
325
|
-
@keydown=${commonHandle}
|
|
326
|
-
role="button"
|
|
327
|
-
tabindex=${-Number(this.disabled)}
|
|
328
|
-
aria-disabled=${this.disabled}
|
|
329
|
-
@click=${this.#onClickDropdown}
|
|
330
|
-
.element=${icons.expand}
|
|
331
|
-
></dy-use>
|
|
332
|
-
`;
|
|
333
|
-
});
|
|
334
|
-
static {
|
|
335
|
-
__runInitializers(_classThis, _static_dropdown_extraInitializers);
|
|
336
56
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
337
57
|
}
|
|
338
58
|
};
|
package/elements/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/elements/button.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/elements/button.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,MAAM,KAAK,GAAG,GAAG,CAAA;;;;CAIhB,CAAC;IAIW,mBAAmB;4BAF/B,aAAa,CAAC,WAAW,CAAC,EAC1B,YAAY,CAAC,KAAK,CAAC;;;;sBACqB,gBAAgB;mCAAxB,SAAQ,WAAgB;;;;YAAzD,6KAA4D;;;YAA/C,uDAAmB;;;;;SAAnB,mBAAmB"}
|
package/elements/checkbox.d.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import type { Option } from './radio';
|
|
4
|
-
import './use';
|
|
5
|
-
export declare class DuoyunCheckboxElement extends GemElement {
|
|
6
|
-
#private;
|
|
7
|
-
static unnamed: string;
|
|
8
|
-
checked: boolean;
|
|
9
|
-
indeterminate: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
change: Emitter<boolean>;
|
|
12
|
-
value: string;
|
|
13
|
-
render: () => import("@mantou/gem/lib/lit-html").TemplateResult;
|
|
1
|
+
import { TapCheckboxElement, TapCheckboxGroupElement } from '@mantou/tap-ui/elements/checkbox';
|
|
2
|
+
export declare class DuoyunCheckboxElement extends TapCheckboxElement {
|
|
14
3
|
}
|
|
15
|
-
export declare class DuoyunCheckboxGroupElement extends
|
|
16
|
-
#private;
|
|
17
|
-
orientation: 'horizontal' | 'vertical';
|
|
18
|
-
disabled: boolean;
|
|
19
|
-
change: Emitter<any[]>;
|
|
20
|
-
value?: any[];
|
|
21
|
-
options?: Option[];
|
|
22
|
-
render: () => import("@mantou/gem/lib/lit-html").TemplateResult | null;
|
|
4
|
+
export declare class DuoyunCheckboxGroupElement extends TapCheckboxGroupElement {
|
|
23
5
|
}
|
|
24
6
|
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../src/elements/checkbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../src/elements/checkbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE/F,qBACa,qBAAsB,SAAQ,kBAAkB;CAAG;AAEhE,qBACa,0BAA2B,SAAQ,uBAAuB;CAAG"}
|
package/elements/checkbox.js
CHANGED
|
@@ -32,134 +32,21 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import { addListener } from '@mantou/gem/lib/utils';
|
|
38
|
-
import { commonHandle } from '../lib/hotkeys';
|
|
39
|
-
import { icons } from '../lib/icons';
|
|
40
|
-
import { focusStyle } from '../lib/styles';
|
|
41
|
-
import { theme } from '../lib/theme';
|
|
42
|
-
import { groupStyle } from './radio';
|
|
43
|
-
import './use';
|
|
44
|
-
const style = css `
|
|
45
|
-
:host(:where(:not([hidden]))) {
|
|
46
|
-
cursor: default;
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
gap: 0.5em;
|
|
50
|
-
line-height: 2;
|
|
51
|
-
}
|
|
52
|
-
:host([disabled]) {
|
|
53
|
-
cursor: not-allowed;
|
|
54
|
-
opacity: 0.3;
|
|
55
|
-
}
|
|
56
|
-
.checkbox {
|
|
57
|
-
box-sizing: border-box;
|
|
58
|
-
width: 1em;
|
|
59
|
-
aspect-ratio: 1;
|
|
60
|
-
/* webkit bug */
|
|
61
|
-
height: 1em;
|
|
62
|
-
background-clip: content-box;
|
|
63
|
-
padding: 0;
|
|
64
|
-
color: ${theme.backgroundColor};
|
|
65
|
-
border: 1px solid ${theme.primaryColor};
|
|
66
|
-
border-radius: ${theme.smallRound};
|
|
67
|
-
transform: scale(1.001);
|
|
68
|
-
transition: background 0.1s;
|
|
69
|
-
}
|
|
70
|
-
:host(:not([disabled])) .checkbox {
|
|
71
|
-
box-shadow: ${theme.controlShadow};
|
|
72
|
-
}
|
|
73
|
-
.checkbox::part(icon) {
|
|
74
|
-
stroke-width: 1px;
|
|
75
|
-
stroke: white;
|
|
76
|
-
}
|
|
77
|
-
:host([checked]) .checkbox {
|
|
78
|
-
background-color: ${theme.primaryColor};
|
|
79
|
-
}
|
|
80
|
-
:host([indeterminate]) .checkbox {
|
|
81
|
-
padding: 2px;
|
|
82
|
-
background-color: ${theme.primaryColor};
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
35
|
+
import { customElement } from '@mantou/gem/lib/decorators';
|
|
36
|
+
import { TapCheckboxElement, TapCheckboxGroupElement } from '@mantou/tap-ui/elements/checkbox';
|
|
85
37
|
let DuoyunCheckboxElement = (() => {
|
|
86
|
-
let _classDecorators = [customElement('dy-checkbox')
|
|
38
|
+
let _classDecorators = [customElement('dy-checkbox')];
|
|
87
39
|
let _classDescriptor;
|
|
88
40
|
let _classExtraInitializers = [];
|
|
89
41
|
let _classThis;
|
|
90
|
-
let _classSuper =
|
|
91
|
-
let _static_unnamed_decorators;
|
|
92
|
-
let _static_unnamed_initializers = [];
|
|
93
|
-
let _static_unnamed_extraInitializers = [];
|
|
94
|
-
let _checked_decorators;
|
|
95
|
-
let _checked_initializers = [];
|
|
96
|
-
let _checked_extraInitializers = [];
|
|
97
|
-
let _indeterminate_decorators;
|
|
98
|
-
let _indeterminate_initializers = [];
|
|
99
|
-
let _indeterminate_extraInitializers = [];
|
|
100
|
-
let _disabled_decorators;
|
|
101
|
-
let _disabled_initializers = [];
|
|
102
|
-
let _disabled_extraInitializers = [];
|
|
103
|
-
let _change_decorators;
|
|
104
|
-
let _change_initializers = [];
|
|
105
|
-
let _change_extraInitializers = [];
|
|
106
|
-
let _value_decorators;
|
|
107
|
-
let _value_initializers = [];
|
|
108
|
-
let _value_extraInitializers = [];
|
|
109
|
-
let _private_init_decorators;
|
|
110
|
-
let _private_init_initializers = [];
|
|
111
|
-
let _private_init_extraInitializers = [];
|
|
42
|
+
let _classSuper = TapCheckboxElement;
|
|
112
43
|
var DuoyunCheckboxElement = class extends _classSuper {
|
|
113
44
|
static { _classThis = this; }
|
|
114
45
|
static {
|
|
115
46
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
116
|
-
_static_unnamed_decorators = [slot];
|
|
117
|
-
_checked_decorators = [boolattribute];
|
|
118
|
-
_indeterminate_decorators = [boolattribute];
|
|
119
|
-
_disabled_decorators = [boolattribute];
|
|
120
|
-
_change_decorators = [globalemitter];
|
|
121
|
-
_value_decorators = [attribute];
|
|
122
|
-
_private_init_decorators = [mounted()];
|
|
123
|
-
__esDecorate(null, null, _static_unnamed_decorators, { kind: "field", name: "unnamed", static: true, private: false, access: { has: obj => "unnamed" in obj, get: obj => obj.unnamed, set: (obj, value) => { obj.unnamed = value; } }, metadata: _metadata }, _static_unnamed_initializers, _static_unnamed_extraInitializers);
|
|
124
|
-
__esDecorate(null, null, _checked_decorators, { kind: "field", name: "checked", static: false, private: false, access: { has: obj => "checked" in obj, get: obj => obj.checked, set: (obj, value) => { obj.checked = value; } }, metadata: _metadata }, _checked_initializers, _checked_extraInitializers);
|
|
125
|
-
__esDecorate(null, null, _indeterminate_decorators, { kind: "field", name: "indeterminate", static: false, private: false, access: { has: obj => "indeterminate" in obj, get: obj => obj.indeterminate, set: (obj, value) => { obj.indeterminate = value; } }, metadata: _metadata }, _indeterminate_initializers, _indeterminate_extraInitializers);
|
|
126
|
-
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
127
|
-
__esDecorate(null, null, _change_decorators, { kind: "field", name: "change", static: false, private: false, access: { has: obj => "change" in obj, get: obj => obj.change, set: (obj, value) => { obj.change = value; } }, metadata: _metadata }, _change_initializers, _change_extraInitializers);
|
|
128
|
-
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
129
|
-
__esDecorate(null, null, _private_init_decorators, { kind: "field", name: "#init", static: false, private: true, access: { has: obj => #init in obj, get: obj => obj.#init, set: (obj, value) => { obj.#init = value; } }, metadata: _metadata }, _private_init_initializers, _private_init_extraInitializers);
|
|
130
47
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
131
48
|
DuoyunCheckboxElement = _classThis = _classDescriptor.value;
|
|
132
49
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
133
|
-
}
|
|
134
|
-
static unnamed = __runInitializers(_classThis, _static_unnamed_initializers, void 0);
|
|
135
|
-
checked = __runInitializers(this, _checked_initializers, void 0);
|
|
136
|
-
indeterminate = (__runInitializers(this, _checked_extraInitializers), __runInitializers(this, _indeterminate_initializers, void 0));
|
|
137
|
-
disabled = (__runInitializers(this, _indeterminate_extraInitializers), __runInitializers(this, _disabled_initializers, void 0));
|
|
138
|
-
change = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _change_initializers, void 0));
|
|
139
|
-
value = (__runInitializers(this, _change_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
140
|
-
#init = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _private_init_initializers, () => addListener(this, 'click', this.#onClick)));
|
|
141
|
-
#onClick = (__runInitializers(this, _private_init_extraInitializers), () => {
|
|
142
|
-
if (this.disabled)
|
|
143
|
-
return;
|
|
144
|
-
this.change(!this.checked);
|
|
145
|
-
});
|
|
146
|
-
render = () => {
|
|
147
|
-
return html `
|
|
148
|
-
<dy-use
|
|
149
|
-
role="checkbox"
|
|
150
|
-
tabindex=${-Number(this.disabled)}
|
|
151
|
-
aria-disabled=${this.disabled}
|
|
152
|
-
aria-labelledby="label"
|
|
153
|
-
aria-checked=${this.indeterminate ? 'mixed' : this.checked}
|
|
154
|
-
class="checkbox"
|
|
155
|
-
@keydown=${commonHandle}
|
|
156
|
-
.element=${this.checked ? icons.check : undefined}
|
|
157
|
-
></dy-use>
|
|
158
|
-
<slot id="label"></slot>
|
|
159
|
-
`;
|
|
160
|
-
};
|
|
161
|
-
static {
|
|
162
|
-
__runInitializers(_classThis, _static_unnamed_extraInitializers);
|
|
163
50
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
164
51
|
}
|
|
165
52
|
};
|
|
@@ -167,81 +54,20 @@ let DuoyunCheckboxElement = (() => {
|
|
|
167
54
|
})();
|
|
168
55
|
export { DuoyunCheckboxElement };
|
|
169
56
|
let DuoyunCheckboxGroupElement = (() => {
|
|
170
|
-
let _classDecorators = [customElement('dy-checkbox-group')
|
|
57
|
+
let _classDecorators = [customElement('dy-checkbox-group')];
|
|
171
58
|
let _classDescriptor;
|
|
172
59
|
let _classExtraInitializers = [];
|
|
173
60
|
let _classThis;
|
|
174
|
-
let _classSuper =
|
|
175
|
-
let _orientation_decorators;
|
|
176
|
-
let _orientation_initializers = [];
|
|
177
|
-
let _orientation_extraInitializers = [];
|
|
178
|
-
let _disabled_decorators;
|
|
179
|
-
let _disabled_initializers = [];
|
|
180
|
-
let _disabled_extraInitializers = [];
|
|
181
|
-
let _change_decorators;
|
|
182
|
-
let _change_initializers = [];
|
|
183
|
-
let _change_extraInitializers = [];
|
|
184
|
-
let _value_decorators;
|
|
185
|
-
let _value_initializers = [];
|
|
186
|
-
let _value_extraInitializers = [];
|
|
187
|
-
let _options_decorators;
|
|
188
|
-
let _options_initializers = [];
|
|
189
|
-
let _options_extraInitializers = [];
|
|
190
|
-
let _private_setValueSet_decorators;
|
|
191
|
-
let _private_setValueSet_initializers = [];
|
|
192
|
-
let _private_setValueSet_extraInitializers = [];
|
|
61
|
+
let _classSuper = TapCheckboxGroupElement;
|
|
193
62
|
var DuoyunCheckboxGroupElement = class extends _classSuper {
|
|
194
63
|
static { _classThis = this; }
|
|
195
64
|
static {
|
|
196
65
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
197
|
-
_orientation_decorators = [attribute];
|
|
198
|
-
_disabled_decorators = [boolattribute];
|
|
199
|
-
_change_decorators = [globalemitter];
|
|
200
|
-
_value_decorators = [property];
|
|
201
|
-
_options_decorators = [property];
|
|
202
|
-
_private_setValueSet_decorators = [memo((i) => [i.value])];
|
|
203
|
-
__esDecorate(null, null, _orientation_decorators, { kind: "field", name: "orientation", static: false, private: false, access: { has: obj => "orientation" in obj, get: obj => obj.orientation, set: (obj, value) => { obj.orientation = value; } }, metadata: _metadata }, _orientation_initializers, _orientation_extraInitializers);
|
|
204
|
-
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
205
|
-
__esDecorate(null, null, _change_decorators, { kind: "field", name: "change", static: false, private: false, access: { has: obj => "change" in obj, get: obj => obj.change, set: (obj, value) => { obj.change = value; } }, metadata: _metadata }, _change_initializers, _change_extraInitializers);
|
|
206
|
-
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
207
|
-
__esDecorate(null, null, _options_decorators, { kind: "field", name: "options", static: false, private: false, access: { has: obj => "options" in obj, get: obj => obj.options, set: (obj, value) => { obj.options = value; } }, metadata: _metadata }, _options_initializers, _options_extraInitializers);
|
|
208
|
-
__esDecorate(null, null, _private_setValueSet_decorators, { kind: "field", name: "#setValueSet", static: false, private: true, access: { has: obj => #setValueSet in obj, get: obj => obj.#setValueSet, set: (obj, value) => { obj.#setValueSet = value; } }, metadata: _metadata }, _private_setValueSet_initializers, _private_setValueSet_extraInitializers);
|
|
209
66
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
210
67
|
DuoyunCheckboxGroupElement = _classThis = _classDescriptor.value;
|
|
211
68
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
212
69
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
213
70
|
}
|
|
214
|
-
orientation = __runInitializers(this, _orientation_initializers, void 0);
|
|
215
|
-
disabled = (__runInitializers(this, _orientation_extraInitializers), __runInitializers(this, _disabled_initializers, void 0));
|
|
216
|
-
change = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _change_initializers, void 0));
|
|
217
|
-
value = (__runInitializers(this, _change_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
218
|
-
options = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _options_initializers, void 0));
|
|
219
|
-
#valueSet = __runInitializers(this, _options_extraInitializers);
|
|
220
|
-
#setValueSet = __runInitializers(this, _private_setValueSet_initializers, () => (this.#valueSet = new Set(this.value)));
|
|
221
|
-
#onChange = (__runInitializers(this, _private_setValueSet_extraInitializers), (evt, value) => {
|
|
222
|
-
evt.stopPropagation();
|
|
223
|
-
const newValue = new Set(this.#valueSet);
|
|
224
|
-
if (evt.detail) {
|
|
225
|
-
newValue.add(value);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
newValue.delete(value);
|
|
229
|
-
}
|
|
230
|
-
this.change([...newValue]);
|
|
231
|
-
});
|
|
232
|
-
render = () => {
|
|
233
|
-
if (!this.options)
|
|
234
|
-
return null;
|
|
235
|
-
return html `${this.options.map(({ label, value }) => html `
|
|
236
|
-
<dy-checkbox
|
|
237
|
-
?disabled=${this.disabled}
|
|
238
|
-
?checked=${this.#valueSet.has(value ?? label)}
|
|
239
|
-
@change=${(evt) => this.#onChange(evt, value ?? label)}
|
|
240
|
-
>
|
|
241
|
-
${label}
|
|
242
|
-
</dy-checkbox>
|
|
243
|
-
`)}`;
|
|
244
|
-
};
|
|
245
71
|
};
|
|
246
72
|
return DuoyunCheckboxGroupElement = _classThis;
|
|
247
73
|
})();
|
package/elements/checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../src/elements/checkbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../src/elements/checkbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;IAGlF,qBAAqB;4BADjC,aAAa,CAAC,aAAa,CAAC;;;;sBACc,kBAAkB;qCAA1B,SAAQ,WAAkB;;;;YAA7D,6KAAgE;;;YAAnD,uDAAqB;;;;;SAArB,qBAAqB;IAGrB,0BAA0B;4BADtC,aAAa,CAAC,mBAAmB,CAAC;;;;sBACa,uBAAuB;0CAA/B,SAAQ,WAAuB;;;;YAAvE,6KAA0E;;;YAA7D,uDAA0B;;;;;SAA1B,0BAA0B"}
|
package/elements/code-block.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class DuoyunCodeBlockElement extends
|
|
3
|
-
#private;
|
|
4
|
-
codelang: string;
|
|
5
|
-
range: string;
|
|
6
|
-
highlight: string;
|
|
7
|
-
render(): import("@mantou/gem/lib/lit-html").TemplateResult;
|
|
1
|
+
import { TapCodeBlockElement } from '@mantou/tap-ui/elements/code-block';
|
|
2
|
+
export declare class DuoyunCodeBlockElement extends TapCodeBlockElement {
|
|
8
3
|
}
|
|
9
4
|
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../src/elements/code-block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../src/elements/code-block.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,qBACa,sBAAuB,SAAQ,mBAAmB;CAAG"}
|