yuyeon 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/yuyeon.js +5882 -5489
  3. package/dist/yuyeon.umd.cjs +3 -3
  4. package/lib/components/alert/YAlert.mjs +59 -10
  5. package/lib/components/alert/YAlert.mjs.map +1 -1
  6. package/lib/components/alert/YAlert.scss +76 -0
  7. package/lib/components/alert/index.mjs +1 -1
  8. package/lib/components/alert/index.mjs.map +1 -1
  9. package/lib/components/button/YButton.mjs +79 -74
  10. package/lib/components/button/YButton.mjs.map +1 -1
  11. package/lib/components/button/YButton.scss +1 -1
  12. package/lib/components/card/YCard.scss +1 -1
  13. package/lib/components/checkbox/YCheckbox.mjs +6 -6
  14. package/lib/components/checkbox/YCheckbox.mjs.map +1 -1
  15. package/lib/components/checkbox/YCheckbox.scss +48 -48
  16. package/lib/components/checkbox/YInputCheckbox.scss +3 -3
  17. package/lib/components/dropdown/YDropdown.mjs.map +1 -1
  18. package/lib/components/field-input/YFieldInput.scss +1 -10
  19. package/lib/components/index.mjs +2 -0
  20. package/lib/components/index.mjs.map +1 -1
  21. package/lib/components/input/YInput.scss +1 -1
  22. package/lib/components/select/YSelect.mjs.map +1 -1
  23. package/lib/components/switch/YSwitch.scss +1 -1
  24. package/lib/components/tab/YTab.mjs +57 -7
  25. package/lib/components/tab/YTab.mjs.map +1 -1
  26. package/lib/components/tab/YTab.scss +59 -0
  27. package/lib/components/tab/YTabs.mjs +50 -8
  28. package/lib/components/tab/YTabs.mjs.map +1 -1
  29. package/lib/components/tab/YTabs.scss +10 -0
  30. package/lib/components/tab/index.mjs +1 -0
  31. package/lib/components/tab/index.mjs.map +1 -1
  32. package/lib/components/tab/shared.mjs +2 -0
  33. package/lib/components/tab/shared.mjs.map +1 -0
  34. package/lib/components/tab/types.mjs +2 -0
  35. package/lib/components/tab/types.mjs.map +1 -0
  36. package/lib/components/table/YTable.scss +3 -2
  37. package/lib/components/toggle-button/YToggleButton.mjs +2 -0
  38. package/lib/components/toggle-button/YToggleButton.mjs.map +1 -0
  39. package/lib/components/toggle-button/index.mjs +2 -0
  40. package/lib/components/toggle-button/index.mjs.map +1 -0
  41. package/lib/components/tooltip/YTooltip.mjs +3 -3
  42. package/lib/components/tooltip/YTooltip.mjs.map +1 -1
  43. package/lib/components/tree-view/YTreeView.mjs +1 -1
  44. package/lib/components/tree-view/YTreeView.mjs.map +1 -1
  45. package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
  46. package/lib/composables/choice.mjs +1 -1
  47. package/lib/composables/choice.mjs.map +1 -1
  48. package/lib/composables/communication.mjs +1 -1
  49. package/lib/composables/communication.mjs.map +1 -1
  50. package/lib/composables/index.mjs +2 -0
  51. package/lib/composables/index.mjs.map +1 -0
  52. package/lib/composables/theme/setting.mjs +16 -2
  53. package/lib/composables/theme/setting.mjs.map +1 -1
  54. package/lib/composables/timing.mjs.map +1 -1
  55. package/lib/composables/vue-router.mjs +32 -0
  56. package/lib/composables/vue-router.mjs.map +1 -0
  57. package/lib/styles/_palette.scss +1 -90
  58. package/lib/styles/_variables.scss +2 -0
  59. package/lib/styles/base.scss +4 -1
  60. package/lib/styles/theme/dark.scss +11 -21
  61. package/lib/styles/theme/light.scss +11 -21
  62. package/lib/util/index.mjs +16 -0
  63. package/lib/util/index.mjs.map +1 -0
  64. package/lib/util/reactivity.mjs +5 -0
  65. package/lib/util/reactivity.mjs.map +1 -1
  66. package/lib/util/vue-component.mjs +24 -0
  67. package/lib/util/vue-component.mjs.map +1 -1
  68. package/package.json +11 -1
  69. package/types/components/alert/YAlert.d.ts +18 -0
  70. package/types/components/alert/index.d.ts +1 -0
  71. package/types/components/button/YButton.d.ts +96 -42
  72. package/types/components/checkbox/YInputCheckbox.d.ts +1 -1
  73. package/types/components/dropdown/YDropdown.d.ts +3 -3
  74. package/types/components/field-input/YFieldInput.d.ts +26 -44
  75. package/types/components/index.d.ts +2 -0
  76. package/types/components/input/YInput.d.ts +16 -16
  77. package/types/components/layer/YLayer.d.ts +8 -8
  78. package/types/components/list/YList.d.ts +2 -2
  79. package/types/components/list/YListItem.d.ts +3 -3
  80. package/types/components/pagination/YPagination.d.ts +6 -6
  81. package/types/components/select/YSelect.d.ts +35 -53
  82. package/types/components/tab/YTab.d.ts +282 -7
  83. package/types/components/tab/YTabs.d.ts +111 -3
  84. package/types/components/tab/index.d.ts +1 -0
  85. package/types/components/tab/shared.d.ts +3 -0
  86. package/types/components/tab/types.d.ts +4 -0
  87. package/types/components/table/YDataTable.d.ts +7 -7
  88. package/types/components/table/YDataTableHead.d.ts +3 -3
  89. package/types/components/table/YDataTableRow.d.ts +3 -3
  90. package/types/components/table/YDataTableServer.d.ts +7 -7
  91. package/types/components/table/composibles/items.d.ts +1 -1
  92. package/types/components/table/composibles/selection.d.ts +1 -1
  93. package/types/components/table/composibles/sorting.d.ts +1 -1
  94. package/types/components/toggle-button/YToggleButton.d.ts +3 -0
  95. package/types/components/toggle-button/index.d.ts +1 -0
  96. package/types/components/tree-view/YTreeViewNode.d.ts +6 -6
  97. package/types/composables/choice.d.ts +107 -0
  98. package/types/composables/dimension.d.ts +6 -6
  99. package/types/composables/focus.d.ts +2 -2
  100. package/types/composables/list-items.d.ts +1 -1
  101. package/types/composables/theme/index.d.ts +1 -1
  102. package/types/composables/vue-router.d.ts +43 -0
  103. package/types/shims.d.ts +7 -1
  104. package/types/util/collection.d.ts +1 -0
  105. package/types/util/frame-scheduler.d.ts +7 -0
  106. package/types/util/index.d.ts +15 -0
  107. package/types/util/reactivity.d.ts +4 -0
  108. package/types/util/validation.d.ts +3 -0
  109. package/types/util/vue-component.d.ts +8 -4
