@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,50 @@
|
|
|
1
|
+
import { TooltipAlign, TooltipSide } from './placement';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tooltip 코어 — 앵커에 붙는 설명 버블.
|
|
5
|
+
*
|
|
6
|
+
* 다른 moz 컴포넌트와 구조가 하나 다르다: **트리거를 그리지 않는다.** 툴팁의 트리거는
|
|
7
|
+
* 언제나 소비처가 이미 렌더한 요소(버튼·칩·말줄임 텍스트…)이고, 그것을 코어가 다시
|
|
8
|
+
* 그리면 소비처의 마크업·이벤트·ref 가 코어 소유로 넘어간다. 그래서 코어는 앵커
|
|
9
|
+
* element 를 `anchor` prop 으로 받아 **버블만** body 포털에 그리고, 트리거 이벤트 배선은
|
|
10
|
+
* 프레임워크 래퍼가 맡는다.
|
|
11
|
+
*
|
|
12
|
+
* 내용은 두 갈래다.
|
|
13
|
+
* - `text`: 문자열 한 줄 (Vue 디렉티브 대체 경로).
|
|
14
|
+
* - `content` slot: 임의 노드. React 래퍼는 브릿지의 **동적 slot(`slots` prop)** 경로로
|
|
15
|
+
* 넘긴다 — 그 경로는 소비자 React 트리 안에서 `createPortal` 로 그려지므로 Router·
|
|
16
|
+
* QueryClient 같은 context 가 끊기지 않는다(정적 slot 의 독립 root 와 다르다).
|
|
17
|
+
*
|
|
18
|
+
* 배치는 `placement.ts` 의 순수 함수가 계산한다(flip/shift/화살표 오프셋). 코어는 측정과
|
|
19
|
+
* 재배치 트리거만 담당한다.
|
|
20
|
+
*/
|
|
21
|
+
export interface TooltipProps {
|
|
22
|
+
/** 열림 여부 — 지연·hover 판단은 래퍼 몫이고 코어는 결과만 받는다 */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** 기준 element. 없으면 버블을 그리지 않는다 */
|
|
25
|
+
anchor?: HTMLElement | null;
|
|
26
|
+
/** 문자열 내용 (`content` slot 이 있으면 무시) */
|
|
27
|
+
text?: string;
|
|
28
|
+
side?: TooltipSide;
|
|
29
|
+
align?: TooltipAlign;
|
|
30
|
+
/** 앵커와 버블 사이 간격(px) */
|
|
31
|
+
sideOffset?: number;
|
|
32
|
+
/** 뷰포트 가장자리 최소 여백(px) */
|
|
33
|
+
collisionPadding?: number;
|
|
34
|
+
/** 화살표 렌더 여부 */
|
|
35
|
+
arrow?: boolean;
|
|
36
|
+
/** 버블 element id — 트리거의 `aria-describedby` 가 가리킬 값 */
|
|
37
|
+
tooltipId?: string;
|
|
38
|
+
class?: unknown;
|
|
39
|
+
style?: unknown;
|
|
40
|
+
[attr: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface TooltipEmits {
|
|
43
|
+
/** flip 이 반영된 실제 방향이 정해질 때마다 */
|
|
44
|
+
placed: [TooltipSide];
|
|
45
|
+
}
|
|
46
|
+
export interface TooltipApi {
|
|
47
|
+
/** 앵커가 움직였을 때 재측정 (스크롤·리사이즈는 코어가 알아서 건다) */
|
|
48
|
+
reposition(): void;
|
|
49
|
+
}
|
|
50
|
+
export declare const createTooltip: import('../..').CoreFactory<TooltipProps, TooltipEmits, TooltipApi>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TreeSelect 고유 아이콘 — IconArrowDownCenter/UpCenter(확장 토글) + IconExpandList/CollapseList(전체 펼침/접기).
|
|
5
|
+
* Dropdown/Search/Check 는 Select 아이콘 재사용('../select/icons').
|
|
6
|
+
*/
|
|
7
|
+
/** IconArrowDownCenter.vue 1:1 (기본 12, thin=false → 12 viewBox) */
|
|
8
|
+
export declare function iconArrowDownCenter(color?: string, size?: number): TemplateResult;
|
|
9
|
+
/** IconArrowUpCenter.vue 1:1 (기본 12) */
|
|
10
|
+
export declare function iconArrowUpCenter(color?: string, size?: number): TemplateResult;
|
|
11
|
+
/** IconExpandList.vue 1:1 (기본 12) */
|
|
12
|
+
export declare function iconExpandList(color?: string, size?: number, cls?: string): TemplateResult;
|
|
13
|
+
/** IconCollapseList.vue 1:1 (기본 12) */
|
|
14
|
+
export declare function iconCollapseList(color?: string, size?: number, cls?: string): TemplateResult;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { TreeSelectProps, TreeSelectEmits, TreeSelectApi } from './treeselect.core';
|
|
3
|
+
|
|
4
|
+
export { createTreeSelect } from './treeselect.core';
|
|
5
|
+
export type { TreeSelectProps, TreeSelectEmits, TreeSelectApi, TreeModel } from './treeselect.core';
|
|
6
|
+
export type { TreeProps, Depth, FlatHierarchyItem, TreeItemSource } from './tree-utils';
|
|
7
|
+
export { DEFAULT_TREE_PROPS } from './tree-utils';
|
|
8
|
+
/**
|
|
9
|
+
* TreeSelect — 카테고리 트리 단일/다중 선택(가상 스크롤 + 필터 + 확장/접기 + indeterminate + 검증).
|
|
10
|
+
* 스타일: treeselect.css + label.css + checkbox.css. modelValue 는 string(단일)/string[](다중).
|
|
11
|
+
*/
|
|
12
|
+
export declare const TREESELECT_SPEC: MozSpec<TreeSelectProps, TreeSelectEmits, TreeSelectApi>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TreeSelect 순수 트리 로직 — TreeSelect.ts + useTreeItem.ts 1:1 이식 (프레임워크 무관).
|
|
3
|
+
* 카테고리 데이터 → depth0/1/2 flat hierarchy + 카테고리 Set 부모/자식 캐스케이드.
|
|
4
|
+
*/
|
|
5
|
+
export type Depth = 0 | 1 | 2;
|
|
6
|
+
export type DepthKey = `depth${Depth}`;
|
|
7
|
+
export interface Item {
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export interface InputItem extends Item {
|
|
12
|
+
categoryLv1ID?: string;
|
|
13
|
+
categoryLv2ID?: string;
|
|
14
|
+
parent?: string;
|
|
15
|
+
isSubCategory?: boolean;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface FlatHierarchyItem extends InputItem {
|
|
19
|
+
depth: Depth;
|
|
20
|
+
isHidden?: boolean;
|
|
21
|
+
isExpanded?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface TreeItemSource {
|
|
24
|
+
code: string;
|
|
25
|
+
name: string;
|
|
26
|
+
categoryLv1ID: string;
|
|
27
|
+
categoryLv1Label?: string;
|
|
28
|
+
categoryLv2ID?: string;
|
|
29
|
+
categoryLv2Label?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TreeProps {
|
|
33
|
+
keyProp: string;
|
|
34
|
+
displayProp?: string;
|
|
35
|
+
categoryLv1ID: string;
|
|
36
|
+
categoryLv1Label?: string;
|
|
37
|
+
categoryLv2ID?: string;
|
|
38
|
+
categoryLv2Label?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CategoryList {
|
|
42
|
+
categoryLv1Set: Set<string>;
|
|
43
|
+
categoryLv2Set: Set<string>;
|
|
44
|
+
}
|
|
45
|
+
export declare const DEFAULT_TREE_PROPS: TreeProps;
|
|
46
|
+
/** useTreeItem 1:1 — itemsSource 를 TreeItemSource 로 매핑 */
|
|
47
|
+
export declare function processTreeItems(items: Record<string, unknown>[], props: TreeProps): TreeItemSource[];
|
|
48
|
+
/** buildFlatHierarchyFromCategory 1:1 */
|
|
49
|
+
export declare function buildFlatHierarchyFromCategory(data: TreeItemSource[]): FlatHierarchyItem[];
|
|
50
|
+
export declare function convertToFlatSets(items: FlatHierarchyItem[]): Set<string>;
|
|
51
|
+
export declare function isLastDepth(maxDepth: Depth, depth: Depth): boolean;
|
|
52
|
+
export declare function getChildDepthList(itemsSource: FlatHierarchyItem[], value: FlatHierarchyItem): FlatHierarchyItem[];
|
|
53
|
+
export declare function arrayToFilterSet(array: FlatHierarchyItem[]): Set<string>;
|
|
54
|
+
export declare function processChildDepth(itemsSource: FlatHierarchyItem[], value: FlatHierarchyItem): {
|
|
55
|
+
childDepthList: FlatHierarchyItem[];
|
|
56
|
+
};
|
|
57
|
+
export declare function isAllChildSelected(childSet: Set<string>, selectedSet: Set<string>): boolean;
|
|
58
|
+
export declare function deleteCategory(categoryList: CategoryList, depth: Depth, code: string): void;
|
|
59
|
+
export declare function addCategoryList(categoryList: CategoryList, depth: Depth, code: string): void;
|
|
60
|
+
export declare function addCategoryParent(categoryList: CategoryList, code1: string, code2: string): void;
|
|
61
|
+
export declare function resetCategoryList(categoryList: CategoryList): void;
|
|
62
|
+
export declare function addWithParentsAndChildren(categoryList: CategoryList, itemsSource: FlatHierarchyItem[], value: FlatHierarchyItem, lastDepth: Depth): void;
|
|
63
|
+
export declare function deleteWithParentsAndChildren(categoryList: CategoryList, itemsSource: FlatHierarchyItem[], value: FlatHierarchyItem, lastDepth: Depth): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Rule, RuleEventTarget } from '../../validator/types';
|
|
2
|
+
import { TreeProps } from './tree-utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TreeSelect 코어 — TreeSelect.vue(+.ts/Item/composables) 1:1 포팅. 라이브러리 최대 복잡 컴포넌트.
|
|
6
|
+
*
|
|
7
|
+
* 보존 포인트(1:1):
|
|
8
|
+
* - 카테고리 데이터 → depth0/1/2 flat hierarchy(in-place isExpanded/isHidden). 렌더는 flat 가상 리스트.
|
|
9
|
+
* - 3상태 얽힘: flatList / categoryLv1Set·categoryLv2Set(부모 체크) / model(last-depth 선택 키).
|
|
10
|
+
* - useMultiSelect=false→단일(model=string, last-depth 만, onSelectSingle) / true→다중(model=string[], 캐스케이드).
|
|
11
|
+
* - 확장/축소(onToggleExpanded+toggleChildrenHidden 재귀 / toggleAll 전체), indeterminate(자식 선택수 기준).
|
|
12
|
+
* - 필터(부모 stack 유지), showOnlySelected(선택+조상), select-all(onAddSearch/onSelectOnlyRes).
|
|
13
|
+
* - 위치(calcPosition+shouldOpenOppositeDirection, MultiSelect 동형), closeOnScroll/closeMenuAtBodyClick/Esc, Validator.
|
|
14
|
+
* - 기벽: 단일 선택은 change emit 안 함(update:modelValue 만). ITEM_HEIGHT CSS var→24.
|
|
15
|
+
*/
|
|
16
|
+
export type TreeModel = string | string[];
|
|
17
|
+
export interface TreeSelectProps {
|
|
18
|
+
itemsSource: Record<string, unknown>[];
|
|
19
|
+
label?: string | null;
|
|
20
|
+
width?: string | number;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
disabledProp?: string;
|
|
25
|
+
rules?: Rule[];
|
|
26
|
+
useSelectAll?: boolean;
|
|
27
|
+
useFilter?: boolean;
|
|
28
|
+
headerFormat?: string;
|
|
29
|
+
listBoxWidth?: number | string;
|
|
30
|
+
useSpecificSelect?: boolean;
|
|
31
|
+
treeLevels?: number;
|
|
32
|
+
useMultiSelect?: boolean;
|
|
33
|
+
treeProps?: TreeProps;
|
|
34
|
+
modelValue?: TreeModel;
|
|
35
|
+
[attr: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface TreeSelectEmits {
|
|
38
|
+
change: [values: string[], items: string[]];
|
|
39
|
+
close: [];
|
|
40
|
+
'update:modelValue': [TreeModel];
|
|
41
|
+
}
|
|
42
|
+
export interface TreeSelectApi {
|
|
43
|
+
validate(eventTarget?: RuleEventTarget): Promise<boolean>;
|
|
44
|
+
}
|
|
45
|
+
export declare const createTreeSelect: import('../..').CoreFactory<TreeSelectProps, TreeSelectEmits, TreeSelectApi>;
|