@vmscloud/moz-ui-components-core 0.1.42
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/dist/components/avatar/avatar.core.d.ts +39 -0
- package/dist/components/avatar/index.d.ts +14 -0
- package/dist/components/bread-crumb/breadcrumb.core.d.ts +70 -0
- package/dist/components/bread-crumb/icons.d.ts +9 -0
- package/dist/components/bread-crumb/index.d.ts +10 -0
- package/dist/components/button/button.core.d.ts +59 -0
- package/dist/components/button/circleLoader.d.ts +8 -0
- package/dist/components/button/index.d.ts +12 -0
- package/dist/components/calendar/calendar.core.d.ts +25 -0
- package/dist/components/calendar/icons.d.ts +7 -0
- package/dist/components/calendar/index.d.ts +7 -0
- package/dist/components/checkbox/checkbox.core.d.ts +46 -0
- package/dist/components/checkbox/icons.d.ts +9 -0
- package/dist/components/checkbox/index.d.ts +10 -0
- package/dist/components/collapsible/collapsible.core.d.ts +34 -0
- package/dist/components/collapsible/index.d.ts +15 -0
- package/dist/components/context-menu/contextmenu.core.d.ts +58 -0
- package/dist/components/context-menu/index.d.ts +10 -0
- package/dist/components/controller/controller.core.d.ts +44 -0
- package/dist/components/controller/icons.d.ts +12 -0
- package/dist/components/controller/index.d.ts +12 -0
- package/dist/components/date-input/dateinput.core.d.ts +32 -0
- package/dist/components/date-input/icons.d.ts +6 -0
- package/dist/components/date-input/index.d.ts +7 -0
- package/dist/components/empty-state/emptystate.core.d.ts +25 -0
- package/dist/components/empty-state/emptystate.types.d.ts +17 -0
- package/dist/components/empty-state/index.d.ts +8 -0
- package/dist/components/input/icons.d.ts +4 -0
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input/input.core.d.ts +38 -0
- package/dist/components/label/index.d.ts +6 -0
- package/dist/components/label/label.core.d.ts +22 -0
- package/dist/components/multi-select/icons.d.ts +14 -0
- package/dist/components/multi-select/index.d.ts +10 -0
- package/dist/components/multi-select/multiselect.core.d.ts +60 -0
- package/dist/components/number-input/icons.d.ts +7 -0
- package/dist/components/number-input/index.d.ts +7 -0
- package/dist/components/number-input/numberinput.core.d.ts +30 -0
- package/dist/components/password-input/icons.d.ts +7 -0
- package/dist/components/password-input/index.d.ts +7 -0
- package/dist/components/password-input/passwordinput.core.d.ts +29 -0
- package/dist/components/popover/index.d.ts +14 -0
- package/dist/components/popover/popover.core.d.ts +65 -0
- package/dist/components/popup/icons.d.ts +18 -0
- package/dist/components/popup/index.d.ts +14 -0
- package/dist/components/popup/popup.core.d.ts +132 -0
- package/dist/components/radio/index.d.ts +9 -0
- package/dist/components/radio/radio.core.d.ts +35 -0
- package/dist/components/scroll-area/index.d.ts +16 -0
- package/dist/components/scroll-area/scrollarea.core.d.ts +47 -0
- package/dist/components/select/icons.d.ts +16 -0
- package/dist/components/select/index.d.ts +10 -0
- package/dist/components/select/select.core.d.ts +48 -0
- package/dist/components/slider/index.d.ts +6 -0
- package/dist/components/slider/slider.core.d.ts +23 -0
- package/dist/components/split-pane/index.d.ts +15 -0
- package/dist/components/split-pane/splitpane.core.d.ts +24 -0
- package/dist/components/tab/icons.d.ts +4 -0
- package/dist/components/tab/index.d.ts +10 -0
- package/dist/components/tab/tab.core.d.ts +28 -0
- package/dist/components/table-select/index.d.ts +10 -0
- package/dist/components/table-select/tableselect.core.d.ts +45 -0
- package/dist/components/tag-input/icons.d.ts +9 -0
- package/dist/components/tag-input/index.d.ts +12 -0
- package/dist/components/tag-input/taginput.core.d.ts +32 -0
- package/dist/components/textarea/index.d.ts +6 -0
- package/dist/components/textarea/textarea.core.d.ts +35 -0
- package/dist/components/time-picker/icons.d.ts +9 -0
- package/dist/components/time-picker/index.d.ts +10 -0
- package/dist/components/time-picker/timepicker.core.d.ts +26 -0
- package/dist/components/toast/icons.d.ts +12 -0
- package/dist/components/toast/index.d.ts +13 -0
- package/dist/components/toast/timer.d.ts +17 -0
- package/dist/components/toast/toast.core.d.ts +48 -0
- package/dist/components/toast/useToast.d.ts +13 -0
- package/dist/components/toggle/index.d.ts +9 -0
- package/dist/components/toggle/toggle.core.d.ts +54 -0
- package/dist/components/tooltip/index.d.ts +18 -0
- package/dist/components/tooltip/placement.d.ts +9 -0
- package/dist/components/tooltip/tooltip.core.d.ts +50 -0
- package/dist/components/tree-select/icons.d.ts +14 -0
- package/dist/components/tree-select/index.d.ts +12 -0
- package/dist/components/tree-select/tree-utils.d.ts +63 -0
- package/dist/components/tree-select/treeselect.core.d.ts +45 -0
- package/dist/index.cjs +1887 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +9233 -0
- package/dist/index.js.map +1 -0
- package/dist/locale/en.d.ts +3 -0
- package/dist/locale/index.d.ts +10 -0
- package/dist/locale/ja.d.ts +3 -0
- package/dist/locale/ko.d.ts +3 -0
- package/dist/locale/types.d.ts +482 -0
- package/dist/locale/zh.d.ts +3 -0
- package/dist/overlay/DismissStack.d.ts +49 -0
- package/dist/overlay/Overlay.d.ts +39 -0
- package/dist/overlay/PortalHost.d.ts +11 -0
- package/dist/overlay/index.d.ts +5 -0
- package/dist/overlay/placement.d.ts +74 -0
- package/dist/runtime/ChromeComponent.d.ts +38 -0
- package/dist/runtime/Observable.d.ts +18 -0
- package/dist/runtime/SlotHost.d.ts +48 -0
- package/dist/runtime/defineHeadless.d.ts +28 -0
- package/dist/runtime/spread.d.ts +26 -0
- package/dist/runtime/types.d.ts +149 -0
- package/dist/shared/cn.d.ts +8 -0
- package/dist/shared/dayjs.d.ts +10 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/utils.d.ts +58 -0
- package/dist/styles/default/avatar.css +94 -0
- package/dist/styles/default/breadcrumb.css +120 -0
- package/dist/styles/default/button.css +220 -0
- package/dist/styles/default/calendar.css +158 -0
- package/dist/styles/default/checkbox.css +128 -0
- package/dist/styles/default/collapsible.css +27 -0
- package/dist/styles/default/contextmenu.css +212 -0
- package/dist/styles/default/controller.css +157 -0
- package/dist/styles/default/dateinput.css +193 -0
- package/dist/styles/default/emptystate.css +91 -0
- package/dist/styles/default/index.css +3877 -0
- package/dist/styles/default/input.css +179 -0
- package/dist/styles/default/label.css +65 -0
- package/dist/styles/default/multiselect.css +394 -0
- package/dist/styles/default/numberinput.css +174 -0
- package/dist/styles/default/passwordinput.css +189 -0
- package/dist/styles/default/popover.css +92 -0
- package/dist/styles/default/popup.css +222 -0
- package/dist/styles/default/radio.css +264 -0
- package/dist/styles/default/scrollarea.css +133 -0
- package/dist/styles/default/select.css +287 -0
- package/dist/styles/default/slider.css +123 -0
- package/dist/styles/default/splitpane.css +62 -0
- package/dist/styles/default/tab.css +172 -0
- package/dist/styles/default/tableselect.css +313 -0
- package/dist/styles/default/taginput.css +296 -0
- package/dist/styles/default/textarea.css +145 -0
- package/dist/styles/default/timepicker.css +221 -0
- package/dist/styles/default/toast.css +165 -0
- package/dist/styles/default/toggle.css +129 -0
- package/dist/styles/default/tooltip.css +131 -0
- package/dist/styles/default/treeselect.css +382 -0
- package/dist/validator/createValidator.d.ts +7 -0
- package/dist/validator/index.d.ts +2 -0
- package/dist/validator/types.d.ts +26 -0
- package/package.json +57 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { InputProps, InputEmits } from './input.core';
|
|
3
|
+
|
|
4
|
+
export { createInput } from './input.core';
|
|
5
|
+
export type { InputProps, InputEmits } from './input.core';
|
|
6
|
+
export { iconInfo } from './icons';
|
|
7
|
+
/**
|
|
8
|
+
* v-model(modelValue) + validator. slot: invalidTooltip(v2 아이콘 커스터마이징).
|
|
9
|
+
*/
|
|
10
|
+
export declare const INPUT_SPEC: MozSpec<InputProps, InputEmits, void>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Rule } from '../../validator/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Input 코어 — Input.vue 1:1 포팅.
|
|
5
|
+
*
|
|
6
|
+
* 보존 포인트(1:1):
|
|
7
|
+
* - v-model(modelValue) + validator(change/blur 는 로컬, save 는 부모 Validator.validate 로).
|
|
8
|
+
* - required 시 auto save-rule (메시지: requiredMessage ?? locale.Common.requiredMessage.replace('{label}', label||name||'')).
|
|
9
|
+
* - checkRules: rules 없음/disabled/isReadOnly → true. 에러 시 validatorMessages[target] 세팅.
|
|
10
|
+
* - invalidMessage = save || blur || change. isFocused 면 메시지/아이콘 숨김.
|
|
11
|
+
* - v2(useInvalidV2): 아이콘+툴팁 (invalidTooltip slot; fallback 은 native title — 원본 v-tooltip 은 host 전역 디렉티브라 헤드리스에선 title 로 대체).
|
|
12
|
+
* - enter/mounted emit. $attrs 는 input 으로 패스스루. caret 보존 위해 .value=live().
|
|
13
|
+
*/
|
|
14
|
+
export interface InputProps {
|
|
15
|
+
label?: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
isReadOnly?: boolean;
|
|
23
|
+
rules?: Rule[];
|
|
24
|
+
width?: string | number;
|
|
25
|
+
messagePosition?: 'outside' | 'inside';
|
|
26
|
+
requiredMessage?: string;
|
|
27
|
+
useInvalidV2?: boolean;
|
|
28
|
+
modelValue?: string;
|
|
29
|
+
class?: unknown;
|
|
30
|
+
style?: unknown;
|
|
31
|
+
[attr: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface InputEmits {
|
|
34
|
+
enter: [KeyboardEvent];
|
|
35
|
+
mounted: [HTMLInputElement | null];
|
|
36
|
+
'update:modelValue': [string];
|
|
37
|
+
}
|
|
38
|
+
export declare const createInput: import('../..').CoreFactory<InputProps, InputEmits, void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { LabelProps, LabelEmits } from './label.core';
|
|
3
|
+
|
|
4
|
+
export { createLabel, labelTemplate, labelClass } from './label.core';
|
|
5
|
+
export type { LabelProps, LabelEmits } from './label.core';
|
|
6
|
+
export declare const LABEL_SPEC: MozSpec<LabelProps, LabelEmits, void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Label 코어 — Label.vue 1:1 포팅.
|
|
5
|
+
* inheritAttrs 기본 true 였으므로 class/style/id/aria/data 등 $attrs 가 label 로 패스스루.
|
|
6
|
+
*/
|
|
7
|
+
export interface LabelProps {
|
|
8
|
+
for?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
isReadOnly?: boolean;
|
|
12
|
+
class?: unknown;
|
|
13
|
+
style?: unknown;
|
|
14
|
+
[attr: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface LabelEmits {
|
|
17
|
+
}
|
|
18
|
+
/** 클래스 계산 (Label.vue cn 1:1). extra 는 합성처(Toggle 의 label-left/right)에서 추가 */
|
|
19
|
+
export declare function labelClass(p: Pick<LabelProps, 'disabled' | 'isReadOnly' | 'class'>, extra?: unknown): string;
|
|
20
|
+
/** 순수 lit-html label 템플릿 — 다른 코어(Toggle 등)에서 합성용 */
|
|
21
|
+
export declare function labelTemplate(p: LabelProps, content: unknown, extraClass?: unknown): TemplateResult;
|
|
22
|
+
export declare const createLabel: import('../..').CoreFactory<LabelProps, LabelEmits, void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MultiSelect 아이콘 — IconDropdown / IconDropdownActive / IconSearch.vue 1:1 포팅.
|
|
5
|
+
* (Select 아이콘과 동일 도형이지만 컴포넌트 독립성을 위해 자체 보유.)
|
|
6
|
+
*/
|
|
7
|
+
type IconSize = '10' | '12' | '14' | '16' | '18' | '20' | '22' | '30';
|
|
8
|
+
/** IconDropdown.vue 1:1 (기본 size 14, color #8998b5) */
|
|
9
|
+
export declare function iconDropdown(size?: IconSize, color?: string, disabled?: boolean): TemplateResult;
|
|
10
|
+
/** IconDropdownActive.vue 1:1 (기본 size 14, color #8998b5) */
|
|
11
|
+
export declare function iconDropdownActive(size?: IconSize, color?: string, disabled?: boolean): TemplateResult;
|
|
12
|
+
/** IconSearch.vue 1:1 (기본 size 12, color #8998b5, width 구간별 2가지 SVG) */
|
|
13
|
+
export declare function iconSearch(size?: IconSize, color?: string, disabled?: boolean): TemplateResult;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { MultiSelectProps, MultiSelectEmits, MultiSelectApi } from './multiselect.core';
|
|
3
|
+
|
|
4
|
+
export { createMultiSelect } from './multiselect.core';
|
|
5
|
+
export type { MultiSelectProps, MultiSelectEmits, MultiSelectApi } from './multiselect.core';
|
|
6
|
+
/**
|
|
7
|
+
* MultiSelect — 다중 선택 드롭다운(가상 스크롤 + 필터 + 전체선택 + focus 다중선택 + 검증).
|
|
8
|
+
* 스타일: multiselect.css + label.css. modelValue 는 string[] v-model(controlled)/uncontrolled 이중 모드.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MULTISELECT_SPEC: MozSpec<MultiSelectProps, MultiSelectEmits, MultiSelectApi>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Rule, RuleEventTarget } from '../../validator/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MultiSelect 코어 — MultiSelect.vue 1:1 포팅 (오버레이 티어, 가상 스크롤 + 다중선택).
|
|
5
|
+
*
|
|
6
|
+
* 보존 포인트(1:1):
|
|
7
|
+
* - v-model 은 string[] (key 배열). focus 기반 다중선택(단일/ctrl 누적/shift 범위).
|
|
8
|
+
* - 드롭다운은 body 포털(teleport)로, 자체 calcPosition(position:absolute) + shouldOpenOppositeDirection
|
|
9
|
+
* (Overlay 미사용 — MultiSelect 는 자체 위치 로직). 부모 스크롤 시 닫힘(closeOnScroll).
|
|
10
|
+
* - selectAll/selectFiltered/addSearch, specificSelect, disabled 아이템은 항상 선택 유지.
|
|
11
|
+
* - selectAllWhenEmpty(닫을 때 빈 선택이면 전체), autoSelectNewItems(itemsSource 변경 시 신규 자동선택).
|
|
12
|
+
* - headerFormat 표시(ALL / {count} / join). Validator(change/blur 로컬, save 부모).
|
|
13
|
+
* - ITEM_HEIGHT 는 attr[dropdown-item-height] 또는 CSS var(--size-input-dropdown-item-height),
|
|
14
|
+
* 둘 다 없으면 24 폴백(헤드리스 standalone 방어 — 원본은 폴백 없음).
|
|
15
|
+
* - 기벽: watch(showList) 의 선택-스크롤 분기는 `!model.value`(빈 배열도 truthy) 조건이라 항상 죽음.
|
|
16
|
+
*/
|
|
17
|
+
export type DisplayFormatter = (item: Record<string, unknown>) => string;
|
|
18
|
+
export interface MultiSelectProps {
|
|
19
|
+
itemsSource: Record<string, unknown>[];
|
|
20
|
+
/** Render the same DDL in place, without a trigger, portal or dismiss layer. */
|
|
21
|
+
inline?: boolean;
|
|
22
|
+
/** Remote mode displays itemsSource as returned by the server. */
|
|
23
|
+
filterMode?: 'local' | 'remote';
|
|
24
|
+
filterValue?: string;
|
|
25
|
+
searchPlaceholder?: string;
|
|
26
|
+
preserveMissingValues?: boolean;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
loadingText?: string;
|
|
29
|
+
listBoxHeight?: number;
|
|
30
|
+
label?: string | null;
|
|
31
|
+
width?: string | number;
|
|
32
|
+
required?: boolean;
|
|
33
|
+
readonly?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
keyProp?: string;
|
|
36
|
+
displayProp?: string | DisplayFormatter;
|
|
37
|
+
disabledProp?: string;
|
|
38
|
+
rules?: Rule[];
|
|
39
|
+
useSelectAll?: boolean;
|
|
40
|
+
useFilter?: boolean;
|
|
41
|
+
headerFormat?: string;
|
|
42
|
+
listBoxWidth?: number | string;
|
|
43
|
+
useSpecificSelect?: boolean;
|
|
44
|
+
autoSelectNewItems?: boolean;
|
|
45
|
+
selectAllWhenEmpty?: boolean;
|
|
46
|
+
modelValue?: string[] | null;
|
|
47
|
+
class?: unknown;
|
|
48
|
+
style?: unknown;
|
|
49
|
+
[attr: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
export interface MultiSelectEmits {
|
|
52
|
+
change: [values: string[], items: Record<string, unknown>[]];
|
|
53
|
+
close: [];
|
|
54
|
+
'update:filterValue': [string];
|
|
55
|
+
'update:modelValue': [string[]];
|
|
56
|
+
}
|
|
57
|
+
export interface MultiSelectApi {
|
|
58
|
+
validate(eventTarget?: RuleEventTarget): Promise<boolean>;
|
|
59
|
+
}
|
|
60
|
+
export declare const createMultiSelect: import('../..').CoreFactory<MultiSelectProps, MultiSelectEmits, MultiSelectApi>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/** NumberInput 아이콘 (IconAdd/IconMinus/IconListUp/IconListDown.vue 1:1 포팅). */
|
|
4
|
+
export declare function iconAdd(color?: string, disabled?: boolean): TemplateResult;
|
|
5
|
+
export declare function iconMinus(color?: string, disabled?: boolean): TemplateResult;
|
|
6
|
+
export declare function iconListUp(disabled?: boolean): TemplateResult;
|
|
7
|
+
export declare function iconListDown(disabled?: boolean): TemplateResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { NumberInputProps, NumberInputEmits } from './numberinput.core';
|
|
3
|
+
|
|
4
|
+
export { createNumberInput } from './numberinput.core';
|
|
5
|
+
export type { NumberInputProps, NumberInputEmits } from './numberinput.core';
|
|
6
|
+
/** 버튼 스타일에 button.css 도 함께 import 필요 (moz-button 기본 클래스 재현). */
|
|
7
|
+
export declare const NUMBERINPUT_SPEC: MozSpec<NumberInputProps, NumberInputEmits, void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberInput 코어 — NumberInput.vue 1:1 포팅.
|
|
3
|
+
*
|
|
4
|
+
* 보존: +/- 버튼(min/max guard, step), keydown Backspace/Delete 가드(min 에서 비우기 차단),
|
|
5
|
+
* blur 빈값 복원(min 또는 0), onChanged clamp, shortMode(up/down 리스트 버튼).
|
|
6
|
+
* emit: update:modelValue(모델 변경) + change + enter + mounted. 버튼은 Button(icon-accent) 렌더 클래스 인라인 재현.
|
|
7
|
+
*/
|
|
8
|
+
export interface NumberInputProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
step?: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
shortMode?: boolean;
|
|
18
|
+
nullable?: boolean;
|
|
19
|
+
modelValue?: number;
|
|
20
|
+
class?: unknown;
|
|
21
|
+
style?: unknown;
|
|
22
|
+
[attr: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface NumberInputEmits {
|
|
25
|
+
change: [number];
|
|
26
|
+
mounted: [HTMLInputElement | null];
|
|
27
|
+
enter: [KeyboardEvent];
|
|
28
|
+
'update:modelValue': [number];
|
|
29
|
+
}
|
|
30
|
+
export declare const createNumberInput: import('../..').CoreFactory<NumberInputProps, NumberInputEmits, void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/** PasswordInput 토글 아이콘 (IconPasswordHidden/Visible.vue 1:1 포팅). */
|
|
4
|
+
/** 눈-가림 (현재 비밀번호가 보이는 상태 → 숨기기 버튼) */
|
|
5
|
+
export declare function iconPasswordHidden(): TemplateResult;
|
|
6
|
+
/** 눈 (현재 비밀번호가 숨겨진 상태 → 보이기 버튼) */
|
|
7
|
+
export declare function iconPasswordVisible(): TemplateResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { PasswordInputProps, PasswordInputEmits } from './passwordinput.core';
|
|
3
|
+
|
|
4
|
+
export { createPasswordInput } from './passwordinput.core';
|
|
5
|
+
export type { PasswordInputProps, PasswordInputEmits } from './passwordinput.core';
|
|
6
|
+
export { iconPasswordHidden, iconPasswordVisible } from './icons';
|
|
7
|
+
export declare const PASSWORDINPUT_SPEC: MozSpec<PasswordInputProps, PasswordInputEmits, void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Rule } from '../../validator/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PasswordInput 코어 — PasswordInput.vue 1:1 포팅 (Input 과 동일 validator 틀 + 표시 토글).
|
|
5
|
+
* 보존: visiblePassword 토글(disabled 면 강제 false), Edge 브라우저 edge-password 클래스, checkRules 는 isReadOnly 없음(disabled 만).
|
|
6
|
+
*/
|
|
7
|
+
export interface PasswordInputProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
rules?: Rule[];
|
|
15
|
+
width?: string | number;
|
|
16
|
+
messagePosition?: 'outside' | 'inside';
|
|
17
|
+
requiredMessage?: string;
|
|
18
|
+
useInvalidV2?: boolean;
|
|
19
|
+
modelValue?: string;
|
|
20
|
+
class?: unknown;
|
|
21
|
+
style?: unknown;
|
|
22
|
+
[attr: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface PasswordInputEmits {
|
|
25
|
+
enter: [KeyboardEvent];
|
|
26
|
+
mounted: [HTMLInputElement | null];
|
|
27
|
+
'update:modelValue': [string];
|
|
28
|
+
}
|
|
29
|
+
export declare const createPasswordInput: import('../..').CoreFactory<PasswordInputProps, PasswordInputEmits, void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { PopoverProps, PopoverEmits, PopoverApi } from './popover.core';
|
|
3
|
+
|
|
4
|
+
export { createPopover } from './popover.core';
|
|
5
|
+
export type { PopoverProps, PopoverEmits, PopoverApi, PopoverSide, PopoverAlign, PopoverCloseReason, } from './popover.core';
|
|
6
|
+
/**
|
|
7
|
+
* POPOVER_SPEC — 패널 전용 스펙. 트리거·앵커는 소비처 소유라 코어가 그리지 않는다.
|
|
8
|
+
*
|
|
9
|
+
* `content` slot 은 **동적 slot 경로(`slots={{ content: … }}`)로 넘겨야 한다.** 정적 slot 으로
|
|
10
|
+
* 넘기면 브릿지가 독립 React root 에 마운트해 소비자 context 가 끊긴다(Tooltip 과 같은 규약).
|
|
11
|
+
*
|
|
12
|
+
* (스타일은 별도: `@vmscloud/moz-ui-components-core/styles/popover.css`)
|
|
13
|
+
*/
|
|
14
|
+
export declare const POPOVER_SPEC: MozSpec<PopoverProps, PopoverEmits, PopoverApi>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { OverlayAlign, OverlaySide } from '../../overlay/placement';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Popover 코어 — 앵커에 붙는 **임의 콘텐츠 패널**.
|
|
5
|
+
*
|
|
6
|
+
* Tooltip 과 마찬가지로 **트리거를 그리지 않는다**. 트리거는 소비처가 이미 렌더한 요소이고,
|
|
7
|
+
* 코어는 앵커 element 를 `anchor` prop 으로 받아 패널만 body 포털에 그린다. Tooltip 과 다른
|
|
8
|
+
* 점은 상호작용 계약이다 — 포커스 진입·트랩·복원, 바깥 클릭, ESC, 그리고 **중첩 계층**.
|
|
9
|
+
*
|
|
10
|
+
* 열림 상태는 코어가 소유하지 않는다(`open` 은 prop). 코어는 "닫아 달라" 는 의도를
|
|
11
|
+
* `requestClose` 로 올려보내고, 그 전에 취소 가능한 `escapeKeyDown`·`interactOutside` 를
|
|
12
|
+
* 먼저 emit 한다 — 소비처가 `preventDefault()` 하면 `requestClose` 가 나가지 않는다.
|
|
13
|
+
* (Radix 의 `onEscapeKeyDown`/`onInteractOutside` 와 같은 의미다.)
|
|
14
|
+
*
|
|
15
|
+
* ESC 는 `DismissStack` 이 `window` capture 에서 최상위 레이어에만 전달하고 전파를 끊는다.
|
|
16
|
+
* 다른 라이브러리의 오버레이가 우리 위에 있으면(소비 앱이 `registerForeignLayer` 로 알린다)
|
|
17
|
+
* 아예 손대지 않는다 — 그쪽이 평소대로 닫힌다.
|
|
18
|
+
*/
|
|
19
|
+
export type PopoverSide = OverlaySide;
|
|
20
|
+
export type PopoverAlign = OverlayAlign;
|
|
21
|
+
export type PopoverCloseReason = 'escape' | 'interactOutside';
|
|
22
|
+
export interface PopoverProps {
|
|
23
|
+
/** 열림 여부 — 상태는 래퍼/소비처가 소유한다 */
|
|
24
|
+
open?: boolean;
|
|
25
|
+
/** 위치 기준 element. 없으면 패널을 그리지 않는다 */
|
|
26
|
+
anchor?: HTMLElement | null;
|
|
27
|
+
side?: PopoverSide;
|
|
28
|
+
align?: PopoverAlign;
|
|
29
|
+
/** 앵커와 패널 사이 간격(px) */
|
|
30
|
+
sideOffset?: number;
|
|
31
|
+
/** 뷰포트 가장자리 최소 여백(px) */
|
|
32
|
+
collisionPadding?: number;
|
|
33
|
+
/** 패널 폭을 트리거 폭에 맞춘다. 값과 무관하게 `--moz-popover-trigger-width` 는 항상 실린다 */
|
|
34
|
+
matchTriggerWidth?: boolean;
|
|
35
|
+
/** 열린 동안 Tab 을 패널 안에서 순환시킨다 (기본 true) */
|
|
36
|
+
trapFocus?: boolean;
|
|
37
|
+
/** 패널 element id — 트리거의 `aria-controls` 가 가리킬 값 */
|
|
38
|
+
popoverId?: string;
|
|
39
|
+
class?: unknown;
|
|
40
|
+
style?: unknown;
|
|
41
|
+
[attr: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
export interface PopoverEmits {
|
|
44
|
+
/** flip 이 반영된 실제 방향이 정해질 때마다 */
|
|
45
|
+
placed: [PopoverSide];
|
|
46
|
+
/** 최상위일 때의 ESC. `preventDefault()` 로 닫힘을 취소할 수 있다 */
|
|
47
|
+
escapeKeyDown: [KeyboardEvent];
|
|
48
|
+
/** 패널 바깥 포인터 다운. `preventDefault()` 로 닫힘을 취소할 수 있다 */
|
|
49
|
+
interactOutside: [CustomEvent<{
|
|
50
|
+
originalEvent: Event;
|
|
51
|
+
}>];
|
|
52
|
+
/** 열린 직후 자동 포커스 전. `preventDefault()` 로 자동 포커스를 막는다 */
|
|
53
|
+
openAutoFocus: [CustomEvent];
|
|
54
|
+
/** 닫힌 직후 트리거 포커스 복원 전. `preventDefault()` 로 복원을 막는다 */
|
|
55
|
+
closeAutoFocus: [CustomEvent];
|
|
56
|
+
/** 위 두 취소 지점을 통과했을 때만 나간다 */
|
|
57
|
+
requestClose: [PopoverCloseReason];
|
|
58
|
+
}
|
|
59
|
+
export interface PopoverApi {
|
|
60
|
+
/** 앵커가 움직였을 때 재측정 (스크롤·리사이즈는 코어가 알아서 건다) */
|
|
61
|
+
reposition(): void;
|
|
62
|
+
/** 패널 element (테스트·명령형 접근용) */
|
|
63
|
+
panel(): HTMLElement | null;
|
|
64
|
+
}
|
|
65
|
+
export declare const createPopover: import('../..').CoreFactory<PopoverProps, PopoverEmits, PopoverApi>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Popup 아이콘 — IconClose / IconToast{Error,Info,Success,Warning}.vue 1:1 포팅.
|
|
5
|
+
* 각 아이콘은 size 프리셋(10~30) → width/height 로 변환하고, 색상은 하드코딩/파라미터.
|
|
6
|
+
*/
|
|
7
|
+
type IconSize = '10' | '12' | '14' | '16' | '18' | '20' | '22' | '30';
|
|
8
|
+
/** IconClose.vue 1:1 — width 구간별 4가지 SVG(≤10 / 11~13 두꺼움 / 11~13 얇음 / ≥14). */
|
|
9
|
+
export declare function iconClose(size?: IconSize, color?: string, disabled?: boolean, thin?: boolean, cls?: string): TemplateResult;
|
|
10
|
+
/** IconToastError.vue 1:1 (기본 size 30, color #dc5a5a) */
|
|
11
|
+
export declare function iconToastError(size?: IconSize, color?: string, cls?: string): TemplateResult;
|
|
12
|
+
/** IconToastInfo.vue 1:1 (기본 size 30, color #4568e0) */
|
|
13
|
+
export declare function iconToastInfo(size?: IconSize, color?: string, cls?: string): TemplateResult;
|
|
14
|
+
/** IconToastSuccess.vue 1:1 (기본 size 30, color #357e63) */
|
|
15
|
+
export declare function iconToastSuccess(size?: IconSize, color?: string, cls?: string): TemplateResult;
|
|
16
|
+
/** IconToastWarning.vue 1:1 (기본 size 30, color #fa9e23) */
|
|
17
|
+
export declare function iconToastWarning(size?: IconSize, color?: string, cls?: string): TemplateResult;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { PopupProps, PopupEmits, PopupApi } from './popup.core';
|
|
3
|
+
|
|
4
|
+
export { createPopup } from './popup.core';
|
|
5
|
+
export type { PopupProps, PopupEmits, PopupApi, PopupPreset, DialogIcon, PopupSide } from './popup.core';
|
|
6
|
+
/**
|
|
7
|
+
* Popup — body portal 로 렌더되는 모달. 스타일은 popup.css + button.css 를 소비자가 import.
|
|
8
|
+
* visible/width/height 는 v-model(controlled)/uncontrolled 이중 모드. title/default/footer 슬롯 지원.
|
|
9
|
+
* focusTrap/lockScroll/side/showBackdrop 은 opt-in 접근성·드로어 확장(mozart-cloud #890) — 기본값은 종전 동작.
|
|
10
|
+
* description slot 은 제목 아래 설명 문단이며 값이 있을 때만 aria-describedby 로 연결된다(issue 892).
|
|
11
|
+
* React 에서는 `description={문자열|노드}` 가 그대로 이 slot 을 채운다(브릿지 정적 slot 경로).
|
|
12
|
+
* ESC 닫힘은 공용 dismiss 스택이 관리한다 — 가장 위에 열린 레이어 하나만 닫힌다(#892).
|
|
13
|
+
*/
|
|
14
|
+
export declare const POPUP_SPEC: MozSpec<PopupProps, PopupEmits, PopupApi>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popup 코어 — Popup.vue 1:1 포팅.
|
|
3
|
+
*
|
|
4
|
+
* 보존 포인트(1:1):
|
|
5
|
+
* - 전체가 body 로 teleport → defineHeadless portal 모드로 body 루트에 렌더.
|
|
6
|
+
* - visible/width/height 는 defineModel 로컬 폴백(controlled/uncontrolled 이중 모드).
|
|
7
|
+
* - watch(visible): true→onOpen(emit open+resetPosition), false→handleBeforeUnload+handleCancel.
|
|
8
|
+
* handleCancel 이 visible=false 로 만들면 watch 가 재진입해 close:before 가 2회 발행되는 기벽까지 보존.
|
|
9
|
+
* - draggable(타이틀 mousedown 드래그) / resizeable(우하단 핸들 리사이즈, keepAspectRatio) 로직 그대로.
|
|
10
|
+
* - preset/action → buttonActions(locale fallback), no-footer 는 푸터 자체 제거.
|
|
11
|
+
* - $attrs(style 포함)는 .moz-popup(dialog)로, class prop 은 .moz-popup-container 로 분리 패스스루.
|
|
12
|
+
*
|
|
13
|
+
* 접근성·드로어 확장 (mozart-cloud #890, 전부 opt-in — 기본값에서는 위 1:1 동작 그대로):
|
|
14
|
+
* - focusTrap: 열릴 때 이전 활성 요소 기억 → dialog 안 첫 포커스 가능 요소(없으면 dialog 자신,
|
|
15
|
+
* tabindex=-1)로 초기 포커스 → Tab/Shift+Tab 을 dialog 안에서 순환 → 닫히면 이전 요소로 복원.
|
|
16
|
+
* 중첩 시 DOM 상 마지막 .moz-popup 만 Tab 을 가로채고, 이 창 위에 다른 dismiss 레이어가
|
|
17
|
+
* 올라와 있으면(창 안에서 연 팝오버 등) Tab 을 가로채지 않고 양보한다.
|
|
18
|
+
* - lockScroll: 열린 동안 body overflow 를 잠근다. 모듈 단위 카운트라 중첩 Popup 이 모두 닫혀야 원복.
|
|
19
|
+
* - side: 가장자리 드로어 변형. 중앙 배치·드래그·리사이즈 비활성, 위치는 popup.scss 가 담당.
|
|
20
|
+
* - showBackdrop=false: backdrop 없는 도킹 모드(컨테이너 pointer-events:none, dialog 만 상호작용).
|
|
21
|
+
* - hideOthers: 열린 동안 창 밖 body 자식을 aria-hidden 으로 가린다(보조기술용 모달 경계).
|
|
22
|
+
* - autoPosition=false: 위치를 코어가 정하지 않는다(인라인 left/top 없음) — 소비자 CSS 가 기하를 갖는다.
|
|
23
|
+
* - 중앙 배치는 창 크기 변경에도 유지된다(사용자가 끌어 옮긴 창은 제외).
|
|
24
|
+
*/
|
|
25
|
+
export type PopupPreset = 'confirm' | 'save' | 'check' | 'close' | 'no-footer';
|
|
26
|
+
export type DialogIcon = 'error' | 'warning' | 'success' | 'info';
|
|
27
|
+
export type PopupSide = 'left' | 'right' | 'top' | 'bottom';
|
|
28
|
+
export interface PopupProps {
|
|
29
|
+
title?: string;
|
|
30
|
+
minWidth?: number;
|
|
31
|
+
minHeight?: number;
|
|
32
|
+
maxWidth?: number;
|
|
33
|
+
maxHeight?: number;
|
|
34
|
+
draggable?: boolean;
|
|
35
|
+
resizeable?: boolean;
|
|
36
|
+
keepAspectRatio?: boolean;
|
|
37
|
+
disabledConfirmButton?: boolean;
|
|
38
|
+
showCloseButton?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* dialog element(`.moz-popup`) 에 실을 클래스. `class` 는 컨테이너로 가므로, 창 자체의
|
|
41
|
+
* 폭·모서리·레이아웃을 소비자 디자인 시스템 클래스로 정하려면 이쪽을 쓴다.
|
|
42
|
+
* (소비 앱의 Modal/Drawer facade 는 반응형 `max-w-*` 를 dialog 에 얹는다.)
|
|
43
|
+
*/
|
|
44
|
+
dialogClass?: unknown;
|
|
45
|
+
/**
|
|
46
|
+
* 기본 타이틀바를 그릴지. `false` 면 제목 줄·닫기 버튼을 그리지 않고 본문만 그린다 —
|
|
47
|
+
* 소비자가 자기 헤더를 body 안에 직접 그리는 경우다. 이때 `aria-labelledby` 도 내보내지
|
|
48
|
+
* 않으므로 **소비자가 `aria-label` 또는 자기 헤더를 가리키는 `aria-labelledby` 를 줘야 한다.**
|
|
49
|
+
*/
|
|
50
|
+
showHeader?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 제목 아래 설명 문단은 **`description` slot** 이다(issue 892). 문자열이든 노드든 그 통로로
|
|
53
|
+
* 넘기면 되고, 값이 있을 때만 `aria-describedby` 로 dialog 에 연결된다.
|
|
54
|
+
* (prop 과 slot 을 같은 이름으로 두 갈래 두지 않는다 — 브릿지가 같은 키를 slot 으로 등록해
|
|
55
|
+
* 어느 쪽이 이기는지가 호출 형태에 따라 달라진다.)
|
|
56
|
+
*/
|
|
57
|
+
closeOnOutsideClick?: boolean;
|
|
58
|
+
preset?: PopupPreset;
|
|
59
|
+
dialogIcon?: DialogIcon;
|
|
60
|
+
dialogMessage?: string;
|
|
61
|
+
onCancel?: () => void;
|
|
62
|
+
onBeforeClose?: () => boolean | Promise<boolean>;
|
|
63
|
+
onBeforeUnload?: () => void;
|
|
64
|
+
onConfirm?: () => void;
|
|
65
|
+
onBeforeConfirm?: () => boolean | Promise<boolean>;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
contentsPadding?: string | number;
|
|
68
|
+
class?: unknown;
|
|
69
|
+
useVShow?: boolean;
|
|
70
|
+
top?: number | null;
|
|
71
|
+
left?: number | null;
|
|
72
|
+
showFooterBorder?: boolean;
|
|
73
|
+
action?: {
|
|
74
|
+
positive?: string;
|
|
75
|
+
negative?: string;
|
|
76
|
+
};
|
|
77
|
+
saveText?: string;
|
|
78
|
+
cancelText?: string;
|
|
79
|
+
okText?: string;
|
|
80
|
+
closeText?: string;
|
|
81
|
+
visible?: boolean;
|
|
82
|
+
width?: number;
|
|
83
|
+
height?: number;
|
|
84
|
+
/**
|
|
85
|
+
* 초기 포커스·Tab 순환·닫힘 후 포커스 복원. 기본 false.
|
|
86
|
+
* 창 위에 다른 dismiss 레이어가 올라와 있으면 Tab 순환을 양보한다 — 창 안에서 연 팝오버·
|
|
87
|
+
* 드롭다운이 body 포털로 나가더라도 그쪽으로 포커스가 넘어갈 수 있어야 하기 때문이다.
|
|
88
|
+
*/
|
|
89
|
+
focusTrap?: boolean;
|
|
90
|
+
/** 열린 동안 body 스크롤 잠금(중첩 카운트). 기본 false. */
|
|
91
|
+
lockScroll?: boolean;
|
|
92
|
+
/** 드로어 변형 — 지정하면 가장자리에서 슬라이드 인. left/right 는 width, top/bottom 은 height 로 크기 지정. */
|
|
93
|
+
side?: PopupSide;
|
|
94
|
+
/** false 면 backdrop 없이 도킹(페이지 상호작용 유지). 기본 true. */
|
|
95
|
+
showBackdrop?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* false 면 창 위치를 코어가 정하지 않는다 — 인라인 `left`/`top` 을 내지 않고 중앙 배치·
|
|
98
|
+
* 재중앙 배치·드래그를 모두 끈다. 기본 true.
|
|
99
|
+
*
|
|
100
|
+
* 소비자가 창의 기하를 **CSS 로 직접 정하는** 경우를 위한 opt-out 이다(전체화면 라이트박스,
|
|
101
|
+
* 화면 가장자리에 붙는 슬라이드오버 등). 인라인 스타일은 클래스를 이기므로, 이걸 끄지 않으면
|
|
102
|
+
* 소비자가 준 위치 클래스가 조용히 무시된다.
|
|
103
|
+
*/
|
|
104
|
+
autoPosition?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* 열린 동안 창 밖의 body 자식들을 `aria-hidden="true"` 로 가린다. 기본 false.
|
|
107
|
+
*
|
|
108
|
+
* 시각적으로는 backdrop 이 페이지를 덮지만 **보조기술에는 아무것도 덮이지 않는다** — 그대로
|
|
109
|
+
* 두면 스크린리더 사용자가 모달 밖 버튼을 계속 읽고 누를 수 있다. 진짜 모달로 쓸 때 켠다.
|
|
110
|
+
* 중첩되면 안쪽이 바깥 창까지 가리고, 닫히면 자기가 가린 것만 되돌린다.
|
|
111
|
+
*/
|
|
112
|
+
hideOthers?: boolean;
|
|
113
|
+
[attr: string]: unknown;
|
|
114
|
+
}
|
|
115
|
+
export interface PopupEmits {
|
|
116
|
+
open: [];
|
|
117
|
+
close: [];
|
|
118
|
+
'close:before': [willClose: boolean];
|
|
119
|
+
confirm: [];
|
|
120
|
+
'confirm:before': [willClose: boolean];
|
|
121
|
+
'drag-start': [];
|
|
122
|
+
'drag-end': [];
|
|
123
|
+
hidden: [];
|
|
124
|
+
init: [body: HTMLElement | null];
|
|
125
|
+
'update:visible': [boolean];
|
|
126
|
+
'update:width': [number | undefined];
|
|
127
|
+
'update:height': [number | undefined];
|
|
128
|
+
}
|
|
129
|
+
export interface PopupApi {
|
|
130
|
+
resetPosition(): void;
|
|
131
|
+
}
|
|
132
|
+
export declare const createPopup: import('../..').CoreFactory<PopupProps, PopupEmits, PopupApi>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { RadioProps, RadioEmits } from './radio.core';
|
|
3
|
+
|
|
4
|
+
export { createRadio } from './radio.core';
|
|
5
|
+
export type { RadioProps, RadioEmits } from './radio.core';
|
|
6
|
+
/**
|
|
7
|
+
* modelValue(v-model)만으로 동작 (원본에 change 이벤트 없음). update:modelValue 직접 emit.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RADIO_SPEC: MozSpec<RadioProps, RadioEmits, void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio 코어 — Radio.vue 1:1 포팅.
|
|
3
|
+
*
|
|
4
|
+
* 3-모드 상태머신 (보존해야 하는 미묘한 차이 有):
|
|
5
|
+
* - single (value 있고 itemsSource 비었을 때): checked/active = String(modelValue)===String(value),
|
|
6
|
+
* 선택 시 modelValue = String(value) (disabled guard 有).
|
|
7
|
+
* - segment: is-active = String(modelValue)===String(item[valueExpr]), 클릭 시 modelValue = item[valueExpr] (RAW, String 아님!).
|
|
8
|
+
* - group (else): checked/active = modelValue===String(item[valueExpr]) (modelValue 를 String 으로 안 감쌈!),
|
|
9
|
+
* 선택 시 modelValue = String(item[valueExpr]) (handler 에 disabled guard 없음 — native :disabled 로만 차단).
|
|
10
|
+
* - emit 은 update:modelValue 뿐 (원본에 defineEmits 없음; v-model 전용). tooltipExpr 는 dead prop.
|
|
11
|
+
* - getBoxedOffsetStyle 는 i!==0 boxed 에 marginInlineStart/BlockStart '-1px' 상수 (원본 test 의 inset/누적 기대는 stale).
|
|
12
|
+
*/
|
|
13
|
+
export interface RadioProps {
|
|
14
|
+
label?: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
displayExpr?: string;
|
|
19
|
+
valueExpr?: string;
|
|
20
|
+
tooltipExpr?: string;
|
|
21
|
+
itemsSource?: Record<string, unknown>[];
|
|
22
|
+
value?: string | number;
|
|
23
|
+
name?: string;
|
|
24
|
+
direction?: 'horizontal' | 'vertical';
|
|
25
|
+
variant?: 'borderless' | 'boxed' | 'segment';
|
|
26
|
+
labelPosition?: 'top' | 'left';
|
|
27
|
+
modelValue?: unknown;
|
|
28
|
+
class?: unknown;
|
|
29
|
+
style?: unknown;
|
|
30
|
+
[attr: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface RadioEmits {
|
|
33
|
+
'update:modelValue': [unknown];
|
|
34
|
+
}
|
|
35
|
+
export declare const createRadio: import('../..').CoreFactory<RadioProps, RadioEmits, void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { ScrollAreaProps, ScrollAreaEmits } from './scrollarea.core';
|
|
3
|
+
|
|
4
|
+
export { createScrollArea } from './scrollarea.core';
|
|
5
|
+
export type { ScrollAreaProps, ScrollAreaEmits, ScrollAreaOrientation, ScrollbarVisibility } from './scrollarea.core';
|
|
6
|
+
/**
|
|
7
|
+
* SCROLLAREA_SPEC — **스크롤바 전용** 스펙. 뷰포트는 프레임워크 래퍼가 자기 트리에 그리고
|
|
8
|
+
* 그 element 를 `viewport` prop 으로 넘긴다(Tooltip 의 `anchor` 와 같은 형태).
|
|
9
|
+
*
|
|
10
|
+
* 코어가 뷰포트까지 그리면 안 되는 이유는 slot 타이밍이다 — 뷰포트 콘텐츠는 소비처의
|
|
11
|
+
* 페이지 서브트리이고, 그걸 slot 으로 끌어오면 소비자 트리보다 **한 커밋 늦게** 마운트돼
|
|
12
|
+
* "자식 layout effect 가 부모보다 먼저" 라는 React 불변식이 깨진다.
|
|
13
|
+
*
|
|
14
|
+
* (스타일은 별도: `@vmscloud/moz-ui-components-core/styles/scrollarea.css`)
|
|
15
|
+
*/
|
|
16
|
+
export declare const SCROLLAREA_SPEC: MozSpec<ScrollAreaProps, ScrollAreaEmits, void>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScrollArea 코어 — 네이티브 스크롤 위에 얹는 커스텀 스크롤바.
|
|
3
|
+
*
|
|
4
|
+
* **스크롤 자체는 브라우저가 한다.** 뷰포트는 그냥 `overflow: auto` 인 요소이고, 코어는
|
|
5
|
+
* 네이티브 스크롤바만 숨긴 뒤 그 위에 자기 thumb 을 그린다. 스크롤을 JS 로 재구현하는
|
|
6
|
+
* 방식은 휠 가속·키보드(Space/PageDown/Home/End)·터치 관성·스크롤 앵커링·`scrollIntoView`
|
|
7
|
+
* 를 전부 다시 만들어야 하고, 하나라도 빠지면 접근성 회귀가 조용히 생긴다.
|
|
8
|
+
*
|
|
9
|
+
* **코어는 뷰포트를 그리지 않는다 — 스크롤바만 그린다.** Tooltip 이 트리거를 그리지 않고
|
|
10
|
+
* `anchor` 를 받는 것과 같은 이유다. 뷰포트 안에 들어가는 것은 소비처의 프레임워크 트리
|
|
11
|
+
* (메뉴·칸반·SVG 캔버스)이고, 그걸 코어의 slot 으로 끌어오면 **소비자 트리보다 한 커밋 늦게
|
|
12
|
+
* 마운트된다.** 그러면 "자식 layout effect 가 부모보다 먼저 돈다" 는 React 불변식에 기대는
|
|
13
|
+
* 소비처 로직이 깨진다(소비 앱 실측: 사이드바 초기 활성 항목 중앙 정렬이 통째로 사라졌다).
|
|
14
|
+
* 그래서 뷰포트는 프레임워크 래퍼가 자기 트리에 직접 렌더하고, 코어는 그 element 를 prop 으로
|
|
15
|
+
* 받아 스크롤을 관찰하며 thumb 을 그린다.
|
|
16
|
+
*
|
|
17
|
+
* thumb 기하는 스크롤/리사이즈마다 다시 계산하지만 **재렌더는 하지 않는다** — 스타일을
|
|
18
|
+
* 직접 써넣는다. 스크롤 이벤트마다 lit 렌더를 돌리면 큰 목록에서 프레임을 잡아먹는다.
|
|
19
|
+
* 렌더가 필요한 것은 "스크롤바가 보이냐 마냐" 가 바뀔 때뿐이다.
|
|
20
|
+
*/
|
|
21
|
+
export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
|
|
22
|
+
export type ScrollbarVisibility = 'always' | 'hover';
|
|
23
|
+
export interface ScrollAreaProps {
|
|
24
|
+
/** 관찰할 스크롤 컨테이너. 프레임워크 래퍼가 자기 트리에 렌더한 뷰포트를 넘긴다 */
|
|
25
|
+
viewport?: HTMLElement | null;
|
|
26
|
+
/** hover/focus 를 관찰할 래퍼 소유 루트. 생략하면 viewport 를 사용한다 */
|
|
27
|
+
interactionRoot?: HTMLElement | null;
|
|
28
|
+
/** 기본 `always`. `hover` 는 영역 hover·내부 focus·thumb drag 동안만 표시한다 */
|
|
29
|
+
scrollbarVisibility?: ScrollbarVisibility;
|
|
30
|
+
/** 어느 방향 스크롤바를 그릴지. 기본 `vertical` */
|
|
31
|
+
orientation?: ScrollAreaOrientation;
|
|
32
|
+
/** 스크롤바 트랙에 실을 클래스 */
|
|
33
|
+
scrollbarClass?: unknown;
|
|
34
|
+
/** thumb 에 실을 클래스 */
|
|
35
|
+
thumbClass?: unknown;
|
|
36
|
+
class?: unknown;
|
|
37
|
+
style?: unknown;
|
|
38
|
+
[attr: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
export interface ScrollAreaEmits {
|
|
41
|
+
/** 뷰포트가 스크롤될 때 */
|
|
42
|
+
scroll: [{
|
|
43
|
+
scrollTop: number;
|
|
44
|
+
scrollLeft: number;
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
47
|
+
export declare const createScrollArea: import('../..').CoreFactory<ScrollAreaProps, ScrollAreaEmits, void>;
|