solely 0.7.0 → 0.8.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.md +46 -4
- package/dist/compiler/index.d.ts +2 -2
- package/dist/compiler/ir/buildIR.d.ts +1 -1
- package/dist/compiler/ir/index.d.ts +1 -1
- package/dist/compiler/parser/index.d.ts +1 -1
- package/dist/compiler/parser/parser.d.ts +1 -1
- package/dist/components/commands/drawer/index.cjs +1 -1
- package/dist/components/commands/drawer/index.d.ts +1 -1
- package/dist/components/commands/drawer/index.js +1 -1
- package/dist/components/commands/drawer/style.css.cjs +1 -1
- package/dist/components/commands/drawer/style.css.js +1 -1
- package/dist/components/commands/index.d.ts +12 -12
- package/dist/components/commands/message/index.cjs +1 -1
- package/dist/components/commands/message/index.d.ts +1 -1
- package/dist/components/commands/message/index.js +1 -1
- package/dist/components/commands/message/style.css.cjs +1 -1
- package/dist/components/commands/message/style.css.js +1 -1
- package/dist/components/commands/message/types.d.ts +1 -1
- package/dist/components/commands/modal/index.cjs +1 -1
- package/dist/components/commands/modal/index.d.ts +1 -1
- package/dist/components/commands/modal/index.js +1 -1
- package/dist/components/commands/modal/style.css.cjs +1 -1
- package/dist/components/commands/modal/style.css.js +1 -1
- package/dist/components/commands/modal/types.d.ts +8 -3
- package/dist/components/commands/popconfirm/index.cjs +1 -1
- package/dist/components/commands/popconfirm/index.d.ts +1 -1
- package/dist/components/commands/popconfirm/index.js +1 -1
- package/dist/components/commands/popconfirm/style.css.cjs +1 -1
- package/dist/components/commands/popconfirm/style.css.js +1 -1
- package/dist/components/commands/popconfirm/types.d.ts +10 -3
- package/dist/components/commands/tooltip/index.cjs +1 -1
- package/dist/components/commands/tooltip/index.d.ts +1 -1
- package/dist/components/commands/tooltip/index.js +1 -1
- package/dist/components/commands/tooltip/style.css.cjs +1 -1
- package/dist/components/commands/tooltip/style.css.js +1 -1
- package/dist/components/commands/tooltip/types.d.ts +1 -3
- package/dist/components/commands/utils.cjs +1 -1
- package/dist/components/commands/utils.d.ts +11 -0
- package/dist/components/commands/utils.js +1 -1
- package/dist/components/elements/alert/index.cjs +1 -1
- package/dist/components/elements/alert/index.d.ts +68 -6
- package/dist/components/elements/alert/index.html.cjs +1 -1
- package/dist/components/elements/alert/index.html.js +1 -1
- package/dist/components/elements/alert/index.js +1 -1
- package/dist/components/elements/alert/style.css.cjs +1 -1
- package/dist/components/elements/alert/style.css.js +1 -1
- package/dist/components/elements/alert/types.d.ts +5 -1
- package/dist/components/elements/backtop/index.cjs +1 -1
- package/dist/components/elements/backtop/index.d.ts +14 -2
- package/dist/components/elements/backtop/index.html.cjs +1 -1
- package/dist/components/elements/backtop/index.html.js +1 -1
- package/dist/components/elements/backtop/index.js +1 -1
- package/dist/components/elements/backtop/style.css.cjs +1 -1
- package/dist/components/elements/backtop/style.css.js +1 -1
- package/dist/components/elements/badge/index.cjs +1 -1
- package/dist/components/elements/badge/index.d.ts +12 -6
- package/dist/components/elements/badge/index.html.cjs +1 -1
- package/dist/components/elements/badge/index.html.js +1 -1
- package/dist/components/elements/badge/index.js +1 -1
- package/dist/components/elements/badge/types.d.ts +2 -4
- package/dist/components/elements/breadcrumb/index.cjs +1 -1
- package/dist/components/elements/breadcrumb/index.d.ts +13 -3
- package/dist/components/elements/breadcrumb/index.html.cjs +1 -1
- package/dist/components/elements/breadcrumb/index.html.js +1 -1
- package/dist/components/elements/breadcrumb/index.js +1 -1
- package/dist/components/elements/breadcrumb/style.css.cjs +1 -1
- package/dist/components/elements/breadcrumb/style.css.js +1 -1
- package/dist/components/elements/breadcrumb/types.d.ts +2 -0
- package/dist/components/elements/button/index.cjs +1 -1
- package/dist/components/elements/button/index.d.ts +14 -2
- package/dist/components/elements/button/index.html.cjs +1 -1
- package/dist/components/elements/button/index.html.js +1 -1
- package/dist/components/elements/button/index.js +1 -1
- package/dist/components/elements/button/style.css.cjs +1 -1
- package/dist/components/elements/button/style.css.js +1 -1
- package/dist/components/elements/button/types.d.ts +4 -0
- package/dist/components/elements/card/index.cjs +1 -1
- package/dist/components/elements/card/index.d.ts +22 -2
- package/dist/components/elements/card/index.html.cjs +1 -1
- package/dist/components/elements/card/index.html.js +1 -1
- package/dist/components/elements/card/index.js +1 -1
- package/dist/components/elements/card/style.css.cjs +1 -1
- package/dist/components/elements/card/style.css.js +1 -1
- package/dist/components/elements/card/types.d.ts +4 -2
- package/dist/components/elements/checkbox/index.cjs +1 -1
- package/dist/components/elements/checkbox/index.d.ts +56 -3
- package/dist/components/elements/checkbox/index.html.cjs +1 -1
- package/dist/components/elements/checkbox/index.html.js +1 -1
- package/dist/components/elements/checkbox/index.js +1 -1
- package/dist/components/elements/checkbox/style.css.cjs +1 -1
- package/dist/components/elements/checkbox/style.css.js +1 -1
- package/dist/components/elements/checkbox/types.d.ts +10 -0
- package/dist/components/elements/coordinate-input/index.cjs +1 -1
- package/dist/components/elements/coordinate-input/index.d.ts +27 -2
- package/dist/components/elements/coordinate-input/index.html.cjs +1 -1
- package/dist/components/elements/coordinate-input/index.html.js +1 -1
- package/dist/components/elements/coordinate-input/index.js +1 -1
- package/dist/components/elements/coordinate-input/style.css.cjs +1 -1
- package/dist/components/elements/coordinate-input/style.css.js +1 -1
- package/dist/components/elements/coordinate-input/types.d.ts +4 -4
- package/dist/components/elements/divider/index.cjs +1 -1
- package/dist/components/elements/divider/index.d.ts +11 -2
- package/dist/components/elements/divider/index.js +1 -1
- package/dist/components/elements/empty/index.cjs +1 -1
- package/dist/components/elements/empty/index.d.ts +14 -2
- package/dist/components/elements/empty/index.html.cjs +1 -1
- package/dist/components/elements/empty/index.html.js +1 -1
- package/dist/components/elements/empty/index.js +1 -1
- package/dist/components/elements/empty/style.css.cjs +1 -1
- package/dist/components/elements/empty/style.css.js +1 -1
- package/dist/components/elements/empty/types.d.ts +4 -2
- package/dist/components/elements/fab/index.cjs +1 -1
- package/dist/components/elements/fab/index.d.ts +12 -3
- package/dist/components/elements/fab/index.html.cjs +1 -1
- package/dist/components/elements/fab/index.html.js +1 -1
- package/dist/components/elements/fab/index.js +1 -1
- package/dist/components/elements/fab/style.css.cjs +1 -1
- package/dist/components/elements/fab/style.css.js +1 -1
- package/dist/components/elements/icon/index.cjs +1 -1
- package/dist/components/elements/icon/index.d.ts +23 -2
- package/dist/components/elements/icon/index.js +1 -1
- package/dist/components/elements/icon/style.css.cjs +1 -1
- package/dist/components/elements/icon/style.css.js +1 -1
- package/dist/components/elements/index.cjs +1 -1
- package/dist/components/elements/index.d.ts +61 -60
- package/dist/components/elements/index.js +1 -1
- package/dist/components/elements/input/index.cjs +1 -1
- package/dist/components/elements/input/index.d.ts +120 -5
- package/dist/components/elements/input/index.html.cjs +1 -1
- package/dist/components/elements/input/index.html.js +1 -1
- package/dist/components/elements/input/index.js +1 -1
- package/dist/components/elements/input/style.css.cjs +1 -1
- package/dist/components/elements/input/style.css.js +1 -1
- package/dist/components/elements/input/types.d.ts +46 -7
- package/dist/components/elements/not-found/index.cjs +1 -1
- package/dist/components/elements/not-found/index.d.ts +38 -2
- package/dist/components/elements/not-found/index.html.cjs +1 -1
- package/dist/components/elements/not-found/index.html.js +1 -1
- package/dist/components/elements/not-found/index.js +1 -1
- package/dist/components/elements/not-found/style.css.cjs +1 -1
- package/dist/components/elements/not-found/style.css.js +1 -1
- package/dist/components/elements/not-found/types.d.ts +2 -0
- package/dist/components/elements/pagination/index.cjs +1 -1
- package/dist/components/elements/pagination/index.d.ts +52 -7
- package/dist/components/elements/pagination/index.html.cjs +1 -1
- package/dist/components/elements/pagination/index.html.js +1 -1
- package/dist/components/elements/pagination/index.js +1 -1
- package/dist/components/elements/pagination/style.css.cjs +1 -1
- package/dist/components/elements/pagination/style.css.js +1 -1
- package/dist/components/elements/pagination/types.d.ts +1 -1
- package/dist/components/elements/progress/index.cjs +1 -1
- package/dist/components/elements/progress/index.d.ts +16 -7
- package/dist/components/elements/progress/index.html.cjs +1 -1
- package/dist/components/elements/progress/index.html.js +1 -1
- package/dist/components/elements/progress/index.js +1 -1
- package/dist/components/elements/progress/style.css.cjs +1 -1
- package/dist/components/elements/progress/style.css.js +1 -1
- package/dist/components/elements/progress/types.d.ts +4 -2
- package/dist/components/elements/radio/index.cjs +1 -1
- package/dist/components/elements/radio/index.d.ts +82 -3
- package/dist/components/elements/radio/index.html.cjs +1 -1
- package/dist/components/elements/radio/index.html.js +1 -1
- package/dist/components/elements/radio/index.js +1 -1
- package/dist/components/elements/radio/style.css.cjs +1 -1
- package/dist/components/elements/radio/style.css.js +1 -1
- package/dist/components/elements/radio/types.d.ts +6 -0
- package/dist/components/elements/rate/index.cjs +1 -1
- package/dist/components/elements/rate/index.d.ts +75 -3
- package/dist/components/elements/rate/index.html.cjs +1 -1
- package/dist/components/elements/rate/index.html.js +1 -1
- package/dist/components/elements/rate/index.js +1 -1
- package/dist/components/elements/rate/style.css.cjs +1 -1
- package/dist/components/elements/rate/style.css.js +1 -1
- package/dist/components/elements/rate/types.d.ts +2 -0
- package/dist/components/elements/select/index.cjs +1 -1
- package/dist/components/elements/select/index.d.ts +197 -22
- package/dist/components/elements/select/index.html.cjs +1 -1
- package/dist/components/elements/select/index.html.js +1 -1
- package/dist/components/elements/select/index.js +1 -1
- package/dist/components/elements/select/option.cjs +1 -0
- package/dist/components/elements/select/option.d.ts +2 -2
- package/dist/components/elements/select/option.js +1 -0
- package/dist/components/elements/select/style.css.cjs +1 -1
- package/dist/components/elements/select/style.css.js +1 -1
- package/dist/components/elements/select/types.d.ts +42 -6
- package/dist/components/elements/skeleton/index.cjs +1 -1
- package/dist/components/elements/skeleton/index.d.ts +15 -2
- package/dist/components/elements/skeleton/index.html.cjs +1 -1
- package/dist/components/elements/skeleton/index.html.js +1 -1
- package/dist/components/elements/skeleton/index.js +1 -1
- package/dist/components/elements/skeleton/style.css.cjs +1 -1
- package/dist/components/elements/skeleton/style.css.js +1 -1
- package/dist/components/elements/skeleton/types.d.ts +2 -1
- package/dist/components/elements/slider/index.cjs +1 -1
- package/dist/components/elements/slider/index.d.ts +115 -11
- package/dist/components/elements/slider/index.html.cjs +1 -1
- package/dist/components/elements/slider/index.html.js +1 -1
- package/dist/components/elements/slider/index.js +1 -1
- package/dist/components/elements/slider/style.css.cjs +1 -1
- package/dist/components/elements/slider/style.css.js +1 -1
- package/dist/components/elements/slider/types.d.ts +15 -4
- package/dist/components/elements/steps/index.cjs +1 -1
- package/dist/components/elements/steps/index.d.ts +73 -10
- package/dist/components/elements/steps/index.html.cjs +1 -1
- package/dist/components/elements/steps/index.html.js +1 -1
- package/dist/components/elements/steps/index.js +1 -1
- package/dist/components/elements/steps/style.css.cjs +1 -1
- package/dist/components/elements/steps/style.css.js +1 -1
- package/dist/components/elements/steps/types.d.ts +9 -2
- package/dist/components/elements/switch/index.cjs +1 -1
- package/dist/components/elements/switch/index.d.ts +52 -9
- package/dist/components/elements/switch/index.html.cjs +1 -1
- package/dist/components/elements/switch/index.html.js +1 -1
- package/dist/components/elements/switch/index.js +1 -1
- package/dist/components/elements/switch/types.d.ts +12 -0
- package/dist/components/elements/table/index.cjs +1 -1
- package/dist/components/elements/table/index.d.ts +251 -4
- package/dist/components/elements/table/index.html.cjs +1 -1
- package/dist/components/elements/table/index.html.js +1 -1
- package/dist/components/elements/table/index.js +1 -1
- package/dist/components/elements/table/style.css.cjs +1 -1
- package/dist/components/elements/table/style.css.js +1 -1
- package/dist/components/elements/table/types.d.ts +152 -7
- package/dist/components/elements/tabs/index.cjs +1 -1
- package/dist/components/elements/tabs/index.d.ts +47 -4
- package/dist/components/elements/tabs/index.html.cjs +1 -1
- package/dist/components/elements/tabs/index.html.js +1 -1
- package/dist/components/elements/tabs/index.js +1 -1
- package/dist/components/elements/tabs/style.css.cjs +1 -1
- package/dist/components/elements/tabs/style.css.js +1 -1
- package/dist/components/elements/tabs/types.d.ts +10 -0
- package/dist/components/elements/tag/index.cjs +1 -1
- package/dist/components/elements/tag/index.d.ts +11 -3
- package/dist/components/elements/tag/index.html.cjs +1 -1
- package/dist/components/elements/tag/index.html.js +1 -1
- package/dist/components/elements/tag/index.js +1 -1
- package/dist/components/elements/tag/style.css.cjs +1 -1
- package/dist/components/elements/tag/style.css.js +1 -1
- package/dist/components/elements/timeline/index.cjs +1 -1
- package/dist/components/elements/timeline/index.d.ts +8 -2
- package/dist/components/elements/timeline/index.js +1 -1
- package/dist/components/elements/timeline/style.css.cjs +1 -1
- package/dist/components/elements/timeline/style.css.js +1 -1
- package/dist/components/elements/timeline/types.d.ts +0 -1
- package/dist/components/elements/tooltip/index.cjs +1 -1
- package/dist/components/elements/tooltip/index.d.ts +78 -5
- package/dist/components/elements/tooltip/index.html.cjs +1 -1
- package/dist/components/elements/tooltip/index.html.js +1 -1
- package/dist/components/elements/tooltip/index.js +1 -1
- package/dist/components/elements/tooltip/style.css.cjs +1 -1
- package/dist/components/elements/tooltip/style.css.js +1 -1
- package/dist/components/elements/tooltip/types.d.ts +1 -1
- package/dist/components/elements/tree/index.cjs +1 -1
- package/dist/components/elements/tree/index.d.ts +163 -13
- package/dist/components/elements/tree/index.html.cjs +1 -1
- package/dist/components/elements/tree/index.html.js +1 -1
- package/dist/components/elements/tree/index.js +1 -1
- package/dist/components/elements/tree/style.css.cjs +1 -1
- package/dist/components/elements/tree/style.css.js +1 -1
- package/dist/components/elements/tree/types.d.ts +18 -4
- package/dist/components/elements/upload/index.cjs +1 -1
- package/dist/components/elements/upload/index.d.ts +59 -8
- package/dist/components/elements/upload/index.html.cjs +1 -1
- package/dist/components/elements/upload/index.html.js +1 -1
- package/dist/components/elements/upload/index.js +1 -1
- package/dist/components/elements/upload/style.css.cjs +1 -1
- package/dist/components/elements/upload/style.css.js +1 -1
- package/dist/components/elements/upload/types.d.ts +89 -5
- package/dist/components/elements/utils/helpers.cjs +1 -1
- package/dist/components/elements/utils/helpers.d.ts +10 -0
- package/dist/components/elements/utils/helpers.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +3 -21
- package/dist/components/index.js +1 -1
- package/dist/components/theme/auto-inject.cjs +1 -0
- package/dist/components/theme/auto-inject.d.ts +23 -0
- package/dist/components/theme/auto-inject.js +1 -0
- package/dist/components/theme/index.cjs +1 -1
- package/dist/components/theme/index.d.ts +7 -1
- package/dist/components/theme/index.js +1 -1
- package/dist/components/theme/variables.css +25 -0
- package/dist/components/theme/variables.css.cjs +1 -0
- package/dist/components/theme/variables.css.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/solely-vite-plugin.d.ts +1 -1
- package/dist/router/core.cjs +1 -1
- package/dist/router/core.d.ts +31 -1
- package/dist/router/core.js +1 -1
- package/dist/router/index.d.ts +4 -4
- package/dist/router/router-link.d.ts +1 -1
- package/dist/router/router-view.cjs +1 -1
- package/dist/router/router-view.d.ts +12 -2
- package/dist/router/router-view.js +1 -1
- package/dist/router/types.d.ts +3 -1
- package/dist/runtime/component/base-element.cjs +1 -1
- package/dist/runtime/component/base-element.d.ts +7 -0
- package/dist/runtime/component/base-element.js +1 -1
- package/dist/runtime/component/decorators.d.ts +7 -2
- package/dist/runtime/component/index.d.ts +2 -2
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/reactivity/computed.d.ts +1 -1
- package/dist/runtime/reactivity/index.d.ts +6 -6
- package/dist/runtime/reactivity/watch.d.ts +1 -1
- package/dist/runtime/renderer/index.d.ts +2 -2
- package/dist/runtime/renderer/renderIR.cjs +1 -1
- package/dist/runtime/renderer/renderIR.d.ts +1 -1
- package/dist/runtime/renderer/renderIR.js +1 -1
- package/dist/shared/aria.cjs +1 -0
- package/dist/shared/aria.d.ts +67 -0
- package/dist/shared/aria.js +1 -0
- package/dist/shared/boolean.cjs +1 -0
- package/dist/shared/boolean.d.ts +9 -0
- package/dist/shared/boolean.js +1 -0
- package/dist/shared/enum.cjs +1 -0
- package/dist/shared/enum.d.ts +10 -0
- package/dist/shared/enum.js +1 -0
- package/dist/shared/env.cjs +1 -1
- package/dist/shared/env.js +1 -1
- package/dist/shared/floating/overlay-stack.cjs +1 -0
- package/dist/shared/floating/overlay-stack.d.ts +56 -0
- package/dist/shared/floating/overlay-stack.js +1 -0
- package/dist/shared/floating/position.cjs +1 -0
- package/dist/shared/floating/position.d.ts +32 -0
- package/dist/shared/floating/position.js +1 -0
- package/dist/shared/floating/types.d.ts +112 -0
- package/dist/shared/form-associated.cjs +1 -0
- package/dist/shared/form-associated.d.ts +253 -0
- package/dist/shared/form-associated.js +1 -0
- package/dist/shared/gen-function.d.ts +1 -1
- package/dist/shared/icons.cjs +1 -0
- package/dist/shared/icons.d.ts +31 -0
- package/dist/shared/icons.js +1 -0
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/index.d.ts +11 -9
- package/dist/shared/index.js +1 -1
- package/dist/shared/size.cjs +1 -0
- package/dist/shared/size.d.ts +17 -0
- package/dist/shared/size.js +1 -0
- package/dist/shared/templateError.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/ir.d.ts +1 -1
- package/package.json +27 -11
- package/dist/solely.svg +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import a from"../../../runtime/component/base-element.js";import{CustomElement as s}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let r=class extends a{_filteredSuggestions=[];inputElement;searchDebounceTimer;get filteredSuggestions(){return this._filteredSuggestions}mounted(){this.refresh(),this.inputElement=this.shadowRoot?.querySelector("input, textarea"),this.$data.autofocus&&this.focus()}unmounted(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=void 0)}hasPrefixSlot(){return null!==this.querySelector('[slot="prefix"]')}hasSuffixSlot(){return null!==this.querySelector('[slot="suffix"]')}getWrapperClasses(){const e={};return"small"===this.$data.size?e["form-control--sm"]=!0:"large"===this.$data.size&&(e["form-control--lg"]=!0),"error"===this.$data.status?e["is-error"]=!0:"warning"===this.$data.status?e["is-warning"]=!0:"success"===this.$data.status&&(e["is-success"]=!0),"textarea"===this.$data.type&&(e["form-control--textarea"]=!0),e["is-focused"]=!!this.$data.focused,e["is-disabled"]=!!this.$data.disabled,e["is-readonly"]=!!this.$data.readonly,e["form-control--block"]=!!this.$data.block,e}getCharCount(){return this.$data.value?.length||0}formatValue(e){if(!e)return"";switch(this.$data.format){case"phone":return e.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3").trim();case"bankcard":return e.replace(/(\d{4})(?=\d)/g,"$1 ").trim();case"idcard":return e.replace(/(\d{6})(\d{4})(\d{4})(\d{4})(\d{0,4})/,"$1 $2 $3 $4 $5").trim();default:return e}}unformatValue(e){return e?e.replace(/\s/g,""):""}handleInput(e){const t=e.target;let a=t.value;if("none"!==this.$data.format&&"textarea"!==this.$data.type){const e=this.unformatValue(a),s=this.formatValue(e);s!==a&&(t.value=s,a=s)}this.$data.value=a,this.$data.suggestions&&this.$data.suggestions.length>0&&this.updateSuggestions(a)}handleFocus(e){this.$data.focused=!0,this.$data.selectall&&this.$data.value&&this.select()}handleBlur(e){this.$data.focused=!1}handleChange(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}handleKeydown(e){"Enter"===e.key&&"search"===this.$data.type&&this.emit("search",{value:this.$data.value})}handleClear(){this.$data.value="",this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.focus()}togglePassword(){this.$data.passwordVisible=!this.$data.passwordVisible}async handleCopy(){try{const e=this.unformatValue(this.$data.value);await navigator.clipboard.writeText(e),this.emit("copy",{value:e})}catch(e){this.emit("copy-error",{error:e})}}updateSuggestions(e){this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(()=>{this._updateSuggestionsImpl(e),this.searchDebounceTimer=void 0},300)}_updateSuggestionsImpl(e){if(!e||!this.$data.suggestions)return this._filteredSuggestions=[],void this.refresh();this._filteredSuggestions=this.$data.suggestions.filter(t=>t.toLowerCase().includes(e.toLowerCase())),this.refresh()}selectSuggestion(e){this.$data.value=e,this._filteredSuggestions=[],this.refresh(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.focus(),this.$data.focused=!0}blur(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.blur(),this.$data.focused=!1}setValue(e){this.$data.value=e}getValue(){return this.unformatValue(this.$data.value)}get value(){return this.getValue()}set value(e){this.setValue(e)}select(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.select()}};r=((e,t)=>{for(var a,s=t,r=e.length-1;r>=0;r--)(a=e[r])&&(s=a(s)||s);return s})([s({tagName:"solely-input",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"text"},{name:"size",type:"string",default:"medium"},{name:"value",type:"string",default:""},{name:"placeholder",type:"string",default:""},{name:"disabled",type:"boolean",default:!1},{name:"readonly",type:"boolean",default:!1},{name:"required",type:"boolean",default:!1},{name:"maxlength",type:"number"},{name:"minlength",type:"number"},{name:"clearable",type:"boolean",default:!1},{name:"showpassword",type:"boolean",default:!1},{name:"passwordVisible",type:"boolean",default:!1},{name:"focused",type:"boolean",default:!1},{name:"prefix",type:"string",default:""},{name:"suffix",type:"string",default:""},{name:"status",type:"string",default:""},{name:"message",type:"string",default:""},{name:"showcount",type:"boolean",default:!1},{name:"rows",type:"number",default:3},{name:"autofocus",type:"boolean",default:!1},{name:"selectall",type:"boolean",default:!1},{name:"copyable",type:"boolean",default:!1},{name:"format",type:"string",default:"none"},{name:"suggestions",type:"array",default:[]},{name:"block",type:"boolean",default:!1}]})],r);export{r as SolelyInput};
|
|
1
|
+
import{normalizeSize as e}from"../../../shared/size.js";import{parseBooleanAttribute as t}from"../../../shared/boolean.js";import{oneOf as a}from"../../../shared/enum.js";import{initFormAssociation as s,handleFormAssociatedCallback as i,handleFormResetCallback as r,handleFormDisabledCallback as o,formValidity as l,formValidationMessage as n,effectiveDisabled as u,checkFormValidity as h,reportFormValidity as d,setCustomValidity as c,syncFormValue as m,syncValidity as f,syncAria as g,emitChange as p,setFormDefault as y}from"../../../shared/form-associated.js";import b from"./style.css.js";import{__SOLELY_IR__ as $}from"./index.html.js";import v from"../../../runtime/component/base-element.js";import{CustomElement as w}from"../../../runtime/component/decorators.js";var V=Object.defineProperty;Object.getOwnPropertyDescriptor;let S=0;const C=["error","warning","success",""];let x=class extends v{get size(){return e(this.$data.size)}set size(t){this.$data.size=e(t)}get showpassword(){return!!this.$data.showPassword}set showpassword(e){this.$data.showPassword=!!e}get showcount(){return!!this.$data.showCount}set showcount(e){this.$data.showCount=!!e}get selectall(){return!!this.$data.selectAll}set selectall(e){this.$data.selectAll=!!e}_filteredSuggestions=[];inputElement;searchDebounceTimer;valueBeforeChange;_messageId="solely-input-message-"+ ++S;created(){s(this,{family:"scalar",read:()=>this.getValue(),write:(e,t)=>this.setValue(String(e),!0),encode:e=>[String(e)],name:()=>this.formFieldName(),disabled:()=>!!this.$data.disabled,required:()=>!!this.$data.required,ariaTarget:()=>this.getNativeControl(),tabTargets:()=>this.getNativeControl(),anchors:()=>{const e=this.getNativeControl();return e?[e]:null},validate:e=>this.validateValue(String(e)),invalidMessage:()=>this.$data.invalidMessage||"",messageContext:()=>this.buildMessageContext(),hasVisualError:()=>"error"===this.getStatus(),readDefault:()=>this.readExplicitDefaultValue(),changeDetail:(e,t,a)=>({name:this.formFieldName(),value:e,previousValue:t,source:a})})}formAssociatedCallback(){i(this)}formResetCallback(){r(this)}formDisabledCallback(e){o(this,e)}get validity(){return l(this)}get validationMessage(){return n(this)}get willValidate(){return!u(this)&&!this.$data.readonly}checkValidity(){return h(this)}reportValidity(){return d(this)}setCustomValidity(e){c(this,e)}syncFormState(){m(this),f(this),g(this)}getNativeControl(){return this.inputElement?.isConnected?this.inputElement:this.shadowRoot?.querySelector("input, textarea")??null}readExplicitDefaultValue(){const e=this.getAttribute("default-value");if(null!==e)return e;const t=this.$data.defaultValue;return"string"==typeof t&&""!==t?t:void 0}formFieldName(){return this.$data.name||this.getAttribute("name")||""}validateValue(e){if(this.$data.readonly)return null;const t={},a=Number(this.$data.minlength),s=Number(this.$data.maxlength);this.$data.required&&""===e?t.valueMissing=!0:(a>0&&e.length<a&&(t.tooShort=!0),s>0&&e.length>s&&(t.tooLong=!0));const i=this.getNativeControl()?.validity;return i&&(i.typeMismatch&&(t.typeMismatch=!0),i.patternMismatch&&(t.patternMismatch=!0),i.badInput&&(t.badInput=!0)),Object.values(t).some(Boolean)?{flags:t,anchor:this.getNativeControl()??void 0}:null}buildMessageContext(){const e={type:this.$data.type},t=Number(this.$data.minlength),a=Number(this.$data.maxlength);return t>0&&(e.minlength=t),a>0&&(e.maxlength=a),e}get filteredSuggestions(){return this._filteredSuggestions}mounted(){this.refresh(),this.inputElement=this.shadowRoot?.querySelector("input, textarea"),this.$data.autofocus&&this.focus(),this.syncNativeAttributes(),this.adjustAutosize()}unmounted(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=void 0)}updated(){this.syncNativeAttributes(),this.syncFormState(),this.adjustAutosize()}getMessageId(){return this.$data.message?this._messageId:void 0}getGroupClasses(){const e={};return this.$data.addonBefore&&(e["form-control-group--addon-before"]=!0),this.$data.addonAfter&&(e["form-control-group--addon-after"]=!0),e}syncNativeAttributes(){const e=this.getNativeControl();if(!e)return;const t=[["autocomplete",this.$data.autocomplete],["inputmode",this.$data.inputmode],["enterkeyhint",this.$data.enterkeyhint]];for(const[i,r]of t)""===r||null==r?e.removeAttribute(i):e.setAttribute(i,r);const a=this.$data.spellcheck;""===a||null==a?e.hasAttribute("spellcheck")&&e.removeAttribute("spellcheck"):e.setAttribute("spellcheck","false"===a?"false":"true");const s=[["min",this.$data.min],["max",this.$data.max],["step",this.$data.step]];for(const[i,r]of s)"number"==typeof r&&Number.isFinite(r)?e.setAttribute(i,String(r)):e.removeAttribute(i)}adjustAutosize(){if(!this.$data.autosize||"textarea"!==this.$data.type)return;const e=this.getNativeControl();if(!e||"TEXTAREA"!==e.tagName)return;const t=e;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}hasPrefixSlot(){return null!==this.querySelector('[slot="prefix"]')}hasSuffixSlot(){return null!==this.querySelector('[slot="suffix"]')}isEffectivelyDisabled(){return u(this)}hasActions(){const e=this.isEffectivelyDisabled(),t=!!this.$data.value,a="password"===this.$data.type&&!!this.$data.showPassword,s=!!this.$data.copyable&&t&&!e,i=!!this.$data.clearable&&t&&!this.$data.readonly&&!e;return a||s||i}getStatus(){return a(this.$data.status,C,"")}getWrapperClasses(){const e={};"small"===this.$data.size?e["form-control--sm"]=!0:"large"===this.$data.size&&(e["form-control--lg"]=!0);const t=this.getStatus();return"error"===t?e["is-error"]=!0:"warning"===t?e["is-warning"]=!0:"success"===t&&(e["is-success"]=!0),"textarea"===this.$data.type&&(e["form-control--textarea"]=!0),this.$data.autosize&&"textarea"===this.$data.type&&(e["form-control--autosize"]=!0),e["is-focused"]=!!this.$data.focused,e["is-disabled"]=this.isEffectivelyDisabled(),e["is-readonly"]=!!this.$data.readonly,e["form-control--block"]=!!this.$data.block,e}getCharCount(){return this.$data.value?.length||0}formatValue(e){if(!e)return"";switch(this.$data.format){case"phone":return e.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3").trim();case"bankcard":return e.replace(/(\d{4})(?=\d)/g,"$1 ").trim();case"idcard":return e.replace(/(\d{6})(\d{4})(\d{4})(\d{4})(\d{0,4})/,"$1 $2 $3 $4 $5").trim();default:return e}}unformatValue(e){return e?e.replace(/\s/g,""):""}handleInput(e){const t=e.target;let a=t.value;if("none"!==this.$data.format&&"textarea"!==this.$data.type){const e=this.unformatValue(a),s=this.formatValue(e);s!==a&&(t.value=s,a=s)}this.$data.value=a,this.syncFormState(),this.$data.suggestions&&this.$data.suggestions.length>0&&this.updateSuggestions(a)}handleFocus(e){this.$data.focused=!0,this.valueBeforeChange=this.getValue(),this.$data.selectAll&&this.$data.value&&this.select()}handleBlur(e){this.$data.focused=!1}handleChange(e){e.stopPropagation();const t=this.getValue(),a=this.valueBeforeChange??t;this.valueBeforeChange=t,p(this,{name:this.formFieldName(),value:t,previousValue:a,source:"user"})}handleKeydown(e){"Enter"===e.key&&(this.emit("press-enter",{value:this.$data.value}),"search"===this.$data.type&&this.emit("search",{value:this.$data.value}))}handleActionKeydown(e,t){"Enter"!==e.key&&" "!==e.key||this.isEffectivelyDisabled()||(e.preventDefault(),"clear"===t?this.handleClear():"password"===t?this.togglePassword():this.handleCopy())}handleSuggestionKeydown(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectSuggestion(t))}handleClear(){this.isEffectivelyDisabled()||this.$data.readonly||(this.$data.value="",this.syncFormState(),this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.focus())}togglePassword(){this.isEffectivelyDisabled()||(this.$data.passwordVisible=!this.$data.passwordVisible)}async handleCopy(){if(!this.isEffectivelyDisabled())try{const e=this.unformatValue(this.$data.value);await navigator.clipboard.writeText(e),this.emit("copy",{value:e})}catch(e){this.emit("copy-error",{error:e})}}updateSuggestions(e){this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(()=>{this._updateSuggestionsImpl(e),this.searchDebounceTimer=void 0},300)}_updateSuggestionsImpl(e){if(!e||!this.$data.suggestions)return this._filteredSuggestions=[],void this.refresh();this._filteredSuggestions=this.$data.suggestions.filter(t=>t.toLowerCase().includes(e.toLowerCase())),this.refresh()}selectSuggestion(e){if(this.isEffectivelyDisabled())return;const t=this.getValue();this.$data.value=e,this._filteredSuggestions=[],this.syncFormState(),this.refresh(),p(this,{name:this.formFieldName(),value:this.getValue(),previousValue:t,source:"user"})}focus(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.focus(),this.$data.focused=!0}blur(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.blur(),this.$data.focused=!1}setValue(e,t=!1){const a=this.getValue();this.$data.value=e,this.syncFormState(),t||p(this,{name:this.formFieldName(),value:this.getValue(),previousValue:a,source:"api"})}getValue(){return this.unformatValue(this.$data.value)}get value(){return this.getValue()}set value(e){this.setValue(e,!0)}get defaultValue(){return this.$data.defaultValue}set defaultValue(e){this.$data.defaultValue=e,this.isSyncingProps||y(this,e||"")}readBooleanAlias(...e){return e.some(e=>t(this.getAttribute(e)))}attributeChanged(e,t,a){switch(e){case"show-password":case"showpassword":this.$data.showPassword=this.readBooleanAlias("show-password","showpassword");break;case"show-count":case"showcount":this.$data.showCount=this.readBooleanAlias("show-count","showcount");break;case"select-all":case"selectall":this.$data.selectAll=this.readBooleanAlias("select-all","selectall");break;case"default-value":y(this,this.$data.defaultValue||"")}}select(){const e=this.inputElement||this.shadowRoot?.querySelector("input, textarea");e?.select()}};var A,D,E;E=!0,(D="formAssociated")in(A=x)?V(A,D,{enumerable:!0,configurable:!0,writable:!0,value:E}):A[D]=E,x=((e,t)=>{for(var a,s=t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([w({tagName:"solely-input",template:$,styles:b,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"text"},{name:"size",type:"string",default:"medium"},{name:"ariaLabel",type:"string",default:""},{name:"name",type:"string",default:""},{name:"value",type:"string",default:""},{name:"defaultValue",type:"string",default:""},{name:"placeholder",type:"string",default:""},{name:"disabled",type:"boolean",default:!1,reflect:!0},{name:"readonly",type:"boolean",default:!1,reflect:!0},{name:"required",type:"boolean",default:!1,reflect:!0},{name:"invalidMessage",type:"string",default:""},{name:"maxlength",type:"number"},{name:"minlength",type:"number"},{name:"clearable",type:"boolean",default:!1},{name:"showPassword",type:"boolean",default:!1},{name:"showpassword",type:"boolean"},{name:"prefix",type:"string",default:""},{name:"suffix",type:"string",default:""},{name:"status",type:"string",default:""},{name:"message",type:"string",default:""},{name:"showCount",type:"boolean",default:!1},{name:"showcount",type:"boolean"},{name:"rows",type:"number",default:3},{name:"autofocus",type:"boolean",default:!1},{name:"selectAll",type:"boolean",default:!1},{name:"selectall",type:"boolean"},{name:"copyable",type:"boolean",default:!1},{name:"format",type:"string",default:"none"},{name:"suggestions",type:"array",default:[]},{name:"block",type:"boolean",default:!1},{name:"addonBefore",type:"string",default:""},{name:"addonAfter",type:"string",default:""},{name:"autosize",type:"boolean",default:!1},{name:"autocomplete",type:"string",default:""},{name:"inputmode",type:"string",default:""},{name:"enterkeyhint",type:"string",default:""},{name:"spellcheck",type:"string",default:""},{name:"min",type:"number"},{name:"max",type:"number"},{name:"step",type:"number"}]})],x);export{x as SolelyInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled):not(.is-error):not(.is-warning):not(.is-success){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1;width:100%;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:var(--solely-focus-ring);border-color:var(--solely-primary)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:var(--solely-focus-ring-error);border-color:var(--solely-error)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:var(--solely-focus-ring-warning);border-color:var(--solely-warning)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:var(--solely-focus-ring-success);border-color:var(--solely-success)}.form-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;width:var(--solely-input-width, 220px);max-width:100%}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;flex-wrap:nowrap;width:100%;min-width:0;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled):not(.is-error):not(.is-warning):not(.is-success){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1 1 0;width:100%;min-width:0;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:var(--solely-focus-ring);border-color:var(--solely-primary)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:var(--solely-focus-ring-error);border-color:var(--solely-error)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:var(--solely-focus-ring-warning);border-color:var(--solely-warning)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:var(--solely-focus-ring-success);border-color:var(--solely-success)}.form-control__actions{display:inline-flex;align-items:center;gap:var(--solely-spacing-xs);margin-left:var(--solely-spacing-xs);flex-shrink:0}.form-control__action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;flex-shrink:0;line-height:1;color:var(--solely-text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;transition:color var(--solely-transition-duration)}.form-control__action:hover{color:var(--solely-text-secondary)}.form-control__action:focus-visible,.form-control__action:active{color:var(--solely-primary)}.form-control__action-icon{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.form-control__count{display:inline-flex;align-items:center;margin-left:var(--solely-spacing-xs);flex-shrink:0;white-space:nowrap;font-size:var(--solely-font-size-sm);color:var(--solely-text-tertiary);gap:2px}.form-control__count--block{display:flex;justify-content:flex-end;margin-top:var(--solely-spacing-xs);margin-left:0}.form-control__count-current{color:var(--solely-text-secondary)}.form-control__count-separator,.form-control__count-max{color:var(--solely-text-tertiary)}.form-control__message{margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);line-height:var(--solely-line-height-md)}.form-control__message--error{color:var(--solely-error)}.form-control__message--warning{color:var(--solely-warning)}.form-control__message--success{color:var(--solely-success)}.form-control__message--default{color:var(--solely-text-tertiary)}.form-control--block{display:flex;width:100%}.dropdown{position:absolute;top:100%;left:0;right:0;margin-top:4px;padding:var(--solely-spacing-xs) 0;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown);max-height:200px;overflow-y:auto}.dropdown__item{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:background-color var(--solely-transition-duration)}.dropdown__item:hover{background-color:var(--solely-gray-3)}.form-control__prefix,.form-control__suffix{display:inline-flex;align-items:center;color:var(--solely-text-tertiary);flex-shrink:0}.form-control__prefix{margin-right:var(--solely-spacing-xs)}.form-control__suffix{margin-left:var(--solely-spacing-xs)}.form-control__prefix ::slotted(*),.form-control__suffix ::slotted(*){display:inline-flex;align-items:center}.form-control-group{display:inline-flex;align-items:stretch;width:100%;max-width:100%}:host([block]) .form-control-group{display:flex;width:100%}.form-control-group .form-control{flex:1 1 auto;width:auto;min-width:0}.form-control__addon{display:inline-flex;align-items:center;padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);color:var(--solely-text-secondary);background-color:var(--solely-gray-2);border:1px solid var(--solely-border-color);white-space:nowrap;flex-shrink:0}.form-control__addon--before{border-right:none;border-radius:var(--solely-border-radius-md) 0 0 var(--solely-border-radius-md)}.form-control__addon--after{border-left:none;border-radius:0 var(--solely-border-radius-md) var(--solely-border-radius-md) 0}.form-control-group--addon-before .form-control{border-top-left-radius:0;border-bottom-left-radius:0}.form-control-group--addon-after .form-control{border-top-right-radius:0;border-bottom-right-radius:0}.form-control--autosize .form-control__textarea{resize:none;overflow:hidden}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled):not(.is-error):not(.is-warning):not(.is-success){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1;width:100%;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:var(--solely-focus-ring);border-color:var(--solely-primary)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:var(--solely-focus-ring-error);border-color:var(--solely-error)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:var(--solely-focus-ring-warning);border-color:var(--solely-warning)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:var(--solely-focus-ring-success);border-color:var(--solely-success)}.form-
|
|
1
|
+
const o="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block;width:var(--solely-input-width, 220px);max-width:100%}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;flex-wrap:nowrap;width:100%;min-width:0;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled):not(.is-error):not(.is-warning):not(.is-success){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1 1 0;width:100%;min-width:0;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:var(--solely-focus-ring);border-color:var(--solely-primary)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:var(--solely-focus-ring-error);border-color:var(--solely-error)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:var(--solely-focus-ring-warning);border-color:var(--solely-warning)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:var(--solely-focus-ring-success);border-color:var(--solely-success)}.form-control__actions{display:inline-flex;align-items:center;gap:var(--solely-spacing-xs);margin-left:var(--solely-spacing-xs);flex-shrink:0}.form-control__action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;flex-shrink:0;line-height:1;color:var(--solely-text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;transition:color var(--solely-transition-duration)}.form-control__action:hover{color:var(--solely-text-secondary)}.form-control__action:focus-visible,.form-control__action:active{color:var(--solely-primary)}.form-control__action-icon{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.form-control__count{display:inline-flex;align-items:center;margin-left:var(--solely-spacing-xs);flex-shrink:0;white-space:nowrap;font-size:var(--solely-font-size-sm);color:var(--solely-text-tertiary);gap:2px}.form-control__count--block{display:flex;justify-content:flex-end;margin-top:var(--solely-spacing-xs);margin-left:0}.form-control__count-current{color:var(--solely-text-secondary)}.form-control__count-separator,.form-control__count-max{color:var(--solely-text-tertiary)}.form-control__message{margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);line-height:var(--solely-line-height-md)}.form-control__message--error{color:var(--solely-error)}.form-control__message--warning{color:var(--solely-warning)}.form-control__message--success{color:var(--solely-success)}.form-control__message--default{color:var(--solely-text-tertiary)}.form-control--block{display:flex;width:100%}.dropdown{position:absolute;top:100%;left:0;right:0;margin-top:4px;padding:var(--solely-spacing-xs) 0;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown);max-height:200px;overflow-y:auto}.dropdown__item{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:background-color var(--solely-transition-duration)}.dropdown__item:hover{background-color:var(--solely-gray-3)}.form-control__prefix,.form-control__suffix{display:inline-flex;align-items:center;color:var(--solely-text-tertiary);flex-shrink:0}.form-control__prefix{margin-right:var(--solely-spacing-xs)}.form-control__suffix{margin-left:var(--solely-spacing-xs)}.form-control__prefix ::slotted(*),.form-control__suffix ::slotted(*){display:inline-flex;align-items:center}.form-control-group{display:inline-flex;align-items:stretch;width:100%;max-width:100%}:host([block]) .form-control-group{display:flex;width:100%}.form-control-group .form-control{flex:1 1 auto;width:auto;min-width:0}.form-control__addon{display:inline-flex;align-items:center;padding:0 var(--solely-spacing-md);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);color:var(--solely-text-secondary);background-color:var(--solely-gray-2);border:1px solid var(--solely-border-color);white-space:nowrap;flex-shrink:0}.form-control__addon--before{border-right:none;border-radius:var(--solely-border-radius-md) 0 0 var(--solely-border-radius-md)}.form-control__addon--after{border-left:none;border-radius:0 var(--solely-border-radius-md) var(--solely-border-radius-md) 0}.form-control-group--addon-before .form-control{border-top-left-radius:0;border-bottom-left-radius:0}.form-control-group--addon-after .form-control{border-top-right-radius:0;border-bottom-right-radius:0}.form-control--autosize .form-control__textarea{resize:none;overflow:hidden}";export{o as default};
|
|
@@ -7,10 +7,16 @@ export type InputStatus = 'error' | 'warning' | 'success' | '';
|
|
|
7
7
|
export interface InputProps {
|
|
8
8
|
/** 输入框类型 */
|
|
9
9
|
type: InputType;
|
|
10
|
+
/** 无障碍名称(原生 input 没有关联 label 时使用) */
|
|
11
|
+
ariaLabel?: string;
|
|
10
12
|
/** 输入框尺寸 */
|
|
11
13
|
size: InputSize;
|
|
14
|
+
/** 表单字段名 */
|
|
15
|
+
name: string;
|
|
12
16
|
/** 输入框值 */
|
|
13
17
|
value: string;
|
|
18
|
+
/** 表单重置时写回的值 */
|
|
19
|
+
defaultValue: string;
|
|
14
20
|
/** 占位符 */
|
|
15
21
|
placeholder: string;
|
|
16
22
|
/** 是否禁用 */
|
|
@@ -19,6 +25,8 @@ export interface InputProps {
|
|
|
19
25
|
readonly: boolean;
|
|
20
26
|
/** 是否必填 */
|
|
21
27
|
required: boolean;
|
|
28
|
+
/** 自定义校验消息 */
|
|
29
|
+
invalidMessage: string;
|
|
22
30
|
/** 最大长度 */
|
|
23
31
|
maxlength: number;
|
|
24
32
|
/** 最小长度 */
|
|
@@ -26,11 +34,9 @@ export interface InputProps {
|
|
|
26
34
|
/** 是否显示清除按钮 */
|
|
27
35
|
clearable: boolean;
|
|
28
36
|
/** 是否显示密码切换 */
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/** 是否聚焦 */
|
|
33
|
-
focused: boolean;
|
|
37
|
+
showPassword: boolean;
|
|
38
|
+
/** @deprecated 旧属性名,请使用 showPassword(对应 show-password) */
|
|
39
|
+
showpassword?: boolean;
|
|
34
40
|
/** 前缀图标 */
|
|
35
41
|
prefix: string;
|
|
36
42
|
/** 后缀图标 */
|
|
@@ -40,13 +46,17 @@ export interface InputProps {
|
|
|
40
46
|
/** 状态提示信息 */
|
|
41
47
|
message: string;
|
|
42
48
|
/** 是否显示字数统计 */
|
|
43
|
-
|
|
49
|
+
showCount: boolean;
|
|
50
|
+
/** @deprecated 旧属性名,请使用 showCount(对应 show-count) */
|
|
51
|
+
showcount?: boolean;
|
|
44
52
|
/** 文本域行数 */
|
|
45
53
|
rows: number;
|
|
46
54
|
/** 是否自动聚焦 */
|
|
47
55
|
autofocus: boolean;
|
|
48
56
|
/** 聚焦时是否全选 */
|
|
49
|
-
|
|
57
|
+
selectAll: boolean;
|
|
58
|
+
/** @deprecated 旧属性名,请使用 selectAll(对应 select-all) */
|
|
59
|
+
selectall?: boolean;
|
|
50
60
|
/** 是否显示复制按钮 */
|
|
51
61
|
copyable: boolean;
|
|
52
62
|
/** 输入格式化类型 */
|
|
@@ -55,6 +65,35 @@ export interface InputProps {
|
|
|
55
65
|
suggestions: string[];
|
|
56
66
|
/** 是否块级显示 */
|
|
57
67
|
block: boolean;
|
|
68
|
+
/** 输入框前置附加内容(与输入框合体的文本标签) */
|
|
69
|
+
addonBefore: string;
|
|
70
|
+
/** 输入框后置附加内容(与输入框合体的文本标签) */
|
|
71
|
+
addonAfter: string;
|
|
72
|
+
/** textarea 是否随内容自动增高 */
|
|
73
|
+
autosize: boolean;
|
|
74
|
+
/** autocomplete 透传(on / off / 具体 token) */
|
|
75
|
+
autocomplete: string;
|
|
76
|
+
/** inputmode 透传(none / text / numeric / decimal / tel / search / email / url) */
|
|
77
|
+
inputmode: string;
|
|
78
|
+
/** enterkeyhint 透传 */
|
|
79
|
+
enterkeyhint: string;
|
|
80
|
+
/** spellcheck 透传,字符串 'true' / 'false'(未设置时不输出该属性) */
|
|
81
|
+
spellcheck: string;
|
|
82
|
+
/** number 类型的最小值 */
|
|
83
|
+
min: number;
|
|
84
|
+
/** number 类型的最大值 */
|
|
85
|
+
max: number;
|
|
86
|
+
/** number 类型的步进 */
|
|
87
|
+
step: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Input 组件内部状态(不暴露为公共 attribute,仅用于渲染)
|
|
91
|
+
*/
|
|
92
|
+
export interface InputInternalState {
|
|
93
|
+
/** 密码是否可见(内部状态) */
|
|
94
|
+
passwordVisible: boolean;
|
|
95
|
+
/** 是否聚焦(内部状态) */
|
|
96
|
+
focused: boolean;
|
|
58
97
|
}
|
|
59
98
|
/**
|
|
60
99
|
* Input 组件 Refs 接口
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),n=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyNotFound=class extends n.default{prefersChinese(){if("undefined"==typeof document)return!0;const e=(this.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||"").toLowerCase();return""===e||e.startsWith("zh")}getDefaultSubtitleText(){return this.prefersChinese()?"抱歉,您访问的页面不存在":"Sorry, the page you requested does not exist"}getDefaultDescriptionText(){return this.prefersChinese()?"请检查网址是否正确,或点击下方按钮返回首页":"Please check the URL, or click the button below to go back home"}getDefaultBackText(){return this.prefersChinese()?"返回首页":"Back to Home"}getTitleText(){return this.$data.title||"404"}getSubtitleText(){return this.$data.subtitle||this.getDefaultSubtitleText()}getDescriptionText(){return this.$data.description||this.getDefaultDescriptionText()}getBackText(){return this.$data.backText||this.getDefaultBackText()}handleBack(){if("undefined"==typeof window)return;const e=this.$data.backUrl||"/";if(!this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return;const t=window.__SOLELY_ROUTER__;t&&"function"==typeof t.push?t.push(e):window.location.href=e}},exports.SolelyNotFound=((e,t)=>{for(var n,r=t,o=e.length-1;o>=0;o--)(n=e[o])&&(r=n(r)||r);return r})([r.CustomElement({tagName:"solely-not-found",template:t.__SOLELY_IR__,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"title",type:"string",default:"404"},{name:"subtitle",type:"string",default:e=>e.getDefaultSubtitleText()},{name:"description",type:"string",default:e=>e.getDefaultDescriptionText()},{name:"backText",type:"string",default:e=>e.getDefaultBackText()},{name:"backUrl",type:"string",default:"/"},{name:"embedded",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!0}]})],exports.SolelyNotFound);
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
import { BaseElement } from '../../../runtime/component';
|
|
2
|
-
import { NotFoundProps } from './types';
|
|
1
|
+
import { BaseElement } from '../../../runtime/component/index.js';
|
|
2
|
+
import { NotFoundProps } from './types.js';
|
|
3
3
|
declare class SolelyNotFound extends BaseElement<NotFoundProps> {
|
|
4
|
+
/**
|
|
5
|
+
* 是否使用中文默认文案:
|
|
6
|
+
* 优先取最近的 [lang] 祖先,其次取文档根节点 lang;未声明语言时沿用中文
|
|
7
|
+
*/
|
|
8
|
+
private prefersChinese;
|
|
9
|
+
/**
|
|
10
|
+
* 语言相关的默认副标题(不读取当前 prop 值,供 manifest default 工厂与渲染复用)
|
|
11
|
+
*/
|
|
12
|
+
getDefaultSubtitleText(): string;
|
|
13
|
+
/**
|
|
14
|
+
* 语言相关的默认描述文字(不读取当前 prop 值)
|
|
15
|
+
*/
|
|
16
|
+
getDefaultDescriptionText(): string;
|
|
17
|
+
/**
|
|
18
|
+
* 语言相关的默认返回按钮文字(不读取当前 prop 值)
|
|
19
|
+
*/
|
|
20
|
+
getDefaultBackText(): string;
|
|
21
|
+
/**
|
|
22
|
+
* 标题(清空 title 时回退到 404,避免标题区整体消失)
|
|
23
|
+
*/
|
|
24
|
+
getTitleText(): string;
|
|
25
|
+
/**
|
|
26
|
+
* 副标题(未通过属性覆盖时按语言给出)
|
|
27
|
+
*/
|
|
28
|
+
getSubtitleText(): string;
|
|
29
|
+
/**
|
|
30
|
+
* 描述文字(未通过属性覆盖时按语言给出)
|
|
31
|
+
*/
|
|
32
|
+
getDescriptionText(): string;
|
|
33
|
+
/**
|
|
34
|
+
* 返回按钮文字(未通过属性覆盖时按语言给出)
|
|
35
|
+
*/
|
|
36
|
+
getBackText(): string;
|
|
4
37
|
/**
|
|
5
38
|
* 处理返回按钮点击
|
|
39
|
+
*
|
|
40
|
+
* 先派发可取消的 back 事件,业务方可以阻止默认跳转并自行接入路由;
|
|
41
|
+
* 未阻止时优先使用旧版可选的 __SOLELY_ROUTER__ 全局实例,否则回退到 location 跳转。
|
|
6
42
|
*/
|
|
7
43
|
handleBack(): void;
|
|
8
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:d}=this;return{"not-found--embedded":d.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:d}=this;return{"not-found--embedded":d.embedded}},function(t){const{$data:d}=this;return d.showIcon},function(t){const{$data:d}=this;return`${this.getTitleText()}`},function(t){const{$data:d}=this;return`${this.getSubtitleText()}`},function(t){const{$data:d}=this;return`${this.getDescriptionText()}`},function(t,d){const{$data:n}=this,{value:o,checked:s}=t?.target||{};this.handleBack()},function(t){const{$data:d}=this;return` ${this.getBackText()}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"not-found",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"container",d:0},{k:"class",v:"not-found__container",d:0}],c:[{t:2,d:0,x:" 404 数字动画 "},{t:0,d:0,g:"div",a:[{k:"part",v:"numbers",d:0},{k:"class",v:"not-found__numbers",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"number",d:0},{k:"class",v:"not-found__number",d:0}],c:[{t:1,d:0,s:1,x:"4"}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:2,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"not-found__icon-wrapper",d:0}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"part",v:"icon",d:0},{k:"class",v:"not-found__icon",d:0},{k:"aria-hidden",v:"true",d:0},{k:"viewBox",v:"0 0 24 24",d:0},{k:"fill",v:"none",d:0},{k:"stroke",v:"currentColor",d:0},{k:"stroke-width",v:"2",d:0}],c:[{t:0,d:0,s:1,g:"circle",a:[{k:"cx",v:"12",d:0},{k:"cy",v:"12",d:0},{k:"r",v:"10",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"12",d:0},{k:"y1",v:"8",d:0},{k:"x2",v:"12",d:0},{k:"y2",v:"12",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"12",d:0},{k:"y1",v:"16",d:0},{k:"x2",v:"12.01",d:0},{k:"y2",v:"16",d:0}],c:[]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"number",d:0},{k:"class",v:"not-found__number",d:0}],c:[{t:1,d:0,s:1,x:"4"}]}]},{t:2,d:0,x:" 文字内容 "},{t:0,d:0,g:"h1",a:[{k:"part",v:"title",d:0},{k:"class",v:"not-found__title",d:0}],c:[{t:1,d:1,f:3}]},{t:0,d:0,g:"h2",a:[{k:"part",v:"subtitle",d:0},{k:"class",v:"not-found__subtitle",d:0}],c:[{t:1,d:1,f:4}]},{t:0,d:0,g:"p",a:[{k:"part",v:"description",d:0},{k:"class",v:"not-found__description",d:0}],c:[{t:1,d:1,f:5}]},{t:2,d:0,x:" 返回按钮 "},{t:1,d:0,s:1,x:" "},{t:0,d:1,g:"button",a:[{k:"part",v:"button",d:0},{k:"class",v:"not-found__button",d:0},{k:"@click",f:6,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"part",v:"button-icon",d:0},{k:"class",v:"not-found__button-icon",d:0},{k:"aria-hidden",v:"true",d:0},{k:"viewBox",v:"0 0 24 24",d:0},{k:"fill",v:"none",d:0},{k:"stroke",v:"currentColor",d:0},{k:"stroke-width",v:"2",d:0}],c:[{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"19",d:0},{k:"y1",v:"12",d:0},{k:"x2",v:"5",d:0},{k:"y2",v:"12",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"polyline",a:[{k:"points",v:"12 19 5 12 12 5",d:0}],c:[]}]},{t:1,d:1,f:7}]}]},{t:2,d:0,x:" 装饰性背景元素 "},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--1",d:0}],c:[]},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--2",d:0}],c:[]},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--3",d:0}],c:[]}]}],s:{tf:7,cf:7,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:d}=this;return{"not-found--embedded":d.
|
|
1
|
+
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:d}=this;return{"not-found--embedded":d.embedded}},function(t){const{$data:d}=this;return d.showIcon},function(t){const{$data:d}=this;return`${this.getTitleText()}`},function(t){const{$data:d}=this;return`${this.getSubtitleText()}`},function(t){const{$data:d}=this;return`${this.getDescriptionText()}`},function(t,d){const{$data:n}=this,{value:o,checked:s}=t?.target||{};this.handleBack()},function(t){const{$data:d}=this;return` ${this.getBackText()}`}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"not-found",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,g:"div",a:[{k:"part",v:"container",d:0},{k:"class",v:"not-found__container",d:0}],c:[{t:2,d:0,x:" 404 数字动画 "},{t:0,d:0,g:"div",a:[{k:"part",v:"numbers",d:0},{k:"class",v:"not-found__numbers",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"number",d:0},{k:"class",v:"not-found__number",d:0}],c:[{t:1,d:0,s:1,x:"4"}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:2,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"icon-wrapper",d:0},{k:"class",v:"not-found__icon-wrapper",d:0}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"part",v:"icon",d:0},{k:"class",v:"not-found__icon",d:0},{k:"aria-hidden",v:"true",d:0},{k:"viewBox",v:"0 0 24 24",d:0},{k:"fill",v:"none",d:0},{k:"stroke",v:"currentColor",d:0},{k:"stroke-width",v:"2",d:0}],c:[{t:0,d:0,s:1,g:"circle",a:[{k:"cx",v:"12",d:0},{k:"cy",v:"12",d:0},{k:"r",v:"10",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"12",d:0},{k:"y1",v:"8",d:0},{k:"x2",v:"12",d:0},{k:"y2",v:"12",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"12",d:0},{k:"y1",v:"16",d:0},{k:"x2",v:"12.01",d:0},{k:"y2",v:"16",d:0}],c:[]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"number",d:0},{k:"class",v:"not-found__number",d:0}],c:[{t:1,d:0,s:1,x:"4"}]}]},{t:2,d:0,x:" 文字内容 "},{t:0,d:0,g:"h1",a:[{k:"part",v:"title",d:0},{k:"class",v:"not-found__title",d:0}],c:[{t:1,d:1,f:3}]},{t:0,d:0,g:"h2",a:[{k:"part",v:"subtitle",d:0},{k:"class",v:"not-found__subtitle",d:0}],c:[{t:1,d:1,f:4}]},{t:0,d:0,g:"p",a:[{k:"part",v:"description",d:0},{k:"class",v:"not-found__description",d:0}],c:[{t:1,d:1,f:5}]},{t:2,d:0,x:" 返回按钮 "},{t:1,d:0,s:1,x:" "},{t:0,d:1,g:"button",a:[{k:"part",v:"button",d:0},{k:"class",v:"not-found__button",d:0},{k:"@click",f:6,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"part",v:"button-icon",d:0},{k:"class",v:"not-found__button-icon",d:0},{k:"aria-hidden",v:"true",d:0},{k:"viewBox",v:"0 0 24 24",d:0},{k:"fill",v:"none",d:0},{k:"stroke",v:"currentColor",d:0},{k:"stroke-width",v:"2",d:0}],c:[{t:0,d:0,s:1,g:"line",a:[{k:"x1",v:"19",d:0},{k:"y1",v:"12",d:0},{k:"x2",v:"5",d:0},{k:"y2",v:"12",d:0}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,s:1,g:"polyline",a:[{k:"points",v:"12 19 5 12 12 5",d:0}],c:[]}]},{t:1,d:1,f:7}]}]},{t:2,d:0,x:" 装饰性背景元素 "},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--1",d:0}],c:[]},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--2",d:0}],c:[]},{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"bg-decoration",d:0},{k:"class",v:"not-found__bg-decoration not-found__bg-decoration--3",d:0}],c:[]}]}],s:{tf:7,cf:7,dn:1,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as
|
|
1
|
+
import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import n from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let s=class extends n{prefersChinese(){if("undefined"==typeof document)return!0;const e=(this.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||"").toLowerCase();return""===e||e.startsWith("zh")}getDefaultSubtitleText(){return this.prefersChinese()?"抱歉,您访问的页面不存在":"Sorry, the page you requested does not exist"}getDefaultDescriptionText(){return this.prefersChinese()?"请检查网址是否正确,或点击下方按钮返回首页":"Please check the URL, or click the button below to go back home"}getDefaultBackText(){return this.prefersChinese()?"返回首页":"Back to Home"}getTitleText(){return this.$data.title||"404"}getSubtitleText(){return this.$data.subtitle||this.getDefaultSubtitleText()}getDescriptionText(){return this.$data.description||this.getDefaultDescriptionText()}getBackText(){return this.$data.backText||this.getDefaultBackText()}handleBack(){if("undefined"==typeof window)return;const e=this.$data.backUrl||"/";if(!this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return;const t=window.__SOLELY_ROUTER__;t&&"function"==typeof t.push?t.push(e):window.location.href=e}};s=((e,t)=>{for(var n,r=t,s=e.length-1;s>=0;s--)(n=e[s])&&(r=n(r)||r);return r})([r({tagName:"solely-not-found",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"title",type:"string",default:"404"},{name:"subtitle",type:"string",default:e=>e.getDefaultSubtitleText()},{name:"description",type:"string",default:e=>e.getDefaultDescriptionText()},{name:"backText",type:"string",default:e=>e.getDefaultBackText()},{name:"backUrl",type:"string",default:"/"},{name:"embedded",type:"boolean",default:!1},{name:"showIcon",type:"boolean",default:!0}]})],s);export{s as SolelyNotFound};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='*,*:before,*:after{box-sizing:border-box}:host{display:flex;width:100%;min-height:100vh;align-items:center;justify-content:center;font-family:var(--solely-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);background:linear-gradient(135deg,var(--solely-gray-3, #f5f7fa) 0%,var(--solely-gray-5, #c3cfe2) 100%);position:relative;overflow:hidden}.not-found{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--solely-spacing-xl, 32px);position:relative;z-index:var(--solely-z-index-base, 1)}.not-found__container{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:500px;animation:fadeInUp .6s ease-out}.not-found__numbers{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:24px}.not-found__number{font-size:120px;font-weight:800;line-height:1;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:float 3s ease-in-out infinite;text-shadow:none}.not-found__number:first-child{animation-delay:0s}.not-found__number:last-child{animation-delay:.5s}.not-found__icon-wrapper{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--solely-error, #ff6b6b) 0%,var(--solely-error-hover, #ee5a6f) 100%);border-radius:50%;animation:pulse 2s ease-in-out infinite,float 3s ease-in-out infinite;animation-delay:.25s,.25s;box-shadow:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='*,*:before,*:after{box-sizing:border-box}:host{display:flex;width:100%;min-height:100vh;align-items:center;justify-content:center;font-family:var(--solely-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);background:linear-gradient(135deg,var(--solely-gray-3, #f5f7fa) 0%,var(--solely-gray-5, #c3cfe2) 100%);position:relative;overflow:hidden}.not-found{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--solely-spacing-xl, 32px);position:relative;z-index:var(--solely-z-index-base, 1)}.not-found__container{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:500px;animation:fadeInUp .6s ease-out}.not-found__numbers{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:24px}.not-found__number{font-size:120px;font-weight:800;line-height:1;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:float 3s ease-in-out infinite;text-shadow:none}.not-found__number:first-child{animation-delay:0s}.not-found__number:last-child{animation-delay:.5s}.not-found__icon-wrapper{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--solely-error, #ff6b6b) 0%,var(--solely-error-hover, #ee5a6f) 100%);border-radius:50%;animation:pulse 2s ease-in-out infinite,float 3s ease-in-out infinite;animation-delay:.25s,.25s;box-shadow:var(--solely-shadow-error-glow-lg)}.not-found__icon{width:40px;height:40px;color:var(--solely-white, #ffffff)}.not-found__title{font-size:48px;font-weight:700;color:var(--solely-text-primary, #262626);margin:0 0 8px;line-height:1.2}.not-found__subtitle{font-size:20px;font-weight:500;color:var(--solely-text-secondary, #595959);margin:0 0 16px;line-height:1.4}.not-found__description{font-size:14px;color:var(--solely-text-tertiary, #8c8c8c);margin:0 0 32px;line-height:1.6;max-width:400px}.not-found__button{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 28px;font-size:15px;font-weight:500;color:var(--solely-white, #ffffff);background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);border:none;border-radius:22px;cursor:pointer;transition:all .3s ease;box-shadow:var(--solely-shadow-primary-glow-md);outline:none}.not-found__button:hover{transform:translateY(-2px);box-shadow:var(--solely-shadow-primary-glow-lg)}.not-found__button:active{transform:translateY(0)}.not-found__button:focus-visible{--solely-focus-ring-offset: 3px;outline:var(--solely-focus-ring-width) solid var(--solely-focus-ring-color);outline-offset:var(--solely-focus-ring-offset)}.not-found__button-icon{width:18px;height:18px;transition:transform .3s ease}.not-found__button:hover .not-found__button-icon{transform:translate(-3px)}.not-found__bg-decoration{position:absolute;border-radius:50%;opacity:.1;pointer-events:none}.not-found__bg-decoration--1{width:300px;height:300px;background:var(--solely-primary, #1890ff);top:-100px;right:-100px;animation:float 8s ease-in-out infinite}.not-found__bg-decoration--2{width:200px;height:200px;background:var(--solely-error, #ff6b6b);bottom:-50px;left:-50px;animation:float 6s ease-in-out infinite reverse}.not-found__bg-decoration--3{width:150px;height:150px;background:var(--solely-success, #52c41a);top:50%;right:10%;animation:float 10s ease-in-out infinite;animation-delay:-2s}@keyframes fadeInUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@media(max-width:576px){.not-found__number{font-size:80px}.not-found__icon-wrapper{width:60px;height:60px}.not-found__icon{width:30px;height:30px}.not-found__title{font-size:36px}.not-found__subtitle{font-size:18px}.not-found__description{font-size:13px}.not-found__numbers{gap:12px}}:host([embedded]){min-height:auto;background:var(--docs-bg-secondary, #f5f5f5)}.not-found--embedded{padding:var(--solely-spacing-lg, 24px)}.not-found--embedded .not-found__container{max-width:400px;animation:fadeInUp .4s ease-out}.not-found--embedded .not-found__number{font-size:64px}.not-found--embedded .not-found__icon-wrapper{width:48px;height:48px;box-shadow:var(--solely-shadow-error-glow-sm)}.not-found--embedded .not-found__icon{width:24px;height:24px}.not-found--embedded .not-found__title{font-size:28px;margin-bottom:4px}.not-found--embedded .not-found__subtitle{font-size:16px;margin-bottom:12px}.not-found--embedded .not-found__description{font-size:13px;margin-bottom:20px}.not-found--embedded .not-found__button{height:36px;padding:0 20px;font-size:13px;border-radius:18px;box-shadow:var(--solely-shadow-primary-glow-sm)}.not-found--embedded .not-found__button-icon{width:14px;height:14px}.not-found--embedded .not-found__numbers{gap:10px;margin-bottom:16px}.not-found--embedded .not-found__bg-decoration{display:none}';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o='*,*:before,*:after{box-sizing:border-box}:host{display:flex;width:100%;min-height:100vh;align-items:center;justify-content:center;font-family:var(--solely-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);background:linear-gradient(135deg,var(--solely-gray-3, #f5f7fa) 0%,var(--solely-gray-5, #c3cfe2) 100%);position:relative;overflow:hidden}.not-found{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--solely-spacing-xl, 32px);position:relative;z-index:var(--solely-z-index-base, 1)}.not-found__container{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:500px;animation:fadeInUp .6s ease-out}.not-found__numbers{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:24px}.not-found__number{font-size:120px;font-weight:800;line-height:1;background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:float 3s ease-in-out infinite;text-shadow:none}.not-found__number:first-child{animation-delay:0s}.not-found__number:last-child{animation-delay:.5s}.not-found__icon-wrapper{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--solely-error, #ff6b6b) 0%,var(--solely-error-hover, #ee5a6f) 100%);border-radius:50%;animation:pulse 2s ease-in-out infinite,float 3s ease-in-out infinite;animation-delay:.25s,.25s;box-shadow:var(--solely-shadow-error-glow-lg)}.not-found__icon{width:40px;height:40px;color:var(--solely-white, #ffffff)}.not-found__title{font-size:48px;font-weight:700;color:var(--solely-text-primary, #262626);margin:0 0 8px;line-height:1.2}.not-found__subtitle{font-size:20px;font-weight:500;color:var(--solely-text-secondary, #595959);margin:0 0 16px;line-height:1.4}.not-found__description{font-size:14px;color:var(--solely-text-tertiary, #8c8c8c);margin:0 0 32px;line-height:1.6;max-width:400px}.not-found__button{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 28px;font-size:15px;font-weight:500;color:var(--solely-white, #ffffff);background:linear-gradient(135deg,var(--solely-primary, #1890ff) 0%,var(--solely-primary-hover, #40a9ff) 100%);border:none;border-radius:22px;cursor:pointer;transition:all .3s ease;box-shadow:var(--solely-shadow-primary-glow-md);outline:none}.not-found__button:hover{transform:translateY(-2px);box-shadow:var(--solely-shadow-primary-glow-lg)}.not-found__button:active{transform:translateY(0)}.not-found__button:focus-visible{--solely-focus-ring-offset: 3px;outline:var(--solely-focus-ring-width) solid var(--solely-focus-ring-color);outline-offset:var(--solely-focus-ring-offset)}.not-found__button-icon{width:18px;height:18px;transition:transform .3s ease}.not-found__button:hover .not-found__button-icon{transform:translate(-3px)}.not-found__bg-decoration{position:absolute;border-radius:50%;opacity:.1;pointer-events:none}.not-found__bg-decoration--1{width:300px;height:300px;background:var(--solely-primary, #1890ff);top:-100px;right:-100px;animation:float 8s ease-in-out infinite}.not-found__bg-decoration--2{width:200px;height:200px;background:var(--solely-error, #ff6b6b);bottom:-50px;left:-50px;animation:float 6s ease-in-out infinite reverse}.not-found__bg-decoration--3{width:150px;height:150px;background:var(--solely-success, #52c41a);top:50%;right:10%;animation:float 10s ease-in-out infinite;animation-delay:-2s}@keyframes fadeInUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@media(max-width:576px){.not-found__number{font-size:80px}.not-found__icon-wrapper{width:60px;height:60px}.not-found__icon{width:30px;height:30px}.not-found__title{font-size:36px}.not-found__subtitle{font-size:18px}.not-found__description{font-size:13px}.not-found__numbers{gap:12px}}:host([embedded]){min-height:auto;background:var(--docs-bg-secondary, #f5f5f5)}.not-found--embedded{padding:var(--solely-spacing-lg, 24px)}.not-found--embedded .not-found__container{max-width:400px;animation:fadeInUp .4s ease-out}.not-found--embedded .not-found__number{font-size:64px}.not-found--embedded .not-found__icon-wrapper{width:48px;height:48px;box-shadow:var(--solely-shadow-error-glow-sm)}.not-found--embedded .not-found__icon{width:24px;height:24px}.not-found--embedded .not-found__title{font-size:28px;margin-bottom:4px}.not-found--embedded .not-found__subtitle{font-size:16px;margin-bottom:12px}.not-found--embedded .not-found__description{font-size:13px;margin-bottom:20px}.not-found--embedded .not-found__button{height:36px;padding:0 20px;font-size:13px;border-radius:18px;box-shadow:var(--solely-shadow-primary-glow-sm)}.not-found--embedded .not-found__button-icon{width:14px;height:14px}.not-found--embedded .not-found__numbers{gap:10px;margin-bottom:16px}.not-found--embedded .not-found__bg-decoration{display:none}';export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../shared/size.cjs"),e=require("./style.css.cjs"),a=require("./index.html.cjs"),i=require("../utils/helpers.cjs"),s=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;var n,h,l,d,u,o=t=>{throw TypeError(t)},c=(t,e,a)=>(((t,e)=>{e.has(t)||o("Cannot access private method")})(t,e),a);exports.SolelyPagination=class extends s.default{constructor(){var t,e;super(...arguments),t=this,(e=n).has(t)?o("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,void 0)}get size(){return t.normalizeSize(this.$data.size)}set size(e){this.$data.size=t.normalizeSize(e)}getEffectiveCurrent(){return c(this,n,d).call(this,this.$data.current,this.$data.total,this.$data.pageSize)}get current(){return this.$data.current}set current(t){const e=Math.max(1,c(this,n,h).call(this,t,this.$data.current||1));e!==this.$data.current&&(this.$data.current=e,this.isSyncingProps||c(this,n,u).call(this,e,this.$data.pageSize))}get pageSize(){return this.$data.pageSize}set pageSize(t){const e=Math.max(1,c(this,n,h).call(this,t,this.$data.pageSize||10));if(e===this.$data.pageSize)return;this.$data.pageSize=e;const a=c(this,n,d).call(this,this.$data.current,this.$data.total,e);a!==this.$data.current&&(this.$data.current=a),this.isSyncingProps||c(this,n,u).call(this,a,e)}get total(){return this.$data.total}set total(t){const e=this.$data.current,a=Math.max(0,c(this,n,h).call(this,t,this.$data.total||0));if(a===this.$data.total)return;this.$data.total=a;const i=c(this,n,d).call(this,e,a,this.$data.pageSize);i!==e&&(this.$data.current=i),this.isSyncingProps||i===e||c(this,n,u).call(this,i,this.$data.pageSize)}getPaginationClasses(){const t={};return"small"===this.$data.size?t["pagination--sm"]=!0:"large"===this.$data.size?t["pagination--lg"]=!0:t["pagination--md"]=!0,t["is-disabled"]=!!this.$data.disabled,t["pagination--simple"]=!!this.$data.simple,t}getPrevClasses(){return{"pagination__item--disabled":this.$data.disabled||this.getEffectiveCurrent()<=1}}getNextClasses(){return{"pagination__item--disabled":this.$data.disabled||this.getEffectiveCurrent()>=this.totalPages}}getPrevTabIndex(){return this.$data.disabled||this.getEffectiveCurrent()<=1?"-1":"0"}getNextTabIndex(){return this.$data.disabled||this.getEffectiveCurrent()>=this.totalPages?"-1":"0"}getItemClasses(t){return{"pagination__item--active":t===this.getEffectiveCurrent()}}mounted(){this.refresh(),this.$data.jumperValue=""}getPageSizeOptions(){const t=[10,20,50,100],e=i.safeJsonParse(this.$data.pageSizeOptions,t),a=Array.isArray(e)?e.map(Number).filter(t=>Number.isFinite(t)&&t>0):t,s=this.$data.pageSize||10;return Array.from(new Set([...a,s])).sort((t,e)=>t-e)}get totalPages(){return Math.ceil((this.$data.total||0)/(this.$data.pageSize||10))}calculateVisiblePages(){const t=this.getEffectiveCurrent(),e=this.totalPages,a=[];if(this.$data.simple){const i=[1,t,e].filter(t=>t>=1&&t<=e),s=Array.from(new Set(i)).sort((t,e)=>t-e);return s.forEach((t,e)=>{e>0&&t-s[e-1]>1&&a.push("..."),a.push(t)}),a}if(e<=7)for(let i=1;i<=e;i++)a.push(i);else t<=3?a.push(1,2,3,4,5,"...",e):t>=e-2?a.push(1,"...",e-4,e-3,e-2,e-1,e):a.push(1,"...",t-1,t,t+1,"...",e);return a}handlePageClick(t){if(this.$data.disabled)return;const e=c(this,n,h).call(this,t,this.$data.current||1);e<1||e>c(this,n,l).call(this,this.$data.total,this.$data.pageSize)||e!==this.$data.current&&(this.$data.current=e,c(this,n,u).call(this,e,this.$data.pageSize))}handlePageKeydown(t,e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handlePageClick(t))}handlePrev(){if(this.$data.disabled)return;const t=this.getEffectiveCurrent();t<=1||this.handlePageClick(t-1)}handlePrevKeydown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handlePrev())}handleNext(){if(this.$data.disabled)return;const t=this.getEffectiveCurrent();t>=this.totalPages||this.handlePageClick(t+1)}handleNextKeydown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleNext())}handleSizeChange(t){if(this.$data.disabled)return;const e=t.target,a=Math.max(1,c(this,n,h).call(this,e.value,this.$data.pageSize||10));if(a===this.$data.pageSize)return;this.$data.pageSize=a,this.$data.current=1;const i={current:1,pageSize:a};c(this,n,u).call(this,i.current,i.pageSize),this.emit("size-change",i),this.emit("show-size-change",i)}handleJumperKeydown(t){if("Enter"!==t.key)return;t.preventDefault();const e=t.target,a=parseInt(e.value,10);a>=1&&a<=this.totalPages&&this.handlePageClick(a),this.$data.jumperValue=""}handleJumperStep(t){if(this.$data.disabled)return;const e=this.getEffectiveCurrent()+t;e>=1&&e<=this.totalPages&&(this.handlePageClick(e),this.$data.jumperValue=String(e))}handleJumperStepKeydown(t,e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleJumperStep(t))}setCurrent(t){this.current=c(this,n,d).call(this,t,this.$data.total,this.$data.pageSize)}getCurrent(){return this.$data.current}},n=new WeakSet,h=function(t,e){const a=Number(t);return Number.isFinite(a)?Math.floor(a):e},l=function(t,e){return Math.max(1,Math.ceil((t||0)/(e||10)))},d=function(t,e,a){return Math.min(Math.max(1,c(this,n,h).call(this,t,1)),c(this,n,l).call(this,e,a))},u=function(t,e){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{current:t,pageSize:e}}))},exports.SolelyPagination=((t,e)=>{for(var a,i=e,s=t.length-1;s>=0;s--)(a=t[s])&&(i=a(i)||i);return i})([r.CustomElement({tagName:"solely-pagination",template:a.__SOLELY_IR__,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"current",type:"number",default:1},{name:"total",type:"number",default:0},{name:"pageSize",type:"number",default:10},{name:"size",type:"string",default:"medium"},{name:"simple",type:"boolean",default:!1},{name:"showQuickJumper",type:"boolean",default:!1},{name:"showSizeChanger",type:"boolean",default:!1},{name:"pageSizeOptions",type:"string",default:"[10, 20, 50, 100]"},{name:"disabled",type:"boolean",default:!1},{name:"showTotal",type:"boolean",default:!1}]})],exports.SolelyPagination);
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { BaseElement } from '../../../runtime/component';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseElement } from '../../../runtime/component/index.js';
|
|
2
|
+
import { SizeInput } from '../../../shared/size.js';
|
|
3
|
+
import { PaginationProps, PaginationSize } from './types.js';
|
|
4
|
+
declare class SolelyPagination extends BaseElement<PaginationProps> {
|
|
5
|
+
#private;
|
|
6
|
+
/** 统一尺寸语义:middle / default 归一为 medium */
|
|
7
|
+
get size(): PaginationSize;
|
|
8
|
+
set size(value: SizeInput);
|
|
9
|
+
/**
|
|
10
|
+
* 供展示、高亮、禁用态与页码计算统一使用的有效当前页。
|
|
11
|
+
* 越界时以钳制值为准,避免"展示页 1、高亮页 9"的漂移。
|
|
12
|
+
*/
|
|
13
|
+
getEffectiveCurrent(): number;
|
|
6
14
|
/**
|
|
7
15
|
* 暴露 current 属性,使外部可通过 event.target.current 访问
|
|
8
16
|
*/
|
|
@@ -13,6 +21,11 @@ declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
|
13
21
|
*/
|
|
14
22
|
get pageSize(): number;
|
|
15
23
|
set pageSize(value: number);
|
|
24
|
+
/**
|
|
25
|
+
* 暴露 total 属性。total 变化后当前页可能越界,需要夹取并同步到事件 detail。
|
|
26
|
+
*/
|
|
27
|
+
get total(): number;
|
|
28
|
+
set total(value: number);
|
|
16
29
|
/**
|
|
17
30
|
* 获取 pagination class 对象
|
|
18
31
|
*/
|
|
@@ -25,15 +38,28 @@ declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
|
25
38
|
* 获取 next class 对象
|
|
26
39
|
*/
|
|
27
40
|
getNextClasses(): Record<string, boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* 上一页 / 下一页的焦点顺序
|
|
43
|
+
*
|
|
44
|
+
* 到达边界后与 aria-disabled 保持一致,从 Tab 序列中移除;
|
|
45
|
+
* 返回字符串以避免数字 -1 与默认 tabIndex 相等而被渲染层跳过写 attribute。
|
|
46
|
+
*/
|
|
47
|
+
getPrevTabIndex(): string;
|
|
48
|
+
getNextTabIndex(): string;
|
|
28
49
|
/**
|
|
29
50
|
* 获取 item class 对象
|
|
30
51
|
*/
|
|
31
52
|
getItemClasses(page: number | string): Record<string, boolean>;
|
|
32
53
|
mounted(): void;
|
|
33
54
|
/**
|
|
34
|
-
*
|
|
55
|
+
* 每页条数选项。
|
|
56
|
+
*
|
|
57
|
+
* 当前 pageSize 必须出现在选项里:否则 <select> 中没有任何 option 带 selected,
|
|
58
|
+
* 浏览器会回退选中第一项,出现「下拉显示 10 条/页、实际每页 2 条」的错位。
|
|
59
|
+
* 这里按最新 pageSize / pageSizeOptions 实时计算,属性后续变化也能同步,
|
|
60
|
+
* 且不写回 $data,避免触发额外的渲染循环。
|
|
35
61
|
*/
|
|
36
|
-
|
|
62
|
+
getPageSizeOptions(): number[];
|
|
37
63
|
/**
|
|
38
64
|
* 计算总页数
|
|
39
65
|
*/
|
|
@@ -46,16 +72,31 @@ declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
|
46
72
|
* 页码点击
|
|
47
73
|
*/
|
|
48
74
|
handlePageClick(page: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* 页码键盘激活(Enter / Space)
|
|
77
|
+
*/
|
|
78
|
+
handlePageKeydown(page: number, event: KeyboardEvent): void;
|
|
49
79
|
/**
|
|
50
80
|
* 上一页
|
|
51
81
|
*/
|
|
52
82
|
handlePrev(): void;
|
|
83
|
+
/**
|
|
84
|
+
* 上一页键盘激活(Enter / Space)
|
|
85
|
+
*/
|
|
86
|
+
handlePrevKeydown(event: KeyboardEvent): void;
|
|
53
87
|
/**
|
|
54
88
|
* 下一页
|
|
55
89
|
*/
|
|
56
90
|
handleNext(): void;
|
|
91
|
+
/**
|
|
92
|
+
* 下一页键盘激活(Enter / Space)
|
|
93
|
+
*/
|
|
94
|
+
handleNextKeydown(event: KeyboardEvent): void;
|
|
57
95
|
/**
|
|
58
96
|
* 每页条数改变
|
|
97
|
+
*
|
|
98
|
+
* 事件契约:change 与 size-change 各派发一次,detail 均为
|
|
99
|
+
* `{ current, pageSize }`。show-size-change 作为兼容别名保留(已废弃)。
|
|
59
100
|
*/
|
|
60
101
|
handleSizeChange(event: Event): void;
|
|
61
102
|
/**
|
|
@@ -66,6 +107,10 @@ declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
|
66
107
|
* 快速跳转步进
|
|
67
108
|
*/
|
|
68
109
|
handleJumperStep(step: number): void;
|
|
110
|
+
/**
|
|
111
|
+
* 快速跳转步进键盘激活(Enter / Space)
|
|
112
|
+
*/
|
|
113
|
+
handleJumperStepKeydown(step: number, event: KeyboardEvent): void;
|
|
69
114
|
/**
|
|
70
115
|
* 设置当前页
|
|
71
116
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getPaginationClasses()},function(t){const{$data:a}=this;return a.showTotal},function(t){const{$data:a}=this;return`共 ${a.total} 条`},function(t){const{$data:a}=this;return this.getPrevClasses()},function(t,a){const{$data:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getPaginationClasses()},function(t){const{$data:a}=this;return a.showTotal},function(t){const{$data:a}=this;return`共 ${a.total} 条`},function(t){const{$data:a}=this;return this.getPrevTabIndex()},function(t){const{$data:a}=this;return"-1"===this.getPrevTabIndex()?"true":"false"},function(t){const{$data:a}=this;return this.getPrevClasses()},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handlePrev(t)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handlePrevKeydown(t)},function(t){const{$data:a}=this;return this.calculateVisiblePages()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return"..."!==d},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return a.disabled?"-1":"0"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return"第 "+d+" 页"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return d===this.getEffectiveCurrent()?"page":null},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return a.disabled?"true":"false"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return this.getItemClasses(d)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};var[s]=a.map(t=>t.itmVal),[i]=a.map(t=>t.idxVal);this.handlePageClick(s,t)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};var[s]=a.map(t=>t.itmVal),[i]=a.map(t=>t.idxVal);this.handlePageKeydown(s,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return`${d}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return"..."===d},function(t){const{$data:a}=this;return this.getNextTabIndex()},function(t){const{$data:a}=this;return"-1"===this.getNextTabIndex()?"true":"false"},function(t){const{$data:a}=this;return this.getNextClasses()},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleNext(t)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleNextKeydown(t)},function(t){const{$data:a}=this;return a.showSizeChanger},function(t){const{$data:a}=this;return a.disabled},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleSizeChange(t)},function(t){const{$data:a}=this;return this.getPageSizeOptions()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return d},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return d===a.pageSize},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[n]=t.map(t=>t.idxVal);return`${d} 条/页`},function(t){const{$data:a}=this;return a.showQuickJumper},function(t){const{$data:a}=this;return a.totalPages},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleJumperKeydown(t)},function(t){const{$data:a}=this;return a.jumperValue},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};d.jumperValue=n},function(t){const{$data:a}=this;return a.disabled?"-1":"0"},function(t){const{$data:a}=this;return a.disabled?"true":"false"},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleJumperStep(1)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleJumperStepKeydown(1,t)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleJumperStep(-1)},function(t,a){const{$data:d}=this,{value:n,checked:e}=t?.target||{};this.handleJumperStepKeydown(-1,t)}],n:[{t:0,d:1,g:"div",a:[{k:"part",v:"base",d:0},{k:"class",v:"pagination",d:0},{k:":class",f:1,d:1}],c:[{t:2,d:0,x:" 总数 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:2,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"total",d:0},{k:"class",v:"pagination__total",d:0}],c:[{t:1,d:1,f:3}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 上一页 "},{t:1,d:0,s:1,x:" "},{t:0,d:1,g:"span",a:[{k:"part",v:"prev",d:0},{k:"class",v:"pagination__prev",d:0},{k:"role",v:"button",d:0},{k:":tabindex",f:4,d:1},{k:"aria-label",v:"上一页",d:0},{k:":aria-disabled",f:5,d:1},{k:":class",f:6,d:1},{k:"@click",f:7,d:1},{k:"@keydown",f:8,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"pagination__nav-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M10 3.5 5.5 8 10 12.5",d:0}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 页码 "},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:9,i:"page",n:"index",a:[],c:[{t:7,d:1,b:[{f:10,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"item",d:0},{k:"class",v:"pagination__item",d:0},{k:"role",v:"button",d:0},{k:":tabindex",f:11,d:1},{k:":aria-label",f:12,d:1},{k:":aria-current",f:13,d:1},{k:":aria-disabled",f:14,d:1},{k:":class",f:15,d:1},{k:"@click",f:16,d:1},{k:"@keydown",f:17,d:1}],c:[{t:1,d:1,f:18}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:19,c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"ellipsis",d:0},{k:"class",v:"pagination__ellipsis",d:0}],c:[{t:1,d:0,s:1,x:"..."}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 下一页 "},{t:1,d:0,s:1,x:" "},{t:0,d:1,g:"span",a:[{k:"part",v:"next",d:0},{k:"class",v:"pagination__next",d:0},{k:"role",v:"button",d:0},{k:":tabindex",f:20,d:1},{k:"aria-label",v:"下一页",d:0},{k:":aria-disabled",f:21,d:1},{k:":class",f:22,d:1},{k:"@click",f:23,d:1},{k:"@keydown",f:24,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"pagination__nav-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M6 3.5 10.5 8 6 12.5",d:0}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 每页条数选择器 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:25,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"size-changer",d:0},{k:"class",v:"pagination__size-changer",d:0}],c:[{t:0,d:1,g:"select",a:[{k:"aria-label",v:"每页条数",d:0},{k:":disabled",f:26,d:1},{k:"@change",f:27,d:1}],c:[{t:6,d:1,f:28,i:"size",n:"index",a:[],c:[{t:0,d:1,g:"option",a:[{k:":value",f:29,d:1},{k:":selected",f:30,d:1}],c:[{t:1,d:1,f:31}]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 快速跳转 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:32,c:[{t:0,d:0,g:"span",a:[{k:"part",v:"jumper",d:0},{k:"class",v:"pagination__jumper",d:0}],c:[{t:1,d:0,s:1,x:"跳至 "},{t:0,d:0,g:"span",a:[{k:"part",v:"jumper-input-wrapper",d:0},{k:"class",v:"pagination__jumper-input-wrapper",d:0}],c:[{t:0,d:1,g:"input",a:[{k:"part",v:"jumper-input",d:0},{k:"type",v:"number",d:0},{k:"min",v:"1",d:0},{k:"aria-label",v:"跳至页码",d:0},{k:":max",f:33,d:1},{k:":disabled",f:26,d:1},{k:"@keydown",f:34,d:1},{k:":value",f:35,d:1},{k:"@input",f:36,d:1,r:"model"}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[{k:"part",v:"jumper-controls",d:0},{k:"class",v:"pagination__jumper-controls",d:0}],c:[{t:0,d:1,g:"span",a:[{k:"part",v:"jumper-up",d:0},{k:"class",v:"pagination__jumper-up",d:0},{k:"role",v:"button",d:0},{k:":tabindex",f:37,d:1},{k:"aria-label",v:"跳至后一页",d:0},{k:":aria-disabled",f:38,d:1},{k:"@click",f:39,d:1},{k:"@keydown",f:40,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"pagination__jumper-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M3.5 10 8 5.5 12.5 10",d:0}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:0,d:1,g:"span",a:[{k:"part",v:"jumper-down",d:0},{k:"class",v:"pagination__jumper-down",d:0},{k:"role",v:"button",d:0},{k:":tabindex",f:37,d:1},{k:"aria-label",v:"跳至前一页",d:0},{k:":aria-disabled",f:38,d:1},{k:"@click",f:41,d:1},{k:"@keydown",f:42,d:1}],c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"pagination__jumper-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M3.5 6 8 10.5 12.5 6",d:0}],c:[]}]}]}]}]},{t:1,d:0,s:1,x:" 页"}]}]}]}]}],s:{tf:42,cf:42,dn:1,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
|