yuyeon 0.2.3-rc.9 → 0.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuyeon.js +2849 -2720
- package/dist/yuyeon.umd.cjs +3 -3
- package/lib/components/button/YButton.mjs +1 -0
- package/lib/components/button/YButton.mjs.map +1 -1
- package/lib/components/button/YButton.scss +9 -0
- package/lib/components/date-picker/YDatePicker.mjs +6 -2
- package/lib/components/date-picker/YDatePicker.mjs.map +1 -1
- package/lib/components/dialog/YDialog.mjs +2 -1
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +9 -3
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/field-input/YFieldInput.mjs +5 -2
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/index.mjs +1 -0
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/input/YInput.mjs +4 -1
- package/lib/components/input/YInput.mjs.map +1 -1
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/progress-bar/YProgressBar.mjs +1 -1
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
- package/lib/components/progress-ring/YProgressRing.mjs +128 -0
- package/lib/components/progress-ring/YProgressRing.mjs.map +1 -0
- package/lib/components/progress-ring/YProgressRing.scss +38 -0
- package/lib/components/progress-ring/index.mjs +2 -0
- package/lib/components/progress-ring/index.mjs.map +1 -0
- package/lib/components/select/YSelect.mjs +97 -106
- package/lib/components/select/YSelect.mjs.map +1 -1
- package/lib/components/switch/YSwitch.mjs.map +1 -1
- package/lib/components/switch/YSwitch.scss +211 -211
- package/lib/components/table/YDataTableBody.mjs.map +1 -1
- package/lib/components/table/YDataTableCell.mjs +8 -4
- package/lib/components/table/YDataTableCell.mjs.map +1 -1
- package/lib/components/table/YDataTableHead.mjs +23 -11
- package/lib/components/table/YDataTableHead.mjs.map +1 -1
- package/lib/components/table/YDataTableRow.mjs +14 -8
- package/lib/components/table/YDataTableRow.mjs.map +1 -1
- package/lib/components/table/YDataTableServer.mjs.map +1 -1
- package/lib/components/table/YTable.mjs +0 -2
- package/lib/components/table/YTable.mjs.map +1 -1
- package/lib/components/table/composibles/header.mjs +14 -4
- package/lib/components/table/composibles/header.mjs.map +1 -1
- package/lib/components/table/composibles/measure.mjs +25 -21
- package/lib/components/table/composibles/measure.mjs.map +1 -1
- package/lib/components/table/types/header.mjs.map +1 -1
- package/lib/components/table/types/index.mjs.map +1 -1
- package/lib/components/tooltip/YTooltip.mjs +2 -2
- package/lib/components/tooltip/YTooltip.mjs.map +1 -1
- package/lib/composables/layer-group.mjs +0 -6
- package/lib/composables/layer-group.mjs.map +1 -1
- package/lib/composables/progress.mjs +2 -1
- package/lib/composables/progress.mjs.map +1 -1
- package/lib/directives/plate-wave/index.mjs +2 -2
- package/lib/directives/plate-wave/index.mjs.map +1 -1
- package/lib/i18n/built-in.mjs.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/util/component/component.mjs.map +1 -1
- package/package.json +120 -120
- package/types/components/checkbox/YInputCheckbox.d.ts +2 -2
- package/types/components/dialog/YDialog.d.ts +8 -7
- package/types/components/dropdown/YDropdown.d.ts +11 -11
- package/types/components/field-input/YFieldInput.d.ts +1 -1
- package/types/components/icons/YIconCheckbox.d.ts +1 -1
- package/types/components/icons/YIconPageControl.d.ts +1 -1
- package/types/components/icons/YIconSort.d.ts +1 -1
- package/types/components/icons/index.d.ts +5 -5
- package/types/components/index.d.ts +1 -0
- package/types/components/layer/YLayer.d.ts +5 -5
- package/types/components/menu/YMenu.d.ts +4 -4
- package/types/components/progress-bar/YProgressBar.d.ts +1 -1
- package/types/components/progress-ring/YProgressRing.d.ts +34 -0
- package/types/components/progress-ring/index.d.ts +1 -0
- package/types/components/snackbar/YSnackbar.d.ts +3 -3
- package/types/components/table/YDataTable.d.ts +7 -7
- package/types/components/table/YDataTableCell.d.ts +5 -1
- package/types/components/table/YDataTableServer.d.ts +7 -7
- package/types/components/table/composibles/header.d.ts +14 -10
- package/types/components/table/composibles/measure.d.ts +5 -5
- package/types/components/table/types/header.d.ts +2 -1
- package/types/components/table/types/index.d.ts +1 -0
- package/types/components/text-highlighter/YTextHighlighter.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +4 -4
- package/types/shims.d.ts +56 -55
- package/types/util/anchor.d.ts +1 -1
- package/types/util/component/component.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer-group.mjs","names":["computed","getCurrentInstance","onBeforeUnmount","unref","watch","useYuyeon","Y_LAYER_GROUP_CLASS_NAME","layerGroupState","WeakMap","useLayerGroup","props","vm","yuyeon","layerGroup","targetEl","document","body","rootEl","root","proxy","$el","refTarget","el","querySelector","nodeType","layerEl","createElement","className","appendChild","
|
|
1
|
+
{"version":3,"file":"layer-group.mjs","names":["computed","getCurrentInstance","onBeforeUnmount","unref","watch","useYuyeon","Y_LAYER_GROUP_CLASS_NAME","layerGroupState","WeakMap","useLayerGroup","props","vm","yuyeon","layerGroup","targetEl","document","body","rootEl","root","proxy","$el","refTarget","el","querySelector","nodeType","layerEl","createElement","className","appendChild","neo","old","has","get","delete","set","Set","add","immediate","getActiveLayers","activeLayers","currentGroup","value","forEach","ctx","active","isUnmounted","push","unregister"],"sources":["../../src/composables/layer-group.ts"],"sourcesContent":["import {\r\n type MaybeRef,\r\n computed,\r\n getCurrentInstance,\r\n onBeforeUnmount,\r\n unref,\r\n watch,\r\n} from 'vue';\r\nimport type { ComponentInternalInstance, Ref } from 'vue';\r\n\r\nimport { useYuyeon } from '@/index';\r\n\r\nexport const Y_LAYER_GROUP_CLASS_NAME = 'y-layer-group';\r\n\r\nconst layerGroupState = new WeakMap<HTMLElement, Set<any>>();\r\n\r\nexport function useLayerGroup(props: {\r\n layerGroup?: MaybeRef<string | Element | undefined>;\r\n}) {\r\n const vm = getCurrentInstance()!;\r\n const yuyeon = useYuyeon();\r\n\r\n const layerGroup = computed<HTMLElement>(() => {\r\n let targetEl: Element = document.body;\r\n const rootEl = vm.root.proxy?.$el;\r\n if (rootEl) {\r\n targetEl = rootEl;\r\n }\r\n const refTarget = unref(props.layerGroup);\r\n if (typeof refTarget === 'string') {\r\n const el = document.querySelector(refTarget);\r\n if (el) {\r\n targetEl = el;\r\n }\r\n }\r\n if (refTarget && (refTarget as Element).nodeType === 1) {\r\n targetEl = refTarget as Element;\r\n }\r\n //\r\n let layerEl = targetEl.querySelector(\r\n `:scope > .${Y_LAYER_GROUP_CLASS_NAME}`,\r\n );\r\n if (!layerEl) {\r\n layerEl = document.createElement('div');\r\n layerEl.className = Y_LAYER_GROUP_CLASS_NAME;\r\n targetEl.appendChild(layerEl);\r\n }\r\n return layerEl as HTMLElement;\r\n });\r\n\r\n watch(\r\n layerGroup,\r\n (neo, old) => {\r\n if (old && layerGroupState.has(old)) {\r\n layerGroupState.get(old)?.delete(vm);\r\n }\r\n if (!(layerGroupState.has(neo) && layerGroupState.get(neo))) {\r\n layerGroupState.set(neo, new Set());\r\n }\r\n layerGroupState.get(neo)?.add(vm);\r\n },\r\n { immediate: true },\r\n );\r\n\r\n function getActiveLayers() {\r\n const activeLayers: ComponentInternalInstance[] = [];\r\n const currentGroup = layerGroupState.get(layerGroup.value);\r\n currentGroup?.forEach((value) => {\r\n if (value?.ctx?.active && !value?.isUnmounted) {\r\n activeLayers.push(value);\r\n }\r\n });\r\n return activeLayers;\r\n }\r\n\r\n function unregister() {\r\n layerGroupState.get(layerGroup.value)?.delete(vm);\r\n }\r\n\r\n onBeforeUnmount(() => {\r\n unregister();\r\n });\r\n\r\n return { layerGroup, layerGroupState, getActiveLayers };\r\n}\r\n"],"mappings":"AAAA,SAEEA,QAAQ,EACRC,kBAAkB,EAClBC,eAAe,EACfC,KAAK,EACLC,KAAK,QACA,KAAK;AAAC,SAGJC,SAAS;AAElB,OAAO,MAAMC,wBAAwB,GAAG,eAAe;AAEvD,MAAMC,eAAe,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AE,CAAC;IACtC;IACA,IAAI,EAAEJ,eAAe,CAACwB,GAAG,CAACF,GAAG,CAAC,IAAItB,eAAe,CAACyB,GAAG,CAACH,GAAG,CAAC,CAAC,EAAE;MAC3DtB,eAAe,CAAC2B,GAAG,CAACL,GAAG,EAAE,IAAIM,GAAG,CAAC,CAAC,CAAC;IACrC;IACA5B,eAAe,CAACyB,GAAG,CAACH,GAAG,CAAC,EAAEO,GAAG,CAACzB,EAAE,CAAC;EACnC,CAAC,EACD;IAAE0B,SAAS,EAAE;EAAK,CACpB,CAAC;EAED,SAASC,eAAeA,CAAA,EAAG;IACzB,MAAMC,YAAyC,GAAG,EAAE;IACpD,MAAMC,YAAY,GAAGjC,eAAe,CAACyB,GAAG,CAACnB,UAAU,CAAC4B,KAAK,CAAC;IAC1DD,YAAY,EAAEE,OAAO,CAAED,KAAK,IAAK;MAC/B,IAAIA,KAAK,EAAEE,GAAG,EAAEC,MAAM,IAAI,CAACH,KAAK,EAAEI,WAAW,EAAE;QAC7CN,YAAY,CAACO,IAAI,CAACL,KAAK,CAAC;MAC1B;IACF,CAAC,CAAC;IACF,OAAOF,YAAY;EACrB;EAEA,SAASQ,UAAUA,CAAA,EAAG;IACpBxC,eAAe,CAACyB,GAAG,CAACnB,UAAU,CAAC4B,KAAK,CAAC,EAAER,MAAM,CAACtB,EAAE,CAAC;EACnD;EAEAT,eAAe,CAAC,MAAM;IACpB6C,UAAU,CAAC,CAAC;EACd,CAAC,CAAC;EAEF,OAAO;IAAElC,UAAU;IAAEN,eAAe;IAAE+B;EAAgB,CAAC;AACzD"}
|
|
@@ -3,9 +3,10 @@ export function useProgress(props) {
|
|
|
3
3
|
const delta = shallowRef(0);
|
|
4
4
|
const numValue = computed(() => {
|
|
5
5
|
const {
|
|
6
|
+
modelValue,
|
|
6
7
|
value
|
|
7
8
|
} = props;
|
|
8
|
-
const numValue = Number(value);
|
|
9
|
+
const numValue = Number(modelValue ?? value);
|
|
9
10
|
if (Number.isNaN(numValue) || numValue < 0) {
|
|
10
11
|
return 0;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.mjs","names":["computed","shallowRef","watch","useProgress","props","delta","numValue","value","Number","isNaN","neo","old"],"sources":["../../src/composables/progress.ts"],"sourcesContent":["import { computed, shallowRef, watch } from 'vue';\r\n\r\nexport function useProgress(props: any) {\r\n const delta = shallowRef(0);\r\n\r\n const numValue = computed(() => {\r\n const { value } = props;\r\n const numValue = Number(value);\r\n if (Number.isNaN(numValue) || numValue < 0) {\r\n return 0;\r\n }\r\n if (numValue > 100) {\r\n return 100;\r\n }\r\n return numValue;\r\n });\r\n\r\n watch(numValue, (neo, old) => {\r\n delta.value = neo - old;\r\n });\r\n\r\n return {\r\n numValue,\r\n delta,\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAEjD,OAAO,SAASC,WAAWA,CAACC,KAAU,EAAE;EACtC,MAAMC,KAAK,GAAGJ,UAAU,CAAC,CAAC,CAAC;EAE3B,MAAMK,QAAQ,GAAGN,QAAQ,CAAC,MAAM;IAC9B,MAAM;MAAEO;IAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"progress.mjs","names":["computed","shallowRef","watch","useProgress","props","delta","numValue","modelValue","value","Number","isNaN","neo","old"],"sources":["../../src/composables/progress.ts"],"sourcesContent":["import { computed, shallowRef, watch } from 'vue';\r\n\r\nexport function useProgress(props: any) {\r\n const delta = shallowRef(0);\r\n\r\n const numValue = computed(() => {\r\n const { modelValue, value } = props;\r\n const numValue = Number(modelValue ?? value);\r\n if (Number.isNaN(numValue) || numValue < 0) {\r\n return 0;\r\n }\r\n if (numValue > 100) {\r\n return 100;\r\n }\r\n return numValue;\r\n });\r\n\r\n watch(numValue, (neo, old) => {\r\n delta.value = neo - old;\r\n });\r\n\r\n return {\r\n numValue,\r\n delta,\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAEjD,OAAO,SAASC,WAAWA,CAACC,KAAU,EAAE;EACtC,MAAMC,KAAK,GAAGJ,UAAU,CAAC,CAAC,CAAC;EAE3B,MAAMK,QAAQ,GAAGN,QAAQ,CAAC,MAAM;IAC9B,MAAM;MAAEO,UAAU;MAAEC;IAAM,CAAC,GAAGJ,KAAK;IACnC,MAAME,QAAQ,GAAGG,MAAM,CAACF,UAAU,IAAIC,KAAK,CAAC;IAC5C,IAAIC,MAAM,CAACC,KAAK,CAACJ,QAAQ,CAAC,IAAIA,QAAQ,GAAG,CAAC,EAAE;MAC1C,OAAO,CAAC;IACV;IACA,IAAIA,QAAQ,GAAG,GAAG,EAAE;MAClB,OAAO,GAAG;IACZ;IACA,OAAOA,QAAQ;EACjB,CAAC,CAAC;EAEFJ,KAAK,CAACI,QAAQ,EAAE,CAACK,GAAG,EAAEC,GAAG,KAAK;IAC5BP,KAAK,CAACG,KAAK,GAAGG,GAAG,GAAGC,GAAG;EACzB,CAAC,CAAC;EAEF,OAAO;IACLN,QAAQ;IACRD;EACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["CLASS_NAME","showAnimation","el","animation","document","createElement","className","appendChild","dataset","activated","String","performance","now","hideAnimation","animations","getElementsByClassName","length","isHiding","diff","Number","delay","Math","max","setTimeout","removeChild","keyboardEventFlag","spawn","event","currentTarget","clean","stop","keyboardSpawn","key","keyboardClean","destroyListeners","removeEventListener","attachWave","binding","init","arguments","undefined","value","modifiers","enabled","addEventListener","PlateWave","mounted","updated","oldValue","unmount"],"sources":["../../../src/directives/plate-wave/index.ts"],"sourcesContent":["import type { DirectiveBinding } from 'vue';\n\nimport './plate-wave.scss';\n\nexport interface PlateWaveBinding\n extends Omit<DirectiveBinding, 'modifiers' | 'value'> {\n value?: boolean;\n modifiers: { stop?: boolean };\n}\n\nconst CLASS_NAME = 'y-plate-wave__animation';\n\nfunction showAnimation(el: HTMLElement | null) {\n if (!el) return;\n const animation = document.createElement('span');\n animation.className = CLASS_NAME;\n el.appendChild(animation);\n animation.dataset.activated = String(performance.now());\n}\n\nfunction hideAnimation(el: HTMLElement | null) {\n if (!el) {\n return;\n }\n const animations = el.getElementsByClassName(CLASS_NAME);\n if (animations.length === 0) return;\n const animation = animations[animations.length - 1] as HTMLElement;\n if (animation.dataset.isHiding) return;\n animation.dataset.isHiding = 'true';\n const diff = performance.now() - Number(animation.dataset.activated);\n const delay = Math.max(250 - diff, 0);\n setTimeout(() => {\n if (animation) {\n el.removeChild(animation);\n }\n }, delay + 300);\n}\n\n/*\n * Event\n * */\n\nlet keyboardEventFlag = false;\n\nfunction spawn(event: Event) {\n showAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction clean(event: Event) {\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction stop(event: Event) {\n //\n}\n\nfunction keyboardSpawn(event: KeyboardEvent) {\n if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {\n keyboardEventFlag = true;\n showAnimation(event.currentTarget as HTMLElement);\n }\n}\n\nfunction keyboardClean(event: KeyboardEvent) {\n keyboardEventFlag = false;\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction destroyListeners(el: HTMLElement) {\n el.removeEventListener('mousedown', spawn);\n el.removeEventListener('mouseup', clean);\n el.removeEventListener('mouseleave', clean);\n el.removeEventListener('keydown', keyboardSpawn);\n el.removeEventListener('keyup', keyboardClean);\n}\n\nfunction attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {\n const { value, modifiers } = binding;\n let enabled = value ?? true;\n if (typeof value === 'boolean') {\n enabled = value;\n }\n if (!enabled) hideAnimation(el);\n\n if (enabled && init) {\n if (modifiers.stop) {\n el.addEventListener('mousedown', stop);\n return;\n }\n\n el.addEventListener('mousedown', spawn);\n el.addEventListener('mouseup', clean);\n el.addEventListener('mouseleave', clean);\n el.addEventListener('keydown', keyboardSpawn);\n el.addEventListener('keyup', keyboardClean);\n el.addEventListener('blur', clean);\n } else if (!enabled && !init) {\n destroyListeners(el);\n }\n}\n\nexport const PlateWave = {\n mounted(el: HTMLElement, binding: PlateWaveBinding) {\n attachWave(el, binding, true);\n },\n updated(el: HTMLElement, binding: PlateWaveBinding) {\n if (binding.value === binding.oldValue) {\n return;\n }\n attachWave(el, binding);\n },\n unmount(el: HTMLElement) {\n destroyListeners(el);\n },\n};\n\nexport default PlateWave;\n"],"mappings":"AAEA;AAQA,MAAMA,UAAU,GAAG,yBAAyB;AAE5C,SAASC,aAAaA,CAACC,EAAsB,EAAE;EAC7C,IAAI,CAACA,EAAE,EAAE;EACT,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAC,MAAM,CAAC;EAChDF,SAAS,CAACG,SAAS,GAAGN,UAAU;EAChCE,EAAE,CAACK,WAAW,CAACJ,SAAS,CAAC;EACzBA,SAAS,CAACK,OAAO,CAACC,SAAS,GAAGC,MAAM,CAACC,WAAW,CAACC,GAAG,CAAC,CAAC,CAAC;AACzD;AAEA,SAASC,aAAaA,CAACX,EAAsB,EAAE;EAC7C,IAAI,CAACA,EAAE,EAAE;IACP;EACF;EACA,MAAMY,UAAU,GAAGZ,EAAE,CAACa,sBAAsB,CAACf,UAAU,CAAC;EACxD,IAAIc,UAAU,CAACE,MAAM,KAAK,CAAC,EAAE;EAC7B,MAAMb,SAAS,GAAGW,UAAU,CAACA,UAAU,CAACE,MAAM,GAAG,CAAC,CAAgB;EAClE,IAAIb,SAAS,CAACK,OAAO,CAACS,QAAQ,EAAE;EAChCd,SAAS,CAACK,OAAO,CAACS,QAAQ,GAAG,MAAM;EACnC,MAAMC,IAAI,GAAGP,WAAW,CAACC,GAAG,CAAC,CAAC,GAAGO,MAAM,CAAChB,SAAS,CAACK,OAAO,CAACC,SAAS,CAAC;EACpE,MAAMW,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAG,GAAGJ,IAAI,EAAE,CAAC,CAAC;EACr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Z,UAAU,CAAClC,EAAE,EAAEmC,OAAO,CAAC;EACzB,CAAC;EACDY,OAAOA,CAAC/C,EAAe,EAAE;IACvBgC,gBAAgB,CAAChC,EAAE,CAAC;EACtB;AACF,CAAC;AAED,eAAe2C,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["CLASS_NAME","showAnimation","el","animation","document","createElement","className","appendChild","dataset","activated","String","performance","now","hideAnimation","animations","getElementsByClassName","length","isHiding","diff","Number","delay","Math","max","setTimeout","removeChild","keyboardEventFlag","spawn","event","currentTarget","clean","stop","keyboardSpawn","key","keyboardClean","destroyListeners","removeEventListener","attachWave","binding","init","arguments","undefined","value","modifiers","enabled","addEventListener","PlateWave","mounted","updated","oldValue","unmount"],"sources":["../../../src/directives/plate-wave/index.ts"],"sourcesContent":["import type { DirectiveBinding } from 'vue';\r\n\r\nimport './plate-wave.scss';\r\n\r\nexport interface PlateWaveBinding\r\n extends Omit<DirectiveBinding, 'modifiers' | 'value'> {\r\n value?: boolean;\r\n modifiers: { stop?: boolean };\r\n}\r\n\r\nconst CLASS_NAME = 'y-plate-wave__animation';\r\n\r\nfunction showAnimation(el: HTMLElement | null) {\r\n if (!el) return;\r\n const animation = document.createElement('span');\r\n animation.className = CLASS_NAME;\r\n el.appendChild(animation);\r\n animation.dataset.activated = String(performance.now());\r\n}\r\n\r\nfunction hideAnimation(el: HTMLElement | null) {\r\n if (!el) {\r\n return;\r\n }\r\n const animations = el.getElementsByClassName(CLASS_NAME);\r\n if (animations.length === 0) return;\r\n const animation = animations[animations.length - 1] as HTMLElement;\r\n if (animation.dataset.isHiding) return;\r\n animation.dataset.isHiding = 'true';\r\n const diff = performance.now() - Number(animation.dataset.activated);\r\n const delay = Math.max(250 - diff, 0);\r\n setTimeout(() => {\r\n if (animation) {\r\n el.removeChild(animation);\r\n }\r\n }, delay + 300);\r\n}\r\n\r\n/*\r\n * Event\r\n * */\r\n\r\nlet keyboardEventFlag = false;\r\n\r\nfunction spawn(event: Event) {\r\n showAnimation(event.currentTarget as HTMLElement);\r\n}\r\n\r\nfunction clean(event: Event) {\r\n hideAnimation(event.currentTarget as HTMLElement);\r\n}\r\n\r\nfunction stop(event: Event) {\r\n //\r\n}\r\n\r\nfunction keyboardSpawn(event: KeyboardEvent) {\r\n if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {\r\n keyboardEventFlag = true;\r\n showAnimation(event.currentTarget as HTMLElement);\r\n }\r\n}\r\n\r\nfunction keyboardClean(event: KeyboardEvent) {\r\n keyboardEventFlag = false;\r\n hideAnimation(event.currentTarget as HTMLElement);\r\n}\r\n\r\nfunction destroyListeners(el: HTMLElement) {\r\n el.removeEventListener('mousedown', spawn);\r\n el.removeEventListener('mouseup', clean);\r\n el.removeEventListener('mouseleave', clean);\r\n el.removeEventListener('keydown', keyboardSpawn);\r\n el.removeEventListener('keyup', keyboardClean);\r\n}\r\n\r\nfunction attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {\r\n const { value, modifiers } = binding;\r\n let enabled = value ?? true;\r\n if (typeof value === 'boolean') {\r\n enabled = value;\r\n }\r\n if (!enabled) hideAnimation(el);\r\n\r\n if (enabled && init) {\r\n if (modifiers.stop) {\r\n el.addEventListener('mousedown', stop);\r\n return;\r\n }\r\n\r\n el.addEventListener('mousedown', spawn);\r\n el.addEventListener('mouseup', clean);\r\n el.addEventListener('mouseleave', clean);\r\n el.addEventListener('keydown', keyboardSpawn);\r\n el.addEventListener('keyup', keyboardClean);\r\n el.addEventListener('blur', clean);\r\n } else if (!enabled && !init) {\r\n destroyListeners(el);\r\n }\r\n}\r\n\r\nexport const PlateWave = {\r\n mounted(el: HTMLElement, binding: PlateWaveBinding) {\r\n attachWave(el, binding, true);\r\n },\r\n updated(el: HTMLElement, binding: PlateWaveBinding) {\r\n if (binding.value === binding.oldValue) {\r\n return;\r\n }\r\n attachWave(el, binding);\r\n },\r\n unmount(el: HTMLElement) {\r\n destroyListeners(el);\r\n },\r\n};\r\n\r\nexport default P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AAE9B,aAAa,CAACX,EAAE,CAAC;EAE/B,IAAIyC,OAAO,IAAIL,IAAI,EAAE;IACnB,IAAII,SAAS,CAACZ,IAAI,EAAE;MAClB5B,EAAE,CAAC0C,gBAAgB,CAAC,WAAW,EAAEd,IAAI,CAAC;MACtC;IACF;IAEA5B,EAAE,CAAC0C,gBAAgB,CAAC,WAAW,EAAElB,KAAK,CAAC;IACvCxB,EAAE,CAAC0C,gBAAgB,CAAC,SAAS,EAAEf,KAAK,CAAC;IACrC3B,EAAE,CAAC0C,gBAAgB,CAAC,YAAY,EAAEf,KAAK,CAAC;IACxC3B,EAAE,CAAC0C,gBAAgB,CAAC,SAAS,EAAEb,aAAa,CAAC;IAC7C7B,EAAE,CAAC0C,gBAAgB,CAAC,OAAO,EAAEX,aAAa,CAAC;IAC3C/B,EAAE,CAAC0C,gBAAgB,CAAC,MAAM,EAAEf,KAAK,CAAC;EACpC,CAAC,MAAM,IAAI,CAACc,OAAO,IAAI,CAACL,IAAI,EAAE;IAC5BJ,gBAAgB,CAAChC,EAAE,CAAC;EACtB;AACF;AAEA,OAAO,MAAM2C,SAAS,GAAG;EACvBC,OAAOA,CAAC5C,EAAe,EAAEmC,OAAyB,EAAE;IAClDD,UAAU,CAAClC,EAAE,EAAEmC,OAAO,EAAE,IAAI,CAAC;EAC/B,CAAC;EACDU,OAAOA,CAAC7C,EAAe,EAAEmC,OAAyB,EAAE;IAClD,IAAIA,OAAO,CAACI,KAAK,KAAKJ,OAAO,CAACW,QAAQ,EAAE;MACtC;IACF;IACAZ,UAAU,CAAClC,EAAE,EAAEmC,OAAO,CAAC;EACzB,CAAC;EACDY,OAAOA,CAAC/C,EAAe,EAAE;IACvBgC,gBAAgB,CAAChC,EAAE,CAAC;EACtB;AACF,CAAC;AAED,eAAe2C,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in.mjs","names":["ref","shallowRef","useProvided","en","getObjectValueByPath","LOCALE_PREFIX","replaceParams","str","params","replace","item","index","String","generateContext","locale","fallbackLocale","messages","translate","key","_len","arguments","length","Array","_key","startsWith","path","localeMessages","value","fallbackMessages","msg","number","options","numberFormat","Intl","NumberFormat","format","getContext","props","localLocale","localFallbackLocale","localMessages","ctx","name","t","n","constructYuyeonI18nAdapter"],"sources":["../../src/i18n/built-in.ts"],"sourcesContent":["import { ref, shallowRef } from 'vue';\nimport type { Ref } from 'vue';\n\nimport { useProvided } from '@/composables/communication';\nimport en from '@/locales/en';\nimport { getObjectValueByPath } from '@/util/common';\n\nimport type { LocaleMessages, LocaleModule, LocaleOptions } from './types';\n\nconst LOCALE_PREFIX = '$yuyeon';\n\nfunction replaceParams(str: string, params: unknown[]) {\n return str.replace(/\\{(\\d+)\\}/g, (item, index) => {\n return String(params[+index]);\n });\n}\n\nfunction generateContext(\n locale: Ref<string>,\n fallbackLocale: Ref<string>,\n messages: Ref<LocaleMessages>,\n) {\n function translate(key: string, ...params: unknown[]) {\n if (!key.startsWith(LOCALE_PREFIX)) {\n return replaceParams(key, params);\n }\n const path = key.replace(LOCALE_PREFIX, '');\n const localeMessages = locale.value && messages.value[locale.value];\n const fallbackMessages =\n fallbackLocale.value && messages.value[fallbackLocale.value];\n\n let msg: string = getObjectValueByPath(localeMessages, path, null);\n if (!msg) {\n msg = getObjectValueByPath(fallbackMessages, path, null);\n }\n if (!msg) {\n msg = key;\n }\n if (typeof msg !== 'string') {\n msg = key;\n }\n return replaceParams(msg, params);\n }\n\n function number(value: number, options?: Intl.NumberFormatOptions) {\n const numberFormat = new Intl.NumberFormat(\n [locale.value, fallbackLocale.value],\n options,\n );\n return numberFormat.format(value);\n }\n\n function getContext(props: LocaleOptions) {\n const localLocale = useProvided(props, 'locale', locale);\n const localFallbackLocale = useProvided(\n props,\n 'fallbackLocale',\n fallbackLocale,\n );\n const localMessages = useProvided(props, 'messages', messages);\n const ctx = generateContext(\n localLocale,\n localFallbackLocale,\n localMessages,\n );\n return {\n name: 'yuyeon',\n locale,\n fallbackLocale,\n messages,\n t: ctx.translate,\n n: ctx.number,\n getContext: ctx.getContext,\n };\n }\n\n return {\n translate,\n number,\n getContext,\n };\n}\n\nexport function constructYuyeonI18nAdapter(\n options?: LocaleOptions,\n): LocaleModule {\n const locale = shallowRef(options?.locale ?? 'en');\n const fallbackLocale = shallowRef(options?.fallbackLocale ?? 'en');\n const messages = ref({\n en,\n ...options?.messages,\n });\n\n const ctx = generateContext(locale, fallbackLocale, messages);\n\n return {\n name: 'yuyeon',\n locale,\n fallbackLocale,\n messages,\n t: ctx.translate,\n n: ctx.number,\n getContext: ctx.getContext,\n };\n}\n"],"mappings":"AAAA,SAASA,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAG7BC,WAAW;AAAA,OACbC,EAAE;AAAA,SACAC,oBAAoB;AAI7B,MAAMC,aAAa,GAAG,SAAS;AAE/B,SAASC,aAAaA,CAACC,GAAW,EAAEC,MAAiB,EAAE;EACrD,OAAOD,GAAG,CAACE,OAAO,CAAC,YAAY,EAAE,CAACC,IAAI,EAAEC,KAAK,KAAK;IAChD,OAAOC,MAAM,CAACJ,MAAM,CAAC,CAACG,KAAK,CAAC,CAAC;EAC/B,CAAC,CAAC;AACJ;AAEA,SAASE,eAAeA,CACtBC,MAAmB,EACnBC,cAA2B,EAC3BC,QAA6B,EAC7B;EACA,SAASC,SAASA,CAACC,GAAW,EAAwB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAnBb,MAAM,OAAAc,KAAA,CAAAH,IAAA,OAAAA,IAAA,WAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;MAANf,MAAM,CAAAe,IAAA,QAAAH,SAAA,CAAAG,IAAA;IAAA;IACvC,IAAI,CAACL,GAAG,CAACM,UAAU,CAACnB,aAAa,CAAC,EAAE;MAClC,OAAOC,aAAa,CAACY,GAAG,EAAEV,MAAM,CAAC;IACnC;IACA,MAAMiB,IAAI,GAAGP,GAAG,CAACT,OAAO,CAACJ,aAA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ACLE,IAAI,EAAE,QAAQ;MACd5B,MAAM;MACNC,cAAc;MACdC,QAAQ;MACR2B,CAAC,EAAEF,GAAG,CAACxB,SAAS;MAChB2B,CAAC,EAAEH,GAAG,CAACX,MAAM;MACbM,UAAU,EAAEK,GAAG,CAACL;IAClB,CAAC;EACH;EAEA,OAAO;IACLnB,SAAS;IACTa,MAAM;IACNM;EACF,CAAC;AACH;AAEA,OAAO,SAASS,0BAA0BA,CACxCd,OAAuB,EACT;EACd,MAAMjB,MAAM,GAAGb,UAAU,CAAC8B,OAAO,EAAEjB,MAAM,IAAI,IAAI,CAAC;EAClD,MAAMC,cAAc,GAAGd,UAAU,CAAC8B,OAAO,EAAEhB,cAAc,IAAI,IAAI,CAAC;EAClE,MAAMC,QAAQ,GAAGhB,GAAG,CAAC;IACnBG,EAAE;IACF,GAAG4B,OAAO,EAAEf;EACd,CAAC,CAAC;EAEF,MAAMyB,GAAG,GAAG5B,eAAe,CAACC,MAAM,EAAEC,cAAc,EAAEC,QAAQ,CAAC;EAE7D,OAAO;IACL0B,IAAI,EAAE,QAAQ;IACd5B,MAAM;IACNC,cAAc;IACdC,QAAQ;IACR2B,CAAC,EAAEF,GAAG,CAACxB,SAAS;IAChB2B,CAAC,EAAEH,GAAG,CAACX,MAAM;IACbM,UAAU,EAAEK,GAAG,CAACL;EAClB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"built-in.mjs","names":["ref","shallowRef","useProvided","en","getObjectValueByPath","LOCALE_PREFIX","replaceParams","str","params","replace","item","index","String","generateContext","locale","fallbackLocale","messages","translate","key","_len","arguments","length","Array","_key","startsWith","path","localeMessages","value","fallbackMessages","msg","number","options","numberFormat","Intl","NumberFormat","format","getContext","props","localLocale","localFallbackLocale","localMessages","ctx","name","t","n","constructYuyeonI18nAdapter"],"sources":["../../src/i18n/built-in.ts"],"sourcesContent":["import { ref, shallowRef } from 'vue';\r\nimport type { Ref } from 'vue';\r\n\r\nimport { useProvided } from '@/composables/communication';\r\nimport en from '@/locales/en';\r\nimport { getObjectValueByPath } from '@/util/common';\r\n\r\nimport type { LocaleMessages, LocaleModule, LocaleOptions } from './types';\r\n\r\nconst LOCALE_PREFIX = '$yuyeon';\r\n\r\nfunction replaceParams(str: string, params: unknown[]) {\r\n return str.replace(/\\{(\\d+)\\}/g, (item, index) => {\r\n return String(params[+index]);\r\n });\r\n}\r\n\r\nfunction generateContext(\r\n locale: Ref<string>,\r\n fallbackLocale: Ref<string>,\r\n messages: Ref<LocaleMessages>,\r\n) {\r\n function translate(key: string, ...params: unknown[]) {\r\n if (!key.startsWith(LOCALE_PREFIX)) {\r\n return replaceParams(key, params);\r\n }\r\n const path = key.replace(LOCALE_PREFIX, '');\r\n const localeMessages = locale.value && messages.value[locale.value];\r\n const fallbackMessages =\r\n fallbackLocale.value && messages.value[fallbackLocale.value];\r\n\r\n let msg: string = getObjectValueByPath(localeMessages, path, null);\r\n if (!msg) {\r\n msg = getObjectValueByPath(fallbackMessages, path, null);\r\n }\r\n if (!msg) {\r\n msg = key;\r\n }\r\n if (typeof msg !== 'string') {\r\n msg = key;\r\n }\r\n return replaceParams(msg, params);\r\n }\r\n\r\n function number(value: number, options?: Intl.NumberFormatOptions) {\r\n const numberFormat = new Intl.NumberFormat(\r\n [locale.value, fallbackLocale.value],\r\n options,\r\n );\r\n return numberFormat.format(value);\r\n }\r\n\r\n function getContext(props: LocaleOptions) {\r\n const localLocale = useProvided(props, 'locale', locale);\r\n const localFallbackLocale = useProvided(\r\n props,\r\n 'fallbackLocale',\r\n fallbackLocale,\r\n );\r\n const localMessages = useProvided(props, 'messages', messages);\r\n const ctx = generateContext(\r\n localLocale,\r\n localFallbackLocale,\r\n localMessages,\r\n );\r\n return {\r\n name: 'yuyeon',\r\n locale,\r\n fallbackLocale,\r\n messages,\r\n t: ctx.translate,\r\n n: ctx.number,\r\n getContext: ctx.getContext,\r\n };\r\n }\r\n\r\n return {\r\n translate,\r\n number,\r\n getContext,\r\n };\r\n}\r\n\r\nexport function constructYuyeonI18nAdapter(\r\n options?: LocaleOptions,\r\n): LocaleModule {\r\n const locale = shallowRef(options?.locale ?? 'en');\r\n const fallbackLocale = shallowRef(options?.fallbackLocale ?? 'en');\r\n const messages = ref({\r\n en,\r\n ...options?.messages,\r\n });\r\n\r\n const ctx = generateContext(locale, fallbackLocale, messages);\r\n\r\n return {\r\n name: 'yuyeon',\r\n locale,\r\n fallbackLocale,\r\n messages,\r\n t: ctx.translate,\r\n n: ctx.number,\r\n getContext: ctx.getContext,\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAG7BC,WAAW;AAAA,OACbC,EAAE;AAAA,SACAC,oBAAoB;AAI7B,MAAMC,aAAa,GAAG,SAAS;AAE/B,SAASC,aAAaA,CAACC,GAAW,EAAEC,MAAiB,EAAE;EACrD,OAAOD,GAAG,CAACE,OAAO,CAAC,YAAY,EAAE,CAACC,IAAI,EAAEC,KAAK,KAAK;IAChD,OAAOC,MAAM,CAACJ,MAAM,CAAC,CAACG,KAAK,CAAC,CAAC;EAC/B,CAAC,CAAC;AACJ;AAEA,SAASE,eAAeA,CACtBC,MAAmB,EACnBC,cAA2B,EAC3BC,QAA6B,EAC7B;EACA,SAASC,SAASA,CAACC,GAAW,EAAwB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAnBb,MAAM,OAAAc,KAAA,CAAAH,IAAA,OAAAA,IAAA,WAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;MAANf,MAAM,CAAAe,IAAA,QAAAH,SAAA,CAAAG,IAAA;IAAA;IACvC,IAAI,CAACL,GAAG,CAACM,UAAU,CAACnB,aAAa,CAAC,EAAE;MAClC,OAAOC,aAAa,CAACY,GAAG,EAAEV,MAAM,CAAC;IACnC;IACA,MAAMiB,IAAI,GAAGP,GAAG,CAACT,OAAO,CAACJ,aAAa,EAAE,EAAE,CAAC;IAC3C,MAAMqB,cAAc,GA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AAc;MACdC,QAAQ;MACR2B,CAAC,EAAEF,GAAG,CAACxB,SAAS;MAChB2B,CAAC,EAAEH,GAAG,CAACX,MAAM;MACbM,UAAU,EAAEK,GAAG,CAACL;IAClB,CAAC;EACH;EAEA,OAAO;IACLnB,SAAS;IACTa,MAAM;IACNM;EACF,CAAC;AACH;AAEA,OAAO,SAASS,0BAA0BA,CACxCd,OAAuB,EACT;EACd,MAAMjB,MAAM,GAAGb,UAAU,CAAC8B,OAAO,EAAEjB,MAAM,IAAI,IAAI,CAAC;EAClD,MAAMC,cAAc,GAAGd,UAAU,CAAC8B,OAAO,EAAEhB,cAAc,IAAI,IAAI,CAAC;EAClE,MAAMC,QAAQ,GAAGhB,GAAG,CAAC;IACnBG,EAAE;IACF,GAAG4B,OAAO,EAAEf;EACd,CAAC,CAAC;EAEF,MAAMyB,GAAG,GAAG5B,eAAe,CAACC,MAAM,EAAEC,cAAc,EAAEC,QAAQ,CAAC;EAE7D,OAAO;IACL0B,IAAI,EAAE,QAAQ;IACd5B,MAAM;IACNC,cAAc;IACdC,QAAQ;IACR2B,CAAC,EAAEF,GAAG,CAACxB,SAAS;IAChB2B,CAAC,EAAEH,GAAG,CAACX,MAAM;IACbM,UAAU,EAAEK,GAAG,CAACL;EAClB,CAAC;AACH"}
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["getCurrentInstance","nextTick","reactive","allComponents","YUYEON_DATE_KEY","YUYEON_DATE_OPTIONS_KEY","createDateModule","createDefaultsModule","YUYEON_DEFAULTS_KEY","createI18nModule","YUYEON_I18N_KEY","YUYEON_ICON_KEY","createIconModule","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","YUYEON_LOGO","defaultOptions","credit","init","options","arguments","length","undefined","defaultsModule","defaults","themeModule","theme","i18nModule","i18n","dateModule","date","localeModule","iconModule","icon","components","install","app","yuyeon","root","instance","rtlModule","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_container","_instance","classList","add","setAttribute","console","log","unmount","mount","vm","scope","stop","useYuyeon","Error","appContext"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Component, ComponentInternalInstance } from 'vue';\nimport { getCurrentInstance, nextTick, reactive } from 'vue';\n\nimport * as allComponents from '@/components/';\nimport {\n YUYEON_DATE_KEY,\n YUYEON_DATE_OPTIONS_KEY,\n createDateModule,\n} from '@/composables/date';\nimport { createDefaultsModule } from '@/composables/defaults';\nimport { YUYEON_DEFAULTS_KEY } from '@/composables/defaults/share';\nimport { createI18nModule } from '@/composables/i18n';\nimport { YUYEON_I18N_KEY } from '@/composables/i18n/share';\nimport { YUYEON_ICON_KEY, createIconModule } from '@/composables/icon';\nimport {\n YUYEON_THEME_KEY,\n createThemeModule,\n useTheme,\n} from '@/composables/theme';\nimport PlateWave from '@/directives/plate-wave';\nimport { YUYEON_LOGO } from '@/etc';\n\nimport './styles/base.scss';\n\nconst defaultOptions = {\n credit: true,\n};\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $yuyeon: any;\n }\n}\n\nexport function init(options: any = defaultOptions) {\n const defaultsModule = createDefaultsModule(options?.defaults);\n const themeModule = createThemeModule(options?.theme);\n const i18nModule = createI18nModule(options?.i18n);\n const dateModule = createDateModule(options?.date, i18nModule.localeModule);\n const iconModule = createIconModule(options?.icon);\n const components = options?.components ?? allComponents;\n\n const install = (app: App) => {\n themeModule.install(app);\n\n const yuyeon = reactive({\n app: null as ComponentInternalInstance | null,\n root: null as HTMLElement | null,\n theme: themeModule.instance,\n i18n: {\n ...i18nModule.localeModule,\n ...i18nModule.rtlModule,\n },\n date: dateModule,\n defaults: defaultsModule,\n });\n\n Object.keys(components).forEach((componentName) => {\n const comp = components[componentName as keyof typeof components];\n if (typeof comp === 'object' && 'name' in comp)\n app.component(componentName, comp as Component);\n });\n\n app.directive('plate-wave', PlateWave);\n\n app.provide(YUYEON_DEFAULTS_KEY, defaultsModule);\n app.provide(YUYEON_THEME_KEY, themeModule.instance);\n app.provide(YUYEON_ICON_KEY, iconModule);\n app.provide(YUYEON_I18N_KEY, {\n ...i18nModule.localeModule,\n ...i18nModule.rtlModule,\n });\n app.provide(YUYEON_DATE_OPTIONS_KEY, dateModule.options);\n app.provide(YUYEON_DATE_KEY, dateModule.instance);\n\n app.config.globalProperties.$yuyeon = yuyeon;\n\n nextTick(() => {\n yuyeon.root = app._container;\n yuyeon.app = app._instance as any;\n if (yuyeon.root) {\n yuyeon.root.classList.add('y-root');\n yuyeon.root.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n }\n });\n\n if (options?.credit) {\n console.log(YUYEON_LOGO);\n }\n const { unmount, mount } = app;\n app.mount = (...args) => {\n const vm = mount(...args);\n if (!yuyeon.app) {\n yuyeon.app = app._instance as any;\n }\n if (!yuyeon.root) {\n nextTick(() => {\n yuyeon.root = app._container;\n if (yuyeon.root) {\n yuyeon.root.classList.add('y-root');\n yuyeon.root.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n }\n });\n }\n app.mount = mount;\n return vm;\n };\n app.unmount = () => {\n unmount();\n themeModule.scope.stop();\n app.unmount = unmount;\n };\n };\n\n return {\n install,\n };\n}\n\nexport function useYuyeon() {\n const vm = getCurrentInstance();\n if (!vm) throw new Error('[yuyeon] Called outside of setup context');\n\n return vm.appContext.config.globalProperties.$yuyeon;\n}\n\nexport { useTheme };\n"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAC,OAEtD,KAAKC,aAAa;AAAA,SAEvBC,eAAe,EACfC,uBAAuB,EACvBC,gBAAgB;AAAA,SAETC,oBAAoB;AAAA,SACpBC,mBAAmB;AAAA,SACnBC,gBAAgB;AAAA,SAChBC,eAAe;AAAA,SACfC,eAAe,EAAEC,gBAAgB;AAAA,SAExCC,gBAAgB,EAChBC,iBAAiB,EACjBC,QAAQ;AAAA,OAEHC,SAAS;AAAA,SACPC,WAAW;AAEpB;AAEA,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,GAAAxC,SAAO,CAAC;MACzB,IAAI,CAACiB,MAAM,CAACD,GAAG,EAAE;QACfC,MAAM,CAACD,GAAG,GAAGA,GAAG,CAACiB,SAAgB;MACnC;MACA,IAAI,CAAChB,MAAM,CAACC,IAAI,EAAE;QAChBvC,QAAQ,CAAC,MAAM;UACbsC,MAAM,CAACC,IAAI,GAAGF,GAAG,CAACgB,UAAU;UAC5B,IAAIf,MAAM,CAACC,IAAI,EAAE;YACfD,MAAM,CAACC,IAAI,CAACgB,SAAS,CAACC,GAAG,CAAC,QAAQ,CAAC;YACnClB,MAAM,CAACC,IAAI,CAACkB,YAAY,CAAC,aAAa,EAAE,EAAE,CAAC;YAC3C/B,WAAW,CAACP,IAAI,CAACmB,MAAM,CAAC;UAC1B;QACF,CAAC,CAAC;MACJ;MACAD,GAAG,CAACwB,KAAK,GAAGA,KAAK;MACjB,OAAOC,EAAE;IACX,CAAC;IACDzB,GAAG,CAACuB,OAAO,GAAG,MAAM;MAClBA,OAAO,CAAC,CAAC;MACTlC,WAAW,CAACqC,KAAK,CAACC,IAAI,CAAC,CAAC;MACxB3B,GAAG,CAACuB,OAAO,GAAGA,OAAO;IACvB,CAAC;EACH,CAAC;EAED,OAAO;IACLxB;EACF,CAAC;AACH;AAEA,OAAO,SAAS6B,SAASA,CAAA,EAAG;EAC1B,MAAMH,EAAE,GAAG/D,kBAAkB,CAAC,CAAC;EAC/B,IAAI,CAAC+D,EAAE,EAAE,MAAM,IAAII,KAAK,CAAC,0CAA0C,CAAC;EAEpE,OAAOJ,EAAE,CAACK,UAAU,CAACjB,MAAM,CAACC,gBAAgB,CAACC,OAAO;AACtD;AAEA,SAAStC,QAAQ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["getCurrentInstance","nextTick","reactive","allComponents","YUYEON_DATE_KEY","YUYEON_DATE_OPTIONS_KEY","createDateModule","createDefaultsModule","YUYEON_DEFAULTS_KEY","createI18nModule","YUYEON_I18N_KEY","YUYEON_ICON_KEY","createIconModule","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","YUYEON_LOGO","defaultOptions","credit","init","options","arguments","length","undefined","defaultsModule","defaults","themeModule","theme","i18nModule","i18n","dateModule","date","localeModule","iconModule","icon","components","install","app","yuyeon","root","instance","rtlModule","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_container","_instance","classList","add","setAttribute","console","log","unmount","mount","vm","scope","stop","useYuyeon","Error","appContext"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Component, ComponentInternalInstance } from 'vue';\r\nimport { getCurrentInstance, nextTick, reactive } from 'vue';\r\n\r\nimport * as allComponents from '@/components/';\r\nimport {\r\n YUYEON_DATE_KEY,\r\n YUYEON_DATE_OPTIONS_KEY,\r\n createDateModule,\r\n} from '@/composables/date';\r\nimport { createDefaultsModule } from '@/composables/defaults';\r\nimport { YUYEON_DEFAULTS_KEY } from '@/composables/defaults/share';\r\nimport { createI18nModule } from '@/composables/i18n';\r\nimport { YUYEON_I18N_KEY } from '@/composables/i18n/share';\r\nimport { YUYEON_ICON_KEY, createIconModule } from '@/composables/icon';\r\nimport {\r\n YUYEON_THEME_KEY,\r\n createThemeModule,\r\n useTheme,\r\n} from '@/composables/theme';\r\nimport PlateWave from '@/directives/plate-wave';\r\nimport { YUYEON_LOGO } from '@/etc';\r\n\r\nimport './styles/base.scss';\r\n\r\nconst defaultOptions = {\r\n credit: true,\r\n};\r\n\r\ndeclare module 'vue' {\r\n interface ComponentCustomProperties {\r\n $yuyeon: any;\r\n }\r\n}\r\n\r\nexport function init(options: any = defaultOptions) {\r\n const defaultsModule = createDefaultsModule(options?.defaults);\r\n const themeModule = createThemeModule(options?.theme);\r\n const i18nModule = createI18nModule(options?.i18n);\r\n const dateModule = createDateModule(options?.date, i18nModule.localeModule);\r\n const iconModule = createIconModule(options?.icon);\r\n const components = options?.components ?? allComponents;\r\n\r\n const install = (app: App) => {\r\n themeModule.install(app);\r\n\r\n const yuyeon = reactive({\r\n app: null as ComponentInternalInstance | null,\r\n root: null as HTMLElement | null,\r\n theme: themeModule.instance,\r\n i18n: {\r\n ...i18nModule.localeModule,\r\n ...i18nModule.rtlModule,\r\n },\r\n date: dateModule,\r\n defaults: defaultsModule,\r\n });\r\n\r\n Object.keys(components).forEach((componentName) => {\r\n const comp = components[componentName as keyof typeof components];\r\n if (typeof comp === 'object' && 'name' in comp)\r\n app.component(componentName, comp as Component);\r\n });\r\n\r\n app.directive('plate-wave', PlateWave);\r\n\r\n app.provide(YUYEON_DEFAULTS_KEY, defaultsModule);\r\n app.provide(YUYEON_THEME_KEY, themeModule.instance);\r\n app.provide(YUYEON_ICON_KEY, iconModule);\r\n app.provide(YUYEON_I18N_KEY, {\r\n ...i18nModule.localeModule,\r\n ...i18nModule.rtlModule,\r\n });\r\n app.provide(YUYEON_DATE_OPTIONS_KEY, dateModule.options);\r\n app.provide(YUYEON_DATE_KEY, dateModule.instance);\r\n\r\n app.config.globalProperties.$yuyeon = yuyeon;\r\n\r\n nextTick(() => {\r\n yuyeon.root = app._container;\r\n yuyeon.app = app._instance as any;\r\n if (yuyeon.root) {\r\n yuyeon.root.classList.add('y-root');\r\n yuyeon.root.setAttribute('data-y-root', '');\r\n themeModule.init(yuyeon);\r\n }\r\n });\r\n\r\n if (options?.credit) {\r\n console.log(YUYEON_LOGO);\r\n }\r\n const { unmount, mount } = app;\r\n app.mount = (...args) => {\r\n const vm = mount(...args);\r\n if (!yuyeon.app) {\r\n yuyeon.app = app._instance as any;\r\n }\r\n if (!yuyeon.root) {\r\n nextTick(() => {\r\n yuyeon.root = app._container;\r\n if (yuyeon.root) {\r\n yuyeon.root.classList.add('y-root');\r\n yuyeon.root.setAttribute('data-y-root', '');\r\n themeModule.init(yuyeon);\r\n }\r\n });\r\n }\r\n app.mount = mount;\r\n return vm;\r\n };\r\n app.unmount = () => {\r\n unmount();\r\n themeModule.scope.stop();\r\n app.unmount = unmount;\r\n };\r\n };\r\n\r\n return {\r\n install,\r\n };\r\n}\r\n\r\nexport function useYuyeon() {\r\n const vm = getCurrentInstance();\r\n if (!vm) throw new Error('[yuyeon] Called outside of setup context');\r\n\r\n return vm.appContext.config.globalProperties.$yuyeon;\r\n}\r\n\r\nexport { useTheme };\r\n"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAC,OAEtD,KAAKC,aAAa;AAAA,SAEvBC,eAAe,EACfC,uBAAuB,EACvBC,gBAAgB;AAAA,SAETC,oBAAoB;AAAA,SACpBC,mBAAmB;AAAA,SACnBC,gBAAgB;AAAA,SAChBC,eAAe;AAAA,SACfC,eAAe,EAAEC,gBAAgB;AAAA,SAExCC,gBAAgB,EAChBC,iBAAiB,EACjBC,QAAQ;AAAA,OAEHC,SAAS;AAAA,SACPC,WAAW;AAEpB;AAEA,MAAMC,cAAc,GAAG;EACrBC,MAAM,EAAE;AACV,CAAC;AAQD,OAAO,SAASC,IAAIA,CAAA,EAAgC;EAAA,IAA/BC,OAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,cAAc;EAChD,MAAMO,cAAc,GAAGlB,oBAAoB,CAACc,OAAO,EAAEK,QAAQ,CAAC;EAC9D,MAAMC,WAAW,GAAGb,iBAAiB,CAACO,OAAO,EAAEO,KAAK,CAAC;EACrD,MAAMC,UAAU,GAAGpB,gBAAgB,CAACY,OAAO,EAAES,IAAI,CAAC;EAClD,MAAMC,UAAU,GAAGzB,gBAAgB,CAACe,OAAO,EAAEW,IAAI,EAAEH,UAAU,CAACI,YAAY,CAAC;EAC3E,MAAMC,UAAU,GAAGtB,gBAAgB,CAACS,OAAO,EAAEc,IAAI,CAAC;EAClD,MAAMC,UAAU,GAAGf,OAAO,EAAEe,UAAU,IAAIjC,aAAa;EAEvD,MAAMkC,OAAO,GAAIC,GAAQ,IAAK;IAC5BX,WAAW,CAACU,OAAO,CAACC,GAAG,CAAC;IAExB,MAAMC,MAAM,GAAG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vB,CAAC;EACH,CAAC;EAED,OAAO;IACLxB;EACF,CAAC;AACH;AAEA,OAAO,SAAS6B,SAASA,CAAA,EAAG;EAC1B,MAAMH,EAAE,GAAG/D,kBAAkB,CAAC,CAAC;EAC/B,IAAI,CAAC+D,EAAE,EAAE,MAAM,IAAII,KAAK,CAAC,0CAA0C,CAAC;EAEpE,OAAOJ,EAAE,CAACK,UAAU,CAACjB,MAAM,CAACC,gBAAgB,CAACC,OAAO;AACtD;AAEA,SAAStC,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.mjs","names":["useDefaultsModule","useSuperDefaults","redefineComponent","options","_setup","setup","props","ctx","defaults","value","_props","provideSubDefaults","name","setupBindings","defineFunctionalComponent","context","defineComponent"],"sources":["../../../src/util/component/component.ts"],"sourcesContent":["import {\n ComponentObjectPropsOptions,\n
|
|
1
|
+
{"version":3,"file":"component.mjs","names":["useDefaultsModule","useSuperDefaults","redefineComponent","options","_setup","setup","props","ctx","defaults","value","_props","provideSubDefaults","name","setupBindings","defineFunctionalComponent","context","defineComponent"],"sources":["../../../src/util/component/component.ts"],"sourcesContent":["import {\r\n ComponentObjectPropsOptions,\r\n ComponentOptionsWithoutProps,\r\n ExtractDefaultPropTypes,\r\n ExtractPropTypes,\r\n FunctionalComponent,\r\n defineComponent,\r\n} from 'vue';\r\nimport type {\r\n Component,\r\n ComponentInjectOptions,\r\n ComponentOptions,\r\n ComponentOptionsMixin,\r\n ComponentPropsOptions,\r\n ComponentProvideOptions,\r\n ComputedOptions,\r\n DefineComponent,\r\n Directive,\r\n EmitsOptions,\r\n MethodOptions,\r\n SlotsType,\r\n} from 'vue';\r\n\r\nimport {\r\n useDefaultsModule,\r\n useSuperDefaults,\r\n} from '../../composables/defaults';\r\nimport { EmitsToProps } from './types';\r\nimport { ComponentOptionsWithObjectProps } from '@vue/runtime-core';\r\n\r\ntype ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> &\r\n Readonly<EmitsToProps<Emits>>;\r\n\r\n// overload 1: no props from options\r\nfunction redefineComponent<\r\n // props\r\n PropsOptions = {},\r\n //\r\n RawBindings = {},\r\n // emits\r\n E extends EmitsOptions = {},\r\n EE extends string = string,\r\n // other options\r\n Data = {},\r\n SetupBindings = {},\r\n Computed extends ComputedOptions = {},\r\n Methods extends MethodOptions = {},\r\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n InjectOptions extends ComponentInjectOptions = {},\r\n InjectKeys extends string = string,\r\n Slots extends SlotsType = {},\r\n LocalComponents extends Record<string, Component> = {},\r\n Directives extends Record<string, Directive> = {},\r\n Exposed extends string = string,\r\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\r\n>(\r\n options: ComponentOptionsWithoutProps<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE,\r\n InjectOptions,\r\n InjectKeys,\r\n Slots\r\n >,\r\n): DefineComponent<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE\r\n>;\r\n\r\n// overload 2: defineComponent with options object, infer props from options\r\nfunction redefineComponent<\r\n // props\r\n PropsOptions = ComponentObjectPropsOptions,\r\n RawBindings = {},\r\n // emits\r\n E extends EmitsOptions = {},\r\n EE extends string = string,\r\n // other options\r\n Data = {},\r\n SetupBindings = {},\r\n Computed extends ComputedOptions = {},\r\n Methods extends MethodOptions = {},\r\n Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Extends extends ComponentOptionsMixin = ComponentOptionsMixin,\r\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\r\n InjectOptions extends {} = {},\r\n InjectKeys extends string = string,\r\n Slots extends SlotsType = {},\r\n LocalComponents extends Record<string, Component> = {},\r\n Directives extends Record<string, Directive> = {},\r\n Exposed extends string = string,\r\n Provide extends ComponentProvideOptions = ComponentProvideOptions,\r\n>(\r\n options: ComponentOptionsWithObjectProps<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE,\r\n InjectOptions,\r\n InjectKeys,\r\n Slots\r\n >,\r\n): DefineComponent<\r\n PropsOptions,\r\n RawBindings,\r\n Data,\r\n Computed,\r\n Methods,\r\n Mixin,\r\n Extends,\r\n E,\r\n EE\r\n>;\r\n\r\nfunction redefineComponent(options: ComponentOptions) {\r\n options._setup = options._setup ?? options.setup;\r\n\r\n if (options._setup) {\r\n options.setup = function (props, ctx) {\r\n const defaults = useDefaultsModule();\r\n // Skip props proxy if defaults are not provided\r\n if (!defaults.value) return options._setup(props, ctx);\r\n\r\n const { props: _props, provideSubDefaults } = useSuperDefaults(\r\n props,\r\n options.name,\r\n defaults,\r\n );\r\n\r\n const setupBindings = options._setup(_props, ctx);\r\n\r\n provideSubDefaults();\r\n\r\n return setupBindings;\r\n };\r\n }\r\n\r\n return options;\r\n}\r\n\r\nfunction defineFunctionalComponent<\r\n T extends FunctionalComponent<Props>,\r\n PropsOptions = ComponentObjectPropsOptions,\r\n Defaults = ExtractDefaultPropTypes<PropsOptions>,\r\n Props = Readonly<ExtractPropTypes<PropsOptions>>,\r\n>(\r\n props: PropsOptions,\r\n context: T,\r\n): FunctionalComponent<Partial<Defaults> & Omit<Props, keyof Defaults>> {\r\n context.props = props as any;\r\n return context as any;\r\n}\r\n\r\nexport { redefineComponent as defineComponent };\r\n"],"mappings":"SAwBEA,iBAAiB,EACjBC,gBAAgB,gDAQlB;AAkDA;AAkDA,SAASC,iBAAiBA,CAACC,OAAyB,EAAE;EACpDA,OAAO,CAACC,MAAM,GAAGD,OAAO,CAACC,MAAM,IAAID,OAAO,CAACE,KAAK;EAEhD,IAAIF,OAAO,CAACC,MAAM,EAAE;IAClBD,OAAO,CAACE,KAAK,GAAG,UAAUC,KAAK,EAAEC,GAAG,EAAE;MACpC,MAAMC,QAAQ,GAAGR,iBAAiB,CAAC,CAAC;MACpC;MACA,IAAI,CAACQ,QAAQ,CAACC,KAAK,EAAE,OAAON,OAAO,CAACC,MAAM,CAACE,KAAK,EAAEC,GAAG,CAAC;MAEtD,MAAM;QAAED,KAAK,EAAEI,MAAM;QAAEC;MAAmB,CAAC,GAAGV,gBAAgB,CAC5DK,KAAK,EACLH,OAAO,CAACS,IAAI,EACZJ,QACF,CAAC;MAED,MAAMK,aAAa,GAAGV,OAAO,CAACC,MAAM,CAACM,MAAM,EAAEH,GAAG,CAAC;MAEjDI,kBAAkB,CAAC,CAAC;MAEpB,OAAOE,aAAa;IACtB,CAAC;EACH;EAEA,OAAOV,OAAO;AAChB;AAEA,SAASW,yBAAyBA,CAMhCR,KAAmB,EACnBS,OAAU,EAC4D;EACtEA,OAAO,CAACT,KAAK,GAAGA,KAAY;EAC5B,OAAOS,OAAO;AAChB;AAEA,SAASb,iBAAiB,IAAIc,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "yuyeon",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"keywords": [
|
|
5
|
-
"UI Library",
|
|
6
|
-
"Vue"
|
|
7
|
-
],
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/yuyeonUI/yuyeon",
|
|
11
|
-
"directory": "packages/yuyeon"
|
|
12
|
-
},
|
|
13
|
-
"author": "yeonyew",
|
|
14
|
-
"license": "Apache-2.0",
|
|
15
|
-
"files": [
|
|
16
|
-
"dist/",
|
|
17
|
-
"lib/",
|
|
18
|
-
"types/"
|
|
19
|
-
],
|
|
20
|
-
"type": "module",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./types/index.d.ts",
|
|
24
|
-
"default": "./lib/index.mjs"
|
|
25
|
-
},
|
|
26
|
-
"./styles/*": "./lib/styles/*",
|
|
27
|
-
"./locales": {
|
|
28
|
-
"types": "./types/locales/index.d.ts",
|
|
29
|
-
"default": "./lib/locales/index.mjs"
|
|
30
|
-
},
|
|
31
|
-
"./lib": {
|
|
32
|
-
"types": "./types/index.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./components": {
|
|
35
|
-
"types": "./types/components/index.d.ts",
|
|
36
|
-
"module": "./lib/components/index.mjs"
|
|
37
|
-
},
|
|
38
|
-
"./components/*": "./lib/components/*/index.mjs",
|
|
39
|
-
"./composables": {
|
|
40
|
-
"types": "./types/composables/index.d.ts",
|
|
41
|
-
"module": "./lib/composables/index.mjs",
|
|
42
|
-
"default": "./lib/composables/index.mjs"
|
|
43
|
-
},
|
|
44
|
-
"./util": {
|
|
45
|
-
"types": "./types/util/index.d.ts",
|
|
46
|
-
"module": "./lib/util/index.mjs"
|
|
47
|
-
},
|
|
48
|
-
"./shims": "./types/shims.d.ts",
|
|
49
|
-
"./types/*": "./types/*",
|
|
50
|
-
"./*": "./*"
|
|
51
|
-
},
|
|
52
|
-
"main": "lib/index.mjs",
|
|
53
|
-
"module": "lib/index.mjs",
|
|
54
|
-
"types": "types/index.d.ts",
|
|
55
|
-
"typesVersions": {
|
|
56
|
-
"*": {
|
|
57
|
-
"lib/index.mjs": [
|
|
58
|
-
"types/index.d.ts"
|
|
59
|
-
],
|
|
60
|
-
"*": [
|
|
61
|
-
"*",
|
|
62
|
-
"types/*",
|
|
63
|
-
"types/*.d.ts",
|
|
64
|
-
"types/*/index.d.ts"
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"scripts": {
|
|
69
|
-
"build": "vue-tsc && vite build && yarn run build:lib",
|
|
70
|
-
"build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\" --copy-files --no-copy-ignored --out-file-extension .mjs"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"motion": "^10.15.5"
|
|
74
|
-
},
|
|
75
|
-
"devDependencies": {
|
|
76
|
-
"@babel/cli": "^7.21.0",
|
|
77
|
-
"@babel/core": "^7.21.3",
|
|
78
|
-
"@babel/preset-env": "^7.20.2",
|
|
79
|
-
"@babel/preset-typescript": "^7.21.0",
|
|
80
|
-
"@rollup/plugin-alias": "^4.0.3",
|
|
81
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
82
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
83
|
-
"@rollup/plugin-typescript": "^11.0.0",
|
|
84
|
-
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
85
|
-
"@types/jest": "^28.1.8",
|
|
86
|
-
"@types/node": "^18.19.1",
|
|
87
|
-
"@types/resize-observer-browser": "^0.1.7",
|
|
88
|
-
"@vitejs/plugin-vue": "^5.0.5",
|
|
89
|
-
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
90
|
-
"@vue/babel-plugin-jsx": "^1.2.2",
|
|
91
|
-
"@vue/test-utils": "2.4.6",
|
|
92
|
-
"autoprefixer": "^10.4.14",
|
|
93
|
-
"babel-plugin-add-import-extension": "1.5.1",
|
|
94
|
-
"babel-plugin-module-resolver": "^5.0.0",
|
|
95
|
-
"babel-plugin-transform-define": "^2.1.0",
|
|
96
|
-
"babel-polyfill": "^6.26.0",
|
|
97
|
-
"concurrently": "^4.1.1",
|
|
98
|
-
"cross-env": "^7.0.3",
|
|
99
|
-
"rollup": "^4.22.4",
|
|
100
|
-
"rollup-plugin-dts": "^5.3.0",
|
|
101
|
-
"rollup-plugin-sass": "^1.2.19",
|
|
102
|
-
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
103
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
104
|
-
"sass": "^1.63.3",
|
|
105
|
-
"vite": "^5.4.6",
|
|
106
|
-
"vite-plugin-dts": "^3.9.1",
|
|
107
|
-
"vue-router": "^4.3.3",
|
|
108
|
-
"vue-tsc": "^2.0.21"
|
|
109
|
-
},
|
|
110
|
-
"peerDependencies": {
|
|
111
|
-
"motion": "^10.15.5",
|
|
112
|
-
"vue": "^3.3.0",
|
|
113
|
-
"vue-i18n": "^9.0.0 || ^10.0.0"
|
|
114
|
-
},
|
|
115
|
-
"peerDependenciesMeta": {
|
|
116
|
-
"vue-i18n": {
|
|
117
|
-
"optional": true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "yuyeon",
|
|
3
|
+
"version": "0.3.0-rc.1",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"UI Library",
|
|
6
|
+
"Vue"
|
|
7
|
+
],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/yuyeonUI/yuyeon",
|
|
11
|
+
"directory": "packages/yuyeon"
|
|
12
|
+
},
|
|
13
|
+
"author": "yeonyew",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"lib/",
|
|
18
|
+
"types/"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./types/index.d.ts",
|
|
24
|
+
"default": "./lib/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./styles/*": "./lib/styles/*",
|
|
27
|
+
"./locales": {
|
|
28
|
+
"types": "./types/locales/index.d.ts",
|
|
29
|
+
"default": "./lib/locales/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"./lib": {
|
|
32
|
+
"types": "./types/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./components": {
|
|
35
|
+
"types": "./types/components/index.d.ts",
|
|
36
|
+
"module": "./lib/components/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./components/*": "./lib/components/*/index.mjs",
|
|
39
|
+
"./composables": {
|
|
40
|
+
"types": "./types/composables/index.d.ts",
|
|
41
|
+
"module": "./lib/composables/index.mjs",
|
|
42
|
+
"default": "./lib/composables/index.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./util": {
|
|
45
|
+
"types": "./types/util/index.d.ts",
|
|
46
|
+
"module": "./lib/util/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./shims": "./types/shims.d.ts",
|
|
49
|
+
"./types/*": "./types/*",
|
|
50
|
+
"./*": "./*"
|
|
51
|
+
},
|
|
52
|
+
"main": "lib/index.mjs",
|
|
53
|
+
"module": "lib/index.mjs",
|
|
54
|
+
"types": "types/index.d.ts",
|
|
55
|
+
"typesVersions": {
|
|
56
|
+
"*": {
|
|
57
|
+
"lib/index.mjs": [
|
|
58
|
+
"types/index.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"*": [
|
|
61
|
+
"*",
|
|
62
|
+
"types/*",
|
|
63
|
+
"types/*.d.ts",
|
|
64
|
+
"types/*/index.d.ts"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "vue-tsc && vite build && yarn run build:lib",
|
|
70
|
+
"build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\" --copy-files --no-copy-ignored --out-file-extension .mjs"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"motion": "^10.15.5"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@babel/cli": "^7.21.0",
|
|
77
|
+
"@babel/core": "^7.21.3",
|
|
78
|
+
"@babel/preset-env": "^7.20.2",
|
|
79
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
80
|
+
"@rollup/plugin-alias": "^4.0.3",
|
|
81
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
82
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
83
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
84
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
85
|
+
"@types/jest": "^28.1.8",
|
|
86
|
+
"@types/node": "^18.19.1",
|
|
87
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
88
|
+
"@vitejs/plugin-vue": "^5.0.5",
|
|
89
|
+
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
90
|
+
"@vue/babel-plugin-jsx": "^1.2.2",
|
|
91
|
+
"@vue/test-utils": "2.4.6",
|
|
92
|
+
"autoprefixer": "^10.4.14",
|
|
93
|
+
"babel-plugin-add-import-extension": "1.5.1",
|
|
94
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
95
|
+
"babel-plugin-transform-define": "^2.1.0",
|
|
96
|
+
"babel-polyfill": "^6.26.0",
|
|
97
|
+
"concurrently": "^4.1.1",
|
|
98
|
+
"cross-env": "^7.0.3",
|
|
99
|
+
"rollup": "^4.22.4",
|
|
100
|
+
"rollup-plugin-dts": "^5.3.0",
|
|
101
|
+
"rollup-plugin-sass": "^1.2.19",
|
|
102
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
103
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
104
|
+
"sass": "^1.63.3",
|
|
105
|
+
"vite": "^5.4.6",
|
|
106
|
+
"vite-plugin-dts": "^3.9.1",
|
|
107
|
+
"vue-router": "^4.3.3",
|
|
108
|
+
"vue-tsc": "^2.0.21"
|
|
109
|
+
},
|
|
110
|
+
"peerDependencies": {
|
|
111
|
+
"motion": "^10.15.5",
|
|
112
|
+
"vue": "^3.3.0",
|
|
113
|
+
"vue-i18n": "^9.0.0 || ^10.0.0"
|
|
114
|
+
},
|
|
115
|
+
"peerDependenciesMeta": {
|
|
116
|
+
"vue-i18n": {
|
|
117
|
+
"optional": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -10,7 +10,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
10
10
|
};
|
|
11
11
|
disabled: PropType<boolean>;
|
|
12
12
|
readonly: PropType<boolean>;
|
|
13
|
-
},
|
|
13
|
+
}, {}, {
|
|
14
14
|
counterId: string;
|
|
15
15
|
checked: boolean;
|
|
16
16
|
focused: boolean;
|
|
@@ -22,7 +22,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
22
22
|
checked: BooleanConstructor;
|
|
23
23
|
indeterminate: BooleanConstructor;
|
|
24
24
|
disabled: BooleanConstructor;
|
|
25
|
-
},
|
|
25
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string> | null;
|
|
26
26
|
}, {
|
|
27
27
|
onFocus(e: FocusEvent): void;
|
|
28
28
|
onBlur(e: FocusEvent): void;
|
|
@@ -151,14 +151,14 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
151
151
|
default: unknown extends Defaults["coordinateStrategy"] ? "levitation" | "arrangement" | import('../../composables/coordinate').CoordinateStrategyFn : NonNullable<"levitation" | "arrangement" | import('../../composables/coordinate').CoordinateStrategyFn> | Defaults["coordinateStrategy"];
|
|
152
152
|
};
|
|
153
153
|
position: unknown extends Defaults["position"] ? {
|
|
154
|
-
type: PropType<"default" | "
|
|
154
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
155
155
|
default: string;
|
|
156
156
|
} : Omit<{
|
|
157
|
-
type: PropType<"default" | "
|
|
157
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
158
158
|
default: string;
|
|
159
159
|
}, "type" | "default"> & {
|
|
160
|
-
type: PropType<unknown extends Defaults["position"] ? "default" | "
|
|
161
|
-
default: unknown extends Defaults["position"] ? "default" | "
|
|
160
|
+
type: PropType<unknown extends Defaults["position"] ? "default" | "top" | "bottom" | "start" | "end" | "left" | "right" : NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right"> | Defaults["position"]>;
|
|
161
|
+
default: unknown extends Defaults["position"] ? "default" | "top" | "bottom" | "start" | "end" | "left" | "right" : NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right"> | Defaults["position"];
|
|
162
162
|
};
|
|
163
163
|
origin: unknown extends Defaults["origin"] ? {
|
|
164
164
|
type: StringConstructor;
|
|
@@ -368,7 +368,7 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
368
368
|
default: string;
|
|
369
369
|
};
|
|
370
370
|
position: {
|
|
371
|
-
type: PropType<"default" | "
|
|
371
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
372
372
|
default: string;
|
|
373
373
|
};
|
|
374
374
|
origin: {
|
|
@@ -456,7 +456,7 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
456
456
|
default: string;
|
|
457
457
|
};
|
|
458
458
|
position: {
|
|
459
|
-
type: PropType<"default" | "
|
|
459
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
460
460
|
default: string;
|
|
461
461
|
};
|
|
462
462
|
align: {
|
|
@@ -3765,7 +3765,7 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
3765
3765
|
default: string;
|
|
3766
3766
|
};
|
|
3767
3767
|
position: {
|
|
3768
|
-
type: PropType<"default" | "
|
|
3768
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
3769
3769
|
default: string;
|
|
3770
3770
|
};
|
|
3771
3771
|
align: {
|
|
@@ -7062,4 +7062,5 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
7062
7062
|
'y-dialog': boolean;
|
|
7063
7063
|
'y-dialog--maximized': boolean | undefined;
|
|
7064
7064
|
}>;
|
|
7065
|
+
children: import('vue').ShallowRef<any[], any[]>;
|
|
7065
7066
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:modelValue"[], "update:modelValue">;
|
|
@@ -152,20 +152,20 @@ export declare const pressYDropdownPropsOptions: <Defaults extends {
|
|
|
152
152
|
default: unknown extends Defaults["offset"] ? string | number | number[] : NonNullable<string | number | number[]> | Defaults["offset"];
|
|
153
153
|
};
|
|
154
154
|
position: unknown extends Defaults["position"] ? Omit<{
|
|
155
|
-
type: PropType<"default" | "
|
|
155
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
156
156
|
default: string;
|
|
157
157
|
}, "type" | "default"> & {
|
|
158
|
-
type: PropType<NonNullable<"default" | "
|
|
159
|
-
default: NonNullable<"default" | "
|
|
158
|
+
type: PropType<NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">>;
|
|
159
|
+
default: NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
160
160
|
} : Omit<Omit<{
|
|
161
|
-
type: PropType<"default" | "
|
|
161
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
162
162
|
default: string;
|
|
163
163
|
}, "type" | "default"> & {
|
|
164
|
-
type: PropType<NonNullable<"default" | "
|
|
165
|
-
default: NonNullable<"default" | "
|
|
164
|
+
type: PropType<NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">>;
|
|
165
|
+
default: NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
166
166
|
}, "type" | "default"> & {
|
|
167
|
-
type: PropType<unknown extends Defaults["position"] ? NonNullable<"default" | "
|
|
168
|
-
default: unknown extends Defaults["position"] ? NonNullable<"default" | "
|
|
167
|
+
type: PropType<unknown extends Defaults["position"] ? NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right"> : Defaults["position"] | NonNullable<NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">>>;
|
|
168
|
+
default: unknown extends Defaults["position"] ? NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right"> : Defaults["position"] | NonNullable<NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">>;
|
|
169
169
|
};
|
|
170
170
|
origin: unknown extends Defaults["origin"] ? {
|
|
171
171
|
type: StringConstructor;
|
|
@@ -462,11 +462,11 @@ export declare const YDropdown: import('vue').DefineComponent<{
|
|
|
462
462
|
type: PropType<string | number | number[]>;
|
|
463
463
|
};
|
|
464
464
|
position: Omit<{
|
|
465
|
-
type: PropType<"default" | "
|
|
465
|
+
type: PropType<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
466
466
|
default: string;
|
|
467
467
|
}, "type" | "default"> & {
|
|
468
|
-
type: PropType<NonNullable<"default" | "
|
|
469
|
-
default: NonNullable<"default" | "
|
|
468
|
+
type: PropType<NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">>;
|
|
469
|
+
default: NonNullable<"default" | "top" | "bottom" | "start" | "end" | "left" | "right">;
|
|
470
470
|
};
|
|
471
471
|
origin: {
|
|
472
472
|
type: StringConstructor;
|
|
@@ -306,5 +306,5 @@ export declare const YFieldInput: import('vue').DefineComponent<{
|
|
|
306
306
|
readonly rxValue: any;
|
|
307
307
|
};
|
|
308
308
|
inValue: import('vue').Ref<any, any>;
|
|
309
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "blur" | "change" | "click" | "focus" | "keydown" | "keyup" | "mousedown" | "mouseup" | "mousedown:display" | "keydown:display" | "update:modelValue" | "update:focused")[], "input" | "blur" | "change" | "click" | "focus" | "keydown" | "keyup" | "mousedown" | "mouseup" | "mousedown:display" | "keydown:display" | "update:modelValue" | "update:focused">;
|
|
309
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "blur" | "change" | "click" | "focus" | "keydown" | "keyup" | "mousedown" | "mouseup" | "mousedown:display" | "keydown:display" | "update:modelValue" | "update:focused" | "click:clear")[], "input" | "blur" | "change" | "click" | "focus" | "keydown" | "keyup" | "mousedown" | "mouseup" | "mousedown:display" | "keydown:display" | "update:modelValue" | "update:focused" | "click:clear">;
|
|
310
310
|
export type YFieldInput = InstanceType<typeof YFieldInput>;
|