neko-ui 2.6.2 → 2.6.3

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/es/@moneko/config/api.md +1 -1
  3. package/es/@moneko/{app → info}/index.d.ts +2 -1
  4. package/es/@moneko/info/index.js.map +1 -0
  5. package/es/cron/begin-interval.d.ts +0 -1
  6. package/es/cron/item.d.ts +0 -1
  7. package/es/cron/period.d.ts +0 -1
  8. package/es/cron/some.d.ts +0 -1
  9. package/es/from-schema/index.js +1 -1
  10. package/es/from-schema/index.js.map +1 -1
  11. package/es/index.d.ts +1 -0
  12. package/es/index.js +1 -1
  13. package/es/index.js.map +1 -1
  14. package/es/md/style.js +1 -2
  15. package/es/md/style.js.map +1 -1
  16. package/es/tree/index.d.ts +2 -2
  17. package/es/tree/index.js +1 -1
  18. package/es/tree/index.js.map +1 -1
  19. package/lib/@moneko/config/api.md +1 -1
  20. package/lib/@moneko/{app → info}/index.d.ts +2 -1
  21. package/lib/@moneko/info/index.js.map +1 -0
  22. package/lib/cron/begin-interval.d.ts +0 -1
  23. package/lib/cron/item.d.ts +0 -1
  24. package/lib/cron/period.d.ts +0 -1
  25. package/lib/cron/some.d.ts +0 -1
  26. package/lib/from-schema/index.js +1 -1
  27. package/lib/from-schema/index.js.map +1 -1
  28. package/lib/index.d.ts +1 -0
  29. package/lib/index.js +1 -1
  30. package/lib/index.js.map +1 -1
  31. package/lib/md/style.js +1 -2
  32. package/lib/md/style.js.map +1 -1
  33. package/lib/tree/index.d.ts +2 -2
  34. package/lib/tree/index.js +1 -1
  35. package/lib/tree/index.js.map +1 -1
  36. package/package.json +14 -10
  37. package/umd/index.js +1 -1
  38. package/es/@moneko/app/index.js.map +0 -1
  39. package/lib/@moneko/app/index.js.map +0 -1
  40. /package/es/@moneko/{app → info}/index.js +0 -0
  41. /package/lib/@moneko/{app → info}/index.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,11 +1,17 @@
1
1
  # Change log
2
2
 
3
- ## Last
3
+ ## [2.6.3](https://github.com/monako97/neko-ui/compare/2.6.1...2.6.3) (12-5-2023)
4
4
 
5
5
  ### 📚 Documentation
6
6
 
