orion-design 0.1.29 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Throne/index.js +30 -14
- package/dist/Throne/index.js.map +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
- package/dist/components/Button/index.js +40 -33
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +122 -89
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +128 -66
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.js +836 -656
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +30 -18
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +28 -0
- package/dist/components/LovTable/index.d.ts +14 -0
- package/dist/components/LovTable/index.js +179 -105
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/ModalLocator.vue.d.ts +20 -0
- package/dist/components/Modal/index.d.ts +4 -1
- package/dist/components/Modal/index.js +127 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Modal/types.d.ts +18 -0
- package/dist/components/Modal/types.js +7 -0
- package/dist/components/Modal/types.js.map +1 -0
- package/dist/components/Modal/useModal.d.ts +1 -3
- package/dist/components/Modal/useModal.js +5 -4
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/Pagetable/Pagetable.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
- package/dist/components/Pagetable/hooks/useColumns.js +88 -74
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +9 -0
- package/dist/components/Pagetable/index.js +697 -491
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +92 -54
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/hooks/useColumns.js +82 -74
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.js +579 -469
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +92 -54
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +100 -74
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +603 -358
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +6 -4
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +74 -39
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +29 -19
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +9 -5
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +22 -17
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +74 -39
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +9 -8
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +14 -7
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +49 -25
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +103 -61
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +65 -50
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +8 -4
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +12 -11
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +4 -2
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +18 -14
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +46 -20
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +18 -10
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +5 -4
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +4 -3
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +9 -8
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +16 -10
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +41 -38
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +41 -22
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +85 -43
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +27 -15
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +29 -25
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +35 -18
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +46 -30
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +12 -6
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +5 -3
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +5 -4
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +100 -54
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +231 -220
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.js +20 -20
- package/dist/components/index.js +38 -35
- package/dist/components/index.js.map +1 -1
- package/dist/components-8oZ2kpUC.js +27 -0
- package/dist/components-8oZ2kpUC.js.map +1 -0
- package/dist/components-B3d9m_tn.js +27 -0
- package/dist/components-B3d9m_tn.js.map +1 -0
- package/dist/error/OrionError.js +8 -4
- package/dist/error/OrionError.js.map +1 -1
- package/dist/functions-BeMkokbY.js +63 -0
- package/dist/functions-BeMkokbY.js.map +1 -0
- package/dist/index-BOKLZnqH.js +54 -0
- package/dist/index-BOKLZnqH.js.map +1 -0
- package/dist/index-D1m0KTpK.js +69 -0
- package/dist/index-D1m0KTpK.js.map +1 -0
- package/dist/index-DR5ZP7mD.js +160 -0
- package/dist/index-DR5ZP7mD.js.map +1 -0
- package/dist/index-DkwIULcN.js +200 -0
- package/dist/index-DkwIULcN.js.map +1 -0
- package/dist/index.css +797 -1
- package/dist/index.js +36 -36
- package/dist/print/LodopFuncs.js +101 -43
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +200 -108
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +17 -14
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +16 -13
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +17 -14
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +47 -22
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +40 -25
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +16 -10
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +305 -201
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +11 -5
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +11 -5
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +9 -4
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +11 -5
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +48 -33
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +191 -93
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +35 -25
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/components-J6-qau6Y.js +0 -73
- package/dist/components-J6-qau6Y.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../src/components/_util/util.ts"],"sourcesContent":["import type { VueNode } from './type'\r\nexport const isFunction = (val) => typeof val === 'function'\r\nexport const controlDefaultValue = Symbol('controlDefaultValue') as any\r\nexport const isArray = Array.isArray\r\nexport const isString = (val) => typeof val === 'string'\r\nexport const isSymbol = (val) => typeof val === 'symbol'\r\nexport const isObject = (val) => val !== null && typeof val === 'object'\r\nconst onRE = /^on[^a-z]/\r\nconst isOn = (key) => onRE.test(key)\r\n\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null)\r\n return (str) => {\r\n const hit = cache[str]\r\n return hit || (cache[str] = fn(str))\r\n }\r\n}\r\nconst camelizeRE = /-(\\w)/g\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\r\n})\r\n\r\nconst hyphenateRE = /\\B([A-Z])/g\r\nconst hyphenate = cacheStringFunction((str) => {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase()\r\n})\r\n\r\nconst capitalize = cacheStringFunction((str) => {\r\n return str.charAt(0).toUpperCase() + str.slice(1)\r\n})\r\n\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key)\r\n\r\n// change from vue sourcecode\r\nfunction resolvePropValue(options, props, key, value) {\r\n const opt = options[key]\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default')\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default\r\n value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue\r\n }\r\n // boolean casting\r\n if (opt.type === Boolean) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false\r\n } else if (value === '') {\r\n value = true\r\n }\r\n }\r\n }\r\n return value\r\n}\r\n\r\nexport function getDataAndAriaProps(props) {\r\n return Object.keys(props).reduce((memo, key) => {\r\n if (key.startsWith('data-') || key.startsWith('aria-')) {\r\n memo[key] = props[key]\r\n }\r\n return memo\r\n }, {})\r\n}\r\n\r\nexport function toPx(val) {\r\n if (typeof val === 'number') return `${val}px`\r\n return val\r\n}\r\n\r\nexport function renderHelper<T = Record<string, any>>(v: VueNode | ((arg0: T) => VueNode), props: T = {} as T, defaultV?: any) {\r\n if (typeof v === 'function') {\r\n return v(props)\r\n }\r\n return v ?? defaultV\r\n}\r\nexport function wrapPromiseFn(openFn: (resolve: VoidFunction) => VoidFunction) {\r\n let closeFn: VoidFunction\r\n\r\n const closePromise = new Promise<boolean>((resolve) => {\r\n closeFn = openFn(() => {\r\n resolve(true)\r\n })\r\n })\r\n\r\n const result: any = () => {\r\n closeFn?.()\r\n }\r\n\r\n result.then = (filled: VoidFunction, rejected: VoidFunction) => closePromise.then(filled, rejected)\r\n result.promise = closePromise\r\n\r\n return result\r\n}\r\n\r\nexport { isOn, cacheStringFunction, camelize, hyphenate, capitalize, resolvePropValue }\r\n"],"names":[
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../src/components/_util/util.ts"],"sourcesContent":["import type { VueNode } from './type'\r\nexport const isFunction = (val) => typeof val === 'function'\r\nexport const controlDefaultValue = Symbol('controlDefaultValue') as any\r\nexport const isArray = Array.isArray\r\nexport const isString = (val) => typeof val === 'string'\r\nexport const isSymbol = (val) => typeof val === 'symbol'\r\nexport const isObject = (val) => val !== null && typeof val === 'object'\r\nconst onRE = /^on[^a-z]/\r\nconst isOn = (key) => onRE.test(key)\r\n\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null)\r\n return (str) => {\r\n const hit = cache[str]\r\n return hit || (cache[str] = fn(str))\r\n }\r\n}\r\nconst camelizeRE = /-(\\w)/g\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\r\n})\r\n\r\nconst hyphenateRE = /\\B([A-Z])/g\r\nconst hyphenate = cacheStringFunction((str) => {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase()\r\n})\r\n\r\nconst capitalize = cacheStringFunction((str) => {\r\n return str.charAt(0).toUpperCase() + str.slice(1)\r\n})\r\n\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key)\r\n\r\n// change from vue sourcecode\r\nfunction resolvePropValue(options, props, key, value) {\r\n const opt = options[key]\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default')\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default\r\n value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue\r\n }\r\n // boolean casting\r\n if (opt.type === Boolean) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false\r\n } else if (value === '') {\r\n value = true\r\n }\r\n }\r\n }\r\n return value\r\n}\r\n\r\nexport function getDataAndAriaProps(props) {\r\n return Object.keys(props).reduce((memo, key) => {\r\n if (key.startsWith('data-') || key.startsWith('aria-')) {\r\n memo[key] = props[key]\r\n }\r\n return memo\r\n }, {})\r\n}\r\n\r\nexport function toPx(val) {\r\n if (typeof val === 'number') return `${val}px`\r\n return val\r\n}\r\n\r\nexport function renderHelper<T = Record<string, any>>(v: VueNode | ((arg0: T) => VueNode), props: T = {} as T, defaultV?: any) {\r\n if (typeof v === 'function') {\r\n return v(props)\r\n }\r\n return v ?? defaultV\r\n}\r\nexport function wrapPromiseFn(openFn: (resolve: VoidFunction) => VoidFunction) {\r\n let closeFn: VoidFunction\r\n\r\n const closePromise = new Promise<boolean>((resolve) => {\r\n closeFn = openFn(() => {\r\n resolve(true)\r\n })\r\n })\r\n\r\n const result: any = () => {\r\n closeFn?.()\r\n }\r\n\r\n result.then = (filled: VoidFunction, rejected: VoidFunction) => closePromise.then(filled, rejected)\r\n result.promise = closePromise\r\n\r\n return result\r\n}\r\n\r\nexport { isOn, cacheStringFunction, camelize, hyphenate, capitalize, resolvePropValue }\r\n"],"names":[],"mappings":"AACO,MAAM,aAAa,CAAC,QAAQ,OAAO,QAAQ;AACrC,MAAA,sBAAsB,OAAO,qBAAqB;AACxD,MAAM,UAAU,MAAM;AACtB,MAAM,WAAW,CAAC,QAAQ,OAAO,QAAQ;AACzC,MAAM,WAAW,CAAC,QAAQ,OAAO,QAAQ;AACzC,MAAM,WAAW,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ;AAChE,MAAM,OAAO;AACb,MAAM,OAAO,CAAC,QAAQ,KAAK,KAAK,GAAG;AAE7B,MAAA,sBAAsB,CAAC,OAAO;AAC5B,QAAA,QAAe,uBAAA,OAAO,IAAI;AAChC,SAAO,CAAC,QAAQ;AACR,UAAA,MAAM,MAAM,GAAG;AACrB,WAAO,QAAQ,MAAM,GAAG,IAAI,GAAG,GAAG;AAAA,EAAA;AAEtC;AACA,MAAM,aAAa;AACb,MAAA,WAAW,oBAAoB,CAAC,QAAQ;AACrC,SAAA,IAAI,QAAQ,YAAY,CAAC,GAAG,MAAO,IAAI,EAAE,YAAY,IAAI,EAAG;AACrE,CAAC;AAED,MAAM,cAAc;AACd,MAAA,YAAY,oBAAoB,CAAC,QAAQ;AAC7C,SAAO,IAAI,QAAQ,aAAa,KAAK,EAAE,YAAY;AACrD,CAAC;AAEK,MAAA,aAAa,oBAAoB,CAAC,QAAQ;AACvC,SAAA,IAAI,OAAO,CAAC,EAAE,gBAAgB,IAAI,MAAM,CAAC;AAClD,CAAC;AAED,MAAM,iBAAiB,OAAO,UAAU;AACxC,MAAM,SAAS,CAAC,KAAK,QAAQ,eAAe,KAAK,KAAK,GAAG;AAGzD,SAAS,iBAAiB,SAAS,OAAO,KAAK,OAAO;AAC9C,QAAA,MAAM,QAAQ,GAAG;AACvB,MAAI,OAAO,MAAM;AACT,UAAA,aAAa,OAAO,KAAK,SAAS;AAEpC,QAAA,cAAc,UAAU,QAAW;AACrC,YAAM,eAAe,IAAI;AACzB,cAAQ,IAAI,SAAS,YAAY,WAAW,YAAY,IAAI,aAAiB,IAAA;AAAA,IAC/E;AAEI,QAAA,IAAI,SAAS,SAAS;AACxB,UAAI,CAAC,OAAO,OAAO,GAAG,KAAK,CAAC,YAAY;AAC9B,gBAAA;AAAA,MAAA,WACC,UAAU,IAAI;AACf,gBAAA;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACO,SAAA;AACT;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,MAAM,QAAQ;AAC9C,QAAI,IAAI,WAAW,OAAO,KAAK,IAAI,WAAW,OAAO,GAAG;AACjD,WAAA,GAAG,IAAI,MAAM,GAAG;AAAA,IACvB;AACO,WAAA;AAAA,EACT,GAAG,CAAE,CAAA;AACP;AAEO,SAAS,KAAK,KAAK;AACxB,MAAI,OAAO,QAAQ,SAAU,QAAO,GAAG,GAAG;AACnC,SAAA;AACT;AAEO,SAAS,aAAsC,GAAqC,QAAW,CAAA,GAAS,UAAgB;AACzH,MAAA,OAAO,MAAM,YAAY;AAC3B,WAAO,EAAE,KAAK;AAAA,EAChB;AACA,SAAO,KAAK;AACd;AACO,SAAS,cAAc,QAAiD;AACzE,MAAA;AAEJ,QAAM,eAAe,IAAI,QAAiB,CAAC,YAAY;AACrD,cAAU,OAAO,MAAM;AACrB,cAAQ,IAAI;AAAA,IAAA,CACb;AAAA,EAAA,CACF;AAED,QAAM,SAAc,MAAM;AACd;AAAA,EAAA;AAGZ,SAAO,OAAO,CAAC,QAAsB,aAA2B,aAAa,KAAK,QAAQ,QAAQ;AAClG,SAAO,UAAU;AAEV,SAAA;AACT;"}
|
@@ -1,21 +1,33 @@
|
|
1
|
-
import { i as
|
2
|
-
const
|
3
|
-
let
|
4
|
-
function
|
5
|
-
const
|
6
|
-
|
1
|
+
import { i as isClient } from "../../../index-D1m0KTpK.js";
|
2
|
+
const globalNodes = [];
|
3
|
+
let target = !isClient ? void 0 : document.body;
|
4
|
+
function createGlobalNode(id) {
|
5
|
+
const el = document.createElement("div");
|
6
|
+
if (id !== void 0) {
|
7
|
+
el.setAttribute("id", id);
|
8
|
+
}
|
9
|
+
if (target) {
|
10
|
+
target.appendChild(el);
|
11
|
+
globalNodes.push(el);
|
12
|
+
}
|
13
|
+
return el;
|
7
14
|
}
|
8
|
-
function
|
9
|
-
|
15
|
+
function removeGlobalNode(el) {
|
16
|
+
globalNodes.splice(globalNodes.indexOf(el), 1);
|
17
|
+
el.remove();
|
10
18
|
}
|
11
|
-
function
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
function changeGlobalNodesTarget(el) {
|
20
|
+
if (el === target) return;
|
21
|
+
target = el;
|
22
|
+
globalNodes.forEach((el2) => {
|
23
|
+
if (target && !el2.contains(target)) {
|
24
|
+
target.appendChild(el2);
|
25
|
+
}
|
26
|
+
});
|
15
27
|
}
|
16
28
|
export {
|
17
|
-
|
18
|
-
|
19
|
-
|
29
|
+
changeGlobalNodesTarget,
|
30
|
+
createGlobalNode,
|
31
|
+
removeGlobalNode
|
20
32
|
};
|
21
33
|
//# sourceMappingURL=global-node.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\n\nconst globalNodes: HTMLElement[] = []\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\n\nexport function createGlobalNode(id?: string) {\n const el = document.createElement('div')\n if (id !== undefined) {\n el.setAttribute('id', id)\n }\n\n if (target) {\n target.appendChild(el)\n globalNodes.push(el)\n }\n\n return el\n}\n\nexport function removeGlobalNode(el: HTMLElement) {\n globalNodes.splice(globalNodes.indexOf(el), 1)\n el.remove()\n}\n\nexport function changeGlobalNodesTarget(el: HTMLElement) {\n if (el === target) return\n\n target = el\n globalNodes.forEach((el) => {\n if (target && !el.contains(target)) {\n target.appendChild(el)\n }\n })\n}\n"],"names":["
|
1
|
+
{"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nconst globalNodes: HTMLElement[] = []\r\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\r\n\r\nexport function createGlobalNode(id?: string) {\r\n const el = document.createElement('div')\r\n if (id !== undefined) {\r\n el.setAttribute('id', id)\r\n }\r\n\r\n if (target) {\r\n target.appendChild(el)\r\n globalNodes.push(el)\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function removeGlobalNode(el: HTMLElement) {\r\n globalNodes.splice(globalNodes.indexOf(el), 1)\r\n el.remove()\r\n}\r\n\r\nexport function changeGlobalNodesTarget(el: HTMLElement) {\r\n if (el === target) return\r\n\r\n target = el\r\n globalNodes.forEach((el) => {\r\n if (target && !el.contains(target)) {\r\n target.appendChild(el)\r\n }\r\n })\r\n}\r\n"],"names":["el"],"mappings":";AAEA,MAAM,cAA6B,CAAA;AACnC,IAAI,SAAkC,CAAC,WAAW,SAAY,SAAS;AAEhE,SAAS,iBAAiB,IAAa;AACtC,QAAA,KAAK,SAAS,cAAc,KAAK;AACvC,MAAI,OAAO,QAAW;AACjB,OAAA,aAAa,MAAM,EAAE;AAAA,EAC1B;AAEA,MAAI,QAAQ;AACV,WAAO,YAAY,EAAE;AACrB,gBAAY,KAAK,EAAE;AAAA,EACrB;AAEO,SAAA;AACT;AAEO,SAAS,iBAAiB,IAAiB;AAChD,cAAY,OAAO,YAAY,QAAQ,EAAE,GAAG,CAAC;AAC7C,KAAG,OAAO;AACZ;AAEO,SAAS,wBAAwB,IAAiB;AACvD,MAAI,OAAO,OAAQ;AAEV,WAAA;AACG,cAAA,QAAQ,CAACA,QAAO;AAC1B,QAAI,UAAU,CAACA,IAAG,SAAS,MAAM,GAAG;AAClC,aAAO,YAAYA,GAAE;AAAA,IACvB;AAAA,EAAA,CACD;AACH;"}
|
@@ -1,32 +1,36 @@
|
|
1
|
-
import { c as
|
2
|
-
import { definePropType
|
3
|
-
const
|
1
|
+
import { c as close_default, s as success_filled_default, i as info_filled_default, w as warning_filled_default, a as circle_close_filled_default, l as loading_default, b as circle_check_default, d as circle_close_default } from "../../../index-DkwIULcN.js";
|
2
|
+
import { definePropType } from "./props/runtime.js";
|
3
|
+
const iconPropType = definePropType([
|
4
4
|
String,
|
5
5
|
Object,
|
6
6
|
Function
|
7
|
-
])
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
7
|
+
]);
|
8
|
+
const CloseComponents = {
|
9
|
+
Close: close_default
|
10
|
+
};
|
11
|
+
const TypeComponents = {
|
12
|
+
Close: close_default,
|
13
|
+
SuccessFilled: success_filled_default,
|
14
|
+
InfoFilled: info_filled_default,
|
15
|
+
WarningFilled: warning_filled_default,
|
16
|
+
CircleCloseFilled: circle_close_filled_default
|
17
|
+
};
|
18
|
+
const TypeComponentsMap = {
|
19
|
+
success: success_filled_default,
|
20
|
+
warning: warning_filled_default,
|
21
|
+
error: circle_close_filled_default,
|
22
|
+
info: info_filled_default
|
23
|
+
};
|
24
|
+
const ValidateComponentsMap = {
|
25
|
+
validating: loading_default,
|
26
|
+
success: circle_check_default,
|
27
|
+
error: circle_close_default
|
24
28
|
};
|
25
29
|
export {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
CloseComponents,
|
31
|
+
TypeComponents,
|
32
|
+
TypeComponentsMap,
|
33
|
+
ValidateComponentsMap,
|
34
|
+
iconPropType
|
31
35
|
};
|
32
36
|
//# sourceMappingURL=icon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\n CircleCheck,\n CircleClose,\n CircleCloseFilled,\n Close,\n InfoFilled,\n Loading,\n SuccessFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\nimport { definePropType } from './props'\n\nimport type { Component } from 'vue'\n\nexport const iconPropType = definePropType<string | Component>([\n String,\n Object,\n Function,\n])\n\nexport const CloseComponents = {\n Close,\n}\n\nexport const TypeComponents = {\n Close,\n SuccessFilled,\n InfoFilled,\n WarningFilled,\n CircleCloseFilled,\n}\n\nexport const TypeComponentsMap = {\n success: SuccessFilled,\n warning: WarningFilled,\n error: CircleCloseFilled,\n info: InfoFilled,\n}\n\nexport const ValidateComponentsMap = {\n validating: Loading,\n success: CircleCheck,\n error: CircleClose,\n}\n"],"names":["
|
1
|
+
{"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\r\n CircleCheck,\r\n CircleClose,\r\n CircleCloseFilled,\r\n Close,\r\n InfoFilled,\r\n Loading,\r\n SuccessFilled,\r\n WarningFilled,\r\n} from '@element-plus/icons-vue'\r\nimport { definePropType } from './props'\r\n\r\nimport type { Component } from 'vue'\r\n\r\nexport const iconPropType = definePropType<string | Component>([\r\n String,\r\n Object,\r\n Function,\r\n])\r\n\r\nexport const CloseComponents = {\r\n Close,\r\n}\r\n\r\nexport const TypeComponents = {\r\n Close,\r\n SuccessFilled,\r\n InfoFilled,\r\n WarningFilled,\r\n CircleCloseFilled,\r\n}\r\n\r\nexport const TypeComponentsMap = {\r\n success: SuccessFilled,\r\n warning: WarningFilled,\r\n error: CircleCloseFilled,\r\n info: InfoFilled,\r\n}\r\n\r\nexport const ValidateComponentsMap = {\r\n validating: Loading,\r\n success: CircleCheck,\r\n error: CircleClose,\r\n}\r\n"],"names":["Close","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","Loading","CircleCheck","CircleClose"],"mappings":";;AAcO,MAAM,eAAe,eAAmC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,MAAM,kBAAkB;AAAA,EAAA,OAC7BA;AACF;AAEO,MAAM,iBAAiB;AAAA,EAAA,OAC5BA;AAAAA,EAAA,eACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,mBACAC;AACF;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAASH;AAAAA,EACT,SAASE;AAAAA,EACT,OAAOC;AAAAA,EACP,MAAMF;AACR;AAEO,MAAM,wBAAwB;AAAA,EACnC,YAAYG;AAAAA,EACZ,SAASC;AAAAA,EACT,OAAOC;AACT;"}
|
@@ -1,44 +1,44 @@
|
|
1
|
-
import { changeGlobalNodesTarget
|
2
|
-
import { CloseComponents
|
3
|
-
import { withInstall
|
4
|
-
import { buildProp
|
5
|
-
import { composeRefs
|
6
|
-
import { getComponentSize
|
7
|
-
import { isValidComponentSize
|
8
|
-
import { PatchFlags
|
1
|
+
import { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode } from "./global-node.js";
|
2
|
+
import { CloseComponents, TypeComponents, TypeComponentsMap, ValidateComponentsMap, iconPropType } from "./icon.js";
|
3
|
+
import { withInstall, withInstallDirective, withInstallFunction, withNoopInstall } from "./install.js";
|
4
|
+
import { buildProp, buildProps, definePropType, epPropKey, isEpProp } from "./props/runtime.js";
|
5
|
+
import { composeRefs } from "./refs.js";
|
6
|
+
import { getComponentSize } from "./size.js";
|
7
|
+
import { isValidComponentSize, isValidDatePickType } from "./validator.js";
|
8
|
+
import { PatchFlags, ensureOnlyChild, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf } from "./vnode.js";
|
9
9
|
export {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
10
|
+
CloseComponents,
|
11
|
+
PatchFlags,
|
12
|
+
TypeComponents,
|
13
|
+
TypeComponentsMap,
|
14
|
+
ValidateComponentsMap,
|
15
|
+
buildProp,
|
16
|
+
buildProps,
|
17
|
+
changeGlobalNodesTarget,
|
18
|
+
composeRefs,
|
19
|
+
createGlobalNode,
|
20
|
+
definePropType,
|
21
|
+
ensureOnlyChild,
|
22
|
+
epPropKey,
|
23
|
+
flattedChildren,
|
24
|
+
getComponentSize,
|
25
|
+
getFirstValidNode,
|
26
|
+
getNormalizedProps,
|
27
|
+
iconPropType,
|
28
|
+
isComment,
|
29
|
+
isEpProp,
|
30
|
+
isFragment,
|
31
|
+
isTemplate,
|
32
|
+
isText,
|
33
|
+
isValidComponentSize,
|
34
|
+
isValidDatePickType,
|
35
|
+
isValidElementNode,
|
36
|
+
removeGlobalNode,
|
37
|
+
renderBlock,
|
38
|
+
renderIf,
|
39
|
+
withInstall,
|
40
|
+
withInstallDirective,
|
41
|
+
withInstallFunction,
|
42
|
+
withNoopInstall
|
43
43
|
};
|
44
44
|
//# sourceMappingURL=index.js.map
|
@@ -1,21 +1,38 @@
|
|
1
|
-
import { N as
|
2
|
-
const
|
3
|
-
|
4
|
-
for (const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
}
|
1
|
+
import { N as NOOP } from "../../../functions-BeMkokbY.js";
|
2
|
+
const withInstall = (main, extra) => {
|
3
|
+
main.install = (app) => {
|
4
|
+
for (const comp of [main, ...Object.values(extra ?? {})]) {
|
5
|
+
app.component(comp.name, comp);
|
6
|
+
}
|
7
|
+
};
|
8
|
+
if (extra) {
|
9
|
+
for (const [key, comp] of Object.entries(extra)) {
|
10
|
+
main[key] = comp;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
return main;
|
14
|
+
};
|
15
|
+
const withInstallFunction = (fn, name) => {
|
16
|
+
fn.install = (app) => {
|
17
|
+
fn._context = app._context;
|
18
|
+
app.config.globalProperties[name] = fn;
|
19
|
+
};
|
20
|
+
return fn;
|
21
|
+
};
|
22
|
+
const withInstallDirective = (directive, name) => {
|
23
|
+
directive.install = (app) => {
|
24
|
+
app.directive(name, directive);
|
25
|
+
};
|
26
|
+
return directive;
|
27
|
+
};
|
28
|
+
const withNoopInstall = (component) => {
|
29
|
+
component.install = NOOP;
|
30
|
+
return component;
|
31
|
+
};
|
15
32
|
export {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
33
|
+
withInstall,
|
34
|
+
withInstallDirective,
|
35
|
+
withInstallFunction,
|
36
|
+
withNoopInstall
|
20
37
|
};
|
21
38
|
//# sourceMappingURL=install.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\n\nimport type { App, Directive } from 'vue'\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\n\nexport const withInstall = <T, E extends Record<string, any>>(\n main: T,\n extra?: E\n) => {\n ;(main as SFCWithInstall<T>).install = (app): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp)\n }\n }\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n ;(main as any)[key] = comp\n }\n }\n return main as SFCWithInstall<T> & E\n}\n\nexport const withInstallFunction = <T>(fn: T, name: string) => {\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\n ;(fn as SFCInstallWithContext<T>)._context = app._context\n app.config.globalProperties[name] = fn\n }\n\n return fn as SFCInstallWithContext<T>\n}\n\nexport const withInstallDirective = <T extends Directive>(\n directive: T,\n name: string\n) => {\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\n app.directive(name, directive)\n }\n\n return directive as SFCWithInstall<T>\n}\n\nexport const withNoopInstall = <T>(component: T) => {\n ;(component as SFCWithInstall<T>).install = NOOP\n\n return component as SFCWithInstall<T>\n}\n"],"names":[
|
1
|
+
{"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\r\n\r\nimport type { App, Directive } from 'vue'\r\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\r\n\r\nexport const withInstall = <T, E extends Record<string, any>>(\r\n main: T,\r\n extra?: E\r\n) => {\r\n ;(main as SFCWithInstall<T>).install = (app): void => {\r\n for (const comp of [main, ...Object.values(extra ?? {})]) {\r\n app.component(comp.name, comp)\r\n }\r\n }\r\n\r\n if (extra) {\r\n for (const [key, comp] of Object.entries(extra)) {\r\n ;(main as any)[key] = comp\r\n }\r\n }\r\n return main as SFCWithInstall<T> & E\r\n}\r\n\r\nexport const withInstallFunction = <T>(fn: T, name: string) => {\r\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\r\n ;(fn as SFCInstallWithContext<T>)._context = app._context\r\n app.config.globalProperties[name] = fn\r\n }\r\n\r\n return fn as SFCInstallWithContext<T>\r\n}\r\n\r\nexport const withInstallDirective = <T extends Directive>(\r\n directive: T,\r\n name: string\r\n) => {\r\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\r\n app.directive(name, directive)\r\n }\r\n\r\n return directive as SFCWithInstall<T>\r\n}\r\n\r\nexport const withNoopInstall = <T>(component: T) => {\r\n ;(component as SFCWithInstall<T>).install = NOOP\r\n\r\n return component as SFCWithInstall<T>\r\n}\r\n"],"names":[],"mappings":";AAKa,MAAA,cAAc,CACzB,MACA,UACG;AACD,OAA2B,UAAU,CAAC,QAAc;AACzC,eAAA,QAAQ,CAAC,MAAM,GAAG,OAAO,OAAO,SAAS,CAAE,CAAA,CAAC,GAAG;AACpD,UAAA,UAAU,KAAK,MAAM,IAAI;AAAA,IAC/B;AAAA,EAAA;AAGF,MAAI,OAAO;AACT,eAAW,CAAC,KAAK,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC7C,WAAa,GAAG,IAAI;AAAA,IACxB;AAAA,EACF;AACO,SAAA;AACT;AAEa,MAAA,sBAAsB,CAAI,IAAO,SAAiB;AAC3D,KAAyB,UAAU,CAAC,QAAa;AAC/C,OAAgC,WAAW,IAAI;AAC7C,QAAA,OAAO,iBAAiB,IAAI,IAAI;AAAA,EAAA;AAG/B,SAAA;AACT;AAEa,MAAA,uBAAuB,CAClC,WACA,SACG;AACD,YAAgC,UAAU,CAAC,QAAmB;AAC1D,QAAA,UAAU,MAAM,SAAS;AAAA,EAAA;AAGxB,SAAA;AACT;AAEa,MAAA,kBAAkB,CAAI,cAAiB;AAChD,YAAgC,UAAU;AAErC,SAAA;AACT;"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { buildProp
|
1
|
+
import { buildProp, buildProps, definePropType, epPropKey, isEpProp } from "./runtime.js";
|
2
2
|
export {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
buildProp,
|
4
|
+
buildProps,
|
5
|
+
definePropType,
|
6
|
+
epPropKey,
|
7
|
+
isEpProp
|
8
8
|
};
|
9
9
|
//# sourceMappingURL=index.js.map
|
@@ -1,37 +1,53 @@
|
|
1
|
-
import { warn
|
2
|
-
import { fromPairs
|
3
|
-
import { d as
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
);
|
1
|
+
import { warn } from "vue";
|
2
|
+
import { fromPairs } from "lodash-es";
|
3
|
+
import { d as isObject, h as hasOwn } from "../../../../functions-BeMkokbY.js";
|
4
|
+
const epPropKey = "__epPropKey";
|
5
|
+
const definePropType = (val) => val;
|
6
|
+
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
|
7
|
+
const buildProp = (prop, key) => {
|
8
|
+
if (!isObject(prop) || isEpProp(prop)) return prop;
|
9
|
+
const { values, required, default: defaultValue, type, validator } = prop;
|
10
|
+
const _validator = values || validator ? (val) => {
|
11
|
+
let valid = false;
|
12
|
+
let allowedValues = [];
|
13
|
+
if (values) {
|
14
|
+
allowedValues = Array.from(values);
|
15
|
+
if (hasOwn(prop, "default")) {
|
16
|
+
allowedValues.push(defaultValue);
|
18
17
|
}
|
19
|
-
|
20
|
-
}
|
21
|
-
|
18
|
+
valid || (valid = allowedValues.includes(val));
|
19
|
+
}
|
20
|
+
if (validator) valid || (valid = validator(val));
|
21
|
+
if (!valid && allowedValues.length > 0) {
|
22
|
+
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
23
|
+
warn(
|
24
|
+
`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
|
25
|
+
val
|
26
|
+
)}.`
|
27
|
+
);
|
28
|
+
}
|
29
|
+
return valid;
|
30
|
+
} : void 0;
|
31
|
+
const epProp = {
|
32
|
+
type,
|
33
|
+
required: !!required,
|
34
|
+
validator: _validator,
|
35
|
+
[epPropKey]: true
|
22
36
|
};
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
37
|
+
if (hasOwn(prop, "default")) epProp.default = defaultValue;
|
38
|
+
return epProp;
|
39
|
+
};
|
40
|
+
const buildProps = (props) => fromPairs(
|
41
|
+
Object.entries(props).map(([key, option]) => [
|
42
|
+
key,
|
43
|
+
buildProp(option, key)
|
28
44
|
])
|
29
45
|
);
|
30
46
|
export {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
47
|
+
buildProp,
|
48
|
+
buildProps,
|
49
|
+
definePropType,
|
50
|
+
epPropKey,
|
51
|
+
isEpProp
|
36
52
|
};
|
37
53
|
//# sourceMappingURL=runtime.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { fromPairs } from 'lodash-unified'\nimport { isObject } from '../../types'\nimport { hasOwn } from '../../objects'\n\nimport type { PropType } from 'vue'\nimport type {\n EpProp,\n EpPropConvert,\n EpPropFinalized,\n EpPropInput,\n EpPropMergeType,\n IfEpProp,\n IfNativePropType,\n NativePropType,\n} from './types'\n\nexport const epPropKey = '__epPropKey'\n\nexport const definePropType = <T>(val: any): PropType<T> => val\n\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\n isObject(val) && !!(val as any)[epPropKey]\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop,能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport const buildProp = <\n Type = never,\n Value = never,\n Validator = never,\n Default extends EpPropMergeType<Type, Value, Validator> = never,\n Required extends boolean = false\n>(\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\n key?: string\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(prop) || isEpProp(prop)) return prop as any\n\n const { values, required, default: defaultValue, type, validator } = prop\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = Array.from(values)\n if (hasOwn(prop, 'default')) {\n allowedValues.push(defaultValue)\n }\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map((value) => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n const epProp: any = {\n type,\n required: !!required,\n validator: _validator,\n [epPropKey]: true,\n }\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\n return epProp\n}\n\nexport const buildProps = <\n Props extends Record<\n string,\n | { [epPropKey]: true }\n | NativePropType\n | EpPropInput<any, any, any, any, any>\n >\n>(\n props: Props\n): {\n [K in keyof Props]: IfEpProp<\n Props[K],\n Props[K],\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\n >\n} =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key),\n ])\n ) as any\n"],"names":[
|
1
|
+
{"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\r\nimport { fromPairs } from 'lodash-unified'\r\nimport { isObject } from '../../types'\r\nimport { hasOwn } from '../../objects'\r\n\r\nimport type { PropType } from 'vue'\r\nimport type {\r\n EpProp,\r\n EpPropConvert,\r\n EpPropFinalized,\r\n EpPropInput,\r\n EpPropMergeType,\r\n IfEpProp,\r\n IfNativePropType,\r\n NativePropType,\r\n} from './types'\r\n\r\nexport const epPropKey = '__epPropKey'\r\n\r\nexport const definePropType = <T>(val: any): PropType<T> => val\r\n\r\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\r\n isObject(val) && !!(val as any)[epPropKey]\r\n\r\n/**\r\n * @description Build prop. It can better optimize prop types\r\n * @description 生成 prop,能更好地优化类型\r\n * @example\r\n // limited options\r\n // the type will be PropType<'light' | 'dark'>\r\n buildProp({\r\n type: String,\r\n values: ['light', 'dark'],\r\n } as const)\r\n * @example\r\n // limited options and other types\r\n // the type will be PropType<'small' | 'large' | number>\r\n buildProp({\r\n type: [String, Number],\r\n values: ['small', 'large'],\r\n validator: (val: unknown): val is number => typeof val === 'number',\r\n } as const)\r\n @link see more: https://github.com/element-plus/element-plus/pull/3341\r\n */\r\nexport const buildProp = <\r\n Type = never,\r\n Value = never,\r\n Validator = never,\r\n Default extends EpPropMergeType<Type, Value, Validator> = never,\r\n Required extends boolean = false\r\n>(\r\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\r\n key?: string\r\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\r\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\r\n if (!isObject(prop) || isEpProp(prop)) return prop as any\r\n\r\n const { values, required, default: defaultValue, type, validator } = prop\r\n\r\n const _validator =\r\n values || validator\r\n ? (val: unknown) => {\r\n let valid = false\r\n let allowedValues: unknown[] = []\r\n\r\n if (values) {\r\n allowedValues = Array.from(values)\r\n if (hasOwn(prop, 'default')) {\r\n allowedValues.push(defaultValue)\r\n }\r\n valid ||= allowedValues.includes(val)\r\n }\r\n if (validator) valid ||= validator(val)\r\n\r\n if (!valid && allowedValues.length > 0) {\r\n const allowValuesText = [...new Set(allowedValues)]\r\n .map((value) => JSON.stringify(value))\r\n .join(', ')\r\n warn(\r\n `Invalid prop: validation failed${\r\n key ? ` for prop \"${key}\"` : ''\r\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\r\n val\r\n )}.`\r\n )\r\n }\r\n return valid\r\n }\r\n : undefined\r\n\r\n const epProp: any = {\r\n type,\r\n required: !!required,\r\n validator: _validator,\r\n [epPropKey]: true,\r\n }\r\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\r\n return epProp\r\n}\r\n\r\nexport const buildProps = <\r\n Props extends Record<\r\n string,\r\n | { [epPropKey]: true }\r\n | NativePropType\r\n | EpPropInput<any, any, any, any, any>\r\n >\r\n>(\r\n props: Props\r\n): {\r\n [K in keyof Props]: IfEpProp<\r\n Props[K],\r\n Props[K],\r\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\r\n >\r\n} =>\r\n fromPairs(\r\n Object.entries(props).map(([key, option]) => [\r\n key,\r\n buildProp(option as any, key),\r\n ])\r\n ) as any\r\n"],"names":[],"mappings":";;;AAiBO,MAAM,YAAY;AAEZ,MAAA,iBAAiB,CAAI,QAA0B;AAE/C,MAAA,WAAW,CAAC,QACvB,SAAS,GAAG,KAAK,CAAC,CAAE,IAAY,SAAS;AAsB9B,MAAA,YAAY,CAOvB,MACA,QAC+D;AAE/D,MAAI,CAAC,SAAS,IAAI,KAAK,SAAS,IAAI,EAAU,QAAA;AAE9C,QAAM,EAAE,QAAQ,UAAU,SAAS,cAAc,MAAM,UAAc,IAAA;AAErE,QAAM,aACJ,UAAU,YACN,CAAC,QAAiB;AAChB,QAAI,QAAQ;AACZ,QAAI,gBAA2B,CAAA;AAE/B,QAAI,QAAQ;AACM,sBAAA,MAAM,KAAK,MAAM;AAC7B,UAAA,OAAO,MAAM,SAAS,GAAG;AAC3B,sBAAc,KAAK,YAAY;AAAA,MACjC;AACU,wBAAA,cAAc,SAAS,GAAG;AAAA,IACtC;AACI,QAAA,UAAqB,mBAAA,UAAU,GAAG;AAEtC,QAAI,CAAC,SAAS,cAAc,SAAS,GAAG;AACtC,YAAM,kBAAkB,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC,EAC/C,IAAI,CAAC,UAAU,KAAK,UAAU,KAAK,CAAC,EACpC,KAAK,IAAI;AACZ;AAAA,QACE,kCACE,MAAM,cAAc,GAAG,MAAM,EAC/B,sBAAsB,eAAe,gBAAgB,KAAK;AAAA,UACxD;AAAA,QACD,CAAA;AAAA,MAAA;AAAA,IAEL;AACO,WAAA;AAAA,EAET,IAAA;AAEN,QAAM,SAAc;AAAA,IAClB;AAAA,IACA,UAAU,CAAC,CAAC;AAAA,IACZ,WAAW;AAAA,IACX,CAAC,SAAS,GAAG;AAAA,EAAA;AAEf,MAAI,OAAO,MAAM,SAAS,UAAU,UAAU;AACvC,SAAA;AACT;AAEa,MAAA,aAAa,CAQxB,UAQA;AAAA,EACE,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,MAAM,MAAM;AAAA,IAC3C;AAAA,IACA,UAAU,QAAe,GAAG;AAAA,EAAA,CAC7B;AACH;"}
|
@@ -1,12 +1,18 @@
|
|
1
|
-
import { b as
|
1
|
+
import { b as isFunction } from "../../../functions-BeMkokbY.js";
|
2
2
|
import "lodash-es";
|
3
3
|
import "vue";
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
const composeRefs = (...refs) => {
|
5
|
+
return (el) => {
|
6
|
+
refs.forEach((ref) => {
|
7
|
+
if (isFunction(ref)) {
|
8
|
+
ref(el);
|
9
|
+
} else {
|
10
|
+
ref.value = el;
|
11
|
+
}
|
12
|
+
});
|
13
|
+
};
|
8
14
|
};
|
9
15
|
export {
|
10
|
-
|
16
|
+
composeRefs
|
11
17
|
};
|
12
18
|
//# sourceMappingURL=refs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"refs.js","sources":["../../../../src/components/_util/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\n\nimport type { ComponentPublicInstance, Ref } from 'vue'\n\nexport type RefSetter = (\n el: Element | ComponentPublicInstance | undefined\n) => void\n\nexport const composeRefs = (\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\n) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(el as Element | ComponentPublicInstance)\n } else {\n ref.value = el as HTMLElement | undefined\n }\n })\n }\n}\n"],"names":[
|
1
|
+
{"version":3,"file":"refs.js","sources":["../../../../src/components/_util/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\r\n\r\nimport type { ComponentPublicInstance, Ref } from 'vue'\r\n\r\nexport type RefSetter = (\r\n el: Element | ComponentPublicInstance | undefined\r\n) => void\r\n\r\nexport const composeRefs = (\r\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\r\n) => {\r\n return (el: Element | ComponentPublicInstance | null) => {\r\n refs.forEach((ref) => {\r\n if (isFunction(ref)) {\r\n ref(el as Element | ComponentPublicInstance)\r\n } else {\r\n ref.value = el as HTMLElement | undefined\r\n }\r\n })\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAQa,MAAA,cAAc,IACtB,SACA;AACH,SAAO,CAAC,OAAiD;AAClD,SAAA,QAAQ,CAAC,QAAQ;AAChB,UAAA,WAAW,GAAG,GAAG;AACnB,YAAI,EAAuC;AAAA,MAAA,OACtC;AACL,YAAI,QAAQ;AAAA,MACd;AAAA,IAAA,CACD;AAAA,EAAA;AAEL;"}
|
@@ -1,6 +1,8 @@
|
|
1
|
-
import { componentSizeMap
|
2
|
-
const
|
1
|
+
import { componentSizeMap } from "element-plus";
|
2
|
+
const getComponentSize = (size) => {
|
3
|
+
return componentSizeMap[size || "default"];
|
4
|
+
};
|
3
5
|
export {
|
4
|
-
|
6
|
+
getComponentSize
|
5
7
|
};
|
6
8
|
//# sourceMappingURL=size.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"size.js","sources":["../../../../src/components/_util/vue/size.ts"],"sourcesContent":["import { componentSizeMap } from 'element-plus'\n\nimport type { ComponentSize } from 'element-plus'\n\nexport const getComponentSize = (size?: ComponentSize) => {\n return componentSizeMap[size || 'default']\n}\n"],"names":[
|
1
|
+
{"version":3,"file":"size.js","sources":["../../../../src/components/_util/vue/size.ts"],"sourcesContent":["import { componentSizeMap } from 'element-plus'\r\n\r\nimport type { ComponentSize } from 'element-plus'\r\n\r\nexport const getComponentSize = (size?: ComponentSize) => {\r\n return componentSizeMap[size || 'default']\r\n}\r\n"],"names":[],"mappings":";AAIa,MAAA,mBAAmB,CAAC,SAAyB;AACjD,SAAA,iBAAiB,QAAQ,SAAS;AAC3C;"}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { componentSizes
|
2
|
-
const
|
1
|
+
import { componentSizes, datePickTypes } from "element-plus";
|
2
|
+
const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
|
3
|
+
const isValidDatePickType = (val) => [...datePickTypes].includes(val);
|
3
4
|
export {
|
4
|
-
|
5
|
-
|
5
|
+
isValidComponentSize,
|
6
|
+
isValidDatePickType
|
6
7
|
};
|
7
8
|
//# sourceMappingURL=validator.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validator.js","sources":["../../../../src/components/_util/vue/validator.ts"],"sourcesContent":["import { componentSizes, datePickTypes } from 'element-plus'\nimport type { ComponentSize, DatePickType } from 'element-plus'\n\nexport const isValidComponentSize = (val: string): val is ComponentSize | '' =>\n ['', ...componentSizes].includes(val)\n\nexport const isValidDatePickType = (val: string): val is DatePickType =>\n ([...datePickTypes] as string[]).includes(val)\n"],"names":[
|
1
|
+
{"version":3,"file":"validator.js","sources":["../../../../src/components/_util/vue/validator.ts"],"sourcesContent":["import { componentSizes, datePickTypes } from 'element-plus'\r\nimport type { ComponentSize, DatePickType } from 'element-plus'\r\n\r\nexport const isValidComponentSize = (val: string): val is ComponentSize | '' =>\r\n ['', ...componentSizes].includes(val)\r\n\r\nexport const isValidDatePickType = (val: string): val is DatePickType =>\r\n ([...datePickTypes] as string[]).includes(val)\r\n"],"names":[],"mappings":";AAGa,MAAA,uBAAuB,CAAC,QACnC,CAAC,IAAI,GAAG,cAAc,EAAE,SAAS,GAAG;AAEzB,MAAA,sBAAsB,CAAC,QACjC,CAAC,GAAG,aAAa,EAAe,SAAS,GAAG;"}
|