@@ -1,48 +1,48 @@
1
- @use '../../styles/palette';
2
-
3
- $checkbox__label-color: #585858 !default;
4
-
5
- .y-checkbox {
6
- display: flex;
7
- align-items: center;
8
-
9
- &__slot {
10
- display: flex;
11
- flex-direction: row;
12
- align-items: center;
13
- }
14
-
15
- .y-checkbox__label {
16
- cursor: pointer;
17
- font-weight: 400;
18
- color: $checkbox__label-color;
19
- font-size: 14px;
20
- }
21
-
22
- &--reverse .y-checkbox__slot {
23
- flex-direction: row-reverse;
24
- }
25
-
26
- &:not(&--reverse) .y-input--checkbox {
27
- margin-right: 8px;
28
- }
29
-
30
- &--reverse .y-input--checkbox {
31
- margin-left: 8px;
32
- }
33
-
34
- &--readonly,
35
- &--disabled {
36
- .y-checkbox__label,
37
- .y-input--checkbox {
38
- cursor: default;
39
- }
40
- }
41
-
42
- &--disabled {
43
- .y-checkbox__slot {
44
- filter: grayscale(1);
45
- opacity: 0.4;
46
- }
47
- }
48
- }
1
+ .y-checkbox {
2
+ display: flex;
3
+ align-items: center;
4
+
5
+ &__slot {
6
+ display: flex;
7
+ flex-direction: row;
8
+ align-items: center;
9
+ }
10
+
11
+ .y-checkbox__label {
12
+ cursor: pointer;
13
+ font-weight: 400;
14
+ color: var(--y-theme-on-surface-variant);
15
+ font-size: 14px;
16
+ }
17
+
18
+ &--reverse .y-checkbox__slot {
19
+ flex-direction: row-reverse;
20
+ }
21
+
22
+ &:not(&--reverse) .y-input--checkbox {
23
+ margin-right: 8px;
24
+ }
25
+
26
+ .y-input--checkbox {
27
+ cursor: pointer;
28
+ }
29
+
30
+ &--reverse .y-input--checkbox {
31
+ margin-left: 8px;
32
+ }
33
+
34
+ &--readonly,
35
+ &--disabled {
36
+ .y-checkbox__label,
37
+ .y-input--checkbox {
38
+ cursor: default;
39
+ }
40
+ }
41
+
42
+ &--disabled {
43
+ .y-checkbox__slot {
44
+ filter: grayscale(1);
45
+ opacity: 0.4;
46
+ }
47
+ }
48
+ }
@@ -1,6 +1,6 @@
1
- @use '../../styles/palette';
2
1
 
3
- $checkbox__color: palette.$primary;
2
+
3
+ $checkbox__color: var(--y-theme-primary);
4
4
  $checkbox__border-color: #a4a4a4;
5
5
 