7
+ - update ([f6a8674](https://github.com/monako97/neko-ui/commit/f6a86741ffaf887a5aacb8d820d3f3b3bf1496ba))
8
+ - npm files ([73b5d58](https://github.com/monako97/neko-ui/commit/73b5d58485f43f0416178beb6f170e3b5872ab5d))
7
9
  - polyfill false ([5009662](https://github.com/monako97/neko-ui/commit/50096621efc6fadc7a4d57f0be347bca93000f57))
8
10
 
11
+ ### ✨ Features
12
+
13
+ - tree click提供item ([112406c](https://github.com/monako97/neko-ui/commit/112406c3e73fe8a520529ab81ee0f3b7124fffef))
14
+
9
15
  ## [2.6.1](https://github.com/monako97/neko-ui/compare/2.6.0...2.6.1) (11-29-2023)
10
16
 
11
17
  ### 📦 Code Refactoring
@@ -46,7 +46,7 @@
46
46
  | bundleAnalyzer | js打包体积分析 | { analyzerMode: string; reportFilename: string; openAnalyzer: false } | - |
47
47
  | prefixJsLoader | 解析js/ts的前置loader | - | - |
48
48
  | bar | 是否打包显示进度条 | - | true |
49
- | theme | 设置主题, 可以在 `@app` 中获取值 | - | - |
49
+ | theme | 设置主题, 可以在 `@app/info` 中获取值 | - | - |
50
50
  | seo | 配置seo优化 | {domain: string; nojekyll?: boolean; path?: string;} | true |
51
51
  | done | 打包完成执行的回调 | () => void | - |
52
52
  | mdx | mdx loader的配置项 | MDXOptions | - |
@@ -1,4 +1,5 @@
1
- /** 虚拟模块 @app
1
+ /** 虚拟模块 @app/info
2
+ * @description 应用信息
2
3
  * @ignore optional
3
4
  */
4
5
  export interface Api {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/@moneko/info/index.ts"],"names":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type BeginIntervalProps = {
package/es/cron/item.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { ActiveTab, CronType } from '.';
3
2
  import type { RadioOption } from 'neko-ui';
4
3
  export type CronItemProps<T extends ActiveTab = 'second'> = {
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type PeriodProps = {
package/es/cron/some.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type SomeProps = {
@@ -1,2 +1,2 @@
1
- var e,r;import{_ as t}from"@swc/helpers/_/_extends";import{_ as o}from"@swc/helpers/_/_object_without_properties_loose";(r=e||(e={})).string="string",r.number="number",r.integer="integer",r.boolean="boolean",r.object="object",r.array="array";export default function i(e,r){let s=[],{properties:p}=e;for(let e in p)if(Object.prototype.hasOwnProperty.call(p,e)){let n=p[e],{properties:a,items:l,type:c="string"}=n,b=t({},o(n,["properties","items","type"]),{name:e,type:c,subTitle:c,key:`${r?`${r}.`:""}${e}`});"object"===c?b.children=i({properties:a},b.key):"array"===c&&(b.children=i({properties:{items:t({},l,{title:"items"})}},b.key)),s.push(b)}return s}
1
+ var e,r;import{_ as t}from"@swc/helpers/_/_extends";import{_ as o}from"@swc/helpers/_/_object_without_properties_loose";(r=e||(e={})).string="string",r.number="number",r.integer="integer",r.boolean="boolean",r.object="object",r.array="array";export default function i(e,r){let s=[],{properties:p}=e;for(let e in p)if(Object.prototype.hasOwnProperty.call(p,e)){let n=p[e],{properties:a,items:l,type:c="string"}=n,m=t({},o(n,["properties","items","type"]),{name:e,type:c,subTitle:c,key:`${r?`${r}.`:""}${e}`});"object"===c?m.children=i({properties:a},m.key):"array"===c&&(m.children=i({properties:{items:t({},l,{title:"items",isItems:!0})}},m.key)),s.push(m)}return s}
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/from-schema/index.ts"],"sourcesContent":["import { type TreeData } from '../tree';\n\nenum Type {\n string = 'string',\n number = 'number',\n integer = 'integer',\n boolean = 'boolean',\n object = 'object',\n array = 'array',\n}\ninterface BaseSchema {\n type?: keyof typeof Type;\n name?: string;\n title?: string;\n items?: never;\n [key: string]: Any;\n}\ninterface ArraySchema extends Omit<BaseSchema, 'type' | 'items'> {\n type: 'array';\n items: Schema;\n properties?: Record<string, Schema>;\n}\n\ninterface ObjectSchema extends Omit<BaseSchema, 'type'> {\n type?: Exclude<keyof typeof Type, 'array'>;\n properties?: Record<string, Schema>;\n}\n\nexport type Schema = ObjectSchema | ArraySchema;\n\nfunction fromSchema(schema: Schema, pid?: string): TreeData<string>[] {\n const treeData: TreeData<string>[] = [];\n const { properties } = schema;\n\n for (const k in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, k)) {\n const name = k as keyof typeof properties;\n const { properties: _properties, items, type = 'string', ...item } = properties[name];\n\n const node: TreeData<string> = {\n ...item,\n name: name,\n type,\n subTitle: type,\n key: `${pid ? `${pid}.` : ''}${name}`,\n };\n\n if (type === 'object') {\n node.children = fromSchema({ properties: _properties }, node.key);\n } else if (type === 'array') {\n node.children = fromSchema(\n {\n properties: {\n items: {\n ...(items as Schema),\n title: 'items',\n },\n },\n },\n node.key,\n );\n }\n treeData.push(node);\n }\n }\n\n return treeData;\n}\n\nexport default fromSchema;\n"],"names":["Type","fromSchema","schema","pid","treeData","properties","Object","prototype","hasOwnProperty","call","_properties","items","type","node","name","subTitle","key","children","title","push"],"mappings":"MAEKA,mHAAAA,EAAAA,IAAAA,kHAmEL,gBAvCA,SAASC,EAAWC,CAAc,CAAEC,CAAY,EAC9C,IAAMC,EAA+B,EAAE,CACjC,CAAEC,WAAAA,CAAU,CAAE,CAAGH,EAEvB,IAAK,SAAWG,EACd,GAAIC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAgB,CAEvD,IAAqEA,EAAAA,CAAU,GAAM,CAA/E,CAAEA,WAAYK,CAAW,CAAEC,MAAAA,CAAK,CAAEC,KAAAA,EAAO,QAAQ,CAAW,CAAGP,EAE/DQ,EAAyB,OAFsCR,GAA7DA,aAAyBM,QAAOC,UAItCE,IAAI,GACJF,KAAAA,EACAG,SAAUH,EACVI,IAAK,CAAC,EAAEb,EAAM,CAAC,EAAEA,EAAI,CAAC,CAAC,CAAG,GAAG,IAAO,CAAC,EAGnCS,AAAS,CAAA,WAATA,EACFC,EAAKI,QAAQ,CAAGhB,EAAW,CAAEI,WAAYK,CAAY,EAAGG,EAAKG,GAAG,EAC9C,UAATJ,GACTC,CAAAA,EAAKI,QAAQ,CAAGhB,EACd,CACEI,WAAY,CACVM,MAAO,KACDA,GACJO,MAAO,SAEX,CACF,EACAL,EAAKG,GAAG,CACV,EAEFZ,EAASe,IAAI,CAACN,EAChB,CAGF,OAAOT,CACT"}
1
+ {"version":3,"sources":["../../components/from-schema/index.ts"],"sourcesContent":["import { type TreeData } from '../tree';\n\nenum Type {\n string = 'string',\n number = 'number',\n integer = 'integer',\n boolean = 'boolean',\n object = 'object',\n array = 'array',\n}\ninterface BaseSchema {\n type?: keyof typeof Type;\n name?: string;\n title?: string;\n items?: never;\n [key: string]: Any;\n}\ninterface ArraySchema extends Omit<BaseSchema, 'type' | 'items'> {\n type: 'array';\n items: Schema;\n properties?: Record<string, Schema>;\n}\n\ninterface ObjectSchema extends Omit<BaseSchema, 'type'> {\n type?: Exclude<keyof typeof Type, 'array'>;\n properties?: Record<string, Schema>;\n}\n\nexport type Schema = ObjectSchema | ArraySchema;\n\nfunction fromSchema(schema: Schema, pid?: string): TreeData<string>[] {\n const treeData: TreeData<string>[] = [];\n const { properties } = schema;\n\n for (const k in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, k)) {\n const name = k as keyof typeof properties;\n const { properties: _properties, items, type = 'string', ...item } = properties[name];\n const node: TreeData<string> = {\n ...item,\n name: name,\n type,\n subTitle: type,\n key: `${pid ? `${pid}.` : ''}${name}`,\n };\n\n if (type === 'object') {\n node.children = fromSchema({ properties: _properties }, node.key);\n } else if (type === 'array') {\n node.children = fromSchema(\n {\n properties: {\n items: {\n ...(items as Schema),\n title: 'items',\n isItems: true,\n },\n },\n },\n node.key,\n );\n }\n treeData.push(node);\n }\n }\n\n return treeData;\n}\n\nexport default fromSchema;\n"],"names":["Type","fromSchema","schema","pid","treeData","properties","Object","prototype","hasOwnProperty","call","_properties","items","type","node","name","subTitle","key","children","title","isItems","push"],"mappings":"MAEKA,mHAAAA,EAAAA,IAAAA,kHAmEL,gBAvCA,SAASC,EAAWC,CAAc,CAAEC,CAAY,EAC9C,IAAMC,EAA+B,EAAE,CACjC,CAAEC,WAAAA,CAAU,CAAE,CAAGH,EAEvB,IAAK,SAAWG,EACd,GAAIC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAgB,CAEvD,IAAqEA,EAAAA,CAAU,GAAM,CAA/E,CAAEA,WAAYK,CAAW,CAAEC,MAAAA,CAAK,CAAEC,KAAAA,EAAO,QAAQ,CAAW,CAAGP,EAC/DQ,EAAyB,OADsCR,GAA7DA,aAAyBM,QAAOC,UAGtCE,IAAI,GACJF,KAAAA,EACAG,SAAUH,EACVI,IAAK,CAAC,EAAEb,EAAM,CAAC,EAAEA,EAAI,CAAC,CAAC,CAAG,GAAG,IAAO,CAAC,EAGnCS,AAAS,CAAA,WAATA,EACFC,EAAKI,QAAQ,CAAGhB,EAAW,CAAEI,WAAYK,CAAY,EAAGG,EAAKG,GAAG,EAC9C,UAATJ,GACTC,CAAAA,EAAKI,QAAQ,CAAGhB,EACd,CACEI,WAAY,CACVM,MAAO,KACDA,GACJO,MAAO,QACPC,QAAS,CAAA,GAEb,CACF,EACAN,EAAKG,GAAG,CACV,EAEFZ,EAASgB,IAAI,CAACP,EAChB,CAGF,OAAOT,CACT"}
package/es/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as Img, type ImgElement, type ImgProps } from './img';
20
20
  export { default as Input, type InputElement, type InputProps } from './input';
21
21
  export { default as InputNumber, type InputNumberElement, type InputNumberProps, } from './input-number';
22
22
  export { default as Md, type MdElement, type MdProps } from './md';
23
+ export { style as mdStyle } from './md/style';
23
24
  export { default as Menu, type MenuElement, type MenuMultipleElement, type MenuMultipleProps, type MenuOption, type MenuProps, } from './menu';
24
25
  export { default as Modal, type ModalElement, type ModalProps, type OpenStateKey, OpenState, } from './modal';
25
26
  export { default as Pagination, type PaginationProps, type PaginationElement } from './pagination';
package/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as Avatar}from"./avatar";export{default as AvatarGroup}from"./avatar/group";export{default as BackTop}from"./back-top";export{FieldName,Size,Status}from"./basic-config";export{default as Button}from"./button";export{default as CaptureScreen}from"./capture-screen";export{default as Carousel}from"./carousel";export{default as Checkbox}from"./checkbox";export{default as Code}from"./code";export{default as ColorPalette}from"./color-palette";export{default as ColorPicker}from"./color-picker";export{default as Cron}from"./cron";export{default as DatePicker}from"./date-picker";export{default as Dropdown}from"./dropdown";export{default as Empty}from"./empty";export{default as fromSchema}from"./from-schema";export{default as getOptions}from"./get-options";export{default as HighlightText}from"./highlight-text";export{default as Img}from"./img";export{default as Input}from"./input";export{default as InputNumber}from"./input-number";export{default as Md}from"./md";export{default as Menu}from"./menu";export{default as Modal,OpenState}from"./modal";export{default as Pagination}from"./pagination";export{default as Popover}from"./popover";export{default as Radio}from"./radio";export{default as Segmented}from"./segmented";export{default as Select}from"./select";export{default as Skeleton}from"./skeleton";export{default as Spin}from"./spin";export{default as Switch}from"./switch";export{default as Table}from"./table";export{default as Tabs}from"./tabs";export{default as Tag}from"./tag";export{default as theme,generateTheme,toneColor}from"./theme";export{default as Tree}from"./tree";export{default as Typography}from"./typography";export{default as dayjs}from"./date-picker/dayjs";export{default as Provider}from"./provider";export{hot,customElement,noShadowDOM,withSolid,getCurrentElement}from"solid-element";
1
+ export{default as Avatar}from"./avatar";export{default as AvatarGroup}from"./avatar/group";export{default as BackTop}from"./back-top";export{FieldName,Size,Status}from"./basic-config";export{default as Button}from"./button";export{default as CaptureScreen}from"./capture-screen";export{default as Carousel}from"./carousel";export{default as Checkbox}from"./checkbox";export{default as Code}from"./code";export{default as ColorPalette}from"./color-palette";export{default as ColorPicker}from"./color-picker";export{default as Cron}from"./cron";export{default as DatePicker}from"./date-picker";export{default as Dropdown}from"./dropdown";export{default as Empty}from"./empty";export{default as fromSchema}from"./from-schema";export{default as getOptions}from"./get-options";export{default as HighlightText}from"./highlight-text";export{default as Img}from"./img";export{default as Input}from"./input";export{default as InputNumber}from"./input-number";export{default as Md}from"./md";export{style as mdStyle}from"./md/style";export{default as Menu}from"./menu";export{default as Modal,OpenState}from"./modal";export{default as Pagination}from"./pagination";export{default as Popover}from"./popover";export{default as Radio}from"./radio";export{default as Segmented}from"./segmented";export{default as Select}from"./select";export{default as Skeleton}from"./skeleton";export{default as Spin}from"./spin";export{default as Switch}from"./switch";export{default as Table}from"./table";export{default as Tabs}from"./tabs";export{default as Tag}from"./tag";export{default as theme,generateTheme,toneColor}from"./theme";export{default as Tree}from"./tree";export{default as Typography}from"./typography";export{default as dayjs}from"./date-picker/dayjs";export{default as Provider}from"./provider";export{hot,customElement,noShadowDOM,withSolid,getCurrentElement}from"solid-element";
2
2
  //# sourceMappingURL=index.js.map
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../components/index.ts"],"sourcesContent":["export { 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 DatePickerProps, type DatePickerElement } from './date-picker';\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 {\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 type OpenStateKey,\n OpenState,\n} from './modal';\nexport { default as Pagination, type PaginationProps, type PaginationElement } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\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 { default as Tabs, type TabOption, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n default as theme,\n type ColorScheme,\n type ThemeOption,\n generateTheme,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\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 { default as dayjs } from './date-picker/dayjs';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { hot, customElement, noShadowDOM, withSolid, getCurrentElement } from 'solid-element';\nexport type { CustomElement } from 'custom-element-type';\nimport { Transform } from 'custom-element-type';\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 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}\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 interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\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","Dropdown","Empty","fromSchema","getOptions","HighlightText","Img","Input","InputNumber","Md","Menu","Modal","OpenState","Pagination","Popover","Radio","Segmented","Select","Skeleton","Spin","Switch","Table","Tabs","Tag","theme","generateTheme","toneColor","Tree","Typography","dayjs","Provider","hot","customElement","noShadowDOM","withSolid","getCurrentElement"],"mappings":"AAAA,OAASA,WAAWC,MAAM,KAA8C,UAAW,AACnF,QACED,WAAWE,WAAW,KAGjB,gBAAiB,AACxB,QAASF,WAAWG,OAAO,KAAgD,YAAa,AACxF,QAA4CC,SAAS,CAAEC,IAAI,CAAEC,MAAM,KAAQ,gBAAiB,AAC5F,QAASN,WAAWO,MAAM,KAA8C,UAAW,AACnF,QACEP,WAAWQ,aAAa,KAGnB,kBAAmB,AAC1B,QAASR,WAAWS,QAAQ,KAAkD,YAAa,AAC3F,QACET,WAAWU,QAAQ,KAKd,YAAa,AACpB,QAASV,WAAWW,IAAI,KAA0C,QAAS,AAC3E,QACEX,WAAWY,YAAY,KAGlB,iBAAkB,AACzB,QACEZ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AsB,AACvD,QAAS5C,WAAW6C,QAAQ,KAAkD,YAAa,AAC3F,QAASC,GAAG,CAAEC,aAAa,CAAEC,WAAW,CAAEC,SAAS,CAAEC,iBAAiB,KAAQ,eAAgB"}
1
+ {"version":3,"sources":["../components/index.ts"],"sourcesContent":["export { 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 DatePickerProps, type DatePickerElement } from './date-picker';\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 { style 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 type OpenStateKey,\n OpenState,\n} from './modal';\nexport { default as Pagination, type PaginationProps, type PaginationElement } from './pagination';\nexport { default as Popover, type PopoverElement, type PopoverProps } from './popover';\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 { default as Tabs, type TabOption, type TabsElement, type TabsProps } from './tabs';\nexport { default as Tag, type TagElement, type TagProps } from './tag';\nexport {\n default as theme,\n type ColorScheme,\n type ThemeOption,\n generateTheme,\n toneColor,\n} from './theme';\nexport {\n default as Tree,\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 { default as dayjs } from './date-picker/dayjs';\nexport { default as Provider, type ProviderElement, type ProviderProps } from './provider';\nexport { hot, customElement, noShadowDOM, withSolid, getCurrentElement } from 'solid-element';\nexport type { CustomElement } from 'custom-element-type';\nimport { Transform } from 'custom-element-type';\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 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}\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 interface HTMLElementTagNameMap extends IntrinsicNekoElement {}\n}\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n export interface IntrinsicElements extends IntrinsicNekoElement {}\n }\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","Dropdown","Empty","fromSchema","getOptions","HighlightText","Img","Input","InputNumber","Md","style","mdStyle","Menu","Modal","OpenState","Pagination","Popover","Radio","Segmented","Select","Skeleton","Spin","Switch","Table","Tabs","Tag","theme","generateTheme","toneColor","Tree","Typography","dayjs","Provider","hot","customElement","noShadowDOM","withSolid","getCurrentElement"],"mappings":"AAAA,OAASA,WAAWC,MAAM,KAA8C,UAAW,AACnF,QACED,WAAWE,WAAW,KAGjB,gBAAiB,AACxB,QAASF,WAAWG,OAAO,KAAgD,YAAa,AACxF,QAA4CC,SAAS,CAAEC,IAAI,CAAEC,MAAM,KAAQ,gBAAiB,AAC5F,QAASN,WAAWO,MAAM,KAA8C,UAAW,AACnF,QACEP,WAAWQ,aAAa,KAGnB,kBAAmB,AAC1B,QAASR,WAAWS,QAAQ,KAAkD,YAAa,AAC3F,QACET,WAAWU,QAAQ,KAKd,YAAa,AACpB,QAASV,WAAWW,IAAI,KAA0C,QAAS,AAC3E,QACEX,WAAWY,YAAY,KAGlB,iBAAkB,AACzB,QACEZ,WAAWa,WAAW,KAGjB,gBAAiB,AACxB,QAASb,WAAWc,IAAI,KAA0C,QAAS,AAC3E,QAASd,WAAWe,UAAU,KAAsD,eAAgB,AACpG,QACEf,WAAWgB,QAAQ,KAKd,YAAa,AACpB,QAAShB,WAAWiB,KAAK,KAA4C,SAAU,AAC/E,QAASjB,WAAWkB,UAAU,KAAQ,eAAgB,AACtD,QAASlB,WAAWmB,UAAU,KAAQ,eAAgB,AACtD,QACEnB,WAAWoB,aAAa,KAGnB,kBAAmB,AAC1B,QAASpB,WAAWqB,GAAG,KAAwC,OAAQ,AACvE,QAASrB,WAAWsB,KAAK,KAA4C,SAAU,AAC/E,QACEtB,WAAWuB,WAAW,KAGjB,gBAAiB,AACxB,QAASvB,WAAWwB,EAAE,KAAsC,MAAO,AACnE,QAASC,SAASC,OAAO,KAAQ,YAAa,AAC9C,QACE1B,WAAW2B,IAAI,KAMV,QAAS,AAChB,QACE3B,WAAW4B,KAAK,CAIhBC,SAAS,KACJ,SAAU,AACjB,QAAS7B,WAAW8B,UAAU,KAAsD,cAAe,AACnG,QAAS9B,WAAW+B,OAAO,KAAgD,WAAY,AACvF,QAAS/B,WAAWgC,KAAK,KAA8D,SAAU,AACjG,QAAShC,WAAWiC,SAAS,KAAoD,aAAc,AAC/F,QACEjC,WAAWkC,MAAM,KAKZ,UAAW,AAClB,QAASlC,WAAWmC,QAAQ,KAAkD,YAAa,AAC3F,QAASnC,WAAWoC,IAAI,KAA0C,QAAS,AAC3E,QAASpC,WAAWqC,MAAM,KAA8C,UAAW,AACnF,QAASrC,WAAWsC,KAAK,KAA4C,SAAU,AAC/E,QAAStC,WAAWuC,IAAI,KAA0D,QAAS,AAC3F,QAASvC,WAAWwC,GAAG,KAAwC,OAAQ,AACvE,QACExC,WAAWyC,KAAK,CAGhBC,aAAa,CACbC,SAAS,KACJ,SAAU,AACjB,QACE3C,WAAW4C,IAAI,KAaV,QAAS,AAChB,QAAS5C,WAAW6C,UAAU,KAAsD,cAAe,AACnG,QAAS7C,WAAW8C,KAAK,KAAQ,qBAAsB,AACvD,QAAS9C,WAAW+C,QAAQ,KAAkD,YAAa,AAC3F,QAASC,GAAG,CAAEC,aAAa,CAAEC,WAAW,CAAEC,SAAS,CAAEC,iBAAiB,KAAQ,eAAgB"}
package/es/md/style.js CHANGED
@@ -23,6 +23,7 @@ import{css as o}from"@moneko/css";export const style=o`
23
23
 
24
24
  .n-md-toc,
25
25
  .n-md-body {
26
+ border-radius: var(--border-radius);
26
27
  background-color: var(--component-bg);
27
28
  box-shadow: 0 2px 8px 0 var(--primary-shadow);
28
29
  }
@@ -30,7 +31,6 @@ import{css as o}from"@moneko/css";export const style=o`
30
31
  .n-md-body {
31
32
  overflow: hidden;
32
33
  margin: 0 auto 24px;
33
- border-radius: var(--border-radius);
34
34
  padding: 24px;
35
35
  color: var(--text-color);
36
36
  max-inline-size: 100%;
@@ -100,7 +100,6 @@ import{css as o}from"@moneko/css";export const style=o`
100
100
  display: block;
101
101
  overflow-y: auto;
102
102
  margin: 0 0 24px;
103
- border-radius: var(--border-radius);
104
103
  padding: 16px;
105
104
  max-inline-size: 200px;
106
105
  block-size: fit-content;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/md/style.ts"],"sourcesContent":["import { css } from '@moneko/css';\n\nexport const style = css`\n :host,\n :root {\n --table-heading-bg: var(--border-color);\n }\n\n .n-photo-header > span,\n .n-md-body,\n .n-md-toc {\n backdrop-filter: blur(16px);\n /* stylelint-disable-next-line */\n -webkit-backdrop-filter: blur(16px);\n }\n\n .n-md-box:not(.site-doc-main) {\n position: relative;\n display: flex;\n margin: 0 auto;\n max-inline-size: 1280px;\n flex-direction: row-reverse;\n gap: 16px;\n }\n\n .n-md-toc,\n .n-md-body {\n background-color: var(--component-bg);\n box-shadow: 0 2px 8px 0 var(--primary-shadow);\n }\n\n .n-md-body {\n overflow: hidden;\n margin: 0 auto 24px;\n border-radius: var(--border-radius);\n padding: 24px;\n color: var(--text-color);\n max-inline-size: 100%;\n box-sizing: border-box;\n overflow-wrap: break-word;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color;\n flex: 1;\n }\n\n .n-md-body .n-md-body,\n .n-md-body n-md {\n overflow: visible;\n margin: 0;\n padding: 0;\n background-color: unset;\n backdrop-filter: none;\n box-shadow: none;\n }\n\n .n-md-body:has(div:only-child:empty) {\n margin: 0;\n padding: 0;\n background-color: unset;\n backdrop-filter: none;\n box-shadow: none;\n }\n\n a {\n position: relative;\n text-decoration: none;\n color: var(--text-color);\n }\n\n a:visited {\n color: var(--text-secondary);\n }\n\n a:hover {\n color: var(--primary-hover, #80b3ff);\n }\n\n p {\n padding: 0;\n font-size: var(--font-size);\n line-height: 1.8;\n vertical-align: baseline;\n word-wrap: break-word;\n word-break: break-word;\n content-visibility: auto;\n contain-intrinsic-size: 32px;\n margin-block-end: 1em;\n }\n\n ol {\n margin: 0;\n padding: 0 0 0 24px;\n font-size: var(--font-size);\n }\n\n .n-md-toc {\n position: sticky;\n inset-block-start: 24px;\n inset-inline-end: 0;\n z-index: 10;\n display: block;\n overflow-y: auto;\n margin: 0 0 24px;\n border-radius: var(--border-radius);\n padding: 16px;\n max-inline-size: 200px;\n block-size: fit-content;\n max-block-size: calc(100vb - 132px);\n box-sizing: border-box;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: border-color, background-color, box-shadow;\n }\n\n .n-md-toc li,\n .n-md-toc ol {\n display: grid;\n inline-size: fit-content;\n max-inline-size: 100%;\n font-size: var(--font-size-sm);\n list-style: none;\n }\n\n .n-md-toc li a {\n overflow: hidden;\n max-inline-size: 100%;\n font-size: var(--font-size-sm);\n text-overflow: ellipsis;\n text-decoration: none;\n white-space: nowrap;\n color: var(--text-color);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: color;\n }\n\n .n-md-toc .active,\n .n-md-toc .active a {\n color: var(--primary-color, #5794ff);\n text-shadow: 0 1px var(--primary-shadow);\n }\n\n .n-md-toc a[href^='http'],\n .n-md-toc a[href^='\\/\\/'],\n .n-md-body table a[href^='http'] {\n &:not(:has(img, n-img))::after {\n content: ' ⎋';\n opacity: 0.3;\n }\n }\n\n a[href^='mailto:']::after {\n content: ' 📧';\n opacity: 0.4;\n }\n\n a[href]::before {\n position: absolute;\n inset-block-end: 0;\n inset-inline-start: 0;\n inline-size: 100%;\n block-size: 2px;\n background-color: var(--primary-hover, #80b3ff);\n transform: scaleX(0);\n transform-origin: center;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: transform, background-color;\n opacity: 0.5;\n content: '';\n }\n\n a[href]:has(img, n-img)::before {\n content: none !important;\n }\n\n a:hover::before {\n transform: scaleX(1);\n }\n\n th img[src*='browser-logos'] {\n display: block;\n inline-size: 32px;\n block-size: 32px;\n }\n\n h1::before,\n h2::before,\n h3::before,\n h4::before,\n h5::before,\n h6::before {\n color: var(--primary-color, #5794ff);\n content: attr(data-prefix);\n }\n\n h1[data-prefix]::before,\n h2[data-prefix]::before,\n h3[data-prefix]::before,\n h4[data-prefix]::before,\n h5[data-prefix]::before,\n h6[data-prefix]::before {\n color: var(--primary-color, #5794ff);\n content: attr(data-prefix) !important;\n }\n\n code:not([class]),\n mark {\n border-radius: var(--border-radius);\n padding: 2px 7px;\n font-size: 90%;\n color: var(--primary-heading);\n background-color: var(--text-selection);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color, color;\n }\n\n [data-prefix] code,\n [data-prefix] mark {\n font-size: 60%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n margin-block: 1em;\n font-weight: 500;\n color: var(--text-heading);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: border-color, background-color, box-shadow, color;\n }\n\n table,\n tr th,\n tr td,\n blockquote,\n blockquote::after,\n blockquote::before,\n blockquote p {\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n }\n\n dl {\n padding: 0;\n margin-block-end: 1em;\n }\n\n h1 {\n font-size: 1.6em;\n line-height: 54px;\n }\n\n h2 {\n font-size: 1.5em;\n line-height: 42px;\n counter-increment: section;\n }\n\n h2::before {\n content: counter(section) '. ';\n }\n\n h1,\n h2 {\n border-block-end: 1px dotted var(--border-color);\n padding-block-end: 10px;\n }\n\n h3 {\n font-size: 1.4em;\n line-height: 30px;\n }\n\n h4 {\n font-size: 1.3em;\n line-height: 28px;\n }\n\n h5 {\n font-size: 1.2em;\n list-style: none;\n }\n\n hr {\n margin: 16px 0;\n border: 0 none;\n padding: 0;\n block-size: 2px;\n text-align: start;\n color: var(--text-color);\n background-color: var(--border-color);\n }\n\n p img,\n p n-img {\n position: relative;\n display: flex;\n overflow: hidden;\n margin: auto;\n border-radius: var(--border-radius);\n max-inline-size: 100%;\n inline-size: fit-content;\n cursor: pointer;\n }\n\n ul {\n font-size: var(--font-size);\n }\n\n dl dt {\n margin-block-start: 16px;\n padding: 10px 0;\n font-size: 1em;\n font-weight: bold;\n font-style: italic;\n }\n\n dl dd {\n margin-block-end: 16px;\n margin-inline-start: 0;\n padding: 0 16px;\n }\n\n table {\n overflow: hidden;\n margin-block-end: 16px;\n border-block-end: 1px solid var(--table-heading-bg);\n inline-size: 100%;\n max-inline-size: 100%;\n border-spacing: 0;\n transition-property: border-color;\n word-break: break-all;\n }\n\n table:last-child {\n margin-block-end: 0;\n }\n\n table tbody tr:nth-child(2n) {\n background-color: var(--primary-details-bg);\n }\n\n table tbody tr:hover {\n background-color: var(--primary-selection);\n }\n\n table tr th {\n font-weight: 500;\n min-inline-size: 54px;\n color: var(--text-heading);\n background-color: var(--table-heading-bg);\n transition-property: background-color, color;\n }\n\n table tr th,\n table td {\n padding: 8px 16px;\n }\n\n tr:first-child th:first-child {\n border-start-start-radius: var(--border-radius);\n }\n\n tr:first-child th:last-child {\n border-start-end-radius: var(--border-radius);\n }\n\n blockquote {\n position: relative;\n margin: 30px 48px;\n border-radius: var(--border-radius);\n padding: 16px;\n font-weight: 500;\n background-color: var(--primary-selection);\n transition-property: background-color;\n }\n\n blockquote::before,\n blockquote::after {\n position: absolute;\n font-size: 56px;\n font-family: sans-serif;\n color: var(--primary-active);\n transition-property: color;\n content: '❞';\n line-height: 1;\n }\n\n blockquote::before {\n inset-block-start: -8px;\n inset-inline-start: 0;\n transform: translateX(-44px) rotate(180deg);\n }\n\n blockquote::after {\n inset-inline-end: 0;\n inset-block-end: -8px;\n transform: translateX(44px);\n }\n\n blockquote.n-tip {\n margin: 16px 0 16px 8px;\n border-inline-start: 4px solid var(--primary-color, #5794ff);\n }\n\n blockquote.n-tip::after {\n content: none;\n }\n\n blockquote.n-tip::before {\n inset-block-start: 18px;\n inset-inline-start: -12px;\n border-radius: 100%;\n inline-size: 20px;\n block-size: 20px;\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n color: #fff;\n background-color: var(--primary-color, #5794ff);\n transform: none;\n content: '!';\n line-height: 20px;\n }\n\n blockquote cite {\n font-size: var(--font-size);\n color: var(--cite-color, #bfbfbf);\n line-height: 20px;\n }\n\n blockquote cite::before {\n content: '\\\\2014 \\\\00A0';\n }\n\n blockquote p {\n margin: auto 0;\n font-size: var(--font-size);\n line-height: 24px;\n transition-property: color;\n }\n\n details {\n overflow: hidden;\n border-inline-start: 5px solid var(--primary-hover, #5794ff);\n border-radius: var(--border-radius);\n padding: 12px 24px;\n background: var(--primary-details-bg);\n box-sizing: border-box;\n user-select: none;\n box-shadow: 0 2px 8px 0 var(--primary-shadow, rgb(0 0 0 / 5%));\n }\n\n details,\n details summary {\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color, transform, border-color;\n }\n\n details:not(:last-of-type) {\n margin-block-end: 16px;\n }\n\n details > summary,\n details > summary ~ * {\n font-size: var(--font-size);\n font-weight: normal;\n font-style: normal;\n line-height: 1.4;\n transition-property: background-color, transform, border-color, margin;\n }\n\n details > summary:not(:last-of-type) details > summary ~ *:not(:last-of-type) {\n margin-block-end: 16px;\n }\n\n details > summary {\n font-weight: 500;\n outline: none;\n cursor: pointer;\n transform: translateX(-18px);\n }\n\n details > summary::-webkit-details-marker,\n details > summary::marker {\n display: none;\n color: transparent;\n }\n\n details > summary::before {\n display: inline-block;\n margin-inline-end: 4px;\n inline-size: 14px;\n font-weight: lighter;\n text-align: center;\n opacity: 0.5;\n content: '⛌';\n transform: rotate(45deg);\n }\n\n details[open] {\n user-select: auto;\n }\n\n details[open] > details {\n margin-block-start: 10px;\n }\n\n details[open] > summary {\n margin-block-end: 10px;\n }\n\n details[open] > summary::before {\n transform: rotate(0);\n }\n\n .katex-display {\n overflow-x: auto;\n }\n\n .n-photo-header {\n display: flex;\n flex-wrap: wrap;\n padding: 16px;\n gap: 16px;\n }\n\n .n-photo-header > span {\n border-radius: 8px;\n padding: 4px 10px;\n font-size: 14px;\n font-weight: lighter;\n background-color: rgb(0 0 0 / 20%);\n }\n\n .n-code {\n display: block;\n margin-block-end: 16px;\n }\n\n .n-code:last-child {\n margin-block-end: 0;\n }\n\n @media screen and (width <= 1100px) {\n .n-md-box,\n .n-md-box:not(.site-doc-main),\n .n-md-body {\n max-inline-size: auto;\n }\n\n .n-md-toc {\n position: fixed;\n inset-inline-end: 16px;\n transform: translateX(100%);\n transition: transform var(--transition-duration) var(--transition-timing-function);\n\n &:hover {\n transform: translateX(0);\n }\n }\n }\n`;\n"],"names":["css","style"],"mappings":"AAAA,OAASA,OAAAA,CAAG,KAAQ,aAAc,AAElC,QAAO,MAAMC,MAAQD,CAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAujBzB,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../components/md/style.ts"],"sourcesContent":["import { css } from '@moneko/css';\n\nexport const style = css`\n :host,\n :root {\n --table-heading-bg: var(--border-color);\n }\n\n .n-photo-header > span,\n .n-md-body,\n .n-md-toc {\n backdrop-filter: blur(16px);\n /* stylelint-disable-next-line */\n -webkit-backdrop-filter: blur(16px);\n }\n\n .n-md-box:not(.site-doc-main) {\n position: relative;\n display: flex;\n margin: 0 auto;\n max-inline-size: 1280px;\n flex-direction: row-reverse;\n gap: 16px;\n }\n\n .n-md-toc,\n .n-md-body {\n border-radius: var(--border-radius);\n background-color: var(--component-bg);\n box-shadow: 0 2px 8px 0 var(--primary-shadow);\n }\n\n .n-md-body {\n overflow: hidden;\n margin: 0 auto 24px;\n padding: 24px;\n color: var(--text-color);\n max-inline-size: 100%;\n box-sizing: border-box;\n overflow-wrap: break-word;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color;\n flex: 1;\n }\n\n .n-md-body .n-md-body,\n .n-md-body n-md {\n overflow: visible;\n margin: 0;\n padding: 0;\n background-color: unset;\n backdrop-filter: none;\n box-shadow: none;\n }\n\n .n-md-body:has(div:only-child:empty) {\n margin: 0;\n padding: 0;\n background-color: unset;\n backdrop-filter: none;\n box-shadow: none;\n }\n\n a {\n position: relative;\n text-decoration: none;\n color: var(--text-color);\n }\n\n a:visited {\n color: var(--text-secondary);\n }\n\n a:hover {\n color: var(--primary-hover, #80b3ff);\n }\n\n p {\n padding: 0;\n font-size: var(--font-size);\n line-height: 1.8;\n vertical-align: baseline;\n word-wrap: break-word;\n word-break: break-word;\n content-visibility: auto;\n contain-intrinsic-size: 32px;\n margin-block-end: 1em;\n }\n\n ol {\n margin: 0;\n padding: 0 0 0 24px;\n font-size: var(--font-size);\n }\n\n .n-md-toc {\n position: sticky;\n inset-block-start: 24px;\n inset-inline-end: 0;\n z-index: 10;\n display: block;\n overflow-y: auto;\n margin: 0 0 24px;\n padding: 16px;\n max-inline-size: 200px;\n block-size: fit-content;\n max-block-size: calc(100vb - 132px);\n box-sizing: border-box;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: border-color, background-color, box-shadow;\n }\n\n .n-md-toc li,\n .n-md-toc ol {\n display: grid;\n inline-size: fit-content;\n max-inline-size: 100%;\n font-size: var(--font-size-sm);\n list-style: none;\n }\n\n .n-md-toc li a {\n overflow: hidden;\n max-inline-size: 100%;\n font-size: var(--font-size-sm);\n text-overflow: ellipsis;\n text-decoration: none;\n white-space: nowrap;\n color: var(--text-color);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: color;\n }\n\n .n-md-toc .active,\n .n-md-toc .active a {\n color: var(--primary-color, #5794ff);\n text-shadow: 0 1px var(--primary-shadow);\n }\n\n .n-md-toc a[href^='http'],\n .n-md-toc a[href^='\\/\\/'],\n .n-md-body table a[href^='http'] {\n &:not(:has(img, n-img))::after {\n content: ' ⎋';\n opacity: 0.3;\n }\n }\n\n a[href^='mailto:']::after {\n content: ' 📧';\n opacity: 0.4;\n }\n\n a[href]::before {\n position: absolute;\n inset-block-end: 0;\n inset-inline-start: 0;\n inline-size: 100%;\n block-size: 2px;\n background-color: var(--primary-hover, #80b3ff);\n transform: scaleX(0);\n transform-origin: center;\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: transform, background-color;\n opacity: 0.5;\n content: '';\n }\n\n a[href]:has(img, n-img)::before {\n content: none !important;\n }\n\n a:hover::before {\n transform: scaleX(1);\n }\n\n th img[src*='browser-logos'] {\n display: block;\n inline-size: 32px;\n block-size: 32px;\n }\n\n h1::before,\n h2::before,\n h3::before,\n h4::before,\n h5::before,\n h6::before {\n color: var(--primary-color, #5794ff);\n content: attr(data-prefix);\n }\n\n h1[data-prefix]::before,\n h2[data-prefix]::before,\n h3[data-prefix]::before,\n h4[data-prefix]::before,\n h5[data-prefix]::before,\n h6[data-prefix]::before {\n color: var(--primary-color, #5794ff);\n content: attr(data-prefix) !important;\n }\n\n code:not([class]),\n mark {\n border-radius: var(--border-radius);\n padding: 2px 7px;\n font-size: 90%;\n color: var(--primary-heading);\n background-color: var(--text-selection);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color, color;\n }\n\n [data-prefix] code,\n [data-prefix] mark {\n font-size: 60%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n margin-block: 1em;\n font-weight: 500;\n color: var(--text-heading);\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: border-color, background-color, box-shadow, color;\n }\n\n table,\n tr th,\n tr td,\n blockquote,\n blockquote::after,\n blockquote::before,\n blockquote p {\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n }\n\n dl {\n padding: 0;\n margin-block-end: 1em;\n }\n\n h1 {\n font-size: 1.6em;\n line-height: 54px;\n }\n\n h2 {\n font-size: 1.5em;\n line-height: 42px;\n counter-increment: section;\n }\n\n h2::before {\n content: counter(section) '. ';\n }\n\n h1,\n h2 {\n border-block-end: 1px dotted var(--border-color);\n padding-block-end: 10px;\n }\n\n h3 {\n font-size: 1.4em;\n line-height: 30px;\n }\n\n h4 {\n font-size: 1.3em;\n line-height: 28px;\n }\n\n h5 {\n font-size: 1.2em;\n list-style: none;\n }\n\n hr {\n margin: 16px 0;\n border: 0 none;\n padding: 0;\n block-size: 2px;\n text-align: start;\n color: var(--text-color);\n background-color: var(--border-color);\n }\n\n p img,\n p n-img {\n position: relative;\n display: flex;\n overflow: hidden;\n margin: auto;\n border-radius: var(--border-radius);\n max-inline-size: 100%;\n inline-size: fit-content;\n cursor: pointer;\n }\n\n ul {\n font-size: var(--font-size);\n }\n\n dl dt {\n margin-block-start: 16px;\n padding: 10px 0;\n font-size: 1em;\n font-weight: bold;\n font-style: italic;\n }\n\n dl dd {\n margin-block-end: 16px;\n margin-inline-start: 0;\n padding: 0 16px;\n }\n\n table {\n overflow: hidden;\n margin-block-end: 16px;\n border-block-end: 1px solid var(--table-heading-bg);\n inline-size: 100%;\n max-inline-size: 100%;\n border-spacing: 0;\n transition-property: border-color;\n word-break: break-all;\n }\n\n table:last-child {\n margin-block-end: 0;\n }\n\n table tbody tr:nth-child(2n) {\n background-color: var(--primary-details-bg);\n }\n\n table tbody tr:hover {\n background-color: var(--primary-selection);\n }\n\n table tr th {\n font-weight: 500;\n min-inline-size: 54px;\n color: var(--text-heading);\n background-color: var(--table-heading-bg);\n transition-property: background-color, color;\n }\n\n table tr th,\n table td {\n padding: 8px 16px;\n }\n\n tr:first-child th:first-child {\n border-start-start-radius: var(--border-radius);\n }\n\n tr:first-child th:last-child {\n border-start-end-radius: var(--border-radius);\n }\n\n blockquote {\n position: relative;\n margin: 30px 48px;\n border-radius: var(--border-radius);\n padding: 16px;\n font-weight: 500;\n background-color: var(--primary-selection);\n transition-property: background-color;\n }\n\n blockquote::before,\n blockquote::after {\n position: absolute;\n font-size: 56px;\n font-family: sans-serif;\n color: var(--primary-active);\n transition-property: color;\n content: '❞';\n line-height: 1;\n }\n\n blockquote::before {\n inset-block-start: -8px;\n inset-inline-start: 0;\n transform: translateX(-44px) rotate(180deg);\n }\n\n blockquote::after {\n inset-inline-end: 0;\n inset-block-end: -8px;\n transform: translateX(44px);\n }\n\n blockquote.n-tip {\n margin: 16px 0 16px 8px;\n border-inline-start: 4px solid var(--primary-color, #5794ff);\n }\n\n blockquote.n-tip::after {\n content: none;\n }\n\n blockquote.n-tip::before {\n inset-block-start: 18px;\n inset-inline-start: -12px;\n border-radius: 100%;\n inline-size: 20px;\n block-size: 20px;\n font-size: 14px;\n font-weight: bold;\n text-align: center;\n color: #fff;\n background-color: var(--primary-color, #5794ff);\n transform: none;\n content: '!';\n line-height: 20px;\n }\n\n blockquote cite {\n font-size: var(--font-size);\n color: var(--cite-color, #bfbfbf);\n line-height: 20px;\n }\n\n blockquote cite::before {\n content: '\\\\2014 \\\\00A0';\n }\n\n blockquote p {\n margin: auto 0;\n font-size: var(--font-size);\n line-height: 24px;\n transition-property: color;\n }\n\n details {\n overflow: hidden;\n border-inline-start: 5px solid var(--primary-hover, #5794ff);\n border-radius: var(--border-radius);\n padding: 12px 24px;\n background: var(--primary-details-bg);\n box-sizing: border-box;\n user-select: none;\n box-shadow: 0 2px 8px 0 var(--primary-shadow, rgb(0 0 0 / 5%));\n }\n\n details,\n details summary {\n transition-duration: var(--transition-duration);\n transition-timing-function: var(--transition-timing-function);\n transition-property: background-color, transform, border-color;\n }\n\n details:not(:last-of-type) {\n margin-block-end: 16px;\n }\n\n details > summary,\n details > summary ~ * {\n font-size: var(--font-size);\n font-weight: normal;\n font-style: normal;\n line-height: 1.4;\n transition-property: background-color, transform, border-color, margin;\n }\n\n details > summary:not(:last-of-type) details > summary ~ *:not(:last-of-type) {\n margin-block-end: 16px;\n }\n\n details > summary {\n font-weight: 500;\n outline: none;\n cursor: pointer;\n transform: translateX(-18px);\n }\n\n details > summary::-webkit-details-marker,\n details > summary::marker {\n display: none;\n color: transparent;\n }\n\n details > summary::before {\n display: inline-block;\n margin-inline-end: 4px;\n inline-size: 14px;\n font-weight: lighter;\n text-align: center;\n opacity: 0.5;\n content: '⛌';\n transform: rotate(45deg);\n }\n\n details[open] {\n user-select: auto;\n }\n\n details[open] > details {\n margin-block-start: 10px;\n }\n\n details[open] > summary {\n margin-block-end: 10px;\n }\n\n details[open] > summary::before {\n transform: rotate(0);\n }\n\n .katex-display {\n overflow-x: auto;\n }\n\n .n-photo-header {\n display: flex;\n flex-wrap: wrap;\n padding: 16px;\n gap: 16px;\n }\n\n .n-photo-header > span {\n border-radius: 8px;\n padding: 4px 10px;\n font-size: 14px;\n font-weight: lighter;\n background-color: rgb(0 0 0 / 20%);\n }\n\n .n-code {\n display: block;\n margin-block-end: 16px;\n }\n\n .n-code:last-child {\n margin-block-end: 0;\n }\n\n @media screen and (width <= 1100px) {\n .n-md-box,\n .n-md-box:not(.site-doc-main),\n .n-md-body {\n max-inline-size: auto;\n }\n\n .n-md-toc {\n position: fixed;\n inset-inline-end: 16px;\n transform: translateX(100%);\n transition: transform var(--transition-duration) var(--transition-timing-function);\n\n &:hover {\n transform: translateX(0);\n }\n }\n }\n`;\n"],"names":["css","style"],"mappings":"AAAA,OAASA,OAAAA,CAAG,KAAQ,aAAc,AAElC,QAAO,MAAMC,MAAQD,CAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsjBzB,CAAC,AAAC"}
@@ -36,7 +36,7 @@ interface TreeBaseProps extends TreeBaseProp {
36
36
  */
37
37
  multiple?: false;
38
38
  /** 选中的值发生修改时的回调函数, 多选模式时入参为数组 */
39
- onChange?(key?: string): void;
39
+ onChange?(key?: string, item?: TreeData): void;
40
40
  }
41
41
  interface TreeMultipleBaseProps extends TreeBaseProp {
42
42
  /** 选中的值 */
@@ -45,7 +45,7 @@ interface TreeMultipleBaseProps extends TreeBaseProp {
45
45
  * @default true
46
46
  */
47
47
  multiple: true;
48
- onChange?(key?: string[]): void;
48
+ onChange?(key?: string[], item?: TreeData): void;
49
49
  }
50
50
  export interface TreeProps extends TreeBaseProps {
51
51
  /** 数据源 */
package/es/tree/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{use as e}from"solid-js/web";import{template as t}from"solid-js/web";import{style as l}from"solid-js/web";import{setAttribute as o}from"solid-js/web";import{memo as i}from"solid-js/web";import{insert as n}from"solid-js/web";import{effect as r}from"solid-js/web";import{delegateEvents as s}from"solid-js/web";import{createComponent as a}from"solid-js/web";import{className as m}from"solid-js/web";let d=t("<li>"),c=t('<span class="title">'),u=t('<span class="sub-title">'),p=t("<style>"),v=t("<ul>");import{For as h,createComponent as f,createEffect as g,createMemo as w,createSignal as b,mergeProps as y,onCleanup as k,onMount as $}from"solid-js";import C from"@moneko/common/lib/isFunction";import R from"@moneko/common/lib/isString";import j from"@moneko/common/lib/passiveSupported";import{css as _,cx as S}from"@moneko/css";import{customElement as E}from"solid-element";import{style as z}from"./style";import A from"../from-schema";import T from"../theme";function D(t){let s;let f={small:6,normal:8,large:10},{baseStyle:y}=T,[E,D]=b([]),[x,P]=b([]),B=w(()=>"rtl"===t.direction),L=w(()=>void 0!==t.value&&null!==t.value?Array.isArray(t.value)?t.value:[t.value]:[]),q=Symbol("path"),F=Symbol("path-end");function M(e){let l=e.length;if(s&&l){let o=f[t.size||"normal"];for(let t=0;t<l;t++){let l=s.querySelectorAll(`li[data-path="${e[t]}"]`);if(l.length){let e=l[0].getBoundingClientRect(),i=e.height/2+o;if(l.length>1){let{bottom:n,height:r,top:s}=l[1].getBoundingClientRect();i=0===t?s-e.top:n-e.top-r/2+o,l[1].style.setProperty("--c","none")}else 0===t&&l[0].style.setProperty("--c","none");(1!==l.length||0!==t)&&l[0].style.setProperty("--line",`${Math.abs(i)}px`)}}}}return g(()=>{let e=t.fromSchema?A(t.data):R(t.data)?function(e){let t=/[^\s|`│├└]/,l=e.trim().split("\n"),o=[{title:l[0],key:l[0]}];for(let e=1;e<l.length;e++){let i=l[e].search(t);if(-1===i)continue;let n={title:l[e].slice(i+3),depth:i};for(;o.length&&i<=(o[o.length-1].depth||0);)o.pop();if(!o.length)return[];let r=o[o.length-1];r.children||(r.children=[]),n.key=`${r.key}-${n.title}-${i}-${e}`,r.children.push(n),o.push(n)}return[o[0]]}(t.data):t.data;D([...new Set(function e(t,l=0){let o=t.length-1,i=t[o],n=t[0],r=[];for(let s=0,a=t.length;s<a;s++){let a=t[s],m=s===o;(0===s||m)&&(a[q]=n.key+(1===t.length?"":`>${i.key}`),m&&(a[F]=""),r.push(a[q])),a.children&&(r=r.concat(e(a.children,l+1)))}return r}(e))]),P(e)}),g(()=>{let e=E(),t=setTimeout(()=>{clearTimeout(t),M(e)},0);e.length&&window.addEventListener("resize",M.bind(null,e),{passive:j}),k(()=>{clearTimeout(t),window.removeEventListener("resize",M.bind(null,E()),!1)})}),$(()=>{let e=setTimeout(()=>{clearTimeout(e),M(E())},32)}),[(()=>{let e=p();return n(e,y,null),n(e,z,null),n(e,()=>_(t.css),null),e})(),(()=>{let p=v(),f=s;return"function"==typeof f?e(f,p):s=p,n(p,()=>(function e(s,p=0){return a(h,{each:s,children:s=>{let{name:a,title:v,subTitle:h,key:f,children:g}=s,w=a!==v&&a?[a,v]:[v];return[(()=>{let e=d();return e.$$dblclick=e=>null==t.onRowDoubleClick?void 0:t.onRowDoubleClick.call(t,e,f,s),e.$$click=e=>{(function(e){if(!t.readonly&&C(t.onChange)){let l=[...L()];if(t.multiple){let t=l.indexOf(e);-1===t?l.push(e):l.splice(t,1)}else l=t.toggle&&l[0]===e?[]:[e];t.onChange(t.multiple?l:l[0])}})(s.key),null==t.onRowClick||t.onRowClick.call(t,e,s.key,s)},n(e,()=>(function(e,l,o){let i=(null==t.renderRow?void 0:t.renderRow.call(t,e,l,o))||[l,o];return B()?i.reverse():i})(s,(()=>{let e=c();return n(e,()=>(B()?w.reverse():w).join(": ")),e})(),h&&(()=>{let e=u();return n(e,h),e})())),r(i=>{let n=S("row",L().includes(f)&&"active",(t.readonly||!C(t.onChange))&&"non"),r=p?{"--depth":`${2*p}em`}:void 0,a=s[F],d=s[q];return n!==i._v$&&m(e,i._v$=n),i._v$2=l(e,r,i._v$2),a!==i._v$3&&o(e,"data-path-end",i._v$3=a),d!==i._v$4&&o(e,"data-path",i._v$4=d),i},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),e})(),i(()=>g?e(g,p+1):null)]}})})(x())),r(()=>m(p,S("tree",t.size,t.class,B()&&"rtl"))),p})()]}E("n-tree",{fromSchema:void 0,size:void 0,data:[],multiple:void 0,value:void 0,onChange:void 0,class:void 0,css:void 0,readonly:void 0,toggle:void 0,direction:void 0,onRowClick:void 0,onRowDoubleClick:void 0,renderRow:void 0},(e,t)=>{let l=t.element,o=y({data:l.data,value:l.value,multiple:l.multiple,fromSchema:l.fromSchema,size:l.size,css:l.css,readonly:l.readonly,toggle:l.toggle,direction:l.direction,onChange(e){l.dispatchEvent(new CustomEvent("change",{detail:e}))},onRowClick(e,t,o){l.dispatchEvent(new CustomEvent("rowclick",{detail:[e,t,o]}))},onRowDoubleClick(e,t,o){l.dispatchEvent(new CustomEvent("rowdoubleclick",{detail:[e,t,o]}))}},e);return g(()=>{l.removeAttribute("css"),l.removeAttribute("data")}),f(D,o)});export default D;s(["click","dblclick"]);
1
+ import{use as e}from"solid-js/web";import{template as t}from"solid-js/web";import{style as l}from"solid-js/web";import{setAttribute as o}from"solid-js/web";import{memo as i}from"solid-js/web";import{insert as n}from"solid-js/web";import{effect as r}from"solid-js/web";import{delegateEvents as s}from"solid-js/web";import{createComponent as a}from"solid-js/web";import{className as m}from"solid-js/web";let d=t("<li>"),c=t('<span class="title">'),u=t('<span class="sub-title">'),p=t("<style>"),v=t("<ul>");import{For as h,createComponent as f,createEffect as g,createMemo as w,createSignal as b,mergeProps as y,onCleanup as k,onMount as $}from"solid-js";import C from"@moneko/common/lib/isFunction";import R from"@moneko/common/lib/isString";import j from"@moneko/common/lib/passiveSupported";import{css as _,cx as S}from"@moneko/css";import{customElement as E}from"solid-element";import{style as z}from"./style";import A from"../from-schema";import T from"../theme";function D(t){let s;let f={small:6,normal:8,large:10},{baseStyle:y}=T,[E,D]=b([]),[x,P]=b([]),B=w(()=>"rtl"===t.direction),L=w(()=>void 0!==t.value&&null!==t.value?Array.isArray(t.value)?t.value:[t.value]:[]),q=Symbol("path"),F=Symbol("path-end");function M(e){let l=e.length;if(s&&l){let o=f[t.size||"normal"];for(let t=0;t<l;t++){let l=s.querySelectorAll(`li[data-path="${e[t]}"]`);if(l.length){let e=l[0].getBoundingClientRect(),i=e.height/2+o;if(l.length>1){let{bottom:n,height:r,top:s}=l[1].getBoundingClientRect();i=0===t?s-e.top:n-e.top-r/2+o,l[1].style.setProperty("--c","none")}else 0===t&&l[0].style.setProperty("--c","none");(1!==l.length||0!==t)&&l[0].style.setProperty("--line",`${Math.abs(i)}px`)}}}}return g(()=>{let e=t.fromSchema?A(t.data):R(t.data)?function(e){let t=/[^\s|`│├└]/,l=e.trim().split("\n"),o=[{title:l[0],key:l[0]}];for(let e=1;e<l.length;e++){let i=l[e].search(t);if(-1===i)continue;let n={title:l[e].slice(i+3),depth:i};for(;o.length&&i<=(o[o.length-1].depth||0);)o.pop();if(!o.length)return[];let r=o[o.length-1];r.children||(r.children=[]),n.key=`${r.key}-${n.title}-${i}-${e}`,r.children.push(n),o.push(n)}return[o[0]]}(t.data):t.data;D([...new Set(function e(t,l=0){let o=t.length-1,i=t[o],n=t[0],r=[];for(let s=0,a=t.length;s<a;s++){let a=t[s],m=s===o;(0===s||m)&&(a[q]=n.key+(1===t.length?"":`>${i.key}`),m&&(a[F]=""),r.push(a[q])),a.children&&(r=r.concat(e(a.children,l+1)))}return r}(e))]),P(e)}),g(()=>{let e=E(),t=setTimeout(()=>{clearTimeout(t),M(e)},0);e.length&&window.addEventListener("resize",M.bind(null,e),{passive:j}),k(()=>{clearTimeout(t),window.removeEventListener("resize",M.bind(null,E()),!1)})}),$(()=>{let e=setTimeout(()=>{clearTimeout(e),M(E())},32)}),[(()=>{let e=p();return n(e,y,null),n(e,z,null),n(e,()=>_(t.css),null),e})(),(()=>{let p=v(),f=s;return"function"==typeof f?e(f,p):s=p,n(p,()=>(function e(s,p=0){return a(h,{each:s,children:s=>{let{name:a,title:v,subTitle:h,key:f,children:g}=s,w=a!==v&&a?[a,v]:[v];return[(()=>{let e=d();return e.$$dblclick=e=>null==t.onRowDoubleClick?void 0:t.onRowDoubleClick.call(t,e,f,s),e.$$click=e=>{(function(e,l){if(!t.readonly&&C(t.onChange)){let o=[...L()];if(t.multiple){let t=o.indexOf(e);-1===t?o.push(e):o.splice(t,1)}else o=t.toggle&&o[0]===e?[]:[e];t.onChange(t.multiple?o:o[0],l)}})(s.key,s),null==t.onRowClick||t.onRowClick.call(t,e,s.key,s)},n(e,()=>(function(e,l,o){let i=(null==t.renderRow?void 0:t.renderRow.call(t,e,l,o))||[l,o];return B()?i.reverse():i})(s,(()=>{let e=c();return n(e,()=>(B()?w.reverse():w).join(": ")),e})(),h&&(()=>{let e=u();return n(e,h),e})())),r(i=>{let n=S("row",L().includes(f)&&"active",(t.readonly||!C(t.onChange))&&"non"),r=p?{"--depth":`${2*p}em`}:void 0,a=s[F],d=s[q];return n!==i._v$&&m(e,i._v$=n),i._v$2=l(e,r,i._v$2),a!==i._v$3&&o(e,"data-path-end",i._v$3=a),d!==i._v$4&&o(e,"data-path",i._v$4=d),i},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),e})(),i(()=>g?e(g,p+1):null)]}})})(x())),r(()=>m(p,S("tree",t.size,t.class,B()&&"rtl"))),p})()]}E("n-tree",{fromSchema:void 0,size:void 0,data:[],multiple:void 0,value:void 0,onChange:void 0,class:void 0,css:void 0,readonly:void 0,toggle:void 0,direction:void 0,onRowClick:void 0,onRowDoubleClick:void 0,renderRow:void 0},(e,t)=>{let l=t.element,o=y({data:l.data,value:l.value,multiple:l.multiple,fromSchema:l.fromSchema,size:l.size,css:l.css,readonly:l.readonly,toggle:l.toggle,direction:l.direction,onChange(e,t){l.dispatchEvent(new CustomEvent("change",{detail:[e,t]}))},onRowClick(e,t,o){l.dispatchEvent(new CustomEvent("rowclick",{detail:[e,t,o]}))},onRowDoubleClick(e,t,o){l.dispatchEvent(new CustomEvent("rowdoubleclick",{detail:[e,t,o]}))}},e);return g(()=>{l.removeAttribute("css"),l.removeAttribute("data")}),f(D,o)});export default D;s(["click","dblclick"]);
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/tree/index.tsx"],"sourcesContent":["import {\n For,\n createComponent,\n createEffect,\n createMemo,\n createSignal,\n mergeProps,\n onCleanup,\n onMount,\n} from 'solid-js';\nimport { isFunction, isString, passiveSupported } from '@moneko/common';\nimport { css, cx } from '@moneko/css';\nimport { customElement } from 'solid-element';\nimport { style } from './style';\nimport schema, { type Schema } from '../from-schema';\nimport theme from '../theme';\nimport type { BasicConfig, CustomElement } from '..';\n\nexport interface TreeBaseProp {\n /** 自定义类名 */\n class?: string;\n /** 自定义样式表 */\n css?: string;\n /** 尺寸\n * @default 'normal'\n */\n size?: BasicConfig['size'];\n /** 只读 */\n readonly?: boolean;\n /** 开启取消选中, 仅多选模式生效 */\n toggle?: boolean;\n /** 方向\n * @default 'ltr'\n */\n direction?: 'rtl' | 'ltr';\n /** 点击行时的回调函数 */\n onRowClick?: (e: MouseEvent, key: string, item: TreeData) => void;\n /** 双击行时的回调函数 */\n onRowDoubleClick?: (e: MouseEvent, key: string, item: TreeData) => void;\n /** 自定义渲染行 */\n renderRow?: (item: TreeData, title: JSX.Element, subTitle?: JSX.Element) => JSX.Element[];\n /** 开启此选项支持 `JSONSchema`\n * @default false\n */\n fromSchema?: false;\n}\n\ninterface TreeBaseProps extends TreeBaseProp {\n /** 选中的值, 多选模式时为数组 */\n value?: string;\n /** 多选模式\n * @default false\n */\n multiple?: false;\n /** 选中的值发生修改时的回调函数, 多选模式时入参为数组 */\n onChange?(key?: string): void;\n}\ninterface TreeMultipleBaseProps extends TreeBaseProp {\n /** 选中的值 */\n value?: string[];\n /** 多选模式\n * @default true\n */\n multiple: true;\n onChange?(key?: string[]): void;\n}\nexport interface TreeProps extends TreeBaseProps {\n /** 数据源 */\n data: TreeData[];\n}\nexport interface TreeSchemaProps extends Omit<TreeBaseProps, 'fromSchema'> {\n /** 开启此选项支持 `JSONSchema` */\n fromSchema: true;\n /** 数据源 */\n data: Schema;\n}\nexport interface TreeStringProps extends TreeBaseProps {\n /** 数据源 */\n data: string;\n}\nexport interface TreeMultipleProps extends TreeMultipleBaseProps {\n /** 数据源 */\n data: TreeData[];\n}\nexport interface TreeMultipleSchemaProps extends Omit<TreeMultipleBaseProps, 'fromSchema'> {\n /** 开启此选项支持 `JSONSchema` */\n fromSchema: true;\n /** 数据源 */\n data: Schema;\n}\nexport interface TreeMultipleStringProps extends TreeMultipleBaseProps {\n /** 数据源 */\n data: string;\n}\n\nfunction Tree(\n _:\n | TreeProps\n | TreeMultipleProps\n | TreeMultipleSchemaProps\n | TreeSchemaProps\n | TreeMultipleStringProps\n | TreeStringProps,\n) {\n const sizeCnt = {\n small: 6,\n normal: 8,\n large: 10,\n };\n const { baseStyle } = theme;\n\n let el: HTMLUListElement | undefined;\n const [lines, setLines] = createSignal<string[]>([]);\n const [treeData, setTreeData] = createSignal<TreeData[]>([]);\n const rtl = createMemo(() => _.direction === 'rtl');\n const current = createMemo(() => {\n if (_.value !== void 0 && _.value !== null) {\n return Array.isArray(_.value) ? _.value : [_.value];\n }\n return [];\n });\n\n const path = Symbol('path');\n const pathEnd = Symbol('path-end');\n\n function countLineLen(tree: TreeData[], depth = 0) {\n const lastIdx = tree.length - 1;\n const last = tree[lastIdx];\n const frist = tree[0];\n let line: string[] = [];\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const item = tree[i],\n isLast = i === lastIdx;\n\n if (i === 0 || isLast) {\n item[path] = frist.key + (tree.length === 1 ? '' : `>${last.key}`);\n if (isLast) {\n item[pathEnd] = '';\n }\n line.push(item[path]);\n }\n if (item.children) {\n line = line.concat(countLineLen(item.children, depth + 1));\n }\n }\n return line;\n }\n\n function parseTree(str: string): TreeData[] {\n const depthRegex = /[^\\s|`│├└]/;\n const rows = str.trim().split('\\n');\n const stack: TreeStack[] = [{ title: rows[0], key: rows[0] }];\n\n for (let i = 1; i < rows.length; i++) {\n const depth = rows[i].search(depthRegex);\n\n if (depth === -1) {\n continue;\n }\n const node: Partial<TreeData> = {\n title: rows[i].slice(depth + 3),\n depth,\n };\n\n while (stack.length && depth <= (stack[stack.length - 1].depth || 0)) {\n stack.pop();\n }\n if (!stack.length) {\n return [];\n }\n const parent = stack[stack.length - 1];\n\n if (!parent.children) {\n parent.children = [];\n }\n node.key = `${parent.key}-${node.title}-${depth}-${i}`;\n parent.children.push(node as TreeData);\n stack.push(node as TreeData);\n }\n\n return [stack[0]];\n }\n\n function handleChange(key: string) {\n if (!_.readonly && isFunction(_.onChange)) {\n let _current = [...current()];\n\n if (_.multiple) {\n const idx = _current.indexOf(key);\n\n if (idx === -1) {\n _current.push(key);\n } else {\n _current.splice(idx, 1);\n }\n } else if (_.toggle && _current[0] === key) {\n _current = [];\n } else {\n _current = [key];\n }\n _.onChange(_.multiple ? _current : _current[0]);\n }\n }\n function handleClick(e: MouseEvent, item: TreeData) {\n handleChange(item.key);\n _.onRowClick?.(e, item.key as never, item as TreeData<never>);\n }\n function renderItem(item: TreeData, title: JSX.Element, subTitle?: JSX.Element): JSX.Element[] {\n const row = _.renderRow?.(item, title, subTitle) || [title, subTitle];\n\n return rtl() ? row.reverse() : row;\n }\n\n function renderTreeRow(list: TreeData[], depth = 0): JSX.Element {\n return (\n <For each={list}>\n {(item) => {\n const { name, title, subTitle, key, children } = item;\n const _title = name === title || !name ? [title] : [name, title];\n\n return (\n <>\n <li\n class={cx(\n 'row',\n current().includes(key) && 'active',\n (_.readonly || !isFunction(_.onChange)) && 'non',\n )}\n onClick={(e) => handleClick(e, item)}\n onDblClick={(e) => _.onRowDoubleClick?.(e, key, item)}\n style={depth ? { '--depth': `${depth * 2}em` } : void 0}\n data-path-end={item[pathEnd]}\n data-path={item[path]}\n >\n {renderItem(\n item,\n <span class=\"title\">{(rtl() ? _title.reverse() : _title).join(': ')}</span>,\n subTitle && <span class=\"sub-title\">{subTitle}</span>,\n )}\n </li>\n {children ? renderTreeRow(children, depth + 1) : null}\n </>\n );\n }}\n </For>\n );\n }\n function updateLine(list: string[]) {\n const len = list.length;\n\n if (el && len) {\n const prefixSize = sizeCnt[_.size || 'normal'];\n\n for (let i = 0; i < len; i++) {\n const al: NodeListOf<HTMLLIElement> = el.querySelectorAll(`li[data-path=\"${list[i]}\"]`);\n\n if (al.length) {\n const rect1 = al[0].getBoundingClientRect();\n let sideLen = rect1.height / 2 + prefixSize;\n\n if (al.length > 1) {\n const { bottom, height, top } = al[1].getBoundingClientRect();\n\n sideLen = i === 0 ? top - rect1.top : bottom - rect1.top - height / 2 + prefixSize;\n al[1].style.setProperty('--c', 'none');\n } else if (i === 0) {\n al[0].style.setProperty('--c', 'none');\n }\n if (al.length !== 1 || i !== 0) {\n al[0].style.setProperty('--line', `${Math.abs(sideLen)}px`);\n }\n }\n }\n }\n }\n createEffect(() => {\n const data = _.fromSchema ? schema(_.data) : isString(_.data) ? parseTree(_.data) : _.data;\n\n setLines([...new Set(countLineLen(data))]);\n setTreeData(data);\n });\n\n createEffect(() => {\n const line = lines();\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n updateLine(line);\n }, 0);\n\n if (line.length) {\n window.addEventListener('resize', updateLine.bind(null, line), {\n passive: passiveSupported,\n });\n }\n onCleanup(() => {\n clearTimeout(timer);\n window.removeEventListener('resize', updateLine.bind(null, lines()), false);\n });\n });\n onMount(() => {\n const timer = setTimeout(() => {\n clearTimeout(timer);\n updateLine(lines());\n }, 32);\n });\n\n return (\n <>\n <style>\n {baseStyle()}\n {style}\n {css(_.css)}\n </style>\n <ul ref={el} class={cx('tree', _.size, _.class, rtl() && 'rtl')}>\n {renderTreeRow(treeData())}\n </ul>\n </>\n );\n}\ntype CustomEvents = 'onChange' | 'onRowDoubleClick' | 'onRowClick';\n\nexport type TreeElement = CustomElement<TreeProps, CustomEvents>;\nexport type TreeSchemaElement = CustomElement<TreeSchemaProps, CustomEvents>;\nexport type TreeStringElement = CustomElement<TreeStringProps, CustomEvents>;\nexport type TreeMultipleElement = CustomElement<TreeMultipleProps, CustomEvents>;\nexport type TreeMultipleSchemaElement = CustomElement<TreeMultipleSchemaProps, CustomEvents>;\nexport type TreeMultipleStringElement = CustomElement<TreeMultipleStringProps, CustomEvents>;\n\ninterface TreeStack extends TreeData {\n /** 深度 */\n depth?: number;\n}\n\nexport interface TreeData<T = string> {\n /** key(唯一值) */\n key: T;\n /** 属性 */\n name?: string;\n /** 标题 */\n title?: string;\n /** 副标题 */\n subTitle?: string;\n /** 详细描述 */\n description?: string;\n /** 子项 */\n children?: TreeData<T>[];\n [key: string | number | symbol]:\n | T\n | string\n | number\n | symbol\n | boolean\n | TreeData<T>[]\n | undefined;\n}\n\ncustomElement<TreeProps>(\n 'n-tree',\n {\n fromSchema: void 0,\n size: void 0,\n data: [],\n multiple: void 0,\n value: void 0,\n onChange: void 0,\n class: void 0,\n css: void 0,\n readonly: void 0,\n toggle: void 0,\n direction: void 0,\n onRowClick: void 0,\n onRowDoubleClick: void 0,\n renderRow: void 0,\n },\n (_, opt) => {\n const el = opt.element;\n const props = mergeProps(\n {\n data: el.data,\n value: el.value,\n multiple: el.multiple,\n fromSchema: el.fromSchema,\n size: el.size,\n css: el.css,\n readonly: el.readonly,\n toggle: el.toggle,\n direction: el.direction,\n onChange(key: string) {\n el.dispatchEvent(\n new CustomEvent('change', {\n detail: key,\n }),\n );\n },\n onRowClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowclick', {\n detail: [e, key, item],\n }),\n );\n },\n onRowDoubleClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowdoubleclick', {\n detail: [e, key, item],\n }),\n );\n },\n },\n _,\n );\n\n createEffect(() => {\n el.removeAttribute('css');\n el.removeAttribute('data');\n });\n return createComponent(Tree, props);\n },\n);\nexport default Tree;\n"],"names":["For","createComponent","createEffect","createMemo","createSignal","mergeProps","onCleanup","onMount","isFunction","isString","passiveSupported","css","cx","customElement","style","schema","theme","Tree","_","el","sizeCnt","small","normal","large","baseStyle","lines","setLines","treeData","setTreeData","rtl","direction","current","value","Array","isArray","path","Symbol","pathEnd","updateLine","list","len","length","prefixSize","size","i","al","querySelectorAll","rect1","getBoundingClientRect","sideLen","height","bottom","top","setProperty","Math","abs","data","fromSchema","parseTree","str","depthRegex","rows","trim","split","stack","title","key","depth","search","node","slice","pop","parent","children","push","Set","countLineLen","tree","lastIdx","last","frist","line","item","isLast","concat","timer","setTimeout","clearTimeout","window","addEventListener","bind","passive","removeEventListener","renderTreeRow","name","subTitle","_title","e","onRowDoubleClick","handleChange","readonly","onChange","_current","multiple","idx","indexOf","splice","toggle","onRowClick","renderItem","row","renderRow","reverse","join","includes","class","opt","element","props","dispatchEvent","CustomEvent","detail","removeAttribute"],"mappings":"wfAAA,QACEA,OAAAA,CAAG,CACHC,mBAAAA,CAAe,CACfC,gBAAAA,CAAY,CACZC,cAAAA,CAAU,CACVC,gBAAAA,CAAY,CACZC,cAAAA,CAAU,CACVC,aAAAA,CAAS,CACTC,WAAAA,CAAO,KACF,UAAW,AAClB,QAASC,MAA8C,+BAAiB,AAAxE,QAAqBC,MAAkC,6BAAiB,AAAxE,QAA+BC,MAAwB,qCAAiB,AACxE,QAASC,OAAAA,CAAG,CAAEC,MAAAA,CAAE,KAAQ,aAAc,AACtC,QAASC,iBAAAA,CAAa,KAAQ,eAAgB,AAC9C,QAASC,SAAAA,CAAK,KAAQ,SAAU,AAChC,QAAOC,MAA6B,gBAAiB,AACrD,QAAOC,MAAW,UAAW,CAgF7B,SAASC,EACPC,CAMmB,MASfC,EAPJ,IAAMC,EAAU,CACdC,MAAO,EACPC,OAAQ,EACRC,MAAO,EACT,EACM,CAAEC,UAAAA,CAAS,CAAE,CAAGR,EAGhB,CAACS,EAAOC,EAAS,CAAGtB,EAAuB,EAAE,EAC7C,CAACuB,EAAUC,EAAY,CAAGxB,EAAyB,EAAE,EACrDyB,EAAM1B,EAAW,IAAMe,AAAgB,QAAhB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,KAAK,CACfuE,SAAUpF,EAAGoF,QAAQ,CACrB9C,WAAYtC,EAAGsC,UAAU,CACzBd,KAAMxB,EAAGwB,IAAI,CACbhC,IAAKQ,EAAGR,GAAG,CACXyF,SAAUjF,EAAGiF,QAAQ,CACrBO,OAAQxF,EAAGwF,MAAM,CACjB7E,UAAWX,EAAGW,SAAS,CACvBuE,SAASnC,CAAW,EAClB/C,EAAGoG,aAAa,CACd,IAAIC,YAAY,SAAU,CACxBC,OAAQvD,CACV,GAEJ,EACA0C,WAAWX,CAAa,CAAE/B,CAAW,CAAEgB,CAAc,EACnD/D,EAAGoG,aAAa,CACd,IAAIC,YAAY,WAAY,CAC1BC,OAAQ,CAACxB,EAAG/B,EAAKgB,EAAK,AACxB,GAEJ,EACAgB,iBAAiBD,CAAa,CAAE/B,CAAW,CAAEgB,CAAc,EACzD/D,EAAGoG,aAAa,CACd,IAAIC,YAAY,iBAAkB,CAChCC,OAAQ,CAACxB,EAAG/B,EAAKgB,EAAK,AACxB,GAEJ,CACF,EACAhE,GAOF,OAJAhB,EAAa,KACXiB,EAAGuG,eAAe,CAAC,OACnBvG,EAAGuG,eAAe,CAAC,OACrB,GACOzH,EAAgBgB,EAAMqG,EAC/B,EAEF,gBAAerG,CAAK"}
1
+ {"version":3,"sources":["../../components/tree/index.tsx"],"sourcesContent":["import {\n For,\n createComponent,\n createEffect,\n createMemo,\n createSignal,\n mergeProps,\n onCleanup,\n onMount,\n} from 'solid-js';\nimport { isFunction, isString, passiveSupported } from '@moneko/common';\nimport { css, cx } from '@moneko/css';\nimport { customElement } from 'solid-element';\nimport { style } from './style';\nimport schema, { type Schema } from '../from-schema';\nimport theme from '../theme';\nimport type { BasicConfig, CustomElement } from '..';\n\nexport interface TreeBaseProp {\n /** 自定义类名 */\n class?: string;\n /** 自定义样式表 */\n css?: string;\n /** 尺寸\n * @default 'normal'\n */\n size?: BasicConfig['size'];\n /** 只读 */\n readonly?: boolean;\n /** 开启取消选中, 仅多选模式生效 */\n toggle?: boolean;\n /** 方向\n * @default 'ltr'\n */\n direction?: 'rtl' | 'ltr';\n /** 点击行时的回调函数 */\n onRowClick?: (e: MouseEvent, key: string, item: TreeData) => void;\n /** 双击行时的回调函数 */\n onRowDoubleClick?: (e: MouseEvent, key: string, item: TreeData) => void;\n /** 自定义渲染行 */\n renderRow?: (item: TreeData, title: JSX.Element, subTitle?: JSX.Element) => JSX.Element[];\n /** 开启此选项支持 `JSONSchema`\n * @default false\n */\n fromSchema?: false;\n}\n\ninterface TreeBaseProps extends TreeBaseProp {\n /** 选中的值, 多选模式时为数组 */\n value?: string;\n /** 多选模式\n * @default false\n */\n multiple?: false;\n /** 选中的值发生修改时的回调函数, 多选模式时入参为数组 */\n onChange?(key?: string, item?: TreeData): void;\n}\ninterface TreeMultipleBaseProps extends TreeBaseProp {\n /** 选中的值 */\n value?: string[];\n /** 多选模式\n * @default true\n */\n multiple: true;\n onChange?(key?: string[], item?: TreeData): void;\n}\nexport interface TreeProps extends TreeBaseProps {\n /** 数据源 */\n data: TreeData[];\n}\nexport interface TreeSchemaProps extends Omit<TreeBaseProps, 'fromSchema'> {\n /** 开启此选项支持 `JSONSchema` */\n fromSchema: true;\n /** 数据源 */\n data: Schema;\n}\nexport interface TreeStringProps extends TreeBaseProps {\n /** 数据源 */\n data: string;\n}\nexport interface TreeMultipleProps extends TreeMultipleBaseProps {\n /** 数据源 */\n data: TreeData[];\n}\nexport interface TreeMultipleSchemaProps extends Omit<TreeMultipleBaseProps, 'fromSchema'> {\n /** 开启此选项支持 `JSONSchema` */\n fromSchema: true;\n /** 数据源 */\n data: Schema;\n}\nexport interface TreeMultipleStringProps extends TreeMultipleBaseProps {\n /** 数据源 */\n data: string;\n}\n\nfunction Tree(\n _:\n | TreeProps\n | TreeMultipleProps\n | TreeMultipleSchemaProps\n | TreeSchemaProps\n | TreeMultipleStringProps\n | TreeStringProps,\n) {\n const sizeCnt = {\n small: 6,\n normal: 8,\n large: 10,\n };\n const { baseStyle } = theme;\n\n let el: HTMLUListElement | undefined;\n const [lines, setLines] = createSignal<string[]>([]);\n const [treeData, setTreeData] = createSignal<TreeData[]>([]);\n const rtl = createMemo(() => _.direction === 'rtl');\n const current = createMemo(() => {\n if (_.value !== void 0 && _.value !== null) {\n return Array.isArray(_.value) ? _.value : [_.value];\n }\n return [];\n });\n const path = Symbol('path');\n const pathEnd = Symbol('path-end');\n\n function countLineLen(tree: TreeData[], depth = 0) {\n const lastIdx = tree.length - 1;\n const last = tree[lastIdx];\n const frist = tree[0];\n let line: string[] = [];\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const item = tree[i],\n isLast = i === lastIdx;\n\n if (i === 0 || isLast) {\n item[path] = frist.key + (tree.length === 1 ? '' : `>${last.key}`);\n if (isLast) {\n item[pathEnd] = '';\n }\n line.push(item[path]);\n }\n if (item.children) {\n line = line.concat(countLineLen(item.children, depth + 1));\n }\n }\n return line;\n }\n\n function parseTree(str: string): TreeData[] {\n const depthRegex = /[^\\s|`│├└]/;\n const rows = str.trim().split('\\n');\n const stack: TreeStack[] = [{ title: rows[0], key: rows[0] }];\n\n for (let i = 1; i < rows.length; i++) {\n const depth = rows[i].search(depthRegex);\n\n if (depth === -1) {\n continue;\n }\n const node: Partial<TreeData> = {\n title: rows[i].slice(depth + 3),\n depth,\n };\n\n while (stack.length && depth <= (stack[stack.length - 1].depth || 0)) {\n stack.pop();\n }\n if (!stack.length) {\n return [];\n }\n const parent = stack[stack.length - 1];\n\n if (!parent.children) {\n parent.children = [];\n }\n node.key = `${parent.key}-${node.title}-${depth}-${i}`;\n parent.children.push(node as TreeData);\n stack.push(node as TreeData);\n }\n\n return [stack[0]];\n }\n\n function handleChange(key: string, item: TreeData) {\n if (!_.readonly && isFunction(_.onChange)) {\n let _current = [...current()];\n\n if (_.multiple) {\n const idx = _current.indexOf(key);\n\n if (idx === -1) {\n _current.push(key);\n } else {\n _current.splice(idx, 1);\n }\n } else if (_.toggle && _current[0] === key) {\n _current = [];\n } else {\n _current = [key];\n }\n _.onChange(_.multiple ? _current : _current[0], item);\n }\n }\n function handleClick(e: MouseEvent, item: TreeData) {\n handleChange(item.key, item);\n _.onRowClick?.(e, item.key as never, item as TreeData<never>);\n }\n function renderItem(item: TreeData, title: JSX.Element, subTitle?: JSX.Element): JSX.Element[] {\n const row = _.renderRow?.(item, title, subTitle) || [title, subTitle];\n\n return rtl() ? row.reverse() : row;\n }\n\n function renderTreeRow(list: TreeData[], depth = 0): JSX.Element {\n return (\n <For each={list}>\n {(item) => {\n const { name, title, subTitle, key, children } = item;\n const _title = name === title || !name ? [title] : [name, title];\n\n return (\n <>\n <li\n class={cx(\n 'row',\n current().includes(key) && 'active',\n (_.readonly || !isFunction(_.onChange)) && 'non',\n )}\n onClick={(e) => handleClick(e, item)}\n onDblClick={(e) => _.onRowDoubleClick?.(e, key, item)}\n style={depth ? { '--depth': `${depth * 2}em` } : void 0}\n data-path-end={item[pathEnd]}\n data-path={item[path]}\n >\n {renderItem(\n item,\n <span class=\"title\">{(rtl() ? _title.reverse() : _title).join(': ')}</span>,\n subTitle && <span class=\"sub-title\">{subTitle}</span>,\n )}\n </li>\n {children ? renderTreeRow(children, depth + 1) : null}\n </>\n );\n }}\n </For>\n );\n }\n function updateLine(list: string[]) {\n const len = list.length;\n\n if (el && len) {\n const prefixSize = sizeCnt[_.size || 'normal'];\n\n for (let i = 0; i < len; i++) {\n const al: NodeListOf<HTMLLIElement> = el.querySelectorAll(`li[data-path=\"${list[i]}\"]`);\n\n if (al.length) {\n const rect1 = al[0].getBoundingClientRect();\n let sideLen = rect1.height / 2 + prefixSize;\n\n if (al.length > 1) {\n const { bottom, height, top } = al[1].getBoundingClientRect();\n\n sideLen = i === 0 ? top - rect1.top : bottom - rect1.top - height / 2 + prefixSize;\n al[1].style.setProperty('--c', 'none');\n } else if (i === 0) {\n al[0].style.setProperty('--c', 'none');\n }\n if (al.length !== 1 || i !== 0) {\n al[0].style.setProperty('--line', `${Math.abs(sideLen)}px`);\n }\n }\n }\n }\n }\n createEffect(() => {\n const data = _.fromSchema ? schema(_.data) : isString(_.data) ? parseTree(_.data) : _.data;\n\n setLines([...new Set(countLineLen(data))]);\n setTreeData(data);\n });\n\n createEffect(() => {\n const line = lines();\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n updateLine(line);\n }, 0);\n\n if (line.length) {\n window.addEventListener('resize', updateLine.bind(null, line), {\n passive: passiveSupported,\n });\n }\n onCleanup(() => {\n clearTimeout(timer);\n window.removeEventListener('resize', updateLine.bind(null, lines()), false);\n });\n });\n onMount(() => {\n const timer = setTimeout(() => {\n clearTimeout(timer);\n updateLine(lines());\n }, 32);\n });\n\n return (\n <>\n <style>\n {baseStyle()}\n {style}\n {css(_.css)}\n </style>\n <ul ref={el} class={cx('tree', _.size, _.class, rtl() && 'rtl')}>\n {renderTreeRow(treeData())}\n </ul>\n </>\n );\n}\ntype CustomEvents = 'onChange' | 'onRowDoubleClick' | 'onRowClick';\n\nexport type TreeElement = CustomElement<TreeProps, CustomEvents>;\nexport type TreeSchemaElement = CustomElement<TreeSchemaProps, CustomEvents>;\nexport type TreeStringElement = CustomElement<TreeStringProps, CustomEvents>;\nexport type TreeMultipleElement = CustomElement<TreeMultipleProps, CustomEvents>;\nexport type TreeMultipleSchemaElement = CustomElement<TreeMultipleSchemaProps, CustomEvents>;\nexport type TreeMultipleStringElement = CustomElement<TreeMultipleStringProps, CustomEvents>;\n\ninterface TreeStack extends TreeData {\n /** 深度 */\n depth?: number;\n}\n\nexport interface TreeData<T = string> {\n /** key(唯一值) */\n key: T;\n /** 属性 */\n name?: string;\n /** 标题 */\n title?: string;\n /** 副标题 */\n subTitle?: string;\n /** 详细描述 */\n description?: string;\n /** 子项 */\n children?: TreeData<T>[];\n [key: string | number | symbol]:\n | T\n | string\n | number\n | symbol\n | boolean\n | TreeData<T>[]\n | undefined;\n}\n\ncustomElement<TreeProps>(\n 'n-tree',\n {\n fromSchema: void 0,\n size: void 0,\n data: [],\n multiple: void 0,\n value: void 0,\n onChange: void 0,\n class: void 0,\n css: void 0,\n readonly: void 0,\n toggle: void 0,\n direction: void 0,\n onRowClick: void 0,\n onRowDoubleClick: void 0,\n renderRow: void 0,\n },\n (_, opt) => {\n const el = opt.element;\n const props = mergeProps(\n {\n data: el.data,\n value: el.value,\n multiple: el.multiple,\n fromSchema: el.fromSchema,\n size: el.size,\n css: el.css,\n readonly: el.readonly,\n toggle: el.toggle,\n direction: el.direction,\n onChange(key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('change', {\n detail: [key, item],\n }),\n );\n },\n onRowClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowclick', {\n detail: [e, key, item],\n }),\n );\n },\n onRowDoubleClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowdoubleclick', {\n detail: [e, key, item],\n }),\n );\n },\n },\n _,\n );\n\n createEffect(() => {\n el.removeAttribute('css');\n el.removeAttribute('data');\n });\n return createComponent(Tree, props);\n },\n);\nexport default Tree;\n"],"names":["For","createComponent","createEffect","createMemo","createSignal","mergeProps","onCleanup","onMount","isFunction","isString","passiveSupported","css","cx","customElement","style","schema","theme","Tree","_","el","sizeCnt","small","normal","large","baseStyle","lines","setLines","treeData","setTreeData","rtl","direction","current","value","Array","isArray","path","Symbol","pathEnd","updateLine","list","len","length","prefixSize","size","i","al","querySelectorAll","rect1","getBoundingClientRect","sideLen","height","bottom","top","setProperty","Math","abs","data","fromSchema","parseTree","str","depthRegex","rows","trim","split","stack","title","key","depth","search","node","slice","pop","parent","children","push","Set","countLineLen","tree","lastIdx","last","frist","line","item","isLast","concat","timer","setTimeout","clearTimeout","window","addEventListener","bind","passive","removeEventListener","renderTreeRow","name","subTitle","_title","e","onRowDoubleClick","handleChange","readonly","onChange","_current","multiple","idx","indexOf","splice","toggle","onRowClick","renderItem","row","renderRow","reverse","join","includes","class","opt","element","props","dispatchEvent","CustomEvent","detail","removeAttribute"],"mappings":"wfAAA,QACEA,O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B,EAAKgB,EAAK,AACxB,GAEJ,EACAgB,iBAAiBD,CAAa,CAAE/B,CAAW,CAAEgB,CAAc,EACzD/D,EAAGoG,aAAa,CACd,IAAIC,YAAY,iBAAkB,CAChCC,OAAQ,CAACxB,EAAG/B,EAAKgB,EAAK,AACxB,GAEJ,CACF,EACAhE,GAOF,OAJAhB,EAAa,KACXiB,EAAGuG,eAAe,CAAC,OACnBvG,EAAGuG,eAAe,CAAC,OACrB,GACOzH,EAAgBgB,EAAMqG,EAC/B,EAEF,gBAAerG,CAAK"}
@@ -46,7 +46,7 @@
46
46
  | bundleAnalyzer | js打包体积分析 | { analyzerMode: string; reportFilename: string; openAnalyzer: false } | - |
47
47
  | prefixJsLoader | 解析js/ts的前置loader | - | - |
48
48
  | bar | 是否打包显示进度条 | - | true |
49
- | theme | 设置主题, 可以在 `@app` 中获取值 | - | - |
49
+ | theme | 设置主题, 可以在 `@app/info` 中获取值 | - | - |
50
50
  | seo | 配置seo优化 | {domain: string; nojekyll?: boolean; path?: string;} | true |
51
51
  | done | 打包完成执行的回调 | () => void | - |
52
52
  | mdx | mdx loader的配置项 | MDXOptions | - |
@@ -1,4 +1,5 @@
1
- /** 虚拟模块 @app
1
+ /** 虚拟模块 @app/info
2
+ * @description 应用信息
2
3
  * @ignore optional
3
4
  */
4
5
  export interface Api {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/@moneko/info/index.ts"],"names":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type BeginIntervalProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { ActiveTab, CronType } from '.';
3
2
  import type { RadioOption } from 'neko-ui';
4
3
  export type CronItemProps<T extends ActiveTab = 'second'> = {
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type PeriodProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="typings/typings" />
2
1
  import type { CronData } from '.';
3
2
  import type { BaseOption } from 'neko-ui';
4
3
  type SomeProps = {
@@ -1,2 +1,2 @@
1
- "use strict";var e,r;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}}),(r=e||(e={})).string="string",r.number="number",r.integer="integer",r.boolean="boolean",r.object="object",r.array="array";const t=function e(r,t){let n=[],{properties:o}=r;for(let r in o)if(Object.prototype.hasOwnProperty.call(o,r)){let{properties:i,items:s,type:a="string",...l}=o[r],p={...l,name:r,type:a,subTitle:a,key:`${t?`${t}.`:""}${r}`};"object"===a?p.children=e({properties:i},p.key):"array"===a&&(p.children=e({properties:{items:{...s,title:"items"}}},p.key)),n.push(p)}return n};
1
+ "use strict";var e,t;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}}),(t=e||(e={})).string="string",t.number="number",t.integer="integer",t.boolean="boolean",t.object="object",t.array="array";const r=function e(t,r){let n=[],{properties:i}=t;for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let{properties:o,items:s,type:a="string",...l}=i[t],p={...l,name:t,type:a,subTitle:a,key:`${r?`${r}.`:""}${t}`};"object"===a?p.children=e({properties:o},p.key):"array"===a&&(p.children=e({properties:{items:{...s,title:"items",isItems:!0}}},p.key)),n.push(p)}return n};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/from-schema/index.ts"],"sourcesContent":["import { type TreeData } from '../tree';\n\nenum Type {\n string = 'string',\n number = 'number',\n integer = 'integer',\n boolean = 'boolean',\n object = 'object',\n array = 'array',\n}\ninterface BaseSchema {\n type?: keyof typeof Type;\n name?: string;\n title?: string;\n items?: never;\n [key: string]: Any;\n}\ninterface ArraySchema extends Omit<BaseSchema, 'type' | 'items'> {\n type: 'array';\n items: Schema;\n properties?: Record<string, Schema>;\n}\n\ninterface ObjectSchema extends Omit<BaseSchema, 'type'> {\n type?: Exclude<keyof typeof Type, 'array'>;\n properties?: Record<string, Schema>;\n}\n\nexport type Schema = ObjectSchema | ArraySchema;\n\nfunction fromSchema(schema: Schema, pid?: string): TreeData<string>[] {\n const treeData: TreeData<string>[] = [];\n const { properties } = schema;\n\n for (const k in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, k)) {\n const name = k as keyof typeof properties;\n const { properties: _properties, items, type = 'string', ...item } = properties[name];\n\n const node: TreeData<string> = {\n ...item,\n name: name,\n type,\n subTitle: type,\n key: `${pid ? `${pid}.` : ''}${name}`,\n };\n\n if (type === 'object') {\n node.children = fromSchema({ properties: _properties }, node.key);\n } else if (type === 'array') {\n node.children = fromSchema(\n {\n properties: {\n items: {\n ...(items as Schema),\n title: 'items',\n },\n },\n },\n node.key,\n );\n }\n treeData.push(node);\n }\n }\n\n return treeData;\n}\n\nexport default fromSchema;\n"],"names":["Type","fromSchema","schema","pid","treeData","properties","k","Object","prototype","hasOwnProperty","call","_properties","items","type","item","node","name","subTitle","key","children","title","push"],"mappings":"mBAEKA,uFAmEL,+CAAA,MAnEKA,EAAAA,IAAAA,yHAmEL,EAvCA,SAASC,EAAWC,CAAc,CAAEC,CAAY,EAC9C,IAAMC,EAA+B,EAAE,CACjC,CAAEC,WAAAA,CAAU,CAAE,CAAGH,EAEvB,IAAK,IAAMI,KAAKD,EACd,GAAIE,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,EAAYC,GAAI,CAEvD,GAAM,CAAED,WAAYM,CAAW,CAAEC,MAAAA,CAAK,CAAEC,KAAAA,EAAO,QAAQ,CAAE,GAAGC,EAAM,CAAGT,CAAU,CADlEC,EACwE,CAE/ES,EAAyB,CAC7B,GAAGD,CAAI,CACPE,KALWV,EAMXO,KAAAA,EACAI,SAAUJ,EACVK,IAAK,CAAC,EAAEf,EAAM,CAAC,EAAEA,EAAI,CAAC,CAAC,CAAG,GAAG,EARlBG,EAQyB,CAAC,AACvC,CAEIO,AAAS,CAAA,WAATA,EACFE,EAAKI,QAAQ,CAAGlB,EAAW,CAAEI,WAAYM,CAAY,EAAGI,EAAKG,GAAG,EAC9C,UAATL,GACTE,CAAAA,EAAKI,QAAQ,CAAGlB,EACd,CACEI,WAAY,CACVO,MAAO,CACL,GAAIA,CAAK,CACTQ,MAAO,OACT,CACF,CACF,EACAL,EAAKG,GAAG,CACV,EAEFd,EAASiB,IAAI,CAACN,EAChB,CAGF,OAAOX,CACT"}
1
+ {"version":3,"sources":["../../components/from-schema/index.ts"],"sourcesContent":["import { type TreeData } from '../tree';\n\nenum Type {\n string = 'string',\n number = 'number',\n integer = 'integer',\n boolean = 'boolean',\n object = 'object',\n array = 'array',\n}\ninterface BaseSchema {\n type?: keyof typeof Type;\n name?: string;\n title?: string;\n items?: never;\n [key: string]: Any;\n}\ninterface ArraySchema extends Omit<BaseSchema, 'type' | 'items'> {\n type: 'array';\n items: Schema;\n properties?: Record<string, Schema>;\n}\n\ninterface ObjectSchema extends Omit<BaseSchema, 'type'> {\n type?: Exclude<keyof typeof Type, 'array'>;\n properties?: Record<string, Schema>;\n}\n\nexport type Schema = ObjectSchema | ArraySchema;\n\nfunction fromSchema(schema: Schema, pid?: string): TreeData<string>[] {\n const treeData: TreeData<string>[] = [];\n const { properties } = schema;\n\n for (const k in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, k)) {\n const name = k as keyof typeof properties;\n const { properties: _properties, items, type = 'string', ...item } = properties[name];\n const node: TreeData<string> = {\n ...item,\n name: name,\n type,\n subTitle: type,\n key: `${pid ? `${pid}.` : ''}${name}`,\n };\n\n if (type === 'object') {\n node.children = fromSchema({ properties: _properties }, node.key);\n } else if (type === 'array') {\n node.children = fromSchema(\n {\n properties: {\n items: {\n ...(items as Schema),\n title: 'items',\n isItems: true,\n },\n },\n },\n node.key,\n );\n }\n treeData.push(node);\n }\n }\n\n return treeData;\n}\n\nexport default fromSchema;\n"],"names":["Type","fromSchema","schema","pid","treeData","properties","k","Object","prototype","hasOwnProperty","call","_properties","items","type","item","node","name","subTitle","key","children","title","isItems","push"],"mappings":"mBAEKA,uFAmEL,+CAAA,MAnEKA,EAAAA,IAAAA,yHAmEL,EAvCA,SAASC,EAAWC,CAAc,CAAEC,CAAY,EAC9C,IAAMC,EAA+B,EAAE,CACjC,CAAEC,WAAAA,CAAU,CAAE,CAAGH,EAEvB,IAAK,IAAMI,KAAKD,EACd,GAAIE,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,EAAYC,GAAI,CAEvD,GAAM,CAAED,WAAYM,CAAW,CAAEC,MAAAA,CAAK,CAAEC,KAAAA,EAAO,QAAQ,CAAE,GAAGC,EAAM,CAAGT,CAAU,CADlEC,EACwE,CAC/ES,EAAyB,CAC7B,GAAGD,CAAI,CACPE,KAJWV,EAKXO,KAAAA,EACAI,SAAUJ,EACVK,IAAK,CAAC,EAAEf,EAAM,CAAC,EAAEA,EAAI,CAAC,CAAC,CAAG,GAAG,EAPlBG,EAOyB,CAAC,AACvC,CAEIO,AAAS,CAAA,WAATA,EACFE,EAAKI,QAAQ,CAAGlB,EAAW,CAAEI,WAAYM,CAAY,EAAGI,EAAKG,GAAG,EAC9C,UAATL,GACTE,CAAAA,EAAKI,QAAQ,CAAGlB,EACd,CACEI,WAAY,CACVO,MAAO,CACL,GAAIA,CAAK,CACTQ,MAAO,QACPC,QAAS,CAAA,CACX,CACF,CACF,EACAN,EAAKG,GAAG,CACV,EAEFd,EAASkB,IAAI,CAACP,EAChB,CAGF,OAAOX,CACT"}
package/lib/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as Img, type ImgElement, type ImgProps } from './img';
20
20
  export { default as Input, type InputElement, type InputProps } from './input';
21
21
  export { default as InputNumber, type InputNumberElement, type InputNumberProps, } from './input-number';
22
22
  export { default as Md, type MdElement, type MdProps } from './md';
23
+ export { style as mdStyle } from './md/style';
23
24
  export { default as Menu, type MenuElement, type MenuMultipleElement, type MenuMultipleProps, type MenuOption, type MenuProps, } from './menu';
24
25
  export { default as Modal, type ModalElement, type ModalProps, type OpenStateKey, OpenState, } from './modal';
25
26
  export { default as Pagination, type PaginationProps, type PaginationElement } from './pagination';
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
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,{Avatar:function(){return t.default},AvatarGroup:function(){return u.default},BackTop:function(){return n.default},Button:function(){return o.default},CaptureScreen:function(){return f.default},Carousel:function(){return a.default},Checkbox:function(){return c.default},Code:function(){return l.default},ColorPalette:function(){return d.default},ColorPicker:function(){return _.default},Cron:function(){return q.default},DatePicker:function(){return p.default},Dropdown:function(){return s.default},Empty:function(){return m.default},FieldName:function(){return i.FieldName},HighlightText:function(){return S.default},Img:function(){return b.default},Input:function(){return k.default},InputNumber:function(){return w.default},Md:function(){return C.default},Menu:function(){return v.default},Modal:function(){return y.default},OpenState:function(){return y.OpenState},Pagination:function(){return T.default},Popover:function(){return P.default},Provider:function(){return H.default},Radio:function(){return O.default},Segmented:function(){return x.default},Select:function(){return M.default},Size:function(){return i.Size},Skeleton:function(){return E.default},Spin:function(){return j.default},Status:function(){return i.Status},Switch:function(){return D.default},Table:function(){return I.default},Tabs:function(){return N.default},Tag:function(){return z.default},Tree:function(){return B.default},Typography:function(){return F.default},customElement:function(){return R.customElement},dayjs:function(){return G.default},fromSchema:function(){return h.default},generateTheme:function(){return A.generateTheme},getCurrentElement:function(){return R.getCurrentElement},getOptions:function(){return g.default},hot:function(){return R.hot},noShadowDOM:function(){return R.noShadowDOM},theme:function(){return A.default},toneColor:function(){return A.toneColor},withSolid:function(){return R.withSolid}});const e=require("@swc/helpers/_/_interop_require_default"),r=require("@swc/helpers/_/_interop_require_wildcard"),t=e._(require("./avatar")),u=e._(require("./avatar/group")),n=e._(require("./back-top")),i=require("./basic-config"),o=e._(require("./button")),f=e._(require("./capture-screen")),a=e._(require("./carousel")),c=e._(require("./checkbox")),l=e._(require("./code")),d=e._(require("./color-palette")),_=e._(require("./color-picker")),q=e._(require("./cron")),p=e._(require("./date-picker")),s=e._(require("./dropdown")),m=e._(require("./empty")),h=e._(require("./from-schema")),g=e._(require("./get-options")),S=e._(require("./highlight-text")),b=e._(require("./img")),k=e._(require("./input")),w=e._(require("./input-number")),C=e._(require("./md")),v=e._(require("./menu")),y=r._(require("./modal")),T=e._(require("./pagination")),P=e._(require("./popover")),O=e._(require("./radio")),x=e._(require("./segmented")),M=e._(require("./select")),E=e._(require("./skeleton")),j=e._(require("./spin")),D=e._(require("./switch")),I=e._(require("./table")),N=e._(require("./tabs")),z=e._(require("./tag")),A=r._(require("./theme")),B=e._(require("./tree")),F=e._(require("./typography")),G=e._(require("./date-picker/dayjs")),H=e._(require("./provider")),R=require("solid-element");
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,{Avatar:function(){return t.default},AvatarGroup:function(){return u.default},BackTop:function(){return n.default},Button:function(){return o.default},CaptureScreen:function(){return f.default},Carousel:function(){return a.default},Checkbox:function(){return c.default},Code:function(){return l.default},ColorPalette:function(){return d.default},ColorPicker:function(){return _.default},Cron:function(){return q.default},DatePicker:function(){return p.default},Dropdown:function(){return s.default},Empty:function(){return m.default},FieldName:function(){return i.FieldName},HighlightText:function(){return S.default},Img:function(){return b.default},Input:function(){return y.default},InputNumber:function(){return k.default},Md:function(){return w.default},Menu:function(){return v.default},Modal:function(){return T.default},OpenState:function(){return T.OpenState},Pagination:function(){return P.default},Popover:function(){return O.default},Provider:function(){return R.default},Radio:function(){return x.default},Segmented:function(){return M.default},Select:function(){return E.default},Size:function(){return i.Size},Skeleton:function(){return j.default},Spin:function(){return D.default},Status:function(){return i.Status},Switch:function(){return I.default},Table:function(){return N.default},Tabs:function(){return z.default},Tag:function(){return A.default},Tree:function(){return F.default},Typography:function(){return G.default},customElement:function(){return J.customElement},dayjs:function(){return H.default},fromSchema:function(){return h.default},generateTheme:function(){return B.generateTheme},getCurrentElement:function(){return J.getCurrentElement},getOptions:function(){return g.default},hot:function(){return J.hot},mdStyle:function(){return C.style},noShadowDOM:function(){return J.noShadowDOM},theme:function(){return B.default},toneColor:function(){return B.toneColor},withSolid:function(){return J.withSolid}});const e=require("@swc/helpers/_/_interop_require_default"),r=require("@swc/helpers/_/_interop_require_wildcard"),t=e._(require("./avatar")),u=e._(require("./avatar/group")),n=e._(require("./back-top")),i=require("./basic-config"),o=e._(require("./button")),f=e._(require("./capture-screen")),a=e._(require("./carousel")),c=e._(require("./checkbox")),l=e._(require("./code")),d=e._(require("./color-palette")),_=e._(require("./color-picker")),q=e._(require("./cron")),p=e._(require("./date-picker")),s=e._(require("./dropdown")),m=e._(require("./empty")),h=e._(require("./from-schema")),g=e._(require("./get-options")),S=e._(require("./highlight-text")),b=e._(require("./img")),y=e._(require("./input")),k=e._(require("./input-number")),w=e._(require("./md")),C=require("./md/style"),v=e._(require("./menu")),T=r._(require("./modal")),P=e._(require("./pagination")),O=e._(require("./popover")),x=e._(require("./radio")),M=e._(require("./segmented")),E=e._(require("./select")),j=e._(require("./skeleton")),D=e._(require("./spin")),I=e._(require("./switch")),N=e._(require("./table")),z=e._(require("./tabs")),A=e._(require("./tag")),B=r._(require("./theme")),F=e._(require("./tree")),G=e._(require("./typography")),H=e._(require("./date-picker/dayjs")),R=e._(require("./provider")),J=require("solid-element");
2
2
  //# sourceMappingURL=index.js.map