@wodecorp/openui-vue-intelligent-ui-library 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2373,6 +2373,7 @@ const SegmentedControlImpl = defineComponent({
2373
2373
  class: "openui-intelligent-segmented",
2374
2374
  style: {
2375
2375
  display: p.props.block ? "flex" : "inline-flex",
2376
+ flexShrink: 0,
2376
2377
  width: p.props.block ? "100%" : void 0,
2377
2378
  padding: "3px",
2378
2379
  gap: "2px",
@@ -2389,11 +2390,12 @@ const SegmentedControlImpl = defineComponent({
2389
2390
  "aria-selected": active,
2390
2391
  disabled: streaming.value,
2391
2392
  style: {
2392
- flex: p.props.block ? "1 1 0%" : void 0,
2393
+ flex: p.props.block ? "1 1 0%" : "0 0 auto",
2393
2394
  padding: "6px 12px",
2394
2395
  fontSize: "13px",
2395
2396
  fontWeight: active ? 600 : 500,
2396
2397
  fontFamily: tokens.font,
2398
+ whiteSpace: "nowrap",
2397
2399
  borderRadius: tokens.radiusSm,
2398
2400
  border: "none",
2399
2401
  cursor: streaming.value ? "not-allowed" : "pointer",
@@ -2445,20 +2447,28 @@ const SelectImpl = defineComponent({
2445
2447
  label: p.props.label ? str(p.props.label) : void 0,
2446
2448
  required: rules.required.value,
2447
2449
  error: rules.error.value,
2448
- control: h("select", {
2450
+ control: h("div", { style: {
2451
+ position: "relative",
2452
+ display: "flex",
2453
+ alignItems: "center",
2454
+ width: "100%"
2455
+ } }, [h("select", {
2449
2456
  value: current,
2450
2457
  disabled: streaming.value,
2451
2458
  class: "openui-intelligent-select",
2452
2459
  style: {
2460
+ appearance: "none",
2461
+ WebkitAppearance: "none",
2453
2462
  width: "100%",
2454
- padding: "8px 10px",
2463
+ padding: "8px 32px 8px 10px",
2455
2464
  fontSize: "14px",
2456
2465
  fontFamily: tokens.font,
2457
2466
  color: tokens.ink,
2458
2467
  background: tokens.canvas,
2459
2468
  border: `1px solid ${rules.error.value ? tokens.danger : tokens.borderStrong}`,
2460
2469
  borderRadius: tokens.radiusMd,
2461
- boxSizing: "border-box"
2470
+ boxSizing: "border-box",
2471
+ cursor: streaming.value ? "not-allowed" : "pointer"
2462
2472
  },
2463
2473
  onChange: (e) => {
2464
2474
  rules.clear();
@@ -2471,7 +2481,25 @@ const SelectImpl = defineComponent({
2471
2481
  }, str(p.props.placeholder)) : null, ...opts.map((opt) => h("option", {
2472
2482
  key: opt.value,
2473
2483
  value: opt.value
2474
- }, opt.label))])
2484
+ }, opt.label))]), h("svg", {
2485
+ width: "14",
2486
+ height: "14",
2487
+ viewBox: "0 0 12 12",
2488
+ fill: "none",
2489
+ "aria-hidden": "true",
2490
+ style: {
2491
+ position: "absolute",
2492
+ right: "10px",
2493
+ pointerEvents: "none",
2494
+ color: tokens.muted
2495
+ }
2496
+ }, [h("path", {
2497
+ d: "M3 4.5L6 7.5L9 4.5",
2498
+ stroke: "currentColor",
2499
+ "stroke-width": "1.5",
2500
+ "stroke-linecap": "round",
2501
+ "stroke-linejoin": "round"
2502
+ })])])
2475
2503
  });
2476
2504
  };
2477
2505
  }
@@ -3145,6 +3173,7 @@ const TimerImpl = defineComponent({
3145
3173
  onBeforeUnmount(stop);
3146
3174
  return () => {
3147
3175
  const secs = typeof field.value === "number" ? field.value : Number(field.value ?? 0);
3176
+ const isZh = typeof document !== "undefined" && document.documentElement.lang.toLowerCase().startsWith("zh");
3148
3177
  return h("div", {
3149
3178
  class: "openui-intelligent-timer",
3150
3179
  style: {
@@ -3171,7 +3200,8 @@ const TimerImpl = defineComponent({
3171
3200
  color: tokens.ink
3172
3201
  } }, formatClock(secs))]), h("div", { style: {
3173
3202
  display: "flex",
3174
- gap: "8px"
3203
+ gap: "8px",
3204
+ flexShrink: 0
3175
3205
  } }, [h("button", {
3176
3206
  type: "button",
3177
3207
  disabled: streaming.value || !running.value && secs <= 0,
@@ -3183,9 +3213,10 @@ const TimerImpl = defineComponent({
3183
3213
  background: tokens.ink,
3184
3214
  color: tokens.onInk,
3185
3215
  fontSize: "13px",
3216
+ whiteSpace: "nowrap",
3186
3217
  cursor: "pointer"
3187
3218
  }
3188
- }, running.value ? "Pause" : "Start"), h("button", {
3219
+ }, running.value ? isZh ? "暂停" : "Pause" : isZh ? "开始" : "Start"), h("button", {
3189
3220
  type: "button",
3190
3221
  disabled: streaming.value,
3191
3222
  onClick: reset,
@@ -3196,9 +3227,10 @@ const TimerImpl = defineComponent({
3196
3227
  background: tokens.canvas,
3197
3228
  color: tokens.ink,
3198
3229
  fontSize: "13px",
3230
+ whiteSpace: "nowrap",
3199
3231
  cursor: "pointer"
3200
3232
  }
3201
- }, "Reset")])]);
3233
+ }, isZh ? "重置" : "Reset")])]);
3202
3234
  };
3203
3235
  }
3204
3236
  });