hy-dispatch-ui-v3 0.2.87 → 0.2.89

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 (39) hide show
  1. package/dist/tailwind.css +180 -0
  2. package/es/api/file.mjs +14 -1
  3. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -469
  4. package/es/components/hyAudioPlayer/audioPlayer2.vue.mjs +1321 -0
  5. package/es/components/hyAudioPlayer/hyAudioPlayer/audioPlayer.vue.mjs +472 -0
  6. package/es/components/hyAudioPlayer/{js → hyAudioPlayer/js}/index.mjs +5 -5
  7. package/es/components/hyAudioPlayer/index.mjs +2 -2
  8. package/es/components/hyAudioPlayer/locale/en_US.mjs +18 -0
  9. package/es/components/hyAudioPlayer/locale/index.mjs +2 -0
  10. package/es/components/hyAudioPlayer/locale/zh_CN.mjs +18 -0
  11. package/es/components/hyCheckboxGroup/checkboxGroup.vue.mjs +9 -7
  12. package/es/components/hyForm/cpns/formItem.vue.mjs +2 -0
  13. package/es/components/hyRadioGroup/radioGroup.vue.mjs +95 -49
  14. package/es/components/hyTable/table.vue.mjs +3 -3
  15. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +2 -2
  16. package/es/components/hyVideoPlayer/videoPlayer2.vue.mjs +734 -434
  17. package/es/static/hy-svg-icons/hy-icon-ops-audio-reduce.js +10 -0
  18. package/es/utils/timeUtils.mjs +8 -29
  19. package/es/version.mjs +1 -1
  20. package/lib/api/file.js +14 -0
  21. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +5 -469
  22. package/lib/components/hyAudioPlayer/audioPlayer2.vue.js +1325 -0
  23. package/lib/components/hyAudioPlayer/hyAudioPlayer/audioPlayer.vue.js +476 -0
  24. package/lib/components/hyAudioPlayer/{js → hyAudioPlayer/js}/index.js +5 -5
  25. package/lib/components/hyAudioPlayer/locale/en_US.js +22 -0
  26. package/lib/components/hyAudioPlayer/locale/index.js +9 -0
  27. package/lib/components/hyAudioPlayer/locale/zh_CN.js +22 -0
  28. package/lib/components/hyCheckboxGroup/checkboxGroup.vue.js +11 -9
  29. package/lib/components/hyForm/cpns/formItem.vue.js +2 -0
  30. package/lib/components/hyRadioGroup/radioGroup.vue.js +94 -48
  31. package/lib/components/hyTable/table.vue.js +2 -2
  32. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +2 -2
  33. package/lib/components/hyVideoPlayer/videoPlayer2.vue.js +732 -432
  34. package/lib/static/hy-svg-icons/hy-icon-ops-audio-reduce.js +10 -0
  35. package/lib/utils/timeUtils.js +8 -29
  36. package/lib/version.js +1 -1
  37. package/package.json +1 -1
  38. /package/es/components/hyAudioPlayer/{style → hyAudioPlayer/style}/audioPlayer.scss +0 -0
  39. /package/lib/components/hyAudioPlayer/{style → hyAudioPlayer/style}/audioPlayer.scss +0 -0
@@ -1,4 +1,6 @@
1
- import { defineComponent, useModel, useTemplateRef, ref, computed, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, normalizeStyle, createCommentVNode, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, useTemplateRef, ref, computed, nextTick, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, renderSlot, createVNode, unref, withDirectives, vShow, mergeModels } from 'vue';
2
+ import '../index.mjs';
3
+ import { HyTooltip } from '../hyTooltip/index.mjs';
2
4
 
3
5
  import "./style/radioGroup.scss";
4
6
 
@@ -22,6 +24,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
22
24
  disabled: {
23
25
  type: Boolean,
24
26
  default: false
27
+ },
28
+ /**
29
+ * 是否撑满父容器宽度
30
+ * true:组件宽度占满父级,每一项平均分配宽度
31
+ * false:组件宽度由内容撑开,每一项宽度为自身内容宽度
32
+ */
33
+ fullWidth: {
34
+ type: Boolean,
35
+ default: true
25
36
  }
