@greypan/web-ui 5.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.CN.md +97 -23
- package/README.md +112 -21
- package/dist/assets/glass.js +1 -1
- package/dist/assets/glass.js.map +1 -1
- package/dist/assets/menu-portal.js +1 -1
- package/dist/assets/menu-portal.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +367 -4
- package/dist/components/autocomplete/index.js +83 -77
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/autocomplete/style.js +1 -1
- package/dist/components/autocomplete/style.js.map +1 -1
- package/dist/components/avatar/style.js +1 -1
- package/dist/components/avatar/style.js.map +1 -1
- package/dist/components/back-top/style.js +1 -1
- package/dist/components/back-top/style.js.map +1 -1
- package/dist/components/badge/style.js +1 -1
- package/dist/components/badge/style.js.map +1 -1
- package/dist/components/button/style.js +1 -1
- package/dist/components/button/style.js.map +1 -1
- package/dist/components/button-group/style.js +1 -1
- package/dist/components/button-group/style.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +366 -5
- package/dist/components/checkbox/index.js +19 -31
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/style.js +1 -1
- package/dist/components/checkbox/style.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +366 -4
- package/dist/components/checkbox-group/index.js +16 -25
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/collapse/index.js +24 -27
- package/dist/components/collapse/index.js.map +1 -1
- package/dist/components/context-menu/index.d.ts +6 -34
- package/dist/components/context-menu/index.js +88 -201
- package/dist/components/context-menu/index.js.map +1 -1
- package/dist/components/dialog/index.js +20 -23
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/style.js +1 -1
- package/dist/components/dialog/style.js.map +1 -1
- package/dist/components/drawer/index.js +54 -57
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/style.js +1 -1
- package/dist/components/drawer/style.js.map +1 -1
- package/dist/components/dropdown/index.d.ts +11 -14
- package/dist/components/dropdown/index.js +128 -155
- package/dist/components/dropdown/index.js.map +1 -1
- package/dist/components/dropdown-header/style.js +1 -1
- package/dist/components/dropdown-header/style.js.map +1 -1
- package/dist/components/dropdown-item/style.js +1 -1
- package/dist/components/dropdown-item/style.js.map +1 -1
- package/dist/components/empty/style.js +1 -1
- package/dist/components/empty/style.js.map +1 -1
- package/dist/components/input/index.d.ts +366 -5
- package/dist/components/input/index.js +35 -47
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/style.js +1 -1
- package/dist/components/input/style.js.map +1 -1
- package/dist/components/input-number/index.d.ts +366 -5
- package/dist/components/input-number/index.js +31 -44
- package/dist/components/input-number/index.js.map +1 -1
- package/dist/components/input-number/style.js +1 -1
- package/dist/components/input-number/style.js.map +1 -1
- package/dist/components/layout/style.js +1 -1
- package/dist/components/layout/style.js.map +1 -1
- package/dist/components/option/style.js +1 -1
- package/dist/components/option/style.js.map +1 -1
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +33 -44
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/style.js +1 -1
- package/dist/components/popover/style.js.map +1 -1
- package/dist/components/radio/index.d.ts +366 -5
- package/dist/components/radio/index.js +19 -31
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/style.js +1 -1
- package/dist/components/radio/style.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +366 -4
- package/dist/components/radio-group/index.js +16 -25
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/segmented/index.d.ts +366 -4
- package/dist/components/segmented/index.js +26 -35
- package/dist/components/segmented/index.js.map +1 -1
- package/dist/components/segmented/style.js +1 -1
- package/dist/components/segmented/style.js.map +1 -1
- package/dist/components/segmented-trigger/style.js +1 -1
- package/dist/components/segmented-trigger/style.js.map +1 -1
- package/dist/components/select/index.d.ts +368 -5
- package/dist/components/select/index.js +65 -67
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/select/style.js +1 -1
- package/dist/components/select/style.js.map +1 -1
- package/dist/components/slider/index.d.ts +366 -5
- package/dist/components/slider/index.js +38 -50
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/style.js +1 -1
- package/dist/components/slider/style.js.map +1 -1
- package/dist/components/spinner/style.js +1 -1
- package/dist/components/spinner/style.js.map +1 -1
- package/dist/components/switch/index.d.ts +366 -5
- package/dist/components/switch/index.js +26 -38
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/style.js +1 -1
- package/dist/components/switch/style.js.map +1 -1
- package/dist/components/textarea/index.d.ts +366 -5
- package/dist/components/textarea/index.js +43 -57
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/style.js +1 -1
- package/dist/components/textarea/style.js.map +1 -1
- package/dist/components/theme/style.js +1 -1
- package/dist/components/theme/style.js.map +1 -1
- package/dist/components/toast/style.js +1 -1
- package/dist/components/toast/style.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +32 -46
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/style.js +1 -1
- package/dist/components/tooltip/style.js.map +1 -1
- package/dist/shared/form-association/index.js +31 -4
- package/dist/shared/form-association/index.js.map +1 -1
- package/dist/shared/menu-behavior/index.js +112 -0
- package/dist/shared/menu-behavior/index.js.map +1 -0
- package/dist/shared/menu-portal/menu-tree.js +60 -1
- package/dist/shared/menu-portal/menu-tree.js.map +1 -1
- package/dist/shared/open-state/index.js +12 -0
- package/dist/shared/open-state/index.js.map +1 -0
- package/dist/shared/option-portal/combobox-shell.js +41 -0
- package/dist/shared/option-portal/combobox-shell.js.map +1 -0
- package/dist/shared/option-portal/index.js +23 -22
- package/dist/shared/option-portal/index.js.map +1 -1
- package/dist/shared/overlay/overlay.js.map +1 -1
- package/dist/shared/overlay/placement-props.js +19 -0
- package/dist/shared/overlay/placement-props.js.map +1 -0
- package/dist/shared/overlay/portal.js +94 -20
- package/dist/shared/overlay/portal.js.map +1 -1
- package/package.json +6 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/back-top/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n/* 容器模式:scrollTarget 为元素时按钮悬浮于容器底部(元素需置于容器内部),\n 横向偏移沿用 --wui-back-top-left/right,纵向沿用 --wui-back-top-bottom */\n:host([container-mode]) {\n position: sticky;\n bottom: var(--wui-back-top-bottom, 20px);\n}\n\n.back-top-inner {\n pointer-events: none;\n\n position: var(--wui-back-top-position, fixed);\n z-index: var(--wui-back-top-z-index, var(--wui-layer-auxiliary, 20));\n top: var(--wui-back-top-top, auto);\n right: var(--wui-back-top-right, 20px);\n bottom: var(--wui-back-top-bottom, 20px);\n left: var(--wui-back-top-left, auto);\n\n visibility: hidden;\n opacity: 0;\n\n .back-top-inner:focus-visible {\n border-radius: calc(infinity * 1px);\n outline: var(--wui-focus-ring-width, 3px) solid var(--wui-color-focus-ring, rgb(0 136 255 / 0.4));\n outline-offset: 2px;\n }\n}\n\n/* 容器模式下按钮脱离 fixed,改为流内布局并按偏移变量左/右对齐 */\n:host([container-mode]) .back-top-inner {\n position: static;\n margin-right: var(--wui-back-top-right, 20px);\n margin-left: var(--wui-back-top-left, auto);\n}\n\n:host([visible]) .back-top-inner {\n pointer-events: auto;\n visibility: visible;\n opacity: 1;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/back-top/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n/* 容器模式:scrollTarget 为元素时按钮悬浮于容器底部(元素需置于容器内部),\n 横向偏移沿用 --wui-back-top-left/right,纵向沿用 --wui-back-top-bottom */\n:host([container-mode]) {\n position: sticky;\n bottom: var(--wui-back-top-bottom, 20px);\n}\n\n.back-top-inner {\n pointer-events: none;\n\n position: var(--wui-back-top-position, fixed);\n z-index: var(--wui-back-top-z-index, var(--wui-layer-auxiliary, 20));\n top: var(--wui-back-top-top, auto);\n right: var(--wui-back-top-right, 20px);\n bottom: var(--wui-back-top-bottom, 20px);\n left: var(--wui-back-top-left, auto);\n\n visibility: hidden;\n opacity: 0;\n\n .back-top-inner:focus-visible {\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n outline: var(--wui-focus-ring-width, 3px) solid var(--wui-color-focus-ring, rgb(0 136 255 / 0.4));\n outline-offset: 2px;\n }\n}\n\n/* 容器模式下按钮脱离 fixed,改为流内布局并按偏移变量左/右对齐 */\n:host([container-mode]) .back-top-inner {\n position: static;\n margin-right: var(--wui-back-top-right, 20px);\n margin-left: var(--wui-back-top-left, auto);\n}\n\n:host([visible]) .back-top-inner {\n pointer-events: auto;\n visibility: visible;\n opacity: 1;\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/components/badge/style.css?inline
|
|
2
|
-
var e = "*,:before,:after{box-sizing:border-box}:host{-webkit-user-select:none;user-select:none;display:inline-block}.badge-wrapper{display:inline-flex}.badge-wrapper-fixed{position:relative}.badge{z-index:1;border:1px solid var(--wui-color-page,#fff);min-width:18px;height:18px;color:var(--wui-color-on-accent,#fff);white-space:nowrap;background-color:var(--wui-color-danger,#dc2626);
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{-webkit-user-select:none;user-select:none;display:inline-block}.badge-wrapper{display:inline-flex}.badge-wrapper-fixed{position:relative}.badge{z-index:1;border:1px solid var(--wui-color-page,#fff);border-radius:var(--wui-radius-control,calc(infinity * 1px));min-width:18px;height:18px;color:var(--wui-color-on-accent,#fff);white-space:nowrap;background-color:var(--wui-color-danger,#dc2626);justify-content:center;align-items:center;padding:0 4px;font-size:12px;font-weight:500;line-height:1;display:inline-flex}.badge-fixed{transform:translate(calc(var(--badge-x,50%) + var(--badge-offset-x,0px)), calc(var(--badge-y,-50%) + var(--badge-offset-y,0px)));position:absolute}:host([placement=top-right]) .badge{--badge-x:50%;--badge-y:-50%;top:0;right:0}:host([placement=top-left]) .badge{--badge-x:-50%;--badge-y:-50%;top:0;left:0}:host([placement=bottom-right]) .badge{--badge-x:50%;--badge-y:50%;bottom:0;right:0}:host([placement=bottom-left]) .badge{--badge-x:-50%;--badge-y:50%;bottom:0;left:0}.badge-dot{min-width:8px;height:8px;padding:0;font-size:0}.badge-fixed.badge-dot{--badge-x:40%;--badge-y:-40%}";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/badge/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n user-select: none;\n display: inline-block;\n}\n\n.badge-wrapper {\n display: inline-flex;\n}\n\n.badge-wrapper-fixed {\n position: relative;\n}\n\n.badge {\n z-index: 1;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n min-width: 18px;\n height: 18px;\n padding: 0 4px;\n border: 1px solid var(--wui-color-page, #fff);\n border-radius: calc(infinity * 1px);\n\n font-size: 12px;\n font-weight: 500;\n line-height: 1;\n color: var(--wui-color-on-accent, #fff);\n white-space: nowrap;\n\n background-color: var(--wui-color-danger, #dc2626);\n}\n\n.badge-fixed {\n position: absolute;\n transform: translate(\n calc(var(--badge-x, 50%) + var(--badge-offset-x, 0px)),\n calc(var(--badge-y, -50%) + var(--badge-offset-y, 0px))\n );\n}\n\n/* ===== Placement ===== */\n\n:host([placement='top-right']) .badge {\n --badge-x: 50%;\n --badge-y: -50%;\n top: 0;\n right: 0;\n}\n\n:host([placement='top-left']) .badge {\n --badge-x: -50%;\n --badge-y: -50%;\n top: 0;\n left: 0;\n}\n\n:host([placement='bottom-right']) .badge {\n --badge-x: 50%;\n --badge-y: 50%;\n right: 0;\n bottom: 0;\n}\n\n:host([placement='bottom-left']) .badge {\n --badge-x: -50%;\n --badge-y: 50%;\n bottom: 0;\n left: 0;\n}\n\n/* ===== Dot ===== */\n\n.badge-dot {\n min-width: 8px;\n height: 8px;\n padding: 0;\n font-size: 0;\n}\n\n/* ===== Fixed mode (has slotted content) ===== */\n\n.badge-fixed.badge-dot {\n --badge-x: 40%;\n --badge-y: -40%;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/badge/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n user-select: none;\n display: inline-block;\n}\n\n.badge-wrapper {\n display: inline-flex;\n}\n\n.badge-wrapper-fixed {\n position: relative;\n}\n\n.badge {\n z-index: 1;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n min-width: 18px;\n height: 18px;\n padding: 0 4px;\n border: 1px solid var(--wui-color-page, #fff);\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n\n font-size: 12px;\n font-weight: 500;\n line-height: 1;\n color: var(--wui-color-on-accent, #fff);\n white-space: nowrap;\n\n background-color: var(--wui-color-danger, #dc2626);\n}\n\n.badge-fixed {\n position: absolute;\n transform: translate(\n calc(var(--badge-x, 50%) + var(--badge-offset-x, 0px)),\n calc(var(--badge-y, -50%) + var(--badge-offset-y, 0px))\n );\n}\n\n/* ===== Placement ===== */\n\n:host([placement='top-right']) .badge {\n --badge-x: 50%;\n --badge-y: -50%;\n top: 0;\n right: 0;\n}\n\n:host([placement='top-left']) .badge {\n --badge-x: -50%;\n --badge-y: -50%;\n top: 0;\n left: 0;\n}\n\n:host([placement='bottom-right']) .badge {\n --badge-x: 50%;\n --badge-y: 50%;\n right: 0;\n bottom: 0;\n}\n\n:host([placement='bottom-left']) .badge {\n --badge-x: -50%;\n --badge-y: 50%;\n bottom: 0;\n left: 0;\n}\n\n/* ===== Dot ===== */\n\n.badge-dot {\n min-width: 8px;\n height: 8px;\n padding: 0;\n font-size: 0;\n}\n\n/* ===== Fixed mode (has slotted content) ===== */\n\n.badge-fixed.badge-dot {\n --badge-x: 40%;\n --badge-y: -40%;\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/components/button/style.css?inline
|
|
2
|
-
var e = "*,:before,:after{box-sizing:border-box}:host{justify-content:center;align-items:center;display:inline-flex;position:relative}:host([full]){width:100%;display:block}:host([disabled]){cursor:not-allowed}button{--wui-glass-corner-radius:calc(var(--wui-control-size,36px) / 2);cursor:default;-webkit-user-select:none;user-select:none;gap:var(--wui-button-gap,8px);box-sizing:border-box;width:var(--wui-button-width,max-content);min-width:var(--wui-control-size,36px);height:var(--wui-control-size,36px);padding:0 var(--wui-button-px,12px);font:inherit;font-size:var(--wui-font-size,14px);color:var(--wui-button-color);white-space:nowrap;background-color:var(--wui-button-bg);border:none;
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{justify-content:center;align-items:center;display:inline-flex;position:relative}:host([full]){width:100%;display:block}:host([disabled]){cursor:not-allowed}button{--wui-glass-corner-radius:calc(var(--wui-control-size,36px) / 2);cursor:default;-webkit-user-select:none;user-select:none;gap:var(--wui-button-gap,8px);box-sizing:border-box;width:var(--wui-button-width,max-content);min-width:var(--wui-control-size,36px);height:var(--wui-control-size,36px);padding:0 var(--wui-button-px,12px);border-radius:var(--wui-radius-control,calc(infinity * 1px));font:inherit;font-size:var(--wui-font-size,14px);color:var(--wui-button-color);white-space:nowrap;background-color:var(--wui-button-bg);border:none;justify-content:center;align-items:center;line-height:1;display:inline-flex;position:relative;overflow:clip}button:disabled{cursor:not-allowed;opacity:.4}button:focus-visible{outline:var(--wui-focus-ring-width,3px) solid var(--wui-color-focus-ring,#08f6);outline-offset:2px}@media (hover:hover) and (pointer:fine){button:hover:not(:disabled){background-color:var(--wui-button-bg-hover)}}button:active:not(:disabled){background-color:var(--wui-button-bg-active)}:host([full]) button{width:100%;display:flex}:host([icon]) button{padding:0}:host([variant=primary]){--wui-button-color:var(--wui-color-on-accent,#fff);--wui-button-bg:var(--wui-color-accent,#08f);--wui-button-bg-hover:color-mix(in srgb, var(--wui-button-bg,#08f) 88%, black);--wui-button-bg-active:color-mix(in srgb, var(--wui-button-bg,#08f) 76%, black)}:host([variant=secondary]){--wui-button-color:var(--wui-color-text,#1b1b1b);--wui-button-bg:var(--wui-color-surface-control,#dfdfdf);--wui-button-bg-hover:color-mix(in srgb, var(--wui-button-bg,#dfdfdf) 92%, black);--wui-button-bg-active:color-mix(in srgb, var(--wui-button-bg,#dfdfdf) 82%, black)}:host([variant=ghost]){--wui-button-color:var(--wui-color-text,#1b1b1b);--wui-button-bg:transparent;--wui-button-bg-hover:var(--wui-color-state-layer-hover,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 6%, transparent));--wui-button-bg-active:var(--wui-color-state-layer-active,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 15%, transparent))}:host([variant=danger]){--wui-button-color:var(--wui-color-danger,#dc2626);--wui-button-bg:color-mix(in srgb, var(--wui-color-danger,#dc2626) 18%, var(--wui-color-surface,#fff));--wui-button-bg-hover:color-mix(in srgb, var(--wui-color-danger,#dc2626) 26%, var(--wui-color-surface,#fff));--wui-button-bg-active:color-mix(in srgb, var(--wui-color-danger,#dc2626) 45%, var(--wui-color-surface,#fff))}:host([variant=glass]){--wui-button-color:var(--wui-color-text,#1b1b1b);--wui-button-bg:transparent;--wui-button-bg-hover:var(--wui-color-surface-glass-hover,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 6%, var(--wui-color-surface-glass,#fafafa57)));--wui-button-bg-active:var(--wui-color-surface-glass-active,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 15%, var(--wui-color-surface-glass,#fafafa57)))}button.is-grouped{--wui-button-bg:transparent;--wui-button-bg-hover:var(--wui-color-state-layer-hover,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 6%, transparent));--wui-button-bg-active:var(--wui-color-state-layer-active,color-mix(in srgb, var(--wui-color-text,#1b1b1b) 15%, transparent))}.group-divider{z-index:1;background-color:var(--wui-color-border,#0000001a);width:1px;height:24px;position:absolute;top:50%;right:-2px;transform:translateY(-50%)}.group-divider.vertical{width:24px;height:1px;inset:auto auto -2px 50%;transform:translate(-50%)}";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/button/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n position: relative;\n\n /* inline-flex 让内层按钮在宿主内完全居中,避免继承的行高撑高宿主、导致图标偏移 */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n:host([full]) {\n display: block;\n width: 100%;\n}\n\n:host([disabled]) {\n cursor: not-allowed;\n}\n\nbutton {\n --wui-glass-corner-radius: calc(var(--wui-control-size, 36px) / 2);\n cursor: default;\n user-select: none;\n\n position: relative;\n\n overflow: clip;\n display: inline-flex;\n gap: var(--wui-button-gap, 8px);\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n width: var(--wui-button-width, max-content);\n min-width: var(--wui-control-size, 36px);\n height: var(--wui-control-size, 36px);\n padding: 0 var(--wui-button-px, 12px);\n border: none;\n border-radius: calc(infinity * 1px);\n\n /* 原生 button 不继承字体;显式继承以对齐宿主排版,避免 UA 默认 Arial 差异 */\n font: inherit;\n font-size: var(--wui-font-size, 14px);\n line-height: 1;\n color: var(--wui-button-color);\n white-space: nowrap;\n\n background-color: var(--wui-button-bg);\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n\n &:focus-visible {\n outline: var(--wui-focus-ring-width, 3px) solid var(--wui-color-focus-ring, rgb(0 136 255 / 0.4));\n outline-offset: 2px;\n }\n}\n\n@media (hover: hover) and (pointer: fine) {\n button:hover:not(:disabled) {\n background-color: var(--wui-button-bg-hover);\n }\n}\n\nbutton:active:not(:disabled) {\n background-color: var(--wui-button-bg-active);\n}\n\n/* ===== Full width ===== */\n\n:host([full]) button {\n display: flex;\n width: 100%;\n}\n\n/* ===== Icon mode ===== */\n\n:host([icon]) button {\n padding: 0;\n}\n\n/* ===== Variant: primary (默认) ===== */\n\n:host([variant='primary']) {\n --wui-button-color: var(--wui-color-on-accent, #fff);\n --wui-button-bg: var(--wui-color-accent, #08f);\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-button-bg, #08f) 88%, black);\n --wui-button-bg-active: color-mix(in srgb, var(--wui-button-bg, #08f) 76%, black);\n}\n\n/* ===== Variant: secondary ===== */\n\n:host([variant='secondary']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n --wui-button-bg: var(--wui-color-surface-control, #dfdfdf);\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-button-bg, #dfdfdf) 92%, black);\n --wui-button-bg-active: color-mix(in srgb, var(--wui-button-bg, #dfdfdf) 82%, black);\n}\n\n/* ===== Variant: ghost ===== */\n\n:host([variant='ghost']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-state-layer-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, transparent)\n );\n --wui-button-bg-active: var(\n --wui-color-state-layer-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, transparent)\n );\n}\n\n/* ===== Variant: danger ===== */\n\n:host([variant='danger']) {\n --wui-button-color: var(--wui-color-danger, #dc2626);\n --wui-button-bg: color-mix(in srgb, var(--wui-color-danger, #dc2626) 18%, var(--wui-color-surface, #fff));\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-color-danger, #dc2626) 26%, var(--wui-color-surface, #fff));\n --wui-button-bg-active: color-mix(in srgb, var(--wui-color-danger, #dc2626) 45%, var(--wui-color-surface, #fff));\n}\n\n/* ===== Variant: glass (玻璃) ===== */\n\n/* .wui-glass 样式由 @/assets/glass.css 提供 */\n:host([variant='glass']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n\n /* standalone glass 底色由 .wui-glass 提供;hover/active 需要还原玻璃底,避免被按钮状态色整块替换 */\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-surface-glass-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, var(--wui-color-surface-glass, rgb(250 250 250 / 0.34)))\n );\n --wui-button-bg-active: var(\n --wui-color-surface-glass-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, var(--wui-color-surface-glass, rgb(250 250 250 / 0.34)))\n );\n}\n\n/* ===== Group context ===== */\n\nbutton.is-grouped {\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-state-layer-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, transparent)\n );\n --wui-button-bg-active: var(\n --wui-color-state-layer-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, transparent)\n );\n}\n\n.group-divider {\n position: absolute;\n z-index: 1;\n top: 50%;\n right: -2px;\n transform: translateY(-50%);\n\n width: 1px;\n height: 24px;\n\n background-color: var(--wui-color-border, rgb(0 0 0 / 0.1));\n}\n\n.group-divider.vertical {\n top: auto;\n right: auto;\n bottom: -2px;\n left: 50%;\n transform: translateX(-50%);\n\n width: 24px;\n height: 1px;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/button/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n position: relative;\n\n /* inline-flex 让内层按钮在宿主内完全居中,避免继承的行高撑高宿主、导致图标偏移 */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n:host([full]) {\n display: block;\n width: 100%;\n}\n\n:host([disabled]) {\n cursor: not-allowed;\n}\n\nbutton {\n --wui-glass-corner-radius: calc(var(--wui-control-size, 36px) / 2);\n cursor: default;\n user-select: none;\n\n position: relative;\n\n overflow: clip;\n display: inline-flex;\n gap: var(--wui-button-gap, 8px);\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n width: var(--wui-button-width, max-content);\n min-width: var(--wui-control-size, 36px);\n height: var(--wui-control-size, 36px);\n padding: 0 var(--wui-button-px, 12px);\n border: none;\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n\n /* 原生 button 不继承字体;显式继承以对齐宿主排版,避免 UA 默认 Arial 差异 */\n font: inherit;\n font-size: var(--wui-font-size, 14px);\n line-height: 1;\n color: var(--wui-button-color);\n white-space: nowrap;\n\n background-color: var(--wui-button-bg);\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n\n &:focus-visible {\n outline: var(--wui-focus-ring-width, 3px) solid var(--wui-color-focus-ring, rgb(0 136 255 / 0.4));\n outline-offset: 2px;\n }\n}\n\n@media (hover: hover) and (pointer: fine) {\n button:hover:not(:disabled) {\n background-color: var(--wui-button-bg-hover);\n }\n}\n\nbutton:active:not(:disabled) {\n background-color: var(--wui-button-bg-active);\n}\n\n/* ===== Full width ===== */\n\n:host([full]) button {\n display: flex;\n width: 100%;\n}\n\n/* ===== Icon mode ===== */\n\n:host([icon]) button {\n padding: 0;\n}\n\n/* ===== Variant: primary (默认) ===== */\n\n:host([variant='primary']) {\n --wui-button-color: var(--wui-color-on-accent, #fff);\n --wui-button-bg: var(--wui-color-accent, #08f);\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-button-bg, #08f) 88%, black);\n --wui-button-bg-active: color-mix(in srgb, var(--wui-button-bg, #08f) 76%, black);\n}\n\n/* ===== Variant: secondary ===== */\n\n:host([variant='secondary']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n --wui-button-bg: var(--wui-color-surface-control, #dfdfdf);\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-button-bg, #dfdfdf) 92%, black);\n --wui-button-bg-active: color-mix(in srgb, var(--wui-button-bg, #dfdfdf) 82%, black);\n}\n\n/* ===== Variant: ghost ===== */\n\n:host([variant='ghost']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-state-layer-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, transparent)\n );\n --wui-button-bg-active: var(\n --wui-color-state-layer-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, transparent)\n );\n}\n\n/* ===== Variant: danger ===== */\n\n:host([variant='danger']) {\n --wui-button-color: var(--wui-color-danger, #dc2626);\n --wui-button-bg: color-mix(in srgb, var(--wui-color-danger, #dc2626) 18%, var(--wui-color-surface, #fff));\n --wui-button-bg-hover: color-mix(in srgb, var(--wui-color-danger, #dc2626) 26%, var(--wui-color-surface, #fff));\n --wui-button-bg-active: color-mix(in srgb, var(--wui-color-danger, #dc2626) 45%, var(--wui-color-surface, #fff));\n}\n\n/* ===== Variant: glass (玻璃) ===== */\n\n/* .wui-glass 样式由 @/assets/glass.css 提供 */\n:host([variant='glass']) {\n --wui-button-color: var(--wui-color-text, #1b1b1b);\n\n /* standalone glass 底色由 .wui-glass 提供;hover/active 需要还原玻璃底,避免被按钮状态色整块替换 */\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-surface-glass-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, var(--wui-color-surface-glass, rgb(250 250 250 / 0.34)))\n );\n --wui-button-bg-active: var(\n --wui-color-surface-glass-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, var(--wui-color-surface-glass, rgb(250 250 250 / 0.34)))\n );\n}\n\n/* ===== Group context ===== */\n\nbutton.is-grouped {\n --wui-button-bg: transparent;\n --wui-button-bg-hover: var(\n --wui-color-state-layer-hover,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 6%, transparent)\n );\n --wui-button-bg-active: var(\n --wui-color-state-layer-active,\n color-mix(in srgb, var(--wui-color-text, #1b1b1b) 15%, transparent)\n );\n}\n\n.group-divider {\n position: absolute;\n z-index: 1;\n top: 50%;\n right: -2px;\n transform: translateY(-50%);\n\n width: 1px;\n height: 24px;\n\n background-color: var(--wui-color-border, rgb(0 0 0 / 0.1));\n}\n\n.group-divider.vertical {\n top: auto;\n right: auto;\n bottom: -2px;\n left: 50%;\n transform: translateX(-50%);\n\n width: 24px;\n height: 1px;\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/components/button-group/style.css?inline
|
|
2
|
-
var e = "*,:before,:after{box-sizing:border-box}:host{display:inline-block}.wui-button-group-inner{flex-direction:var(--wui-button-group-flex-direction,row);width:max-content;height:var(--wui-control-size,36px);border-radius:
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{display:inline-block}.wui-button-group-inner{--wui-glass-corner-radius:calc(var(--wui-control-size,36px) / 2);flex-direction:var(--wui-button-group-flex-direction,row);width:max-content;height:var(--wui-control-size,36px);border-radius:var(--wui-radius-control,calc(infinity * 1px));align-items:center;gap:4px;padding:0 4px;display:flex}:host([direction=vertical]){--wui-button-group-flex-direction:column}:host([direction=vertical]) .wui-button-group-inner{width:var(--wui-control-size,36px);height:auto;padding:4px 0}";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/button-group/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-block;\n}\n\n.wui-button-group-inner {\n display: flex;\n flex-direction: var(--wui-button-group-flex-direction, row);\n gap: 4px;\n align-items: center;\n\n width: max-content;\n height: var(--wui-control-size, 36px);\n padding: 0 4px;\n border-radius: calc(infinity * 1px);\n}\n\n:host([direction='vertical']) {\n --wui-button-group-flex-direction: column;\n}\n\n:host([direction='vertical']) .wui-button-group-inner {\n width: var(--wui-control-size, 36px);\n height: auto;\n padding: 4px 0;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/button-group/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-block;\n}\n\n.wui-button-group-inner {\n --wui-glass-corner-radius: calc(var(--wui-control-size, 36px) / 2);\n\n display: flex;\n flex-direction: var(--wui-button-group-flex-direction, row);\n gap: 4px;\n align-items: center;\n\n width: max-content;\n height: var(--wui-control-size, 36px);\n padding: 0 4px;\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n}\n\n:host([direction='vertical']) {\n --wui-button-group-flex-direction: column;\n}\n\n:host([direction='vertical']) .wui-button-group-inner {\n width: var(--wui-control-size, 36px);\n height: auto;\n padding: 4px 0;\n}\n"],"mappings":""}
|
|
@@ -1,7 +1,370 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
|
|
2
|
+
declare const WebUiCheckbox_base: {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
formResetCallback(): void;
|
|
5
|
+
formDisabledCallback(disabled: boolean): void;
|
|
6
|
+
formStateRestoreCallback(state: File | FormData | string | null): void;
|
|
7
|
+
accessKey: string;
|
|
8
|
+
readonly accessKeyLabel: string;
|
|
9
|
+
autocapitalize: string;
|
|
10
|
+
autocorrect: boolean;
|
|
11
|
+
dir: string;
|
|
12
|
+
draggable: boolean;
|
|
13
|
+
hidden: boolean | "until-found";
|
|
14
|
+
inert: boolean;
|
|
15
|
+
innerText: string;
|
|
16
|
+
lang: string;
|
|
17
|
+
readonly offsetHeight: number;
|
|
18
|
+
readonly offsetLeft: number;
|
|
19
|
+
readonly offsetParent: Element | null;
|
|
20
|
+
readonly offsetTop: number;
|
|
21
|
+
readonly offsetWidth: number;
|
|
22
|
+
outerText: string;
|
|
23
|
+
popover: string | null;
|
|
24
|
+
spellcheck: boolean;
|
|
25
|
+
title: string;
|
|
26
|
+
translate: boolean;
|
|
27
|
+
writingSuggestions: string;
|
|
28
|
+
attachInternals(): ElementInternals;
|
|
29
|
+
click(): void;
|
|
30
|
+
hidePopover(): void;
|
|
31
|
+
showPopover(options?: ShowPopoverOptions): void;
|
|
32
|
+
togglePopover(options?: TogglePopoverOptions | boolean): boolean;
|
|
33
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
34
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
35
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
36
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
37
|
+
readonly attributes: NamedNodeMap;
|
|
38
|
+
get classList(): DOMTokenList;
|
|
39
|
+
set classList(value: string);
|
|
40
|
+
className: string;
|
|
41
|
+
readonly clientHeight: number;
|
|
42
|
+
readonly clientLeft: number;
|
|
43
|
+
readonly clientTop: number;
|
|
44
|
+
readonly clientWidth: number;
|
|
45
|
+
readonly currentCSSZoom: number;
|
|
46
|
+
readonly customElementRegistry: CustomElementRegistry | null;
|
|
47
|
+
id: string;
|
|
48
|
+
innerHTML: string;
|
|
49
|
+
readonly localName: string;
|
|
50
|
+
readonly namespaceURI: string | null;
|
|
51
|
+
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
|
|
52
|
+
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
53
|
+
outerHTML: string;
|
|
54
|
+
readonly ownerDocument: Document;
|
|
55
|
+
get part(): DOMTokenList;
|
|
56
|
+
set part(value: string);
|
|
57
|
+
readonly prefix: string | null;
|
|
58
|
+
readonly scrollHeight: number;
|
|
59
|
+
scrollLeft: number;
|
|
60
|
+
scrollTop: number;
|
|
61
|
+
readonly scrollWidth: number;
|
|
62
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
63
|
+
slot: string;
|
|
64
|
+
readonly tagName: string;
|
|
65
|
+
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
66
|
+
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
67
|
+
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
|
|
68
|
+
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
|
|
69
|
+
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
|
|
70
|
+
closest<E extends Element = Element>(selectors: string): E | null;
|
|
71
|
+
computedStyleMap(): StylePropertyMapReadOnly;
|
|
72
|
+
getAttribute(qualifiedName: string): string | null;
|
|
73
|
+
getAttributeNS(namespace: string | null, localName: string): string | null;
|
|
74
|
+
getAttributeNames(): string[];
|
|
75
|
+
getAttributeNode(qualifiedName: string): Attr | null;
|
|
76
|
+
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
|
|
77
|
+
getBoundingClientRect(): DOMRect;
|
|
78
|
+
getClientRects(): DOMRectList;
|
|
79
|
+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
|
|
80
|
+
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
|
|
81
|
+
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
|
|
82
|
+
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
|
|
83
|
+
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
84
|
+
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
85
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
86
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
87
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
|
|
88
|
+
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
89
|
+
getHTML(options?: GetHTMLOptions): string;
|
|
90
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
91
|
+
hasAttributeNS(namespace: string | null, localName: string): boolean;
|
|
92
|
+
hasAttributes(): boolean;
|
|
93
|
+
hasPointerCapture(pointerId: number): boolean;
|
|
94
|
+
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
|
|
95
|
+
insertAdjacentHTML(position: InsertPosition, string: string): void;
|
|
96
|
+
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
97
|
+
matches<K extends keyof HTMLElementTagNameMap>(selectors: K): this is HTMLElementTagNameMap[K];
|
|
98
|
+
matches<K extends keyof SVGElementTagNameMap>(selectors: K): this is SVGElementTagNameMap[K];
|
|
99
|
+
matches<K extends keyof MathMLElementTagNameMap>(selectors: K): this is MathMLElementTagNameMap[K];
|
|
100
|
+
matches(selectors: string): boolean;
|
|
101
|
+
releasePointerCapture(pointerId: number): void;
|
|
102
|
+
removeAttribute(qualifiedName: string): void;
|
|
103
|
+
removeAttributeNS(namespace: string | null, localName: string): void;
|
|
104
|
+
removeAttributeNode(attr: Attr): Attr;
|
|
105
|
+
requestFullscreen(options?: FullscreenOptions): Promise<void>;
|
|
106
|
+
requestPointerLock(options?: PointerLockOptions): Promise<void>;
|
|
107
|
+
scroll(options?: ScrollToOptions): void;
|
|
108
|
+
scroll(x: number, y: number): void;
|
|
109
|
+
scrollBy(options?: ScrollToOptions): void;
|
|
110
|
+
scrollBy(x: number, y: number): void;
|
|
111
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
112
|
+
scrollTo(options?: ScrollToOptions): void;
|
|
113
|
+
scrollTo(x: number, y: number): void;
|
|
114
|
+
setAttribute(qualifiedName: string, value: string): void;
|
|
115
|
+
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
116
|
+
setAttributeNode(attr: Attr): Attr | null;
|
|
117
|
+
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
118
|
+
setHTMLUnsafe(html: string): void;
|
|
119
|
+
setPointerCapture(pointerId: number): void;
|
|
120
|
+
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
121
|
+
webkitMatchesSelector(selectors: string): boolean;
|
|
122
|
+
get textContent(): string;
|
|
123
|
+
set textContent(value: string | null);
|
|
124
|
+
readonly baseURI: string;
|
|
125
|
+
readonly childNodes: NodeListOf<ChildNode>;
|
|
126
|
+
readonly firstChild: ChildNode | null;
|
|
127
|
+
readonly isConnected: boolean;
|
|
128
|
+
readonly lastChild: ChildNode | null;
|
|
129
|
+
readonly nextSibling: ChildNode | null;
|
|
130
|
+
readonly nodeName: string;
|
|
131
|
+
readonly nodeType: number;
|
|
132
|
+
nodeValue: string | null;
|
|
133
|
+
readonly parentElement: HTMLElement | null;
|
|
134
|
+
readonly parentNode: ParentNode | null;
|
|
135
|
+
readonly previousSibling: ChildNode | null;
|
|
136
|
+
appendChild<T extends Node>(node: T): T;
|
|
137
|
+
cloneNode(subtree?: boolean): Node;
|
|
138
|
+
compareDocumentPosition(other: Node): number;
|
|
139
|
+
contains(other: Node | null): boolean;
|
|
140
|
+
getRootNode(options?: GetRootNodeOptions): Node;
|
|
141
|
+
hasChildNodes(): boolean;
|
|
142
|
+
insertBefore<T extends Node>(node: T, child: Node | null): T;
|
|
143
|
+
isDefaultNamespace(namespace: string | null): boolean;
|
|
144
|
+
isEqualNode(otherNode: Node | null): boolean;
|
|
145
|
+
isSameNode(otherNode: Node | null): boolean;
|
|
146
|
+
lookupNamespaceURI(prefix: string | null): string | null;
|
|
147
|
+
lookupPrefix(namespace: string | null): string | null;
|
|
148
|
+
normalize(): void;
|
|
149
|
+
removeChild<T extends Node>(child: T): T;
|
|
150
|
+
replaceChild<T extends Node>(node: Node, child: T): T;
|
|
151
|
+
readonly ELEMENT_NODE: 1;
|
|
152
|
+
readonly ATTRIBUTE_NODE: 2;
|
|
153
|
+
readonly TEXT_NODE: 3;
|
|
154
|
+
readonly CDATA_SECTION_NODE: 4;
|
|
155
|
+
readonly ENTITY_REFERENCE_NODE: 5;
|
|
156
|
+
readonly ENTITY_NODE: 6;
|
|
157
|
+
readonly PROCESSING_INSTRUCTION_NODE: 7;
|
|
158
|
+
readonly COMMENT_NODE: 8;
|
|
159
|
+
readonly DOCUMENT_NODE: 9;
|
|
160
|
+
readonly DOCUMENT_TYPE_NODE: 10;
|
|
161
|
+
readonly DOCUMENT_FRAGMENT_NODE: 11;
|
|
162
|
+
readonly NOTATION_NODE: 12;
|
|
163
|
+
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
|
|
164
|
+
readonly DOCUMENT_POSITION_PRECEDING: 2;
|
|
165
|
+
readonly DOCUMENT_POSITION_FOLLOWING: 4;
|
|
166
|
+
readonly DOCUMENT_POSITION_CONTAINS: 8;
|
|
167
|
+
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
168
|
+
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
169
|
+
dispatchEvent(event: Event): boolean;
|
|
170
|
+
ariaActiveDescendantElement: Element | null;
|
|
171
|
+
ariaAtomic: string | null;
|
|
172
|
+
ariaAutoComplete: string | null;
|
|
173
|
+
ariaBrailleLabel: string | null;
|
|
174
|
+
ariaBrailleRoleDescription: string | null;
|
|
175
|
+
ariaBusy: string | null;
|
|
176
|
+
ariaChecked: string | null;
|
|
177
|
+
ariaColCount: string | null;
|
|
178
|
+
ariaColIndex: string | null;
|
|
179
|
+
ariaColIndexText: string | null;
|
|
180
|
+
ariaColSpan: string | null;
|
|
181
|
+
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
182
|
+
ariaCurrent: string | null;
|
|
183
|
+
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
184
|
+
ariaDescription: string | null;
|
|
185
|
+
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
186
|
+
ariaDisabled: string | null;
|
|
187
|
+
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
188
|
+
ariaExpanded: string | null;
|
|
189
|
+
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
190
|
+
ariaHasPopup: string | null;
|
|
191
|
+
ariaHidden: string | null;
|
|
192
|
+
ariaInvalid: string | null;
|
|
193
|
+
ariaKeyShortcuts: string | null;
|
|
194
|
+
ariaLabel: string | null;
|
|
195
|
+
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
196
|
+
ariaLevel: string | null;
|
|
197
|
+
ariaLive: string | null;
|
|
198
|
+
ariaModal: string | null;
|
|
199
|
+
ariaMultiLine: string | null;
|
|
200
|
+
ariaMultiSelectable: string | null;
|
|
201
|
+
ariaOrientation: string | null;
|
|
202
|
+
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
203
|
+
ariaPlaceholder: string | null;
|
|
204
|
+
ariaPosInSet: string | null;
|
|
205
|
+
ariaPressed: string | null;
|
|
206
|
+
ariaReadOnly: string | null;
|
|
207
|
+
ariaRelevant: string | null;
|
|
208
|
+
ariaRequired: string | null;
|
|
209
|
+
ariaRoleDescription: string | null;
|
|
210
|
+
ariaRowCount: string | null;
|
|
211
|
+
ariaRowIndex: string | null;
|
|
212
|
+
ariaRowIndexText: string | null;
|
|
213
|
+
ariaRowSpan: string | null;
|
|
214
|
+
ariaSelected: string | null;
|
|
215
|
+
ariaSetSize: string | null;
|
|
216
|
+
ariaSort: string | null;
|
|
217
|
+
ariaValueMax: string | null;
|
|
218
|
+
ariaValueMin: string | null;
|
|
219
|
+
ariaValueNow: string | null;
|
|
220
|
+
ariaValueText: string | null;
|
|
221
|
+
role: string | null;
|
|
222
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
|
|
223
|
+
getAnimations(options?: GetAnimationsOptions): Animation[];
|
|
224
|
+
after(...nodes: (Node | string)[]): void;
|
|
225
|
+
before(...nodes: (Node | string)[]): void;
|
|
226
|
+
remove(): void;
|
|
227
|
+
replaceWith(...nodes: (Node | string)[]): void;
|
|
228
|
+
readonly nextElementSibling: Element | null;
|
|
229
|
+
readonly previousElementSibling: Element | null;
|
|
230
|
+
readonly childElementCount: number;
|
|
231
|
+
readonly children: HTMLCollection;
|
|
232
|
+
readonly firstElementChild: Element | null;
|
|
233
|
+
readonly lastElementChild: Element | null;
|
|
234
|
+
append(...nodes: (Node | string)[]): void;
|
|
235
|
+
moveBefore(node: Node, child: Node | null): void;
|
|
236
|
+
prepend(...nodes: (Node | string)[]): void;
|
|
237
|
+
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
|
|
238
|
+
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
|
|
239
|
+
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
|
|
240
|
+
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
|
|
241
|
+
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
242
|
+
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
|
243
|
+
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
|
|
244
|
+
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
245
|
+
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
246
|
+
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
247
|
+
replaceChildren(...nodes: (Node | string)[]): void;
|
|
248
|
+
readonly assignedSlot: HTMLSlotElement | null;
|
|
249
|
+
readonly attributeStyleMap: StylePropertyMap;
|
|
250
|
+
get style(): CSSStyleDeclaration;
|
|
251
|
+
set style(cssText: string);
|
|
252
|
+
contentEditable: string;
|
|
253
|
+
enterKeyHint: string;
|
|
254
|
+
inputMode: string;
|
|
255
|
+
readonly isContentEditable: boolean;
|
|
256
|
+
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
257
|
+
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
258
|
+
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
259
|
+
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
260
|
+
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
261
|
+
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
262
|
+
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
263
|
+
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
264
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
265
|
+
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
266
|
+
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
267
|
+
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
268
|
+
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
269
|
+
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
270
|
+
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
271
|
+
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
272
|
+
oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
273
|
+
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
274
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
275
|
+
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
276
|
+
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
277
|
+
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
278
|
+
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
279
|
+
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
280
|
+
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
281
|
+
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
282
|
+
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
283
|
+
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
284
|
+
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
285
|
+
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
286
|
+
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
287
|
+
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
288
|
+
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
289
|
+
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
290
|
+
onerror: OnErrorEventHandler;
|
|
291
|
+
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
292
|
+
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
|
|
293
|
+
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
294
|
+
oninput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
295
|
+
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
296
|
+
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
297
|
+
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
298
|
+
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
299
|
+
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
300
|
+
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
301
|
+
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
302
|
+
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
303
|
+
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
304
|
+
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
305
|
+
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
306
|
+
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
307
|
+
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
308
|
+
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
309
|
+
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
310
|
+
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
311
|
+
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
312
|
+
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
313
|
+
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
314
|
+
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
315
|
+
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
316
|
+
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
317
|
+
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
318
|
+
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
319
|
+
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
320
|
+
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
321
|
+
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
322
|
+
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
323
|
+
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
324
|
+
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
325
|
+
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
326
|
+
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
327
|
+
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
328
|
+
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
329
|
+
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
330
|
+
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
|
|
331
|
+
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
332
|
+
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
333
|
+
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
334
|
+
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
335
|
+
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
336
|
+
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
337
|
+
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
338
|
+
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
339
|
+
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
340
|
+
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
341
|
+
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
342
|
+
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
343
|
+
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
344
|
+
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
345
|
+
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
346
|
+
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
347
|
+
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
348
|
+
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
349
|
+
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
350
|
+
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
351
|
+
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
352
|
+
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
353
|
+
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
354
|
+
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
355
|
+
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
356
|
+
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
|
|
357
|
+
autofocus: boolean;
|
|
358
|
+
readonly dataset: DOMStringMap;
|
|
359
|
+
nonce: string;
|
|
360
|
+
tabIndex: number;
|
|
361
|
+
blur(): void;
|
|
362
|
+
focus(options?: FocusOptions): void;
|
|
363
|
+
};
|
|
364
|
+
formAssociated: boolean;
|
|
365
|
+
} & typeof LitElement;
|
|
366
|
+
export declare class WebUiCheckbox extends WebUiCheckbox_base {
|
|
3
367
|
static styles: import('lit').CSSResult;
|
|
4
|
-
static formAssociated: boolean;
|
|
5
368
|
private readonly _groupManagement;
|
|
6
369
|
private _checked;
|
|
7
370
|
get checked(): boolean;
|
|
@@ -14,9 +377,6 @@ export declare class WebUiCheckbox extends LitElement {
|
|
|
14
377
|
private get _isManagedByGroup();
|
|
15
378
|
private readonly _formAssociation;
|
|
16
379
|
private readonly _formAssociationController;
|
|
17
|
-
formResetCallback(): void;
|
|
18
|
-
formDisabledCallback(disabled: boolean): void;
|
|
19
|
-
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
20
380
|
private _syncValidity;
|
|
21
381
|
private handleClick;
|
|
22
382
|
private handleKeyDown;
|
|
@@ -31,3 +391,4 @@ declare global {
|
|
|
31
391
|
'web-ui-checkbox': WebUiCheckbox;
|
|
32
392
|
}
|
|
33
393
|
}
|
|
394
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import e from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/decorate.js";
|
|
2
2
|
import "../icon/index.js";
|
|
3
3
|
import t from "../../icons/generated/heroicons-check-16-solid.js";
|
|
4
|
-
import {
|
|
5
|
-
import { defineGroupManaged as
|
|
6
|
-
import
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { classMap as
|
|
4
|
+
import { FormAssociated as n, FormAssociationController as r, defineFormAssociation as i } from "../../shared/form-association/index.js";
|
|
5
|
+
import { defineGroupManaged as a, selectionGroupContextKey as o } from "../../shared/group-management/index.js";
|
|
6
|
+
import s from "./style.js";
|
|
7
|
+
import { LitElement as c, html as l, unsafeCSS as u } from "lit";
|
|
8
|
+
import { customElement as d, property as f, state as p } from "lit/decorators.js";
|
|
9
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
|
10
10
|
//#region src/components/checkbox/index.ts
|
|
11
|
-
var
|
|
11
|
+
var h = class extends n(c) {
|
|
12
12
|
constructor(...e) {
|
|
13
|
-
super(...e), this._groupManagement =
|
|
14
|
-
context:
|
|
13
|
+
super(...e), this._groupManagement = a(this, {
|
|
14
|
+
context: o,
|
|
15
15
|
requestUpdate: () => this.requestUpdate()
|
|
16
|
-
}).make(), this._checked = !1, this.value = "", this.name = "", this.disabled = !1, this.required = !1, this._formAssociation =
|
|
16
|
+
}).make(), this._checked = !1, this.value = "", this.name = "", this.disabled = !1, this.required = !1, this._formAssociation = i({
|
|
17
17
|
host: this,
|
|
18
18
|
initialize: () => {
|
|
19
19
|
this.hasAttribute("checked") && (this._checked = !0);
|
|
@@ -29,13 +29,10 @@ var m = class extends s {
|
|
|
29
29
|
},
|
|
30
30
|
isStateManaged: () => this._isManagedByGroup,
|
|
31
31
|
syncValidity: () => this._syncValidity()
|
|
32
|
-
}).make(), this._formAssociationController = new
|
|
32
|
+
}).make(), this._formAssociationController = new r(this, this._formAssociation);
|
|
33
33
|
}
|
|
34
34
|
static {
|
|
35
|
-
this.styles =
|
|
36
|
-
}
|
|
37
|
-
static {
|
|
38
|
-
this.formAssociated = !0;
|
|
35
|
+
this.styles = u(s);
|
|
39
36
|
}
|
|
40
37
|
get checked() {
|
|
41
38
|
return this._checked;
|
|
@@ -50,15 +47,6 @@ var m = class extends s {
|
|
|
50
47
|
get _isManagedByGroup() {
|
|
51
48
|
return this._groupManagement.getContext() !== void 0;
|
|
52
49
|
}
|
|
53
|
-
formResetCallback() {
|
|
54
|
-
this._formAssociation.reset();
|
|
55
|
-
}
|
|
56
|
-
formDisabledCallback(e) {
|
|
57
|
-
this._formAssociation.setDisabled(e);
|
|
58
|
-
}
|
|
59
|
-
formStateRestoreCallback(e) {
|
|
60
|
-
this._formAssociation.restore(e);
|
|
61
|
-
}
|
|
62
50
|
_syncValidity() {
|
|
63
51
|
let e = this._formAssociation.getInternals();
|
|
64
52
|
if (!(!e || typeof e.setValidity != "function")) {
|
|
@@ -91,9 +79,9 @@ var m = class extends s {
|
|
|
91
79
|
"is-checked": this._checked,
|
|
92
80
|
"is-disabled": this._isDisabled
|
|
93
81
|
};
|
|
94
|
-
return
|
|
82
|
+
return l`
|
|
95
83
|
<label
|
|
96
|
-
class=${
|
|
84
|
+
class=${m(e)}
|
|
97
85
|
tabindex=${this._isDisabled ? "-1" : "0"}
|
|
98
86
|
role="checkbox"
|
|
99
87
|
aria-checked=${String(this._checked)}
|
|
@@ -115,17 +103,17 @@ var m = class extends s {
|
|
|
115
103
|
`;
|
|
116
104
|
}
|
|
117
105
|
};
|
|
118
|
-
e([
|
|
106
|
+
e([p()], h.prototype, "_checked", void 0), e([f({ type: String })], h.prototype, "value", void 0), e([f({
|
|
119
107
|
type: String,
|
|
120
108
|
reflect: !0
|
|
121
|
-
})],
|
|
109
|
+
})], h.prototype, "name", void 0), e([f({
|
|
122
110
|
type: Boolean,
|
|
123
111
|
reflect: !0
|
|
124
|
-
})],
|
|
112
|
+
})], h.prototype, "disabled", void 0), e([f({
|
|
125
113
|
type: Boolean,
|
|
126
114
|
reflect: !0
|
|
127
|
-
})],
|
|
115
|
+
})], h.prototype, "required", void 0), h = e([d("web-ui-checkbox")], h);
|
|
128
116
|
//#endregion
|
|
129
|
-
export {
|
|
117
|
+
export { h as WebUiCheckbox };
|
|
130
118
|
|
|
131
119
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/checkbox/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nimport '@/components/icon'\nimport { heroiconsCheck16Solid } from '@/icons'\nimport { defineFormAssociation, FormAssociationController } from '@/shared/form-association'\nimport { defineGroupManaged, selectionGroupContextKey, type SelectionGroupContext } from '@/shared/group-management'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-checkbox')\nexport class WebUiCheckbox extends LitElement {\n static override styles = unsafeCSS(style)\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/checkbox/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nimport '@/components/icon'\nimport { heroiconsCheck16Solid } from '@/icons'\nimport { FormAssociated, defineFormAssociation, FormAssociationController } from '@/shared/form-association'\nimport { defineGroupManaged, selectionGroupContextKey, type SelectionGroupContext } from '@/shared/group-management'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-checkbox')\nexport class WebUiCheckbox extends FormAssociated(LitElement) {\n static override styles = unsafeCSS(style)\n private readonly _groupManagement = defineGroupManaged<SelectionGroupContext>(this, {\n context: selectionGroupContextKey,\n requestUpdate: () => this.requestUpdate()\n }).make()\n\n // 内部 checked 状态,通过 getter/setter 暴露为公共 API\n @state() private _checked = false\n\n get checked(): boolean {\n return this._checked\n }\n\n set checked(v: boolean) {\n const old = this._checked\n this._checked = v\n this._formAssociation.sync()\n this.requestUpdate('checked', old)\n }\n\n @property({ type: String }) value = ''\n @property({ type: String, reflect: true }) name = ''\n @property({ type: Boolean, reflect: true }) disabled = false\n @property({ type: Boolean, reflect: true }) required = false\n\n private get _isDisabled(): boolean {\n return (\n this.disabled || this._formAssociation.isFormDisabled() || this._groupManagement.getContext()?.disabled === true\n )\n }\n\n private get _isManagedByGroup(): boolean {\n return this._groupManagement.getContext() !== undefined\n }\n\n private readonly _formAssociation = defineFormAssociation<boolean>({\n host: this,\n initialize: () => {\n if (this.hasAttribute('checked')) this._checked = true\n },\n getState: () => this._checked,\n setState: checked => {\n this.checked = checked\n },\n getFormValue: () => (!this._isManagedByGroup && this._checked ? this.value || 'on' : null),\n getFormState: () => String(this._checked),\n restoreState: state => {\n if (typeof state === 'string') this.checked = state === 'true'\n },\n isStateManaged: () => this._isManagedByGroup,\n syncValidity: () => this._syncValidity()\n }).make()\n\n private readonly _formAssociationController = new FormAssociationController(this, this._formAssociation)\n\n private _syncValidity() {\n const internals = this._formAssociation.getInternals()\n if (!internals || typeof internals.setValidity !== 'function') return\n if (this._isDisabled || this._isManagedByGroup || !this.required || this._checked) {\n internals.setValidity({})\n return\n }\n internals.setValidity({ valueMissing: true }, '请选择此项')\n }\n\n private handleClick() {\n if (this._isDisabled) return\n const old = this._checked\n this._checked = !old\n this._formAssociation.sync()\n this.requestUpdate('checked', old)\n // group-managed 时事件不冒泡/不组合,由 group 统一派发一次 host 事件,避免同名事件外泄\n const opts: EventInit = this._isManagedByGroup\n ? { bubbles: false, composed: false }\n : { bubbles: true, composed: true }\n this.dispatchEvent(new Event('input', opts))\n this.dispatchEvent(new Event('change', opts))\n }\n\n private handleKeyDown(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n this.handleClick()\n }\n }\n\n override render() {\n const cls = {\n 'wui-checkbox': true,\n 'is-checked': this._checked,\n 'is-disabled': this._isDisabled\n }\n\n return html`\n <label\n class=${classMap(cls)}\n tabindex=${this._isDisabled ? '-1' : '0'}\n role=\"checkbox\"\n aria-checked=${String(this._checked)}\n aria-disabled=${String(this._isDisabled)}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n >\n <span class=\"wui-checkbox-box\">\n <span class=\"wui-checkbox-icon\"\n ><web-ui-icon\n .icon=${heroiconsCheck16Solid}\n size=\"18\"\n color=\"var(--wui-color-on-control, #fff)\"\n ></web-ui-icon\n ></span>\n </span>\n <span class=\"wui-checkbox-label\"><slot></slot></span>\n </label>\n `\n }\n\n declare readonly $events: {\n input: Event\n change: Event\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-checkbox': WebUiCheckbox\n }\n}\n"],"mappings":";;;;;;;;;;AAYO,IAAM,IAAN,cAA4B,EAAe,CAAU,CAAC,CAAC;;EAsDd,aApDV,KAAA,mBAAA,EAA0C,MAAM;GAClF,SAAS;GACT,qBAAqB,KAAK,cAAc;EAC1C,CAAC,CAAC,CAAC,KAAK,GAGoB,KAAA,WAAA,IAaQ,KAAA,QAAA,IACc,KAAA,OAAA,IACK,KAAA,WAAA,IACA,KAAA,WAAA,IAYnB,KAAA,mBAAA,EAA+B;GACjE,MAAM;GACN,kBAAkB;IAChB,AAAI,KAAK,aAAa,SAAS,MAAG,KAAK,WAAW;GACpD;GACA,gBAAgB,KAAK;GACrB,WAAU,MAAW;IACnB,KAAK,UAAU;GACjB;GACA,oBAAqB,CAAC,KAAK,qBAAqB,KAAK,WAAW,KAAK,SAAS,OAAO;GACrF,oBAAoB,OAAO,KAAK,QAAQ;GACxC,eAAc,MAAS;IACrB,AAAI,OAAO,KAAU,aAAU,KAAK,UAAU,MAAU;GAC1D;GACA,sBAAsB,KAAK;GAC3B,oBAAoB,KAAK,cAAc;EACzC,CAAC,CAAC,CAAC,KAAK,GAEsC,KAAA,6BAAA,IAAI,EAA0B,MAAM,KAAK,gBAAgB;;;EArD9E,KAAA,SAAA,EAAU,CAAK;;CASxC,IAAI,UAAmB;EACrB,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ,GAAY;EACtB,IAAM,IAAM,KAAK;EAGjB,AAFA,KAAK,WAAW,GAChB,KAAK,iBAAiB,KAAK,GAC3B,KAAK,cAAc,WAAW,CAAG;CACnC;CAOA,IAAY,cAAuB;EACjC,OACE,KAAK,YAAY,KAAK,iBAAiB,eAAe,KAAK,KAAK,iBAAiB,WAAW,CAAC,EAAE,aAAa;CAEhH;CAEA,IAAY,oBAA6B;EACvC,OAAO,KAAK,iBAAiB,WAAW,MAAM,KAAA;CAChD;CAsBA,gBAAwB;EACtB,IAAM,IAAY,KAAK,iBAAiB,aAAa;EACjD,OAAC,KAAa,OAAO,EAAU,eAAgB,aACnD;OAAI,KAAK,eAAe,KAAK,qBAAqB,CAAC,KAAK,YAAY,KAAK,UAAU;IACjF,EAAU,YAAY,CAAC,CAAC;IACxB;GACF;GACA,EAAU,YAAY,EAAE,cAAc,GAAK,GAAG,OAAO;EADrD;CAEF;CAEA,cAAsB;EACpB,IAAI,KAAK,aAAa;EACtB,IAAM,IAAM,KAAK;EAGjB,AAFA,KAAK,WAAW,CAAC,GACjB,KAAK,iBAAiB,KAAK,GAC3B,KAAK,cAAc,WAAW,CAAG;EAEjC,IAAM,IAAkB,KAAK,oBACzB;GAAE,SAAS;GAAO,UAAU;EAAM,IAClC;GAAE,SAAS;GAAM,UAAU;EAAK;EAEpC,AADA,KAAK,cAAc,IAAI,MAAM,SAAS,CAAI,CAAC,GAC3C,KAAK,cAAc,IAAI,MAAM,UAAU,CAAI,CAAC;CAC9C;CAEA,cAAsB,GAAkB;EACtC,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAe,GACjB,KAAK,YAAY;CAErB;CAEA,SAAkB;EAChB,IAAM,IAAM;GACV,gBAAgB;GAChB,cAAc,KAAK;GACnB,eAAe,KAAK;EACtB;EAEA,OAAO,CAAI;;gBAEC,EAAS,CAAG,EAAE;mBACX,KAAK,cAAc,OAAO,IAAI;;uBAE1B,OAAO,KAAK,QAAQ,EAAE;wBACrB,OAAO,KAAK,WAAW,EAAE;iBAChC,KAAK,YAAY;mBACf,KAAK,cAAc;;;;;sBAKhB,EAAsB;;;;;;;;;CAS1C;AAMF;AAlHG,EAAA,CAAA,EAAM,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAaN,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GACzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GACxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GACzC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAzB3C,IAAA,EAAA,CAAA,EAAc,iBAAiB,CAAA,GAAA,CAAA"}
|