@greypan/web-ui 1.4.2 → 2.0.1
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 +674 -232
- package/README.md +683 -237
- package/dist/_virtual/{_@oxc-project_runtime@0.138.0 → _@oxc-project_runtime@0.140.0}/helpers/esm/decorate.js +1 -1
- package/dist/assets/glass.js +6 -0
- package/dist/assets/glass.js.map +1 -0
- package/dist/assets/menu-portal.js +6 -0
- package/dist/assets/menu-portal.js.map +1 -0
- package/dist/assets/overlay-motion.js +6 -0
- package/dist/assets/overlay-motion.js.map +1 -0
- package/dist/assets/toast-containers.js +6 -0
- package/dist/assets/toast-containers.js.map +1 -0
- package/dist/components/avatar/index.d.ts +30 -0
- package/dist/components/avatar/index.js +112 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/avatar/style.js +6 -0
- package/dist/components/avatar/style.js.map +1 -0
- package/dist/components/back-top/index.d.ts +8 -7
- package/dist/components/back-top/index.js +37 -32
- package/dist/components/back-top/index.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/index.d.ts +27 -0
- package/dist/components/badge/index.js +121 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/badge/style.js +6 -0
- package/dist/components/badge/style.js.map +1 -0
- package/dist/components/button/index.d.ts +16 -3
- package/dist/components/button/index.js +56 -17
- package/dist/components/button/index.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/index.d.ts +16 -0
- package/dist/components/button-group/index.js +49 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/button-group/style.js +6 -0
- package/dist/components/button-group/style.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +39 -0
- package/dist/components/checkbox/index.js +111 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/checkbox/style.js +6 -0
- package/dist/components/checkbox/style.js.map +1 -0
- package/dist/components/checkbox-group/index.d.ts +35 -0
- package/dist/components/checkbox-group/index.js +99 -0
- package/dist/components/checkbox-group/index.js.map +1 -0
- package/dist/components/checkbox-group/style.js +6 -0
- package/dist/components/checkbox-group/style.js.map +1 -0
- package/dist/components/context-menu/index.d.ts +84 -0
- package/dist/components/context-menu/index.js +294 -0
- package/dist/components/context-menu/index.js.map +1 -0
- package/dist/components/context-menu/style.js +6 -0
- package/dist/components/context-menu/style.js.map +1 -0
- package/dist/components/dialog/index.d.ts +41 -0
- package/dist/components/dialog/index.js +118 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/dialog/style.js +6 -0
- package/dist/components/dialog/style.js.map +1 -0
- package/dist/components/drawer/index.d.ts +57 -0
- package/dist/components/drawer/index.js +172 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/style.js +6 -0
- package/dist/components/drawer/style.js.map +1 -0
- package/dist/components/dropdown/index.d.ts +87 -0
- package/dist/components/dropdown/index.js +324 -0
- package/dist/components/dropdown/index.js.map +1 -0
- package/dist/components/dropdown/style.js +6 -0
- package/dist/components/dropdown/style.js.map +1 -0
- package/dist/components/dropdown-divider/index.d.ts +11 -0
- package/dist/components/dropdown-divider/index.js +18 -0
- package/dist/components/dropdown-divider/index.js.map +1 -0
- package/dist/components/dropdown-divider/style.js +6 -0
- package/dist/components/dropdown-divider/style.js.map +1 -0
- package/dist/components/dropdown-header/index.d.ts +11 -0
- package/dist/components/dropdown-header/index.js +18 -0
- package/dist/components/dropdown-header/index.js.map +1 -0
- package/dist/components/dropdown-header/style.js +6 -0
- package/dist/components/dropdown-header/style.js.map +1 -0
- package/dist/components/dropdown-item/index.d.ts +17 -0
- package/dist/components/dropdown-item/index.js +44 -0
- package/dist/components/dropdown-item/index.js.map +1 -0
- package/dist/components/dropdown-item/style.js +6 -0
- package/dist/components/dropdown-item/style.js.map +1 -0
- package/dist/components/empty/index.d.ts +23 -0
- package/dist/components/empty/index.js +83 -0
- package/dist/components/empty/index.js.map +1 -0
- package/dist/components/empty/style.js +6 -0
- package/dist/components/empty/style.js.map +1 -0
- package/dist/components/icon/index.d.ts +16 -0
- package/dist/components/icon/index.js +45 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/icon/style.js +6 -0
- package/dist/components/icon/style.js.map +1 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.js +37 -0
- package/dist/components/input/index.d.ts +47 -0
- package/dist/components/input/index.js +140 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/style.js +6 -0
- package/dist/components/input/style.js.map +1 -0
- package/dist/components/input-number/index.d.ts +52 -0
- package/dist/components/input-number/index.js +178 -0
- package/dist/components/input-number/index.js.map +1 -0
- package/dist/components/input-number/style.js +6 -0
- package/dist/components/input-number/style.js.map +1 -0
- package/dist/components/layout/index.d.ts +11 -1
- package/dist/components/layout/index.js +55 -21
- package/dist/components/layout/index.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/index.d.ts +33 -0
- package/dist/components/option/index.js +78 -0
- package/dist/components/option/index.js.map +1 -0
- package/dist/components/option/style.js +6 -0
- package/dist/components/option/style.js.map +1 -0
- package/dist/components/popover/index.d.ts +69 -0
- package/dist/components/popover/index.js +231 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/popover/style.js +6 -0
- package/dist/components/popover/style.js.map +1 -0
- package/dist/components/radio/index.d.ts +39 -0
- package/dist/components/radio/index.js +105 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/radio/style.js +6 -0
- package/dist/components/radio/style.js.map +1 -0
- package/dist/components/radio-group/index.d.ts +35 -0
- package/dist/components/radio-group/index.js +87 -0
- package/dist/components/radio-group/index.js.map +1 -0
- package/dist/components/radio-group/style.js +6 -0
- package/dist/components/radio-group/style.js.map +1 -0
- package/dist/components/segmented/index.d.ts +33 -0
- package/dist/components/segmented/index.js +95 -0
- package/dist/components/segmented/index.js.map +1 -0
- package/dist/components/segmented/style.js +6 -0
- package/dist/components/segmented/style.js.map +1 -0
- package/dist/components/segmented-trigger/index.d.ts +18 -0
- package/dist/components/segmented-trigger/index.js +52 -0
- package/dist/components/segmented-trigger/index.js.map +1 -0
- package/dist/components/segmented-trigger/style.js +6 -0
- package/dist/components/segmented-trigger/style.js.map +1 -0
- package/dist/components/select/index.d.ts +80 -0
- package/dist/components/select/index.js +291 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/style.js +6 -0
- package/dist/components/select/style.js.map +1 -0
- package/dist/components/slider/index.d.ts +61 -0
- package/dist/components/slider/index.js +219 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/slider/style.js +6 -0
- package/dist/components/slider/style.js.map +1 -0
- package/dist/components/spinner/index.d.ts +32 -0
- package/dist/components/spinner/index.js +52 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/spinner/style.js +6 -0
- package/dist/components/spinner/style.js.map +1 -0
- package/dist/components/svg-draw-lines/index.d.ts +30 -9
- package/dist/components/svg-draw-lines/index.js +87 -62
- package/dist/components/svg-draw-lines/index.js.map +1 -1
- package/dist/components/svg-draw-lines/style.js +1 -1
- package/dist/components/svg-draw-lines/style.js.map +1 -1
- package/dist/components/switch/index.d.ts +37 -0
- package/dist/components/switch/index.js +117 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/style.js +6 -0
- package/dist/components/switch/style.js.map +1 -0
- package/dist/components/textarea/index.d.ts +65 -0
- package/dist/components/textarea/index.js +204 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textarea/style.js +6 -0
- package/dist/components/textarea/style.js.map +1 -0
- package/dist/components/theme/index.d.ts +29 -0
- package/dist/components/theme/index.js +78 -0
- package/dist/components/theme/index.js.map +1 -0
- package/dist/components/theme/style.js +6 -0
- package/dist/components/theme/style.js.map +1 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/manager.d.ts +15 -0
- package/dist/components/toast/manager.js +98 -0
- package/dist/components/toast/manager.js.map +1 -0
- package/dist/components/toast/style.js +6 -0
- package/dist/components/toast/style.js.map +1 -0
- package/dist/components/toast/toast.d.ts +42 -0
- package/dist/components/toast/toast.js +122 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toast/types.d.ts +23 -0
- package/dist/components/tooltip/index.d.ts +59 -0
- package/dist/components/tooltip/index.js +190 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tooltip/style.js +6 -0
- package/dist/components/tooltip/style.js.map +1 -0
- package/dist/icons/generated/heroicons-check-16-solid.d.ts +6 -0
- package/dist/icons/generated/heroicons-check-16-solid.js +10 -0
- package/dist/icons/generated/heroicons-check-16-solid.js.map +1 -0
- package/dist/icons/generated/heroicons-x-mark-16-solid.d.ts +6 -0
- package/dist/icons/generated/heroicons-x-mark-16-solid.js +10 -0
- package/dist/icons/generated/heroicons-x-mark-16-solid.js.map +1 -0
- package/dist/icons/generated/jam-close-circle-f.d.ts +8 -0
- package/dist/icons/generated/jam-close-circle-f.js +12 -0
- package/dist/icons/generated/jam-close-circle-f.js.map +1 -0
- package/dist/icons/generated/jam-volume.d.ts +8 -0
- package/dist/icons/generated/jam-watch-f.d.ts +8 -0
- package/dist/icons/generated/lucide-arrow-down-to-line.d.ts +6 -0
- package/dist/icons/generated/lucide-arrow-down-to-line.js +10 -0
- package/dist/icons/generated/lucide-arrow-down-to-line.js.map +1 -0
- package/dist/icons/generated/lucide-arrow-up-to-line.d.ts +6 -0
- package/dist/icons/generated/lucide-arrow-up-to-line.js +10 -0
- package/dist/icons/generated/lucide-arrow-up-to-line.js.map +1 -0
- package/dist/icons/generated/lucide-bell.d.ts +6 -0
- package/dist/icons/generated/lucide-bell.js +10 -0
- package/dist/icons/generated/lucide-bell.js.map +1 -0
- package/dist/icons/generated/lucide-check.d.ts +6 -0
- package/dist/icons/generated/lucide-check.js +10 -0
- package/dist/icons/generated/lucide-check.js.map +1 -0
- package/dist/icons/generated/lucide-chevron-down.d.ts +6 -0
- package/dist/icons/generated/lucide-chevron-down.js +10 -0
- package/dist/icons/generated/lucide-chevron-down.js.map +1 -0
- package/dist/icons/generated/lucide-chevron-left.d.ts +6 -0
- package/dist/icons/generated/lucide-chevron-left.js +10 -0
- package/dist/icons/generated/lucide-chevron-left.js.map +1 -0
- package/dist/icons/generated/lucide-chevron-right.d.ts +6 -0
- package/dist/icons/generated/lucide-chevron-right.js +10 -0
- package/dist/icons/generated/lucide-chevron-right.js.map +1 -0
- package/dist/icons/generated/lucide-chevron-up.d.ts +6 -0
- package/dist/icons/generated/lucide-chevron-up.js +10 -0
- package/dist/icons/generated/lucide-chevron-up.js.map +1 -0
- package/dist/icons/generated/lucide-circle-alert.d.ts +6 -0
- package/dist/icons/generated/lucide-circle-alert.js +10 -0
- package/dist/icons/generated/lucide-circle-alert.js.map +1 -0
- package/dist/icons/generated/lucide-clipboard-paste.d.ts +6 -0
- package/dist/icons/generated/lucide-clipboard-paste.js +10 -0
- package/dist/icons/generated/lucide-clipboard-paste.js.map +1 -0
- package/dist/icons/generated/lucide-copy.d.ts +6 -0
- package/dist/icons/generated/lucide-copy.js +10 -0
- package/dist/icons/generated/lucide-copy.js.map +1 -0
- package/dist/icons/generated/lucide-download.d.ts +6 -0
- package/dist/icons/generated/lucide-download.js +10 -0
- package/dist/icons/generated/lucide-download.js.map +1 -0
- package/dist/icons/generated/lucide-file.d.ts +6 -0
- package/dist/icons/generated/lucide-file.js +10 -0
- package/dist/icons/generated/lucide-file.js.map +1 -0
- package/dist/icons/generated/lucide-folder.d.ts +6 -0
- package/dist/icons/generated/lucide-folder.js +10 -0
- package/dist/icons/generated/lucide-folder.js.map +1 -0
- package/dist/icons/generated/lucide-globe.d.ts +6 -0
- package/dist/icons/generated/lucide-globe.js +10 -0
- package/dist/icons/generated/lucide-globe.js.map +1 -0
- package/dist/icons/generated/lucide-heart.d.ts +6 -0
- package/dist/icons/generated/lucide-heart.js +10 -0
- package/dist/icons/generated/lucide-heart.js.map +1 -0
- package/dist/icons/generated/lucide-image.d.ts +6 -0
- package/dist/icons/generated/lucide-image.js +10 -0
- package/dist/icons/generated/lucide-image.js.map +1 -0
- package/dist/icons/generated/lucide-inbox.d.ts +6 -0
- package/dist/icons/generated/lucide-inbox.js +10 -0
- package/dist/icons/generated/lucide-inbox.js.map +1 -0
- package/dist/icons/generated/lucide-info.d.ts +6 -0
- package/dist/icons/generated/lucide-info.js +10 -0
- package/dist/icons/generated/lucide-info.js.map +1 -0
- package/dist/icons/generated/lucide-loader-circle.d.ts +6 -0
- package/dist/icons/generated/lucide-loader-circle.js +10 -0
- package/dist/icons/generated/lucide-loader-circle.js.map +1 -0
- package/dist/icons/generated/lucide-mail.d.ts +6 -0
- package/dist/icons/generated/lucide-mail.js +10 -0
- package/dist/icons/generated/lucide-mail.js.map +1 -0
- package/dist/icons/generated/lucide-minus.d.ts +6 -0
- package/dist/icons/generated/lucide-minus.js +10 -0
- package/dist/icons/generated/lucide-minus.js.map +1 -0
- package/dist/icons/generated/lucide-plus.d.ts +6 -0
- package/dist/icons/generated/lucide-plus.js +10 -0
- package/dist/icons/generated/lucide-plus.js.map +1 -0
- package/dist/icons/generated/lucide-printer.d.ts +6 -0
- package/dist/icons/generated/lucide-printer.js +10 -0
- package/dist/icons/generated/lucide-printer.js.map +1 -0
- package/dist/icons/generated/lucide-redo-2.d.ts +6 -0
- package/dist/icons/generated/lucide-redo-2.js +10 -0
- package/dist/icons/generated/lucide-redo-2.js.map +1 -0
- package/dist/icons/generated/lucide-scissors.d.ts +6 -0
- package/dist/icons/generated/lucide-scissors.js +10 -0
- package/dist/icons/generated/lucide-scissors.js.map +1 -0
- package/dist/icons/generated/lucide-search.d.ts +6 -0
- package/dist/icons/generated/lucide-search.js +10 -0
- package/dist/icons/generated/lucide-search.js.map +1 -0
- package/dist/icons/generated/lucide-settings.d.ts +6 -0
- package/dist/icons/generated/lucide-settings.js +10 -0
- package/dist/icons/generated/lucide-settings.js.map +1 -0
- package/dist/icons/generated/lucide-star.d.ts +6 -0
- package/dist/icons/generated/lucide-star.js +10 -0
- package/dist/icons/generated/lucide-star.js.map +1 -0
- package/dist/icons/generated/lucide-trash-2.d.ts +6 -0
- package/dist/icons/generated/lucide-trash-2.js +10 -0
- package/dist/icons/generated/lucide-trash-2.js.map +1 -0
- package/dist/icons/generated/lucide-triangle-alert.d.ts +6 -0
- package/dist/icons/generated/lucide-triangle-alert.js +10 -0
- package/dist/icons/generated/lucide-triangle-alert.js.map +1 -0
- package/dist/icons/generated/lucide-undo-2.d.ts +6 -0
- package/dist/icons/generated/lucide-undo-2.js +10 -0
- package/dist/icons/generated/lucide-undo-2.js.map +1 -0
- package/dist/icons/generated/lucide-upload.d.ts +6 -0
- package/dist/icons/generated/lucide-upload.js +10 -0
- package/dist/icons/generated/lucide-upload.js.map +1 -0
- package/dist/icons/generated/lucide-user.d.ts +6 -0
- package/dist/icons/generated/lucide-user.js +10 -0
- package/dist/icons/generated/lucide-user.js.map +1 -0
- package/dist/icons/generated/lucide-x.d.ts +6 -0
- package/dist/icons/generated/lucide-x.js +10 -0
- package/dist/icons/generated/lucide-x.js.map +1 -0
- package/dist/icons/generated/ooui-check.d.ts +6 -0
- package/dist/icons/generated/radix-icons-check.d.ts +6 -0
- package/dist/icons/generated/radix-icons-panel-left-minimized.d.ts +6 -0
- package/dist/icons/generated/radix-icons-panel-left-minimized.js +10 -0
- package/dist/icons/generated/radix-icons-panel-left-minimized.js.map +1 -0
- package/dist/icons/generated/si-check-alt-fill.d.ts +6 -0
- package/dist/icons/index.d.ts +39 -0
- package/dist/icons/index.js +40 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +248 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +324 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +99 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +102 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/shared/menu-portal/menu-portal.js +11 -0
- package/dist/shared/menu-portal/menu-portal.js.map +1 -0
- package/dist/shared/normalize/index.js +11 -0
- package/dist/shared/normalize/index.js.map +1 -0
- package/dist/shared/overlay/overlay.js +68 -0
- package/dist/shared/overlay/overlay.js.map +1 -0
- package/dist/shared/overlay/portal.js +29 -0
- package/dist/shared/overlay/portal.js.map +1 -0
- package/dist/shared/overlay/presence.js +34 -0
- package/dist/shared/overlay/presence.js.map +1 -0
- package/dist/shared/property-converters/boolean-with-false-string.js +9 -0
- package/dist/shared/property-converters/boolean-with-false-string.js.map +1 -0
- package/dist/shared/scroll-lock/scroll-lock.js +12 -0
- package/dist/shared/scroll-lock/scroll-lock.js.map +1 -0
- package/dist/shared/theme/overlay-root.js +28 -0
- package/dist/shared/theme/overlay-root.js.map +1 -0
- package/dist/shared/theme/theme-scope.js +27 -0
- package/dist/shared/theme/theme-scope.js.map +1 -0
- package/dist/types/iconify.d.ts +1 -0
- package/dist/types/react.d.ts +35 -9
- package/dist/types/utils.d.ts +14 -0
- package/dist/types/vue.d.ts +47 -7
- package/package.json +29 -13
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -5
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import e from "../../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.js";
|
|
2
|
+
import "../icon/index.js";
|
|
3
|
+
import t from "../../assets/glass.js";
|
|
4
|
+
import n from "../../icons/generated/lucide-inbox.js";
|
|
5
|
+
import { normalizeLiteral as r } from "../../shared/normalize/index.js";
|
|
6
|
+
import i from "./style.js";
|
|
7
|
+
import { LitElement as a, html as o, unsafeCSS as s } from "lit";
|
|
8
|
+
import { customElement as c, property as l, state as u } from "lit/decorators.js";
|
|
9
|
+
import { classMap as d } from "lit/directives/class-map.js";
|
|
10
|
+
//#region src/components/empty/index.ts
|
|
11
|
+
var f = [
|
|
12
|
+
"small",
|
|
13
|
+
"medium",
|
|
14
|
+
"large"
|
|
15
|
+
], p = class extends a {
|
|
16
|
+
constructor(...e) {
|
|
17
|
+
super(...e), this.title = "", this.description = "", this._size = "medium", this._hasTitleSlot = !1, this._hasDescriptionSlot = !1, this._hasActionSlot = !1, this._syncSlotContent = () => {
|
|
18
|
+
this._hasTitleSlot = this._hasAssignedContent(), this._hasDescriptionSlot = this._hasAssignedContent("description"), this._hasActionSlot = this._hasAssignedContent("action");
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.styles = [s(t), s(i)];
|
|
23
|
+
}
|
|
24
|
+
set size(e) {
|
|
25
|
+
let t = r(e, f, "medium");
|
|
26
|
+
if (this._size !== t) {
|
|
27
|
+
let e = this._size;
|
|
28
|
+
this._size = t, this.requestUpdate("size", e);
|
|
29
|
+
}
|
|
30
|
+
this.getAttribute("size") !== t && this.setAttribute("size", t);
|
|
31
|
+
}
|
|
32
|
+
get size() {
|
|
33
|
+
return this._size;
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback(), this._syncSlotContent();
|
|
37
|
+
}
|
|
38
|
+
_hasAssignedContent(e) {
|
|
39
|
+
return [...this.childNodes].some((t) => t instanceof HTMLElement && (t.getAttribute("slot") ?? "") === (e ?? "") || !e && t.nodeType === Node.TEXT_NODE && !!t.textContent?.trim());
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
let e = this._hasTitleSlot || !!this.title, t = this._hasDescriptionSlot || !!this.description;
|
|
43
|
+
return o`
|
|
44
|
+
<section class="empty">
|
|
45
|
+
<div class="empty-icon wui-glass" aria-hidden="true">
|
|
46
|
+
<slot name="icon"><web-ui-icon .icon=${n}></web-ui-icon></slot>
|
|
47
|
+
</div>
|
|
48
|
+
<div class=${d({
|
|
49
|
+
"empty-title": !0,
|
|
50
|
+
"is-hidden": !e
|
|
51
|
+
})}>
|
|
52
|
+
<slot @slotchange=${this._syncSlotContent}>${this.title}</slot>
|
|
53
|
+
</div>
|
|
54
|
+
<div class=${d({
|
|
55
|
+
"empty-description": !0,
|
|
56
|
+
"is-hidden": !t
|
|
57
|
+
})}>
|
|
58
|
+
<slot name="description" @slotchange=${this._syncSlotContent}>${this.description}</slot>
|
|
59
|
+
</div>
|
|
60
|
+
<div class=${d({
|
|
61
|
+
"empty-action": !0,
|
|
62
|
+
"is-hidden": !this._hasActionSlot
|
|
63
|
+
})}>
|
|
64
|
+
<slot name="action" @slotchange=${this._syncSlotContent}></slot>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
e([l({
|
|
71
|
+
type: String,
|
|
72
|
+
reflect: !0
|
|
73
|
+
})], p.prototype, "title", void 0), e([l({
|
|
74
|
+
type: String,
|
|
75
|
+
reflect: !0
|
|
76
|
+
})], p.prototype, "description", void 0), e([l({
|
|
77
|
+
type: String,
|
|
78
|
+
reflect: !0
|
|
79
|
+
})], p.prototype, "size", null), e([u()], p.prototype, "_hasTitleSlot", void 0), e([u()], p.prototype, "_hasDescriptionSlot", void 0), e([u()], p.prototype, "_hasActionSlot", void 0), p = e([c("web-ui-empty")], p);
|
|
80
|
+
//#endregion
|
|
81
|
+
export { p as WebUiEmpty };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/empty/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\n// 注册 web-ui-icon(Rolldown tree-shake 副作用 import,引用类名阻止删除)\nimport '@/components/icon'\nimport glass from '@/assets/glass.css?inline'\nimport { lucideInbox } from '@/icons'\nimport { normalizeLiteral } from '@/shared/normalize'\n\nimport style from './style.css?inline'\n\nexport type EmptySize = 'small' | 'medium' | 'large'\n\nconst ALLOWED_SIZES = ['small', 'medium', 'large'] as const\n\n@customElement('web-ui-empty')\nexport class WebUiEmpty extends LitElement {\n static override styles = [unsafeCSS(glass), unsafeCSS(style)]\n\n @property({ type: String, reflect: true }) override title = ''\n\n @property({ type: String, reflect: true }) description = ''\n\n @property({ type: String, reflect: true })\n set size(value: string) {\n const normalized = normalizeLiteral(value, ALLOWED_SIZES, 'medium')\n if (this._size !== normalized) {\n const old = this._size\n this._size = normalized\n this.requestUpdate('size', old)\n }\n if (this.getAttribute('size') !== normalized) {\n this.setAttribute('size', normalized)\n }\n }\n\n get size(): EmptySize {\n return this._size\n }\n\n private _size: EmptySize = 'medium'\n\n @state() private _hasTitleSlot = false\n @state() private _hasDescriptionSlot = false\n @state() private _hasActionSlot = false\n\n override connectedCallback() {\n super.connectedCallback()\n this._syncSlotContent()\n }\n\n private _syncSlotContent = () => {\n this._hasTitleSlot = this._hasAssignedContent()\n this._hasDescriptionSlot = this._hasAssignedContent('description')\n this._hasActionSlot = this._hasAssignedContent('action')\n }\n\n private _hasAssignedContent(slotName?: string): boolean {\n return [...this.childNodes].some(node => {\n if (node instanceof HTMLElement && (node.getAttribute('slot') ?? '') === (slotName ?? '')) return true\n return !slotName && node.nodeType === Node.TEXT_NODE && Boolean(node.textContent?.trim())\n })\n }\n\n override render() {\n const showTitle = this._hasTitleSlot || Boolean(this.title)\n const showDescription = this._hasDescriptionSlot || Boolean(this.description)\n\n return html`\n <section class=\"empty\">\n <div class=\"empty-icon wui-glass\" aria-hidden=\"true\">\n <slot name=\"icon\"><web-ui-icon .icon=${lucideInbox}></web-ui-icon></slot>\n </div>\n <div class=${classMap({ 'empty-title': true, 'is-hidden': !showTitle })}>\n <slot @slotchange=${this._syncSlotContent}>${this.title}</slot>\n </div>\n <div class=${classMap({ 'empty-description': true, 'is-hidden': !showDescription })}>\n <slot name=\"description\" @slotchange=${this._syncSlotContent}>${this.description}</slot>\n </div>\n <div class=${classMap({ 'empty-action': true, 'is-hidden': !this._hasActionSlot })}>\n <slot name=\"action\" @slotchange=${this._syncSlotContent}></slot>\n </div>\n </section>\n `\n }\n\n declare readonly $events: Record<string, never>\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-empty': WebUiEmpty\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,IAAM,IAAgB;CAAC;CAAS;CAAU;AAAO,GAGpC,IAAN,cAAyB,EAAW;;EAmCR,aAhC2B,KAAA,QAAA,IAEH,KAAA,cAAA,IAmB9B,KAAA,QAAA,UAEM,KAAA,gBAAA,IACM,KAAA,sBAAA,IACL,KAAA,iBAAA,IAOD,KAAA,yBAAA;GAG/B,AAFA,KAAK,gBAAgB,KAAK,oBAAoB,GAC9C,KAAK,sBAAsB,KAAK,oBAAoB,aAAa,GACjE,KAAK,iBAAiB,KAAK,oBAAoB,QAAQ;EACzD;;;EAtCyB,KAAA,SAAA,CAAC,EAAU,CAAK,GAAG,EAAU,CAAK,CAAC;;CAM5D,IACI,KAAK,GAAe;EACtB,IAAM,IAAa,EAAiB,GAAO,GAAe,QAAQ;EAClE,IAAI,KAAK,UAAU,GAAY;GAC7B,IAAM,IAAM,KAAK;GAEjB,AADA,KAAK,QAAQ,GACb,KAAK,cAAc,QAAQ,CAAG;EAChC;EACA,AAAI,KAAK,aAAa,MAAM,MAAM,KAChC,KAAK,aAAa,QAAQ,CAAU;CAExC;CAEA,IAAI,OAAkB;EACpB,OAAO,KAAK;CACd;CAQA,oBAA6B;EAE3B,AADA,MAAM,kBAAkB,GACxB,KAAK,iBAAiB;CACxB;CAQA,oBAA4B,GAA4B;EACtD,OAAO,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,MAAK,MAC3B,aAAgB,gBAAgB,EAAK,aAAa,MAAM,KAAK,SAAS,KAAY,OAC/E,CAAC,KAAY,EAAK,aAAa,KAAK,aAAa,EAAQ,EAAK,aAAa,KAAK,CACxF;CACH;CAEA,SAAkB;EAChB,IAAM,IAAY,KAAK,iBAAiB,EAAQ,KAAK,OAC/C,IAAkB,KAAK,uBAAuB,EAAQ,KAAK;EAEjE,OAAO,CAAI;;;iDAGkC,EAAY;;qBAExC,EAAS;GAAE,eAAe;GAAM,aAAa,CAAC;EAAU,CAAC,EAAE;8BAClD,KAAK,iBAAiB,GAAG,KAAK,MAAM;;qBAE7C,EAAS;GAAE,qBAAqB;GAAM,aAAa,CAAC;EAAgB,CAAC,EAAE;iDAC3C,KAAK,iBAAiB,GAAG,KAAK,YAAY;;qBAEtE,EAAS;GAAE,gBAAgB;GAAM,aAAa,CAAC,KAAK;EAAe,CAAC,EAAE;4CAC/C,KAAK,iBAAiB;;;;CAIhE;AAGF;AApEG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAExC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAExC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,IAAA,GAmBxC,EAAA,CAAA,EAAM,CAAA,GAAA,EAAA,WAAA,iBAAA,KAAA,CAAA,GACN,EAAA,CAAA,EAAM,CAAA,GAAA,EAAA,WAAA,uBAAA,KAAA,CAAA,GACN,EAAA,CAAA,EAAM,CAAA,GAAA,EAAA,WAAA,kBAAA,KAAA,CAAA,GA7BR,IAAA,EAAA,CAAA,EAAc,cAAc,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/components/empty/style.css?inline
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{display:block}.empty{width:100%;min-block-size:var(--wui-empty-min-height,240px);padding:var(--wui-empty-padding,32px 24px);text-align:center;flex-direction:column;align-items:center;display:flex}.empty-icon{--wui-glass-shadow:none;width:var(--wui-empty-icon-size,56px);height:var(--wui-empty-icon-size,56px);color:var(--wui-color-text-muted,#6a6a6a);background-color:var(--wui-color-surface-raised,#f2f2f7);border-radius:16px;flex:none;justify-content:center;align-items:center;display:flex}.empty-title,.empty-description,.empty-action{max-inline-size:var(--wui-empty-content-width,480px)}.empty-title{margin-top:var(--wui-empty-title-margin-top,16px);font-size:var(--wui-empty-title-font-size,16px);color:var(--wui-color-text,#262626);overflow-wrap:anywhere;font-weight:600;line-height:1.5}.empty-description{font-size:var(--wui-empty-description-font-size,14px);color:var(--wui-color-text-muted,#6a6a6a);overflow-wrap:anywhere;margin-top:6px;line-height:1.6}.empty-action{margin-top:var(--wui-empty-action-margin-top,20px)}.is-hidden{display:none}:host([size=small]){--wui-empty-min-height:160px;--wui-empty-padding:20px 16px;--wui-empty-icon-size:40px;--wui-empty-title-margin-top:12px;--wui-empty-title-font-size:14px;--wui-empty-description-font-size:13px;--wui-empty-action-margin-top:16px}:host([size=large]){--wui-empty-min-height:320px;--wui-empty-padding:48px 32px;--wui-empty-icon-size:72px;--wui-empty-title-margin-top:20px;--wui-empty-title-font-size:18px;--wui-empty-action-margin-top:24px}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/empty/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n.empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n width: 100%;\n min-block-size: var(--wui-empty-min-height, 240px);\n padding: var(--wui-empty-padding, 32px 24px);\n\n text-align: center;\n}\n\n.empty-icon {\n --wui-glass-shadow: none;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: var(--wui-empty-icon-size, 56px);\n height: var(--wui-empty-icon-size, 56px);\n border-radius: 16px;\n\n color: var(--wui-color-text-muted, #6a6a6a);\n\n background-color: var(--wui-color-surface-raised, #f2f2f7);\n}\n\n.empty-title,\n.empty-description,\n.empty-action {\n max-inline-size: var(--wui-empty-content-width, 480px);\n}\n\n.empty-title {\n margin-top: var(--wui-empty-title-margin-top, 16px);\n\n font-size: var(--wui-empty-title-font-size, 16px);\n font-weight: 600;\n line-height: 1.5;\n color: var(--wui-color-text, #262626);\n overflow-wrap: anywhere;\n}\n\n.empty-description {\n margin-top: 6px;\n\n font-size: var(--wui-empty-description-font-size, 14px);\n line-height: 1.6;\n color: var(--wui-color-text-muted, #6a6a6a);\n overflow-wrap: anywhere;\n}\n\n.empty-action {\n margin-top: var(--wui-empty-action-margin-top, 20px);\n}\n\n.is-hidden {\n display: none;\n}\n\n:host([size='small']) {\n --wui-empty-min-height: 160px;\n --wui-empty-padding: 20px 16px;\n --wui-empty-icon-size: 40px;\n --wui-empty-title-margin-top: 12px;\n --wui-empty-title-font-size: 14px;\n --wui-empty-description-font-size: 13px;\n --wui-empty-action-margin-top: 16px;\n}\n\n:host([size='large']) {\n --wui-empty-min-height: 320px;\n --wui-empty-padding: 48px 32px;\n --wui-empty-icon-size: 72px;\n --wui-empty-title-margin-top: 20px;\n --wui-empty-title-font-size: 18px;\n --wui-empty-action-margin-top: 24px;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconifyIcon } from '@iconify/types';
|
|
2
|
+
import { LitElement, nothing } from 'lit';
|
|
3
|
+
export declare class WebUiIcon extends LitElement {
|
|
4
|
+
static styles: import('lit').CSSResult;
|
|
5
|
+
icon?: IconifyIcon;
|
|
6
|
+
spin: boolean;
|
|
7
|
+
size: number;
|
|
8
|
+
color?: string;
|
|
9
|
+
render(): typeof nothing | import('lit').TemplateResult<1>;
|
|
10
|
+
readonly $events: Record<string, never>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'web-ui-icon': WebUiIcon;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import e from "./style.js";
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.js";
|
|
3
|
+
import { LitElement as n, html as r, nothing as i, unsafeCSS as a } from "lit";
|
|
4
|
+
import { customElement as o, property as s } from "lit/decorators.js";
|
|
5
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
|
6
|
+
import { unsafeSVG as l } from "lit/directives/unsafe-svg.js";
|
|
7
|
+
//#region src/components/icon/index.ts
|
|
8
|
+
var u = class extends n {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.spin = !1, this.size = 18;
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = a(e);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
if (!this.icon) return i;
|
|
17
|
+
let e = this.color ? `color: ${this.color}` : "", t = `${this.icon.left ?? 0} ${this.icon.top ?? 0} ${this.icon.width ?? 24} ${this.icon.height ?? 24}`;
|
|
18
|
+
return r`
|
|
19
|
+
<svg
|
|
20
|
+
class=${c({ spin: this.spin })}
|
|
21
|
+
style=${e}
|
|
22
|
+
viewBox="${t}"
|
|
23
|
+
width="${this.size}"
|
|
24
|
+
height="${this.size}"
|
|
25
|
+
aria-hidden="true"
|
|
26
|
+
>
|
|
27
|
+
${l(this.icon.body)}
|
|
28
|
+
</svg>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
t([s({ attribute: !1 })], u.prototype, "icon", void 0), t([s({
|
|
33
|
+
type: Boolean,
|
|
34
|
+
reflect: !0
|
|
35
|
+
})], u.prototype, "spin", void 0), t([s({
|
|
36
|
+
type: Number,
|
|
37
|
+
reflect: !0
|
|
38
|
+
})], u.prototype, "size", void 0), t([s({
|
|
39
|
+
type: String,
|
|
40
|
+
reflect: !0
|
|
41
|
+
})], u.prototype, "color", void 0), u = t([o("web-ui-icon")], u);
|
|
42
|
+
//#endregion
|
|
43
|
+
export { u as WebUiIcon };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/icon/index.ts"],"sourcesContent":["import type { IconifyIcon } from '@iconify/types'\nimport { html, LitElement, nothing, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-icon')\nexport class WebUiIcon extends LitElement {\n static override styles = unsafeCSS(style)\n\n @property({ attribute: false }) icon?: IconifyIcon\n @property({ type: Boolean, reflect: true }) spin = false\n @property({ type: Number, reflect: true }) size: number = 18\n @property({ type: String, reflect: true }) color?: string\n\n override render() {\n if (!this.icon) return nothing\n\n const svgStyle = this.color ? `color: ${this.color}` : ''\n const viewBox = `${this.icon.left ?? 0} ${this.icon.top ?? 0} ${this.icon.width ?? 24} ${this.icon.height ?? 24}`\n\n return html`\n <svg\n class=${classMap({ spin: this.spin })}\n style=${svgStyle}\n viewBox=\"${viewBox}\"\n width=\"${this.size}\"\n height=\"${this.size}\"\n aria-hidden=\"true\"\n >\n ${unsafeSVG(this.icon.body)}\n </svg>\n `\n }\n\n declare readonly $events: Record<string, never>\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-icon': WebUiIcon\n }\n}\n"],"mappings":";;;;;;;AASO,IAAM,IAAN,cAAwB,EAAW;;EAKkB,aADP,KAAA,OAAA,IACO,KAAA,OAAA;;;EAJjC,KAAA,SAAA,EAAU,CAAK;;CAOxC,SAAkB;EAChB,IAAI,CAAC,KAAK,MAAM,OAAO;EAEvB,IAAM,IAAW,KAAK,QAAQ,UAAU,KAAK,UAAU,IACjD,IAAU,GAAG,KAAK,KAAK,QAAQ,EAAE,GAAG,KAAK,KAAK,OAAO,EAAE,GAAG,KAAK,KAAK,SAAS,GAAG,GAAG,KAAK,KAAK,UAAU;EAE7G,OAAO,CAAI;;gBAEC,EAAS,EAAE,MAAM,KAAK,KAAK,CAAC,EAAE;gBAC9B,EAAS;mBACN,EAAQ;iBACV,KAAK,KAAK;kBACT,KAAK,KAAK;;;UAGlB,EAAU,KAAK,KAAK,IAAI,EAAE;;;CAGlC;AAGF;AA1BG,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAC7B,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GACzC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GACxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAP1C,IAAA,EAAA,CAAA,EAAc,aAAa,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/components/icon/style.css?inline
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{-webkit-user-select:none;user-select:none;display:inline-flex}svg{color:var(--wui-icon-color,inherit);display:block}svg.spin{animation:.6s linear infinite wui-icon-spin}@keyframes wui-icon-spin{to{transform:rotate(360deg)}}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/icon/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n user-select: none;\n display: inline-flex;\n}\n\nsvg {\n display: block;\n color: var(--wui-icon-color, inherit);\n}\n\nsvg.spin {\n animation: wui-icon-spin 0.6s linear infinite;\n}\n\n@keyframes wui-icon-spin {\n to {\n transform: rotate(360deg);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export * from './avatar';
|
|
2
|
+
export * from './back-top';
|
|
3
|
+
export * from './badge';
|
|
4
|
+
export * from './button';
|
|
5
|
+
export * from './button-group';
|
|
6
|
+
export * from './checkbox';
|
|
7
|
+
export * from './checkbox-group';
|
|
8
|
+
export * from './context-menu';
|
|
9
|
+
export * from './dialog';
|
|
10
|
+
export * from './drawer';
|
|
11
|
+
export * from './dropdown-divider';
|
|
12
|
+
export * from './dropdown-header';
|
|
13
|
+
export * from './dropdown-item';
|
|
14
|
+
export * from './dropdown';
|
|
15
|
+
export * from './empty';
|
|
16
|
+
export * from './icon';
|
|
17
|
+
export * from './input';
|
|
18
|
+
export * from './input-number';
|
|
19
|
+
export * from './layout';
|
|
20
|
+
export * from './option';
|
|
21
|
+
export * from './popover';
|
|
22
|
+
export * from './radio';
|
|
23
|
+
export * from './radio-group';
|
|
24
|
+
export * from './segmented';
|
|
25
|
+
export * from './segmented-trigger';
|
|
26
|
+
export * from './select';
|
|
27
|
+
export * from './slider';
|
|
28
|
+
export * from './spinner';
|
|
29
|
+
export * from './textarea';
|
|
30
|
+
export * from './theme';
|
|
31
|
+
export * from './toast';
|
|
32
|
+
export * from './svg-draw-lines';
|
|
33
|
+
export * from './switch';
|
|
34
|
+
export * from './tooltip';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { WebUiIcon as e } from "./icon/index.js";
|
|
2
|
+
import { WebUiAvatar as t } from "./avatar/index.js";
|
|
3
|
+
import { WebUiButton as n } from "./button/index.js";
|
|
4
|
+
import { WebUiBackTop as r } from "./back-top/index.js";
|
|
5
|
+
import { WebUiBadge as i } from "./badge/index.js";
|
|
6
|
+
import { WebUiButtonGroup as a } from "./button-group/index.js";
|
|
7
|
+
import { WebUiCheckbox as o } from "./checkbox/index.js";
|
|
8
|
+
import { WebUiCheckboxGroup as s } from "./checkbox-group/index.js";
|
|
9
|
+
import { WebUiDropdownDivider as c } from "./dropdown-divider/index.js";
|
|
10
|
+
import { WebUiDropdownHeader as l } from "./dropdown-header/index.js";
|
|
11
|
+
import { WebUiDropdownItem as u } from "./dropdown-item/index.js";
|
|
12
|
+
import { WebUiContextMenu as d } from "./context-menu/index.js";
|
|
13
|
+
import { WebUiDialog as f } from "./dialog/index.js";
|
|
14
|
+
import { WebUiDrawer as p } from "./drawer/index.js";
|
|
15
|
+
import { WebUiDropdown as m } from "./dropdown/index.js";
|
|
16
|
+
import { WebUiEmpty as h } from "./empty/index.js";
|
|
17
|
+
import { WebUiInput as g } from "./input/index.js";
|
|
18
|
+
import { WebUiInputNumber as _ } from "./input-number/index.js";
|
|
19
|
+
import { WebUiLayout as v } from "./layout/index.js";
|
|
20
|
+
import { WebUiOption as y } from "./option/index.js";
|
|
21
|
+
import { WebUiPopover as b } from "./popover/index.js";
|
|
22
|
+
import { WebUiRadio as x } from "./radio/index.js";
|
|
23
|
+
import { WebUiRadioGroup as S } from "./radio-group/index.js";
|
|
24
|
+
import { WebUiSegmented as C } from "./segmented/index.js";
|
|
25
|
+
import { WebUiSegmentedTrigger as w } from "./segmented-trigger/index.js";
|
|
26
|
+
import { WebUiSelect as T } from "./select/index.js";
|
|
27
|
+
import { WebUiSlider as E } from "./slider/index.js";
|
|
28
|
+
import { WebUiSpinner as D, WebUiSpinnerElement as O } from "./spinner/index.js";
|
|
29
|
+
import { WebUiTextarea as k } from "./textarea/index.js";
|
|
30
|
+
import { WebUiTheme as A } from "./theme/index.js";
|
|
31
|
+
import { toast as j } from "./toast/manager.js";
|
|
32
|
+
import { WebUiToast as M } from "./toast/toast.js";
|
|
33
|
+
import "./toast/index.js";
|
|
34
|
+
import { WebUiSvgDrawLines as N } from "./svg-draw-lines/index.js";
|
|
35
|
+
import { WebUiSwitch as P } from "./switch/index.js";
|
|
36
|
+
import { WebUiTooltip as F } from "./tooltip/index.js";
|
|
37
|
+
export { t as WebUiAvatar, r as WebUiBackTop, i as WebUiBadge, n as WebUiButton, a as WebUiButtonGroup, o as WebUiCheckbox, s as WebUiCheckboxGroup, d as WebUiContextMenu, f as WebUiDialog, p as WebUiDrawer, m as WebUiDropdown, c as WebUiDropdownDivider, l as WebUiDropdownHeader, u as WebUiDropdownItem, h as WebUiEmpty, e as WebUiIcon, g as WebUiInput, _ as WebUiInputNumber, v as WebUiLayout, y as WebUiOption, b as WebUiPopover, x as WebUiRadio, S as WebUiRadioGroup, C as WebUiSegmented, w as WebUiSegmentedTrigger, T as WebUiSelect, E as WebUiSlider, D as WebUiSpinner, O as WebUiSpinnerElement, N as WebUiSvgDrawLines, P as WebUiSwitch, k as WebUiTextarea, A as WebUiTheme, M as WebUiToast, F as WebUiTooltip, j as toast };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class WebUiInput extends LitElement {
|
|
3
|
+
static formAssociated: boolean;
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
type: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
name: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
required: boolean;
|
|
10
|
+
clearable: boolean;
|
|
11
|
+
full: boolean;
|
|
12
|
+
borderless: boolean;
|
|
13
|
+
private _value;
|
|
14
|
+
private _focused;
|
|
15
|
+
private _formDisabled;
|
|
16
|
+
private _hasPrefix;
|
|
17
|
+
private _hasSuffix;
|
|
18
|
+
private _internals?;
|
|
19
|
+
get value(): string;
|
|
20
|
+
set value(v: string);
|
|
21
|
+
private get _isDisabled();
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
updated(changed: Map<string, unknown>): void;
|
|
24
|
+
formResetCallback(): void;
|
|
25
|
+
formDisabledCallback(disabled: boolean): void;
|
|
26
|
+
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
27
|
+
private _syncValidity;
|
|
28
|
+
private _onSlotChange;
|
|
29
|
+
private handleInput;
|
|
30
|
+
private handleFocus;
|
|
31
|
+
private handleBlur;
|
|
32
|
+
private handleClear;
|
|
33
|
+
private preventMouseDownBlur;
|
|
34
|
+
private focusInput;
|
|
35
|
+
render(): import('lit').TemplateResult<1>;
|
|
36
|
+
readonly $events: {
|
|
37
|
+
input: Event;
|
|
38
|
+
change: Event;
|
|
39
|
+
focus: FocusEvent;
|
|
40
|
+
blur: FocusEvent;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
'web-ui-input': WebUiInput;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import e from "../../_virtual/_@oxc-project_runtime@0.140.0/helpers/esm/decorate.js";
|
|
2
|
+
import "../icon/index.js";
|
|
3
|
+
import t from "../../assets/glass.js";
|
|
4
|
+
import n from "../../icons/generated/jam-close-circle-f.js";
|
|
5
|
+
import r from "./style.js";
|
|
6
|
+
import { LitElement as i, html as a, unsafeCSS as o } from "lit";
|
|
7
|
+
import { customElement as s, property as c, state as l } from "lit/decorators.js";
|
|
8
|
+
import { classMap as u } from "lit/directives/class-map.js";
|
|
9
|
+
//#region src/components/input/index.ts
|
|
10
|
+
var d = class extends i {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.type = "text", this.placeholder = "", this.name = "", this.disabled = !1, this.required = !1, this.clearable = !1, this.full = !1, this.borderless = !1, this._value = "", this._focused = !1, this._formDisabled = !1, this._hasPrefix = !1, this._hasSuffix = !1;
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.formAssociated = !0;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = [o(t), o(r)];
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._value;
|
|
22
|
+
}
|
|
23
|
+
set value(e) {
|
|
24
|
+
let t = this._value;
|
|
25
|
+
this._value = e, this._internals?.setFormValue?.(e), this.requestUpdate("value", t);
|
|
26
|
+
}
|
|
27
|
+
get _isDisabled() {
|
|
28
|
+
return this.disabled || this._formDisabled;
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
super.connectedCallback(), this._internals ||= this.attachInternals(), this._internals.setFormValue?.(this._value);
|
|
32
|
+
}
|
|
33
|
+
updated(e) {
|
|
34
|
+
if (e.has("_value")) {
|
|
35
|
+
let e = this.shadowRoot?.querySelector("input");
|
|
36
|
+
e && e.value !== this._value && (e.value = this._value);
|
|
37
|
+
}
|
|
38
|
+
this._syncValidity(), this.toggleAttribute("focused", this._focused);
|
|
39
|
+
}
|
|
40
|
+
formResetCallback() {
|
|
41
|
+
this.value = this.getAttribute("value") || "";
|
|
42
|
+
}
|
|
43
|
+
formDisabledCallback(e) {
|
|
44
|
+
this._formDisabled = e;
|
|
45
|
+
}
|
|
46
|
+
formStateRestoreCallback(e) {
|
|
47
|
+
typeof e == "string" && (this.value = e);
|
|
48
|
+
}
|
|
49
|
+
_syncValidity() {
|
|
50
|
+
let e = this.shadowRoot?.querySelector("input");
|
|
51
|
+
if (!this._internals || !e || typeof this._internals.setValidity != "function") return;
|
|
52
|
+
if (this._isDisabled || e.validity.valid) {
|
|
53
|
+
this._internals.setValidity({});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let t = {};
|
|
57
|
+
e.validity.valueMissing && (t.valueMissing = !0), e.validity.typeMismatch && (t.typeMismatch = !0), e.validity.patternMismatch && (t.patternMismatch = !0), e.validity.tooLong && (t.tooLong = !0), e.validity.tooShort && (t.tooShort = !0), this._internals.setValidity(t, e.validationMessage, e);
|
|
58
|
+
}
|
|
59
|
+
_onSlotChange(e) {
|
|
60
|
+
if (!(e.target instanceof HTMLSlotElement)) return;
|
|
61
|
+
let t = e.target, n = t.assignedElements().length > 0;
|
|
62
|
+
t.name === "prefix" && (this._hasPrefix = n), t.name === "suffix" && (this._hasSuffix = n);
|
|
63
|
+
}
|
|
64
|
+
handleInput(e) {
|
|
65
|
+
e.target instanceof HTMLInputElement && (this._value = e.target.value, this._internals?.setFormValue?.(this._value), this._syncValidity());
|
|
66
|
+
}
|
|
67
|
+
handleFocus() {
|
|
68
|
+
this._isDisabled || (this._focused = !0);
|
|
69
|
+
}
|
|
70
|
+
handleBlur() {
|
|
71
|
+
this._focused = !1;
|
|
72
|
+
}
|
|
73
|
+
handleClear() {
|
|
74
|
+
this._isDisabled || (this._value = "", this._internals?.setFormValue?.(""), this._syncValidity(), this.dispatchEvent(new Event("input", {
|
|
75
|
+
bubbles: !0,
|
|
76
|
+
composed: !0
|
|
77
|
+
})));
|
|
78
|
+
}
|
|
79
|
+
preventMouseDownBlur(e) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
}
|
|
82
|
+
focusInput() {
|
|
83
|
+
this._isDisabled || this.shadowRoot?.querySelector("input")?.focus();
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
let e = this.clearable && this._value;
|
|
87
|
+
return a`
|
|
88
|
+
<div class="wui-glass wui-input-inner" @click=${this.focusInput}>
|
|
89
|
+
<slot name="prefix" class=${u({ empty: !this._hasPrefix })} @slotchange=${this._onSlotChange}></slot>
|
|
90
|
+
<input
|
|
91
|
+
type=${this.type}
|
|
92
|
+
placeholder=${this.placeholder}
|
|
93
|
+
name=${this.name}
|
|
94
|
+
?disabled=${this._isDisabled}
|
|
95
|
+
?required=${this.required}
|
|
96
|
+
.value=${this._value}
|
|
97
|
+
@input=${this.handleInput}
|
|
98
|
+
@focus=${this.handleFocus}
|
|
99
|
+
@blur=${this.handleBlur}
|
|
100
|
+
/>
|
|
101
|
+
${e ? a`<span class="clear" @pointerdown=${this.preventMouseDownBlur} @click=${this.handleClear}>
|
|
102
|
+
<web-ui-icon .icon=${n}></web-ui-icon>
|
|
103
|
+
</span>` : ""}
|
|
104
|
+
<slot name="suffix" class=${u({ empty: !this._hasSuffix })} @slotchange=${this._onSlotChange}></slot>
|
|
105
|
+
</div>
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
e([c({
|
|
110
|
+
type: String,
|
|
111
|
+
reflect: !0
|
|
112
|
+
})], d.prototype, "type", void 0), e([c({
|
|
113
|
+
type: String,
|
|
114
|
+
reflect: !0
|
|
115
|
+
})], d.prototype, "placeholder", void 0), e([c({
|
|
116
|
+
type: String,
|
|
117
|
+
reflect: !0
|
|
118
|
+
})], d.prototype, "name", void 0), e([c({
|
|
119
|
+
type: Boolean,
|
|
120
|
+
reflect: !0
|
|
121
|
+
})], d.prototype, "disabled", void 0), e([c({
|
|
122
|
+
type: Boolean,
|
|
123
|
+
reflect: !0
|
|
124
|
+
})], d.prototype, "required", void 0), e([c({
|
|
125
|
+
type: Boolean,
|
|
126
|
+
reflect: !0
|
|
127
|
+
})], d.prototype, "clearable", void 0), e([c({
|
|
128
|
+
type: Boolean,
|
|
129
|
+
reflect: !0
|
|
130
|
+
})], d.prototype, "full", void 0), e([c({
|
|
131
|
+
type: Boolean,
|
|
132
|
+
reflect: !0
|
|
133
|
+
})], d.prototype, "borderless", void 0), e([l()], d.prototype, "_value", void 0), e([l()], d.prototype, "_focused", void 0), e([l()], d.prototype, "_formDisabled", void 0), e([l()], d.prototype, "_hasPrefix", void 0), e([l()], d.prototype, "_hasSuffix", void 0), e([c({
|
|
134
|
+
type: String,
|
|
135
|
+
reflect: !0
|
|
136
|
+
})], d.prototype, "value", null), d = e([s("web-ui-input")], d);
|
|
137
|
+
//#endregion
|
|
138
|
+
export { d as WebUiInput };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/input/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\n// web-ui-icon 必须注册(Rolldown tree-shake 副作用 import,引用类名阻止删除)\nimport '@/components/icon'\nimport glass from '@/assets/glass.css?inline'\nimport { jamCloseCircleF } from '@/icons'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-input')\nexport class WebUiInput extends LitElement {\n static formAssociated = true\n static override styles = [unsafeCSS(glass), unsafeCSS(style)]\n\n @property({ type: String, reflect: true }) type = 'text'\n @property({ type: String, reflect: true }) placeholder = ''\n @property({ type: String, reflect: true }) name = ''\n @property({ type: Boolean, reflect: true }) disabled = false\n @property({ type: Boolean, reflect: true }) required = false\n @property({ type: Boolean, reflect: true }) clearable = false\n @property({ type: Boolean, reflect: true }) full = false\n @property({ type: Boolean, reflect: true }) borderless = false\n\n @state() private _value = ''\n @state() private _focused = false\n @state() private _formDisabled = false\n @state() private _hasPrefix = false\n @state() private _hasSuffix = false\n\n private _internals?: ElementInternals\n\n @property({ type: String, reflect: true })\n get value(): string {\n return this._value\n }\n\n set value(v: string) {\n const old = this._value\n this._value = v\n this._internals?.setFormValue?.(v)\n this.requestUpdate('value', old)\n }\n\n private get _isDisabled(): boolean {\n return this.disabled || this._formDisabled\n }\n\n override connectedCallback() {\n super.connectedCallback()\n if (!this._internals) {\n this._internals = this.attachInternals()\n }\n this._internals.setFormValue?.(this._value)\n }\n\n override updated(changed: Map<string, unknown>) {\n if (changed.has('_value')) {\n const input = this.shadowRoot?.querySelector('input')\n if (input && input.value !== this._value) {\n input.value = this._value\n }\n }\n this._syncValidity()\n this.toggleAttribute('focused', this._focused)\n }\n\n formResetCallback() {\n this.value = this.getAttribute('value') || ''\n }\n\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n if (typeof state === 'string') this.value = state\n }\n\n private _syncValidity() {\n const input = this.shadowRoot?.querySelector('input')\n if (!this._internals || !input || typeof this._internals.setValidity !== 'function') return\n if (this._isDisabled || input.validity.valid) {\n this._internals.setValidity({})\n return\n }\n\n const flags: ValidityStateFlags = {}\n if (input.validity.valueMissing) flags.valueMissing = true\n if (input.validity.typeMismatch) flags.typeMismatch = true\n if (input.validity.patternMismatch) flags.patternMismatch = true\n if (input.validity.tooLong) flags.tooLong = true\n if (input.validity.tooShort) flags.tooShort = true\n this._internals.setValidity(flags, input.validationMessage, input)\n }\n\n private _onSlotChange(e: Event) {\n if (!(e.target instanceof HTMLSlotElement)) return\n const slot = e.target\n const hasContent = slot.assignedElements().length > 0\n if (slot.name === 'prefix') this._hasPrefix = hasContent\n if (slot.name === 'suffix') this._hasSuffix = hasContent\n }\n\n private handleInput(e: Event) {\n if (!(e.target instanceof HTMLInputElement)) return\n this._value = e.target.value\n this._internals?.setFormValue?.(this._value)\n this._syncValidity()\n }\n\n private handleFocus() {\n if (!this._isDisabled) this._focused = true\n }\n\n private handleBlur() {\n this._focused = false\n }\n\n private handleClear() {\n if (this._isDisabled) return\n this._value = ''\n this._internals?.setFormValue?.('')\n this._syncValidity()\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }))\n }\n\n private preventMouseDownBlur(e: Event) {\n e.preventDefault()\n }\n\n private focusInput() {\n if (this._isDisabled) return\n this.shadowRoot?.querySelector('input')?.focus()\n }\n\n override render() {\n const showClear = this.clearable && this._value\n\n return html`\n <div class=\"wui-glass wui-input-inner\" @click=${this.focusInput}>\n <slot name=\"prefix\" class=${classMap({ empty: !this._hasPrefix })} @slotchange=${this._onSlotChange}></slot>\n <input\n type=${this.type}\n placeholder=${this.placeholder}\n name=${this.name}\n ?disabled=${this._isDisabled}\n ?required=${this.required}\n .value=${this._value}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n />\n ${showClear\n ? html`<span class=\"clear\" @pointerdown=${this.preventMouseDownBlur} @click=${this.handleClear}>\n <web-ui-icon .icon=${jamCloseCircleF}></web-ui-icon>\n </span>`\n : ''}\n <slot name=\"suffix\" class=${classMap({ empty: !this._hasSuffix })} @slotchange=${this._onSlotChange}></slot>\n </div>\n `\n }\n\n declare readonly $events: {\n input: Event\n change: Event\n focus: FocusEvent\n blur: FocusEvent\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-input': WebUiInput\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/components/input/style.css?inline
|
|
2
|
+
var e = "*,:before,:after{box-sizing:border-box}:host{display:inline-block}:host([disabled]){cursor:not-allowed;opacity:.4}.wui-input-inner{box-sizing:border-box;width:var(--wui-input-width,200px);min-width:var(--wui-button-size,40px);height:var(--wui-button-size,40px);border-radius:2147483647px;align-items:center;gap:8px;padding:0 16px;display:flex;position:relative}:host([full]){display:block}:host([full]) .wui-input-inner{width:100%}:host([borderless]) .wui-input-inner{-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;background:0 0;border:none;padding:0}:host([focused]) .wui-input-inner{--wui-glass-shadow:var(--wui-shadow-glass,0 2px 16px #0000000f), 0 0 0 3px var(--wui-focus-ring,#08f6);border-color:var(--wui-color-border-strong,#006ee680)}:host([borderless][focused]) .wui-input-inner{box-shadow:none;border-color:#0000}input{min-width:0;height:100%;font-size:var(--wui-font-size,14px);color:var(--wui-color-text,#1b1b1b);background:0 0;border:none;outline:none;flex:1}input::placeholder{color:var(--wui-color-text-muted,#6a6a6a)}input:disabled{cursor:not-allowed;opacity:.4}slot{font-size:var(--wui-font-size,14px);color:var(--wui-color-text-muted,#6a6a6a);flex-shrink:0;align-items:center;display:flex}slot.empty{display:none}.clear{cursor:pointer;color:var(--wui-color-text-muted,#6a6a6a);flex-shrink:0;justify-content:center;align-self:stretch;align-items:center;display:flex}.clear:hover{color:var(--wui-color-text-muted,#6a6a6a)}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../../../src/components/input/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-block;\n}\n\n:host([disabled]) {\n cursor: not-allowed;\n opacity: 0.4;\n}\n\n.wui-input-inner {\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n box-sizing: border-box;\n width: var(--wui-input-width, 200px);\n min-width: var(--wui-button-size, 40px);\n height: var(--wui-button-size, 40px);\n padding: 0 16px;\n border-radius: calc(infinity * 1px);\n}\n\n:host([full]) {\n display: block;\n}\n\n:host([full]) .wui-input-inner {\n width: 100%;\n}\n\n/* ===== Borderless ===== */\n\n:host([borderless]) .wui-input-inner {\n padding: 0;\n border: none;\n\n background: transparent;\n backdrop-filter: none;\n box-shadow: none;\n}\n\n:host([focused]) .wui-input-inner {\n --wui-glass-shadow:\n var(--wui-shadow-glass, 0 2px 16px rgb(0 0 0 / 0.06)), 0 0 0 3px var(--wui-focus-ring, rgb(0 136 255 / 0.4));\n border-color: var(--wui-color-border-strong, rgb(0 110 230 / 0.5));\n}\n\n:host([borderless][focused]) .wui-input-inner {\n border-color: transparent;\n box-shadow: none;\n}\n\n/* ===== Input ===== */\n\ninput {\n flex: 1;\n\n min-width: 0;\n height: 100%;\n border: none;\n\n font-size: var(--wui-font-size, 14px);\n color: var(--wui-color-text, #1b1b1b);\n\n background: transparent;\n outline: none;\n\n &::placeholder {\n color: var(--wui-color-text-muted, #6a6a6a);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n}\n\n/* ===== Prefix / Suffix ===== */\n\nslot {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n\n font-size: var(--wui-font-size, 14px);\n color: var(--wui-color-text-muted, #6a6a6a);\n}\n\n/* slot 无 slotted 内容时折叠 */\nslot.empty {\n display: none;\n}\n\n/* ===== Clear button ===== */\n\n.clear {\n cursor: pointer;\n\n display: flex;\n flex-shrink: 0;\n align-items: center;\n align-self: stretch;\n justify-content: center;\n\n color: var(--wui-color-text-muted, #6a6a6a);\n\n &:hover {\n color: var(--wui-color-text-muted, #6a6a6a);\n }\n}\n\n/* ===== Disabled ===== */\n"],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class WebUiInputNumber extends LitElement {
|
|
3
|
+
static formAssociated: boolean;
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
placeholder: string;
|
|
6
|
+
name: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
get precision(): number;
|
|
10
|
+
set precision(v: number);
|
|
11
|
+
private _value;
|
|
12
|
+
private _min;
|
|
13
|
+
private _max;
|
|
14
|
+
private _step;
|
|
15
|
+
private _formDisabled;
|
|
16
|
+
private _precision;
|
|
17
|
+
private _internals?;
|
|
18
|
+
get value(): number;
|
|
19
|
+
set value(v: number);
|
|
20
|
+
private get _isDisabled();
|
|
21
|
+
get min(): number;
|
|
22
|
+
set min(v: unknown);
|
|
23
|
+
get max(): number;
|
|
24
|
+
set max(v: unknown);
|
|
25
|
+
get step(): number;
|
|
26
|
+
set step(v: unknown);
|
|
27
|
+
private get _effectiveStep();
|
|
28
|
+
private get atMin();
|
|
29
|
+
private get atMax();
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
formResetCallback(): void;
|
|
32
|
+
formDisabledCallback(disabled: boolean): void;
|
|
33
|
+
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
34
|
+
updated(): void;
|
|
35
|
+
private _syncValidity;
|
|
36
|
+
private clamp;
|
|
37
|
+
private round;
|
|
38
|
+
private setValueAndNotify;
|
|
39
|
+
private handleStep;
|
|
40
|
+
private handleInput;
|
|
41
|
+
private handleKeydown;
|
|
42
|
+
render(): import('lit').TemplateResult<1>;
|
|
43
|
+
readonly $events: {
|
|
44
|
+
input: Event;
|
|
45
|
+
change: Event;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
'web-ui-input-number': WebUiInputNumber;
|
|
51
|
+
}
|
|
52
|
+
}
|