@iyulab/components 1.3.4 → 1.5.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/CHANGELOG.md +30 -0
- package/dist/_virtual/_glob-assets_raw/alert-circle-fill.svg.1e438750.js +4 -0
- package/dist/_virtual/_glob-assets_raw/alert-triangle-fill.svg.1a8797c4.js +4 -0
- package/dist/_virtual/_glob-assets_raw/bell-fill.svg.d37c41d9.js +1 -1
- package/dist/_virtual/_glob-assets_raw/check.svg.4690b01e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-down.svg.0ccd06ea.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-left.svg.b4601050.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-right.svg.0711bb67.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-up.svg.ed917211.js +1 -1
- package/dist/_virtual/_glob-assets_raw/circle-check-fill.svg.3f0fcb72.js +4 -0
- package/dist/_virtual/_glob-assets_raw/copy.svg.6192f853.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/eye-off.svg.7aa25df0.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye.svg.2e5e9c4c.js +1 -1
- package/dist/_virtual/_glob-assets_raw/info-circle-fill.svg.6580071d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/minus.svg.4610de75.js +4 -0
- package/dist/_virtual/_glob-assets_raw/plus.svg.d83ead68.js +4 -0
- package/dist/_virtual/_glob-assets_raw/search.svg.0ba2012d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/star-fill.svg.f24b5a2d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/star.svg.4af61468.js +1 -1
- package/dist/_virtual/_glob-assets_raw/x.svg.5596f6bb.js +4 -0
- package/dist/assets/locales/ar.json.js +23 -0
- package/dist/assets/locales/de.json.js +23 -0
- package/dist/assets/locales/en.json.js +23 -0
- package/dist/assets/locales/es.json.js +23 -0
- package/dist/assets/locales/fr.json.js +23 -0
- package/dist/assets/locales/id.json.js +23 -0
- package/dist/assets/locales/ja.json.js +23 -0
- package/dist/assets/locales/ko.json.js +23 -0
- package/dist/assets/locales/pt-BR.json.js +23 -0
- package/dist/assets/locales/ru.json.js +23 -0
- package/dist/assets/locales/th.json.js +23 -0
- package/dist/assets/locales/vi.json.js +23 -0
- package/dist/assets/locales/zh-CN.json.js +23 -0
- package/dist/assets/locales/zh-TW.json.js +23 -0
- package/dist/components/UFloatingElement.js +13 -4
- package/dist/components/UFormControlElement.d.ts +38 -8
- package/dist/components/UFormControlElement.js +61 -6
- package/dist/components/UOverlayElement.d.ts +4 -0
- package/dist/components/UOverlayElement.js +14 -4
- package/dist/components/alert/UAlert.js +14 -8
- package/dist/components/alert/UAlert.styles.js +0 -6
- package/dist/components/avatar/UAvatar.js +1 -1
- package/dist/components/badge/UBadge.d.ts +1 -1
- package/dist/components/badge/UBadge.js +2 -2
- package/dist/components/badge/UBadge.styles.js +1 -1
- package/dist/components/breadcrumb/UBreadcrumb.js +1 -1
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +1 -1
- package/dist/components/button/UButton.d.ts +6 -11
- package/dist/components/button/UButton.js +1 -1
- package/dist/components/button/UButton.styles.js +50 -51
- package/dist/components/button-group/UButtonGroup.js +1 -1
- package/dist/components/card/UCard.js +1 -1
- package/dist/components/carousel/UCarousel.js +2 -2
- package/dist/components/checkbox/UCheckbox.d.ts +4 -1
- package/dist/components/checkbox/UCheckbox.js +12 -9
- package/dist/components/checkbox/UCheckbox.styles.js +12 -7
- package/dist/components/chip/UChip.js +8 -5
- package/dist/components/copy-button/UCopyButton.d.ts +47 -0
- package/dist/components/copy-button/UCopyButton.js +94 -0
- package/dist/components/copy-button/UCopyButton.styles.js +21 -0
- package/dist/components/dialog/UDialog.js +3 -3
- package/dist/components/divider/UDivider.js +1 -1
- package/dist/components/drawer/UDrawer.js +3 -3
- package/dist/components/drawer/UDrawer.styles.js +0 -6
- package/dist/components/field/UField.js +1 -1
- package/dist/components/form/UForm.js +1 -1
- package/dist/components/icon/UIcon.js +1 -1
- package/dist/components/icon-button/UIconButton.d.ts +0 -1
- package/dist/components/icon-button/UIconButton.js +2 -7
- package/dist/components/icon-button/UIconButton.styles.js +2 -2
- package/dist/components/input/UInput.d.ts +2 -3
- package/dist/components/input/UInput.js +39 -11
- package/dist/components/input/UInput.styles.js +1 -4
- package/dist/components/menu/UMenu.js +1 -1
- package/dist/components/menu-item/UMenuItem.js +2 -2
- package/dist/components/menu-item/UMenuItem.styles.js +4 -3
- package/dist/components/option/UOption.d.ts +4 -1
- package/dist/components/option/UOption.js +11 -5
- package/dist/components/option/UOption.styles.js +5 -4
- package/dist/components/panel/UPanel.js +1 -1
- package/dist/components/popover/UPopover.js +1 -1
- package/dist/components/progress-bar/UProgressBar.js +1 -1
- package/dist/components/progress-bar/UProgressBar.styles.js +2 -2
- package/dist/components/progress-ring/UProgressRing.js +1 -1
- package/dist/components/progress-ring/UProgressRing.styles.js +2 -2
- package/dist/components/radio/URadio.d.ts +1 -1
- package/dist/components/radio/URadio.js +5 -6
- package/dist/components/radio/URadio.styles.js +21 -16
- package/dist/components/rating/URating.d.ts +3 -2
- package/dist/components/rating/URating.js +30 -37
- package/dist/components/select/USelect.d.ts +8 -5
- package/dist/components/select/USelect.js +30 -42
- package/dist/components/select/USelect.styles.js +5 -5
- package/dist/components/skeleton/USkeleton.js +1 -1
- package/dist/components/slider/USlider.d.ts +3 -2
- package/dist/components/slider/USlider.js +20 -30
- package/dist/components/slider/USlider.styles.js +2 -2
- package/dist/components/spinner/USpinner.js +1 -1
- package/dist/components/spinner/USpinner.styles.js +1 -1
- package/dist/components/split-panel/USplitPanel.js +25 -13
- package/dist/components/switch/USwitch.d.ts +4 -1
- package/dist/components/switch/USwitch.js +11 -8
- package/dist/components/switch/USwitch.styles.js +5 -1
- package/dist/components/tab/UTab.js +7 -4
- package/dist/components/tab-panel/UTabPanel.d.ts +5 -0
- package/dist/components/tab-panel/UTabPanel.js +12 -4
- package/dist/components/tab-panel/UTabPanel.styles.js +7 -3
- package/dist/components/tag/UTag.js +1 -1
- package/dist/components/tag/UTag.styles.js +14 -13
- package/dist/components/textarea/UTextarea.d.ts +1 -1
- package/dist/components/textarea/UTextarea.js +17 -6
- package/dist/components/tooltip/UTooltip.js +1 -1
- package/dist/components/tree/UTree.js +1 -1
- package/dist/components/tree-item/UTreeItem.js +11 -5
- package/dist/components/tree-item/UTreeItem.styles.js +5 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +7 -8
- package/dist/react/UCopyButton.d.ts +10 -0
- package/dist/react/UCopyButton.js +12 -0
- package/dist/react/UTabPanel.d.ts +1 -0
- package/dist/react/UTabPanel.js +3 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/styles/dark.css +99 -99
- package/dist/utilities/Locale.d.ts +38 -0
- package/dist/utilities/Locale.js +93 -0
- package/dist/utilities/Toast.d.ts +9 -0
- package/dist/utilities/Toast.js +15 -7
- package/dist/utilities/elements.d.ts +0 -23
- package/dist/utilities/elements.js +1 -34
- package/dist/utilities/icons.d.ts +1 -1
- package/dist/utilities/icons.js +22 -25
- package/package.json +2 -3
- package/skills/iyulab-components/SKILL.md +2 -3
- package/skills/iyulab-components/references/components/input.md +1 -2
- package/skills/iyulab-components/references/components/option.md +1 -0
- package/skills/iyulab-components/references/components/select.md +1 -2
- package/skills/iyulab-components/references/components/tab-panel.md +6 -0
- package/skills/iyulab-components/references/extensions/form-control.md +22 -6
- package/skills/iyulab-components/references/usage.md +11 -0
- package/skills/iyulab-components/references/utilities/elements.md +1 -17
- package/skills/iyulab-components/references/utilities/locale.md +36 -0
- package/skills/iyulab-components/references/utilities/theme.md +12 -0
- package/skills/iyulab-components/references/utilities/toast.md +6 -0
- package/dist/_virtual/_glob-assets_raw/check-circle-fill.svg.51c33a2a.js +0 -4
- package/dist/_virtual/_glob-assets_raw/check-lg.svg.371c5e78.js +0 -4
- package/dist/_virtual/_glob-assets_raw/dash-lg.svg.b40b8b3a.js +0 -4
- package/dist/_virtual/_glob-assets_raw/exclamation-circle-fill.svg.dc8c523e.js +0 -4
- package/dist/_virtual/_glob-assets_raw/exclamation-triangle-fill.svg.7949d2c7.js +0 -4
- package/dist/_virtual/_glob-assets_raw/eye-slash.svg.240afafa.js +0 -4
- package/dist/_virtual/_glob-assets_raw/plus-lg.svg.294e9073.js +0 -4
- package/dist/_virtual/_glob-assets_raw/three-dots-vertical.svg.9fee78c5.js +0 -4
- package/dist/_virtual/_glob-assets_raw/three-dots.svg.6a7a5b23.js +0 -4
- package/dist/_virtual/_glob-assets_raw/x-lg.svg.f34b882c.js +0 -4
- package/dist/components/UDataElement.d.ts +0 -44
- package/dist/components/UDataElement.js +0 -101
- package/dist/components/UDataElement.styles.js +0 -95
- package/dist/core/locale.d.ts +0 -69
- package/dist/core/locale.js +0 -85
- package/dist/utilities/sanitizers.d.ts +0 -35
- package/dist/utilities/sanitizers.js +0 -75
- package/skills/iyulab-components/references/extensions/data.md +0 -60
- package/skills/iyulab-components/references/utilities/sanitizers.md +0 -32
- /package/dist/components/{UDataElement.styles.d.ts → copy-button/UCopyButton.styles.d.ts} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import ar_default from "../assets/locales/ar.json.js";
|
|
2
|
+
import de_default from "../assets/locales/de.json.js";
|
|
3
|
+
import en_default from "../assets/locales/en.json.js";
|
|
4
|
+
import es_default from "../assets/locales/es.json.js";
|
|
5
|
+
import fr_default from "../assets/locales/fr.json.js";
|
|
6
|
+
import id_default from "../assets/locales/id.json.js";
|
|
7
|
+
import ja_default from "../assets/locales/ja.json.js";
|
|
8
|
+
import ko_default from "../assets/locales/ko.json.js";
|
|
9
|
+
import pt_BR_default from "../assets/locales/pt-BR.json.js";
|
|
10
|
+
import ru_default from "../assets/locales/ru.json.js";
|
|
11
|
+
import th_default from "../assets/locales/th.json.js";
|
|
12
|
+
import vi_default from "../assets/locales/vi.json.js";
|
|
13
|
+
import zh_CN_default from "../assets/locales/zh-CN.json.js";
|
|
14
|
+
import zh_TW_default from "../assets/locales/zh-TW.json.js";
|
|
15
|
+
//#region src/utilities/Locale.ts
|
|
16
|
+
var builtins = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
17
|
+
"../assets/locales/ar.json": ar_default,
|
|
18
|
+
"../assets/locales/de.json": de_default,
|
|
19
|
+
"../assets/locales/en.json": en_default,
|
|
20
|
+
"../assets/locales/es.json": es_default,
|
|
21
|
+
"../assets/locales/fr.json": fr_default,
|
|
22
|
+
"../assets/locales/id.json": id_default,
|
|
23
|
+
"../assets/locales/ja.json": ja_default,
|
|
24
|
+
"../assets/locales/ko.json": ko_default,
|
|
25
|
+
"../assets/locales/pt-BR.json": pt_BR_default,
|
|
26
|
+
"../assets/locales/ru.json": ru_default,
|
|
27
|
+
"../assets/locales/th.json": th_default,
|
|
28
|
+
"../assets/locales/vi.json": vi_default,
|
|
29
|
+
"../assets/locales/zh-CN.json": zh_CN_default,
|
|
30
|
+
"../assets/locales/zh-TW.json": zh_TW_default
|
|
31
|
+
})).map(([path, mod]) => {
|
|
32
|
+
return [(path.split("/").pop()?.replace(".json", "") || "").toLowerCase(), mod];
|
|
33
|
+
}));
|
|
34
|
+
var overrides = /* @__PURE__ */ new Map();
|
|
35
|
+
/** 브라우저 환경이면 `navigator.language`/`document.lang`으로 초기 로케일을 추측한다. */
|
|
36
|
+
function detectLocale() {
|
|
37
|
+
if (typeof navigator !== "undefined" && navigator.language) return navigator.language;
|
|
38
|
+
if (typeof document !== "undefined" && document.documentElement?.lang) return document.documentElement.lang;
|
|
39
|
+
return "en";
|
|
40
|
+
}
|
|
41
|
+
var active = detectLocale();
|
|
42
|
+
/** 정확 일치 → base 언어(ko-KR → ko) → en 순으로 값을 찾는다. */
|
|
43
|
+
function lookup(locale, key) {
|
|
44
|
+
const norm = locale.toLowerCase();
|
|
45
|
+
const base = norm.split("-")[0];
|
|
46
|
+
const chain = base === norm ? [norm, "en"] : [
|
|
47
|
+
norm,
|
|
48
|
+
base,
|
|
49
|
+
"en"
|
|
50
|
+
];
|
|
51
|
+
for (const tag of chain) {
|
|
52
|
+
const value = overrides.get(tag)?.[key] ?? builtins.get(tag)?.[key];
|
|
53
|
+
if (value) return value;
|
|
54
|
+
}
|
|
55
|
+
return builtins.get("en")[key];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 검증 메시지 로케일을 관리하는 정적 유틸리티입니다.
|
|
59
|
+
*/
|
|
60
|
+
var Locale = class {
|
|
61
|
+
/** 개별 인스턴스 생성을 방지합니다. */
|
|
62
|
+
constructor() {}
|
|
63
|
+
/** 전역 활성 로케일을 지정합니다. */
|
|
64
|
+
static set(locale) {
|
|
65
|
+
active = locale;
|
|
66
|
+
}
|
|
67
|
+
/** 전역 활성 로케일을 반환합니다 (초기값은 브라우저 언어 자동 감지, 실패 시 'en'). */
|
|
68
|
+
static get() {
|
|
69
|
+
return active;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 로케일 하나의 메시지 테이블(전체 또는 일부)을 등록합니다.
|
|
73
|
+
* 이미 존재하는 값(내장 포함) 위에 병합되므로, 일부 키만 넘겨도 나머지 키가 사라지지 않습니다.
|
|
74
|
+
*/
|
|
75
|
+
static register(locale, table) {
|
|
76
|
+
const norm = locale.toLowerCase();
|
|
77
|
+
const current = overrides.get(norm) ?? builtins.get(norm) ?? builtins.get("en");
|
|
78
|
+
overrides.set(norm, {
|
|
79
|
+
...current,
|
|
80
|
+
...table
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 현재 활성 로케일 기준으로 메시지를 조회합니다.
|
|
85
|
+
* `params`가 있으면 템플릿의 `{name}` 자리를 치환합니다.
|
|
86
|
+
*/
|
|
87
|
+
static getValue(key, params) {
|
|
88
|
+
const template = lookup(active, key);
|
|
89
|
+
return params ? template.replace(/\{(\w+)\}/g, (_, name) => params[name] != null ? String(params[name]) : `{${name}}`) : template;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { Locale };
|
|
@@ -22,6 +22,15 @@ export interface ToastOptions {
|
|
|
22
22
|
export declare class Toast {
|
|
23
23
|
private static containers;
|
|
24
24
|
private static elements;
|
|
25
|
+
/**
|
|
26
|
+
* 모든 Toast 호출에 적용될 전역 기본 옵션입니다. 개별 호출의 `options`가 우선합니다.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* Toast.DefaultOptions = { position: 'bottom-center', duration: 3000 };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
static DefaultOptions: Partial<ToastOptions>;
|
|
25
34
|
/** 개별 인스턴스 생성을 방지합니다. */
|
|
26
35
|
private constructor();
|
|
27
36
|
/** 기본 메시지 알림 */
|
package/dist/utilities/Toast.js
CHANGED
|
@@ -10,6 +10,9 @@ var Toast = class {
|
|
|
10
10
|
static {
|
|
11
11
|
this.elements = /* @__PURE__ */ new Set();
|
|
12
12
|
}
|
|
13
|
+
static {
|
|
14
|
+
this.DefaultOptions = {};
|
|
15
|
+
}
|
|
13
16
|
/** 개별 인스턴스 생성을 방지합니다. */
|
|
14
17
|
constructor() {}
|
|
15
18
|
/** 기본 메시지 알림 */
|
|
@@ -38,21 +41,26 @@ var Toast = class {
|
|
|
38
41
|
}
|
|
39
42
|
/** 토스트 알림을 생성합니다. */
|
|
40
43
|
static async show(status, content, options) {
|
|
44
|
+
const merged = {
|
|
45
|
+
...this.DefaultOptions,
|
|
46
|
+
...options
|
|
47
|
+
};
|
|
41
48
|
const el = new UAlert();
|
|
42
49
|
el.status = status;
|
|
43
50
|
el.innerHTML = content || "";
|
|
44
|
-
el.variant =
|
|
45
|
-
el.title =
|
|
46
|
-
el.closable =
|
|
47
|
-
el.duration =
|
|
51
|
+
el.variant = merged.variant || "solid";
|
|
52
|
+
el.title = merged.title || "";
|
|
53
|
+
el.closable = merged.closable ?? true;
|
|
54
|
+
el.duration = merged.duration ?? 4e3;
|
|
48
55
|
this.elements.add(el);
|
|
49
|
-
const position =
|
|
50
|
-
const target =
|
|
56
|
+
const position = merged.position || "top-right";
|
|
57
|
+
const target = merged.target || document.body;
|
|
51
58
|
const container = this.getOrCreateContainer(position, target);
|
|
52
59
|
container.appendChild(el);
|
|
53
60
|
await el.updateComplete;
|
|
54
61
|
el.show();
|
|
55
|
-
el.addEventListener("hide", async () => {
|
|
62
|
+
el.addEventListener("hide", async (e) => {
|
|
63
|
+
if (e.target !== el) return;
|
|
56
64
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
57
65
|
el.remove();
|
|
58
66
|
this.elements.delete(el);
|
|
@@ -15,26 +15,3 @@ export declare function querySelectorWithin(element: Element, selectors: string)
|
|
|
15
15
|
* - 탐색은 element가 존재하는 shadow DOM 또는 document 루트 범위에서 이루어집니다.
|
|
16
16
|
*/
|
|
17
17
|
export declare function querySelectorAllWithin(element: Element, selectors: string): HTMLElement[];
|
|
18
|
-
/**
|
|
19
|
-
* 지정한 태그, 속성, 내용으로 커스텀 엘리먼트 HTML 문자열을 생성합니다.
|
|
20
|
-
*
|
|
21
|
-
* 속성 값 처리 규칙:
|
|
22
|
-
* - `null` / `undefined` → 해당 속성 생략
|
|
23
|
-
* - `false` (boolean) → 해당 속성 생략
|
|
24
|
-
* - `true` (boolean) → 값 없이 키만 출력 (예: `disabled`)
|
|
25
|
-
* - `object` → `JSON.stringify` 후 `escapeHtmlAttr`
|
|
26
|
-
* - `href` / `src` 키 → `escapeHtmlHref` 적용
|
|
27
|
-
* - 그 외 string → `escapeHtmlAttr` 적용
|
|
28
|
-
*
|
|
29
|
-
* `content`는 이미 안전한 HTML 문자열이라고 가정합니다 (내부 escape 없음).
|
|
30
|
-
*
|
|
31
|
-
* @param tag - 커스텀 엘리먼트 태그 이름 (예: `"u-ref-tag"`)
|
|
32
|
-
* @param attrs - 속성 객체
|
|
33
|
-
* @param content - 내부 HTML 문자열 (기본값: `""`)
|
|
34
|
-
* @returns 생성된 HTML 문자열
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* buildElementHTML('u-ref-tag', { href: 'https://example.com', disabled: true }, 'Click');
|
|
38
|
-
* // → '<u-ref-tag href="https://example.com" disabled>Click</u-ref-tag>'
|
|
39
|
-
*/
|
|
40
|
-
export declare function buildElementHTML(tag: string, attrs?: Record<string, string | boolean | object | null | undefined>, content?: string): string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { escapeHtmlAttr, escapeHtmlHref } from "./sanitizers.js";
|
|
2
1
|
//#region src/utilities/elements.ts
|
|
3
2
|
/**
|
|
4
3
|
* 엘리먼트의 부모 엘리먼트를 반환합니다.
|
|
@@ -35,37 +34,5 @@ function querySelectorAllWithin(element, selectors) {
|
|
|
35
34
|
return Array.from(nodeList);
|
|
36
35
|
} else return [];
|
|
37
36
|
}
|
|
38
|
-
/**
|
|
39
|
-
* 지정한 태그, 속성, 내용으로 커스텀 엘리먼트 HTML 문자열을 생성합니다.
|
|
40
|
-
*
|
|
41
|
-
* 속성 값 처리 규칙:
|
|
42
|
-
* - `null` / `undefined` → 해당 속성 생략
|
|
43
|
-
* - `false` (boolean) → 해당 속성 생략
|
|
44
|
-
* - `true` (boolean) → 값 없이 키만 출력 (예: `disabled`)
|
|
45
|
-
* - `object` → `JSON.stringify` 후 `escapeHtmlAttr`
|
|
46
|
-
* - `href` / `src` 키 → `escapeHtmlHref` 적용
|
|
47
|
-
* - 그 외 string → `escapeHtmlAttr` 적용
|
|
48
|
-
*
|
|
49
|
-
* `content`는 이미 안전한 HTML 문자열이라고 가정합니다 (내부 escape 없음).
|
|
50
|
-
*
|
|
51
|
-
* @param tag - 커스텀 엘리먼트 태그 이름 (예: `"u-ref-tag"`)
|
|
52
|
-
* @param attrs - 속성 객체
|
|
53
|
-
* @param content - 내부 HTML 문자열 (기본값: `""`)
|
|
54
|
-
* @returns 생성된 HTML 문자열
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* buildElementHTML('u-ref-tag', { href: 'https://example.com', disabled: true }, 'Click');
|
|
58
|
-
* // → '<u-ref-tag href="https://example.com" disabled>Click</u-ref-tag>'
|
|
59
|
-
*/
|
|
60
|
-
function buildElementHTML(tag, attrs = {}, content = "") {
|
|
61
|
-
const URL_ATTR = /* @__PURE__ */ new Set(["href", "src"]);
|
|
62
|
-
const attrStr = Object.entries(attrs).flatMap(([k, v]) => {
|
|
63
|
-
if (v === void 0 || v == null || v === false) return [];
|
|
64
|
-
if (v === true) return [k];
|
|
65
|
-
const raw = typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
66
|
-
return [`${k}="${URL_ATTR.has(k) ? escapeHtmlHref(raw) : escapeHtmlAttr(raw)}"`];
|
|
67
|
-
}).join(" ");
|
|
68
|
-
return attrStr ? `<${tag} ${attrStr}>${content}</${tag}>` : `<${tag}>${content}</${tag}>`;
|
|
69
|
-
}
|
|
70
37
|
//#endregion
|
|
71
|
-
export {
|
|
38
|
+
export { getParentElement, querySelectorAllWithin, querySelectorWithin };
|
|
@@ -52,7 +52,7 @@ declare class IconRegistry {
|
|
|
52
52
|
static has(lib: string): boolean;
|
|
53
53
|
/**
|
|
54
54
|
* 지정된 아이콘 라이브러리를 등록합니다.
|
|
55
|
-
* 이미 등록된 라이브러리 이름인 경우,
|
|
55
|
+
* 이미 등록된 라이브러리 이름인 경우, 기존 등록을 덮어쓰지 않고 무시합니다.
|
|
56
56
|
*/
|
|
57
57
|
static register(lib: string, resolver: IconResolver): void;
|
|
58
58
|
/**
|
package/dist/utilities/icons.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
import alert_circle_fill_svg_default from "../_virtual/_glob-assets_raw/alert-circle-fill.svg.1e438750.js";
|
|
2
|
+
import alert_triangle_fill_svg_default from "../_virtual/_glob-assets_raw/alert-triangle-fill.svg.1a8797c4.js";
|
|
1
3
|
import bell_fill_svg_default from "../_virtual/_glob-assets_raw/bell-fill.svg.d37c41d9.js";
|
|
2
|
-
import
|
|
3
|
-
import check_lg_svg_default from "../_virtual/_glob-assets_raw/check-lg.svg.371c5e78.js";
|
|
4
|
+
import check_svg_default from "../_virtual/_glob-assets_raw/check.svg.4690b01e.js";
|
|
4
5
|
import chevron_down_svg_default from "../_virtual/_glob-assets_raw/chevron-down.svg.0ccd06ea.js";
|
|
5
6
|
import chevron_left_svg_default from "../_virtual/_glob-assets_raw/chevron-left.svg.b4601050.js";
|
|
6
7
|
import chevron_right_svg_default from "../_virtual/_glob-assets_raw/chevron-right.svg.0711bb67.js";
|
|
7
8
|
import chevron_up_svg_default from "../_virtual/_glob-assets_raw/chevron-up.svg.ed917211.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import eye_slash_svg_default from "../_virtual/_glob-assets_raw/eye-slash.svg.240afafa.js";
|
|
9
|
+
import circle_check_fill_svg_default from "../_virtual/_glob-assets_raw/circle-check-fill.svg.3f0fcb72.js";
|
|
10
|
+
import copy_svg_default from "../_virtual/_glob-assets_raw/copy.svg.6192f853.js";
|
|
11
|
+
import eye_off_svg_default from "../_virtual/_glob-assets_raw/eye-off.svg.7aa25df0.js";
|
|
12
12
|
import eye_svg_default from "../_virtual/_glob-assets_raw/eye.svg.2e5e9c4c.js";
|
|
13
13
|
import info_circle_fill_svg_default from "../_virtual/_glob-assets_raw/info-circle-fill.svg.6580071d.js";
|
|
14
|
-
import
|
|
14
|
+
import minus_svg_default from "../_virtual/_glob-assets_raw/minus.svg.4610de75.js";
|
|
15
|
+
import plus_svg_default from "../_virtual/_glob-assets_raw/plus.svg.d83ead68.js";
|
|
15
16
|
import search_svg_default from "../_virtual/_glob-assets_raw/search.svg.0ba2012d.js";
|
|
16
17
|
import star_fill_svg_default from "../_virtual/_glob-assets_raw/star-fill.svg.f24b5a2d.js";
|
|
17
18
|
import star_svg_default from "../_virtual/_glob-assets_raw/star.svg.4af61468.js";
|
|
18
|
-
import
|
|
19
|
-
import three_dots_svg_default from "../_virtual/_glob-assets_raw/three-dots.svg.6a7a5b23.js";
|
|
20
|
-
import x_lg_svg_default from "../_virtual/_glob-assets_raw/x-lg.svg.f34b882c.js";
|
|
19
|
+
import x_svg_default from "../_virtual/_glob-assets_raw/x.svg.5596f6bb.js";
|
|
21
20
|
//#region src/utilities/icons.ts
|
|
22
21
|
var defaultIconBaseUrl = "/assets/icons/";
|
|
23
22
|
/**
|
|
@@ -38,27 +37,26 @@ function setDefaultBaseUrl(url) {
|
|
|
38
37
|
* vite의 `import.meta.glob`을 사용하여 내부 경로상의 모든 SVG 파일을 빌드 시점에 한 번에 로드합니다.
|
|
39
38
|
* 이 레지스트리는 런타임 동안 불변이며, 아이콘 조회 시 재사용됩니다.
|
|
40
39
|
*/
|
|
41
|
-
var
|
|
40
|
+
var InternalIconBundle = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
41
|
+
"../assets/icons/alert-circle-fill.svg": alert_circle_fill_svg_default,
|
|
42
|
+
"../assets/icons/alert-triangle-fill.svg": alert_triangle_fill_svg_default,
|
|
42
43
|
"../assets/icons/bell-fill.svg": bell_fill_svg_default,
|
|
43
|
-
"../assets/icons/check
|
|
44
|
-
"../assets/icons/check-lg.svg": check_lg_svg_default,
|
|
44
|
+
"../assets/icons/check.svg": check_svg_default,
|
|
45
45
|
"../assets/icons/chevron-down.svg": chevron_down_svg_default,
|
|
46
46
|
"../assets/icons/chevron-left.svg": chevron_left_svg_default,
|
|
47
47
|
"../assets/icons/chevron-right.svg": chevron_right_svg_default,
|
|
48
48
|
"../assets/icons/chevron-up.svg": chevron_up_svg_default,
|
|
49
|
-
"../assets/icons/
|
|
50
|
-
"../assets/icons/
|
|
51
|
-
"../assets/icons/
|
|
52
|
-
"../assets/icons/eye-slash.svg": eye_slash_svg_default,
|
|
49
|
+
"../assets/icons/circle-check-fill.svg": circle_check_fill_svg_default,
|
|
50
|
+
"../assets/icons/copy.svg": copy_svg_default,
|
|
51
|
+
"../assets/icons/eye-off.svg": eye_off_svg_default,
|
|
53
52
|
"../assets/icons/eye.svg": eye_svg_default,
|
|
54
53
|
"../assets/icons/info-circle-fill.svg": info_circle_fill_svg_default,
|
|
55
|
-
"../assets/icons/
|
|
54
|
+
"../assets/icons/minus.svg": minus_svg_default,
|
|
55
|
+
"../assets/icons/plus.svg": plus_svg_default,
|
|
56
56
|
"../assets/icons/search.svg": search_svg_default,
|
|
57
57
|
"../assets/icons/star-fill.svg": star_fill_svg_default,
|
|
58
58
|
"../assets/icons/star.svg": star_svg_default,
|
|
59
|
-
"../assets/icons/
|
|
60
|
-
"../assets/icons/three-dots.svg": three_dots_svg_default,
|
|
61
|
-
"../assets/icons/x-lg.svg": x_lg_svg_default
|
|
59
|
+
"../assets/icons/x.svg": x_svg_default
|
|
62
60
|
})).map(([path, module]) => {
|
|
63
61
|
return [path.split("/").pop()?.replace(".svg", "") || "", module];
|
|
64
62
|
}).filter(([name]) => name !== ""));
|
|
@@ -118,11 +116,10 @@ var IconRegistry = class {
|
|
|
118
116
|
}
|
|
119
117
|
/**
|
|
120
118
|
* 지정된 아이콘 라이브러리를 등록합니다.
|
|
121
|
-
* 이미 등록된 라이브러리 이름인 경우,
|
|
119
|
+
* 이미 등록된 라이브러리 이름인 경우, 기존 등록을 덮어쓰지 않고 무시합니다.
|
|
122
120
|
*/
|
|
123
121
|
static register(lib, resolver) {
|
|
124
|
-
if (this.libs.has(lib))
|
|
125
|
-
else this.libs.set(lib, resolver);
|
|
122
|
+
if (!this.libs.has(lib)) this.libs.set(lib, resolver);
|
|
126
123
|
}
|
|
127
124
|
/**
|
|
128
125
|
* 지정된 아이콘 라이브러리를 등록 해제합니다.
|
|
@@ -140,7 +137,7 @@ var IconRegistry = class {
|
|
|
140
137
|
}
|
|
141
138
|
};
|
|
142
139
|
IconRegistry.register("internal", (name) => {
|
|
143
|
-
return
|
|
140
|
+
return InternalIconBundle.get(name);
|
|
144
141
|
});
|
|
145
142
|
IconRegistry.register("tabler", async (name) => {
|
|
146
143
|
if (IconCache.has("tabler", name)) return IconCache.get("tabler", name);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/components",
|
|
3
3
|
"description": "web-components library based on lit-element made by iyulab",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iyulab",
|
|
7
7
|
"components",
|
|
@@ -39,9 +39,8 @@
|
|
|
39
39
|
"./plugins/*": "./plugins/*"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"
|
|
42
|
+
"start": "vite --force",
|
|
43
43
|
"test": "vitest run",
|
|
44
|
-
"test:watch": "vitest",
|
|
45
44
|
"test:browser": "vitest run --project=browser",
|
|
46
45
|
"build:plugins": "tsc -p plugins/tsconfig.json",
|
|
47
46
|
"build": "eslint && vite build && npm run build:plugins"
|
|
@@ -4,7 +4,7 @@ description: Web component library built on Lit. Covers all u-* custom elements
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: iyulab
|
|
7
|
-
version: "1.0
|
|
7
|
+
version: "1.4.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# @iyulab/components
|
|
@@ -119,7 +119,7 @@ import { UButton, UInput } from '@iyulab/components/react';
|
|
|
119
119
|
- [`IconRegistry`](./references/utilities/icons.md) — Register and resolve icon libraries
|
|
120
120
|
- [`BrowserStorage`](./references/utilities/browser-storage.md) — Unified localStorage / Cookie API
|
|
121
121
|
- [`converters`](./references/utilities/converters.md) — Lit property attribute converters (array, JSON, date, url…)
|
|
122
|
-
- [`
|
|
122
|
+
- [`Locale`](./references/utilities/locale.md) — Validation-message locale registry and lookup utility
|
|
123
123
|
- [`elements`](./references/utilities/elements.md) — Shadow-DOM-aware DOM query helpers
|
|
124
124
|
- [`OverlayManager`](./references/utilities/overlay-manager.md) — Internal overlay stack and z-index manager
|
|
125
125
|
|
|
@@ -135,4 +135,3 @@ import { UButton, UInput } from '@iyulab/components/react';
|
|
|
135
135
|
- [`UFormControlElement<T>`](./references/extensions/form-control.md) — Base for form-associated controls; handles `disabled`, `readonly`, `invalid`, validation lifecycle
|
|
136
136
|
- [`UFloatingElement`](./references/extensions/floating.md) — Base for anchored floating UI (popover, tooltip); wraps `@floating-ui/dom`
|
|
137
137
|
- [`UOverlayElement`](./references/extensions/overlay.md) — Base for full-screen overlays (dialog, drawer); manages focus-trap, scroll-lock, ESC/backdrop close
|
|
138
|
-
- [`UDataElement`](./references/extensions/data.md) — Base for data-driven components; auto-loads JSON from inline `<script type="application/json">`
|
|
@@ -89,7 +89,6 @@ Text input field with prefix/suffix slots and label. Add `u-option` children for
|
|
|
89
89
|
|
|
90
90
|
| Property | Description |
|
|
91
91
|
|----------|-------------|
|
|
92
|
-
| `--input-popover-
|
|
93
|
-
| `--input-popover-max-width` | Combobox popover max-width |
|
|
92
|
+
| `--input-popover-width` | Combobox popover width (fixed to anchor width by default) |
|
|
94
93
|
| `--input-popover-min-height` | Combobox popover min-height |
|
|
95
94
|
| `--input-popover-max-height` | Combobox popover max-height |
|
|
@@ -51,6 +51,7 @@ Selectable option item. Used inside `u-select`, `u-radio`, and `u-input` (combob
|
|
|
51
51
|
| Method | Returns | Description |
|
|
52
52
|
|--------|---------|-------------|
|
|
53
53
|
| `getText()` | `string` | Returns the visible text content of the option |
|
|
54
|
+
| `getContent()` | `Node[]` | Returns cloned rich-content nodes used for display rendering |
|
|
54
55
|
|
|
55
56
|
## CSS Parts
|
|
56
57
|
|
|
@@ -80,7 +80,6 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
|
|
|
80
80
|
|
|
81
81
|
| Property | Description |
|
|
82
82
|
|----------|-------------|
|
|
83
|
-
| `--select-popover-
|
|
84
|
-
| `--select-popover-max-width` | Dropdown max-width |
|
|
83
|
+
| `--select-popover-width` | Dropdown width (fixed to anchor width by default; long option text ellipsizes instead of widening the popover) |
|
|
85
84
|
| `--select-popover-min-height` | Dropdown min-height |
|
|
86
85
|
| `--select-popover-max-height` | Dropdown max-height |
|
|
@@ -50,6 +50,12 @@ Tab-based content switcher. Pair each `u-tab` with a `u-panel` of the same `valu
|
|
|
50
50
|
| `draggable` | `boolean` | `false` | ✓ | Allow reordering tabs by drag |
|
|
51
51
|
| `disabled` | `boolean` | `false` | ✓ | Disable all tabs |
|
|
52
52
|
|
|
53
|
+
### Events
|
|
54
|
+
|
|
55
|
+
| Event | Description |
|
|
56
|
+
|-------|-------------|
|
|
57
|
+
| `change` | Fires on user-driven tab changes (click/keyboard). Not emitted for initial mount or direct `value` assignment. |
|
|
58
|
+
|
|
53
59
|
### CSS Parts
|
|
54
60
|
|
|
55
61
|
| Part | Description |
|
|
@@ -14,6 +14,8 @@ Use when building a custom input that should participate in forms (`formAssociat
|
|
|
14
14
|
import { UFormControlElement } from '@iyulab/components';
|
|
15
15
|
import { customElement, property } from 'lit/decorators.js';
|
|
16
16
|
import { html } from 'lit';
|
|
17
|
+
import type { PropertyValues } from 'lit';
|
|
18
|
+
import { Locale } from '@iyulab/components';
|
|
17
19
|
|
|
18
20
|
@customElement('my-input')
|
|
19
21
|
export class MyInput extends UFormControlElement<string> {
|
|
@@ -33,17 +35,22 @@ export class MyInput extends UFormControlElement<string> {
|
|
|
33
35
|
`;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
protected override setValidity(): void {
|
|
37
39
|
if (this.required && !this.value) {
|
|
38
|
-
this.
|
|
39
|
-
return
|
|
40
|
+
this.commit({ valueMissing: true }, Locale.getValue('valueMissing'));
|
|
41
|
+
return;
|
|
40
42
|
}
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
+
this.commit({}, '');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
protected override shouldValidate(changed: PropertyValues): boolean {
|
|
47
|
+
return super.shouldValidate(changed);
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
reset(): void {
|
|
46
51
|
this.value = '';
|
|
52
|
+
this.setCustomValidity('');
|
|
53
|
+
this.commit({}, '');
|
|
47
54
|
this.invalid = false;
|
|
48
55
|
}
|
|
49
56
|
}
|
|
@@ -75,5 +82,14 @@ export class MyInput extends UFormControlElement<string> {
|
|
|
75
82
|
|
|
76
83
|
| Method | Returns | Description |
|
|
77
84
|
|--------|---------|-------------|
|
|
78
|
-
| `
|
|
85
|
+
| `setValidity()` | `void` | Compute current validity and call `commit(flags, message, anchor?)` |
|
|
79
86
|
| `reset()` | `void` | Reset value and clear validation state |
|
|
87
|
+
|
|
88
|
+
## Validation Helpers (inherited)
|
|
89
|
+
|
|
90
|
+
| Member | Type | Description |
|
|
91
|
+
|--------|------|-------------|
|
|
92
|
+
| `validate(report?)` | `boolean` | Validate now (`true` = report/update invalid UI, `false` = silent check) |
|
|
93
|
+
| `setCustomValidity(message)` | `void` | Set or clear custom error text (`''` clears) |
|
|
94
|
+
| `commit(flags, message, anchor?)` | `void` | Apply validity state to `ElementInternals` with native-like custom-error precedence |
|
|
95
|
+
| `shouldValidate(changed)` | `boolean` | Select which property updates should trigger re-validation (`value`/`required` by default) |
|
|
@@ -62,6 +62,16 @@ Theme.set('system');
|
|
|
62
62
|
const current = Theme.get(); // 'system' | 'light' | 'dark' | undefined
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
### Brand color customization
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
:root {
|
|
69
|
+
--u-primary-color: #7c3aed;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Interactive components derive hover/active/surface/outline styles from this token.
|
|
74
|
+
|
|
65
75
|
---
|
|
66
76
|
|
|
67
77
|
## Icon Setup
|
|
@@ -210,6 +220,7 @@ const confirmed = await Dialog.confirm('Delete this item?');
|
|
|
210
220
|
const name = await Dialog.prompt('Enter your name:', { default: 'Alice' });
|
|
211
221
|
|
|
212
222
|
// Toast
|
|
223
|
+
Toast.DefaultOptions = { position: 'bottom-center', duration: 3000 };
|
|
213
224
|
Toast.success('Saved!');
|
|
214
225
|
Toast.error('Something went wrong.', { duration: 5000 });
|
|
215
226
|
Toast.message('Hello world', { position: 'bottom-center' });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# elements
|
|
2
2
|
|
|
3
3
|
```ts
|
|
4
|
-
import { getParentElement, querySelectorWithin, querySelectorAllWithin
|
|
4
|
+
import { getParentElement, querySelectorWithin, querySelectorAllWithin } from '@iyulab/components';
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
Shadow-DOM-aware DOM utility helpers.
|
|
@@ -37,19 +37,3 @@ Same as `querySelectorWithin` but returns all matches.
|
|
|
37
37
|
```ts
|
|
38
38
|
const inputs = querySelectorAllWithin(this, 'u-input');
|
|
39
39
|
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
### `buildElementHTML(tag, attrs, content?)`
|
|
44
|
-
|
|
45
|
-
Builds an XSS-safe custom element HTML string. All attribute values and content are sanitized.
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
const html = buildElementHTML('u-alert', {
|
|
49
|
-
status: 'success',
|
|
50
|
-
open: '',
|
|
51
|
-
}, 'File saved.');
|
|
52
|
-
// → '<u-alert status="success" open="">File saved.</u-alert>'
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
> Use this when dynamically constructing HTML strings for `innerHTML` or server-side rendering.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Locale
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { Locale } from '@iyulab/components';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Locale registry utility for library-generated validation messages.
|
|
8
|
+
|
|
9
|
+
## Built-in Locales
|
|
10
|
+
|
|
11
|
+
Built in: `en`, `ko`, `ja`, `zh-CN`, `zh-TW`, `es`, `fr`, `de`, `pt-BR`, `vi`, `th`, `id`, `ru`, `ar`.
|
|
12
|
+
|
|
13
|
+
Initial locale is auto-detected from `navigator.language` / `document.documentElement.lang`, with English fallback.
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
| Method | Description |
|
|
18
|
+
|--------|-------------|
|
|
19
|
+
| `Locale.set(locale)` | Set active locale |
|
|
20
|
+
| `Locale.get()` | Get active locale |
|
|
21
|
+
| `Locale.register(locale, table)` | Register/override locale messages (partial merge supported) |
|
|
22
|
+
| `Locale.getValue(key, params?)` | Resolve a localized message for current locale |
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { Locale } from '@iyulab/components';
|
|
28
|
+
|
|
29
|
+
Locale.set('ko');
|
|
30
|
+
|
|
31
|
+
Locale.register('en', {
|
|
32
|
+
valueMissing: 'Please fill out this field.'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const message = Locale.getValue('valueMissing');
|
|
36
|
+
```
|
|
@@ -22,6 +22,18 @@ await Theme.init({
|
|
|
22
22
|
});
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Primary Color Customization
|
|
26
|
+
|
|
27
|
+
Interactive components derive their accent palette from `--u-primary-color`.
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
:root {
|
|
31
|
+
--u-primary-color: #7c3aed; /* global brand/accent color */
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
With this single token override, components such as buttons, checkbox/radio/switch, tab-panel, badge, and tag recalculate hover/active/surface/outline colors automatically.
|
|
36
|
+
|
|
25
37
|
## API
|
|
26
38
|
|
|
27
39
|
| Member | Type | Description |
|
|
@@ -17,6 +17,11 @@ Toast.info('Update available.');
|
|
|
17
17
|
Toast.notice('New message received.', { position: 'bottom-right' });
|
|
18
18
|
Toast.message('Hello!', { title: 'Greetings' });
|
|
19
19
|
|
|
20
|
+
Toast.DefaultOptions = {
|
|
21
|
+
position: 'bottom-center',
|
|
22
|
+
duration: 3000
|
|
23
|
+
};
|
|
24
|
+
|
|
20
25
|
// Full control
|
|
21
26
|
await Toast.show('success', 'Custom message', {
|
|
22
27
|
title: 'Done',
|
|
@@ -38,6 +43,7 @@ await Toast.show('success', 'Custom message', {
|
|
|
38
43
|
| `Toast.warning(content, options?)` | Warning toast |
|
|
39
44
|
| `Toast.error(content, options?)` | Error toast |
|
|
40
45
|
| `Toast.show(status?, content?, options?)` | Generic toast with custom options |
|
|
46
|
+
| `Toast.DefaultOptions` | Global default options applied to every toast call (per-call options win) |
|
|
41
47
|
|
|
42
48
|
## ToastOptions
|
|
43
49
|
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/check-circle-fill.svg.51c33a2a
|
|
2
|
-
var check_circle_fill_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { check_circle_fill_svg_default as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/check-lg.svg.371c5e78
|
|
2
|
-
var check_lg_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { check_lg_svg_default as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/dash-lg.svg.b40b8b3a
|
|
2
|
-
var dash_lg_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M2 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11A.5.5 0 0 1 2 8\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { dash_lg_svg_default as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/exclamation-circle-fill.svg.dc8c523e
|
|
2
|
-
var exclamation_circle_fill_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4m.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { exclamation_circle_fill_svg_default as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/exclamation-triangle-fill.svg.7949d2c7
|
|
2
|
-
var exclamation_triangle_fill_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { exclamation_triangle_fill_svg_default as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region \0glob-assets_raw/eye-slash.svg.240afafa
|
|
2
|
-
var eye_slash_svg_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z\"/>\n <path d=\"M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829\"/>\n <path d=\"M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z\"/>\n</svg>";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { eye_slash_svg_default as default };
|