@flitsmeister/design-system 3.0.2 → 3.1.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/README.md +93 -1
- package/dist/ce/dom.d.ts +2 -0
- package/dist/ce/dom.d.ts.map +1 -0
- package/dist/ce/dom.js +11 -0
- package/dist/ce/dom.js.map +1 -0
- package/dist/ce/implicit-form-submit.d.ts +2 -0
- package/dist/ce/implicit-form-submit.d.ts.map +1 -0
- package/dist/ce/implicit-form-submit.js +27 -0
- package/dist/ce/implicit-form-submit.js.map +1 -0
- package/dist/fm-button/fm-button.d.ts +4 -1
- package/dist/fm-button/fm-button.d.ts.map +1 -1
- package/dist/fm-button/fm-button.js +4 -1
- package/dist/fm-button/fm-button.js.map +1 -1
- package/dist/fm-button/fm-button.style.js +7 -7
- package/dist/fm-dropdown/fm-dropdown.style.js +6 -6
- package/dist/fm-icon/fm-icon.style.js +4 -4
- package/dist/fm-input/fm-input.d.ts +21 -3
- package/dist/fm-input/fm-input.d.ts.map +1 -1
- package/dist/fm-input/fm-input.js +25 -6
- package/dist/fm-input/fm-input.js.map +1 -1
- package/dist/fm-input/fm-input.style.js +7 -7
- package/dist/fm-radio-input/fm-radio-input.style.js +4 -4
- package/dist/fm-segmented-controller/fm-segmented-controller.style.d.ts.map +1 -1
- package/dist/fm-segmented-controller/fm-segmented-controller.style.js +7 -8
- package/dist/fm-segmented-controller/fm-segmented-controller.style.js.map +1 -1
- package/dist/fm-wizard/fm-wizard.style.js +5 -5
- package/dist/react/ce.d.ts +14 -0
- package/dist/react/ce.d.ts.map +1 -0
- package/dist/react/ce.js +43 -0
- package/dist/react/ce.js.map +1 -0
- package/dist/react/fm-button.d.ts +27 -0
- package/dist/react/fm-button.d.ts.map +1 -0
- package/dist/react/fm-button.js +26 -0
- package/dist/react/fm-button.js.map +1 -0
- package/dist/react/fm-dropdown.d.ts +13 -0
- package/dist/react/fm-dropdown.d.ts.map +1 -0
- package/dist/react/fm-dropdown.js +19 -0
- package/dist/react/fm-dropdown.js.map +1 -0
- package/dist/react/fm-icon.d.ts +11 -0
- package/dist/react/fm-icon.d.ts.map +1 -0
- package/dist/react/fm-icon.js +13 -0
- package/dist/react/fm-icon.js.map +1 -0
- package/dist/react/fm-input.d.ts +30 -0
- package/dist/react/fm-input.d.ts.map +1 -0
- package/dist/react/fm-input.js +52 -0
- package/dist/react/fm-input.js.map +1 -0
- package/dist/react/fm-radio-input.d.ts +15 -0
- package/dist/react/fm-radio-input.d.ts.map +1 -0
- package/dist/react/fm-radio-input.js +15 -0
- package/dist/react/fm-radio-input.js.map +1 -0
- package/dist/react/fm-segmented-controller.d.ts +13 -0
- package/dist/react/fm-segmented-controller.d.ts.map +1 -0
- package/dist/react/fm-segmented-controller.js +16 -0
- package/dist/react/fm-segmented-controller.js.map +1 -0
- package/dist/react/index.d.ts +14 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +8 -0
- package/dist/react/index.js.map +1 -0
- package/dist/vue/ce.d.ts +3 -0
- package/dist/vue/ce.d.ts.map +1 -0
- package/dist/vue/ce.js +16 -0
- package/dist/vue/ce.js.map +1 -0
- package/dist/vue/fm-button.d.ts +164 -0
- package/dist/vue/fm-button.d.ts.map +1 -0
- package/dist/vue/fm-button.js +67 -0
- package/dist/vue/fm-button.js.map +1 -0
- package/dist/vue/fm-dropdown.d.ts +65 -0
- package/dist/vue/fm-dropdown.d.ts.map +1 -0
- package/dist/vue/fm-dropdown.js +40 -0
- package/dist/vue/fm-dropdown.js.map +1 -0
- package/dist/vue/fm-input.d.ts +150 -0
- package/dist/vue/fm-input.d.ts.map +1 -0
- package/dist/vue/fm-input.js +93 -0
- package/dist/vue/fm-input.js.map +1 -0
- package/dist/vue/index.d.ts +6 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +4 -0
- package/dist/vue/index.js.map +1 -0
- package/icons/bold/add.svg +3 -0
- package/icons/bold/check.svg +3 -0
- package/icons/bold/checkbox-checked.svg +4 -0
- package/icons/bold/checkbox-unchecked.svg +3 -0
- package/icons/bold/chevron-backward.svg +3 -0
- package/icons/bold/chevron-down.svg +3 -0
- package/icons/bold/chevron-forward.svg +3 -0
- package/icons/bold/chevron-up.svg +3 -0
- package/icons/bold/close-1.svg +3 -0
- package/icons/bold/close.svg +4 -0
- package/icons/bold/dot.svg +3 -0
- package/icons/bold/open-external.svg +3 -0
- package/icons/bold/prominent-1.svg +3 -0
- package/icons/bold/prominent.svg +3 -0
- package/icons/bold/question.svg +4 -0
- package/icons/bold/remove.svg +3 -0
- package/icons/bold/search.svg +3 -0
- package/icons/bold/spinner.svg +3 -0
- package/icons/bold/warning.svg +3 -0
- package/icons/duotone/check.svg +4 -0
- package/icons/filled/achievements.svg +3 -0
- package/icons/filled/add.svg +3 -0
- package/icons/filled/app-settings.svg +3 -0
- package/icons/filled/calendar.svg +7 -0
- package/icons/filled/car-simplified.svg +3 -0
- package/icons/filled/check.svg +3 -0
- package/icons/filled/clock.svg +3 -0
- package/icons/filled/close.svg +3 -0
- package/icons/filled/control.svg +7 -0
- package/icons/filled/danger.svg +3 -0
- package/icons/filled/delete.svg +3 -0
- package/icons/filled/deviceOne.svg +3 -0
- package/icons/filled/deviceTwo.svg +3 -0
- package/icons/filled/disputeFine.svg +3 -0
- package/icons/filled/email.svg +3 -0
- package/icons/filled/gasPrices.svg +3 -0
- package/icons/filled/hazard.svg +3 -0
- package/icons/filled/highway.svg +3 -0
- package/icons/filled/info.svg +3 -0
- package/icons/filled/lock-close.svg +3 -0
- package/icons/filled/lock-open.svg +3 -0
- package/icons/filled/lock.svg +3 -0
- package/icons/filled/microphone.svg +4 -0
- package/icons/filled/notificaiton-unread.svg +4 -0
- package/icons/filled/notificaiton.svg +3 -0
- package/icons/filled/parking.svg +3 -0
- package/icons/filled/play.svg +8 -0
- package/icons/filled/question.svg +3 -0
- package/icons/filled/rating-empty.svg +3 -0
- package/icons/filled/rating-full.svg +3 -0
- package/icons/filled/rating-half.svg +4 -0
- package/icons/filled/remove.svg +3 -0
- package/icons/filled/return-location.svg +3 -0
- package/icons/filled/support.svg +3 -0
- package/icons/filled/toll.svg +3 -0
- package/icons/filled/tripHistory.svg +3 -0
- package/icons/filled/truck.svg +3 -0
- package/icons/filled/user-pin.svg +3 -0
- package/icons/filled/user-profile.svg +3 -0
- package/icons/filled/warning.svg +3 -0
- package/icons/filled/zone-default.svg +3 -0
- package/icons/filled/zone-indoor.svg +3 -0
- package/icons/filled/zone-street.svg +3 -0
- package/icons/stroke/arrow-Down.svg +3 -0
- package/icons/stroke/arrow-Up.svg +3 -0
- package/icons/stroke/arrow-left.svg +3 -0
- package/icons/stroke/arrow-right.svg +3 -0
- package/icons/stroke/check.svg +3 -0
- package/icons/stroke/checkbox-checked.svg +4 -0
- package/icons/stroke/checkbox-unchecked.svg +3 -0
- package/icons/stroke/chevron-backward.svg +3 -0
- package/icons/stroke/chevron-down.svg +3 -0
- package/icons/stroke/chevron-forward.svg +3 -0
- package/icons/stroke/chevron-up.svg +3 -0
- package/icons/stroke/clock.svg +3 -0
- package/icons/stroke/close-1.svg +3 -0
- package/icons/stroke/close.svg +4 -0
- package/icons/stroke/download.svg +4 -0
- package/icons/stroke/email.svg +4 -0
- package/icons/stroke/hamburger.svg +3 -0
- package/icons/stroke/login.svg +4 -0
- package/icons/stroke/logout.svg +3 -0
- package/icons/stroke/more.svg +5 -0
- package/icons/stroke/open-external.svg +3 -0
- package/icons/stroke/question.svg +4 -0
- package/icons/stroke/search.svg +3 -0
- package/icons/stroke/spinner.svg +3 -0
- package/icons/stroke/warning.svg +3 -0
- package/package.json +78 -14
- package/scripts/bundle-cli.mjs +16 -0
- package/scripts/copy-package-assets.mjs +19 -0
- package/scripts/install-cli.bundled.mjs +1637 -0
- package/styles/fm-design-system/fm-design-system.css +921 -0
- package/styles/fm-design-system/fm-design-system.tailwind.css +323 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../fm-button/fm-button.js';
|
|
3
|
+
import type { ButtonType, ButtonVariant, IconPosition, Role, Size } from '../fm-button/fm-button-core.js';
|
|
4
|
+
import type { IconVariant } from '../fm-icon/icon-registry.generated.js';
|
|
5
|
+
export declare const FmButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
type: {
|
|
7
|
+
type: PropType<ButtonType>;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
title: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
href: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
target: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
size: {
|
|
23
|
+
type: PropType<Size>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
role: {
|
|
27
|
+
type: PropType<Role>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
buttontype: {
|
|
31
|
+
type: PropType<ButtonVariant>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
icon: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
iconVariant: {
|
|
39
|
+
type: PropType<IconVariant>;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
iconPosition: {
|
|
43
|
+
type: PropType<IconPosition>;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
disabled: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
loading: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
error: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
success: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
errorRetryLabel: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
customClasses: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
70
|
+
fullWidth: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
type: {
|
|
78
|
+
type: PropType<ButtonType>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
title: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
href: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
target: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
size: {
|
|
94
|
+
type: PropType<Size>;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
role: {
|
|
98
|
+
type: PropType<Role>;
|
|
99
|
+
default: string;
|
|
100
|
+
};
|
|
101
|
+
buttontype: {
|
|
102
|
+
type: PropType<ButtonVariant>;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
icon: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
iconVariant: {
|
|
110
|
+
type: PropType<IconVariant>;
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
113
|
+
iconPosition: {
|
|
114
|
+
type: PropType<IconPosition>;
|
|
115
|
+
default: string;
|
|
116
|
+
};
|
|
117
|
+
disabled: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: boolean;
|
|
120
|
+
};
|
|
121
|
+
loading: {
|
|
122
|
+
type: BooleanConstructor;
|
|
123
|
+
default: boolean;
|
|
124
|
+
};
|
|
125
|
+
error: {
|
|
126
|
+
type: BooleanConstructor;
|
|
127
|
+
default: boolean;
|
|
128
|
+
};
|
|
129
|
+
success: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
133
|
+
errorRetryLabel: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
customClasses: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
141
|
+
fullWidth: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
144
|
+
};
|
|
145
|
+
}>> & Readonly<{}>, {
|
|
146
|
+
success: boolean;
|
|
147
|
+
type: ButtonType;
|
|
148
|
+
size: Size;
|
|
149
|
+
role: Role;
|
|
150
|
+
buttontype: ButtonVariant;
|
|
151
|
+
loading: boolean;
|
|
152
|
+
error: boolean;
|
|
153
|
+
customClasses: string;
|
|
154
|
+
title: string;
|
|
155
|
+
href: string;
|
|
156
|
+
target: string;
|
|
157
|
+
icon: string;
|
|
158
|
+
iconVariant: "bold" | "filled" | "stroke" | "duotone";
|
|
159
|
+
iconPosition: IconPosition;
|
|
160
|
+
disabled: boolean;
|
|
161
|
+
errorRetryLabel: string;
|
|
162
|
+
fullWidth: boolean;
|
|
163
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
164
|
+
//# sourceMappingURL=fm-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fm-button.d.ts","sourceRoot":"","sources":["../../src/vue/fm-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAC9D,OAAO,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,IAAI,EACL,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAA;AAGxE,eAAO,MAAM,QAAQ;;cAIO,QAAQ,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;cAIpB,QAAQ,CAAC,IAAI,CAAC;;;;cACd,QAAQ,CAAC,IAAI,CAAC;;;;cACR,QAAQ,CAAC,aAAa,CAAC;;;;;;;;cAEtB,QAAQ,CAAC,WAAW,CAAC;;;;cACpB,QAAQ,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAT9B,QAAQ,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;cAIpB,QAAQ,CAAC,IAAI,CAAC;;;;cACd,QAAQ,CAAC,IAAI,CAAC;;;;cACR,QAAQ,CAAC,aAAa,CAAC;;;;;;;;cAEtB,QAAQ,CAAC,WAAW,CAAC;;;;cACpB,QAAQ,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAyDxD,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent, h, watch } from 'vue';
|
|
2
|
+
import '../fm-button/fm-button.js';
|
|
3
|
+
import { boolAttr, callHandler } from './ce.js';
|
|
4
|
+
export const FmButton = defineComponent({
|
|
5
|
+
name: 'FmButton',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
type: { type: String, default: 'button' },
|
|
9
|
+
title: { type: String, default: '' },
|
|
10
|
+
href: { type: String, default: '/' },
|
|
11
|
+
target: { type: String, default: '_self' },
|
|
12
|
+
size: { type: String, default: 'md' },
|
|
13
|
+
role: { type: String, default: 'strong' },
|
|
14
|
+
buttontype: { type: String, default: 'filled' },
|
|
15
|
+
icon: { type: String, default: '' },
|
|
16
|
+
iconVariant: { type: String, default: 'bold' },
|
|
17
|
+
iconPosition: { type: String, default: 'prepend' },
|
|
18
|
+
disabled: { type: Boolean, default: false },
|
|
19
|
+
loading: { type: Boolean, default: false },
|
|
20
|
+
error: { type: Boolean, default: false },
|
|
21
|
+
success: { type: Boolean, default: false },
|
|
22
|
+
errorRetryLabel: { type: String, default: '' },
|
|
23
|
+
customClasses: { type: String, default: '' },
|
|
24
|
+
fullWidth: { type: Boolean, default: false }
|
|
25
|
+
},
|
|
26
|
+
setup(props, { slots, attrs }) {
|
|
27
|
+
watch(() => props.icon, (icon) => {
|
|
28
|
+
if (icon)
|
|
29
|
+
void import('../fm-icon/all.js');
|
|
30
|
+
}, { immediate: true });
|
|
31
|
+
const handleClick = (event) => {
|
|
32
|
+
callHandler(attrs.onClick, event);
|
|
33
|
+
if (props.disabled || props.loading || event.defaultPrevented)
|
|
34
|
+
return;
|
|
35
|
+
const host = event.currentTarget;
|
|
36
|
+
const form = host?.closest('form');
|
|
37
|
+
if (!form)
|
|
38
|
+
return;
|
|
39
|
+
if (props.type === 'submit')
|
|
40
|
+
form.requestSubmit();
|
|
41
|
+
else if (props.type === 'reset')
|
|
42
|
+
form.reset();
|
|
43
|
+
};
|
|
44
|
+
return () => h('fm-button', {
|
|
45
|
+
...attrs,
|
|
46
|
+
type: props.type,
|
|
47
|
+
title: props.title,
|
|
48
|
+
href: props.href,
|
|
49
|
+
target: props.target,
|
|
50
|
+
size: props.size,
|
|
51
|
+
role: props.role,
|
|
52
|
+
buttontype: props.buttontype,
|
|
53
|
+
icon: props.icon,
|
|
54
|
+
'icon-variant': props.iconVariant,
|
|
55
|
+
'icon-position': props.iconPosition,
|
|
56
|
+
disabled: boolAttr(props.disabled),
|
|
57
|
+
loading: boolAttr(props.loading),
|
|
58
|
+
error: boolAttr(props.error),
|
|
59
|
+
success: boolAttr(props.success),
|
|
60
|
+
'error-retry-label': props.errorRetryLabel,
|
|
61
|
+
'custom-classes': props.customClasses,
|
|
62
|
+
'full-width': boolAttr(props.fullWidth),
|
|
63
|
+
onClick: handleClick
|
|
64
|
+
}, slots.default?.());
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=fm-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fm-button.js","sourceRoot":"","sources":["../../src/vue/fm-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAiB,MAAM,KAAK,CAAA;AAC9D,OAAO,2BAA2B,CAAA;AASlC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAA8B,EAAE,OAAO,EAAE,QAAQ,EAAE;QACjE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QACpC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE;QACpC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE;QAC1C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,OAAO,EAAE,IAAI,EAAE;QACvD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC3D,UAAU,EAAE,EAAE,IAAI,EAAE,MAAiC,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,WAAW,EAAE,EAAE,IAAI,EAAE,MAA+B,EAAE,OAAO,EAAE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StringConstructor;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
value: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
11
|
+
name: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
disabled: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
grayBorder: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("fm-dropdown" | "update:modelValue")[], "fm-dropdown" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
value: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
name: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
disabled: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
grayBorder: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
}>> & Readonly<{
|
|
55
|
+
"onFm-dropdown"?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
name: string;
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
placeholder: string;
|
|
61
|
+
value: string;
|
|
62
|
+
grayBorder: boolean;
|
|
63
|
+
modelValue: string;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
//# sourceMappingURL=fm-dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fm-dropdown.d.ts","sourceRoot":"","sources":["../../src/vue/fm-dropdown.ts"],"names":[],"mappings":"AACA,OAAO,+BAA+B,CAAA;AAKtC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4CrB,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent, h, onMounted, onUpdated, ref } from 'vue';
|
|
2
|
+
import '../fm-dropdown/fm-dropdown.js';
|
|
3
|
+
import { assignOptionsSlot } from '../ce/dom.js';
|
|
4
|
+
import { boolAttr } from './ce.js';
|
|
5
|
+
export const FmDropdown = defineComponent({
|
|
6
|
+
name: 'FmDropdown',
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: String, default: undefined },
|
|
10
|
+
value: { type: String, default: undefined },
|
|
11
|
+
name: { type: String, default: '' },
|
|
12
|
+
placeholder: { type: String, default: '' },
|
|
13
|
+
disabled: { type: Boolean, default: false },
|
|
14
|
+
grayBorder: { type: Boolean, default: false }
|
|
15
|
+
},
|
|
16
|
+
emits: ['update:modelValue', 'fm-dropdown'],
|
|
17
|
+
setup(props, { emit, slots, attrs }) {
|
|
18
|
+
const elRef = ref(null);
|
|
19
|
+
const currentValue = () => props.modelValue ?? props.value ?? '';
|
|
20
|
+
const syncOptionSlots = () => assignOptionsSlot(elRef.value);
|
|
21
|
+
onMounted(syncOptionSlots);
|
|
22
|
+
onUpdated(syncOptionSlots);
|
|
23
|
+
const handleChange = (event) => {
|
|
24
|
+
const customEvent = event;
|
|
25
|
+
emit('update:modelValue', customEvent.detail.value);
|
|
26
|
+
emit('fm-dropdown', customEvent);
|
|
27
|
+
};
|
|
28
|
+
return () => h('fm-dropdown', {
|
|
29
|
+
...attrs,
|
|
30
|
+
ref: elRef,
|
|
31
|
+
name: props.name,
|
|
32
|
+
value: currentValue(),
|
|
33
|
+
placeholder: props.placeholder,
|
|
34
|
+
disabled: boolAttr(props.disabled),
|
|
35
|
+
'gray-border': boolAttr(props.grayBorder),
|
|
36
|
+
onFmDropdown: handleChange
|
|
37
|
+
}, slots.default?.());
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=fm-dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fm-dropdown.js","sourceRoot":"","sources":["../../src/vue/fm-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACnE,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;QAChD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;QAC3C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EA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AAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../fm-input/fm-input.js';
|
|
3
|
+
import type { ValidationRule } from '../fm-input/fm-input.js';
|
|
4
|
+
type InputType = 'text' | 'search' | 'email' | 'number' | 'password' | 'tel';
|
|
5
|
+
export type FmInputExpose = {
|
|
6
|
+
validate: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const FmInput: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
value: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
type: {
|
|
18
|
+
type: PropType<InputType>;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
placeholder: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
rules: {
|
|
26
|
+
type: PropType<ValidationRule[]>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
readonly: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
loading: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
grayBorder: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
maxLength: {
|
|
46
|
+
type: PropType<number | null>;
|
|
47
|
+
default: null;
|
|
48
|
+
};
|
|
49
|
+
letterSpacing: {
|
|
50
|
+
type: NumberConstructor;
|
|
51
|
+
default: number;
|
|
52
|
+
};
|
|
53
|
+
autocomplete: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
/** Shadow-only class on `.inputgroup`; not a Tailwind API. Prefer host `class` for layout. */
|
|
58
|
+
customClass: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
/** Shadow-only class on `<input>`; not a Tailwind API. Prefer host `class` for layout. */
|
|
63
|
+
inputClass: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
68
|
+
[key: string]: any;
|
|
69
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("fm-input" | "fm-focus" | "fm-blur" | "update:modelValue")[], "fm-input" | "fm-focus" | "fm-blur" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
|
+
modelValue: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
value: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
type: {
|
|
79
|
+
type: PropType<InputType>;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
placeholder: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
default: string;
|
|
85
|
+
};
|
|
86
|
+
rules: {
|
|
87
|
+
type: PropType<ValidationRule[]>;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
disabled: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
94
|
+
readonly: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
loading: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
grayBorder: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
maxLength: {
|
|
107
|
+
type: PropType<number | null>;
|
|
108
|
+
default: null;
|
|
109
|
+
};
|
|
110
|
+
letterSpacing: {
|
|
111
|
+
type: NumberConstructor;
|
|
112
|
+
default: number;
|
|
113
|
+
};
|
|
114
|
+
autocomplete: {
|
|
115
|
+
type: StringConstructor;
|
|
116
|
+
default: string;
|
|
117
|
+
};
|
|
118
|
+
/** Shadow-only class on `.inputgroup`; not a Tailwind API. Prefer host `class` for layout. */
|
|
119
|
+
customClass: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
/** Shadow-only class on `<input>`; not a Tailwind API. Prefer host `class` for layout. */
|
|
124
|
+
inputClass: {
|
|
125
|
+
type: StringConstructor;
|
|
126
|
+
default: string;
|
|
127
|
+
};
|
|
128
|
+
}>> & Readonly<{
|
|
129
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
130
|
+
"onFm-input"?: ((...args: any[]) => any) | undefined;
|
|
131
|
+
"onFm-focus"?: ((...args: any[]) => any) | undefined;
|
|
132
|
+
"onFm-blur"?: ((...args: any[]) => any) | undefined;
|
|
133
|
+
}>, {
|
|
134
|
+
type: InputType;
|
|
135
|
+
loading: boolean;
|
|
136
|
+
disabled: boolean;
|
|
137
|
+
placeholder: string;
|
|
138
|
+
value: string;
|
|
139
|
+
rules: ValidationRule[];
|
|
140
|
+
readonly: boolean;
|
|
141
|
+
grayBorder: boolean;
|
|
142
|
+
maxLength: number | null;
|
|
143
|
+
letterSpacing: number;
|
|
144
|
+
autocomplete: string;
|
|
145
|
+
customClass: string;
|
|
146
|
+
inputClass: string;
|
|
147
|
+
modelValue: string;
|
|
148
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=fm-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fm-input.d.ts","sourceRoot":"","sources":["../../src/vue/fm-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnE,OAAO,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAA6B,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxF,KAAK,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAA;AAE5E,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,OAAO;;;;;;;;;;cAMQ,QAAQ,CAAC,SAAS,CAAC;;;;;;;;cAEnB,QAAQ,CAAC,cAAc,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;cAKrB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;;;;;;IAGpD,8FAA8F;;;;;IAE9F,0FAA0F;;;;;;;;;;;;;;;;;cAZlE,QAAQ,CAAC,SAAS,CAAC;;;;;;;;cAEnB,QAAQ,CAAC,cAAc,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;cAKrB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;;;;;;IAGpD,8FAA8F;;;;;IAE9F,0FAA0F;;;;;;;;;;;;;;;;;;;;;;;;;4EA8E5F,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent, h, ref, watch } from 'vue';
|
|
2
|
+
import '../fm-input/fm-input.js';
|
|
3
|
+
import { boolAttr, callHandler } from './ce.js';
|
|
4
|
+
import { requestImplicitFormSubmit } from '../ce/implicit-form-submit.js';
|
|
5
|
+
export const FmInput = defineComponent({
|
|
6
|
+
name: 'FmInput',
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: String, default: undefined },
|
|
10
|
+
value: { type: String, default: undefined },
|
|
11
|
+
type: { type: String, default: 'text' },
|
|
12
|
+
placeholder: { type: String, default: '' },
|
|
13
|
+
rules: { type: Array, default: undefined },
|
|
14
|
+
disabled: { type: Boolean, default: false },
|
|
15
|
+
readonly: { type: Boolean, default: false },
|
|
16
|
+
loading: { type: Boolean, default: false },
|
|
17
|
+
grayBorder: { type: Boolean, default: false },
|
|
18
|
+
maxLength: { type: Number, default: null },
|
|
19
|
+
letterSpacing: { type: Number, default: 0 },
|
|
20
|
+
autocomplete: { type: String, default: '' },
|
|
21
|
+
/** Shadow-only class on `.inputgroup`; not a Tailwind API. Prefer host `class` for layout. */
|
|
22
|
+
customClass: { type: String, default: '' },
|
|
23
|
+
/** Shadow-only class on `<input>`; not a Tailwind API. Prefer host `class` for layout. */
|
|
24
|
+
inputClass: { type: String, default: '' }
|
|
25
|
+
},
|
|
26
|
+
emits: ['update:modelValue', 'fm-input', 'fm-focus', 'fm-blur'],
|
|
27
|
+
setup(props, { emit, expose, attrs }) {
|
|
28
|
+
const elRef = ref(null);
|
|
29
|
+
const currentValue = () => props.modelValue ?? props.value ?? '';
|
|
30
|
+
const syncRules = () => {
|
|
31
|
+
const apply = (el) => {
|
|
32
|
+
if (el && props.rules !== undefined)
|
|
33
|
+
el.rules = props.rules;
|
|
34
|
+
};
|
|
35
|
+
const el = elRef.value;
|
|
36
|
+
if (el && typeof el.validate === 'function') {
|
|
37
|
+
apply(el);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
void customElements.whenDefined('fm-input').then(() => apply(elRef.value));
|
|
41
|
+
};
|
|
42
|
+
watch(() => props.rules, syncRules, { immediate: true });
|
|
43
|
+
const validate = () => {
|
|
44
|
+
const el = elRef.value;
|
|
45
|
+
if (el && typeof el.validate === 'function') {
|
|
46
|
+
el.validate();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
void customElements.whenDefined('fm-input').then(() => {
|
|
50
|
+
elRef.value?.validate?.();
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
expose({ validate });
|
|
54
|
+
const handleInput = (event) => {
|
|
55
|
+
const customEvent = event;
|
|
56
|
+
emit('update:modelValue', customEvent.detail.value);
|
|
57
|
+
emit('fm-input', customEvent);
|
|
58
|
+
};
|
|
59
|
+
const handleKeydown = (event) => {
|
|
60
|
+
callHandler(attrs.onKeydown ?? attrs.onKeyDown, event);
|
|
61
|
+
const keyboardEvent = event;
|
|
62
|
+
if (keyboardEvent.key !== 'Enter' || props.disabled || props.readonly || props.loading)
|
|
63
|
+
return;
|
|
64
|
+
const host = keyboardEvent.currentTarget;
|
|
65
|
+
const form = host?.closest('form');
|
|
66
|
+
if (!form)
|
|
67
|
+
return;
|
|
68
|
+
keyboardEvent.preventDefault();
|
|
69
|
+
requestImplicitFormSubmit(form);
|
|
70
|
+
};
|
|
71
|
+
return () => h('fm-input', {
|
|
72
|
+
...attrs,
|
|
73
|
+
ref: elRef,
|
|
74
|
+
type: props.type,
|
|
75
|
+
placeholder: props.placeholder,
|
|
76
|
+
value: currentValue(),
|
|
77
|
+
disabled: boolAttr(props.disabled),
|
|
78
|
+
readonly: boolAttr(props.readonly),
|
|
79
|
+
loading: boolAttr(props.loading),
|
|
80
|
+
'gray-border': boolAttr(props.grayBorder),
|
|
81
|
+
'max-length': props.maxLength ?? undefined,
|
|
82
|
+
'letter-spacing': props.letterSpacing,
|
|
83
|
+
autocomplete: props.autocomplete,
|
|
84
|
+
'custom-class': props.customClass,
|
|
85
|
+
'input-class': props.inputClass,
|
|
86
|
+
onFmInput: handleInput,
|
|
87
|
+
onFmFocus: (event) => emit('fm-focus', event),
|
|
88
|
+
onFmBlur: (event) => emit('fm-blur', event),
|
|
89
|
+
onKeydown: handleKeydown
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=fm-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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AC,UAAU,EAAE;YACZ,GAAG,KAAK;YACR,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,KAAK,EAAE,YAAY,EAAE;YACrB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;YAClC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;YAClC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;YAChC,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC;YACzC,YAAY,EAAE,KAAK,CAAC,SAAS,IAAI,SAAS;YAC1C,gBAAgB,EAAE,KAAK,CAAC,aAAa;YACrC,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,cAAc,EAAE,KAAK,CAAC,WAAW;YACjC,aAAa,EAAE,KAAK,CAAC,UAAU;YAC/B,SAAS,EAAE,WAAW;YACtB,SAAS,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;YACpD,QAAQ,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;YAClD,SAAS,EAAE,aAAa;SACzB,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { FmButton } from './fm-button.js';
|
|
2
|
+
export { FmInput } from './fm-input.js';
|
|
3
|
+
export type { FmInputExpose } from './fm-input.js';
|
|
4
|
+
export type { ValidationRule } from '../fm-input/fm-input.js';
|
|
5
|
+
export { FmDropdown } from './fm-dropdown.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9998 4C12.9662 4 13.7496 4.7834 13.7497 5.74979L13.7498 10.2501L18.2501 10.25C19.2165 10.2499 20 11.0334 20 11.9998C20 12.9662 19.2166 13.7496 18.2502 13.7496L13.7498 13.7497L13.7499 18.2501C13.75 19.2165 12.9665 20 12.0001 20C11.0338 20 10.2503 19.2166 10.2503 18.2502L10.2502 13.7498L5.74986 13.7499C4.78345 13.7499 4.00002 12.9665 4 12.0001C3.99998 11.0337 4.78338 10.2503 5.74978 10.2502L10.2501 10.2501L10.25 5.74987C10.25 4.78345 11.0334 4 11.9998 4Z" fill="#161616"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.4723 13.8673L6.11191 10.5072C5.42847 9.82379 4.32046 9.82381 3.63706 10.5072C2.95364 11.1907 2.95366 12.2987 3.63712 12.9821L8.23345 17.5781C8.74794 18.0926 9.50305 18.2198 10.1365 17.9596C10.3461 17.8742 10.5425 17.7465 10.7126 17.5764L19.5514 8.7371C20.2347 8.05374 20.2347 6.94582 19.5514 6.26249C18.868 5.57915 17.7601 5.57917 17.0767 6.26254L9.4723 13.8673Z" fill="#161616"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM12.0001 18.5C15.5899 18.5 18.5001 15.5899 18.5001 12C18.5001 8.41018 15.5899 5.50003 12.0001 5.50003C8.41021 5.50003 5.50007 8.41018 5.50007 12C5.50007 15.5899 8.41021 18.5 12.0001 18.5Z" fill="#161616"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8728 12.2889L9.98737 11.4036C9.30394 10.7202 8.19595 10.7203 7.51256 11.4037C6.82912 12.0871 6.82915 13.1952 7.51263 13.8786L9.63404 15.9998C10.1512 16.5169 10.9115 16.6427 11.5469 16.3772C11.7528 16.2918 11.9457 16.1654 12.1132 15.9979L16.3559 11.7549C17.0392 11.0715 17.0391 9.96365 16.3558 9.28032C15.6724 8.59697 14.5645 8.59699 13.8812 9.28038L10.8728 12.2889Z" fill="#161616"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM12.0001 18.5C15.5899 18.5 18.5001 15.5899 18.5001 12C18.5001 8.41018 15.5899 5.50003 12.0001 5.50003C8.41021 5.50003 5.50007 8.41018 5.50007 12C5.50007 15.5899 8.41021 18.5 12.0001 18.5Z" fill="#161616"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7656 3.01261C12.0822 2.32919 10.9742 2.32919 10.2907 3.01261L2.51256 10.7908C2.50722 10.7961 2.50193 10.8015 2.49667 10.8069C2.45988 10.8446 2.42513 10.8836 2.39243 10.9237C2.05606 11.3361 1.93593 11.8661 2.03204 12.3625C2.09611 12.6934 2.25628 13.0094 2.51256 13.2657L10.2907 21.0438C10.9742 21.7273 12.0822 21.7273 12.7656 21.0438C13.449 20.3604 13.449 19.2524 12.7656 18.569L6.22487 12.0282L12.7656 5.48748C13.449 4.80406 13.449 3.69603 12.7656 3.01261Z" fill="#161616"/>
|
|
3
|
+
</svg>
|