neko-ui 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/code/worker.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js.map +1 -1
- package/es/qrcode/index.d.ts +6 -0
- package/es/qrcode/index.js +1 -1
- package/es/qrcode/index.js.map +1 -1
- package/lib/code/worker.js +1 -1
- package/lib/code/worker.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/qrcode/index.d.ts +6 -0
- package/lib/qrcode/index.js +1 -1
- package/lib/qrcode/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/index.js +1 -1
package/es/code/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../components/code/worker.ts"],"sourcesContent":["self.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-diff.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-docker.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-git.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-jsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-latex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-less.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.js');\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup-templating.js',\n);\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-regex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-toml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-tsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-wasm.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\n// plugins\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/diff-highlight/prism-diff-highlight.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/highlight-keywords/prism-highlight-keywords.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.js',\n);\n\nfunction onMessage(e: MessageEvent<string>) {\n let result;\n\n try {\n const { code, language = 'markup' } = JSON.parse(e.data) as {\n code: string;\n language: string;\n };\n\n if (/^diff-([\\w-]+)/i.test(language) && !self.Prism.languages[language]) {\n self.Prism.languages[language] = self.Prism.languages.diff;\n }\n\n result = self.Prism.highlight(`${code}\\n`, self.Prism.languages[language], language);\n
|
|
1
|
+
{"version":3,"sources":["../../components/code/worker.ts"],"sourcesContent":["self.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-diff.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-docker.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-git.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-jsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-latex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-less.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.js');\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup-templating.js',\n);\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-regex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-toml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-tsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-wasm.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\n// plugins\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/diff-highlight/prism-diff-highlight.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/highlight-keywords/prism-highlight-keywords.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.js',\n);\n\nfunction onMessage(e: MessageEvent<string>) {\n let result;\n\n try {\n const { code, language = 'markup' } = JSON.parse(e.data) as {\n code: string;\n language: string;\n };\n\n if (/^diff-([\\w-]+)/i.test(language) && !self.Prism.languages[language]) {\n self.Prism.languages[language] = self.Prism.languages.diff;\n }\n\n result = self.Prism.highlight(`${code}\\n`, self.Prism.languages[language], language);\n } catch {\n result = '';\n }\n self.postMessage(result); // 向主线程发送消息\n}\n\nself.addEventListener('message', onMessage, false);\n"],"names":["self","importScripts","addEventListener","e","result","code","language","JSON","parse","data","test","Prism","languages","diff","highlight","postMessage"],"mappings":"AAAAA,KAAKC,aAAa,CAAC,wDACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,0EACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,8EACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,4EACnBD,KAAKC,aAAa,CAChB,qFAEFD,KAAKC,aAAa,CAAC,0EACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,8EACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,wEAEnBD,KAAKC,aAAa,CAChB,8FAEFD,KAAKC,aAAa,CAChB,sGAEFD,KAAKC,aAAa,CAChB,0FAuBFD,KAAKE,gBAAgB,CAAC,UApBtB,SAAmBC,CAAuB,EACxC,IAAIC,EAEJ,GAAI,CACF,GAAM,CAAEC,KAAAA,CAAI,CAAEC,SAAAA,EAAW,QAAQ,CAAE,CAAGC,KAAKC,KAAK,CAACL,EAAEM,IAAI,EAKnD,kBAAkBC,IAAI,CAACJ,IAAa,CAACN,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,EACrEN,CAAAA,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,CAAGN,KAAKW,KAAK,CAACC,SAAS,CAACC,IAAI,AAAD,EAG3DT,EAASJ,KAAKW,KAAK,CAACG,SAAS,CAAC,CAAC,EAAET,EAAK;AAAE,CAAC,CAAEL,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,CAAEA,EAC7E,CAAE,QAAM,CACNF,EAAS,EACX,CACAJ,KAAKe,WAAW,CAACX,EACnB,EAE4C,CAAA"}
|
package/es/index.d.ts
CHANGED
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../components/index.ts"],"sourcesContent":["'use client';\n\nexport { default as Avatar, type AvatarElement, type AvatarProps } from './avatar';\nexport {\n default as AvatarGroup,\n type AvatarGroupElement,\n type AvatarGroupProps,\n} from './avatar/group';\nexport { default as BackTop, type BackTopElement, type BackTopProps } from './back-top';\nexport { type BaseOption, type BasicConfig, FieldName, Size, Status } from './basic-config';\nexport { default as Button, type ButtonElement, type ButtonProps } from './button';\nexport {\n default as CaptureScreen,\n type CaptureScreenElement,\n type CaptureScreenProps,\n} from './capture-screen';\nexport { default as Carousel, type CarouselElement, type CarouselProps } from './carousel';\nexport {\n default as Checkbox,\n type CheckboxBoolElement,\n type CheckboxBoolProps,\n type CheckboxGroupElement,\n type CheckboxGroupProps,\n} from './checkbox';\nexport { default as Code, type CodeElement, type CodeProps } from './code';\nexport {\n default as ColorPalette,\n type ColorPaletteElement,\n type ColorPaletteProps,\n} from './color-palette';\nexport {\n default as ColorPicker,\n type ColorPickerElement,\n type ColorPickerProps,\n} from './color-picker';\nexport { default as Cron, type CronElement, type CronProps } from './cron';\nexport { default as DatePicker, type DatePickerElement, type DatePickerProps } from './date-picker';\nexport { default as dayjs } from './date-picker/dayjs';\nexport {\n default as Dropdown,\n type DropdownElement,\n type DropdownMultipleElement,\n type DropdownMultipleProps,\n type DropdownProps,\n} from './dropdown';\nexport { default as Empty, type EmptyElement, type EmptyProps } from './empty';\nexport { default as fromSchema } from './from-schema';\nexport { default as getOptions } from './get-options';\nexport {\n default as HighlightText,\n type HighlightTextElement,\n type HighlightTextProps,\n} from './highlight-text';\nexport { default as Img, type ImgElement, type ImgProps } from './img';\nexport { default as Input, type InputElement, type InputProps } from './input';\nexport {\n default as InputNumber,\n type InputNumberElement,\n type InputNumberProps,\n} from './input-number';\nexport { default as Md, type MdElement, type MdProps } from './md';\nexport { default as mdStyle } from './md-style';\nexport {\n default as Menu,\n type MenuElement,\n type MenuMultipleElement,\n type MenuMultipleProps,\n type MenuOption,\n type MenuProps,\n} from './menu';\nexport {\n default as Modal,\n type ModalElement,\n type ModalProps,\n OpenState,\n type OpenStateKey,\n} from './modal';\nexport {\n default as notification,\n type NotificationProps,\n type NotificationType,\n} from './notification';\nexport { default as Pagination, type PaginationElement, type PaginationProps } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\nexport { default as Prism } from './prism';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { type IntRange, default as QrCode, type QrCodeElement, type QrCodeProps } from './qrcode';\nexport { default as Radio, type RadioElement, type RadioOption, type RadioProps } from './radio';\nexport { default as Segmented, type SegmentedElement, type SegmentedProps } from './segmented';\nexport {\n default as Select,\n type SelectElement,\n type SelectMultipleElement,\n type SelectMultipleProps,\n type SelectProps,\n} from './select';\nexport { default as Skeleton, type SkeletonElement, type SkeletonProps } from './skeleton';\nexport { default as Spin, type SpinElement, type SpinProps } from './spin';\nexport { default as Switch, type SwitchElement, type SwitchProps } from './switch';\nexport { default as Table, type TableElement, type TableProps } from './table';\nexport { type TabOption, default as Tabs, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n type ColorScheme,\n generateColor,\n default as theme,\n type ThemeOption,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\n type TreeData,\n type TreeElement,\n type TreeMultipleElement,\n type TreeMultipleProps,\n type TreeMultipleSchemaElement,\n type TreeMultipleSchemaProps,\n type TreeMultipleStringElement,\n type TreeMultipleStringProps,\n type TreeProps,\n type TreeSchemaElement,\n type TreeSchemaProps,\n type TreeStringElement,\n type TreeStringProps,\n} from './tree';\nexport { default as Typography, type TypographyElement, type TypographyProps } from './typography';\nexport type { CustomElement } from 'custom-element-type';\nexport { customElement, getCurrentElement, hot, noShadowDOM, withSolid } from 'solid-element';\nimport type { ICustomElement, Transform } from 'custom-element-type';\n\nimport type {\n AvatarElement,\n AvatarGroupElement,\n BackTopElement,\n ButtonElement,\n CaptureScreenElement,\n CarouselElement,\n CheckboxBoolElement,\n CheckboxGroupElement,\n CodeElement,\n ColorPaletteElement,\n ColorPickerElement,\n CronElement,\n DatePickerElement,\n DropdownElement,\n DropdownMultipleElement,\n EmptyElement,\n HighlightTextElement,\n ImgElement,\n InputElement,\n InputNumberElement,\n MdElement,\n MenuElement,\n MenuMultipleElement,\n ModalElement,\n PaginationElement,\n PopoverElement,\n ProviderElement,\n QrCodeElement,\n RadioElement,\n SegmentedElement,\n SelectElement,\n SelectMultipleElement,\n SkeletonElement,\n SpinElement,\n SwitchElement,\n TableElement,\n TabsElement,\n TagElement,\n TreeElement,\n TreeMultipleElement,\n TreeMultipleSchemaElement,\n TreeMultipleStringElement,\n TreeSchemaElement,\n TreeStringElement,\n TypographyElement,\n} from '.';\n\n/** 组件列表\n * @author monako97\n * @ignore optional\n */\ninterface CustomElementTags {\n /** 头像 */\n 'n-avatar': AvatarElement;\n /** 头像组 */\n 'n-avatar-group': AvatarGroupElement;\n /** 返回顶部 */\n 'n-back-top': BackTopElement;\n /** 按钮 */\n 'n-button': ButtonElement;\n /** 捕获屏幕 */\n 'n-capture-screen': CaptureScreenElement;\n /** 走马灯、轮播 */\n 'n-carousel': CarouselElement;\n /** 复选框 */\n 'n-checkbox': CheckboxBoolElement | CheckboxGroupElement;\n /** 代码框 */\n 'n-code': CodeElement;\n /** 取色器 */\n 'n-color-palette': ColorPaletteElement;\n /** 取色器(弹出类型) */\n 'n-color-picker': ColorPickerElement;\n /** 下拉面板 */\n 'n-dropdown': DropdownElement | DropdownMultipleElement;\n /** 空面板 */\n 'n-empty': EmptyElement;\n /** 匹配高亮文字 */\n 'n-highlight-text': HighlightTextElement;\n /** 图片查看器 */\n 'n-img': ImgElement;\n /** 输入框 */\n 'n-input': InputElement;\n /** 数字输入框 */\n 'n-input-number': InputNumberElement;\n /** Markdown渲染 */\n 'n-md': MdElement;\n /** 弹出气泡面板 */\n 'n-popover': PopoverElement;\n /** 单选项 */\n 'n-radio': RadioElement;\n /** 分段控制器 */\n 'n-segmented': SegmentedElement;\n /** 下拉选择框 */\n 'n-select': SelectElement | SelectMultipleElement;\n /** 骨架屏 */\n 'n-skeleton': SkeletonElement;\n /** 加载中 */\n 'n-spin': SpinElement;\n /** 开关 */\n 'n-switch': SwitchElement;\n /** 树形渲染 */\n 'n-tree':\n | TreeElement\n | TreeStringElement\n | TreeSchemaElement\n | TreeMultipleElement\n | TreeMultipleStringElement\n | TreeMultipleSchemaElement;\n /** 文字排版 */\n 'n-typography': TypographyElement;\n /** 标签页 */\n 'n-tabs': TabsElement;\n /** 标签 */\n 'n-tag': TagElement;\n /** 导航菜单 */\n 'n-menu': MenuElement | MenuMultipleElement;\n /** Cron表达式编辑器 */\n 'n-cron': CronElement;\n /** 日期选择器\n * @since 2.1.0\n */\n 'n-data-picker': DatePickerElement;\n /** 数据表格\n * @since 2.2.0\n */\n 'n-table': TableElement;\n /** 分页器\n * @since 2.2.0\n */\n 'n-pagination': PaginationElement;\n /** 响应内部变化\n * @since 2.3.0\n */\n 'n-provider': ProviderElement;\n /** 模态框\n * @since 2.6.0\n */\n 'n-modal': ModalElement;\n /**\n * 二维码\n * @scince 2.9.0\n */\n 'n-qrcode': QrCodeElement;\n}\ntype IntrinsicNekoElement = Transform<CustomElementTags>;\n\ndeclare module 'solid-js' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends HTMLElementTags, IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\n\nexport interface ComponentOptions<T> {\n element: T & ICustomElement;\n}\n"],"names":["default","Avatar","AvatarGroup","BackTop","FieldName","Size","Status","Button","CaptureScreen","Carousel","Checkbox","Code","ColorPalette","ColorPicker","Cron","DatePicker","dayjs","Dropdown","Empty","fromSchema","getOptions","HighlightText","Img","Input","InputNumber","Md","mdStyle","Menu","Modal","OpenState","notification","Pagination","Popover","Prism","Provider","QrCode","Radio","Segmented","Select","Skeleton","Spin","Switch","Table","Tabs","Tag","generateColor","theme","toneColor","Tree","Typography","customElement","getCurrentElement","hot","noSh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AAO,KAAgD,WAAY,AACvF,QAAShC,WAAWiC,KAAK,KAAQ,SAAU,AAC3C,QAASjC,WAAWkC,QAAQ,KAAkD,YAAa,AAC3F,QAAwBlC,WAAWmC,MAAM,KAA8C,UAAW,AAClG,QAASnC,WAAWoC,KAAK,KAA8D,SAAU,AACjG,QAASpC,WAAWqC,SAAS,KAAoD,aAAc,AAC/F,QACErC,WAAWsC,MAAM,KAKZ,UAAW,AAClB,QAAStC,WAAWuC,QAAQ,KAAkD,YAAa,AAC3F,QAASvC,WAAWwC,IAAI,KAA0C,QAAS,AAC3E,QAASxC,WAAWyC,MAAM,KAA8C,UAAW,AACnF,QAASzC,WAAW0C,KAAK,KAA4C,SAAU,AAC/E,QAAyB1C,WAAW2C,IAAI,KAA0C,QAAS,AAC3F,QAAS3C,WAAW4C,GAAG,KAAwC,OAAQ,AACvE,QAEEC,aAAa,CACb7C,WAAW8C,KAAK,CAEhBC,SAAS,KACJ,SAAU,AACjB,QACE/C,WAAWgD,IAAI,KAcV,QAAS,AAChB,QAAShD,WAAWiD,UAAU,KAAsD,cAAe,AAEnG,QAASC,aAAa,CAAEC,iBAAiB,CAAEC,GAAG,CAAEC,WAAW,CAAEC,SAAS,KAAQ,eAAgB"}
|
|
1
|
+
{"version":3,"sources":["../components/index.ts"],"sourcesContent":["'use client';\n\nexport { default as Avatar, type AvatarElement, type AvatarProps } from './avatar';\nexport {\n default as AvatarGroup,\n type AvatarGroupElement,\n type AvatarGroupProps,\n} from './avatar/group';\nexport { default as BackTop, type BackTopElement, type BackTopProps } from './back-top';\nexport { type BaseOption, type BasicConfig, FieldName, Size, Status } from './basic-config';\nexport { default as Button, type ButtonElement, type ButtonProps } from './button';\nexport {\n default as CaptureScreen,\n type CaptureScreenElement,\n type CaptureScreenProps,\n} from './capture-screen';\nexport { default as Carousel, type CarouselElement, type CarouselProps } from './carousel';\nexport {\n default as Checkbox,\n type CheckboxBoolElement,\n type CheckboxBoolProps,\n type CheckboxGroupElement,\n type CheckboxGroupProps,\n} from './checkbox';\nexport { default as Code, type CodeElement, type CodeProps } from './code';\nexport {\n default as ColorPalette,\n type ColorPaletteElement,\n type ColorPaletteProps,\n} from './color-palette';\nexport {\n default as ColorPicker,\n type ColorPickerElement,\n type ColorPickerProps,\n} from './color-picker';\nexport { default as Cron, type CronElement, type CronProps } from './cron';\nexport { default as DatePicker, type DatePickerElement, type DatePickerProps } from './date-picker';\nexport { default as dayjs } from './date-picker/dayjs';\nexport {\n default as Dropdown,\n type DropdownElement,\n type DropdownMultipleElement,\n type DropdownMultipleProps,\n type DropdownProps,\n} from './dropdown';\nexport { default as Empty, type EmptyElement, type EmptyProps } from './empty';\nexport { default as fromSchema } from './from-schema';\nexport { default as getOptions } from './get-options';\nexport {\n default as HighlightText,\n type HighlightTextElement,\n type HighlightTextProps,\n} from './highlight-text';\nexport { default as Img, type ImgElement, type ImgProps } from './img';\nexport { default as Input, type InputElement, type InputProps } from './input';\nexport {\n default as InputNumber,\n type InputNumberElement,\n type InputNumberProps,\n} from './input-number';\nexport { default as Md, type MdElement, type MdProps } from './md';\nexport { default as mdStyle } from './md-style';\nexport {\n default as Menu,\n type MenuElement,\n type MenuMultipleElement,\n type MenuMultipleProps,\n type MenuOption,\n type MenuProps,\n} from './menu';\nexport {\n default as Modal,\n type ModalElement,\n type ModalProps,\n OpenState,\n type OpenStateKey,\n} from './modal';\nexport {\n default as notification,\n type NotificationProps,\n type NotificationType,\n} from './notification';\nexport { default as Pagination, type PaginationElement, type PaginationProps } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\nexport { default as Prism } from './prism';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { type IntRange, default as QrCode, type QrCodeElement, type QrCodeProps } from './qrcode';\nexport { default as Radio, type RadioElement, type RadioOption, type RadioProps } from './radio';\nexport { default as Segmented, type SegmentedElement, type SegmentedProps } from './segmented';\nexport {\n default as Select,\n type SelectElement,\n type SelectMultipleElement,\n type SelectMultipleProps,\n type SelectProps,\n} from './select';\nexport { default as Skeleton, type SkeletonElement, type SkeletonProps } from './skeleton';\nexport { default as Spin, type SpinElement, type SpinProps } from './spin';\nexport { default as Switch, type SwitchElement, type SwitchProps } from './switch';\nexport { default as Table, type TableElement, type TableProps } from './table';\nexport { type TabOption, default as Tabs, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n type ColorScheme,\n generateColor,\n default as theme,\n type ThemeOption,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\n type TreeData,\n type TreeElement,\n type TreeMultipleElement,\n type TreeMultipleProps,\n type TreeMultipleSchemaElement,\n type TreeMultipleSchemaProps,\n type TreeMultipleStringElement,\n type TreeMultipleStringProps,\n type TreeProps,\n type TreeSchemaElement,\n type TreeSchemaProps,\n type TreeStringElement,\n type TreeStringProps,\n} from './tree';\nexport { default as Typography, type TypographyElement, type TypographyProps } from './typography';\nexport type { CustomElement } from 'custom-element-type';\nexport { customElement, getCurrentElement, hot, noShadowDOM, withSolid } from 'solid-element';\nimport type { ICustomElement, Transform } from 'custom-element-type';\n\nimport type {\n AvatarElement,\n AvatarGroupElement,\n BackTopElement,\n ButtonElement,\n CaptureScreenElement,\n CarouselElement,\n CheckboxBoolElement,\n CheckboxGroupElement,\n CodeElement,\n ColorPaletteElement,\n ColorPickerElement,\n CronElement,\n DatePickerElement,\n DropdownElement,\n DropdownMultipleElement,\n EmptyElement,\n HighlightTextElement,\n ImgElement,\n InputElement,\n InputNumberElement,\n MdElement,\n MenuElement,\n MenuMultipleElement,\n ModalElement,\n PaginationElement,\n PopoverElement,\n ProviderElement,\n QrCodeElement,\n RadioElement,\n SegmentedElement,\n SelectElement,\n SelectMultipleElement,\n SkeletonElement,\n SpinElement,\n SwitchElement,\n TableElement,\n TabsElement,\n TagElement,\n TreeElement,\n TreeMultipleElement,\n TreeMultipleSchemaElement,\n TreeMultipleStringElement,\n TreeSchemaElement,\n TreeStringElement,\n TypographyElement,\n} from '.';\n\n/** 组件列表\n * @author monako97\n * @ignore optional\n */\ninterface CustomElementTags {\n /** 头像 */\n 'n-avatar': AvatarElement;\n /** 头像组 */\n 'n-avatar-group': AvatarGroupElement;\n /** 返回顶部 */\n 'n-back-top': BackTopElement;\n /** 按钮 */\n 'n-button': ButtonElement;\n /** 捕获屏幕 */\n 'n-capture-screen': CaptureScreenElement;\n /** 走马灯、轮播 */\n 'n-carousel': CarouselElement;\n /** 复选框 */\n 'n-checkbox': CheckboxBoolElement | CheckboxGroupElement;\n /** 代码框 */\n 'n-code': CodeElement;\n /** 取色器 */\n 'n-color-palette': ColorPaletteElement;\n /** 取色器(弹出类型) */\n 'n-color-picker': ColorPickerElement;\n /** 下拉面板 */\n 'n-dropdown': DropdownElement | DropdownMultipleElement;\n /** 空面板 */\n 'n-empty': EmptyElement;\n /** 匹配高亮文字 */\n 'n-highlight-text': HighlightTextElement;\n /** 图片查看器 */\n 'n-img': ImgElement;\n /** 输入框 */\n 'n-input': InputElement;\n /** 数字输入框 */\n 'n-input-number': InputNumberElement;\n /** Markdown渲染 */\n 'n-md': MdElement;\n /** 弹出气泡面板 */\n 'n-popover': PopoverElement;\n /** 单选项 */\n 'n-radio': RadioElement;\n /** 分段控制器 */\n 'n-segmented': SegmentedElement;\n /** 下拉选择框 */\n 'n-select': SelectElement | SelectMultipleElement;\n /** 骨架屏 */\n 'n-skeleton': SkeletonElement;\n /** 加载中 */\n 'n-spin': SpinElement;\n /** 开关 */\n 'n-switch': SwitchElement;\n /** 树形渲染 */\n 'n-tree':\n | TreeElement\n | TreeStringElement\n | TreeSchemaElement\n | TreeMultipleElement\n | TreeMultipleStringElement\n | TreeMultipleSchemaElement;\n /** 文字排版 */\n 'n-typography': TypographyElement;\n /** 标签页 */\n 'n-tabs': TabsElement;\n /** 标签 */\n 'n-tag': TagElement;\n /** 导航菜单 */\n 'n-menu': MenuElement | MenuMultipleElement;\n /** Cron表达式编辑器 */\n 'n-cron': CronElement;\n /** 日期选择器\n * @since 2.1.0\n */\n 'n-data-picker': DatePickerElement;\n /** 数据表格\n * @since 2.2.0\n */\n 'n-table': TableElement;\n /** 分页器\n * @since 2.2.0\n */\n 'n-pagination': PaginationElement;\n /** 响应内部变化\n * @since 2.3.0\n */\n 'n-provider': ProviderElement;\n /** 模态框\n * @since 2.6.0\n */\n 'n-modal': ModalElement;\n /**\n * 二维码\n * @since 2.9.0\n */\n 'n-qrcode': QrCodeElement;\n}\ntype IntrinsicNekoElement = Transform<CustomElementTags>;\n\ndeclare module 'solid-js' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends HTMLElementTags, IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\n\nexport interface ComponentOptions<T> {\n element: T & ICustomElement;\n}\n"],"names":["default","Avatar","AvatarGroup","BackTop","FieldName","Size","Status","Button","CaptureScreen","Carousel","Checkbox","Code","ColorPalette","ColorPicker","Cron","DatePicker","dayjs","Dropdown","Empty","fromSchema","getOptions","HighlightText","Img","Input","InputNumber","Md","mdStyle","Menu","Modal","OpenState","notification","Pagination","Popover","Prism","Provider","QrCode","Radio","Segmented","Select","Skeleton","Spin","Switch","Table","Tabs","Tag","generateColor","theme","toneColor","Tree","Typography","customElement","getCurrentElement","hot","noShadowDOM","withSolid"],"mappings":"AAEA,OAASA,WAAWC,MAAM,KAA8C,UAAW,AACnF,QACED,WAAWE,WAAW,KAGjB,gBAAiB,AACxB,QAASF,WAAWG,OAAO,KAAgD,YAAa,AACxF,QAA4CC,SAAS,CAAEC,IAAI,CAAEC,MAAM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AU,AACjG,QAASpC,WAAWqC,SAAS,KAAoD,aAAc,AAC/F,QACErC,WAAWsC,MAAM,KAKZ,UAAW,AAClB,QAAStC,WAAWuC,QAAQ,KAAkD,YAAa,AAC3F,QAASvC,WAAWwC,IAAI,KAA0C,QAAS,AAC3E,QAASxC,WAAWyC,MAAM,KAA8C,UAAW,AACnF,QAASzC,WAAW0C,KAAK,KAA4C,SAAU,AAC/E,QAAyB1C,WAAW2C,IAAI,KAA0C,QAAS,AAC3F,QAAS3C,WAAW4C,GAAG,KAAwC,OAAQ,AACvE,QAEEC,aAAa,CACb7C,WAAW8C,KAAK,CAEhBC,SAAS,KACJ,SAAU,AACjB,QACE/C,WAAWgD,IAAI,KAcV,QAAS,AAChB,QAAShD,WAAWiD,UAAU,KAAsD,cAAe,AAEnG,QAASC,aAAa,CAAEC,iBAAiB,CAAEC,GAAG,CAAEC,WAAW,CAAEC,SAAS,KAAQ,eAAgB"}
|
package/es/qrcode/index.d.ts
CHANGED
|
@@ -43,6 +43,12 @@ export interface QrCodeProps {
|
|
|
43
43
|
* @default 7
|
|
44
44
|
*/
|
|
45
45
|
iconSize?: number;
|
|
46
|
+
/**
|
|
47
|
+
* 模块形状
|
|
48
|
+
* @default 'rect'
|
|
49
|
+
* @since 2.9.1
|
|
50
|
+
*/
|
|
51
|
+
shape?: 'rect' | 'rhombus' | 'heart' | 'circle';
|
|
46
52
|
}
|
|
47
53
|
declare const QRCode: (_props: QrCodeProps) => JSX.Element;
|
|
48
54
|
export type QrCodeElement = CustomElement<QrCodeProps>;
|
package/es/qrcode/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{use as e}from"solid-js/web";import{template as
|
|
1
|
+
import{use as e}from"solid-js/web";import{template as r}from"solid-js/web";import{setAttribute as o}from"solid-js/web";import"solid-js/web";import{insert as t}from"solid-js/web";import{effect as i}from"solid-js/web";import{createComponent as l}from"solid-js/web";let s=r('<svg><image preserveAspectRatio="xMidYMid meet"></svg>',!1,!0),d=r('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="none" shape-rendering="crispEdges" role="img"><path></path><path>'),n=r('<canvas role="img">'),b=r("<style>");import{createEffect as a,mergeProps as c,Show as u,splitProps as m}from"solid-js";import{customElement as h}from"solid-element";import{clearAttribute as g}from"../basic-config";import f,{inline as v}from"../theme";import{Ecc as p,encodeSegments as $,makeSegments as z}from"./qrcode";let w=r=>{let b,h,g;let{isDark:v}=f,[w,S]=m(c({size:160,iconSize:7,border:1,ecl:"m",type:"svg"},r),["value","border","size","type","minVersion","maxVersion","mask","boostEcc","ecl","bgColor","color","iconSize","shape"]),C={l:p.get("LOW"),m:p.get("MEDIUM"),q:p.get("QUARTILE"),h:p.get("HIGH")};return a(e=>{let r;v();let o=$(z(w.value),C[w.ecl],w.minVersion,w.maxVersion,w.mask,w.boostEcc);if("canvas"===w.type){if(w.size<=0||w.border<0||!b)throw RangeError("Value out of range");let t=w.size/(o.size+2*w.border),i=t/2;b.width=w.size,b.height=w.size,r=window.getComputedStyle(b);let l=b.getContext("2d"),s=w.color||(null==e?void 0:e.color)||r.color,d=w.bgColor||(null==e?void 0:e.bg)||r.backgroundColor;l.clearRect(0,0,w.size,w.size),l.fillStyle=d,l.fillRect(0,0,w.size,w.size),l.fillStyle=s;for(let e=-w.border;e<o.size+w.border;e++){let r=(e+w.border)*t;for(let s=-w.border;s<o.size+w.border;s++)if(o.getModule(s,e)){let e=(s+w.border)*t;switch(w.shape){case"circle":l.beginPath(),l.arc(e+i,r+i,i,0,2*Math.PI),l.fill();break;case"heart":l.beginPath(),l.moveTo(e+i,r+t/4),l.bezierCurveTo(e+.1*t,r-.2*t,e-.3*t,r+.6*t,e+i,r+t),l.bezierCurveTo(e+1.3*t,r+.6*t,e+.9*t,r-.2*t,e+i,r+t/4),l.closePath(),l.fill();break;case"rhombus":l.beginPath(),l.moveTo(e+i,r),l.lineTo(e+t,r+i),l.lineTo(e+i,r+t),l.lineTo(e,r+i),l.closePath(),l.fill();break;default:l.fillRect(Math.floor(e),Math.floor(r),Math.ceil(t),Math.ceil(t))}}}S.icon&&(g||(g=new Image(w.iconSize,w.iconSize)),g.src=S.icon,g.onload=()=>{let e=(w.size+w.border*t-w.iconSize)/2;l.drawImage(g,e,e,w.iconSize,w.iconSize)})}else{if(w.border<0)throw RangeError("Border must be non-negative");let t=[];for(let e=0;e<o.size;e++)for(let r=0;r<o.size;r++)if(o.getModule(r,e))switch(w.shape){case"circle":t.push(`M${r+w.border+.5},${e+w.border+.5} m -0.5, 0 a 0.5,0.5 0 1,0 1,0 a 0.5,0.5 0 1,0 -1,0`);break;case"rhombus":t.push(`M${r+w.border+.5},${e+w.border} L${r+w.border+1},${e+w.border+.5} L${r+w.border+.5},${e+w.border+1} L${r+w.border},${e+w.border+.5} Z`);break;case"heart":t.push(`M${r+w.border+.5},${e+w.border+.25} C${r+w.border+.1},${e+w.border-.2} ${r+w.border-.3},${e+w.border+.6} ${r+w.border+.5},${e+w.border+1} C${r+w.border+1.3},${e+w.border+.6} ${r+w.border+.9},${e+w.border-.2} ${r+w.border+.5},${e+w.border+.25} Z`);break;default:t.push(`M${r+w.border},${e+w.border}h1v1h-1z`)}let i=null==h?void 0:h.querySelectorAll("path"),l=o.size+2*w.border;null==h||h.setAttribute("viewBox",`0 0 ${l} ${l}`),r=window.getComputedStyle(h),i.length>0&&(i[0].setAttribute("d",`M0,0 h${l}v${l}H0z`),i[0].setAttribute("fill",w.bgColor||(null==e?void 0:e.bg)||r.backgroundColor),i[1].setAttribute("d",t.join(" ")),i[1].setAttribute("fill",w.color||(null==e?void 0:e.color)||r.color));let s=null==h?void 0:h.querySelector("image");if(s){let e=`${(o.size+2*w.border-w.iconSize)/2}`;s.setAttribute("x",e),s.setAttribute("y",e),s.setAttribute("width",`${w.iconSize}`),s.setAttribute("height",`${w.iconSize}`)}}return{color:r.color,bg:r.backgroundColor}}),l(u,{get when(){return"svg"===w.type},get fallback(){return(()=>{let r=n(),o=b;return"function"==typeof o?e(o,r):b=r,r})()},get children(){let r=d(),n=h;return r.firstChild.nextSibling,"function"==typeof n?e(n,r):h=r,t(r,l(u,{get when(){return S.icon},get children(){let e=s();return i(()=>o(e,"href",S.icon)),e}}),null),i(e=>{let t=w.size,i=w.size;return t!==e._v$&&o(r,"width",e._v$=t),i!==e._v$2&&o(r,"height",e._v$2=i),e},{_v$:void 0,_v$2:void 0}),r}})};export const defaultProps={value:"",icon:void 0,color:void 0,bgColor:void 0,size:void 0,iconSize:void 0,ecl:void 0,minVersion:void 0,maxVersion:void 0,mask:void 0,boostEcc:!1,border:void 0,type:void 0,shape:void 0};h("n-qrcode",defaultProps,(e,r)=>{let o=r.element;return a(()=>{g(o,["value","icon"])}),[(()=>{let e=b();return e.textContent=v,e})(),l(w,e)]});export default w;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/es/qrcode/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../components/qrcode/index.tsx"],"sourcesContent":["import { createEffect, JSX, mergeProps, Show, splitProps } from 'solid-js';\nimport { customElement } from 'solid-element';\n\nimport { clearAttribute } from '../basic-config';\nimport theme, { inline } from '../theme';\n\nimport { Ecc, encodeSegments, type IntRange, makeSegments } from './qrcode';\nexport type { IntRange } from './qrcode';\nexport interface QrCodeProps {\n /** 自定义类名 */\n class?: string;\n style?: string | JSX.CSSProperties;\n /** 二维码值 */\n value: string;\n /** 二维码模块的颜色 */\n color?: string;\n /** 二维码背景色 */\n bgColor?: string;\n /**\n * 二维码尺寸\n * @default 150\n */\n size?: number;\n /** 纠错等级; 分别对应7%、15%、25%、30%的数据纠错能力\n * @default 'm'\n */\n ecl?: 'l' | 'm' | 'q' | 'h';\n minVersion?: IntRange<1, 41>;\n maxVersion?: IntRange<1, 41>;\n mask?: -1 | IntRange<0, 8>;\n boostEcc?: boolean;\n /**\n * 模块外围的边框宽度(模块单位,非像素)\n * @default 1\n */\n border?: IntRange<1, 101>;\n /**\n * 渲染方式\n * @default 'svg'\n */\n type?: 'svg' | 'canvas';\n /**\n * 二维码图标\n */\n icon?: string;\n /**\n * 二维码图标尺寸\n * @default 7\n */\n iconSize?: number;\n}\nconst QRCode = (_props: QrCodeProps) => {\n const { isDark } = theme;\n let cvs: HTMLCanvasElement | undefined;\n let svg: SVGSVGElement | undefined;\n let img: HTMLImageElement | undefined;\n const normal = mergeProps(\n {\n size: 160,\n iconSize: 7,\n border: 1,\n ecl: 'm' as const,\n type: 'svg' as const,\n },\n _props,\n );\n const [props, other] = splitProps(normal, [\n 'value',\n 'border',\n 'size',\n 'type',\n 'minVersion',\n 'maxVersion',\n 'mask',\n 'boostEcc',\n 'ecl',\n 'bgColor',\n 'color',\n 'iconSize',\n ]);\n const eccMap = {\n l: Ecc.get('LOW'),\n m: Ecc.get('MEDIUM'),\n q: Ecc.get('QUARTILE'),\n h: Ecc.get('HIGH'),\n };\n\n createEffect((prev?: { color?: string; bg?: string }) => {\n isDark(); // 响应主题模式\n const segs = makeSegments(props.value);\n const qr = encodeSegments(\n segs,\n eccMap[props.ecl],\n props.minVersion,\n props.maxVersion,\n props.mask,\n props.boostEcc,\n );\n let styles: CSSStyleDeclaration;\n\n if (props.type === 'canvas') {\n if (props.size <= 0 || props.border < 0 || !cvs) throw new RangeError('Value out of range');\n const _scale = props.size / (qr.size + props.border * 2);\n const scale = Math.ceil(_scale);\n\n cvs.width = props.size;\n cvs.height = props.size;\n styles = window.getComputedStyle(cvs as unknown as Element);\n const ctx = cvs.getContext('2d') as CanvasRenderingContext2D;\n const color = props.color || prev?.color || styles.color;\n const bgColor = props.bgColor || prev?.bg || styles.backgroundColor;\n\n ctx.clearRect(0, 0, props.size, props.size);\n for (let y = -props.border; y < qr.size + props.border; y++) {\n for (let x = -props.border; x < qr.size + props.border; x++) {\n ctx.fillStyle = qr.getModule(x, y) ? color : bgColor;\n ctx.fillRect((x + props.border) * scale, (y + props.border) * scale, scale, scale);\n }\n }\n // 如果有图标,则绘制到中心\n if (other.icon) {\n if (!img) {\n img = new Image(props.iconSize, props.iconSize);\n }\n img.src = other.icon;\n img.onload = () => {\n const offset = (props.size + props.border * scale - props.iconSize) / 2;\n\n ctx.drawImage(img!, offset, offset, props.iconSize, props.iconSize);\n };\n }\n } else {\n if (props.border < 0) {\n throw new RangeError('Border must be non-negative');\n }\n const parts: string[] = [];\n\n for (let y = 0; y < qr.size; y++) {\n for (let x = 0; x < qr.size; x++) {\n if (qr.getModule(x, y)) {\n parts.push(`M${x + props.border},${y + props.border}h1v1h-1z`);\n }\n }\n }\n const paths = svg?.querySelectorAll('path') as unknown as SVGPathElement[];\n const box_size = qr.size + props.border * 2;\n\n svg?.setAttribute('viewBox', `0 0 ${box_size} ${box_size}`);\n styles = window.getComputedStyle(svg as unknown as Element);\n if (paths.length > 0) {\n paths[0].setAttribute('d', `M0,0 h${box_size}v${box_size}H0z`);\n paths[0].setAttribute('fill', props.bgColor || prev?.bg || styles.backgroundColor);\n paths[1].setAttribute('d', parts.join(' '));\n paths[1].setAttribute('fill', props.color || prev?.color || styles.color);\n }\n // icon\n const icon = svg?.querySelector('image');\n\n if (icon) {\n const offset = `${(qr.size + props.border * 2 - props.iconSize) / 2}`;\n\n icon.setAttribute('x', offset);\n icon.setAttribute('y', offset);\n icon.setAttribute('width', `${props.iconSize}`);\n icon.setAttribute('height', `${props.iconSize}`);\n }\n }\n\n return {\n color: styles.color,\n bg: styles.backgroundColor,\n };\n });\n\n return (\n <Show when={props.type === 'svg'} fallback={<canvas ref={cvs} role=\"img\" />}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n stroke=\"none\"\n width={props.size}\n height={props.size}\n ref={svg}\n shape-rendering=\"crispEdges\"\n role=\"img\"\n >\n <path />\n <path />\n <Show when={other.icon}>\n <image href={other.icon} preserveAspectRatio=\"xMidYMid meet\" />\n </Show>\n </svg>\n </Show>\n );\n};\n\nexport type QrCodeElement = CustomElement<QrCodeProps>;\nexport const defaultProps: QrCodeProps = {\n value: '',\n icon: void 0,\n color: void 0,\n bgColor: void 0,\n size: void 0,\n iconSize: void 0,\n ecl: void 0,\n minVersion: void 0,\n maxVersion: void 0,\n mask: void 0,\n boostEcc: false,\n border: void 0,\n type: void 0,\n};\n\ncustomElement<QrCodeProps>('n-qrcode', defaultProps, (props, opt) => {\n const el = opt.element;\n\n createEffect(() => {\n clearAttribute(el, ['value', 'icon']);\n });\n return (\n <>\n <style textContent={inline} />\n <QRCode {...props} />\n </>\n );\n});\n\nexport default QRCode;\n"],"names":["createEffect","mergeProps","Show","splitProps","customElement","clearAttribute","theme","inline","Ecc","encodeSegments","makeSegments","QRCode","_props","cvs","svg","img","isDark","props","other","size","iconSize","border","ecl","type","eccMap","l","get","m","q","h","prev","styles","qr","value","minVersion","maxVersion","mask","boostEcc","RangeError","scale","Math","ceil","width","height","window","getComputedStyle","ctx","getContext","color","bgColor","bg","backgroundColor","clearRect","y","x","fillStyle","getModule","fillRect","icon","Image","src","onload","offset","drawImage","parts","push","paths","querySelectorAll","box_size","setAttribute","length","join","querySelector","defaultProps","opt","el","element"],"mappings":"+fAAA,QAASA,gBAAAA,CAAY,CAAOC,cAAAA,CAAU,CAAEC,QAAAA,CAAI,CAAEC,cAAAA,CAAU,KAAQ,UAAW,AAC3E,QAASC,iBAAAA,CAAa,KAAQ,eAAgB,AAE9C,QAASC,kBAAAA,CAAc,KAAQ,iBAAkB,AACjD,QAAOC,GAASC,UAAAA,CAAM,KAAQ,UAAW,AAEzC,QAASC,OAAAA,CAAG,CAAEC,kBAAAA,CAAc,CAAiBC,gBAAAA,CAAY,KAAQ,UAAW,CA6C5E,IAAMC,EAAS,AAACC,QAEVC,EACAC,EACAC,EAHJ,GAAM,CAAEC,OAAAA,CAAM,CAAE,CAAGV,EAcb,CAACW,EAAOC,EAAM,CAAGf,EAVRF,EACb,CACEkB,KAAM,IACNC,SAAU,EACVC,OAAQ,EACRC,IAAK,IACLC,KAAM,KACR,EACAX,GAEwC,CACxC,QACA,SACA,OACA,OACA,aACA,aACA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AI,4GAa1B,CAGA,QAAO,MAAMsD,aAA4B,CACvCxC,MAAO,GACPyB,KAAM,KAAK,EACXV,MAAO,KAAK,EACZC,QAAS,KAAK,EACd9B,KAAM,KAAK,EACXC,SAAU,KAAK,EACfE,IAAK,KAAK,EACVY,WAAY,KAAK,EACjBC,WAAY,KAAK,EACjBC,KAAM,KAAK,EACXC,SAAU,CAAA,EACVhB,OAAQ,KAAK,EACbE,KAAM,KAAK,CACb,CAAE,CAEFnB,EAA2B,WAAYqE,aAAc,CAACxD,EAAOyD,KAC3D,IAAMC,EAAKD,EAAIE,OAAO,CAKtB,OAHA5E,EAAa,KACXK,EAAesE,EAAI,CAAC,QAAS,OAAO,CACtC,yCAGwBpE,UACnBI,EAAWM,GAGlB,EAEA,gBAAeN,CAAO"}
|
|
1
|
+
{"version":3,"sources":["../../components/qrcode/index.tsx"],"sourcesContent":["import { createEffect, JSX, mergeProps, Show, splitProps } from 'solid-js';\nimport { customElement } from 'solid-element';\n\nimport { clearAttribute } from '../basic-config';\nimport theme, { inline } from '../theme';\n\nimport { Ecc, encodeSegments, type IntRange, makeSegments } from './qrcode';\nexport type { IntRange } from './qrcode';\nexport interface QrCodeProps {\n /** 自定义类名 */\n class?: string;\n style?: string | JSX.CSSProperties;\n /** 二维码值 */\n value: string;\n /** 二维码模块的颜色 */\n color?: string;\n /** 二维码背景色 */\n bgColor?: string;\n /**\n * 二维码尺寸\n * @default 150\n */\n size?: number;\n /** 纠错等级; 分别对应7%、15%、25%、30%的数据纠错能力\n * @default 'm'\n */\n ecl?: 'l' | 'm' | 'q' | 'h';\n minVersion?: IntRange<1, 41>;\n maxVersion?: IntRange<1, 41>;\n mask?: -1 | IntRange<0, 8>;\n boostEcc?: boolean;\n /**\n * 模块外围的边框宽度(模块单位,非像素)\n * @default 1\n */\n border?: IntRange<1, 101>;\n /**\n * 渲染方式\n * @default 'svg'\n */\n type?: 'svg' | 'canvas';\n /**\n * 二维码图标\n */\n icon?: string;\n /**\n * 二维码图标尺寸\n * @default 7\n */\n iconSize?: number;\n /**\n * 模块形状\n * @default 'rect'\n * @since 2.9.1\n */\n shape?: 'rect' | 'rhombus' | 'heart' | 'circle';\n}\nconst QRCode = (_props: QrCodeProps) => {\n const { isDark } = theme;\n let cvs: HTMLCanvasElement | undefined;\n let svg: SVGSVGElement | undefined;\n let img: HTMLImageElement | undefined;\n const normal = mergeProps(\n {\n size: 160,\n iconSize: 7,\n border: 1,\n ecl: 'm' as const,\n type: 'svg' as const,\n },\n _props,\n );\n const [props, other] = splitProps(normal, [\n 'value',\n 'border',\n 'size',\n 'type',\n 'minVersion',\n 'maxVersion',\n 'mask',\n 'boostEcc',\n 'ecl',\n 'bgColor',\n 'color',\n 'iconSize',\n 'shape',\n ]);\n const eccMap = {\n l: Ecc.get('LOW'),\n m: Ecc.get('MEDIUM'),\n q: Ecc.get('QUARTILE'),\n h: Ecc.get('HIGH'),\n };\n\n createEffect((prev?: { color?: string; bg?: string }) => {\n isDark(); // 响应主题模式\n const segs = makeSegments(props.value);\n const qr = encodeSegments(\n segs,\n eccMap[props.ecl],\n props.minVersion,\n props.maxVersion,\n props.mask,\n props.boostEcc,\n );\n let styles: CSSStyleDeclaration;\n\n if (props.type === 'canvas') {\n if (props.size <= 0 || props.border < 0 || !cvs) throw new RangeError('Value out of range');\n const scale = props.size / (qr.size + props.border * 2);\n const radius = scale / 2; // 半径\n\n cvs.width = props.size;\n cvs.height = props.size;\n styles = window.getComputedStyle(cvs as unknown as Element);\n const ctx = cvs.getContext('2d') as CanvasRenderingContext2D;\n const color = props.color || prev?.color || styles.color;\n const bgColor = props.bgColor || prev?.bg || styles.backgroundColor;\n\n ctx.clearRect(0, 0, props.size, props.size);\n ctx.fillStyle = bgColor;\n ctx.fillRect(0, 0, props.size, props.size);\n ctx.fillStyle = color;\n for (let y = -props.border; y < qr.size + props.border; y++) {\n const ypos = (y + props.border) * scale;\n\n for (let x = -props.border; x < qr.size + props.border; x++) {\n if (qr.getModule(x, y)) {\n const xpos = (x + props.border) * scale;\n\n switch (props.shape) {\n case 'circle':\n ctx.beginPath();\n ctx.arc(xpos + radius, ypos + radius, radius, 0, Math.PI * 2);\n ctx.fill();\n break;\n case 'heart':\n ctx.beginPath();\n ctx.moveTo(xpos + radius, ypos + scale / 4);\n ctx.bezierCurveTo(\n xpos + scale * 0.1,\n ypos - scale * 0.2,\n xpos - scale * 0.3,\n ypos + scale * 0.6,\n xpos + radius,\n ypos + scale,\n );\n ctx.bezierCurveTo(\n xpos + scale * 1.3,\n ypos + scale * 0.6,\n xpos + scale * 0.9,\n ypos - scale * 0.2,\n xpos + radius,\n ypos + scale / 4,\n );\n ctx.closePath();\n ctx.fill();\n break;\n case 'rhombus':\n ctx.beginPath();\n ctx.moveTo(xpos + radius, ypos);\n ctx.lineTo(xpos + scale, ypos + radius);\n ctx.lineTo(xpos + radius, ypos + scale);\n ctx.lineTo(xpos, ypos + radius);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rect':\n default:\n // 避免由于小数位带来的间隔问题\n ctx.fillRect(\n Math.floor(xpos),\n Math.floor(ypos),\n Math.ceil(scale),\n Math.ceil(scale),\n );\n break;\n }\n }\n }\n }\n // 恢复缩放\n // ctx.restore();\n // 如果有图标,则绘制到中心\n if (other.icon) {\n if (!img) {\n img = new Image(props.iconSize, props.iconSize);\n }\n img.src = other.icon;\n img.onload = () => {\n const offset = (props.size + props.border * scale - props.iconSize) / 2;\n\n ctx.drawImage(img!, offset, offset, props.iconSize, props.iconSize);\n };\n }\n } else {\n if (props.border < 0) {\n throw new RangeError('Border must be non-negative');\n }\n const parts: string[] = [];\n\n for (let y = 0; y < qr.size; y++) {\n for (let x = 0; x < qr.size; x++) {\n if (qr.getModule(x, y)) {\n switch (props.shape) {\n case 'circle':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border + 0.5} m -0.5, 0 a 0.5,0.5 0 1,0 1,0 a 0.5,0.5 0 1,0 -1,0`,\n );\n break;\n case 'rhombus':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border} L${x + props.border + 1},${y + props.border + 0.5} L${x + props.border + 0.5},${y + props.border + 1} L${x + props.border},${y + props.border + 0.5} Z`,\n );\n break;\n case 'heart':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border + 0.25} C${x + props.border + 0.1},${y + props.border - 0.2} ${x + props.border - 0.3},${y + props.border + 0.6} ${x + props.border + 0.5},${y + props.border + 1} C${x + props.border + 1.3},${y + props.border + 0.6} ${x + props.border + 0.9},${y + props.border - 0.2} ${x + props.border + 0.5},${y + props.border + 0.25} Z`,\n );\n break;\n case 'rect':\n default:\n parts.push(`M${x + props.border},${y + props.border}h1v1h-1z`);\n break;\n }\n }\n }\n }\n const paths = svg?.querySelectorAll('path') as unknown as SVGPathElement[];\n const box_size = qr.size + props.border * 2;\n\n svg?.setAttribute('viewBox', `0 0 ${box_size} ${box_size}`);\n styles = window.getComputedStyle(svg as unknown as Element);\n if (paths.length > 0) {\n paths[0].setAttribute('d', `M0,0 h${box_size}v${box_size}H0z`);\n paths[0].setAttribute('fill', props.bgColor || prev?.bg || styles.backgroundColor);\n paths[1].setAttribute('d', parts.join(' '));\n paths[1].setAttribute('fill', props.color || prev?.color || styles.color);\n }\n // icon\n const icon = svg?.querySelector('image');\n\n if (icon) {\n const offset = `${(qr.size + props.border * 2 - props.iconSize) / 2}`;\n\n icon.setAttribute('x', offset);\n icon.setAttribute('y', offset);\n icon.setAttribute('width', `${props.iconSize}`);\n icon.setAttribute('height', `${props.iconSize}`);\n }\n }\n\n return {\n color: styles.color,\n bg: styles.backgroundColor,\n };\n });\n\n return (\n <Show when={props.type === 'svg'} fallback={<canvas ref={cvs} role=\"img\" />}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n stroke=\"none\"\n width={props.size}\n height={props.size}\n ref={svg}\n shape-rendering=\"crispEdges\"\n role=\"img\"\n >\n <path />\n <path />\n <Show when={other.icon}>\n <image href={other.icon} preserveAspectRatio=\"xMidYMid meet\" />\n </Show>\n </svg>\n </Show>\n );\n};\n\nexport type QrCodeElement = CustomElement<QrCodeProps>;\nexport const defaultProps: QrCodeProps = {\n value: '',\n icon: void 0,\n color: void 0,\n bgColor: void 0,\n size: void 0,\n iconSize: void 0,\n ecl: void 0,\n minVersion: void 0,\n maxVersion: void 0,\n mask: void 0,\n boostEcc: false,\n border: void 0,\n type: void 0,\n shape: void 0,\n};\n\ncustomElement<QrCodeProps>('n-qrcode', defaultProps, (props, opt) => {\n const el = opt.element;\n\n createEffect(() => {\n clearAttribute(el, ['value', 'icon']);\n });\n return (\n <>\n <style textContent={inline} />\n <QRCode {...props} />\n </>\n );\n});\n\nexport default QRCode;\n"],"names":["createEffect","mergeProps","Show","splitProps","customElement","clearAttribute","theme","inline","Ecc","encodeSegments","makeSegments","QRCode","_props","cvs","svg","img","isDark","props","other","size","iconSize","border","ecl","type","eccMap","l","get","m","q","h","prev","styles","qr","value","minVersion","maxVersion","mask","boostEcc","RangeError","scale","radius","width","height","window","getComputedStyle","ctx","getContext","color","bgColor","bg","backgroundColor","clearRect","fillStyle","fillRect","y","ypos","x","getModule","xpos","shape","beginPath","arc","Math","PI","fill","moveTo","bezierCurveTo","closePath","lineTo","floor","ceil","icon","Image","src","onload","offset","drawImage","parts","push","paths","querySelectorAll","box_size","setAttribute","length","join","querySelector","defaultProps","opt","el","element"],"mappings":"+fAAA,QAASA,gBAAAA,CAAY,CAAOC,cAAAA,CAAU,CAAEC,QAAAA,CAAI,CAAEC,cAAAA,CAAU,KAAQ,UAAW,AAC3E,QAASC,iBAAAA,CAAa,KAAQ,eAAgB,AAE9C,QAASC,kBAAAA,CAAc,KAAQ,iBAAkB,AACjD,QAAOC,GAASC,UAAAA,CAAM,KAAQ,UAAW,AAEzC,QAASC,OAAAA,CAAG,CAAEC,kBAAAA,CAAc,CAAiBC,gBAAAA,CAAY,KAAQ,UAAW,CAmD5E,IAAMC,EAAS,AAACC,QAEVC,EACAC,EACAC,EAHJ,GAAM,CAAEC,OAAAA,CAA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E,EAAMG,QAAQ,CAAC,CAAC,CACjD,CACF,CAEA,MAAO,CACL2B,MAAOhB,EAAOgB,KAAK,CACnBE,GAAIlB,EAAOmB,eAAe,AAC5B,CACF,KAGGhD,oBAAWe,AAAe,QAAfA,EAAMM,IAAI,yCAAmCV,oCAAAA,sCAOhDC,8DAAAA,UAMJZ,qBAAWgB,EAAMqD,IAAI,mDACPrD,EAAMqD,IAAI,0BATlBtD,EAAME,IAAI,GACTF,EAAME,IAAI,4GAa1B,CAGA,QAAO,MAAMmE,aAA4B,CACvCrD,MAAO,GACPsC,KAAM,KAAK,EACXxB,MAAO,KAAK,EACZC,QAAS,KAAK,EACd7B,KAAM,KAAK,EACXC,SAAU,KAAK,EACfE,IAAK,KAAK,EACVY,WAAY,KAAK,EACjBC,WAAY,KAAK,EACjBC,KAAM,KAAK,EACXC,SAAU,CAAA,EACVhB,OAAQ,KAAK,EACbE,KAAM,KAAK,EACXoC,MAAO,KAAK,CACd,CAAE,CAEFvD,EAA2B,WAAYkF,aAAc,CAACrE,EAAOsE,KAC3D,IAAMC,EAAKD,EAAIE,OAAO,CAKtB,OAHAzF,EAAa,KACXK,EAAemF,EAAI,CAAC,QAAS,OAAO,CACtC,yCAGwBjF,UACnBI,EAAWM,GAGlB,EAEA,gBAAeN,CAAO"}
|
package/lib/code/worker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-diff.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-docker.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-git.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-jsx.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-latex.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-less.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup-templating.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-regex.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-toml.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-tsx.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-wasm.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/diff-highlight/prism-diff-highlight.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/highlight-keywords/prism-highlight-keywords.js"),self.importScripts("https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.js"),self.addEventListener("message",function(s){let p;try{let{code:t,language:i="markup"}=JSON.parse(s.data);/^diff-([\w-]+)/i.test(i)&&!self.Prism.languages[i]&&(self.Prism.languages[i]=self.Prism.languages.diff),p=self.Prism.highlight(`${t}
|
|
2
|
-
`,self.Prism.languages[i],i)}catch
|
|
2
|
+
`,self.Prism.languages[i],i)}catch{p=""}self.postMessage(p)},!1);
|
|
3
3
|
//# sourceMappingURL=worker.js.map
|
package/lib/code/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../components/code/worker.ts"],"sourcesContent":["self.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-diff.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-docker.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-git.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-jsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-latex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-less.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.js');\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup-templating.js',\n);\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-regex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-toml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-tsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-wasm.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\n// plugins\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/diff-highlight/prism-diff-highlight.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/highlight-keywords/prism-highlight-keywords.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.js',\n);\n\nfunction onMessage(e: MessageEvent<string>) {\n let result;\n\n try {\n const { code, language = 'markup' } = JSON.parse(e.data) as {\n code: string;\n language: string;\n };\n\n if (/^diff-([\\w-]+)/i.test(language) && !self.Prism.languages[language]) {\n self.Prism.languages[language] = self.Prism.languages.diff;\n }\n\n result = self.Prism.highlight(`${code}\\n`, self.Prism.languages[language], language);\n
|
|
1
|
+
{"version":3,"sources":["../../components/code/worker.ts"],"sourcesContent":["self.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-css.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-diff.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-docker.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-git.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-jsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-latex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-less.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markdown.js');\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup-templating.js',\n);\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-regex.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-rust.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-swift.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-toml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-tsx.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-typescript.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-wasm.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.js');\nself.importScripts('https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.js');\n// plugins\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/diff-highlight/prism-diff-highlight.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/highlight-keywords/prism-highlight-keywords.js',\n);\nself.importScripts(\n 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.js',\n);\n\nfunction onMessage(e: MessageEvent<string>) {\n let result;\n\n try {\n const { code, language = 'markup' } = JSON.parse(e.data) as {\n code: string;\n language: string;\n };\n\n if (/^diff-([\\w-]+)/i.test(language) && !self.Prism.languages[language]) {\n self.Prism.languages[language] = self.Prism.languages.diff;\n }\n\n result = self.Prism.highlight(`${code}\\n`, self.Prism.languages[language], language);\n } catch {\n result = '';\n }\n self.postMessage(result); // 向主线程发送消息\n}\n\nself.addEventListener('message', onMessage, false);\n"],"names":["self","importScripts","addEventListener","e","result","code","language","JSON","parse","data","test","Prism","languages","diff","highlight","postMessage"],"mappings":"aAAAA,KAAKC,aAAa,CAAC,wDACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,0EACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,8EACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,4EACnBD,KAAKC,aAAa,CAChB,qFAEFD,KAAKC,aAAa,CAAC,0EACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,yEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,uEACnBD,KAAKC,aAAa,CAAC,8EACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,wEACnBD,KAAKC,aAAa,CAAC,wEAEnBD,KAAKC,aAAa,CAChB,8FAEFD,KAAKC,aAAa,CAChB,sGAEFD,KAAKC,aAAa,CAChB,0FAuBFD,KAAKE,gBAAgB,CAAC,UApBtB,SAAmBC,CAAuB,EACxC,IAAIC,EAEJ,GAAI,CACF,GAAM,CAAEC,KAAAA,CAAI,CAAEC,SAAAA,EAAW,QAAQ,CAAE,CAAGC,KAAKC,KAAK,CAACL,EAAEM,IAAI,EAKnD,kBAAkBC,IAAI,CAACJ,IAAa,CAACN,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,EACrEN,CAAAA,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,CAAGN,KAAKW,KAAK,CAACC,SAAS,CAACC,IAAI,AAAD,EAG3DT,EAASJ,KAAKW,KAAK,CAACG,SAAS,CAAC,CAAC,EAAET,EAAK;AAAE,CAAC,CAAEL,KAAKW,KAAK,CAACC,SAAS,CAACN,EAAS,CAAEA,EAC7E,CAAE,KAAM,CACNF,EAAS,EACX,CACAJ,KAAKe,WAAW,CAACX,EACnB,EAE4C,CAAA"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../components/index.ts"],"sourcesContent":["'use client';\n\nexport { default as Avatar, type AvatarElement, type AvatarProps } from './avatar';\nexport {\n default as AvatarGroup,\n type AvatarGroupElement,\n type AvatarGroupProps,\n} from './avatar/group';\nexport { default as BackTop, type BackTopElement, type BackTopProps } from './back-top';\nexport { type BaseOption, type BasicConfig, FieldName, Size, Status } from './basic-config';\nexport { default as Button, type ButtonElement, type ButtonProps } from './button';\nexport {\n default as CaptureScreen,\n type CaptureScreenElement,\n type CaptureScreenProps,\n} from './capture-screen';\nexport { default as Carousel, type CarouselElement, type CarouselProps } from './carousel';\nexport {\n default as Checkbox,\n type CheckboxBoolElement,\n type CheckboxBoolProps,\n type CheckboxGroupElement,\n type CheckboxGroupProps,\n} from './checkbox';\nexport { default as Code, type CodeElement, type CodeProps } from './code';\nexport {\n default as ColorPalette,\n type ColorPaletteElement,\n type ColorPaletteProps,\n} from './color-palette';\nexport {\n default as ColorPicker,\n type ColorPickerElement,\n type ColorPickerProps,\n} from './color-picker';\nexport { default as Cron, type CronElement, type CronProps } from './cron';\nexport { default as DatePicker, type DatePickerElement, type DatePickerProps } from './date-picker';\nexport { default as dayjs } from './date-picker/dayjs';\nexport {\n default as Dropdown,\n type DropdownElement,\n type DropdownMultipleElement,\n type DropdownMultipleProps,\n type DropdownProps,\n} from './dropdown';\nexport { default as Empty, type EmptyElement, type EmptyProps } from './empty';\nexport { default as fromSchema } from './from-schema';\nexport { default as getOptions } from './get-options';\nexport {\n default as HighlightText,\n type HighlightTextElement,\n type HighlightTextProps,\n} from './highlight-text';\nexport { default as Img, type ImgElement, type ImgProps } from './img';\nexport { default as Input, type InputElement, type InputProps } from './input';\nexport {\n default as InputNumber,\n type InputNumberElement,\n type InputNumberProps,\n} from './input-number';\nexport { default as Md, type MdElement, type MdProps } from './md';\nexport { default as mdStyle } from './md-style';\nexport {\n default as Menu,\n type MenuElement,\n type MenuMultipleElement,\n type MenuMultipleProps,\n type MenuOption,\n type MenuProps,\n} from './menu';\nexport {\n default as Modal,\n type ModalElement,\n type ModalProps,\n OpenState,\n type OpenStateKey,\n} from './modal';\nexport {\n default as notification,\n type NotificationProps,\n type NotificationType,\n} from './notification';\nexport { default as Pagination, type PaginationElement, type PaginationProps } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\nexport { default as Prism } from './prism';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { type IntRange, default as QrCode, type QrCodeElement, type QrCodeProps } from './qrcode';\nexport { default as Radio, type RadioElement, type RadioOption, type RadioProps } from './radio';\nexport { default as Segmented, type SegmentedElement, type SegmentedProps } from './segmented';\nexport {\n default as Select,\n type SelectElement,\n type SelectMultipleElement,\n type SelectMultipleProps,\n type SelectProps,\n} from './select';\nexport { default as Skeleton, type SkeletonElement, type SkeletonProps } from './skeleton';\nexport { default as Spin, type SpinElement, type SpinProps } from './spin';\nexport { default as Switch, type SwitchElement, type SwitchProps } from './switch';\nexport { default as Table, type TableElement, type TableProps } from './table';\nexport { type TabOption, default as Tabs, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n type ColorScheme,\n generateColor,\n default as theme,\n type ThemeOption,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\n type TreeData,\n type TreeElement,\n type TreeMultipleElement,\n type TreeMultipleProps,\n type TreeMultipleSchemaElement,\n type TreeMultipleSchemaProps,\n type TreeMultipleStringElement,\n type TreeMultipleStringProps,\n type TreeProps,\n type TreeSchemaElement,\n type TreeSchemaProps,\n type TreeStringElement,\n type TreeStringProps,\n} from './tree';\nexport { default as Typography, type TypographyElement, type TypographyProps } from './typography';\nexport type { CustomElement } from 'custom-element-type';\nexport { customElement, getCurrentElement, hot, noShadowDOM, withSolid } from 'solid-element';\nimport type { ICustomElement, Transform } from 'custom-element-type';\n\nimport type {\n AvatarElement,\n AvatarGroupElement,\n BackTopElement,\n ButtonElement,\n CaptureScreenElement,\n CarouselElement,\n CheckboxBoolElement,\n CheckboxGroupElement,\n CodeElement,\n ColorPaletteElement,\n ColorPickerElement,\n CronElement,\n DatePickerElement,\n DropdownElement,\n DropdownMultipleElement,\n EmptyElement,\n HighlightTextElement,\n ImgElement,\n InputElement,\n InputNumberElement,\n MdElement,\n MenuElement,\n MenuMultipleElement,\n ModalElement,\n PaginationElement,\n PopoverElement,\n ProviderElement,\n QrCodeElement,\n RadioElement,\n SegmentedElement,\n SelectElement,\n SelectMultipleElement,\n SkeletonElement,\n SpinElement,\n SwitchElement,\n TableElement,\n TabsElement,\n TagElement,\n TreeElement,\n TreeMultipleElement,\n TreeMultipleSchemaElement,\n TreeMultipleStringElement,\n TreeSchemaElement,\n TreeStringElement,\n TypographyElement,\n} from '.';\n\n/** 组件列表\n * @author monako97\n * @ignore optional\n */\ninterface CustomElementTags {\n /** 头像 */\n 'n-avatar': AvatarElement;\n /** 头像组 */\n 'n-avatar-group': AvatarGroupElement;\n /** 返回顶部 */\n 'n-back-top': BackTopElement;\n /** 按钮 */\n 'n-button': ButtonElement;\n /** 捕获屏幕 */\n 'n-capture-screen': CaptureScreenElement;\n /** 走马灯、轮播 */\n 'n-carousel': CarouselElement;\n /** 复选框 */\n 'n-checkbox': CheckboxBoolElement | CheckboxGroupElement;\n /** 代码框 */\n 'n-code': CodeElement;\n /** 取色器 */\n 'n-color-palette': ColorPaletteElement;\n /** 取色器(弹出类型) */\n 'n-color-picker': ColorPickerElement;\n /** 下拉面板 */\n 'n-dropdown': DropdownElement | DropdownMultipleElement;\n /** 空面板 */\n 'n-empty': EmptyElement;\n /** 匹配高亮文字 */\n 'n-highlight-text': HighlightTextElement;\n /** 图片查看器 */\n 'n-img': ImgElement;\n /** 输入框 */\n 'n-input': InputElement;\n /** 数字输入框 */\n 'n-input-number': InputNumberElement;\n /** Markdown渲染 */\n 'n-md': MdElement;\n /** 弹出气泡面板 */\n 'n-popover': PopoverElement;\n /** 单选项 */\n 'n-radio': RadioElement;\n /** 分段控制器 */\n 'n-segmented': SegmentedElement;\n /** 下拉选择框 */\n 'n-select': SelectElement | SelectMultipleElement;\n /** 骨架屏 */\n 'n-skeleton': SkeletonElement;\n /** 加载中 */\n 'n-spin': SpinElement;\n /** 开关 */\n 'n-switch': SwitchElement;\n /** 树形渲染 */\n 'n-tree':\n | TreeElement\n | TreeStringElement\n | TreeSchemaElement\n | TreeMultipleElement\n | TreeMultipleStringElement\n | TreeMultipleSchemaElement;\n /** 文字排版 */\n 'n-typography': TypographyElement;\n /** 标签页 */\n 'n-tabs': TabsElement;\n /** 标签 */\n 'n-tag': TagElement;\n /** 导航菜单 */\n 'n-menu': MenuElement | MenuMultipleElement;\n /** Cron表达式编辑器 */\n 'n-cron': CronElement;\n /** 日期选择器\n * @since 2.1.0\n */\n 'n-data-picker': DatePickerElement;\n /** 数据表格\n * @since 2.2.0\n */\n 'n-table': TableElement;\n /** 分页器\n * @since 2.2.0\n */\n 'n-pagination': PaginationElement;\n /** 响应内部变化\n * @since 2.3.0\n */\n 'n-provider': ProviderElement;\n /** 模态框\n * @since 2.6.0\n */\n 'n-modal': ModalElement;\n /**\n * 二维码\n * @scince 2.9.0\n */\n 'n-qrcode': QrCodeElement;\n}\ntype IntrinsicNekoElement = Transform<CustomElementTags>;\n\ndeclare module 'solid-js' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends HTMLElementTags, IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\n\nexport interface ComponentOptions<T> {\n element: T & ICustomElement;\n}\n"],"names":["Avatar","AvatarGroup","BackTop","Button","CaptureScreen","Carousel","Checkbox","Code","ColorPalette","ColorPicker","Cron","DatePicker","Dropdown","Empty","FieldName","HighlightText","Img","Input","InputNumber","Md","Menu","Modal","OpenState","Pagination","Popover","Prism","Provider","QrCode","Radio","Segmented","Select","Size","Skeleton","Spin","Status","Switch","Table","Tabs","Tag","Tree","Typography","customElement","dayjs","fromSchema","generateColor","getCurrentElement","getOptions","hot","mdStyle","noShadowDOM","notification","theme","toneColor","withSolid"],"mappings":"+JAEoBA,MAAM,mBAANA,SAAM,EAEbC,WAAW,mBAAXA,SAAW,EAIJC,OAAO,mBAAPA,SAAO,EAEPC,MAAM,mBAANA,SAAM,EAEbC,aAAa,mBAAbA,SAAa,EAINC,QAAQ,mBAARA,SAA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jD9CC,YAAY,mBAAZA,SAAY,EA2BZC,KAAK,mBAALA,SAAK,EAEhBC,SAAS,mBAATA,WAAS,EAoBkDC,SAAS,mBAATA,WAAS,sBA7HE,yBAKjE,+BACoE,yBACA,8BACH,yBAKjE,iCACuE,2BAOvE,2BAC2D,uBAK3D,gCAKA,+BAC2D,uBACkB,8BACnD,oCAO1B,2BAC8D,wBAC/B,8BACA,8BAK/B,iCACwD,sBACM,wBAK9D,+BACqD,qBACzB,2BAQ5B,uBAOA,wBAKA,+BAC6E,6BACT,0BAC1C,wBAC6C,2BACS,yBACA,wBACN,4BAO1E,yBACuE,2BACZ,uBACM,yBACH,wBACa,uBACnB,sBAOxD,wBAgBA,uBAC6E,2BAEN"}
|
|
1
|
+
{"version":3,"sources":["../components/index.ts"],"sourcesContent":["'use client';\n\nexport { default as Avatar, type AvatarElement, type AvatarProps } from './avatar';\nexport {\n default as AvatarGroup,\n type AvatarGroupElement,\n type AvatarGroupProps,\n} from './avatar/group';\nexport { default as BackTop, type BackTopElement, type BackTopProps } from './back-top';\nexport { type BaseOption, type BasicConfig, FieldName, Size, Status } from './basic-config';\nexport { default as Button, type ButtonElement, type ButtonProps } from './button';\nexport {\n default as CaptureScreen,\n type CaptureScreenElement,\n type CaptureScreenProps,\n} from './capture-screen';\nexport { default as Carousel, type CarouselElement, type CarouselProps } from './carousel';\nexport {\n default as Checkbox,\n type CheckboxBoolElement,\n type CheckboxBoolProps,\n type CheckboxGroupElement,\n type CheckboxGroupProps,\n} from './checkbox';\nexport { default as Code, type CodeElement, type CodeProps } from './code';\nexport {\n default as ColorPalette,\n type ColorPaletteElement,\n type ColorPaletteProps,\n} from './color-palette';\nexport {\n default as ColorPicker,\n type ColorPickerElement,\n type ColorPickerProps,\n} from './color-picker';\nexport { default as Cron, type CronElement, type CronProps } from './cron';\nexport { default as DatePicker, type DatePickerElement, type DatePickerProps } from './date-picker';\nexport { default as dayjs } from './date-picker/dayjs';\nexport {\n default as Dropdown,\n type DropdownElement,\n type DropdownMultipleElement,\n type DropdownMultipleProps,\n type DropdownProps,\n} from './dropdown';\nexport { default as Empty, type EmptyElement, type EmptyProps } from './empty';\nexport { default as fromSchema } from './from-schema';\nexport { default as getOptions } from './get-options';\nexport {\n default as HighlightText,\n type HighlightTextElement,\n type HighlightTextProps,\n} from './highlight-text';\nexport { default as Img, type ImgElement, type ImgProps } from './img';\nexport { default as Input, type InputElement, type InputProps } from './input';\nexport {\n default as InputNumber,\n type InputNumberElement,\n type InputNumberProps,\n} from './input-number';\nexport { default as Md, type MdElement, type MdProps } from './md';\nexport { default as mdStyle } from './md-style';\nexport {\n default as Menu,\n type MenuElement,\n type MenuMultipleElement,\n type MenuMultipleProps,\n type MenuOption,\n type MenuProps,\n} from './menu';\nexport {\n default as Modal,\n type ModalElement,\n type ModalProps,\n OpenState,\n type OpenStateKey,\n} from './modal';\nexport {\n default as notification,\n type NotificationProps,\n type NotificationType,\n} from './notification';\nexport { default as Pagination, type PaginationElement, type PaginationProps } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\nexport { default as Prism } from './prism';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { type IntRange, default as QrCode, type QrCodeElement, type QrCodeProps } from './qrcode';\nexport { default as Radio, type RadioElement, type RadioOption, type RadioProps } from './radio';\nexport { default as Segmented, type SegmentedElement, type SegmentedProps } from './segmented';\nexport {\n default as Select,\n type SelectElement,\n type SelectMultipleElement,\n type SelectMultipleProps,\n type SelectProps,\n} from './select';\nexport { default as Skeleton, type SkeletonElement, type SkeletonProps } from './skeleton';\nexport { default as Spin, type SpinElement, type SpinProps } from './spin';\nexport { default as Switch, type SwitchElement, type SwitchProps } from './switch';\nexport { default as Table, type TableElement, type TableProps } from './table';\nexport { type TabOption, default as Tabs, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n type ColorScheme,\n generateColor,\n default as theme,\n type ThemeOption,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\n type TreeData,\n type TreeElement,\n type TreeMultipleElement,\n type TreeMultipleProps,\n type TreeMultipleSchemaElement,\n type TreeMultipleSchemaProps,\n type TreeMultipleStringElement,\n type TreeMultipleStringProps,\n type TreeProps,\n type TreeSchemaElement,\n type TreeSchemaProps,\n type TreeStringElement,\n type TreeStringProps,\n} from './tree';\nexport { default as Typography, type TypographyElement, type TypographyProps } from './typography';\nexport type { CustomElement } from 'custom-element-type';\nexport { customElement, getCurrentElement, hot, noShadowDOM, withSolid } from 'solid-element';\nimport type { ICustomElement, Transform } from 'custom-element-type';\n\nimport type {\n AvatarElement,\n AvatarGroupElement,\n BackTopElement,\n ButtonElement,\n CaptureScreenElement,\n CarouselElement,\n CheckboxBoolElement,\n CheckboxGroupElement,\n CodeElement,\n ColorPaletteElement,\n ColorPickerElement,\n CronElement,\n DatePickerElement,\n DropdownElement,\n DropdownMultipleElement,\n EmptyElement,\n HighlightTextElement,\n ImgElement,\n InputElement,\n InputNumberElement,\n MdElement,\n MenuElement,\n MenuMultipleElement,\n ModalElement,\n PaginationElement,\n PopoverElement,\n ProviderElement,\n QrCodeElement,\n RadioElement,\n SegmentedElement,\n SelectElement,\n SelectMultipleElement,\n SkeletonElement,\n SpinElement,\n SwitchElement,\n TableElement,\n TabsElement,\n TagElement,\n TreeElement,\n TreeMultipleElement,\n TreeMultipleSchemaElement,\n TreeMultipleStringElement,\n TreeSchemaElement,\n TreeStringElement,\n TypographyElement,\n} from '.';\n\n/** 组件列表\n * @author monako97\n * @ignore optional\n */\ninterface CustomElementTags {\n /** 头像 */\n 'n-avatar': AvatarElement;\n /** 头像组 */\n 'n-avatar-group': AvatarGroupElement;\n /** 返回顶部 */\n 'n-back-top': BackTopElement;\n /** 按钮 */\n 'n-button': ButtonElement;\n /** 捕获屏幕 */\n 'n-capture-screen': CaptureScreenElement;\n /** 走马灯、轮播 */\n 'n-carousel': CarouselElement;\n /** 复选框 */\n 'n-checkbox': CheckboxBoolElement | CheckboxGroupElement;\n /** 代码框 */\n 'n-code': CodeElement;\n /** 取色器 */\n 'n-color-palette': ColorPaletteElement;\n /** 取色器(弹出类型) */\n 'n-color-picker': ColorPickerElement;\n /** 下拉面板 */\n 'n-dropdown': DropdownElement | DropdownMultipleElement;\n /** 空面板 */\n 'n-empty': EmptyElement;\n /** 匹配高亮文字 */\n 'n-highlight-text': HighlightTextElement;\n /** 图片查看器 */\n 'n-img': ImgElement;\n /** 输入框 */\n 'n-input': InputElement;\n /** 数字输入框 */\n 'n-input-number': InputNumberElement;\n /** Markdown渲染 */\n 'n-md': MdElement;\n /** 弹出气泡面板 */\n 'n-popover': PopoverElement;\n /** 单选项 */\n 'n-radio': RadioElement;\n /** 分段控制器 */\n 'n-segmented': SegmentedElement;\n /** 下拉选择框 */\n 'n-select': SelectElement | SelectMultipleElement;\n /** 骨架屏 */\n 'n-skeleton': SkeletonElement;\n /** 加载中 */\n 'n-spin': SpinElement;\n /** 开关 */\n 'n-switch': SwitchElement;\n /** 树形渲染 */\n 'n-tree':\n | TreeElement\n | TreeStringElement\n | TreeSchemaElement\n | TreeMultipleElement\n | TreeMultipleStringElement\n | TreeMultipleSchemaElement;\n /** 文字排版 */\n 'n-typography': TypographyElement;\n /** 标签页 */\n 'n-tabs': TabsElement;\n /** 标签 */\n 'n-tag': TagElement;\n /** 导航菜单 */\n 'n-menu': MenuElement | MenuMultipleElement;\n /** Cron表达式编辑器 */\n 'n-cron': CronElement;\n /** 日期选择器\n * @since 2.1.0\n */\n 'n-data-picker': DatePickerElement;\n /** 数据表格\n * @since 2.2.0\n */\n 'n-table': TableElement;\n /** 分页器\n * @since 2.2.0\n */\n 'n-pagination': PaginationElement;\n /** 响应内部变化\n * @since 2.3.0\n */\n 'n-provider': ProviderElement;\n /** 模态框\n * @since 2.6.0\n */\n 'n-modal': ModalElement;\n /**\n * 二维码\n * @since 2.9.0\n */\n 'n-qrcode': QrCodeElement;\n}\ntype IntrinsicNekoElement = Transform<CustomElementTags>;\n\ndeclare module 'solid-js' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends HTMLElementTags, IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\n\nexport interface ComponentOptions<T> {\n element: T & ICustomElement;\n}\n"],"names":["Avatar","AvatarGroup","BackTop","Button","CaptureScreen","Carousel","Checkbox","Code","ColorPalette","ColorPicker","Cron","DatePicker","Dropdown","Empty","FieldName","HighlightText","Img","Input","InputNumber","Md","Menu","Modal","OpenState","Pagination","Popover","Prism","Provider","QrCode","Radio","Segmented","Select","Size","Skeleton","Spin","Status","Switch","Table","Tabs","Tag","Tree","Typography","customElement","dayjs","fromSchema","generateColor","getCurrentElement","getOptions","hot","mdStyle","noShadowDOM","notification","theme","toneColor","withSolid"],"mappings":"+JAEoBA,MAAM,mBAANA,SAAM,EAEbC,WAAW,mBAAXA,SAAW,EAIJC,OAAO,mBAAPA,SAAO,EAEPC,MAAM,mBAANA,SAAM,EAEbC,aAAa,mBAAbA,SAAa,EAINC,QAAQ,mBAARA,SAAQ,EAEfC,QAAQ,mBAARA,SAAQ,EAMDC,IAAI,mBAAJA,SAAI,EAEXC,YAAY,mBAAZA,SAAY,EAKZC,WAAW,mBAAXA,SAAW,EAIJC,IAAI,mBAAJA,SAAI,EACJC,UAAU,mBAAVA,SAAU,EAGjBC,QAAQ,mBAARA,SAAQ,EAMDC,KAAK,mBAALA,SAAK,EApCmBC,SAAS,mBAATA,WAAS,EAwCxCC,aAAa,mBAAbA,SAAa,EAINC,GAAG,mBAAHA,SAAG,EACHC,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A,+BAC6E,6BACT,0BAC1C,wBAC6C,2BACS,yBACA,wBACN,4BAO1E,yBACuE,2BACZ,uBACM,yBACH,wBACa,uBACnB,sBAOxD,wBAgBA,uBAC6E,2BAEN"}
|
package/lib/qrcode/index.d.ts
CHANGED
|
@@ -43,6 +43,12 @@ export interface QrCodeProps {
|
|
|
43
43
|
* @default 7
|
|
44
44
|
*/
|
|
45
45
|
iconSize?: number;
|
|
46
|
+
/**
|
|
47
|
+
* 模块形状
|
|
48
|
+
* @default 'rect'
|
|
49
|
+
* @since 2.9.1
|
|
50
|
+
*/
|
|
51
|
+
shape?: 'rect' | 'rhombus' | 'heart' | 'circle';
|
|
46
52
|
}
|
|
47
53
|
declare const QRCode: (_props: QrCodeProps) => JSX.Element;
|
|
48
54
|
export type QrCodeElement = CustomElement<QrCodeProps>;
|
package/lib/qrcode/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(exports,{default:function(){return f},defaultProps:function(){return u}});const e=require("solid-js/web"),r=require("solid-js"),t=require("solid-element"),o=require("../basic-config"),i=function(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l(void 0);if(t&&t.has(e))return t.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var c=i?Object.getOwnPropertyDescriptor(e,n):null;c&&(c.get||c.set)?Object.defineProperty(o,n,c):o[n]=e[n]}return o.default=e,t&&t.set(e,o),o}(require("../theme")),n=require("./qrcode");function l(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(l=function(e){return e?t:r})(e)}const c=(0,e.template)('<svg><image preserveAspectRatio="xMidYMid meet"></svg>',!1,!0),s=(0,e.template)('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="none" shape-rendering="crispEdges" role="img"><path></path><path>'),a=(0,e.template)('<canvas role="img">'),d=(0,e.template)("<style>"),b=t=>{let o,l,d;let{isDark:b}=i.default,u=(0,r.mergeProps)({size:160,iconSize:7,border:1,ecl:"m",type:"svg"},t),[f,g]=(0,r.splitProps)(u,["value","border","size","type","minVersion","maxVersion","mask","boostEcc","ecl","bgColor","color","iconSize","shape"]),h={l:n.Ecc.get("LOW"),m:n.Ecc.get("MEDIUM"),q:n.Ecc.get("QUARTILE"),h:n.Ecc.get("HIGH")};return(0,r.createEffect)(e=>{let r;b();let t=(0,n.makeSegments)(f.value),i=(0,n.encodeSegments)(t,h[f.ecl],f.minVersion,f.maxVersion,f.mask,f.boostEcc);if("canvas"===f.type){if(f.size<=0||f.border<0||!o)throw RangeError("Value out of range");let t=f.size/(i.size+2*f.border),n=t/2;o.width=f.size,o.height=f.size,r=window.getComputedStyle(o);let l=o.getContext("2d"),c=f.color||e?.color||r.color,s=f.bgColor||e?.bg||r.backgroundColor;l.clearRect(0,0,f.size,f.size),l.fillStyle=s,l.fillRect(0,0,f.size,f.size),l.fillStyle=c;for(let e=-f.border;e<i.size+f.border;e++){let r=(e+f.border)*t;for(let o=-f.border;o<i.size+f.border;o++)if(i.getModule(o,e)){let e=(o+f.border)*t;switch(f.shape){case"circle":l.beginPath(),l.arc(e+n,r+n,n,0,2*Math.PI),l.fill();break;case"heart":l.beginPath(),l.moveTo(e+n,r+t/4),l.bezierCurveTo(e+.1*t,r-.2*t,e-.3*t,r+.6*t,e+n,r+t),l.bezierCurveTo(e+1.3*t,r+.6*t,e+.9*t,r-.2*t,e+n,r+t/4),l.closePath(),l.fill();break;case"rhombus":l.beginPath(),l.moveTo(e+n,r),l.lineTo(e+t,r+n),l.lineTo(e+n,r+t),l.lineTo(e,r+n),l.closePath(),l.fill();break;default:l.fillRect(Math.floor(e),Math.floor(r),Math.ceil(t),Math.ceil(t))}}}g.icon&&(d||(d=new Image(f.iconSize,f.iconSize)),d.src=g.icon,d.onload=()=>{let e=(f.size+f.border*t-f.iconSize)/2;l.drawImage(d,e,e,f.iconSize,f.iconSize)})}else{if(f.border<0)throw RangeError("Border must be non-negative");let t=[];for(let e=0;e<i.size;e++)for(let r=0;r<i.size;r++)if(i.getModule(r,e))switch(f.shape){case"circle":t.push(`M${r+f.border+.5},${e+f.border+.5} m -0.5, 0 a 0.5,0.5 0 1,0 1,0 a 0.5,0.5 0 1,0 -1,0`);break;case"rhombus":t.push(`M${r+f.border+.5},${e+f.border} L${r+f.border+1},${e+f.border+.5} L${r+f.border+.5},${e+f.border+1} L${r+f.border},${e+f.border+.5} Z`);break;case"heart":t.push(`M${r+f.border+.5},${e+f.border+.25} C${r+f.border+.1},${e+f.border-.2} ${r+f.border-.3},${e+f.border+.6} ${r+f.border+.5},${e+f.border+1} C${r+f.border+1.3},${e+f.border+.6} ${r+f.border+.9},${e+f.border-.2} ${r+f.border+.5},${e+f.border+.25} Z`);break;default:t.push(`M${r+f.border},${e+f.border}h1v1h-1z`)}let o=l?.querySelectorAll("path"),n=i.size+2*f.border;l?.setAttribute("viewBox",`0 0 ${n} ${n}`),r=window.getComputedStyle(l),o.length>0&&(o[0].setAttribute("d",`M0,0 h${n}v${n}H0z`),o[0].setAttribute("fill",f.bgColor||e?.bg||r.backgroundColor),o[1].setAttribute("d",t.join(" ")),o[1].setAttribute("fill",f.color||e?.color||r.color));let c=l?.querySelector("image");if(c){let e=`${(i.size+2*f.border-f.iconSize)/2}`;c.setAttribute("x",e),c.setAttribute("y",e),c.setAttribute("width",`${f.iconSize}`),c.setAttribute("height",`${f.iconSize}`)}}return{color:r.color,bg:r.backgroundColor}}),(0,e.createComponent)(r.Show,{get when(){return"svg"===f.type},get fallback(){return(()=>{let r=a(),t=o;return"function"==typeof t?(0,e.use)(t,r):o=r,r})()},get children(){let t=s(),o=l;return t.firstChild.nextSibling,"function"==typeof o?(0,e.use)(o,t):l=t,(0,e.insert)(t,(0,e.createComponent)(r.Show,{get when(){return g.icon},get children(){let r=c();return(0,e.effect)(()=>(0,e.setAttribute)(r,"href",g.icon)),r}}),null),(0,e.effect)(r=>{let o=f.size,i=f.size;return o!==r._v$&&(0,e.setAttribute)(t,"width",r._v$=o),i!==r._v$2&&(0,e.setAttribute)(t,"height",r._v$2=i),r},{_v$:void 0,_v$2:void 0}),t}})},u={value:"",icon:void 0,color:void 0,bgColor:void 0,size:void 0,iconSize:void 0,ecl:void 0,minVersion:void 0,maxVersion:void 0,mask:void 0,boostEcc:!1,border:void 0,type:void 0,shape:void 0};(0,t.customElement)("n-qrcode",u,(t,n)=>{let l=n.element;return(0,r.createEffect)(()=>{(0,o.clearAttribute)(l,["value","icon"])}),[(()=>{let e=d();return e.textContent=i.inline,e})(),(0,e.createComponent)(b,t)]});const f=b;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/qrcode/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../components/qrcode/index.tsx"],"sourcesContent":["import { createEffect, JSX, mergeProps, Show, splitProps } from 'solid-js';\nimport { customElement } from 'solid-element';\n\nimport { clearAttribute } from '../basic-config';\nimport theme, { inline } from '../theme';\n\nimport { Ecc, encodeSegments, type IntRange, makeSegments } from './qrcode';\nexport type { IntRange } from './qrcode';\nexport interface QrCodeProps {\n /** 自定义类名 */\n class?: string;\n style?: string | JSX.CSSProperties;\n /** 二维码值 */\n value: string;\n /** 二维码模块的颜色 */\n color?: string;\n /** 二维码背景色 */\n bgColor?: string;\n /**\n * 二维码尺寸\n * @default 150\n */\n size?: number;\n /** 纠错等级; 分别对应7%、15%、25%、30%的数据纠错能力\n * @default 'm'\n */\n ecl?: 'l' | 'm' | 'q' | 'h';\n minVersion?: IntRange<1, 41>;\n maxVersion?: IntRange<1, 41>;\n mask?: -1 | IntRange<0, 8>;\n boostEcc?: boolean;\n /**\n * 模块外围的边框宽度(模块单位,非像素)\n * @default 1\n */\n border?: IntRange<1, 101>;\n /**\n * 渲染方式\n * @default 'svg'\n */\n type?: 'svg' | 'canvas';\n /**\n * 二维码图标\n */\n icon?: string;\n /**\n * 二维码图标尺寸\n * @default 7\n */\n iconSize?: number;\n}\nconst QRCode = (_props: QrCodeProps) => {\n const { isDark } = theme;\n let cvs: HTMLCanvasElement | undefined;\n let svg: SVGSVGElement | undefined;\n let img: HTMLImageElement | undefined;\n const normal = mergeProps(\n {\n size: 160,\n iconSize: 7,\n border: 1,\n ecl: 'm' as const,\n type: 'svg' as const,\n },\n _props,\n );\n const [props, other] = splitProps(normal, [\n 'value',\n 'border',\n 'size',\n 'type',\n 'minVersion',\n 'maxVersion',\n 'mask',\n 'boostEcc',\n 'ecl',\n 'bgColor',\n 'color',\n 'iconSize',\n ]);\n const eccMap = {\n l: Ecc.get('LOW'),\n m: Ecc.get('MEDIUM'),\n q: Ecc.get('QUARTILE'),\n h: Ecc.get('HIGH'),\n };\n\n createEffect((prev?: { color?: string; bg?: string }) => {\n isDark(); // 响应主题模式\n const segs = makeSegments(props.value);\n const qr = encodeSegments(\n segs,\n eccMap[props.ecl],\n props.minVersion,\n props.maxVersion,\n props.mask,\n props.boostEcc,\n );\n let styles: CSSStyleDeclaration;\n\n if (props.type === 'canvas') {\n if (props.size <= 0 || props.border < 0 || !cvs) throw new RangeError('Value out of range');\n const _scale = props.size / (qr.size + props.border * 2);\n const scale = Math.ceil(_scale);\n\n cvs.width = props.size;\n cvs.height = props.size;\n styles = window.getComputedStyle(cvs as unknown as Element);\n const ctx = cvs.getContext('2d') as CanvasRenderingContext2D;\n const color = props.color || prev?.color || styles.color;\n const bgColor = props.bgColor || prev?.bg || styles.backgroundColor;\n\n ctx.clearRect(0, 0, props.size, props.size);\n for (let y = -props.border; y < qr.size + props.border; y++) {\n for (let x = -props.border; x < qr.size + props.border; x++) {\n ctx.fillStyle = qr.getModule(x, y) ? color : bgColor;\n ctx.fillRect((x + props.border) * scale, (y + props.border) * scale, scale, scale);\n }\n }\n // 如果有图标,则绘制到中心\n if (other.icon) {\n if (!img) {\n img = new Image(props.iconSize, props.iconSize);\n }\n img.src = other.icon;\n img.onload = () => {\n const offset = (props.size + props.border * scale - props.iconSize) / 2;\n\n ctx.drawImage(img!, offset, offset, props.iconSize, props.iconSize);\n };\n }\n } else {\n if (props.border < 0) {\n throw new RangeError('Border must be non-negative');\n }\n const parts: string[] = [];\n\n for (let y = 0; y < qr.size; y++) {\n for (let x = 0; x < qr.size; x++) {\n if (qr.getModule(x, y)) {\n parts.push(`M${x + props.border},${y + props.border}h1v1h-1z`);\n }\n }\n }\n const paths = svg?.querySelectorAll('path') as unknown as SVGPathElement[];\n const box_size = qr.size + props.border * 2;\n\n svg?.setAttribute('viewBox', `0 0 ${box_size} ${box_size}`);\n styles = window.getComputedStyle(svg as unknown as Element);\n if (paths.length > 0) {\n paths[0].setAttribute('d', `M0,0 h${box_size}v${box_size}H0z`);\n paths[0].setAttribute('fill', props.bgColor || prev?.bg || styles.backgroundColor);\n paths[1].setAttribute('d', parts.join(' '));\n paths[1].setAttribute('fill', props.color || prev?.color || styles.color);\n }\n // icon\n const icon = svg?.querySelector('image');\n\n if (icon) {\n const offset = `${(qr.size + props.border * 2 - props.iconSize) / 2}`;\n\n icon.setAttribute('x', offset);\n icon.setAttribute('y', offset);\n icon.setAttribute('width', `${props.iconSize}`);\n icon.setAttribute('height', `${props.iconSize}`);\n }\n }\n\n return {\n color: styles.color,\n bg: styles.backgroundColor,\n };\n });\n\n return (\n <Show when={props.type === 'svg'} fallback={<canvas ref={cvs} role=\"img\" />}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n stroke=\"none\"\n width={props.size}\n height={props.size}\n ref={svg}\n shape-rendering=\"crispEdges\"\n role=\"img\"\n >\n <path />\n <path />\n <Show when={other.icon}>\n <image href={other.icon} preserveAspectRatio=\"xMidYMid meet\" />\n </Show>\n </svg>\n </Show>\n );\n};\n\nexport type QrCodeElement = CustomElement<QrCodeProps>;\nexport const defaultProps: QrCodeProps = {\n value: '',\n icon: void 0,\n color: void 0,\n bgColor: void 0,\n size: void 0,\n iconSize: void 0,\n ecl: void 0,\n minVersion: void 0,\n maxVersion: void 0,\n mask: void 0,\n boostEcc: false,\n border: void 0,\n type: void 0,\n};\n\ncustomElement<QrCodeProps>('n-qrcode', defaultProps, (props, opt) => {\n const el = opt.element;\n\n createEffect(() => {\n clearAttribute(el, ['value', 'icon']);\n });\n return (\n <>\n <style textContent={inline} />\n <QRCode {...props} />\n </>\n );\n});\n\nexport default QRCode;\n"],"names":["defaultProps","QRCode","_props","cvs","svg","img","isDark","theme","normal","mergeProps","size","iconSize","border","ecl","type","props","other","splitProps","eccMap","l","Ecc","get","m","q","h","createEffect","prev","styles","segs","makeSegments","value","qr","encodeSegments","minVersion","maxVersion","mask","boostEcc","RangeError","scale","Math","ceil","width","height","window","getComputedStyle","ctx","getContext","color","bgColor","bg","backgroundColor","clearRect","y","x","fillStyle","getModule","fillRect","icon","Image","src","onload","offset","drawImage","parts","push","paths","querySelectorAll","box_size","setAttribute","length","join","querySelector","Show","customElement","opt","el","element","clearAttribute","inline"],"mappings":"+JAmOA,OAAsB,mBAAtB,GA9BaA,YAAY,mBAAZA,+CArMmD,sBAClC,2BAEC,yeACD,uBAEmC,0bA6C3DC,EAAS,AAACC,QAEVC,EACAC,EACAC,EAHJ,GAAM,CAAEC,OAAAA,CAAM,CAAE,CAAGC,SAAK,CAIlBC,EAASC,GAAAA,YAAU,EACvB,CACEC,KAAM,IACNC,SAAU,EACVC,OAAQ,EACRC,IAAK,IACLC,KAAM,KACR,EACAZ,GAEI,CAACa,EAAOC,EAAM,CAAGC,GAAAA,YAAU,EAACT,EAAQ,CACxC,QACA,SACA,OACA,OACA,aACA,aACA,OACA,WACA,MACA,UACA,QACA,WACD,EACKU,EAAS,CACbC,EAAGC,KAAG,CAACC,GAAG,CAAC,OACXC,EAAGF,KAAG,CAACC,GAAG,CAAC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XC,SAAU,KAAK,EACfE,IAAK,KAAK,EACVoB,WAAY,KAAK,EACjBC,WAAY,KAAK,EACjBC,KAAM,KAAK,EACXC,SAAU,CAAA,EACVxB,OAAQ,KAAK,EACbE,KAAM,KAAK,CACb,EAEA2D,GAAAA,eAAa,EAAc,WAAYzE,EAAc,CAACe,EAAO2D,KAC3D,IAAMC,EAAKD,EAAIE,OAAO,CAKtB,MAHAnD,GAAAA,cAAY,EAAC,KACXoD,GAAAA,gBAAc,EAACF,EAAI,CAAC,QAAS,OAAO,CACtC,yCAGwBG,QAAM,6BACzB7E,EAAWc,GAGlB,SAEA,EAAed"}
|
|
1
|
+
{"version":3,"sources":["../../components/qrcode/index.tsx"],"sourcesContent":["import { createEffect, JSX, mergeProps, Show, splitProps } from 'solid-js';\nimport { customElement } from 'solid-element';\n\nimport { clearAttribute } from '../basic-config';\nimport theme, { inline } from '../theme';\n\nimport { Ecc, encodeSegments, type IntRange, makeSegments } from './qrcode';\nexport type { IntRange } from './qrcode';\nexport interface QrCodeProps {\n /** 自定义类名 */\n class?: string;\n style?: string | JSX.CSSProperties;\n /** 二维码值 */\n value: string;\n /** 二维码模块的颜色 */\n color?: string;\n /** 二维码背景色 */\n bgColor?: string;\n /**\n * 二维码尺寸\n * @default 150\n */\n size?: number;\n /** 纠错等级; 分别对应7%、15%、25%、30%的数据纠错能力\n * @default 'm'\n */\n ecl?: 'l' | 'm' | 'q' | 'h';\n minVersion?: IntRange<1, 41>;\n maxVersion?: IntRange<1, 41>;\n mask?: -1 | IntRange<0, 8>;\n boostEcc?: boolean;\n /**\n * 模块外围的边框宽度(模块单位,非像素)\n * @default 1\n */\n border?: IntRange<1, 101>;\n /**\n * 渲染方式\n * @default 'svg'\n */\n type?: 'svg' | 'canvas';\n /**\n * 二维码图标\n */\n icon?: string;\n /**\n * 二维码图标尺寸\n * @default 7\n */\n iconSize?: number;\n /**\n * 模块形状\n * @default 'rect'\n * @since 2.9.1\n */\n shape?: 'rect' | 'rhombus' | 'heart' | 'circle';\n}\nconst QRCode = (_props: QrCodeProps) => {\n const { isDark } = theme;\n let cvs: HTMLCanvasElement | undefined;\n let svg: SVGSVGElement | undefined;\n let img: HTMLImageElement | undefined;\n const normal = mergeProps(\n {\n size: 160,\n iconSize: 7,\n border: 1,\n ecl: 'm' as const,\n type: 'svg' as const,\n },\n _props,\n );\n const [props, other] = splitProps(normal, [\n 'value',\n 'border',\n 'size',\n 'type',\n 'minVersion',\n 'maxVersion',\n 'mask',\n 'boostEcc',\n 'ecl',\n 'bgColor',\n 'color',\n 'iconSize',\n 'shape',\n ]);\n const eccMap = {\n l: Ecc.get('LOW'),\n m: Ecc.get('MEDIUM'),\n q: Ecc.get('QUARTILE'),\n h: Ecc.get('HIGH'),\n };\n\n createEffect((prev?: { color?: string; bg?: string }) => {\n isDark(); // 响应主题模式\n const segs = makeSegments(props.value);\n const qr = encodeSegments(\n segs,\n eccMap[props.ecl],\n props.minVersion,\n props.maxVersion,\n props.mask,\n props.boostEcc,\n );\n let styles: CSSStyleDeclaration;\n\n if (props.type === 'canvas') {\n if (props.size <= 0 || props.border < 0 || !cvs) throw new RangeError('Value out of range');\n const scale = props.size / (qr.size + props.border * 2);\n const radius = scale / 2; // 半径\n\n cvs.width = props.size;\n cvs.height = props.size;\n styles = window.getComputedStyle(cvs as unknown as Element);\n const ctx = cvs.getContext('2d') as CanvasRenderingContext2D;\n const color = props.color || prev?.color || styles.color;\n const bgColor = props.bgColor || prev?.bg || styles.backgroundColor;\n\n ctx.clearRect(0, 0, props.size, props.size);\n ctx.fillStyle = bgColor;\n ctx.fillRect(0, 0, props.size, props.size);\n ctx.fillStyle = color;\n for (let y = -props.border; y < qr.size + props.border; y++) {\n const ypos = (y + props.border) * scale;\n\n for (let x = -props.border; x < qr.size + props.border; x++) {\n if (qr.getModule(x, y)) {\n const xpos = (x + props.border) * scale;\n\n switch (props.shape) {\n case 'circle':\n ctx.beginPath();\n ctx.arc(xpos + radius, ypos + radius, radius, 0, Math.PI * 2);\n ctx.fill();\n break;\n case 'heart':\n ctx.beginPath();\n ctx.moveTo(xpos + radius, ypos + scale / 4);\n ctx.bezierCurveTo(\n xpos + scale * 0.1,\n ypos - scale * 0.2,\n xpos - scale * 0.3,\n ypos + scale * 0.6,\n xpos + radius,\n ypos + scale,\n );\n ctx.bezierCurveTo(\n xpos + scale * 1.3,\n ypos + scale * 0.6,\n xpos + scale * 0.9,\n ypos - scale * 0.2,\n xpos + radius,\n ypos + scale / 4,\n );\n ctx.closePath();\n ctx.fill();\n break;\n case 'rhombus':\n ctx.beginPath();\n ctx.moveTo(xpos + radius, ypos);\n ctx.lineTo(xpos + scale, ypos + radius);\n ctx.lineTo(xpos + radius, ypos + scale);\n ctx.lineTo(xpos, ypos + radius);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rect':\n default:\n // 避免由于小数位带来的间隔问题\n ctx.fillRect(\n Math.floor(xpos),\n Math.floor(ypos),\n Math.ceil(scale),\n Math.ceil(scale),\n );\n break;\n }\n }\n }\n }\n // 恢复缩放\n // ctx.restore();\n // 如果有图标,则绘制到中心\n if (other.icon) {\n if (!img) {\n img = new Image(props.iconSize, props.iconSize);\n }\n img.src = other.icon;\n img.onload = () => {\n const offset = (props.size + props.border * scale - props.iconSize) / 2;\n\n ctx.drawImage(img!, offset, offset, props.iconSize, props.iconSize);\n };\n }\n } else {\n if (props.border < 0) {\n throw new RangeError('Border must be non-negative');\n }\n const parts: string[] = [];\n\n for (let y = 0; y < qr.size; y++) {\n for (let x = 0; x < qr.size; x++) {\n if (qr.getModule(x, y)) {\n switch (props.shape) {\n case 'circle':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border + 0.5} m -0.5, 0 a 0.5,0.5 0 1,0 1,0 a 0.5,0.5 0 1,0 -1,0`,\n );\n break;\n case 'rhombus':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border} L${x + props.border + 1},${y + props.border + 0.5} L${x + props.border + 0.5},${y + props.border + 1} L${x + props.border},${y + props.border + 0.5} Z`,\n );\n break;\n case 'heart':\n parts.push(\n `M${x + props.border + 0.5},${y + props.border + 0.25} C${x + props.border + 0.1},${y + props.border - 0.2} ${x + props.border - 0.3},${y + props.border + 0.6} ${x + props.border + 0.5},${y + props.border + 1} C${x + props.border + 1.3},${y + props.border + 0.6} ${x + props.border + 0.9},${y + props.border - 0.2} ${x + props.border + 0.5},${y + props.border + 0.25} Z`,\n );\n break;\n case 'rect':\n default:\n parts.push(`M${x + props.border},${y + props.border}h1v1h-1z`);\n break;\n }\n }\n }\n }\n const paths = svg?.querySelectorAll('path') as unknown as SVGPathElement[];\n const box_size = qr.size + props.border * 2;\n\n svg?.setAttribute('viewBox', `0 0 ${box_size} ${box_size}`);\n styles = window.getComputedStyle(svg as unknown as Element);\n if (paths.length > 0) {\n paths[0].setAttribute('d', `M0,0 h${box_size}v${box_size}H0z`);\n paths[0].setAttribute('fill', props.bgColor || prev?.bg || styles.backgroundColor);\n paths[1].setAttribute('d', parts.join(' '));\n paths[1].setAttribute('fill', props.color || prev?.color || styles.color);\n }\n // icon\n const icon = svg?.querySelector('image');\n\n if (icon) {\n const offset = `${(qr.size + props.border * 2 - props.iconSize) / 2}`;\n\n icon.setAttribute('x', offset);\n icon.setAttribute('y', offset);\n icon.setAttribute('width', `${props.iconSize}`);\n icon.setAttribute('height', `${props.iconSize}`);\n }\n }\n\n return {\n color: styles.color,\n bg: styles.backgroundColor,\n };\n });\n\n return (\n <Show when={props.type === 'svg'} fallback={<canvas ref={cvs} role=\"img\" />}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n stroke=\"none\"\n width={props.size}\n height={props.size}\n ref={svg}\n shape-rendering=\"crispEdges\"\n role=\"img\"\n >\n <path />\n <path />\n <Show when={other.icon}>\n <image href={other.icon} preserveAspectRatio=\"xMidYMid meet\" />\n </Show>\n </svg>\n </Show>\n );\n};\n\nexport type QrCodeElement = CustomElement<QrCodeProps>;\nexport const defaultProps: QrCodeProps = {\n value: '',\n icon: void 0,\n color: void 0,\n bgColor: void 0,\n size: void 0,\n iconSize: void 0,\n ecl: void 0,\n minVersion: void 0,\n maxVersion: void 0,\n mask: void 0,\n boostEcc: false,\n border: void 0,\n type: void 0,\n shape: void 0,\n};\n\ncustomElement<QrCodeProps>('n-qrcode', defaultProps, (props, opt) => {\n const el = opt.element;\n\n createEffect(() => {\n clearAttribute(el, ['value', 'icon']);\n });\n return (\n <>\n <style textContent={inline} />\n <QRCode {...props} />\n </>\n );\n});\n\nexport default QRCode;\n"],"names":["defaultProps","QRCode","_props","cvs","svg","img","isDark","theme","normal","mergeProps","size","iconSize","border","ecl","type","props","other","splitProps","eccMap","l","Ecc","get","m","q","h","createEffect","prev","styles","segs","makeSegments","value","qr","encodeSegments","minVersion","maxVersion","mask","boostEcc","RangeError","scale","radius","width","height","window","getComputedStyle","ctx","getContext","color","bgColor","bg","backgroundColor","clearRect","fillStyle","fillRect","y","ypos","x","getModule","xpos","shape","beginPath","arc","Math","PI","fill","moveTo","bezierCurveTo","closePath","lineTo","floor","ceil","icon","Image","src","onload","offset","drawImage","parts","push","paths","querySelectorAll","box_size","setAttribute","length","join","querySelector","Show","customElement","opt","el","element","clearAttribute","inline"],"mappings":"+JAwTA,OAAsB,mBAAtB,GA/BaA,YAAY,mBAAZA,+CAzRmD,sBAClC,2BAEC,yeACD,uBAEmC,0bAmD3DC,EAAS,AAACC,QAEVC,EACAC,EACAC,EAHJ,GAAM,CAAEC,OAAAA,CAAM,CAAE,CAAGC,SAAK,CAIlBC,EAASC,GAAAA,YAAU,EACvB,CACEC,KAAM,IACNC,SAAU,EACVC,OAAQ,EACRC,IAAK,IACLC,KAAM,KACR,EACAZ,GAEI,CAACa,EAAOC,EAAM,CAAGC,GAAAA,YAAU,EAACT,EAAQ,CACxC,QACA,SACA,OACA,OACA,aACA,aACA,OACA,WACA,MACA,UACA,QACA,WACA,QACD,EACKU,EAAS,CACbC,EAAGC,KAAG,CAACC,GAAG,CAAC,OACXC,EAAGF,KAAG,CAAC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