26
37
  }, {
27
38
  "modelValue": {
@@ -35,8 +46,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
35
46
  const props = __props;
36
47
  const emits = __emit;
37
48
  const modelValue = useModel(__props, "modelValue");
49
+ const containerRef = useTemplateRef("containerRef");
38
50
  const sliderRef = useTemplateRef("sliderRef");
39
51
  const selectIndex = ref(0);
52
+ const sliderReady = ref(false);
40
53
  const radioProps = computed(() => {
41
54
  return {
42
55
  value: "value",
@@ -52,17 +65,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
52
65
  modelValue.value = value;
53
66
  emits("change", value);
54
67
  }
68
+ function updateSlider() {
69
+ const slider = sliderRef.value;
70
+ const container = containerRef.value;
71
+ if (!slider || !container || selectIndex.value < 0) return;
72
+ const items = container.querySelectorAll("[data-radio-item]");
73
+ const target = items[selectIndex.value];
74
+ if (!target) return;
75
+ slider.style.left = `${target.offsetLeft}px`;
76
+ slider.style.width = `${target.offsetWidth}px`;
77
+ sliderReady.value = true;
78
+ }
55
79
  async function sliderHandler() {
56
80
  selectIndex.value = props.options.findIndex((item) => {
57
81
  return item[radioProps.value.value] === modelValue.value;
58
82
  });
59
83
  await nextTick();
60
- const slider = sliderRef.value;
61
- if (slider) {
62
- const proportion = 100 / props.options.length;
63
- const left = selectIndex.value > 0 ? selectIndex.value * proportion : 0;
64
- slider.style.left = `${left}%`;
65
- }
84
+ updateSlider();
66
85
  }
67
86
  watch(
68
87
  () => [modelValue.value, props.options],
@@ -71,6 +90,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
71
90
  },
72
91
  { immediate: true }
73
92
  );
93
+ let resizeObserver = null;
94
+ onMounted(() => {
95
+ if (typeof ResizeObserver === "undefined" || !containerRef.value) return;
96
+ resizeObserver = new ResizeObserver(() => updateSlider());
97
+ resizeObserver.observe(containerRef.value);
98
+ });
99
+ onBeforeUnmount(() => {
100
+ resizeObserver?.disconnect();
101
+ resizeObserver = null;
102
+ });
74
103
  __expose({});
75
104
  return (_ctx, _cache) => {
76
105
  return openBlock(), createElementBlock(
@@ -78,51 +107,68 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
78
107
  {
79
108
  class: normalizeClass(["hy-radio-group", [
80
109
  __props.size === "large" ? "h-[40px]" : __props.size === "small" ? "h-[30px]" : "h-[34px]",
81
- __props.size === "small" ? "text-xs" : "text-sm"
110
+ __props.size === "small" ? "text-xs" : "text-sm",
111
+ { "w-fit": !__props.fullWidth }
82
112
  ]])
83
113
  },
84
114
  [
85
- createElementVNode("div", { class: "w-full h-full inline-flex box-border relative" }, [
86
- (openBlock(true), createElementBlock(
87
- Fragment,
88
- null,
89
- renderList(__props.options, (item, index) => {
90
- return openBlock(), createElementBlock("div", {
91
- key: index,
92
- class: normalizeClass(["w-0 flex-1 h-full flex items-center justify-center text-main whitespace-nowrap user-select-none relative z-[2]", [
93
- item[radioProps.value.disabled] || __props.disabled ? "cursor-not-allowed opacity-90" : "cursor-pointer"
94
- ]]),
95
- onClick: ($event) => switchSelect(item, index, $event)
96
- }, [
97
- renderSlot(_ctx.$slots, "default", {
98
- item,
99
- index
100
- }, () => [
101
- createTextVNode(
102
- toDisplayString(item[radioProps.value.label]),
103
- 1
104
- /* TEXT */
105
- )
106
- ])
107
- ], 10, ["onClick"]);
108
- }),
109
- 128
110
- /* KEYED_FRAGMENT */
111
- )),
112
- selectIndex.value >= 0 ? (openBlock(), createElementBlock(
113
- "div",
114
- {
115
- key: 0,
116
- ref_key: "sliderRef",
117
- ref: sliderRef,
118
- class: "slider rounded-[2px] box-border absolute h-full top-0 left-0 z-0 duration-500 border border-theme",
119
- style: normalizeStyle([{ width: `calc(100% / ${__props.options.length})` }, { "background": "linear-gradient(180deg, #2a4968 0%, #0ea0bb 100%)" }])
120
- },
121
- null,
122
- 4
123
- /* STYLE */
124
- )) : createCommentVNode("v-if", true)
125
- ])
115
+ createElementVNode(
116
+ "div",
117
+ {
118
+ ref_key: "containerRef",
119
+ ref: containerRef,
120
+ class: normalizeClass(["h-full inline-flex box-border relative", { "w-full": __props.fullWidth }])
121
+ },
122
+ [
123
+ (openBlock(true), createElementBlock(
124
+ Fragment,
125
+ null,
126
+ renderList(__props.options, (item, index) => {
127
+ return openBlock(), createElementBlock("div", {
128
+ key: index,
129
+ "data-radio-item": "",
130
+ class: normalizeClass(["h-full flex items-center justify-center text-main whitespace-nowrap user-select-none relative px-3 z-[2]", [
131
+ __props.fullWidth ? "w-0 flex-1" : "w-auto",
132
+ item[radioProps.value.disabled] || __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
133
+ ]]),
134
+ onClick: ($event) => switchSelect(item)
135
+ }, [
136
+ renderSlot(_ctx.$slots, "default", {
137
+ item,
138
+ index
139
+ }, () => [
140
+ createVNode(unref(HyTooltip), {
141
+ "is-always": false,
142
+ "over-line": 1,
143
+ content: item[radioProps.value.label]
144
+ }, null, 8, ["content"])
145
+ ])
146
+ ], 10, ["onClick"]);
147
+ }),
148
+ 128
149
+ /* KEYED_FRAGMENT */
150
+ )),
151
+ withDirectives(createElementVNode(
152
+ "div",
153
+ {
154
+ ref_key: "sliderRef",
155
+ ref: sliderRef,
156
+ class: normalizeClass(["slider rounded-[2px] box-border absolute h-full top-0 left-0 z-0 duration-500 border border-theme", {
157
+ "opacity-0": !sliderReady.value,
158
+ "opacity-80": __props.disabled
159
+ }]),
160
+ style: { "background": "linear-gradient(180deg, #2a4968 0%, #0ea0bb 100%)" }
161
+ },
162
+ null,
163
+ 2
164
+ /* CLASS */
165
+ ), [
166
+ [vShow, selectIndex.value >= 0]
167
+ ])
168
+ ],
169
+ 2
170
+ /* CLASS */
171
+ )
126
172
  ],
127
173
  2
128
174
  /* CLASS */
@@ -1,4 +1,4 @@
1
- import { defineComponent, useModel, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, toDisplayString, withCtx, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers, normalizeStyle, isRef, createTextVNode, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, toDisplayString, renderSlot, withCtx, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers, normalizeStyle, isRef, createTextVNode, mergeModels } from 'vue';
2
2
  import { ElTable, ElTableColumn, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElAutoResizer, ElPagination } from 'element-plus';
3
3
  import { MoreFilled } from '@element-plus/icons-vue';
4
4
  import '../index.mjs';
@@ -344,6 +344,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
344
344
  /* TEXT */
345
345
  )
346
346
  ])) : createCommentVNode("v-if", true),
347
+ renderSlot(_ctx.$slots, "operator-right-box"),
347
348
  unref(searchPlaceholder) ? (openBlock(), createBlock(unref(HyTooltip), {
348
349
  key: 2,
349
350
  "is-always": "",
@@ -378,8 +379,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
378
379
  ]),
379
380
  _: 1
380
381
  /* STABLE */
381
- }, 8, ["onClick"])),
382
- renderSlot(_ctx.$slots, "operator-right-box")
382
+ }, 8, ["onClick"]))
383
383
  ]),
384
384
  _ctx.$slots["operator-left-box"] ? (openBlock(), createElementBlock("div", {
385
385
  key: 0,
@@ -1,8 +1,8 @@
1
1
  import _sfc_main from './videoPlayer2.vue.mjs';
2
2
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
3
3
 
4
- import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/components/hyVideoPlayer/videoPlayer.vue?vue&type=style&index=0&scoped=8645e10e&lang.scss";
4
+ import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/components/hyVideoPlayer/videoPlayer.vue?vue&type=style&index=0&scoped=96c2e90a&lang.scss";
5
5
 
6
- var componnet = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8645e10e"]]);
6
+ var componnet = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-96c2e90a"]]);
7
7
 
8
8
  export { componnet as default };