6
6
  .y-input--checkbox {
@@ -67,7 +67,7 @@ $checkbox__border-color: #a4a4a4;
67
67
 
68
68
  &.y-input--active:hover {
69
69
  .y-icon-checkbox__border-path {
70
- fill: lighten($checkbox__color, 10);
70
+ filter: brightness(1.1);
71
71
  }
72
72
  }
73
73
 
@@ -1 +1 @@
1
- {"version":3,"file":"YDropdown.mjs","names":["defineComponent","pressItemsPropsOptions","useModelDuplex","useRender","pressCoordinateProps","getObjectValueByPath","omit","chooseProps","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","menuProps","_createVNode","_Fragment","_mergeProps","$event","base","_len","arguments","length","args","Array","_key","default","menu","isArray","items","map","text","itemText","e","_createTextVNode"],"sources":["../../../src/components/dropdown/YDropdown.tsx"],"sourcesContent":["import { PropType, defineComponent, mergeProps } 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 { chooseProps, 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 const menuProps = chooseProps(props, YMenu.props);\n return (\n <>\n <YMenu\n {...menuProps}\n v-model={opened.value}\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>\n ) : (\n <div class=\"y-dropdown__no-options\">항목이 없습니다.</div>\n )}\n </YCard>\n ),\n }}\n </YMenu>\n </>\n );\n });\n },\n});\n"],"mappings":";AAAA,SAAmBA,eAAe,QAAoB,KAAK;AAAC,SAEnDC,sBAAsB;AAAA,SACtBC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SACpBC,oBAAoB,EAAEC,IAAI;AAAA,SAC1BC,WAAW,EAAEC,YAAY;AAAA,SACzBC,OAAO;AAAA,SACPC,KAAK;AAAA,SACLC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAEd;AAEA,OAAO,MAAMC,0BAA0B,GAAGP,YAAY,CACpD;EACEQ,UAAU,EAAEC,OAA4B;EACxCC,SAAS,EAAEC,MAA0B;EACrCC,KAAK,EAAED,MAA0B;EACjC,GAAGb,IAAI,CAACF,oBAAoB,CA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b,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YDropdown.mjs","names":["defineComponent","pressItemsPropsOptions","useModelDuplex","useRender","pressCoordinateProps","getObjectValueByPath","omit","chooseProps","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","menuProps","_createVNode","_Fragment","_mergeProps","$event","base","_len","arguments","length","args","Array","_key","default","menu","isArray","items","map","text","itemText","e","_createTextVNode"],"sources":["../../../src/components/dropdown/YDropdown.tsx"],"sourcesContent":["import { PropType, defineComponent, mergeProps } from 'vue';\r\n\r\nimport { pressItemsPropsOptions } from '../../abstract/items';\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport { getObjectValueByPath, omit } from '../../util/common';\r\nimport { chooseProps, propsFactory } from '../../util/vue-component';\r\nimport { YButton } from '../button';\r\nimport { YCard } from '../card';\r\nimport { YIconDropdown } from '../icons/YIconDropdown';\r\nimport { YList, YListItem } from '../list';\r\nimport { YMenu } from '../menu';\r\n\r\nimport './YDropdown.scss';\r\n\r\nexport const pressYDropdownPropsOptions = propsFactory(\r\n {\r\n modelValue: Boolean as PropType<boolean>,\r\n variation: String as PropType<string>,\r\n color: String as PropType<string>,\r\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\r\n 'coordinateStrategy',\r\n ]),\r\n ...pressItemsPropsOptions(),\r\n },\r\n 'YDropdown',\r\n);\r\n\r\nexport const YDropdown = defineComponent({\r\n name: 'YDropdown',\r\n inheritAttrs: false,\r\n components: {\r\n YMenu,\r\n },\r\n props: {\r\n ...pressYDropdownPropsOptions(),\r\n },\r\n emits: ['update:modelValue', 'click'],\r\n setup(props, { slots, attrs, emit }) {\r\n const opened = useModelDuplex(props);\r\n\r\n function onClickItem(item: any) {\r\n opened.value = false;\r\n emit('click', item);\r\n }\r\n\r\n useRender(() => {\r\n const menuProps = chooseProps(props, YMenu.props);\r\n return (\r\n <>\r\n <YMenu\r\n {...menuProps}\r\n v-model={opened.value}\r\n content-classes={['y-dropdown__content']}\r\n >\r\n {{\r\n base: (...args: any[]) =>\r\n slots.base ? (\r\n slots.base?.(...args)\r\n ) : (\r\n <YButton\r\n variation={props.variation}\r\n color={props.color}\r\n class={[\r\n 'y-dropdown',\r\n { 'y-dropdown--opened': opened.value },\r\n ]}\r\n {...attrs}\r\n >\r\n {\r\n <span class=\"y-dropdown__default\">\r\n {slots.default?.()}\r\n </span>\r\n }\r\n {slots['expand-icon'] ? (\r\n slots['expand-icon']()\r\n ) : (\r\n <i class=\"y-dropdown__icon\">\r\n <YIconDropdown></YIconDropdown>\r\n </i>\r\n )}\r\n </YButton>\r\n ),\r\n default: () =>\r\n slots.menu ? (\r\n slots.menu()\r\n ) : (\r\n <YCard>\r\n {Array.isArray(props.items) && props.items.length > 0 ? (\r\n <YList>\r\n {props.items.map((item) => {\r\n const text = getObjectValueByPath(\r\n item,\r\n props.itemText,\r\n );\r\n return (\r\n <YListItem onClick={(e) => onClickItem(item)}>\r\n {text}\r\n </YListItem>\r\n );\r\n })}\r\n </YList>\r\n ) : (\r\n <div class=\"y-dropdown__no-options\">항목이 없습니다.</div>\r\n )}\r\n </YCard>\r\n ),\r\n }}\r\n </YMenu>\r\n </>\r\n );\r\n });\r\n },\r\n});\r\n"],"mappings":";AAAA,SAAmBA,eAAe,QAAoB,KAAK;AAAC,SAEnDC,sBAAsB;AAAA,SACtBC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SACpBC,oBAAoB,EAAEC,IAAI;AAAA,SAC1BC,WAAW,EAAEC,YAAY;AAAA,SACzBC,OAAO;AAAA,SACPC,KAAK;AAAA,SACLC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;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B,WAAW,CAACC,IAAI;cAAC;gBAAAc,OAAA,EAAAA,CAAA,MACzCK,IAAI;cAAA;YAGX,CAAC,CAAC;UAAA,KAAAhB,YAAA;YAAA,SAGO;UAAwB,IAAAmB,gBAAA,kDACpC;QAAA;MAEJ;IAKb,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
@@ -1,5 +1,3 @@
1
- @use '../../styles/util/theme';
2
- @use '../../styles/util/helper';
3
1
  @use '../../styles/variables';
4
2
 
5
3
  .y-field-input {
@@ -61,13 +59,6 @@
61
59
  height: 16px;
62
60
  padding: 0;
63
61
  cursor: pointer;
64
- }
65
- }
66
-
67
- @include theme.basicTheme('y-field-input') using ($themeMap, $class) {
68
- .y-field-input {
69
- &__clear {
70
- color: helper.deepGet($themeMap, 'fieldInput', 'clear');
71
- }
62
+ color: var(--y-theme-on-surface);
72
63
  }
73
64
  }
@@ -23,4 +23,6 @@ export * from "./pagination/index.mjs";
23
23
  export * from "./loading/index.mjs";
24
24
  export * from "./dropdown/index.mjs";
25
25
  export * from "./select/index.mjs";
26
+ export * from "./tab/index.mjs";
27
+ export * from "./alert/index.mjs";
26
28
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './app';\r\nexport * from './button';\r\nexport * from './input';\r\nexport * from './field-input';\r\nexport * from './form';\r\nexport * from './progress-bar';\r\nexport * from './card';\r\nexport * from './chip';\r\nexport * from './switch';\r\nexport * from './layer';\r\nexport * from './dialog';\r\nexport * from './snackbar';\r\nexport * from './tooltip';\r\nexport * from './transitions';\r\nexport * from './panel';\r\nexport * from './tree-view';\r\nexport * from './list';\r\nexport * from './icons';\r\nexport * from './table';\r\nexport * from './menu';\r\nexport * from './checkbox';\r\nexport * from './pagination';\r\nexport * from './loading';\r\nexport * from './dropdown';\r\nexport * from './select';\r\n"],"mappings":""}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './app';\r\nexport * from './button';\r\nexport * from './input';\r\nexport * from './field-input';\r\nexport * from './form';\r\nexport * from './progress-bar';\r\nexport * from './card';\r\nexport * from './chip';\r\nexport * from './switch';\r\nexport * from './layer';\r\nexport * from './dialog';\r\nexport * from './snackbar';\r\nexport * from './tooltip';\r\nexport * from './transitions';\r\nexport * from './panel';\r\nexport * from './tree-view';\r\nexport * from './list';\r\nexport * from './icons';\r\nexport * from './table';\r\nexport * from './menu';\r\nexport * from './checkbox';\r\nexport * from './pagination';\r\nexport * from './loading';\r\nexport * from './dropdown';\r\nexport * from './select';\r\nexport * from './tab';\r\nexport * from './alert';\r\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
 
2
- @use '../../styles/palette';
2
+
3
3
  @use '../../styles/variables';
4
4
 
5
5
  $input-border-radius: variables.$border-radius-root !default;
@@ -1 +1 @@
1
- {"version":3,"file":"YSelect.mjs","names":["shallowRef","computed","defineComponent","mergeProps","ref","useModelDuplex","useRender","pressCoordinateProps","pressListItemsPropsOptions","useItems","wrapInArray","deepEqual","getObjectValueByPath","omit","chooseProps","propsFactory","YCard","YFieldInput","pressYFieldInputPropsOptions","YIconDropdown","YList","YListItem","YMenu","returnItemEquals","optionsItem","valueItem","valueKey","arguments","length","undefined","valueItemType","itemValue","pressSelectPropsOptions","opened","Boolean","multiple","weakEquals","valueEquals","type","Function","default","pressYSelectPropsOptions","maxHeight","Number","String","position","YSelect","name","props","emits","value","setup","_ref","slots","fieldInputRef","menuRef","listRef","focused","items","toRefineItems","toEmitItems","model","v","emitValue","selections","map","find","item","selected","selection","onMousedownDisplay","event","disabled","onBlur","$el","contains","relatedTarget","onClickItem","select","onAfterLeave","focus","displayText","text","join","fieldInputProps","_createVNode","$event","offset","origin","base","_len","args","Array","_key","_mergeProps","leading","_len2","_key2","trailing","menu","e","_createTextVNode"],"sources":["../../../src/components/select/YSelect.tsx"],"sourcesContent":["import { shallowRef } from '@vue/runtime-core';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, mergeProps, ref } from 'vue';\n\nimport { useModelDuplex } from '../../composables/communication';\nimport { useRender } from '../../composables/component';\nimport { pressCoordinateProps } from '../../composables/coordinate';\nimport {\n ListItem,\n pressListItemsPropsOptions,\n useItems,\n} from '../../composables/list-items';\nimport { wrapInArray } from '../../util/array';\nimport { deepEqual, getObjectValueByPath, omit } from '../../util/common';\nimport { chooseProps, propsFactory } from '../../util/vue-component';\nimport { YCard } from '../card';\nimport { YFieldInput, pressYFieldInputPropsOptions } from '../field-input';\nimport { YIconDropdown } from '../icons/YIconDropdown';\nimport { YList, YListItem } from '../list';\nimport { YMenu } from '../menu';\n\nimport './YSelect.scss';\n\nexport type SelectEquals = (\n optionsItem: any,\n valueItem: any,\n valueKey?: string,\n) => boolean;\n\nexport function returnItemEquals(\n optionsItem: any,\n valueItem: any,\n valueKey = 'value',\n) {\n const valueItemType = typeof valueItem;\n const itemValue =\n valueItemType === 'string' || valueItemType === 'number'\n ? getObjectValueByPath(optionsItem, valueKey)\n : optionsItem;\n return deepEqual(itemValue, valueItem);\n}\n\nexport const pressSelectPropsOptions = propsFactory(\n {\n opened: Boolean as PropType<boolean>,\n multiple: Boolean,\n weakEquals: Boolean,\n valueEquals: {\n type: Function as PropType<SelectEquals>,\n default: deepEqual,\n },\n ...pressListItemsPropsOptions(),\n },\n 'Select',\n);\n\nexport const pressYSelectPropsOptions = propsFactory(\n {\n maxHeight: {\n type: [Number, String],\n default: 310,\n },\n ...pressSelectPropsOptions(),\n ...pressYFieldInputPropsOptions(),\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\n 'coordinateStrategy',\n ]),\n },\n 'YSelect',\n);\n\nexport const YSelect = defineComponent({\n name: 'YSelect',\n props: {\n ...pressYSelectPropsOptions(),\n },\n emits: {\n 'update:modelValue': (value: any) => true,\n 'update:opened': (opened: boolean) => true,\n },\n setup(props, { slots }) {\n const fieldInputRef = ref();\n const menuRef = ref();\n const listRef = ref<InstanceType<typeof YList>>();\n\n const opened = useModelDuplex(props, 'opened');\n const focused = shallowRef(false);\n\n const { items, toRefineItems, toEmitItems } = useItems(props);\n const model = useModelDuplex(\n props,\n 'modelValue',\n [],\n (v) => toRefineItems(v === null ? [null] : wrapInArray(v)),\n (v) => {\n const emitValue = toEmitItems(wrapInArray(v));\n return props.multiple ? emitValue : emitValue[0] ?? null;\n },\n );\n\n const selections = computed<ListItem[]>(() => {\n return model.value.map((v: any) => {\n return items.value.find((item) => {\n return props.valueEquals(item.value, v.value);\n });\n });\n });\n\n const selected = computed(() => {\n return selections.value.map((selection) => selection.props.value);\n });\n\n // Field\n function onMousedownDisplay(event: MouseEvent) {\n if (props.disabled) {\n return;\n }\n opened.value = !opened.value;\n }\n\n function onBlur(event: FocusEvent) {\n if (listRef.value?.$el.contains(event.relatedTarget)) {\n opened.value = false;\n }\n }\n\n // Menu Contents\n function onClickItem(item: ListItem) {\n select(item);\n if (!props.multiple) {\n opened.value = false;\n }\n }\n\n function onAfterLeave() {\n if (focused.value) {\n fieldInputRef.value?.focus();\n }\n }\n\n function select(item: ListItem) {\n if (props.multiple) {\n //\n } else {\n model.value = [item];\n }\n }\n\n const displayText = computed(() => {\n if (props.multiple) {\n return selections.value.map((item) => item.text).join(', ');\n }\n return selections.value?.[0]?.text ?? '';\n });\n\n useRender(() => {\n const fieldInputProps = chooseProps(props, YFieldInput.props);\n return (\n <YMenu\n v-model={opened.value}\n ref={menuRef}\n offset={props.offset}\n position={props.position}\n origin={props.origin}\n content-classes={['y-select__content']}\n maxHeight={props.maxHeight}\n open-on-click-base={false}\n onAfterLeave={onAfterLeave}\n >\n {{\n base: (...args: any[]) =>\n slots.base ? (\n slots.base?.(...args)\n ) : (\n <YFieldInput\n {...{\n ...fieldInputProps,\n ...mergeProps({ ...args[0].props }, { ref: fieldInputRef }),\n }}\n onMousedown:display={onMousedownDisplay}\n onBlur={onBlur}\n readonly\n class={['y-select', { 'y-select--opened': opened.value }]}\n v-model:focused={focused.value}\n >\n {{\n default: () => {\n return (\n <div class={['y-select__selection']}>\n {slots.selection\n ? slots.selection?.()\n : displayText.value}\n </div>\n );\n },\n leading: slots.leading\n ? (...args: any[]) => slots.leading?.(...args)\n : undefined,\n trailing: (...args: any[]) => {\n return slots['expand-icon'] ? (\n slots['expand-icon']()\n ) : (\n <i class=\"y-select__icon\">\n <YIconDropdown></YIconDropdown>\n </i>\n );\n },\n 'helper-text': slots['helper-text']\n ? slots['helper-text']?.()\n : undefined,\n }}\n </YFieldInput>\n ),\n default: () =>\n slots.menu ? (\n slots.menu()\n ) : (\n <YCard>\n {items.value.length > 0 ? (\n <YList ref={listRef}>\n {items.value.map((item) => {\n return (\n <YListItem onClick={(e) => onClickItem(item)}>\n {item.text}\n </YListItem>\n );\n })}\n </YList>\n ) : (\n <div class=\"y-select__no-options\">항목이 없습니다.</div>\n )}\n </YCard>\n ),\n }}\n </YMenu>\n );\n });\n\n return {\n fieldInputRef,\n model,\n selections,\n };\n },\n});\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,QAAQ,EAAEC,eAAe,EAAEC,UAAU,EAAEC,GAAG,QAAQ,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SAG3BC,0BAA0B,EAC1BC,QAAQ;AAAA,SAEDC,WAAW;AAAA,SACXC,SAAS,EAAEC,oBAAoB,EAAEC,IAAI;AAAA,SACrCC,WAAW,EAAEC,YAAY;AAAA,SACzBC,KAAK;AAAA,SACLC,WAAW,EAAEC,4BAA4B;AAAA,SACzCC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAEd;AAQA,OAAO,SAASC,gBAAgBA,CAC9BC,WAAgB,EAChBC,SAAc,EAEd;EAAA,IADAC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,OAAO;EAElB,MAAMG,aAAa,GA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O;MACL/C,aAAa;MACbO,KAAK;MACLG;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YSelect.mjs","names":["shallowRef","computed","defineComponent","mergeProps","ref","useModelDuplex","useRender","pressCoordinateProps","pressListItemsPropsOptions","useItems","wrapInArray","deepEqual","getObjectValueByPath","omit","chooseProps","propsFactory","YCard","YFieldInput","pressYFieldInputPropsOptions","YIconDropdown","YList","YListItem","YMenu","returnItemEquals","optionsItem","valueItem","valueKey","arguments","length","undefined","valueItemType","itemValue","pressSelectPropsOptions","opened","Boolean","multiple","weakEquals","valueEquals","type","Function","default","pressYSelectPropsOptions","maxHeight","Number","String","position","YSelect","name","props","emits","value","setup","_ref","slots","fieldInputRef","menuRef","listRef","focused","items","toRefineItems","toEmitItems","model","v","emitValue","selections","map","find","item","selected","selection","onMousedownDisplay","event","disabled","onBlur","$el","contains","relatedTarget","onClickItem","select","onAfterLeave","focus","displayText","text","join","fieldInputProps","_createVNode","$event","offset","origin","base","_len","args","Array","_key","_mergeProps","leading","_len2","_key2","trailing","menu","e","_createTextVNode"],"sources":["../../../src/components/select/YSelect.tsx"],"sourcesContent":["import { shallowRef } from '@vue/runtime-core';\r\nimport type { PropType } from 'vue';\r\nimport { computed, defineComponent, mergeProps, ref } from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport {\r\n ListItem,\r\n pressListItemsPropsOptions,\r\n useItems,\r\n} from '../../composables/list-items';\r\nimport { wrapInArray } from '../../util/array';\r\nimport { deepEqual, getObjectValueByPath, omit } from '../../util/common';\r\nimport { chooseProps, propsFactory } from '../../util/vue-component';\r\nimport { YCard } from '../card';\r\nimport { YFieldInput, pressYFieldInputPropsOptions } from '../field-input';\r\nimport { YIconDropdown } from '../icons/YIconDropdown';\r\nimport { YList, YListItem } from '../list';\r\nimport { YMenu } from '../menu';\r\n\r\nimport './YSelect.scss';\r\n\r\nexport type SelectEquals = (\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey?: string,\r\n) => boolean;\r\n\r\nexport function returnItemEquals(\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey = 'value',\r\n) {\r\n const valueItemType = typeof valueItem;\r\n const itemValue =\r\n valueItemType === 'string' || valueItemType === 'number'\r\n ? getObjectValueByPath(optionsItem, valueKey)\r\n : optionsItem;\r\n return deepEqual(itemValue, valueItem);\r\n}\r\n\r\nexport const pressSelectPropsOptions = propsFactory(\r\n {\r\n opened: Boolean as PropType<boolean>,\r\n multiple: Boolean,\r\n weakEquals: Boolean,\r\n valueEquals: {\r\n type: Function as PropType<SelectEquals>,\r\n default: deepEqual,\r\n },\r\n ...pressListItemsPropsOptions(),\r\n },\r\n 'Select',\r\n);\r\n\r\nexport const pressYSelectPropsOptions = propsFactory(\r\n {\r\n maxHeight: {\r\n type: [Number, String],\r\n default: 310,\r\n },\r\n ...pressSelectPropsOptions(),\r\n ...pressYFieldInputPropsOptions(),\r\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\r\n 'coordinateStrategy',\r\n ]),\r\n },\r\n 'YSelect',\r\n);\r\n\r\nexport const YSelect = defineComponent({\r\n name: 'YSelect',\r\n props: {\r\n ...pressYSelectPropsOptions(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: any) => true,\r\n 'update:opened': (opened: boolean) => true,\r\n },\r\n setup(props, { slots }) {\r\n const fieldInputRef = ref();\r\n const menuRef = ref();\r\n const listRef = ref<InstanceType<typeof YList>>();\r\n\r\n const opened = useModelDuplex(props, 'opened');\r\n const focused = shallowRef(false);\r\n\r\n const { items, toRefineItems, toEmitItems } = useItems(props);\r\n const model = useModelDuplex(\r\n props,\r\n 'modelValue',\r\n [],\r\n (v) => toRefineItems(v === null ? [null] : wrapInArray(v)),\r\n (v) => {\r\n const emitValue = toEmitItems(wrapInArray(v));\r\n return props.multiple ? emitValue : emitValue[0] ?? null;\r\n },\r\n );\r\n\r\n const selections = computed<ListItem[]>(() => {\r\n return model.value.map((v: any) => {\r\n return items.value.find((item) => {\r\n return props.valueEquals(item.value, v.value);\r\n });\r\n });\r\n });\r\n\r\n const selected = computed(() => {\r\n return selections.value.map((selection) => selection.props.value);\r\n });\r\n\r\n // Field\r\n function onMousedownDisplay(event: MouseEvent) {\r\n if (props.disabled) {\r\n return;\r\n }\r\n opened.value = !opened.value;\r\n }\r\n\r\n function onBlur(event: FocusEvent) {\r\n if (listRef.value?.$el.contains(event.relatedTarget)) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n // Menu Contents\r\n function onClickItem(item: ListItem) {\r\n select(item);\r\n if (!props.multiple) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n function onAfterLeave() {\r\n if (focused.value) {\r\n fieldInputRef.value?.focus();\r\n }\r\n }\r\n\r\n function select(item: ListItem) {\r\n if (props.multiple) {\r\n //\r\n } else {\r\n model.value = [item];\r\n }\r\n }\r\n\r\n const displayText = computed(() => {\r\n if (props.multiple) {\r\n return selections.value.map((item) => item.text).join(', ');\r\n }\r\n return selections.value?.[0]?.text ?? '';\r\n });\r\n\r\n useRender(() => {\r\n const fieldInputProps = chooseProps(props, YFieldInput.props);\r\n return (\r\n <YMenu\r\n v-model={opened.value}\r\n ref={menuRef}\r\n offset={props.offset}\r\n position={props.position}\r\n origin={props.origin}\r\n content-classes={['y-select__content']}\r\n maxHeight={props.maxHeight}\r\n open-on-click-base={false}\r\n onAfterLeave={onAfterLeave}\r\n >\r\n {{\r\n base: (...args: any[]) =>\r\n slots.base ? (\r\n slots.base?.(...args)\r\n ) : (\r\n <YFieldInput\r\n {...{\r\n ...fieldInputProps,\r\n ...mergeProps({ ...args[0].props }, { ref: fieldInputRef }),\r\n }}\r\n onMousedown:display={onMousedownDisplay}\r\n onBlur={onBlur}\r\n readonly\r\n class={['y-select', { 'y-select--opened': opened.value }]}\r\n v-model:focused={focused.value}\r\n >\r\n {{\r\n default: () => {\r\n return (\r\n <div class={['y-select__selection']}>\r\n {slots.selection\r\n ? slots.selection?.()\r\n : displayText.value}\r\n </div>\r\n );\r\n },\r\n leading: slots.leading\r\n ? (...args: any[]) => slots.leading?.(...args)\r\n : undefined,\r\n trailing: (...args: any[]) => {\r\n return slots['expand-icon'] ? (\r\n slots['expand-icon']()\r\n ) : (\r\n <i class=\"y-select__icon\">\r\n <YIconDropdown></YIconDropdown>\r\n </i>\r\n );\r\n },\r\n 'helper-text': slots['helper-text']\r\n ? slots['helper-text']?.()\r\n : undefined,\r\n }}\r\n </YFieldInput>\r\n ),\r\n default: () =>\r\n slots.menu ? (\r\n slots.menu()\r\n ) : (\r\n <YCard>\r\n {items.value.length > 0 ? (\r\n <YList ref={listRef}>\r\n {items.value.map((item) => {\r\n return (\r\n <YListItem onClick={(e) => onClickItem(item)}>\r\n {item.text}\r\n </YListItem>\r\n );\r\n })}\r\n </YList>\r\n ) : (\r\n <div class=\"y-select__no-options\">항목이 없습니다.</div>\r\n )}\r\n </YCard>\r\n ),\r\n }}\r\n </YMenu>\r\n );\r\n });\r\n\r\n return {\r\n fieldInputRef,\r\n model,\r\n selections,\r\n };\r\n },\r\n});\r\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,QAAQ,EAAEC,eAAe,EAAEC,UAAU,EAAEC,GAAG,QAAQ,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SAG3BC,0BAA0B,EAC1BC,QAAQ;AAAA,SAEDC,WAAW;AAAA,SACXC,SAAS,EAAEC,oBAAoB,EAAEC,IAAI;AAAA,SACrCC,WAAW,EAAEC,YAAY;AAAA,SACzBC,KAAK;AAAA,SACLC,WAAW,EAAEC,4BAA4B;AAAA,SACzCC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAEd;AAQA,OAAO,SAASC,gBAAgBA,CAC9BC,WAAgB,EAChBC,SAAc,EAEd;EAAA,IADAC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CAAC;UAAA,KAAAG,YAAA;YAAA,SAGO;UAAsB,IAAAgB,gBAAA,kDAClC;QAAA;MAEJ;IAIX,CAAC,CAAC;IAEF,OAAO;MACL/C,aAAa;MACbO,KAAK;MACLG;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- @use '../../styles/palette';
1
+
2
2
  @use '../../styles/variables';
3
3
 
4
4
  .y-switch {
@@ -1,14 +1,64 @@
1
- import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
- import { defineComponent } from 'vue';
1
+ import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
+ import { shallowRef } from '@vue/runtime-core';
3
+ import { computed, defineComponent, ref } from 'vue';
3
4
  import { useRender } from "../../composables/component.mjs";
4
- import { YButton } from "../button/index.mjs";
5
+ import { chooseProps, propsFactory } from "../../util/index.mjs";
6
+ import { YButton, pressYButtonProps } from "../button/index.mjs";
7
+ import { Y_TABS_KEY } from "./shared.mjs";
8
+ import "./YTab.scss";
9
+ export const pressYTabPropsOptions = propsFactory({
10
+ text: String,
11
+ value: String,
12
+ hideIndicator: Boolean,
13
+ indicatorColor: String,
14
+ ...pressYButtonProps({
15
+ selectedClass: 'y-tab--selected',
16
+ noWave: true
17
+ })
18
+ }, 'YTab');
5
19
  export const YTab = defineComponent({
6
20
  name: 'YTab',
7
- props: {},
8
- setup() {
21
+ props: pressYTabPropsOptions(),
22
+ slots: Object,
23
+ setup(props, _ref) {
24
+ let {
25
+ slots,
26
+ attrs
27
+ } = _ref;
28
+ const selected = shallowRef(false);
29
+ const indicator$ = ref();
30
+ const indicatorStyles = computed(() => {
31
+ return {};
32
+ });
33
+ const attrsProps = computed(() => {
34
+ return {
35
+ role: 'tab',
36
+ 'aria-selected': `${String(selected.value)}`,
37
+ tabindex: selected.value ? 0 : -1
38
+ };
39
+ });
40
+ function onChoice(_ref2) {
41
+ let {
42
+ value
43
+ } = _ref2;
44
+ selected.value = value;
45
+ }
9
46
  useRender(() => {
10
- return _createVNode(_Fragment, null, [_createVNode(YButton, null, {
11
- default: () => [_createVNode("slot", null, null)]
47
+ const yButtonProps = chooseProps(props, YButton.props);
48
+ console.log(props, yButtonProps);
49
+ return _createVNode(_Fragment, null, [_createVNode(YButton, _mergeProps({
50
+ "class": ['y-tab'],
51
+ "active": false
52
+ }, attrsProps.value, attrs, yButtonProps, {
53
+ "injectSymbol": Y_TABS_KEY,
54
+ "onChoice:selected": onChoice
55
+ }), {
56
+ default: () => slots.default?.() ?? props.text,
57
+ append: () => !props.hideIndicator && _createVNode("div", {
58
+ "ref": indicator$,
59
+ "class": ['y-tab__indicator'],
60
+ "style": indicatorStyles.value
61
+ }, null)
12
62
  })]);
13
63
  });
14
64
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"YTab.mjs","names":["defineComponent","useRender","YButton","YTab","name","props","setup","_createVNode","_Fragment","default"],"sources":["../../../src/components/tab/YTab.tsx"],"sourcesContent":["import { defineComponent } from 'vue';\r\n\r\nimport { useRender } from '../../composables/component';\r\nimport { YButton } from '../button';\r\n\r\nexport const YTab = defineComponent({\r\n name: 'YTab',\r\n props: {},\r\n setup() {\r\n useRender(() => {\r\n return (\r\n <>\r\n <YButton>\r\n <slot></slot>\r\n </YButton>\r\n </>\r\n );\r\n });\r\n\r\n return {};\r\n },\r\n});\r\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,KAAK;AAAC,SAE7BC,SAAS;AAAA,SACTC,OAAO;AAEhB,OAAO,MAAMC,IAAI,GAAGH,eAAe,CAAC;EAClCI,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,CAAC,CAAC;EACTC,KAAKA,CAAA,EAAG;IACNL,SAAS,CAAC,MAAM;MACd,OAAAM,YAAA,CAAAC,SAAA,SAAAD,YAAA,CAAAL,OAAA;QAAAO,OAAA,EAAAA,CAAA,MAAAF,YAAA;MAAA;IAOF,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YTab.mjs","names":["shallowRef","computed","defineComponent","ref","useRender","chooseProps","propsFactory","YButton","pressYButtonProps","Y_TABS_KEY","pressYTabPropsOptions","text","String","value","hideIndicator","Boolean","indicatorColor","selectedClass","noWave","YTab","name","props","slots","Object","setup","_ref","attrs","selected","indicator$","indicatorStyles","attrsProps","role","tabindex","onChoice","_ref2","yButtonProps","console","log","_createVNode","_Fragment","_mergeProps","default","append"],"sources":["../../../src/components/tab/YTab.tsx"],"sourcesContent":["import { shallowRef } from '@vue/runtime-core';\nimport {\n PropType,\n SlotsType,\n computed,\n defineComponent,\n mergeProps,\n ref,\n} from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { chooseProps, omit, propsFactory } from '../../util';\nimport { YButton, pressYButtonProps } from '../button';\nimport { Y_TABS_KEY } from './shared';\n\nimport './YTab.scss';\n\nexport const pressYTabPropsOptions = propsFactory(\n {\n text: String as PropType<string>,\n value: String as PropType<string>,\n hideIndicator: Boolean as PropType<boolean>,\n indicatorColor: String as PropType<string>,\n ...pressYButtonProps({\n selectedClass: 'y-tab--selected',\n noWave: true,\n }),\n },\n 'YTab',\n);\n\nexport const YTab = defineComponent({\n name: 'YTab',\n props: pressYTabPropsOptions(),\n slots: Object as SlotsType<{\n default?: any;\n }>,\n setup(props, { slots, attrs }) {\n const selected = shallowRef(false);\n\n const indicator$ = ref();\n const indicatorStyles = computed(() => {\n return {};\n });\n const attrsProps = computed(() => {\n return {\n role: 'tab',\n 'aria-selected': `${String(selected.value)}`,\n tabindex: selected.value ? 0 : -1,\n };\n });\n\n function onChoice({ value }: { value: boolean }) {\n selected.value = value;\n }\n\n useRender(() => {\n const yButtonProps = chooseProps(props, YButton.props);\n console.log(props, yButtonProps);\n return (\n <>\n <YButton\n class={['y-tab']}\n active={false}\n {...attrsProps.value}\n {...attrs}\n {...yButtonProps}\n injectSymbol={Y_TABS_KEY}\n onChoice:selected={onChoice}\n >\n {{\n default: () => slots.default?.() ?? props.text,\n append: () =>\n !props.hideIndicator && (\n <div\n ref={indicator$}\n class={['y-tab__indicator']}\n style={indicatorStyles.value}\n ></div>\n ),\n }}\n </YButton>\n </>\n );\n });\n\n return {};\n },\n});\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAC9C,SAGEC,QAAQ,EACRC,eAAe,EAEfC,GAAG,QACE,KAAK;AAAC,SAEJC,SAAS;AAAA,SACTC,WAAW,EAAQC,YAAY;AAAA,SAC/BC,OAAO,EAAEC,iBAAiB;AAAA,SAC1BC,UAAU;AAEnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGJ,YAAY,CAC/C;EACEK,IAAI,EAAEC,MAA0B;EAChCC,KAAK,EAAED,MAA0B;EACjCE,aAAa,EAAEC,OAA4B;EAC3CC,cAAc,EAAEJ,MAA0B;EAC1C,GAAGJ,iBAAiB,CAAC;IACjBS,aAAa,EAAE,iBAAiB;IAChCC,MAAM,EAAE;EACZ,CAAC;AACH,CAAC,EACD,MACF,CAAC;AAED,OAAO,MAAMC,IAAI,GAAGjB,eAAe,CAAC;EAClCkB,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEX,qBAAqB,CAAC,CAAC;EAC9BY,KAAK,EAAEC,MAEL;EACFC,KAAKA,CAACH,KAAK,EAAAI,IAAA,EAAoB;IAAA,IAAlB;MAAEH,KAAK;MAAEI;IAAM,CAAC,GAAAD,IAAA;IAC3B,MAAME,QAAQ,GAAG3B,UAAU,CAAC,KAAK,CAAC;IAElC,MAAM4B,UAAU,GAAGzB,GAAG,CAAC,CAAC;IACxB,MAAM0B,eAAe,GAAG5B,QAAQ,CAAC,MAAM;MACrC,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACF,MAAM6B,UAAU,GAAG7B,QAAQ,CAAC,MAAM;MAChC,OAAO;QACL8B,IAAI,EAAE,KAAK;QACX,eAAe,EAAG,GAAEnB,MAAM,CAACe,QAAQ,CAACd,KAAK,CAAE,EAAC;QAC5CmB,QAAQ,EAAEL,QAAQ,CAACd,KAAK,GAAG,CAAC,GAAG,CAAC;MAClC,CAAC;IACH,CAAC,CAAC;IAEF,SAASoB,QAAQA,CAAAC,KAAA,EAAgC;MAAA,IAA/B;QAAErB;MAA0B,CAAC,GAAAqB,KAAA;MAC7CP,QAAQ,CAACd,KAAK,GAAGA,KAAK;IACxB;IAEAT,SAAS,CAAC,MAAM;MACd,MAAM+B,YAAY,GAAG9B,WAAW,CAACgB,KAAK,EAAEd,OAAO,CAACc,KAAK,CAAC;MACtDe,OAAO,CAACC,GAAG,CAAChB,KAAK,EAAEc,YAAY,CAAC;MAChC,OAAAG,YAAA,CAAAC,SAAA,SAAAD,YAAA,CAAA/B,OAAA,EAAAiC,WAAA;QAAA,SAGa,CAAC,OAAO,CAAC;QAAA,UACR;MAAK,GACTV,UAAU,CAACjB,KAAK,EAChBa,KAAK,EACLS,YAAY;QAAA,gBACF1B,UAAU;QAAA,qBACLwB;MAAQ;QAGzBQ,OAAO,EAAEA,CAAA,KAAMnB,KAAK,CAACmB,OAAO,GAAG,CAAC,IAAIpB,KAAK,CAACV,IAAI;QAC9C+B,MAAM,EAAEA,CAAA,KACN,CAACrB,KAAK,CAACP,aAAa,IAAAwB,YAAA;UAAA,OAEXV,UAAU;UAAA,SACR,CAAC,kBAAkB,CAAC;UAAA,SACpBC,eAAe,CAAChB;QAAK;MAE/B;IAKb,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
@@ -0,0 +1,59 @@
1
+ @use '../../styles/variables';
2
+
3
+ .y-tab {
4
+ --y-tab-color: var(--y-theme-on-surface);
5
+ --y-tab-active-color: var(--y-theme-primary);
6
+
7
+ --y-tab-indicator-width: 2.7px;
8
+ --y-tab-indicator-color: inherit;
9
+ --y-tab-active-indicator-color: var(--y-theme-primary);
10
+ --y-tab-hover-indicator-color: var(--y-theme-outline);
11
+
12
+ box-shadow: none;
13
+ border-radius: 0;
14
+ font-size: 1rem;
15
+ padding: 4px 8px 12px;
16
+ color: var(--y-tab-color);
17
+
18
+ &:before {
19
+ background: radial-gradient(currentColor 50%, transparent);
20
+ }
21
+
22
+ &__indicator {
23
+ height: var(--y-tab-indicator-width);
24
+ position: absolute;
25
+ left: 4px;
26
+ right: 4px;
27
+ bottom: 0;
28
+ background-color: currentColor;
29
+ border-top-left-radius: 4444px;
30
+ border-top-right-radius: 4444px;
31
+ transform: scaleY(0);
32
+ transform-origin: bottom center;
33
+ transition-timing-function: variables.$basic-transition-timing-function;
34
+ transition-duration: 200ms;
35
+ transition-property: all;
36
+ will-change: transform;
37
+ }
38
+
39
+ .y-button {
40
+ &__content {
41
+ padding: 0;
42
+ }
43
+ }
44
+
45
+ &--active {
46
+ font-weight: 700;
47
+ color: var(--y-tab-active-color);
48
+ }
49
+
50
+ &:hover:not(&--active) &__indicator {
51
+ transform: scaleY(1);
52
+ color: var(--y-tab-hover-indicator-color);
53
+ }
54
+
55
+ &--active &__indicator {
56
+ color: var(--y-tab-active-indicator-color);
57
+ transform: scaleY(1);
58
+ }
59
+ }
@@ -1,16 +1,32 @@
1
- import { createVNode as _createVNode } from "vue";
2
- import { defineComponent } from 'vue';
1
+ import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
2
+ import { computed, defineComponent } from 'vue';
3
+ import { pressChoicePropsOptions, useChoice } from "../../composables/choice.mjs";
3
4
  import { useRender } from "../../composables/component.mjs";
4
5
  import { useResizeObserver } from "../../composables/resize-observer.mjs";
5
6
  import { propsFactory } from "../../util/vue-component.mjs";
6
- export const pressYTabsPropOptions = propsFactory({}, 'YTabs');
7
+ import { YTab } from "./YTab.mjs";
8
+ import { Y_TABS_KEY } from "./shared.mjs";
9
+ import "./YTabs.scss";
10
+ export const pressYTabsPropOptions = propsFactory({
11
+ items: {
12
+ type: Array
13
+ },
14
+ ...pressChoicePropsOptions({
15
+ selectedClass: 'y-tab--active',
16
+ mandatory: 'force'
17
+ })
18
+ }, 'YTabs');
7
19
  export const YTabs = defineComponent({
8
20
  name: 'YTabs',
9
21
  props: {
10
22
  tag: {
11
23
  type: String,
12
24
  default: 'div'
13
- }
25
+ },
26
+ ...pressYTabsPropOptions()
27
+ },
28
+ emits: {
29
+ 'update:modelValue': value => true
14
30
  },
15
31
  setup(props, _ref) {
16
32
  let {
@@ -24,9 +40,30 @@ export const YTabs = defineComponent({
24
40
  resizeObservedRef: content$,
25
41
  contentRect
26
42
  } = useResizeObserver();
43
+ const choiceState = useChoice(props, Y_TABS_KEY);
44
+ const slotProps = computed(() => {
45
+ return {
46
+ next: choiceState.next,
47
+ prev: choiceState.prev,
48
+ select: choiceState.select,
49
+ isSelected: choiceState.isSelected
50
+ };
51
+ });
52
+ const tabItems = computed(() => {
53
+ return props.items?.map(item => {
54
+ if (typeof item !== 'object') {
55
+ return {
56
+ text: item,
57
+ value: item
58
+ };
59
+ }
60
+ return item;
61
+ }) ?? [];
62
+ });
27
63
  useRender(() => {
28
64
  return _createVNode(props.tag, {
29
- "class": ['y-tabs']
65
+ "class": ['y-tabs'],
66
+ "role": "tablist"
30
67
  }, {
31
68
  default: () => [_createVNode("div", {
32
69
  "key": "container",
@@ -34,11 +71,16 @@ export const YTabs = defineComponent({
34
71
  "class": ['y-tabs__container']
35
72
  }, [_createVNode("div", {
36
73
  "key": "content",
37
- "ref": content$
38
- }, [slots.default?.()])])]
74
+ "ref": content$,
75
+ "class": ['y-tabs__content']
76
+ }, [slots.default ? slots.default(slotProps.value) : tabItems.value.map(tabItem => _createVNode(YTab, _mergeProps(tabItem, {
77
+ "key": tabItem.text
78
+ }), null))])])]
39
79
  });
40
80
  });
41
- return {};
81
+ return {
82
+ selected: choiceState.selected
83
+ };
42
84
  }
43
85
  });
44
86
  //# sourceMappingURL=YTabs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"YTabs.mjs","names":["defineComponent","useRender","useResizeObserver","propsFactory","pressYTabsPropOptions","YTabs","name","props","tag","type","String","default","setup","_ref","slots","resizeObservedRef","container$","contentRect","containerRect","content$","_createVNode"],"sources":["../../../src/components/tab/YTabs.tsx"],"sourcesContent":["import { PropType, defineComponent, ref } from 'vue';\r\n\r\nimport { useRender } from '../../composables/component';\r\nimport { useResizeObserver } from '../../composables/resize-observer';\r\nimport { propsFactory } from '../../util/vue-component';\r\n\r\nexport const pressYTabsPropOptions = propsFactory({}, 'YTabs');\r\n\r\nexport const YTabs = defineComponent({\r\n name: 'YTabs',\r\n props: {\r\n tag: {\r\n type: String as PropType<'div' | 'nav' | 'ol' | 'ul'>,\r\n default: 'div',\r\n },\r\n },\r\n setup(props, { slots }) {\r\n const { resizeObservedRef: container$, contentRect: containerRect } =\r\n useResizeObserver();\r\n const { resizeObservedRef: content$, contentRect } = useResizeObserver();\r\n\r\n useRender(() => {\r\n return (\r\n <props.tag class={['y-tabs']}>\r\n <div\r\n key=\"container\"\r\n ref={container$}\r\n class={['y-tabs__container']}\r\n >\r\n <div key=\"content\" ref={content$}>\r\n {slots.default?.()}\r\n </div>\r\n </div>\r\n </props.tag>\r\n );\r\n });\r\n\r\n return {};\r\n },\r\n});\r\n"],"mappings":";AAAA,SAAmBA,eAAe,QAAa,KAAK;AAAC,SAE5CC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,YAAY;AAErB,OAAO,MAAMC,qBAAqB,GAAGD,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AAE9D,OAAO,MAAME,KAAK,GAAGL,eAAe,CAAC;EACnCM,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE;IACLC,GAAG,EAAE;MACHC,IAAI,EAAEC,MAA+C;MACrDC,OAAO,EAAE;IACX;EACF,CAAC;EACDC,KAAKA,CAACL,KAAK,EAAAM,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACpB,MAAM;MAAEE,iBAAiB,EAAEC,UAAU;MAAEC,WAAW,EAAEC;IAAc,CAAC,GACjEhB,iBAAiB,CAAC,CAAC;IACrB,MAAM;MAAEa,iBAAiB,EAAEI,QAAQ;MAAEF;IAAY,CAAC,GAAGf,iBAAiB,CAAC,CAAC;IAExED,SAAS,CAAC,MAAM;MACd,OAAAmB,YAAA,CAAAb,KAAA,CAAAC,GAAA;QAAA,SACoB,CAAC,QAAQ;MAAC;QAAAG,OAAA,EAAAA,CAAA,MAAAS,YAAA;UAAA,OAEpB,WAAW;UAAA,OACVJ,UAAU;UAAA,SACR,CAAC,mBAAmB;QAAC,IAAAI,YAAA;UAAA,OAEnB,SAAS;UAAA,OAAMD;QAAQ,IAC7BL,KAAK,CAACH,OAAO,GAAG,CAAC;MAAA;IAK5B,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YTabs.mjs","names":["computed","defineComponent","pressChoicePropsOptions","useChoice","useRender","useResizeObserver","propsFactory","YTab","Y_TABS_KEY","pressYTabsPropOptions","items","type","Array","selectedClass","mandatory","YTabs","name","props","tag","String","default","emits","value","setup","_ref","slots","resizeObservedRef","container$","contentRect","containerRect","content$","choiceState","slotProps","next","prev","select","isSelected","tabItems","map","item","text","_createVNode","tabItem","_mergeProps","selected"],"sources":["../../../src/components/tab/YTabs.tsx"],"sourcesContent":["import { PropType, computed, defineComponent } from 'vue';\n\nimport { pressChoicePropsOptions, useChoice } from '../../composables/choice';\nimport { useRender } from '../../composables/component';\nimport { useResizeObserver } from '../../composables/resize-observer';\nimport { propsFactory } from '../../util/vue-component';\nimport { YTab } from './YTab';\nimport { Y_TABS_KEY } from './shared';\nimport { YTabPropItem } from './types';\n\nimport './YTabs.scss';\n\nexport const pressYTabsPropOptions = propsFactory(\n {\n items: {\n type: Array as PropType<YTabPropItem[]>,\n },\n ...pressChoicePropsOptions({\n selectedClass: 'y-tab--active',\n mandatory: 'force' as const,\n }),\n },\n 'YTabs',\n);\n\nexport const YTabs = defineComponent({\n name: 'YTabs',\n props: {\n tag: {\n type: String as PropType<'div' | 'nav' | 'ol' | 'ul'>,\n default: 'div',\n },\n ...pressYTabsPropOptions(),\n },\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n setup(props, { slots }) {\n const { resizeObservedRef: container$, contentRect: containerRect } =\n useResizeObserver();\n const { resizeObservedRef: content$, contentRect } = useResizeObserver();\n\n const choiceState = useChoice(props, Y_TABS_KEY);\n\n const slotProps = computed(() => {\n return {\n next: choiceState.next,\n prev: choiceState.prev,\n select: choiceState.select,\n isSelected: choiceState.isSelected,\n };\n });\n\n const tabItems = computed(() => {\n return (\n props.items?.map((item) => {\n if (typeof item !== 'object') {\n return {\n text: item,\n value: item,\n };\n }\n return item;\n }) ?? []\n );\n });\n\n useRender(() => {\n return (\n <props.tag class={['y-tabs']} role=\"tablist\">\n <div key=\"container\" ref={container$} class={['y-tabs__container']}>\n <div key=\"content\" ref={content$} class={['y-tabs__content']}>\n {slots.default\n ? slots.default(slotProps.value)\n : tabItems.value.map((tabItem) => (\n <YTab {...tabItem} key={tabItem.text}></YTab>\n ))}\n </div>\n </div>\n </props.tag>\n );\n });\n\n return {\n selected: choiceState.selected,\n };\n },\n});\n\nexport type YTabs = InstanceType<typeof YTabs>;\n"],"mappings":";AAAA,SAAmBA,QAAQ,EAAEC,eAAe,QAAQ,KAAK;AAAC,SAEjDC,uBAAuB,EAAEC,SAAS;AAAA,SAClCC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,YAAY;AAAA,SACZC,IAAI;AAAA,SACJC,UAAU;AAGnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGH,YAAY,CAC/C;EACEI,KAAK,EAAE;IACLC,IAAI,EAAEC;EACR,CAAC;EACD,GAAGV,uBAAuB,CAAC;IACzBW,aAAa,EAAE,eAAe;IAC9BC,SAAS,EAAE;EACb,CAAC;AACH,CAAC,EACD,OACF,CAAC;AAED,OAAO,MAAMC,KAAK,GAAGd,eAAe,CAAC;EACnCe,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE;IACLC,GAAG,EAAE;MACHP,IAAI,EAAEQ,MAA+C;MACrDC,OAAO,EAAE;IACX,CAAC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,YAAA;UAAA,OACvD,SAAS;UAAA,OAAMX,QAAQ;UAAA,SAAS,CAAC,iBAAiB;QAAC,IACzDL,KAAK,CAACL,OAAO,GACVK,KAAK,CAACL,OAAO,CAACY,SAAS,CAACV,KAAK,CAAC,GAC9Be,QAAQ,CAACf,KAAK,CAACgB,GAAG,CAAEI,OAAO,IAAAD,YAAA,CAAAlC,IAAA,EAAAoC,WAAA,CACfD,OAAO;UAAA,OAAOA,OAAO,CAACF;QAAI,SACrC,CAAC;MAAA;IAKhB,CAAC,CAAC;IAEF,OAAO;MACLI,QAAQ,EAAEb,WAAW,CAACa;IACxB,CAAC;EACH;AACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ .y-tabs {
2
+ --y-tabs-gap: 16px;
3
+
4
+
5
+
6
+ &__content {
7
+ display: flex;
8
+ gap: var(--y-tabs-gap);
9
+ }
10
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./YTabs.mjs";
2
2
  export * from "./YTab.mjs";
3
+ export { Y_TABS_KEY } from "./shared.mjs";
3
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/components/tab/index.ts"],"sourcesContent":["export * from './YTabs';\r\nexport * from './YTab';\r\n"],"mappings":""}
1
+ {"version":3,"file":"index.mjs","names":["Y_TABS_KEY"],"sources":["../../../src/components/tab/index.ts"],"sourcesContent":["export * from './YTabs';\r\nexport * from './YTab';\r\nexport {Y_TABS_KEY} from \"./shared\";\r\n"],"mappings":";;SAEQA,UAAU"}
@@ -0,0 +1,2 @@
1
+ export const Y_TABS_KEY = Symbol.for('yuyeon.y-tabs');
2
+ //# sourceMappingURL=shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.mjs","names":["Y_TABS_KEY","Symbol","for"],"sources":["../../../src/components/tab/shared.ts"],"sourcesContent":["import { InjectionKey } from 'vue';\n\nimport { ChoiceProvide } from '../../composables/choice';\n\nexport const Y_TABS_KEY: InjectionKey<ChoiceProvide> =\n Symbol.for('yuyeon.y-tabs');\n"],"mappings":"AAIA,OAAO,MAAMA,UAAuC,GAClDC,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../../src/components/tab/types.ts"],"sourcesContent":["export interface YTabPropItem {\r\n text: string;\r\n value: string;\r\n}\r\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  $table-cell-padding: 0 16px !default;
2
+ $table-head-background: var(--y-theme-surface-variant, #dfe3eb) !default;
2
3
 
3
4
  .y-table {
4
5
  display: flex;
@@ -29,10 +30,10 @@ $table-cell-padding: 0 16px !default;
29
30
 
30
31
  &--fixed-head.y-table > &__container > table > thead > tr > th {
31
32
  z-index: 1;
32
- background: var(--y-theme-panel, 250, 250, 250);
33
+ background: $table-head-background;
33
34
  }
34
35
 
35
- &__container {
36
+ .y-table__container {
36
37
  > table {
37
38
  font-size: 0.875rem;
38
39
 
@@ -0,0 +1,2 @@
1
+ export const Y_TOGGLE_BUTTON_KEY = Symbol.for('yuyeon.y-toggle-button');
2
+ //# sourceMappingURL=YToggleButton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YToggleButton.mjs","names":["Y_TOGGLE_BUTTON_KEY","Symbol","for"],"sources":["../../../src/components/toggle-button/YToggleButton.tsx"],"sourcesContent":["import { InjectionKey } from 'vue';\n\nimport { ChoiceProvide } from '../../composables/choice';\n\nexport const Y_TOGGLE_BUTTON_KEY: InjectionKey<ChoiceProvide> = Symbol.for(\n 'yuyeon.y-toggle-button',\n);\n"],"mappings":"AAIA,OAAO,MAAMA,mBAAgD,GAAGC,MAAM,CAACC,GAAG,CACxE,wBACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./YToggleButton.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/components/toggle-button/index.ts"],"sourcesContent":["export * from './YToggleButton';\r\n"],"mappings":""}