@mptw/skylens-ui 1.5.0 → 1.5.2

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 (111) hide show
  1. package/AGENTS.md +59 -0
  2. package/CLAUDE.md +36 -0
  3. package/README.md +7 -7
  4. package/app/app.config.ts +11 -2
  5. package/app/app.vue +5 -0
  6. package/app/assets/css/layout.css +134 -0
  7. package/app/assets/css/main.css +189 -0
  8. package/app/components/SLAlertModal.vue +24 -16
  9. package/app/components/SLBreadcrumbs.vue +12 -8
  10. package/app/components/SLButton.vue +196 -163
  11. package/app/components/SLCalendarButton.vue +40 -34
  12. package/app/components/SLCalendarPopup.vue +79 -53
  13. package/app/components/SLCard.vue +57 -41
  14. package/app/components/SLChart.vue +6 -3
  15. package/app/components/SLCheckbox.vue +92 -49
  16. package/app/components/SLCircleButton.vue +25 -16
  17. package/app/components/SLCollapsableBlock.vue +44 -33
  18. package/app/components/SLCollapsableMulitPillSelect.vue +20 -15
  19. package/app/components/SLConfirmModal.vue +9 -6
  20. package/app/components/SLContextMenu.vue +88 -48
  21. package/app/components/SLDateInput.vue +109 -92
  22. package/app/components/SLDatePicker.vue +9 -7
  23. package/app/components/SLDistributor.vue +1 -1
  24. package/app/components/SLDownloadButton.vue +39 -29
  25. package/app/components/SLDraggable.vue +2 -2
  26. package/app/components/SLDropdown.vue +33 -25
  27. package/app/components/SLDropdownItem.vue +9 -5
  28. package/app/components/SLElementWithTitle.vue +12 -7
  29. package/app/components/SLEyeCheckbox.vue +44 -31
  30. package/app/components/SLFileInput.vue +23 -16
  31. package/app/components/SLGenderAgeSelect.vue +52 -36
  32. package/app/components/SLHourRangeInput.vue +45 -32
  33. package/app/components/SLIOSSwitch.vue +81 -60
  34. package/app/components/SLIcon.vue +4 -3
  35. package/app/components/SLIconButton.vue +31 -29
  36. package/app/components/SLInfoTip.vue +51 -40
  37. package/app/components/SLInsightSitePage.vue +12 -7
  38. package/app/components/SLLegend.vue +19 -12
  39. package/app/components/SLLinearProgressBar.vue +7 -20
  40. package/app/components/SLLink.vue +12 -8
  41. package/app/components/SLLoading.vue +34 -31
  42. package/app/components/SLMapChart.vue +5 -4
  43. package/app/components/SLModal.vue +90 -66
  44. package/app/components/SLMonthCalendarButton.vue +91 -45
  45. package/app/components/SLMonthPicker.vue +42 -37
  46. package/app/components/SLMultiEmailInput.vue +163 -113
  47. package/app/components/SLMultiSelect.vue +37 -26
  48. package/app/components/SLNoData.vue +16 -11
  49. package/app/components/SLNotification.vue +133 -129
  50. package/app/components/SLPageModal.vue +14 -9
  51. package/app/components/SLPagination.vue +45 -33
  52. package/app/components/SLPillCheckbox.vue +50 -42
  53. package/app/components/SLPillLabel.vue +43 -28
  54. package/app/components/SLPopupMenuButton.vue +26 -17
  55. package/app/components/SLProfileButton.vue +28 -20
  56. package/app/components/SLProjectShareItem.vue +30 -17
  57. package/app/components/SLRadioButton.vue +41 -33
  58. package/app/components/SLRadioButtonGroup.vue +28 -23
  59. package/app/components/SLRadioGroup.vue +90 -78
  60. package/app/components/SLRangeInput.vue +53 -38
  61. package/app/components/SLRegionsMapChart.vue +5 -4
  62. package/app/components/SLRightSider.vue +50 -40
  63. package/app/components/SLSearchInput.vue +24 -19
  64. package/app/components/SLSelect.vue +114 -87
  65. package/app/components/SLSelectAllToggle.vue +52 -37
  66. package/app/components/SLSidebarNav.vue +253 -193
  67. package/app/components/SLSidebarNavGroupItem.vue +13 -10
  68. package/app/components/SLSidebarNavGroupItemSection.vue +240 -179
  69. package/app/components/SLSidebarNavLinkItem.vue +131 -109
  70. package/app/components/SLSidebarNavSectionItem.vue +21 -18
  71. package/app/components/SLSitePage.vue +35 -24
  72. package/app/components/SLSkyInsightSitePage.vue +13 -8
  73. package/app/components/SLSortByDropdown.vue +35 -22
  74. package/app/components/SLSpinIcon.vue +6 -3
  75. package/app/components/SLStayRangeInput.vue +47 -36
  76. package/app/components/SLTab.vue +7 -2
  77. package/app/components/SLTable.vue +330 -313
  78. package/app/components/SLTableTooltip.vue +44 -30
  79. package/app/components/SLTabs.vue +333 -280
  80. package/app/components/SLTextInput.vue +162 -134
  81. package/app/components/SLTextarea.vue +40 -29
  82. package/app/components/SLToast.vue +19 -11
  83. package/app/components/SLToggleButton.vue +18 -11
  84. package/app/components/SLTwoLayerMultiSelect.vue +180 -85
  85. package/app/components/SLTwoLayerSelect.vue +47 -37
  86. package/app/components/SLTwoLayerSingleSelect.vue +52 -33
  87. package/app/components/SLWarnModal.vue +9 -7
  88. package/app/interface/commons.ts +7 -0
  89. package/app/utils/index.ts +213 -146
  90. package/eslint.config.js +3 -0
  91. package/nuxt.config.ts +17 -14
  92. package/package.json +9 -8
  93. package/skills-lock.json +59 -0
  94. package/tsconfig.json +1 -6
  95. package/.eslintrc.cjs +0 -4
  96. package/app/assets/css/layout.styl +0 -98
  97. package/app/assets/css/tailwind.css +0 -3
  98. package/app/pages/index.vue +0 -15
  99. package/interface/commons.ts +0 -7
  100. package/tailwind.config.js +0 -271
  101. /package/{interface → app/interface}/IDateRange.ts +0 -0
  102. /package/{interface → app/interface}/IHourRange.ts +0 -0
  103. /package/{interface → app/interface}/IInputOption.ts +0 -0
  104. /package/{interface → app/interface}/ILegendItem.ts +0 -0
  105. /package/{interface → app/interface}/IOrganization.ts +0 -0
  106. /package/{interface → app/interface}/IPopupMenuButton.ts +0 -0
  107. /package/{interface → app/interface}/IStayRange.ts +0 -0
  108. /package/{interface → app/interface}/ITableField.ts +0 -0
  109. /package/{interface → app/interface}/IWeb.ts +0 -0
  110. /package/{interface → app/interface}/NavConfigType.ts +0 -0
  111. /package/{models → app/models}/DateRange.ts +0 -0
