yuyeon 0.0.14 → 0.0.15
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/LICENSE +191 -0
- package/README.md +15 -0
- package/dist/style.css +1 -1
- package/dist/yuyeon.mjs +3134 -2276
- package/dist/yuyeon.umd.js +29 -1
- package/lib/abstract/items.mjs +20 -0
- package/lib/abstract/items.mjs.map +1 -0
- package/lib/components/button/YButton.mjs +2 -2
- package/lib/components/button/YButton.mjs.map +1 -1
- package/lib/components/button/YButton.scss +1 -1
- package/lib/components/card/YCard.mjs.map +1 -1
- package/lib/components/card/YCard.scss +3 -2
- package/lib/components/checkbox/YInputCheckbox.scss +1 -1
- package/lib/components/chip/YChip.mjs +2 -2
- package/lib/components/chip/YChip.mjs.map +1 -1
- package/lib/components/dialog/YDialog.mjs +2 -2
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +83 -2
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.scss +33 -0
- package/lib/components/field-input/YFieldInput.mjs +55 -47
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/icons/YIconCheckbox.scss +1 -1
- package/lib/components/icons/YIconDropdown.mjs +16 -0
- package/lib/components/icons/YIconDropdown.mjs.map +1 -0
- package/lib/components/index.mjs +2 -0
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/input/YInput.mjs +83 -49
- package/lib/components/input/YInput.mjs.map +1 -1
- package/lib/components/input/YInput.scss +8 -8
- package/lib/components/layer/YLayer.mjs +21 -9
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/YLayer.scss +1 -0
- package/lib/components/layer/scroll-strategies.mjs +1 -1
- package/lib/components/layer/scroll-strategies.mjs.map +1 -1
- package/lib/components/list/YList.mjs +40 -2
- package/lib/components/list/YList.mjs.map +1 -1
- package/lib/components/list/YListItem.mjs +31 -11
- package/lib/components/list/YListItem.mjs.map +1 -1
- package/lib/components/list/YListItem.scss +5 -2
- package/lib/components/menu/YMenu.mjs +29 -18
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/components/menu/YMenu.scss +20 -7
- package/lib/components/pagination/YPagination.mjs +8 -8
- package/lib/components/pagination/YPagination.mjs.map +1 -1
- package/lib/components/panel/YDividePanel.scss +4 -4
- package/lib/components/progress-bar/YProgressBar.mjs +20 -3
- package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
- package/lib/components/progress-bar/YProgressBar.scss +109 -40
- package/lib/components/select/YSelect.mjs +185 -0
- package/lib/components/select/YSelect.mjs.map +1 -0
- package/lib/components/select/YSelect.scss +43 -0
- package/lib/components/select/index.mjs +2 -0
- package/lib/components/select/index.mjs.map +1 -0
- package/lib/components/switch/YSwitch.scss +1 -1
- package/lib/components/table/YTable.scss +2 -2
- package/lib/components/tree-view/YTreeView.mjs +76 -18
- package/lib/components/tree-view/YTreeView.mjs.map +1 -1
- package/lib/components/tree-view/YTreeViewNode.mjs +21 -18
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
- package/lib/components/tree-view/types.mjs.map +1 -1
- package/lib/components/tree-view/util.mjs +24 -0
- package/lib/components/tree-view/util.mjs.map +1 -1
- package/lib/composables/coordinate/arrangement.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/coordinate/levitation.mjs +1 -1
- package/lib/composables/coordinate/levitation.mjs.map +1 -1
- package/lib/composables/coordinate/utils/point.mjs.map +1 -1
- package/lib/composables/dimension.mjs +26 -0
- package/lib/composables/dimension.mjs.map +1 -0
- package/lib/composables/focus.mjs +29 -0
- package/lib/composables/focus.mjs.map +1 -0
- package/lib/composables/list-items.mjs +58 -0
- package/lib/composables/list-items.mjs.map +1 -0
- package/lib/composables/theme/factory.mjs +45 -0
- package/lib/composables/theme/factory.mjs.map +1 -0
- package/lib/composables/theme/helper.mjs +14 -0
- package/lib/composables/theme/helper.mjs.map +1 -0
- package/lib/composables/theme/index.mjs +144 -10
- package/lib/composables/theme/index.mjs.map +1 -1
- package/lib/composables/theme/setting.mjs +46 -9
- package/lib/composables/theme/setting.mjs.map +1 -1
- package/lib/composables/theme/types.mjs +2 -0
- package/lib/composables/theme/types.mjs.map +1 -0
- package/lib/directives/complement-click/index.mjs.map +1 -1
- package/lib/directives/theme-class.mjs +4 -4
- package/lib/directives/theme-class.mjs.map +1 -1
- package/lib/index.mjs +7 -5
- package/lib/index.mjs.map +1 -1
- package/lib/mixins/di.mjs +0 -3
- package/lib/mixins/di.mjs.map +1 -1
- package/lib/styles/_elevation.scss +15 -0
- package/lib/styles/base.scss +11 -5
- package/lib/styles/settings/_elevation.scss +20 -0
- package/lib/styles/theme/light.scss +1 -1
- package/lib/styles/util/_helper.scss +12 -0
- package/lib/styles/util/_var.scss +18 -0
- package/lib/util/color/apca.mjs +201 -0
- package/lib/util/color/apca.mjs.map +1 -0
- package/lib/util/color/const.mjs +6 -0
- package/lib/util/color/const.mjs.map +1 -0
- package/lib/util/color/contrast/contrast.mjs +149 -0
- package/lib/util/color/contrast/contrast.mjs.map +1 -0
- package/lib/util/color/conversion.mjs +310 -0
- package/lib/util/color/conversion.mjs.map +1 -0
- package/lib/util/color/hct/cam16.mjs +349 -0
- package/lib/util/color/hct/cam16.mjs.map +1 -0
- package/lib/util/color/hct/hct-solver.mjs +389 -0
- package/lib/util/color/hct/hct-solver.mjs.map +1 -0
- package/lib/util/color/hct/hct.mjs +153 -0
- package/lib/util/color/hct/hct.mjs.map +1 -0
- package/lib/util/color/hct/viewing-conditions.mjs +110 -0
- package/lib/util/color/hct/viewing-conditions.mjs.map +1 -0
- package/lib/util/color/index.mjs +24 -0
- package/lib/util/color/index.mjs.map +1 -0
- package/lib/util/color/palettes/core-palette.mjs +99 -0
- package/lib/util/color/palettes/core-palette.mjs.map +1 -0
- package/lib/util/color/palettes/tonal-palette.mjs +112 -0
- package/lib/util/color/palettes/tonal-palette.mjs.map +1 -0
- package/lib/util/color/types.mjs +2 -0
- package/lib/util/color/types.mjs.map +1 -0
- package/lib/util/color/utils/math-utils.mjs +139 -0
- package/lib/util/color/utils/math-utils.mjs.map +1 -0
- package/lib/util/common.mjs +11 -6
- package/lib/util/common.mjs.map +1 -1
- package/lib/util/debounce.mjs +114 -0
- package/lib/util/debounce.mjs.map +1 -0
- package/lib/util/{FrameScheduler.mjs → frame-scheduler.mjs} +1 -1
- package/lib/util/frame-scheduler.mjs.map +1 -0
- package/lib/util/{Rect.mjs → rect.mjs} +1 -1
- package/lib/util/{Rect.mjs.map → rect.mjs.map} +1 -1
- package/lib/util/string.mjs +6 -0
- package/lib/util/string.mjs.map +1 -1
- package/lib/util/ui.mjs +11 -36
- package/lib/util/ui.mjs.map +1 -1
- package/package.json +12 -1
- package/types/abstract/items.d.ts +48 -0
- package/types/components/card/YCard.d.ts +1 -1
- package/types/components/checkbox/YInputCheckbox.d.ts +2 -2
- package/types/components/dialog/YDialog.d.ts +23 -8
- package/types/components/dropdown/YDropdown.d.ts +219 -0
- package/types/components/dropdown/index.d.ts +1 -0
- package/types/components/field-input/YFieldInput.d.ts +238 -25
- package/types/components/icons/YIconCheckbox.d.ts +1 -1
- package/types/components/icons/YIconDropdown.d.ts +1 -0
- package/types/components/index.d.ts +2 -0
- package/types/components/input/YInput.d.ts +156 -42
- package/types/components/layer/YLayer.d.ts +67 -17
- package/types/components/list/YList.d.ts +22 -1
- package/types/components/list/YListItem.d.ts +28 -2
- package/types/components/menu/YMenu.d.ts +132 -16
- package/types/components/pagination/YPagination.d.ts +10 -10
- package/types/components/progress-bar/YProgressBar.d.ts +18 -1
- package/types/components/select/YSelect.d.ts +701 -0
- package/types/components/select/index.d.ts +1 -0
- package/types/components/table/YDataTable.d.ts +1 -1
- package/types/components/table/YDataTableServer.d.ts +1 -1
- package/types/components/text-highlighter/YTextHighlighter.d.ts +40 -0
- package/types/components/tooltip/YTooltip.d.ts +20 -5
- package/types/components/tree-view/YTreeView.d.ts +47 -22
- package/types/components/tree-view/YTreeViewNode.d.ts +72 -26
- package/types/components/tree-view/types.d.ts +1 -0
- package/types/components/tree-view/util.d.ts +4 -1
- package/types/composables/coordinate/arrangement.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +3 -3
- package/types/composables/coordinate/levitation.d.ts +1 -1
- package/types/composables/coordinate/utils/point.d.ts +1 -1
- package/types/composables/dimension.d.ts +53 -0
- package/types/composables/focus.d.ts +27 -0
- package/types/composables/list-items.d.ts +117 -0
- package/types/composables/theme/factory.d.ts +3 -0
- package/types/composables/theme/helper.d.ts +3 -0
- package/types/composables/theme/index.d.ts +45 -5
- package/types/composables/theme/setting.d.ts +3 -6
- package/types/composables/theme/types.d.ts +28 -0
- package/types/directives/complement-click/index.d.ts +1 -1
- package/types/directives/theme-class.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/shims.d.ts +4 -0
- package/types/util/color/apca.d.ts +29 -0
- package/types/util/color/const.d.ts +5 -0
- package/types/util/color/conversion.d.ts +130 -0
- package/types/util/color/hct/cam16.d.ts +131 -0
- package/types/util/color/hct/hct.d.ts +86 -0
- package/types/util/color/hct/hct_solver.d.ts +146 -0
- package/types/util/color/hct/viewing_conditions.d.ts +74 -0
- package/types/util/color/index.d.ts +4 -0
- package/types/util/color/palettes/tonal_palette.d.ts +55 -0
- package/types/util/color/types.d.ts +14 -0
- package/types/util/color/utils/math-utils.d.ts +82 -0
- package/types/util/color/utils/math_utils.d.ts +82 -0
- package/types/util/common.d.ts +2 -1
- package/types/util/debounce.d.ts +11 -0
- package/types/util/string.d.ts +1 -0
- package/types/util/ui.d.ts +1 -6
- package/lib/components/input/index.scss +0 -2
- package/lib/components/table/pagination.mjs +0 -80
- package/lib/components/table/pagination.mjs.map +0 -1
- package/lib/composables/collections.mjs +0 -2
- package/lib/composables/collections.mjs.map +0 -1
- package/lib/composables/levitation.mjs +0 -135
- package/lib/composables/levitation.mjs.map +0 -1
- package/lib/styles/util/helper.scss +0 -6
- package/lib/util/FrameScheduler.mjs.map +0 -1
- /package/lib/styles/settings/{provided.scss → _provided.scss} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { propsFactory } from "../util/vue-component.mjs";
|
|
2
|
+
export const pressItemsPropsOptions = propsFactory({
|
|
3
|
+
items: {
|
|
4
|
+
type: Array,
|
|
5
|
+
default: () => []
|
|
6
|
+
},
|
|
7
|
+
itemKey: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: 'key'
|
|
10
|
+
},
|
|
11
|
+
itemText: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'text'
|
|
14
|
+
},
|
|
15
|
+
itemChildren: {
|
|
16
|
+
type: [Boolean, String],
|
|
17
|
+
default: 'children'
|
|
18
|
+
}
|
|
19
|
+
}, 'abstract.items');
|
|
20
|
+
//# sourceMappingURL=items.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.mjs","names":["propsFactory","pressItemsPropsOptions","items","type","Array","default","itemKey","String","itemText","itemChildren","Boolean"],"sources":["../../src/abstract/items.ts"],"sourcesContent":["import { PropType } from 'vue';\n\nimport { propsFactory } from '../util/vue-component';\n\nexport const pressItemsPropsOptions = propsFactory(\n {\n items: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n itemKey: {\n type: String as PropType<string>,\n default: 'key',\n },\n itemText: {\n type: String as PropType<string>,\n default: 'text',\n },\n itemChildren: {\n type: [Boolean, String] as PropType<boolean | string>,\n default: 'children',\n },\n },\n 'abstract.items',\n);\n"],"mappings":"SAESA,YAAY;AAErB,OAAO,MAAMC,sBAAsB,GAAGD,YAAY,CAChD;EACEE,KAAK,EAAE;IACLC,IAAI,EAAEC,KAAwB;IAC9BC,OAAO,EAAEA,CAAA,KAAM;EACjB,CAAC;EACDC,OAAO,EAAE;IACPH,IAAI,EAAEI,MAA0B;IAChCF,OAAO,EAAE;EACX,CAAC;EACDG,QAAQ,EAAE;IACRL,IAAI,EAAEI,MAA0B;IAChCF,OAAO,EAAE;EACX,CAAC;EACDI,YAAY,EAAE;IACZN,IAAI,EAAE,CAACO,OAAO,EAAEH,MAAM,CAA+B;IACrDF,OAAO,EAAE;EACX;AACF,CAAC,EACD,gBACF,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent, h, withDirectives } from 'vue';
|
|
2
2
|
import { PlateWave } from "../../directives/plate-wave/index.mjs";
|
|
3
|
-
import { isColorValue } from "../../util/ui.mjs";
|
|
4
3
|
import { getSlot, propsFactory } from "../../util/vue-component.mjs";
|
|
5
4
|
import { YSpinnerRing } from "../loading/YSpinnerRing.mjs";
|
|
6
5
|
/**
|
|
7
6
|
* Style
|
|
8
7
|
*/
|
|
9
8
|
import "./YButton.scss";
|
|
9
|
+
import { isColorValue } from "../../util/color/index.mjs";
|
|
10
10
|
const NAME = 'y-button';
|
|
11
11
|
export const pressYButtonProps = propsFactory({
|
|
12
12
|
loading: Boolean,
|
|
@@ -91,7 +91,7 @@ export const YButton = defineComponent({
|
|
|
91
91
|
color
|
|
92
92
|
} = this;
|
|
93
93
|
if (color && !isColorValue(color)) {
|
|
94
|
-
color = `rgba(var(--y-theme
|
|
94
|
+
color = `rgba(var(--y-theme-${color}), 1)`;
|
|
95
95
|
}
|
|
96
96
|
return {
|
|
97
97
|
[`--y-button__color`]: color
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YButton.mjs","names":["defineComponent","h","withDirectives","PlateWave","
|
|
1
|
+
{"version":3,"file":"YButton.mjs","names":["defineComponent","h","withDirectives","PlateWave","getSlot","propsFactory","YSpinnerRing","isColorValue","NAME","pressYButtonProps","loading","Boolean","disabled","type","variation","String","small","icon","outlined","default","rounded","filled","text","color","noWave","YButton","name","directives","props","computed","variations","split","map","value","trim","classes","includes","styles","methods","createContent","defaultSlot","children","push","width","height","class","getClasses","onClick","e","preventDefault","render","style","undefined"],"sources":["../../../src/components/button/YButton.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType, VNodeArrayChildren } from 'vue';\nimport { defineComponent, h, withDirectives } from 'vue';\n\nimport { PlateWave } from '../../directives/plate-wave';\nimport { getSlot, propsFactory } from '../../util/vue-component';\nimport { YSpinnerRing } from '../loading/YSpinnerRing';\n\n/**\n * Style\n */\nimport './YButton.scss';\nimport { isColorValue } from \"../../util/color\";\n\nconst NAME = 'y-button';\n\nexport const pressYButtonProps = propsFactory(\n {\n loading: Boolean,\n disabled: {\n type: Boolean,\n },\n //\n variation: {\n type: String as PropType<string>,\n },\n small: Boolean,\n icon: Boolean,\n outlined: {\n type: Boolean,\n default: false,\n },\n rounded: {\n type: Boolean,\n default: false,\n },\n filled: {\n type: Boolean,\n default: false,\n },\n text: {\n type: Boolean,\n },\n //\n color: {\n type: String,\n },\n noWave: {\n type: Boolean,\n default: false,\n },\n },\n 'YButton',\n);\n\nexport const YButton = defineComponent({\n name: 'YButton',\n directives: {\n PlateWave,\n },\n props: {\n ...pressYButtonProps(),\n },\n computed: {\n variations(): any[] {\n const { variation } = this;\n if (variation) {\n return variation.split(',').map((value) => {\n return value.trim();\n });\n }\n return [];\n },\n //\n classes() {\n const { variations, outlined, rounded, filled, text, small, icon } = this;\n return {\n [`${NAME}--outlined`]: variations.includes('outlined') || outlined,\n [`${NAME}--rounded`]: variations.includes('rounded') || rounded,\n [`${NAME}--filled`]: variations.includes('filled') || filled,\n [`${NAME}--text`]: variations.includes('text') || text,\n [`${NAME}--small`]: variations.includes('small') || small,\n [`${NAME}--icon`]: variations.includes('icon') || icon,\n [`${NAME}--color`]: this.color,\n [`${NAME}--loading`]: this.loading,\n [`${NAME}--disabled`]: this.disabled,\n };\n },\n styles(): Record<string, any> {\n let { color } = this;\n if (color && !isColorValue(color)) {\n color = `rgba(var(--y-theme-${color}), 1)`;\n }\n return {\n [`--y-button__color`]: color,\n };\n },\n },\n methods: {\n createContent() {\n const defaultSlot = getSlot(this, 'default');\n const children: VNodeArrayChildren = [];\n if (this.loading) {\n children.push(h(YSpinnerRing, { width: '24', height: '24' }));\n }\n children.push(defaultSlot);\n return h('span', { class: 'y-button__content' }, children);\n },\n getClasses() {\n return this.classes;\n },\n /// Events\n onClick(e: MouseEvent) {\n e.preventDefault();\n if (this.loading) {\n return;\n }\n },\n },\n render() {\n const { onClick, styles, noWave, loading } = this;\n return withDirectives(\n h(\n 'button',\n {\n class: {\n ...this.getClasses(),\n [`${NAME}`]: true,\n },\n style: styles,\n onClick,\n '^disabled': this.disabled ? true : undefined,\n },\n this.createContent(),\n ),\n [[PlateWave, !noWave && !loading]],\n );\n },\n});\n\nexport type YButton = InstanceType<typeof YButton>;\n"],"mappings":"AACA,SAASA,eAAe,EAAEC,CAAC,EAAEC,cAAc,QAAQ,KAAK;AAAC,SAEhDC,SAAS;AAAA,SACTC,OAAO,EAAEC,YAAY;AAAA,SACrBC,YAAY;AAErB;AACA;AACA;AACA;AAAwB,SACfC,YAAY;AAErB,MAAMC,IAAI,GAAG,UAAU;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,YAAY,CAC3C;EACEK,OAAO,EAAEC,OAAO;EAChBC,QAAQ,EAAE;IACRC,IAAI,EAAEF;EACR,CAAC;EACD;EACAG,SAAS,EAAE;IACTD,IAAI,EAAEE;EACR,CAAC;EACDC,KAAK,EAAEL,OAAO;EACdM,IAAI,EAAEN,OAAO;EACbO,QAAQ,EAAE;IACRL,IAAI,EAAEF,OAAO;IACbQ,OAAO,EAAE;EACX,CAAC;EACDC,OAAO,EAAE;IACPP,IAAI,EAAEF,OAAO;IACbQ,OAAO,EAAE;EACX,CAAC;EACDE,MAAM,EAAE;IACNR,IAAI,EAAEF,OAAO;IACbQ,OAAO,EAAE;EACX,CAAC;EACDG,IAAI,EAAE;IACJT,IAAI,EAAEF;EACR,CAAC;EACD;EACAY,KAAK,EAAE;IACLV,IAAI,EAAEE;EACR,CAAC;EACDS,MAAM,EAAE;IACNX,IAAI,EAAEF,OAAO;IACbQ,OAAO,EAAE;EACX;AACF,CAAC,EACD,SACF,CAAC;AAED,OAAO,MAAM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AU,CAAC,CAAC;QACpB,CAAE,GAAEtC,IAAK,EAAC,GAAG;MACf,CAAC;MACD2C,KAAK,EAAEd,MAAM;MACbU,OAAO;MACP,WAAW,EAAE,IAAI,CAACnC,QAAQ,GAAG,IAAI,GAAGwC;IACtC,CAAC,EACD,IAAI,CAACb,aAAa,CAAC,CACrB,CAAC,EACD,CAAC,CAACpC,SAAS,EAAE,CAACqB,MAAM,IAAI,CAACd,OAAO,CAAC,CACnC,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YCard.mjs","names":["defineComponent","h","withDirectives","ThemeClass","name","props","outline","type","Boolean","render","theme","class","$slots","default","call"],"sources":["../../../src/components/card/YCard.ts"],"sourcesContent":["import type { Directive, PropType, VNode } from
|
|
1
|
+
{"version":3,"file":"YCard.mjs","names":["defineComponent","h","withDirectives","ThemeClass","name","props","outline","type","Boolean","render","theme","class","$slots","default","call"],"sources":["../../../src/components/card/YCard.ts"],"sourcesContent":["import type { Directive, PropType, VNode } from 'vue';\nimport { defineComponent, h, withDirectives } from 'vue';\n\nimport ThemeClass from '../../directives/theme-class';\n\nimport './YCard.scss';\n\nexport default defineComponent({\n name: 'y-card',\n props: {\n outline: {\n type: Boolean as PropType<boolean>,\n },\n },\n render(): VNode {\n const theme = ThemeClass as Directive;\n return withDirectives(\n h(\n 'div',\n {\n class: ['y-card'],\n },\n this.$slots.default?.call(this),\n ),\n [[theme]],\n );\n },\n});\n"],"mappings":"AACA,SAASA,eAAe,EAAEC,CAAC,EAAEC,cAAc,QAAQ,KAAK;AAAC,OAElDC,UAAU;AAEjB;AAEA,eAAeH,eAAe,CAAC;EAC7BI,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;IACLC,OAAO,EAAE;MACPC,IAAI,EAAEC;IACR;EACF,CAAC;EACDC,MAAMA,CAAA,EAAU;IACd,MAAMC,KAAK,GAAGP,UAAuB;IACrC,OAAOD,cAAc,CACnBD,CAAC,CACC,KAAK,EACL;MACEU,KAAK,EAAE,CAAC,QAAQ;IAClB,CAAC,EACD,IAAI,CAACC,MAAM,CAACC,OAAO,EAAEC,IAAI,CAAC,IAAI,CAChC,CAAC,EACD,CAAC,CAACJ,KAAK,CAAC,CACV,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -6,9 +6,10 @@ $card__padding: 24px;
|
|
|
6
6
|
|
|
7
7
|
.y-card {
|
|
8
8
|
--y-card__border-radius: #{$card__border-radius};
|
|
9
|
-
--y-
|
|
9
|
+
--y-card__default-background: 255, 255, 255;
|
|
10
|
+
--y-card__background: var(--y-theme-surface, var(--y-card__default-background));
|
|
10
11
|
|
|
11
|
-
background-color: var(--y-card__background);
|
|
12
|
+
background-color: rgba(var(--y-card__background), 1);
|
|
12
13
|
border-radius: var(--y-card__border-radius, $card__border-radius);
|
|
13
14
|
|
|
14
15
|
&__header {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
3
|
import { hasOwnProperty } from "../../util/common.mjs";
|
|
4
|
-
import { colorHexToRgb } from "../../util/ui.mjs";
|
|
5
4
|
import "./YChip.scss";
|
|
5
|
+
import { rgbFromHex } from "../../util/color/index.mjs";
|
|
6
6
|
export default defineComponent({
|
|
7
7
|
name: 'y-chip',
|
|
8
8
|
props: {
|
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
methods: {
|
|
40
40
|
colorRgb(color) {
|
|
41
41
|
if (color?.startsWith('#')) {
|
|
42
|
-
return
|
|
42
|
+
return rgbFromHex(color)?.join(',') || '';
|
|
43
43
|
}
|
|
44
44
|
const RGBA_REGEX = /rgb(a?)\((?<v>.*)\)/;
|
|
45
45
|
if (RGBA_REGEX.test(color)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YChip.mjs","names":["defineComponent","hasOwnProperty","
|
|
1
|
+
{"version":3,"file":"YChip.mjs","names":["defineComponent","hasOwnProperty","rgbFromHex","name","props","color","String","background","small","Boolean","bgOpacity","type","Number","default","computed","clickable","$attrs","classes","backgroundColor","colorRgb","styles","methods","startsWith","join","RGBA_REGEX","test","value","exec","valueArray","trim","split","splice","render","_createVNode","$slots"],"sources":["../../../src/components/chip/YChip.tsx"],"sourcesContent":["import { defineComponent } from 'vue';\n\nimport { hasOwnProperty } from '../../util/common';\n\nimport './YChip.scss';\nimport { rgbFromHex } from \"../../util/color\";\n\nexport default defineComponent({\n name: 'y-chip',\n props: {\n color: String,\n background: String,\n small: Boolean,\n bgOpacity: {\n type: Number,\n default: 0.14,\n },\n },\n computed: {\n clickable() {\n return hasOwnProperty(this.$attrs, 'onClick');\n },\n classes() {\n return {\n 'y-chip': true,\n 'y-chip--small': this.small,\n 'y-chip--clickable': this.clickable,\n };\n },\n backgroundColor() {\n const color = (this.background as string) ?? this.color;\n return this.colorRgb(color);\n },\n styles() {\n return {\n color: this.color,\n background: `rgba(${this.backgroundColor}, ${this.bgOpacity})`,\n };\n },\n },\n methods: {\n colorRgb(color: string): string {\n if (color?.startsWith('#')) {\n return rgbFromHex(color)?.join(',') || '';\n }\n const RGBA_REGEX = /rgb(a?)\\((?<v>.*)\\)/;\n if (RGBA_REGEX.test(color)) {\n const value = RGBA_REGEX.exec(color)?.[2] || '';\n if (value) {\n const valueArray = value.trim().split(',');\n valueArray.splice(3, 1);\n return valueArray.join(',');\n }\n }\n return '';\n },\n },\n render() {\n const { classes, styles } = this;\n return (\n <span class={classes} style={styles}>\n <span class=\"y-chip__content\">\n {this.$slots.default?.()}\n </span>\n </span>\n );\n },\n});\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,KAAK;AAAC,SAE7BC,cAAc;AAEvB;AAAsB,SACbC,UAAU;AAEnB,eAAeF,eAAe,CAAC;EAC7BG,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;IACLC,KAAK,EAAEC,MAAM;IACbC,UAAU,EAAED,MAAM;IAClBE,KAAK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,CAAC;UACvB,OAAOH,UAAU,CAACL,IAAI,CAAC,GAAG,CAAC;QAC7B;MACF;MACA,OAAO,EAAE;IACX;EACF,CAAC;EACDS,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEf,OAAO;MAAEG;IAAO,CAAC,GAAG,IAAI;IAChC,OAAAa,YAAA;MAAA,SACehB,OAAO;MAAA,SAASG;IAAM,IAAAa,YAAA;MAAA,SACrB;IAAiB,IAC1B,IAAI,CAACC,MAAM,CAACrB,OAAO,GAAG,CAAC;EAIhC;AACF,CAAC,CAAC"}
|
|
@@ -16,7 +16,7 @@ export const YDialog = defineComponent({
|
|
|
16
16
|
modelValue: {
|
|
17
17
|
type: Boolean
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
modal: {
|
|
20
20
|
type: Boolean
|
|
21
21
|
},
|
|
22
22
|
dialogClasses: {
|
|
@@ -88,7 +88,7 @@ export const YDialog = defineComponent({
|
|
|
88
88
|
"onUpdate:modelValue": $event => active.value = $event,
|
|
89
89
|
"scrim": true,
|
|
90
90
|
"classes": classes.value,
|
|
91
|
-
"
|
|
91
|
+
"modal": props.modal,
|
|
92
92
|
"ref": layer
|
|
93
93
|
}, {
|
|
94
94
|
default: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YDialog.mjs","names":["computed","defineComponent","ref","watch","useRender","bindClasses","YCard","YLayer","useModelDuplex","YDialog","name","components","props","modelValue","type","Boolean","
|
|
1
|
+
{"version":3,"file":"YDialog.mjs","names":["computed","defineComponent","ref","watch","useRender","bindClasses","YCard","YLayer","useModelDuplex","YDialog","name","components","props","modelValue","type","Boolean","modal","dialogClasses","Array","String","Object","disabled","emits","setup","_ref","emit","slots","active","classes","boundClasses","layer","onFocusin","e","prevTarget","relatedTarget","target","value","content$","document","includes","contains","focusableSelector","focusables","querySelectorAll","filter","el","hasAttribute","matches","length","firstChild","lastChild","focus","installFocusTrap","addEventListener","dismantleFocusTrap","removeEventListener","onUpdate","v","onClick","currentActive","baseEl","neo","old","immediate","_createVNode","_Fragment","$event","default","_len","arguments","args","_key","base"],"sources":["../../../src/components/dialog/YDialog.tsx"],"sourcesContent":["import type { PropType } from 'vue';\nimport { computed, defineComponent, ref, watch } from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { bindClasses } from '../../util/vue-component';\nimport { YCard } from '../card';\nimport { YLayer } from '../layer';\n\nimport './YDialog.scss';\nimport { useModelDuplex } from \"../../composables/communication\";\n\nexport const YDialog = defineComponent({\n name: 'YDialog',\n components: {\n YLayer,\n YCard,\n },\n props: {\n modelValue: {\n type: Boolean as PropType<boolean>,\n },\n modal: {\n type: Boolean,\n },\n dialogClasses: {\n type: [Array, String, Object] as PropType<\n string[] | string | Record<string, any>\n >,\n },\n disabled: Boolean,\n },\n emits: ['update:modelValue'],\n setup(props, { emit, slots }) {\n const active = useModelDuplex(props);\n\n const classes = computed(() => {\n const boundClasses = bindClasses(props.dialogClasses);\n return {\n ...boundClasses,\n 'y-dialog': true,\n };\n });\n\n const layer = ref<typeof YLayer>();\n\n function onFocusin(e: FocusEvent) {\n const prevTarget = e.relatedTarget as HTMLElement | null;\n const target = e.target as HTMLElement | null;\n if (\n prevTarget !== target &&\n layer.value?.content$ &&\n ![document, layer.value?.content$].includes(target) &&\n !layer.value?.content$.contains(target)\n ) {\n const focusableSelector =\n 'button, [href], input:not([type=\"hidden\"]), select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n const focusables = [\n ...layer.value.content$.querySelectorAll(focusableSelector),\n ].filter(\n (el) =>\n !el.hasAttribute('disabled') && !el.matches('[tabindex=\"-1\"]'),\n ) as HTMLElement[];\n if (!focusables.length) return;\n const firstChild = focusables[0];\n const lastChild = focusables[focusables.length - 1];\n if (firstChild === lastChild) {\n lastChild.focus();\n } else {\n firstChild.focus();\n }\n }\n }\n\n function installFocusTrap() {\n document.addEventListener('focusin', onFocusin);\n }\n\n function dismantleFocusTrap() {\n document.removeEventListener('focusin', onFocusin);\n }\n\n function onUpdate(v: boolean) {\n active.value = v;\n }\n\n function onClick(e: MouseEvent) {\n const currentActive = active.value;\n if (!props.disabled) {\n active.value = !currentActive;\n }\n }\n\n watch(() => layer.value?.baseEl, (neo, old) => {\n if (neo) {\n neo.addEventListener('click', onClick);\n } else if (old) {\n old.removeEventListener('click', onClick);\n }\n });\n\n watch(\n () => active.value,\n (neo) => {\n neo ? installFocusTrap() : dismantleFocusTrap();\n },\n { immediate: true },\n );\n\n useRender(() => {\n return (\n <>\n <YLayer\n v-model={active.value}\n scrim\n classes={classes.value}\n modal={props.modal}\n ref={layer}\n >\n {{\n default: (...args: any[]) => slots.default?.(...args),\n base: slots.base\n }}\n </YLayer>\n </>\n );\n });\n\n return {\n active,\n layer,\n classes,\n };\n },\n});\n"],"mappings":";AACA,SAASA,QAAQ,EAAEC,eAAe,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAEnDC,SAAS;AAAA,SACTC,WAAW;AAAA,SACXC,KAAK;AAAA,SACLC,MAAM;AAEf;AAAwB,SACfC,cAAc;AAEvB,OAAO,MAAMC,OAAO,GAAGR,eAAe,CAAC;EACrCS,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE;IACVJ,MAAM;IACND;EACF,CAAC;EACDM,KAAK,EAAE;IACLC,UAAU,EAAE;MACVC,IAAI,EAAEC;IACR,CAAC;IACDC,KAAK,EAAE;MACLF,IAAI,EAAEC;IACR,CAAC;IACDE,aAAa,EAAE;MACbH,IAAI,EAAE,CAACI,KAAK,EAAEC,MAAM,EAAEC,MAAM;IAG9B,CAAC;IACDC,QAAQ,EAAEN;EACZ,CAAC;EACDO,KAAK,EAAE,CAAC,mBAAmB,CAAC;EAC5BC,KAAKA,CAACX,KAAK,EAAAY,IAAA,EAAmB;IAAA,IAAjB;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAAF,IAAA;IAC1B,MAAMG,MAAM,GAAGnB,cAAc,CAACI,KAAK,CAAC;IAEpC,MAAMgB,OAAO,GAAG5B,QA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AC,IAAA,GAAAC,SAAA,CAAArB,MAAA,EAAIsB,IAAI,OAAApD,KAAA,CAAAkD,IAAA,GAAAG,IAAA,MAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA;YAAJD,IAAI,CAAAC,IAAA,IAAAF,SAAA,CAAAE,IAAA;UAAA;UAAA,OAAY7C,KAAK,CAACyC,OAAO,GAAG,GAAGG,IAAI,CAAC;QAAA;QACrDE,IAAI,EAAE9C,KAAK,CAAC8C;MAAI;IAK1B,CAAC,CAAC;IAEF,OAAO;MACL7C,MAAM;MACNG,KAAK;MACLF;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,88 @@
|
|
|
1
|
+
import { createTextVNode as _createTextVNode, mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from "vue";
|
|
1
2
|
import { defineComponent } from 'vue';
|
|
3
|
+
import { pressItemsPropsOptions } from "../../abstract/items.mjs";
|
|
4
|
+
import { useModelDuplex } from "../../composables/communication.mjs";
|
|
5
|
+
import { useRender } from "../../composables/component.mjs";
|
|
6
|
+
import { pressCoordinateProps } from "../../composables/coordinate/index.mjs";
|
|
7
|
+
import { getObjectValueByPath, omit } from "../../util/common.mjs";
|
|
2
8
|
import { propsFactory } from "../../util/vue-component.mjs";
|
|
3
|
-
|
|
9
|
+
import { YButton } from "../button/index.mjs";
|
|
10
|
+
import { YCard } from "../card/index.mjs";
|
|
11
|
+
import { YIconDropdown } from "../icons/YIconDropdown.mjs";
|
|
12
|
+
import { YList, YListItem } from "../list/index.mjs";
|
|
13
|
+
import { YMenu } from "../menu/index.mjs";
|
|
14
|
+
import "./YDropdown.scss";
|
|
15
|
+
export const pressYDropdownPropsOptions = propsFactory({
|
|
16
|
+
modelValue: Boolean,
|
|
17
|
+
variation: String,
|
|
18
|
+
color: String,
|
|
19
|
+
...omit(pressCoordinateProps({
|
|
20
|
+
position: 'bottom'
|
|
21
|
+
}), ['coordinateStrategy']),
|
|
22
|
+
...pressItemsPropsOptions()
|
|
23
|
+
}, 'YDropdown');
|
|
4
24
|
export const YDropdown = defineComponent({
|
|
5
|
-
name: 'YDropdown'
|
|
25
|
+
name: 'YDropdown',
|
|
26
|
+
inheritAttrs: false,
|
|
27
|
+
components: {
|
|
28
|
+
YMenu
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
...pressYDropdownPropsOptions()
|
|
32
|
+
},
|
|
33
|
+
emits: ['update:modelValue', 'click'],
|
|
34
|
+
setup(props, _ref) {
|
|
35
|
+
let {
|
|
36
|
+
slots,
|
|
37
|
+
attrs,
|
|
38
|
+
emit
|
|
39
|
+
} = _ref;
|
|
40
|
+
const opened = useModelDuplex(props);
|
|
41
|
+
function onClickItem(item) {
|
|
42
|
+
opened.value = false;
|
|
43
|
+
emit('click', item);
|
|
44
|
+
}
|
|
45
|
+
useRender(() => {
|
|
46
|
+
return _createVNode(_Fragment, null, [_createVNode(YMenu, {
|
|
47
|
+
"modelValue": opened.value,
|
|
48
|
+
"onUpdate:modelValue": $event => opened.value = $event,
|
|
49
|
+
"position": props.position,
|
|
50
|
+
"content-classes": ['y-dropdown__content']
|
|
51
|
+
}, {
|
|
52
|
+
base: function () {
|
|
53
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
54
|
+
args[_key] = arguments[_key];
|
|
55
|
+
}
|
|
56
|
+
return slots.base ? slots.base?.(...args) : _createVNode(YButton, _mergeProps({
|
|
57
|
+
"variation": props.variation,
|
|
58
|
+
"color": props.color,
|
|
59
|
+
"class": ['y-dropdown', {
|
|
60
|
+
'y-dropdown--opened': opened.value
|
|
61
|
+
}]
|
|
62
|
+
}, attrs), {
|
|
63
|
+
default: () => [_createVNode("span", {
|
|
64
|
+
"class": "y-dropdown__default"
|
|
65
|
+
}, [slots.default?.()]), slots['expand-icon'] ? slots['expand-icon']() : _createVNode("i", {
|
|
66
|
+
"class": "y-dropdown__icon"
|
|
67
|
+
}, [_createVNode(YIconDropdown, null, null)])]
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
default: () => slots.menu ? slots.menu() : _createVNode(YCard, null, {
|
|
71
|
+
default: () => [Array.isArray(props.items) && props.items.length > 0 ? _createVNode(YList, null, {
|
|
72
|
+
default: () => [props.items.map(item => {
|
|
73
|
+
const text = getObjectValueByPath(item, props.itemText);
|
|
74
|
+
return _createVNode(YListItem, {
|
|
75
|
+
"onClick": e => onClickItem(item)
|
|
76
|
+
}, {
|
|
77
|
+
default: () => [text]
|
|
78
|
+
});
|
|
79
|
+
})]
|
|
80
|
+
}) : _createVNode("div", {
|
|
81
|
+
"class": "pa-4"
|
|
82
|
+
}, [_createTextVNode("\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")])]
|
|
83
|
+
})
|
|
84
|
+
})]);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
6
87
|
});
|
|
7
88
|
//# sourceMappingURL=YDropdown.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YDropdown.mjs","names":["defineComponent","propsFactory","pressYDropdownPropsOptions","YDropdown","name"],"sources":["../../../src/components/dropdown/YDropdown.tsx"],"sourcesContent":["import { defineComponent } from 'vue';\nimport { propsFactory } from
|
|
1
|
+
{"version":3,"file":"YDropdown.mjs","names":["defineComponent","pressItemsPropsOptions","useModelDuplex","useRender","pressCoordinateProps","getObjectValueByPath","omit","propsFactory","YButton","YCard","YIconDropdown","YList","YListItem","YMenu","pressYDropdownPropsOptions","modelValue","Boolean","variation","String","color","position","YDropdown","name","inheritAttrs","components","props","emits","setup","_ref","slots","attrs","emit","opened","onClickItem","item","value","_createVNode","_Fragment","$event","base","_len","arguments","length","args","Array","_key","_mergeProps","default","menu","isArray","items","map","text","itemText","e","_createTextVNode"],"sources":["../../../src/components/dropdown/YDropdown.tsx"],"sourcesContent":["import { PropType, defineComponent } from 'vue';\n\nimport { pressItemsPropsOptions } from '../../abstract/items';\nimport { useModelDuplex } from '../../composables/communication';\nimport { useRender } from '../../composables/component';\nimport { pressCoordinateProps } from '../../composables/coordinate';\nimport { getObjectValueByPath, omit } from '../../util/common';\nimport { propsFactory } from '../../util/vue-component';\nimport { YButton } from '../button';\nimport { YCard } from '../card';\nimport { YIconDropdown } from '../icons/YIconDropdown';\nimport { YList, YListItem } from '../list';\nimport { YMenu } from '../menu';\n\nimport './YDropdown.scss';\n\nexport const pressYDropdownPropsOptions = propsFactory(\n {\n modelValue: Boolean as PropType<boolean>,\n variation: String as PropType<string>,\n color: String as PropType<string>,\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\n 'coordinateStrategy',\n ]),\n ...pressItemsPropsOptions(),\n },\n 'YDropdown',\n);\n\nexport const YDropdown = defineComponent({\n name: 'YDropdown',\n inheritAttrs: false,\n components: {\n YMenu,\n },\n props: {\n ...pressYDropdownPropsOptions(),\n },\n emits: ['update:modelValue', 'click'],\n setup(props, { slots, attrs, emit }) {\n const opened = useModelDuplex(props);\n\n function onClickItem(item: any) {\n opened.value = false;\n emit('click', item);\n }\n\n useRender(() => {\n return (\n <>\n <YMenu\n v-model={opened.value}\n position={props.position}\n content-classes={['y-dropdown__content']}\n >\n {{\n base: (...args: any[]) =>\n slots.base ? (\n slots.base?.(...args)\n ) : (\n <YButton\n variation={props.variation}\n color={props.color}\n class={[\n 'y-dropdown',\n { 'y-dropdown--opened': opened.value },\n ]}\n {...attrs}\n >\n {\n <span class=\"y-dropdown__default\">\n {slots.default?.()}\n </span>\n }\n {slots['expand-icon'] ? (\n slots['expand-icon']()\n ) : (\n <i class=\"y-dropdown__icon\">\n <YIconDropdown></YIconDropdown>\n </i>\n )}\n </YButton>\n ),\n default: () =>\n slots.menu ? (\n slots.menu()\n ) : (\n <YCard>\n {Array.isArray(props.items) && props.items.length > 0 ? (\n <YList>\n {props.items.map((item) => {\n const text = getObjectValueByPath(\n item,\n props.itemText,\n );\n return (\n <YListItem onClick={(e) => onClickItem(item)}>\n {text}\n </YListItem>\n );\n })}\n </YList>\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ACyB,KAAK,CAACR,MAAM,GAAG,CAAC,GAAAN,YAAA,CAAAzB,KAAA;YAAAoC,OAAA,EAAAA,CAAA,MAEhDtB,KAAK,CAACyB,KAAK,CAACC,GAAG,CAAEjB,IAAI,IAAK;cACzB,MAAMkB,IAAI,GAAG/C,oBAAoB,CAC/B6B,IAAI,EACJT,KAAK,CAAC4B,QACR,CAAC;cACD,OAAAjB,YAAA,CAAAxB,SAAA;gBAAA,WACuB0C,CAAC,IAAKrB,WAAW,CAACC,IAAI;cAAC;gBAAAa,OAAA,EAAAA,CAAA,MACzCK,IAAI;cAAA;YAGX,CAAC,CAAC;UAAA,KAAAhB,YAAA;YAAA,SAGO;UAAM,IAAAmB,gBAAA,kDAClB;QAAA;MAEJ;IAKb,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.y-dropdown {
|
|
2
|
+
.y-button__content {
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&__default {
|
|
7
|
+
flex-grow: 1;
|
|
8
|
+
text-align: left;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&__icon {
|
|
12
|
+
transition: 200ms ease;
|
|
13
|
+
width: 1.5em;
|
|
14
|
+
height: 1.5em;
|
|
15
|
+
|
|
16
|
+
> svg {
|
|
17
|
+
width: 1.5em;
|
|
18
|
+
height: 1.5em;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--opened &__icon {
|
|
23
|
+
transform: rotate3d(1, 0, 0, 180deg) translateY(0.1em);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
&__content {
|
|
28
|
+
> .y-card {
|
|
29
|
+
padding-top: 8px;
|
|
30
|
+
padding-bottom: 8px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
import { computed, defineComponent, getCurrentInstance, h, nextTick, ref, toRef, watch } from 'vue';
|
|
2
|
+
import { useRender } from "../../composables/component.mjs";
|
|
3
|
+
import { useFocus } from "../../composables/focus.mjs";
|
|
4
|
+
import { chooseProps, propsFactory } from "../../util/vue-component.mjs";
|
|
2
5
|
import { YIconClear } from "../icons/YIconClear.mjs";
|
|
3
|
-
import { YInput,
|
|
6
|
+
import { YInput, pressYInputPropsOptions } from "../input/index.mjs";
|
|
4
7
|
import "./YFieldInput.scss";
|
|
5
8
|
const NAME = 'y-field-input';
|
|
9
|
+
export const pressYFieldInputPropsOptions = propsFactory({
|
|
10
|
+
enableClear: Boolean,
|
|
11
|
+
inputAlign: String,
|
|
12
|
+
displayText: [String, Function],
|
|
13
|
+
whenInputValid: [Boolean, Number],
|
|
14
|
+
tabindex: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '0'
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'text'
|
|
21
|
+
},
|
|
22
|
+
...pressYInputPropsOptions({
|
|
23
|
+
variation: 'filled'
|
|
24
|
+
})
|
|
25
|
+
}, 'YFieldInput');
|
|
6
26
|
export const YFieldInput = defineComponent({
|
|
7
27
|
name: 'YFieldInput',
|
|
8
28
|
props: {
|
|
9
|
-
...
|
|
10
|
-
clearable: Boolean,
|
|
11
|
-
inputAlign: String,
|
|
12
|
-
displayText: [String, Function],
|
|
13
|
-
whenInputValid: [Boolean, Number],
|
|
14
|
-
tabindex: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: '0'
|
|
17
|
-
},
|
|
18
|
-
type: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: 'text'
|
|
21
|
-
}
|
|
29
|
+
...pressYFieldInputPropsOptions()
|
|
22
30
|
},
|
|
23
|
-
emits: ['update:modelValue', 'input', 'change', 'click', 'mousedown', 'mouseup', 'keydown', 'keyup', 'focus', 'blur'],
|
|
31
|
+
emits: ['update:modelValue', 'update:focused', 'input', 'change', 'click', 'mousedown', 'mouseup', 'keydown', 'keyup', 'focus', 'blur', 'mousedown:display'],
|
|
24
32
|
setup(props, _ref) {
|
|
25
33
|
let {
|
|
26
34
|
attrs,
|
|
@@ -30,14 +38,16 @@ export const YFieldInput = defineComponent({
|
|
|
30
38
|
} = _ref;
|
|
31
39
|
const yInputRef = ref();
|
|
32
40
|
const inputRef = ref();
|
|
33
|
-
const
|
|
41
|
+
const {
|
|
42
|
+
focused,
|
|
43
|
+
whenFocus,
|
|
44
|
+
whenBlur
|
|
45
|
+
} = useFocus(props, 'y-field-input');
|
|
34
46
|
const inValue = ref('');
|
|
35
47
|
const displayValue = ref('');
|
|
36
48
|
const inputType = toRef(props, 'type');
|
|
37
49
|
const classes = computed(() => {
|
|
38
50
|
return {
|
|
39
|
-
...(yInputRef.value?.classes || {}),
|
|
40
|
-
'y-input--focused': isFocused.value,
|
|
41
51
|
[NAME]: true
|
|
42
52
|
};
|
|
43
53
|
});
|
|
@@ -49,12 +59,12 @@ export const YFieldInput = defineComponent({
|
|
|
49
59
|
emit('click', event);
|
|
50
60
|
}
|
|
51
61
|
function onFocus(event) {
|
|
52
|
-
|
|
62
|
+
whenFocus();
|
|
53
63
|
displayValue.value = inValue.value;
|
|
54
64
|
emit('focus', event);
|
|
55
65
|
}
|
|
56
66
|
function onBlur(event) {
|
|
57
|
-
|
|
67
|
+
whenBlur();
|
|
58
68
|
invokeValidators();
|
|
59
69
|
emit('blur', event);
|
|
60
70
|
changeDisplay();
|
|
@@ -121,7 +131,7 @@ export const YFieldInput = defineComponent({
|
|
|
121
131
|
immediate: true
|
|
122
132
|
});
|
|
123
133
|
watch(inValue, neo => {
|
|
124
|
-
if (!
|
|
134
|
+
if (!focused.value) {
|
|
125
135
|
changeDisplay();
|
|
126
136
|
} else {
|
|
127
137
|
displayValue.value = neo;
|
|
@@ -133,42 +143,37 @@ export const YFieldInput = defineComponent({
|
|
|
133
143
|
clear,
|
|
134
144
|
inputRef
|
|
135
145
|
});
|
|
136
|
-
const yInputProps = () => {
|
|
137
|
-
const ret = {};
|
|
138
|
-
for (const propKey in YInputProps) {
|
|
139
|
-
ret[propKey] = props[propKey];
|
|
140
|
-
}
|
|
141
|
-
return ret;
|
|
142
|
-
};
|
|
143
146
|
function onUpdateModel(value) {
|
|
144
147
|
emit('update:modelValue', value);
|
|
145
148
|
}
|
|
146
|
-
|
|
149
|
+
useRender(() => h(YInput, {
|
|
147
150
|
class: classes.value,
|
|
148
151
|
ref: yInputRef,
|
|
149
|
-
...
|
|
152
|
+
...chooseProps(props, YInput.props),
|
|
150
153
|
modelValue: inValue.value,
|
|
151
154
|
'onUpdate:modelValue': onUpdateModel,
|
|
152
|
-
onClick
|
|
155
|
+
onClick,
|
|
156
|
+
focused: focused.value,
|
|
157
|
+
'onMousedown:display': $event => emit('mousedown:display', $event)
|
|
153
158
|
}, {
|
|
154
|
-
|
|
155
|
-
const
|
|
159
|
+
leading: slots.leading ? function () {
|
|
160
|
+
const leadingChildren = [];
|
|
156
161
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
157
162
|
args[_key] = arguments[_key];
|
|
158
163
|
}
|
|
159
|
-
const slot = slots.
|
|
164
|
+
const slot = slots.leading?.(...args);
|
|
160
165
|
if (slot) {
|
|
161
|
-
|
|
166
|
+
leadingChildren.push(slot);
|
|
162
167
|
} else {
|
|
163
168
|
return undefined;
|
|
164
169
|
}
|
|
165
|
-
return
|
|
170
|
+
return leadingChildren;
|
|
166
171
|
} : undefined,
|
|
167
172
|
default: defaultProps => h('div', {
|
|
168
173
|
class: `${NAME}__field`,
|
|
169
174
|
'data-id': defaultProps.attrId,
|
|
170
175
|
ref: 'field'
|
|
171
|
-
}, [YInput.methods.createLabel.call(yInputRef), h('input', {
|
|
176
|
+
}, [YInput.methods.createLabel.call(yInputRef), slots.default?.(), h('input', {
|
|
172
177
|
'.value': displayValue.value,
|
|
173
178
|
'.id': defaultProps.attrId,
|
|
174
179
|
'^type': inputType.value,
|
|
@@ -189,11 +194,11 @@ export const YFieldInput = defineComponent({
|
|
|
189
194
|
},
|
|
190
195
|
ref: inputRef
|
|
191
196
|
})]),
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
if (props.
|
|
195
|
-
|
|
196
|
-
class: 'y-
|
|
197
|
+
trailing: () => {
|
|
198
|
+
const trailingChildren = [];
|
|
199
|
+
if (props.enableClear && inValue.value) {
|
|
200
|
+
trailingChildren.push(h('div', {
|
|
201
|
+
class: 'y-input__trailing y-input__trailing--clear'
|
|
197
202
|
}, [h('button', {
|
|
198
203
|
class: `${NAME}__clear`,
|
|
199
204
|
onClick: onClickClear,
|
|
@@ -201,18 +206,21 @@ export const YFieldInput = defineComponent({
|
|
|
201
206
|
'^tabindex': '2'
|
|
202
207
|
}, [h(YIconClear)])]));
|
|
203
208
|
}
|
|
204
|
-
const slot = slots.
|
|
209
|
+
const slot = slots.trailing;
|
|
205
210
|
if (slot) {
|
|
206
|
-
|
|
207
|
-
class: 'y-
|
|
211
|
+
trailingChildren.push(h('div', {
|
|
212
|
+
class: 'y-input__trailing'
|
|
208
213
|
}, slot()));
|
|
209
214
|
}
|
|
210
|
-
return
|
|
215
|
+
return trailingChildren;
|
|
211
216
|
},
|
|
212
217
|
'helper-text': () => {
|
|
213
218
|
return slots['helper-text']?.();
|
|
214
219
|
}
|
|
215
|
-
});
|
|
220
|
+
}));
|
|
221
|
+
return {
|
|
222
|
+
focused
|
|
223
|
+
};
|
|
216
224
|
}
|
|
217
225
|
});
|
|
218
226
|
//# sourceMappingURL=YFieldInput.mjs.map
|