@@ -31,20 +31,15 @@ import { fromEvent, Subscription } from "rxjs";
31
31
  import { createPopper } from "@popperjs/core";
32
32
  import type { Instance as PopperInstance, Placement } from "@popperjs/core";
33
33
  import ExcelJS from "exceljs";
34
- import {
35
- downloadURL,
36
- downloadBlob,
37
- gaev,
38
- ga4ev,
39
- } from "~ui/utils";
40
- import type IDateRange from "~ui/interface/IDateRange";
34
+ import { downloadURL, downloadBlob, gaev, ga4ev } from "~ui/app/utils";
35
+ import type IDateRange from "~ui/app/interface/IDateRange";
41
36
 
42
37
  // http://www.excelcodex.com/2012/06/worksheets-naming-conventions/
43
38
  function safeSheetName(name: string) {
44
39
  return name.replace(/[\\/*?:[\]]/g, "").substring(0, 31);
45
40
  }
46
41
 
47
- const WatermarkImage = '/assets/images/commons/watermark-2.svg';
42
+ const WatermarkImage = "/assets/images/commons/watermark-2.svg";
48
43
 
49
44
  export default defineComponent({
50
45
  name: "SLDownloadButton",
@@ -93,7 +88,7 @@ export default defineComponent({
93
88
  },
94
89
  customStyle: {
95
90
  type: Object as PropType<Partial<CSSStyleDeclaration>>,
96
- default: () => { },
91
+ default: () => {},
97
92
  },
98
93
  evCategory: {
99
94
  type: String,
@@ -204,7 +199,7 @@ export default defineComponent({
204
199
  const workbook = new ExcelJS.Workbook();
205
200
  sheets.value.map((sheetData) => {
206
201
  const sheet = workbook.addWorksheet(
207
- sheetData?.sheetName ? safeSheetName(sheetData.sheetName) : ""
202
+ sheetData?.sheetName ? safeSheetName(sheetData.sheetName) : "",
208
203
  );
209
204
  (sheetData?.sheetData || []).forEach((rowData) => {
210
205
  sheet.addRow(rowData);
@@ -215,12 +210,20 @@ export default defineComponent({
215
210
  downloadBlob(
216
211
  buffer,
217
212
  `${fileName.value}.xlsx`,
218
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
213
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
219
214
  );
220
215
  return;
221
216
  }
222
217
 
223
- const dataURL = await domToPngDataUrl(imageTarget.value, customFilter.value, customStyle.value, padding.value, dateRanges.value, watermark.value, WatermarkImage);
218
+ const dataURL = await domToPngDataUrl(
219
+ imageTarget.value,
220
+ customFilter.value,
221
+ customStyle.value,
222
+ padding.value,
223
+ dateRanges.value,
224
+ watermark.value,
225
+ WatermarkImage,
226
+ );
224
227
  if (!dataURL) {
225
228
  console.log("Can not generate data URL!");
226
229
  return;
@@ -269,27 +272,34 @@ export default defineComponent({
269
272
  });
270
273
  </script>
271
274
 
272
- <style lang="stylus">
273
- .download-button
274
- @apply inline-block
275
+ <style>
276
+ @reference '~ui/app/assets/css/main.css';
275
277
 
276
- &.disabled
277
- .download-button-toggle
278
- @apply border-pgray-5 text-pgray-5 cursor-default
278
+ .download-button {
279
+ @apply inline-block;
280
+ }
281
+
282
+ .download-button.disabled .download-button-toggle {
283
+ @apply border-pgray-5 text-pgray-5 cursor-default;
284
+ }
279
285
 
280
- &-toggle
281
- @apply inline-flex justify-center items-center s('w-[28px]') s('h-[28px]') bg-white border border-primary-600 rounded text-lg text-primary-600
286
+ .download-button-toggle {
287
+ @apply inline-flex justify-center items-center w-[28px] h-[28px] bg-white border border-primary-600 rounded text-lg text-primary-600;
288
+ }
282
289
 
283
- &.active
284
- @apply bg-primary-600 text-white
290
+ .download-button-toggle.active {
291
+ @apply bg-primary-600 text-white;
292
+ }
285
293
 
286
- .download-button-popup
287
- @apply z-60 absolute flex flex-col bg-white border border-primary-500 rounded overflow-hidden shadow invisible pointer-events-none
294
+ .download-button-popup {
295
+ @apply z-60 absolute flex flex-col bg-white border border-primary-500 rounded overflow-hidden shadow-default invisible pointer-events-none;
296
+ }
288
297
 
289
- &[data-show]
290
- @apply visible pointer-events-auto
298
+ .download-button-popup[data-show] {
299
+ @apply visible pointer-events-auto;
300
+ }
291
301
 
292
- .download-option
293
- @apply block p-2 bg-white text-sm text-pgray-3
294
- @apply s('hover:bg-primary-100') s('hover:text-primary')
302
+ .download-button-popup .download-option {
303
+ @apply block p-2 bg-white text-sm text-pgray-3 hover:bg-primary-100 hover:text-primary;
304
+ }
295
305
  </style>
@@ -58,7 +58,7 @@ export default defineComponent({
58
58
  }
59
59
 
60
60
  const elIndex = Array.from(draggableEl.value.children).indexOf(
61
- dragEl
61
+ dragEl,
62
62
  );
63
63
 
64
64
  if (elIndex === -1) {
@@ -148,4 +148,4 @@ export default defineComponent({
148
148
  });
149
149
  </script>
150
150
 
151
- <style lang="stylus"></style>
151
+ <style></style>
@@ -178,7 +178,7 @@ export default defineComponent({
178
178
  }
179
179
  emit("update:showDropdown", visible.value);
180
180
  },
181
- { immediate: true }
181
+ { immediate: true },
182
182
  );
183
183
  watch(search, () => {
184
184
  emit("update:search", search.value);
@@ -240,38 +240,46 @@ export default defineComponent({
240
240
  });
241
241
  </script>
242
242
 
243
- <style lang="stylus">
244
- .dropdown
245
- @apply inline-block relative
243
+ <style>
244
+ @reference '~ui/app/assets/css/main.css';
246
245
 
247
- &.active
248
- .dropdown-toggle
246
+ .dropdown {
247
+ @apply inline-block relative;
248
+ }
249
249
 
250
- .toggle-icon
251
- @apply text-primary-600 rotate-180
250
+ .dropdown.active .dropdown-toggle .toggle-icon {
251
+ @apply text-primary-600 rotate-180;
252
+ }
252
253
 
253
- &-toggle
254
- @apply flex items-center s('p-1.75') border border-primary-500 rounded bg-white space-x-2 text-base text-pgray-2 whitespace-nowrap
254
+ .dropdown-toggle {
255
+ @apply flex items-center p-1.75 border border-primary-500 rounded bg-white space-x-2 text-base text-pgray-2 whitespace-nowrap;
256
+ }
255
257
 
256
- .toggle-icon
257
- @apply text-xs leading-none text-pgray-2 transition-transform transform
258
+ .dropdown-toggle .toggle-icon {
259
+ @apply text-xs leading-none text-pgray-2 transition-transform transform;
260
+ }
258
261
 
259
- &-menu
260
- @apply z-50 flex flex-col max-h-48 border border-primary-500 rounded bg-white shadow-md overflow-hidden invisible pointer-events-none
262
+ .dropdown-menu {
263
+ @apply z-50 flex flex-col max-h-48 border border-primary-500 rounded bg-white shadow-md overflow-hidden invisible pointer-events-none;
264
+ }
261
265
 
262
- &[data-show]
263
- @apply visible pointer-events-auto
266
+ .dropdown-menu[data-show] {
267
+ @apply visible pointer-events-auto;
268
+ }
264
269
 
265
- .dropdown-list-wrapper
266
- .dropdown-list
267
- @apply relative
270
+ .dropdown-menu[data-show] .dropdown-list-wrapper .dropdown-list {
271
+ @apply relative;
272
+ }
268
273
 
269
- .dropdown-search
270
- @apply flex-grow-0 flex-shrink-0 mb-1 p-1
274
+ .dropdown-menu .dropdown-search {
275
+ @apply grow-0 shrink-0 mb-1 p-1;
276
+ }
271
277
 
272
- .dropdown-list-wrapper
273
- @apply flex-grow
278
+ .dropdown-menu .dropdown-list-wrapper {
279
+ @apply grow;
280
+ }
274
281
 
275
- .dropdown-list
276
- @apply absolute
282
+ .dropdown-menu .dropdown-list-wrapper .dropdown-list {
283
+ @apply absolute;
284
+ }
277
285
  </style>
@@ -22,10 +22,14 @@ export default defineComponent({
22
22
  });
23
23
  </script>
24
24
 
25
- <style lang="stylus">
26
- .dropdown-item
27
- @apply block p-2 bg-white text-sm text-primary whitespace-nowrap s('hover:text-primary') s('hover:bg-primary-50') s('focus:text-primary') s('focus:bg-primary-50') s('active:text-primary') s('active:bg-primary-50')
25
+ <style>
26
+ @reference '~ui/app/assets/css/main.css';
28
27
 
29
- &.active
30
- @apply text-primary bg-primary-50
28
+ .dropdown-item {
29
+ @apply block p-2 bg-white text-sm text-primary whitespace-nowrap hover:text-primary hover:bg-primary-50 focus:text-primary focus:bg-primary-50 active:text-primary active:bg-primary-50;
30
+ }
31
+
32
+ .dropdown-item.active {
33
+ @apply text-primary bg-primary-50;
34
+ }
31
35
  </style>
@@ -169,13 +169,18 @@ export default defineComponent({
169
169
  });
170
170
  </script>
171
171
 
172
- <style lang="stylus">
173
- .element-with-title
174
- @apply inline-flex
172
+ <style>
173
+ @reference '~ui/app/assets/css/main.css';
175
174
 
176
- &-tooltip
177
- @apply s('z-[10]') p-2 s('bg-mask/70') rounded text-xs text-white whitespace-pre shadow invisible pointer-events-none
175
+ .element-with-title {
176
+ @apply inline-flex;
177
+ }
178
178
 
179
- &[data-show]
180
- @apply visible
179
+ .element-with-title-tooltip {
180
+ @apply z-10 p-2 bg-mask/70 rounded text-xs text-white whitespace-pre shadow-default invisible pointer-events-none;
181
+ }
182
+
183
+ .element-with-title-tooltip[data-show] {
184
+ @apply visible;
185
+ }
181
186
  </style>
@@ -18,7 +18,7 @@
18
18
 
19
19
  <script lang="ts">
20
20
  import { isEqual } from "lodash-es";
21
- import { getUID } from "~ui/utils";
21
+ import { getUID } from "~ui/app/utils";
22
22
 
23
23
  export default defineComponent({
24
24
  name: "SLEyeCheckbox",
@@ -99,7 +99,7 @@ export default defineComponent({
99
99
  } else {
100
100
  emit(
101
101
  "update:modelValue",
102
- isChecked ? trueValue.value : falseValue.value
102
+ isChecked ? trueValue.value : falseValue.value,
103
103
  );
104
104
  }
105
105
  }
@@ -118,45 +118,58 @@ export default defineComponent({
118
118
  });
119
119
  </script>
120
120
 
121
- <style lang="stylus">
122
- .eye-checkbox
123
- @apply inline-block relative text-base align-top overflow-hidden
121
+ <style>
122
+ @reference '~ui/app/assets/css/main.css';
124
123
 
125
- &.checkbox-sm
126
- @apply text-sm
124
+ .eye-checkbox {
125
+ @apply inline-block relative text-base align-top overflow-hidden;
126
+ }
127
127
 
128
- label
129
- @apply text-sm
128
+ .eye-checkbox.checkbox-sm {
129
+ @apply text-sm;
130
+ }
130
131
 
131
- input
132
- @apply absolute s('-top-10') s('-left-10')
132
+ .eye-checkbox.checkbox-sm label {
133
+ @apply text-sm;
134
+ }
133
135
 
134
- label
135
- @apply relative inline-flex items-center text-base text-pgray-2 cursor-pointer
136
+ .eye-checkbox input {
137
+ @apply absolute -top-10 -left-10;
138
+ }
136
139
 
137
- .icon
138
- @apply hidden text-primary
140
+ .eye-checkbox label {
141
+ @apply relative inline-flex items-center text-base text-pgray-2 cursor-pointer;
142
+ }
139
143
 
140
- span
141
- @apply ml-2
144
+ .eye-checkbox label .icon {
145
+ @apply hidden text-primary;
146
+ }
142
147
 
143
- input:checked + label
144
- .icon-eye
145
- @apply inline-block
148
+ .eye-checkbox label span {
149
+ @apply ml-2;
150
+ }
146
151
 
147
- input:not(:checked) + label
148
- .icon-eye-slash
149
- @apply inline-block
152
+ .eye-checkbox input:checked + label .icon-eye {
153
+ @apply inline-block;
154
+ }
150
155
 
151
- input:not(:checked):disabled + label
152
- @apply text-pgray-4 cursor-default
156
+ .eye-checkbox input:not(:checked) + label .icon-eye-slash {
157
+ @apply inline-block;
158
+ }
153
159
 
154
- .icon-eye-slash
155
- @apply inline-block text-pgray-4
160
+ .eye-checkbox input:not(:checked):disabled + label {
161
+ @apply text-pgray-4 cursor-default;
162
+ }
156
163
 
157
- input:checked:disabled + label
158
- @apply text-pgray-3 cursor-default
164
+ .eye-checkbox input:not(:checked):disabled + label .icon-eye-slash {
165
+ @apply inline-block text-pgray-4;
166
+ }
159
167
 
160
- .icon-eye
161
- @apply inline-block text-pgray-3
168
+ .eye-checkbox input:checked:disabled + label {
169
+ @apply text-pgray-3 cursor-default;
170
+ }
171
+
172
+ .eye-checkbox input:checked:disabled + label .icon-eye {
173
+ @apply inline-block text-pgray-3;
174
+ }
162
175
  </style>
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script lang="ts">
16
- import { getUID } from "~ui/utils";
16
+ import { getUID } from "~ui/app/utils";
17
17
 
18
18
  export default defineComponent({
19
19
  name: "SLFileInput",
@@ -78,24 +78,31 @@ export default defineComponent({
78
78
  });
79
79
  </script>
80
80
 
81
- <style lang="stylus">
82
- .custom-file-input
83
- @apply inline-flex items-center s('space-x-3.5')
81
+ <style>
82
+ @reference '~ui/app/assets/css/main.css';
83
+
84
+ .custom-file-input {
85
+ @apply inline-flex items-center space-x-3.5;
86
+ }
84
87
 
85
- .file-button
86
- @apply relative overflow-hidden
88
+ .custom-file-input .file-button {
89
+ @apply relative overflow-hidden;
90
+ }
87
91
 
88
- &.uploaded
89
- label
90
- @apply bg-white border text-primary s("hover:text-primary-600") s("hover:bg-white")
92
+ .custom-file-input .file-button.uploaded label {
93
+ @apply bg-white border text-primary hover:text-primary-600 hover:bg-white;
94
+ }
91
95
 
92
- label
93
- @apply relative inline-block s("py-1.75") s("px-3.75") border border-transparent rounded bg-transparent text-base leading-normal space-x-2 cursor-pointer s("focus:outline-none")
94
- @apply bg-primary border-primary text-white s("hover:bg-primary-600") s("hover:border-primary-600")
96
+ .custom-file-input .file-button label {
97
+ @apply relative inline-block py-1.75 px-3.75 border border-transparent rounded bg-transparent text-base leading-[1.3125] space-x-2 cursor-pointer focus:outline-none;
98
+ @apply bg-primary border-primary text-white hover:bg-primary-600 hover:border-primary-600;
99
+ }
95
100
 
96
- input[type="file"]
97
- @apply absolute top-0 left-0
101
+ .custom-file-input .file-button input[type="file"] {
102
+ @apply absolute top-0 left-0;
103
+ }
98
104
 
99
- .filename
100
- @apply s("p-1.75") border border-primary-300 rounded bg-primary-50 text-base text-pgray-2
105
+ .custom-file-input .filename {
106
+ @apply p-1.75 border border-primary-300 rounded bg-primary-50 text-base text-pgray-2;
107
+ }
101
108
  </style>
@@ -42,7 +42,7 @@ import type { PropType } from "vue";
42
42
  import { fromEvent, Subscription } from "rxjs";
43
43
  import { createPopper } from "@popperjs/core";
44
44
  import type { Instance as PopperInstance } from "@popperjs/core";
45
- import { AGE_RANGE_NAME } from "~ui/utils/constants";
45
+ import { AGE_RANGE_NAME } from "~ui/app/utils/constants";
46
46
 
47
47
  export default defineComponent({
48
48
  name: "SLGenderAgeSelect",
@@ -92,7 +92,7 @@ export default defineComponent({
92
92
  AGE_RANGE_NAME.map((name, i) => ({
93
93
  label: name,
94
94
  value: i + 1,
95
- }))
95
+ })),
96
96
  );
97
97
  const genderProxy = computed({
98
98
  get: () => {
@@ -234,50 +234,66 @@ export default defineComponent({
234
234
  });
235
235
  </script>
236
236
 
237
- <style lang="stylus">
238
- .gender-age-select
239
- @apply relative inline-flex
237
+ <style>
238
+ @reference '~ui/app/assets/css/main.css';
240
239
 
241
- .toggle-button
242
- @apply inline-flex items-center justify-between w-full s('p-1.75') border border-primary-500 rounded space-x-4 text-sm text-pgray-2
240
+ .gender-age-select {
241
+ @apply relative inline-flex;
242
+ }
243
243
 
244
- .toggle-title
245
- @apply flex-grow truncate
244
+ .gender-age-select .toggle-button {
245
+ @apply inline-flex items-center justify-between w-full p-1.75 border border-primary-500 rounded space-x-4 text-sm text-pgray-2;
246
+ }
246
247
 
247
- .icon
248
- @apply flex-grow-0 flex-shrink-0 text-xs leading-none
248
+ .gender-age-select .toggle-button .toggle-title {
249
+ @apply grow truncate;
250
+ }
249
251
 
250
- .options-popup
251
- @apply z-60 absolute flex s('max-h-[196px]') s('p-2.75') bg-white border border-primary-500 rounded shadow pointer-events-none invisible
252
+ .gender-age-select .toggle-button .icon {
253
+ @apply grow-0 shrink-0 text-xs leading-none;
254
+ }
252
255
 
253
- &[data-show]
254
- @apply pointer-events-auto visible
256
+ .options-popup {
257
+ @apply z-60 absolute flex max-h-[196px] p-2.75 bg-white border border-primary-500 rounded shadow-default pointer-events-none invisible;
258
+ }
255
259
 
256
- .options-block
257
- @apply flex flex-col
258
- &-gender
259
- @apply flex-grow-0 flex-shrink-0
260
- width 37%
260
+ .options-popup[data-show] {
261
+ @apply pointer-events-auto visible;
262
+ }
261
263
 
262
- &-age
263
- @apply flex-grow
264
+ .options-popup .options-block {
265
+ @apply flex flex-col;
266
+ }
264
267
 
265
- &-header
266
- @apply s('pb-1.75') border-b border-primary text-base text-primary
268
+ .options-popup .options-block-gender {
269
+ @apply grow-0 shrink-0 w-[37%];
270
+ }
267
271
 
268
- &-body
269
- @apply overflow-hidden
270
- .options-list
271
- @apply flex flex-col
272
+ .options-popup .options-block-age {
273
+ @apply grow;
274
+ }
272
275
 
273
- .checkbox
274
- label
275
- @apply w-full s('py-1.5') px-2 text-sm
276
- @apply s('hover:bg-primary-100')
276
+ .options-popup .options-block-header {
277
+ @apply pb-1.75 border-b border-primary text-base text-primary;
278
+ }
277
279
 
278
- span
279
- @apply ml-1
280
+ .options-popup .options-block-body {
281
+ @apply overflow-hidden;
282
+ }
280
283
 
281
- .options-divide
282
- @apply flex-grow-0 flex-shrink-0 w-px ml-3 s('mr-2.75') bg-pgray-4
284
+ .options-popup .options-block-body .options-list {
285
+ @apply flex flex-col;
286
+ }
287
+
288
+ .options-popup .options-block-body .options-list .checkbox label {
289
+ @apply w-full py-1.5 px-2 text-sm hover:bg-primary-100;
290
+ }
291
+
292
+ .options-popup .options-block-body .options-list .checkbox label span {
293
+ @apply ml-1;
294
+ }
295
+
296
+ .options-popup .options-divide {
297
+ @apply grow-0 shrink-0 w-px ml-3 mr-2.75 bg-pgray-4;
298
+ }
283
299
  </style>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <script lang="ts">
35
35
  import type { PropType } from "vue";
36
- import type IHourRange from "~ui/interface/IHourRange";
36
+ import type IHourRange from "~ui/app/interface/IHourRange";
37
37
 
38
38
  export default defineComponent({
39
39
  name: "SLHourRangeInput",
@@ -72,12 +72,12 @@ export default defineComponent({
72
72
  const startHour = ref(
73
73
  modelValue.value && modelValue.value.start !== null
74
74
  ? modelValue.value.start
75
- : ""
75
+ : "",
76
76
  );
77
77
  const endHour = ref(
78
78
  modelValue.value && modelValue.value.end !== null
79
79
  ? modelValue.value.end
80
- : ""
80
+ : "",
81
81
  );
82
82
  const isStartHourInvalid = ref(false);
83
83
  const isEndHourInvalid = ref(false);
@@ -166,46 +166,59 @@ export default defineComponent({
166
166
  });
167
167
  </script>
168
168
 
169
- <style lang="stylus">
170
- .hour-range-input
171
- &.inline
172
- @apply flex
169
+ <style>
170
+ @reference '~ui/app/assets/css/main.css';
173
171
 
174
- & > label
175
- @apply flex-grow-0 flex-shrink-0 mb-0 mr-2 py-2 border-t border-b border-transparent
172
+ .hour-range-input.inline {
173
+ @apply flex;
174
+ }
176
175
 
177
- .form-control
178
- @apply flex-grow
176
+ .hour-range-input.inline > label {
177
+ @apply grow-0 shrink-0 mb-0 mr-2 py-2 border-t border-b border-transparent;
178
+ }
179
179
 
180
- &.disabled, &.readonly
181
- .input-group
182
- @apply border-primary-500 bg-primary-100
180
+ .hour-range-input.inline .form-control {
181
+ @apply grow;
182
+ }
183
183
 
184
+ .hour-range-input.disabled .input-group,
185
+ .hour-range-input.readonly .input-group {
186
+ @apply border-primary-500 bg-primary-100;
187
+ }
184
188
 
185
- & > label
186
- @apply flex items-center mb-2 space-x-2 text-base leading-normal text-pgray-2
189
+ .hour-range-input > label {
190
+ @apply flex items-center mb-2 space-x-2 text-base leading-[1.3125] text-pgray-2;
191
+ }
187
192
 
188
- .icon
189
- @apply text-xs leading-none
193
+ .hour-range-input > label .icon {
194
+ @apply text-xs leading-none;
195
+ }
190
196
 
191
- .form-control
192
- @apply flex items-center space-x-2
197
+ .hour-range-input .form-control {
198
+ @apply flex items-center space-x-2;
199
+ }
193
200
 
194
- .input-group
195
- @apply flex items-center flex-nowrap p-2 bg-white border border-primary-500 rounded text-base space-x-1
201
+ .hour-range-input .input-group {
202
+ @apply flex items-center flex-nowrap p-2 bg-white border border-primary-500 rounded text-base space-x-1;
203
+ }
196
204
 
197
- &.invalid
198
- @apply border-danger
205
+ .hour-range-input .input-group.invalid {
206
+ @apply border-danger;
207
+ }
199
208
 
200
- input[type=text]
201
- @apply flex-grow-0 flex-shrink-0 s('w-4.75') border-0 bg-transparent text-base text-center text-pgray-2 outline-none
209
+ .hour-range-input .input-group input[type="text"] {
210
+ @apply grow-0 shrink-0 w-4.75 border-0 bg-transparent text-base text-center text-pgray-2 outline-none;
211
+ }
202
212
 
203
- .minutes-label
204
- @apply flex-grow-0 flex-shrink-0
213
+ .hour-range-input .input-group .minutes-label {
214
+ @apply grow-0 shrink-0;
215
+ }
205
216
 
206
- .input-group-splitter
207
- @apply w-4 h-px bg-primary
217
+ .hour-range-input .input-group-splitter {
218
+ @apply w-4 h-px bg-primary;
219
+ }
208
220
 
209
- .invalid-feedback
210
- @apply mt-1 text-danger text-xs
221
+ .hour-range-input .invalid-feedback {
222
+ @apply mt-1 text-danger text-xs;
223
+ }
211
224
  </style>